From 433b98fdb5e77f314c68d9f3bc6671b1ce2b0ebb Mon Sep 17 00:00:00 2001 From: Beu Date: Wed, 16 Feb 2022 01:09:06 +0100 Subject: [PATCH] Keep displayed the Checkpoint UI if the player skip the outro --- TM_RoyalRounds_Online.Script.txt | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/TM_RoyalRounds_Online.Script.txt b/TM_RoyalRounds_Online.Script.txt index 099a0b7..63ef32e 100644 --- a/TM_RoyalRounds_Online.Script.txt +++ b/TM_RoyalRounds_Online.Script.txt @@ -790,7 +790,7 @@ Boolean MapIsOver(Boolean _UseTieBreak, Integer _PointsLimit, Integer _ValidRoun #Include "TextLib" as TL main() { - declare Integer TimeToDisplay = 0; + declare Ident Last_GUIPlayerId; declare Integer LastUpdate = 0; declare Frame_Global <=> (Page.GetFirstChild("frame-global") as CMlFrame); @@ -815,20 +815,19 @@ Boolean MapIsOver(Boolean _UseTieBreak, Integer _PointsLimit, Integer _ValidRoun Label_Time.Value = TL::TimeToText(GUIPlayer.RaceWaypointTimes[0], True, True); Label_Rank.Value = TL::FormatRank(Net_RoyalRounds_CheckpointUI_Rank, False); Label_Segments.Value = TL::Compose("Segment %1/%2", TL::ToText(Net_RoyalRounds_CheckpointUI_CurrentNbSegments), TL::ToText(Net_RoyalRounds_CheckpointUI_TotalNbSegments)); + Frame_Global.Visible = True; - TimeToDisplay = Now + 3000; - } else { - TimeToDisplay = -1; // Force hide UI + AnimMgr.Flush(Frame_Global); + AnimMgr.Add(Frame_Global, "", Now, 3000, CAnimManager::EAnimManagerEasing::Linear); } } - - if (TimeToDisplay != 0 && TimeToDisplay < Now) { - Frame_Global.Visible = False; - TimeToDisplay = 0; + if (Last_GUIPlayerId != GUIPlayer.Id) { + Last_GUIPlayerId = GUIPlayer.Id; + if (Frame_Global.Visible) { + AnimMgr.Flush(Frame_Global); + Frame_Global.Visible = False; + } } - } else if (Frame_Global.Visible) { - Frame_Global.Visible = False; - TimeToDisplay = 0; } } }