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): players strip, superweapons on tab, steel esc menu

Olcay Seygan5b263e338477
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2b581f681..5f66320ea 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -507,6 +507,10 @@ found and fixed — EA's own, not port damage.**
- Three buttons sit in a step of the radar's own steel, on its right: the smoke signals Alt+Z, X and C send, placed in the middle of your view for your allies to see. 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.
- The readout in the top right corner is a box of its own and always there: the time of day, the match time and the real time beside it, the logic rate and the frame rate, the renderer and the frame number. In a network game it adds how many frames are ready out of the input delay, the room's frame rate and the traffic in and out, and under a unit limit your count against it.
+- Every player in the match hangs from the top edge of the screen, your own team on the left, the match clock between two teams. Each one is a general's flag on a small steel plate with that player's colour along its top, and a lamp sits on the plate's bottom edge for their superweapons: green once one can fire, an empty ring while it is still charging, red when they have none. The column of superweapon countdowns that used to sit in the top right is gone while you play; the full list with the seconds is on Tab.
+- The steel between the build buttons, the portrait's grid and the promotion screen's cells is half as wide as it was, so the pictures take the room. The queue's tray has a thinner rim. The portrait and its upgrade icons sit under the portrait's grid, framed the same way as every other picture on the bar.
+- The command bar slides up from the bottom of the screen again when a match starts. The new steel frame had been drawn at its final place from the first frame, so the buttons rose into a frame that was already standing.
+- The Escape menu is in the bar's steel too: a plate in your side's colour with sunk keys that light gold under the pointer and press in when clicked. Restart reads Surrender or Restart Mission as the game you are in calls for.
## Placing buildings
@@ -726,6 +730,7 @@ found and fixed — EA's own, not port damage.**
- Names are written in white and the player's colour goes on the stripe. Dark red on a black panel measured about 2 to 1 and could barely be read. A player who is out goes grey.
- An enemy row is a colour, a name and a team and nothing more. What they are playing and what they have in the bank is theirs to know.
- Watching a match, everybody gets the full row, with a team column to say who is with whom.
+- Under the players, every superweapon in the match: each player who owns one, then each of their superweapons as its picture and the seconds it still needs, soonest first, rimmed in gold once it can fire. Enemies' too, as the old countdown column in the corner showed them.
- The diplomacy screen, where you mute a player, is still on the command bar's button.
## Your Razer hardware plays along
diff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
index f404a2731..2fb0689a4 100644
--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html
+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
@@ -15,7 +15,9 @@
The game fills in, every frame (GameClient/HtmlTemplate.h):
{{layer}} "back" under the bar's windows; "front" drawn again after one grid's
buttons with nothing but {{side}} and data-each="frontcells", that grid's
- cells, each {{cell.x}} .y .w .h, whose frames then lie over the buttons
+ cells, each {{cell.x}} .y .w .h, whose frames then lie over the buttons.
+ Every cell of every grid is its picture's rectangle, with {{ring}} the
+ steel round it in page pixels
{{side}} "america", "china" or "gla": the side whose bar is on screen
{{promotion}} "ready" while the general has a promotion to spend
{{watching}} "watching" while the local player is an observer or out of the match
@@ -49,6 +51,10 @@
net.in and net.out with {{net.online}} "online" in a network game;
net.units and net.cap with {{net.capped}} "capped" under a unit limit
{{blink}} "lit" for half of every second, for anything that blinks
+ data-each="seats" while playing, every player grouped by team, your own first: {{kind}}
+ "seat" with {{image}} {{color}} and {{weapon}} "ready", "charging" or
+ "none"; between exactly two teams
+ an entry of kind "clock" showing {{clock}}, between any others one of "gap"
{{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
@@ -132,10 +138,11 @@
.gla .bezel .steel { background: linear-gradient(to bottom, #b8ab6e, #766a3a 30%, #3c3519); }
.gla .bezel .shine { background-color: #ebe2b4; }
.gla .bezel .sunk { border-bottom-color: #cbbf82; border-right-color: #cbbf82; }
- /* the command grid: its well is steel, and each of the fourteen places a dark cell with the well's
- steel laid two pixels over its edge and a bevel inside that; an empty place shows as a hole. The
- page is drawn a second time as the front, after each grid's buttons, with only the frames and
- the bevels, so the grid lies over the buttons, which stand in the hole exactly */
+ /* the command grid: its well is steel, and each of the fourteen places a dark hole exactly its
+ picture's size, a ring of the well's steel {{ring}} wide round it, half the gap to the next, and
+ a bevel on the hole's edge; an empty place shows as a hole. The page is drawn a second time as
+ the front, after each grid's buttons, with only the rings and the bevels, so the grid lies over
+ the buttons and takes no more than the bevel's pixel off a picture */
.front .piece { display: none; }
.front .piece.over { display: block; }
.bezel .sunk.grid { background-color: #3a414a; }
@@ -143,10 +150,11 @@
.gla .bezel .sunk.grid { background-color: #423a1c; }
.commandcell { background-color: #020405; }
.commandcell.over { background: none; }
- .commandcell .edge { position: absolute; left: -1px; top: -1px; right: -1px; bottom: -1px; border: 3px solid #3a414a; }
+ .commandcell .edge { position: absolute; border-style: solid; border-color: #3a414a; }
.china .commandcell .edge { border-color: #45190f; }
.gla .commandcell .edge { border-color: #423a1c; }
- .commandcell .bevel { position: absolute; left: 2px; top: 2px; right: 2px; bottom: 2px; border: 1px solid #06090b;
+ /* the bevel lies on the picture's outermost pixel, where a button draws its own border line */
+ .commandcell .bevel { position: absolute; left: 0; top: 0; right: 0; bottom: 0; border: 1px solid #06090b;
border-bottom-color: #9aa4ae; border-right-color: #9aa4ae; }
.china .commandcell .bevel { border-bottom-color: #d98a72; border-right-color: #d98a72; }
.gla .commandcell .bevel { border-bottom-color: #cbbf82; border-right-color: #cbbf82; }
@@ -332,6 +340,28 @@
#net.online .onlineonly { display: block; }
#net .cappedonly { display: none; }
#net .cappedonly.capped { display: block; }
+
+ /* the players hanging from the top edge, grouped by team with the clock between two teams: each
+ their general's flag on a steel plate with their colour along its top, and on its bottom edge,
+ half in and half out, a lamp for their superweapons: green once one can fire, an empty ring
+ while none can yet, red when they have none */
+ #seats { left: 180px; right: 180px; top: 0; text-align: center; }
+ .sseat, .sclock, .sgap { display: inline-block; position: relative; vertical-align: top; }
+ .sseat { width: 32px; height: 34px; margin: 0 1px; }
+ .sseat .plate { position: absolute; left: 0; top: 0; width: 30px; height: 26px; border: 1px solid #0c1114; border-top: 0;
+ background: linear-gradient(to bottom, #6f7782, #3f4650 50%, #1f252c); }
+ .china .sseat .plate { background: linear-gradient(to bottom, #8e3b2b, #4c1b13 50%, #26100b); }
+ .gla .sseat .plate { background: linear-gradient(to bottom, #867a45, #48401e 50%, #241f0f); }
+ .sseat .stripe { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
+ .sseat .emblem { position: absolute; left: 3px; top: 5px; width: 24px; height: 14px; }
+ .sseat .lamp { position: absolute; left: 9px; top: 20px; width: 14px; height: 14px; background-size: 100% 100%; }
+ .sseat .lamp.ready { background-image: url(Icons/LampReady.svg); }
+ .sseat .lamp.charging { background-image: url(Icons/LampCharging.svg); }
+ .sseat .lamp.none { background-image: url(Icons/LampNone.svg); }
+ .sclock { width: 46px; height: 18px; margin: 0 4px; line-height: 18px; font-size: 10px; font-weight: bold; color: #e8d27a;
+ background-color: rgba(4, 8, 10, 0.9); border: 1px solid #06090b; border-top: 0; border-bottom-color: #b4bec8; border-right-color: #b4bec8; }
+ .sgap { width: 8px; height: 30px; }
+ .sclock .plate, .sclock .lamp, .sgap .plate, .sgap .lamp, .sgap .clocktext, .sseat .clocktext { display: none; }
</style>
</head>
<body>
@@ -351,7 +381,7 @@
<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>
- <div class="piece commandcell" data-each="commandcells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge"></div><div class="bevel"></div></div>
+ <div class="piece commandcell" data-each="commandcells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge" style="left: -{{ring}}px; top: -{{ring}}px; right: -{{ring}}px; bottom: -{{ring}}px; border-width: {{ring}}px"></div><div class="bevel"></div></div>
<div class="piece step worker solid {{workertab.shown}} {{ButtonIdleWorker.state}}" style="left: {{workertab.x}}px; top: {{workertab.y}}px; width: {{workertab.w}}px; height: {{workertab.h}}px">
<div class="key" data-click="press:ButtonIdleWorker"><div class="icon"></div><div class="veil"></div></div>
</div>
@@ -383,7 +413,7 @@
<div class="lit" style="left: -{{right.bl}}px; top: -{{right.bt}}px; bottom: -{{right.bb}}px"></div>
<div class="sunk grid" style="width: {{right.w}}px; height: {{right.h}}px"></div>
</div>
- <div class="piece commandcell" data-each="portraitcells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge"></div><div class="bevel"></div></div>
+ <div class="piece commandcell" data-each="portraitcells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge" style="left: -{{ring}}px; top: -{{ring}}px; right: -{{ring}}px; bottom: -{{ring}}px; border-width: {{ring}}px"></div><div class="bevel"></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">
<div class="rungs" style="width: {{expframe.innerw}}px"><div class="rung {{lit}}" data-each="expcells" style="top: {{y}}px; height: {{h}}px; width: {{expframe.innerw}}px"><div class="seg" style="width: {{expframe.innerw}}px; height: {{segh}}px"></div></div></div>
<div class="lip"></div>
@@ -408,10 +438,10 @@
<div class="base" style="left: -{{skilltray.bl}}px; right: -{{skilltray.br}}px; bottom: -{{skilltray.bb}}px"></div>
<div class="sunk grid" style="width: {{skilltray.w}}px; height: {{skilltray.h}}px"></div>
</div>
- <div class="piece commandcell" data-each="skillcells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge"></div><div class="bevel"></div></div>
+ <div class="piece commandcell" data-each="skillcells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge" style="left: -{{ring}}px; top: -{{ring}}px; right: -{{ring}}px; bottom: -{{ring}}px; border-width: {{ring}}px"></div><div class="bevel"></div></div>
<!-- the front: one grid's frames again, drawn after its buttons -->
- <div class="piece commandcell over" data-each="frontcells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge"></div><div class="bevel"></div></div>
+ <div class="piece commandcell over" data-each="frontcells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge" style="left: -{{ring}}px; top: -{{ring}}px; right: -{{ring}}px; bottom: -{{ring}}px; border-width: {{ring}}px"></div><div class="bevel"></div></div>
<div class="piece button menu {{ButtonOptions.state}}" data-click="press:ButtonOptions">
<div class="bar" style="top: 4px"></div>
@@ -419,6 +449,14 @@
<div class="bar" style="top: 10px"></div>
</div>
+ <div id="seats" class="piece">
+ <div class="s{{kind}}" data-each="seats">
+ <div class="plate"><div class="stripe" style="background-color: {{color}}"></div><img class="emblem" src="{{image}}"></div>
+ <div class="lamp {{weapon}}"></div>
+ <div class="clocktext">{{clock}}</div>
+ </div>
+ </div>
+
<div id="net" class="piece panel {{net.online}}">
<div class="line"><span class="big">{{net.clock}}</span> {{net.game}} <span class="dim">({{net.real}})</span></div>
<div class="line">{{net.hz}}hz {{net.fps}}fps <span class="dim">{{net.renderer}} frame {{net.frame}}</span></div>
diff --git a/GeneralsMD/Code/Data/Window/Html/Icons/LampCharging.svg b/GeneralsMD/Code/Data/Window/Html/Icons/LampCharging.svg
new file mode 100644
index 000000000..4cb013432
--- /dev/null
+++ b/GeneralsMD/Code/Data/Window/Html/Icons/LampCharging.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12">
+ <circle cx="6" cy="6" r="4.2" fill="none" stroke="#dfe5ea" stroke-width="1.6"/>
+</svg>
diff --git a/GeneralsMD/Code/Data/Window/Html/Icons/LampNone.svg b/GeneralsMD/Code/Data/Window/Html/Icons/LampNone.svg
new file mode 100644
index 000000000..a5f52c5b2
--- /dev/null
+++ b/GeneralsMD/Code/Data/Window/Html/Icons/LampNone.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12">
+ <circle cx="6" cy="6" r="4.6" fill="#e0402c" stroke="#0c1114" stroke-width="1.2"/>
+</svg>
diff --git a/GeneralsMD/Code/Data/Window/Html/Icons/LampReady.svg b/GeneralsMD/Code/Data/Window/Html/Icons/LampReady.svg
new file mode 100644
index 000000000..24bd99ae0
--- /dev/null
+++ b/GeneralsMD/Code/Data/Window/Html/Icons/LampReady.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12">
+ <circle cx="6" cy="6" r="4.6" fill="#5ee04a" stroke="#0c1114" stroke-width="1.2"/>
+</svg>
diff --git a/GeneralsMD/Code/Data/Window/Html/Promotion.html b/GeneralsMD/Code/Data/Window/Html/Promotion.html
index c9ca8d96e..d03331fd0 100644
--- a/GeneralsMD/Code/Data/Window/Html/Promotion.html
+++ b/GeneralsMD/Code/Data/Window/Html/Promotion.html
@@ -19,7 +19,8 @@
data-each="exprungs" the experience bar's twenty rungs, each {{lit}} "lit" up to the way from
this rank to the next, at {{x}} and {{w}} inside the bar
data-each="headings" a heading over each row of promotions, {{heading.x}} .y .w .h and {{label}}
- data-each="cells" every place of every row's grid, {{cell.x}} .y .w .h, and {{state}}
+ data-each="cells" every place of every row's grid, {{cell.x}} .y .w .h, {{ring}} the steel
+ round it in page pixels, and {{state}}
"owned" once bought, "ready" while it can be, "locked" while it cannot,
"empty" where no promotion stands
All in the page's pixels, a pixel of an 800x600 screen. Without this page the painting draws.
@@ -74,16 +75,17 @@
/* the page is drawn twice a frame: the back under the promotions, the front over them */
.front .under, .back .over { display: none; }
- /* the grid, as the command bar's: every place a dark cell, the well's steel between them. The front
- lays the same steel over the gap and two pixels into each cell, with a bevel inside it, and the
- promotion fills the hole exactly, so the grid reads as laid over the promotions; a promotion's
- bevel is a rim that says where it stands - gold once bought, light steel while it can be bought */
+ /* the grid, as the command bar's: every place a dark hole the promotion's size, a ring of the
+ well's steel {{ring}} wide round it, half the gap to the next, and a bevel on its edge. The front
+ lays the rings and bevels again over the promotions, so the grid reads as laid over them; a
+ promotion's bevel is a rim that says where it stands - gold once bought, light steel while it can
+ be bought */
.cell { background-color: #020405; }
.cell.over { background: none; }
- .cell .frame { position: absolute; left: -1px; top: -1px; right: -1px; bottom: -1px; border: 3px solid #3a414a; }
- .china .cell .frame { border-color: #45190f; }
- .gla .cell .frame { border-color: #423a1c; }
- .cell .bevel { position: absolute; left: 2px; top: 2px; right: 2px; bottom: 2px; border: 1px solid #06090b;
+ .cell .edge { position: absolute; border-style: solid; border-color: #3a414a; }
+ .china .cell .edge { border-color: #45190f; }
+ .gla .cell .edge { border-color: #423a1c; }
+ .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; }
.gla .cell .bevel { border-bottom-color: #cbbf82; border-right-color: #cbbf82; }
@@ -115,7 +117,7 @@
<div class="piece heading under" data-each="headings" style="left: {{heading.x}}px; top: {{heading.y}}px; width: {{heading.w}}px; height: {{heading.h}}px">{{label}}<div class="rule"></div></div>
<div class="piece cell under" data-each="cells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"></div>
- <div class="piece cell over {{state}}" data-each="cells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="frame"></div><div class="bevel"></div></div>
+ <div class="piece cell over {{state}}" data-each="cells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge" style="left: -{{ring}}px; top: -{{ring}}px; right: -{{ring}}px; bottom: -{{ring}}px; border-width: {{ring}}px"></div><div class="bevel"></div></div>
<div class="piece close under {{ButtonExit.shown}} {{ButtonExit.state}}" style="left: {{ButtonExit.x}}px; top: {{ButtonExit.y}}px; width: {{ButtonExit.w}}px; height: {{ButtonExit.h}}px"><div class="label">{{text:GUI:CloseExpScreen}}</div></div>
</div>
diff --git a/GeneralsMD/Code/Data/Window/Html/Queue.html b/GeneralsMD/Code/Data/Window/Html/Queue.html
index ca3c8abc8..a1048079d 100644
--- a/GeneralsMD/Code/Data/Window/Html/Queue.html
+++ b/GeneralsMD/Code/Data/Window/Html/Queue.html
@@ -13,7 +13,8 @@
{{tray.x}} .y .w .h the tray, a panel as ControlBar.html's {{right.x}} is: .x and .y the
border's outer corner, .w and .h the cells it holds, .bt .br .bb .bl its
border's four widths
- data-each="cells" a cell behind each cameo and the "+N", each {{cell.x}} .y .w .h
+ 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
All in the page's pixels, a pixel of an 800x600 screen. Without this page the strip draws its
column of the power bar's trays.
-->
@@ -45,13 +46,14 @@
.gla .tray .shine { background-color: #ebe2b4; }
.gla .tray .sunk { border-bottom-color: #cbbf82; border-right-color: #cbbf82; background-color: #423a1c; }
- /* a cell as the command grid's: dark, the well's steel laid over its edge and a bevel inside */
+ /* 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; left: -1px; top: -1px; right: -1px; bottom: -1px; border: 3px solid #3a414a; }
+ .cell .edge { position: absolute; border-style: solid; border-color: #3a414a; }
.china .cell .edge { border-color: #45190f; }
.gla .cell .edge { border-color: #423a1c; }
- .cell .bevel { position: absolute; left: 2px; top: 2px; right: 2px; bottom: 2px; border: 1px solid #06090b;
+ .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; }
.gla .cell .bevel { border-bottom-color: #cbbf82; border-right-color: #cbbf82; }
@@ -66,8 +68,8 @@
<div class="base" style="left: -{{tray.bl}}px; right: -{{tray.br}}px; bottom: -{{tray.bb}}px"></div>
<div class="sunk" style="width: {{tray.w}}px; height: {{tray.h}}px"></div>
</div>
- <div class="piece cell under" data-each="cells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge"></div><div class="bevel"></div></div>
- <div class="piece cell over" data-each="cells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge"></div><div class="bevel"></div></div>
+ <div class="piece cell under" data-each="cells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge" style="left: -{{ring}}px; top: -{{ring}}px; right: -{{ring}}px; bottom: -{{ring}}px; border-width: {{ring}}px"></div><div class="bevel"></div></div>
+ <div class="piece cell over" data-each="cells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge" style="left: -{{ring}}px; top: -{{ring}}px; right: -{{ring}}px; bottom: -{{ring}}px; border-width: {{ring}}px"></div><div class="bevel"></div></div>
</div>
</body>
</html>
diff --git a/GeneralsMD/Code/Data/Window/Html/QuitMenu.html b/GeneralsMD/Code/Data/Window/Html/QuitMenu.html
new file mode 100644
index 000000000..960d6fe5a
--- /dev/null
+++ b/GeneralsMD/Code/Data/Window/Html/QuitMenu.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<!--
+ The Esc menu in the command bar's steel, drawn as the menu's own plate. Its keys are the menu's
+ buttons, drawing nothing now and still taking their clicks; the logo over them is the menu's own
+ picture and draws over this page. Same materials as Window/Html/Promotion.html.
+
+ The game fills in, every frame the menu is up (InGameUI::drawQuitMenuPage):
+ {{side}} "america", "china" or "gla"
+ {{panel.x}} .y .w .h the menu's plate
+ data-each="keys" every key the menu shows, top to bottom, {{key.x}} .y .w .h, {{label}} the
+ button's own text and {{state}} any of "disabled", "hilite", "pushed"
+ All in the page's pixels, a pixel of an 800x600 screen. Without this page the menu draws as EA
+ drew it.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>Quit menu</title>
+<style>
+ html, body { margin: 0; padding: 0; }
+ body { background-color: #3b4a36; font-size: 10px; color: #e8eef2; }
+ .piece { position: absolute; }
+
+ /* the plate: steel lit from above, a light line along its top and down its left, dark along its
+ right and bottom */
+ .plate { background: linear-gradient(to bottom, #9aa3ad, #5a626c 12%, #353c45); border: 1px solid #0c1114;
+ border-top-color: #dde4ea; border-left-color: #b3bbc4; }
+ .china .plate { background: linear-gradient(to bottom, #c06a52, #7a3120 12%, #3f160f); border-top-color: #f0b8a4; border-left-color: #d58a70; }
+ .gla .plate { background: linear-gradient(to bottom, #b8ab6e, #766a3a 12%, #3c3519); border-top-color: #ebe2b4; border-left-color: #cabe86; }
+
+ /* a key sunk in the steel, lit steel with a gold rim under the pointer, pressed in while held, and
+ dim when it does nothing */
+ .key { border: 1px solid #06090b; border-bottom-color: #9aa4ae; border-right-color: #9aa4ae; background-color: rgba(4, 8, 10, 0.9);
+ text-align: center; font-weight: bold; }
+ .china .key { border-bottom-color: #d98a72; border-right-color: #d98a72; }
+ .gla .key { border-bottom-color: #cbbf82; border-right-color: #cbbf82; }
+ .key.hilite { background: linear-gradient(to bottom, #b3bbc4, #5a626c); border-color: #e8d27a; color: #ffffff; }
+ .china .key.hilite { background: linear-gradient(to bottom, #d58a70, #7a3120); }
+ .gla .key.hilite { background: linear-gradient(to bottom, #cabe86, #766a3a); }
+ .key.pushed { background: linear-gradient(to bottom, #151a1f, #3a414a); border-color: #e8d27a; color: #f2cf4a; }
+ .key.disabled { color: #5d666f; }
+ .key .label { position: absolute; left: 0; right: 0; top: 50%; margin-top: -7px; line-height: 14px; }
+</style>
+</head>
+<body>
+<div class="{{side}}">
+ <div class="piece plate" style="left: {{panel.x}}px; top: {{panel.y}}px; width: {{panel.w}}px; height: {{panel.h}}px"></div>
+ <div class="piece key {{state}}" data-each="keys" style="left: {{key.x}}px; top: {{key.y}}px; width: {{key.w}}px; height: {{key.h}}px"><div class="label">{{label}}</div></div>
+</div>
+</body>
+</html>
diff --git a/GeneralsMD/Code/Data/Window/Html/Scoreboard.html b/GeneralsMD/Code/Data/Window/Html/Scoreboard.html
index 8a478fe46..54b60e8db 100644
--- a/GeneralsMD/Code/Data/Window/Html/Scoreboard.html
+++ b/GeneralsMD/Code/Data/Window/Html/Scoreboard.html
@@ -15,6 +15,10 @@
has {{portrait}} {{general}} {{rank}} {{cash}} {{income}} {{kills}} {{losses}}, its promotions
as {{skill0}} to {{skill6}}, and {{favourite}} with {{favouritename}}, the unit built most.
A hidden seat is an enemy: a name, a colour and a team, nothing else.
+ data-each="superweapons", every superweapon in the match: per player who has one an entry of
+ {{kind}} "head" with {{image}} their general, {{color}} and {{name}}, then their countdowns, soonest
+ first, {{kind}} "weapon" with {{image}} its cameo, {{time}} and {{ready}} "ready" once it can
+ fire; {{weapons}} is "hidden" while there is none.
An image whose name is empty is not drawn, so an unused {{skillN}} leaves no box.
Edit the copy under Run/Window/Html and the next match reads it.
@@ -81,6 +85,20 @@
.hidden .tray, .hidden .num, .hidden .skill, .hidden .favourite, .hidden .general { display: none; }
.defeated .who { color: #8a949f; }
.defeated .num, .defeated .cash { color: #8a949f; }
+
+ /* the superweapons: a line per player who has one, their general and name, and after it each of
+ their countdowns as a cameo with its time, gold once it can fire */
+ .weapons.hidden { display: none; }
+ .whead { position: relative; height: 20px; margin: 2px 3px 0 3px; }
+ .whead .tray { position: absolute; left: 4px; top: 1px; width: 24px; height: 18px; }
+ .whead .emblem { position: absolute; left: 3px; top: 3px; width: 18px; height: 12px; }
+ .whead .who { position: absolute; left: 32px; top: 0; line-height: 20px; font-weight: bold; }
+ .whead .cameo, .whead .time, .wweapon .tray, .wweapon .who { display: none; }
+ .wweapon { display: inline-block; position: relative; width: 58px; height: 20px; margin: 0 0 2px 7px; }
+ .wweapon .cameo { position: absolute; left: 0; top: 0; width: 24px; height: 20px; border: 1px solid #0c1114; }
+ .wweapon .time { position: absolute; left: 28px; top: 0; line-height: 20px; font-weight: bold; color: #c9d2d9; }
+ .wweapon.ready .cameo { border-color: #e8c24a; }
+ .wweapon.ready .time { color: #f2cf4a; }
</style>
</head>
<body>
@@ -121,6 +139,16 @@
<img class="favourite c-favourite" src="{{favourite}}">
</div>
</div>
+
+ <div class="weapons {{weapons}}">
+ <div class="band plate">{{text:GUI:Superweapons}}</div>
+ <div class="w{{kind}} {{ready}}" data-each="superweapons">
+ <div class="tray"><img class="emblem" src="{{image}}"></div>
+ <span class="who" style="color: {{color}}">{{name}}</span>
+ <img class="cameo" src="{{image}}">
+ <span class="time">{{time}}</span>
+ </div>
+ </div>
</div>
</div>
</body>
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
index e764b7709..c86ed99d7 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
@@ -1036,17 +1036,16 @@ public:
/** 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
- * art is not drawn; the page draws their cells, and each power stands `inset` inside its cell
- * for the page's frame over the edge. 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. */
- Int placeSpecialPowerShortcutGrid( const ICoord2D *corner, const ICoord2D &cell, Int gap, Int inset );
-
- /** Puts one of the bar's windows `inset` pixels inside the rectangle layoutPanels gave it, on every
- * side, for a frame the page draws over the edge; nought gives it the whole rectangle back. A
- * rebuild of the layout reads the window as the whole rectangle. */
- void insetPlacedWindow( GameWindow *window, Int inset );
- Int getPlacedInset( GameWindow *window ) const; ///< what insetPlacedWindow last put it in by
+ * 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. */
+ Int placeSpecialPowerShortcutGrid( const ICoord2D *corner, const ICoord2D &cell, Int gap );
+
+ /** Puts one of the bar's windows `inset` pixels inside the rectangle layoutPanels gave it, across
+ * on both sides and down on both, or outside it where the inset is less than nought; nought gives
+ * it the rectangle back. A rebuild of the layout reads the window as that rectangle. */
+ void insetPlacedWindow( GameWindow *window, const ICoord2D &inset );
+ ICoord2D getPlacedInset( GameWindow *window ) const; ///< what insetPlacedWindow last put it in by
GameWindow *getSpecialPowerShortcutParent( void ) { return m_specialPowerShortcutParent; }
/// the general's stars are asking to be spent, so the button blinks; see getStarImage
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
index dd190226e..d0413c71c 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
@@ -411,6 +411,10 @@ public: // ********************************************************************
/** The general's promotion screen, Window/Html/Promotion.html, drawn as `parent`'s picture: the
* screen's windows keep their clicks and the promotions' own cameos paint over it. */
void drawPromotionPage( GameWindow *parent, Bool front );
+ /** The Esc menu hands its look to Window/Html/QuitMenu.html: `parent` draws the page and its keys
+ * draw nothing and keep their clicks. Left as it is when there is no page. */
+ void themeQuitMenu( GameWindow *parent );
+ void drawQuitMenuPage( GameWindow *parent );
/** The command bar's grids of buttons whose cells the page frames in front of the buttons. */
enum CellGrid { CELL_GRID_COMMAND, CELL_GRID_QUEUE, CELL_GRID_POWERS, CELL_GRID_COUNT };
/** The steel frames over one grid's buttons, from Window/Html/ControlBar.html, drawn after them. */
@@ -1237,6 +1241,9 @@ protected:
std::vector< HtmlValues > m_cellFrontCells[ CELL_GRID_COUNT ]; ///< each grid's cells as the bar's page last placed them
Bool m_promotionPageLoaded;
std::string m_promotionPage;
+ HtmlOverlay * m_quitMenuOverlay;
+ Bool m_quitMenuPageLoaded;
+ std::string m_quitMenuPage;
Bool m_signalsWereShown; ///< the smoke signal column was up last frame
UnsignedInt m_signalsRiseStartMs; ///< when it last came up, the start of its buttons' rise
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
index 4d0a5b7a7..ab45df596 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
@@ -1637,7 +1637,7 @@ struct ControlBarPanelPlacement
Real designX, designY, designW, designH;
Int placedX, placedY, placedW, placedH;
Int slideApplied; ///< how far down applyPanelSlide has actually moved this one, in pixels
- Int inset; ///< how far insetPlacedWindow has put it inside the placed rectangle, in pixels
+ ICoord2D inset; ///< how far insetPlacedWindow has put it inside the placed rectangle, each way, in pixels
};
typedef std::map< GameWindow *, ControlBarPanelPlacement > ControlBarPanelPlacementMap;
static ControlBarPanelPlacementMap theControlBarPlacement;
@@ -2025,10 +2025,10 @@ void ControlBar::placeInPanel( GameWindow *win, Int panel,
// a window insetPlacedWindow put inside its place is read as the whole place, or every rebuild
// would take the inset for what it was authored at and shrink it again
ControlBarPanelPlacement &place = theControlBarPlacement[ win ];
- size.x += 2 * place.inset;
- size.y += 2 * place.inset;
- const Int oldX = oldParentX + rel.x - place.inset;
- const Int oldY = oldParentY + rel.y - place.inset;
+ size.x += 2 * place.inset.x;
+ size.y += 2 * place.inset.y;
+ const Int oldX = oldParentX + rel.x - place.inset.x;
+ const Int oldY = oldParentY + rel.y - place.inset.y;
if( place.known == FALSE || oldX != place.placedX || oldY != place.placedY ||
size.x != place.placedW || size.y != place.placedH )
@@ -2097,7 +2097,7 @@ void ControlBar::placeInPanel( GameWindow *win, Int panel,
place.panel = panel;
place.weHid = FALSE;
place.slideApplied = 0;
- place.inset = 0;
+ place.inset.x = place.inset.y = 0;
place.placedX = newX;
place.placedY = newY;
place.placedW = newW;
@@ -2147,20 +2147,20 @@ Int ControlBar::getPanelSlideOffset( Int panel ) const
}
//-------------------------------------------------------------------------------------------------
-void ControlBar::insetPlacedWindow( GameWindow *window, Int inset )
+void ControlBar::insetPlacedWindow( GameWindow *window, const ICoord2D &inset )
{
ControlBarPanelPlacement &place = theControlBarPlacement.find( window )->second;
- if( place.inset == inset )
+ if( place.inset.x == inset.x && place.inset.y == inset.y )
return;
// where placeInPanel put it in its parent, which the parent carries with it wherever it goes
const ControlBarPanelPlacement &parent = theControlBarPlacement.find( window->winGetParent() )->second;
- window->winSetPosition( place.placedX - parent.placedX + inset, place.placedY - parent.placedY + inset );
- window->winSetSize( place.placedW - 2 * inset, place.placedH - 2 * inset );
+ window->winSetPosition( place.placedX - parent.placedX + inset.x, place.placedY - parent.placedY + inset.y );
+ window->winSetSize( place.placedW - 2 * inset.x, place.placedH - 2 * inset.y );
place.inset = inset;
}
-Int ControlBar::getPlacedInset( GameWindow *window ) const
+ICoord2D ControlBar::getPlacedInset( GameWindow *window ) const
{
return theControlBarPlacement.find( window )->second.inset;
}
@@ -6228,7 +6228,7 @@ static void drawNoTray( GameWindow *window, WinInstanceData *instData )
{
}
-Int ControlBar::placeSpecialPowerShortcutGrid( const ICoord2D *corner, const ICoord2D &cell, Int gap, Int inset )
+Int ControlBar::placeSpecialPowerShortcutGrid( const ICoord2D *corner, const ICoord2D &cell, Int gap )
{
if( m_specialPowerShortcutParent == NULL || m_specialPowerShortcutButtonParents[ 0 ] == NULL )
return 0;
@@ -6263,7 +6263,7 @@ Int ControlBar::placeSpecialPowerShortcutGrid( const ICoord2D *corner, const ICo
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 but for the inset round it
+ // order the row keys count in. Each cameo fills its cell
for( Int i = 0; i < MAX_SPECIAL_POWER_SHORTCUTS; i++ )
{
GameWindow *slot = m_specialPowerShortcutButtonParents[ i ];
@@ -6276,8 +6276,8 @@ Int ControlBar::placeSpecialPowerShortcutGrid( const ICoord2D *corner, const ICo
slot->winSetPosition( width - ( column + 1 ) * cell.x - column * gap, height - ( row + 1 ) * cell.y - row * gap );
slot->winSetSize( cell.x, cell.y );
slot->winSetDrawFunc( drawNoTray );
- button->winSetSize( cell.x - 2 * inset, cell.y - 2 * inset );
- button->winSetPosition( inset, inset );
+ button->winSetSize( cell.x, cell.y );
+ button->winSetPosition( 0, 0 );
}
return shown;
}
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
index 5b0cd3727..b0753a887 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
@@ -467,7 +467,8 @@ void ToggleQuitMenu()
TheInGameUI->setQuitMenuVisible(FALSE);
return;
}
-
+ TheInGameUI->themeQuitMenu( quitMenuLayout->getFirstWindow() );
+
//quitMenuLayout->hide(FALSE);
// if we are watching a cinematic, we need to disable the save/load button
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index ac93a26d3..180bc0720 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -1211,6 +1211,8 @@ InGameUI::InGameUI()
for( Int grid = 0; grid < CELL_GRID_COUNT; grid++ )
m_cellFrontOverlay[ grid ] = NULL;
m_promotionPageLoaded = FALSE;
+ m_quitMenuOverlay = NULL;
+ m_quitMenuPageLoaded = FALSE;
m_controlBarPageShown = FALSE;
m_tooltipOverlay = NULL;
m_tooltipPageLoaded = FALSE;
@@ -1343,6 +1345,8 @@ InGameUI::~InGameUI()
m_promotionOverlay = NULL;
delete m_promotionFrontOverlay;
m_promotionFrontOverlay = NULL;
+ delete m_quitMenuOverlay;
+ m_quitMenuOverlay = NULL;
for( Int grid = 0; grid < CELL_GRID_COUNT; grid++ )
{
delete m_cellFrontOverlay[ grid ];
@@ -2200,6 +2204,81 @@ static void fillSpectatorTop( std::vector< SpectatorStats > players, std::vector
}
}
+//-------------------------------------------------------------------------------------------------
+/** Every player still in the match for the pages a player sees: grouped by team, allies both ways
+ * sharing one, the local player's own team first. Only the player and the team are filled in;
+ * `teams` is how many there are. */
+//-------------------------------------------------------------------------------------------------
+static std::vector< SpectatorStats > gatherSeats( Int &teams )
+{
+ std::vector< SpectatorStats > seats;
+ const Player *local = ThePlayerList->getLocalPlayer();
+ Int localTeam = -1;
+ teams = 0;
+ for( Int index = 0; index < ThePlayerList->getPlayerCount(); index++ )
+ {
+ Player *player = ThePlayerList->getNthPlayer( index );
+ if( player == NULL || !player->isPlayerActive() || !player->isPlayableSide() )
+ continue;
+
+ SpectatorStats seat = SpectatorStats();
+ seat.player = player;
+ seat.team = -1;
+ for( size_t earlier = 0; earlier < seats.size() && seat.team < 0; earlier++ )
+ {
+ const Player *other = seats[ earlier ].player;
+ if( player->getRelationship( other->getDefaultTeam() ) == ALLIES && other->getRelationship( player->getDefaultTeam() ) == ALLIES )
+ seat.team = seats[ earlier ].team;
+ }
+ if( seat.team < 0 )
+ seat.team = teams++;
+ if( player == local )
+ localTeam = seat.team;
+ seats.push_back( seat );
+ }
+
+ std::stable_sort( seats.begin(), seats.end(), [ localTeam ]( const SpectatorStats &a, const SpectatorStats &b )
+ { return ( a.team == localTeam ? -1 : a.team ) < ( b.team == localTeam ? -1 : b.team ); } );
+ return seats;
+}
+
+//-------------------------------------------------------------------------------------------------
+/** The command bar page's "seats" list, the strip across the top of the screen while playing: every
+ * player grouped by team, each of kind "seat" with their general and colour, the match clock
+ * between exactly two teams and a gap between any others. Under each, {{weapon}} says where their
+ * superweapons stand: "ready" once one can fire, "charging" while none can yet, and "none" when
+ * they have none. */
+//-------------------------------------------------------------------------------------------------
+static void fillPlayerSeats( const std::vector< SpectatorStats > &seats, Int teams,
+ const std::vector< SpectatorSuperweapon > &weapons, std::vector< HtmlValues > &entries )
+{
+ entries.clear();
+ for( size_t index = 0; index < seats.size(); index++ )
+ {
+ if( index > 0 && seats[ index - 1 ].team != seats[ index ].team )
+ {
+ HtmlValues between;
+ between[ "kind" ] = teams == TWO_TEAMS ? "clock" : "gap";
+ entries.push_back( between );
+ }
+
+ Bool owned = FALSE;
+ Bool ready = FALSE;
+ for( size_t weapon = 0; weapon < weapons.size(); weapon++ )
+ {
+ if( weapons[ weapon ].playerIndex != seats[ index ].player->getPlayerIndex() )
+ continue;
+ owned = TRUE;
+ ready = ready || weapons[ weapon ].ready;
+ }
+
+ HtmlValues entry = spectatorHead( seats[ index ].player );
+ entry[ "kind" ] = "seat";
+ entry[ "weapon" ] = ready ? "ready" : owned ? "charging" : "none";
+ entries.push_back( entry );
+ }
+}
+
//-------------------------------------------------------------------------------------------------
/** The page's "superweapons" list: per player who has one, a head entry and then his countdowns,
* soonest first, each of kind "weapon" with its cameo, {{time}} and {{ready}} "ready" once it can
@@ -3904,6 +3983,7 @@ void InGameUI::reset( void )
m_controlBarPageLoaded = FALSE;
m_tooltipPageLoaded = FALSE;
m_promotionPageLoaded = FALSE;
+ m_quitMenuPageLoaded = FALSE;
m_signalsWereShown = FALSE;
m_spectatorPageLoaded = FALSE;
m_spectatorFlipped.clear();
@@ -9638,7 +9718,9 @@ void InGameUI::addSuperweaponIcon( const Image *image, Int seconds, Int percent,
void InGameUI::drawSuperweaponStrip( void )
{
// watching, the spectator page's left panel lists the countdowns instead
- if( m_superweaponIconCount < 1 || stripSwitchedOff( &GlobalData::m_showSuperweaponStrip ) || m_spectatorPageShown )
+ // playing under the bar's page, the countdowns are on the Tab scoreboard and the strip of seats
+ if( m_superweaponIconCount < 1 || stripSwitchedOff( &GlobalData::m_showSuperweaponStrip ) || m_spectatorPageShown ||
+ ( m_controlBarPageShown && !localPlayerWatching() ) )
return;
if( TheGameLogic == NULL || !TheGameLogic->isInGame() || TheGameLogic->isInShellGame() )
@@ -10186,9 +10268,15 @@ void InGameUI::drawScoreboard( void )
seats[ first ].player == local ) );
}
+ // every superweapon counting down in the match, per player in the order of the seats across the
+ // top, the one place a player reads the times now the strip is gone
+ Int teams = 0;
+ fillSpectatorSuperweapons( gatherSeats( teams ), m_spectatorSuperweapons, lists[ "superweapons" ] );
+
HtmlValues values;
values[ "side" ] = spectatorSide();
values[ "clock" ] = spectatorClock( TheGameLogic->getFrame() );
+ values[ "weapons" ] = lists[ "superweapons" ].empty() ? "hidden" : "";
m_scoreboardOverlay->setPage( HtmlTemplate_expand( m_scoreboardPage, values, lists, lookupGameText ) );
m_scoreboardOverlay->draw();
}
@@ -10406,9 +10494,10 @@ enum
STARS_TAB_HEIGHT = 22, ///< the key 17 tall with its rim, three pixels down
SKILL_GRID_GAP = 12, ///< between the general's powers' tray and the stars' tab under it
SKILL_TRAY_BORDER = 6, ///< the tray's steel round its cells
+ 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
SKILL_CELL_PERCENT = 75, ///< a cell's size against a command button's; the whole size stood too big over the portrait
- CELL_FRAME = 3, ///< a grid's steel and bevel, drawn in front over a cell's edge; its button fills the hole inside
+ CELL_GAP_LEAST = 2, ///< the least steel between two pictures of a grid, a bevel each side
SIGNAL_BUTTON_SIZE = 24, ///< each smoke signal button's height, a row of the column
SIGNAL_BUTTON_WIDTH = 40, ///< and its width, room for its picture
SIGNAL_BUTTONS = 3, ///< attack, defend, look
@@ -10524,13 +10613,23 @@ enum
/** The border round a container: `border` screen pixels on the sides facing the battlefield, out to
* the screen's edge on the sides against it - the bottom always, the left or the right as asked. */
+/** The screen's bottom edge as the bar stands on it: while the match's intro slides the bar up from
+ * below, its frame is under where layoutPanels put it, and everything standing on the edge goes
+ * down with it, or the panels waited at the bottom while only the buttons rose. */
+static Int barBottom( void )
+{
+ Int frameX = 0, frameY = 0;
+ TheControlBar->getMasterParent()->winGetScreenPosition( &frameX, &frameY );
+ return TheDisplay->getHeight() + frameY - TheControlBar->getPanelOrigin()->y;
+}
+
static IRegion2D framed( const IRegion2D &content, Int border, Bool againstLeft, Bool againstRight )
{
IRegion2D box;
box.lo.x = againstLeft ? 0 : content.lo.x - border;
box.lo.y = content.lo.y - border;
box.hi.x = againstRight ? TheDisplay->getWidth() : content.hi.x + border;
- box.hi.y = TheDisplay->getHeight();
+ box.hi.y = barBottom();
return box;
}
@@ -10585,44 +10684,76 @@ static GameWindow *numberedWindow( const char *prefix, Int number )
return controlBarWindow( name );
}
+/** `place` grown by `across` screen pixels on the left and the right and `down` on the top and the
+ * bottom. */
+static IRegion2D reachedBy( const IRegion2D &place, Int across, Int down )
+{
+ IRegion2D cell = place;
+ cell.lo.x -= across;
+ cell.lo.y -= down;
+ cell.hi.x += across;
+ cell.hi.y += down;
+ return cell;
+}
+
+/** The screen rectangle of one of the bar's windows as it stands now. */
+static IRegion2D windowScreenRect( GameWindow *window )
+{
+ IRegion2D rect;
+ Int width = 0, height = 0;
+ window->winGetScreenPosition( &rect.lo.x, &rect.lo.y );
+ window->winGetSize( &width, &height );
+ rect.hi.x = rect.lo.x + width;
+ rect.hi.y = rect.lo.y + height;
+ return rect;
+}
+
/** The screen rectangle of the bar's window `prefix` followed by `number` in two digits, shown or
- * not: its whole place, the frame the page draws over its edge included. */
+ * not, as layoutPanels placed it, before gridGrowth grew it. */
static IRegion2D numberedWindowRect( const char *prefix, Int number )
{
GameWindow *window = numberedWindow( prefix, number );
- const Int inset = TheControlBar->getPlacedInset( window );
- IRegion2D place;
- Int width = 0, height = 0;
- window->winGetScreenPosition( &place.lo.x, &place.lo.y );
- window->winGetSize( &width, &height );
- place.lo.x -= inset;
- place.lo.y -= inset;
- place.hi.x = place.lo.x + width + 2 * inset;
- place.hi.y = place.lo.y + height + 2 * inset;
- return place;
+ const ICoord2D inset = TheControlBar->getPlacedInset( window );
+ return reachedBy( windowScreenRect( window ), inset.x, inset.y );
}
-/** How far a grid's cells reach out past their buttons into the gaps between them: half the narrower
- * of the gaps beside and below button `first`, so a cell's frame stops short of its neighbour's
- * bevel, and never more than the frame. The frame's depth past that is taken off the buttons, and
- * the steel between two pictures stays near the gap the layout left. */
-static Int cellReach( const char *prefix, Int first, Int beside, Int below, Int frame )
+/** The page's ring of steel round a picture with `gap` screen pixels to its neighbour: half of it in
+ * the page's pixels, so two rings meet in the gap, and one at least, which is the bevel. */
+static Int pageRing( Int gap )
+{
+ return max( 1, (Int)REAL_TO_INT_FLOOR( gap / ControlBarUniformScale() / 2 ) );
+}
+
+/** How far a grid's buttons grow into the gaps the layout left between them, and the ring the page
+ * lays round each picture. */
+struct GridGrowth
+{
+ ICoord2D grow; ///< screen pixels, across and down, on each side
+ Int ring; ///< page pixels
+};
+
+/** The buttons grow until the gaps beside and below button `first` are both half the narrower of
+ * the two, and never under `least` screen pixels. */
+static GridGrowth gridGrowth( const char *prefix, Int first, Int beside, Int below, Int least )
{
const IRegion2D place = numberedWindowRect( prefix, first );
const Int across = numberedWindowRect( prefix, beside ).lo.x - place.hi.x;
const Int down = numberedWindowRect( prefix, below ).lo.y - place.hi.y;
- return min( frame, min( across, down ) / 2 );
+ const Int gap = max( least, min( across, down ) / 2 );
+ GridGrowth growth;
+ growth.grow.x = max( 0, ( across - gap ) / 2 );
+ growth.grow.y = max( 0, ( down - gap ) / 2 );
+ growth.ring = pageRing( min( across - 2 * growth.grow.x, down - 2 * growth.grow.y ) );
+ return growth;
}
-/** `place` grown by `reach` screen pixels on every side. */
-static IRegion2D reachedBy( const IRegion2D &place, Int reach )
+static void putPageRect( HtmlValues &values, const std::string &name, const IRegion2D &rect, Bool shown );
+
+/** One cell of a grid for the page: the picture's hole as `cell` and the ring round it. */
+static void putCell( HtmlValues &entry, const IRegion2D &picture, Int ring )
{
- IRegion2D cell = place;
- cell.lo.x -= reach;
- cell.lo.y -= reach;
- cell.hi.x += reach;
- cell.hi.y += reach;
- return cell;
+ putPageRect( entry, "cell", picture, TRUE );
+ entry[ "ring" ] = std::to_string( ring );
}
/** ButtonCommandNN's screen rectangle, `button` 1 to COMMAND_BUTTONS, shown or not. */
@@ -10657,12 +10788,12 @@ static void lowerControlBarWindow( const char *name, Int shift )
window->winSetPosition( x, y + shift );
}
-static void stackCentre( HtmlValues &values, Bool shown, Int reach, IRegion2D &centre )
+static void stackCentre( HtmlValues &values, Bool shown, const ICoord2D &grow, IRegion2D &centre )
{
// the command buttons stand as low as the idle worker's key beside them, GRID_BOTTOM_GAP over the
// screen's bottom edge, wherever the side's layout put them; the beacon button goes down with them
const Real scale = ControlBarUniformScale();
- const Int shift = TheDisplay->getHeight() - REAL_TO_INT( GRID_BOTTOM_GAP * scale ) - commandButtonsBox().hi.y;
+ const Int shift = barBottom() - REAL_TO_INT( GRID_BOTTOM_GAP * scale ) - commandButtonsBox().hi.y - grow.y;
if( shift != 0 )
{
lowerControlBarWindow( "CommandWindow", shift );
@@ -10676,8 +10807,8 @@ static void stackCentre( HtmlValues &values, Bool shown, Int reach, IRegion2D &c
// money and the power bar stood over bare battlefield. The grid's place holds whether it is up,
// and it is the fourteen buttons' place rather than CommandWindow's: the window reaches 34 pixels
// further left, over where the beacon button stands, and left an empty strip in the panel
- // It is the cells', which reach `reach` past the buttons
- IRegion2D buttons = reachedBy( commandButtonsBox(), reach );
+ // It is the cells', which reach `grow` past the buttons' places
+ IRegion2D buttons = reachedBy( commandButtonsBox(), grow.x, grow.y );
if( othersFound )
{
buttons.lo.x = min( buttons.lo.x, grid.lo.x );
@@ -10862,16 +10993,21 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
const Real scale = ControlBarUniformScale();
const Int border = REAL_TO_INT( PANEL_BORDER * scale );
- // the command and queue buttons stand inside the frame the page draws over their cells' edges, so
- // the frame covers no part of the picture; the cells reach into the gaps for as much of it as fits.
- // The gaps are measured from the whole places, whatever the buttons were last put in by
- const Int cellFrame = REAL_TO_INT( CELL_FRAME * scale );
- const Int commandReach = cellReach( "ButtonCommand", 1, 3, 2, cellFrame );
- const Int queueReach = cellReach( "ButtonQueue", 1, 2, 4, cellFrame );
+ // the command and queue buttons grow into the gaps the layout left until the steel between two
+ // pictures is half what it was, and the page's rings round the pictures meet in what is left.
+ // The gaps are measured from the placed rectangles, whatever the buttons were last grown by
+ const Int leastGap = REAL_TO_INT( CELL_GAP_LEAST * scale );
+ const GridGrowth commandGrowth = gridGrowth( "ButtonCommand", 1, 3, 2, leastGap );
+ const GridGrowth queueGrowth = gridGrowth( "ButtonQueue", 1, 2, 4, leastGap );
+ ICoord2D grown;
+ grown.x = -commandGrowth.grow.x;
+ grown.y = -commandGrowth.grow.y;
for( Int button = 1; button <= COMMAND_BUTTONS; button++ )
- TheControlBar->insetPlacedWindow( numberedWindow( "ButtonCommand", button ), cellFrame - commandReach );
+ TheControlBar->insetPlacedWindow( numberedWindow( "ButtonCommand", button ), grown );
+ grown.x = -queueGrowth.grow.x;
+ grown.y = -queueGrowth.grow.y;
for( Int button = 1; button <= QUEUE_BUTTONS; button++ )
- TheControlBar->insetPlacedWindow( numberedWindow( "ButtonQueue", button ), cellFrame - queueReach );
+ TheControlBar->insetPlacedWindow( numberedWindow( "ButtonQueue", button ), grown );
const Bool leftShown = panelCount > 0 && shown[ 0 ];
const Bool rightShown = panelCount > 2 && shown[ 2 ];
@@ -10888,7 +11024,7 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
IRegion2D signalColumn;
signalColumn.lo.x = leftBox.hi.x;
signalColumn.hi.x = leftBox.hi.x + REAL_TO_INT( SIGNAL_BUTTON_WIDTH * scale );
- signalColumn.hi.y = TheDisplay->getHeight();
+ signalColumn.hi.y = barBottom();
signalColumn.lo.y = signalColumn.hi.y - REAL_TO_INT( SIGNAL_BUTTON_SIZE * SIGNAL_BUTTONS * scale );
const Bool signalsShown = leftFound && leftShown && signalsAllowed();
putPageRect( values, "signals", signalColumn, signalsShown );
@@ -10899,25 +11035,40 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
putSignalRise( values, nowMs - m_signalsRiseStartMs );
IRegion2D centreBox;
- stackCentre( values, panelCount > 1 && shown[ 1 ], commandReach, centreBox );
+ // the grid's container holds the pictures and the rings round them
+ ICoord2D gridOutside;
+ gridOutside.x = commandGrowth.grow.x + REAL_TO_INT( commandGrowth.ring * scale );
+ gridOutside.y = commandGrowth.grow.y + REAL_TO_INT( commandGrowth.ring * scale );
+ stackCentre( values, panelCount > 1 && shown[ 1 ], gridOutside, centreBox );
// the idle worker's key, a smoke signal's size, in a step against the centre panel's border at its
// bottom left, standing on the screen's bottom edge; on the top edge it stood under the power bar
IRegion2D workerStep;
workerStep.hi.x = centreBox.lo.x;
workerStep.lo.x = workerStep.hi.x - REAL_TO_INT( WORKER_TAB_WIDTH * scale );
- workerStep.hi.y = TheDisplay->getHeight();
+ workerStep.hi.y = barBottom();
workerStep.lo.y = workerStep.hi.y - REAL_TO_INT( WORKER_STEP_HEIGHT * scale );
putPageRect( values, "workertab", workerStep, panelCount > 1 && shown[ 1 ] );
HtmlLists lists;
putPowerBar( values, lists[ "powercells" ] ); // after the stack, whose frame it divides into cells
+ // every player across the top of the screen, and whether each has a superweapon ready; a watcher's
+ // own page has its strip there
+ // gathered first: an argument list may read `teams` before gatherSeats has counted them
+ if( !watching )
+ {
+ Int teams = 0;
+ const std::vector< SpectatorStats > seats = gatherSeats( teams );
+ fillPlayerSeats( seats, teams, m_spectatorSuperweapons, lists[ "seats" ] );
+ }
+ values[ "clock" ] = spectatorClock( TheGameLogic->getFrame() );
+
// a well behind each of the fourteen command buttons, shown or not, so the grid reads as a grid
// with the steel between its places, and an empty place is a hole in it rather than bare dark
std::vector< HtmlValues > &commandCells = lists[ "commandcells" ];
for( Int button = 1; button <= COMMAND_BUTTONS && panelCount > 1 && shown[ 1 ]; button++ )
{
HtmlValues entry;
- putPageRect( entry, "cell", reachedBy( commandButtonRect( button ), commandReach ), TRUE );
+ putCell( entry, windowScreenRect( numberedWindow( "ButtonCommand", button ) ), commandGrowth.ring );
commandCells.push_back( entry );
}
@@ -10937,11 +11088,26 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
// the portrait's well is steel with a dark cell for each of the production queue's nine places,
// the grid the side's RightHUD picture used to draw in the side's own colour, blue for America
+ // While a unit is selected its portrait stands over four of those places and its upgrades in the
+ // other five: the portrait's four are one cell then, the portrait's own
std::vector< HtmlValues > &portraitCells = lists[ "portraitcells" ];
+ GameWindow *portrait = controlBarWindow( "CameoWindow" );
+ const Bool portraitShown = !portrait->winIsHidden() && !portrait->winGetParent()->winIsHidden();
+ const IRegion2D portraitRect = windowScreenRect( portrait );
+ if( portraitShown && rightFound && rightShown )
+ {
+ HtmlValues entry;
+ putCell( entry, portraitRect, queueGrowth.ring );
+ portraitCells.push_back( entry );
+ }
for( Int button = 1; button <= QUEUE_BUTTONS && rightFound && rightShown; button++ )
{
+ const IRegion2D place = windowScreenRect( numberedWindow( "ButtonQueue", button ) );
+ if( portraitShown && place.lo.x >= portraitRect.lo.x && place.hi.x <= portraitRect.hi.x + 1 &&
+ place.lo.y >= portraitRect.lo.y && place.hi.y <= portraitRect.hi.y + 1 )
+ continue;
HtmlValues entry;
- putPageRect( entry, "cell", reachedBy( numberedWindowRect( "ButtonQueue", button ), queueReach ), TRUE );
+ putCell( entry, place, queueGrowth.ring );
portraitCells.push_back( entry );
}
@@ -10958,9 +11124,7 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
cell.x = ( button.hi.x - button.lo.x ) * SKILL_CELL_PERCENT / 100;
cell.y = ( button.hi.y - button.lo.y ) * SKILL_CELL_PERCENT / 100;
const Int cellGap = REAL_TO_INT( SKILL_CELL_GAP * scale );
- const Int powersReach = min( cellFrame, cellGap / 2 );
- const Int powersShown = TheControlBar->placeSpecialPowerShortcutGrid( rightFound && rightShown ? &corner : NULL, cell, cellGap,
- cellFrame - powersReach );
+ const Int powersShown = TheControlBar->placeSpecialPowerShortcutGrid( rightFound && rightShown ? &corner : NULL, cell, cellGap );
std::vector< HtmlValues > &places = lists[ "skillcells" ];
IRegion2D powers;
@@ -10978,7 +11142,7 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
powers.lo.x = min( powers.lo.x, place.lo.x );
powers.lo.y = min( powers.lo.y, place.lo.y );
HtmlValues entry;
- putPageRect( entry, "cell", reachedBy( place, powersReach ), TRUE );
+ putCell( entry, place, pageRing( cellGap ) );
places.push_back( entry );
}
IRegion2D tray = powers;
@@ -10993,7 +11157,8 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
m_cellFrontCells[ CELL_GRID_QUEUE ] = portraitCells;
m_cellFrontCells[ CELL_GRID_POWERS ] = places;
putFrontWindow( controlBarWindow( "CommandWindow" ), drawCommandGridFront );
- putFrontWindow( controlBarWindow( "ProductionQueueWindow" ), drawQueueGridFront );
+ // the portrait's grid over the queue, the portrait and its upgrades alike, all RightHUD's
+ putFrontWindow( controlBarWindow( "RightHUD" ), drawQueueGridFront );
GameWindow *powersParent = TheControlBar->getSpecialPowerShortcutParent();
if( powersParent )
putFrontWindow( powersParent, drawPowersGridFront );
@@ -11108,13 +11273,13 @@ static const struct PromotionRow
enum
{
PROMOTION_COLUMNS = 5, ///< the widest row, the middle one
- PROMOTION_MARGIN = 6, ///< the plate round the wells, and between one well and the next
- PROMOTION_INSET = 4, ///< a well round its heading and cells
+ PROMOTION_MARGIN = 4, ///< the plate round the wells, and between one well and the next
+ PROMOTION_INSET = 3, ///< a well round its heading and cells
PROMOTION_CELL_GAP = 2,
PROMOTION_TITLE = 14, ///< the rank's name's line, the points beside it
PROMOTION_BAR = 7, ///< the experience bar under it
PROMOTION_BAR_GAP = 3,
- PROMOTION_HEADING = 14 ///< a row's heading over its first button
+ PROMOTION_HEADING = 12 ///< a row's heading over its first button
};
/** One place in the screen's grids, screen pixels, and the promotion's button standing in it: NULL
@@ -11166,7 +11331,6 @@ static void layoutPromotionScreen( GameWindow *parent, PromotionLayout &layout )
const Int margin = Page::px( PROMOTION_MARGIN, scale );
const Int inset = Page::px( PROMOTION_INSET, scale );
const Int heading = Page::px( PROMOTION_HEADING, scale );
- const Int frame = Page::px( CELL_FRAME, scale );
const Int gridWidth = PROMOTION_COLUMNS * cellWidth + ( PROMOTION_COLUMNS - 1 ) * gap;
const Int width = gridWidth + 2 * ( margin + inset );
@@ -11230,7 +11394,7 @@ static void layoutPromotionScreen( GameWindow *parent, PromotionLayout &layout )
else if( number < PROMOTION_ROWS[ row ].count )
{
const std::string name = PROMOTION_ROWS[ row ].buttons + std::to_string( number );
- placePromotionWindow( name, x + frame, top + frame, cellWidth - 2 * frame, cellHeight - 2 * frame );
+ placePromotionWindow( name, x, top, cellWidth, cellHeight );
place.button = promotionWindow( name );
}
layout.places.push_back( place );
@@ -11369,7 +11533,7 @@ void InGameUI::drawPromotionPage( GameWindow *parent, Bool front )
continue;
HtmlValues entry;
- putPageRect( entry, "cell", place.rect, TRUE );
+ putCell( entry, place.rect, pageRing( REAL_TO_INT( PROMOTION_CELL_GAP * ControlBarUniformScale() ) ) );
entry[ "state" ] = place.button && !place.button->winIsHidden() ? promotionState( place.button ) : "empty";
cells.push_back( entry );
}
@@ -11387,6 +11551,79 @@ void InGameUI::drawPromotionPage( GameWindow *parent, Bool front )
overlay->draw();
}
+static const char *const QUIT_MENU_PAGE = "Window\\Html\\QuitMenu.html";
+
+/** The Esc menu's keys top to bottom. QuitMenu.wnd has them all, QuitNoSave.wnd, for network games
+ * and replays, all but the first. */
+static const char *const QUIT_MENU_KEYS[] = { "ButtonSaveLoad", "ButtonOptions", "ButtonRestart", "ButtonExit", "ButtonReturn" };
+
+/** A window of the same layout as `parent`, by its name there. */
+static GameWindow *quitMenuWindow( GameWindow *parent, const char *name )
+{
+ const AsciiString &parentName = parent->winGetInstanceData()->m_decoratedNameString;
+ const std::string layout( parentName.str(), strchr( parentName.str(), ':' ) + 1 );
+ return TheWindowManager->winGetWindowFromId( parent, NAMEKEY( ( layout + name ).c_str() ) );
+}
+
+static void drawQuitMenu( GameWindow *window, WinInstanceData *instData )
+{
+ TheInGameUI->drawQuitMenuPage( window );
+}
+
+void InGameUI::themeQuitMenu( GameWindow *parent )
+{
+ if( !m_quitMenuPageLoaded )
+ {
+ m_quitMenuPageLoaded = TRUE;
+ readHtmlPage( QUIT_MENU_PAGE, m_quitMenuPage );
+ }
+ if( m_quitMenuPage.empty() )
+ return;
+
+ parent->winSetDrawFunc( drawQuitMenu );
+ for( Int key = 0; key < (Int)ARRAY_SIZE( QUIT_MENU_KEYS ); key++ )
+ {
+ GameWindow *button = quitMenuWindow( parent, QUIT_MENU_KEYS[ key ] );
+ if( button )
+ button->winSetDrawFunc( drawNothing );
+ }
+}
+
+//-------------------------------------------------------------------------------------------------
+/** The Esc menu from Window/Html/QuitMenu.html, drawn as the menu's plate: every key where its
+ * button stands, with the button's own label, so the restart key reads Surrender or Restart Mission
+ * as the menu relabelled it, and its state. */
+//-------------------------------------------------------------------------------------------------
+void InGameUI::drawQuitMenuPage( GameWindow *parent )
+{
+ if( m_quitMenuOverlay == NULL )
+ m_quitMenuOverlay = new HtmlOverlay( m_superweaponNormalFont );
+
+ HtmlValues values;
+ HtmlLists lists;
+ values[ "side" ] = spectatorSide();
+ IRegion2D panel;
+ putPageRect( values, "panel", panel, controlBarWindowRect( parent, panel ) );
+
+ std::vector< HtmlValues > &keys = lists[ "keys" ];
+ for( Int key = 0; key < (Int)ARRAY_SIZE( QUIT_MENU_KEYS ); key++ )
+ {
+ GameWindow *button = quitMenuWindow( parent, QUIT_MENU_KEYS[ key ] );
+ IRegion2D rect;
+ if( !controlBarWindowRect( button, rect ) )
+ continue;
+
+ HtmlValues entry;
+ putPageRect( entry, "key", rect, TRUE );
+ entry[ "state" ] = controlBarWindowState( button );
+ entry[ "label" ] = WideCharStringToMultiByte( button->winGetInstanceData()->getText().str() );
+ keys.push_back( entry );
+ }
+
+ m_quitMenuOverlay->setPage( HtmlTemplate_expand( m_quitMenuPage, values, lists, lookupGameText ) );
+ m_quitMenuOverlay->draw();
+}
+
//-------------------------------------------------------------------------------------------------
/** Lay out and draw one run of cells, its left edge at left and the first cameo's top edge at
* bottomY.
@@ -11723,10 +11960,7 @@ void InGameUI::drawQueueTray( Int row )
cell.x = ( button.hi.x - button.lo.x ) * SKILL_CELL_PERCENT / 100;
cell.y = ( button.hi.y - button.lo.y ) * SKILL_CELL_PERCENT / 100;
const Int gap = REAL_TO_INT( SKILL_CELL_GAP * scale );
- const Int frame = REAL_TO_INT( CELL_FRAME * scale );
- const Int reach = min( frame, gap / 2 );
- const Int inset = frame - reach;
- const Int trayBorder = REAL_TO_INT( SKILL_TRAY_BORDER * scale );
+ const Int trayBorder = REAL_TO_INT( QUEUE_TRAY_BORDER * scale );
IRegion2D content;
controlBarUnion( CONTROL_BAR_LEFT, content );
@@ -11750,8 +11984,8 @@ void InGameUI::drawQueueTray( Int row )
tray.hi.x += trayBorder;
tray.hi.y += trayBorder;
- m_productionStripCameoW = cell.x - 2 * inset;
- m_productionStripCameoH = cell.y - 2 * inset;
+ m_productionStripCameoW = cell.x;
+ m_productionStripCameoH = cell.y;
m_productionStripStep = cell.x + gap;
HtmlValues values;
@@ -11767,7 +12001,7 @@ void InGameUI::drawQueueTray( Int row )
place.hi.x = place.lo.x + cell.x;
place.hi.y = cellsBox.hi.y;
HtmlValues entry;
- putPageRect( entry, "cell", reachedBy( place, reach ), TRUE );
+ putCell( entry, place, pageRing( gap ) );
cellList.push_back( entry );
}
@@ -11781,7 +12015,7 @@ void InGameUI::drawQueueTray( Int row )
m_queueOverlay->draw();
TheDisplay->beginBatch2D();
- drawProductionStripColumn( row, cellsBox.lo.x + inset, cellsBox.lo.y + inset );
+ drawProductionStripColumn( row, cellsBox.lo.x, cellsBox.lo.y );
TheDisplay->endBatch2D();
values[ "layer" ] = "front";