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): watcher with nothing selected loses the portrait well

Olcay Seygan51613413a1ef
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cce5c814f..354ce36ed 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,7 +22,7 @@ found and fixed — EA's own, not port damage.**
- The command bar is one console standing in the middle of the bottom edge: a taller radar, your selection and the build grid side by side, with the power bar over the grid. The idle worker and rank keys sit in a row over your selection, and in multiplayer the smoke signals join them. The red under-attack lamp is gone: the ping on the radar, the voice and the line in the event feed already tell you where you are hit, and the lamp only blinked about it a second time.
- Your general's powers grow out of the console's right end, a column for each F key with its powers stacked up it, and only the powers you have take any room.
-- A single unit's name and health stand beside its portrait, and a veteran gets his gold stars there too. A group shows every type it holds in the same box, five to a row.
+- A single unit's name and health stand beside its portrait, and a veteran gets his gold stars there too. A group shows every type it holds in the same box, five to a row. Watching a match with nothing selected, the empty portrait box is gone and the console is the radar alone; click a unit and the box comes back.
- The match clock hangs from the middle of the top edge with your money in its own box under it. Superweapon countdowns in the top right corner are as big as your general's power buttons. Hold Tab and the scoreboard drops down from it.
- Peace time has its own plate under your money, so the truce clock never pushes the match clock aside. When the last ten seconds start, the countdown hangs straight off that plate.
- A superweapon built, charged or fired anywhere on the map flashes its name in big letters under the clock: "Nuclear Missile launched". Yours are white, an ally's blue, an enemy's red. Each line stays four seconds and fades out. When several land at once they queue and hurry through, two seconds each with one more waiting and one second with a pile behind it, so the last news never sits stale.
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index c833dc088..88b84f2d0 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -12297,7 +12297,13 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
const Int gridWellWidth = REAL_TO_INT( COMMAND_COLUMNS * ( COMMAND_CELL_WIDTH + CELL_GAP ) * scale );
const ICoord2D cell = cellSize();
const Int cellGap = REAL_TO_INT( SKILL_CELL_GAP * scale );
- Int consoleWidth = radarWellWidth + border + selectionWellWidth;
+ // a watcher with nothing selected has no portrait to show, and the bar has already stood the
+ // portrait's panel down (ControlBar::watchPlayer): the selection's well goes with it and the
+ // console is the radar alone, until a click on a unit brings both back
+ const Bool selectionShown = !watching || centreShown || ( panelCount > 2 && shown[ 2 ] );
+ Int consoleWidth = radarWellWidth;
+ if( selectionShown )
+ consoleWidth += border + selectionWellWidth;
if( centreShown )
consoleWidth += border + gridWellWidth + powersTrayWidth( scale );
@@ -12308,7 +12314,7 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
IRegion2D wells;
wells.lo.x = radarWell.lo.x;
- wells.hi.x = centreShown ? gridWell.hi.x : selectionWell.hi.x;
+ wells.hi.x = centreShown ? gridWell.hi.x : selectionShown ? selectionWell.hi.x : radarWell.hi.x;
wells.lo.y = consoleTopLine;
wells.hi.y = foot;
const IRegion2D consoleBox = framed( wells, border );
@@ -12322,7 +12328,7 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
std::vector< HtmlValues > &wellList = lists[ "wells" ];
size_t wellsFilled = 0;
putWell( wellList, wellsFilled, radarWell, leftFound, FALSE, scale );
- putWell( wellList, wellsFilled, selectionWell, consoleShown, TRUE, scale );
+ putWell( wellList, wellsFilled, selectionWell, consoleShown && selectionShown, TRUE, scale );
putWell( wellList, wellsFilled, gridWell, centreShown, TRUE, scale );
wellList.resize( wellsFilled );