|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
#Extends "Modes/Nadeo/Trackmania/Base/TrackmaniaRoundsBase.Script.txt"
|
|
|
|
|
|
|
|
|
|
#Const CompatibleMapTypes "TrackMania\\TM_Race,TM_Race"
|
|
|
|
|
#Const Version "2024-08-25"
|
|
|
|
|
#Const Version "2025-02-15"
|
|
|
|
|
#Const ScriptName "Modes/TM2020-Gamemodes/TM_MultiLivesKnockout.Script.txt"
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
|
|
|
|
@ -38,12 +38,14 @@
|
|
|
|
|
#Setting S_EliminatedPlayersNbRanks "4,16,16" as _("Nb of players above which one extra elim. /round")
|
|
|
|
|
#Setting S_RoundsWithoutElimination 1 as _("Rounds without elimination")
|
|
|
|
|
|
|
|
|
|
#Setting S_EliminatePerRounds False as "Eliminate par rounds instead of per players alive"
|
|
|
|
|
#Setting S_EliminationMode 0 as "0 per player / 1 per lives / 2 per round"
|
|
|
|
|
#Setting S_MaximumLives 3
|
|
|
|
|
#Setting S_MatchName "Final"
|
|
|
|
|
#Setting S_AlternativeMatchInfosPosition False
|
|
|
|
|
|
|
|
|
|
/* About S_EliminatedPlayersNbRanks and S_EliminatePerRounds.
|
|
|
|
|
* If S_EliminatePerRounds is True, it will decrease the number of lose of life.
|
|
|
|
|
|
|
|
|
|
/* About S_EliminatedPlayersNbRanks.
|
|
|
|
|
* If S_EliminationMode is 2, it will decrease the number of lose of life.
|
|
|
|
|
* Example : "8,16"
|
|
|
|
|
* Round 1 to 7 -> 3 eliminations per round
|
|
|
|
|
* Round 8 to 15 -> 2 eliminations per round
|
|
|
|
@ -61,7 +63,8 @@
|
|
|
|
|
* Example : ""
|
|
|
|
|
* 1 elimination per round
|
|
|
|
|
*
|
|
|
|
|
* If S_EliminatePerRounds is False, it will work like the official
|
|
|
|
|
* If S_EliminationMode is 1, it will sum number of remaining lives and apply official system on it
|
|
|
|
|
* If S_EliminationMode is 0, it will work like the official Knockout Mode
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
|
|
|
|
@ -75,6 +78,10 @@
|
|
|
|
|
#Const C_ManiaAppUrl "file://Media/ManiaApps/Nadeo/Trackmania/Modes/Knockout.Script.txt" //< Url of the mania app
|
|
|
|
|
#Const C_FakeUsersNb 0
|
|
|
|
|
|
|
|
|
|
#Const C_ElimMode_Rounds 2
|
|
|
|
|
#Const C_ElimMode_Lives 1
|
|
|
|
|
#Const C_ElimMode_Official 0
|
|
|
|
|
|
|
|
|
|
#Const C_Callback_Elimination "Trackmania.Knockout.Elimination"
|
|
|
|
|
#Const C_Callback_LostLife "Trackmania.Knockout.LostLife"
|
|
|
|
|
|
|
|
|
@ -463,13 +470,11 @@ if (Semver::Compare(XmlRpc::GetApiVersion(), ">=", "2.1.1")) {
|
|
|
|
|
Scores::XmlRpc_SendScores(Scores::C_Section_PreEndRound, "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DisplayLiveRanking(False);
|
|
|
|
|
|
|
|
|
|
declare Text[] LostLifeAccountIds;
|
|
|
|
|
declare Text[] EliminatedAccountIds;
|
|
|
|
|
declare Integer[] EliminatedRanks;
|
|
|
|
|
|
|
|
|
|
if (Round_ForceEndRound || Round_SkipPauseRound) {
|
|
|
|
|
if (Round_ForceEndRound || Round_SkipPauseRound || Round_Skipped) {
|
|
|
|
|
// Cancel points
|
|
|
|
|
foreach (Score in Scores) {
|
|
|
|
|
Scores::SetPlayerRoundPoints(Score, 0);
|
|
|
|
@ -479,6 +484,7 @@ if (Round_ForceEndRound || Round_SkipPauseRound) {
|
|
|
|
|
ForcedEndRoundSequence();
|
|
|
|
|
}
|
|
|
|
|
MB_SetValidRound(False);
|
|
|
|
|
Match_CurrentRoundNb -= 1;
|
|
|
|
|
} else {
|
|
|
|
|
// Eliminate players that did not finish in time
|
|
|
|
|
declare Ident[] EliminatedPlayersScoresIds = []; // Score.Id
|
|
|
|
@ -488,7 +494,6 @@ if (Round_ForceEndRound || Round_SkipPauseRound) {
|
|
|
|
|
Match_RegistrationIsOpen = False;
|
|
|
|
|
|
|
|
|
|
// Eliminate last players
|
|
|
|
|
Race::SortScores(Race::C_Sort_PrevRaceTime);
|
|
|
|
|
declare Integer ParticipantsNb = GetParticipantsNb();
|
|
|
|
|
declare Integer AliveScoresNb = GetAliveScoresNb();
|
|
|
|
|
declare Integer LossOfLifeNb = GetLossOfLifeNb(Match_CurrentRoundNb, AliveScoresNb);
|
|
|
|
@ -505,7 +510,8 @@ if (Round_ForceEndRound || Round_SkipPauseRound) {
|
|
|
|
|
LostLifeAccountIds.add(Score.User.WebServicesUserId);
|
|
|
|
|
|
|
|
|
|
if (!ScoreIsAlive(Score)) {
|
|
|
|
|
Scores::SetPlayerMatchPoints(Score, ParticipantsNb - Rank);
|
|
|
|
|
// Registered Score must have at least 1 point or a best race time to not be reset at end of the map: https://forum.nadeo.com/viewtopic.php?t=4365
|
|
|
|
|
Scores::SetPlayerMatchPoints(Score, ParticipantsNb + 1 - Rank);
|
|
|
|
|
EliminatedAccountIds.add(Score.User.WebServicesUserId);
|
|
|
|
|
EliminatedRanks.add(Rank);
|
|
|
|
|
|
|
|
|
@ -554,6 +560,7 @@ if (Round_ForceEndRound || Round_SkipPauseRound) {
|
|
|
|
|
MB_Sleep(S_ChatTime / 2 * 1000);
|
|
|
|
|
UIManager.UIAll.ScoreTableVisibility = CUIConfig::EVisibility::Normal;
|
|
|
|
|
}
|
|
|
|
|
DisplayLiveRanking(False);
|
|
|
|
|
}
|
|
|
|
|
***
|
|
|
|
|
|
|
|
|
@ -690,6 +697,19 @@ Integer GetAliveScoresNb() {
|
|
|
|
|
return AliveScoresNb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
|
|
|
|
|
/** Number of lives cumulated
|
|
|
|
|
*
|
|
|
|
|
* @return Number of lives cumulated
|
|
|
|
|
*/
|
|
|
|
|
Integer GetRemainingLivesNb() {
|
|
|
|
|
declare Integer LivesNb;
|
|
|
|
|
foreach (Score in Scores) {
|
|
|
|
|
LivesNb += GetScoreRemainingLives(Score);
|
|
|
|
|
}
|
|
|
|
|
return LivesNb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
|
|
|
|
|
/** Compute Lose of Life Milestones
|
|
|
|
|
*
|
|
|
|
@ -715,14 +735,20 @@ Integer[] GetAllMilestones() {
|
|
|
|
|
*/
|
|
|
|
|
Integer GetNextMilestone(Integer _RoundNb, Integer _AliveScoresNb) {
|
|
|
|
|
if (_AliveScoresNb <= 0) return 0;
|
|
|
|
|
|
|
|
|
|
declare Integer ThresholdValue = _AliveScoresNb;
|
|
|
|
|
if (S_EliminationMode == C_ElimMode_Lives) {
|
|
|
|
|
ThresholdValue = GetRemainingLivesNb();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
declare Integer[] Milestones = GetAllMilestones();
|
|
|
|
|
|
|
|
|
|
declare Integer NextMilestone = 0;
|
|
|
|
|
foreach (Milestone in Milestones) {
|
|
|
|
|
if (S_EliminatePerRounds && Milestone > _RoundNb) {
|
|
|
|
|
if (S_EliminationMode == C_ElimMode_Rounds && Milestone > _RoundNb) {
|
|
|
|
|
NextMilestone = Milestone;
|
|
|
|
|
break;
|
|
|
|
|
} else if (!S_EliminatePerRounds && Milestone < _AliveScoresNb) { // could be optimized but can change original behavior
|
|
|
|
|
} else if ((S_EliminationMode == C_ElimMode_Official || S_EliminationMode == C_ElimMode_Lives) && Milestone < ThresholdValue) { // could be optimized but can change original behavior
|
|
|
|
|
NextMilestone = Milestone;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -739,11 +765,17 @@ Integer GetNextMilestone(Integer _RoundNb, Integer _AliveScoresNb) {
|
|
|
|
|
Integer GetLossOfLifeNb(Integer _RoundNb, Integer _AliveScoresNb) {
|
|
|
|
|
if (_AliveScoresNb <= 1) return 0;
|
|
|
|
|
if (_RoundNb <= S_RoundsWithoutElimination) return 0;
|
|
|
|
|
|
|
|
|
|
declare Integer ThresholdValue = _AliveScoresNb;
|
|
|
|
|
if (S_EliminationMode == C_ElimMode_Lives) {
|
|
|
|
|
ThresholdValue = GetRemainingLivesNb();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
declare Integer[] Milestones = GetAllMilestones();
|
|
|
|
|
|
|
|
|
|
declare Integer NumberOfElimination;
|
|
|
|
|
|
|
|
|
|
if (S_EliminatePerRounds) {
|
|
|
|
|
if (S_EliminationMode == C_ElimMode_Rounds) {
|
|
|
|
|
Milestones = Milestones.slice(1);
|
|
|
|
|
NumberOfElimination = 1;
|
|
|
|
|
foreach (Milestone in Milestones) {
|
|
|
|
@ -751,10 +783,10 @@ Integer GetLossOfLifeNb(Integer _RoundNb, Integer _AliveScoresNb) {
|
|
|
|
|
NumberOfElimination += 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
} else if (S_EliminationMode == C_ElimMode_Official || S_EliminationMode == C_ElimMode_Lives) {
|
|
|
|
|
declare Integer RoundMinEliminations = Milestones.count + 1;
|
|
|
|
|
foreach (Index => Milestone in Milestones) {
|
|
|
|
|
if (Milestone < _AliveScoresNb) {
|
|
|
|
|
if (Milestone < ThresholdValue) {
|
|
|
|
|
RoundMinEliminations = Index + 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -842,7 +874,6 @@ Text GetScoreRemainingLivesText(CSmScore _Score) {
|
|
|
|
|
Void UpdateCustomRanking(Boolean _DisplayTimes) {
|
|
|
|
|
declare Text[] AccountIdsToDisplay = [];
|
|
|
|
|
declare Text[][Text] CustomPoints = [];
|
|
|
|
|
declare Integer[Text] CustomTimes = [];
|
|
|
|
|
|
|
|
|
|
declare Integer ParticipantsNb = GetParticipantsNb();
|
|
|
|
|
declare Integer AliveScoresNb = GetAliveScoresNb();
|
|
|
|
@ -853,11 +884,11 @@ Void UpdateCustomRanking(Boolean _DisplayTimes) {
|
|
|
|
|
if (!ScoreIsRegistered(Score)) continue;
|
|
|
|
|
AccountIdsToDisplay.add(Score.User.WebServicesUserId);
|
|
|
|
|
if (!ScoreIsAlive(Score)) continue;
|
|
|
|
|
|
|
|
|
|
Scores::SetPlayerMatchPoints(Score, Scores.count + ParticipantsNb - Index);
|
|
|
|
|
if (_DisplayTimes && Score.PrevRaceTimes.count == 0) {
|
|
|
|
|
CustomTimes[Score.User.WebServicesUserId] = 0; //@ prev race is updated automatically at the moment (22/10/20) so we need to use this
|
|
|
|
|
} else if (!_DisplayTimes) {
|
|
|
|
|
|
|
|
|
|
if (_DisplayTimes) {
|
|
|
|
|
Scores::SetPlayerMatchPoints(Score, ParticipantsNb + ParticipantsNb - Index);
|
|
|
|
|
} else {
|
|
|
|
|
Scores::SetPlayerMatchPoints(Score, ParticipantsNb + GetScoreRemainingLives(Score));
|
|
|
|
|
CustomPoints[Score.User.WebServicesUserId] = [GetScoreRemainingLivesText(Score)];
|
|
|
|
|
}
|
|
|
|
|
if (AliveScoresNb == 1 && ParticipantsNb > 1) {
|
|
|
|
@ -869,7 +900,9 @@ Void UpdateCustomRanking(Boolean _DisplayTimes) {
|
|
|
|
|
declare Text[Text] CustomRanks = [];
|
|
|
|
|
Race::SortScores(Race::C_Sort_TotalPoints);
|
|
|
|
|
foreach (Score in Scores) {
|
|
|
|
|
if (ScoreIsAlive(Score)) {
|
|
|
|
|
if (AliveScoresNb == 1 && ScoreIsAlive(Score)) {
|
|
|
|
|
CustomRanks[Score.User.WebServicesUserId] = "1";
|
|
|
|
|
} else if (ScoreIsAlive(Score)) {
|
|
|
|
|
CustomRanks[Score.User.WebServicesUserId] = "-";
|
|
|
|
|
} else if (ScoreIsRegistered(Score)) {
|
|
|
|
|
CustomRanks[Score.User.WebServicesUserId] = ""^Rank;
|
|
|
|
@ -881,7 +914,6 @@ Void UpdateCustomRanking(Boolean _DisplayTimes) {
|
|
|
|
|
UIModules_ScoresTable::SetCustomRanks(CustomRanks);
|
|
|
|
|
UIModules_ScoresTable::DisplayOnly(AccountIdsToDisplay); // Display only registered players
|
|
|
|
|
UIModules_ScoresTable::SetCustomPoints(CustomPoints);
|
|
|
|
|
UIModules_ScoresTable::SetCustomTimes(CustomTimes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
|
|
|
|
@ -926,7 +958,7 @@ Boolean MatchIsOver(Integer _RoundNb) {
|
|
|
|
|
*/
|
|
|
|
|
Boolean MapIsOver(Integer _RoundNb) {
|
|
|
|
|
if (MatchIsOver(_RoundNb)) return True;
|
|
|
|
|
if (S_RoundsPerMap > 0 && MB_GetRoundCount() >= S_RoundsPerMap) return True; //< There is a rounds limit and it is reached
|
|
|
|
|
if (S_RoundsPerMap > 0 && MB_GetValidRoundCount() >= S_RoundsPerMap) return True; //< There is a rounds limit and it is reached
|
|
|
|
|
|
|
|
|
|
return False;
|
|
|
|
|
}
|
|
|
|
@ -975,8 +1007,8 @@ Void UpdateMatchInfos(Integer _CurrentRoundNb, Integer _LossOfLife, Integer _Ali
|
|
|
|
|
if (MapNumber == 0) MapNumber = 3;
|
|
|
|
|
|
|
|
|
|
if (_CurrentRoundNb == -1) MatchInfo = "Warm Up";
|
|
|
|
|
else if (S_EliminatePerRounds) MatchInfo = "Match Round "^ _CurrentRoundNb ^ " - Round "^ ML::Max(MB_GetRoundCount(), 1) ^"/"^ S_RoundsPerMap ^" of Map "^ MapNumber ^"/"^ MapList.count;
|
|
|
|
|
else MatchInfo = "Round "^ ML::Max(MB_GetRoundCount(), 1) ^"/"^ S_RoundsPerMap ^ " - Map "^ MapNumber ^"/"^ MapList.count;
|
|
|
|
|
else if (S_EliminationMode == C_ElimMode_Rounds) MatchInfo = "Match Round "^ _CurrentRoundNb ^ " - Round "^ ML::Max(MB_GetValidRoundCount(), 1) ^"/"^ S_RoundsPerMap ^" of Map "^ MapNumber ^"/"^ MapList.count;
|
|
|
|
|
else MatchInfo = "Round "^ ML::Max(MB_GetValidRoundCount(), 1) ^"/"^ S_RoundsPerMap ^ " - Map "^ MapNumber ^"/"^ MapList.count;
|
|
|
|
|
} else if (_CurrentRoundNb == -1) {
|
|
|
|
|
MatchInfo = "Warm Up";
|
|
|
|
|
} else {
|
|
|
|
@ -987,17 +1019,20 @@ Void UpdateMatchInfos(Integer _CurrentRoundNb, Integer _LossOfLife, Integer _Ali
|
|
|
|
|
if (_LossOfLife == 0) {
|
|
|
|
|
MatchInfo ^= "\nNo loss of life";
|
|
|
|
|
ScoreTablesInfo ^= "\nNo loss of life this round";
|
|
|
|
|
} else if (S_EliminatePerRounds && _LossOfLife > 1 && _Milestone > 1) {
|
|
|
|
|
MatchInfo ^= "\n"^ _LossOfLife ^" lose of life until Match Round "^ _Milestone;
|
|
|
|
|
} else if (S_EliminationMode == C_ElimMode_Rounds && _LossOfLife > 1 && _Milestone > 1) {
|
|
|
|
|
MatchInfo ^= "\n"^ _LossOfLife ^" lives lost until Match Round "^ _Milestone;
|
|
|
|
|
ScoreTablesInfo ^= "\n"^ _LossOfLife ^" players will lose a life until Match Round "^ _Milestone;
|
|
|
|
|
} else if (!S_EliminatePerRounds && _LossOfLife > 1 && _Milestone > 1) {
|
|
|
|
|
MatchInfo ^= "\n"^ _LossOfLife ^" lose of life until "^ _Milestone ^" players are alive";
|
|
|
|
|
} else if (S_EliminationMode == C_ElimMode_Lives && _LossOfLife > 1 && _Milestone > 1) {
|
|
|
|
|
MatchInfo ^= "\n"^ _LossOfLife ^" lives lost until "^ _Milestone ^" lives left";
|
|
|
|
|
ScoreTablesInfo ^= "\n"^ _LossOfLife ^" players will lose a life until "^ _Milestone ^" lives left";
|
|
|
|
|
} else if (S_EliminationMode == C_ElimMode_Official && _LossOfLife > 1 && _Milestone > 1) {
|
|
|
|
|
MatchInfo ^= "\n"^ _LossOfLife ^" lives lost until "^ _Milestone ^" players are alive";
|
|
|
|
|
ScoreTablesInfo ^= "\n"^ _LossOfLife ^" players will lose a life until "^ _Milestone ^" players are alive";
|
|
|
|
|
} else if (_LossOfLife > 1) {
|
|
|
|
|
MatchInfo ^= "\n"^ _LossOfLife ^" lose of life";
|
|
|
|
|
MatchInfo ^= "\n"^ _LossOfLife ^" players will lose a life";
|
|
|
|
|
ScoreTablesInfo ^= "\n"^ _LossOfLife ^" players will lose a life per round";
|
|
|
|
|
} else {
|
|
|
|
|
MatchInfo ^= "\n1 lose of life";
|
|
|
|
|
MatchInfo ^= "\n1 player will lose a life";
|
|
|
|
|
ScoreTablesInfo ^= "\n1 player will lose a life";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1022,6 +1057,13 @@ Void UpdateMatchName() {
|
|
|
|
|
Net_MultiLivesKnockout_LiveRanking_MatchName = S_MatchName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
|
|
|
|
|
// Update Match Infos
|
|
|
|
|
Void UpdateMatchInfosPosition() {
|
|
|
|
|
declare netwrite Boolean Net_MultiLivesKnockout_AlternativePosition for Teams[0];
|
|
|
|
|
Net_MultiLivesKnockout_AlternativePosition = S_AlternativeMatchInfosPosition;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
|
|
|
|
|
// Update Number of lives
|
|
|
|
|
Void UpdateMaximumLives() {
|
|
|
|
@ -1048,6 +1090,7 @@ Void UpdateLossOfLife(Integer _LossOfLife) {
|
|
|
|
|
*/
|
|
|
|
|
Void UpdateInterfacesInfo(Integer _CurrentRoundNb, Integer _LossOfLife, Integer _AliveScoresNb) {
|
|
|
|
|
UpdateMatchInfos(_CurrentRoundNb, _LossOfLife, _AliveScoresNb, GetNextMilestone(_CurrentRoundNb, _AliveScoresNb));
|
|
|
|
|
UpdateMatchInfosPosition();
|
|
|
|
|
UpdateMatchName();
|
|
|
|
|
UpdateMaximumLives();
|
|
|
|
|
UpdateLossOfLife(_LossOfLife);
|
|
|
|
@ -1075,7 +1118,7 @@ Void LoadManialinks() {
|
|
|
|
|
<label id="label-player-time" pos="54 -2" z-index="2" size="10 5" halign="right" valign="center" textsize="2" textfont="Nadeo/Trackmania/BebasNeueRegular" textcolor="ffffff"/>
|
|
|
|
|
</framemodel>
|
|
|
|
|
<frame id="frame-global" hidden="1">
|
|
|
|
|
<frame id="frame-matchinfo" pos="-160 80">
|
|
|
|
|
<frame id="frame-matchinfo" pos="-160 80" hidden="1">
|
|
|
|
|
<quad size="55 18" bgcolor="000000" opacity="0.6"/>
|
|
|
|
|
<label id="label-matchinfo-name" pos="3 -7.8" size="49 6" valign="bottom" textsize="3.5" textfont="GameFontExtraBold" textcolor="ffffff" text=""/>
|
|
|
|
|
<label id="label-matchinfo-info" pos="3 -8.8" size="49 8" textsize="1.3" maxline="2" linespacing="1.1" textfont="GameFontSemiBold" textcolor="ffffff" text="" />
|
|
|
|
@ -1186,16 +1229,23 @@ Void ToggleUI(Boolean _Display, Boolean _UseAnimation) {
|
|
|
|
|
// Update Match info
|
|
|
|
|
Void UpdateMatchInfo() {
|
|
|
|
|
declare CMlFrame Frame <=> (Page.GetFirstChild("frame-matchinfo") as CMlFrame);
|
|
|
|
|
|
|
|
|
|
declare netread Text Net_MultiLivesKnockout_LiveRanking_MatchName for Teams[0];
|
|
|
|
|
Frame.Visible = (Net_MultiLivesKnockout_LiveRanking_MatchName != "");
|
|
|
|
|
|
|
|
|
|
declare CMlLabel Label_Name <=> (Frame.GetFirstChild("label-matchinfo-name") as CMlLabel);
|
|
|
|
|
declare CMlLabel Label_Info <=> (Frame.GetFirstChild("label-matchinfo-info") as CMlLabel);
|
|
|
|
|
|
|
|
|
|
declare netread Text Net_MultiLivesKnockout_LiveRanking_MatchName for Teams[0];
|
|
|
|
|
declare netread Boolean Net_MultiLivesKnockout_AlternativePosition for Teams[0];
|
|
|
|
|
if (Net_MultiLivesKnockout_AlternativePosition) Frame.RelativePosition_V3.Y = 50.;
|
|
|
|
|
else Frame.RelativePosition_V3.Y = 80.;
|
|
|
|
|
|
|
|
|
|
Label_Name.Value = Net_MultiLivesKnockout_LiveRanking_MatchName;
|
|
|
|
|
Tools::FitLabelValue(Label_Name, 3.5, 2., .2);
|
|
|
|
|
|
|
|
|
|
declare netread Text Net_MultiLivesKnockout_LiveRanking_MatchInfo for Teams[0];
|
|
|
|
|
Label_Info.Value = Net_MultiLivesKnockout_LiveRanking_MatchInfo;
|
|
|
|
|
Tools::FitLabelValue(Label_Info, 1.3, .8, .1);
|
|
|
|
|
Tools::FitLabelValue(Label_Info, 1.3, .4, .1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
|
|
|
|
@ -1332,15 +1382,17 @@ Void UpdateRanking() {
|
|
|
|
|
} else {
|
|
|
|
|
declare Ident PlayerId = ScoreIdToPlayerId.get(Score.Id, NullId);
|
|
|
|
|
if (PlayerId != NullId) {
|
|
|
|
|
declare CSmPlayer Player <=> Players[PlayerId];
|
|
|
|
|
PlayerState.CPNb = Player.RaceWaypointTimes.count;
|
|
|
|
|
PlayerState.IsNotPlaying = (Player.SpawnStatus == CSmPlayer::ESpawnStatus::NotSpawned);
|
|
|
|
|
PlayerState.Finished = (Score.PrevRaceTimes.count != 0);
|
|
|
|
|
|
|
|
|
|
if (PlayerState.CPNb > 0) {
|
|
|
|
|
PlayerState.LastCPTime = Player.RaceWaypointTimes[-1];
|
|
|
|
|
declare CSmPlayer Player <=> Players.get(PlayerId, Null);
|
|
|
|
|
if (Player != Null) {
|
|
|
|
|
PlayerState.CPNb = Player.RaceWaypointTimes.count;
|
|
|
|
|
PlayerState.IsNotPlaying = (Player.SpawnStatus == CSmPlayer::ESpawnStatus::NotSpawned);
|
|
|
|
|
PlayerState.Finished = (Score.PrevRaceTimes.count != 0);
|
|
|
|
|
|
|
|
|
|
if (PlayerState.CPNb > 0) {
|
|
|
|
|
PlayerState.LastCPTime = Player.RaceWaypointTimes[-1];
|
|
|
|
|
}
|
|
|
|
|
if (GlobalLastCPTime < PlayerState.LastCPTime) GlobalLastCPTime = PlayerState.LastCPTime;
|
|
|
|
|
}
|
|
|
|
|
if (GlobalLastCPTime < PlayerState.LastCPTime) GlobalLastCPTime = PlayerState.LastCPTime;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1393,7 +1445,10 @@ Void UpdateRanking() {
|
|
|
|
|
PlayerState.InDanger = (Rank >= LostOfLifeRank);
|
|
|
|
|
|
|
|
|
|
if (FirstPlayer == Null) {
|
|
|
|
|
FirstPlayer <=> Players[ScoreIdToPlayerId.get(PlayerState.ScoreId, NullId)];
|
|
|
|
|
declare Ident FirstPlayerId = ScoreIdToPlayerId.get(PlayerState.ScoreId, NullId);
|
|
|
|
|
if (FirstPlayerId != NullId) {
|
|
|
|
|
FirstPlayer <=> Players[FirstPlayerId];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (FirstPlayer != Null) {
|
|
|
|
@ -1582,7 +1637,7 @@ main() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GUIPlayer == Null && Last_GUIPlayer != NullId) {
|
|
|
|
|
Last_GUIPlayer == NullId;
|
|
|
|
|
Last_GUIPlayer = NullId;
|
|
|
|
|
UpdateLiveRanking = True;
|
|
|
|
|
} else if (GUIPlayer != Null && Last_GUIPlayer != GUIPlayer.Id) {
|
|
|
|
|
Last_GUIPlayer = GUIPlayer.Id;
|
|
|
|
|