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.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
feat(gameclient): power bar over the grid, money on it, portrait bar beside it
Olcay Seygan8c6204ce95d1
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex aeda7f151..289a545b1 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -624,9 +624,9 @@ A third pass went through the generals' powers, promotions and unit abilities.- Both are an ordinary web page with a stylesheet, in the game's Window folder. Change the colours, the sizes or the order there and the next match you watch draws it that way, and the page opens in a browser too.- A minimised command bar stays minimised. Changing seats, or clicking another player's unit while watching, put the whole bar back up over the battlefield you had just cleared. A new match still opens with the bar up.- The command bar's frame is drawn new, in the same steel as the boards. Each panel holds one thing and is exactly its size, the radar, the command grid, the portrait with the experience bar, and wears a steel border outside it. Grey for America, red for China, sand for GLA. It slides and minimises with the bar, and like the boards it is a page in the Window folder; take the page away and the old painted bar comes back.-- The command bar is laid out anew, all of it running rightwards from the bottom left corner, and it is smaller: at 1920x1080 it stands 248 pixels tall where the old bar took 312, and it ends a third of the way across, so the rest of the screen's bottom edge is battlefield but for the general's powers in the corner. The radar sits in the corner with your general's experience bar standing beside it, and on its top edge the under-attack light, the skills key with your rank's stars on that, and over the stars the idle worker button whenever a worker stands idle. Next to it is one grid of eighteen buttons, six across and three down, and every button is its own key: Q W E R T Y over A S D F G H over Z X C V B N. No more two-key building shortcuts and no second bars: a dozer's buildings, a factory's units, a unit's abilities and upgrades and its orders all share the grid, each a single press. The orders stay put whatever you select. For a unit, A attacks, S stops, D attack-moves, V moves, Z ejects the passengers, X guards and C holds position; for a building, N sells it, B sets its rally point and Z empties its garrison. Workers keep three of their own: N clears mines on every side's worker and dozer, H swaps a GLA worker between real and fake buildings, and B is the Demolition worker's suicide charge. Everything else packs into the top left corner, two rows at a time, Q A W Z S E X D R C and on, so the buildings you reach for most sit under your fingers; what a building makes comes first and its upgrades after. Only the buttons your selection has are drawn, and with nothing selected the grid is gone altogether and only the power bar stands. Its buttons are a fifth bigger than the rest of the bar's, so what you build stands out. Attack, hold position and move are buttons now, where no unit ever had one, with pictures painted to sit among the game's own: a crosshair on a red plate over a burning sky, a raised palm on a blue one, an arrow on a green diamond. V, or a click on the arrow, is a move for the left button: the next click on the ground sends the selection there, and a drag lays them out along the line the way a right drag does. Over the grid runs a portrait bar only as long as what it holds. Select one unit and its upgrades follow its portrait; select a group and the bar holds every kind of unit in it once, each with how many you have, the one Tab has picked lit and the rest dimmed. The power bar stands up at the grid's right end. Your money has moved to the middle of the screen's top edge. The Legacy mouse and keyboard and the W A S D camera are gone from the Options screen: there is one way to play, and an Options.ini that still names them loads as it always did.-- Every panel of the bar is only as big as what it holds now, and stands on the bottom of the screen. The radar's border runs out to the screen's left edge. The power bar stands in a steel groove of its own at the right end of the command grid, twenty cells that light up from the bottom with your production and fill the groove when full, the consumption marked by a white needle across it. The money hangs from the top edge of the screen in a steel plate of its own, the figure in a dark well. Everything the old painting filled round them is battlefield again, and a click there lands on the battlefield.-- The bar's own buttons are drawn to match, steel caps lit gold under the pointer and pressed in when pushed. The menu is a small square with three bars in the screen's top left corner. The idle worker button is a key like the smoke signals', a hard hat on it, in a steel tab over your rank's stars, where it no longer hides the end of the power bar. Each button stands in its own dark cell with steel running between them, and the steel is laid over the edge of every picture the way a frame holds a card, the whole picture showing inside it. The production queue and the general's powers are framed the same way. The power bar is sunk into the same steel plate as the build grid, standing at its right end, and is as tall as the grid on every side, where it used to change length from one faction to the next. The build grid's panel no longer carries an empty strip down its left side. There is no chat button any more: Enter opens the chat as it always did. The beacon button is gone from the bar too; the smoke signals over the radar are how you point your team at a spot. The portrait sits in the radar's lit steel too. The experience bar beside it is ten gold rungs in a sunk groove, climbing from the bottom as you earn your way to the next rank, and your rank stands in a steel tab on the portrait's top right corner, a key sunk in it like the idle worker's with one star for every rank there is, gold up to the one you hold. A watcher has nothing to promote and no longer gets the tab, which used to hang half into the screen's corner. Its button goes with it: a watcher who clicked a unit used to find an empty patch of screen there that still showed the promotions tooltip and opened the promotion screen. The portrait's grid is steel between dark cells on every side, where America's was drawn in blue lines that matched nothing else on the bar. That key is the promotions button: point at it and it comes up with a gold rim, it blinks bright in your side's own steel while you have a promotion to spend, and a click opens the promotion screen. That screen is rebuilt in the same steel and half its old size: each rank's promotions stand in a grid of build-button cells five wide, like the command grid, an empty place a dark hole, each rank in a steel well of its own with its heading, the wells a plate's thickness apart, the grid's steel laid over the edge of every picture so the picture sits in its cell like a card in a frame, your rank and the points to spend on one line over the experience bar, and Done in the last row's spare place. A gold rim marks what you have bought and a light one what you can buy now. It comes up the way the Esc menu does, the battlefield behind it dimmed to 65% black and the screen fading in over an eighth of a second; the side's old painted screen no longer fades in over it for the first nine frames. The bar has no minimise arrow any more: it is only as big as what it holds. The radar sits sunk in a bezel of lit steel, bright along the top and shadowed down the right, and the build grid and the money wear the same steel, the figure in a dark window of its own, and the under-attack light is a long red lamp set in a steel tab on its top left corner, dark until you are hit and then blinking. No words on it, so it reads the same in any language.+- The command bar is laid out anew, all of it running rightwards from the bottom left corner, and it is smaller: at 1920x1080 it stands 248 pixels tall where the old bar took 312, and it ends a third of the way across, so the rest of the screen's bottom edge is battlefield but for the general's powers in the corner. The radar sits in the corner, taller than before so its top lines up with the power bar's, with your general's experience bar standing beside it, and on its top edge the under-attack light, the skills key with your rank's stars on that, and over the stars the idle worker button whenever a worker stands idle. Next to it is one grid of eighteen buttons, six across and three down, and every button is its own key: Q W E R T Y over A S D F G H over Z X C V B N. No more two-key building shortcuts and no second bars: a dozer's buildings, a factory's units, a unit's abilities and upgrades and its orders all share the grid, each a single press. The orders stay put whatever you select. For a unit, A attacks, S stops, D attack-moves, V moves, Z ejects the passengers, X guards and C holds position; for a building, N sells it, B sets its rally point and Z empties its garrison. Workers keep three of their own: N clears mines on every side's worker and dozer, H swaps a GLA worker between real and fake buildings, and B is the Demolition worker's suicide charge. Everything else packs into the top left corner, two rows at a time, Q A W Z S E X D R C and on, so the buildings you reach for most sit under your fingers; what a building makes comes first and its upgrades after. Only the buttons your selection has are drawn, and with nothing selected the grid stays as a plate of bare steel. Its buttons are a fifth bigger than the rest of the bar's, so what you build stands out. Attack, hold position and move are buttons now, where no unit ever had one, with pictures painted to sit among the game's own: a crosshair on a red plate over a burning sky, a raised palm on a blue one, an arrow on a green diamond. V, or a click on the arrow, is a move for the left button: the next click on the ground sends the selection there, and a drag lays them out along the line the way a right drag does. Beside the grid, on the bottom edge of the screen, runs a portrait bar only as long as what it holds. Select one unit and its upgrades follow its portrait; select a group and the bar holds every kind of unit in it once, each with how many you have, the one Tab has picked lit and the rest dimmed. The power bar lies along the top of the grid, and your money sits on its left end, so both are one glance from the buttons you spend them on. The Legacy mouse and keyboard and the W A S D camera are gone from the Options screen: there is one way to play, and an Options.ini that still names them loads as it always did.+- Every panel of the bar is only as big as what it holds now, and stands on the bottom of the screen. The radar's border runs out to the screen's left edge. The power bar lies in a steel groove of its own along the top of the command grid, twenty cells that light up from the left with your production and fill the groove when full, the consumption marked by a white needle across it. The money stands on the power bar's left end in a steel plate of its own, the figure in a dark well. Everything the old painting filled round them is battlefield again, and a click there lands on the battlefield.+- The bar's own buttons are drawn to match, steel caps lit gold under the pointer and pressed in when pushed. The menu is a small square with three bars in the screen's top left corner. The idle worker button is a key like the smoke signals', a hard hat on it, in a steel tab over your rank's stars, where it no longer hides the end of the power bar. Each button stands in its own dark cell with steel running between them, and the steel is laid over the edge of every picture the way a frame holds a card, the whole picture showing inside it. The production queue and the general's powers are framed the same way. The power bar is sunk into the same steel as the build grid, lying along its top, and is as long as the grid on every side, where it used to change length from one faction to the next. The build grid's panel no longer carries an empty strip down its left side. There is no chat button any more: Enter opens the chat as it always did. The beacon button is gone from the bar too; the smoke signals over the radar are how you point your team at a spot. The portrait sits in the radar's lit steel too. The experience bar beside it is ten gold rungs in a sunk groove, climbing from the bottom as you earn your way to the next rank, and your rank stands in a steel tab on the portrait's top right corner, a key sunk in it like the idle worker's with one star for every rank there is, gold up to the one you hold. A watcher has nothing to promote and no longer gets the tab, which used to hang half into the screen's corner. Its button goes with it: a watcher who clicked a unit used to find an empty patch of screen there that still showed the promotions tooltip and opened the promotion screen. The portrait's grid is steel between dark cells on every side, where America's was drawn in blue lines that matched nothing else on the bar. That key is the promotions button: point at it and it comes up with a gold rim, it blinks bright in your side's own steel while you have a promotion to spend, and a click opens the promotion screen. That screen is rebuilt in the same steel and half its old size: each rank's promotions stand in a grid of build-button cells five wide, like the command grid, an empty place a dark hole, each rank in a steel well of its own with its heading, the wells a plate's thickness apart, the grid's steel laid over the edge of every picture so the picture sits in its cell like a card in a frame, your rank and the points to spend on one line over the experience bar, and Done in the last row's spare place. A gold rim marks what you have bought and a light one what you can buy now. It comes up the way the Esc menu does, the battlefield behind it dimmed to 65% black and the screen fading in over an eighth of a second; the side's old painted screen no longer fades in over it for the first nine frames. The bar has no minimise arrow any more: it is only as big as what it holds. The radar sits sunk in a bezel of lit steel, bright along the top and shadowed down the right, and the build grid and the money wear the same steel, the figure in a dark window of its own, and the under-attack light is a long red lamp set in a steel tab on its top left corner, dark until you are hit and then blinking. No words on it, so it reads the same in any language.- The general's powers you have bought and can fire, the column that climbed the right edge of the screen, stand in the bottom right corner now in a tray of the bar's own steel. The first sits in the corner against the right edge of the screen, and each one you gain takes the place to the left of the last, three to a row before a new row starts above, so the tray is only ever as big as what you hold and an empty one takes no room at all. Each power sits on a dark cell three quarters the size of a build button, where the side's old tray art used to frame it. It is always out; there is no button to fold it away.- Three buttons sit side by side in a step of the radar's own steel, on its top edge: the smoke signals Alt+Z, X and C send. Press one and the pointer turns to a cross; your next click puts the signal there, on the ground or on the radar, and a right click or Escape takes it back; until now a button dropped its smoke in the middle of your view. Every signal now leaves a mark on the ground in your colour for ten seconds, and the radar ping lasts as long: crossed swords to attack, a shield to defend, an eye to look, each in a ring a few tanks across, fading out over its last two seconds. Each is a key sunk into the steel with a sharp white picture on it instead of a word: a crosshair to attack, a shield to defend, an eye to look. Point at one and it comes up out of its well as lit steel with a gold rim, and it sinks in darker while you hold the button down. They rise into place one after another from the bottom of the screen when the match starts. A game with nobody on your side to see the smoke, a skirmish against the computer or a replay, has no signal buttons at all.- Tooltips wear the bar's steel. Point at a build button and a card opens right above it rather than in a fixed box at the side: the name on a steel header in your side's colour with the price in gold at its end, every "Power Supplied: 5" or "Strong: infantry" line of the description laid out as a label and a bold figure, then the unit's health, damage, attacks a second, damage a second, range and build time in gold, counted with the upgrades you own. Under them every upgrade that touches the unit and what it does to it: a Gattling Tank's card says Chain Guns takes its damage from 15 to 18 and its damage a second from 37 to 46, a Humvee's that TOW adds a 50 damage missile with a range of 317, and an upgrade you already bought turns gold. Point at the upgrade itself and the card lists the units it changes, Composite Armor putting a Crusader from 480 health to 680. At the bottom, "not enough money" or what you still need in a sunk red note at the bottom. Point at something on the battlefield and a small dark box beside the pointer names it, its owner's colour in a stripe down the left edge.diff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.htmlindex 2b1780d30..f12cbcfa2 100644--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html@@ -2,10 +2,10 @@<!--The command bar's frame, drawn where its three plates used to be, and the bar's own buttons, laidout the way the owner drew them on 2026-09-28 (docs/plans/HUD-REDESIGN.md): the radar in the- bottom left corner with the experience bar beside it, the command grid with the portrait bar on- it and the power bar standing up after it; over the radar the idle- worker's key on the skills key on the under-attack light, and the smoke signals; the money at the- screen's top. Laid out at ControlBarHudScale(), 70 percent of the uniform scale the tooltips and+ bottom left corner with the experience bar beside it, the command grid with the power bar lying+ along its top and the money on the power bar's left end, the portrait bar after the grid on the+ screen's bottom edge; over the radar the idle worker's key on the skills key on the under-attack+ light, and the smoke signals. Laid out at ControlBarHudScale(), 70 percent of the uniform scale the tooltips andthe boards use. The command buttons, the radar, the money and theportrait are still the bar's windows and paint over this page. The under-attack light, the powerbar and the experience bar are the page's to draw: their windows take the clicks and draw@@ -29,10 +29,10 @@{{power.fill}} the power bar: production as a percent of the bar, on the bar's own{{power.needle}} logarithmic scale, consumption as the same ({{power.consumes}} "hidden"while it is nought), and {{power.state}} "green",- "yellow" or "red"; the watched player's while watching. The bar stands- up: {{power.needley}} is the needle's place in pixels down the groove- data-each="powercells" the same production as 20 cells from the bottom, each {{lit}} "lit" up to- it, standing at {{y}} pixels inside the frame's lip, {{h}} tall, {{segh}}+ "yellow" or "red"; the watched player's while watching. The bar lies+ flat: {{power.needlex}} is the needle's place in pixels along the groove+ data-each="powercells" the same production as 20 cells from the left, each {{lit}} "lit" up to+ it, standing at {{x}} pixels inside the frame's lip, {{w}} wide, {{segw}}without its black line{{expframe.x}} ... the experience bar's groove beside the radar, .w and .h its inside,{{expframe.innerw}} the width inside its lip; data-each="expcells" its@@ -69,16 +69,16 @@{{panelN.shown}} is "hidden" when a minimised bar has stood it down{{left.x}} .y .w .h the panels, each a container and a border outside it: .x and .y the{{centre.x}} ... border's outer corner, .w and .h the container, exactly what it holds (the- {{portrait.x}} ... radar and the experience bar; the command grid and the power groove; the- portrait bar's), and .bt .br .bb .bl the border's four widths, out to the+ {{powerpanel.x}} ... radar and the experience bar; the command grid; the power groove; the+ {{portrait.x}} ... portrait bar's), and .bt .br .bb .bl the border's four widths, out to thescreen's edge on the sides against it{{alerttab.x}} ... the under-attack light, a tab on the radar panel's top edge at its left{{skillstab.x}} ... hand end, and on it the skills key: the rank's stars, pressed throughdata-click="press:ButtonGeneral" for the promotion screen{{idletab.x}} ... the idle worker's key in a tab on the skills key- {{powerframe.x}} ... the power bar's groove inside the command grid's frame, after the grid;- {{powerframe.inner}} the width inside the frame and its lip- {{moneyplate.x}} ... the money's plate hanging from the screen's top edge in its middle, and+ {{powerframe.x}} ... the power bar's groove in its panel over the command grid's frame;+ {{powerframe.inner}} the height inside the frame and its lip+ {{moneyplate.x}} ... the money's plate standing on the power panel's left end, and{{moneyblock.x}} ... the dark well in it the money's window is moved into{{Name.x}} .y .w .h the rectangle of the bar's window Name, {{Name.shown}} "shown" or "hidden"and {{Name.state}} any of "disabled", "hilite", "pushed", for LeftHUD (the@@ -162,12 +162,9 @@.china .commandcell .bevel { border-bottom-color: #d98a72; border-right-color: #d98a72; }.gla .commandcell .bevel { border-bottom-color: #cbbf82; border-right-color: #cbbf82; }- /* the money's plate hanging from the screen's top edge, the money's well sunk in it. The money's+ /* the money's plate standing on the power bar's panel, the money's well sunk in it. The money'sfigure is the bar's own window over its well */.stack { box-sizing: border-box; margin: 0; }- .moneyplate .steel { background: linear-gradient(to bottom, #7d8691, #b0b8c1); }- .china .moneyplate .steel { background: linear-gradient(to bottom, #9a4331, #cf8068); }- .gla .moneyplate .steel { background: linear-gradient(to bottom, #8f8249, #c8bc84); }.moneywell { background-color: #020405; }.moneywell .lip { position: absolute; left: 0; top: 0; right: 0; bottom: 0; border: 1px solid #06090b;border-bottom-color: #b4bec8; border-right-color: #b4bec8; }@@ -185,27 +182,27 @@left a gap under it */.groove.stack { margin: 0; }- /* the power bar is the page's: a column of cells up the groove, lit from the bottom up to the+ /* the power bar is the page's: a row of cells along the groove, lit from the left up to theproduction in the power bar's own green, yellow or red, a black line between every two, and theconsumption a white needle across them. Full is every cell, lip to lip */- /* the column's width is the frame's inside, {{powerframe.inner}}, written in: a percentage of a- width set by left and right does not resolve here, and the cells came out with none */- .cells { position: absolute; left: 1px; top: 1px; bottom: 1px; }- /* each cell stands at its own {{y}} and {{h}} in pixels, and the gap is the inner block's margin:+ /* the row's height is the frame's inside, {{powerframe.inner}}, written in: a percentage of a+ height set by top and bottom does not resolve here, and the cells came out with none */+ .cells { position: absolute; left: 1px; top: 1px; right: 1px; }+ /* each cell stands at its own {{x}} and {{w}} in pixels, and the gap is the inner block's margin:a percentage of an absolutely placed box does not resolve here at all */- .cells .cell { position: absolute; left: 0; }- .cells .seg { margin-top: 1px; background-color: #0d1512; background-size: 100% 100%; background-repeat: no-repeat; }+ .cells .cell { position: absolute; top: 0; }+ .cells .seg { margin-left: 1px; background-color: #0d1512; background-size: 100% 100%; background-repeat: no-repeat; }.cells .lit .seg { background-image: url(PowerBarGreen); }.cells.yellow .lit .seg { background-image: url(PowerBarYellow); }.cells.red .lit .seg { background-image: url(PowerBarRed); }- /* the needle is a gauge pointer through the whole groove at {{power.needley}} pixels down: a white- stem outlined in black so it reads on a lit cell as well as a dark one, capped left and right+ /* the needle is a gauge pointer through the whole groove at {{power.needlex}} pixels in: a white+ stem outlined in black so it reads on a lit cell as well as a dark one, capped top and bottomwhere it crosses the groove's edges. It stands after the lip so the lip does not cut it */- .needle { position: absolute; left: -2px; right: -2px; height: 4px; margin-top: -1px; background-color: #000000; }+ .needle { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -1px; background-color: #000000; }.needle .stem { position: absolute; left: 1px; right: 1px; top: 1px; bottom: 1px; background-color: #f4f6f8; }- .needle .cap { position: absolute; top: -1px; width: 1px; height: 4px; border: 1px solid #000000; background-color: #f4f6f8; }- .needle .head { left: -1px; }- .needle .foot { right: -1px; }+ .needle .cap { position: absolute; left: -1px; width: 4px; height: 1px; border: 1px solid #000000; background-color: #f4f6f8; }+ .needle .head { top: -1px; }+ .needle .foot { bottom: -1px; }.china .groove { border-bottom-color: #d98a72; border-right-color: #d98a72; }.gla .groove { border-bottom-color: #cbbf82; border-right-color: #cbbf82; }@@ -363,22 +360,27 @@<div class="shade" style="right: -{{centre.br}}px; top: -{{centre.bt}}px; bottom: -{{centre.bb}}px"></div><div class="sunk grid" style="width: {{centre.w}}px; height: {{centre.h}}px"></div></div>- <!-- the power bar standing up in its groove at the command grid's right, the way the experience- bar stands beside the radar -->+ <!-- the power bar lying in its groove on a panel of its own along the command grid's top -->+ <div class="piece frame bezel solid {{powerpanel.shown}}" style="left: {{powerpanel.x}}px; top: {{powerpanel.y}}px; width: {{powerpanel.w}}px; height: {{powerpanel.h}}px; border-width: {{powerpanel.bt}}px {{powerpanel.br}}px {{powerpanel.bb}}px {{powerpanel.bl}}px">+ <div class="steel" style="left: -{{powerpanel.bl}}px; right: -{{powerpanel.br}}px; top: -{{powerpanel.bt}}px; bottom: -{{powerpanel.bb}}px"></div>+ <div class="shine" style="left: -{{powerpanel.bl}}px; right: -{{powerpanel.br}}px; top: -{{powerpanel.bt}}px"></div>+ <div class="lit" style="left: -{{powerpanel.bl}}px; top: -{{powerpanel.bt}}px; bottom: -{{powerpanel.bb}}px"></div>+ <div class="shade" style="right: -{{powerpanel.br}}px; top: -{{powerpanel.bt}}px; bottom: -{{powerpanel.bb}}px"></div>+ </div><div class="piece groove solid stack {{powerframe.shown}}" style="left: {{powerframe.x}}px; top: {{powerframe.y}}px; width: {{powerframe.w}}px; height: {{powerframe.h}}px">- <div class="cells {{power.state}}" style="width: {{powerframe.inner}}px"><div class="cell {{lit}}" data-each="powercells" style="top: {{y}}px; height: {{h}}px; width: {{powerframe.inner}}px"><div class="seg" style="width: {{powerframe.inner}}px; height: {{segh}}px"></div></div></div>+ <div class="cells {{power.state}}" style="height: {{powerframe.inner}}px"><div class="cell {{lit}}" data-each="powercells" style="left: {{x}}px; width: {{w}}px; height: {{powerframe.inner}}px"><div class="seg" style="height: {{powerframe.inner}}px; width: {{segw}}px"></div></div></div><div class="lip"></div>- <div class="needle {{power.consumes}}" style="top: {{power.needley}}px"><div class="stem"></div><div class="cap head"></div><div class="cap foot"></div></div>+ <div class="needle {{power.consumes}}" style="left: {{power.needlex}}px"><div class="stem"></div><div class="cap head"></div><div class="cap foot"></div></div></div><div class="piece tab idle {{idletab.shown}} {{ButtonIdleWorker.state}}" style="left: {{idletab.x}}px; top: {{idletab.y}}px; width: {{idletab.w}}px; height: {{idletab.h}}px"><div class="key" data-click="press:ButtonIdleWorker"><div class="icon"></div><div class="veil"></div></div></div>- <!-- the money, a plate hanging from the screen's top edge in its middle -->+ <!-- the money, a plate standing on the power bar's panel at its left end --><div class="piece bezel solid moneyplate {{moneyplate.shown}}" style="left: {{moneyplate.x}}px; top: {{moneyplate.y}}px; width: {{moneyplate.w}}px; height: {{moneyplate.h}}px"><div class="steel" style="left: 0; right: 0; top: 0; bottom: 0"></div>+ <div class="shine" style="left: 0; right: 0; top: 0"></div><div class="lit" style="left: 0; top: 0; bottom: 0"></div><div class="shade" style="right: 0; top: 0; bottom: 0"></div>- <div class="base" style="left: 0; right: 0; bottom: 0"></div></div><div class="piece moneywell solid {{moneyblock.shown}}" style="left: {{moneyblock.x}}px; top: {{moneyblock.y}}px; width: {{moneyblock.w}}px; height: {{moneyblock.h}}px"><div class="lip"></div></div><div class="piece frame bezel solid {{portrait.shown}}" style="left: {{portrait.x}}px; top: {{portrait.y}}px; width: {{portrait.w}}px; height: {{portrait.h}}px; border-width: {{portrait.bt}}px {{portrait.br}}px {{portrait.bb}}px {{portrait.bl}}px">diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex efbfe3b48..d152b64bd 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -10884,8 +10884,7 @@ static void putPowerBar( HtmlValues &values, std::vector< HtmlValues > &cells )enum{ONE_UNIT_NEEDLE_TENTHS = 15, ///< a consumption of 1 is drawn as 1.5: log(1) is 0, and 1 is not nothing- POWER_CELLS = 20 ///< the bar is drawn as this many cells, lit up to the production; forty- ///< stood across the old bar, and up a groove this short a cell was two pixels+ POWER_CELLS = 20 ///< the bar is drawn as this many cells, lit up to the production};Player *player = TheControlBar->isObserverControlBarOn() ? TheControlBar->getObserverLookAtPlayer()@@ -10900,24 +10899,24 @@ static void putPowerBar( HtmlValues &values, std::vector< HtmlValues > &cells )// with nothing drawing power the needle stood at nought, a white bar across the bar's footvalues[ "power.consumes" ] = consumption > 0 ? "" : "hidden";- // the bar stands up: each cell gets its place and height in the page's pixels from the bottom,- // cut from the frame's inside so they add up to it exactly - floated at a percentage each the- // page rounded them up, and a percentage of an absolutely placed box does not resolve at all.+ // the bar lies along the grid: each cell gets its place and width in the page's pixels from the+ // left, cut from the frame's inside so they add up to it exactly - floated at a percentage each+ // the page rounded them up, and a percentage of an absolutely placed box does not resolve at all.// The needle is a pixel place for the same reasonenum { FRAME_LIP = 1 };- const Int column = atoi( values[ "powerframe.h" ].c_str() ) - 2 * FRAME_LIP;- values[ "power.needley" ] = std::to_string( column - REAL_TO_INT( powerBarShare( needle ) * column ) );+ const Int row = atoi( values[ "powerframe.w" ].c_str() ) - 2 * FRAME_LIP;+ values[ "power.needlex" ] = std::to_string( REAL_TO_INT( powerBarShare( needle ) * row ) );cells.clear();const Int lit = REAL_TO_INT( fill * POWER_CELLS );- for( Int cell = 0; cell < POWER_CELLS && column > 0; cell++ )+ for( Int cell = 0; cell < POWER_CELLS && row > 0; cell++ ){- const Int top = column - ( cell + 1 ) * column / POWER_CELLS;+ const Int left = cell * row / POWER_CELLS;HtmlValues entry;entry[ "lit" ] = cell < lit ? "lit" : "";- entry[ "y" ] = std::to_string( top );- const Int height = column - cell * column / POWER_CELLS - top;- entry[ "h" ] = std::to_string( height );- entry[ "segh" ] = std::to_string( max( 0, height - 1 ) ); // the black line over it+ entry[ "x" ] = std::to_string( left );+ const Int width = ( cell + 1 ) * row / POWER_CELLS - left;+ entry[ "w" ] = std::to_string( width );+ entry[ "segw" ] = std::to_string( max( 0, width - 1 ) ); // the black line before itcells.push_back( entry );}if( consumption > production )@@ -11057,10 +11056,10 @@ static const Int COMMAND_BUTTONS = 14; ///< ButtonCommand01 to 14, the command sstatic const Int UPGRADE_CAMEOS = 5; ///< UnitUpgrade1 to 5, a single unit's upgrades in the portrait bar/** The bar as the owner drew it on 2026-09-28, 800x600 pixels at ControlBarHudScale(): from the left,- * the radar with the experience bar beside it, then the command grid, six by three, with the portrait- * bar on it and the power bar standing up at its right. Over the radar the idle worker's key stands- * on the skills key, the skills key on the under-attack light at its left hand end, and the smoke- * signals at its right. The money hangs from the screen's top. */+ * the radar with the experience bar beside it, then the command grid, six by three, with the power+ * bar lying along its top and the money on the power bar's left end, then the portrait bar on the+ * screen's bottom edge. Over the radar the idle worker's key stands on the skills key, the skills+ * key on the under-attack light at its left hand end, and the smoke signals at its right. */enum{COMMAND_BUTTON_WIDTH = 50, ///< a command button as ControlBar.wnd authors it, the promotion screen's cell@@ -11076,8 +11075,8 @@ enumPORTRAIT_WIDTH = 44, ///< the portrait's cell, a cell's height at the portrait's own shapePORTRAIT_PLACES = 7, ///< the most cells the portrait bar holds in one row after the portrait; it is///< only as long as what it holds- RADAR_WIDTH = 167, ///< the radar, as ControlBar.wnd authors LeftHUD- RADAR_HEIGHT = 152,+ RADAR_WIDTH = 167, ///< the radar's shape, as ControlBar.wnd authors LeftHUD; its height is the+ RADAR_HEIGHT = 152, ///< command grid's and the power bar's panels togetherEXPERIENCE_WIDTH = 12, ///< the experience bar's groove, the radar's heightEXPERIENCE_GAP = 4, ///< between it and the radarPANEL_FOOT = 4, ///< a grid's ring over the screen's bottom edge, the steel under it@@ -11089,8 +11088,8 @@ enumSIGNAL_STEP_HEIGHT = 24, ///< three keys side by sideIDLE_TAB_WIDTH = 38, ///< the idle worker's key in a tab on the skills key's, with its rimIDLE_TAB_HEIGHT = 22,- POWER_WIDTH = 12, ///< the power bar's groove up the command grid's right, frame and lip- MONEY_WIDTH = 104, ///< the money's well in its plate at the screen's top+ POWER_WIDTH = 12, ///< the power bar's groove along the command grid's top, frame and lip+ MONEY_WIDTH = 104, ///< the money's well in its plate on the power bar's panelMONEY_HEIGHT = 18,MONEY_PLATE_BORDER = 5, ///< the plate's steel round the wellSKILL_GRID_GAP = 12, ///< between the general's powers' tray and what it stands on@@ -11314,24 +11313,20 @@ static IRegion2D gridCell( const IRegion2D &box, Int column, Int row, Int width,}//--------------------------------------------------------------------------------------------------/** The money, a steel plate hanging from the screen's top edge in its middle with the figure in a- * dark well, the owner's call of 2026-09-28: a glance up rather than down into the bar. The money's- * window is moved into the well, cut to its line of text. Written as moneyplate and moneyblock. */+/** The money, a steel plate standing on the power bar's panel `powerBox` at its left end with the+ * figure in a dark well, the owner's place of 2026-09-28. The money's window is moved into the+ * well, cut to its line of text. Written as moneyplate and moneyblock. *///--------------------------------------------------------------------------------------------------static void putMoney( HtmlValues &values, Bool shown )+static void putMoney( HtmlValues &values, const IRegion2D &powerBox, Bool shown ){const Real scale = ControlBarHudScale();const Int border = REAL_TO_INT( MONEY_PLATE_BORDER * scale );- IRegion2D money;- money.lo.x = ( TheDisplay->getWidth() - REAL_TO_INT( MONEY_WIDTH * scale ) ) / 2;- money.hi.x = money.lo.x + REAL_TO_INT( MONEY_WIDTH * scale );- money.lo.y = border;- money.hi.y = money.lo.y + REAL_TO_INT( MONEY_HEIGHT * scale );- IRegion2D plate = money;- plate.lo.x -= border;- plate.hi.x += border;- plate.lo.y = 0;- plate.hi.y += border;+ const IRegion2D plate = tabOn( powerBox, MONEY_WIDTH + 2 * MONEY_PLATE_BORDER, MONEY_HEIGHT + 2 * MONEY_PLATE_BORDER, FALSE );+ IRegion2D money = plate;+ money.lo.x += border;+ money.hi.x -= border;+ money.lo.y += border;+ money.hi.y -= border;putPageRect( values, "moneyplate", plate, shown, scale );putPageRect( values, "moneyblock", money, shown, scale );@@ -11350,10 +11345,10 @@ static void putMoney( HtmlValues &values, Bool shown )}//--------------------------------------------------------------------------------------------------/** The power bar standing up in its groove at `groove`, screen pixels, with the power window moved- * under it so its tooltip stands on the bar. The page lays boxes out content-box whatever- * box-sizing says, so the groove's border goes on top of its width and height: it is handed the- * content, and the width inside its lip for the cells. Written as powerframe. */+/** The power bar lying in its groove at `groove`, screen pixels, with the power window moved under it+ * so its tooltip stands on the bar. The page lays boxes out content-box whatever box-sizing says,+ * so the groove's border goes on top of its width and height: it is handed the content, and the+ * height inside its lip for the cells. Written as powerframe. *///-------------------------------------------------------------------------------------------------static void putPowerGroove( HtmlValues &values, const IRegion2D &groove, Bool shown ){@@ -11365,7 +11360,7 @@ static void putPowerGroove( HtmlValues &values, const IRegion2D &groove, Bool shconst Int height = atoi( values[ "powerframe.h" ].c_str() ) - 2 * FRAME_BORDER;values[ "powerframe.w" ] = std::to_string( width > 0 ? width : 0 );values[ "powerframe.h" ] = std::to_string( height > 0 ? height : 0 );- values[ "powerframe.inner" ] = std::to_string( width > 2 * FRAME_LIP ? width - 2 * FRAME_LIP : 0 );+ values[ "powerframe.inner" ] = std::to_string( height > 2 * FRAME_LIP ? height - 2 * FRAME_LIP : 0 );}/** `name`.x, .y, .w and .h in the page's pixels, `scale` screen pixels to one, and `name`.shown@@ -11520,11 +11515,14 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I// uniform scale, so it is put again at the HUD'sGameWindow *radarWindow = controlBarWindow( "LeftHUD" );const Bool leftFound = leftShown && !radarWindow->winIsHidden();+ // the radar stands as tall as the command grid's panel and the power bar's over it together, so its+ // panel's top is level with the power bar's, the owner's call of 2026-09-28, and keeps its shapeIRegion2D content;- content.lo.x = border;- content.hi.x = content.lo.x + REAL_TO_INT( RADAR_WIDTH * scale );content.hi.y = foot;- content.lo.y = content.hi.y - REAL_TO_INT( RADAR_HEIGHT * scale );+ content.lo.y = content.hi.y - REAL_TO_INT( COMMAND_ROWS * ( COMMAND_CELL_HEIGHT + CELL_GAP ) * scale ) - 2 * border+ - REAL_TO_INT( POWER_WIDTH * scale );+ content.lo.x = border;+ content.hi.x = content.lo.x + ( content.hi.y - content.lo.y ) * RADAR_WIDTH / RADAR_HEIGHT;TheControlBar->placeWindowAt( radarWindow, content );IRegion2D experience = content;experience.lo.x = content.hi.x + REAL_TO_INT( EXPERIENCE_GAP * scale );@@ -11567,38 +11565,37 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I// the command grid against the radar's panel, six by three, every place its key: the orders in the// owner's places (ControlBar_commandPlaces) and everything else packed toward the top left, what a- // set builds before its abilities and upgrades. The power bar stands up in its- // groove inside the grid's frame, after it, the way the experience bar stands in the radar's. The- // money hangs from the screen's top+ // set builds before its abilities and upgrades. Over the grid's frame the power bar lies in a+ // groove of its own panel, and the money stands on that panel's left endconst IRegion2D commandBox = gridBox( leftBox.hi.x + border, foot, COMMAND_COLUMNS, COMMAND_ROWS,COMMAND_CELL_WIDTH, COMMAND_CELL_HEIGHT );Int where[ MAX_COMMANDS_PER_SET ];const Bool fights = TheControlBar->getCommandPlaces( where );TheControlBar->labelCommandPlaces( where );Bool taken[ COMMAND_PLACE_COUNT ] = { FALSE };- Bool anyCommand = fights;for( Int button = 0; button < COMMAND_BUTTONS; button++ )if( where[ button ] >= 0 )- anyCommand = taken[ where[ button ] ] = TRUE;+ taken[ where[ button ] ] = TRUE;// attack, hold position and move have no button in any command set: the page's keys do what A, C// and V do, for anything that attack movestaken[ COMMAND_PLACE_ATTACK ] = taken[ COMMAND_PLACE_HOLD ] = taken[ COMMAND_PLACE_MOVE ] = fights;- // with nothing to command, nothing selected, there is no grid and no frame round it, the owner's- // call: the power bar keeps its groove where it stands, in a frame of its own that wide- const Bool gridShown = centreShown && anyCommand;+ // with nothing selected the frame keeps the whole grid's size and the grid is bare steel, the+ // owner's call: only the cells go+ const IRegion2D centreBox = framed( commandBox, border, FALSE, FALSE );+ putFrame( values, "centre", commandBox, centreBox, centreShown );++ // the power bar lying along the grid's top, in the strip the portrait bar had, a panel of its own+ // as wide as the grid; the money stands on its left end, the owner's places of 2026-09-28IRegion2D power = commandBox;- power.lo.x = commandBox.hi.x + REAL_TO_INT( EXPERIENCE_GAP * scale );- power.hi.x = power.lo.x + REAL_TO_INT( POWER_WIDTH * scale );- IRegion2D centreContent = commandBox;- centreContent.hi.x = power.hi.x;- if( !gridShown )- centreContent.lo.x = power.lo.x;- const IRegion2D centreBox = framed( centreContent, border, FALSE, FALSE );- putFrame( values, "centre", centreContent, centreBox, centreShown );+ power.hi.y = centreBox.lo.y - border;+ power.lo.y = power.hi.y - REAL_TO_INT( POWER_WIDTH * scale );+ IRegion2D powerBox = framed( power, border, FALSE, FALSE );+ powerBox.hi.y = centreBox.lo.y;+ putFrame( values, "powerpanel", power, powerBox, centreShown );putPowerGroove( values, power, centreShown );putPowerBar( values, lists[ "powercells" ] ); // after the groove, which it divides into cells- putMoney( values, centreShown && !controlBarWindow( "MoneyDisplay" )->winIsHidden() );+ putMoney( values, powerBox, centreShown && !controlBarWindow( "MoneyDisplay" )->winIsHidden() );// each command button to its place. A click only reaches a window inside every one of its parents,// so the buttons' two cover the whole frame; the page's solids still decide what is battlefield@@ -11629,11 +11626,11 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, Ivalues[ "holdkey.key" ] = commandSlotKey( COMMAND_PLACE_HOLD );values[ "movekey.key" ] = commandSlotKey( COMMAND_PLACE_MOVE );- // the portrait bar on the command panel, flush with its left edge: the portrait, then a single- // unit's upgrades or a multi-selection's types, the owner's rule, and only as long as what it- // holds; with no portrait there is no bar. More types than PORTRAIT_PLACES take smaller cells, two- // rows of them, then three. A watcher has no command panel and keeps the portrait of what he- // clicked, the bar standing on the screen's bottom edge in its place+ // the portrait bar on the screen's bottom edge right of the command panel: the portrait, then a+ // single unit's upgrades or a multi-selection's types, the owner's rule, and only as long as what+ // it holds; with no portrait there is no bar. More types than PORTRAIT_PLACES take smaller cells,+ // two rows of them, then three. A watcher has no command panel and keeps the portrait of what he+ // clicked, the bar standing where the panel would have beenGameWindow *portraitWindow = controlBarWindow( "CameoWindow" );const Bool portraitShown = ( centreShown || ( panelCount > 2 && shown[ 2 ] ) ) &&!portraitWindow->winIsHidden() && !portraitWindow->winGetParent()->winIsHidden();@@ -11660,12 +11657,11 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, Iconst Int portraitWidth = multi ? 0 : PORTRAIT_WIDTH + CELL_GAP;IRegion2D portraitBox;- portraitBox.lo.x = commandBox.lo.x;- portraitBox.hi.y = centreShown ? centreBox.lo.y - border : foot;+ portraitBox.lo.x = centreShown ? centreBox.hi.x + border : commandBox.lo.x;+ portraitBox.hi.y = foot;portraitBox.lo.y = portraitBox.hi.y - REAL_TO_INT( ( CELL_HEIGHT + CELL_GAP ) * scale );portraitBox.hi.x = portraitBox.lo.x + REAL_TO_INT( ( portraitWidth + columns * ( CELL_WIDTH + CELL_GAP ) ) * scale );- IRegion2D portraitFrame = framed( portraitBox, border, FALSE, FALSE );- portraitFrame.hi.y = centreShown ? centreBox.lo.y : barBottom();+ const IRegion2D portraitFrame = framed( portraitBox, border, FALSE, FALSE );putFrame( values, "portrait", portraitBox, portraitFrame, portraitShown );TheControlBar->placeWindowAt( controlBarWindow( "RightHUD" ), portraitBox );TheControlBar->placeWindowAt( controlBarWindow( "WinUnitSelected" ), portraitBox );@@ -11712,7 +11708,8 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, Iconst Int trayWidth = SPECIAL_POWER_SHORTCUT_COLS * ( cell.x + cellGap ) + 2 * trayBorder;ICoord2D corner;corner.x = TheDisplay->getWidth() - trayBorder;- corner.y = ( (Int)TheDisplay->getWidth() - centreBox.hi.x >= trayWidth ? barBottom() : centreBox.lo.y - REAL_TO_INT( SKILL_GRID_GAP * scale ) )+ const Int panelRight = portraitShown ? max( centreBox.hi.x, portraitFrame.hi.x ) : centreBox.hi.x;+ corner.y = ( (Int)TheDisplay->getWidth() - panelRight >= trayWidth ? barBottom() : powerBox.lo.y - REAL_TO_INT( SKILL_GRID_GAP * scale ) )- trayBorder;const Int powersShown = TheControlBar->placeSpecialPowerShortcutGrid( centreShown ? &corner : NULL, cell, cellGap );