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): radar fills its well, keys over the portrait

Olcay Seyganc962aa81ce55
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1846d0ac6..554d44231 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,10 +10,10 @@ found and fixed — EA's own, not port damage.**
## The command bar moves to the middle
-- The command bar is one console standing in the middle of the bottom edge: the radar, the smoke signals in multiplayer, your selection and the build grid side by side, with the power bar over the grid.
+- The command bar is one console standing in the middle of the bottom edge: a taller radar, your selection and the build grid side by side, with the power bar over the grid. The idle worker, rank and under-attack keys sit in a row over your selection, and in multiplayer the smoke signals join them.
- Your general's powers grow out of the console's right end, a column for each F key with its powers stacked up it, and only the powers you have take any room.
- A single unit's name and health stand beside its portrait, and a veteran gets his gold stars there too. A group shows every type it holds in the same box, five to a row.
-- The match clock hangs from the middle of the top edge with your money under it. Hold Tab and the scoreboard drops down from it.
+- The match clock hangs from the middle of the top edge with your money in its own box under it. Superweapon countdowns in the top right corner are as big as your general's power buttons. Hold Tab and the scoreboard drops down from it.
- Your production queue stands on the console over your selection, five to a row, each row only as long as what is in it. The event feed runs down from the menu key in the top left corner, and the chat sits under it.
- HUD Size grows the console from its middle, and on a narrow screen it stops at the size that still fits.
diff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
index 8b7198fc1..8a72e621a 100644
--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html
+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
@@ -2,11 +2,12 @@
<!--
The command bar's frame, drawn where its three plates used to be, and the bar's own buttons, laid
out the way the owner drew them on 2026-10-01: the console standing on the middle of the screen's
- bottom edge, one plate of steel with a header strip and a well for each section side by side - the
- radar with the experience bar beside it and, in its header, the idle worker's key, the skills key
- and the under-attack light; the smoke signals' column; the selection; the command grid with the
- power bar in its header - with the general's powers growing out of its right hand end, and the
- top page hanging from the middle of the top edge, the match clock over the money. Laid out at
+ bottom edge, one plate of steel with a well for each section side by side - the radar with the
+ experience bar beside it, as tall as the console; the selection with, in the header strip over
+ it, the idle worker's key, the skills key, the under-attack light and the smoke signals; the
+ command grid with the power bar in its header - with the general's powers growing out of its right
+ hand end, and the top page hanging from the middle of the top edge, the match clock's plate over
+ the money's. Laid out at
ControlBarHudScale(), 70 percent of the uniform scale the
tooltips and the boards use. The command buttons, the radar, the money and the
portrait are still the bar's windows and paint over this page. The under-attack light, the power
@@ -42,7 +43,7 @@
rank to the next, at {{y}} inside the lip, {{h}} tall, {{segh}} without
its black line
data-each="rankstars" a star for every rank there is, {{lit}} "lit" up to the one reached, at
- {{x}} inside the 58 wide key so the row is centred on it
+ {{x}} inside the 56 wide key so the row is centred on it
data-each="commandcells" each {{cell.x}} .y .w .h: the command grid's places that hold a command,
six by three, each its key (Q W E R T Y, A S D F G H, Z X C V B N), an
empty one left as steel; its cells are a fifth bigger than the others
@@ -61,12 +62,12 @@
the left, {{plate.x}} .y .w .h, against the console's right hand end and
down to the screen's bottom edge, each as high as its own cells, and
{{shadeh}} how far down its right hand side no column beside it covers
- {{signals.x}} ... the smoke signals' well, three keys down it;
+ {{signals.x}} ... the smoke signals, three slots after the light in the selection's header;
data-click="signal:attack", "signal:defend" or "signal:look" sends one
to the middle of the view; {{signals.shown}} is "hidden" where the keys
would do nothing either, a game with no allies to see the smoke, and
{{signal0.drop}} to {{signal2.drop}} how far below its place each button
- still is while they rise into the well
+ still is while they rise into the header
url(Name.svg) an SVG file under Window/Html, fitted whole into the box and centred
{{blink}} "lit" for half of every second while the general has a promotion to
spend, the one thing that blinks: a value that changes lays the whole
@@ -76,16 +77,18 @@
{{panelN.x}} .y .w .h N 0 to 2, left, centre and right: where the plates would have gone,
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
- {{console.x}} .y .w .h the console's plate and {{topbar.x}} ... the top page's, each a container
- {{topbar.x}} ... and a border outside it: .x and .y the border's outer corner, .w and .h
- the container, and .bt .br .bb .bl the border's four widths
+ {{console.x}} .y .w .h the console's plate, {{clockbar.x}} ... the clock's on the top page and
+ {{clockbar.x}} ... {{moneybar.x}} ... the money's under it, each a container and a border
+ {{moneybar.x}} ... outside it: .x and .y the border's outer corner, .w and .h the
+ container, and .bt .br .bb .bl the border's four widths
data-each="wells" each of the console's wells, {{well.x}} .y .w .h, and the header strip
- over it, {{header.x}} .y .w .h
- {{idletab.x}} ... in the radar's header from its left: the idle worker's key,
- {{skillstab.x}} ... {{idleflash}} "flash" for half of every 0.7 seconds of the client's clock
- {{alerttab.x}} ... while one is idle; the skills key, the rank's stars, pressed through
- data-click="press:ButtonGeneral" for the promotion screen; and the
- under-attack light
+ over it, {{header.x}} .y .w .h, {{header.shown}} "hidden" over the
+ radar's, which reaches up to the console's top line
+ {{idletab.x}} ... in the selection's header from its left, on a grid of seven 30 pixel
+ {{skillstab.x}} ... slots: the idle worker's key, {{idleflash}} "flash" for half of every
+ {{alerttab.x}} ... 0.7 seconds of the client's clock while one is idle; the skills key, two
+ slots, the rank's stars, pressed through data-click="press:ButtonGeneral"
+ for the promotion screen; and the under-attack light
{{powerframe.x}} ... the power bar's groove in the command grid's header strip;
{{powerframe.inner}} the height inside the frame and its lip
{{clock.x}} ... the match clock's well at the top of the top page, its figure
@@ -259,12 +262,12 @@
/* a key sunk in the steel with a one-colour SVG on it, the smoke signals' and the idle worker's:
under the pointer it comes up out of its well as lit steel with a gold rim, and a key whose
button has nothing to do is veiled */
- .key { position: absolute; width: 32px; height: 18px; background-color: rgba(4, 8, 10, 0.9);
+ .key { position: absolute; top: 1px; width: 26px; height: 18px; background-color: rgba(4, 8, 10, 0.9);
border: 1px solid #06090b; border-bottom-color: #9aa4ae; border-right-color: #9aa4ae; }
.key:hover { background: linear-gradient(to bottom, #b3bbc4, #5a626c); border-color: #e8d27a; }
.china .key:hover { background: linear-gradient(to bottom, #d58a70, #7a3120); }
.gla .key:hover { background: linear-gradient(to bottom, #cabe86, #766a3a); }
- .key .icon { position: absolute; left: 9px; top: 2px; width: 14px; height: 14px;
+ .key .icon { position: absolute; left: 6px; top: 2px; width: 14px; height: 14px;
background-size: 100% 100%; background-repeat: no-repeat; }
/* pressed, the key under the pointer while the left button is {{held}}: sunk deeper than at rest,
dark on top and lit below, the gold rim kept and the picture a pixel down */
@@ -273,11 +276,12 @@
.gla .held .key:hover { background: linear-gradient(to bottom, #19160a, #4f4623); }
.held .key:hover .icon { top: 3px; }
.key .veil { display: none; }
- .disabled .key .veil { display: block; position: absolute; left: 0; top: 0; width: 32px; height: 18px;
+ .disabled .key .veil { display: block; position: absolute; left: 0; top: 0; width: 26px; height: 18px;
background-color: rgba(4, 8, 10, 0.65); }
- /* the idle worker: a key in a tab at the radar's header's left end, 38 by 22 */
- .idle .key { left: 2px; top: 3px; }
+ /* the header's tabs stand on a grid of 30 pixel slots, a key 28 wide with its rim a pixel in from
+ each slot's left. The idle worker: a key in a tab of a slot at the selection's header's left end */
+ .idle .key { left: 1px; }
.idle .icon { background-image: url(Icons/IdleWorker.svg); }
.watching .idle { display: none; }
/* while a worker stands idle the key flashes, {{idleflash}} "flash" for half of every 0.7 seconds:
@@ -298,21 +302,22 @@
/* the key in each one's top left corner is the game's, lettered the way the command buttons'
are (InGameUI::drawCellGridFront) */
- /* the under-attack light: a red lamp in a tab in the radar's header, dark until the bar blinks it.
- The tab is 54 by 22 and the lamp a bar 42 by 10 with its rim */
- .alert .led { position: absolute; left: 6px; top: 6px; width: 40px; height: 8px; border: 1px solid #120302;
+ /* the under-attack light: a red lamp in a tab of a slot in the selection's header, dark until the
+ bar blinks it. The lamp is a bar 22 by 10 with its rim */
+ .alert .led { position: absolute; left: 3px; top: 5px; width: 20px; height: 8px; border: 1px solid #120302;
background: linear-gradient(to bottom, #4a0d08, #2a0604); }
- .alert .glint { position: absolute; left: 2px; top: 1px; width: 36px; height: 2px; background-color: #6a2a24; }
+ .alert .glint { position: absolute; left: 2px; top: 1px; width: 16px; height: 2px; background-color: #6a2a24; }
.alert.disabled .led { border-color: #ff9a80; background: linear-gradient(to bottom, #ff6a50, #d01a08); }
.alert.disabled .glint { background-color: #ffe4dc; }
- /* the skills key: the rank, and the promotion button, a key like the idle worker's in a tab in the
- radar's header between the idle worker's and the under-attack light, a star on it for every rank there is, gold up to the one reached and dark past it. The
- tab is 66 by 22 and the key 60 by 17 with its rim, three pixels in. Under the pointer it comes
+ /* the skills key: the rank, and the promotion button, a key like the idle worker's in a tab of two
+ slots between the idle worker's and the under-attack light, a star on it for every rank there
+ is, gold up to the one reached and dark past it. The key is 58 by 17 with its rim, a pixel in
+ from the tab's left and two down. Under the pointer it comes
up as lit steel with a gold rim, and while a promotion waits to be spent it blinks in the side's own
steel at its brightest, a white rim round it. The stars carry a dark outline so the gold reads
on the lit key as well, and an unreached one is a dark star rimmed in light steel */
- .rank .key { left: 3px; top: 3px; width: 58px; height: 15px; }
+ .rank .key { left: 1px; top: 2px; width: 56px; height: 15px; }
.rank.hilite .key { background: linear-gradient(to bottom, #b3bbc4, #5a626c); border-color: #e8d27a; }
.china .rank.hilite .key { background: linear-gradient(to bottom, #d58a70, #7a3120); }
.gla .rank.hilite .key { background: linear-gradient(to bottom, #cabe86, #766a3a); }
@@ -327,7 +332,7 @@
.rank .star { position: absolute; top: 2px; width: 10px; height: 10px; background-size: 100% 100%;
background-repeat: no-repeat; background-image: url(Icons/RankStarDark.svg); }
.rank .star.lit { background-image: url(Icons/RankStar.svg); }
- .rank.disabled .key .veil { display: block; position: absolute; left: 0; top: 0; width: 58px; height: 15px;
+ .rank.disabled .key .veil { display: block; position: absolute; left: 0; top: 0; width: 56px; height: 15px;
background-color: rgba(4, 8, 10, 0.65); }
/* the experience bar: rungs up the groove beside the radar, lit gold from the bottom up to the way
@@ -341,12 +346,11 @@
on the screen's edge */
.bezel .base { position: absolute; height: 1px; background-color: #0c1114; }
- /* the smoke signals: their own well right of the radar's, three keys down it: a crosshair to
+ /* the smoke signals: three slots after the under-attack light, a key in each: a crosshair to
attack, a shield to defend, an eye to look */
- /* each key stands at its own top, pushed down by {{signalN.drop}} while it rises: a relatively
+ /* each key stands at its own left, pushed down by {{signalN.drop}} while it rises: a relatively
placed box inside an absolutely placed one is laid out from the screen's corner here, and the
- column came out in the top left */
- .signals .key { left: 1px; }
+ row came out in the top left */
.signal.attack .icon { background-image: url(Icons/SignalAttack.svg); }
.signal.defend .icon { background-image: url(Icons/SignalDefend.svg); }
.signal.look .icon { background-image: url(Icons/SignalLook.svg); }
@@ -363,7 +367,7 @@
<div class="shade" style="right: -{{console.br}}px; top: -{{console.bt}}px; bottom: -{{console.bb}}px"></div>
</div>
<div data-each="wells">
- <div class="piece header" style="left: {{header.x}}px; top: {{header.y}}px; width: {{header.w}}px; height: {{header.h}}px"></div>
+ <div class="piece header {{header.shown}}" style="left: {{header.x}}px; top: {{header.y}}px; width: {{header.w}}px; height: {{header.h}}px"></div>
<div class="piece" style="left: {{well.x}}px; top: {{well.y}}px; width: {{well.w}}px; height: {{well.h}}px"><div class="hollow" style="width: {{well.w}}px; height: {{well.h}}px"></div></div>
</div>
<div class="piece groove solid stack {{expframe.shown}}" style="left: {{expframe.x}}px; top: {{expframe.y}}px; width: {{expframe.w}}px; height: {{expframe.h}}px">
@@ -374,10 +378,10 @@
<div class="piece tab rank {{skillstab.shown}} {{promotion}} {{blink}} {{ButtonGeneral.state}}" style="left: {{skillstab.x}}px; top: {{skillstab.y}}px; width: {{skillstab.w}}px; height: {{skillstab.h}}px">
<div class="key" data-click="press:ButtonGeneral"><div class="star {{lit}}" data-each="rankstars" style="left: {{x}}px"></div><div class="veil"></div></div>
</div>
- <div class="piece signals solid {{signals.shown}}" style="left: {{signals.x}}px; top: {{signals.y}}px; width: {{signals.w}}px; height: {{signals.h}}px">
- <div class="key signal attack" data-click="signal:attack" style="top: 18px; margin-top: {{signal0.drop}}px"><div class="icon"></div></div>
- <div class="key signal defend" data-click="signal:defend" style="top: 56px; margin-top: {{signal1.drop}}px"><div class="icon"></div></div>
- <div class="key signal look" data-click="signal:look" style="top: 94px; margin-top: {{signal2.drop}}px"><div class="icon"></div></div>
+ <div class="piece tab signals solid {{signals.shown}}" style="left: {{signals.x}}px; top: {{signals.y}}px; width: {{signals.w}}px; height: {{signals.h}}px">
+ <div class="key signal attack" data-click="signal:attack" style="left: 1px; margin-top: {{signal0.drop}}px"><div class="icon"></div></div>
+ <div class="key signal defend" data-click="signal:defend" style="left: 31px; margin-top: {{signal1.drop}}px"><div class="icon"></div></div>
+ <div class="key signal look" data-click="signal:look" style="left: 61px; margin-top: {{signal2.drop}}px"><div class="icon"></div></div>
</div>
<!-- the general's powers' steel, stepping down from the console's right hand end -->
@@ -387,12 +391,20 @@
<div class="shade" style="height: {{shadeh}}px"></div>
</div>
- <!-- the top page: the match clock over the money in one plate from the top edge -->
- <div class="piece frame bezel solid {{topbar.shown}}" style="left: {{topbar.x}}px; top: {{topbar.y}}px; width: {{topbar.w}}px; height: {{topbar.h}}px; border-width: {{topbar.bt}}px {{topbar.br}}px {{topbar.bb}}px {{topbar.bl}}px">
- <div class="steel" style="left: -{{topbar.bl}}px; right: -{{topbar.br}}px; top: -{{topbar.bt}}px; bottom: -{{topbar.bb}}px"></div>
- <div class="lit" style="left: -{{topbar.bl}}px; top: -{{topbar.bt}}px; bottom: -{{topbar.bb}}px"></div>
- <div class="shade" style="right: -{{topbar.br}}px; top: -{{topbar.bt}}px; bottom: -{{topbar.bb}}px"></div>
- <div class="base" style="left: -{{topbar.bl}}px; right: -{{topbar.br}}px; bottom: -{{topbar.bb}}px"></div>
+ <!-- the top page: the match clock in a plate from the top edge, and the money in its own plate
+ hung under it -->
+ <div class="piece frame bezel solid {{clockbar.shown}}" style="left: {{clockbar.x}}px; top: {{clockbar.y}}px; width: {{clockbar.w}}px; height: {{clockbar.h}}px; border-width: {{clockbar.bt}}px {{clockbar.br}}px {{clockbar.bb}}px {{clockbar.bl}}px">
+ <div class="steel" style="left: -{{clockbar.bl}}px; right: -{{clockbar.br}}px; top: -{{clockbar.bt}}px; bottom: -{{clockbar.bb}}px"></div>
+ <div class="lit" style="left: -{{clockbar.bl}}px; top: -{{clockbar.bt}}px; bottom: -{{clockbar.bb}}px"></div>
+ <div class="shade" style="right: -{{clockbar.br}}px; top: -{{clockbar.bt}}px; bottom: -{{clockbar.bb}}px"></div>
+ <div class="base" style="left: -{{clockbar.bl}}px; right: -{{clockbar.br}}px; bottom: -{{clockbar.bb}}px"></div>
+ </div>
+ <div class="piece frame bezel solid {{moneybar.shown}}" style="left: {{moneybar.x}}px; top: {{moneybar.y}}px; width: {{moneybar.w}}px; height: {{moneybar.h}}px; border-width: {{moneybar.bt}}px {{moneybar.br}}px {{moneybar.bb}}px {{moneybar.bl}}px">
+ <div class="steel" style="left: -{{moneybar.bl}}px; right: -{{moneybar.br}}px; top: -{{moneybar.bt}}px; bottom: -{{moneybar.bb}}px"></div>
+ <div class="shine" style="left: -{{moneybar.bl}}px; right: -{{moneybar.br}}px; top: -{{moneybar.bt}}px"></div>
+ <div class="lit" style="left: -{{moneybar.bl}}px; top: -{{moneybar.bt}}px; bottom: -{{moneybar.bb}}px"></div>
+ <div class="shade" style="right: -{{moneybar.br}}px; top: -{{moneybar.bt}}px; bottom: -{{moneybar.bb}}px"></div>
+ <div class="base" style="left: -{{moneybar.bl}}px; right: -{{moneybar.br}}px; bottom: -{{moneybar.bb}}px"></div>
</div>
<div class="piece moneywell {{clock.shown}}" style="left: {{clock.x}}px; top: {{clock.y}}px; width: {{clock.w}}px; height: {{clock.h}}px"><div class="lip"></div></div>
<div class="piece groove stack {{powerframe.shown}}" style="left: {{powerframe.x}}px; top: {{powerframe.y}}px; width: {{powerframe.w}}px; height: {{powerframe.h}}px">
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
index 4b718b784..aa1dce9ce 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
@@ -1120,7 +1120,7 @@ public: // ********************************************************************
// whatever timers are live, so nothing here outlives the draw that filled it in.
//
enum { SUPERWEAPON_STRIP_COLS = 6 }; ///< cameos in one row, the soonest at the right hand end
- enum { SUPERWEAPON_STRIP_ROWS = 7 }; ///< rows the strip can grow to, as many as fit the top half of the screen; past 42 the latest to land have no cell
+ enum { SUPERWEAPON_STRIP_ROWS = 7 }; ///< rows the strip can grow to, past the top half of the screen from the fourth at 1280x720 and HUD Size 150%; past 42 the latest to land have no cell
enum { SUPERWEAPON_STRIP_MAX = SUPERWEAPON_STRIP_COLS * SUPERWEAPON_STRIP_ROWS };
enum { SKILL_STRIP_COLS = 6 }; ///< bought promotions in one row, under the countdowns
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index 927cac457..f3e1e35b7 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -11121,7 +11121,7 @@ static void putExperienceBar( HtmlValues &values, std::vector< HtmlValues > &cel
// the stars stand at pixel places centred on the key: centred as a line of text, the page measured
// the star glyph wider than it drew it and the row sat to the left
- enum { RANK_KEY_WIDTH = 58, STAR_PITCH = 11, STAR_SIZE = 10 };
+ enum { RANK_KEY_WIDTH = 56, STAR_PITCH = 11, STAR_SIZE = 10 };
const Int rankCount = TheRankInfoStore->getRankLevelCount();
const Int firstStar = ( RANK_KEY_WIDTH - ( rankCount * STAR_PITCH - ( STAR_PITCH - STAR_SIZE ) ) ) / 2;
for( Int rank = 1; rank <= rankCount; rank++ )
@@ -11209,8 +11209,9 @@ static const Int UPGRADE_CAMEOS = 5; ///< UnitUpgrade1 to 5, a single unit's up
/** 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 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. */
+ * screen's bottom edge. Since 2026-10-01 the radar's keys stand in the selection's header instead,
+ * the idle worker's key, the skills key and the under-attack light from its left, the smoke signals
+ * after them, and the radar has the height of its header too. */
enum
{
COMMAND_BUTTON_WIDTH = 50, ///< a command button as ControlBar.wnd authors it, the promotion screen's cell
@@ -11231,25 +11232,28 @@ enum
EXPERIENCE_WIDTH = 12, ///< the experience bar's groove, the radar's height
EXPERIENCE_GAP = 4, ///< between it and the radar
PANEL_FOOT = 4, ///< a grid's ring over the screen's bottom edge, the steel under it
- SKILLS_TAB_WIDTH = 66, ///< the skills key, the rank's stars, in a tab in the radar's header
- ALERT_TAB_WIDTH = 54, ///< the under-attack light, a lamp in a tab in the radar's header
- SIGNAL_BUTTONS = 3, ///< attack, defend, look
+ HEADER_SLOTS = 7, ///< the selection's header, in slots of a seventh of it: the idle worker's key,
+ ///< the skills key two, the under-attack light, and a smoke signal's key each
+ IDLE_SLOTS = 1,
+ SKILLS_SLOTS = 2,
+ ALERT_SLOTS = 1,
+ SIGNAL_BUTTONS = 3, ///< attack, defend, look, a slot each
SIGNAL_STEP_HEIGHT = 24, ///< how far each smoke signal key rises into its place
- IDLE_TAB_WIDTH = 38, ///< the idle worker's key in a tab in the radar's header, with its rim
MONEY_TEXT_MARGIN = 5, ///< the money's well each side of its figure, which sets the well's width
QUEUE_TRAY_BORDER = 3, ///< the production queue's tray's, thinner, since the row runs over the battlefield
SKILL_CELL_GAP = 2, ///< the steel between two cells of the powers and the production queue
QUEUE_TRAY_LINE = 1, ///< the light and dark lines along that tray's edges
QUEUE_TRAY_WELL = SKILL_CELL_GAP, ///< the well round its cells: a row stepped under another starts in it
QUEUE_TRAY_COLUMNS = 5, ///< the production queue's cells to a row, rows growing up over the selection
- HEADER_HEIGHT = 22, ///< the strip over each of the console's wells, the radar's keys standing in it
+ HEADER_HEIGHT = 22, ///< the strip over the selection's and the grid's wells; the radar's well reaches
+ ///< up through it to the console's top line
HEADER_GAP = 2, ///< between a header and its well
- SIGNAL_COLUMN_WIDTH = 36, ///< the smoke signals' well, a key wide, the three keys down it
SELECTION_ROWS = 3, ///< the selection's well: three rows of PORTRAIT_PLACES cells for a group's types
PORTRAIT_SCALE = 2, ///< a lone unit's portrait, two cells high
TOP_WELL_HEIGHT = 22, ///< the top page's clock's well
MONEY_WELL_HEIGHT = 16, ///< the money's well under it
- TOP_BORDER = 4, ///< the top page's steel round and between them
+ TOP_BORDER = 4, ///< the top page's steel round each of them
+ TOP_BOX_GAP = 2, ///< the battlefield between the clock's plate and the money's
CLOCK_WIDTH = 64, ///< the top page's wells at their narrowest, in the middle of the screen
POWER_BAR_HEIGHT = 12, ///< the power bar's groove in the command grid's header
POWER_BAR_MARGIN = 6, ///< the header's steel each end of it
@@ -11363,19 +11367,18 @@ static Int powersTrayWidth( Real scale )
return COLUMNS * ( REAL_TO_INT( CELL_WIDTH * scale ) + gap ) + REAL_TO_INT( POWER_TRAY_EDGE * scale );
}
-/** The four wells drawControlBarPage stands side by side, the radar, the smoke signals, the selection
- * and the command grid, with the steel between and round them, and the general's powers' steel at
- * its widest on the right: the console stands that much left of the middle, so the powers grow
- * into room kept for them and nothing moves when one comes. */
+/** The three wells drawControlBarPage stands side by side, the radar, the selection and the command
+ * grid, with the steel between and round them, and the general's powers' steel at its widest on the
+ * right: the console stands that much left of the middle, so the powers grow into room kept for
+ * them and nothing moves when one comes. */
Int InGameUI_consolePageWidth( void )
{
- const Int wellHeight = COMMAND_ROWS * ( COMMAND_CELL_HEIGHT + CELL_GAP );
- const Int radar = wellHeight * RADAR_WIDTH / RADAR_HEIGHT + EXPERIENCE_GAP + EXPERIENCE_WIDTH;
+ const Int radarHeight = COMMAND_ROWS * ( COMMAND_CELL_HEIGHT + CELL_GAP ) + HEADER_GAP + HEADER_HEIGHT;
+ const Int radar = radarHeight * RADAR_WIDTH / RADAR_HEIGHT + EXPERIENCE_GAP + EXPERIENCE_WIDTH;
const Int selection = PORTRAIT_PLACES * ( CELL_WIDTH + CELL_GAP );
const Int grid = COMMAND_COLUMNS * ( COMMAND_CELL_WIDTH + CELL_GAP );
- enum { WELLS = 4 };
- return radar + SIGNAL_COLUMN_WIDTH + selection + grid + ( WELLS + 1 ) * PANEL_BORDER + powersTrayWidth( 1.0f ) +
- 2 * CONSOLE_MARGIN;
+ enum { WELLS = 3 };
+ return radar + selection + grid + ( WELLS + 1 ) * PANEL_BORDER + powersTrayWidth( 1.0f ) + 2 * CONSOLE_MARGIN;
}
/** The screen's bottom edge as the bar stands on it: while the match's intro slides the bar up from
@@ -11446,15 +11449,15 @@ static IRegion2D wellHeader( const IRegion2D &well, Real scale )
return header;
}
-/** A well of the console for the page, data-each="wells": {{well.x}} .y .w .h and the header strip
- * over it, {{header.x}} .y .w .h. */
-static void putWell( std::vector< HtmlValues > &wells, const IRegion2D &well, Bool shown, Real scale )
+/** A well of the console for the page, data-each="wells": {{well.x}} .y .w .h and, when `headed`, the
+ * header strip over it, {{header.x}} .y .w .h. */
+static void putWell( std::vector< HtmlValues > &wells, const IRegion2D &well, Bool shown, Bool headed, Real scale )
{
if( !shown )
return;
HtmlValues entry;
putPageRect( entry, "well", well, TRUE, scale );
- putPageRect( entry, "header", wellHeader( well, scale ), TRUE, scale );
+ putPageRect( entry, "header", wellHeader( well, scale ), headed, scale );
wells.push_back( entry );
}
@@ -11841,9 +11844,9 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
values[ "held" ] = m_controlBarPageHovered && TheMouse->getMouseStatus()->leftState != MBS_Up ? "held" : "";
values[ "blink" ] = !values[ "promotion" ].empty() && TheGameLogic->getFrame() % LOGICFRAMES_PER_SECOND > LOGICFRAMES_PER_SECOND / 2 ? "lit" : "";
// The console: one plate of steel standing on the middle of the screen's bottom edge, its wells side
- // by side under one top line, a header strip over each - the radar with the experience bar beside
- // it and its keys in its header, the smoke signals' column, the selection, and the command grid
- // with the power bar in its header - and the general's powers growing out of its right hand end,
+ // by side under one top line - the radar with the experience bar beside it, the selection with the
+ // radar's keys and the smoke signals in its header, and the command grid with the power bar in
+ // its header - and the general's powers growing out of its right hand end,
// the owner's centred drawing of 2026-10-01 at ControlBarHudScale(), which is what the page is
// laid out at too. Every well is a fixed size and the powers' widest is kept free beside it, so
// the console keeps its place through the match and nothing moves under the pointer; HUD Size
@@ -11864,32 +11867,31 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
// not there at all where the keys would do nothing either, a game with no allies to see the smoke
const Bool signalsShown = leftFound && signalsAllowed();
- // every well is the command grid's height; the radar keeps its shape in it, the experience bar's
- // groove beside it. A watcher has no grid and no powers, and his console is the rest of it
+ // every well is the command grid's height and a header over it, but the radar's, which reaches up
+ // through the header's height to the console's top line and keeps its shape in that, the
+ // experience bar's groove beside it. A watcher has no grid and no powers, and his console is the
+ // rest of it
const Int wellHeight = REAL_TO_INT( COMMAND_ROWS * ( COMMAND_CELL_HEIGHT + CELL_GAP ) * scale );
- const Int radarWidth = wellHeight * RADAR_WIDTH / RADAR_HEIGHT;
+ const Int consoleTopLine = foot - wellHeight - REAL_TO_INT( ( HEADER_GAP + HEADER_HEIGHT ) * scale );
+ const Int radarWidth = ( foot - consoleTopLine ) * RADAR_WIDTH / RADAR_HEIGHT;
const Int radarWellWidth = radarWidth + REAL_TO_INT( ( EXPERIENCE_GAP + EXPERIENCE_WIDTH ) * scale );
- const Int signalWellWidth = REAL_TO_INT( SIGNAL_COLUMN_WIDTH * scale );
const Int selectionWellWidth = REAL_TO_INT( PORTRAIT_PLACES * ( CELL_WIDTH + CELL_GAP ) * scale );
const Int gridWellWidth = REAL_TO_INT( COMMAND_COLUMNS * ( COMMAND_CELL_WIDTH + CELL_GAP ) * scale );
const ICoord2D cell = cellSize();
const Int cellGap = REAL_TO_INT( SKILL_CELL_GAP * scale );
Int consoleWidth = radarWellWidth + border + selectionWellWidth;
- if( signalsShown )
- consoleWidth += signalWellWidth + border;
if( centreShown )
consoleWidth += border + gridWellWidth + powersTrayWidth( scale );
Int wellLeft = ( (Int)TheDisplay->getWidth() - consoleWidth ) / 2;
- const IRegion2D radarWell = nextWell( wellLeft, radarWellWidth, foot - wellHeight, foot, border );
- const IRegion2D signalWell = signalsShown ? nextWell( wellLeft, signalWellWidth, foot - wellHeight, foot, border ) : radarWell;
+ const IRegion2D radarWell = nextWell( wellLeft, radarWellWidth, consoleTopLine, foot, border );
const IRegion2D selectionWell = nextWell( wellLeft, selectionWellWidth, foot - wellHeight, foot, border );
const IRegion2D gridWell = nextWell( wellLeft, gridWellWidth, foot - wellHeight, foot, border );
IRegion2D wells;
wells.lo.x = radarWell.lo.x;
wells.hi.x = centreShown ? gridWell.hi.x : selectionWell.hi.x;
- wells.lo.y = radarWell.lo.y - REAL_TO_INT( ( HEADER_GAP + HEADER_HEIGHT ) * scale );
+ wells.lo.y = consoleTopLine;
wells.hi.y = foot;
const IRegion2D consoleBox = framed( wells, border );
const Bool consoleShown = leftFound || centreShown;
@@ -11900,10 +11902,9 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
m_queueCorner.y = m_consoleTop;
std::vector< HtmlValues > &wellList = lists[ "wells" ];
- putWell( wellList, radarWell, leftFound, scale );
- putWell( wellList, signalWell, signalsShown, scale );
- putWell( wellList, selectionWell, consoleShown, scale );
- putWell( wellList, gridWell, centreShown, scale );
+ putWell( wellList, radarWell, leftFound, FALSE, scale );
+ putWell( wellList, selectionWell, consoleShown, TRUE, scale );
+ putWell( wellList, gridWell, centreShown, TRUE, scale );
// the radar at the HUD's scale, layoutPanels having put it at the uniform one
IRegion2D radar = radarWell;
@@ -11914,29 +11915,36 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
putPageRect( values, "expframe", experience, leftFound, scale );
putExperienceBar( values, lists[ "expcells" ], lists[ "rankstars" ] );
- // in the radar's header, from its left: the idle worker's key, the skills key - the rank's stars,
- // and the button that opens the promotion screen - and the under-attack light. A key that is not
- // there leaves no gap: a watcher, or a player beaten, has no idle worker's key and no promotions
- // to buy, and only the light is left at the header's left end
+ // in the selection's header, on its grid of HEADER_SLOTS from its left: the idle worker's key, the
+ // skills key - the rank's stars, and the button that opens the promotion screen - the under-attack
+ // light, and in a multiplayer game the three smoke signals. A key that is not there leaves no gap:
+ // a watcher, or a player beaten, has no idle worker's key and no promotions to buy, and only the
+ // light is left at the header's left end. Every edge is a whole slot from the header's left, each
+ // rounded once, so two tabs share theirs
const Bool idleShown = leftFound && centreShown;
const Bool skillsShown = leftFound && ThePlayerList->getLocalPlayer()->isPlayerActive();
- IRegion2D header = radarWell;
- header.hi.y = radarWell.lo.y - REAL_TO_INT( HEADER_GAP * scale );
- header.lo.y = header.hi.y - REAL_TO_INT( HEADER_HEIGHT * scale );
- IRegion2D idleTab = header;
- idleTab.hi.x = idleTab.lo.x + ( idleShown ? (Int)REAL_TO_INT( IDLE_TAB_WIDTH * scale ) : 0 );
- IRegion2D skillsTab = header;
- skillsTab.lo.x = idleTab.hi.x;
- skillsTab.hi.x = skillsTab.lo.x + ( skillsShown ? (Int)REAL_TO_INT( SKILLS_TAB_WIDTH * scale ) : 0 );
- IRegion2D alertTab = header;
- alertTab.lo.x = skillsTab.hi.x;
- alertTab.hi.x = alertTab.lo.x + REAL_TO_INT( ALERT_TAB_WIDTH * scale );
+ const IRegion2D header = wellHeader( selectionWell, scale );
+ const Real slotWidth = (Real)selectionWellWidth / HEADER_SLOTS;
+ struct Slots
+ {
+ static IRegion2D take( const IRegion2D &header, Real slotWidth, Int &slot, Int count )
+ {
+ IRegion2D tab = header;
+ tab.lo.x = header.lo.x + REAL_TO_INT( slot * slotWidth );
+ slot += count;
+ tab.hi.x = header.lo.x + REAL_TO_INT( slot * slotWidth );
+ return tab;
+ }
+ };
+ Int slot = 0;
+ const IRegion2D idleTab = Slots::take( header, slotWidth, slot, idleShown ? IDLE_SLOTS : 0 );
+ const IRegion2D skillsTab = Slots::take( header, slotWidth, slot, skillsShown ? SKILLS_SLOTS : 0 );
+ const IRegion2D alertTab = Slots::take( header, slotWidth, slot, ALERT_SLOTS );
+ const IRegion2D signalTabs = Slots::take( header, slotWidth, slot, signalsShown ? SIGNAL_BUTTONS : 0 );
putPageRect( values, "idletab", idleTab, idleShown, scale );
putPageRect( values, "skillstab", skillsTab, skillsShown, scale );
putPageRect( values, "alerttab", alertTab, leftFound, scale );
-
- // the three smoke signal buttons down their own well right of the radar's
- putPageRect( values, "signals", signalWell, signalsShown, scale );
+ putPageRect( values, "signals", signalTabs, signalsShown, scale );
const UnsignedInt nowMs = timeGetTime();
// the idle worker's key flashes while a worker stands idle, which is when the bar enables its
@@ -11977,10 +11985,10 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
putPowerGroove( values, power, centreShown );
putPowerBar( values, lists[ "powercells" ] ); // after the groove, which it divides into cells
- // The top page, hanging from the middle of the screen's top edge: the match clock, and the money
- // under it, in one plate of steel; both wells are as wide as the wider of the two, so the plate
- // grows from its middle when the figure does. A watcher's are on the spectator page. The money's
- // well is as wide as the figure and a margin each side, following it through
+ // The top page, hanging from the middle of the screen's top edge: the match clock in a plate of its
+ // own, and the money in another hung a little under it, each as wide as what it holds, so the
+ // money's grows from its middle when the figure does. A watcher's are on the spectator page. The
+ // money's well is as wide as the figure and a margin each side, following it through
// InGameUI_moneyPlateWidth on the client's clock. A static text wraps at its window's width less
// ten pixels, which the margin only covered from a scale of 1.0 up: at 1280x720 "$ 48500 +0/s"
// broke onto two lines and spilled out of the plate. The window is one line, which the static
@@ -11993,29 +12001,36 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
moneyWindow->winSetStatus( WIN_STATUS_ONE_LINE );
moneyText->setWordWrap( 0 );
const Int moneyNeeded = moneyText->getWidth() + 2 * REAL_TO_INT( MONEY_TEXT_MARGIN * scale );
- const Int topWidth = max( (Int)REAL_TO_INT( CLOCK_WIDTH * scale ), InGameUI_moneyPlateWidth( m_moneyPlate, moneyNeeded, nowMs ) );
+ const Int clockWidth = REAL_TO_INT( CLOCK_WIDTH * scale );
+ const Int moneyWidth = InGameUI_moneyPlateWidth( m_moneyPlate, moneyNeeded, nowMs );
IRegion2D clock;
- clock.lo.x = ( (Int)TheDisplay->getWidth() - topWidth ) / 2;
- clock.hi.x = clock.lo.x + topWidth;
+ clock.lo.x = ( (Int)TheDisplay->getWidth() - clockWidth ) / 2;
+ clock.hi.x = clock.lo.x + clockWidth;
clock.lo.y = topBorder;
clock.hi.y = clock.lo.y + REAL_TO_INT( TOP_WELL_HEIGHT * scale );
putPageRect( values, "clock", clock, topShown, scale );
values[ "clock" ] = spectatorClock( TheGameLogic->getFrame() );
-
- IRegion2D money = clock;
- money.lo.y = clock.hi.y + topBorder;
+ IRegion2D clockBox = clock;
+ clockBox.lo.x -= topBorder;
+ clockBox.lo.y = 0;
+ clockBox.hi.x += topBorder;
+ clockBox.hi.y += topBorder;
+ putFrame( values, "clockbar", clock, clockBox, topShown );
+
+ const Bool moneyShown = topShown && !moneyWindow->winIsHidden();
+ IRegion2D money;
+ money.lo.x = ( (Int)TheDisplay->getWidth() - moneyWidth ) / 2;
+ money.hi.x = money.lo.x + moneyWidth;
+ money.lo.y = clockBox.hi.y + REAL_TO_INT( TOP_BOX_GAP * scale ) + topBorder;
money.hi.y = money.lo.y + REAL_TO_INT( MONEY_WELL_HEIGHT * scale );
- putMoney( values, money, topShown && !moneyWindow->winIsHidden() );
-
- IRegion2D topWells = clock;
- topWells.hi.y = money.hi.y;
- IRegion2D topBox = topWells;
- topBox.lo.x -= topBorder;
- topBox.lo.y = 0;
- topBox.hi.x += topBorder;
- topBox.hi.y += topBorder;
- putFrame( values, "topbar", topWells, topBox, topShown );
- m_topBarBottom = topShown ? topBox.hi.y : 0;
+ putMoney( values, money, moneyShown );
+ IRegion2D moneyBox = money;
+ moneyBox.lo.x -= topBorder;
+ moneyBox.lo.y -= topBorder;
+ moneyBox.hi.x += topBorder;
+ moneyBox.hi.y += topBorder;
+ putFrame( values, "moneybar", money, moneyBox, moneyShown );
+ m_topBarBottom = moneyShown ? moneyBox.hi.y : topShown ? clockBox.hi.y : 0;
// the event feed hangs in the top left corner under the menu key, and under the top page's foot
// too, which on a 4:3 screen reaches over the feed's lines
m_feedTop = max( (Int)REAL_TO_INT( MENU_FOOT * scale ), m_topBarBottom );
@@ -13244,12 +13259,6 @@ void InGameUI::drawSuperweaponStrip( void )
if( TheGameLogic == NULL || !TheGameLogic->isInGame() || TheGameLogic->isInShellGame() )
return;
- // a cameo is one of the general's power bar's, and the HUD Size option grows it with the bar:
- // the player's step on top of the bar's own
- ICoord2D traySize, cameoSize, trayHole;
- Int trayStep = 0;
- stripTrayMetrics( &traySize, &cameoSize, &trayHole, &trayStep );
-
//
// The strip is laid out in the screen's pixels, and its page with it: every length of the steel
// is turned into a whole number of screen pixels here, once, and everything after is sums of
@@ -13267,9 +13276,11 @@ void InGameUI::drawSuperweaponStrip( void )
return pixels > 1 ? pixels : 1;
}
};
- const Real hudStep = scale / ControlBarHudScaleFor( TheDisplay->getWidth(), TheDisplay->getHeight() );
- const Int cameoW = Whole::of( cameoSize.x, hudStep );
- const Int cameoH = Whole::of( cameoSize.y, hudStep );
+ // a cameo is the size of a general's power's cell in the console, so a countdown up here reads
+ // the way the powers' own do
+ const ICoord2D cameo = cellSize();
+ const Int cameoW = cameo.x;
+ const Int cameoH = cameo.y;
// the production queue's steel: the gap between two of its cells, which here is the steel between
// two owners' frames, and its tray's border, which is the well and the line along its outer edge