Fix positioning of the research progress icons below the counters overlay
Bug found by: ffffffff Differential Revision: https://code.wildfiregames.com/D3525 This was SVN commit r24868.
This commit is contained in:
parent
5e1b84ed64
commit
11fde58751
@ -13,6 +13,7 @@ class OverlayCounterManager
|
||||
this.enabledCounters = [];
|
||||
this.lastTick = undefined;
|
||||
this.resizeHandlers = [];
|
||||
this.lastHeight = undefined;
|
||||
this.initSize = this.dataCounter.size;
|
||||
|
||||
for (let name of this.availableCounterNames())
|
||||
@ -91,6 +92,7 @@ class OverlayCounterManager
|
||||
txt += newTxt + "\n";
|
||||
}
|
||||
|
||||
let height;
|
||||
if (lineCount)
|
||||
{
|
||||
this.dataCounter.caption = txt;
|
||||
@ -103,12 +105,19 @@ class OverlayCounterManager
|
||||
size.bottom = size.top + textSize.height;
|
||||
size.left = size.right - textSize.width;
|
||||
this.dataCounter.size = size;
|
||||
height = textSize.height;
|
||||
}
|
||||
else
|
||||
height = 0;
|
||||
|
||||
this.dataCounter.hidden = !lineCount;
|
||||
|
||||
for (let handler of this.resizeHandlers)
|
||||
handler(textSize);
|
||||
if (this.lastHeight != height)
|
||||
{
|
||||
this.lastHeight = height;
|
||||
for (let handler of this.resizeHandlers)
|
||||
handler(height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@ class ResearchProgress
|
||||
let updater = this.updateResearchProgress.bind(this);
|
||||
registerSimulationUpdateHandler(updater);
|
||||
playerViewControl.registerViewedPlayerChangeHandler(updater);
|
||||
g_OverlayCounterManager.registerResizeHandler(this.setTopOffset.bind(this));
|
||||
}
|
||||
|
||||
setTopOffset(offset)
|
||||
|
Loading…
Reference in New Issue
Block a user