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): containers fit what they hold, borders outside them
Olcay Seygand4d72ef7b01c
diff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.htmlindex fc7faa939..da44800a6 100644--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html@@ -38,15 +38,18 @@{{panelN.x}} .y .w .h N 0 to 2, left, centre and right: where the plates would have gone,moving with the bar when it slides or minimises; .w and .h are 0 and{{panelN.shown}} is "hidden" when a minimised bar has stood it down- {{left.x}} .y .w .h the left panel, grown round the radar and out to the screen's left and- bottom edges- {{centre.x}} .y .w .h the centre as three blocks stacked flush, with their steel round them- {{powerframe.x}} ... already: the command grid's panel, the power bar's frame standing on it,- {{moneyblock.x}} ... and the money's block on the frame; each .shown as above, and- {{powerframe.inner}} the height inside the frame and its lip- {{right.x}} .y .w .h the right panel, grown round the portrait and the experience bar and out- to the screen's right and bottom edges. The promotion and minimise- buttons are moved to sit in its top right corner+ {{left.x}} .y .w .h the three panels, each a container and a border outside it: .x and .y+ {{centre.x}} ... the border's outer corner, .w and .h the container, exactly what it holds+ {{right.x}} ... (the radar; the command grid; the portrait and the experience bar), and+ .bt .br .bb .bl the border's four widths, out to the screen's edge on the+ sides against it+ {{alerttab.x}} ... tabs standing on a border's top edge, outside it: the under-attack light+ {{workertab.x}} ... on the radar panel's, the idle worker on the centre's, the skills button+ {{skillsbutton.x}} ... on the right panel's at its right hand end, with the promotion button+ moved beside it+ {{powerframe.x}} ... the power bar's frame standing on the centre's border, and the money's+ {{moneyblock.x}} ... block on the frame, stacked flush; {{powerframe.inner}} the height inside+ the frame and its lip{{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 (theradar), RightHUD (the portrait's box), CameoWindow (the portrait),@@ -78,27 +81,22 @@.gla .panel { background-color: rgba(21, 18, 8, 0.94); border-top-color: #cbbf82; border-left-color: #a99d62; }.gla .rail { background: linear-gradient(to bottom, #8f8249, #48401e); }- /* every panel hugs what it holds, and what the old plates covered round them is battlefield and- takes clicks as one: the left the radar's bezel, the right the portrait with the two small- buttons over its top right corner, the centre the command grid under the money and power bar */- /* the side panels arrive from the game already grown round their windows and run out to the- screen's side and bottom edges, like the centre's blocks run down to its bottom */-- /* the centre is three blocks stacked flush like bricks, each narrower than the one under it: the- command grid's panel, the power bar's frame on it and the money's block on that. The game works- out where each one ends so they touch, and the page draws them exactly there */+ /* a panel is a container exactly as big as what it holds - the radar, the command grid, the+ portrait - and a border of steel outside it, out to the screen's edge on the sides against it.+ The game hands each one its corner, its container's size and the four border widths. The+ container is dark behind what it holds; everything else stands outside the border */+ .frame { border-style: solid; border-color: #6f7782; border-top-color: #aab4bf; border-left-color: #8a949f;+ border-bottom-color: #3f4650; border-right-color: #4b535e; background-color: rgba(4, 8, 10, 0.94); }+ .china .frame { border-color: #8e3b2b; border-top-color: #d98a72; border-left-color: #b8604b; border-bottom-color: #4c1b13; border-right-color: #6a2a1e;+ background-color: rgba(12, 4, 3, 0.94); }+ .gla .frame { border-color: #867a45; border-top-color: #cbbf82; border-left-color: #a99d62; border-bottom-color: #48401e; border-right-color: #625a31;+ background-color: rgba(10, 9, 4, 0.94); }++ /* over the centre's border the power bar's frame and on it the money's block, stacked flush */.stack { box-sizing: border-box; margin: 0; }/* the money's block is only as tall as its figure, so it wears its lit top edge and no rail */.moneyblock .rail { display: none; }- /* a bezel: a window set into the panel, four pixels of steel round a black lip */- .bezel { margin: -5px 0 0 -5px; border: 4px solid #4b535e; border-top-color: #2a3036; border-left-color: #2a3036;- border-bottom-color: #8a949f; border-right-color: #6f7782; }- .bezel .lip { position: absolute; left: 0; top: 0; right: 0; bottom: 0; border: 1px solid #000000; }- .china .bezel { border-color: #6a2a1e; border-top-color: #34120c; border-left-color: #34120c; border-bottom-color: #b8604b; border-right-color: #8e3b2b; }- .gla .bezel { border-color: #625a31; border-top-color: #302b15; border-left-color: #302b15; border-bottom-color: #a99d62; border-right-color: #867a45; }- .rivet { position: absolute; width: 3px; height: 3px; background-color: #aab4bf; border-bottom: 1px solid #0c1114; }-.well { margin: -3px 0 0 -3px; border: 2px solid #0c1114; border-bottom-color: #4b535e; border-right-color: #4b535e;background-color: rgba(0, 0, 0, 0.35); }/* a groove: a bar framed in two pixels of steel all the way round a black lip, lit a shade more@@ -146,13 +144,14 @@.menu .bar { position: absolute; left: 4px; right: 4px; height: 2px; background-color: #e8eef2; }.menu:hover .bar { background-color: #e8d27a; }- /* the idle worker: a tab over the centre panel's top left corner, outside it */- .worker { position: absolute; left: 0; top: -15px; width: 44px; height: 14px; border-bottom: 0; }+ /* the idle worker: a tab standing on the centre's border at its left end */+ .worker { border-bottom: 0; }.watching .worker { display: none; }- /* the under-attack light: a tab on the left panel's top left edge, red while the bar blinks it */- .alert { position: absolute; left: 4px; top: -15px; height: 13px; line-height: 13px; padding: 0 6px; font-size: 7px; font-weight: bold;- color: #5a2a24; background-color: rgba(20, 8, 6, 0.9); border: 1px solid #4a1a14; border-bottom: 0; }+ /* the under-attack light: a tab standing on the radar panel's border at its left end, red while+ the bar blinks it */+ .alert { line-height: 14px; text-align: center; font-size: 7px; font-weight: bold;+ color: #5a2a24; background-color: rgba(20, 8, 6, 0.9); }.alert.disabled { color: #ffffff; background: linear-gradient(to bottom, #ff6a50, #b0200f); border-color: #ffb0a0; }/* the skills button is lit while the powers are out, and dark once folded away; the grid's empty@@ -184,39 +183,17 @@<body><div class="{{side}} {{watching}}">- <div class="piece panel solid left {{left.shown}}" style="left: {{left.x}}px; top: {{left.y}}px; width: {{left.w}}px; height: {{left.h}}px">- <div class="rail"></div>- <div class="alert {{WinUAttack.state}}">{{text:GUI:BarUnderAttack}}</div>- </div>+ <div class="piece frame solid {{left.shown}}" style="left: {{left.x}}px; top: {{left.y}}px; width: {{left.w}}px; height: {{left.h}}px; border-width: {{left.bt}}px {{left.br}}px {{left.bb}}px {{left.bl}}px"></div>+ <div class="piece alert {{alerttab.shown}} {{WinUAttack.state}}" style="left: {{alerttab.x}}px; top: {{alerttab.y}}px; width: {{alerttab.w}}px; height: {{alerttab.h}}px">{{text:GUI:BarUnderAttack}}</div><div class="piece panel solid stack moneyblock {{moneyblock.shown}}" style="left: {{moneyblock.x}}px; top: {{moneyblock.y}}px; width: {{moneyblock.w}}px; height: {{moneyblock.h}}px"><div class="rail"></div></div><div class="piece groove solid stack {{powerframe.shown}}" style="left: {{powerframe.x}}px; top: {{powerframe.y}}px; width: {{powerframe.w}}px; height: {{powerframe.h}}px"><div class="cells {{power.state}}" style="height: {{powerframe.inner}}px"><div class="cell {{lit}}" data-each="powercells" style="left: {{x}}px; width: {{w}}px; height: {{powerframe.inner}}px"><div class="seg" style="height: {{powerframe.inner}}px"></div></div></div><div class="needle" style="left: {{power.needle}}%"></div><div class="lip"></div></div>- <div class="piece panel solid stack centre {{centre.shown}}" style="left: {{centre.x}}px; top: {{centre.y}}px; width: {{centre.w}}px; height: {{centre.h}}px">- <div class="rail"></div>- <div class="worker button {{ButtonIdleWorker.state}}" data-click="press:ButtonIdleWorker"><div class="cap">{{text:GUI:BarIdleWorker}}</div></div>- </div>- <div class="piece panel solid right {{right.shown}}" style="left: {{right.x}}px; top: {{right.y}}px; width: {{right.w}}px; height: {{right.h}}px"><div class="rail"></div></div>-- <div class="piece bezel {{LeftHUD.shown}}" style="left: {{LeftHUD.x}}px; top: {{LeftHUD.y}}px; width: {{LeftHUD.w}}px; height: {{LeftHUD.h}}px">- <div class="lip"></div>- <div class="rivet" style="left: -4px; top: -4px"></div>- <div class="rivet" style="right: -4px; top: -4px"></div>- <div class="rivet" style="left: -4px; bottom: -4px"></div>- <div class="rivet" style="right: -4px; bottom: -4px"></div>- </div>- <div class="piece bezel {{RightHUD.shown}}" style="left: {{RightHUD.x}}px; top: {{RightHUD.y}}px; width: {{RightHUD.w}}px; height: {{RightHUD.h}}px">- <div class="lip"></div>- <div class="rivet" style="left: -4px; top: -4px"></div>- <div class="rivet" style="right: -4px; top: -4px"></div>- <div class="rivet" style="left: -4px; bottom: -4px"></div>- <div class="rivet" style="right: -4px; bottom: -4px"></div>- </div>-- <div class="piece well {{CommandWindow.shown}}" style="left: {{CommandWindow.x}}px; top: {{CommandWindow.y}}px; width: {{CommandWindow.w}}px; height: {{CommandWindow.h}}px"></div>- <div class="piece groove {{GeneralsExp.shown}}" style="left: {{GeneralsExp.x}}px; top: {{GeneralsExp.y}}px; width: {{GeneralsExp.w}}px; height: {{GeneralsExp.h}}px"><div class="lip"></div></div>+ <div class="piece frame solid {{centre.shown}}" style="left: {{centre.x}}px; top: {{centre.y}}px; width: {{centre.w}}px; height: {{centre.h}}px; border-width: {{centre.bt}}px {{centre.br}}px {{centre.bb}}px {{centre.bl}}px"></div>+ <div class="piece button worker {{workertab.shown}} {{ButtonIdleWorker.state}}" data-click="press:ButtonIdleWorker" style="left: {{workertab.x}}px; top: {{workertab.y}}px; width: {{workertab.w}}px; height: {{workertab.h}}px"><div class="cap">{{text:GUI:BarIdleWorker}}</div></div>+ <div class="piece frame solid {{right.shown}}" style="left: {{right.x}}px; top: {{right.y}}px; width: {{right.w}}px; height: {{right.h}}px; border-width: {{right.bt}}px {{right.br}}px {{right.bb}}px {{right.bl}}px"></div><div class="piece button {{ButtonPlaceBeacon.shown}} {{ButtonPlaceBeacon.state}}" style="left: {{ButtonPlaceBeacon.x}}px; top: {{ButtonPlaceBeacon.y}}px; width: {{ButtonPlaceBeacon.w}}px; height: {{ButtonPlaceBeacon.h}}px"><div class="cap">{{text:GUI:BarBeacon}}</div></div><div class="piece button promotion {{promotion}} {{blink}} {{ButtonGeneral.shown}} {{ButtonGeneral.state}}" style="left: {{ButtonGeneral.x}}px; top: {{ButtonGeneral.y}}px; width: {{ButtonGeneral.w}}px; height: {{ButtonGeneral.h}}px"><div class="cap stars">★★★</div></div>diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex ce8146c42..8b588955c 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -10253,22 +10253,22 @@ static const char *const CONTROL_BAR_LEFT[] = { "LeftHUD", NULL };static const char *const CONTROL_BAR_RIGHT[] = { "RightHUD", "GeneralsExp", "ExpBarForeground", NULL };static const char *const CONTROL_BAR_CENTRE[] = { "CommandWindow", "ObserverPlayerListWindow", "ButtonPlaceBeacon", NULL };-/** The promotion button, small, in the right panel's top right corner beside the page's own skills- * button, which takes the outermost place. 800x600 pixels. */+/** The promotion button, small, on the right panel's border beside the page's own skills button,+ * which takes the outermost place. 800x600 pixels. */enum{CORNER_BUTTON_WIDTH = 32,- CORNER_BUTTON_HEIGHT = 14,CORNER_BUTTON_GAP = 2,- CORNER_BUTTON_RISE = 16, ///< how far above the portrait's box the buttons' top edge sitsSKILL_GRID_WIDTH = 150, ///< the general's powers, three to a row, against the screen's right edge- SKILL_GRID_GAP = 30, ///< between them and the right panel's top+ SKILL_GRID_GAP = 30, ///< between them and the skills buttonSIGNAL_BUTTON_SIZE = 24, ///< each smoke signal button's height, a row of the columnSIGNAL_BUTTON_WIDTH = 40, ///< and its width, room for its word in either languageSIGNAL_BUTTONS = 3, ///< attack, defend, lookSKILL_GRID_ROWS = 3, ///< the empty places drawn behind the powersSKILL_GRID_COLUMNS = 3,- SKILLS_BUTTON_WIDTH = 58 ///< wide enough for its name in either language+ SKILLS_BUTTON_WIDTH = 58, ///< wide enough for its name in either language+ ALERT_TAB_WIDTH = 84, ///< the under-attack light, on the radar panel's border+ WORKER_TAB_WIDTH = 44 ///< the idle worker button, on the command grid panel's border};static const char *const SKILLS_FOLDED = "skills"; ///< the flip the skills button toggles; flipped is folded awaystatic const char *const CORNER_BUTTONS[] = { "ButtonGeneral" };@@ -10351,15 +10351,60 @@ static void putPageRect( HtmlValues &values, const std::string &name, const IReg/** How much steel each block of the centre stack shows round its window, 800x600 pixels. */enum{- STACK_GRID_SIDE = 6, ///< either side of the command grid, and under it- STACK_GRID_TOP = 10, ///< over the grid when no power bar sits on it+ PANEL_BORDER = 8, ///< a panel's border outside its container, on the sides facing the battlefieldSTACK_FRAME = 3, ///< the power bar's frame and lipSTACK_MONEY_SIDE = 8,STACK_MONEY_TOP = 1, ///< over the money's line of text- SIDE_PANEL_SIDE = 8, ///< steel between a side panel's window and its inner edge- SIDE_PANEL_TOP = 10 ///< and over it; the outer edges are the screen's+ PANEL_TAB_HEIGHT = 14 ///< a tab or button standing on a border's top edge};+/** 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. */+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();+ return box;+}++/** A panel for the page: `name`.x and .y the border's outer corner, .w and .h the container, and+ * .bt .br .bb .bl the border's four widths, all in the page's pixels, every edge rounded once so+ * the container fits what it holds exactly; `name`.shown as putPageRect writes it. */+static void putFrame( HtmlValues &values, const std::string &name, const IRegion2D &content, const IRegion2D &box, Bool shown )+{+ const Real scale = ControlBarUniformScale();+ struct Edge { static Int page( Int screen, Real scale ) { return REAL_TO_INT_FLOOR( screen / scale + 0.5f ); } };+ const Int left = Edge::page( box.lo.x, scale ), top = Edge::page( box.lo.y, scale );+ const Int innerLeft = Edge::page( content.lo.x, scale ), innerTop = Edge::page( content.lo.y, scale );+ const Int innerRight = Edge::page( content.hi.x, scale ), innerBottom = Edge::page( content.hi.y, scale );+ const Int right = Edge::page( box.hi.x, scale ), bottom = Edge::page( box.hi.y, scale );++ values[ name + ".x" ] = std::to_string( left );+ values[ name + ".y" ] = std::to_string( top );+ values[ name + ".w" ] = std::to_string( shown ? max( 0, innerRight - innerLeft ) : 0 );+ values[ name + ".h" ] = std::to_string( shown ? max( 0, innerBottom - innerTop ) : 0 );+ values[ name + ".bl" ] = std::to_string( max( 0, innerLeft - left ) );+ values[ name + ".bt" ] = std::to_string( max( 0, innerTop - top ) );+ values[ name + ".br" ] = std::to_string( max( 0, right - innerRight ) );+ values[ name + ".bb" ] = std::to_string( max( 0, bottom - innerBottom ) );+ values[ name + ".shown" ] = shown ? "shown" : "hidden";+}++/** A tab of `width` 800x600 pixels standing on `box`'s top edge, from its left or its right. */+static IRegion2D tabOn( const IRegion2D &box, Int width, Bool fromRight )+{+ const Real scale = ControlBarUniformScale();+ IRegion2D tab;+ tab.hi.y = box.lo.y;+ tab.lo.y = tab.hi.y - REAL_TO_INT( PANEL_TAB_HEIGHT * scale );+ tab.lo.x = fromRight ? box.hi.x - REAL_TO_INT( width * scale ) : box.lo.x;+ tab.hi.x = fromRight ? box.hi.x : box.lo.x + REAL_TO_INT( width * scale );+ return tab;+}+//-------------------------------------------------------------------------------------------------/** The centre of the bar as three blocks stacked flush, each narrower than the one under it: the* command grid's panel, the power bar in its frame on top of that, and the money's block on top of@@ -10369,7 +10414,7 @@ enum* line of text and set down on the block under it, so its block is no taller than the figure.* Written as centre, powerframe and moneyblock. *///--------------------------------------------------------------------------------------------------static void stackCentre( HtmlValues &values, Bool shown )+static void stackCentre( HtmlValues &values, Bool shown, IRegion2D ¢re ){IRegion2D grid, power, money;Bool gridFound = controlBarUnion( CONTROL_BAR_CENTRE, grid );@@ -10395,18 +10440,19 @@ static void stackCentre( HtmlValues &values, Bool shown )}const Bool powerFound = controlBarWindowRect( controlBarWindow( "PowerWindow" ), power );- // the grid's panel stands on the screen's bottom edge like the side panels- IRegion2D centre = grownBy( grid, STACK_GRID_SIDE, STACK_GRID_TOP, STACK_GRID_SIDE, 0 );- centre.hi.y = TheDisplay->getHeight();+ // the grid's container is the grid, its border outside it running down to the screen's bottom.+ // The power bar is the page's own now, so its frame is free to stand on that border wherever the+ // power window sits, and the money is set down on the frame+ centre = framed( grid, REAL_TO_INT( PANEL_BORDER * ControlBarUniformScale() ), FALSE, FALSE );IRegion2D frame = grownBy( power, STACK_FRAME, STACK_FRAME, STACK_FRAME, STACK_FRAME );+ const Int frameHeight = frame.hi.y - frame.lo.y;+ frame.hi.y = centre.lo.y;+ frame.lo.y = frame.hi.y - frameHeight;- // each block reaches down to the top of the one it stands on+ // each block stands on the top of the one under itInt floor = centre.lo.y;if( powerFound )- {- centre.lo.y = frame.hi.y;floor = frame.lo.y;- }GameWindow *moneyWindow = controlBarWindow( "MoneyDisplay" );Bool moneyFound = controlBarWindowRect( moneyWindow, money );@@ -10426,7 +10472,7 @@ static void stackCentre( HtmlValues &values, Bool shown )IRegion2D block = grownBy( money, STACK_MONEY_SIDE, STACK_MONEY_TOP, STACK_MONEY_SIDE, 0 );block.hi.y = floor;- putPageRect( values, "centre", centre, gridFound && shown );+ putFrame( values, "centre", grid, centre, gridFound && shown );putPageRect( values, "powerframe", frame, powerFound && shown );// the page lays boxes out content-box whatever box-sizing says, so the frame's border goes on top@@ -10502,52 +10548,53 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, Ifor( Int panel = 0; panel < panelCount; panel++ )putPageRect( values, "panel" + std::to_string( panel ), panels[ panel ], shown[ panel ] );- // every panel hugs what it holds, so the rest of the old plates is battlefield again- IRegion2D box;- // the side panels stand on the screen's bottom edge and against its side edge, the steel round- // what they hold running out to the edge of the screen- const Bool leftFound = controlBarUnion( CONTROL_BAR_LEFT, box );- IRegion2D side = grownBy( box, 0, SIDE_PANEL_TOP, SIDE_PANEL_SIDE, 0 );- side.lo.x = 0;- side.hi.y = TheDisplay->getHeight();- putPageRect( values, "left", side, leftFound && panelCount > 0 && shown[ 0 ] );-- // the three smoke signal buttons, a column standing on the screen's bottom edge against the- // left panel's right side+ // Every panel is a container exactly as big as what it holds, and a border outside it: steel on+ // the sides facing the battlefield, out to the screen's edge on the sides against it. Everything+ // else - the tabs, the buttons, the signals - stands outside the border.+ const Real scale = ControlBarUniformScale();+ const Int border = REAL_TO_INT( PANEL_BORDER * scale );+ const Bool leftShown = panelCount > 0 && shown[ 0 ];+ const Bool rightShown = panelCount > 2 && shown[ 2 ];++ IRegion2D content;+ const Bool leftFound = controlBarUnion( CONTROL_BAR_LEFT, content );+ const IRegion2D leftBox = framed( content, border, TRUE, FALSE );+ putFrame( values, "left", content, leftBox, leftFound && leftShown );+ putPageRect( values, "alerttab", tabOn( leftBox, ALERT_TAB_WIDTH, FALSE ), leftFound && leftShown );++ // the three smoke signal buttons, a column standing on the screen's bottom edge against the left+ // panel's borderIRegion2D signalColumn;- signalColumn.lo.x = side.hi.x;- signalColumn.hi.x = side.hi.x + REAL_TO_INT( SIGNAL_BUTTON_WIDTH * ControlBarUniformScale() );+ 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.lo.y = signalColumn.hi.y - REAL_TO_INT( SIGNAL_BUTTON_SIZE * SIGNAL_BUTTONS * ControlBarUniformScale() );- putPageRect( values, "signals", signalColumn, leftFound && panelCount > 0 && shown[ 0 ] );- stackCentre( values, panelCount > 1 && shown[ 1 ] );+ signalColumn.lo.y = signalColumn.hi.y - REAL_TO_INT( SIGNAL_BUTTON_SIZE * SIGNAL_BUTTONS * scale );+ putPageRect( values, "signals", signalColumn, leftFound && leftShown );++ IRegion2D centreBox;+ stackCentre( values, panelCount > 1 && shown[ 1 ], centreBox );+ putPageRect( values, "workertab", tabOn( centreBox, WORKER_TAB_WIDTH, FALSE ), panelCount > 1 && shown[ 1 ] );HtmlLists lists;putPowerBar( values, lists[ "powercells" ] ); // after the stack, whose frame it divides into cells- const Bool rightFound = controlBarUnion( CONTROL_BAR_RIGHT, box );- side = grownBy( box, SIDE_PANEL_SIDE, SIDE_PANEL_TOP + CORNER_BUTTON_RISE, 0, 0 );- side.hi.x = TheDisplay->getWidth();- side.hi.y = TheDisplay->getHeight();- putPageRect( values, "right", side, rightFound && panelCount > 2 && shown[ 2 ] );-- // the page's skills button takes the right panel's top right corner and the promotion button- // stands beside it; a bar with no portrait showing leaves the promotion button where it was- const Real scale = ControlBarUniformScale();++ const Bool rightFound = controlBarUnion( CONTROL_BAR_RIGHT, content );+ const IRegion2D rightBox = framed( content, border, FALSE, TRUE );+ putFrame( values, "right", content, rightBox, rightFound && rightShown );++ // the page's skills button stands on the right panel's border at its right hand end, and the+ // promotion button beside it; a bar with no portrait showing leaves the promotion button where it wasconst Int cornerWidth = REAL_TO_INT( CORNER_BUTTON_WIDTH * scale );- const Int cornerHeight = REAL_TO_INT( CORNER_BUTTON_HEIGHT * scale );const Int cornerGap = REAL_TO_INT( CORNER_BUTTON_GAP * scale );- IRegion2D skills;- skills.hi.x = box.hi.x;- skills.lo.x = skills.hi.x - REAL_TO_INT( SKILLS_BUTTON_WIDTH * scale );- skills.lo.y = box.lo.y - REAL_TO_INT( CORNER_BUTTON_RISE * scale );- skills.hi.y = skills.lo.y + cornerHeight;- putPageRect( values, "skillsbutton", skills, rightFound && panelCount > 2 && shown[ 2 ] );+ const IRegion2D skills = tabOn( rightBox, SKILLS_BUTTON_WIDTH, TRUE );+ const Int cornerHeight = skills.hi.y - skills.lo.y;+ putPageRect( values, "skillsbutton", skills, rightFound && rightShown );// the general's powers ready to fire, three to a row over the right panel, while the skills// button has not folded them awayIRegion2D powers;powers.hi.x = TheDisplay->getWidth();powers.lo.x = powers.hi.x - REAL_TO_INT( SKILL_GRID_WIDTH * scale );- powers.hi.y = side.lo.y - REAL_TO_INT( SKILL_GRID_GAP * scale );+ powers.hi.y = skills.lo.y - REAL_TO_INT( SKILL_GRID_GAP * scale );powers.lo.y = powers.hi.y;const Bool powersOpen = m_controlBarFlipped.find( SKILLS_FOLDED ) == m_controlBarFlipped.end();ICoord2D cell;