forked from mirrors/0ad
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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user