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): untitled wells, power bar over the grid, powers by column

Olcay Seygan2c323a92fd0e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 98c3ba543..1846d0ac6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,10 +10,11 @@ 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, the build grid and the general's powers side by side, under one top line.
+- 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.
+- 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.
-- Your money and the match clock hang from the middle of the top edge with the power bar beside them. Hold Tab and the scoreboard drops down under them.
-- Your production queue stands on the console over your selection, five to a row. The event feed runs down from the menu key in the top left corner, and the chat sits under it.
+- 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.
+- 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.
## Groups attack-move at their own speed
diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.str
index 242c2290b..fcb2a6f65 100644
--- a/GeneralsMD/Code/Data/Patch.str
+++ b/GeneralsMD/Code/Data/Patch.str
@@ -1414,19 +1414,6 @@ GUI:BarNetUnits
"units"
END
-// the titles on the console's header strips
-GUI:HudSelection
-"Selection"
-END
-
-GUI:HudCommands
-"Commands"
-END
-
-GUI:HudPowers
-"Powers"
-END
-
// the scoreboard on Tab
GUI:ScoreboardAllies
"YOUR SIDE"
diff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.str
index 897940f8b..54615da68 100644
--- a/GeneralsMD/Code/Data/Turkish/Generals.str
+++ b/GeneralsMD/Code/Data/Turkish/Generals.str
@@ -15901,18 +15901,6 @@ GUI:BarNetUnits
"birim"
END
-GUI:HudSelection
-"Seçim"
-END
-
-GUI:HudCommands
-"Komutlar"
-END
-
-GUI:HudPowers
-"Güçler"
-END
-
GUI:ScoreboardAllies
"TAKIMIN"
END
diff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
index b703645d6..8b7198fc1 100644
--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html
+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
@@ -4,9 +4,10 @@
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; the
- general's powers - and the top page hanging from the middle of the top edge, the money, the match
- clock and the power bar. Laid out at ControlBarHudScale(), 70 percent of the uniform scale the
+ 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
+ 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
bar and the experience bar are the page's to draw: their windows take the clicks and draw
@@ -55,8 +56,11 @@
at {{x}} for each veterancy level, and the health bar's dark groove,
{{sel.healthshown}} "hidden" for an enemy in disguise. The health's
figure and its lit length are Window/Html/Readout.html's
- data-each="skillcells" a cell behind each of the general's powers in the console's right hand
- well, each {{cell.x}} .y .w .h
+ data-each="skillcells" a cell behind each of the general's powers, each {{cell.x}} .y .w .h
+ data-each="powersteel" the powers' steel, a column of it under each column of their cells from
+ 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;
data-click="signal:attack", "signal:defend" or "signal:look" sends one
to the middle of the view; {{signals.shown}} is "hidden" where the keys
@@ -76,18 +80,17 @@
{{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
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, {{title}} the section's name in it or
- nothing
+ 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
- {{powerframe.x}} ... the power bar's groove right of the clock;
+ {{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 in the middle of the top page, its figure
+ {{clock.x}} ... the match clock's well at the top of the top page, its figure
Readout.html's
- {{moneyblock.x}} ... the money's well left of it, the money's window moved into it
+ {{moneyblock.x}} ... the money's well under it, the money's window moved into it
{{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
radar), RightHUD (the portrait's box), CameoWindow (the portrait),
@@ -185,8 +188,11 @@
background-repeat: no-repeat; background-image: url(Icons/RankStar.svg); }
.selinfo .health { position: absolute; left: 0; top: 40px; height: 8px; background-color: #0d1512; border-bottom: 1px solid #3f4650; }
- /* each well's title in its header strip */
- .header .title { position: absolute; left: 6px; top: 0; font-size: 9px; font-weight: bold; color: #c9d2d9; white-space: nowrap; }
+ /* the general's powers' steel, a column at a time: the console's steel with its light top line,
+ and a dark line down the part of its right hand side that faces the battlefield */
+ .powersteel .steel { left: 0; top: 0; right: 0; bottom: 0; }
+ .powersteel .shine { left: 0; right: 0; top: 0; }
+ .powersteel .shade { right: 0; top: 0; }
/* the money's well on the top page. The money's figure is the bar's own window over its well */
.stack { box-sizing: border-box; margin: 0; }
@@ -357,7 +363,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 class="title" style="line-height: {{header.h}}px">{{title}}</div></div>
+ <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" 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,7 +380,14 @@
<div class="key signal look" data-click="signal:look" style="top: 94px; margin-top: {{signal2.drop}}px"><div class="icon"></div></div>
</div>
- <!-- the top page: the money, the match clock and the power bar in one plate from the top edge -->
+ <!-- the general's powers' steel, stepping down from the console's right hand end -->
+ <div class="piece bezel solid powersteel" data-each="powersteel" style="left: {{plate.x}}px; top: {{plate.y}}px; width: {{plate.w}}px; height: {{plate.h}}px">
+ <div class="steel"></div>
+ <div class="shine"></div>
+ <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>
@@ -390,7 +403,7 @@
<div class="piece tab idle {{idletab.shown}} {{ButtonIdleWorker.state}} {{idleflash}}" 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, left of the clock; the figure is the bar's own window over its well -->
+ <!-- the money, under the clock; the figure is the bar's own window over its well -->
<div class="piece moneywell {{moneyblock.shown}}" style="left: {{moneyblock.x}}px; top: {{moneyblock.y}}px; width: {{moneyblock.w}}px; height: {{moneyblock.h}}px"><div class="lip"></div></div>
<!-- a lone unit's name, veterancy and health beside its portrait in the selection's well -->
<div class="piece selinfo {{selinfo.shown}}" style="left: {{selinfo.x}}px; top: {{selinfo.y}}px; width: {{selinfo.w}}px; height: {{selinfo.h}}px">
diff --git a/GeneralsMD/Code/Data/Window/Html/Queue.html b/GeneralsMD/Code/Data/Window/Html/Queue.html
index 8e637a3fd..b05bd6e43 100644
--- a/GeneralsMD/Code/Data/Window/Html/Queue.html
+++ b/GeneralsMD/Code/Data/Window/Html/Queue.html
@@ -2,7 +2,8 @@
<!--
Everything the player has coming, playing: one cameo for each item queued in any factory or going
up on the ground, the soonest first, in rows of five standing on the console over the selection's
- well, each row growing right and the next one over it, in a tray of the console's steel.
+ well, each row growing right and the next one over it, in a tray of the console's steel only as
+ long as each row.
The cameos, their clocks, their countdowns and the "+N" are the game's own and
draw between the page's two layers. Same materials as Window/Html/ControlBar.html.
@@ -12,7 +13,8 @@
{{side}} "america", "china" or "gla"
data-each="trays" the tray, a frame as ControlBar.html's {{console.x}} is: {{tray.x}} and .y
the border's outer corner, .w and .h the cells it holds, .bt .br .bb .bl
- its border's four widths. The queue has one
+ its border's four widths. The queue has one, and a second over it for a
+ last row shorter than five
data-each="cells" a cell behind each cameo and the "+N", each {{cell.x}} .y .w .h, the
cameo's own rectangle, and {{ring}} the steel round it
{{line}} how thick the tray's light and dark lines are, 1
@@ -34,7 +36,9 @@
strip no `cells`
{{tray.step}} "step" on a second tray: a last row shorter than the six over it hangs
under them only as wide as its own cells, against the same edge, its
- top where the rows over it end, so the two read as one stepped plate
+ top where the rows over it end, so the two read as one stepped plate.
+ The production queue's turned up: "standing" on its plate of full rows,
+ which stands on the console, and "rise" on a shorter last row over it
-->
<html>
<head>
@@ -46,38 +50,49 @@
.piece { position: absolute; }
.front .under, .back .over { display: none; }
- /* the tray: a steel plate lit from above, a light line along its top, dark down its right, which
- faces the battlefield, and along its bottom, which stands over it; the cells in a well. The
- border's widths are written into each piece, since the page cannot add a width to a width */
+ /* the tray: ControlBar.html's console steel and wells, a light line along its top, dark down its
+ right, which faces the battlefield, and along its bottom, which stands over it; the cells in a
+ well. The border's widths are written into each piece, since the page cannot add a width to a
+ width */
.tray { border-style: solid; border-color: transparent; }
- .tray .steel { position: absolute; background: linear-gradient(to bottom, #9aa3ad, #5a626c 30%, #353c45); }
+ .tray .steel { position: absolute; background: linear-gradient(to bottom, #5c6268, #363b41 30%, #20242a); }
.tray .shine { position: absolute; height: {{line}}px; background-color: #dde4ea; }
.tray .shade { position: absolute; width: {{line}}px; background-color: #0c1114; }
.tray .base { position: absolute; height: {{line}}px; background-color: #0c1114; }
.tray .lefthand, .mirrored .tray .righthand { display: none; }
.mirrored .tray .lefthand { display: block; }
.tray .sunk { position: absolute; left: -{{well}}px; top: -{{well}}px; border: {{well}}px solid #06090b;
- border-bottom-color: #b4bec8; border-right-color: #b4bec8; background-color: #3a414a; }
- .china .tray .steel { background: linear-gradient(to bottom, #c06a52, #7a3120 30%, #3f160f); }
+ border-bottom-color: #b4bec8; border-right-color: #b4bec8; background-color: #23272c; }
+ .china .tray .steel { background: linear-gradient(to bottom, #733f31, #491d13 30%, #260d09); }
.china .tray .shine { background-color: #f0b8a4; }
- .china .tray .sunk { border-bottom-color: #d98a72; border-right-color: #d98a72; background-color: #45190f; }
- .gla .tray .steel { background: linear-gradient(to bottom, #b8ab6e, #766a3a 30%, #3c3519); }
+ .china .tray .sunk { border-bottom-color: #d98a72; border-right-color: #d98a72; background-color: #290f09; }
+ .gla .tray .steel { background: linear-gradient(to bottom, #6e6742, #473f23 30%, #24200f); }
.gla .tray .shine { background-color: #ebe2b4; }
- .gla .tray .sunk { border-bottom-color: #cbbf82; border-right-color: #cbbf82; background-color: #423a1c; }
+ .gla .tray .sunk { border-bottom-color: #cbbf82; border-right-color: #cbbf82; background-color: #282311; }
/* a step: a shorter row hung under the tray over it as one plate. It has no top of its own, so
no light line, and its well's top edge is the well's steel, the gap between two rows */
.tray.step .shine { display: none; }
- .tray.step .sunk { border-top-color: #3a414a; }
- .china .tray.step .sunk { border-top-color: #45190f; }
- .gla .tray.step .sunk { border-top-color: #423a1c; }
+ .tray.step .sunk { border-top-color: #23272c; }
+ .china .tray.step .sunk { border-top-color: #290f09; }
+ .gla .tray.step .sunk { border-top-color: #282311; }
+ /* the production queue stands on the console's top line, so its plate has no shaded bottom; a
+ shorter last row rises from the plate under it, its well's bottom edge the well's steel */
+ .tray.standing .base, .tray.rise .base { display: none; }
+ /* its steel runs down into the console's top, the shade that steel has there, not out to a dark foot */
+ .tray.standing .steel, .tray.rise .steel { background: linear-gradient(to bottom, #6a7076, #5c6268); }
+ .china .tray.standing .steel, .china .tray.rise .steel { background: linear-gradient(to bottom, #814a3a, #733f31); }
+ .gla .tray.standing .steel, .gla .tray.rise .steel { background: linear-gradient(to bottom, #7b744c, #6e6742); }
+ .tray.rise .sunk { border-bottom-color: #23272c; }
+ .china .tray.rise .sunk { border-bottom-color: #290f09; }
+ .gla .tray.rise .sunk { border-bottom-color: #282311; }
/* a cell as the command grid's: a dark hole the cameo's size, a ring of the well's steel {{ring}}
wide round it and a bevel on its edge */
.cell { background-color: #020405; }
.cell.over { background: none; }
- .cell .edge { position: absolute; border-style: solid; border-color: #3a414a; }
- .china .cell .edge { border-color: #45190f; }
- .gla .cell .edge { border-color: #423a1c; }
+ .cell .edge { position: absolute; border-style: solid; border-color: #23272c; }
+ .china .cell .edge { border-color: #290f09; }
+ .gla .cell .edge { border-color: #282311; }
.cell .bevel { position: absolute; left: 0; top: 0; right: 0; bottom: 0; border: 1px solid #06090b;
border-bottom-color: #9aa4ae; border-right-color: #9aa4ae; }
.china .cell .bevel { border-bottom-color: #d98a72; border-right-color: #d98a72; }
diff --git a/GeneralsMD/Code/Data/Window/Html/Scoreboard.html b/GeneralsMD/Code/Data/Window/Html/Scoreboard.html
index a4691452c..2365a0fa9 100644
--- a/GeneralsMD/Code/Data/Window/Html/Scoreboard.html
+++ b/GeneralsMD/Code/Data/Window/Html/Scoreboard.html
@@ -52,7 +52,10 @@
.china .well { background-color: rgba(26, 10, 8, 0.9); }
.gla .well { background-color: rgba(22, 19, 8, 0.9); }
- #board { position: absolute; width: 708px; padding-bottom: 3px; }
+ /* it hangs from the top page's foot, so its top edge is that page's steel carried on */
+ #board { position: absolute; width: 708px; padding-bottom: 3px; border-top: 3px solid #363b41; }
+ .china #board { border-top-color: #491d13; }
+ .gla #board { border-top-color: #473f23; }
/* every column's left edge, shared by the captions and the seats; the Turkish captions are the
long ones, so a number column is as wide as its caption rather than its digits, and
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
index 2f1474b03..32c2a617e 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
@@ -847,9 +847,10 @@ public:
/** paint `button`'s key, the one `place` is bound to. `place` below 0 clears it. */
void labelPlaceButton( GameWindow *button, Int place );
- /** The general's powers are laid out SPECIAL_POWER_SHORTCUT_COLS to a row, so one key press
- cannot reach eleven of them. The first press picks a row (F1 is the row in the corner,
- F2 the one above it) and the second picks a power inside that row (F1 is the rightmost),
+ /** The general's powers are laid out SPECIAL_POWER_SHORTCUT_COLS to a group, so one key press
+ cannot reach eleven of them. The first press picks a group, which stands on the HUD as a
+ column (F1 is the column against the console, F2 the next) and the second picks a power
+ inside it (F1 is the bottom one),
which puts every power two keystrokes away: F1-F1, F2-F1, F2-F3. This is what the
SHORTCUT_SLOTnn keys are wired to. */
void pressSpecialPowerShortcut( Int index );
@@ -1106,9 +1107,10 @@ public:
* solid panel. */
void setPageSolids( const std::vector< IRegion2D > *solids, const std::vector< IRegion2D > *holes = NULL );
- /** The HUD page's place for the general's powers: the first in `corner`, the bottom right of the
- * grid, each `cell` big with `gap` between them, a row of SPECIAL_POWER_SHORTCUT_COLS running
- * left from it and the next row over it, the order the row keys count in. The slots' own tray
+ /** The HUD page's place for the general's powers: the first in `corner`, the bottom left of the
+ * grid, each `cell` big with `gap` between them, a group of SPECIAL_POWER_SHORTCUT_COLS going
+ * up from it as a column and the next group the column right of it, the order the group keys
+ * count in. The slots' own tray
* art is not drawn; the page draws their cells. NULL hides the bar. Screen pixels. Asked every
* frame the page draws, so it holds against the bar's own layout. Returns how many powers are
* shown, each in its place. */
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
index 8583d5da6..c353fcf64 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
@@ -4639,8 +4639,8 @@ ControlBar::PressOutcome ControlBar::peekSpecialPowerShortcutPress( Int index, G
//-------------------------------------------------------------------------------------------------
/** One key cannot reach eleven powers laid out three to a row, so it takes two: the first press
- * picks the row - F1 the row in the corner, F2 the one above it - and the second picks the power
- * in it, F1 being the rightmost. Until a row is picked only the head of each row is labelled,
+ * picks the row - a group of three, standing as a column: F1 the one against the console, F2 the
+ * one right of it - and the second picks the power in it, F1 being the bottom one. Until a row is picked only the head of each row is labelled,
* with the key that picks that row; once one is, the labels move onto its three powers. */
//-------------------------------------------------------------------------------------------------
void ControlBar::pressSpecialPowerShortcut( Int index )
@@ -6386,21 +6386,22 @@ Int ControlBar::placeSpecialPowerShortcutGrid( const ICoord2D *corner, const ICo
// the bar covers every cell, or a cell off its edge draws and never takes a click, and it is only
// as big as the powers shown, so the battlefield round them takes its own clicks. Its position is
// its own parent's, and the layout's root is not the screen
- const Int columns = MIN( shown, (Int)SPECIAL_POWER_SHORTCUT_COLS );
- const Int rows = ( shown + SPECIAL_POWER_SHORTCUT_COLS - 1 ) / SPECIAL_POWER_SHORTCUT_COLS;
+ const Int columns = ( shown + SPECIAL_POWER_SHORTCUT_COLS - 1 ) / SPECIAL_POWER_SHORTCUT_COLS;
+ const Int rows = MIN( shown, (Int)SPECIAL_POWER_SHORTCUT_COLS );
const Int width = columns * cell.x + ( columns - 1 ) * gap;
const Int height = rows * cell.y + ( rows - 1 ) * gap;
Int parentX = 0, parentY = 0;
if( m_specialPowerShortcutParent->winGetParent() )
m_specialPowerShortcutParent->winGetParent()->winGetScreenPosition( &parentX, &parentY );
- m_specialPowerShortcutParent->winSetPosition( corner->x - width - parentX, corner->y - height - parentY );
+ m_specialPowerShortcutParent->winSetPosition( corner->x - parentX, corner->y - height - parentY );
m_specialPowerShortcutParent->winSetSize( width, height );
m_specialPowerShortcutParent->winSetDrawFunc( drawNoTray );
if( m_specialPowerShortcutParent->winIsHidden() )
m_specialPowerShortcutParent->winHide( FALSE );
- // the first power in the corner, the row running left from it and the next row over it: the
- // order the row keys count in. Each cameo fills its cell
+ // the first power in the corner, its group of SPECIAL_POWER_SHORTCUT_COLS going up from it and the
+ // next group in the column to the right: F1's group is the first column, F2's the second, the
+ // order the group keys count in. Each cameo fills its cell
for( Int i = 0; i < MAX_SPECIAL_POWER_SHORTCUTS; i++ )
{
GameWindow *slot = m_specialPowerShortcutButtonParents[ i ];
@@ -6408,9 +6409,9 @@ Int ControlBar::placeSpecialPowerShortcutGrid( const ICoord2D *corner, const ICo
if( slot == NULL || button == NULL )
continue;
- const Int column = i % SPECIAL_POWER_SHORTCUT_COLS;
- const Int row = i / SPECIAL_POWER_SHORTCUT_COLS;
- slot->winSetPosition( width - ( column + 1 ) * cell.x - column * gap, height - ( row + 1 ) * cell.y - row * gap );
+ const Int column = i / SPECIAL_POWER_SHORTCUT_COLS;
+ const Int row = i % SPECIAL_POWER_SHORTCUT_COLS;
+ slot->winSetPosition( column * ( cell.x + gap ), height - ( row + 1 ) * cell.y - row * gap );
slot->winSetSize( cell.x, cell.y );
slot->winSetDrawFunc( drawNoTray );
button->winSetSize( cell.x, cell.y );
@@ -6898,8 +6899,8 @@ void ControlBar::drawSpecialPowerShortcutMultiplierText()
//
// a power takes two keys, so only the half of them that the next press can reach is
- // labelled: with no row pending that is the head of each row, carrying the key that
- // picks the row; with one pending it is that row's powers, carrying their own keys.
+ // labelled: with no group pending that is the foot of each group's column, carrying the
+ // key that picks the group; with one pending it is that group's powers, carrying their own keys.
// Which key a slot number means is up to CommandMap.ini - getMetaKeyLabel returns
// nothing for an unbound one.
//
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index a5bfcb890..927cac457 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -10980,14 +10980,14 @@ std::string InGameUI::scoreboardHtml( void )
}
}
- // hanging under the top page in the middle of the screen
- enum { BOARD_WIDTH = 708, BOARD_GAP = 4 };
+ // hanging from the top page's foot in the middle of the screen, the two one plate
+ enum { BOARD_WIDTH = 708 };
const Real scale = ControlBarUniformScale();
HtmlValues values;
values[ "side" ] = spectatorSide();
values[ "clock" ] = spectatorClock( TheGameLogic->getFrame() );
values[ "boardx" ] = std::to_string( REAL_TO_INT_FLOOR( TheDisplay->getWidth() / scale - BOARD_WIDTH ) / 2 );
- values[ "boardy" ] = std::to_string( REAL_TO_INT_FLOOR( ( m_controlBarPageShown ? m_topBarBottom : 0 ) / scale ) + BOARD_GAP );
+ values[ "boardy" ] = std::to_string( REAL_TO_INT_FLOOR( ( m_controlBarPageShown ? m_topBarBottom : 0 ) / scale ) );
return HtmlTemplate_expand( m_scoreboardPage, values, lists, lookupGameText );
}
@@ -11237,7 +11237,6 @@ enum
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
- SKILL_GRID_GAP = 4, ///< between the production queue's tray and the console it stands on
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
@@ -11248,11 +11247,12 @@ enum
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 wells: the money, the clock and the power bar
- TOP_BORDER = 5, ///< the top page's steel round and between them
- CLOCK_WIDTH = 64, ///< the match clock's well, in the middle of the screen
- TOP_POWER_WIDTH = 160, ///< the power bar's groove right of the clock
- TOP_POWER_HEIGHT = 12,
+ 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
+ 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
MENU_FOOT = 24 ///< the menu key's bottom edge in the top left corner, the feed under it
};
@@ -11350,20 +11350,32 @@ static void putPageRect( HtmlValues &values, const std::string &name, const IReg
enum
{
PANEL_BORDER = 8, ///< a panel's border outside its container, and the steel between two wells
- CONSOLE_MARGIN = 2 ///< the least battlefield each side of the console at its widest
+ CONSOLE_MARGIN = 2, ///< the least battlefield each side of the console at its widest
+ POWER_TRAY_EDGE = 4 ///< the general's powers' steel past their last column and over their top cell
};
-/** The five wells drawControlBarPage stands side by side, the radar, the smoke signals, the selection,
- * the command grid and the powers, with the steel between and round them. */
+/** The general's powers' steel at its widest, a column of cells for every group a key picks and the
+ * steel between and past them, `scale` screen pixels to a page pixel. */
+static Int powersTrayWidth( Real scale )
+{
+ enum { COLUMNS = ( MAX_SPECIAL_POWER_SHORTCUTS + SPECIAL_POWER_SHORTCUT_COLS - 1 ) / SPECIAL_POWER_SHORTCUT_COLS };
+ const Int gap = REAL_TO_INT( SKILL_CELL_GAP * 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. */
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 selection = PORTRAIT_PLACES * ( CELL_WIDTH + CELL_GAP );
const Int grid = COMMAND_COLUMNS * ( COMMAND_CELL_WIDTH + CELL_GAP );
- const Int powers = SPECIAL_POWER_SHORTCUT_COLS * ( CELL_WIDTH + SKILL_CELL_GAP ) + SKILL_CELL_GAP;
- enum { WELLS = 5 };
- return radar + SIGNAL_COLUMN_WIDTH + selection + grid + powers + ( WELLS + 1 ) * PANEL_BORDER + 2 * CONSOLE_MARGIN;
+ enum { WELLS = 4 };
+ return radar + SIGNAL_COLUMN_WIDTH + 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
@@ -11425,20 +11437,24 @@ static IRegion2D nextWell( Int &left, Int width, Int top, Int bottom, Int gap )
return well;
}
-/** 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, the same width, with {{title}} the string table's `label` in it,
- * or nothing for a NULL one. */
-static void putWell( std::vector< HtmlValues > &wells, const IRegion2D &well, Bool shown, Real scale, const char *label )
+/** The header strip over a well of the console, the same width. */
+static IRegion2D wellHeader( const IRegion2D &well, Real scale )
{
- if( !shown )
- return;
IRegion2D header = well;
header.hi.y = well.lo.y - REAL_TO_INT( HEADER_GAP * scale );
header.lo.y = header.hi.y - REAL_TO_INT( HEADER_HEIGHT * 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 )
+{
+ if( !shown )
+ return;
HtmlValues entry;
putPageRect( entry, "well", well, TRUE, scale );
- putPageRect( entry, "header", header, TRUE, scale );
- entry[ "title" ] = label ? WideCharStringToMultiByte( TheGameText->fetch( label ).str() ) : "";
+ putPageRect( entry, "header", wellHeader( well, scale ), TRUE, scale );
wells.push_back( entry );
}
@@ -11826,10 +11842,12 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
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, the command grid and the
- // general's powers - 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, so the console keeps its width
- // through the match and nothing moves under the pointer; HUD Size grows it from its bottom centre
+ // 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,
+ // 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
+ // grows it from its bottom centre
const Real scale = ControlBarHudScale();
m_controlBarOverlay->setHud( TRUE );
for( Int panel = 0; panel < panelCount; panel++ )
@@ -11856,23 +11874,21 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
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 );
- const Int powersWellWidth = SPECIAL_POWER_SHORTCUT_COLS * ( cell.x + cellGap ) + cellGap;
Int consoleWidth = radarWellWidth + border + selectionWellWidth;
if( signalsShown )
consoleWidth += signalWellWidth + border;
if( centreShown )
- consoleWidth += border + gridWellWidth + border + powersWellWidth;
+ 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 selectionWell = nextWell( wellLeft, selectionWellWidth, foot - wellHeight, foot, border );
const IRegion2D gridWell = nextWell( wellLeft, gridWellWidth, foot - wellHeight, foot, border );
- const IRegion2D powersWell = nextWell( wellLeft, powersWellWidth, foot - wellHeight, foot, border );
IRegion2D wells;
wells.lo.x = radarWell.lo.x;
- wells.hi.x = centreShown ? powersWell.hi.x : selectionWell.hi.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.hi.y = foot;
const IRegion2D consoleBox = framed( wells, border );
@@ -11884,12 +11900,10 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
m_queueCorner.y = m_consoleTop;
std::vector< HtmlValues > &wellList = lists[ "wells" ];
- // the radar's header holds its keys, and the signals' is a key wide: neither has room for a title
- putWell( wellList, radarWell, leftFound, scale, NULL );
- putWell( wellList, signalWell, signalsShown, scale, NULL );
- putWell( wellList, selectionWell, consoleShown, scale, "GUI:HudSelection" );
- putWell( wellList, gridWell, centreShown, scale, "GUI:HudCommands" );
- putWell( wellList, powersWell, centreShown, scale, "GUI:HudPowers" );
+ putWell( wellList, radarWell, leftFound, scale );
+ putWell( wellList, signalWell, signalsShown, scale );
+ putWell( wellList, selectionWell, consoleShown, scale );
+ putWell( wellList, gridWell, centreShown, scale );
// the radar at the HUD's scale, layoutPanels having put it at the uniform one
IRegion2D radar = radarWell;
@@ -11952,46 +11966,49 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
// and V do, for anything that attack moves
taken[ COMMAND_PLACE_ATTACK ] = taken[ COMMAND_PLACE_HOLD ] = taken[ COMMAND_PLACE_MOVE ] = fights;
- // The top page, hanging from the middle of the screen's top edge: the match clock in the middle,
- // the money left of it and the power bar right of it, one plate of steel round the three. The
- // clock stands still and the money grows to the left, so nothing else moves 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 text draws unwrapped, so the figure is never cut and its own
- // string measures it. It stays up while the bar is put away: it is the player's, not the bar's
+ // The power bar lies in the command grid's header strip, as long as the strip less a margin each end
+ const IRegion2D gridHeader = wellHeader( gridWell, scale );
+ const Int powerMargin = REAL_TO_INT( POWER_BAR_MARGIN * scale );
+ IRegion2D power;
+ power.lo.x = gridHeader.lo.x + powerMargin;
+ power.hi.x = gridHeader.hi.x - powerMargin;
+ power.lo.y = ( gridHeader.lo.y + gridHeader.hi.y - REAL_TO_INT( POWER_BAR_HEIGHT * scale ) ) / 2;
+ power.hi.y = power.lo.y + REAL_TO_INT( POWER_BAR_HEIGHT * scale );
+ 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
+ // 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
+ // text draws unwrapped, so the figure is never cut and its own string measures it. It stays up
+ // while the bar is put away: it is the player's, not the bar's
const Bool topShown = !watching;
const Int topBorder = REAL_TO_INT( TOP_BORDER * scale );
+ GameWindow *moneyWindow = controlBarWindow( "MoneyDisplay" );
+ DisplayString *moneyText = ( (TextData *)moneyWindow->winGetUserData() )->text;
+ 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 ) );
IRegion2D clock;
- clock.lo.x = ( (Int)TheDisplay->getWidth() - REAL_TO_INT( CLOCK_WIDTH * scale ) ) / 2;
- clock.hi.x = clock.lo.x + REAL_TO_INT( CLOCK_WIDTH * scale );
+ clock.lo.x = ( (Int)TheDisplay->getWidth() - topWidth ) / 2;
+ clock.hi.x = clock.lo.x + topWidth;
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() );
- GameWindow *moneyWindow = controlBarWindow( "MoneyDisplay" );
- DisplayString *moneyText = ( (TextData *)moneyWindow->winGetUserData() )->text;
- moneyWindow->winSetStatus( WIN_STATUS_ONE_LINE );
- moneyText->setWordWrap( 0 );
- const Int moneyNeeded = moneyText->getWidth() + 2 * REAL_TO_INT( MONEY_TEXT_MARGIN * scale );
IRegion2D money = clock;
- money.hi.x = clock.lo.x - topBorder;
- money.lo.x = money.hi.x - InGameUI_moneyPlateWidth( m_moneyPlate, moneyNeeded, nowMs );
+ money.lo.y = clock.hi.y + topBorder;
+ money.hi.y = money.lo.y + REAL_TO_INT( MONEY_WELL_HEIGHT * scale );
putMoney( values, money, topShown && !moneyWindow->winIsHidden() );
- IRegion2D power = clock;
- power.lo.x = clock.hi.x + topBorder;
- power.hi.x = power.lo.x + REAL_TO_INT( TOP_POWER_WIDTH * scale );
- power.lo.y = ( clock.lo.y + clock.hi.y - REAL_TO_INT( TOP_POWER_HEIGHT * scale ) ) / 2;
- power.hi.y = power.lo.y + REAL_TO_INT( TOP_POWER_HEIGHT * scale );
- putPowerGroove( values, power, topShown );
- putPowerBar( values, lists[ "powercells" ] ); // after the groove, which it divides into cells
-
IRegion2D topWells = clock;
- topWells.lo.x = money.lo.x;
- topWells.hi.x = power.hi.x;
+ topWells.hi.y = money.hi.y;
IRegion2D topBox = topWells;
topBox.lo.x -= topBorder;
topBox.lo.y = 0;
@@ -12003,16 +12020,15 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
// 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 );
- // the money's and the power's windows stand outside the bar's frame, where a window is never
- // pointed at, so the page puts their cards up while the pointer is over their wells
+ // the money's window stands outside the bar's frame, where a window is never pointed at, and the
+ // power's has nothing to draw, so the page puts their cards up while the pointer is over their wells
const ICoord2D &pointer = TheMouse->getMouseStatus()->pos;
- if( topShown && pointer.y >= money.lo.y && pointer.y < money.hi.y )
- {
- if( pointer.x >= money.lo.x && pointer.x < money.hi.x )
- TheControlBar->showBuildTooltipLayout( moneyWindow );
- else if( pointer.x >= power.lo.x && pointer.x < power.hi.x )
- TheControlBar->showBuildTooltipLayout( controlBarWindow( "PowerWindow" ) );
- }
+ struct Over { static Bool is( const ICoord2D &point, const IRegion2D &rect )
+ { return point.x >= rect.lo.x && point.x < rect.hi.x && point.y >= rect.lo.y && point.y < rect.hi.y; } };
+ if( topShown && Over::is( pointer, money ) )
+ TheControlBar->showBuildTooltipLayout( moneyWindow );
+ else if( centreShown && Over::is( pointer, power ) )
+ TheControlBar->showBuildTooltipLayout( controlBarWindow( "PowerWindow" ) );
// 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
@@ -12117,37 +12133,54 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
portraitCells.push_back( entry );
}
- // the general's powers ready to fire in the console's right hand well, the first in its bottom
- // right corner, the row growing left as they come and wrapping upward past three, each a cell's size
+ // the general's powers ready to fire, growing out of the console's right hand end, a column for
+ // each group a key picks: F1's against it, its powers going up from the wells' floor, F2's beside
+ // it and so on, four columns for eleven. Only the powers there are have steel, a column of it
+ // under each column of cells as high as its own, so the plate steps down to the right and there
+ // is never an empty place
ICoord2D corner;
- corner.x = powersWell.hi.x - cellGap;
- corner.y = powersWell.hi.y - cellGap;
- ICoord2D powerCell = cell;
- Int powersShown = TheControlBar->placeSpecialPowerShortcutGrid( centreShown ? &corner : NULL, powerCell, cellGap );
- // ten or eleven powers take a fourth row, which the well has no height for: their cells shrink
- // until four rows fit it
- const Int powerRows = ( powersShown + SPECIAL_POWER_SHORTCUT_COLS - 1 ) / SPECIAL_POWER_SHORTCUT_COLS;
- if( powerRows * ( cell.y + cellGap ) + cellGap > wellHeight )
- {
- powerCell.y = ( wellHeight - cellGap ) / powerRows - cellGap;
- powerCell.x = cell.x * powerCell.y / cell.y;
- powersShown = TheControlBar->placeSpecialPowerShortcutGrid( &corner, powerCell, cellGap );
- }
+ corner.x = consoleBox.hi.x;
+ corner.y = foot;
+ const Int powersShown = TheControlBar->placeSpecialPowerShortcutGrid( centreShown ? &corner : NULL, cell, cellGap );
std::vector< HtmlValues > &places = lists[ "skillcells" ];
for( Int slot = 0; slot < powersShown; slot++ )
{
- const Int column = slot % SPECIAL_POWER_SHORTCUT_COLS;
- const Int row = slot / SPECIAL_POWER_SHORTCUT_COLS;
+ const Int column = slot / SPECIAL_POWER_SHORTCUT_COLS;
+ const Int row = slot % SPECIAL_POWER_SHORTCUT_COLS;
IRegion2D place;
- place.hi.x = corner.x - column * ( powerCell.x + cellGap );
- place.hi.y = corner.y - row * ( powerCell.y + cellGap );
- place.lo.x = place.hi.x - powerCell.x;
- place.lo.y = place.hi.y - powerCell.y;
+ place.lo.x = corner.x + column * ( cell.x + cellGap );
+ place.hi.y = corner.y - row * ( cell.y + cellGap );
+ place.hi.x = place.lo.x + cell.x;
+ place.lo.y = place.hi.y - cell.y;
HtmlValues entry;
putCell( entry, place, pageRing( cellGap, scale ), scale );
places.push_back( entry );
}
+ const Int powerEdge = REAL_TO_INT( POWER_TRAY_EDGE * scale );
+ const Int powerColumns = ( powersShown + SPECIAL_POWER_SHORTCUT_COLS - 1 ) / SPECIAL_POWER_SHORTCUT_COLS;
+ std::vector< HtmlValues > &steel = lists[ "powersteel" ];
+ Int columnTop[ MAX_SPECIAL_POWER_SHORTCUTS ];
+ for( Int column = 0; column < powerColumns; column++ )
+ {
+ const Int cells = min( powersShown - column * SPECIAL_POWER_SHORTCUT_COLS, (Int)SPECIAL_POWER_SHORTCUT_COLS );
+ columnTop[ column ] = corner.y - cells * ( cell.y + cellGap ) + cellGap - powerEdge;
+ }
+ for( Int column = 0; column < powerColumns; column++ )
+ {
+ // a column takes the gap left of its cells, and the last the edge right of them too; its own
+ // shade down its right hand side is the part no column beside it covers
+ IRegion2D plate;
+ plate.lo.x = column == 0 ? consoleBox.hi.x - 1 : corner.x + column * ( cell.x + cellGap ) - cellGap;
+ plate.hi.x = corner.x + column * ( cell.x + cellGap ) + cell.x + ( column + 1 == powerColumns ? powerEdge : 0 );
+ plate.lo.y = columnTop[ column ];
+ plate.hi.y = consoleBox.hi.y;
+ HtmlValues entry;
+ putPageRect( entry, "plate", plate, TRUE, scale );
+ const Int shadeFoot = column + 1 == powerColumns ? plate.hi.y : columnTop[ column + 1 ];
+ entry[ "shadeh" ] = std::to_string( REAL_TO_INT_FLOOR( ( shadeFoot - plate.lo.y ) / scale + 0.5f ) );
+ steel.push_back( entry );
+ }
// each grid's frames again in front of its buttons, drawn by a window after them
m_cellFrontCells[ CELL_GRID_COMMAND ] = commandCells;
@@ -13101,31 +13134,52 @@ void InGameUI::drawQueueTray( void )
shown += m_productionStrip[ slot ].quantity;
const Int cells = m_productionStripCount + ( m_productionStripTotal > shown ? 1 : 0 );
const Int columns = min( cells, (Int)QUEUE_TRAY_COLUMNS );
- const Int rows = ( cells + QUEUE_TRAY_COLUMNS - 1 ) / QUEUE_TRAY_COLUMNS;
+ const Int fullRows = cells / QUEUE_TRAY_COLUMNS;
+ const Int lastRow = cells % QUEUE_TRAY_COLUMNS;
m_productionStripCameoW = cell.x;
m_productionStripCameoH = cell.y;
m_productionStripStep = cell.x + gap;
const Int rowStep = cell.y + gap;
+ // the tray stands on the console's top line with nothing between, its left edge the selection
+ // well's: the full rows in one plate, and a shorter last row on top of it only as wide as its own
+ // cells, the two one stepped plate as the powers' columns are
IRegion2D cellsBox;
cellsBox.lo.x = m_queueCorner.x + trayBorder;
- cellsBox.hi.y = m_queueCorner.y - REAL_TO_INT( SKILL_GRID_GAP * scale ) - trayBorder;
- cellsBox.lo.y = cellsBox.hi.y - rows * rowStep + gap;
+ cellsBox.hi.y = m_queueCorner.y - trayBorder;
+ cellsBox.lo.y = cellsBox.hi.y - ( fullRows > 0 ? fullRows : 1 ) * rowStep + gap;
cellsBox.hi.x = cellsBox.lo.x + columns * m_productionStripStep - gap;
- IRegion2D tray = cellsBox;
- tray.lo.x -= trayBorder;
- tray.lo.y -= trayBorder;
- tray.hi.x += trayBorder;
- tray.hi.y += trayBorder;
HtmlValues values;
HtmlLists lists;
values[ "side" ] = spectatorSide();
values[ "line" ] = std::to_string( QUEUE_TRAY_LINE );
values[ "well" ] = std::to_string( QUEUE_TRAY_WELL );
- lists[ "trays" ].resize( 1 ); // the page's trays are a list: the superweapon strip has a stepped one
- putFrame( lists[ "trays" ][ 0 ], "tray", cellsBox, tray, TRUE );
+ std::vector< HtmlValues > &trays = lists[ "trays" ];
+ IRegion2D tray = cellsBox;
+ tray.lo.x -= trayBorder;
+ tray.lo.y -= trayBorder;
+ tray.hi.x += trayBorder;
+ tray.hi.y += trayBorder + 1; // over the console's light top line, so the two plates are one
+ trays.resize( 1 );
+ putFrame( trays[ 0 ], "tray", cellsBox, tray, TRUE );
+ trays[ 0 ][ "tray.step" ] = "standing";
+ if( fullRows > 0 && lastRow > 0 )
+ {
+ IRegion2D rise = cellsBox;
+ rise.hi.y = cellsBox.lo.y - gap;
+ rise.lo.y = rise.hi.y - cell.y;
+ rise.hi.x = rise.lo.x + lastRow * m_productionStripStep - gap;
+ IRegion2D riseTray = rise;
+ riseTray.lo.x -= trayBorder;
+ riseTray.lo.y -= trayBorder;
+ riseTray.hi.x += trayBorder;
+ riseTray.hi.y = cellsBox.lo.y;
+ trays.resize( 2 );
+ putFrame( trays[ 1 ], "tray", rise, riseTray, TRUE );
+ trays[ 1 ][ "tray.step" ] = "rise";
+ }
std::vector< HtmlValues > &cellList = lists[ "cells" ];
for( Int each = 0; each < cells; each++ )
{
@@ -14518,10 +14572,11 @@ Bool InGameUI::drawTooltipPage( const UnicodeString &cursorText, const RGBColor
if( card )
{
// over the button, centred on it, and under it when there is no room above; a button on
- // the console has its card over the console's top line, clear of the wells' headers
+ // the console has its card standing on the console's top line, clear of the wells' headers,
+ // as the production queue stands there
box.lo.x = ( card->anchor.lo.x + card->anchor.hi.x - m_tooltipSize.x ) / 2;
- const Int anchorTop = m_controlBarPageShown && card->anchor.hi.y > m_consoleTop ? m_consoleTop : card->anchor.lo.y;
- box.lo.y = anchorTop - gap - m_tooltipSize.y;
+ const Bool onConsole = m_controlBarPageShown && card->anchor.hi.y > m_consoleTop;
+ box.lo.y = onConsole ? m_consoleTop - m_tooltipSize.y : card->anchor.lo.y - gap - m_tooltipSize.y;
if( box.lo.y < 0 )
box.lo.y = card->anchor.hi.y + gap;
box.lo.x = max( 0, min( box.lo.x, screenWidth - m_tooltipSize.x ) );