/* TimeTrial Gamemode for Shootmania Copyright (C) 2013 TGYoshi This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #RequireContext CSmMode #Include "Libs/Nadeo/Mode.Script.txt" #Include "MathLib" as MathLib #Include "TextLib" as TextLib #Include "Libs/Nadeo/ShootMania/SM.Script.txt" as SM #Include "Libs/Nadeo/ShootMania/Score.Script.txt" as Score #Const CompatibleMapTypes "TimeTrial" #Const Version "V3.4-beta public" #Const MatchTime 1500000 #Const SpawnInterval 5 #Const C_UITickPeriod 200 Text GetTime(Integer StartTime) { declare Text r = TextLib::TimeToText(Now-StartTime); declare Text b = TextLib::ToText(Now-StartTime); r ^= "."^TextLib::SubString(b, TextLib::Length(b)-3, 3); return r; } Text GetTime2(Integer RealTime) { declare Text r = TextLib::TimeToText(RealTime); declare Text b = TextLib::ToText(RealTime); r ^= "."^TextLib::SubString(b, TextLib::Length(b)-3, 3); return r; } Void ThrowMessage(Text msg, Boolean notice) { if (notice) { UIManager.UIAll.SendNotice(msg, CUIConfig::ENoticeLevel::MatchInfo, Null, CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::TieBreakPoint, 0); } else { UIManager.UIAll.BigMessage = msg; } } Text MLGet_ScoreTable(Boolean ShowLP) { declare ML = ""; declare List = ""; declare i = 0; declare CSmPlayer[] Listed; declare CSmPlayer[] AllPlayers; foreach (Player in Players) { AllPlayers.add(Player); } foreach (Player in Spectators) { AllPlayers.add(Player); } declare height = (AllPlayers.count)/2; if (height * 2 != AllPlayers.count) height += 1; if (height < 8) height = 8; foreach (Score in Scores) { foreach (Player in AllPlayers) { if (Score.Points != Player.Score.Points || Listed.exists(Player)) continue; Listed.add(Player); //for (j, 1, 5) { i+=1; declare Integer BestTime for Player; declare Integer BestResp for Player; declare Text LPMsg = ""; if (ShowLP) { if (Player.Score.IsRegisteredForLadderMatch) LPMsg = "$faa$o+"^Player.Score.LadderScore^" LP"; else LPMsg = "$faa$o(unofficial)"; } declare wpos = "1"; declare hpos = ""^-7*i-1; if (i > height) { wpos = "81"; hpos = ""^-7*(i-height)-1; } List ^= """