Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
feat(gameclient): general's powers tray cut to each row
Olcay Seygan750479c27aa8
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c42e13494..369fd8513 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -617,7 +617,7 @@ A third pass went through the generals' powers, promotions and unit abilities.- The superweapon strip in the top right stands in the same metal, the right way round this time: it is anchored to the right hand edge and grows leftwards, which is the way that bar in the corner grows, so its rail closes the row against the edge of the screen. The black rectangle behind those pictures is gone with it, and the countdowns are the size of the ones down in the corner rather than half of it.- Nothing in a row of trays lies over the picture in the tray beside it any more. A slot used to slide an eighth of a tray back under its neighbour so a row would read as one run of metal, and what it actually did was drop that neighbour's rail across the left edge of every cameo but the last - visible on the general's powers along the bottom right and on the superweapon countdowns along the top. They step a whole tray now, sideways as well as upward, which is what the queue column down the left has always done.- A game opens with nothing selected, so your first click is not a rally point.-- Your general's powers no longer climb the right hand edge of the screen. They sit three abreast, filling from the bottom corner where the first one has always been and wrapping upward, so a general holding eleven of them still reads as a block instead of a ladder from the radar to the sky. The keys follow the same shape: the first press picks a row, the second picks the power in it, so every power is two keys away - F1 F1 for the one in the corner, F2 F1 for the row above it. Only the keys you can press next are written on the pictures, so you are never reading eleven labels to find one, and Escape drops a row you thought better of - so does clicking a power with the mouse, and so does four seconds' pause, so a key hit by mistake in a fight never turns your next one into a superweapon. Rows with nothing in them yet cannot be picked at all: early on, when you hold three powers, only the row you have answers a key.+- Your general's powers no longer climb the right hand edge of the screen. They sit three abreast, filling from the bottom corner where the first one has always been and wrapping upward, so a general holding eleven of them still reads as a block instead of a ladder from the radar to the sky. Each row stands in steel only as wide as the powers in it, the way the superweapon countdowns do: seven powers are two rows of three with a single one on top against the screen's edge, where the tray used to be a full three by three with an empty dark corner. The keys follow the same shape: the first press picks a row, the second picks the power in it, so every power is two keys away - F1 F1 for the one in the corner, F2 F1 for the row above it. Only the keys you can press next are written on the pictures, so you are never reading eleven labels to find one, and Escape drops a row you thought better of - so does clicking a power with the mouse, and so does four seconds' pause, so a key hit by mistake in a fight never turns your next one into a superweapon. Rows with nothing in them yet cannot be picked at all: early on, when you hold three powers, only the row you have answers a key.- The second key of that pair works now. Anything that touched the interface at all - a promotion, a unit rolling out, a building captured somewhere across the map - was quietly forgetting the row you had just picked, and in a real fight that happens several times a second, so the pair almost never completed and the powers looked as though they answered no key at all.- The key written on a power is drawn over its cooldown sweep instead of under it. A power still charging had its label buried by the black wedge sweeping across the picture, which is exactly when you want to know which key it is.- The tilde key opens the general's promotions, and Escape closes them - Escape used to bring up the pause menu on top of the open screen, leaving the small exit button in its corner as the only way out. The screen is five columns wide and 1 to 5 now name them: each number sits in the corner of the science that column would sell you next, and pressing it twice buys that one - once to mark, once to spend, so a point is never gone to a key hit in a hurry. Buy the top of a chain and the number drops onto the next rung down, so a whole column goes in with one finger while the fight carries on behind you.diff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.htmlindex 8c1491c74..c7c27a512 100644--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html@@ -50,9 +50,11 @@them. The game letters each with the key bound to its placedata-each="portraitcells" the portrait bar's cells, the portrait's first and then only what itholds, each {{cell.x}} .y .w .h- {{skilltray.x}} ... the general's powers' tray, a panel as {{centre.x}} is, only as big as the- powers shown; data-each="skillcells" a cell behind each power, each- {{cell.x}} .y .w .h+ {{skilltray.x}} ... the general's powers' tray, a panel as {{centre.x}} is, round the full rows+ of three (or the one short row when there are fewer than three);+ {{skillstep.x}} ... the step a last row of one or two stands in on top of+ it, {{skillstep.shown}} "hidden" when there is none; data-each="skillcells"+ a cell behind each power, each {{cell.x}} .y .w .h{{signals.x}} ... the step of smoke signal buttons on the radar panel's top edge;data-click="signal:attack", "signal:defend" or "signal:look" sends oneto the middle of the view; {{signals.shown}} is "hidden" where the keys@@ -322,6 +324,13 @@as big as the powers shown, a dark cell behind each; its bottom edge is shaded, since it standsover the battlefield rather than on the screen's edge */.bezel .base { position: absolute; height: 1px; background-color: #0c1114; }+ /* a last row of one or two powers stands on the tray under it as a step, as the superweapon+ strip's short row hangs under its tray: no bottom of its own, and its well's bottom edge is the+ well's steel, the gap between two rows */+ .bezel.step .base { display: none; }+ .bezel.step .sunk { border-bottom-color: #23272c; }+ .china .bezel.step .sunk { border-bottom-color: #290f09; }+ .gla .bezel.step .sunk { border-bottom-color: #282311; }/* the smoke signals: a step on the radar's bezel's top edge at its right hand end, dark down itsown right. Three keys in it side by side: a crosshair to attack, a shield to defend, an eye to@@ -409,6 +418,12 @@<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 frame bezel step solid {{skillstep.shown}}" style="left: {{skillstep.x}}px; top: {{skillstep.y}}px; width: {{skillstep.w}}px; height: {{skillstep.h}}px; border-width: {{skillstep.bt}}px {{skillstep.br}}px {{skillstep.bb}}px {{skillstep.bl}}px">+ <div class="steel" style="left: -{{skillstep.bl}}px; right: -{{skillstep.br}}px; top: -{{skillstep.bt}}px; bottom: -{{skillstep.bb}}px"></div>+ <div class="shine" style="left: -{{skillstep.bl}}px; right: -{{skillstep.br}}px; top: -{{skillstep.bt}}px"></div>+ <div class="lit" style="left: -{{skillstep.bl}}px; top: -{{skillstep.bt}}px; bottom: -{{skillstep.bb}}px"></div>+ <div class="sunk grid" style="width: {{skillstep.w}}px; height: {{skillstep.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" 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 -->diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex 98bff9e46..bb5a58f1b 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -11946,9 +11946,6 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, Iconst Int powersShown = TheControlBar->placeSpecialPowerShortcutGrid( centreShown ? &corner : NULL, cell, cellGap );std::vector< HtmlValues > &places = lists[ "skillcells" ];- IRegion2D powers;- powers.lo = corner;- powers.hi = corner;for( Int slot = 0; slot < powersShown; slot++ ){const Int column = slot % SPECIAL_POWER_SHORTCUT_COLS;@@ -11958,12 +11955,20 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, Iplace.hi.y = corner.y - row * ( cell.y + cellGap );place.lo.x = place.hi.x - cell.x;place.lo.y = place.hi.y - cell.y;- powers.lo.x = min( powers.lo.x, place.lo.x );- powers.lo.y = min( powers.lo.y, place.lo.y );HtmlValues entry;putCell( entry, place, pageRing( cellGap, scale ), scale );places.push_back( entry );}++ // the tray is cut to each row, as the superweapon strip's is: the full rows of three stand in one+ // plate, and a last row of one or two stands on top of it in steel only as wide as it is, against+ // the screen's edge, rather than the whole tray widening round an empty corner+ const Int fullRows = powersShown / SPECIAL_POWER_SHORTCUT_COLS;+ const Int lastColumns = powersShown % SPECIAL_POWER_SHORTCUT_COLS;+ IRegion2D powers;+ powers.hi = corner;+ powers.lo.x = corner.x - ( fullRows > 0 ? SPECIAL_POWER_SHORTCUT_COLS : lastColumns ) * ( cell.x + cellGap ) + cellGap;+ powers.lo.y = corner.y - max( fullRows, 1 ) * ( cell.y + cellGap ) + cellGap;IRegion2D tray = powers;tray.lo.x -= trayBorder;tray.lo.y -= trayBorder;@@ -11971,6 +11976,20 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, Itray.hi.y += trayBorder;putFrame( values, "skilltray", powers, tray, powersShown > 0 );+ // the step: its bottom is the gap between its row and the one under it+ const Bool stepShown = powersShown > 0 && fullRows > 0 && lastColumns > 0;+ IRegion2D step;+ step.hi.x = corner.x;+ step.hi.y = powers.lo.y - cellGap;+ step.lo.x = corner.x - lastColumns * ( cell.x + cellGap ) + cellGap;+ step.lo.y = step.hi.y - cell.y;+ IRegion2D stepTray = step;+ stepTray.lo.x -= trayBorder;+ stepTray.lo.y -= trayBorder;+ stepTray.hi.x = TheDisplay->getWidth();+ stepTray.hi.y = powers.lo.y;+ putFrame( values, "skillstep", step, stepTray, stepShown );+// each grid's frames again in front of its buttons, drawn by a window after themm_cellFrontCells[ CELL_GRID_COMMAND ] = commandCells;m_cellFrontCells[ CELL_GRID_QUEUE ] = portraitCells;