// For vim users, don't remove: vim:ts=4:sw=4:cindent /* ============================================================================================= * * This file is part of The Dark Mod's Main Menu GUI * * Mission Authors: DO NOT EDIT, INCLUDE OR OVERRIDE THIS FILE IN YOUR MISSION PK4. * * ============================================================================================= */ windowDef ObjectivesMenu { rect 0,0,640,640 visible 0 windowDef ObjectivesMenuParchment { rect ("gui::ingame" ? 0 : 50), -75, 640, 640 matcolor 1,1,1,1 background "guis/assets/objectives/parchment_untitled" } // This is called whenever the user switches to this screen windowDef ObjectivesStateInit { noTime 1 // Init methods have onTime 10 instead of onTime 0. onTime 10 { set "cmd" "log 'ObjectivesStateInit called.'"; set "gui::ObjStartIdx" "0"; // Show our parent windowDef set "ObjectivesMenu::visible" "1"; // stgatilov: background layers must never be enabled/disabled manually! // unfortunately, we have to leave this hack here for compatibility with old missions: // They override mainmenu_briefing.gui, which enables the figures in End code =( set "MainMenuBackgroundFigures::visible" "0"; // Issue the open request to the SDK set "cmd" "log 'Issuing objective_open_request call.'"; set "cmd" "objective_open_request"; set "notime" 1; } } // Called when the MainMenuModeSelect script switches states. windowDef ObjectivesStateEnd { noTime 1 onTime 0 { set "cmd" "log 'ObjectivesStateEnd called.'"; set "ObjectivesMenu::visible" "0"; set "notime" "1"; } } /*************************************************************************** * * Actual objectives * **************************************************************************/ windowDef ObjectivesHolder { #define OBJ_OFFSET_X ("gui::ingame" ? 110 : 160) #define OBJ_FULL_WIDTH 460 #define OBJ_FULL_HEIGHT 355 rect OBJ_OFFSET_X, 60, OBJ_FULL_WIDTH, OBJ_FULL_HEIGHT //backcolor 0.2,0.5,1.0,1 //for debugging #include "guis/tdm_objectives_core.gui" } /*************************************************************************** * * The Difficulty selection buttons (only visible in start game) * **************************************************************************/ windowDef DifficultySelection { rect 0,0,640,640 visible "gui::DifficultyIsVisible" notime 1 windowDef Difficulty0 { rect 12,80,123,62 forecolor 1,1,1,1 text "gui::diff0Name" textscale 0.36 textalign 0 font "fonts/carleton" notime 1 onTime 0 { if ("gui::diffSelect" == 0) { set "forecolor" "1,1,1,1"; } } onAction { set "Difficulty1::forecolor" "0.6,0.6,0.6,0.7"; set "Difficulty2::forecolor" "0.6,0.6,0.6,0.7"; set "forecolor" "1,1,1,1"; set "gui::diffSelect" "0"; set "cmd" "log 'Selected difficulty level 0.'"; set "cmd" "play sound/meta/menu/mnu_select; diffSelect"; } onMouseEnter { if ("gui::diffSelect" != 0) { transition "forecolor" "0.6,0.6,0.6,0.7" "1,1,1,0.9" "50" ; set "cmd" "play sound/meta/menu/mnu_hover;"; } } onMouseExit { if ("gui::diffSelect" != 0) { transition "forecolor" "1,1,1,0.9" "0.6,0.6,0.6,0.7" "50" ; } } } windowDef Difficulty1 { rect 12,208,123,62 forecolor 0.6,0.6,0.6,0.7 text "gui::diff1Name" textscale 0.36 textalign 0 font "fonts/carleton" notime 1 onTime 0 { if ("gui::diffSelect" == 1) { set "forecolor" "1,1,1,1"; } } onAction { set "Difficulty0::forecolor" "0.6,0.6,0.6,0.7"; set "Difficulty2::forecolor" "0.6,0.6,0.6,0.7"; set "forecolor" "1,1,1,1"; set "gui::diffSelect" "1"; set "cmd" "log 'Selected difficulty level 1.'"; set "cmd" "play sound/meta/menu/mnu_select; diffSelect"; } onMouseEnter { if ("gui::diffSelect" != 1) { transition "forecolor" "0.6,0.6,0.6,0.7" "1,1,1,0.9" "50" ; set "cmd" "play sound/meta/menu/mnu_hover;"; } } onMouseExit { if ("gui::diffSelect" != 1) { transition "forecolor" "1,1,1,0.9" "0.6,0.6,0.6,0.7" "50" ; } } } windowDef Difficulty2 { rect 12,336,123,62 forecolor 0.6,0.6,0.6,0.7 text "gui::diff2Name" textscale 0.36 textalign 0 font "fonts/carleton" notime 1 onTime 0 { if ("gui::diffSelect" == 2) { set "forecolor" "1,1,1,1"; } } onAction { set "Difficulty0::forecolor" "0.6,0.6,0.6,0.7"; set "Difficulty1::forecolor" "0.6,0.6,0.6,0.7"; set "forecolor" "1,1,1,1"; set "gui::diffSelect" "2"; set "cmd" "log 'Selected difficulty level 2.'"; set "cmd" "play sound/meta/menu/mnu_select; diffSelect"; } onMouseEnter { if ("gui::diffSelect" != 2) { transition "forecolor" "0.6,0.6,0.6,0.7" "1,1,1,0.9" "50" ; set "cmd" "play sound/meta/menu/mnu_hover;"; } } onMouseExit { if ("gui::diffSelect" != 2) { transition "forecolor" "1,1,1,0.9" "0.6,0.6,0.6,0.7" "50" ; } } } } /*************************************************************************** * * The "Resume Game" Button (only visible in-game) * **************************************************************************/ windowDef ObjectivesResumeButtonH { MM_POS_OBJ_FORWARD_BUTTON_GLOW MM_FONT_RIGHT_GLOW MM_BUTTON_HUGE text "#str_02102" // Resume Mission visible ("gui::inGame" == 1) } windowDef ObjectivesResumeButton { MM_POS_OBJ_FORWARD_BUTTON MM_FONT_RIGHT MM_BUTTON_HUGE forecolor GLOW_WHITE_COLOR text "#str_02102" // Resume Mission visible ("gui::inGame" == 1) } windowDef ObjectivesResumeButtonAction { MM_POS_OBJ_FORWARD_ACTION visible ("gui::inGame" == 1) onMouseEnter { transition "ObjectivesResumeButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ; transition "ObjectivesResumeButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ; set "cmd" "play sound/meta/menu/mnu_hover;"; } onMouseExit { transition "ObjectivesResumeButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ; transition "ObjectivesResumeButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ; } onAction { // The "objective_close_request" will be caught by the SDK code and shut down this GUI set "cmd" "play sound/meta/menu/mnu_select;"; resetTime "ObjectivesDelayedCloseRequest" 0; } } // Sends an objective close request after a short delay windowDef ObjectivesDelayedCloseRequest { rect 0,0,0,0 notime 1 onTime 400 { set "cmd" "close"; set "notime" 1; } } // Called by the SDK when displaying the objectives in the pre-mission menu onNamedEvent ObjMenuShowDifficultyOptions { // Display the Difficulty choices set "gui::DifficultyIsVisible" "1"; // Hide the objective checkboxes set "gui::ObjectiveBoxIsVisible" "0"; } // Called by the SDK when displaying the objectives in-game onNamedEvent ObjMenuHideDifficultyOptions { // Hide the Difficulty choices set "gui::DifficultyIsVisible" "0"; // Display the objective checkboxes set "gui::ObjectiveBoxIsVisible" "1"; } /*************************************************************************** * * The "Main Menu" Button (only visible in-game) * **************************************************************************/ windowDef ObjectivesMainmenuButtonH { MM_POS_OBJ_BACK_BUTTON_GLOW MM_FONT_LEFT_GLOW MM_BUTTON_HUGE text "#str_02114" // Main Menu visible ("gui::inGame" == 1) } windowDef ObjectivesMainmenuButton { MM_POS_OBJ_BACK_BUTTON MM_FONT_LEFT MM_BUTTON_HUGE forecolor GLOW_WHITE_COLOR text "#str_02114" // Main Menu visible ("gui::inGame" == 1) onMouseEnter { transition "ObjectivesMainmenuButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ; transition "ObjectivesMainmenuButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ; set "cmd" "play sound/meta/menu/mnu_hover;"; } onMouseExit { transition "ObjectivesMainmenuButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ; transition "ObjectivesMainmenuButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ; } onAction { set "cmd" "play sound/meta/menu/mnu_select;"; // Switch to the main menu set "gui::targetmode" MM_STATE_MAINMENU; resetTime "MainMenuModeSelect" 0; } } /*************************************************************************** * * The "Buy Equipment" or "Start Mission" Buttons * **************************************************************************/ windowDef ObjectivesStartMissionButtonH { MM_POS_OBJ_FORWARD_BUTTON_GLOW MM_FONT_RIGHT_GLOW MM_BUTTON_HUGE text "#str_02253" // Start Mission textalignx -2 visible ("gui::inGame" == 0 && "gui::SkipShop" == 1) } windowDef ObjectivesStartMissionButton { MM_POS_OBJ_FORWARD_BUTTON MM_FONT_RIGHT MM_BUTTON_HUGE forecolor GLOW_WHITE_COLOR text "#str_02253" // Start Mission textalignx -2 visible ("gui::inGame" == 0 && "gui::SkipShop" == 1) } windowDef ObjectivesStartMissionButtonAction { MM_POS_OBJ_FORWARD_ACTION visible ("gui::inGame" == 0 && "gui::SkipShop" == 1) onMouseEnter { transition "ObjectivesStartMissionButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ; transition "ObjectivesStartMissionButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ; set "cmd" "play sound/meta/menu/mnu_hover;"; } onMouseExit { transition "ObjectivesStartMissionButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ; transition "ObjectivesStartMissionButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ; } onAction { set "gui::targetmode" MM_STATE_FORWARD; resetTime "MainMenuModeSelect" 0; set "cmd" "play sound/meta/menu/mnu_select;"; set "cmd" "log 'Starting mission.'"; } } windowDef ObjectivesBuyEquipmentButtonH { MM_POS_OBJ_FORWARD_BUTTON_GLOW MM_FONT_RIGHT_GLOW MM_BUTTON_HUGE text "#str_02205" // Buy Equipment visible ("gui::inGame" == 0 && "gui::SkipShop" == 0) } windowDef ObjectivesBuyEquipmentButton { MM_POS_OBJ_FORWARD_BUTTON MM_FONT_RIGHT MM_BUTTON_HUGE forecolor GLOW_WHITE_COLOR text "#str_02205" // Buy Equipment visible ("gui::inGame" == 0 && "gui::SkipShop" == 0) } windowDef ObjectivesBuyEquipmentButtonAction { MM_POS_OBJ_FORWARD_ACTION visible ("gui::inGame" == 0 && "gui::SkipShop" == 0) onMouseEnter { transition "ObjectivesBuyEquipmentButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ; transition "ObjectivesBuyEquipmentButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ; set "cmd" "play sound/meta/menu/mnu_hover;"; } onMouseExit { transition "ObjectivesBuyEquipmentButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ; transition "ObjectivesBuyEquipmentButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ; } onAction { set "cmd" "play sound/meta/menu/mnu_select;"; set "cmd" "log 'Entering shop.'"; set "gui::targetmode" MM_STATE_FORWARD; resetTime "MainMenuModeSelect" 0; } } /*************************************************************************** * * The "Briefing/Back" Button (only visible in start menu) * **************************************************************************/ windowDef ObjectivesBriefingButtonH { MM_POS_OBJ_BACK_BUTTON_GLOW MM_FONT_LEFT_GLOW MM_BUTTON_HUGE text "#str_07202" // Back visible ("gui::inGame" == 0) } windowDef ObjectivesBriefingButton { MM_POS_OBJ_BACK_BUTTON MM_FONT_LEFT MM_BUTTON_HUGE forecolor GLOW_WHITE_COLOR text "#str_07202" // Back visible ("gui::inGame" == 0) onMouseEnter { transition "ObjectivesBriefingButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ; transition "ObjectivesBriefingButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ; set "cmd" "play sound/meta/menu/mnu_hover;"; } onMouseExit { transition "ObjectivesBriefingButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ; transition "ObjectivesBriefingButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ; } onAction { set "cmd" "play sound/meta/menu/mnu_select"; // Switch to briefing set "gui::targetmode" MM_STATE_BACKWARD; resetTime "MainMenuModeSelect" 0; } } } // ObjectivesMenu