Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

feat(gameclient): fold the power bar's step into the bar's centre

Olcay Seygan0578ed50d8b3
diff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
index 74f91fa65..a67e10cde 100644
--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html
+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
@@ -21,8 +21,8 @@
moving with the bar when it slides or minimises; .w and .h are 0 and
{{panelN.shown}} is "hidden" when a minimised bar has stood it down
{{left.x}} .y .w .h the box round the radar, so the left panel is only as big as its bezel
- {{centre.x}} .y .w .h the box round the command grid; {{centre.shown}} as above. The money's and
- the power bar's steps over it are drawn from MoneyDisplay and PowerWindow
+ {{centre.x}} .y .w .h the box round the command grid and the power bar over it; {{centre.shown}}
+ as above. The money's step over it is drawn from MoneyDisplay
{{right.x}} .y .w .h the box round the portrait and the experience bar. The promotion and
minimise buttons are moved to sit over its top right corner
{{Name.x}} .y .w .h the rectangle of the bar's window Name, {{Name.shown}} "shown" or "hidden"
@@ -63,12 +63,10 @@
.right { margin: -22px 0 0 -8px; padding: 22px 8px 8px 8px; }
.centre { margin: -10px 0 0 -6px; padding: 10px 6px 6px 6px; }
- /* over the centre, two steps, each narrower than the one under it: the power bar's, then on top
- the money's. Each hangs down behind the step under it, which is drawn after it and covers the
- join, so none needs to know where the next one starts */
+ /* over the centre, a narrower step for the money. It hangs down behind the centre, which is drawn
+ after it and covers the join, so it needs no idea where the centre starts */
.step { padding-bottom: 30px; }
.step .rail { height: 3px; }
- .powerstep { margin: -8px 0 0 -14px; padding-top: 8px; padding-left: 14px; padding-right: 14px; }
.moneystep { margin: -5px 0 0 -8px; padding-top: 5px; padding-left: 8px; padding-right: 8px; }
/* a bezel: a window set into the panel, four pixels of steel round a black lip */
@@ -119,7 +117,6 @@
<div class="alert {{WinUAttack.state}}">{{text:GUI:BarUnderAttack}}</div>
</div>
<div class="piece panel solid step moneystep {{centre.shown}} {{MoneyDisplay.shown}}" style="left: {{MoneyDisplay.x}}px; top: {{MoneyDisplay.y}}px; width: {{MoneyDisplay.w}}px; height: {{MoneyDisplay.h}}px"><div class="rail"></div></div>
- <div class="piece panel solid step powerstep {{centre.shown}} {{PowerWindow.shown}}" style="left: {{PowerWindow.x}}px; top: {{PowerWindow.y}}px; width: {{PowerWindow.w}}px; height: {{PowerWindow.h}}px"><div class="rail"></div></div>
<div class="piece panel solid centre {{centre.shown}}" style="left: {{centre.x}}px; top: {{centre.y}}px; width: {{centre.w}}px; height: {{centre.h}}px">
<div class="rail"></div>
<div class="worker button {{ButtonIdleWorker.state}}" data-click="press:ButtonIdleWorker"><div class="cap">{{text:GUI:BarIdleWorker}}</div></div>
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index e082b79e6..f96997d09 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -10108,12 +10108,15 @@ static const char *const CONTROL_BAR_STOOD_DOWN[] = { "ButtonOptions", "ButtonId
static const std::string PRESS_ACTION = "press:";
/** The windows each panel is drawn round, so a panel is only as big as what it holds: the left one
- * the radar, the right one the portrait and the experience bar, the centre the command grid. The
- * money and the power bar stand on steps of their own over the centre, drawn from their windows'
- * rectangles. NULL ends each list. */
+ * the radar, the right one the portrait and the experience bar, the centre the command grid with
+ * the power bar over it. The money stands on a step of its own over the centre, drawn from its
+ * window's rectangle. NULL ends each list. */
static const char *const CONTROL_BAR_LEFT[] = { "LeftHUD", NULL };
static const char *const CONTROL_BAR_RIGHT[] = { "RightHUD", "GeneralsExp", "ExpBarForeground", NULL };
-static const char *const CONTROL_BAR_CENTRE[] = { "CommandWindow", "ObserverPlayerListWindow", "ButtonPlaceBeacon", NULL };
+static const char *const CONTROL_BAR_CENTRE[] =
+{
+ "CommandWindow", "ObserverPlayerListWindow", "PowerWindow", "ButtonPlaceBeacon", NULL
+};
/** The promotion and minimise buttons, small, side by side in the right panel's top right corner,
* the minimise button outermost. 800x600 pixels. */