-- -- Autor: Catalin Marcu -- Date: 20-09-2009 -- -- Main loading script -- --=============================================================================== function getLoadText(index) if (index == 1) then return { scale = 0.1, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, vertical = E_VALIGN_CENTER, text = txtYes } elseif (index == 2) then return { scale = 0.1, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, vertical = E_VALIGN_CENTER, text = txtNo } elseif (index == 3) then return { scale = 0.1, font = "font4.fnt", overlap = -3, color = {255, 255, 255, 255}, vertical = E_VALIGN_CENTER, text = txtContinueTitle } elseif (index == 4 and gameModeSelected == GAME_MODE_NONE) then return { scale = 0.09, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, vertical = E_VALIGN_CENTER, text = txtContinueMatch } elseif (index == 4 and gameModeSelected == GAME_MODE_WORLDCUP) then return { scale = 0.09, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, vertical = E_VALIGN_CENTER, text = txtContinueCup } end end --=============================================================================== function goToContinueDialog() CreateActor("ActorGeom", {name = "ContinueDialog", model = "Screen_load.mesh", touchable = true, camera = "backgroundCamera"}) SetActorAnimPenalty("ContinueDialog", { anim = "screen_load_in.anm", loop = false }) Sound.PlaySound(MenuSounds.Fx.panelIn, false) end --=============================================================================== function exitContinueDialog(functionName) -- EnqueueExecuteScript("ContinueDialog", "SetActorAnimPenalty(\"ContinueDialog\", { anim = \"Screen_load_out.anm\", loop = false })") -- EnqueueExecuteScript("ContinueDialog", "Sound.PlaySound(MenuSounds.Fx.panelOut, false)") -- EnqueueExecuteScript("ContinueDialog", "DestroyActor(\"ContinueDialog\")") -- EnqueueExecuteScript("ContinueDialog", functionName) --if (mainMusicStarted == true and stopMainMusic == true) then -- mainMusicStarted = false -- StopMenuMusic(MenuSounds.Music.main) --end SetActorAnimPenalty("ContinueDialog", { anim = "Screen_load_out.anm", loop = false }) Sound.PlaySound(MenuSounds.Fx.panelOut, false) EnqueueExecuteScript("ContinueDialog", "DestroyActor(\"ContinueDialog\")") EnqueueExecuteScript("ContinueDialog", functionName) end --=============================================================================== function acceptContinue() if (gameModeSelected == GAME_MODE_WORLDCUP or gameModeSaved == GAME_MODE_WORLDCUP) then LoadWorldCup() stopMainMusic = true userTeamId = GetUserTeam() SetUserTeam(userTeamId) userGroup = GetTeamGroup(userTeamId) SimulateCPUMatches() continueSimulation = false execute("menu/functions_tournament.lua") if (gameModeSaved == GAME_MODE_WORLDCUP or ExistsSavedMatch(GAME_MODE_WORLDCUP) == true) then gameModeSelected = GAME_MODE_WORLDCUP gameModeSaved = GAME_MODE_NONE roundGame = IsGroupFinished(userGroup) execute("menu/functions_gameplay.lua") initCurrentMatch(1, 1, 5, txtQuickShootout) --just use any values here, they will be changed by the LoadMatch() bellow LoadMatch(gameModeSelected) DeleteSavedMatch(gameModeSelected) mainMusicStarted = false StopMenuMusic(MenuSounds.Music.main) -- EnqueueExecuteScript("ContinueDialog", "exitContinueDialog(\"continueMatch()\")") exitContinueDialog("continueMatch()") elseif (IsGroupFinished(userGroup) == true) then -- EnqueueExecuteScript("ContinueDialog", "exitContinueDialog(\"goToFinalRounds()\")") exitContinueDialog("goToFinalRounds()") else -- EnqueueExecuteScript("ContinueDialog", "exitContinueDialog(\"goToGroupResults()\")") exitContinueDialog("goToGroupResults()") end elseif (gameModeSaved == GAME_MODE_QUICK) then gameModeSaved = GAME_MODE_NONE gameModeSelected = GAME_MODE_QUICK execute("menu/functions_gameplay.lua") initCurrentMatch(1, 1, 5, txtQuickShootout) --just use any values here, they will be changed by the LoadMatch() bellow LoadMatch(GAME_MODE_QUICK) DeleteSavedMatch(GAME_MODE_QUICK) userTeamId = currentMatch.teamAId mainMusicStarted = false StopMenuMusic(MenuSounds.Music.main) -- EnqueueExecuteScript("ContinueDialog", "exitContinueDialog(\"continueMatch()\")") exitContinueDialog("continueMatch()") end end --=============================================================================== function declineContinue() if (gameModeSelected == GAME_MODE_WORLDCUP) then DeleteSavedCup() if (ExistsSavedMatch(GAME_MODE_WORLDCUP) == true) then DeleteSavedMatch(GAME_MODE_WORLDCUP) end execute("menu/functions_tournament.lua") -- EnqueueExecuteScript("ContinueDialog", "exitContinueDialog(\"startNewWorldCup()\")") exitContinueDialog("startNewWorldCup()") else -- the dialog appeared before the main menu if (gameModeSaved == GAME_MODE_QUICK) then DeleteSavedMatch(GAME_MODE_QUICK) end execute("menu/functions_main_menu.lua") -- EnqueueExecuteScript("ContinueDialog", "exitContinueDialog(\"goToMainMenu()\")") exitContinueDialog("goToMainMenu()") end end