Fix FPS/realtime/matchtime/ceasefire overlay counter visibility following 38e06fce7e/D2391 when starting with all counters disabled or starting a match with ceasefire disabled but ceasefire counter enabled, reported by Polakrity.

This was SVN commit r23112.
This commit is contained in:
elexis 2019-10-29 16:28:36 +00:00
parent f615b71c30
commit 1348c936b1
2 changed files with 8 additions and 4 deletions

View file

@ -13,12 +13,16 @@ class OverlayCounterManager
this.counters = [];
this.enabledCounters = [];
this.lastTick = undefined;
this.lastLineCount = 0;
this.lastLineCount = undefined;
this.resizeHandlers = [];
for (let name of this.availableCounterNames())
{
let counter = new OverlayCounterTypes.prototype[name](this);
let counterType = OverlayCounterTypes.prototype[name];
if (counterType.IsAvailable && !counterType.IsAvailable())
continue;
let counter = new counterType(this);
this.counters.push(counter);
counter.updateEnabled();
}

View file

@ -17,8 +17,6 @@ OverlayCounterTypes.prototype.RemainingCeasefire = class extends OverlayCounter
get()
{
if (!g_SimState)
return "";
return timeToString(g_SimState.ceasefireTimeRemaining);
}
};
@ -26,3 +24,5 @@ OverlayCounterTypes.prototype.RemainingCeasefire = class extends OverlayCounter
OverlayCounterTypes.prototype.RemainingCeasefire.prototype.Config = "gui.session.ceasefirecounter";
OverlayCounterTypes.prototype.RemainingCeasefire.prototype.Hotkey = "ceasefirecounter.toggle";
OverlayCounterTypes.prototype.RemainingCeasefire.IsAvailable = () => GetSimState().ceasefireActive;