mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-20 15:23:56 -07:00
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:
parent
f615b71c30
commit
1348c936b1
2 changed files with 8 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue