From 83b846694b0c613bf17ae3482c9c57a24ea46327 Mon Sep 17 00:00:00 2001 From: Beu Date: Sat, 4 Sep 2021 09:47:35 +0200 Subject: [PATCH] Use the official newly added SmallScoreBoard CustomTimes --- TM_RoyalRounds_Online.Script.txt | 286 ++----------------------------- 1 file changed, 17 insertions(+), 269 deletions(-) diff --git a/TM_RoyalRounds_Online.Script.txt b/TM_RoyalRounds_Online.Script.txt index 77aa67f..105952e 100644 --- a/TM_RoyalRounds_Online.Script.txt +++ b/TM_RoyalRounds_Online.Script.txt @@ -16,15 +16,13 @@ #Include "Libs/Nadeo/ModeLibs/Common/Utils.Script.txt" as ModeUtils #Include "Libs/Nadeo/TMNext/TrackMania/Menu/Constants.Script.txt" as MenuConsts -#Include "Libs/Nadeo/TMxSM/Race/StateManager.Script.txt" as StateMgr +#Include "Libs/Nadeo/TMNext/TrackMania/Modes/Rounds/StateManager.Script.txt" as StateMgr #Include "ManiaApps/Nadeo/TMxSM/Race/UIModules/ScoresTable_Server.Script.txt" as UIModules_ScoresTable #Include "ManiaApps/Nadeo/TMxSM/Race/UIModules/PauseMenuOnline_Server.Script.txt" as UIModules_PauseMenu_Online #Include "ManiaApps/Nadeo/TMxSM/Race/UIModules/Checkpoint_Server.Script.txt" as UIModules_Checkpoint #Include "ManiaApps/Nadeo/TMxSM/Race/UIModules/BigMessage_Server.Script.txt" as UIModules_BigMessage #Include "ManiaApps/Nadeo/TMxSM/Race/UIModules/Chrono_Server.Script.txt" as UIModules_Chrono - -// For the ML -#Include "Libs/Nadeo/ModeLibs/TrackMania/MV_Utils.Script.txt" as MV_Utils +#Include "ManiaApps/Nadeo/TMNext/TrackMania/Rounds/UIModules/SmallScoresTable_Server.Script.txt" as UIModules_SmallScoresTable // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Settings @@ -49,7 +47,7 @@ #Const Description _("$zIn $<$t$6F9RoyalRounds$z$z$> mode, the goal is to win a maximum number of $<$t$6F9points.\n\n$z$>The rounds mode consists of $<$t$6F9a series of races$z$>.\nWhen you finish a race in a good $<$t$6F9position$z$>, you get $<$t$6F9points$z$>, added to your total.\n\nThe $<$t$6F9winner$z$> is the first player whose total reaches the $<$t$6F9point limit$z$> (30 for example).") #Const C_HudModulePath "" //< Path to the hud module -#Const C_ManiaAppUrl "file://Media/ManiaApps/Nadeo/TMNext/TrackMania/TimeAttack/TimeAttack.Script.txt" //< Url of the mania app +#Const C_ManiaAppUrl "file://Media/ManiaApps/Nadeo/TMNext/TrackMania/Rounds/Rounds.Script.txt" //< Url of the mania app #Const C_FakeUsersNb 0 @@ -75,6 +73,17 @@ Log::RegisterScript(Semver::ScriptName, Semver::Version); Log::RegisterScript(ModeUtils::ScriptName, ModeUtils::Version); Log::RegisterScript(StateMgr::ScriptName, StateMgr::Version); Log::RegisterScript(UIModules_Checkpoint::ScriptName, UIModules_Checkpoint::Version); +Log::RegisterScript(UIModules_SmallScoresTable::ScriptName, UIModules_SmallScoresTable::Version); +*** + +***Match_LoadLibraries*** +*** +StateMgr::Load(); +*** + +***Match_UnloadLibraries*** +*** +StateMgr::Unload(); *** ***Match_Settings*** @@ -112,8 +121,6 @@ UIManager.UIAll.OverlayHideSpectatorControllers = True; UIManager.UIAll.OverlayHideSpectatorInfos = True; UIManager.UIAll.OverlayHideChrono = True; UIManager.UIAll.OverlayHideCountdown = True; - -SetML(Null); *** ***Match_Yield*** @@ -314,7 +321,7 @@ foreach (Event in RacePendingEvents) { } } } - } + } } } } @@ -412,6 +419,7 @@ if (Round_ForceEndRound || Round_SkipPauseRound || Round_Skipped) { } } CustomTimes.clear(); +UIModules_SmallScoresTable::ResetCustomTimes(); *** ***Match_EndMap*** @@ -489,13 +497,6 @@ Integer GetFinishTimeout(Integer _FinishTimeout) { return Now + FinishTimeout; } -Void SetCustomTimes(Integer[Text] _CustomTimes) { - declare netwrite Integer[Text] Net_Rounds_SmallScoresTable_CustomTimes for Teams[0]; - declare netwrite Integer Net_Rounds_SmallScoresTable_CustomTimesUpdate for Teams[0]; - Net_Rounds_SmallScoresTable_CustomTimes = _CustomTimes; - Net_Rounds_SmallScoresTable_CustomTimesUpdate = Now; -} - /** Update the Scores Table with Real Time * * @param _Player The Player who end the round @@ -525,7 +526,7 @@ Void SetCustomTimes(Integer[Text] _CustomTimes) { I += 1; } } - SetCustomTimes(CustomTimes); + UIModules_SmallScoresTable::SetCustomTimes(CustomTimes); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @@ -618,257 +619,4 @@ Boolean MapIsOver(Boolean _UseTieBreak, Integer _PointsLimit, Integer _ValidRoun // In all other cases continue to play return False; -} - -/** Set the UI - * - * @param _Player Malus Index - */ - Void SetML(CSmPlayer _Player) { - declare TotalWidth = 44.5; - - declare Text MLText = """ - - - - -