From d3b330d92d9d4305e7219ed34b53e410204589d5 Mon Sep 17 00:00:00 2001 From: Beu Date: Thu, 31 Mar 2022 22:32:23 +0200 Subject: [PATCH] Use the new BigMessage library --- LastManStanding.Script.txt | 20 +++++++++++--------- TM_SeedingTimeAttack_Online.Script.txt | 16 +++++++++------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/LastManStanding.Script.txt b/LastManStanding.Script.txt index 024b941..564fd87 100644 --- a/LastManStanding.Script.txt +++ b/LastManStanding.Script.txt @@ -19,6 +19,7 @@ // UI from Race #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/BigMessage_Server.Script.txt" as UIModules_BigMessage // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Settings @@ -466,7 +467,7 @@ if (Players.count > 0 && S_MalusDuration > 0 && MalusTime != -1 && Now > MalusTi NextStepMalusTime = Now + (S_MalusDuration*1000); UIManager.UIAll.BigMessageSound = CUIConfig::EUISound::Silence; - UIManager.UIAll.BigMessage = "Current Effect: "^C_Malus_Name[MalusIndex]; + UIModules_BigMessage::SetMessage("Current Effect: "^C_Malus_Name[MalusIndex]); // Players UI update Net_NextMalus = 0; @@ -482,7 +483,7 @@ if (Players.count > 0 && S_MalusDuration > 0 && MalusTime != -1 && Now > MalusTi NextStepMalusTime = Now + (S_MalusEveryNSecs*1000); UIManager.UIAll.BigMessageSound = CUIConfig::EUISound::Silence; - UIManager.UIAll.BigMessage = ""; + UIModules_BigMessage::SetMessage(""); // Players UI update Net_NextMalus = -1; @@ -548,20 +549,21 @@ if (Round_ForceEndRound || Round_SkipPauseRound) { } Scores::SetPlayerWinner(WinnerScore); - declare Text Message = _("|Match|Draw"); - if (WinnerScore != Null) { - Message = TL::Compose(_("$<%1$> wins the match!"), Tools::GetNameWithClubTag(WinnerScore.User)); // TODO CHeck why display draw when someone leave - } - UIManager.UIAll.BigMessageSound = CUIConfig::EUISound::EndRound; UIManager.UIAll.BigMessageSoundVariant = 0; - UIManager.UIAll.BigMessage = Message; + + declare Text Message = _("|Match|Draw"); + if (WinnerScore != Null) { + UIModules_BigMessage::SetMessage("$<%1$> wins the match!", WinnerScore.User.WebServicesUserId); + } else { + UIModules_BigMessage::SetMessage(_("|Match|Draw")); + } Scores::EndRound(); Race::SortScores(Race::C_Sort_TotalPoints); MB_Sleep(5000); - UIManager.UIAll.BigMessage = ""; + UIModules_BigMessage::SetMessage(""); UIManager.UIAll.ScoreTableVisibility = CUIConfig::EVisibility::ForcedVisible; MB_Sleep((S_ChatTime*1000)/2); UIManager.UIAll.ScoreTableVisibility = CUIConfig::EVisibility::Normal; diff --git a/TM_SeedingTimeAttack_Online.Script.txt b/TM_SeedingTimeAttack_Online.Script.txt index eb51490..3c2d59a 100644 --- a/TM_SeedingTimeAttack_Online.Script.txt +++ b/TM_SeedingTimeAttack_Online.Script.txt @@ -21,6 +21,7 @@ // UI from Race #Include "ManiaApps/Nadeo/TMxSM/Race/UIModules/TimeGap_Server.Script.txt" as UIModules_TimeGap +#Include "ManiaApps/Nadeo/TMxSM/Race/UIModules/BigMessage_Server.Script.txt" as UIModules_BigMessage #Include "ManiaApps/Nadeo/TMxSM/Race/UIModules/Checkpoint_Server.Script.txt" as UIModules_Checkpoint #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 @@ -401,15 +402,16 @@ if (MB_GetMapCount() >= S_MapsPerMatch) { UIManager.UIAll.BigMessageSound = CUIConfig::EUISound::EndRound; UIManager.UIAll.BigMessageSoundVariant = 0; -declare Text Message = _("|Match|Draw"); declare CSmScore WinnerScore <=> Scores::GetPlayerWinner(); if (WinnerScore != Null) { - if (!MB_MatchIsRunning()) Message = TL::Compose(_("$<%1$> wins the match!"), Tools::GetNameWithClubTag(WinnerScore.User)); - else Message = TL::Compose(_("$<%1$> wins the map!"), Tools::GetNameWithClubTag(WinnerScore.User)); + if (!MB_MatchIsRunning()) { + UIModules_BigMessage::SetMessage("$<%1$> wins the match!", WinnerScore.User.WebServicesUserId); + } else { + UIModules_BigMessage::SetMessage("$<%1$> wins the map!", WinnerScore.User.WebServicesUserId); + } +} else { + UIModules_BigMessage::SetMessage(_("|Match|Draw")); } - -UIManager.UIAll.BigMessage = Message; - // Compute match trophies Trophy_LiveTimeAttackAchievement_ClearResultList(); @@ -469,7 +471,7 @@ UIManager.UIAll.UISequence = PrevUISequence; ***Match_AfterPodiumSequence*** *** -UIManager.UIAll.BigMessage = ""; +UIModules_BigMessage::SetMessage(""); UIModules_ScoresTable::ResetTrophies(); ***