/* ============================================================================================= * * Load/Save Game GUI. 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 LoadSaveGameMenu { rect 0,0,640,640 visible 0 // Parchment Background windowDef LoadSaveGameMenuBackground { rect 280, 0, 320, 640 background "guis/assets/mainmenu/parchment_load" visible 1 } // Load * Save Headline Translation windowDef LoadSaveHeadlineTextGlow { rect 137, 23.5 + "gui::headline_offset", 600, 200 text "#str_02122" // Load Save font "fonts/mason_glow" forecolor 1,1,0.80,0.8 textscale 0.75 textalign 1 textaligny -1 visible 1 } windowDef LoadSaveHeadlineText { rect 137, 23.5 + "gui::headline_offset", 600, 200 text "#str_02122" // Load Save font "fonts/mason" forecolor 0,0,0,1.0 textscale 0.75 textalign 1 visible 1 } // This is called whenever the user switches to this screen windowDef LoadSaveGameMenuStateInit { noTime 1 // Init methods have onTime 10 instead of onTime 0. onTime 10 { set "cmd" "log 'LoadSaveGameMenuStateInit called.'"; set "cmd" "loadsavemenu_init"; // grayman #3733 resetTime "LoadSaveGameUpdateAll" 0; // Show our parent windowDef set "LoadSaveGameMenu::visible" 1; // grayman #3733 - fade in the campaign/mission titles if ("LoadSaveIntroAnimation::introAnimPlayed" == 0) { set "cmd" "log 'Trying to call load/save menu intro animation.'"; // Intro animation not yet played, show it now set "LoadSaveIntroAnimation::notime" "0"; resetTime "LoadSaveIntroAnimation" 0; } else { set "cmd" "log 'Skipping load/save menu intro animation.'"; } set "notime" 1; } } // General update routine windowDef LoadSaveGameUpdateAll { notime 1 onTime 0 { set "LSGSaveGameNameEntry::text" ""; set "LGCLevelSaveDate::text" ""; set "LGCLevelSaveTime::text" ""; resetTime "LSGSaveMissionButton_action" 0; set "LSGSaveMissionButton_lit::matcolor" "1 1 1 0"; resetTime "LSGDeleteSaveGameButton" 0; resetTime "LSGLoadMissionButton" 0; set "LSGLoadMissionButton_lit::matcolor" "1 1 1 0"; set "cmd" "updateSaveGameInfo;"; } } // Called when the MainMenuModeSelect script switches states. windowDef LoadSaveGameMenuStateEnd { noTime 1 onTime 0 { set "cmd" "log 'LoadSaveGameMenuStateEnd called.'"; set "LoadSaveGameMenu::visible" "0"; set "notime" "1"; } } // Savegame properties/preview windowDef LGCLoadGameSpecific { rect 0, 170, 300, 300 // Save game screenshot windowDef LGCLevelshot { rect 45, 65, 215, 175 background "gui::loadgame_shot" matcolor 1, 1, 1, 1 noevents 1 visible ("gui::loadGame_sel_0" >= 0) } // This box simulates a 'multiply' effect on screenshot windowDef LGCLevelshot_multiply { rect 45, 65, 215, 175 background "guis/assets/mainmenu/screenshot_multiply" matcolor 1, 1, 1, 1 bordersize 0 noevents 1 visible ("gui::loadGame_sel_0" >= 0) } windowDef LGCLevelshot_back { rect 12, 0, 282, 295 background "guis/assets/mainmenu/oldparchment_backdrop" matcolor 1, 1, 1, 1 bordersize 0 noevents 1 visible ("gui::loadGame_sel_0" >= 0) } // Savegame Name windowDef LGCLevelSaveName { rect 0, 0, 300, 35 text "gui::saveGameName" font "fonts/carleton" textscale 0.32 textalign 1 forecolor 1, 1, 1, 1 } // Date windowDef LGCLevelSaveDate { rect 20, 280, 100, 15 text "gui::saveGameDate" font "fonts/carleton" textscale 0.22 textalign 2 forecolor 1, 1, 1, 1 } // Time windowDef LGCLevelSaveTime { rect 185, 280, 100, 15 text "gui::saveGameTime" font "fonts/carleton" textscale 0.22 forecolor 1, 1, 1, 1 } } // Use this layer to move all content elements (lists, buttons, etc.) around in the GUI windowDef LSGContentParent { rect 0, 5, 640, 635 visible 1 // ------------ Campaign and Mission Titles (grayman #3733) ------------------- // LSCampaignTitleText and LSCampaignMissionTitleText will appear // as a pair when playing a campaign mission windowDef LSCampaignTitleText { rect LS_TITLE_CAMPAIGN LS_TITLE_FONT //text "No Honor Among Thieves:" // Campaign title text "gui::LSCampaignTitleText" // Campaign title } windowDef LSCampaignMissionTitleText { rect LS_TITLE_CAMPAIGN_MISSION LS_TITLE_FONT //text "A Night Out on the Town" // Campaign Mission title text "gui::LSCampaignMissionTitleText" // Campaign Mission title } // MissionTitleText will appear by itself when playing a non-campaign mission windowDef LSMissionTitleText { rect LS_TITLE_MISSION LS_TITLE_FONT //text "Return to the City" // Mission title text "gui::LSMissionTitleText" // Mission title } //----------------------------------------------------------------------------- // The list of available save games listDef LGSaveGameList { rect 325, 187, 250, 160 // grayman #3733 - was too far to the right forecolor 0, 0, 0, 1 bordercolor 0, 0, 0, 0.1 textscale 0.23 listName "loadGame" tabstops "2, 99, 180" font "fonts/carleton" onAction { set "cmd" "play sound/meta/menu/mnu_select;"; set "cmd" "updateSaveGameInfo;"; resetTime "LSGLoadMissionButton" "0"; set "LSGLoadMissionButton_lit::matcolor" "1 1 1 0"; resetTime "LSGDeleteSaveGameButton" 0; if ("gui::inGame" == 1) { resetTime "LSGSaveMissionButton_action" 0; } resetTime "LGSaveGameList" "0"; } onEnter { set "cmd" "play sound/meta/menu/mnu_select;" ; if ("gui::inGame" == 1) { // greebo: do nothing, double click is ambiguous } else { // No save game option available, route the double click to loadGame // Switch back to main menu set "gui::targetmode" MM_STATE_MAINMENU; resetTime "MainMenuModeSelect" 0; set "cmd" "loadGame"; resetTime "LSGResetButtons" 0; } } } // "Load Mission" button windowDef LSGLoadMissionButton { rect 290,380,160,20 background "guis/assets/mainmenu/buttons_loadsave/loadmission" matcolor 1, 1, 1, 0 notime 1 onTime 0 { if ( "gui::loadGame_sel_0" >= 0 ) { set "matcolor" "1 1 1 1" ; set "noevents" "0" } else { // greebo: No savegame selected, make insensitive set "matcolor" "0 0 0 0.3" ; set "noevents" "1" } } } windowDef LSGLoadMissionButton_lit { rect 290, 380, 160, 20 background "guis/assets/mainmenu/buttons_loadsave/loadmission_lit" matcolor 1, 1, 1, 0 } windowDef LSGLoadMissionButton_action { rect 340, 380, 110, 14 onMouseEnter { if ( "gui::loadGame_sel_0" >= 0 ) { transition "LSGLoadMissionButton::matcolor" "1 1 1 1" "1 1 1 0" "50" ; transition "LSGLoadMissionButton_lit::matcolor" "1 1 1 0" "1 1 1 1" "50" ; set "cmd" "play sound/meta/menu/mnu_hover;"; } } onMouseExit { if ( "gui::loadGame_sel_0" >= 0 ) { transition "LSGLoadMissionButton::matcolor" "1 1 1 0" "1 1 1 1" "50" ; transition "LSGLoadMissionButton_lit::matcolor" "1 1 1 1" "1 1 1 0" "50" ; } } onAction { if ("gui::loadGame_sel_0" >= 0) { set "cmd" "play sound/meta/menu/mnu_select; "; set "cmd" "updateSaveGameInfo;"; set "LGCLevelSaveName::text" ""; set "LGCLevelSaveDate::text" ""; set "LGCLevelSaveTime::text" ""; } } onActionRelease { if ("gui::loadGame_sel_0" >= 0) { // Switch to the main menu set "gui::targetmode" MM_STATE_MAINMENU; resetTime "MainMenuModeSelect" 0; set "cmd" "loadGame"; resetTime "LSGResetButtons" 0; } } } windowDef LGSaveGameNameText { rect 335,348,80,16 text "#str_07201" // Enter Name: font "fonts/carleton" textscale 0.22 forecolor 0,0,0,1 textaligny -4 visible ("gui::inGame" == 1) } // Savegame Name Entry Field windowDef LSGSaveGameName { rect 415,348,155,16 backcolor 0, 0, 0, 0.4 bordercolor 0, 0, 0, 0.7 bordersize 1 visible ("gui::inGame" == 1) editDef LSGSaveGameNameEntry { rect 0, 0, 140, 14 text "gui::saveGameName" font "fonts/carleton" textscale 0.22 forecolor 0.8,0.8,0.8,1 textaligny -4 maxchars 32 onEnter { set "cmd" "play sound/meta/menu/mnu_select; saveGame 1"; // Switch to the main menu after save set "gui::targetmode" MM_STATE_MAINMENU; resetTime "MainMenuModeSelect" 0; set "cmd" "close"; } onAction { // greebo: Update the SaveMission button on each event resetTime "LSGSaveMissionButton" 0; resetTime "LSGSaveMissionButton_action" 0; } } } // greebo: called by the engine when a savegame is about to be overwritten onNamedEvent saveGameOverwrite { // Nothing here. Use this to display an "Overwrite game?"-style dialog } // "Save Mission" button windowDef LSGSaveMissionButton { rect 435, 380, 160, 20 background "guis/assets/mainmenu/buttons_loadsave/savemission" matcolor 1, 1, 1, 0 visible ("gui::inGame" == 1) notime 1 onTime 0 { if ("LSGSaveGameNameEntry::text") { set "matcolor" "1 1 1 1" ; set "noevents" "0" } else { // greebo: No savegame name, make insensitive set "matcolor" "0 0 0 0.3"; set "noevents" "1" } } } windowDef LSGSaveMissionButton_lit { rect 435,380,160,20 background "guis/assets/mainmenu/buttons_loadsave/savemission_lit" matcolor 1,1,1,0 visible ("gui::inGame" == 1) } windowDef LSGSaveMissionButton_action { rect 455, 380, 95, 14 visible ("gui::inGame" == 1) notime 1 onTime 10 { if ("LSGSaveGameNameEntry::text") { set "LSGSaveMissionButton::matcolor" "1 1 1 1" ; set "LSGSaveMissionButton_lit::matcolor" "1 1 1 0" ; set "noevents" "0"; } else { // greebo: No savegame selected, make insensitive set "LSGSaveMissionButton::matcolor" "1 1 1 0.3" ; set "LSGSaveMissionButton_lit::matcolor" "1 1 1 0" ; set "noevents" "1"; } } onMouseEnter { if ("LSGSaveGameNameEntry::text") { set "cmd" "play sound/meta/menu/mnu_hover;"; transition "LSGSaveMissionButton::matcolor" "1 1 1 1" "1 1 1 0" "50" ; transition "LSGSaveMissionButton_lit::matcolor" "1 1 1 0" "1 1 1 1" "50" ; } } onMouseExit { if ("LSGSaveGameNameEntry::text") { set "cmd" "play sound/meta/menu/mnu_hover;"; transition "LSGSaveMissionButton_lit::matcolor" "1 1 1 1" "1 1 1 0" "50" ; transition "LSGSaveMissionButton::matcolor" "1 1 1 0" "1 1 1 1" "50" ; } } onAction { set "cmd" "play sound/meta/menu/mnu_select; saveGame 1"; // Switch back to main menu after save set "gui::targetmode" MM_STATE_MAINMENU; resetTime "MainMenuModeSelect" 0; set "cmd" "close"; } } // Delete Button windowDef LSGDeleteSaveGameButton { rect 323, 427, 100, 30 text "#str_07200" // Delete font "fonts/carleton" textscale 0.29 forecolor 0, 0, 0, 1 notime 1 onTime 0 { if ( "gui::loadGame_sel_0" >= 0 ) { set "forecolor" "0 0 0 1" ; set "noevents" "0" } else { // greebo: No savegame selected, make insensitive set "forecolor" "0 0 0 0.4" ; set "noevents" "1" } } onMouseEnter { set "cmd" "play sound/meta/menu/mnu_hover;"; transition "forecolor" "0 0 0 1" "1 1 1 1" "50" ; } onMouseExit { transition "forecolor" "1 1 1 1" "0 0 0 1" "50" ; } onAction { if ("gui::loadGame_sel_0" >= 0) { set "cmd" "play sound/meta/menu/mnu_select; deleteGame;"; set "cmd" "updateSaveGameInfo;"; resetTime "LSGResetTexts" 0; set "LGCLevelSaveName::text" ""; resetTime "LSGResetButtons" 0; } } } // greebo: This is used to reset the buttons after Load/Save action // so that they aren't left in a sensitive state with an empty listDef selection. windowDef LSGResetButtons { rect 0,0,0,0 notime 1 onTime 30 { resetTime "LSGSaveMissionButton_action" 0; set "LSGSaveMissionButton_lit::matcolor" "1 1 1 0"; resetTime "LSGDeleteSaveGameButton" 0; resetTime "LSGLoadMissionButton" 0; set "LSGLoadMissionButton_lit::matcolor" "1 1 1 0"; } } // Clears the texts for savegame info and savegame name windowDef LSGResetTexts { rect 0,0,0,0 notime 1 onTime 20 { set "LSGSaveGameNameEntry::text" ""; set "LGCLevelSaveDate::text" ""; set "LGCLevelSaveTime::text" ""; } } } // end windowDef LGContentParent // Main Menu Button -- this should go here regardless of rest of design windowDef LGMainMenuButtonH { MM_POS_SETTINGS_BACK_BUTTON_GLOW MM_FONT_RIGHT_GLOW text "#str_02114" // Main Menu } windowDef LGMainMenuButton { MM_POS_SETTINGS_BACK_BUTTON MM_FONT_RIGHT_BOLD text "#str_02114" // Main Menu } // "Normal" version used for highlighting windowDef LGMainMenuButtonN { MM_POS_SETTINGS_BACK_BUTTON MM_FONT_RIGHT text "#str_02114" // Main Menu } windowDef LGMainMenuButtonAction { MM_POS_SETTINGS_BACK_ACTION visible 1 float exit; onMouseEnter { set "exit" 0; transition "LGMainMenuButton::forecolor" SNORMAL_COLOR SINVISIBLE "50" ; transition "LGMainMenuButtonH::forecolor" SINVISIBLE SGLOW_RED_COLOR "50" ; transition "LGMainMenuButtonN::forecolor" SINVISIBLE SBOLDGLOW_WHITE_COLOR "50" ; set "cmd" "play sound/meta/menu/mnu_hover"; } onMouseExit { if ( "exit" == 0 ) { transition "LGMainMenuButton::forecolor" SBOLDGLOW_WHITE_COLOR SNORMAL_COLOR "50" ; transition "LGMainMenuButtonH::forecolor" SGLOW_RED_COLOR SINVISIBLE "50" ; transition "LGMainMenuButtonN::forecolor" SBOLDGLOW_WHITE_COLOR SINVISIBLE "50" ; } } onAction { transition "LGMainMenuButton::forecolor" SBOLDGLOW_WHITE_COLOR SNORMAL_COLOR "50" ; transition "LGMainMenuButtonH::forecolor" SGLOW_RED_COLOR SINVISIBLE "50" ; transition "LGMainMenuButtonN::forecolor" SBOLDGLOW_WHITE_COLOR SINVISIBLE "50" ; set "exit" 1; set "cmd" "play sound/meta/menu/mnu_select;"; // Switch to the main menu set "gui::targetmode" MM_STATE_MAINMENU; resetTime "MainMenuModeSelect" 0; } } /** * Intro (fade-in) animation, is only played once. */ windowDef LoadSaveIntroAnimation // grayman #3733 { rect 0,0,0,0 notime 1 visible 1 float introAnimPlayed; // this is 1 if the intro anim has already been played onTime 10 { set "cmd" "log 'LoadSaveIntroAnimation called.'"; if ("introAnimPlayed" == 1) { set "cmd" "log 'LoadSaveIntroAnimation has already been played, stopping.'"; set "notime" 1; } else { set "cmd" "log 'LoadSaveIntroAnimation started playing.'"; } } // grayman #3733 - show campaign and mission titles onTime 100 { // these titles will appear as a pair when playing a campaign mission transition "LSCampaignTitleText::forecolor" SINVISIBLE SLS_TITLE_COLOR "500" ; transition "LSCampaignMissionTitleText::forecolor" SINVISIBLE SLS_TITLE_COLOR "500" ; // this title will appear by itself when playing a non-campaign mission transition "LSMissionTitleText::forecolor" SINVISIBLE SLS_TITLE_COLOR "500" ; } onTime 200 { set "cmd" "log 'LoadSaveIntroAnimation successfully executed, stopping.'"; set "introAnimPlayed" 1; set "notime" 1; // stop animation } } } // end windowDef LoadSaveGameMenu