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): observer console hud, spectator rack and close button
Olcay Seygan8883f46cfbc1
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2cd191828..d52f98826 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,6 +13,10 @@ found and fixed, EA's own, not port damage.**- The radar takes the map's shape. A long map draws as a long strip in a frame of the same shape, a tall map as a tall one, and the black bands beside it are gone. A click on the radar still lands where it always did.- Four idle buttons stand at the right end of the command grid, top to bottom: worker, infantry, vehicle and aircraft. Each picks the next unit of its kind standing with no order and turns the camera to it, as the idle worker button always did; that button has moved there from the column on the left. A button stays dark while nothing of its kind is idle, and its tooltip names the key that does the same. The worker button used to light two to five seconds after the other three, because it waited on the worker to report itself idle; all four now look at your army on the same frame, and the worker button and its key cycle through the same workers that lit it.- The general's powers stand three to a row again, on the right edge above the general's tab. When the top row is short it leaves a step on the inside, and the tray's plate follows that outline.+- 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.+- Watching a match gets a bar of its own in dark graphite with rounded corners. Its radar takes the map's shape as a player's does, 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.+- 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.## Your queue in pictures againdiff --git a/GeneralsMD/Code/BuildFingerprint.manifest b/GeneralsMD/Code/BuildFingerprint.manifestindex a735290ef..ede5759c3 100644--- a/GeneralsMD/Code/BuildFingerprint.manifest+++ b/GeneralsMD/Code/BuildFingerprint.manifest@@ -27,7 +27,9 @@ Data/Art/Textures/ReforgedHudGlaCommandBarWide.ddsData/Art/Textures/ReforgedHudGlaPowers.ddsData/Art/Textures/ReforgedHudHelpbox.ddsData/Art/Textures/ReforgedHudObsCommandBar.dds+Data/Art/Textures/ReforgedHudObsPieces.ddsData/Art/Textures/ReforgedHudObsPlayerWindow.dds+Data/Art/Textures/ReforgedHudObsSpec.ddsData/Art/Textures/ReforgedHudTurkiyeCommandBar.ddsData/Art/Textures/ReforgedHudTurkiyeCommandBarWide.ddsData/Art/Textures/ReforgedHudTurkiyePowers.dds@@ -295,7 +297,9 @@ Data/INI/MappedImages/HandCreated/ReforgedHudGlaCommandBar.iniData/INI/MappedImages/HandCreated/ReforgedHudGlaPowers.iniData/INI/MappedImages/HandCreated/ReforgedHudHelpbox.iniData/INI/MappedImages/HandCreated/ReforgedHudObsCommandBar.ini+Data/INI/MappedImages/HandCreated/ReforgedHudObsPieces.iniData/INI/MappedImages/HandCreated/ReforgedHudObsPlayerWindow.ini+Data/INI/MappedImages/HandCreated/ReforgedHudObsSpec.iniData/INI/MappedImages/HandCreated/ReforgedHudTurkiyeCommandBar.iniData/INI/MappedImages/HandCreated/ReforgedHudTurkiyePowers.iniData/INI/MappedImages/HandCreated/ReforgedLobbySpot.inidiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudAmericaPowers.dds b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudAmericaPowers.ddsindex 14deecc1b..72a75f844 100644Binary files a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudAmericaPowers.dds and b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudAmericaPowers.dds differdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudChinaPowers.dds b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudChinaPowers.ddsindex 81c8b6812..2cc328f90 100644Binary files a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudChinaPowers.dds and b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudChinaPowers.dds differdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudGlaPowers.dds b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudGlaPowers.ddsindex 6aa1d43b2..4a27d9813 100644Binary files a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudGlaPowers.dds and b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudGlaPowers.dds differdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsCommandBar.dds b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsCommandBar.ddsindex 497b531cc..ec0dc407a 100644Binary files a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsCommandBar.dds and b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsCommandBar.dds differdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsPieces.dds b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsPieces.ddsnew file mode 100644index 000000000..6d2d24f49Binary files /dev/null and b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsPieces.dds differdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsPlayerWindow.dds b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsPlayerWindow.ddsindex 8b77b25f7..68f532df2 100644Binary files a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsPlayerWindow.dds and b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsPlayerWindow.dds differdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsSpec.dds b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsSpec.ddsnew file mode 100644index 000000000..0192e120bBinary files /dev/null and b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudObsSpec.dds differdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudTurkiyePowers.dds b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudTurkiyePowers.ddsindex c97666aed..95700474c 100644Binary files a/GeneralsMD/Code/Data/Art/Textures/ReforgedHudTurkiyePowers.dds and b/GeneralsMD/Code/Data/Art/Textures/ReforgedHudTurkiyePowers.dds differdiff --git a/GeneralsMD/Code/Data/INI/ControlBarProReforged.ini b/GeneralsMD/Code/Data/INI/ControlBarProReforged.iniindex b2b11310f..6649792af 100644--- a/GeneralsMD/Code/Data/INI/ControlBarProReforged.ini+++ b/GeneralsMD/Code/Data/INI/ControlBarProReforged.ini@@ -139,6 +139,11 @@ ControlBarScheme America8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage AmericaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable AmericaProGenPowerClose+ PowerPurchaseCloseButtonHightlited AmericaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed AmericaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled AmericaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage AmericaProIdleInfantry@@ -253,6 +258,11 @@ ControlBarScheme Turkiye8x6Layer 4EndPowerPurchaseImage TurkiyeProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable TurkiyeProGenPowerClose+ PowerPurchaseCloseButtonHightlited TurkiyeProGenPowerCloseH+ PowerPurchaseCloseButtonPushed TurkiyeProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled TurkiyeProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage TurkiyeProIdleInfantry@@ -365,6 +375,11 @@ ControlBarScheme GLA8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage GlaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable GlaProGenPowerClose+ PowerPurchaseCloseButtonHightlited GlaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed GlaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled GlaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage GlaProIdleInfantry@@ -478,6 +493,11 @@ ControlBarScheme China8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage ChinaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable ChinaProGenPowerClose+ PowerPurchaseCloseButtonHightlited ChinaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed ChinaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled ChinaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage ChinaProIdleInfantry@@ -578,6 +598,10 @@ ControlBarScheme Observer8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage AmericaProGeneralsPowerWindow+ ; the radar's frame round the map's own shape, the player column beside it following its right+ ; edge; the superweapon tray in America's pieces, standing where it does in a player's game+ RadarFrameImage ObserverProRadar+ PowerTrayImage AmericaProTrayEnd;-----------------------GENERALS CHALLENGE@@ -679,6 +703,11 @@ ControlBarScheme AmericaSuperWeaponGeneral8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage AmericaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable AmericaProGenPowerClose+ PowerPurchaseCloseButtonHightlited AmericaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed AmericaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled AmericaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage AmericaProIdleInfantry@@ -790,6 +819,11 @@ ControlBarScheme AmericaLaserGeneral8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage AmericaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable AmericaProGenPowerClose+ PowerPurchaseCloseButtonHightlited AmericaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed AmericaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled AmericaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage AmericaProIdleInfantry@@ -903,6 +937,11 @@ ControlBarScheme AmericaAirForceGeneral8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage AmericaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable AmericaProGenPowerClose+ PowerPurchaseCloseButtonHightlited AmericaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed AmericaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled AmericaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage AmericaProIdleInfantry@@ -1041,6 +1080,11 @@ ControlBarScheme ChinaTankGeneral8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage ChinaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable ChinaProGenPowerClose+ PowerPurchaseCloseButtonHightlited ChinaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed ChinaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled ChinaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage ChinaProIdleInfantry@@ -1155,6 +1199,11 @@ ControlBarScheme ChinaInfantryGeneral8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage ChinaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable ChinaProGenPowerClose+ PowerPurchaseCloseButtonHightlited ChinaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed ChinaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled ChinaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage ChinaProIdleInfantry@@ -1271,6 +1320,11 @@ ControlBarScheme ChinaNukeGeneral8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage ChinaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable ChinaProGenPowerClose+ PowerPurchaseCloseButtonHightlited ChinaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed ChinaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled ChinaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage ChinaProIdleInfantry@@ -1402,6 +1456,11 @@ ControlBarScheme GLAToxinGeneral8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage GlaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable GlaProGenPowerClose+ PowerPurchaseCloseButtonHightlited GlaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed GlaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled GlaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage GlaProIdleInfantry@@ -1516,6 +1575,11 @@ ControlBarScheme GLADemolitionGeneral8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage GlaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable GlaProGenPowerClose+ PowerPurchaseCloseButtonHightlited GlaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed GlaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled GlaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage GlaProIdleInfantry@@ -1630,6 +1694,11 @@ ControlBarScheme GLAStealthGeneral8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage GlaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable GlaProGenPowerClose+ PowerPurchaseCloseButtonHightlited GlaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed GlaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled GlaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage GlaProIdleInfantry@@ -1746,6 +1815,11 @@ ControlBarScheme ChinaBossGeneral8x6Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage ChinaProGeneralsPowerWindow+ ; the promotion window's close button in the side's own art; there is no pushed piece+ PowerPurchaseCloseButtonEnable ChinaProGenPowerClose+ PowerPurchaseCloseButtonHightlited ChinaProGenPowerCloseH+ PowerPurchaseCloseButtonPushed ChinaProGenPowerCloseH+ PowerPurchaseCloseButtonDisabled ChinaProGenPowerCloseI; the idle column at the grid's right end, the worker on top (WorkerUL/LR); the radar's frame; round the map's shape and the general's powers tray, each drawn from sheet piecesIdleInfantryButtonImage ChinaProIdleInfantrydiff --git a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudAmericaPowers.ini b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudAmericaPowers.iniindex 1d666596e..27a4be624 100644--- a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudAmericaPowers.ini+++ b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudAmericaPowers.ini@@ -603,3 +603,27 @@ MappedImage AmericaProHudReadyShimmerCoords = Left:632 Top:496 Right:704 Bottom:544Status = NONEEnd++MappedImage AmericaProGenPowerClose+ Texture = ReforgedHudAmericaPowers.tga+ TextureWidth = 1024+ TextureHeight = 1024+ Coords = Left:736 Top:4 Right:796 Bottom:54+ Status = NONE+End++MappedImage AmericaProGenPowerCloseH+ Texture = ReforgedHudAmericaPowers.tga+ TextureWidth = 1024+ TextureHeight = 1024+ Coords = Left:736 Top:58 Right:796 Bottom:108+ Status = NONE+End++MappedImage AmericaProGenPowerCloseI+ Texture = ReforgedHudAmericaPowers.tga+ TextureWidth = 1024+ TextureHeight = 1024+ Coords = Left:736 Top:112 Right:796 Bottom:162+ Status = NONE+Enddiff --git a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudChinaPowers.ini b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudChinaPowers.iniindex 09240aa2d..31836330d 100644--- a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudChinaPowers.ini+++ b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudChinaPowers.ini@@ -603,3 +603,27 @@ MappedImage ChinaProHudReadyShimmerCoords = Left:632 Top:496 Right:704 Bottom:544Status = NONEEnd++MappedImage ChinaProGenPowerClose+ Texture = ReforgedHudChinaPowers.tga+ TextureWidth = 1024+ TextureHeight = 1024+ Coords = Left:736 Top:4 Right:796 Bottom:54+ Status = NONE+End++MappedImage ChinaProGenPowerCloseH+ Texture = ReforgedHudChinaPowers.tga+ TextureWidth = 1024+ TextureHeight = 1024+ Coords = Left:736 Top:58 Right:796 Bottom:108+ Status = NONE+End++MappedImage ChinaProGenPowerCloseI+ Texture = ReforgedHudChinaPowers.tga+ TextureWidth = 1024+ TextureHeight = 1024+ Coords = Left:736 Top:112 Right:796 Bottom:162+ Status = NONE+Enddiff --git a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudControlButtons.ini b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudControlButtons.iniindex c5351782d..d1c1b83be 100644--- a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudControlButtons.ini+++ b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudControlButtons.ini@@ -1,104 +1,5 @@-MappedImage ObserverProChat- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:73 Top:90 Right:118 Bottom:120- Status = NONE-End--MappedImage ObserverProChatH- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:119 Top:90 Right:164 Bottom:120- Status = NONE-End--MappedImage ObserverProChatP- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:165 Top:90 Right:210 Bottom:120- Status = NONE-End--MappedImage ObserverProChatI- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:211 Top:90 Right:256 Bottom:120- Status = NONE-End----MappedImage ObserverProOptions- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:73 Top:121 Right:118 Bottom:151- Status = NONE-End--MappedImage ObserverProOptionsH- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:119 Top:121 Right:164 Bottom:151- Status = NONE-End--MappedImage ObserverProOptionsP- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:165 Top:121 Right:210 Bottom:151- Status = NONE-End--MappedImage ObserverProOptionsI- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:211 Top:121 Right:256 Bottom:151- Status = NONE-End----MappedImage ObserverProBack- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:73 Top:152 Right:118 Bottom:182- Status = NONE-End--MappedImage ObserverProBackH- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:119 Top:152 Right:164 Bottom:182- Status = NONE-End--MappedImage ObserverProBackP- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:165 Top:152 Right:210 Bottom:182- Status = NONE-End--MappedImage ObserverProBackI- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:211 Top:152 Right:256 Bottom:182- Status = NONE-End--+; ObserverPro{Options,Chat,Back}{,H,P,I} and the SSObserver* side pictures moved to ReforgedHudObsPieces.ini+; (the observer's own sheet)MappedImage ControlBarProGenPowerCloseTexture = ReforgedHudControlButtons.tga@@ -131,29 +32,3 @@ MappedImage ControlBarProGenPowerCloseICoords = Left:196 Top:31 Right:256 Bottom:81Status = NONEEnd----MappedImage SSObserverUSA ; Hardcoded name; collides with entry in SSUserInterface512.INI but is loaded first here- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:27 Top:0 Right:72 Bottom:30- Status = NONE-End--MappedImage SSObserverChina ; Hardcoded name; collides with entry in SSUserInterface512.INI but is loaded first here- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:73 Top:0 Right:118 Bottom:30- Status = NONE-End--MappedImage SSObserverGLA ; Hardcoded name; collides with entry in SSUserInterface512.INI but is loaded first here- Texture = ReforgedHudControlButtons.tga- TextureWidth = 256- TextureHeight = 256- Coords = Left:119 Top:0 Right:164 Bottom:30- Status = NONE-Enddiff --git a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudGlaPowers.ini b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudGlaPowers.iniindex 3fd9ddfed..8d119b9c3 100644--- a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudGlaPowers.ini+++ b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudGlaPowers.ini@@ -603,3 +603,27 @@ MappedImage GlaProHudReadyShimmerCoords = Left:632 Top:496 Right:704 Bottom:544Status = NONEEnd++MappedImage GlaProGenPowerClose+ Texture = ReforgedHudGlaPowers.tga+ TextureWidth = 1024+ TextureHeight = 1024+ Coords = Left:736 Top:4 Right:796 Bottom:54+ Status = NONE+End++MappedImage GlaProGenPowerCloseH+ Texture = ReforgedHudGlaPowers.tga+ TextureWidth = 1024+ TextureHeight = 1024+ Coords = Left:736 Top:58 Right:796 Bottom:108+ Status = NONE+End++MappedImage GlaProGenPowerCloseI+ Texture = ReforgedHudGlaPowers.tga+ TextureWidth = 1024+ TextureHeight = 1024+ Coords = Left:736 Top:112 Right:796 Bottom:162+ Status = NONE+Enddiff --git a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudObsPieces.ini b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudObsPieces.ininew file mode 100644index 000000000..d4bb621d7--- /dev/null+++ b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudObsPieces.ini@@ -0,0 +1,305 @@+; The observer's pieces (Tools/hud_command_bar.py paint_observer_pieces): the toolbar's three buttons in+; four states, the rings round a hovered (RowH) and a watched (RowS) player button, and the radar frame's+; nine (RadarFrameImage ObserverProRadar), and the sides' emblems. The generator reads this file as the+; sheet's layout.++MappedImage ObserverProOptions+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:2 Top:2 Right:47 Bottom:32+ Status = NONE+End++MappedImage ObserverProOptionsH+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:51 Top:2 Right:96 Bottom:32+ Status = NONE+End++MappedImage ObserverProOptionsP+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:100 Top:2 Right:145 Bottom:32+ Status = NONE+End++MappedImage ObserverProOptionsI+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:149 Top:2 Right:194 Bottom:32+ Status = NONE+End++MappedImage ObserverProChat+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:198 Top:2 Right:243 Bottom:32+ Status = NONE+End++MappedImage ObserverProChatH+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:2 Top:36 Right:47 Bottom:66+ Status = NONE+End++MappedImage ObserverProChatP+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:51 Top:36 Right:96 Bottom:66+ Status = NONE+End++MappedImage ObserverProChatI+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:100 Top:36 Right:145 Bottom:66+ Status = NONE+End++MappedImage ObserverProBack+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:149 Top:36 Right:194 Bottom:66+ Status = NONE+End++MappedImage ObserverProBackH+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:198 Top:36 Right:243 Bottom:66+ Status = NONE+End++MappedImage ObserverProBackP+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:2 Top:70 Right:47 Bottom:100+ Status = NONE+End++MappedImage ObserverProBackI+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:51 Top:70 Right:96 Bottom:100+ Status = NONE+End++MappedImage ObserverProRowH+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:2 Top:106 Right:55 Bottom:144+ Status = NONE+End++MappedImage ObserverProRowS+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:59 Top:106 Right:112 Bottom:144+ Status = NONE+End++MappedImage ObserverProRadarTL+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:350 Top:2 Right:355 Bottom:15+ Status = NONE+End++MappedImage ObserverProRadarT+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:2 Top:330 Right:324 Bottom:343+ Status = NONE+End++MappedImage ObserverProRadarTR+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:358 Top:2 Right:363 Bottom:15+ Status = NONE+End++MappedImage ObserverProRadarL+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:262 Top:2 Right:267 Bottom:324+ Status = NONE+End++MappedImage ObserverProRadarC+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:280 Top:2 Right:344 Bottom:66+ Status = NONE+End++MappedImage ObserverProRadarR+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:270 Top:2 Right:275 Bottom:324+ Status = NONE+End++MappedImage ObserverProRadarBL+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:366 Top:2 Right:371 Bottom:7+ Status = NONE+End++MappedImage ObserverProRadarB+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:2 Top:346 Right:324 Bottom:351+ Status = NONE+End++; The sides' and generals' emblems (paint_side_emblems, round 13's A), 45x30: the picture a player's row+; carries on the bar and in the rack's standings. SSObserverUSA, China and GLA are the names retail's+; PlayerTemplate EnabledImage gives every side and general, and take them back from SSUserInterface512;+; each general's is SSObserver and his template's name without Faction and General.++MappedImage SSObserverUSA+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:2 Top:150 Right:47 Bottom:180+ Status = NONE+End++MappedImage SSObserverAmericaSuperWeapon+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:51 Top:150 Right:96 Bottom:180+ Status = NONE+End++MappedImage SSObserverAmericaLaser+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:100 Top:150 Right:145 Bottom:180+ Status = NONE+End++MappedImage SSObserverAmericaAirForce+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:149 Top:150 Right:194 Bottom:180+ Status = NONE+End++MappedImage SSObserverChina+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:198 Top:150 Right:243 Bottom:180+ Status = NONE+End++MappedImage SSObserverChinaTank+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:2 Top:184 Right:47 Bottom:214+ Status = NONE+End++MappedImage SSObserverChinaInfantry+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:51 Top:184 Right:96 Bottom:214+ Status = NONE+End++MappedImage SSObserverChinaNuke+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:100 Top:184 Right:145 Bottom:214+ Status = NONE+End++MappedImage SSObserverBoss+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:149 Top:184 Right:194 Bottom:214+ Status = NONE+End++MappedImage SSObserverGLA+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:198 Top:184 Right:243 Bottom:214+ Status = NONE+End++MappedImage SSObserverGLAToxin+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:2 Top:218 Right:47 Bottom:248+ Status = NONE+End++MappedImage SSObserverGLADemolition+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:51 Top:218 Right:96 Bottom:248+ Status = NONE+End++MappedImage SSObserverGLAStealth+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:100 Top:218 Right:145 Bottom:248+ Status = NONE+End++MappedImage SSObserverTurkiye+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:149 Top:218 Right:194 Bottom:248+ Status = NONE+End++MappedImage ObserverProRadarBR+ Texture = ReforgedHudObsPieces.tga+ TextureWidth = 512+ TextureHeight = 512+ Coords = Left:374 Top:2 Right:379 Bottom:7+ Status = NONE+Enddiff --git a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudObsSpec.ini b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudObsSpec.ininew file mode 100644index 000000000..65d1240a6--- /dev/null+++ b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudObsSpec.ini@@ -0,0 +1,307 @@+; The spectator's rack (Tools/hud_command_bar.py paint_rack): drawers hung off the right edge under the+; superweapon tray. Caps, heads, rows, bodies and feet are slices the code stacks; the rest are controls+; in each state. The generator reads this file as the sheet's layout.++MappedImage ObserverProRackHead+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:2 Top:2 Right:308 Bottom:70+ Status = NONE+End++MappedImage ObserverProRackDialQ+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:311 Top:2 Right:363 Bottom:54+ Status = NONE+End++MappedImage ObserverProRackDialQH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:366 Top:2 Right:418 Bottom:54+ Status = NONE+End++MappedImage ObserverProRackDialW+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:421 Top:2 Right:473 Bottom:54+ Status = NONE+End++MappedImage ObserverProRackDialWH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:476 Top:2 Right:528 Bottom:54+ Status = NONE+End++MappedImage ObserverProRackDialE+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:531 Top:2 Right:583 Bottom:54+ Status = NONE+End++MappedImage ObserverProRackDialEH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:586 Top:2 Right:638 Bottom:54+ Status = NONE+End++MappedImage ObserverProRackDialR+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:641 Top:2 Right:693 Bottom:54+ Status = NONE+End++MappedImage ObserverProRackDialRH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:696 Top:2 Right:748 Bottom:54+ Status = NONE+End++MappedImage ObserverProRackDialT+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:751 Top:2 Right:803 Bottom:54+ Status = NONE+End++MappedImage ObserverProRackDialTH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:806 Top:2 Right:858 Bottom:54+ Status = NONE+End++MappedImage ObserverProRackDialY+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:861 Top:2 Right:913 Bottom:54+ Status = NONE+End++MappedImage ObserverProRackDialYH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:916 Top:2 Right:968 Bottom:54+ Status = NONE+End++MappedImage ObserverProRackDialA+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:2 Top:73 Right:54 Bottom:125+ Status = NONE+End++MappedImage ObserverProRackDialAH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:57 Top:73 Right:109 Bottom:125+ Status = NONE+End++MappedImage ObserverProRackLeverFree+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:112 Top:73 Right:268 Bottom:105+ Status = NONE+End++MappedImage ObserverProRackLeverFreeH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:271 Top:73 Right:427 Bottom:105+ Status = NONE+End++MappedImage ObserverProRackLeverDirector+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:430 Top:73 Right:586 Bottom:105+ Status = NONE+End++MappedImage ObserverProRackLeverDirectorH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:589 Top:73 Right:745 Bottom:105+ Status = NONE+End++MappedImage ObserverProRackLeverPlayer+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:748 Top:73 Right:904 Bottom:105+ Status = NONE+End++MappedImage ObserverProRackLeverPlayerH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:2 Top:128 Right:158 Bottom:160+ Status = NONE+End++MappedImage ObserverProRackRockerOff+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:161 Top:128 Right:207 Bottom:160+ Status = NONE+End++MappedImage ObserverProRackRockerOffH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:210 Top:128 Right:256 Bottom:160+ Status = NONE+End++MappedImage ObserverProRackRockerOn+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:259 Top:128 Right:305 Bottom:160+ Status = NONE+End++MappedImage ObserverProRackRockerOnH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:308 Top:128 Right:354 Bottom:160+ Status = NONE+End++MappedImage ObserverProRackRow+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:357 Top:128 Right:663 Bottom:158+ Status = NONE+End++MappedImage ObserverProDrawerRow+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:666 Top:128 Right:942 Bottom:158+ Status = NONE+End++MappedImage ObserverProRackTop+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:2 Top:163 Right:308 Bottom:191+ Status = NONE+End++MappedImage ObserverProRackTab+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:311 Top:163 Right:351 Bottom:189+ Status = NONE+End++MappedImage ObserverProRackTabH+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:354 Top:163 Right:394 Bottom:189+ Status = NONE+End++MappedImage ObserverProRackTabOn+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:397 Top:163 Right:437 Bottom:189+ Status = NONE+End++MappedImage ObserverProRackBottom+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:440 Top:163 Right:746 Bottom:177+ Status = NONE+End++MappedImage ObserverProDrawerBottom+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:2 Top:194 Right:278 Bottom:208+ Status = NONE+End++MappedImage ObserverProRackTally+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:281 Top:194 Right:295 Bottom:208+ Status = NONE+End++MappedImage ObserverProDrawerTop+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:298 Top:194 Right:574 Bottom:206+ Status = NONE+End++MappedImage ObserverProRackLens+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:577 Top:194 Right:582 Bottom:206+ Status = NONE+End++MappedImage ObserverProRackBody+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:585 Top:194 Right:891 Bottom:198+ Status = NONE+End++MappedImage ObserverProRackMeter+ Texture = ReforgedHudObsSpec.tga+ TextureWidth = 1024+ TextureHeight = 256+ Coords = Left:894 Top:194 Right:910 Bottom:198+ Status = NONE+Enddiff --git a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudTurkiyePowers.ini b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudTurkiyePowers.iniindex ebd579017..db2b69199 100644--- a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudTurkiyePowers.ini+++ b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedHudTurkiyePowers.ini@@ -595,3 +595,27 @@ MappedImage TurkiyeProHudReadyShimmerCoords = Left:632 Top:496 Right:704 Bottom:544Status = NONEEnd++MappedImage TurkiyeProGenPowerClose+ Texture = ReforgedHudTurkiyePowers.tga+ TextureWidth = 1024+ TextureHeight = 1024+ Coords = Left:736 Top:4 Right:796 Bottom:54+ Status = NONE+End++MappedImage TurkiyeProGenPowerCloseH+ Texture = ReforgedHudTurkiyePowers.tga+ TextureWidth = 1024+ TextureHeight = 1024+ Coords = Left:736 Top:58 Right:796 Bottom:108+ Status = NONE+End++MappedImage TurkiyeProGenPowerCloseI+ Texture = ReforgedHudTurkiyePowers.tga+ TextureWidth = 1024+ TextureHeight = 1024+ Coords = Left:736 Top:112 Right:796 Bottom:162+ Status = NONE+Enddiff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex 9670171d7..c8e75b63a 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -1234,6 +1234,77 @@ GUI:HudStatArmy"Army value"END+// The spectator's rack: the stats its dial ranks every player by, the first also the broadcast's+// list of every player's cash plus what everything he has standing cost+GUI:HudNetWorth+"Net worth"+END++GUI:HudStatCash+"Cash"+END++GUI:HudStatIncome+"Income per minute"+END++GUI:HudStatKills+"Kills / losses"+END++GUI:HudStatRank+"General's rank"+END++GUI:HudStatPower+"Power"+END++// a row's number under the income stat, "$1,840/min"+GUI:HudStatIncomeValue+"%ls/min"+END++// a row's number under the rank stat+GUI:HudStatRankValue+"Rank %d"+END++// the rack's top drawer: the camera lever, the fog and the armies drawer+GUI:HudWatch+"Watch"+END++// the camera's own again+GUI:HudCameraFree+"Free"+END++// the camera goes to the biggest fight on the map by itself+GUI:HudCameraDirector+"Director"+END++// the camera shows what the followed player's own screen shows+GUI:HudCameraPlayer+"Player"+END++// the followed player's fog of war, so the spectator sees only what he sees+GUI:HudFog+"Fog"+END++// each player's units, most first, with how many he has+GUI:HudArmies+"Armies"+END++// the rack's drawer of every player ranked by the dial's stat+GUI:HudStandings+"Standings"+END+// The cheat panel the console's "trainer" command opens.GUI:CheatPanelTitle"Cheats"diff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex 393beb3d7..c63d3e4bc 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -15681,6 +15681,66 @@ GUI:HudStatArmy"Ordu değeri"END+GUI:HudNetWorth+"Net değer"+END++GUI:HudStatCash+"Nakit"+END++GUI:HudStatIncome+"Dakikalık gelir"+END++GUI:HudStatKills+"Öldürme / kayıp"+END++GUI:HudStatRank+"General rütbesi"+END++GUI:HudStatPower+"Elektrik"+END++GUI:HudStatIncomeValue+"%ls/dk"+END++GUI:HudStatRankValue+"Rütbe %d"+END++GUI:HudWatch+"İzle"+END++GUI:HudCameraFree+"Serbest"+END++GUI:HudCameraDirector+"Yönetmen"+END++GUI:HudCameraPlayer+"Oyuncu"+END++GUI:HudFog+"Sis"+END++GUI:HudArmies+"Ordular"+END++GUI:HudStandings+"Sıralama"+END+GUI:CheatPanelTitle"Hileler"ENDdiff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.hindex 66135e5ed..41921ec70 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h@@ -1209,8 +1209,16 @@ protected:void fitRadarToMap( Bool fromLayout ); ///< the radar window, its frame and its blocker take the map's shape; see layoutPanelsReal m_radarFitWidth, m_radarFitHeight; ///< the map extent fitRadarToMap last fitted to- enum { RADAR_FIT_RADAR, RADAR_FIT_BLOCK, RADAR_FIT_LAMP, RADAR_FIT_COUNT };+ /// the observer's player column (its list, the watched player's panel, Options and Chat) stands+ /// against the frame's right edge, so it is fitted with the radar+ enum { RADAR_FIT_RADAR, RADAR_FIT_BLOCK, RADAR_FIT_LAMP, RADAR_FIT_LIST, RADAR_FIT_INFO, RADAR_FIT_OPTIONS,+ RADAR_FIT_CHAT, RADAR_FIT_COUNT, RADAR_FIT_COLUMN_FIRST = RADAR_FIT_LIST };IRegion2D m_radarFitBox[ RADAR_FIT_COUNT ]; ///< where layoutPanels put each, against the bar's frame+ Int m_radarColumnShift; ///< how far the column stands left of where the square map has it+public:+ /// drawPainting moves the left piece of the painting, the column's plate, by as much+ Int getRadarColumnShift( void ) const { return m_radarColumnShift; }+protected:void showIdleButtons( Bool show ); ///< the idle worker, infantry, vehicle and aircraft buttons, hidden while watching/** Where a key lands: the command slot at grid place `place`, or SLOT_NOTHING; and the tray slotdiff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBarScheme.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBarScheme.hindex 20d87425e..2fe0182d6 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBarScheme.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBarScheme.h@@ -264,6 +264,13 @@ public:Image *m_powerPurchaseImage;+ /// PowerPurchaseCloseButton*: the promotion window's close button (GeneralsExpPoints.wnd:ButtonExit)+ /// in the side's own art; a scheme without them leaves the .wnd's images on the button+ Image *m_powerPurchaseCloseButtonEnable;+ Image *m_powerPurchaseCloseButtonHightlited;+ Image *m_powerPurchaseCloseButtonPushed;+ Image *m_powerPurchaseCloseButtonDisabled;+typedef std::list< ControlBarSchemeImage* > ControlBarSchemeImageList;ControlBarSchemeImageList m_layer[MAX_CONTROL_BAR_SCHEME_IMAGE_LAYERS];@@ -350,5 +357,9 @@ private://-----------------------------------------------------------------------------/// a mod's faction, which gets our American power tray (owner's call)Bool ControlBarIsModFaction( const PlayerTemplate *pt );+/// the side's emblem the observer's column, the rack and the lobbies show: SSObserver and the template's+/// name less a leading "Faction" and a trailing "General" (SSObserverAmericaLaser), else+/// SSObserver<USA|China|GLA|Turkiye> for the country its base side or side names, else its EnabledImage+const Image *ControlBarSideEmblem( const PlayerTemplate *pt );#endif // __CONTROL_BAR_SCHEME_H_diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.hindex ad7a57869..7c6af1967 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h@@ -1040,6 +1040,16 @@ public: // ********************************************************************/// items off that building's queue; one of your own superweapons takes the camera to itBool handleHudCellClick( const ICoord2D *mouse, Bool cancel );+ /// 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 controls+ Bool 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+ Bool 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 shipped+ Bool 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+ Bool pickSpectatorStatKey( Int key, Int keyState );+/// Ingame video playbackvirtual void playMovie( const AsciiString& movieName );virtual void stopMovie( void );@@ -1499,6 +1509,33 @@ protected:UnsignedInt m_hudCellPass; ///< client passes, counted by update()UnsignedInt m_hudCellDrawnPass; ///< m_hudCellPass when postDraw last laid the cells out+ //+ // 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.+ //+ 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_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+ };+ void drawSpectatorRack( Int plateTop ); ///< plateTop: the watch drawer's plate, 8 under the superweapon tray's foot+ /// the kept string `slot` holding text in the bold face at px pixels at 1080, a pixel smaller at a time+ /// down to 9 until it is no wider than room (0: any width)+ DisplayString *rackText( Int slot, const UnicodeString &text, Int px, Int room );+ Bool m_rackShown; ///< the last postDraw drew it+ Int m_rackX, m_rackY; ///< its pieces' left and the watch drawer's top+ Int m_rackRows;+ Int m_rackRowPlayer[ RACK_ROWS ]; ///< the player index on each row, top down+ Int m_rackStat; ///< SPECTATOR_STATS index on the dial+ Bool m_rackArmies; ///< the armies drawer is out+ DisplayString * m_rackText[ RACK_TEXT_COUNT ];+ Int m_rackTextPx[ RACK_TEXT_COUNT ]; ///< the size and room each was laid out for+ Int m_rackTextRoom[ RACK_TEXT_COUNT ];+Coord2D m_superweaponPosition;Real m_superweaponFlashDuration;diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cppindex fccde6b00..fc64e8858 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp@@ -1445,6 +1445,7 @@ ControlBar::ControlBar( void )m_trayLaidOutFor = NULL;m_trayFramePlaced = FALSE;m_radarFitWidth = m_radarFitHeight = 0.0f;+ m_radarColumnShift = 0;for( Int fit = 0; fit < RADAR_FIT_COUNT; fit++ )m_radarFitBox[ fit ].lo.x = m_radarFitBox[ fit ].lo.y = m_radarFitBox[ fit ].hi.x = m_radarFitBox[ fit ].hi.y = 0;@@ -2317,6 +2318,31 @@ void ControlBar::layoutPanels( void )} // end layoutPanels+/// every place layoutPanels remembers for a window and everything under it, moved across by dx+static void shiftPlaces( GameWindow *window, Int dx )+{+ ControlBarPanelPlacementMap::iterator place = theControlBarPlacement.find( window );+ if( place != theControlBarPlacement.end() )+ place->second.placedX += dx;+ for( GameWindow *child = window->winGetChild(); child; child = child->winGetNext() )+ shiftPlaces( child, dx );+}++//-------------------------------------------------------------------------------------------------+/** A window and everything under it moved across by dx, with their remembered places, so the next+ * layout reads them as where it left them and starts from their authored rectangles again.+ * placeWindowAt keeps the children where they stood; this takes them along. */+//-------------------------------------------------------------------------------------------------+static void shiftWindowTree( GameWindow *window, Int dx )+{+ if( dx == 0 )+ return;+ Int x = 0, y = 0;+ window->winGetPosition( &x, &y );+ window->winSetPosition( x + dx, y );+ shiftPlaces( window, dx );+}+//-------------------------------------------------------------------------------------------------/** layoutPanels stands the radar in its square box. A scheme with a radar frame then shrinks the* window to the map's own shape inside that box, pinned to the box's bottom left where the bar@@ -2334,11 +2360,19 @@ void ControlBar::fitRadarToMap( Bool fromLayout ){static NameKeyType radarID = NAMEKEY( "ControlBar.wnd:LeftHUD" );static NameKeyType blockID = NAMEKEY( "ControlBar.wnd:ControlBarProBlockInputRadar" );+ static NameKeyType listID = NAMEKEY( "ControlBar.wnd:ObserverPlayerListWindow" );+ static NameKeyType infoID = NAMEKEY( "ControlBar.wnd:ObserverPlayerInfoWindow" );+ static NameKeyType optionsID = NAMEKEY( "ControlBar.wnd:ButtonOptions" );+ static NameKeyType chatID = NAMEKEY( "ControlBar.wnd:PopupCommunicator" );GameWindow *const windows[ RADAR_FIT_COUNT ] ={TheWindowManager->winGetWindowFromId( NULL, radarID ),TheWindowManager->winGetWindowFromId( NULL, blockID ),m_radarAttackGlowWindow,+ TheWindowManager->winGetWindowFromId( NULL, listID ),+ TheWindowManager->winGetWindowFromId( NULL, infoID ),+ TheWindowManager->winGetWindowFromId( NULL, optionsID ),+ TheWindowManager->winGetWindowFromId( NULL, chatID ),};GameWindow *parent = m_contextParent[ CP_MASTER ];if( parent == NULL || windows[ RADAR_FIT_RADAR ] == NULL )@@ -2348,6 +2382,8 @@ void ControlBar::fitRadarToMap( Bool fromLayout )if( fromLayout ){+ // the layout has just put the column back where the square map has it+ m_radarColumnShift = 0;for( Int i = 0; i < RADAR_FIT_COUNT; i++ ){if( windows[ i ] == NULL )@@ -2409,6 +2445,27 @@ void ControlBar::fitRadarToMap( Bool fromLayout )lamp.lo.y += dy;lamp.hi.y += dy;placeWindowAt( windows[ RADAR_FIT_LAMP ], lamp );++ //+ // The observer's column stands against the frame's right edge, so a tall map's narrower frame+ // takes the column, its plate (drawPainting) and everything on it left with it. Its height is+ // the square's and it ends at the screen's foot, so a wide map's lower frame leaves it standing:+ // moved down it would run off the screen. A side's Options and Chat stand in the middle plate+ // and stay.+ //+ if( m_controlBarSchemeManager->getCurrentSide().compareNoCase( "Observer" ) != 0 )+ return;+ IRegion2D squareOuter;+ ControlBarSchemeManager::radarFrameRect( frame, square, &squareOuter );+ m_radarColumnShift = outer.hi.x - squareOuter.hi.x;+ for( Int i = RADAR_FIT_COLUMN_FIRST; i < RADAR_FIT_COUNT; i++ )+ {+ if( windows[ i ] == NULL )+ continue;+ ICoord2D at;+ windows[ i ]->winGetScreenPosition( &at.x, &at.y );+ shiftWindowTree( windows[ i ], box[ i ].lo.x + m_radarColumnShift - at.x );+ }}//-------------------------------------------------------------------------------------------------diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cppindex 994b10ee6..3329a4553 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp@@ -61,6 +61,7 @@#include "Common/KindOf.h"#include "Common/Recorder.h"#include "GameClient/ControlBar.h"+#include "GameClient/ControlBarScheme.h"#include "GameClient/PlayerColorScheme.h"#include "GameClient/GameWindowManager.h"#include "GameClient/GadgetPushButton.h"@@ -68,6 +69,8 @@#include "GameClient/GameText.h"#include "GameClient/InGameUI.h"#include "GameClient/ObserverCamera.h"+#include "GameClient/Display.h"+#include "GameClient/Image.h"#include "GameNetwork/NetworkDefs.h"//-----------------------------------------------------------------------------// DEFINES ////////////////////////////////////////////////////////////////////@@ -100,6 +103,44 @@ static GameWindow *staticTextNumberOfUnitsKilled = NULL;static GameWindow *staticTextNumberOfUnitsLost = NULL;static GameWindow *staticTextPlayerName = NULL;+static GameWinDrawFunc buttonPlayerDraw = NULL; ///< the push button's own draw, which the row draw ends with+static const Image *rowHover = NULL;+static const Image *rowWatched = NULL;++//-------------------------------------------------------------------------------------------------+/** A row of the observer's column: his colour's lamp on the plate beside his button, and the ring+ * round it while the pointer is over it (ObserverProRowH) or while he is the one watched or+ * followed (ObserverProRowS, which wins). Numbers are the button's own at 1080, 45x30. */+//-------------------------------------------------------------------------------------------------+static void drawObserverRow( GameWindow *window, WinInstanceData *instData )+{+ enum { BUTTON_H = 30, RING_OUT = 4, RING_W = 53, RING_H = 38, LAMP_X = 49, LAMP_Y = 4, LAMP_W = 7, LAMP_H = 22,+ SHINE_X = 50, SHINE_Y = 6, SHINE_W = 2, SHINE_H = 18, SHINE_LIFT = 90 };+ ICoord2D at, size;+ window->winGetScreenPosition( &at.x, &at.y );+ window->winGetSize( &size.x, &size.y );+ const Real k = (Real)size.y / BUTTON_H;+ auto px = [ k ]( Int at1080 ) { return REAL_TO_INT( at1080 * k + 0.5f ); };++ const Player *player = (const Player *)GadgetButtonGetData( window );+ const Bool watched = player == TheControlBar->getObserverLookAtPlayer()+ || player->getPlayerIndex() == TheObserverCamera.getFollowedPlayerIndex();+ const Image *ring = watched ? rowWatched : ( BitTest( instData->getState(), WIN_STATE_HILITED ) ? rowHover : NULL );+ if( ring )+ TheDisplay->drawImage( ring, at.x - px( RING_OUT ), at.y - px( RING_OUT ),+ at.x - px( RING_OUT ) + px( RING_W ), at.y - px( RING_OUT ) + px( RING_H ) );++ const Color colour = clientPlayerColor( player );+ UnsignedByte r, g, b, a;+ GameGetColorComponents( colour, &r, &g, &b, &a );+ auto lift = []( UnsignedByte c ) { return (UnsignedByte)min( (Int)c + SHINE_LIFT, 255 ); };+ TheDisplay->drawFillRect( at.x + px( LAMP_X ), at.y + px( LAMP_Y ), px( LAMP_W ), px( LAMP_H ), GameMakeColor( r, g, b, 255 ) );+ TheDisplay->drawFillRect( at.x + px( SHINE_X ), at.y + px( SHINE_Y ), px( SHINE_W ), px( SHINE_H ),+ GameMakeColor( lift( r ), lift( g ), lift( b ), 255 ) );++ buttonPlayerDraw( window, instData );+}+//-----------------------------------------------------------------------------// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////-----------------------------------------------------------------------------@@ -107,6 +148,8 @@ static GameWindow *staticTextPlayerName = NULL;void ControlBar::initObserverControls( void ){+ rowHover = TheMappedImageCollection->findImageByName( "ObserverProRowH" );+ rowWatched = TheMappedImageCollection->findImageByName( "ObserverProRowS" );ObserverPlayerInfoWindow = TheWindowManager->winGetWindowFromId(NULL, TheNameKeyGenerator->nameToKey("ControlBar.wnd:ObserverPlayerInfoWindow"));ObserverPlayerListWindow = TheWindowManager->winGetWindowFromId(NULL, TheNameKeyGenerator->nameToKey("ControlBar.wnd:ObserverPlayerListWindow"));@@ -116,6 +159,12 @@ void ControlBar::initObserverControls( void )tmpString.format("ControlBar.wnd:ButtonPlayer%d", i);buttonPlayerID[i] = TheNameKeyGenerator->nameToKey( tmpString );buttonPlayer[i] = TheWindowManager->winGetWindowFromId( ObserverPlayerListWindow, buttonPlayerID[i] );+ // the windows are made again on a new screen size, each with the button's own draw again+ if( buttonPlayer[i]->winGetDrawFunc() != drawObserverRow )+ {+ buttonPlayerDraw = buttonPlayer[i]->winGetDrawFunc();+ buttonPlayer[i]->winSetDrawFunc( drawObserverRow );+ }tmpString.format("ControlBar.wnd:StaticTextPlayer%d", i);staticTextPlayerID[i] = TheNameKeyGenerator->nameToKey( tmpString );staticTextPlayer[i] = TheWindowManager->winGetWindowFromId( ObserverPlayerListWindow, staticTextPlayerID[i] );@@ -243,7 +292,7 @@ void ControlBar::populateObserverList( void )continue;DEBUG_ASSERTCRASH(currentButton < MAX_BUTTONS, ("ControlBar::populateObserverList trying to populate more buttons then we have"));GadgetButtonSetData(buttonPlayer[currentButton], (void *)p);- GadgetButtonSetEnabledImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getEnabledImage() );+ GadgetButtonSetEnabledImage( buttonPlayer[currentButton], ControlBarSideEmblem( p->getPlayerTemplate() ) );//GadgetButtonSetHiliteImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getHiliteImage() );//GadgetButtonSetHiliteSelectedImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getPushedImage() );//GadgetButtonSetDisabledImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getDisabledImage() );@@ -291,7 +340,7 @@ void ControlBar::populateObserverList( void ){DEBUG_ASSERTCRASH(currentButton < MAX_BUTTONS, ("ControlBar::populateObserverList trying to populate more buttons then we have"));GadgetButtonSetData(buttonPlayer[currentButton], (void *)p);- GadgetButtonSetEnabledImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getEnabledImage() );+ GadgetButtonSetEnabledImage( buttonPlayer[currentButton], ControlBarSideEmblem( p->getPlayerTemplate() ) );//GadgetButtonSetHiliteImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getHiliteImage() );//GadgetButtonSetHiliteSelectedImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getPushedImage() );//GadgetButtonSetDisabledImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getDisabledImage() );diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cppindex ad64ed512..a3d25b57b 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp@@ -189,6 +189,10 @@ const FieldParse ControlBarSchemeManager::m_controlBarSchemeFieldParseTable[] ={ "CommandMarkerImage", INI::parseMappedImage, NULL, offsetof( ControlBarScheme, m_commandMarkerImage) },{ "ExpBarForegroundImage", INI::parseMappedImage, NULL, offsetof( ControlBarScheme, m_expBarForeground) },{ "PowerPurchaseImage", INI::parseMappedImage, NULL, offsetof( ControlBarScheme, m_powerPurchaseImage) },+ { "PowerPurchaseCloseButtonEnable", INI::parseMappedImage, NULL, offsetof( ControlBarScheme, m_powerPurchaseCloseButtonEnable ) },+ { "PowerPurchaseCloseButtonHightlited", INI::parseMappedImage, NULL, offsetof( ControlBarScheme, m_powerPurchaseCloseButtonHightlited ) },+ { "PowerPurchaseCloseButtonPushed", INI::parseMappedImage, NULL, offsetof( ControlBarScheme, m_powerPurchaseCloseButtonPushed ) },+ { "PowerPurchaseCloseButtonDisabled", INI::parseMappedImage, NULL, offsetof( ControlBarScheme, m_powerPurchaseCloseButtonDisabled ) },{ NULL, NULL, NULL, 0 } // keep this last@@ -315,7 +319,11 @@ void ControlBarScheme::reset(void)m_commandMarkerImage = NULL;m_expBarForeground = NULL;m_powerPurchaseImage = NULL;-+ m_powerPurchaseCloseButtonEnable = NULL;+ m_powerPurchaseCloseButtonHightlited = NULL;+ m_powerPurchaseCloseButtonPushed = NULL;+ m_powerPurchaseCloseButtonDisabled = NULL;+}ControlBarScheme::~ControlBarScheme(void)@@ -381,6 +389,10 @@ ControlBarScheme::ControlBarScheme(void)m_expBarForeground = NULL;m_powerPurchaseImage = NULL;+ m_powerPurchaseCloseButtonEnable = NULL;+ m_powerPurchaseCloseButtonHightlited = NULL;+ m_powerPurchaseCloseButtonPushed = NULL;+ m_powerPurchaseCloseButtonDisabled = NULL;m_generalButtonEnable = NULL;m_generalButtonHightlited = NULL;@@ -701,6 +713,15 @@ void ControlBarScheme::init(void)// where it stands is ControlBar Pro's GeneralsExpPoints.wnd at its pieces' scale, centred at the// top (ControlBarLayoutUniform in ControlBar::initWindows), so nothing here moves it}+ // its close button stands in the window's close boss, the same rect for every side+ win = TheWindowManager->winGetWindowFromId( NULL, TheNameKeyGenerator->nameToKey( "GeneralsExpPoints.wnd:ButtonExit" ) );+ if( win && m_powerPurchaseCloseButtonEnable )+ {+ GadgetButtonSetEnabledImage( win, m_powerPurchaseCloseButtonEnable );+ GadgetButtonSetHiliteImage( win, m_powerPurchaseCloseButtonHightlited );+ GadgetButtonSetHiliteSelectedImage( win, m_powerPurchaseCloseButtonPushed );+ GadgetButtonSetDisabledImage( win, m_powerPurchaseCloseButtonDisabled );+ }//// A painting whose plates outgrow ControlBar.wnd's input blockers names its own, so a click on@@ -1244,6 +1265,48 @@ Bool ControlBarIsModFaction( const PlayerTemplate *pt )return pt->getModIndex() >= 0 || ( !TheGlobalData->m_mods.empty() && !TheGlobalData->m_modFactions );}+//-----------------------------------------------------------------------------+/** The emblem is looked up by name, so a sheet that adds one for a general needs no INI edit and the+ * player templates (in the INI checksum) stay as they are. A mod's sub-faction or a faction built+ * on another country's base side gets that country's. */+//-----------------------------------------------------------------------------+const Image *ControlBarSideEmblem( const PlayerTemplate *pt )+{+ static const char *const PREFIX = "SSObserver";+ static const std::string LEADING = "Faction";+ static const std::string TRAILING = "General";+ // FactionAmericaLaserGeneral wears SSObserverAmericaLaser, FactionTurkiye SSObserverTurkiye+ std::string general = pt->getName().str();+ if( general.compare( 0, LEADING.size(), LEADING ) == 0 )+ general.erase( 0, LEADING.size() );+ if( general.size() >= TRAILING.size() && general.compare( general.size() - TRAILING.size(), TRAILING.size(), TRAILING ) == 0 )+ general.erase( general.size() - TRAILING.size() );+ AsciiString name;+ name.format( "%s%s", PREFIX, general.c_str() );+ const Image *emblem = TheMappedImageCollection->findImageByName( name );+ if( emblem != NULL )+ return emblem;++ const AsciiString side = pt->getBaseSide().isEmpty() ? pt->getSide() : pt->getBaseSide();+ const char *country = NULL;+ if( side.startsWithNoCase( "America" ) || side.startsWithNoCase( "USA" ) )+ country = "USA";+ else if( side.startsWithNoCase( "China" ) )+ country = "China";+ else if( side.startsWithNoCase( "GLA" ) )+ country = "GLA";+ else if( side.startsWithNoCase( "Turkiye" ) )+ country = "Turkiye";+ if( country != NULL )+ {+ name.format( "%s%s", PREFIX, country );+ emblem = TheMappedImageCollection->findImageByName( name );+ if( emblem != NULL )+ return emblem;+ }+ return pt->getEnabledImage();+}+//-----------------------------------------------------------------------------/** The bar follows the country, and is always ControlBar Pro's. A side with a ControlBar Pro scheme of* its own (Boss and Observer among them) wears it; any other wears its country's by name, the way@@ -1341,9 +1404,13 @@ void ControlBarSchemeManager::drawPainting( ICoord2D offset, Bool foreground )const Int width = TheDisplay->getWidth();const Int height = TheDisplay->getHeight();const Bool wide = TheControlBar && TheControlBar->isCommandGridWide();+ const ICoord2D barOffset = offset;for( Int p = 0; p < ControlBar::CB_PANEL_COUNT; p++ ){+ // the left piece holds only the observer's column, which stands against the radar's frame+ // (ControlBar::fitRadarToMap); a side's left piece is empty and its shift is 0+ offset.x = barOffset.x + ( p == ControlBar::CB_PANEL_LEFT ? TheControlBar->getRadarColumnShift() : 0 );IRegion2D band, clip;band.lo.x = seams[ p ];band.hi.x = seams[ p + 1 ];diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex c82da0097..e10eb332b 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -105,6 +105,7 @@#include "GameClient/SelectionXlat.h"#include "GameClient/Shadow.h"#include "GameClient/GlobalLanguage.h"+#include "GameClient/UIStyle.h"#include "GameNetwork/NetworkInterface.h"@@ -1553,6 +1554,16 @@ InGameUI::InGameUI()m_superweaponTab = noHudTab();m_hudCellPass = 0;m_hudCellDrawnPass = 0;+ m_rackShown = FALSE;+ m_rackX = m_rackY = 0;+ m_rackRows = 0;+ m_rackStat = 0;+ m_rackArmies = FALSE;+ for( Int text = 0; text < RACK_TEXT_COUNT; text++ )+ {+ m_rackText[ text ] = NULL;+ m_rackTextPx[ text ] = m_rackTextRoom[ text ] = 0;+ }m_superweaponPosition.x = 0.7f;m_superweaponPosition.y = 0.7f;@@ -1659,6 +1670,8 @@ InGameUI::~InGameUI()TheDisplayStringManager->freeDisplayString( m_superweaponCellText[ text ] );TheDisplayStringManager->freeDisplayString( m_superweaponMoreText );TheDisplayStringManager->freeDisplayString( m_productionListMoreText );+ for( Int text = 0; text < RACK_TEXT_COUNT; text++ )+ TheDisplayStringManager->freeDisplayString( m_rackText[ text ] );}//-------------------------------------------------------------------------------------------------@@ -2047,16 +2060,25 @@ struct SpectatorStatsstd::map< const ThingTemplate *, Int > units; ///< how many of each unit with a cameo he has standing};-/** The number a list of players is ranked by. */+/** 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). */struct SpectatorStat{+ const char *label;Int SpectatorStats::*value;};static const SpectatorStat SPECTATOR_STATS[] ={- { &SpectatorStats::networth }+ { "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 }};+enum { SPECTATOR_STAT_COUNT = ARRAY_SIZE( SPECTATOR_STATS ) };static void addObjectStats( Object *obj, void *userData ){@@ -2075,12 +2097,32 @@ static void addObjectStats( Object *obj, void *userData )stats->units[ thing ]++;}+//-------------------------------------------------------------------------------------------------+/** A lobby seat the observer bar lists, player0 to player7 and not an observer: the Boss general sits+ * in one but is no playable side. Outside a multiplayer match the playable sides stand in. */+//-------------------------------------------------------------------------------------------------+static Bool isObserverSeat( const Player *player )+{+ if( !TheRecorder->isMultiplayer() )+ return player->isPlayableSide();+ if( player->isPlayerObserver() )+ return FALSE;+ for( Int slot = 0; slot < MAX_SLOTS; slot++ )+ {+ AsciiString name;+ name.format( "player%d", slot );+ if( TheNameKeyGenerator->nameToKey( name ) == player->getPlayerNameKey() )+ return TRUE;+ }+ return FALSE;+}+//-------------------------------------------------------------------------------------------------/** Everyone still in the match but leftOut with his numbers, ranked by `stat`, and the players in kept* who have lost. Allies both ways share a team number, counted in the order the teams first appear- * in the player list. */+ * in the player list. seats takes the observer bar's players instead of the playable sides. *///--------------------------------------------------------------------------------------------------static std::vector< SpectatorStats > gatherSpectatorStats( const SpectatorStat &stat, const Player *leftOut, PlayerMaskType kept = 0 )+static std::vector< SpectatorStats > gatherSpectatorStats( const SpectatorStat &stat, const Player *leftOut, PlayerMaskType kept = 0, Bool seats = FALSE ){std::vector< SpectatorStats > players;const UnsignedInt frame = TheGameLogic->getFrame();@@ -2088,7 +2130,7 @@ static std::vector< SpectatorStats > gatherSpectatorStats( const SpectatorStat &for( Int index = 0; index < ThePlayerList->getPlayerCount(); index++ ){Player *player = ThePlayerList->getNthPlayer( index );- if( player == NULL || player == leftOut || !player->isPlayableSide() )+ if( player == NULL || player == leftOut || !( seats ? isObserverSeat( player ) : player->isPlayableSide() ) )continue;if( !player->isPlayerActive() && ( player->getPlayerMask() & kept ) == 0 )continue;@@ -2403,6 +2445,514 @@ void InGameUI::runSpectatorAction( const std::string &action )TheGameEngine->setFramesPerSecondLimit( atoi( action.substr( REPLAY_SPEED.size() ).c_str() ) * replayNormalFramesPerSecond() / PERCENT );}+//-------------------------------------------------------------------------------------------------+// 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+// 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.+//-------------------------------------------------------------------------------------------------+enum+{+ RACK_W = 306, ///< every rack piece; its right side is the screen's edge+ RACK_SKIRT = 6, ///< a drawer's shadow over and left of its plate+ RACK_TRAY_GAP = 8, ///< the superweapon tray's foot to the watch drawer's plate+ RACK_NO_TRAY_DROP = 4, ///< the info strip's foot to the plate, no superweapons up+ RACK_TOP_H = 28,+ RACK_BODY_H = 50, ///< the watch drawer's plain plate, RackBody stretched+ RACK_WATCH_H = 86, ///< the watch drawer's plate ends this far under its top; the standings start there+ RACK_HEAD_TOP = 28,+ RACK_ROWS_TOP = 96, ///< the standings' first row under their top+ RACK_ROW_H = 30,+ RACK_FOOT_SOLID = 8, ///< RackBottom's rows above its shadow skirt+ RACK_DRAWER_W = 276,+ RACK_DRAWER_TUCK = 20, ///< the armies drawer's right end under the standings+ RACK_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_MIN_PX = 9, ///< the smallest a shrunk label goes+ RACK_LEVER_WELL_LEFT = 22, ///< the lever's well inside its bevel, which the stop words keep inside+ RACK_LEVER_WELL_RIGHT = 166,+ RACK_STOP_PAD = 3, ///< a stop word's clearance each side in its share of the well+ RACK_REFRESH_FRAMES = LOGICFRAMES_PER_SECOND / 2+};++static const char RACK_KEYS[] = "QWERTYA"; ///< the dial's stops, the letters pickSpectatorStatKey answers+static const Int RACK_LEVER_STOPS[ 3 ] = { 38, 94, 150 }; ///< Free, Director, Player, as ObserverCameraMode counts+static 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 UnsignedInt theRackStatsFrame = 0;+static Int theRackStatsStat = -1;++static UnicodeString broadcastNumber( const char *prefix, Int value );++/// a rack length at 1080, on this screen: the HUD's own scale, the one stripPixels uses+static Int rackPx( Real at1080 )+{+ return REAL_TO_INT_FLOOR( at1080 * ControlBarHudPageScale() / 1.8f + 0.5f );+}++static const Image *rackPiece( const char *name )+{+ AsciiString full;+ full.format( "ObserverPro%s", name );+ return TheMappedImageCollection->findImageByName( full );+}++/// a piece at its own size, or stretched to width by height; tinted by colour+static void drawRackPiece( const char *name, Int x, Int y, Int width = 0, Int height = 0, Color colour = 0xFFFFFFFF )+{+ const Image *piece = rackPiece( name );+ if( width == 0 )+ width = rackPx( piece->getImageWidth() );+ if( height == 0 )+ height = rackPx( piece->getImageHeight() );+ TheDisplay->drawImage( piece, x, y, x + width, y + height, colour );+}++/// the "H" state of a piece while the pointer is over it+static void drawRackState( const char *name, Bool hover, Int x, Int y )+{+ AsciiString state;+ state.format( "%s%s", name, hover ? "H" : "" );+ drawRackPiece( state.str(), x, y );+}++/// where the rack's drawers stand, from the pieces' left and the watch drawer's top+struct RackPlace+{+ Int x, y; ///< the watch drawer+ Int standings; ///< the standings drawer's top+ Int rows; ///< its first row's top+ Int drawer; ///< the armies drawer's left+ Int tabs; ///< the follow tabs' left+ Int right;+};++static RackPlace rackPlace( Int x, Int y, Bool armies )+{+ RackPlace at;+ at.x = x;+ at.y = y;+ at.standings = y + rackPx( RACK_WATCH_H );+ at.rows = at.standings + rackPx( RACK_ROWS_TOP );+ at.drawer = x - rackPx( RACK_DRAWER_W - RACK_DRAWER_TUCK );+ at.tabs = ( armies ? at.drawer : x ) - rackPx( RACK_TAB_OUT );+ at.right = TheDisplay->getWidth();+ return at;+}++static Bool rackInside( const ICoord2D &mouse, Int left, Int top, Int right, Int bottom )+{+ return 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 )+{+ 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;+}++static ICoord2D rackDialCentre( const RackPlace &at )+{+ ICoord2D centre;+ centre.x = at.x + rackPx( RACK_DIAL_X );+ centre.y = at.standings + rackPx( RACK_DIAL_Y );+ return centre;+}++static Bool rackOverDial( 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;+}++/// the player's colour, opaque: the tint the lens, the meter and the name take+static Color rackColour( const Player *player )+{+ UnsignedByte red, green, blue, alpha;+ GameGetColorComponents( clientPlayerColor( player ), &red, &green, &blue, &alpha );+ return GameMakeColor( red, green, blue, 255 );+}++/// where a follow tab's visible body starts, by its state: idle, the pointer over it, followed+static Int rackTabOut( Bool followed, Bool hover )+{+ return rackPx( followed ? 2 : ( hover ? 15 : 22 ) );+}++/// a row's number as the standings write it+static UnicodeString rackValueText( Int stat, const SpectatorStats &stats )+{+ const Int SpectatorStats::*field = SPECTATOR_STATS[ stat ].value;+ const Int value = stats.*field;+ UnicodeString text;+ if( field == &SpectatorStats::cash && stats.unlimited )+ text = TheGameText->fetch( "GUI:StartingMoneyUnlimited" );+ else if( field == &SpectatorStats::income )+ text.format( TheGameText->fetch( "GUI:HudStatIncomeValue" ), broadcastNumber( "$", value ).str() );+ else if( field == &SpectatorStats::kills )+ text.format( u"%d / %d", stats.kills, stats.losses );+ else if( field == &SpectatorStats::rank )+ text.format( TheGameText->fetch( "GUI:HudStatRankValue" ), value );+ else if( field == &SpectatorStats::power )+ text.format( u"%+d", value );+ else+ text = broadcastNumber( "$", value );+ return text;+}++enum RackAlign { RACK_ALIGN_LEFT, RACK_ALIGN_CENTRE, RACK_ALIGN_RIGHT };++/// bold, its shadow a pixel down and right, in the box left..right top..bottom, middled in height+static void drawRackText( DisplayString *text, Int left, Int top, Int right, Int bottom, Int pad, RackAlign align, Color colour )+{+ Int width = 0, height = 0;+ text->getSize( &width, &height );+ Int x = left + pad;+ if( align == RACK_ALIGN_CENTRE )+ x = ( left + right - width ) / 2;+ else if( align == RACK_ALIGN_RIGHT )+ x = right - pad - width;+ text->draw( x, ( top + bottom - height ) / 2, colour, GameMakeColor( 0, 0, 0, 255 ) );+}++DisplayString *InGameUI::rackText( Int slot, const UnicodeString &text, Int px, Int room )+{+ DisplayString *&string = m_rackText[ slot ];+ if( string == NULL )+ string = TheDisplayStringManager->newDisplayString();+ else if( m_rackTextPx[ slot ] == px && m_rackTextRoom[ slot ] == room && string->getText().compare( text ) == 0 )+ return string;+ m_rackTextPx[ slot ] = px;+ m_rackTextRoom[ slot ] = room;+ string->setText( text );+ // the face's em is its point size at 96 dots an inch+ for( Int size = px; ; size-- )+ {+ string->setFont( TheFontLibrary->getFont( m_superweaponNormalFont, max( rackPx( size * 0.75f ), 1 ), TRUE ) );+ Int width = 0, height = 0;+ string->getSize( &width, &height );+ if( room <= 0 || width <= room || size <= RACK_MIN_PX )+ break;+ }+ return string;+}++//-------------------------------------------------------------------------------------------------+/** 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+ * in the order the pieces overlap: the tabs, the armies drawer, the watch drawer, the standings,+ * then every word and number. */+//-------------------------------------------------------------------------------------------------+void InGameUI::drawSpectatorRack( Int plateTop )+{+ const UnsignedInt frame = TheGameLogic->getFrame();+ if( theRackStatsStat != m_rackStat || frame < theRackStatsFrame || frame >= theRackStatsFrame + RACK_REFRESH_FRAMES )+ {+ theRackStats = gatherSpectatorStats( SPECTATOR_STATS[ m_rackStat ], ThePlayerList->getLocalPlayer(), PLAYERMASK_ALL, TRUE );+ theRackStatsFrame = frame;+ theRackStatsStat = m_rackStat;+ }++ const Color GREY = GameMakeColor( 138, 148, 159, 255 );+ const Color WHITE = GameMakeColor( 240, 244, 246, 255 );+ const Color LIT = GameMakeColor( 128, 149, 234, 255 );+ const Color GOLD = GameMakeColor( 242, 194, 48, 255 );++ m_rackX = TheDisplay->getWidth() - rackPx( RACK_W );+ m_rackY = plateTop - rackPx( RACK_SKIRT );+ m_rackRows = min( (Int)theRackStats.size(), (Int)RACK_ROWS );+ const RackPlace at = rackPlace( m_rackX, m_rackY, m_rackArmies );+ const Int X = at.x, Y = at.y, Y2 = at.standings, rows = m_rackRows;+ const ICoord2D mouse = TheMouse->getMouseStatus()->pos;+ const Int followed = TheObserverCamera.getFollowedPlayerIndex();+ auto rowTop = [ &at ]( Int row ) { return at.rows + rackPx( RACK_ROW_H * row ); };++ // the most a stat's number is, which the meters are a share of+ Int highest = 0;+ for( Int row = 0; row < rows; row++ )+ highest = max( highest, theRackStats[ row ].*SPECTATOR_STATS[ m_rackStat ].value );+ if( highest <= 0 )+ highest = 1;++ typedef std::pair< const ThingTemplate *, Int > UnitCount;+ std::vector< UnitCount > units[ RACK_ROWS ];++ TheDisplay->beginBatch2D();+ for( Int row = 0; row < rows; row++ )+ {+ const Int top = rowTop( row );+ const Player *player = theRackStats[ row ].player;+ 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 ) );+ 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 );+ }++ if( m_rackArmies )+ {+ drawRackPiece( "DrawerTop", at.drawer, at.rows - rackPx( RACK_DRAWER_TOP_H ) );+ for( Int row = 0; row < rows; row++ )+ drawRackPiece( "DrawerRow", at.drawer, rowTop( row ) );+ drawRackPiece( "DrawerBottom", at.drawer, rowTop( rows ) );+ for( Int row = 0; row < rows; row++ )+ {+ std::vector< UnitCount > &kinds = units[ row ];+ kinds.assign( theRackStats[ row ].units.begin(), theRackStats[ row ].units.end() );+ std::stable_sort( kinds.begin(), kinds.end(), []( const UnitCount &a, const UnitCount &b ) { return a.second > b.second; } );+ if( kinds.size() > RACK_ARMY_UNITS )+ kinds.resize( RACK_ARMY_UNITS );+ const Int top = rowTop( row );+ for( Int cell = 0; cell < (Int)kinds.size(); cell++ )+ TheDisplay->drawImage( kinds[ cell ].first->getButtonImage(),+ at.drawer + rackPx( 22 + 39 * cell ) + 1, top + rackPx( 3 ) + 1,+ at.drawer + rackPx( 58 + 39 * cell ) - 1, top + rackPx( 27 ) - 1 );+ }+ }++ // the watch drawer: the lever at the camera's stop, the fog's and the armies drawer's rockers+ const Int camera = (Int)TheObserverCamera.getMode();+ const Bool overLever = rackInside( mouse, X + rackPx( 16 ), Y + rackPx( 30 ), X + rackPx( 172 ), Y + rackPx( 62 ) );+ const Bool overFog = rackInside( mouse, X + rackPx( 186 ), Y + rackPx( 30 ), X + rackPx( 232 ), Y + rackPx( 62 ) );+ const Bool overArmies = rackInside( mouse, X + rackPx( 246 ), Y + rackPx( 30 ), X + rackPx( 292 ), Y + rackPx( 62 ) );+ const Bool fog = TheObserverCamera.isFogOn();+ drawRackPiece( "RackTop", X, Y );+ drawRackPiece( "RackBody", X, Y + rackPx( RACK_TOP_H ), rackPx( RACK_W ), rackPx( RACK_BODY_H ) );+ drawRackPiece( "RackBottom", X, Y + rackPx( RACK_TOP_H + RACK_BODY_H ) );+ drawRackPiece( "RackTally", X + rackPx( 160 ), Y + rackPx( 9 ) );+ drawRackState( RACK_LEVERS[ camera ], overLever, X + rackPx( 16 ), Y + rackPx( 30 ) );+ 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;+ 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 row = 0; row < rows; row++ )+ {+ const Int top = rowTop( row );+ const SpectatorStats &stats = theRackStats[ row ];+ TheDisplay->drawImage( ControlBarSideEmblem( stats.player->getPlayerTemplate() ),+ X + rackPx( 23 ), top + rackPx( 5 ), X + rackPx( 53 ), 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 );+ if( fill > 0 )+ drawRackPiece( "RackMeter", X + rackPx( 59 ), top + rackPx( 23 ), fill, rackPx( 2 ), rackColour( stats.player ) );+ }+ TheDisplay->endBatch2D();++ // the words, all upper case but the names and the numbers+ drawRackText( 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 );+ // each stop's word in its share of the well, split halfway between the stops, all three one size+ DisplayString *stopWords[ 3 ];+ Int stopLefts[ 3 ], stopRights[ 3 ];+ GameFont *stopFont = NULL;+ for( Int stop = 0; stop < 3; stop++ )+ {+ stopLefts[ stop ] = X + rackPx( stop == 0 ? RACK_LEVER_WELL_LEFT : ( RACK_LEVER_STOPS[ stop - 1 ] + RACK_LEVER_STOPS[ stop ] ) / 2 );+ stopRights[ stop ] = X + rackPx( stop == 2 ? RACK_LEVER_WELL_RIGHT : ( RACK_LEVER_STOPS[ stop ] + RACK_LEVER_STOPS[ stop + 1 ] ) / 2 );+ stopWords[ stop ] = rackText( RACK_TEXT_STOP + stop, UIStyle::capitals( TheGameText->fetch( RACK_LEVER_LABELS[ stop ] ) ), 11,+ stopRights[ stop ] - stopLefts[ stop ] - 2 * rackPx( RACK_STOP_PAD ) );+ if( stopFont == NULL || stopWords[ stop ]->getFont()->pointSize < stopFont->pointSize )+ stopFont = stopWords[ stop ]->getFont();+ }+ for( Int stop = 0; stop < 3; stop++ )+ {+ if( stopWords[ stop ]->getFont() != stopFont )+ stopWords[ stop ]->setFont( stopFont );+ drawRackText( stopWords[ stop ], stopLefts[ stop ], Y + rackPx( 61 ), stopRights[ stop ], Y + rackPx( 74 ), 0, RACK_ALIGN_CENTRE,+ stop == camera ? LIT : GREY );+ }+ drawRackText( rackText( RACK_TEXT_FOG, UIStyle::capitals( TheGameText->fetch( "GUI:HudFog" ) ), 11, rackPx( 58 ) ),+ X + rackPx( 180 ), Y + rackPx( 61 ), X + rackPx( 238 ), Y + rackPx( 74 ), 0, RACK_ALIGN_CENTRE, fog ? LIT : GREY );+ drawRackText( rackText( RACK_TEXT_ARMIES, UIStyle::capitals( TheGameText->fetch( "GUI:HudArmies" ) ), 11, rackPx( 58 ) ),+ X + rackPx( 240 ), Y + rackPx( 61 ), X + rackPx( 298 ), Y + rackPx( 74 ), 0, RACK_ALIGN_CENTRE, m_rackArmies ? LIT : GREY );++ 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 );+ for( 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 );++ 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 );++ // each kind's count on a dark plate in its cell's bottom right+ for( Int cell = 0; cell < (Int)units[ row ].size(); cell++ )+ {+ UnicodeString count;+ count.format( u"%d", units[ row ][ cell ].second );+ DisplayString *text = rackText( RACK_TEXT_UNITS + row * RACK_ARMY_UNITS + cell, count, 10, 0 );+ Int width = 0, height = 0;+ text->getSize( &width, &height );+ const Int cellRight = at.drawer + rackPx( 58 + 39 * cell ), cellBottom = top + rackPx( 27 );+ const Int plateLeft = cellRight - width - rackPx( 5 ), plateTopY = cellBottom - rackPx( 12 );+ TheDisplay->drawFillRect( plateLeft, plateTopY, cellRight - rackPx( 2 ) - plateLeft, rackPx( 10 ), GameMakeColor( 6, 9, 15, 230 ) );+ drawRackText( text, plateLeft, plateTopY, cellRight - rackPx( 3 ), plateTopY + rackPx( 10 ), 0, RACK_ALIGN_RIGHT, WHITE );+ }+ }+ m_rackShown = TRUE;+}++//-------------------------------------------------------------------------------------------------+/** The rack is drawn over the world rather than in a window, so a press anywhere on its plates, a+ * follow tab or the armies drawer is its own, as on a HUD cell; between the watch drawer and the+ * standings the world shows, and takes the click. The boxes are the last draw's, under the same+ * pass stamp as the cells (handleHudCellClick). */+//-------------------------------------------------------------------------------------------------+Bool InGameUI::handleSpectatorRackClick( const ICoord2D *mouse, Bool act )+{+ if( !m_rackShown || m_hudCellDrawnPass + 1 != m_hudCellPass )+ return FALSE;++ const RackPlace at = rackPlace( m_rackX, m_rackY, m_rackArmies );+ const Int X = at.x, Y = at.y;+ const Int foot = at.rows + rackPx( RACK_ROW_H * m_rackRows + RACK_FOOT_SOLID );+ const Int followed = TheObserverCamera.getFollowedPlayerIndex();++ // a row's tab with the whole row: follow him, or nobody when he already is+ for( Int row = 0; row < m_rackRows; row++ )+ {+ const Int top = at.rows + rackPx( RACK_ROW_H * row );+ const Bool on = m_rackRowPlayer[ row ] == followed;+ if( !rackInside( *mouse, at.tabs + rackTabOut( on, !on ), top + rackPx( 3 ), at.right, top + rackPx( 27 ) ) )+ continue;+ if( act )+ runSpectatorAction( on ? FOLLOW_ACTION + FOLLOW_NOBODY : FOLLOW_ACTION + std::to_string( m_rackRowPlayer[ row ] ) );+ return TRUE;+ }++ if( rackInside( *mouse, X + rackPx( RACK_SKIRT ), Y + rackPx( RACK_SKIRT ), at.right, Y + rackPx( RACK_WATCH_H ) ) )+ {+ if( !act )+ return TRUE;+ if( rackInside( *mouse, X + rackPx( 16 ), Y + rackPx( 30 ), X + rackPx( 172 ), Y + rackPx( 62 ) ) )+ {+ // the stop nearest the pointer+ Int stop = 0;+ for( Int each = 1; each < 3; each++ )+ if( abs( mouse->x - X - rackPx( RACK_LEVER_STOPS[ each ] ) ) < abs( mouse->x - X - rackPx( RACK_LEVER_STOPS[ stop ] ) ) )+ stop = each;+ runSpectatorAction( CAMERA_ACTION + *RACK_CAMERAS[ stop ] );+ }+ else if( rackInside( *mouse, X + rackPx( 186 ), Y + rackPx( 30 ), X + rackPx( 232 ), Y + rackPx( 62 ) ) )+ runSpectatorAction( FOG_ACTION );+ else if( rackInside( *mouse, X + rackPx( 246 ), Y + rackPx( 30 ), X + rackPx( 292 ), Y + rackPx( 62 ) ) )+ m_rackArmies = !m_rackArmies;+ return TRUE;+ }++ 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 ) );+ return TRUE;+ }++ return m_rackArmies && rackInside( *mouse, at.drawer + rackPx( RACK_SKIRT ), at.rows - rackPx( 9 ), X + rackPx( RACK_SKIRT ), foot );+}++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 ) ) )+ 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 bar. */+//-------------------------------------------------------------------------------------------------+Bool InGameUI::pickSpectatorStat( Int commandSlot )+{+ // the last draw's flag outlives a pass that drew nothing, a load screen's; the watch is asked again+ if( !m_rackShown || !localPlayerWatching() || commandSlot >= SPECTATOR_STAT_COUNT )+ return FALSE;+ m_rackStat = commandSlot;+ return TRUE;+}++//-------------------------------------------------------------------------------------------------+/** The same keys as letters, so the dial answers 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. */+//-------------------------------------------------------------------------------------------------+Bool InGameUI::pickSpectatorStatKey( Int key, Int keyState )+{+ static const Int KEYS[ SPECTATOR_STAT_COUNT ] = { KEY_Q, KEY_W, KEY_E, KEY_R, KEY_T, KEY_Y, KEY_A };+ if( !m_rackShown || !localPlayerWatching() || ( keyState & ( KEY_STATE_CONTROL | KEY_STATE_SHIFT | KEY_STATE_ALT ) ) )+ return FALSE;+ for( Int stat = 0; stat < SPECTATOR_STAT_COUNT; stat++ )+ {+ if( KEYS[ stat ] != key )+ continue;+ if( keyState & KEY_STATE_DOWN )+ m_rackStat = stat;+ return TRUE;+ }+ return FALSE;+}+void InGameUI::handleBuildPlacements( void ){@@ -6886,6 +7436,8 @@ void InGameUI::postDraw( void )// want to display the timers -- Eva still needs to be checkedm_superweaponCells = 0; // nothing drawn is nothing to clickm_superweaponTab = noHudTab();+ // the spectator's rack hangs under the superweapon tray when there is one+ Int rackPlateTop = max( hudStripBottom(), TheUIRect().y ) + stripPixels( RACK_NO_TRAY_DROP );if (TheGameLogic->getFrame() > 0 ){//@@ -7076,6 +7628,7 @@ void InGameUI::postDraw( void )// under the last row's cell at the screen edge, below the tray's own bottom edgeconst IRegion2D &lastRow = m_superweaponPlace[ ( cameos - 1 ) / SUPERWEAPON_LIST_COLUMNS * SUPERWEAPON_LIST_COLUMNS ];m_superweaponTab = more ? hudTab( 1, lastRow.hi.y + style.superweapon.uncoveredH, 1 ) : noHudTab();+ rackPlateTop = max( lastRow.hi.y + style.superweapon.uncoveredH, m_superweaponTab.hi.y ) + rackPx( RACK_TRAY_GAP );TheDisplay->beginBatch2D();drawHudTray( style.superweapon, m_superweaponPlace, cameos, SUPERWEAPON_LIST_COLUMNS, -1, -1 );@@ -7113,6 +7666,12 @@ void InGameUI::postDraw( void )}}+ // the spectator's own controls and standings, only while watching: the other side's worth is not+ // a player's to know+ m_rackShown = FALSE;+ if( TheGameLogic->getFrame() > 0 && !TheGameLogic->isInShellGame() && localPlayerWatching() )+ drawSpectatorRack( rackPlateTop );+// draw named timersif (TheGameLogic->getFrame() > 0 && m_showNamedTimers){diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cppindex 3f44d53e2..97e3795d8 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp@@ -2987,7 +2987,11 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessagecase GameMessage::MSG_META_COMMAND_SLOT17:case GameMessage::MSG_META_COMMAND_SLOT18:{- TheControlBar->pressCommandButton( t - GameMessage::MSG_META_COMMAND_SLOT01 );+ // a watcher has no commands to press, and the first keys pick the rack's stat instead, the+ // keys Dota's spectator uses for the same list+ const Int slot = t - GameMessage::MSG_META_COMMAND_SLOT01;+ if( !TheInGameUI->pickSpectatorStat( slot ) )+ TheControlBar->pressCommandButton( slot );disp = DESTROY_MESSAGE;break;} // end command bar grid slotsdiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cppindex 6aa2df582..17996a4ca 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp@@ -488,6 +488,9 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessaMappableKeyType key = (MappableKeyType)msg->getArgument(0)->integer;Int keyState = msg->getArgument(1)->integer;+ if( TheInGameUI && TheInGameUI->pickSpectatorStatKey( key, keyState ) )+ return DESTROY_MESSAGE;+// for our purposes here, we don't care to distinguish between right and left keys,// so just fudge a little to simplify things.Int newModState = 0;diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cppindex d04b8d3ce..149360564 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp@@ -156,7 +156,8 @@ GameMessageDisposition PlaceEventTranslator::translateGameMessage(const GameMesscase GameMessage::MSG_RAW_MOUSE_RIGHT_DOUBLE_CLICK:{m_cellRightClickTaken = FALSE;- if( TheInGameUI->handleHudCellClick( &msg->getArgument(0)->pixel, TRUE ) )+ if( TheInGameUI->handleSpectatorRackClick( &msg->getArgument(0)->pixel, FALSE )+ || TheInGameUI->handleHudCellClick( &msg->getArgument(0)->pixel, TRUE ) ){m_cellRightClickTaken = TRUE;return DESTROY_MESSAGE;@@ -173,6 +174,9 @@ GameMessageDisposition PlaceEventTranslator::translateGameMessage(const GameMess//case GameMessage::MSG_RAW_MOUSE_WHEEL:{+ // over the spectator's rack the wheel turns the stat dial and never zooms+ if( TheInGameUI->handleSpectatorRackWheel( &msg->getArgument( 0 )->pixel, msg->getArgument( 1 )->real ) )+ return DESTROY_MESSAGE;if( TheInGameUI->getPendingPlaceType() && TheInGameUI->isPlacementAnchored() &&TheInGameUI->placesRow() ){@@ -203,7 +207,8 @@ GameMessageDisposition PlaceEventTranslator::translateGameMessage(const GameMess// the production and superweapon cells lie over the world, not in a window: take a press on// one before placement, and long before selection makes a move order of it. Ctrl cancelsm_cellClickTaken = FALSE;- if( TheInGameUI->handleHudCellClick( &msg->getArgument(0)->pixel, TheKeyboard->isCtrl() ) )+ if( TheInGameUI->handleSpectatorRackClick( &msg->getArgument(0)->pixel, TRUE )+ || TheInGameUI->handleHudCellClick( &msg->getArgument(0)->pixel, TheKeyboard->isCtrl() ) ){m_cellClickTaken = TRUE;return DESTROY_MESSAGE;diff --git a/GeneralsMD/Code/Tools/hud_command_bar.py b/GeneralsMD/Code/Tools/hud_command_bar.pyindex 92af690fa..c3ce59fd4 100644--- a/GeneralsMD/Code/Tools/hud_command_bar.py+++ b/GeneralsMD/Code/Tools/hud_command_bar.py@@ -24,12 +24,15 @@ window and button, the surface of the metal and what is fixed to it. America isat 45 degrees with the emblem's chevrons; China is cast armour in square terraces held by rivets; theGLA is scrap sheet welded and bolted over a ragged frame; Turkiye is composite armour of triangularfacets with 30 degree cuts. The emblem in every side's selection window is the launcher's-(launcher/ui/emblem.svg beside this checkout, or --emblem). The observer's bar is a different layout-and is not drawn here.-- python Tools/hud_command_bar.py --out DIR [--side all|America|China|Gla|Turkiye] [--dds TEXTURES]- writes DIR/ReforgedHud<Side>CommandBar.png, ...CommandBarWide.png and ...Powers.png, and with- --dds the same as DXT5 .dds into TEXTURES (Data/Art/Textures)+(launcher/ui/emblem.svg beside this checkout, or --emblem). The observer has a build of its own, the+console (anodised graphite, every corner a radius, grilles, screws, the emblem's feathers and a tally+lamp): its bar, the watched player's panel, a sheet of pieces (toolbar buttons, the rows' rings, the+radar frame's nine, every side's and general's emblem) and the spectator's rack (ReforgedHudObsSpec).++ python Tools/hud_command_bar.py --out DIR [--side all|Observer|America|China|Gla|Turkiye] [--dds TEXTURES]+ writes DIR/ReforgedHud<Side>CommandBar.png, ...CommandBarWide.png and ...Powers.png for each side+ and the observer's ReforgedHudObsCommandBar, ...ObsPlayerWindow, ...ObsPieces and ...ObsSpec, and+ with --dds the same as DXT5 .dds into TEXTURES (Data/Art/Textures)"""import argparseimport os@@ -82,6 +85,21 @@ BUILDS = {"faceted": dict(metric="edt", bevel=7.0, corner="slant"),}++def rounded(r):+ """An edge profile like a bullnose: a quarter circle r texels wide, steep at the edge and flat on top."""+ def profile(d, scale):+ return np.sqrt(np.clip(1 - (1 - np.clip(d / (r * scale), 0, 1)) ** 2, 0, 1))+ return profile+++# The observer's console (round 9 prototype, --observer): no side's build, a broadcast desk in the same+# steel. Every corner a radius, every edge a bullnose, anodised graphite with perforated grilles, cross+# head screws, the emblem's wing feathers and a red tally lamp. Not in SIDES, so nothing ships with it.+BUILDS["console"] = dict(metric="edt", profile=rounded(5.0), corner="round")+OBSERVER = dict(build="console", steel=(112, 118, 128), glass=(6, 9, 15), glass_lo=(12, 16, 24),+ accent=BLUE, accent2=RED, scheme="Observer8x6")+# materialsSTEEL, GLASS, ACCENT, ACCENT2, GOLDM, INKM, BRIGHT, DARK, PAPERM, DIM, HILITE = range(11)METAL = (STEEL, DARK, BRIGHT)@@ -125,6 +143,8 @@ def corner_points(kind, c):return [(0, c), (c, c), (c, 0)]if kind == "slant": # a 30 degree cut, long along the topreturn [(0, c), (c * 1.73, 0)]+ if kind == "round": # a radius, the observer's console (prototype)+ return [(c - c * np.cos(a), c - c * np.sin(a)) for a in np.linspace(0, np.pi / 2, 8)]return [(0, 0)]@@ -313,6 +333,14 @@ class Painter:self.alpha[sl] &= ~mreturn sl, m+ def ramp(self, polys, left, right):+ """Tilt what is inside the polygons: left added at their left edge, right at their right."""+ sl, m = self.local(polys)+ xs = np.nonzero(m.any(axis=0))[0]+ t = np.clip((np.arange(m.shape[1]) - xs[0]) / max(xs[-1] - xs[0], 1), 0, 1)[None, :]+ self.h[sl] += (left + (right - left) * t) * m+ return sl, m+def stud(self, cx, cy, r, height=1.8):self.bump([octagon(cx - r, cy - r, cx + r, cy + r, r * 0.42)], height, r * 0.6, BRIGHT)@@ -390,6 +418,9 @@ def shade(p, side, seams=(), shadow=True, seed=7, falloff=True):elif build == "scavenged": # mill scale and wear, no grain directiongrain = 1.0 + 0.09 * mottle + 0.045 * fine + 0.04 * noise(3 * SS)spec_base, rough_base = 0.32, 18.0+ elif build == "console": # anodised: even, a faint grain, semi-gloss+ grain = 1.0 + 0.03 * mottle + 0.02 * fine+ spec_base, rough_base = 0.5, 30.0else: # composite: matte and evengrain = 1.0 + 0.035 * mottle + 0.03 * finespec_base, rough_base = 0.25, 16.0@@ -653,9 +684,9 @@ BARS = {"machined": bar_machined, "terraced": bar_terraced, "scavenged": bar_sca# ---------------------------------------------------------------------------------------------- the button sheet-def read_mapped(side_name):- """Every MappedImage of the side's Powers sheet: name -> (x0, y0, x1, y1)."""- path = os.path.join(HERE, "..", "Data", "INI", "MappedImages", "HandCreated", "ReforgedHud%sPowers.ini" % side_name)+def read_mapped(side_name, sheet="Powers"):+ """Every MappedImage of ReforgedHud<side><sheet>.ini: name -> (x0, y0, x1, y1)."""+ path = os.path.join(HERE, "..", "Data", "INI", "MappedImages", "HandCreated", "ReforgedHud%s%s.ini" % (side_name, sheet))text = open(path, encoding="latin-1").read()out = {}for m in re.finditer(r"MappedImage\s+(\S+).*?Left:(\d+)\s+Top:(\d+)\s+Right:(\d+)\s+Bottom:(\d+)", text, re.S):@@ -725,6 +756,12 @@ def icon(kind, cx, cy, build):if kind == "General":# three stars set on a shallow chevron, the middle one larger and higherreturn [star(cx - 21, cy + 1.5, 6.5), star(cx, cy - 0.5, 9.0), star(cx + 21, cy + 1.5, 6.5)], []+ if kind == "Back": # the observer's way back to the list (prototype)+ return [[(cx - 11, cy), (cx - 3, cy - 8), (cx - 3, cy - 3), (cx + 11, cy - 3), (cx + 11, cy + 3), (cx - 3, cy + 3),+ (cx - 3, cy + 8)]], []+ if kind == "Close": # the powers window's close (prototype)+ bar = plate(cx - 13, cy - 2.6, cx + 13, cy + 2.6)+ return [rotated(bar, cx, cy, 45), rotated(bar, cx, cy, -45)], []raise ValueError(kind)@@ -738,20 +775,34 @@ def star(cx, cy, r, inner=0.42):return pts+BEZEL_SCALE = 0.67 # a button's bezel chamfer against its build's plates+BEZEL_FACE_INSET = 4 # texels from the button's edge to its sunk face++def button(p, r, kind, state, build):"""A bezel in the side's build round a dark face carrying the glyph; state is '', 'H', 'P' or 'I'."""x0, y0, x1, y1 = rbezel = {"": STEEL, "H": BRIGHT, "P": STEEL, "I": DARK}[state]glyph = {"": PAPERM, "H": GOLDM, "P": HILITE, "I": DIM}[state]- p.frame([shape(build, x0, y0, x1, y1, 5)], 2.0 if state == "P" else 3.5, build, bezel, 0.67)- p.sink([shape(build, x0 + 4, y0 + 4, x1 - 4, y1 - 4, 3)], 2.5 if state == "P" else 1.4, 1.0)+ p.frame([shape(build, x0, y0, x1, y1, 5)], 2.0 if state == "P" else 3.5, build, bezel, BEZEL_SCALE)+ inner = (x0 + BEZEL_FACE_INSET, y0 + BEZEL_FACE_INSET, x1 - BEZEL_FACE_INSET, y1 - BEZEL_FACE_INSET)+ p.sink([shape(build, *inner, 3)], 2.5 if state == "P" else 1.4, 1.0)if build == "terraced":for x in (x0 + 2.2, x1 - 2.2):p.rivet(x, (y0 + y1) / 2, 1.3)elif build == "scavenged":p.bolt(x1 - 3, y0 + 3, 1.6, x0)if state == "H":- p.inlay([plate(x0 + 6, y1 - 6, x1 - 6, y1 - 5)], HILITE, 0.2)+ # the close button's rule is two texels over the face's lower lip and 8 in from each side, so+ # each DXT5 block it touches holds only the dark face and the blue: one texel of it, sharing a+ # block with the lip's crest or the bezel, lost its blue in most blocks+ inset, foot = (8, 4) if kind == "Close" else (6, 5)+ sl, m = p.inlay([plate(x0 + inset, y1 - 6, x1 - inset, y1 - foot)], HILITE, 0.2)+ if kind == "Close" and BUILDS[build].get("bevel", 1.0) * BEZEL_SCALE > BEZEL_FACE_INSET:+ # laid flat where the bezel's chamfer runs on under the face (the faceted build's 4.7+ # texels): on the slope the rule lit as a grey-to-pale gradient that DXT5 smeared into the+ # white lip below, and in game it read as part of the lip+ p.h[sl][m] = p.h[sl][m].max()off = 1 if state == "P" else 0raised, ink, *again = icon(kind.replace("Idle", ""), (x0 + x1) / 2 + off, (y0 + y1) / 2 + off, build)p.bump(raised, 1.1, 0.6, glyph)@@ -761,49 +812,153 @@ def button(p, r, kind, state, build):p.bump(polys, 1.1, 0.6, glyph)-def power_window(p, x0, y0, build):- """The general's powers window, 542x598, its openings where GeneralsExpPoints.wnd puts them."""+# The general's promotion window (round 9's B, picked by the owner on 2026-11-03). Same 542x598 picture+# and every opening where GeneralsExpPoints.wnd puts it: the four text bands, the rank 1, 3 and 8 cells,+# the points readout and the close button. The powers' icons cover their cells whole, so what shows is+# the frame, the gaps, the margins, the right column's two sockets and any slot a side leaves empty. The+# outline steps in round the points and close sockets, which stand on bosses of their own; each rank is+# one tray parted by mullions, its empty slots dark wells; the rank's stars run down the left margin+# (one, three and five: rank 8 is the five-star general). The close button is the side's own+# (<S>ProGenPowerClose{,H,I}, 60x50, where the Powers INI maps it).+PROMO_R1 = [(18 + 102 * i, 54, 116 + 102 * i, 132) for i in range(4)]+PROMO_R3 = [(18 + 102 * i, 178 + 82 * j, 116 + 102 * i, 256 + 82 * j) for i in range(5) for j in range(3)]+PROMO_R8 = [(18 + 102 * i, 466, 116 + 102 * i, 544) for i in range(4)]+PROMO_BANDS = [(13, 17, 529, 45), (17, 141, 525, 169), (17, 429, 525, 457), (13, 553, 529, 581)]+PROMO_POINTS, PROMO_CLOSE = (450, 68, 510, 118), (450, 480, 510, 530)+PROMO_STARS = ((93, 1), (299, 3), (505, 5))+++def promo_window(p, x0, y0, build):def r(a, b, c, d):return (x0 + a, y0 + b, x0 + c, y0 + d)- outer = shape(build, *r(0, 0, 542, 598), 18)- p.silhouette([jitter(outer, 5, 2.0) if build == "scavenged" else outer], 4.0, build)- p.frame([shape(build, *r(7, 7, 535, 591), 13)], 7.0, build, STEEL)- for band in ((13, 17, 529, 45), (17, 141, 525, 169), (17, 429, 525, 457), (13, 553, 529, 581)):- window(p, r(*band), 3, 2, 0, 4, build=build)- cells = [(18 + 102 * i, 54, 116 + 102 * i, 132) for i in range(4)]- cells += [(18 + 102 * i, 178 + 82 * j, 116 + 102 * i, 256 + 82 * j) for i in range(5) for j in range(3)]- cells += [(18 + 102 * i, 466, 116 + 102 * i, 544) for i in range(4)]- for c in cells:- window(p, r(*c), 6, 3 if build != "terraced" else 1.2, 2, 3 if build != "machined" else 0, build=build)- window(p, r(450, 68, 510, 118), 5, 3, 2, 6, build=build) # rank points available- window(p, r(450, 480, 510, 530), 3, 2, 2, 6, STEEL, build) # the close button's socket++ def R(rect, g=0):+ return grow(r(*rect), g)+ W, H = 542, 598+ # the outline cuts the right column back beside the rank 1 and rank 8 rows (x 430 on), leaving the+ # points and close sockets on bosses of their own+ notch = 8 if build != "terraced" else 6+ body = [(0, 0), (W, 0), (W, 50), (430, 50), (430, 136), (W, 136), (W, 462), (430, 462), (430, 548), (W, 548), (W, H), (0, H)]+ k = BUILDS[build]["corner"]+ if k == "slant":+ body = [(0, 10), (17, 0), (W - 10, 0), (W, 6), (W, 46), (434, 50), (430, 56), (430, 130), (434, 136), (W, 140), (W, 458),+ (434, 462), (430, 468), (430, 542), (434, 548), (W, 552), (W, H - 6), (W - 10, H), (17, H), (0, H - 10)]+ elif k == "notch":+ body = [(0, notch), (notch, notch), (notch, 0), (W - notch, 0), (W - notch, notch), (W, notch), (W, 50), (430, 50), (430, 136),+ (W, 136), (W, 462), (430, 462), (430, 548), (W, 548), (W, H - notch), (W - notch, H - notch), (W - notch, H),+ (notch, H), (notch, H - notch), (0, H - notch)]+ else:+ c = 14+ body = [(0, c), (c, 0), (W - c, 0), (W, c), (W, 44), (W - 6, 50), (430, 50), (430, 136), (W - 6, 136), (W, 142), (W, 456),+ (W - 6, 462), (430, 462), (430, 548), (W - 6, 548), (W, 554), (W, H - c), (W - c, H), (c, H), (0, H - c)]+ body = [(x0 + x, y0 + y) for x, y in body]+ # each boss on a short bracket back to the body+ bosses = [shape(build, *R(PROMO_POINTS, 14), 9), shape(build, *R(PROMO_CLOSE, 14), 9),+ plate(*r(424, 86, 440, 100)), plate(*r(424, 498, 440, 512))]+ if build == "scavenged":+ body = jitter(body, 5, 2.0)+ bosses = [jitter(b, 6 + i, 1.4, 8) for i, b in enumerate(bosses)]++ def inner(i, c):+ """The plate laid on the frame, i texels in, its outline stepped like the body's."""+ k = BUILDS[build]["corner"] if BUILDS[build]["corner"] != "rough" else "cut"+ return [plate(*r(i, i, W - i, 50 - i), tl=(k, c), tr=(k, c)), plate(*r(i, i, 430 - i, H - i), tl=(k, c), bl=(k, c)),+ plate(*r(i, 136 + i, W - i, 462 - i), tr=(k, c * 0.5), br=(k, c * 0.5)),+ plate(*r(i, 548 + i, W - i, H - i), bl=(k, c), br=(k, c))] + \+ [shape(build, *R(b, 14 - i), 7) for b in (PROMO_POINTS, PROMO_CLOSE)]++ # the frame, each build its own way+ if build == "machined": # a dark flange, a satin plate on it+ p.silhouette([body] + bosses, 4.0, build)+ p.raise_plate(inner(6, 12), 7.0, 3.0, STEEL)+ elif build == "terraced": # cast in square terraces, the outer one dark+ sl, m, d = p.silhouette([body] + bosses, 11.0, build, STEEL)+ p.mat[sl][m & (d < 5)] = DARK+ elif build == "scavenged": # a ragged frame, scrap sheets laid round it+ p.silhouette([body] + bosses, 3.0, build)+ for k, ((a, b, c, e), deg, tint) in enumerate((((-4, -4, W + 4, 15), 0.12, 1.04), ((-4, 583, W + 4, H + 4), -0.1, 0.94),+ ((-4, 12, 12, 586), 0.15, 0.9), ((530, 12, W + 4, 586), -0.12, 1.07))):+ poly = sheet(*r(a, b, c, e), deg)+ sl, m, _ = p.raise_plate([poly], 5.0 + (k % 2) * 0.9, 1.2, STEEL)+ p.tint[sl][m] = tint+ p.raise_plate(inner(12, 6), 4.2, 1.2, STEEL)+ else: # composite with one wide flat facet for an edge+ p.silhouette([body] + bosses, 4.0, "machined")+ p.frame(inner(5, 8), 9.0, build)+ # nothing opaque past the outline: the sheets run on past the ragged edge, and the steps stay open+ win = (slice(max(y0 - 6, 0) * SS, (y0 + H + 6) * SS), slice(max(x0 - 6, 0) * SS, (x0 + W + 6) * SS))+ p.alpha[win] &= p.limit[win]++ # the openings+ lip, depth, c = {"machined": (3, 6, 0), "terraced": (1.2, 8, 4), "scavenged": (2, 5, 4), "faceted": (4, 6, 5)}[build]+ if build == "terraced": # a heavy square rim round every band and socket+ for band in PROMO_BANDS:+ p.bump([shape(build, *R(band, 4), 3)], 2.0, 1.0)+ for b in (PROMO_POINTS, PROMO_CLOSE):+ p.bump([shape(build, *R(b, 5), 4)], 2.0, 1.0)+ for band in PROMO_BANDS:+ window(p, R(band), 3, 2, 0, c * 0.8, build=build)+ # each rank one tray, the cells parted by mullions+ for tray in ((18, 54, 422, 132), (18, 178, 524, 420), (18, 466, 422, 544)):+ window(p, R(tray, 3), depth, lip, 0, c, build=build)+ for tray, cols, rows in (((18, 54, 422, 132), 4, 1), ((18, 178, 524, 420), 5, 3), ((18, 466, 422, 544), 4, 1)):+ for i in range(1, cols):+ x = tray[0] + 102 * i - 2+ p.raise_plate([plate(*r(x - 1.3, tray[1] - 2, x + 1.3, tray[3] + 2))], 1.5, 0.6, STEEL)+ for j in range(1, rows):+ y = tray[1] + 82 * j - 2+ p.raise_plate([plate(*r(tray[0] - 2, y - 1.3, tray[2] + 2, y + 1.3))], 1.5, 0.6, STEEL)+ window(p, R(PROMO_POINTS, 2), depth - 1, lip, 0, 6, build=build)+ window(p, R(PROMO_CLOSE, 2), 3, 2, 0, 6, STEEL, build)if build == "faceted":- p.facets(40, 0.06, 0.45, 29)- for y in (137, 425, 549): # grooves between the ranks- p.inlay([plate(*r(16, y - 1, 526, y + 1))], INKM, 1.2)+ p.facets(40, 0.06, 0.45, 29) # after the openings, so the glass stays flat++ # the rank's stars down the left margin: one, three, five+ star_mat = GOLDM if build == "machined" else PAPERM if build in ("terraced", "faceted") else ACCENT2+ for cy, n in PROMO_STARS:+ for k in range(n):+ yy = cy + (k - (n - 1) / 2) * 13+ pts = star(x0 + 11, y0 + yy, 4.6)+ if build == "scavenged": # stencilled by hand, none quite level+ pts = rotated(pts, x0 + 11, y0 + yy, 7 * (k - 2))+ if build == "terraced":+ p.bump([pts], 0.9, 0.5, star_mat)+ else:+ p.inlay([pts], star_mat, 0.5)++ # what each build fixes to itif build == "machined":- for x in (436, 523):- p.bump(chevrons(x0 + x, y0 + 84, 13), 0.8, 0.6, GOLDM)- for x, y in ((14, 300), (528, 300), (300, 9.5), (240, 588.5)):- p.stud(x0 + x, y0 + y, 3.0)+ # the shield's chevrons up the right margin (blue) and in the points boss (gold), studs at the corners+ wing_chevrons(p, x0 + 534, y0 + 186, y0 + 412, 10, ACCENT, gap=7)+ for x in (442.5, 517.5):+ p.bump(chevrons(x0 + x, y0 + 84, 7), 0.8, 0.5, GOLDM)+ for x, y in ((14, 9.5), (W - 14, 9.5), (14, H - 9.5), (W - 14, H - 9.5), (W / 2, 9.5), (W / 2, H - 9.5)):+ p.stud(x0 + x, y0 + y, 2.8)+ p.inlay([plate(*r(40, 8.2, 250, 10))], ACCENT, 0.4)+ p.inlay([plate(*r(292, 588, 502, 589.8))], ACCENT2, 0.4)+ vents(p, x0 + 40, x0 + 230, y0 + 584, y0 + 592)elif build == "terraced":- for t in np.linspace(40, 500, 12):- p.rivet(x0 + t, y0 + 3.5, 2.0)- p.rivet(x0 + t, y0 + 594.5, 2.0)- for t in np.linspace(40, 560, 14):- p.rivet(x0 + 3.5, y0 + t, 2.0)- p.rivet(x0 + 538.5, y0 + t, 2.0)+ for t in np.linspace(40, 500, 13):+ p.rivet(x0 + t, y0 + 4.5, 1.9)+ p.rivet(x0 + t, y0 + H - 4.5, 1.9)+ for y in np.arange(190, 410, 18): # ingots up the right margin+ p.bump([plate(*r(530, y, 538, y + 9))], 1.6, 0.8, ACCENT2)+ p.inlay([plate(*r(40, 9, 500, 12))], ACCENT, 0.3)elif build == "scavenged":- p.weld((x0 + 14, y0 + 172.5), (x0 + 528, y0 + 172.5), 9) # in the gap under the band, clear of the cells- for i, (x, y) in enumerate(((14, 160), (528, 220), (300, 9.5), (120, 588.5), (528, 470))):- p.bolt(x0 + x, y0 + y, 3.0, i)+ for x in range(30, 220, 15): # hazard slashes, the top edge only+ p.inlay([[(x0 + x, y0 + 13), (x0 + x + 7, y0 + 5), (x0 + x + 13, y0 + 5), (x0 + x + 6, y0 + 13)]], ACCENT, 0.3)+ p.inlay([jitter(plate(*r(531, 190, 539, 400)), 47, 2.0, 5)], ACCENT2, 0.25)+ p.weld((x0 + 12, y0 + 14), (x0 + 530, y0 + 14), 151, 1.1)+ p.weld((x0 + 12, y0 + 584), (x0 + 530, y0 + 584), 152, 1.1)+ for i, (x, y) in enumerate(((6, 6), (W - 7, 8), (5, H - 6), (W - 6, H - 7), (270, 7), (150, H - 6))):+ p.bolt(x0 + x, y0 + y, 2.8, 30 + i)else:- for x, point in ((436, "right"), (524, "left")):- p.inlay([triangle(x0 + x, y0 + 93, 10, 12, point)], ACCENT, 0.6)- for x, y in ((14, 300), (528, 300)):+ for y in np.arange(196, 410, 26): # triangle markers pointing in from the right+ p.inlay([triangle(x0 + 534, y0 + y, 9, 10, "left")], ACCENT, 0.6)+ for x, y in ((12, 10), (W - 12, 10), (12, H - 10), (W - 12, H - 10)):p.bump([regular(x0 + x, y0 + y, 3.0, 6, np.pi / 6)], 0.8, 1.2, BRIGHT)- p.inlay([plate(*r(30, 9, 260, 11))], ACCENT, 0.4)- p.inlay([plate(*r(282, 587, 512, 589))], ACCENT2, 0.4)+ p.inlay([plate(*r(40, 9, 200, 11)), [(x0 + 200, y0 + 9), (x0 + 210, y0 + 14), (x0 + 210, y0 + 16), (x0 + 200, y0 + 11)],+ plate(*r(210, 14, 260, 16))], ACCENT, 0.4)def exp_bar(p, x0, y0, build):@@ -990,9 +1145,9 @@ def radar_frame(side_name):return shade(p, side, shadow=False).crop((0, 8, W, H + 8))-def radar_pieces(frame):+def radar_pieces(frame, edge=RADAR_EDGE):"""The nine pieces, by suffix, out of radar_frame's picture."""- l, t, r, b = RADAR_EDGE+ l, t, r, b = edgexs, ys = (0, l, l + RADAR_INSIDE, l + RADAR_INSIDE + r), (0, t, t + RADAR_INSIDE, t + RADAR_INSIDE + b)out = {}for i, name in enumerate(("TL", "T", "TR", "L", "C", "R", "BL", "B", "BR")):@@ -1262,7 +1417,9 @@ def paint_powers(side_name="America", svg_path=EMBLEM_SVG, frame=None, glow="B")M = read_mapped(side_name)prefix = side_name + "Pro"p = Painter(1024, 1024)- power_window(p, *M[prefix + "GeneralsPowerWindow"][:2], build)+ promo_window(p, *M[prefix + "GeneralsPowerWindow"][:2], build)+ for state in ("", "H", "I"): # the window's close button, 60x50+ button(p, M[prefix + "GenPowerClose" + state], "Close", state, build)for kind in ("Chat", "Options", "Worker", "Beacon", "General", "Minimize", "Maximize", "IdleInfantry","IdleVehicle", "IdleAircraft"):for state in ("", "H", "P", "I"):@@ -1287,6 +1444,889 @@ def paint_powers(side_name="America", svg_path=EMBLEM_SVG, frame=None, glow="B")return sheet_img+# ---------------------------------------------------------------------------------------------- the observer++# The watcher's bar in the console build (OBSERVER), approved by the owner on 2026-11-03 with the rows'+# colour lamps (round 9's A), the radar framed to the map's shape and the rack. Every window it frames+# is ControlBar.wnd's and the Observer8x6 scheme's, in screen pixels at 1920x1080; the bar stands inside+# the .wnd's own input blockers, the scheme naming none of its own. Its pieces are on two sheets of+# their own, ReforgedHudObsPieces (the toolbar's buttons, the rows' hover and watched rings, the radar's+# nine) and ReforgedHudObsSpec (the rack), each laid out by its MappedImages/HandCreated INI.+OBS_LIST = [(334, 755 + 32 * i, 379, 785 + 32 * i) for i in range(8)] # ButtonPlayer0..7, each a side's picture+OBS_OPTIONS, OBS_CHAT = (334, 1011, 379, 1041), (334, 1043, 379, 1073) # OptionsUL/LR, ChatUL/LR; ButtonCancel on chat+OBS_SELECTION, OBS_EXP = (1642, 887, 1871, 1071), (1875, 887, 1911, 1071) # RightHUD and the rank bar's place+OBS_BLOCKS = [(332, 740, 394, 1080), (1625, 870, 1920, 1080)] # the radar's follows its frame at runtime+# ObserverPlayerInfoWindow: its picture (WinGeneralPortrait, ObserverProPlayerWindow) is 512x256 at 327,824+OBS_PANEL_AT = (327, 824)+OBS_POWER = (332, 895, 822, 905) # PowerBarUL/LR+OBS_NAME, OBS_MONEY = (334, 912, 698, 946), (700, 912, 820, 946) # StaticTextPlayerName, MoneyUL/LR+OBS_LABELS = [(334 + 122 * i, 948, 454 + 122 * i, 998) for i in range(4)] # Buildings, Units, Units Lost, Units Killed+OBS_NUMBERS = [(334, 1000, 454, 1034), (454, 1000, 574, 1034), (578, 1000, 698, 1034), (700, 1000, 820, 1034)]+OBS_PANEL_BLOCKS = [(394, 882, 835, 1049), (332, 740, 394, 1080)]+OBS_PIECES_SIZE, OBS_SPEC_SIZE = (512, 512), (1024, 256)+++def to_bar(r):+ return (r[0], r[1] - TOP, r[2], r[3] - TOP)+++def to_panel(r):+ return (r[0] - OBS_PANEL_AT[0], r[1] - OBS_PANEL_AT[1], r[2] - OBS_PANEL_AT[0], r[3] - OBS_PANEL_AT[1])+++def screw(p, cx, cy, r=2.6):+ """A round head with a cross slot."""+ p.bump([regular(cx, cy, r, 16)], 1.4, r * 0.8, BRIGHT)+ k = r * 0.68+ p.inlay([plate(cx - k, cy - 0.4, cx + k, cy + 0.4), plate(cx - 0.4, cy - k, cx + 0.4, cy + k)], INKM, 0.6)+++def grille(p, x0, y0, x1, y1, pitch=3.4, r=0.85):+ """A perforated speaker grille, the rows staggered."""+ holes = []+ for j, y in enumerate(np.arange(y0 + pitch / 2, y1, pitch)):+ for x in np.arange(x0 + pitch / 2 + (j % 2) * pitch / 2, x1, pitch):+ holes.append(regular(x, y, r, 8))+ p.inlay(holes, INKM, 1.0)+++def feathers(p, x, y, n, length, mat, left=True, gap=2.6, t=1.4):+ """The emblem's wing: n blades stacked, each shorter, their roots at x, tapering to a point outward."""+ s = -1 if left else 1+ polys = []+ for i in range(n):+ L = length * (1 - 0.24 * i)+ yy = y + i * gap+ polys.append([(x, yy), (x + s * L * 0.9, yy), (x + s * L, yy + t * 0.5), (x + s * L * 0.9, yy + t), (x, yy + t)])+ p.inlay(polys, mat, 0.5)+++def tally(p, cx, cy, r):+ """The red tally lamp a broadcast camera wears while it is on air: a lens in a dark bezel."""+ p.bump([regular(cx, cy, r + 1.3, 16)], 1.0, 0.8, DARK)+ p.inlay([regular(cx, cy, r, 16)], ACCENT2, 0.2)+ p.bump([regular(cx - r * 0.35, cy - r * 0.35, r * 0.3, 8)], 0.4, 0.3, PAPERM)+++# each row's colour lamp beside its button, empty glass until the code lights it in the player's colour+OBS_LAMPS = [(383, r[1] + 4, 389.5, r[3] - 4) for r in OBS_LIST]+++def paint_observer_bar():+ """The bar: the players' column on the left, a lamp beside each row, the selection window on the right+ and nothing in the middle. The radar is the nine piece frame's (observer_radar_frame), which the+ code stands round the map's shape."""+ b = "console"+ p = Painter(2048, 512)+ p.silhouette([plate(330, 172, 394, 512, tl=("round", 4), tr=("round", 16))], 4.0, b, screen=True)+ p.frame([plate(331, 175, 393, 512, tl=("round", 3), tr=("round", 13))], 8.0, b, STEEL, screen=True)+ for row, lamp in zip(OBS_LIST, OBS_LAMPS):+ p.sink([shape(b, *grow(to_bar(row), 2), 4)], 4, 2)+ lamp = to_bar(lamp)+ p.bump([shape(b, *grow(lamp, 1.4), 3)], 1.0, 0.7, DARK)+ p.sink([shape(b, *lamp, 3)], 1.5, 0.8)+ for r in (OBS_OPTIONS, OBS_CHAT):+ p.sink([shape(b, *grow(to_bar(r), 1), 4)], 3.5, 2)+ tally(p, 357, 180, 2.6)+ screw(p, 340.5, 180, 2.2)+ screw(p, 374, 180, 2.2)++ p.silhouette([plate(1625, 302, 1920, 512, tl=("round", 16))], 4.0, b, screen=True)+ p.frame([plate(1628, 305, 2048, 512, tl=("round", 13))], 8.0, b, STEEL, screen=True)+ p.sink([shape(b, *grow(to_bar(OBS_SELECTION), 2), 8)], 8, 3)+ p.sink([shape(b, *grow(to_bar(OBS_EXP), 1), 4)], 6, 2)+ screw(p, 1756.5, 312.5, 2.4)+ feathers(p, 1749, 309, 3, 48, ACCENT, left=True)+ feathers(p, 1764, 309, 3, 48, ACCENT, left=False)+ grille(p, 1648, 308.5, 1694, 316.5)+ grille(p, 1819, 308.5, 1865, 316.5)+ grille(p, 1633, 330, 1640, 496, 3.6)+ tally(p, 1904, 312.5, 2.8)+ return shade(p, OBSERVER, SEAMS)+++def paint_observer_panel():+ """The watched player's panel (ObserverProPlayerWindow): the power rail over a header with the tally+ lit, the name and money wells, the four counts under dark label plates, and a tab down the column for+ the back button."""+ b = "console"+ p = Painter(512, 256)+ main = plate(2, 56, 510, 227, tl=("round", 10), tr=("round", 14), br=("round", 14))+ tab = plate(2, 150, 60, 254, bl=("round", 6), br=("round", 6))+ p.silhouette([main, tab], 4.0, b)+ p.frame([plate(4, 58, 508, 225, tl=("round", 8), tr=("round", 12), br=("round", 12)),+ plate(4, 150, 58, 252, bl=("round", 5), br=("round", 5))], 8.0, b, STEEL)+ p.sink([plate(*grow(to_panel(OBS_POWER), 1.5))], 3.5, 1.5)+ grille(p, 16, 60.5, 250, 68.5, 3.2)+ feathers(p, 486, 61, 3, 72, ACCENT, left=True, gap=2.2, t=1.2)+ tally(p, 498, 64.5, 2.8)+ p.sink([shape(b, *grow(to_panel(OBS_NAME), 1), 5)], 6, 3)+ p.sink([shape(b, *grow(to_panel(OBS_MONEY), 1), 5)], 6, 3)+ for lab in OBS_LABELS:+ x0, y0, x1, y1 = to_panel(lab)+ p.sink([shape(b, x0 + 3, y0 + 5, x1 - 3, y1 - 5, 4)], 1.4, 0.9) # a shallow window for the white label+ for i, num in enumerate(OBS_NUMBERS):+ x0, y0, x1, y1 = to_panel(num)+ x0 = max(x0, 56) + 2 # the first count stands right of the options button+ p.sink([shape(b, x0, y0, x1 - 2, y1, 4)], 5, 2.5)+ p.sink([shape(b, *grow(to_panel(OBS_OPTIONS), 1), 4)], 3.5, 2)+ p.sink([shape(b, *grow(to_panel(OBS_CHAT), 1), 4)], 3.5, 2)+ feathers(p, 494, 214, 2, 120, ACCENT, left=True, gap=3.0, t=1.4)+ screw(p, 70, 218, 2.2)+ return shade(p, OBSERVER)+++def paint_observer_pieces():+ """ReforgedHudObsPieces, 512x512: the toolbar's three buttons in four states, the hovered (RowH) and+ the watched (RowS) row's rings that stand 4 px round a 45x30 player button, the radar's nine and the+ sides' emblems (paint_side_emblems, variant A)."""+ b = "console"+ M = read_mapped("Obs", "Pieces")+ p = Painter(*OBS_PIECES_SIZE)+ for name, r in M.items():+ kind = name[len("ObserverPro"):]+ if not name.startswith("ObserverPro") or kind.startswith("Radar"):+ continue+ st = kind[-1] if kind[-1] in "HPIS" else ""+ base = kind[:-1] if st else kind+ if base in ("Options", "Chat", "Back"):+ button(p, r, base, st, b)+ else: # a ring round the button, its middle open+ x0, y0, x1, y1 = r+ p.frame([shape(b, x0, y0, x1, y1, 7)], 3.0, b, BRIGHT if st == "H" else STEEL)+ if st == "H":+ p.inlay([plate(x0 + 9, y1 - 2.6, x1 - 9, y1 - 1.4)], HILITE, 0.2)+ else: # the watched one: on air, red bars top and bottom+ p.inlay([plate(x0 + 9, y0 + 1.4, x1 - 9, y0 + 2.6), plate(x0 + 9, y1 - 2.6, x1 - 9, y1 - 1.4)], ACCENT2, 0.2)+ p.cut([shape(b, x0 + 4, y0 + 4, x1 - 4, y1 - 4, 3)])+ p.limit[:] = True+ sheet_img = shade(p, OBSERVER, shadow=False)+ for name, img in radar_pieces(observer_radar_frame(), OBS_RADAR_EDGE).items():+ put(sheet_img, img, M["ObserverProRadar" + name])+ for name, img in paint_side_emblems("A").items():+ put(sheet_img, img, M[name])+ check_mapped(M, OBS_PIECES_SIZE)+ return sheet_img+++# ---------------------------------------------------------------------------------------------- the sides' emblems++# The picture a player's row carries on the observer's bar (ButtonPlayer0..7, 45x30, the PlayerTemplate's+# EnabledImage) and in the rack's standings (the same image drawn at 30x20), round 13; the owner picked A+# on 2026-11-03 and it ships on ReforgedHudObsPieces, where its INI maps each name. Each side has a base mark in its own build (America twin chevrons, China a stepped pyramid, the GLA two crossed+# scrap bars on a hex bolt, Turkiye a faceted arrowhead) and each general his side's mark beside a glyph+# of his own. No flag, national star, crescent or eagle, and no flag's colour pair: Turkiye's red sits+# on dark steel only. A is a badge: the side's plate lit as the bar is, the mark on an accent field and+# the general's glyph raised in a sunk well. B is the glyph alone in flat paint on a small plate in the+# side's silhouette and colour, kept for the record. Names: the three bases keep retail's EnabledImage+# names (SSObserverUSA, China, GLA, which every side and general of PlayerTemplate.ini gives), the rest+# are SSObserver and the template's name without Faction and General.+SIDE_EMBLEM = (45, 30)+SIDE_EMBLEMS = [ # MappedImage, the side whose build it takes, glyph+ ("SSObserverUSA", "America", None), ("SSObserverAmericaSuperWeapon", "America", "reticle"),+ ("SSObserverAmericaLaser", "America", "laser"), ("SSObserverAmericaAirForce", "America", "jet"),+ ("SSObserverChina", "China", None), ("SSObserverChinaTank", "China", "tread"),+ ("SSObserverChinaInfantry", "China", "helmet"), ("SSObserverChinaNuke", "China", "atom"),+ ("SSObserverBoss", "China", "crown"), ("SSObserverGLA", "Gla", None),+ ("SSObserverGLAToxin", "Gla", "trefoil"), ("SSObserverGLADemolition", "Gla", "charge"),+ ("SSObserverGLAStealth", "Gla", "shroud"), ("SSObserverTurkiye", "Turkiye", None),+]+++def spark(cx, cy, r):+ """A four-pointed burst, straight cuts."""+ return [(cx + (r if i % 2 == 0 else r * 0.3) * np.cos(np.pi / 4 * i), cy + (r if i % 2 == 0 else r * 0.3) * np.sin(np.pi / 4 * i))+ for i in range(8)]+++def stroke(path, w):+ """A polyline w wide: a bar along each segment and a square at each joint."""+ out = []+ for (x0, y0), (x1, y1) in zip(path, path[1:]):+ length = np.hypot(x1 - x0, y1 - y0)+ nx, ny = -(y1 - y0) / length * w / 2, (x1 - x0) / length * w / 2+ out.append([(x0 + nx, y0 + ny), (x1 + nx, y1 + ny), (x1 - nx, y1 - ny), (x0 - nx, y0 - ny)])+ return out + [plate(x - w / 2, y - w / 2, x + w / 2, y + w / 2) for x, y in path[1:-1]]+++def wedge(r0, r1, a, w0, w1):+ """A blade from radius r0 to r1 along angle a (degrees), w0 and w1 its half widths in degrees."""+ def at(r, d):+ t = np.radians(d)+ return (r * np.cos(t), r * np.sin(t))+ return [at(r0, a - w0), at(r1, a - w1), at(r1, a + w1), at(r0, a + w0)]+++def emblem_glyph(kind):+ """A side's mark or a general's glyph round (0, 0), about 24 units across, as parts (sign, polygons,+ holes): a '+' part is added, a '-' part is cut out of what is there, and each part's holes are its own."""+ if kind == "machined": # the emblem's twin chevrons+ return [("+", chevrons(0, -10, 22, n=2, up=True), [])]+ if kind == "terraced": # a stepped pyramid, three courses+ return [("+", [plate(-3.5, -9, 3.5, -4), plate(-8, -2.6, 8, 2.4), plate(-12, 3.8, 12, 8.8)], [])]+ if kind == "scavenged": # two scrap bars crossed out of square on a hex bolt+ long_ = rotated(plate(-12.5, -2.4, 12.5, 2.4), 0, 0, 34)+ short = rotated(plate(-10, -2.1, 9.5, 2.1), 0, 0, -41)+ bite = rotated([(10.5, -2.6), (13, -2.6), (13, 0.8)], 0, 0, 34)+ return [("+", [long_, short], []), ("-", [bite, regular(0, 0, 4.2, 6, 0.3)], []),+ ("+", [regular(0, 0, 3.4, 6, 0.3)], [regular(0, 0, 1.2, 6)])]+ if kind == "faceted": # an arrowhead of two facets, a groove up its spine+ return [("+", [[(0, -11), (12, 9), (0, 3.5), (-12, 9)]], []), ("-", [plate(-0.55, -7.5, 0.55, 2.8)], [])]+ if kind == "reticle": # the superweapon general: a target ring and ticks+ return [("+", [octagon(-10, -10, 10, 10, 4.2)], [octagon(-7.2, -7.2, 7.2, 7.2, 3.0)]),+ ("+", [plate(-1.1, -12.5, 1.1, -4.2), plate(-1.1, 4.2, 1.1, 12.5), plate(-12.5, -1.1, -4.2, 1.1),+ plate(4.2, -1.1, 12.5, 1.1)], []), ("+", [octagon(-2, -2, 2, 2, 0.9)], [])]+ if kind == "laser": # a beam struck down from the corner, burst where it lands+ beam = rotated([(-12, -2.8), (3, -1.6), (3, 1.6), (-12, 2.8)], 0, 0, 38)+ return [("+", [beam, rotated(plate(-13, -4.6, -9.5, 4.6), 0, 0, 38), spark(4.6, 3.6, 8.5)], []),+ ("-", [regular(4.6, 3.6, 1.6, 8)], [])]+ if kind == "jet":+ raised, ink = icon("Aircraft", 0, 0, "machined")+ return [("+", raised, ink)]+ if kind == "tread":+ raised, ink = icon("Vehicle", 0, 0, "terraced")+ return [("+", raised, ink)]+ if kind == "helmet": # a helmet side on, its band and chin strap+ dome = [(-11, 3), (-10, -2), (-7, -6.5), (-2, -8.5), (4, -8), (8.5, -5), (10.5, -0.5), (12.5, 2.5), (12.5, 4.6),+ (-11, 4.6)]+ return [("+", [dome, [(-6.5, 4.6), (-4.2, 4.6), (1.5, 10.5), (-0.8, 10.5)]], []), ("-", [plate(-10.6, -0.6, 11, 0.9)], [])]+ if kind == "atom": # three straight-cut orbits and a nucleus+ parts = [("+", [rotated(octagon(-12.5, -5, 12.5, 5, 3.4), 0, 0, d)], [rotated(octagon(-10.2, -2.7, 10.2, 2.7, 2.0), 0, 0, d)])+ for d in (0, 60, 120)]+ return parts + [("+", [octagon(-2.7, -2.7, 2.7, 2.7, 1.1)], [])]+ if kind == "trefoil": # the toxin general: three clawed blades round a hub+ blades = [wedge(3.9, 12, a, 30, 36) for a in (-90, 30, 150)]+ claws = [regular(9.6 * np.cos(np.radians(a)), 9.6 * np.sin(np.radians(a)), 3.4, 8, np.pi / 8) for a in (-90, 30, 150)]+ return [("+", blades, []), ("-", claws, []), ("+", [octagon(-2.4, -2.4, 2.4, 2.4, 1.0)], [])]+ if kind == "charge": # the demolition general: an octagon bomb, its fuse lit+ return [("+", [octagon(-12, -6, 6, 12, 5.4), rotated(plate(-2.6, -9.4, 2.6, -5), -3, -3, 45)], []),+ ("-", [plate(-7, -1.4, -3.4, 0.4)], []),+ ("+", [rotated(plate(1.5, -8.6, 7.5, -7.4), 1.5, -8, -35), spark(8.6, -10.6, 4.4)], [])]+ if kind == "shroud": # the stealth general: a cut eye, struck through+ eye = [(-12.5, 0), (-5, -7), (5, -7), (12.5, 0), (5, 7), (-5, 7)]+ lid = [(-9, 0), (-3.8, -4.4), (3.8, -4.4), (9, 0), (3.8, 4.4), (-3.8, 4.4)]+ return [("+", [eye], [lid]), ("+", [octagon(-2.8, -2.8, 2.8, 2.8, 1.2)], []),+ ("-", [rotated(plate(-15, -2.3, 15, 2.3), 0, 0, -38)], []), ("+", [rotated(plate(-13.5, -1, 13.5, 1), 0, 0, -38)], [])]+ if kind == "eye": # the observer: the cut eye, open+ eye = [(-12.5, 0), (-5, -7), (5, -7), (12.5, 0), (5, 7), (-5, 7)]+ lid = [(-9, 0), (-3.8, -4.4), (3.8, -4.4), (9, 0), (3.8, 4.4), (-3.8, 4.4)]+ return [("+", [eye], [lid]), ("+", [octagon(-3, -3, 3, 3, 1.3)], [])]+ if kind == "random": # a question mark of straight strokes+ path = [(-6, -6.5), (-6, -11), (6, -11), (6, -3.5), (0, 0.5), (0, 4)]+ return [("+", stroke(path, 3.6) + [plate(-1.9, 7, 1.9, 11)], [])]+ if kind == "crown": # the boss: three spikes on a band+ return [("+", [[(-11.5, 7), (-11.5, -5.5), (-5.6, 0.4), (0, -8.5), (5.6, 0.4), (11.5, -5.5), (11.5, 7)],+ octagon(-13.2, -8.8, -9.8, -5.4, 1.2), octagon(-1.7, -12.3, 1.7, -8.9, 1.2), octagon(9.8, -8.8, 13.2, -5.4, 1.2)], []),+ ("-", [plate(-11.5, 2.6, 11.5, 3.9)], [])]+ raise ValueError(kind)+++def glyph_mask(parts, w, h, box, scale):+ """parts fitted into box (x0, y0, x1, y1 in texels, aspect kept, centred), drawn scale times: a mask."""+ xs = [x for s, polys, _ in parts if s == "+" for q in polys for x, _ in q]+ ys = [y for s, polys, _ in parts if s == "+" for q in polys for _, y in q]+ k = min((box[2] - box[0]) / (max(xs) - min(xs)), (box[3] - box[1]) / (max(ys) - min(ys)))+ ox, oy = (box[0] + box[2]) / 2 - k * (min(xs) + max(xs)) / 2, (box[1] + box[3]) / 2 - k * (min(ys) + max(ys)) / 2+ m = np.zeros((h * scale, w * scale), bool)+ for sign, polys, holes in parts:+ im = Image.new("L", (w * scale, h * scale), 0)+ d = ImageDraw.Draw(im)+ for fill, qs in ((255, polys), (0, holes)):+ for q in qs:+ d.polygon([((ox + k * x) * scale, (oy + k * y) * scale) for x, y in q], fill=fill)+ pm = np.asarray(im) > 0+ m = (m | pm) if sign == "+" else (m & ~pm)+ return m+++def emblem_body(build, box):+ """The badge's outline in the side's build."""+ x0, y0, x1, y1 = box+ if build == "scavenged": # a sheet laid on out of square, its edges bitten+ return rotated(jitter(shape(build, x0 + 0.5, y0 + 0.5, x1 - 0.5, y1 - 0.5, 4), 13, amp=0.9, step=5), (x0 + x1) / 2, (y0 + y1) / 2, 2.2)+ return shape(build, x0, y0, x1, y1, {"machined": 6, "terraced": 3, "faceted": 4}[build])+++def emblem_badge(side_name, glyph):+ """Variant A, 45x30: the side's plate lit like the bar, its mark on an accent field and the general's+ glyph raised in a sunk well beside it (a side alone has the mark large across the field)."""+ side = SIDES[side_name]+ b = side["build"]+ W, H = SIDE_EMBLEM+ pad = 8+ p = Painter(W + 2 * pad, H + 2 * pad)++ def o(polys):+ return [[(x + pad, y + pad) for x, y in q] for q in polys]++ def raise_mask(m, height, bevel, material):+ d = ndimage.distance_transform_edt(np.pad(m, 1))[1:-1, 1:-1] / SS+ p.h += np.clip(d / bevel, 0, 1) * m * height+ p.mat[m] = material++ body = emblem_body(b, (1, 1, 44, 29))+ sl, m, _ = p.frame(o([body]), 3.0, b, DARK, scale=0.35 if b != "scavenged" else 1.0)+ p.limit[sl] |= m+ if b == "machined": # two tiers: the satin frame on the dark flange+ p.frame(o([shape(b, 2.6, 2.6, 42.4, 27.4, 4.8)]), 4.4, b, STEEL, scale=0.4)+ elif b == "scavenged": # a second scrap laid over the top left, welded+ p.frame(o([sheet(2.5, 2.5, 20, 15, -5)]), 3.8, b, STEEL)+ p.frame(o([sheet(14, 3, 43, 27.5, 1.5)]), 3.6, b, STEEL)+ elif b == "faceted":+ p.frame(o([shape(b, 2.4, 2.4, 42.6, 27.6, 3.2)]), 4.4, b, STEEL, scale=0.25)+ else:+ p.mat[sl][m] = STEEL+ field_mat, mark_mat = (ACCENT2, ACCENT) if b == "faceted" else (ACCENT, PAPERM)+ glyph_mat = BRIGHT if b == "faceted" else PAPERM+ if glyph is None:+ field, mark_box = shape(b, 6, 4.5, 39, 25.5, 2.6), (12, 6.5, 33, 23.5)+ else:+ field, mark_box = shape(b, 4.5, 4.5, 16, 25.5, 2.2), (6, 9, 14.5, 21)+ p.sink(o([shape(b, 17.5, 4.5, 41, 25.5, 2.6)]), 1.8, 0.8)+ p.inlay(o([field]), field_mat, 0.3)+ mbox = (mark_box[0] + pad, mark_box[1] + pad, mark_box[2] + pad, mark_box[3] + pad)+ raise_mask(glyph_mask(emblem_glyph(b), W + 2 * pad, H + 2 * pad, mbox, SS), 1.0, 0.45, mark_mat)+ if glyph is not None:+ raise_mask(glyph_mask(emblem_glyph(glyph), W + 2 * pad, H + 2 * pad, (19.5 + pad, 6.5 + pad, 39 + pad, 23.5 + pad), SS),+ 1.0, 0.45, glyph_mat)+ if b == "machined": # the second accent: a red hairline under the field+ p.inlay(o([plate(*((7, 26.2, 38, 26.9) if glyph is None else (5.5, 26.2, 15, 26.9)))]), ACCENT2, 0.2)+ elif b == "terraced":+ for x, y in ((3.6, 3.6), (41.4, 3.6), (3.6, 26.4), (41.4, 26.4)):+ p.rivet(x + pad, y + pad, 1.1)+ elif b == "scavenged":+ p.weld((14 + pad, 15 + pad), (20 + pad, 15.5 + pad), 5, 0.6)+ p.bolt(41.2 + pad, 26 + pad, 1.2, 3)+ for i in range(3): # hazard slashes along the top edge only+ x = 28 + 4 * i+ p.inlay(o([[(x, 1.8), (x + 1.8, 1.8), (x + 0.6, 3.8), (x - 1.2, 3.8)]]), ACCENT2 if i % 2 else INKM, 0.2)+ else:+ p.facets(5.0, 0.05, 0.18, 41)+ p.bolt(42 + pad, 15 + pad, 1.1, 0)+ return shade(p, side, shadow=False).crop((pad, pad, pad + W, pad + H))+++# B's flat paint: the plate, its second tone, the glyph and its ink+EMBLEM_FLAT = {+ "America": dict(plate=BLUE, tone=(0x5a, 0x6e, 0xc8), line=RED, glyph=PAPER),+ "China": dict(plate=RED, tone=(0x93, 0x1e, 0x19), line=(0xd0, 0x8a, 0x22), glyph=PAPER),+ "Gla": dict(plate=(0x6c, 0x6a, 0x30), tone=(0xb0, 0x5a, 0x1e), line=INK, glyph=PAPER),+ "Turkiye": dict(plate=(0x3e, 0x45, 0x4d), tone=(0x52, 0x5a, 0x63), line=(0xc0, 0x2a, 0x2a), glyph=(0xb4, 0xbc, 0xc2)),+}+++def emblem_flat(side_name, glyph):+ """Variant B, 45x30: the glyph alone in flat paint, ink round it, on a small plate in the side's+ silhouette and colours (a side alone carries its mark)."""+ b = SIDES[side_name]["build"]+ c = EMBLEM_FLAT[side_name]+ W, H = SIDE_EMBLEM+ S = 4+ yy, xx = np.mgrid[0:H * S, 0:W * S] / S++ def poly_mask(polys):+ im = Image.new("L", (W * S, H * S), 0)+ d = ImageDraw.Draw(im)+ for q in polys:+ d.polygon([(x * S, y * S) for x, y in q], fill=255)+ return np.asarray(im) > 0++ out = np.zeros((H * S, W * S, 4), np.float32)++ def paint(m, rgb):+ out[m] = tuple(v / 255.0 for v in rgb) + (1.0,)++ box = (8, 2, 37, 28)+ plate_m = poly_mask([emblem_body(b, box)])+ paint(plate_m, c["plate"])+ if b == "machined": # a satin band over the top, a red hairline at the foot+ paint(plate_m & (yy < box[1] + 5), c["tone"])+ paint(plate_m & (yy > box[3] - 3.2) & (yy < box[3] - 2.2) & (xx > box[0] + 5) & (xx < box[2] - 5), c["line"])+ elif b == "terraced": # a terrace inset round the face, rivets on the rim+ paint(plate_m & ~poly_mask([shape(b, box[0] + 2.5, box[1] + 2.5, box[2] - 2.5, box[3] - 2.5, 2)]), c["tone"])+ for x, y in ((box[0] + 1.3, box[1] + 1.3), (box[2] - 1.3, box[1] + 1.3), (box[0] + 1.3, box[3] - 1.3), (box[2] - 1.3, box[3] - 1.3)):+ paint(poly_mask([regular(x, y, 0.8, 8)]), c["line"])+ elif b == "scavenged": # a rust patch and hazard slashes on the top edge+ paint(plate_m & poly_mask([sheet(box[2] - 11, box[3] - 9, box[2] + 2, box[3] + 2, -8)]), c["tone"])+ for i in range(3):+ x = box[0] + 15 + 3.4 * i+ paint(plate_m & poly_mask([[(x, box[1]), (x + 1.6, box[1]), (x + 0.2, box[1] + 3.2), (x - 1.4, box[1] + 3.2)]]),+ c["line"] if i % 2 == 0 else c["tone"])+ else: # two facets and a red marker pointing in from the left+ paint(plate_m & poly_mask([[(box[0], box[3]), (box[2], box[1]), (box[2], box[3])]]), c["tone"])+ paint(plate_m & poly_mask([triangle(box[0] + 2.2, (box[1] + box[3]) / 2, 3.2, 5, "right")]), c["line"])+ g = glyph_mask(emblem_glyph(glyph or b), W, H, (10, 4.5, 35, 25.5) if glyph else (12, 5.5, 33, 24.5), S)+ ink = ndimage.binary_dilation(g, iterations=int(S * 0.9)) & ~g+ paint(ink, INK)+ paint(g, c["glyph"])+ keyline = ndimage.binary_dilation(plate_m | g, iterations=S) & ~(plate_m | g | ink)+ paint(keyline, INK)+ small = out.reshape(H, S, W, S, 4).mean(axis=(1, 3))+ a = small[..., 3:4]+ small[..., :3] = np.where(a > 0, small[..., :3] / np.maximum(a, 1e-6), 0)+ return Image.fromarray((np.clip(small, 0, 1) * 255 + 0.5).astype(np.uint8), "RGBA")+++def paint_side_emblems(variant):+ """Every side's and general's emblem in variant A or B: MappedImage name -> 45x30 piece."""+ draw = emblem_badge if variant == "A" else emblem_flat+ return {name: draw(side, glyph) for name, side, glyph in SIDE_EMBLEMS}+++# ---------------------------------------------------------------------------------------------- the front end's emblems++# The same family where the front end shows a side (round 14's prototype, --lobby-emblems, off by+# default): ReforgedFactionEmblems, 1024x1024. A card, 240x240, for each army the army screen lists, the+# Boss and the observer, which FactionPicker draws as a 100 px tile, a 96 px pool icon and the focused+# portrait (FactionPicker<template>), and which the retail GeneralImage names (USA_Logo, USA_Laser, ...)+# can map too, for PopupPlayerInfo's 86 px picture; and a small 48x44 side icon for the GameinfoXXX+# names (SideIconImage, the LAN game list's 22x25). A card is the side's plate in its build round a sunk+# well with the general's glyph (a side alone: its mark large on the accent field), over a side plate+# carrying the mark and the build's fittings. Each piece stands at FACTION_EMBLEMS_AT until an INI maps+# it.+CARD = 240+FACTION_CARDS = [ # FactionPicker image, the side whose build it takes, glyph+ ("FactionPickerFactionAmerica", "America", None), ("FactionPickerFactionAmericaSuperWeaponGeneral", "America", "reticle"),+ ("FactionPickerFactionAmericaLaserGeneral", "America", "laser"), ("FactionPickerFactionAmericaAirForceGeneral", "America", "jet"),+ ("FactionPickerFactionChina", "China", None), ("FactionPickerFactionChinaTankGeneral", "China", "tread"),+ ("FactionPickerFactionChinaInfantryGeneral", "China", "helmet"), ("FactionPickerFactionChinaNukeGeneral", "China", "atom"),+ ("FactionPickerFactionBossGeneral", "China", "crown"), ("FactionPickerFactionGLA", "Gla", None),+ ("FactionPickerFactionGLAToxinGeneral", "Gla", "trefoil"), ("FactionPickerFactionGLADemolitionGeneral", "Gla", "charge"),+ ("FactionPickerFactionGLAStealthGeneral", "Gla", "shroud"), ("FactionPickerFactionTurkiye", "Turkiye", None),+ ("FactionPickerObserver", "Observer", "eye"),+]+# the retail GeneralImage names the same cards can stand for+GENERAL_IMAGE = {"USA_Logo": "FactionAmerica", "USA_Superweapon": "FactionAmericaSuperWeaponGeneral", "USA_Laser": "FactionAmericaLaserGeneral",+ "USA_Air": "FactionAmericaAirForceGeneral", "China_Logo": "FactionChina", "China_Tank": "FactionChinaTankGeneral",+ "China_Infantry": "FactionChinaInfantryGeneral", "China_Nuke": "FactionChinaNukeGeneral", "GLA_Logo": "FactionGLA",+ "GLA_Toxin": "FactionGLAToxinGeneral", "GLA_Demo": "FactionGLADemolitionGeneral", "GLA_Stealth": "FactionGLAStealthGeneral"}+SIDE_ICON = (48, 44)+SIDE_ICONS = [("GameinfoAMRCA", "America", None), ("GameinfoCHINA", "China", None), ("GameinfoGLA", "Gla", None),+ ("GameinfoTURKIYE", "Turkiye", None), ("GameinfoBOSS", "China", "crown"), ("GameinfoOBSRVR", "Observer", "eye"),+ ("GameinfoRANDOM", "Observer", "random")]+FACTION_EMBLEMS_SIZE = (1024, 1024)+FACTION_EMBLEMS_AT = {n: (4 + 248 * (i % 4), 4 + 248 * (i // 4), 4 + 248 * (i % 4) + CARD, 4 + 248 * (i // 4) + CARD)+ for i, (n, _, _) in enumerate(FACTION_CARDS)}+FACTION_EMBLEMS_AT.update({n: (752 + 56 * (i % 4), 752 + 50 * (i // 4), 752 + 56 * (i % 4) + 48, 752 + 50 * (i // 4) + 44)+ for i, (n, _, _) in enumerate(SIDE_ICONS)})+++def palette_of(side_name):+ return OBSERVER if side_name == "Observer" else SIDES[side_name]+++def mark_of(build):+ """The side mark a build carries: the observer's console has the eye."""+ return "eye" if build == "console" else build+++def faction_card(side_name, glyph):+ """A 240x240 card: the side's plate in its build, the glyph raised in a sunk well (a side alone: its+ mark on the accent field), and a side plate under it with the mark and the build's fittings."""+ side = palette_of(side_name)+ b = side["build"]+ pad = 16+ p = Painter(CARD + 2 * pad, CARD + 2 * pad)++ def o(polys):+ return [[(x + pad, y + pad) for x, y in q] for q in polys]++ def raise_mask(parts, box, height, bevel, material):+ m = glyph_mask(parts, CARD + 2 * pad, CARD + 2 * pad, (box[0] + pad, box[1] + pad, box[2] + pad, box[3] + pad), SS)+ d = ndimage.distance_transform_edt(np.pad(m, 1))[1:-1, 1:-1] / SS+ p.h += np.clip(d / bevel, 0, 1) * m * height+ p.mat[m] = material++ c = {"machined": 30, "terraced": 12, "scavenged": 16, "faceted": 18, "console": 18}[b]+ if b == "scavenged":+ body = jitter(shape(b, 6, 6, 234, 234, c), 29, amp=3.0, step=16)+ else:+ body = shape(b, 4, 4, 236, 236, c)+ sl, m, _ = p.frame(o([body]), 9.0, b, DARK)+ p.limit[sl] |= m+ if b == "machined": # the satin frame on the dark flange+ p.frame(o([shape(b, 12, 12, 228, 228, 24)]), 13.0, b, STEEL)+ elif b == "scavenged": # scrap sheets laid on out of square+ for poly in (sheet(12, 12, 150, 126, -2.5), sheet(96, 16, 228, 150, 2.0), sheet(14, 116, 226, 226, -1.2)):+ p.frame(o([poly]), 12.0, b, STEEL)+ elif b in ("faceted", "console"):+ p.frame(o([shape(b, 12, 12, 228, 228, c - 6)]), 13.0, b, STEEL)+ else:+ p.mat[sl][m] = STEEL+ field_mat, mark_mat = (ACCENT2, ACCENT) if b == "faceted" else (ACCENT, PAPERM)+ glyph_mat = BRIGHT if b == "faceted" else PAPERM+ well = (26, 24, 214, 170)+ wsl, wm = p.local(o([shape(b, *grow(well, 3), 12)])) # no sheet's or terrace's step reaches the glass+ p.h[wsl][wm] = 12.0+ if glyph is None:+ p.inlay(o([shape(b, *well, 10)]), field_mat, 0.8)+ raise_mask(emblem_glyph(mark_of(b)), (60, 36, 180, 158), 3.0, 1.4, mark_mat)+ else:+ p.sink(o([shape(b, *well, 10)]), 6.0, 3.0)+ raise_mask(emblem_glyph(glyph), (52, 36, 188, 158), 3.0, 1.4, glyph_mat)+ plate_r = (26, 180, 214, 216) # the side plate: the mark on a chip, then the fittings+ p.inlay(o([shape(b, *plate_r, 6)]), field_mat if b != "console" else DARK, 0.6)+ p.frame(o([shape(b, 30, 183, 62, 213, 4)]), 11.0, b, STEEL)+ raise_mask(emblem_glyph(mark_of(b)), (34, 187, 58, 209), 1.6, 0.8, mark_mat if b != "console" else PAPERM)+ if b == "machined":+ for i in range(4):+ p.inlay(o(chevrons(84 + 34 * i, 189, 22, n=1, up=True)), PAPERM, 0.3)+ for x, y in ((40, 18), (200, 18), (40, 222), (200, 222)):+ p.stud(x + pad, y + pad, 3.4)+ elif b == "terraced":+ for i in range(4): # stacked ingots+ x = 88 + 32 * i+ p.bump(o([plate(x, 186, x + 22, 196), plate(x + 4, 198, x + 18, 208)]), 1.6, 0.8, BRIGHT)+ for x in range(36, 210, 24):+ p.rivet(x + pad, 10 + pad, 2.0)+ p.rivet(x + pad, 230 + pad, 2.0)+ elif b == "scavenged":+ for i in range(7): # hazard slashes along the side plate+ x = 80 + 18 * i+ p.inlay(o([[(x, 182), (x + 9, 182), (x + 2, 214), (x - 7, 214)]]), INKM if i % 2 else ACCENT2, 0.3)+ p.weld((97 + pad, 13 + pad), (97 + pad, 21 + pad), 3, 1.6) # welds in the margins, off the glass+ p.weld((14 + pad, 117 + pad), (23 + pad, 117 + pad), 4, 1.6)+ p.weld((217 + pad, 116 + pad), (226 + pad, 116 + pad), 5, 1.6)+ for x, y, s in ((20, 20, 1), (222, 24, 2), (18, 222, 3), (220, 224, 4)):+ p.bolt(x + pad, y + pad, 3.6, s)+ elif b == "faceted":+ for i in range(4): # triangle markers pointing in along the plate+ p.inlay(o([triangle(92 + 30 * i, 198, 16, 22, "right")]), ACCENT, 0.3)+ for x, y in ((20, 120), (220, 120)):+ p.inlay(o([triangle(x, y, 10, 18, "right" if x < 120 else "left")]), ACCENT, 0.3)+ p.facets(22.0, 0.035, 0.5, 43)+ for x, y in ((40, 18), (200, 222)):+ p.bolt(x + pad, y + pad, 3.2, 0)+ else: # the console: a grille, screws and the tally lamp+ p.raise_plate(o([plate(78, 188, 190, 208)]), 0.5, 0.5, DARK)+ for x in np.arange(84, 186, 6.5):+ for y in (193, 203):+ p.sink(o([regular(x, y, 1.6, 8)]), 1.5, 0.6, INKM)+ for x, y in ((24, 18), (216, 18), (24, 222), (216, 222)):+ screw(p, x + pad, y + pad, 3.0)+ p.raise_plate(o([regular(202, 198, 5, 16)]), 15.0, 1.0, ACCENT2)+ return shade(p, side, shadow=False).crop((pad, pad, pad + CARD, pad + CARD))+++def side_icon(side_name, glyph):+ """A 48x44 side icon: the badge's plate in the build, the accent field and the mark (or the glyph)."""+ side = palette_of(side_name)+ b = side["build"]+ W, H = SIDE_ICON+ pad = 8+ p = Painter(W + 2 * pad, H + 2 * pad)++ def o(polys):+ return [[(x + pad, y + pad) for x, y in q] for q in polys]++ body = emblem_body(b, (1, 1, 47, 43)) if b != "console" else shape(b, 1, 1, 47, 43, 6)+ sl, m, _ = p.frame(o([body]), 3.0, b, DARK, scale=0.4 if b != "scavenged" else 1.0)+ p.limit[sl] |= m+ p.frame(o([shape(b, 3, 3, 45, 41, 4)]), 4.4, b, STEEL, scale=0.35)+ field_mat, mark_mat = (ACCENT2, ACCENT) if b == "faceted" else (DARK, PAPERM) if b == "console" else (ACCENT, PAPERM)+ p.inlay(o([shape(b, 6, 5.5, 42, 38.5, 3)]), field_mat, 0.3)+ mk = glyph_mask(emblem_glyph(glyph or mark_of(b)), W + 2 * pad, H + 2 * pad, (11 + pad, 8.5 + pad, 37 + pad, 35.5 + pad), SS)+ d = ndimage.distance_transform_edt(np.pad(mk, 1))[1:-1, 1:-1] / SS+ p.h += np.clip(d / 0.5, 0, 1) * mk * 1.1+ p.mat[mk] = mark_mat+ if b == "faceted":+ p.facets(6.0, 0.05, 0.2, 47)+ return shade(p, side, shadow=False).crop((pad, pad, pad + W, pad + H))+++def paint_faction_emblems():+ """ReforgedFactionEmblems (prototype): every card and side icon at FACTION_EMBLEMS_AT."""+ out = Image.new("RGBA", FACTION_EMBLEMS_SIZE, (0, 0, 0, 0))+ for name, side, glyph in FACTION_CARDS:+ put(out, faction_card(side, glyph), FACTION_EMBLEMS_AT[name])+ for name, side, glyph in SIDE_ICONS:+ put(out, side_icon(side, glyph), FACTION_EMBLEMS_AT[name])+ check_mapped(FACTION_EMBLEMS_AT, FACTION_EMBLEMS_SIZE)+ return out+++def check_mapped(M, size):+ """No two mapped pieces share a texel, their one texel gutters included, and all are on the sheet."""+ boxes = sorted((grow(r, 1), n) for n, r in M.items())+ for i, (p, n) in enumerate(boxes):+ assert p[0] >= 0 and p[1] >= 0 and p[2] <= size[0] and p[3] <= size[1], "%s is off its %s sheet" % (n, size)+ for q, m in boxes[i + 1:]:+ assert p[2] <= q[0] or q[2] <= p[0] or p[3] <= q[1] or q[3] <= p[1], "%s and %s overlap" % (n, m)+++def check_observer(bar, panel):+ """The cuts stay clear, every window the bar and the panel frame stands on plate, and nothing is opaque+ more than 3 px past the .wnd's blockers (the column's; the radar's follows its frame at runtime)."""+ a = np.asarray(bar)[..., 3]+ for x in SEAMS:+ assert not a[:, x - 2:x + 3].any(), "observer art across the cut at texel %d" % x+ for r in [OBS_OPTIONS, OBS_CHAT, OBS_SELECTION, OBS_EXP] + OBS_LIST:+ x0, y0, x1, y1 = to_bar(r)+ assert (a[y0:y1, x0:x1] == 255).all(), "observer window %s is not on the plate" % (r,)+ for img, blocks, at in ((a[:, :1920], OBS_BLOCKS, (0, TOP)), (np.asarray(panel)[..., 3], OBS_PANEL_BLOCKS, OBS_PANEL_AT)):+ ok = np.zeros(img.shape, bool)+ for x0, y0, x1, y1 in blocks:+ ok[max(y0 - at[1] - 3, 0):max(y1 - at[1] + 3, 0), max(x0 - at[0] - 3, 0):max(x1 - at[0] + 3, 0)] = True+ assert not ((img >= 250) & ~ok).any(), "observer plate past its blockers at %s" % (np.argwhere((img >= 250) & ~ok)[0],)+ pa = np.asarray(panel)[..., 3]+ for r in [OBS_POWER, OBS_NAME, OBS_MONEY, OBS_OPTIONS, OBS_CHAT] + OBS_LABELS + OBS_NUMBERS:+ x0, y0, x1, y1 = to_panel(r)+ assert (pa[y0:y1, x0:x1] == 255).all(), "panel window %s is not on the plate" % (r,)+++# The observer's radar sized to the map like the sides' (RadarFrameImage ObserverProRadar on+# Observer8x6), its frame thin: 5 down the left, the right and the foot and 13 over the top, so at the square map it is exactly+# 0..332 x 740..1080 and meets the players' column at x 332 with both tops at 740. It carries no+# fitting at all, only a hairline along its top: every piece but the corners stretches.+OBS_RADAR_EDGE = (5, 13, 5, 5)+++def observer_radar_frame():+ l, t, r, b = OBS_RADAR_EDGE+ W, H = l + RADAR_INSIDE + r, t + RADAR_INSIDE + b+ p = Painter(W + 8, H + 8)+ o, w = (0, 8, W, H + 8), (l, 8 + t, l + RADAR_INSIDE, 8 + t + RADAR_INSIDE)+ p.silhouette([plate(*o, tr=("round", 5))], 4.0, "console", screen=True)+ p.frame([plate(o[0], o[1] + 1, o[2] - 1, o[3], tr=("round", 4))], 7.0, "console", STEEL, screen=True)+ p.sink([plate(*grow(w, 2))], 6, 2)+ p.inlay([plate(o[0], o[1] + 4.4, o[2] - 7, o[1] + 5.4)], ACCENT, 0.3)+ return shade(p, OBSERVER, shadow=False).crop((0, 8, W, H + 8))+++# ---------------------------------------------------------------------------------------------- the spectator's rack++# 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+# 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+# white lenses in the player's colour.+++class Offset:+ """A Painter seen with its origin moved: every polygon argument is shifted by (dx, dy)."""++ def __init__(self, painter, dx, dy):+ self.painter, self.dx, self.dy = painter, dx, dy++ def __getattr__(self, name):+ method = getattr(self.painter, name)++ def shifted(polys, *args, **kwargs):+ return method([[(x + self.dx, y + self.dy) for x, y in poly] for poly in polys], *args, **kwargs)+ return shifted+++def lit(w, h, draw, shadow=False, pad=24):+ """A w x h piece drawn by draw() in its own coordinates on a canvas pad wider each way (shade's mottle+ needs the room, and a side on the screen's edge runs on past the crop so it takes no bevel), lit+ with no falloff so a cut row tiles, and cropped back."""+ p = Painter(w + 2 * pad, h + 2 * pad)+ draw(Offset(p, pad, pad))+ p.limit[:] = True+ return shade(p, OBSERVER, shadow=shadow, falloff=False).crop((pad, pad, pad + w, pad + h))+++def lens(p, cx, cy, r, mat=GLASS):+ """A round lamp in a dark bezel, raised so it stands on an otherwise empty overlay too."""+ p.raise_plate([regular(cx, cy, r + 1.3, 16)], 1.0, 0.8, DARK)+ p.raise_plate([regular(cx, cy, r, 16)], 1.2, 0.5, mat)+ if mat != GLASS:+ p.raise_plate([regular(cx - r * 0.35, cy - r * 0.35, r * 0.3, 8)], 1.6, 0.3, PAPERM)+++def white_lens(w, h):+ """White, lit along its top, for the code to tint in a player's colour."""+ v = np.linspace(255, 150, h).astype(np.uint8)[:, None].repeat(w, 1)+ return Image.fromarray(np.dstack([v, v, v, np.full_like(v, 255)]), "RGBA")+++RACK_W, RACK_TOP, RACK_HEAD, RACK_PITCH, RACK_FOOT = 306, 28, 68, 30, 14+RACK_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+RACK_LABEL = (24, 9, 180, 23)+DRAWER_W, DRAWER_TOP = 276, 12+DRAWER_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}+++def rack_reference(rows=2, body=12):+ """A drawer with everything a slice is cut from: the cap with its label and handle, the standings'+ head with the dial's socket, rows, a plain body for the watch drawer, and the foot."""+ b = "console"+ H = RACK_TOP + RACK_HEAD + rows * RACK_PITCH + body + RACK_FOOT++ def draw(p):+ p.silhouette([plate(6, 6, RACK_W + 20, H - 6, tl=("round", 10), bl=("round", 10))], 4.0, b)+ p.frame([plate(7.5, 7.5, RACK_W + 20, H - 7.5, tl=("round", 8.5), bl=("round", 8.5))], 7.0, b, STEEL)+ for x in (10, 13): # the runner down the drawer's side+ p.inlay([plate(x, 16, x + 1, H - 16)], INKM, 1.0)+ p.sink([shape(b, *RACK_LABEL, 3)], 2, 1.0)+ for x in (224, 284):+ p.bump([shape(b, x, 10, x + 8, 22, 2)], 1.6, 0.8, DARK)+ p.bump([shape(b, 222, 13, 294, 19, 3)], 2.6, 1.2, BRIGHT)+ screw(p, 198, 16, 2.2)+ 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 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)+ screw(p, 30, H - 11, 2.0)+ grille(p, 60, H - 13.5, 290, H - 7.5, 3.0)+ return lit(RACK_W, H, draw, shadow=True), H+++def drawer_reference(rows=2):+ """The armies drawer, out to the left of the standings on two runners, its rows level with theirs."""+ b = "console"+ H = DRAWER_TOP + rows * RACK_PITCH + RACK_FOOT++ def draw(p):+ p.silhouette([plate(6, 3, DRAWER_W + 20, H - 6, tl=("round", 6), bl=("round", 6))], 3.0, b)+ p.frame([plate(7.5, 4.5, DRAWER_W + 20, H - 7.5, tl=("round", 4.5), bl=("round", 4.5))], 6.0, b, STEEL)+ for y in (6, H - 11): # the runners, a dark channel with a bright slide in it+ p.sink([plate(20, y, DRAWER_W + 20, y + 4)], 2.0, 0.6, DARK)+ p.bump([plate(28, y + 1.2, DRAWER_W + 20, y + 2.8)], 1.4, 0.5, BRIGHT)+ p.bump([shape(b, 11, 9, 16, H - 12, 2)], 2.6, 1.0, BRIGHT) # the pull, down the front+ for k in range(rows):+ y0 = DRAWER_TOP + k * RACK_PITCH+ for c in DRAWER_CAMEOS:+ p.sink([shape(b, c[0], c[1] + y0, c[2], c[3] + y0, 3)], 3, 1.2)+ return lit(DRAWER_W, H, draw, shadow=True), H+++def lever(position, state):+ """The camera's three way lever: a gate with a ball in it at Free, Director or Player."""+ w, h = 156, 32+ cx = (22, 78, 134)[position]++ def draw(p):+ b = "console"+ p.frame([plate(0, 2, w, 30, ("round", 12), ("round", 12), ("round", 12), ("round", 12))], 2.5, b, STEEL)+ p.sink([plate(6, 8, w - 6, 24, ("round", 7), ("round", 7), ("round", 7), ("round", 7))], 3.5, 1.2, GLASS)+ for x in (22, 78, 134): # a detent at each stop+ p.sink([plate(x - 2, 24, x + 2, 27.5)], 1.2, 0.5, DARK)+ if state == "H":+ p.raise_plate([regular(cx, 16, 11.5, 24)], 1.5, 0.6, HILITE)+ p.raise_plate([regular(cx, 16, 9.5, 24)], 4.5, 1.0, BRIGHT, profile=rounded(4.5))+ return lit(w, h, draw)+++def rocker(on, state):+ """The fog's rocker, the side it is pressed down: I is on, O is off. Under the pointer the bezel+ brightens, the paddle turns from dark to bare steel and its marks to gold."""+ w, h = 46, 32+ hover = state == "H"++ def draw(p):+ b = "console"+ p.frame([shape(b, 0, 0, w, h, 6)], 3.0, b, BRIGHT if hover else STEEL)+ p.sink([shape(b, 4, 4, w - 4, h - 4, 4)], 3.0, 1.0, DARK)+ p.bump([shape(b, 7, 7, w - 7, h - 7, 3)], 2.6, 1.0, STEEL if hover else DARK)+ p.ramp([shape(b, 7, 7, w - 7, h - 7, 3)], -1.6 if on else 1.6, 1.6 if on else -1.6)+ mark = GOLDM if hover else PAPERM+ p.inlay([plate(14.4, 11, 16, 21)], HILITE if on else mark, 0.3)+ p.inlay([regular(31, 16, 4.2, 16)], mark, 0.3)+ p.bump([regular(31, 16, 2.8, 16)], 0.3, 0.2, STEEL if hover else DARK)+ 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, pulled+ right out with its lamp on air when that player is followed. The code lights the lens in his colour."""+ w, h = RACK_TAB+ x0 = RACK_TAB_OUT[state]++ def draw(p):+ b = "console"+ p.frame([plate(x0, 1, w + 10, h - 1, tl=("round", 5), bl=("round", 5))], 3.0, b, BRIGHT if state == "H" else STEEL)+ p.sink([shape(b, x0 + 4, 7, x0 + 9, h - 7, 1.5)], 1.5, 0.6)+ if state == "On":+ lens(p, x0 + 16, h / 2, 2.8, ACCENT2)+ return lit(w, h, draw)+++def rack_pieces():+ ref, H = rack_reference()+ rows_at = RACK_TOP + RACK_HEAD+ body_at = rows_at + 2 * RACK_PITCH+ drawer, DH = drawer_reference()+ out = {"RackTop": ref.crop((0, 0, RACK_W, RACK_TOP)), "RackHead": ref.crop((0, RACK_TOP, RACK_W, rows_at)),+ "RackRow": ref.crop((0, rows_at, RACK_W, rows_at + RACK_PITCH)), "RackBody": ref.crop((0, body_at + 4, RACK_W, body_at + 8)),+ "RackBottom": ref.crop((0, H - RACK_FOOT, RACK_W, H)),+ "DrawerTop": drawer.crop((0, 0, DRAWER_W, DRAWER_TOP)),+ "DrawerRow": drawer.crop((0, DRAWER_TOP, DRAWER_W, DRAWER_TOP + RACK_PITCH)),+ "DrawerBottom": drawer.crop((0, DH - RACK_FOOT, DRAWER_W, DH)), "RackLens": white_lens(5, 12),+ "RackMeter": white_lens(16, 4)}+ for i, pos in enumerate(("Free", "Director", "Player")):+ for st in ("", "H"):+ out["RackLever%s%s" % (pos, st)] = lever(i, st)+ 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 st in ("", "H", "On"):+ out["RackTab" + st] = index_tab(st)++ def tally_piece(p):+ lens(p, 7, 7, 3.2, ACCENT2)+ out["RackTally"] = lit(14, 14, tally_piece)+ return out+++RACK_TILES = ("RackRow", "RackBody", "DrawerRow")+++def paint_rack():+ """ReforgedHudObsSpec, 1024x256: every rack piece where ReforgedHudObsSpec.ini maps it. A slice the+ code repeats has to meet itself: its first and last rows cover the same texels."""+ pieces = rack_pieces()+ M = read_mapped("Obs", "Spec")+ assert set(M) == {"ObserverPro" + n for n in pieces}, "ReforgedHudObsSpec.ini and the rack's pieces differ: %s" % \+ sorted(set(M) ^ {"ObserverPro" + n for n in pieces})+ sheet_img = Image.new("RGBA", OBS_SPEC_SIZE, (0, 0, 0, 0))+ for n, im in pieces.items():+ put(sheet_img, im, M["ObserverPro" + n])+ check_mapped(M, OBS_SPEC_SIZE)+ for n in RACK_TILES:+ a = np.asarray(pieces[n])[..., 3] > 127+ assert (a[0] == a[-1]).all(), "%s does not tile: its ends differ" % n+ return sheet_img++# ---------------------------------------------------------------------------------------------- checksdef scheme_blocks(scheme="America8x6"):@@ -1356,6 +2396,8 @@ def check_sheet(sheet_img, side_name, glow="B"):for k in ("Infantry", "Vehicle", "Aircraft"):for st in ("", "H", "P", "I"):want["Idle" + k + st] = (54, 35)+ for st in ("", "H", "I"):+ want["GenPowerClose" + st] = (60, 50)for n, wh in want.items():assert pre + n in M, "%s%s is not on the sheet" % (pre, n)assert size(n) == wh, "%s%s is %s, the code wants %s" % (pre, n, size(n), wh)@@ -1398,23 +2440,33 @@ def check_sheet(sheet_img, side_name, glow="B"):def main():ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])- ap.add_argument("--side", default="all", choices=["all"] + sorted(SIDES))+ ap.add_argument("--side", default="all", choices=["all", "Observer"] + sorted(SIDES))ap.add_argument("--out", required=True, help="where the PNGs go")ap.add_argument("--dds", help="Data/Art/Textures, to write the DXT5 textures too")ap.add_argument("--emblem", default=EMBLEM_SVG)ap.add_argument("--ready-glow", choices=("A", "B"), default="B",help="a charged superweapon's light: B, the breath and a rising band (default, ships), or A, the breath alone")+ ap.add_argument("--lobby-emblems", action="store_true",+ help="prototype, off by default: also write ReforgedFactionEmblems, the front end's cards and side icons")args = ap.parse_args()os.makedirs(args.out, exist_ok=True)- for side in (list(SIDES) if args.side == "all" else [args.side]):+ for side in (list(SIDES) + ["Observer"] if args.side == "all" else [args.side]) + (["Lobby"] if args.lobby_emblems else []):made = {}- frame = radar_frame(side)- for wide in (False, True):- img = paint_bar(side, wide)- check(img, wide, side, frame)- made["ReforgedHud%sCommandBar%s" % (side, "Wide" if wide else "")] = img- made["ReforgedHud%sPowers" % side] = sheet_img = paint_powers(side, args.emblem, frame, args.ready_glow)- check_sheet(sheet_img, side, args.ready_glow)+ if side == "Lobby":+ made = {"ReforgedFactionEmblems": paint_faction_emblems()}+ elif side == "Observer":+ bar, panel = paint_observer_bar(), paint_observer_panel()+ check_observer(bar, panel)+ made = {"ReforgedHudObsCommandBar": bar, "ReforgedHudObsPlayerWindow": panel,+ "ReforgedHudObsPieces": paint_observer_pieces(), "ReforgedHudObsSpec": paint_rack()}+ else:+ frame = radar_frame(side)+ for wide in (False, True):+ img = paint_bar(side, wide)+ check(img, wide, side, frame)+ made["ReforgedHud%sCommandBar%s" % (side, "Wide" if wide else "")] = img+ made["ReforgedHud%sPowers" % side] = sheet_img = paint_powers(side, args.emblem, frame, args.ready_glow)+ check_sheet(sheet_img, side, args.ready_glow)for name, img in made.items():img.save(os.path.join(args.out, name + ".png"))if args.dds: