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(hud): observer standings picked by labelled stat keys
Olcay Seygancf2cb2730533
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 32e934dc1..007e4a83d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -25,7 +25,7 @@ found and fixed, EA's own, not port damage.**- The promotion window's close button is your side's own now, cut to fit the window's corner. It was the last piece of the old bar's art left on any side's screen.- On a very wide map the minimap stops at 4:3 and shows the rest with black bands.- Watching a match gets a bar of its own in plain dark steel with the same three tiers as the players' bars, square where it meets the screen's edge. The watcher belongs to no side, so each of his boxes is built the way one side builds: the radar and the column of players are one American box under a ledge that ends in an arrow point, the watched player's panel is China's, with a stepped rail and a row of rivets, the selection box takes Turkiye's wide chamfer and range ticks under a mount that holds the on-air lamp, and the drawers on the right are GLA scrap with welded patches and odd bolts. The panel now reaches the bottom of the screen, and a click anywhere on its steel stays on the panel. Its radar takes the map's shape, and the column of players stands against the radar's edge on a tall map instead of leaving a gap. A lamp in each player's colour sits beside his button, with a ring round the one you point at and a brighter one round the player you are watching.-- While you watch, a rack of drawers hangs from the right edge under the superweapon countdowns. The top drawer holds a lever for the camera with three stops (yours, the director that goes to the biggest fight by itself, or the followed player's own screen), a switch for that player's fog of war and a switch that slides the armies drawer out. Under it every player is ranked on a dial of seven numbers: net worth, cash, income a minute, army value, kills and losses, general's rank and power. Turn it with a click, the wheel or Q, W, E, R, T, Y and A, and each row's bar shows his share of the leader's number. A tab out of each row follows that player, a second click lets him go, and the armies drawer lists the six kinds of unit he has most of, with how many. A click on the rack never reaches the battlefield.+- While you watch, a rack of drawers hangs from the right edge under the superweapon countdowns. The top drawer holds a lever for the camera with three stops (yours, the director that goes to the biggest fight by itself, or the followed player's own screen), a switch for that player's fog of war and a switch that slides the armies drawer out. Under it every player is ranked by one of seven numbers: net worth, cash, income a minute, army value, kills and losses, general's rank and power. A row of seven buttons picks the number, each with a picture (a stack of coins for net worth, a tank for army value, a gunsight for kills) and its key in the corner; Q, W, E, R, T, Y and A and the wheel pick it too. The number's name stands over the list in plain words, the column head says what it is counted in, and pointing at a button names it before you click. It used to be a dial with seven letters round it and nothing to say which letter meant what. Each row carries the player's place, his colour, his emblem and a bar of his share of the leader's number; the row under the pointer lights gold and the player you follow is framed in blue. A tab out of each row follows that player, a second click lets him go, and the armies drawer lists the six kinds of unit he has most of, with how many. A click on the rack never reaches the battlefield.- The superweapon countdowns stand where they do in a player's game while you watch, in their tray. The observer's bar named no tray for them, so they used to sit bare and higher up.- The card that rises when you point at a build button is drawn in your side's own art now, with the price and the build time beside the name behind a coin and a clock. Under them one row of icons says what you are buying: health, armour class, damage, damage a second, range and speed for a unit, health, armour and the power it adds or draws for a building. The six lines of figures that used to pad out the description are gone, and so is the "Power Required" line EA wrote into every building's text, in every language. The small tooltip beside the pointer sits in a framed well of the same art in a match and of the watcher's steel in the menus. Both are cut from the bar itself: the same near-black shell, bevelled lip and sunk glass, the card's corner shaped like the side's bar (America's 45 degree cut, China's two steps, the GLA's bitten scrap, Turkiye's wide chamfer with its turquoise light), open on the side that meets the screen's edge.- The army screen, the lobby and the score screen wear our own emblems. Every army has a card of its own on the army screen, the generals included, where EA's faces and logos used to be, and the player card shows the same one. Turkiye stops borrowing America's logo there and in the lobby's game list. On the score screen each player's row starts with his army's emblem, and your own army's card stands faint behind the table.diff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsSpec.dds b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsSpec.ddsindex 02a26db1e..48ce99156 100644Binary files a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsSpec.dds and b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsSpec.dds differdiff --git a/GeneralsMD/Code/Data/French/Generals.str b/GeneralsMD/Code/Data/French/Generals.strindex 464241c48..7b1037144 100644--- a/GeneralsMD/Code/Data/French/Generals.str+++ b/GeneralsMD/Code/Data/French/Generals.str@@ -16733,6 +16733,26 @@ GUI:HudNoWorkerLeft"%s n'a plus d'ouvrier"END+GUI:HudHighestFirst+"du plus haut au plus bas"+END++GUI:HudPlayerHead+"Joueur"+END++GUI:HudStatUnitMoney+"$"+END++GUI:HudStatUnitIncome+"$/min"+END++GUI:HudStatUnitPower+"excédent"+END+GUI:BarIdleWorker"Ouvrier"ENDdiff --git a/GeneralsMD/Code/Data/German/Generals.str b/GeneralsMD/Code/Data/German/Generals.strindex f609da8dc..82eb9057d 100644--- a/GeneralsMD/Code/Data/German/Generals.str+++ b/GeneralsMD/Code/Data/German/Generals.str@@ -14929,6 +14929,26 @@ GUI:HudNoWorkerLeft"%s hat keinen Arbeiter mehr"END+GUI:HudHighestFirst+"höchste zuerst"+END++GUI:HudPlayerHead+"Spieler"+END++GUI:HudStatUnitMoney+"$"+END++GUI:HudStatUnitIncome+"$/Min."+END++GUI:HudStatUnitPower+"Überschuss"+END+GUI:BarIdleWorker"Arbeiter"ENDdiff --git a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudObsSpec.ini b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudObsSpec.iniindex 65d1240a6..ed64f9112 100644--- a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudObsSpec.ini+++ b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudObsSpec.ini@@ -10,298 +10,354 @@ MappedImage ObserverProRackHeadStatus = NONEEnd-MappedImage ObserverProRackDialQ+MappedImage ObserverProRackLeverFreeTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:311 Top:2 Right:363 Bottom:54+ Coords = Left:112 Top:73 Right:268 Bottom:105Status = NONEEnd-MappedImage ObserverProRackDialQH+MappedImage ObserverProRackLeverFreeHTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:366 Top:2 Right:418 Bottom:54+ Coords = Left:271 Top:73 Right:427 Bottom:105Status = NONEEnd-MappedImage ObserverProRackDialW+MappedImage ObserverProRackLeverDirectorTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:421 Top:2 Right:473 Bottom:54+ Coords = Left:430 Top:73 Right:586 Bottom:105Status = NONEEnd-MappedImage ObserverProRackDialWH+MappedImage ObserverProRackLeverDirectorHTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:476 Top:2 Right:528 Bottom:54+ Coords = Left:589 Top:73 Right:745 Bottom:105Status = NONEEnd-MappedImage ObserverProRackDialE+MappedImage ObserverProRackLeverPlayerTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:531 Top:2 Right:583 Bottom:54+ Coords = Left:748 Top:73 Right:904 Bottom:105Status = NONEEnd-MappedImage ObserverProRackDialEH+MappedImage ObserverProRackLeverPlayerHTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:586 Top:2 Right:638 Bottom:54+ Coords = Left:2 Top:128 Right:158 Bottom:160Status = NONEEnd-MappedImage ObserverProRackDialR+MappedImage ObserverProRackRockerOffTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:641 Top:2 Right:693 Bottom:54+ Coords = Left:161 Top:128 Right:207 Bottom:160Status = NONEEnd-MappedImage ObserverProRackDialRH+MappedImage ObserverProRackRockerOffHTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:696 Top:2 Right:748 Bottom:54+ Coords = Left:210 Top:128 Right:256 Bottom:160Status = NONEEnd-MappedImage ObserverProRackDialT+MappedImage ObserverProRackRockerOnTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:751 Top:2 Right:803 Bottom:54+ Coords = Left:259 Top:128 Right:305 Bottom:160Status = NONEEnd-MappedImage ObserverProRackDialTH+MappedImage ObserverProRackRockerOnHTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:806 Top:2 Right:858 Bottom:54+ Coords = Left:308 Top:128 Right:354 Bottom:160Status = NONEEnd-MappedImage ObserverProRackDialY+MappedImage ObserverProRackRowTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:861 Top:2 Right:913 Bottom:54+ Coords = Left:357 Top:128 Right:663 Bottom:158Status = NONEEnd-MappedImage ObserverProRackDialYH+MappedImage ObserverProDrawerRowTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:916 Top:2 Right:968 Bottom:54+ Coords = Left:666 Top:128 Right:942 Bottom:158Status = NONEEnd-MappedImage ObserverProRackDialA+MappedImage ObserverProRackTopTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:2 Top:73 Right:54 Bottom:125+ Coords = Left:2 Top:163 Right:308 Bottom:191Status = NONEEnd-MappedImage ObserverProRackDialAH+MappedImage ObserverProRackTabTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:57 Top:73 Right:109 Bottom:125+ Coords = Left:311 Top:163 Right:351 Bottom:189Status = NONEEnd-MappedImage ObserverProRackLeverFree+MappedImage ObserverProRackTabHTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:112 Top:73 Right:268 Bottom:105+ Coords = Left:354 Top:163 Right:394 Bottom:189Status = NONEEnd-MappedImage ObserverProRackLeverFreeH+MappedImage ObserverProRackTabOnTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:271 Top:73 Right:427 Bottom:105+ Coords = Left:397 Top:163 Right:437 Bottom:189Status = NONEEnd-MappedImage ObserverProRackLeverDirector+MappedImage ObserverProRackBottomTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:430 Top:73 Right:586 Bottom:105+ Coords = Left:440 Top:163 Right:746 Bottom:177Status = NONEEnd-MappedImage ObserverProRackLeverDirectorH+MappedImage ObserverProDrawerBottomTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:589 Top:73 Right:745 Bottom:105+ Coords = Left:2 Top:194 Right:278 Bottom:208Status = NONEEnd-MappedImage ObserverProRackLeverPlayer+MappedImage ObserverProRackTallyTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:748 Top:73 Right:904 Bottom:105+ Coords = Left:281 Top:194 Right:295 Bottom:208Status = NONEEnd-MappedImage ObserverProRackLeverPlayerH+MappedImage ObserverProDrawerTopTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:2 Top:128 Right:158 Bottom:160+ Coords = Left:298 Top:194 Right:574 Bottom:206Status = NONEEnd-MappedImage ObserverProRackRockerOff+MappedImage ObserverProRackLensTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:161 Top:128 Right:207 Bottom:160+ Coords = Left:577 Top:194 Right:582 Bottom:206Status = NONEEnd-MappedImage ObserverProRackRockerOffH+MappedImage ObserverProRackBodyTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:210 Top:128 Right:256 Bottom:160+ Coords = Left:585 Top:194 Right:891 Bottom:198Status = NONEEnd-MappedImage ObserverProRackRockerOn+MappedImage ObserverProRackMeterTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:259 Top:128 Right:305 Bottom:160+ Coords = Left:894 Top:194 Right:910 Bottom:198Status = NONEEnd-MappedImage ObserverProRackRockerOnH+MappedImage ObserverProRackStatQTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:308 Top:128 Right:354 Bottom:160+ Coords = Left:2 Top:211 Right:38 Bottom:237Status = NONEEnd-MappedImage ObserverProRackRow+MappedImage ObserverProRackStatQHTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:357 Top:128 Right:663 Bottom:158+ Coords = Left:41 Top:211 Right:77 Bottom:237Status = NONEEnd-MappedImage ObserverProDrawerRow+MappedImage ObserverProRackStatQOnTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:666 Top:128 Right:942 Bottom:158+ Coords = Left:80 Top:211 Right:116 Bottom:237Status = NONEEnd-MappedImage ObserverProRackTop+MappedImage ObserverProRackStatWTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:2 Top:163 Right:308 Bottom:191+ Coords = Left:119 Top:211 Right:155 Bottom:237Status = NONEEnd-MappedImage ObserverProRackTab+MappedImage ObserverProRackStatWHTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:311 Top:163 Right:351 Bottom:189+ Coords = Left:158 Top:211 Right:194 Bottom:237Status = NONEEnd-MappedImage ObserverProRackTabH+MappedImage ObserverProRackStatWOnTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:354 Top:163 Right:394 Bottom:189+ Coords = Left:197 Top:211 Right:233 Bottom:237Status = NONEEnd-MappedImage ObserverProRackTabOn+MappedImage ObserverProRackStatETexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:397 Top:163 Right:437 Bottom:189+ Coords = Left:236 Top:211 Right:272 Bottom:237Status = NONEEnd-MappedImage ObserverProRackBottom+MappedImage ObserverProRackStatEHTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:440 Top:163 Right:746 Bottom:177+ Coords = Left:275 Top:211 Right:311 Bottom:237Status = NONEEnd-MappedImage ObserverProDrawerBottom+MappedImage ObserverProRackStatEOnTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:2 Top:194 Right:278 Bottom:208+ Coords = Left:314 Top:211 Right:350 Bottom:237Status = NONEEnd-MappedImage ObserverProRackTally+MappedImage ObserverProRackStatRTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:281 Top:194 Right:295 Bottom:208+ Coords = Left:353 Top:211 Right:389 Bottom:237Status = NONEEnd-MappedImage ObserverProDrawerTop+MappedImage ObserverProRackStatRHTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:298 Top:194 Right:574 Bottom:206+ Coords = Left:392 Top:211 Right:428 Bottom:237Status = NONEEnd-MappedImage ObserverProRackLens+MappedImage ObserverProRackStatROnTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:577 Top:194 Right:582 Bottom:206+ Coords = Left:431 Top:211 Right:467 Bottom:237Status = NONEEnd-MappedImage ObserverProRackBody+MappedImage ObserverProRackStatTTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:585 Top:194 Right:891 Bottom:198+ Coords = Left:470 Top:211 Right:506 Bottom:237Status = NONEEnd-MappedImage ObserverProRackMeter+MappedImage ObserverProRackStatTHTexture = ReforgedHudObsSpec.tgaTextureWidth = 1024TextureHeight = 256- Coords = Left:894 Top:194 Right:910 Bottom:198+ Coords = Left:509 Top:211 Right:545 Bottom:237+ Status = NONE+End++MappedImage ObserverProRackStatTOn+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:548 Top:211 Right:584 Bottom:237+ Status = NONE+End++MappedImage ObserverProRackStatY+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:587 Top:211 Right:623 Bottom:237+ Status = NONE+End++MappedImage ObserverProRackStatYH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:626 Top:211 Right:662 Bottom:237+ Status = NONE+End++MappedImage ObserverProRackStatYOn+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:665 Top:211 Right:701 Bottom:237+ Status = NONE+End++MappedImage ObserverProRackStatA+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:704 Top:211 Right:740 Bottom:237+ Status = NONE+End++MappedImage ObserverProRackStatAH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:743 Top:211 Right:779 Bottom:237+ Status = NONE+End++MappedImage ObserverProRackStatAOn+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:782 Top:211 Right:818 Bottom:237Status = NONEEnddiff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex 758e0444c..fd442c302 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -1502,11 +1502,34 @@ GUI:HudArmies"Armies"END-// the rack's drawer of every player ranked by the dial's stat+// the rack's drawer of every player ranked by the picked statGUI:HudStandings"Standings"END+// the standings' heading when no stat key is under the pointer: the order the rows are in+GUI:HudHighestFirst+"highest first"+END++// the standings' column head over the names+GUI:HudPlayerHead+"Player"+END++// the units the standings' column head names after the stat+GUI:HudStatUnitMoney+"$"+END++GUI:HudStatUnitIncome+"$/min"+END++GUI:HudStatUnitPower+"surplus"+END+// The cheat panel the console's "trainer" command opens.GUI:CheatPanelTitle"Cheats"diff --git a/GeneralsMD/Code/Data/Russian/Generals.str b/GeneralsMD/Code/Data/Russian/Generals.strindex cd1d3f0a6..37e46f4d3 100644--- a/GeneralsMD/Code/Data/Russian/Generals.str+++ b/GeneralsMD/Code/Data/Russian/Generals.str@@ -16725,6 +16725,26 @@ GUI:HudNoWorkerLeft"У %s не осталось рабочих"END+GUI:HudHighestFirst+"по убыванию"+END++GUI:HudPlayerHead+"Игрок"+END++GUI:HudStatUnitMoney+"$"+END++GUI:HudStatUnitIncome+"$/мин"+END++GUI:HudStatUnitPower+"излишек"+END+GUI:BarIdleWorker"Рабочий"ENDdiff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex 872c15bf1..b49bed663 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -15949,6 +15949,26 @@ GUI:HudStandings"Sıralama"END+GUI:HudHighestFirst+"en yüksek üstte"+END++GUI:HudPlayerHead+"Oyuncu"+END++GUI:HudStatUnitMoney+"$"+END++GUI:HudStatUnitIncome+"$/dk"+END++GUI:HudStatUnitPower+"fazla"+END+GUI:CheatPanelTitle"Hileler"ENDdiff --git a/GeneralsMD/Code/Data/Ukrainian/Generals.str b/GeneralsMD/Code/Data/Ukrainian/Generals.strindex aacb0bdb5..c82f7a399 100644--- a/GeneralsMD/Code/Data/Ukrainian/Generals.str+++ b/GeneralsMD/Code/Data/Ukrainian/Generals.str@@ -16725,6 +16725,26 @@ GUI:HudNoWorkerLeft"У %s не лишилося робітників"END+GUI:HudHighestFirst+"за спаданням"+END++GUI:HudPlayerHead+"Гравець"+END++GUI:HudStatUnitMoney+"$"+END++GUI:HudStatUnitIncome+"$/хв"+END++GUI:HudStatUnitPower+"надлишок"+END+GUI:BarIdleWorker"Робітник"ENDdiff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.hindex 9902c5998..f7d706625 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h@@ -1045,11 +1045,11 @@ public: // ********************************************************************/// A press on the spectator's rack, at `mouse` in screen pixels: TRUE when the rack is under it,/// whatever button it was; only `act`, the left button, works its controlsBool handleSpectatorRackClick( const ICoord2D *mouse, Bool act );- /// The wheel over the rack: TRUE when the rack is under it; over the dial it steps the stat+ /// The wheel over the rack: TRUE when the rack is under it; over the standings' head it steps the statBool handleSpectatorRackWheel( const ICoord2D *mouse, Real notches );/// a command bar key while watching: TRUE when it picked a stat, Q W E R T Y A as shippedBool pickSpectatorStat( Int commandSlot );- /// a raw Q W E R T Y A press or release while watching: TRUE when the rack's dial took it+ /// a raw Q W E R T Y A press or release while watching: TRUE when the rack's stat keys took itBool pickSpectatorStatKey( Int key, Int keyState );/// Ingame video playback@@ -1514,13 +1514,14 @@ protected://// The spectator's rack (drawSpectatorRack), drawers hung off the right edge under the superweapon// tray while the local player watches: the camera, the fog and the armies drawer, then every- // player ranked by the stat on the dial. Where the last draw put it, for the clicks.+ // player ranked by the stat its keys pick. Where the last draw put it, for the clicks.//enum { RACK_ROWS = 8, RACK_ARMY_UNITS = 6 };enum{RACK_TEXT_WATCH, RACK_TEXT_STANDINGS, RACK_TEXT_STOP, RACK_TEXT_FOG = RACK_TEXT_STOP + 3, RACK_TEXT_ARMIES,- RACK_TEXT_KEY, RACK_TEXT_STAT = RACK_TEXT_KEY + 7, RACK_TEXT_STAT_KEY, RACK_TEXT_NAME,+ RACK_TEXT_KEY, RACK_TEXT_STAT = RACK_TEXT_KEY + 7, RACK_TEXT_HINT, RACK_TEXT_PLACE_HEAD, RACK_TEXT_PLAYER_HEAD,+ RACK_TEXT_VALUE_HEAD, RACK_TEXT_PLACE, RACK_TEXT_NAME = RACK_TEXT_PLACE + RACK_ROWS,RACK_TEXT_VALUE = RACK_TEXT_NAME + RACK_ROWS, RACK_TEXT_UNITS = RACK_TEXT_VALUE + RACK_ROWS,RACK_TEXT_COUNT = RACK_TEXT_UNITS + RACK_ROWS * RACK_ARMY_UNITS};@@ -1532,7 +1533,7 @@ protected:Int m_rackX, m_rackY; ///< its pieces' left and the watch drawer's topInt m_rackRows;Int m_rackRowPlayer[ RACK_ROWS ]; ///< the player index on each row, top down- Int m_rackStat; ///< SPECTATOR_STATS index on the dial+ Int m_rackStat; ///< the picked SPECTATOR_STATS indexBool m_rackArmies; ///< the armies drawer is outDisplayString * m_rackText[ RACK_TEXT_COUNT ];Int m_rackTextPx[ RACK_TEXT_COUNT ]; ///< the size and room each was laid out fordiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex b2774ae41..9318e4316 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -2127,23 +2127,25 @@ struct SpectatorStatsstd::map< const ThingTemplate *, Int > units; ///< how many of each unit with a cameo he has standing};-/** One stop of the rack's stat dial: the label it goes by and the number the list is ranked by when- * it is picked, in the order of the keys that pick them (pickSpectatorStat). */+/** One of the rack's stat keys: the label it goes by, the unit its column head names (none where the+ * label or the number already says it: kills and losses, "Rank 3") and the number the list is ranked by when it is picked, in the+ * order of the keys that pick them (pickSpectatorStat). */struct SpectatorStat{const char *label;+ const char *unit;Int SpectatorStats::*value;};static const SpectatorStat SPECTATOR_STATS[] ={- { "GUI:HudNetWorth", &SpectatorStats::networth },- { "GUI:HudStatCash", &SpectatorStats::cash },- { "GUI:HudStatIncome", &SpectatorStats::income },- { "GUI:HudStatArmy", &SpectatorStats::army },- { "GUI:HudStatKills", &SpectatorStats::kills },- { "GUI:HudStatRank", &SpectatorStats::rank },- { "GUI:HudStatPower", &SpectatorStats::power }+ { "GUI:HudNetWorth", "GUI:HudStatUnitMoney", &SpectatorStats::networth },+ { "GUI:HudStatCash", "GUI:HudStatUnitMoney", &SpectatorStats::cash },+ { "GUI:HudStatIncome", "GUI:HudStatUnitIncome", &SpectatorStats::income },+ { "GUI:HudStatArmy", "GUI:HudStatUnitMoney", &SpectatorStats::army },+ { "GUI:HudStatKills", NULL, &SpectatorStats::kills },+ { "GUI:HudStatRank", NULL, &SpectatorStats::rank },+ { "GUI:HudStatPower", "GUI:HudStatUnitPower", &SpectatorStats::power }};enum { SPECTATOR_STAT_COUNT = ARRAY_SIZE( SPECTATOR_STATS ) };@@ -2516,7 +2518,7 @@ void InGameUI::runSpectatorAction( const std::string &action )// The spectator's rack: drawers hung off the right edge under the superweapon tray, cut from one// reference drawer (ReforgedHudObsSpec, Tools/hud_command_bar.py paint_rack, every piece named// ObserverPro<piece>). A watch drawer with the camera's three-stop lever and the fog and armies-// rockers, a standings drawer with the stat dial and a row a player, an index tab out of each row+// rockers, a standings drawer with seven stat keys and a row a player, an index tab out of each row// to follow him, and the armies drawer out to the left on its runners. Every number is a pixel at// 1080 (experiments/proofs/2026-11-02/hud-original/round12/SPEC.md), put through rackPx.//-------------------------------------------------------------------------------------------------@@ -2537,11 +2539,15 @@ enumRACK_DRAWER_TUCK = 20, ///< the armies drawer's right end under the standingsRACK_DRAWER_TOP_H = 12,RACK_TAB_OUT = 26, ///< a follow tab's left past what it hangs from- RACK_DIAL_X = 56,- RACK_DIAL_Y = 64, ///< the dial's centre in the standings drawer- RACK_DIAL_REACH = 40,- RACK_DIAL_RADIUS = 33, ///< the key letters round it- RACK_DIAL_HALF = 26,+ RACK_KEY_LEFT = 23, ///< the first stat key in the standings drawer+ RACK_KEY_TOP = 31,+ RACK_KEY_W = 36,+ RACK_KEY_H = 26,+ RACK_KEY_PITCH = 39,+ RACK_WELL_LEFT = 20, ///< a standings row's well, which the hover and follow rims trace+ RACK_WELL_RIGHT = 296,+ RACK_WELL_TOP = 2,+ RACK_WELL_BOTTOM = 28,RACK_MIN_PX = 9, ///< the smallest a shrunk label goesRACK_LEVER_WELL_LEFT = 22, ///< the lever's well inside its bevel, which the stop words keep insideRACK_LEVER_WELL_RIGHT = 166,@@ -2549,13 +2555,13 @@ enumRACK_REFRESH_FRAMES = LOGICFRAMES_PER_SECOND / 2};-static const char RACK_KEYS[] = "QWERTYA"; ///< the dial's stops, the letters pickSpectatorStatKey answers+static const char RACK_KEYS[] = "QWERTYA"; ///< the stat keys' letters, the ones pickSpectatorStatKey answersstatic const Int RACK_LEVER_STOPS[ 3 ] = { 38, 94, 150 }; ///< Free, Director, Player, as ObserverCameraMode countsstatic const char *const RACK_LEVERS[ 3 ] = { "RackLeverFree", "RackLeverDirector", "RackLeverPlayer" };static const char *const RACK_LEVER_LABELS[ 3 ] = { "GUI:HudCameraFree", "GUI:HudCameraDirector", "GUI:HudCameraPlayer" };static const std::string *const RACK_CAMERAS[ 3 ] = { &CAMERA_FREE, &CAMERA_DIRECTOR, &CAMERA_PLAYER };-static std::vector< SpectatorStats > theRackStats; ///< ranked by the dial's stat, gathered every RACK_REFRESH_FRAMES+static std::vector< SpectatorStats > theRackStats; ///< ranked by the picked stat, gathered every RACK_REFRESH_FRAMESstatic UnsignedInt theRackStatsFrame = 0;static Int theRackStatsStat = -1;@@ -2622,39 +2628,26 @@ static Bool rackInside( const ICoord2D &mouse, Int left, Int top, Int right, Intreturn mouse.x >= left && mouse.x < right && mouse.y >= top && mouse.y < bottom;}-/// the dial's key whose stop is nearest the pointer's angle round the centre, clockwise from up-static Int rackDialKey( const ICoord2D &mouse, const ICoord2D ¢re )+/// a stat key's left edge+static Int rackKeyLeft( const RackPlace &at, Int key ){- const Real angle = atan2f( (Real)( mouse.x - centre.x ), (Real)( centre.y - mouse.y ) ) * 180.0f / PI;- Int best = 0;- Real bestGap = 360.0f;- for( Int key = 0; key < SPECTATOR_STAT_COUNT; key++ )- {- Real gap = fabsf( angle - ( -135.0f + 45.0f * key ) );- if( gap > 180.0f )- gap = 360.0f - gap;- if( gap < bestGap )- {- best = key;- bestGap = gap;- }- }- return best;+ return at.x + rackPx( RACK_KEY_LEFT + RACK_KEY_PITCH * key );}-static ICoord2D rackDialCentre( const RackPlace &at )+/// the stat key under the pointer, or -1+static Int rackKeyAt( const ICoord2D &mouse, const RackPlace &at ){- ICoord2D centre;- centre.x = at.x + rackPx( RACK_DIAL_X );- centre.y = at.standings + rackPx( RACK_DIAL_Y );- return centre;+ const Int top = at.standings + rackPx( RACK_KEY_TOP ), bottom = at.standings + rackPx( RACK_KEY_TOP + RACK_KEY_H );+ for( Int key = 0; key < SPECTATOR_STAT_COUNT; key++ )+ if( rackInside( mouse, rackKeyLeft( at, key ), top, rackKeyLeft( at, key ) + rackPx( RACK_KEY_W ), bottom ) )+ return key;+ return -1;}-static Bool rackOverDial( const ICoord2D &mouse, const RackPlace &at )+/// the standings' head, keys, heading and column heads, where the wheel steps the stat+static Bool rackOverHead( const ICoord2D &mouse, const RackPlace &at ){- const ICoord2D centre = rackDialCentre( at );- const Int dx = mouse.x - centre.x, dy = mouse.y - centre.y, reach = rackPx( RACK_DIAL_REACH );- return dx * dx + dy * dy <= reach * reach;+ return rackInside( mouse, at.x + rackPx( RACK_WELL_LEFT ), at.standings + rackPx( RACK_HEAD_TOP ), at.right, at.rows );}/// the player's colour, opaque: the tint the lens, the meter and the name take@@ -2732,7 +2725,7 @@ DisplayString *InGameUI::rackText( Int slot, const UnicodeString &text, Int px,//-------------------------------------------------------------------------------------------------/** The rack, while the local player watches. plateTop is where the watch drawer's plate starts:* 8 under the superweapon tray's foot, or under the info strip with no superweapons up. Every- * player is read at most twice a second, ranked by the dial's stat, the watcher left out. Drawn+ * player is read at most twice a second, ranked by the picked stat, the watcher left out. Drawn* in the order the pieces overlap: the tabs, the armies drawer, the watch drawer, the standings,* then every word and number. *///-------------------------------------------------------------------------------------------------@@ -2750,6 +2743,7 @@ void InGameUI::drawSpectatorRack( Int plateTop )const Color WHITE = GameMakeColor( 240, 244, 246, 255 );const Color LIT = GameMakeColor( 128, 149, 234, 255 );const Color GOLD = GameMakeColor( 242, 194, 48, 255 );+ const Color DIM = GameMakeColor( 92, 100, 110, 255 );m_rackX = TheDisplay->getWidth() - rackPx( RACK_W );m_rackY = plateTop - rackPx( RACK_SKIRT );@@ -2770,6 +2764,8 @@ void InGameUI::drawSpectatorRack( Int plateTop )typedef std::pair< const ThingTemplate *, Int > UnitCount;std::vector< UnitCount > units[ RACK_ROWS ];+ Bool rowHover[ RACK_ROWS ];+TheDisplay->beginBatch2D();for( Int row = 0; row < rows; row++ ){@@ -2778,6 +2774,7 @@ void InGameUI::drawSpectatorRack( Int plateTop )m_rackRowPlayer[ row ] = player->getPlayerIndex();const Bool on = m_rackRowPlayer[ row ] == followed;const Bool hover = !on && rackInside( mouse, at.tabs + rackTabOut( FALSE, TRUE ), top + rackPx( 3 ), at.right, top + rackPx( 27 ) );+ rowHover[ row ] = hover;drawRackPiece( on ? "RackTabOn" : ( hover ? "RackTabH" : "RackTab" ), at.tabs, top + rackPx( 2 ) );const Color colour = rackColour( player );drawRackPiece( "RackLens", at.tabs + rackTabOut( on, hover ) + rackPx( 4 ), top + rackPx( 9 ), 0, 0, colour );@@ -2818,31 +2815,47 @@ void InGameUI::drawSpectatorRack( Int plateTop )drawRackState( fog ? "RackRockerOn" : "RackRockerOff", overFog, X + rackPx( 186 ), Y + rackPx( 30 ) );drawRackState( m_rackArmies ? "RackRockerOn" : "RackRockerOff", overArmies, X + rackPx( 246 ), Y + rackPx( 30 ) );- // the standings: the dial at the stat, a row a player with his emblem and his meter- const Bool overDial = rackOverDial( mouse, at );- const ICoord2D centre = rackDialCentre( at );- const Int hoverKey = overDial ? rackDialKey( mouse, centre ) : -1;+ // the standings: the seven stat keys, a row a player with his colour, emblem and meter+ const Int hoverKey = rackKeyAt( mouse, at );drawRackPiece( "RackTop", X, Y2 );drawRackPiece( "RackHead", X, Y2 + rackPx( RACK_HEAD_TOP ) );for( Int row = 0; row < rows; row++ )drawRackPiece( "RackRow", X, rowTop( row ) );drawRackPiece( "RackBottom", X, rowTop( rows ) );- AsciiString dial;- dial.format( "RackDial%c", RACK_KEYS[ m_rackStat ] );- drawRackState( dial.str(), overDial, centre.x - rackPx( RACK_DIAL_HALF ), centre.y - rackPx( RACK_DIAL_HALF ) );+ for( Int key = 0; key < SPECTATOR_STAT_COUNT; key++ )+ {+ AsciiString piece;+ piece.format( "RackStat%c%s", RACK_KEYS[ key ], key == m_rackStat ? "On" : ( key == hoverKey ? "H" : "" ) );+ drawRackPiece( piece.str(), rackKeyLeft( at, key ), Y2 + rackPx( RACK_KEY_TOP ) );+ }for( Int row = 0; row < rows; row++ ){const Int top = rowTop( row );const SpectatorStats &stats = theRackStats[ row ];+ const Color colour = rackColour( stats.player );+ drawRackPiece( "RackMeter", X + rackPx( 22 ), top + rackPx( 4 ), rackPx( 3 ), rackPx( 22 ), colour );TheDisplay->drawImage( ControlBarSideEmblem( stats.player->getPlayerTemplate() ),- X + rackPx( 23 ), top + rackPx( 5 ), X + rackPx( 53 ), top + rackPx( 25 ) );+ X + rackPx( 42 ), top + rackPx( 5 ), X + rackPx( 72 ), top + rackPx( 25 ) );const Real share = max( stats.*SPECTATOR_STATS[ m_rackStat ].value, 0 ) / (Real)highest;- const Int fill = REAL_TO_INT_FLOOR( rackPx( 234 ) * share );+ const Int fill = REAL_TO_INT_FLOOR( rackPx( 216 ) * share );if( fill > 0 )- drawRackPiece( "RackMeter", X + rackPx( 59 ), top + rackPx( 23 ), fill, rackPx( 2 ), rackColour( stats.player ) );+ drawRackPiece( "RackMeter", X + rackPx( 76 ), top + rackPx( 23 ), fill, rackPx( 2 ), colour );}TheDisplay->endBatch2D();+ // the followed row in a double lit rim round its well, the row under the pointer in a gold one+ for( Int row = 0; row < rows; row++ )+ {+ const Bool on = m_rackRowPlayer[ row ] == followed;+ if( !on && !rowHover[ row ] )+ continue;+ const Int left = X + rackPx( RACK_WELL_LEFT ), top = rowTop( row ) + rackPx( RACK_WELL_TOP );+ const Int width = rackPx( RACK_WELL_RIGHT - RACK_WELL_LEFT ), height = rackPx( RACK_WELL_BOTTOM - RACK_WELL_TOP );+ TheDisplay->drawOpenRect( left, top, width, height, 1.0f, on ? LIT : GOLD );+ if( on )+ TheDisplay->drawOpenRect( left + 1, top + 1, width - 2, height - 2, 1.0f, GameMakeColor( 128, 149, 234, 160 ) );+ }+// the words, all upper case but the names and the numbersdrawRackText( rackText( RACK_TEXT_WATCH, UIStyle::capitals( TheGameText->fetch( "GUI:HudWatch" ) ), 12, 0 ),X + rackPx( 24 ), Y + rackPx( 9 ), X + rackPx( 180 ), Y + rackPx( 23 ), rackPx( 8 ), RACK_ALIGN_LEFT, GREY );@@ -2873,32 +2886,57 @@ void InGameUI::drawSpectatorRack( Int plateTop )drawRackText( rackText( RACK_TEXT_STANDINGS, UIStyle::capitals( TheGameText->fetch( "GUI:HudStandings" ) ), 12, 0 ),X + rackPx( 24 ), Y2 + rackPx( 9 ), X + rackPx( 180 ), Y2 + rackPx( 23 ), rackPx( 8 ), RACK_ALIGN_LEFT, GREY );+ // each key's letter small in its bottom right cornerfor( Int key = 0; key < SPECTATOR_STAT_COUNT; key++ ){- const Real angle = ( -135.0f + 45.0f * key ) * PI / 180.0f;- const Int x = centre.x + rackPx( RACK_DIAL_RADIUS * Sin( angle ) );- const Int y = centre.y - rackPx( RACK_DIAL_RADIUS * Cos( angle ) );UnicodeString letter;letter.format( u"%c", (WideChar)RACK_KEYS[ key ] );- drawRackText( rackText( RACK_TEXT_KEY + key, letter, 13, 0 ), x - rackPx( 8 ), y - rackPx( 8 ), x + rackPx( 8 ), y + rackPx( 8 ), 0,- RACK_ALIGN_CENTRE, key == m_rackStat ? LIT : ( key == hoverKey ? GOLD : GREY ) );- }- const Int statLeft = X + rackPx( 104 ), statTop = Y2 + rackPx( 46 ), statRight = X + rackPx( 294 ), statBottom = Y2 + rackPx( 78 );- drawRackText( rackText( RACK_TEXT_STAT, UIStyle::capitals( TheGameText->fetch( SPECTATOR_STATS[ m_rackStat ].label ) ), 15,- statRight - statLeft - rackPx( 40 ) ), statLeft, statTop, statRight, statBottom, rackPx( 10 ), RACK_ALIGN_LEFT, LIT );- UnicodeString statKey;- statKey.format( u"%c", (WideChar)RACK_KEYS[ m_rackStat ] );- drawRackText( rackText( RACK_TEXT_STAT_KEY, statKey, 13, 0 ), statLeft, statTop, statRight, statBottom, rackPx( 10 ), RACK_ALIGN_RIGHT, GREY );+ const Int right = rackKeyLeft( at, key ) + rackPx( RACK_KEY_W - 1 ), bottom = Y2 + rackPx( RACK_KEY_TOP + RACK_KEY_H - 1 );+ drawRackText( rackText( RACK_TEXT_KEY + key, letter, 8, 0 ), right - rackPx( 8 ), bottom - rackPx( 9 ), right, bottom, 0,+ RACK_ALIGN_CENTRE, key == m_rackStat ? GREY : DIM );+ }+ // the heading: the picked stat by name; on its right the key under the pointer, or the order+ const SpectatorStat &stat = SPECTATOR_STATS[ m_rackStat ];+ const UnicodeString statName = UIStyle::capitals( TheGameText->fetch( stat.label ) );+ UnicodeString hint;+ if( hoverKey >= 0 )+ hint.format( u"%ls (%c)", TheGameText->fetch( SPECTATOR_STATS[ hoverKey ].label ).str(), (WideChar)RACK_KEYS[ hoverKey ] );+ else+ hint = TheGameText->fetch( "GUI:HudHighestFirst" );+ DisplayString *hintText = rackText( RACK_TEXT_HINT, hint, 9, rackPx( 144 ) );+ Int hintWidth = 0, hintHeight = 0;+ hintText->getSize( &hintWidth, &hintHeight );+ drawRackText( hintText, X + rackPx( 150 ), Y2 + rackPx( 60 ), X + rackPx( 294 ), Y2 + rackPx( 76 ), 0, RACK_ALIGN_RIGHT,+ hoverKey >= 0 ? GOLD : DIM );+ drawRackText( rackText( RACK_TEXT_STAT, statName, 13,+ rackPx( 294 - 22 - 8 ) - hintWidth ), X + rackPx( 22 ), Y2 + rackPx( 60 ), X + rackPx( 294 ), Y2 + rackPx( 76 ), 0, RACK_ALIGN_LEFT, WHITE );+ // the column heads: place, player, and the stat with its unit over the numbers+ UnicodeString valueHead = statName;+ if( stat.unit != NULL )+ valueHead.format( u"%ls (%ls)", statName.str(), TheGameText->fetch( stat.unit ).str() );+ const Int headTop = Y2 + rackPx( 79 ), headBottom = Y2 + rackPx( 93 );+ drawRackText( rackText( RACK_TEXT_PLACE_HEAD, UnicodeString( u"#" ), 9, 0 ), X + rackPx( 22 ), headTop, X + rackPx( 38 ), headBottom, 0,+ RACK_ALIGN_CENTRE, DIM );+ drawRackText( rackText( RACK_TEXT_PLAYER_HEAD, UIStyle::capitals( TheGameText->fetch( "GUI:HudPlayerHead" ) ), 9, rackPx( 60 ) ),+ X + rackPx( 76 ), headTop, X + rackPx( 136 ), headBottom, 0, RACK_ALIGN_LEFT, DIM );+ drawRackText( rackText( RACK_TEXT_VALUE_HEAD, valueHead, 9, rackPx( 154 ) ), X + rackPx( 140 ), headTop, X + rackPx( 294 ), headBottom, 0,+ RACK_ALIGN_RIGHT, GREY );for( Int row = 0; row < rows; row++ ){const Int top = rowTop( row );const SpectatorStats &stats = theRackStats[ row ];- drawRackText( rackText( RACK_TEXT_NAME + row, stats.player->getPlayerDisplayName(), 13, rackPx( 118 - 12 ) ),- X + rackPx( 58 ), top + rackPx( 4 ), X + rackPx( 176 ), top + rackPx( 19 ), rackPx( 6 ), RACK_ALIGN_LEFT,- rackColour( stats.player ) );- drawRackText( rackText( RACK_TEXT_VALUE + row, rackValueText( m_rackStat, stats ), 14, rackPx( 114 - 12 ) ),- X + rackPx( 180 ), top + rackPx( 4 ), X + rackPx( 294 ), top + rackPx( 19 ), rackPx( 6 ), RACK_ALIGN_RIGHT, WHITE );+ UnicodeString place;+ place.format( u"%d", row + 1 );+ drawRackText( rackText( RACK_TEXT_PLACE + row, place, 12, 0 ), X + rackPx( 26 ), top + rackPx( 2 ), X + rackPx( 40 ), top + rackPx( 28 ), 0,+ RACK_ALIGN_CENTRE, row == 0 ? WHITE : GREY );+ // the number first, so the name gets the room it leaves+ DisplayString *value = rackText( RACK_TEXT_VALUE + row, rackValueText( m_rackStat, stats ), 14, rackPx( 114 - 12 ) );+ Int valueWidth = 0, valueHeight = 0;+ value->getSize( &valueWidth, &valueHeight );+ drawRackText( value, X + rackPx( 180 ), top + rackPx( 2 ), X + rackPx( 294 ), top + rackPx( 22 ), rackPx( 4 ), RACK_ALIGN_RIGHT, WHITE );+ drawRackText( rackText( RACK_TEXT_NAME + row, stats.player->getPlayerDisplayName(), 13, rackPx( 290 - 76 - 6 ) - valueWidth ),+ X + rackPx( 76 ), top + rackPx( 2 ), X + rackPx( 190 ), top + rackPx( 22 ), 0, RACK_ALIGN_LEFT, rackColour( stats.player ) );// each kind's count on a dark plate in its cell's bottom rightfor( Int cell = 0; cell < (Int)units[ row ].size(); cell++ )@@ -2967,8 +3005,9 @@ Bool InGameUI::handleSpectatorRackClick( const ICoord2D *mouse, Bool act )if( rackInside( *mouse, X + rackPx( RACK_SKIRT ), at.standings + rackPx( RACK_SKIRT ), at.right, foot ) ){- if( act && rackOverDial( *mouse, at ) )- m_rackStat = rackDialKey( *mouse, rackDialCentre( at ) );+ const Int key = rackKeyAt( *mouse, at );+ if( act && key >= 0 )+ m_rackStat = key;return TRUE;}@@ -2979,15 +3018,15 @@ Bool InGameUI::handleSpectatorRackWheel( const ICoord2D *mouse, Real notches ){if( !handleSpectatorRackClick( mouse, FALSE ) )return FALSE;- // down the wheel is round the dial clockwise, the next key- if( notches != 0.0f && rackOverDial( *mouse, rackPlace( m_rackX, m_rackY, m_rackArmies ) ) )+ // down the wheel is the next key to the right, round to the first after the last+ if( notches != 0.0f && rackOverHead( *mouse, rackPlace( m_rackX, m_rackY, m_rackArmies ) ) )m_rackStat = ( m_rackStat + ( notches < 0.0f ? 1 : SPECTATOR_STAT_COUNT - 1 ) ) % SPECTATOR_STAT_COUNT;return TRUE;}//--------------------------------------------------------------------------------------------------/** The command grid's first keys while the rack is up, Q W E R T Y A as shipped, pick the dial's- * stats in its order. A watcher has no commands to press; anything past the last stat is left to+/** The command grid's first keys while the rack is up, Q W E R T Y A as shipped, pick the stat+ * keys' stats in their order. A watcher has no commands to press; anything past the last stat is left to* the command bar. *///-------------------------------------------------------------------------------------------------Bool InGameUI::pickSpectatorStat( Int commandSlot )@@ -3000,7 +3039,7 @@ Bool InGameUI::pickSpectatorStat( Int commandSlot )}//--------------------------------------------------------------------------------------------------/** The same keys as letters, so the dial answers Q W E R T Y A with no CommandMap binding: the+/** The same keys as letters, so the stat keys answer Q W E R T Y A with no CommandMap binding: the* shipped one binds no command slot to a letter. A plain press only, while the rack is up and the* local player watches; a player's letters never come here. *///-------------------------------------------------------------------------------------------------diff --git a/GeneralsMD/Code/Tools/hud_command_bar.py b/GeneralsMD/Code/Tools/hud_command_bar.pyindex 20508ec52..0b2041882 100644--- a/GeneralsMD/Code/Tools/hud_command_bar.py+++ b/GeneralsMD/Code/Tools/hud_command_bar.py@@ -2991,8 +2991,8 @@ def observer_radar_frame():# The spectator's controls (InGameUI's runSpectatorAction, gatherSpectatorStats), round 11's concept 2,# approved on 2026-11-03: drawers hung off the right edge 8 px under the superweapon tray's foot. A watch-# drawer with a three way camera lever and a fog rocker, a standings drawer with a rotary stat dial and-# its rows, an index tab out of each row to follow that player, and an armies drawer sliding out left on+# drawer with a three way camera lever and a fog rocker, a standings drawer with seven stat keys (round+# 21, owner's pick C, in place of round 11's rotary dial) and its rows, an index tab out of each row to follow that player, and an armies drawer sliding out left on# two runners. Each drawer is drawn whole round two reference rows, lit with no top to bottom falloff,# and cut into the slices the code stacks (a cap, a head, a row it repeats, a plain body, a foot); every# control is a piece of its own in each state. The code writes every word and number and tints the@@ -3046,13 +3046,20 @@ def white_lens(w, h):RACK_W, RACK_TOP, RACK_HEAD, RACK_PITCH, RACK_FOOT = 306, 28, 68, 30, 14RACK_AT = 1920 - RACK_W-RACK_ROW = dict(emblem=(22, 4, 54, 26), name=(58, 4, 176, 19), value=(180, 4, 294, 19), meter=(58, 22, 294, 26))-RACK_HEAD_AT = dict(dial=(56, 36), stat=(104, 18, 294, 50))-RACK_DIAL_R, RACK_LETTER_R = 25, 33 # the dial's socket, and the radius the code writes the keys at+# a standings row (round 21, owner's pick C): one well, the player's colour as a stripe at its left, his place,+# emblem, name and number, a meter of his share under the name; the code paints and writes all of it+RACK_ROW = dict(well=(20, 2, 296, 28), stripe=(22, 4, 25, 26), place=(26, 2, 40, 28), emblem=(42, 5, 72, 25),+ name=(76, 2, 190, 22), value=(180, 2, 294, 22), meter=(76, 23, 292, 25))+# the head: seven stat keys in a row, the picked stat's name as a heading, the column heads over a hairline+RACK_STAT_KEYS = "QWERTYA"+RACK_STAT_W, RACK_STAT_PITCH = 36, 39+RACK_STAT_AT = [(23 + RACK_STAT_PITCH * i, 3, 23 + RACK_STAT_PITCH * i + RACK_STAT_W, 29) for i in range(len(RACK_STAT_KEYS))]+RACK_HEAD_AT = dict(heading=(22, 32, 294, 48), columns=(22, 51, 294, 65), rule=(22, 65, 294, 66))+# the code's text colours (InGameUI drawSpectatorRack), which the keys' glyphs and rims match+RACK_GREY, RACK_WHITE, RACK_LIT, RACK_GOLD = (138, 148, 159), (240, 244, 246), (128, 149, 234), (242, 194, 48)RACK_LABEL = (24, 9, 180, 23)DRAWER_W, DRAWER_TOP = 276, 12DRAWER_CAMEOS = [(22 + 39 * i, 3, 58 + 39 * i, 27) for i in range(6)] # all six clear of the standings' edge-DIAL_ANGLES = [-135, -90, -45, 0, 45, 90, 135] # Q W E R T Y A, clockwise from straight up# the follow tab: its size, and where its body starts in it by state (the rest tucks under the drawer)RACK_TAB = (40, 26)RACK_TAB_OUT = {"": 22, "H": 15, "On": 2}@@ -3060,7 +3067,7 @@ RACK_TAB_OUT = {"": 22, "H": 15, "On": 2}def rack_reference(rows=2, body=12):"""A drawer with everything a slice is cut from: the cap with its label, the standings' head with the- dial's socket, rows, a plain body for the watch drawer, and the foot. The GLA's (round 20): the cap a+ stat keys' wells and the column heads' rule, rows, a plain body for the watch drawer, and the foot. The GLA's (round 20): the cap aragged ledge of scrap standing out past the drawer toward the field with a patch welded on crooked, thedrawer's corners cut unevenly, its head's edge bitten, odd bolts. The rows and the body keep a straightedge, since the code repeats and stretches them."""@@ -3084,16 +3091,14 @@ def rack_reference(rows=2, body=12):p.weld(a, c, seed=171 + int(a[0]), r=1.1)p.bolt(200, 13, 2.4, 9)hy = RACK_TOP- cx, cy = RACK_HEAD_AT["dial"]- p.sink([regular(cx, hy + cy, RACK_DIAL_R, 40)], 2.0, 1.2, DARK)- s = RACK_HEAD_AT["stat"]- p.sink([shape(b, s[0], hy + s[1], s[2], hy + s[3], 4)], 4, 1.6)- p.inlay([plate(20, hy + RACK_HEAD - 2, 296, hy + RACK_HEAD - 1)], INKM, 0.8)+ for x0, y0, x1, y1 in RACK_STAT_AT:+ p.sink([shape(b, x0 + 1.5, hy + y0, x1 - 1.5, hy + y1, 3)], 3, 1.2)+ r = RACK_HEAD_AT["rule"]+ p.inlay([plate(r[0], hy + r[1], r[2], hy + r[3])], INKM, 0.4)for k in range(rows):y0 = RACK_TOP + RACK_HEAD + k * RACK_PITCH- for name, depth in (("emblem", 3), ("name", 2), ("value", 4), ("meter", 2)):- r = RACK_ROW[name]- p.sink([shape(b, r[0], r[1] + y0, r[2], r[3] + y0, 3 if name != "meter" else 1.5)], depth, 1.2)+ r = RACK_ROW["well"]+ p.sink([shape(b, r[0], r[1] + y0, r[2], r[3] + y0, 3)], 4, 1.6)p.weld((60, H - 10.5), (250, H - 10.5), 181)p.bolt(30, H - 11, 2.6, 10)p.bolt(282, H - 11, 3.0, 11)@@ -3155,24 +3160,6 @@ def rocker(on, state):return lit(w, h, draw)-def dial(position, state):- """The stat dial: a face with seven ticks round three quarters of a turn and a knurled knob pointing- at one; the code writes Q W E R T Y A at the ticks' ends."""- w = h = 52- c = w / 2-- def draw(p):- p.raise_plate([regular(c, c, RACK_DIAL_R - 2, 40)], 1.0, 0.8, DARK)- for i, a in enumerate(DIAL_ANGLES):- tick = rotated(plate(c - 0.7, c - 22, c + 0.7, c - 17.5), c, c, a)- p.inlay([tick], HILITE if i == position else PAPERM, 0.3)- p.raise_plate([regular(c, c, 15, 40)], 4.5, 1.0, BRIGHT if state == "H" else STEEL, profile=rounded(4.0))- notches = [rotated(plate(c - 0.8, c - 15.2, c + 0.8, c - 13.4), c, c, k * 360 / 20) for k in range(20)]- p.inlay(notches, INKM, 0.6)- p.inlay([rotated(plate(c - 1.0, c - 12, c + 1.0, c - 4), c, c, DIAL_ANGLES[position])], HILITE, 0.4)- return lit(w, h, draw)--def index_tab(state):"""A follow tab out of a row's left end, tucked under the drawer: short, longer when hovered, pulledright out with its lamp on air when that player is followed. The code lights the lens in his colour."""@@ -3189,6 +3176,49 @@ def index_tab(state):return lit(w, h, draw)+def stat_glyph(stat, cx, cy):+ """A stat's mark, about 18 x 14 round (cx, cy), as polygons: net worth a stack of coins, cash a note,+ income a rising arrow, army a tank side on, kills a reticle, rank three chevrons, power a bolt."""+ if stat == 0:+ return [plate(cx - 7 + i, cy + 4 - 4.5 * i, cx + 7 - i, cy + 6.5 - 4.5 * i) for i in range(3)]+ if stat == 1:+ return [plate(cx - 9, cy - 5, cx + 9, cy - 3), plate(cx - 9, cy + 3, cx + 9, cy + 5), plate(cx - 9, cy - 5, cx - 7, cy + 5),+ plate(cx + 7, cy - 5, cx + 9, cy + 5), regular(cx, cy, 2.4, 10)]+ if stat == 2:+ return stroke([(cx - 8, cy + 5), (cx - 2, cy - 1), (cx + 2, cy + 3), (cx + 7, cy - 3)], 2.2) + [+ [(cx + 9, cy - 6), (cx + 9, cy + 1), (cx + 2, cy - 6)]]+ if stat == 3:+ return [plate(cx - 9, cy + 1, cx + 9, cy + 6), plate(cx - 5, cy - 3, cx + 4, cy + 1), plate(cx + 3, cy - 2, cx + 10, cy - 1)]+ if stat == 4:+ return ring(cx, cy, 5.5, 1.6, 20) + [plate(cx - 9, cy - 0.8, cx - 3, cy + 0.8), plate(cx + 3, cy - 0.8, cx + 9, cy + 0.8),+ plate(cx - 0.8, cy - 8, cx + 0.8, cy - 3), plate(cx - 0.8, cy + 3, cx + 0.8, cy + 8)]+ if stat == 5:+ return [[(cx - 7, cy - 4 + 4 * i), (cx, cy - 8 + 4 * i), (cx + 7, cy - 4 + 4 * i), (cx + 7, cy - 2 + 4 * i),+ (cx, cy - 6 + 4 * i), (cx - 7, cy - 2 + 4 * i)] for i in range(3)]+ return [[(cx + 2, cy - 8), (cx - 5, cy + 1), (cx, cy + 1), (cx - 2, cy + 8), (cx + 5, cy - 1), (cx, cy - 1)]]+++def stat_key(ref, stat, state):+ """One of the standings' seven stat keys, cut from the head where its well is so it meets the plate round+ it, its glyph laid on flat: grey, gold under the pointer, and white in a lit rim with a lit underline when+ it is the picked stat. The code writes the key's letter in its bottom right corner."""+ x0, y0, x1, y1 = RACK_STAT_AT[stat]+ w, h = x1 - x0, y1 - y0+ img = ref.crop((x0, RACK_TOP + y0, x1, RACK_TOP + y1))+ ss = 4 # the glyph drawn 4 times over and box filtered+ mask = Image.new("L", (w * ss, h * ss), 0)+ d = ImageDraw.Draw(mask)+ for poly in stat_glyph(stat, w / 2, h / 2 - 1):+ d.polygon([(x * ss, y * ss) for x, y in poly], fill=255)+ colour = {"": RACK_GREY, "H": RACK_GOLD, "On": RACK_WHITE}[state]+ img.paste(Image.new("RGBA", (w, h), colour + (255,)), (0, 0), mask.resize((w, h), Image.BOX))+ if state == "On":+ d = ImageDraw.Draw(img)+ d.rectangle((2, 1, w - 3, h - 2), outline=RACK_LIT + (255,))+ d.rectangle((6, h - 4, w - 7, h - 3), fill=RACK_LIT + (255,))+ return img++def rack_pieces():ref, H = rack_reference()rows_at = RACK_TOP + RACK_HEAD@@ -3207,9 +3237,9 @@ def rack_pieces():for on in (False, True):for st in ("", "H"):out["RackRocker%s%s" % ("On" if on else "Off", st)] = rocker(on, st)- for i, key in enumerate("QWERTYA"):- for st in ("", "H"):- out["RackDial%s%s" % (key, st)] = dial(i, st)+ for i, key in enumerate(RACK_STAT_KEYS):+ for st in ("", "H", "On"):+ out["RackStat%s%s" % (key, st)] = stat_key(ref, i, st)for st in ("", "H", "On"):out["RackTab" + st] = index_tab(st)@@ -3236,6 +3266,15 @@ def paint_rack():for n in RACK_TILES:a = np.asarray(pieces[n])[..., 3] > 127assert (a[0] == a[-1]).all(), "%s does not tile: its ends differ" % n+ for left, right in zip(RACK_STAT_AT, RACK_STAT_AT[1:]):+ assert right[0] - left[2] >= 3, "stat keys %s and %s are under 3 apart" % (left, right)+ heading = RACK_HEAD_AT["heading"]+ assert RACK_STAT_AT[0][0] >= heading[0] and RACK_STAT_AT[-1][2] <= heading[2], "the stat keys run past the heading's width"+ assert max(r[3] for r in RACK_STAT_AT) <= heading[1], "the stat keys reach into the heading"+ well = RACK_ROW["well"]+ for name, r in RACK_ROW.items():+ assert well[0] <= r[0] and r[2] <= well[2] and well[1] <= r[1] and r[3] <= well[3], \+ "the row's %s %s is outside its well %s" % (name, r, well)return sheet_img