diff --git a/marble/client/init.cs b/marble/client/init.cs index 3aecb3b..a6cd586 100644 --- a/marble/client/init.cs +++ b/marble/client/init.cs @@ -83,12 +83,14 @@ function initClient() exec("./ui/loadingGui.gui"); exec("./ui/optionsDlg.gui"); exec("./ui/remapDlg.gui"); - exec("./ui/MOTDGui.gui"); + //exec("./ui/MOTDGui.gui"); exec("./ui/EnterNameDlg.gui"); EnterNameDlg.preload(); exec("./ui/HelpCreditsGui.gui"); exec("./ui/ExitGameDlg.gui"); exec("./ui/MiniShotGui.gui"); + // custom gui files + exec("./ui/congratsGui.gui"); // Client scripts exec("./scripts/client.cs"); @@ -104,7 +106,7 @@ function initClient() exec("./scripts/centerPrint.cs"); exec("./scripts/game.cs"); exec("./scripts/version.cs"); - // custom guis + // custom gui scripts exec("./scripts/MarbleSkinSelectionDlg.cs"); // Default player key bindings diff --git a/marble/client/scripts/game.cs b/marble/client/scripts/game.cs index 1187cdf..bfad3a1 100644 --- a/marble/client/scripts/game.cs +++ b/marble/client/scripts/game.cs @@ -33,6 +33,11 @@ function clientCmdGameEnd() return; getBestTimes($Server::MissionFile); + if($Server::MissionFile $= "marble/data/missions/expert/timmysfork.mis") { + // if we've beaten The Final Challenge show the epic finale + gameIsCompleteSignalForEndGameGui(1); + Canvas.pushDialog(congratsGui); + } $highScoreIndex = ""; for(%i = 0; %i < 3; %i++) { diff --git a/marble/client/ui/congrats.jpg b/marble/client/ui/congrats.jpg new file mode 100644 index 0000000..eff5da5 Binary files /dev/null and b/marble/client/ui/congrats.jpg differ diff --git a/marble/client/ui/congratsGui.gui b/marble/client/ui/congratsGui.gui new file mode 100644 index 0000000..ec41a4d --- /dev/null +++ b/marble/client/ui/congratsGui.gui @@ -0,0 +1,38 @@ +new GuiChunkedBitmapCtrl(congratsGui) { + profile = "GuiContentProfile"; + horizSizing = "width"; + vertSizing = "height"; + position = "0 0"; + extent = "640 480"; + minExtent = "8 8"; + visible = "1"; + helpTag = "0"; + bitmap = "./congrats.jpg"; + useVariable = "0"; + tile = "0"; + + new GuiBitmapButtonCtrl() { + profile = "GuiButtonProfile"; + horizSizing = "center"; + vertSizing = "top"; + position = "280 415"; + extent = "111 59"; + minExtent = "8 8"; + visible = "1"; + command = "setPlayMissionGui();gameIsCompleteSignalForEndGameGui(0);"; + accelerator = "escape"; + helpTag = "0"; + text = "play"; + groupNum = "-1"; + buttonType = "PushButton"; + bitmap = "./play/play"; + }; +}; + +function congratsGui::onWake() { + if (!alxIsPlaying($WinSoundHandle)) + { + $WinSoundHandle = alxCreateSource("AudioChannel0", expandFilename("~/data/sound/congrats.wav")); + alxPlay($WinSoundHandle); + } +} \ No newline at end of file diff --git a/marble/client/ui/endGameGui.gui b/marble/client/ui/endGameGui.gui index 5179576..3433b3d 100644 --- a/marble/client/ui/endGameGui.gui +++ b/marble/client/ui/endGameGui.gui @@ -36,7 +36,7 @@ new GuiControl(EndGameGui) { allowColorChars = "0"; maxChars = "-1"; }; - new GuiBitmapButtonCtrl() { + new GuiBitmapButtonCtrl(EndGameContinueButton) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; @@ -70,3 +70,11 @@ new GuiControl(EndGameGui) { }; }; //--- OBJECT WRITE END --- + +function gameIsCompleteSignalForEndGameGui(%probably) { + if(%probably) { + EndGameContinueButton.command = "Canvas.popDialog(EndGameGui);"; + } else { + EndGameContinueButton.command = "setPlayMissionGui();"; + } +} diff --git a/marble/data/sound/congrats.wav b/marble/data/sound/congrats.wav new file mode 100644 index 0000000..138a172 Binary files /dev/null and b/marble/data/sound/congrats.wav differ