diff --git a/src/history_table.as b/src/history_table.as index 0e182ab..6b74a57 100644 --- a/src/history_table.as +++ b/src/history_table.as @@ -77,7 +77,7 @@ class HistoryTable string formattedTime = ""; string icon = ""; if (@target != null && target.time > 0) { - icon = target.icon; + icon = target.coloredIcon(); formattedTime = "\\$fff" + Time::Format(target.time); } else { icon = Icons::Spinner; @@ -132,7 +132,7 @@ class HistoryTable } if (settingColumnShowMedal) { UI::TableNextColumn(); - UI::Text(run.beaten.icon); + UI::Text(run.beaten.coloredIcon()); } if (settingColumnShowTime) { UI::TableNextColumn(); diff --git a/src/main.as b/src/main.as index ef3b7a3..0c980d5 100755 --- a/src/main.as +++ b/src/main.as @@ -58,6 +58,7 @@ void Main() #if DEPENDENCY_WARRIORMEDALS print("WarriorMedals detected"); targets.InsertAt(1, warrior); + warrior.color = WarriorMedals::GetColorStr(); #else warn("WarriorMedals not installed"); #endif @@ -144,7 +145,7 @@ void RenderChangeTargetPopup() if (UI::BeginPopup(POPUP_CHANGE_TARGET)) { string text = TEXT_DEFAULT_TARGET; if (!autoChangeTarget && @currentTarget != null) { - text = currentTarget.icon + "\\$fff" + Time::Format(currentTarget.time); + text = currentTarget.coloredIcon() + "\\$fff" + Time::Format(currentTarget.time); } if (UI::BeginCombo(Icons::ClockO, text)) { if (UI::Selectable(TEXT_DEFAULT_TARGET, autoChangeTarget)) { @@ -158,10 +159,10 @@ void RenderChangeTargetPopup() continue; } if (UI::Selectable( - target.icon + "\\$fff" + Time::Format(target.time), + target.coloredIcon() + "\\$fff" + Time::Format(target.time), @target == @currentTarget && !autoChangeTarget )) { - print("Target change " + target.icon); + print("Target change " + target.coloredIcon()); autoChangeTarget = false; SetTarget(target); UI::CloseCurrentPopup(); @@ -228,11 +229,11 @@ void RenderMenu() { continue; } if (UI::MenuItem( - target.icon + " \\$fff" + Time::Format(target.time), + target.coloredIcon() + " \\$fff" + Time::Format(target.time), "", @target == @currentTarget && !autoChangeTarget )) { - print("Target change " + target.icon); + print("Target change " + target.coloredIcon()); autoChangeTarget = false; SetTarget(target); } @@ -297,7 +298,7 @@ void SetTarget(Target @target) return; } @currentTarget = target; - print("New target: " + target.icon); + print("New target: " + target.coloredIcon()); runs.UpdateDeltaTimes(currentTarget, thresholdsTable); } @@ -469,17 +470,15 @@ void OnMapChange(CGameCtnChallenge@ map) uint newPbTime = scoreMgr.Map_GetRecord_v2(userId, map.MapInfo.MapUid, "PersonalBest", "", "TimeAttack", ""); if (newPbTime != 0) { pb.time = newPbTime; - print(pb.icon + Time::Format(pb.time)); + print(pb.coloredIcon() + Time::Format(pb.time)); } } UpdateCurrentTarget(); #if DEPENDENCY_CHAMPIONMEDALS - // UpdateChampionTime(); UpdateCustomMedalTime(champion, function() { return ChampionMedals::GetCMTime(); }); #endif #if DEPENDENCY_WARRIORMEDALS - // UpdateWarriorTime(); UpdateCustomMedalTime(warrior, function() { return WarriorMedals::GetWMTimeAsync(); }); #endif } @@ -496,7 +495,7 @@ void UpdateCustomMedalTime(Target @medal, MedalTimeCB @GetTime) { int newTime = GetTime(); if (medal.time != int(newTime)) { medal.time = newTime; - print(medal.icon + Time::Format(medal.time) + " attempt#" + attempts); + print(medal.coloredIcon() + Time::Format(medal.time) + " attempt#" + attempts); UpdateCurrentTarget(); } sleep(1000 * attempts); diff --git a/src/run.as b/src/run.as index 0e09117..2b86967 100755 --- a/src/run.as +++ b/src/run.as @@ -65,7 +65,7 @@ class Run string ToString() { return - "Run #" + id + " " + Time::Format(time) + beaten.icon + " \\$fff " + "Run #" + id + " " + Time::Format(time) + beaten.coloredIcon() + " \\$fff " + ICON_PB + ICON_DELTA + ": " + pbDelta + " isPB: " + (isPB ? Icons::Check : Icons::Times) + " No respawn time: " + Time::Format(noRespawnTime) diff --git a/src/target.as b/src/target.as index c142e63..60bbfc2 100644 --- a/src/target.as +++ b/src/target.as @@ -5,10 +5,15 @@ class Target { Target(string &in color, string &in icon, int time = 0) { this.color = color; - this.icon = color + icon; + this.icon = icon; this.time = time; } + string coloredIcon() + { + return color + icon; + } + bool hasTime() { return time > 0;