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): radar fit to map, idle buttons, picture queue trays
Olcay Seygan548352ff712f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 9a5d90061..cd5b9e3db 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,6 +8,17 @@ found and fixed, EA's own, not port damage.**---+## The command bar fits the map++- 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.++## Your queue in pictures again++- What your base is building stands over the radar as pictures again, not lines of text: one row of five, the next to arrive on the left, together in one steel tray hard against the left edge of the screen, built like the tray that holds the general's powers, each picture in its cell with the coloured edge a power button wears. The seconds left sit in its corner on a dark plate, an x4 marks four of the same thing queued back to back, and a dark sweep comes off the picture as it builds. Past five, a tag sticking up from the tray says how many more are coming. Click one and the camera goes to the building making it; right-click it, or click with Ctrl held, and the newest of it comes off that building's queue, the picture turning red under Ctrl first so you see what you are about to cancel.+- Superweapon countdowns in the top right are pictures too, yours first and then everyone else's, each soonest first, six to a row and two rows at most in a tray of their own against the right edge of the screen, a little under the info strip, with a tag hanging below it for the rest. A line under each one is its owner's colour, a dark sweep shows how far the charge has come, and once one is charged that line's colour rises up over the picture like light off a lamp, brightest at the line, breathing slowly so a ready superweapon reads at a glance. Clicking one of your own takes the camera to it.+## EA's four ranks are back- The rank ladder is gone, every grade, perk and aura of it. A unit is Regular, Veteran, Elite or Heroic again, on the kills and the bonuses the 2003 game gave them, with EA's chevrons over the health bar and on the portrait. Six kills of its own kind make a Crusader Heroic, where an American one needed 66 on the ladder.diff --git a/GeneralsMD/Code/Data/INI/CommandSetReforged.ini b/GeneralsMD/Code/Data/INI/CommandSetReforged.iniindex 54e99c077..5d223848e 100644--- a/GeneralsMD/Code/Data/INI/CommandSetReforged.ini+++ b/GeneralsMD/Code/Data/INI/CommandSetReforged.ini@@ -25,6 +25,24 @@ CommandButton Command_ForceAttackDescriptLabel = CONTROLBAR:ToolTipForceAttackEnd+; The idle buttons beside the command grid, under EA's idle worker: their tooltips. A click is+; ControlBarSystem's, the same cycle the Next Idle Infantry, Vehicle and Aircraft keys run.++CommandButton NonCommand_IdleInfantry+ TextLabel = CONTROLBAR:IdleInfantry+ DescriptLabel = CONTROLBAR:IdleInfantryDescription+End++CommandButton NonCommand_IdleVehicle+ TextLabel = CONTROLBAR:IdleVehicle+ DescriptLabel = CONTROLBAR:IdleVehicleDescription+End++CommandButton NonCommand_IdleAircraft+ TextLabel = CONTROLBAR:IdleAircraft+ DescriptLabel = CONTROLBAR:IdleAircraftDescription+End+; ==== China Command Centers after Mines ===========================================================; Buying Mines swaps the Command Center to its Upgrade set, and the Infantry and Nuke copies of thatdiff --git a/GeneralsMD/Code/Data/INI/ControlBarProReforged.ini b/GeneralsMD/Code/Data/INI/ControlBarProReforged.iniindex 1d50b63ce..b2b11310f 100644--- a/GeneralsMD/Code/Data/INI/ControlBarProReforged.ini+++ b/GeneralsMD/Code/Data/INI/ControlBarProReforged.ini@@ -45,6 +45,17 @@ControlBarScheme America8x6ScreenCreationRes X:1920 Y:1080Side America+ ; the painting's plates reach past ControlBar.wnd's input blockers; these cover them (Tools/hud_command_bar.py)+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage AmericaProLogoCommandBarBorderColor R:44 G:139 B:101 A:255 ;EXP Green@@ -106,12 +117,12 @@ ControlBarScheme America8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -128,12 +139,149 @@ 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 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 pieces+ IdleInfantryButtonImage AmericaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage AmericaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage AmericaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage AmericaProRadar+ PowerTrayImage AmericaProTray+End+++; Turkiye's own painting and buttons (composite armour, team red and dark steel, no national mark);+; its shortcut tray is still America's, through GenPowersShortcutBarUS.wnd+ControlBarScheme Turkiye8x6+ ScreenCreationRes X:1920 Y:1080+ Side Turkiye+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858+ QueueButtonImage SCBigButton+ RightHUDImage TurkiyeProLogo+ CommandBarBorderColor R:44 G:139 B:101 A:255 ;EXP Green+ BuildUpClockColor R:0 G:0 B:0 A:160+ ButtonBorderBuildColor R:91 G:146 B:255 A:255 ;blue+ ButtonBorderActionColor R:0 G:222 B:1 A:255 ;Green+ ButtonBorderUpgradeColor R:208 G:108 B:0 A:255 ;Orange+ ButtonBorderSystemColor R:255 G:240 B:5 A:255 ;yellow++ GenBarButtonIn BlankTexture+ GenBarButtonOn BlankTexture++ ToggleButtonUpIn TurkiyeProMaximizeH+ ToggleButtonUpOn TurkiyeProMaximize+ ToggleButtonUpPushed TurkiyeProMaximizeP++ ToggleButtonDownIn TurkiyeProMinimizeH+ ToggleButtonDownOn TurkiyeProMinimize+ ToggleButtonDownPushed TurkiyeProMinimizeP++ OptionsButtonEnable TurkiyeProOptions+ OptionsButtonHightlited TurkiyeProOptionsH+ OptionsButtonPushed TurkiyeProOptionsP++ IdleWorkerButtonEnable TurkiyeProWorker+ IdleWorkerButtonHightlited TurkiyeProWorkerH+ IdleWorkerButtonPushed TurkiyeProWorkerP+ IdleWorkerButtonDisabled TurkiyeProWorkerI+ BuddyButtonEnable TurkiyeProChat+ BuddyButtonHightlited TurkiyeProChatH+ BuddyButtonPushed TurkiyeProChatP++ BeaconButtonEnable TurkiyeProBeacon+ BeaconButtonHightlited TurkiyeProBeaconH+ BeaconButtonPushed TurkiyeProBeaconP+ OptionsButtonDisabled TurkiyeProOptionsI+ BuddyButtonDisabled TurkiyeProChatI+ BeaconButtonDisabled TurkiyeProBeaconI++ GeneralButtonEnable TurkiyeProGeneral+ GeneralButtonHightlited TurkiyeProGeneralH+ GeneralButtonPushed TurkiyeProGeneralP+ GeneralButtonDisabled TurkiyeProGeneralI++ UAttackButtonEnable BlankTexture+ UAttackButtonHightlited TurkiyeProUAttackH+ UAttackButtonPushed BlankTexture++ MinMaxButtonEnable BlankTexture+ MinMaxButtonHightlited BlankTexture+ MinMaxButtonPushed BlankTexture++ MinMaxUL X:1829 Y:802+ MinMaxLR X:1920 Y:833+ GeneralUL X:1829 Y:840+ GeneralLR X:1920 Y:871+ UAttackUL X:276 Y:740+ UAttackLR X:340 Y:804++ OptionsUL X:609 Y:925+ OptionsLR X:663 Y:960+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960+ ChatUL X:609 Y:1036+ ChatLR X:663 Y:1071+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015++ PowerBarUL X:605 Y:906+ PowerBarLR X:1313 Y:916+ ExpBarForegroundImage TurkiyeProExpBar+ MoneyUL X:894 Y:879+ MoneyLR X:1026 Y:904++ GenArrow TurkiyeProLevelUP+ CommandMarkerImage SAEmptyFrame+ ImagePart+ Position X:0 Y:568+ Size X:1920 Y:512+ ImageName TurkiyeProCommandBar+ Layer 4+ End+ PowerPurchaseImage TurkiyeProGeneralsPowerWindow+ ; 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 pieces+ IdleInfantryButtonImage TurkiyeProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage TurkiyeProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage TurkiyeProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage TurkiyeProRadar+ PowerTrayImage TurkiyeProTrayEndControlBarScheme GLA8x6ScreenCreationRes X:1920 Y:1080Side GLA+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage GlaProLogoBuildUpClockColor R:0 G:0 B:0 A:160@@ -196,12 +344,12 @@ ControlBarScheme GLA8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -217,12 +365,35 @@ 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 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 pieces+ IdleInfantryButtonImage GlaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage GlaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage GlaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage GlaProRadar+ PowerTrayImage GlaProTrayEndControlBarScheme China8x6ScreenCreationRes X:1920 Y:1080Side China+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage ChinaProLogoCommandBarBorderColor R:113 G:110 B:102 A:255 ;EXP Prom Button@@ -285,12 +456,12 @@ ControlBarScheme China8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -307,6 +478,19 @@ 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 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 pieces+ IdleInfantryButtonImage ChinaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage ChinaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage ChinaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage ChinaProRadar+ PowerTrayImage ChinaProTrayEnd@@ -391,7 +575,7 @@ ControlBarScheme Observer8x6Position X:0 Y:568Size X:1920 Y:512ImageName ObserverProCommandBar- Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on top+ Layer 4 ;; layer means how deep the image will be drawn, it's a number between 0-5 with 0 being on topEndPowerPurchaseImage AmericaProGeneralsPowerWindowEnd@@ -402,6 +586,16 @@ EndControlBarScheme AmericaSuperWeaponGeneral8x6ScreenCreationRes X:1920 Y:1080Side AmericaSuperWeaponGeneral+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage AmericaProLogoCommandBarBorderColor R:44 G:139 B:101 A:255 ;EXP Green@@ -463,12 +657,12 @@ ControlBarScheme AmericaSuperWeaponGeneral8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -485,12 +679,35 @@ 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 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 pieces+ IdleInfantryButtonImage AmericaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage AmericaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage AmericaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage AmericaProRadar+ PowerTrayImage AmericaProTrayEndControlBarScheme AmericaLaserGeneral8x6ScreenCreationRes X:1920 Y:1080Side AmericaLaserGeneral+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage AmericaProLogoCommandBarBorderColor R:44 G:139 B:101 A:255 ;EXP Green@@ -552,12 +769,12 @@ ControlBarScheme AmericaLaserGeneral8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -573,6 +790,19 @@ 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 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 pieces+ IdleInfantryButtonImage AmericaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage AmericaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage AmericaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage AmericaProRadar+ PowerTrayImage AmericaProTrayEnd@@ -580,6 +810,16 @@ EndControlBarScheme AmericaAirForceGeneral8x6ScreenCreationRes X:1920 Y:1080Side AmericaAirForceGeneral+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage AmericaProLogoCommandBarBorderColor R:44 G:139 B:101 A:255 ;EXP Green@@ -641,12 +881,12 @@ ControlBarScheme AmericaAirForceGeneral8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -663,6 +903,19 @@ 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 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 pieces+ IdleInfantryButtonImage AmericaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage AmericaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage AmericaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage AmericaProRadar+ PowerTrayImage AmericaProTrayEnd@@ -694,6 +947,16 @@ EndControlBarScheme ChinaTankGeneral8x6ScreenCreationRes X:1920 Y:1080Side ChinaTankGeneral+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage ChinaProLogoCommandBarBorderColor R:113 G:110 B:102 A:255 ;EXP Prom Button@@ -756,12 +1019,12 @@ ControlBarScheme ChinaTankGeneral8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -778,6 +1041,19 @@ 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 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 pieces+ IdleInfantryButtonImage ChinaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage ChinaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage ChinaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage ChinaProRadar+ PowerTrayImage ChinaProTrayEnd@@ -785,6 +1061,16 @@ EndControlBarScheme ChinaInfantryGeneral8x6ScreenCreationRes X:1920 Y:1080Side ChinaInfantryGeneral+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage ChinaProLogoCommandBarBorderColor R:113 G:110 B:102 A:255 ;EXP Prom Button@@ -847,12 +1133,12 @@ ControlBarScheme ChinaInfantryGeneral8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -869,6 +1155,19 @@ 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 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 pieces+ IdleInfantryButtonImage ChinaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage ChinaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage ChinaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage ChinaProRadar+ PowerTrayImage ChinaProTrayEnd@@ -878,6 +1177,16 @@ EndControlBarScheme ChinaNukeGeneral8x6ScreenCreationRes X:1920 Y:1080Side ChinaNukeGeneral+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage ChinaProLogoCommandBarBorderColor R:113 G:110 B:102 A:255 ;EXP Prom Button@@ -940,12 +1249,12 @@ ControlBarScheme ChinaNukeGeneral8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -962,6 +1271,19 @@ 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 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 pieces+ IdleInfantryButtonImage ChinaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage ChinaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage ChinaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage ChinaProRadar+ PowerTrayImage ChinaProTrayEnd@@ -987,6 +1309,16 @@ EndControlBarScheme GLAToxinGeneral8x6ScreenCreationRes X:1920 Y:1080Side GLAToxinGeneral+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage GlaProLogoBuildUpClockColor R:0 G:0 B:0 A:160@@ -1049,12 +1381,12 @@ ControlBarScheme GLAToxinGeneral8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -1070,6 +1402,19 @@ 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 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 pieces+ IdleInfantryButtonImage GlaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage GlaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage GlaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage GlaProRadar+ PowerTrayImage GlaProTrayEnd@@ -1078,6 +1423,16 @@ EndControlBarScheme GLADemolitionGeneral8x6ScreenCreationRes X:1920 Y:1080Side GLADemolitionGeneral+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage GlaProLogoBuildUpClockColor R:0 G:0 B:0 A:160@@ -1140,12 +1495,12 @@ ControlBarScheme GLADemolitionGeneral8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -1161,6 +1516,19 @@ 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 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 pieces+ IdleInfantryButtonImage GlaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage GlaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage GlaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage GlaProRadar+ PowerTrayImage GlaProTrayEnd@@ -1169,6 +1537,16 @@ EndControlBarScheme GLAStealthGeneral8x6ScreenCreationRes X:1920 Y:1080Side GLAStealthGeneral+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage GlaProLogoBuildUpClockColor R:0 G:0 B:0 A:160@@ -1231,12 +1609,12 @@ ControlBarScheme GLAStealthGeneral8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -1252,6 +1630,19 @@ 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 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 pieces+ IdleInfantryButtonImage GlaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage GlaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage GlaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage GlaProRadar+ PowerTrayImage GlaProTrayEnd@@ -1261,6 +1652,16 @@ EndControlBarScheme ChinaBossGeneral8x6ScreenCreationRes X:1920 Y:1080Side Boss+ BlockRadarUL X:0 Y:724+ BlockRadarLR X:372 Y:1080+ BlockProductionUL X:560 Y:884+ BlockProductionLR X:1383 Y:1080+ BlockMoneyUL X:832 Y:854+ BlockMoneyLR X:1088 Y:884+ BlockUpgradesUL X:1590 Y:858+ BlockUpgradesLR X:1920 Y:1080+ BlockGenPowerUL X:1806 Y:790+ BlockGenPowerLR X:1920 Y:858QueueButtonImage SCBigButtonRightHUDImage ChinaProLogoCommandBarBorderColor R:113 G:110 B:102 A:255 ;EXP Prom Button@@ -1323,12 +1724,12 @@ ControlBarScheme ChinaBossGeneral8x6OptionsUL X:609 Y:925OptionsLR X:663 Y:960- WorkerUL X:609 Y:962- WorkerLR X:663 Y:997+ WorkerUL X:1312 Y:925+ WorkerLR X:1366 Y:960ChatUL X:609 Y:1036ChatLR X:663 Y:1071- BeaconUL X:609 Y:999- BeaconLR X:663 Y:1034+ BeaconUL X:609 Y:980+ BeaconLR X:663 Y:1015PowerBarUL X:605 Y:906PowerBarLR X:1313 Y:916@@ -1345,5 +1746,18 @@ 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 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 pieces+ IdleInfantryButtonImage ChinaProIdleInfantry+ IdleInfantryUL X:1312 Y:962+ IdleInfantryLR X:1366 Y:997+ IdleVehicleButtonImage ChinaProIdleVehicle+ IdleVehicleUL X:1312 Y:999+ IdleVehicleLR X:1366 Y:1034+ IdleAircraftButtonImage ChinaProIdleAircraft+ IdleAircraftUL X:1312 Y:1036+ IdleAircraftLR X:1366 Y:1071+ RadarFrameImage ChinaProRadar+ PowerTrayImage ChinaProTrayEnddiff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex 6a45b06a3..1d55df293 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -38,6 +38,32 @@ CONTROLBAR:ToolTipForceAttack"The next click attacks whatever is under the pointer, the ground and your own side included. Click the button again to call it off."END+// the idle buttons at the right end of the command grid, under EA's idle worker++CONTROLBAR:IdleInfantry+"Idle Infantry"+END++CONTROLBAR:IdleInfantryDescription+"Click to select the next idle infantry"+END++CONTROLBAR:IdleVehicle+"Idle Vehicle"+END++CONTROLBAR:IdleVehicleDescription+"Click to select the next idle ground vehicle"+END++CONTROLBAR:IdleAircraft+"Idle Aircraft"+END++CONTROLBAR:IdleAircraftDescription+"Click to select the next idle aircraft"+END+GUI:OrderHoldPositionDescription"The selected units guard the spot they stand on and fight whatever comes near, without chasing it out of the area."ENDdiff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex 8978ef04c..3539a86a7 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -4509,6 +4509,30 @@ CONTROLBAR:IdleWorkerDescription"Sonraki boştaki işçiyi seçmek için tıklayın"END+CONTROLBAR:IdleInfantry+"Boştaki Piyade"+END++CONTROLBAR:IdleInfantryDescription+"Sonraki boştaki piyadeyi seçmek için tıklayın"+END++CONTROLBAR:IdleVehicle+"Boştaki Araç"+END++CONTROLBAR:IdleVehicleDescription+"Sonraki boştaki kara aracını seçmek için tıklayın"+END++CONTROLBAR:IdleAircraft+"Boştaki Hava Aracı"+END++CONTROLBAR:IdleAircraftDescription+"Sonraki boştaki hava aracını seçmek için tıklayın"+END+CONTROLBAR:Beacon"İşaret"ENDdiff --git a/GeneralsMD/Code/Data/Window/ControlBar.wnd b/GeneralsMD/Code/Data/Window/ControlBar.wndindex 1bf10ac25..1a74210ee 100644--- a/GeneralsMD/Code/Data/Window/ControlBar.wnd+++ b/GeneralsMD/Code/Data/Window/ControlBar.wnd@@ -2919,6 +2919,147 @@ WINDOWIMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;ENDCHILD+ WINDOW+ WINDOWTYPE = PUSHBUTTON;+ SCREENRECT = UPPERLEFT: 0 0,+ BOTTOMRIGHT: 100 100,+ CREATIONRESOLUTION: 1920 1080;+ NAME = "ControlBar.wnd:ButtonIdleInfantry";+ STATUS = IMAGE+NOFOCUS+ON_MOUSE_DOWN;+ STYLE = PUSHBUTTON+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Times New Roman", SIZE: 10, BOLD: 0;+ HEADERTEMPLATE = "[NONE]";+ TOOLTIPDELAY = -1;+ TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 128 128 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ END+ CHILD+ WINDOW+ WINDOWTYPE = PUSHBUTTON;+ SCREENRECT = UPPERLEFT: 0 0,+ BOTTOMRIGHT: 100 100,+ CREATIONRESOLUTION: 1920 1080;+ NAME = "ControlBar.wnd:ButtonIdleVehicle";+ STATUS = IMAGE+NOFOCUS+ON_MOUSE_DOWN;+ STYLE = PUSHBUTTON+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Times New Roman", SIZE: 10, BOLD: 0;+ HEADERTEMPLATE = "[NONE]";+ TOOLTIPDELAY = -1;+ TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 128 128 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ END+ CHILD+ WINDOW+ WINDOWTYPE = PUSHBUTTON;+ SCREENRECT = UPPERLEFT: 0 0,+ BOTTOMRIGHT: 100 100,+ CREATIONRESOLUTION: 1920 1080;+ NAME = "ControlBar.wnd:ButtonIdleAircraft";+ STATUS = IMAGE+NOFOCUS+ON_MOUSE_DOWN;+ STYLE = PUSHBUTTON+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Times New Roman", SIZE: 10, BOLD: 0;+ HEADERTEMPLATE = "[NONE]";+ TOOLTIPDELAY = -1;+ TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 128 128 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ END+ CHILDWINDOWWINDOWTYPE = PUSHBUTTON;SCREENRECT = UPPERLEFT: 0 0,diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Radar.h b/GeneralsMD/Code/GameEngine/Include/Common/Radar.hindex da5112011..08ad94f15 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/Radar.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/Radar.h@@ -208,6 +208,7 @@ public:// radar optionsvoid hide( Bool hide ) { m_radarHidden = hide; } ///< hide/unhide the radarBool isRadarHidden( void ) { return m_radarHidden; } ///< is radar hidden+ const Region3D *getMapExtent( void ) const { return &m_mapExtent; } ///< the map newMap was given; the radar window takes its shape// other radar option methods here like the ability to show a certain// team, show buildings, show units at all, etcdiff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.hindex 8ca407bf8..66135e5ed 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h@@ -1004,9 +1004,11 @@ public:const Image *getStarImage( void );Color getBorderColor( void ){return m_commandBarBorderColor;}- /// the two button border colours the bar itself uses, so anything drawn outside it can match+ /// the button border colours the bar itself uses, so anything drawn outside it can matchColor getBuildBorderColor( void ){return m_commandButtonBorderBuildColor;}Color getUpgradeBorderColor( void ){return m_commandButtonBorderUpgradeColor;}+ Color getActionBorderColor( void ){return m_commandButtonBorderActionColor;}+ Color getSystemBorderColor( void ){return m_commandButtonBorderSystemColor;}void updateBorderColor( Color color) {m_commandBarBorderColor = color; }/// set the command data into the button@@ -1195,6 +1197,21 @@ protected:void updateSpecialPowerShortcut( void );void arrangeSpecialPowerShortcutGrid( void ); ///< re-lay the layout's single column as rows of SPECIAL_POWER_SHORTCUT_COLSInt countVisibleSpecialPowerShortcuts( void ); ///< how many slots carry a power right now, which is not the command set's size+ UnsignedInt visibleSpecialPowerShortcutMask( void ); ///< the slots showing a power, one bit a slot+ void rearrangeSpecialPowerShortcutGrid( void ); ///< arrangeSpecialPowerShortcutGrid when the slots shown or the scheme's pieces changed+ static const UnsignedInt TRAY_NOT_LAID_OUT = 0xFFFFFFFFu; ///< no mask of MAX_SPECIAL_POWER_SHORTCUTS bits is this+ UnsignedInt m_trayLaidOutMask; ///< the slots arrangeSpecialPowerShortcutGrid stepped the tray for+ const Image *const *m_trayLaidOutFor; ///< and the scheme pieces it used, NULL for the shipped column+ Bool m_trayFramePlaced; ///< the frame stands at the stepped tray's box for this layout+ enum { POWER_TRAY_FOOT_Y = 790 }; ///< at 1080, where the tray stands: the top of the general's tab+ void powerTrayMetrics( const Image *const *tray, ICoord2D *origin, ICoord2D *cell,+ Int *left, Int *top, Int *foot, Int *bottom ); ///< see arrangeSpecialPowerShortcutGrid++ void fitRadarToMap( Bool fromLayout ); ///< the radar window, its frame and its blocker take the map's shape; see layoutPanels+ Real m_radarFitWidth, m_radarFitHeight; ///< the map extent fitRadarToMap last fitted to+ enum { RADAR_FIT_RADAR, RADAR_FIT_BLOCK, RADAR_FIT_LAMP, RADAR_FIT_COUNT };+ IRegion2D m_radarFitBox[ RADAR_FIT_COUNT ]; ///< where layoutPanels put each, against the bar's frame+ 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 slota shortcut key reaches with its row as it stands. The press calls and the peek calls both go@@ -1284,6 +1301,20 @@ protected:WindowLayout *m_specialPowerLayout;GameWindow *m_specialPowerShortcutParent;+public:+ /** Where one slot of the stepped tray draws its plate, in its own window's pixels: the cell+ * under the power, and the thickness of each edge the tray's outline runs along it (0 where a+ * neighbour stands). stepRight is how much of the top edge the step above takes off its outer+ * end; stepBelow how much of the left edge the step at its foot takes. */+ struct TraySlot+ {+ IRegion2D cell;+ Int edgeLeft, edgeTop, edgeBottom;+ Int stepRight, stepBelow;+ };+protected:+ TraySlot m_traySlot[ MAX_SPECIAL_POWER_SHORTCUTS ];+GameWindow *m_commandWindows[ MAX_COMMANDS_PER_SET ]; ///< command window controls for easy accessInt m_commandUpgradeRank[ MAX_COMMANDS_PER_SET ]; ///< each window's upgradeRank on the bar populateCommand last filled (HotKeyManager::playerButtonKey)diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBarScheme.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBarScheme.hindex 8d415af7c..20d87425e 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBarScheme.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBarScheme.h@@ -228,6 +228,32 @@ public:ICoord2D m_powerBarUL;ICoord2D m_powerBarLR;+ /// where the bar's input blockers stand when the scheme's painting is not ControlBar.wnd's+ /// (Block<Name>UL/LR); a zero LR leaves the .wnd's rectangle+ enum { BLOCK_RADAR, BLOCK_PRODUCTION, BLOCK_MONEY, BLOCK_UPGRADES, BLOCK_GEN_POWER, BLOCK_COUNT };+ ICoord2D m_blockUL[ BLOCK_COUNT ];+ ICoord2D m_blockLR[ BLOCK_COUNT ];++ /// the idle infantry, vehicle and aircraft buttons beside the command grid: Idle<Kind>ButtonImage+ /// names the sheet piece, and its H, P and I copies are the other three states; Idle<Kind>UL/LR+ /// where it stands. A scheme without the rectangle leaves the button out.+ enum { IDLE_INFANTRY, IDLE_VEHICLE, IDLE_AIRCRAFT, IDLE_COUNT };+ AsciiString m_idleButtonImage[ IDLE_COUNT ];+ ICoord2D m_idleUL[ IDLE_COUNT ];+ ICoord2D m_idleLR[ IDLE_COUNT ];++ /// RadarFrameImage: the nine pieces the radar's frame is drawn from round the map's own shape,+ /// <name>TL, T, TR, L, C, R, BL, B, BR. The corners' sizes are the frame's thickness on each side.+ enum { FRAME_TL, FRAME_T, FRAME_TR, FRAME_L, FRAME_C, FRAME_R, FRAME_BL, FRAME_B, FRAME_BR, FRAME_PIECE_COUNT };+ AsciiString m_radarFrameName;+ const Image *m_radarFrame[ FRAME_PIECE_COUNT ]; ///< resolved by init; all NULL without the key++ /// PowerTrayImage: the general's powers tray's pieces, <name>Cell, EdgeTop, EdgeLeft, EdgeBottom,+ /// CornerTopLeft, CornerBottomLeft, Step; see ControlBar::arrangeSpecialPowerShortcutGrid+ enum { TRAY_CELL, TRAY_EDGE_TOP, TRAY_EDGE_LEFT, TRAY_EDGE_BOTTOM, TRAY_CORNER_TL, TRAY_CORNER_BL, TRAY_STEP, TRAY_PIECE_COUNT };+ AsciiString m_powerTrayName;+ const Image *m_powerTray[ TRAY_PIECE_COUNT ]; ///< resolved by init; all NULL without the key+@@ -276,6 +302,16 @@ public:/// the bar on screen wears its scheme's own painting, ControlBar Pro'sBool isCurrentSchemePainted( void ) const;++ /// the radar frame's nine pieces (ControlBarScheme::FRAME_*) of the scheme on screen, or NULL+ /// when it names none or lacks the two corners that size it; the radar then keeps its square well+ const Image *const *getRadarFrame( void ) const;+ /// the frame round a radar standing at 'radar' on screen: the corners' sizes, at the screen's+ /// height over 1080, are its thickness on each side+ static void radarFrameRect( const Image *const *frame, const IRegion2D& radar, IRegion2D *outer );+ /// the general's powers tray's pieces (ControlBarScheme::TRAY_*) of the scheme on screen, or NULL+ /// without a cell; the tray then keeps the shipped column+ const Image *const *getPowerTray( void ) const;/// the scheme's painting, cut at the panel seams and each piece drawn where its panel standsvoid drawPainting( ICoord2D offset, Bool foreground );diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.hindex b9b18179e..ad7a57869 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h@@ -1015,23 +1015,31 @@ public: // ********************************************************************void drawDirectorIntroPlate( void );//- // The production list on the left: one line per item the local player has coming, queued in a- // factory or going up on the map, soonest finished first. Past PRODUCTION_LIST_LINES the rest is- // one "+N more" line. The superweapon list in the top right stops at SUPERWEAPON_LIST_LINES the- // same way.+ // The production list on the left: one cameo per item the local player has coming, queued in a+ // factory or going up on the map, soonest finished first, in one row. Past PRODUCTION_LIST_CELLS a+ // tab sticking up from the tray says "+N" for the rest. The superweapon cameos in the top right,+ // SUPERWEAPON_LIST_COLUMNS to a row, stop at SUPERWEAPON_LIST_CELLS with a tab hanging below.//- enum { PRODUCTION_LIST_LINES = 6 };- enum { SUPERWEAPON_LIST_LINES = 18 };+ enum { PRODUCTION_LIST_COLUMNS = 5, PRODUCTION_LIST_CELLS = 5 }; ///< one row, over the radar's piece of the bar+ enum { SUPERWEAPON_LIST_COLUMNS = 6, SUPERWEAPON_LIST_CELLS = 12 }; ///< two rows at moststruct ProductionListSlot{ObjectID producer; ///< the building it is queued on, or the building going up- Int typeKey; ///< what the item is, so a run of the same thing is one line+ Int typeKey; ///< what the item is, so a run of the same thing is one cellBool isUpgrade;Int remaining; ///< logic frames until it is done, waiting time ahead of it included- Int quantity; ///< how many of the same thing the line stands for- UnicodeString name;+ Int quantity; ///< how many of the same thing the cell stands for+ Int percent; ///< of its own build done; 0 while it waits behind another+ const Image * cameo; ///< its picture, NULL for a template that carries none+ Int id; ///< what a cancel names: the run's newest production ID, or the upgrade's key+ Bool isStructure; ///< going up on the map: a click looks at it, nothing cancels it};+ /// A click on a production or superweapon cell, at `mouse` in screen pixels: TRUE when a cell took it.+ /// A production cell takes the camera to its building, or with `cancel` takes the newest of its+ /// items off that building's queue; one of your own superweapons takes the camera to it+ Bool handleHudCellClick( const ICoord2D *mouse, Bool cancel );+/// Ingame video playbackvirtual void playMovie( const AsciiString& movieName );virtual void stopMovie( void );@@ -1174,8 +1182,11 @@ public: // ********************************************************************void addIdleWorkerFor( Object *obj, Int playerIndex ); ///< addIdleWorker with the owner read at the callvirtual void removeIdleWorker( Object *obj, Int playerNumber );virtual Object *selectNextIdleWorker( void ); ///< what it selected, NULL with no idle worker; never moves the camera- void selectNextIdleUnit( KindOfMaskType mustBeSet, KindOfMaskType mustBeClear ); ///< the same cycle for fighting units of those kinds standing with no order+ Object *selectNextIdleUnit( KindOfMaskType mustBeSet, KindOfMaskType mustBeClear ); ///< the same cycle for fighting units of those kinds standing with no order; what it selected, or NULLstatic Bool isIdleCombatUnit( const Object *obj ); ///< the local player's fighting unit standing with no order+ /// the kinds a MSG_META_SELECT_NEXT_IDLE_* key cycles over: vehicles are ground vehicles only+ static void idleUnitKinds( GameMessage::Type t, KindOfMaskType *mustBeSet, KindOfMaskType *mustBeClear );+ void updateIdleUnitButtons( void ); ///< the idle infantry, vehicle, aircraft and worker buttons lit while one of their kind stands idlevirtual void recreateControlBar( void );virtual void notifyResolutionChange( void );@@ -1194,11 +1205,6 @@ public: // ********************************************************************Bool shouldMoveScrollAnchor( void ) const { return m_moveRMBScrollAnchor; }private:- virtual Int getIdleWorkerCount( void );- virtual Object *findIdleWorker( Object *obj);- virtual void showIdleWorkerLayout( void );- virtual void hideIdleWorkerLayout( void );- virtual void updateIdleWorker( void );virtual void resetIdleWorker( void );public:@@ -1406,7 +1412,9 @@ protected:void drawHudOverlay( void ); ///< the top right info strip (ShowNetBox), peace time at its endInt hudStripBottom( void ) const; ///< first screen row below that strip, 0 while it is not drawnvoid drawKickVoteBanner( void ); ///< the open vote kick, top middle, while there is one- void drawProductionList( void ); ///< the production list, lines on the left above the control bar+ void drawProductionList( void ); ///< the production list, cameos on the left above the control bar+ DisplayString *cellString( DisplayString *&string, const UnicodeString &text ); ///< a cell's kept readout string+ void drawCellSeconds( DisplayString *&string, Int seconds, const IRegion2D &cameo, const Image *plate ); ///< "45s" in a cameo's cornerSignalKind m_armedSignal; ///< the signal the next click drops; SIGNAL_KIND_COUNT for nonestruct SignalMark@@ -1435,8 +1443,6 @@ protected:void fadeClassicMessages( void );void drawClassicMessages( void );void freeClassicMessages( void );- void drawClassicSuperweapon( SuperweaponInfo *info, const AsciiString &templateName, Bool isReady, Int readySecs,- Int x, Int *y );void watchDozers( void );UnsignedInt m_dozerCheckFrame; ///< the logic frame watchDozers last looked onBool m_hadDozer[ MAX_PLAYER_COUNT ]; ///< that player had a dozer or worker then@@ -1471,14 +1477,27 @@ protected://// The production list: everything the local player has coming, gathered once a logic frame, and- // one kept string per line plus the "+N more" one, so a line is laid out again only when its text- // changes. The superweapon list keeps its own "+N more" string the same way.+ // kept strings per cell, its seconds at 2n and its "xN" at 2n + 1, so a readout is laid out again+ // only when its text changes. The superweapon cameos keep a seconds string each; each tray's+ // "+N" tab has one of its own.//- ProductionListSlot m_productionList[ PRODUCTION_LIST_LINES ];- Int m_productionListCount; ///< lines filled- Int m_productionListTotal; ///< items coming, listed or not- DisplayString * m_productionListText[ PRODUCTION_LIST_LINES + 1 ];+ ProductionListSlot m_productionList[ PRODUCTION_LIST_CELLS ];+ Int m_productionListCount; ///< cells filled+ Int m_productionListTotal; ///< items coming, shown or not+ DisplayString * m_productionListText[ 2 * PRODUCTION_LIST_CELLS ];+ DisplayString * m_productionListMoreText;+ DisplayString * m_superweaponCellText[ SUPERWEAPON_LIST_CELLS ];DisplayString * m_superweaponMoreText;+ // where the last draw put the cells and the tabs, for handleHudCellClick; a tab not drawn is empty+ IRegion2D m_productionListPlace[ PRODUCTION_LIST_CELLS ];+ Int m_productionListCells; ///< cells drawn+ IRegion2D m_productionListTab;+ IRegion2D m_superweaponPlace[ SUPERWEAPON_LIST_CELLS ];+ ObjectID m_superweaponJump[ SUPERWEAPON_LIST_CELLS ]; ///< the building a click looks at, INVALID_ID for none+ Int m_superweaponCells; ///< cells drawn+ IRegion2D m_superweaponTab;+ UnsignedInt m_hudCellPass; ///< client passes, counted by update()+ UnsignedInt m_hudCellDrawnPass; ///< m_hudCellPass when postDraw last laid the cells outCoord2D m_superweaponPosition;Real m_superweaponFlashDuration;@@ -1602,8 +1621,6 @@ protected:// Idle worker animationObjectList m_idleWorkers[MAX_PLAYER_COUNT];- GameWindow * m_idleWorkerWin;- Int m_currentIdleWorkerDisplay;DrawableID m_soloNexusSelectedDrawableID; ///< The drawable of the nexus, if only one angry mob is selected, otherwise, null@@ -1637,7 +1654,9 @@ enum HudReadoutCorner* plate's own margins. Text that does not fit is set a point smaller until it does. */extern Bool HudReadout_fits( DisplayString *text, const IRegion2D &cell );-/** The plate in `corner` of `cell`'s inner rectangle and `text` on it. */-extern void HudReadout_draw( DisplayString *text, const IRegion2D &cell, HudReadoutCorner corner, Color textColor );+/** The plate in `corner` of `cell`'s inner rectangle and `text` on it: `plate` stretched to it when+ * given (a sheet piece), a solid one otherwise. */+extern void HudReadout_draw( DisplayString *text, const IRegion2D &cell, HudReadoutCorner corner, Color textColor,+ const Image *plate = NULL );#endif // _IN_GAME_UI_H_diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/PlaceEventTranslator.h b/GeneralsMD/Code/GameEngine/Include/GameClient/PlaceEventTranslator.hindex 6898dcb0c..33b1cf074 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/PlaceEventTranslator.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/PlaceEventTranslator.h@@ -38,6 +38,8 @@ class PlaceEventTranslator : public GameMessageTranslator{private:UnsignedInt m_frameOfUpButton;+ Bool m_cellClickTaken; ///< the left press went to a HUD cell, so its release, drag and click are the cell's too+ Bool m_cellRightClickTaken; ///< the same for the right button, so a cancel never turns into a world orderpublic:PlaceEventTranslator();diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cppindex b5b647a78..fccde6b00 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp@@ -58,6 +58,7 @@#include "Common/ThingFactory.h"#include "Common/Upgrade.h"#include "Common/Recorder.h"+#include "Common/Radar.h"#include "GameLogic/GameLogic.h"#include "GameLogic/ExperienceTracker.h"@@ -1440,6 +1441,12 @@ ControlBar::ControlBar( void )updateCommanBarBorderColors(GAME_COLOR_UNDEFINED,GAME_COLOR_UNDEFINED,GAME_COLOR_UNDEFINED,GAME_COLOR_UNDEFINED);m_radarAttackGlowWindow = NULL;m_remainingRadarAttackGlowFrames = 0;+ m_trayLaidOutMask = TRAY_NOT_LAID_OUT;+ m_trayLaidOutFor = NULL;+ m_trayFramePlaced = FALSE;+ m_radarFitWidth = m_radarFitHeight = 0.0f;+ 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;#if defined( _INTERNAL ) || defined( _DEBUG )m_lastFrameMarkedDirty = 0;@@ -2306,8 +2313,104 @@ void ControlBar::layoutPanels( void )placeInPanel( child, panelForWindow( shortWindowName( child ), designCenterX ),barOrigin.x, barOrigin.y, 0, parentTop ); }+ fitRadarToMap( TRUE );+} // end layoutPanels+//-------------------------------------------------------------------------------------------------+/** 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+ * meets the corner of the screen: Radar::findDrawPositions then finds nothing to letterbox and a+ * click maps to the world through the same arithmetic as before. The blocker becomes the frame+ * round it, which ControlBarSchemeManager::drawPainting draws, and the under-attack lamp at the+ * radar's top right goes where that corner went.+ *+ * 'fromLayout' is layoutPanels having just put the three windows back where the square box has+ * them, which is remembered against the bar's frame. A new map without a new layout (update)+ * fits from what was remembered, so it never has to lay the bar out again under a slide or a+ * minimised stage. */+//-------------------------------------------------------------------------------------------------+void ControlBar::fitRadarToMap( Bool fromLayout )+{+ static NameKeyType radarID = NAMEKEY( "ControlBar.wnd:LeftHUD" );+ static NameKeyType blockID = NAMEKEY( "ControlBar.wnd:ControlBarProBlockInputRadar" );+ GameWindow *const windows[ RADAR_FIT_COUNT ] =+ {+ TheWindowManager->winGetWindowFromId( NULL, radarID ),+ TheWindowManager->winGetWindowFromId( NULL, blockID ),+ m_radarAttackGlowWindow,+ };+ GameWindow *parent = m_contextParent[ CP_MASTER ];+ if( parent == NULL || windows[ RADAR_FIT_RADAR ] == NULL )+ return;+ ICoord2D origin;+ parent->winGetScreenPosition( &origin.x, &origin.y );++ if( fromLayout )+ {+ for( Int i = 0; i < RADAR_FIT_COUNT; i++ )+ {+ if( windows[ i ] == NULL )+ continue;+ IRegion2D &r = m_radarFitBox[ i ];+ windows[ i ]->winGetScreenPosition( &r.lo.x, &r.lo.y );+ windows[ i ]->winGetSize( &r.hi.x, &r.hi.y );+ r.hi.x += r.lo.x - origin.x;+ r.hi.y += r.lo.y - origin.y;+ r.lo.x -= origin.x;+ r.lo.y -= origin.y;+ }+ }++ // ControlBar::init lays the bar out before GameEngine::init makes the radar; update() fits it then+ if( TheRadar == NULL )+ return;+ const Region3D *extent = TheRadar->getMapExtent();+ m_radarFitWidth = extent->width();+ m_radarFitHeight = extent->height();++ // between maps there is no extent; a scheme without a frame keeps the square well+ const Image *const *frame = m_controlBarSchemeManager ? m_controlBarSchemeManager->getRadarFrame() : NULL;+ if( frame == NULL || m_radarFitWidth <= 0.0f || m_radarFitHeight <= 0.0f )+ return;++ IRegion2D box[ RADAR_FIT_COUNT ];+ for( Int i = 0; i < RADAR_FIT_COUNT; i++ )+ {+ box[ i ] = m_radarFitBox[ i ];+ box[ i ].lo.x += origin.x;+ box[ i ].hi.x += origin.x;+ box[ i ].lo.y += origin.y;+ box[ i ].hi.y += origin.y;+ }++ // W3DLeftHUDDraw paints the radar a pixel inside the window, so it is the inside that takes the+ // map's shape; rounded, so Radar::findDrawPositions finds under a pixel to letterbox and draws none+ enum { RADAR_BEZEL = 1 };+ const IRegion2D &square = box[ RADAR_FIT_RADAR ];+ const Int insideWidth = square.hi.x - square.lo.x - 2 * RADAR_BEZEL;+ const Int insideHeight = square.hi.y - square.lo.y - 2 * RADAR_BEZEL;+ const Real scale = MIN( insideWidth / m_radarFitWidth, insideHeight / m_radarFitHeight );+ IRegion2D fit;+ fit.lo.x = square.lo.x;+ fit.hi.x = square.lo.x + REAL_TO_INT( m_radarFitWidth * scale + 0.5f ) + 2 * RADAR_BEZEL;+ fit.lo.y = square.hi.y - REAL_TO_INT( m_radarFitHeight * scale + 0.5f ) - 2 * RADAR_BEZEL;+ fit.hi.y = square.hi.y;+ placeWindowAt( windows[ RADAR_FIT_RADAR ], fit );++ IRegion2D outer;+ ControlBarSchemeManager::radarFrameRect( frame, fit, &outer );+ placeWindowAt( windows[ RADAR_FIT_BLOCK ], outer );++ IRegion2D lamp = box[ RADAR_FIT_LAMP ];+ const Int dx = fit.hi.x - square.hi.x, dy = fit.lo.y - square.lo.y;+ lamp.lo.x += dx;+ lamp.hi.x += dx;+ lamp.lo.y += dy;+ lamp.hi.y += dy;+ placeWindowAt( windows[ RADAR_FIT_LAMP ], lamp );+}+//-------------------------------------------------------------------------------------------------/** Initialzie the control bar, this is our interface to the context sinsitive GUI *///-------------------------------------------------------------------------------------------------@@ -2688,6 +2791,23 @@ void ControlBar::initWindows( void )setControlCommand(win, findCommandButton("NonCommand_IdleWorker") );win->winSetTooltipFunc(commandButtonTooltip);}+ // a mod's ControlBar.wnd has none of these, and a mod's CommandButton.ini none of the buttons+ static const char *const idleButtons[][ 2 ] =+ {+ { "ControlBar.wnd:ButtonIdleInfantry", "NonCommand_IdleInfantry" },+ { "ControlBar.wnd:ButtonIdleVehicle", "NonCommand_IdleVehicle" },+ { "ControlBar.wnd:ButtonIdleAircraft", "NonCommand_IdleAircraft" },+ };+ for( Int idle = 0; idle < 3; idle++ )+ {+ win = TheWindowManager->winGetWindowFromId( NULL, TheNameKeyGenerator->nameToKey( idleButtons[ idle ][ 0 ] ) );+ const CommandButton *idleCommand = findCommandButton( idleButtons[ idle ][ 1 ] );+ if( win && idleCommand )+ {+ setControlCommand( win, idleCommand );+ win->winSetTooltipFunc( commandButtonTooltip );+ }+ }win = TheWindowManager->winGetWindowFromId(NULL,TheNameKeyGenerator->nameToKey("ControlBar.wnd:ButtonPlaceBeacon"));if( win ){@@ -2878,6 +2998,11 @@ void ControlBar::update( void )clearSpecialPowerShortcutRow();}+ // the scheme lays the bar out before the map is loaded, so the radar takes the map's shape here+ const Region3D *radarExtent = TheRadar->getMapExtent();+ if( radarExtent->width() != m_radarFitWidth || radarExtent->height() != m_radarFitHeight )+ fitRadarToMap( FALSE );+if(m_controlBarSchemeManager)m_controlBarSchemeManager->update();@@ -2927,6 +3052,7 @@ void ControlBar::update( void )// walks every shortcut button and asks the player for its most ready special power objectif( logicTick )updateSpecialPowerShortcut();+ rearrangeSpecialPowerShortcutGrid();// if we're an observer, don't do the complete updateif( m_isObserverCommandBar){@@ -4601,15 +4727,30 @@ void ControlBar::showRallyPoint( const Coord3D *loc )/** Show a rally point marker at the world location specified. If no location is specified* any marker that we might have visible is hidden */// ------------------------------------------------------------------------------------------------+void ControlBar::showIdleButtons( Bool show )+{+ static const NameKeyType ids[ 4 ] =+ {+ NAMEKEY( "ControlBar.wnd:ButtonIdleWorker" ),+ NAMEKEY( "ControlBar.wnd:ButtonIdleInfantry" ),+ NAMEKEY( "ControlBar.wnd:ButtonIdleVehicle" ),+ NAMEKEY( "ControlBar.wnd:ButtonIdleAircraft" ),+ };+ for( Int i = 0; i < 4; i++ )+ {+ GameWindow *win = TheWindowManager->winGetWindowFromId( NULL, ids[ i ] );+ if( win )+ win->winHide( !show );+ }+}+void ControlBar::setControlBarSchemeByPlayer(Player *p){LOGIC_CENSUS( CENSUS_CONTROLBAR );if(m_controlBarSchemeManager)m_controlBarSchemeManager->setControlBarSchemeByPlayer(p);- static NameKeyType buttonIdleWorkerID = NAMEKEY("ControlBar.wnd:ButtonIdleWorker");static NameKeyType buttonGeneralID = NAMEKEY("ControlBar.wnd:ButtonGeneral");- GameWindow *buttonIdleWorker = TheWindowManager->winGetWindowFromId( NULL, buttonIdleWorkerID );GameWindow *buttonGeneral = TheWindowManager->winGetWindowFromId( NULL, buttonGeneralID );if( !p->isPlayerActive() )@@ -4618,8 +4759,7 @@ void ControlBar::setControlBarSchemeByPlayer(Player *p)switchToContext( CB_CONTEXT_OBSERVER_LIST, NULL );DEBUG_LOG(("We're loading the Observer Command Bar\n"));- if (buttonIdleWorker)- buttonIdleWorker->winHide(TRUE);+ showIdleButtons( FALSE );if (buttonGeneral)buttonGeneral->winEnable(FALSE);}@@ -4631,8 +4771,7 @@ void ControlBar::setControlBarSchemeByPlayer(Player *p)// the stand-in builder's command set has to be evaluated againmarkUIDirty();- if (buttonIdleWorker)- buttonIdleWorker->winHide(FALSE);+ showIdleButtons( TRUE );if (buttonGeneral){buttonGeneral->winHide(FALSE);@@ -4660,9 +4799,7 @@ void ControlBar::setControlBarSchemeByPlayerTemplate( const PlayerTemplate *pt)if(m_controlBarSchemeManager)m_controlBarSchemeManager->setControlBarSchemeByPlayerTemplate(pt);- static NameKeyType buttonIdleWorkerID = NAMEKEY("ControlBar.wnd:ButtonIdleWorker");static NameKeyType buttonGeneralID = NAMEKEY("ControlBar.wnd:ButtonGeneral");- GameWindow *buttonIdleWorker = TheWindowManager->winGetWindowFromId( NULL, buttonIdleWorkerID );GameWindow *buttonGeneral = TheWindowManager->winGetWindowFromId( NULL, buttonGeneralID );if(pt == ThePlayerTemplateStore->findPlayerTemplate(TheNameKeyGenerator->nameToKey("FactionObserver")))@@ -4671,8 +4808,7 @@ void ControlBar::setControlBarSchemeByPlayerTemplate( const PlayerTemplate *pt)switchToContext( CB_CONTEXT_OBSERVER_LIST, NULL );DEBUG_LOG(("We're loading the Observer Command Bar\n"));- if (buttonIdleWorker)- buttonIdleWorker->winHide(TRUE);+ showIdleButtons( FALSE );if (buttonGeneral)buttonGeneral->winEnable(FALSE);}@@ -4684,8 +4820,7 @@ void ControlBar::setControlBarSchemeByPlayerTemplate( const PlayerTemplate *pt)// the stand-in builder's command set has to be evaluated againmarkUIDirty();- if (buttonIdleWorker)- buttonIdleWorker->winHide(FALSE);+ showIdleButtons( TRUE );if (buttonGeneral){buttonGeneral->winHide(FALSE);@@ -5332,6 +5467,10 @@ void ControlBar::initSpecialPowershortcutBar( Player *player)//ControlBarLayoutUniform( m_specialPowerShortcutParent, 1.0f, 1.0f );+ // a new layout: the stepped tray's frame is placed by the first arrangement under a scheme with a tray+ m_trayLaidOutMask = TRAY_NOT_LAID_OUT;+ m_trayFramePlaced = FALSE;+tempName = layoutName;tempName.concat(":ButtonCommand%d");parentName = layoutName;@@ -5370,15 +5509,184 @@ void ControlBar::initSpecialPowershortcutBar( Player *player)}//--------------------------------------------------------------------------------------------------/** The shipped column, stretched with the bar, on the right edge of the screen and climbing from- * the top of the bar as 1.04's did. Its frame runs most of the screen's height and took every- * click over the battlefield and the promotion screen beside the powers; the frame takes none- * now, its slots and buttons still do. */+/** One slot's plate, from the scheme's PowerTrayImage pieces: the cell under the power and the+ * edges, corners and step on whichever of its sides the tray's outline runs (TraySlot). A slot+ * draws only inside its own window, so the slots together are the outline and nothing overlaps. */+//-------------------------------------------------------------------------------------------------+static void drawPowerTraySlot( GameWindow *window, WinInstanceData *instData )+{+ const ControlBar::TraySlot *slot = (const ControlBar::TraySlot *)window->winGetUserData();+ const Image *const *tray = TheControlBar->getControlBarSchemeManager()->getPowerTray();+ if( slot == NULL || tray == NULL )+ return;++ Int x, y;+ window->winGetScreenPosition( &x, &y );+ const Int x0 = x + slot->cell.lo.x, y0 = y + slot->cell.lo.y;+ const Int x1 = x + slot->cell.hi.x, y1 = y + slot->cell.hi.y;+ const Int l = slot->edgeLeft, t = slot->edgeTop, b = slot->edgeBottom;+ struct Piece { Int image, lx, ly, hx, hy; Bool wanted; };+ const Piece pieces[] =+ {+ { ControlBarScheme::TRAY_CELL, x0, y0, x1, y1, TRUE },+ { ControlBarScheme::TRAY_EDGE_TOP, x0, y0 - t, x1 - slot->stepRight, y0, t > 0 },+ { ControlBarScheme::TRAY_EDGE_LEFT, x0 - l, y0, x0, y1 - slot->stepBelow, l > 0 },+ { ControlBarScheme::TRAY_STEP, x0 - l, y1 - slot->stepBelow, x0, y1, slot->stepBelow > 0 },+ { ControlBarScheme::TRAY_CORNER_TL, x0 - l, y0 - t, x0, y0, l > 0 && t > 0 },+ { ControlBarScheme::TRAY_EDGE_BOTTOM, x0, y1, x1, y1 + b, b > 0 },+ { ControlBarScheme::TRAY_CORNER_BL, x0 - l, y1, x0, y1 + b, l > 0 && b > 0 },+ };+ for( Int i = 0; i < (Int)( sizeof( pieces ) / sizeof( pieces[ 0 ] ) ); i++ )+ {+ // a piece the art leaves out leaves the battlefield showing there+ const Piece &p = pieces[ i ];+ if( p.wanted && tray[ p.image ] )+ TheDisplay->drawImage( tray[ p.image ], p.lx, p.ly, p.hx, p.hy );+ }+}++//-------------------------------------------------------------------------------------------------+/** With a scheme that names PowerTrayImage, the powers stand SPECIAL_POWER_SHORTCUT_COLS to a row+ * in the scheme's cells, hard against the right edge of the screen, the first row on the general's+ * tab and the rest climbing from it. Slot i is row i / COLS and place i % COLS counted in from the+ * edge, the order the two-key chords already read, so a row that is not full is short on the+ * inside and the tray steps there. Each slot window is its cell plus the edges the outline runs+ * along it, which is what keeps a click on the plate off the world and lets one through beside it.+ * A slot hidden mid-row (COMMAND_HIDDEN) gives its place to the next one shown. The first+ * arrangement under a scheme with a tray stands the frame at the tallest tray's size, before+ * anything slides it in, and it stays there, so the slide carries the slots and a new layout never+ * fights it.+ *+ * A scheme without the pieces, a mod's, keeps the shipped column, stretched with the bar on the+ * right edge and climbing from the top of the bar as 1.04's did. Either way the frame takes no+ * click: it runs well past the powers, and once took every click over the battlefield and the+ * promotion screen beside them. *///-------------------------------------------------------------------------------------------------void ControlBar::arrangeSpecialPowerShortcutGrid( void ){- if( m_specialPowerShortcutParent )- m_specialPowerShortcutParent->winSetStatus( WIN_STATUS_NO_INPUT );+ if( m_specialPowerShortcutParent == NULL )+ return;+ m_specialPowerShortcutParent->winSetStatus( WIN_STATUS_NO_INPUT );++ const Image *const *tray = m_controlBarSchemeManager->getPowerTray();+ m_trayLaidOutMask = visibleSpecialPowerShortcutMask();+ m_trayLaidOutFor = tray;+ if( tray == NULL )+ return;++ ICoord2D origin, cell;+ Int left, top, foot, bottom;+ powerTrayMetrics( tray, &origin, &cell, &left, &top, &foot, &bottom );+ if( !m_trayFramePlaced )+ {+ m_specialPowerShortcutParent->winSetPosition( origin.x, origin.y );+ m_specialPowerShortcutParent->winSetSize( TheDisplay->getWidth() - origin.x, bottom - origin.y );+ m_trayFramePlaced = TRUE;+ }++ Int shown[ MAX_SPECIAL_POWER_SHORTCUTS ];+ Int count = 0;+ for( Int slotIndex = 0; slotIndex < MAX_SPECIAL_POWER_SHORTCUTS; slotIndex++ )+ {+ if( m_trayLaidOutMask & ( 1u << slotIndex ) )+ shown[ count++ ] = slotIndex;+ }++ const Int cols = SPECIAL_POWER_SHORTCUT_COLS;+ const Int rows = ( count + cols - 1 ) / cols;+ Int rowLength[ MAX_SPECIAL_POWER_SHORTCUTS / SPECIAL_POWER_SHORTCUT_COLS + 2 ];+ for( Int r = 0; r <= rows; r++ )+ rowLength[ r ] = r < rows ? MIN( cols, count - r * cols ) : 0;++ const Int right = TheDisplay->getWidth();+ for( Int i = 0; i < count; i++ )+ {+ GameWindow *slotWin = m_specialPowerShortcutButtonParents[ shown[ i ] ];+ GameWindow *button = m_specialPowerShortcutButtons[ shown[ i ] ];+ const Int row = i / cols, place = i % cols;+ const Bool covered = place < rowLength[ row + 1 ];+ const Bool innermost = place == rowLength[ row ] - 1;++ TraySlot &slot = m_traySlot[ i ];+ slot.edgeLeft = innermost ? left : 0;+ slot.edgeTop = covered ? 0 : top;+ slot.edgeBottom = row == 0 ? foot : 0;+ // the short row above ends over this cell's outer neighbour: the step closes the corner there+ slot.stepRight = !covered && place > 0 && place - 1 < rowLength[ row + 1 ] ? left : 0;+ // and this, the short row's innermost cell, stands on a longer row+ slot.stepBelow = innermost && row > 0 && place + 1 < rowLength[ row - 1 ] ? top : 0;++ IRegion2D screen;+ screen.hi.x = right - place * cell.x;+ screen.lo.x = screen.hi.x - cell.x - slot.edgeLeft;+ screen.hi.y = bottom - foot - row * cell.y + slot.edgeBottom;+ screen.lo.y = screen.hi.y - slot.edgeBottom - cell.y - slot.edgeTop;+ slot.cell.lo.x = slot.edgeLeft;+ slot.cell.lo.y = slot.edgeTop;+ slot.cell.hi.x = slot.edgeLeft + cell.x;+ slot.cell.hi.y = slot.edgeTop + cell.y;++ slotWin->winSetPosition( screen.lo.x - origin.x, screen.lo.y - origin.y );+ slotWin->winSetSize( screen.hi.x - screen.lo.x, screen.hi.y - screen.lo.y );+ slotWin->winSetUserData( &slot );+ slotWin->winSetDrawFunc( drawPowerTraySlot );++ Int bw, bh;+ button->winGetSize( &bw, &bh );+ button->winSetPosition( slot.edgeLeft + ( cell.x - bw ) / 2, slot.edgeTop + ( cell.y - bh ) / 2 );+ }+}++//-------------------------------------------------------------------------------------------------+/** The slots showing a power, one bit a slot. */+//-------------------------------------------------------------------------------------------------+UnsignedInt ControlBar::visibleSpecialPowerShortcutMask( void )+{+ UnsignedInt mask = 0;+ for( Int i = 0; i < m_currentlyUsedSpecialPowersButtons && i < MAX_SPECIAL_POWER_SHORTCUTS; i++ )+ {+ if( !m_specialPowerShortcutButtons[ i ]->winIsHidden() )+ mask |= 1u << i;+ }+ return mask;+}++//-------------------------------------------------------------------------------------------------+/** Lay the tray out again when a power was bought, spent or hidden, or the scheme changed its+ * pieces; populateSpecialPowerShortcut and updateSpecialPowerShortcut are what change those. */+//-------------------------------------------------------------------------------------------------+void ControlBar::rearrangeSpecialPowerShortcutGrid( void )+{+ if( m_specialPowerShortcutParent == NULL )+ return;+ if( visibleSpecialPowerShortcutMask() != m_trayLaidOutMask+ || m_controlBarSchemeManager->getPowerTray() != m_trayLaidOutFor )+ arrangeSpecialPowerShortcutGrid();+}++//-------------------------------------------------------------------------------------------------+/** The tray's numbers on this screen: the pieces at the screen's height over 1080, and the+ * frame's top left at rest, the tallest tray's box standing on the general's tab against the+ * right edge. */+//-------------------------------------------------------------------------------------------------+void ControlBar::powerTrayMetrics( const Image *const *tray, ICoord2D *origin, ICoord2D *cell,+ Int *left, Int *top, Int *foot, Int *bottom )+{+ const Real k = TheDisplay->getHeight() / 1080.0f;+ cell->x = REAL_TO_INT_CEIL( tray[ ControlBarScheme::TRAY_CELL ]->getImageWidth() * k );+ cell->y = REAL_TO_INT_CEIL( tray[ ControlBarScheme::TRAY_CELL ]->getImageHeight() * k );+ const Image *edgeLeft = tray[ ControlBarScheme::TRAY_EDGE_LEFT ];+ const Image *edgeTop = tray[ ControlBarScheme::TRAY_EDGE_TOP ];+ const Image *edgeFoot = tray[ ControlBarScheme::TRAY_EDGE_BOTTOM ];+ *left = edgeLeft ? REAL_TO_INT_CEIL( edgeLeft->getImageWidth() * k ) : 0;+ *top = edgeTop ? REAL_TO_INT_CEIL( edgeTop->getImageHeight() * k ) : 0;+ *foot = edgeFoot ? REAL_TO_INT_CEIL( edgeFoot->getImageHeight() * k ) : 0;++ const Int cols = SPECIAL_POWER_SHORTCUT_COLS;+ const Int rows = ( MAX_SPECIAL_POWER_SHORTCUTS + cols - 1 ) / cols;+ *bottom = TheDisplay->getHeight() - REAL_TO_INT( ( 1080 - POWER_TRAY_FOOT_Y ) * k );+ origin->x = TheDisplay->getWidth() - cols * cell->x - *left;+ origin->y = *bottom - *foot - rows * cell->y - *top;}//-------------------------------------------------------------------------------------------------@@ -5681,6 +5989,7 @@ void ControlBar::populateSpecialPowerShortcut( Player *player)animateSpecialPowerShortcut(TRUE);}updateSpecialPowerShortcut();+ rearrangeSpecialPowerShortcutGrid();}//-------------------------------------------------------------------------------------------------diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cppindex 491c026b2..ad64ed512 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp@@ -163,6 +163,29 @@ const FieldParse ControlBarSchemeManager::m_controlBarSchemeFieldParseTable[] ={ "MoneyUL", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_moneyUL ) },{ "MoneyLR", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_moneyLR ) },+ { "BlockRadarUL", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_blockUL[ ControlBarScheme::BLOCK_RADAR ] ) },+ { "BlockRadarLR", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_blockLR[ ControlBarScheme::BLOCK_RADAR ] ) },+ { "BlockProductionUL", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_blockUL[ ControlBarScheme::BLOCK_PRODUCTION ] ) },+ { "BlockProductionLR", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_blockLR[ ControlBarScheme::BLOCK_PRODUCTION ] ) },+ { "BlockMoneyUL", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_blockUL[ ControlBarScheme::BLOCK_MONEY ] ) },+ { "BlockMoneyLR", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_blockLR[ ControlBarScheme::BLOCK_MONEY ] ) },+ { "BlockUpgradesUL", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_blockUL[ ControlBarScheme::BLOCK_UPGRADES ] ) },+ { "BlockUpgradesLR", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_blockLR[ ControlBarScheme::BLOCK_UPGRADES ] ) },+ { "BlockGenPowerUL", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_blockUL[ ControlBarScheme::BLOCK_GEN_POWER ] ) },+ { "BlockGenPowerLR", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_blockLR[ ControlBarScheme::BLOCK_GEN_POWER ] ) },++ { "IdleInfantryButtonImage", INI::parseAsciiString, NULL, offsetof( ControlBarScheme, m_idleButtonImage[ ControlBarScheme::IDLE_INFANTRY ] ) },+ { "IdleInfantryUL", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_idleUL[ ControlBarScheme::IDLE_INFANTRY ] ) },+ { "IdleInfantryLR", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_idleLR[ ControlBarScheme::IDLE_INFANTRY ] ) },+ { "IdleVehicleButtonImage", INI::parseAsciiString, NULL, offsetof( ControlBarScheme, m_idleButtonImage[ ControlBarScheme::IDLE_VEHICLE ] ) },+ { "IdleVehicleUL", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_idleUL[ ControlBarScheme::IDLE_VEHICLE ] ) },+ { "IdleVehicleLR", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_idleLR[ ControlBarScheme::IDLE_VEHICLE ] ) },+ { "IdleAircraftButtonImage", INI::parseAsciiString, NULL, offsetof( ControlBarScheme, m_idleButtonImage[ ControlBarScheme::IDLE_AIRCRAFT ] ) },+ { "IdleAircraftUL", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_idleUL[ ControlBarScheme::IDLE_AIRCRAFT ] ) },+ { "IdleAircraftLR", INI::parseICoord2D, NULL, offsetof( ControlBarScheme, m_idleLR[ ControlBarScheme::IDLE_AIRCRAFT ] ) },+ { "RadarFrameImage", INI::parseAsciiString, NULL, offsetof( ControlBarScheme, m_radarFrameName ) },+ { "PowerTrayImage", INI::parseAsciiString, NULL, offsetof( ControlBarScheme, m_powerTrayName ) },+{ "CommandMarkerImage", INI::parseMappedImage, NULL, offsetof( ControlBarScheme, m_commandMarkerImage) },{ "ExpBarForegroundImage", INI::parseMappedImage, NULL, offsetof( ControlBarScheme, m_expBarForeground) },{ "PowerPurchaseImage", INI::parseMappedImage, NULL, offsetof( ControlBarScheme, m_powerPurchaseImage) },@@ -427,6 +450,21 @@ ControlBarScheme::ControlBarScheme(void)m_moneyLR.x = 0;m_moneyLR.y = 0;++ for( Int i = 0; i < BLOCK_COUNT; i++ )+ {+ m_blockUL[ i ].x = m_blockUL[ i ].y = 0;+ m_blockLR[ i ].x = m_blockLR[ i ].y = 0;+ }+ for( Int i = 0; i < IDLE_COUNT; i++ )+ {+ m_idleUL[ i ].x = m_idleUL[ i ].y = 0;+ m_idleLR[ i ].x = m_idleLR[ i ].y = 0;+ }+ for( Int i = 0; i < FRAME_PIECE_COUNT; i++ )+ m_radarFrame[ i ] = NULL;+ for( Int i = 0; i < TRAY_PIECE_COUNT; i++ )+ m_powerTray[ i ] = NULL;}@@ -458,8 +496,29 @@ static void placeSchemeWindow( GameWindow *win, const ICoord2D& ul, const ICoord( lr.y - ul.y ) * resMultiplier.y + COMMAND_BAR_SIZE_OFFSET );}+/// <prefix><suffix> for each suffix from the mapped images; every one NULL when the scheme names no prefix+static void findPieces( const AsciiString& prefix, const char *const *suffixes, Int count, const Image **out )+{+ for( Int i = 0; i < count; i++ )+ {+ out[ i ] = NULL;+ if( prefix.isEmpty() )+ continue;+ AsciiString name = prefix;+ name.concat( suffixes[ i ] );+ out[ i ] = TheMappedImageCollection->findImageByName( name );+ }+}+void ControlBarScheme::init(void){+ // before anything below lays the bar out: layoutPanels fits the radar's frame from these+ static const char *const frameSuffixes[ FRAME_PIECE_COUNT ] = { "TL", "T", "TR", "L", "C", "R", "BL", "B", "BR" };+ static const char *const traySuffixes[ TRAY_PIECE_COUNT ] =+ { "Cell", "EdgeTop", "EdgeLeft", "EdgeBottom", "CornerTopLeft", "CornerBottomLeft", "Step" };+ findPieces( m_radarFrameName, frameSuffixes, FRAME_PIECE_COUNT, m_radarFrame );+ findPieces( m_powerTrayName, traySuffixes, TRAY_PIECE_COUNT, m_powerTray );+if(TheControlBar){TheControlBar->switchControlBarStage(CONTROL_BAR_STAGE_DEFAULT);@@ -481,7 +540,7 @@ void ControlBarScheme::init(void)//// The eighteen-window grid (ControlBar::isCommandGridWide) stands on a plate one command column- // longer at each end: the painting's "<name>Wide" copy (Tools/wide_command_bar.py). The toolbar+ // longer at each end: the painting's "<name>Wide" copy (Tools/hud_command_bar.py). The toolbar// column moves out with the left end and the power rail runs the plate's new length. A scheme// whose painting has no wide copy, a mod's own, keeps its windows where it put them.//@@ -508,8 +567,9 @@ void ControlBarScheme::init(void)ICoord2D powerBarUL = m_powerBarUL, powerBarLR = m_powerBarLR;chatUL.x -= wideStep;chatLR.x -= wideStep;- workerUL.x -= wideStep;- workerLR.x -= wideStep;+ // the idle worker heads the idle column at the grid's right end, so it goes out with that end+ workerUL.x += wideStep;+ workerLR.x += wideStep;optionsUL.x -= wideStep;optionsLR.x -= wideStep;beaconUL.x -= wideStep;@@ -538,6 +598,41 @@ void ControlBarScheme::init(void)GadgetButtonSetDisabledImage(win, m_idleWorkerButtonDisabled);placeSchemeWindow( win, workerUL, workerLR, resMultiplier );}++ //+ // The idle infantry, vehicle and aircraft buttons stand in a column at the grid's right end and+ // go out with it on the wide grid, the way the toolbar column goes out with the left end. A+ // scheme that does not place one shrinks it to nothing rather than leave it at the .wnd's 0,0.+ //+ static const char *const idleNames[ IDLE_COUNT ] =+ {+ "ControlBar.wnd:ButtonIdleInfantry",+ "ControlBar.wnd:ButtonIdleVehicle",+ "ControlBar.wnd:ButtonIdleAircraft",+ };+ for( Int i = 0; i < IDLE_COUNT; i++ )+ {+ win = TheWindowManager->winGetWindowFromId( NULL, TheNameKeyGenerator->nameToKey( idleNames[ i ] ) );+ if( win == NULL )+ continue;+ if( m_idleLR[ i ].x <= m_idleUL[ i ].x )+ {+ win->winSetSize( 0, 0 );+ continue;+ }+ static const char *const states[ 4 ] = { "", "H", "P", "I" };+ const Image *image[ 4 ];+ findPieces( m_idleButtonImage[ i ], states, 4, image );+ GadgetButtonSetEnabledImage( win, image[ 0 ] );+ GadgetButtonSetHiliteImage( win, image[ 1 ] );+ GadgetButtonSetHiliteSelectedImage( win, image[ 2 ] );+ GadgetButtonSetDisabledImage( win, image[ 3 ] );+ ICoord2D ul = m_idleUL[ i ], lr = m_idleLR[ i ];+ ul.x += wideStep;+ lr.x += wideStep;+ placeSchemeWindow( win, ul, lr, resMultiplier );+ }+win= TheWindowManager->winGetWindowFromId( NULL, TheNameKeyGenerator->nameToKey( "ControlBar.wnd:ExpBarForeground" ) );if(win){@@ -607,6 +702,35 @@ void ControlBarScheme::init(void)// top (ControlBarLayoutUniform in ControlBar::initWindows), so nothing here moves it}+ //+ // A painting whose plates outgrow ControlBar.wnd's input blockers names its own, so a click on+ // the new steel does not fall through to the world. The production blocker follows the wide+ // plate's two extra columns the way the power rail does.+ //+ static const char *const blockNames[ BLOCK_COUNT ] =+ {+ "ControlBar.wnd:ControlBarProBlockInputRadar",+ "ControlBar.wnd:ControlBarProBlockInputProduction",+ "ControlBar.wnd:ControlBarProBlockInputMoney",+ "ControlBar.wnd:ControlBarProBlockInputUpgrades",+ "ControlBar.wnd:ControlBarProBlockInputGenPowerButton",+ };+ for( Int i = 0; i < BLOCK_COUNT; i++ )+ {+ if( m_blockLR[ i ].x <= m_blockUL[ i ].x )+ continue;+ win = TheWindowManager->winGetWindowFromId( NULL, TheNameKeyGenerator->nameToKey( blockNames[ i ] ) );+ if( win == NULL )+ continue;+ ICoord2D ul = m_blockUL[ i ], lr = m_blockLR[ i ];+ if( i == BLOCK_PRODUCTION )+ {+ ul.x -= wideStep;+ lr.x += wideStep;+ }+ placeSchemeWindow( win, ul, lr, resMultiplier );+ }+//// Everything above put a window back where the loader would have stretched it to, which is// the whole width of the screen rather than one of the three panels the bar is really in.@@ -1146,6 +1270,61 @@ Bool ControlBarSchemeManager::isCurrentSchemePainted( void ) constreturn m_currentScheme != NULL;}+const Image *const *ControlBarSchemeManager::getRadarFrame( void ) const+{+ if( m_currentScheme == NULL || m_currentScheme->m_radarFrame[ ControlBarScheme::FRAME_TL ] == NULL+ || m_currentScheme->m_radarFrame[ ControlBarScheme::FRAME_BR ] == NULL )+ return NULL;+ return m_currentScheme->m_radarFrame;+}++void ControlBarSchemeManager::radarFrameRect( const Image *const *frame, const IRegion2D& radar, IRegion2D *outer )+{+ const Real k = TheDisplay->getHeight() / 1080.0f;+ const Image *tl = frame[ ControlBarScheme::FRAME_TL ];+ const Image *br = frame[ ControlBarScheme::FRAME_BR ];+ outer->lo.x = radar.lo.x - REAL_TO_INT_CEIL( tl->getImageWidth() * k );+ outer->lo.y = radar.lo.y - REAL_TO_INT_CEIL( tl->getImageHeight() * k );+ outer->hi.x = radar.hi.x + REAL_TO_INT_CEIL( br->getImageWidth() * k );+ outer->hi.y = radar.hi.y + REAL_TO_INT_CEIL( br->getImageHeight() * k );+}++const Image *const *ControlBarSchemeManager::getPowerTray( void ) const+{+ if( m_currentScheme == NULL || m_currentScheme->m_powerTray[ ControlBarScheme::TRAY_CELL ] == NULL )+ return NULL;+ return m_currentScheme->m_powerTray;+}++//-----------------------------------------------------------------------------+/** The radar's frame, nine pieces round wherever ControlBar::fitRadarToMap stood the radar: the+ * corners at their size, the edges stretched along the radar and the centre under it, which is+ * what shows while the player has no radar. Drawn after the painting and before the windows. */+//-----------------------------------------------------------------------------+static void drawRadarFrame( const Image *const *frame )+{+ static NameKeyType radarID = NAMEKEY( "ControlBar.wnd:LeftHUD" );+ GameWindow *radar = TheWindowManager->winGetWindowFromId( NULL, radarID );+ if( radar == NULL || radar->winIsHidden() )+ return;+ IRegion2D inner, outer;+ radar->winGetScreenPosition( &inner.lo.x, &inner.lo.y );+ radar->winGetSize( &inner.hi.x, &inner.hi.y );+ inner.hi.x += inner.lo.x;+ inner.hi.y += inner.lo.y;+ ControlBarSchemeManager::radarFrameRect( frame, inner, &outer );+ const Int xs[ 4 ] = { outer.lo.x, inner.lo.x, inner.hi.x, outer.hi.x };+ const Int ys[ 4 ] = { outer.lo.y, inner.lo.y, inner.hi.y, outer.hi.y };+ for( Int piece = 0; piece < ControlBarScheme::FRAME_PIECE_COUNT; piece++ )+ {+ // a piece the art leaves out leaves the painting showing there+ if( frame[ piece ] == NULL )+ continue;+ const Int col = piece % 3, row = piece / 3;+ TheDisplay->drawImage( frame[ piece ], xs[ col ], ys[ row ], xs[ col + 1 ], ys[ row + 1 ] );+ }+}+//-----------------------------------------------------------------------------/** ControlBar Pro's painting, cut at the seams below and each piece drawn where its panel stands* (ControlBarPanelDesignToScreen). The seams fall in the gaps of every side's art. */@@ -1199,6 +1378,11 @@ void ControlBarSchemeManager::drawPainting( ICoord2D offset, Bool foreground )}TheDisplay->enableClipping( FALSE );}++ // the radar window travels with the bar, so its frame needs no offset+ const Image *const *frame = getRadarFrame();+ if( !foreground && frame )+ drawRadarFrame( frame );}//-----------------------------------------------------------------------------@@ -1216,7 +1400,7 @@ void ControlBarSchemeManager::setControlBarSchemeByPlayerTemplate( const PlayerT// the squished bar keeps EA's pick: the side's Small scheme, and none ships, so "Default"AsciiString smallSide = side;smallSide.concat("Small");- // a side with no bar of its own (the fork's Turkiye) wears America's (findSchemeForFaction)+ // a side with no bar of its own wears its country's or America's (findSchemeForFaction)ControlBarScheme *tempScheme = useSmall ? findSchemeForSide( smallSide ) : findSchemeForFaction( side );if(tempScheme){@@ -1250,7 +1434,7 @@ void ControlBarSchemeManager::setControlBarSchemeByPlayer(Player *p)side.set("Observer");// picked again every time, even for the side on screen: a new resolution can want a different// scheme for it (findSchemeForSide), and the multiplier below is the screen's- // the neutral and civilian players are of no country, and wear America's, as does Turkiye+ // the neutral and civilian players are of no country, and wear America'sm_currentScheme = findSchemeForFaction( side );DEBUG_LOG(("setControlBarSchemeByPlayer gave side %s the scheme of %s\n", side.str(), m_currentScheme->m_side.str()));m_multiplyer.x = TheDisplay->getWidth() / (Real)m_currentScheme->m_ScreenCreationRes.x;diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cppindex 1d15a2ac1..e495d762e 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp@@ -434,6 +434,9 @@ WindowMsgHandledType ControlBarSystem( GameWindow *window, UnsignedInt msg,static NameKeyType buttonLargeID = NAMEKEY("ControlBar.wnd:ButtonLarge");static NameKeyType buttonOptions = NAMEKEY("ControlBar.wnd:ButtonOptions");static NameKeyType buttonIdleWorker = NAMEKEY("ControlBar.wnd:ButtonIdleWorker");+ static NameKeyType buttonIdleInfantry = NAMEKEY("ControlBar.wnd:ButtonIdleInfantry");+ static NameKeyType buttonIdleVehicle = NAMEKEY("ControlBar.wnd:ButtonIdleVehicle");+ static NameKeyType buttonIdleAircraft = NAMEKEY("ControlBar.wnd:ButtonIdleAircraft");Int controlID = control->winGetWindowId();if( controlID == buttonCommunicator )@@ -488,6 +491,18 @@ WindowMsgHandledType ControlBarSystem( GameWindow *window, UnsignedInt msg,if( worker ) // every worker busy: nothing was selectedTheTacticalView->lookAt( worker->getPosition() );}+ else if( controlID == buttonIdleInfantry || controlID == buttonIdleVehicle || controlID == buttonIdleAircraft )+ {+ // the Next Idle Infantry, Vehicle and Aircraft keys' cycle, with the worker button's camera+ HideQuitMenu( );+ KindOfMaskType mustBeSet, mustBeClear;+ InGameUI::idleUnitKinds( controlID == buttonIdleInfantry ? GameMessage::MSG_META_SELECT_NEXT_IDLE_INFANTRY+ : controlID == buttonIdleVehicle ? GameMessage::MSG_META_SELECT_NEXT_IDLE_VEHICLE+ : GameMessage::MSG_META_SELECT_NEXT_IDLE_AIRCRAFT, &mustBeSet, &mustBeClear );+ Object *unit = TheInGameUI->selectNextIdleUnit( mustBeSet, mustBeClear );+ if( unit )+ TheTacticalView->lookAt( unit->getPosition() );+ }else{//diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cppindex f768c338e..3f368a9f4 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp@@ -1153,6 +1153,12 @@ void ControlBar::populateBuildTooltipLayout( const CommandButton *commandButton,{if( commandButton && commandButton->getName() == "NonCommand_IdleWorker" )name.concat( metaKeySuffix( GameMessage::MSG_META_SELECT_NEXT_IDLE_WORKER ) );+ else if( commandButton && commandButton->getName() == "NonCommand_IdleInfantry" )+ name.concat( metaKeySuffix( GameMessage::MSG_META_SELECT_NEXT_IDLE_INFANTRY ) );+ else if( commandButton && commandButton->getName() == "NonCommand_IdleVehicle" )+ name.concat( metaKeySuffix( GameMessage::MSG_META_SELECT_NEXT_IDLE_VEHICLE ) );+ else if( commandButton && commandButton->getName() == "NonCommand_IdleAircraft" )+ name.concat( metaKeySuffix( GameMessage::MSG_META_SELECT_NEXT_IDLE_AIRCRAFT ) );GadgetStaticTextSetText(win, name);}diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex bdc5ac8d6..c82da0097 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -131,6 +131,7 @@#include "GameLogic/Module/ProductionUpdate.h"#include "GameLogic/Module/SpecialPowerModule.h"#include "GameLogic/Module/StealthUpdate.h"+#include "GameLogic/Module/SupplyTruckAIUpdate.h"#include "GameLogic/Module/SupplyWarehouseDockUpdate.h"#include "GameLogic/Module/MobMemberSlavedUpdate.h"//ML#include "GameLogic/Module/SpawnBehavior.h"@@ -162,7 +163,23 @@ static const RGBColor illegalBuildColor = { 1.0, 0.0, 0.0 };// ------------------------------------------------------------------------------------------------enum{- PRODUCTION_LIST_LIFT = 24 ///< clearance between the list's last line and the control bar+ PRODUCTION_LIST_LIFT = 2, ///< clearance between the queue tray's foot and the radar frame's top+ HUD_CELL_CAMEO_W = 39, ///< a production or superweapon cameo: the general's power shortcut's+ HUD_CELL_CAMEO_H = 27,+ HUD_CELL_GAP = 2, ///< twice the superweapon owner line's height+ HUD_CELL_POINT_SIZE = 7, ///< the seconds and the "xN" written in a cameo+ HUD_CELL_TRAY_CELL_W = 80, ///< the general's powers tray's cell piece at 1080, round its+ HUD_CELL_TRAY_CELL_H = 70, ///< power button; a cameo's cell keeps the same margins to scale+ HUD_CELL_TRAY_BUTTON_W = 75,+ HUD_CELL_TRAY_BUTTON_H = 60,+ HUD_TRAY_TAB_W = 40, ///< the "+N" tab's picture at 1080, see hudTab+ HUD_TRAY_TAB_H = 28,+ HUD_TRAY_TAB_JOIN = 6, ///< its rows lying over the tray's outer edge+ HUD_TRAY_TAB_TEXT_INSET_X = 4, ///< the text's room inside the rest of it+ HUD_TRAY_TAB_TEXT_INSET_Y = 2,+ SUPERWEAPON_TRAY_DROP = 4, ///< between the info strip's foot and the superweapon tray's top+ HUD_READY_GLOW_PERIOD_MS = 1400, ///< one breath of a charged superweapon's glow+ HUD_READY_SHIMMER_RISE = 85 ///< percent of the cameo the shimmer's top edge climbs in a breath};//-------------------------------------------------------------------------------------------------@@ -175,6 +192,301 @@ static Int stripPixels( Int nominal )return REAL_TO_INT_CEIL( nominal * ControlBarHudPageScale() );}+//-------------------------------------------------------------------------------------------------+/** One strip's tray, the general's powers tray's outline laid round a group of cells that stands+ * against another edge of the screen or grows the other way. The roles are the powers tray's own,+ * named from the screen edge out: the edge down the open side of each row's innermost cell, the+ * foot outside row 0, the edge over a cell no row beyond covers, the open side's two corners, and+ * the step filling the notch where a short row ends on a longer one. */+//-------------------------------------------------------------------------------------------------+struct HudTray+{+ const Image *cell; ///< under every cell, NULL with no tray: then nothing is drawn round them+ const Image *open; ///< down the open side+ const Image *foot; ///< outside row 0+ const Image *uncovered; ///< over the far side of a cell no row covers+ const Image *cornerFoot; ///< the open side's corner at the foot+ const Image *cornerUncovered; ///< the open side's corner at the far side+ const Image *step; ///< open side by far side, in a short row's cell where it meets the longer+ Int openW, footH, uncoveredH; ///< each edge's thickness at the cells' scale+};++//-------------------------------------------------------------------------------------------------+/** The local player's build of the command bar for the cameos drawn over the battlefield, the+ * production ones and the superweapon ones. The cameos sit together in one tray the way the+ * general's powers do, each in the tray's cell piece with the margins round a power button scaled+ * to the cameo, and inside the button's 1-pixel border. A scheme with no tray, Classic's, leaves+ * the border alone, as its shipped column does. What else is the side's is the plate under every+ * readout, a piece of its own button sheet (<side>ProHudCellPlate in ReforgedHud<side>Powers). A+ * sheet without the plate yet gets HudReadout_draw's solid one. A side no build is named for, an+ * observer's or a mod's, wears America's. */+//-------------------------------------------------------------------------------------------------+struct HudCellStyle+{+ const Image *plate; ///< under a readout, stretched to its text+ Int cameoW, cameoH; ///< the cameo, the size of the general's power shortcut's+ Int marginX, marginY; ///< from the cell's edge to the cameo's, each side+ Int cellW, cellH; ///< a cell, and the step from one to the next: cells touch, as the tray's do+ const Image *tabUp; ///< the queue's "+N" tab, NULL until the sheet has one+ const Image *tabDown; ///< the superweapons' "+N" tab+ const Image *readyGlow; ///< a charged superweapon's light, NULL until the sheet has one+ const Image *readyShimmer; ///< the band climbing through it+ HudTray production; ///< against the screen's left edge, one row+ HudTray superweapon; ///< against the right edge, rows going down+};++/// a tray piece the powers tray has no use for, the mirror of one it has; until a sheet draws it the+/// unmirrored one stands in, its light on the wrong side+static const Image *mirroredTrayPiece( const char *prefix, const char *piece, const Image *standIn )+{+ AsciiString name;+ name.format( "%sProTray%s", prefix, piece );+ const Image *image = TheMappedImageCollection->findImageByName( name );+ return image != NULL ? image : standIn;+}++/// the edges as thick, against the cell, as the powers tray's are against its cell+static void sizeHudTray( HudTray *tray, Real scaleX, Real scaleY )+{+ tray->openW = tray->open ? REAL_TO_INT_CEIL( tray->open->getImageWidth() * scaleX ) : 0;+ tray->footH = tray->foot ? REAL_TO_INT_CEIL( tray->foot->getImageHeight() * scaleY ) : 0;+ tray->uncoveredH = tray->uncovered ? REAL_TO_INT_CEIL( tray->uncovered->getImageHeight() * scaleY ) : 0;+}++static HudCellStyle hudCellStyle( void )+{+ const AsciiString side = ThePlayerList->getLocalPlayer()->getSide();+ HudCellStyle style;+ style.cameoW = stripPixels( HUD_CELL_CAMEO_W );+ style.cameoH = stripPixels( HUD_CELL_CAMEO_H );+ style.marginX = REAL_TO_INT_CEIL( style.cameoW * ( HUD_CELL_TRAY_CELL_W - HUD_CELL_TRAY_BUTTON_W ) / ( 2.0f * HUD_CELL_TRAY_BUTTON_W ) );+ style.marginY = REAL_TO_INT_CEIL( style.cameoH * ( HUD_CELL_TRAY_CELL_H - HUD_CELL_TRAY_BUTTON_H ) / ( 2.0f * HUD_CELL_TRAY_BUTTON_H ) );+ style.cellW = style.cameoW + 2 * style.marginX;+ style.cellH = style.cameoH + 2 * style.marginY;++ const char *prefix = "America";+ if( side.startsWith( "China" ) || side.startsWith( "Boss" ) )+ prefix = "China";+ else if( side.startsWith( "GLA" ) )+ prefix = "Gla";+ else if( side.startsWith( "Turkiye" ) )+ prefix = "Turkiye";++ AsciiString name;+ name.format( "%sProHudCellPlate", prefix );+ style.plate = TheMappedImageCollection->findImageByName( name );+ name.format( "%sProTrayTabUp", prefix );+ style.tabUp = TheMappedImageCollection->findImageByName( name );+ name.format( "%sProTrayTabDown", prefix );+ style.tabDown = TheMappedImageCollection->findImageByName( name );+ name.format( "%sProHudReadyGlow", prefix );+ style.readyGlow = TheMappedImageCollection->findImageByName( name );+ name.format( "%sProHudReadyShimmer", prefix );+ style.readyShimmer = TheMappedImageCollection->findImageByName( name );++ // the production tray is the powers tray mirrored left for right, the superweapon tray the same+ // tray turned top for bottom, which leaves every one of its pieces the right way up but the step+ const Image *const *tray = TheControlBar->getControlBarSchemeManager()->getPowerTray();+ const HudTray none = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 };+ style.production = none;+ style.superweapon = none;+ if( tray == NULL )+ return style;++ const Image *cell = tray[ ControlBarScheme::TRAY_CELL ];+ const HudTray production =+ {+ cell,+ mirroredTrayPiece( prefix, "EdgeRight", tray[ ControlBarScheme::TRAY_EDGE_LEFT ] ),+ tray[ ControlBarScheme::TRAY_EDGE_BOTTOM ],+ tray[ ControlBarScheme::TRAY_EDGE_TOP ],+ mirroredTrayPiece( prefix, "CornerBottomRight", tray[ ControlBarScheme::TRAY_CORNER_BL ] ),+ mirroredTrayPiece( prefix, "CornerTopRight", tray[ ControlBarScheme::TRAY_CORNER_TL ] ),+ mirroredTrayPiece( prefix, "StepRight", tray[ ControlBarScheme::TRAY_STEP ] ),+ 0, 0, 0+ };+ const HudTray superweapon =+ {+ cell,+ tray[ ControlBarScheme::TRAY_EDGE_LEFT ],+ tray[ ControlBarScheme::TRAY_EDGE_TOP ],+ tray[ ControlBarScheme::TRAY_EDGE_BOTTOM ],+ tray[ ControlBarScheme::TRAY_CORNER_TL ],+ tray[ ControlBarScheme::TRAY_CORNER_BL ],+ mirroredTrayPiece( prefix, "StepDown", tray[ ControlBarScheme::TRAY_STEP ] ),+ 0, 0, 0+ };+ style.production = production;+ style.superweapon = superweapon;+ const Real scaleX = (Real)style.cellW / cell->getImageWidth();+ const Real scaleY = (Real)style.cellH / cell->getImageHeight();+ sizeHudTray( &style.production, scaleX, scaleY );+ sizeHudTray( &style.superweapon, scaleX, scaleY );+ return style;+}++//-------------------------------------------------------------------------------------------------+/** A strip's cells and the tray round them, drawn piece by piece as drawPowerTraySlot draws a+ * power's slot. Cell i is row i / columns, place i % columns counted in from the screen edge;+ * `openSide` is +1 when the open side, away from the screen edge, is the right one and -1 when it+ * is the left, `footSide` +1 when row 0's outer edge is below the cells and -1 above. The screen+ * edge's side gets no edge, as the powers tray's right side has none. */+//-------------------------------------------------------------------------------------------------+static void drawHudTray( const HudTray &tray, const IRegion2D *cells, Int count, Int columns, Int openSide, Int footSide )+{+ if( tray.cell == NULL || count == 0 )+ return;++ const Int rows = ( count + columns - 1 ) / columns;+ auto rowLength = [ & ]( Int row ) { return row >= 0 && row < rows ? MIN( columns, count - row * columns ) : 0; };+ auto piece = []( const Image *image, Int lx, Int ly, Int hx, Int hy )+ {+ // a piece the art leaves out leaves the battlefield showing there+ if( image != NULL && hx > lx && hy > ly )+ TheDisplay->drawImage( image, lx, ly, hx, hy );+ };++ for( Int each = 0; each < count; each++ )+ {+ const IRegion2D &c = cells[ each ];+ const Int row = each / columns, place = each % columns;+ const Bool innermost = place == rowLength( row ) - 1;+ const Bool covered = place < rowLength( row + 1 );+ // this short row's innermost cell stands on a longer row: the step fills the notch+ const Bool stepHere = innermost && row > 0 && place + 1 < rowLength( row - 1 );+ // the short row beyond ends over this cell's screen-side neighbour: the step closes that corner+ const Bool stepBeside = !covered && place > 0 && place - 1 < rowLength( row + 1 );++ const Int openLo = openSide > 0 ? c.hi.x : c.lo.x - tray.openW;+ const Int openHi = openLo + tray.openW;+ const Int footLo = footSide > 0 ? c.hi.y : c.lo.y - tray.footH;+ const Int footHi = footLo + tray.footH;+ const Int farLo = footSide > 0 ? c.lo.y - tray.uncoveredH : c.hi.y;+ const Int farHi = farLo + tray.uncoveredH;+ const Int stepLo = footSide > 0 ? c.hi.y - tray.uncoveredH : c.lo.y;+ const Int stepHi = stepLo + tray.uncoveredH;+ const Int notch = stepHere ? tray.uncoveredH : 0;+ const Int shorten = stepBeside ? tray.openW : 0;++ piece( tray.cell, c.lo.x, c.lo.y, c.hi.x, c.hi.y );+ if( !covered )+ piece( tray.uncovered, c.lo.x + ( openSide > 0 ? shorten : 0 ), farLo, c.hi.x - ( openSide > 0 ? 0 : shorten ), farHi );+ if( innermost )+ {+ piece( tray.open, openLo, c.lo.y + ( footSide > 0 ? 0 : notch ), openHi, c.hi.y - ( footSide > 0 ? notch : 0 ) );+ if( stepHere )+ piece( tray.step, openLo, stepLo, openHi, stepHi );+ if( !covered )+ piece( tray.cornerUncovered, openLo, farLo, openHi, farHi );+ }+ if( row == 0 )+ {+ piece( tray.foot, c.lo.x, footLo, c.hi.x, footHi );+ if( innermost )+ piece( tray.cornerFoot, openLo, footLo, openHi, footHi );+ }+ }+}++//-------------------------------------------------------------------------------------------------+/** A charged superweapon's light: its owner's colour cast up off the underline over the cameo,+ * strongest at the line and gone by the top, breathing once every HUD_READY_GLOW_PERIOD_MS on the+ * logic clock, so it holds still while the game is paused. The piece, <side>ProHudReadyGlow, is+ * grey light on black drawn additively: the vertex colour, the owner's scaled by the breath,+ * multiplies it (Render2DClass draws with GRADIENT_MODULATE) and the sum brightens the cameo+ * without hiding it. Over it <side>ProHudReadyShimmer, a band of light as tall as the cameo and+ * brightest along its top edge, climbs from the underline to HUD_READY_SHIMMER_RISE of the cameo+ * once a breath and fades as it goes, clipped to the cameo: Tools/hud_command_bar.py shimmer_rise,+ * the owner's pick from the round 8 preview. A piece the sheet lacks is left out. */+//-------------------------------------------------------------------------------------------------+static void drawReadyGlow( const Image *glow, const Image *shimmer, const IRegion2D &cameo, Color owner )+{+ const Int period = LOGICFRAMES_PER_SECOND * HUD_READY_GLOW_PERIOD_MS / 1000;+ const Real phase = (Real)( TheGameLogic->getFrame() % period ) / period;+ const Real breath = 0.55f + 0.45f * ( 0.5f - 0.5f * Cos( 2.0f * PI * phase ) );++ UnsignedByte r, g, b, a;+ GameGetColorComponents( owner, &r, &g, &b, &a );+ auto tint = [ r, g, b ]( Real light )+ {+ return GameMakeColor( REAL_TO_INT( r * light ), REAL_TO_INT( g * light ), REAL_TO_INT( b * light ), 255 );+ };++ if( glow != NULL )+ TheDisplay->drawImage( glow, cameo.lo.x, cameo.lo.y, cameo.hi.x, cameo.hi.y, tint( breath ),+ Display::DRAW_IMAGE_ADDITIVE );+ if( shimmer == NULL )+ return;++ // the band's top edge stands rise of the cameo up off the underline; below the cameo it is cut+ const Real rise = HUD_READY_SHIMMER_RISE / 100.0f * phase;+ const Real fade = (Real)pow( 1.0f - phase, 0.7 );+ const Int height = cameo.hi.y - cameo.lo.y;+ const Int top = cameo.lo.y + REAL_TO_INT( floor( height * ( 1.0f - rise ) + 0.5f ) ) - 1;+ IRegion2D clip = cameo;+ TheDisplay->setClipRegion( &clip );+ TheDisplay->drawImage( shimmer, cameo.lo.x, top, cameo.hi.x, top + height, tint( fade * breath ),+ Display::DRAW_IMAGE_ADDITIVE );+ TheDisplay->enableClipping( FALSE );+}++/// no tab: the cells all fit+static IRegion2D noHudTab( void )+{+ IRegion2D none;+ none.lo.x = none.lo.y = none.hi.x = none.hi.y = 0;+ return none;+}++//-------------------------------------------------------------------------------------------------+/** A full tray's "+N" tab, a tag of its own pinned to the tray's far side at the screen edge: the+ * superweapons' hangs from the tray's bottom against the right edge (<side>ProTrayTabDown), the+ * queue's sticks up from its top against the left edge (<side>ProTrayTabUp). Each is one fixed+ * picture, HUD_TRAY_TAB_W by HUD_TRAY_TAB_H at 1080 and scaled as the powers tray is, whose+ * HUD_TRAY_TAB_JOIN rows nearest the tray lie over the tray's own outer edge so the art can draw+ * the pin there. `screenSide` is +1 for the right edge and -1 for the left, `tray` the tray's+ * outer line on its far side, `hangs` +1 for a tab below that line and -1 above. The text is+ * centred in the rest, inset HUD_TRAY_TAB_TEXT_INSET_X and HUD_TRAY_TAB_TEXT_INSET_Y. A sheet+ * without the piece yet gets a dark slab. */+//-------------------------------------------------------------------------------------------------+static IRegion2D hudTab( Int screenSide, Int tray, Int hangs )+{+ const Real k = TheDisplay->getHeight() / 1080.0f;+ const Int width = REAL_TO_INT_CEIL( HUD_TRAY_TAB_W * k );+ const Int height = REAL_TO_INT_CEIL( HUD_TRAY_TAB_H * k );+ const Int join = REAL_TO_INT_CEIL( HUD_TRAY_TAB_JOIN * k );+ IRegion2D tab;+ tab.lo.x = screenSide > 0 ? TheDisplay->getWidth() - width : 0;+ tab.hi.x = tab.lo.x + width;+ tab.lo.y = hangs > 0 ? tray - join : tray + join - height;+ tab.hi.y = tab.lo.y + height;+ return tab;+}++static void drawHudTab( const Image *art, const IRegion2D &tab, Int hangs, DisplayString *text )+{+ if( art != NULL )+ TheDisplay->drawImage( art, tab.lo.x, tab.lo.y, tab.hi.x, tab.hi.y );+ else+ TheDisplay->drawFillRect( tab.lo.x, tab.lo.y, tab.hi.x - tab.lo.x, tab.hi.y - tab.lo.y, GameMakeColor( 2, 4, 5, 230 ) );++ const Real k = TheDisplay->getHeight() / 1080.0f;+ const Int join = REAL_TO_INT_CEIL( HUD_TRAY_TAB_JOIN * k );+ const Int insetX = REAL_TO_INT_CEIL( HUD_TRAY_TAB_TEXT_INSET_X * k );+ const Int insetY = REAL_TO_INT_CEIL( HUD_TRAY_TAB_TEXT_INSET_Y * k );+ IRegion2D room;+ room.lo.x = tab.lo.x + insetX;+ room.hi.x = tab.hi.x - insetX;+ room.lo.y = tab.lo.y + insetY + ( hangs > 0 ? join : 0 );+ room.hi.y = tab.hi.y - insetY - ( hangs > 0 ? 0 : join );++ Int textWidth = 0, textHeight = 0;+ text->getSize( &textWidth, &textHeight );+ text->setClipRegion( &room );+ text->draw( ( room.lo.x + room.hi.x - textWidth ) / 2, ( room.lo.y + room.hi.y - textHeight ) / 2,+ GameMakeColor( 255, 255, 255, 255 ), GameMakeColor( 0, 0, 0, 255 ) );+}+//-------------------------------------------------------------------------------------------------/** The cameo a special power is fired from. A SpecialPowerTemplate carries no art of its own -* the picture lives on whichever command button launches it - so the button list is what has to@@ -202,6 +514,43 @@ static const Image *superweaponCameo( const SpecialPowerTemplate *powerTemplatereturn button ? button->getButtonImage() : NULL;}+//-------------------------------------------------------------------------------------------------+/** The border a command button of `type` wears on the bar and in the tray, the scheme's+ * ButtonBorder* colour through setCommandBarBorder; GAME_COLOR_UNDEFINED draws none, as+ * W3DPushButton draws none. */+//-------------------------------------------------------------------------------------------------+static Color hudCellBorder( CommandButtonMappedBorderType type )+{+ if( type == COMMAND_BUTTON_BORDER_BUILD )+ return TheControlBar->getBuildBorderColor();+ if( type == COMMAND_BUTTON_BORDER_UPGRADE )+ return TheControlBar->getUpgradeBorderColor();+ if( type == COMMAND_BUTTON_BORDER_ACTION )+ return TheControlBar->getActionBorderColor();+ if( type == COMMAND_BUTTON_BORDER_SYSTEM )+ return TheControlBar->getSystemBorderColor();+ return GAME_COLOR_UNDEFINED;+}++/// the cell round a cameo's box: the tray's cell piece, and what a click on the cameo takes+static IRegion2D hudCellBox( const HudCellStyle &style, const IRegion2D &cameo )+{+ IRegion2D box;+ box.lo.x = cameo.lo.x - style.marginX;+ box.lo.y = cameo.lo.y - style.marginY;+ box.hi.x = cameo.hi.x + style.marginX;+ box.hi.y = cameo.hi.y + style.marginY;+ return box;+}++/// the button's own 1-pixel border, just outside the cameo, the way W3DPushButton draws it+static void drawHudCellBorder( const IRegion2D &cameo, Color border )+{+ if( border != GAME_COLOR_UNDEFINED )+ TheDisplay->drawOpenRect( cameo.lo.x - 1, cameo.lo.y - 1, cameo.hi.x - cameo.lo.x + 2, cameo.hi.y - cameo.lo.y + 2,+ 1, border );+}+//-------------------------------------------------------------------------------------------------/** Pointer to show while a structure rides the cursor. Mouse::BUILD_PLACEMENT and* INVALID_BUILD_PLACEMENT are two names in CursorININames[] that no shipped Mouse.ini ever@@ -1192,9 +1541,18 @@ InGameUI::InGameUI()m_hudLastDrawMs = 0;m_productionListCount = 0;m_productionListTotal = 0;- for( Int line = 0; line <= PRODUCTION_LIST_LINES; line++ )- m_productionListText[ line ] = NULL;+ for( Int text = 0; text < 2 * PRODUCTION_LIST_CELLS; text++ )+ m_productionListText[ text ] = NULL;+ for( Int text = 0; text < SUPERWEAPON_LIST_CELLS; text++ )+ m_superweaponCellText[ text ] = NULL;m_superweaponMoreText = NULL;+ m_productionListMoreText = NULL;+ m_productionListCells = 0;+ m_productionListTab = noHudTab();+ m_superweaponCells = 0;+ m_superweaponTab = noHudTab();+ m_hudCellPass = 0;+ m_hudCellDrawnPass = 0;m_superweaponPosition.x = 0.7f;m_superweaponPosition.y = 0.7f;@@ -1242,9 +1600,6 @@ InGameUI::InGameUI()m_moveRMBScrollAnchor = FALSE;m_displayedMaxWarning = FALSE;- m_idleWorkerWin = NULL;- m_currentIdleWorkerDisplay = -1;-m_waypointMode = false;m_forceAttackMode = false;m_forceMoveToMode = false;@@ -1298,9 +1653,12 @@ InGameUI::~InGameUI()for( std::map< std::string, DisplayString * >::iterator text = m_broadcastTexts.begin(); text != m_broadcastTexts.end(); ++text )TheDisplayStringManager->freeDisplayString( text->second );m_broadcastTexts.clear();- for( Int line = 0; line <= PRODUCTION_LIST_LINES; line++ )- TheDisplayStringManager->freeDisplayString( m_productionListText[ line ] );+ for( Int text = 0; text < 2 * PRODUCTION_LIST_CELLS; text++ )+ TheDisplayStringManager->freeDisplayString( m_productionListText[ text ] );+ for( Int text = 0; text < SUPERWEAPON_LIST_CELLS; text++ )+ TheDisplayStringManager->freeDisplayString( m_superweaponCellText[ text ] );TheDisplayStringManager->freeDisplayString( m_superweaponMoreText );+ TheDisplayStringManager->freeDisplayString( m_productionListMoreText );}//-------------------------------------------------------------------------------------------------@@ -2371,6 +2729,10 @@ void InGameUI::update( void ){USE_PERF_TIMER(InGameUI_update)+ // a client pass draws (GameClient::update's DRAW) before it gets here; the clicks after it may use+ // the HUD cells' boxes only if that draw put them there. See handleHudCellClick+ m_hudCellPass++;+updateReplaySeek();// the wheeled radius belongs to the guard it was wheeled for; a shift-kept key keeps it@@ -2628,7 +2990,7 @@ void InGameUI::update( void )// update the control barTheControlBar->update();- updateIdleWorker();+ updateIdleUnitButtons();// update any random window layout that so requestsfor (std::list<WindowLayout *>::iterator it = m_windowLayouts.begin(); it != m_windowLayouts.end(); ++it)@@ -2968,48 +3330,6 @@ void InGameUI::drawClassicMessages( void )}}-//--------------------------------------------------------------------------------------------------/** EA's countdown line: the power's name right-aligned to x and its clock after it, in its owner's- * colour, the ready one bold and flashing. The text is only set again when the second, the- * readiness or a forced refresh changes it. */-//--------------------------------------------------------------------------------------------------void InGameUI::drawClassicSuperweapon( SuperweaponInfo *info, const AsciiString &templateName, Bool isReady,- Int readySecs, Int x, Int *y )-{- if( readySecs != (Int)info->m_timestamp || isReady != info->m_ready || info->m_forceUpdateText )- {- if( isReady )- info->setFont( m_superweaponReadyFont, m_superweaponReadyPointSize, m_superweaponReadyBold );- else if( info->m_timestamp == 0 )- info->setFont( m_superweaponNormalFont, m_superweaponNormalPointSize, TRUE );- info->m_forceUpdateText = false;- info->m_ready = isReady;- info->m_timestamp = readySecs;- AsciiString label;- label.format( "GUI:%s", templateName.str() );- UnicodeString name, time;- name.format( u"%ls: ", TheGameText->fetch( label.str() ).str() );- time.format( u"%d:%2.2d", readySecs / 60, readySecs % 60 );- info->setText( name, time );- }-- // 0 draws in the owner's colour, flashing to EA's flash colour once ready- Color color = 0;- if( isReady && m_superweaponFlashDuration != 0.0f )- {- if( TheGameLogic->getFrame() >= m_superweaponLastFlashFrame + (Int)m_superweaponFlashDuration )- {- m_superweaponUsedFlashColor = !m_superweaponUsedFlashColor;- m_superweaponLastFlashFrame = TheGameLogic->getFrame();- }- color = m_superweaponUsedFlashColor ? 0 : m_superweaponFlashColor;- }- const Color drop = GameMakeColor( 0, 0, 0, 255 );- info->drawName( x, *y, color, drop );- info->drawTime( x, *y, color, drop );- *y += REAL_TO_INT( info->getHeight() );-}-//-------------------------------------------------------------------------------------------------/** Same as the unicode message method, but this takes an ascii string which is assumed* to me a string manager label */@@ -3162,6 +3482,28 @@ static Int controlBarTop( void )return TheControlBar->getPanelRect( ControlBar::CB_PANEL_LEFT )->lo.y + barPos.y - TheControlBar->getPanelOrigin()->y;}+//-------------------------------------------------------------------------------------------------+/** The top of the radar's frame as it stands, fitted to this map's shape: a wide map's radar is+ * shorter and its frame starts lower than the bar's left piece. A scheme with no frame, or a+ * hidden radar, gives controlBarTop. */+//-------------------------------------------------------------------------------------------------+static Int radarFrameTop( void )+{+ static NameKeyType radarKey = TheNameKeyGenerator->nameToKey( "ControlBar.wnd:LeftHUD" );+ const Image *const *frame = TheControlBar->getControlBarSchemeManager()->getRadarFrame();+ GameWindow *radar = TheWindowManager->winGetWindowFromId( NULL, radarKey );+ if( frame == NULL || radar == NULL || radar->winIsHidden() || controlBarTop() >= TheDisplay->getHeight() )+ return controlBarTop();++ IRegion2D inner, outer;+ radar->winGetScreenPosition( &inner.lo.x, &inner.lo.y );+ radar->winGetSize( &inner.hi.x, &inner.hi.y );+ inner.hi.x += inner.lo.x;+ inner.hi.y += inner.lo.y;+ ControlBarSchemeManager::radarFrameRect( frame, inner, &outer );+ return outer.lo.y;+}+//-------------------------------------------------------------------------------------------------/** A line of chat from `player`, EA's way: "[name] text" in the message list, in his colour. *///-------------------------------------------------------------------------------------------------@@ -6508,6 +6850,7 @@ void InGameUI::disregardDrawable( Drawable *draw )void InGameUI::postDraw( void ){// drawHudOverlay is NOT called here - it goes on top of everything, see W3DInGameUI::draw+ m_hudCellDrawnPass = m_hudCellPass;drawProductionList();drawClassicMessages();@@ -6541,19 +6884,25 @@ void InGameUI::postDraw( void )// Also responsible for Eva saying "Superweapon is ready for launch"// IMPORTANT: Don't bail out of this block early just because you don't// want to display the timers -- Eva still needs to be checked+ m_superweaponCells = 0; // nothing drawn is nothing to click+ m_superweaponTab = noHudTab();if (TheGameLogic->getFrame() > 0 ){//- // EA's column of names and clocks in the top right. Everything the loop below finds is- // gathered first and written at the end of it, the soonest ready at the top, so the one that- // matters next is always the first line however many are behind it.+ // The cameos in the top right, everybody's as EA listed them, bare, each underlined in its+ // owner's colour. Everything the loop below finds is gathered first+ // and drawn at the end of it, the charged ones and then the soonest ready at the right hand+ // end, so the one that matters next is always in the same place however many are behind it.//struct ListedSuperweapon{- SuperweaponInfo *info;- const AsciiString *templateName;+ const Image *cameo;+ Color border; ///< its power button's, as the tray draws it+ Color owner;Bool ready;Int seconds;+ Int percent; ///< of the charge done, for the sweep+ ObjectID jump; ///< the local player's own building, which a click looks at; INVALID_ID otherwise};std::vector< ListedSuperweapon > listed;@@ -6659,7 +7008,20 @@ void InGameUI::postDraw( void )info->m_evaReadyPlayed = false; // Reset Eva for next time}- ListedSuperweapon line = { info, &mapIt->first, isReady, readySecs };+ // how far through the charge it is: the frame it comes ready on against a whole charge+ const UnsignedInt reload = info->getSpecialPowerTemplate()->getReloadTime();+ const UnsignedInt left = module->getReadyFrame() > TheGameLogic->getFrame()+ ? module->getReadyFrame() - TheGameLogic->getFrame() : 0;+ Int percent = 100;+ if( !isReady && reload > 0 )+ percent = left >= reload ? 0 : REAL_TO_INT( 100.0f * (Real)( reload - left ) / (Real)reload );++ const ObjectID jump = owningObject->getControllingPlayer() == ThePlayerList->getLocalPlayer()+ ? owningObject->getID() : INVALID_ID;+ const CommandButton *shortcut = powerButton( info->getSpecialPowerTemplate() );+ ListedSuperweapon line = { shortcut ? shortcut->getButtonImage() : NULL,+ shortcut ? hudCellBorder( shortcut->getCommandButtonMappedBorderType() ) : GAME_COLOR_UNDEFINED,+ clientColor( info->getColor() ), isReady, readySecs, percent, jump };listed.push_back( line );if (info->getSpecialPowerTemplate()->isSharedNSync())break; // Wow, it is almost too easy!@@ -6675,36 +7037,78 @@ void InGameUI::postDraw( void )}}- if( !m_superweaponHiddenByScript )+ if( !m_superweaponHiddenByScript && !listed.empty() ){+ // the local player's own first, then everyone else's, each soonest first: twelve cells and a+ // "+N" must never leave your own nuke behind the tagstd::stable_sort( listed.begin(), listed.end(), []( const ListedSuperweapon &a, const ListedSuperweapon &b )- { return a.ready != b.ready ? a.ready : a.seconds < b.seconds; } );-- const Int screenH = TheDisplay->getHeight();- const Int x = hudEdgeX( m_superweaponPosition.x );- // under the info strip whenever it is up: the strip is drawn last and would cover them- Int y = max( REAL_TO_INT( m_superweaponPosition.y * screenH ), hudStripBottom() );- const Int bottom = REAL_TO_INT( screenH * 0.8f * 0.82f ); // EA's: the view above its bar- size_t drawn = 0;- for( ; drawn < listed.size() && drawn < SUPERWEAPON_LIST_LINES && y < bottom; drawn++ )- drawClassicSuperweapon( listed[ drawn ].info, *listed[ drawn ].templateName, listed[ drawn ].ready,- listed[ drawn ].seconds, x, &y );-- // the rest as one line, right-aligned to the names over it- if( drawn < listed.size() )- {- UnicodeString more;- more.format( TheGameText->fetch( "GUI:ListMore" ), (Int)( listed.size() - drawn ) );- if( m_superweaponMoreText == NULL ){- m_superweaponMoreText = TheDisplayStringManager->newDisplayString();- m_superweaponMoreText->setFont( TheFontLibrary->getFont( m_superweaponNormalFont,- TheGlobalLanguageData->adjustFontSize( m_superweaponNormalPointSize ), TRUE ) );- }- if( m_superweaponMoreText->getText().compare( more ) != 0 )- m_superweaponMoreText->setText( more );- m_superweaponMoreText->draw( x - m_superweaponMoreText->getWidth(), y, GameMakeColor( 255, 255, 255, 255 ),- GameMakeColor( 0, 0, 0, 255 ) );+ const Bool ownA = a.jump != INVALID_ID, ownB = b.jump != INVALID_ID;+ if( ownA != ownB )+ return ownA;+ return a.ready != b.ready ? a.ready : a.seconds < b.seconds;+ } );++ // rows of SUPERWEAPON_LIST_COLUMNS in one tray hard against the screen's right edge, a row+ // under a row, the tray's top a little under the info strip's foot whenever it is up (the+ // strip is drawn last and would cover them), the top of the screen otherwise. Two rows at+ // most, the last the short one; past SUPERWEAPON_LIST_CELLS a "+N" tab hangs from the tray+ const HudCellStyle style = hudCellStyle();+ const Int cameoW = style.cameoW;+ const Int cameoH = style.cameoH;+ const Int gap = stripPixels( HUD_CELL_GAP );+ const Int underline = max( gap / 2, 1 ); ///< whose it is, in the cell's margin under the border+ const Int right = TheDisplay->getWidth();+ const Int top = max( hudStripBottom(), TheUIRect().y ) + stripPixels( SUPERWEAPON_TRAY_DROP ) + style.superweapon.footH;+ const Bool more = (Int)listed.size() > SUPERWEAPON_LIST_CELLS;+ const Int cameos = more ? SUPERWEAPON_LIST_CELLS : (Int)listed.size();+ IRegion2D place[ SUPERWEAPON_LIST_CELLS ];+ for( Int each = 0; each < cameos; each++ )+ {+ place[ each ].hi.x = right - each % SUPERWEAPON_LIST_COLUMNS * style.cellW - style.marginX;+ place[ each ].lo.y = top + each / SUPERWEAPON_LIST_COLUMNS * style.cellH + style.marginY;+ place[ each ].lo.x = place[ each ].hi.x - cameoW;+ place[ each ].hi.y = place[ each ].lo.y + cameoH;+ m_superweaponPlace[ each ] = hudCellBox( style, place[ each ] );+ m_superweaponJump[ each ] = listed[ each ].jump;+ }+ m_superweaponCells = cameos;+ // under the last row's cell at the screen edge, below the tray's own bottom edge+ const 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();++ TheDisplay->beginBatch2D();+ drawHudTray( style.superweapon, m_superweaponPlace, cameos, SUPERWEAPON_LIST_COLUMNS, -1, -1 );+ for( Int each = 0; each < cameos; each++ )+ if( listed[ each ].cameo != NULL )+ TheDisplay->drawImage( listed[ each ].cameo, place[ each ].lo.x, place[ each ].lo.y,+ place[ each ].hi.x, place[ each ].hi.y );+ // charging, the scrim swept off as the charge runs; charged, its owner's light rising off the line+ for( Int each = 0; each < cameos; each++ )+ {+ if( !listed[ each ].ready )+ TheDisplay->drawRemainingRectClock( place[ each ].lo.x, place[ each ].lo.y, cameoW, cameoH,+ listed[ each ].percent, GameMakeColor( 0, 0, 0, 130 ) );+ else+ drawReadyGlow( style.readyGlow, style.readyShimmer, place[ each ], listed[ each ].owner );+ }+ for( Int each = 0; each < cameos; each++ )+ drawHudCellBorder( place[ each ], listed[ each ].border );+ // an underline in its owner's colour says whose it is, charged or not: a tint on the readout's+ // plate would leave a charged one, which wears no readout, with no owner at all+ for( Int each = 0; each < cameos; each++ )+ TheDisplay->drawFillRect( place[ each ].lo.x, place[ each ].hi.y + 1, cameoW, underline, listed[ each ].owner );+ TheDisplay->endBatch2D();++ // a charged one wears no number: zero seconds says nothing the glow does not+ for( Int each = 0; each < cameos; each++ )+ if( !listed[ each ].ready )+ drawCellSeconds( m_superweaponCellText[ each ], listed[ each ].seconds, place[ each ], style.plate );+ if( more )+ {+ UnicodeString rest;+ rest.format( u"+%d", (Int)listed.size() - cameos );+ drawHudTab( style.tabDown, m_superweaponTab, 1, cellString( m_superweaponMoreText, rest ) );}}}@@ -9616,7 +10020,7 @@ static Int productionListPlace( const InGameUI::ProductionListSlot *slots, Int c//-------------------------------------------------------------------------------------------------/** Append everything this object has queued, units and upgrades alike, into a list kept sorted by* how long each item still has to wait - soonest first. Everything is counted in *total; only- * the PRODUCTION_LIST_LINES items that finish first get a line, whatever order they were met in.+ * the PRODUCTION_LIST_CELLS items that finish first get a cell, whatever order they were met in.** The wait is cumulative down a producer's queue: an entry only starts once everything ahead of* it has popped, so its remaining time is the time left on the entry in front plus its own build@@ -9640,20 +10044,20 @@ static void appendProducerQueue( Object *obj, InGameUI::ProductionListSlot *slotInt typeKey = 0;Bool isUpgrade = FALSE;Int buildFrames = 0;- UnicodeString name;+ const Image *cameo = NULL;if( p->getProductionType() == PRODUCTION_UNIT && p->getProductionObject() ){buildFrames = p->getProductionObject()->calcTimeToBuild( owner );typeKey = (Int)p->getProductionObject()->getTemplateID();- name = p->getProductionObject()->getDisplayName();+ cameo = p->getProductionObject()->getButtonImage();}else if( p->getProductionType() == PRODUCTION_UPGRADE && p->getProductionUpgrade() ){isUpgrade = TRUE;typeKey = (Int)p->getProductionUpgrade()->getUpgradeNameKey();buildFrames = p->getProductionUpgrade()->calcTimeToBuild( owner );- name = TheGameText->fetch( p->getProductionUpgrade()->getDisplayNameLabel().str() );+ cameo = p->getProductionUpgrade()->getButtonImage();}elsecontinue;@@ -9668,12 +10072,15 @@ static void appendProducerQueue( Object *obj, InGameUI::ProductionListSlot *slot// Guard pair is one order, paid for once and cancelled once(*total)++;- // a run of the same thing queued back to back in one producer folds into the line the run+ // a run of the same thing queued back to back in one producer folds into the cell the run// started, which wears an "xN" and the time the next of them arrives+ const Int id = isUpgrade ? typeKey : (Int)p->getProductionID();if( runAt >= 0 && runAt < *count && slots[ runAt ].typeKey == typeKey&& slots[ runAt ].isUpgrade == isUpgrade && slots[ runAt ].producer == obj->getID() ){+ // a cancel takes the newest of the run off, as the command bar's doesslots[ runAt ].quantity++;+ slots[ runAt ].id = id;continue;}@@ -9682,10 +10089,10 @@ static void appendProducerQueue( Object *obj, InGameUI::ProductionListSlot *slot// something else has come between: whatever this producer queues next starts a new runrunAt = -1;- if( at >= InGameUI::PRODUCTION_LIST_LINES )+ if( at >= InGameUI::PRODUCTION_LIST_CELLS )continue; // everything already kept finishes sooner: counted, but not drawn- if( *count < InGameUI::PRODUCTION_LIST_LINES )+ if( *count < InGameUI::PRODUCTION_LIST_CELLS )(*count)++;for( Int j = *count - 1; j > at; j-- )@@ -9699,7 +10106,11 @@ static void appendProducerQueue( Object *obj, InGameUI::ProductionListSlot *slotslot->isUpgrade = isUpgrade;slot->remaining = remaining;slot->quantity = 1;- slot->name = name;+ // only the head of a queue is being built; the rest wait at 0+ slot->percent = REAL_TO_INT( p->getPercentComplete() );+ slot->cameo = cameo;+ slot->id = id;+ slot->isStructure = FALSE;}}@@ -9724,23 +10135,26 @@ static void appendStructureUnderConstruction( Object *obj, InGameUI::ProductionL(*total)++;const Int at = productionListPlace( slots, *count, remaining );- if( at >= InGameUI::PRODUCTION_LIST_LINES )+ if( at >= InGameUI::PRODUCTION_LIST_CELLS )return;- if( *count < InGameUI::PRODUCTION_LIST_LINES )+ if( *count < InGameUI::PRODUCTION_LIST_CELLS )(*count)++;for( Int j = *count - 1; j > at; j-- )slots[ j ] = slots[ j - 1 ];- // each site is its own place on the map, so two of the same building stay two lines+ // each site is its own place on the map, so two of the same building stay two cellsInGameUI::ProductionListSlot *slot = &slots[ at ];slot->producer = obj->getID();slot->typeKey = 0;slot->isUpgrade = FALSE;slot->remaining = remaining;slot->quantity = 1;- slot->name = obj->getTemplate()->getDisplayName();+ slot->percent = REAL_TO_INT( percent );+ slot->cameo = obj->getTemplate()->getButtonImage();+ slot->id = 0;+ slot->isStructure = TRUE;}//-------------------------------------------------------------------------------------------------@@ -9810,7 +10224,8 @@ Bool HudReadout_fits( DisplayString *text, const IRegion2D &cell )}//--------------------------------------------------------------------------------------------------void HudReadout_draw( DisplayString *text, const IRegion2D &cell, HudReadoutCorner corner, Color textColor )+void HudReadout_draw( DisplayString *text, const IRegion2D &cell, HudReadoutCorner corner, Color textColor,+ const Image *plate ){Int textWidth = 0, textHeight = 0;text->getSize( &textWidth, &textHeight );@@ -9832,11 +10247,14 @@ void HudReadout_draw( DisplayString *text, const IRegion2D &cell, HudReadoutCorntop = ( cell.lo.y + cell.hi.y - textHeight ) / 2;}- // solid, the colour of a cell's own hole: the text is read against the plate at every HUD Size,- // whatever picture is under it- TheDisplay->drawFillRect( left, top, plateWidth, textHeight, GameMakeColor( 2, 4, 5, 255 ) );- IRegion2D plate = { { left, top }, { left + plateWidth, top + textHeight } };- text->setClipRegion( &plate );+ // the side's plate when the sheet has one, or solid, the colour of a cell's own hole: the text is+ // read against the plate at every HUD Size, whatever picture is under it+ if( plate != NULL )+ TheDisplay->drawImage( plate, left, top, left + plateWidth, top + textHeight );+ else+ TheDisplay->drawFillRect( left, top, plateWidth, textHeight, GameMakeColor( 2, 4, 5, 255 ) );+ IRegion2D plateBox = { { left, top }, { left + plateWidth, top + textHeight } };+ text->setClipRegion( &plateBox );text->draw( left + HUD_READOUT_PAD, top, textColor, GameMakeColor( 0, 0, 0, 255 ) );}@@ -9868,15 +10286,20 @@ void InGameUI_numberBuildPlans( std::vector<BuildPlanNumber>& plans )}//--------------------------------------------------------------------------------------------------/** Everything the local player has coming, as lines of text down the left side over the control- * bar: every producer's queue and every building a dozer or a worker has going up, soonest to- * finish first, in the superweapon countdown's font and the player's colour. PRODUCTION_LIST_LINES- * of them, and one more saying how many did not fit. The sweep reads the logic, which only moves- * on a logic frame, so it is taken once a frame and the render passes between two frames draw what- * it found; a script can change a queue while time is frozen, so a frozen pass sweeps every time. */+/** Everything the local player has coming, as bare cameos on the left over the+ * control bar: every producer's queue and every building a dozer or a worker has going up, soonest+ * to finish at the left, in one row. Each wears its seconds in the bottom left corner, an "xN" in+ * the top right for a run of the same thing, and a scrim swept off as its own build runs.+ * PRODUCTION_LIST_CELLS cells, and a "+N" tab sticking up from the tray when more is coming than+ * they show. The sweep reads the logic, which only moves on a logic frame, so+ * it is taken once a frame and the render passes between two frames draw what it found; a script can+ * change a queue while time is frozen, so a frozen pass sweeps every time. *///-------------------------------------------------------------------------------------------------void InGameUI::drawProductionList( void ){+ // nothing drawn is nothing to click+ m_productionListCells = 0;+ m_productionListTab = noHudTab();if( !TheGameLogic->isInGame() || TheGameLogic->isInShellGame() )return;@@ -9902,49 +10325,197 @@ void InGameUI::drawProductionList( void )if( m_productionListCount == 0 )return;- // a line wearing an "x5" stands for five, and the last line counts what no line shows+ // a cell wearing an "x5" stands for five. Only a full list leaves anything out, and the tab+ // counts everything no cameo showsInt shown = 0;for( Int each = 0; each < m_productionListCount; each++ )shown += m_productionList[ each ].quantity;- const Int hidden = m_productionListTotal - shown;- const Int lines = m_productionListCount + ( hidden > 0 ? 1 : 0 );+ const Bool more = m_productionListTotal > shown;+ const Int cameos = m_productionListCount;- // left-aligned under the messages' column, the last line standing just clear of the control bar,- // white and bold so it reads on any ground- GameFont *font = TheFontLibrary->getFont( m_superweaponNormalFont,- TheGlobalLanguageData->adjustFontSize( m_superweaponNormalPointSize ), TRUE );- const Int x = m_messagePosition.x;- Int y = controlBarTop() - stripPixels( PRODUCTION_LIST_LIFT ) - lines * font->height;- const Color color = GameMakeColor( 255, 255, 255, 255 );- const Color drop = GameMakeColor( 0, 0, 0, 255 );- for( Int line = 0; line < lines; line++ )+ // one row in a tray hard against the screen's left edge, the powers tray mirrored, its foot+ // standing just clear of the radar's frame+ const HudCellStyle style = hudCellStyle();+ const Int cameoW = style.cameoW;+ const Int cameoH = style.cameoH;+ const Int left = 0;+ const Int foot = radarFrameTop() - stripPixels( PRODUCTION_LIST_LIFT ) - style.production.footH;+ IRegion2D place[ PRODUCTION_LIST_CELLS ];+ for( Int each = 0; each < cameos; each++ ){- UnicodeString text;- if( line < m_productionListCount )+ place[ each ].lo.x = left + each * style.cellW + style.marginX;+ place[ each ].hi.y = foot - style.marginY;+ place[ each ].hi.x = place[ each ].lo.x + cameoW;+ place[ each ].lo.y = place[ each ].hi.y - cameoH;+ m_productionListPlace[ each ] = hudCellBox( style, place[ each ] );+ }+ m_productionListCells = cameos;+ // over the first cell, above the tray's own top edge+ if( more )+ m_productionListTab = hudTab( -1, m_productionListPlace[ 0 ].lo.y - style.production.uncoveredH, -1 );++ // ctrl is the cells' cancel key, so while it is held the cameo a click would cancel says so: it goes+ // red and wears a minus. An accidental cancel costs the whole item+ Int cancelHover = -1;+ if( TheKeyboard->isCtrl() )+ {+ const MouseIO *io = TheMouse->getMouseStatus();+ for( Int each = 0; each < cameos; each++ ){- const ProductionListSlot &slot = m_productionList[ line ];- const Int seconds = ControlBar_secondsFromFrames( (Real)slot.remaining );- if( slot.quantity > 1 )- text.format( u"%ls x%d: %d:%2.2d", slot.name.str(), slot.quantity, seconds / 60, seconds % 60 );- else- text.format( u"%ls: %d:%2.2d", slot.name.str(), seconds / 60, seconds % 60 );+ const Object *producer = TheGameLogic->findObjectByID( m_productionList[ each ].producer );+ const IRegion2D &box = m_productionListPlace[ each ];+ if( !m_productionList[ each ].isStructure && producer != NULL && producer->isLocallyControlled()+ && io->pos.x >= box.lo.x && io->pos.x < box.hi.x && io->pos.y >= box.lo.y && io->pos.y < box.hi.y )+ cancelHover = each;}- else- text.format( TheGameText->fetch( "GUI:ListMore" ), hidden );+ }- DisplayString *&string = m_productionListText[ line ];- if( string == NULL )+ // a piece at a time over every cell, so a run of the same piece is one draw call; see beginBatch2D+ TheDisplay->beginBatch2D();+ drawHudTray( style.production, m_productionListPlace, cameos, PRODUCTION_LIST_COLUMNS, 1, 1 );+ for( Int each = 0; each < cameos; each++ )+ if( m_productionList[ each ].cameo != NULL )+ TheDisplay->drawImage( m_productionList[ each ].cameo, place[ each ].lo.x, place[ each ].lo.y,+ place[ each ].hi.x, place[ each ].hi.y );+ // swept off the way the command bar's own clock is; an item still waiting wears all of it+ for( Int each = 0; each < cameos; each++ )+ TheDisplay->drawRemainingRectClock( place[ each ].lo.x, place[ each ].lo.y, cameoW, cameoH,+ m_productionList[ each ].percent, GameMakeColor( 0, 0, 0, 100 ) );+ // the command bar's own: build for a unit or a structure, upgrade for an upgrade+ for( Int each = 0; each < cameos; each++ )+ drawHudCellBorder( place[ each ], hudCellBorder( m_productionList[ each ].isUpgrade ? COMMAND_BUTTON_BORDER_UPGRADE+ : COMMAND_BUTTON_BORDER_BUILD ) );+ if( cancelHover >= 0 )+ {+ const IRegion2D &box = place[ cancelHover ];+ const Int barInset = cameoW / 4;+ const Int barHeight = stripPixels( 4 );+ TheDisplay->drawFillRect( box.lo.x, box.lo.y, cameoW, cameoH, GameMakeColor( 190, 0, 0, 120 ) );+ TheDisplay->drawFillRect( box.lo.x + barInset, box.lo.y + ( cameoH - barHeight ) / 2, cameoW - 2 * barInset, barHeight,+ GameMakeColor( 255, 255, 255, 255 ) );+ }+ TheDisplay->endBatch2D();++ const Color white = GameMakeColor( 255, 255, 255, 255 );+ for( Int each = 0; each < cameos; each++ )+ {+ const ProductionListSlot &slot = m_productionList[ each ];+ drawCellSeconds( m_productionListText[ 2 * each ], ControlBar_secondsFromFrames( (Real)slot.remaining ),+ place[ each ], style.plate );+ if( slot.quantity > 1 ){- string = TheDisplayStringManager->newDisplayString();- string->setFont( font );+ UnicodeString count;+ count.format( u"x%d", slot.quantity );+ HudReadout_draw( cellString( m_productionListText[ 2 * each + 1 ], count ), place[ each ],+ HUD_READOUT_TOP_RIGHT, white, style.plate );}- if( string->getText().compare( text ) != 0 )- string->setText( text );- string->draw( x, y, color, drop );- y += font->height;+ }+ if( more )+ {+ UnicodeString rest;+ rest.format( u"+%d", m_productionListTotal - shown );+ drawHudTab( style.tabUp, m_productionListTab, -1, cellString( m_productionListMoreText, rest ) );}}+//-------------------------------------------------------------------------------------------------+/** A cell's readout string, made the first time in the superweapon countdown's face, bold, and set+ * to `text` only when it holds something else: a string laid out again builds its texture again. */+//-------------------------------------------------------------------------------------------------+DisplayString *InGameUI::cellString( DisplayString *&string, const UnicodeString &text )+{+ if( string == NULL )+ {+ string = TheDisplayStringManager->newDisplayString();+ string->setFont( TheFontLibrary->getFont( m_superweaponNormalFont,+ TheGlobalLanguageData->adjustFontSize( HUD_CELL_POINT_SIZE ), TRUE ) );+ }+ if( string->getText().compare( text ) != 0 )+ string->setText( text );+ return string;+}++//-------------------------------------------------------------------------------------------------+/** A countdown in a cameo's bottom left corner, in bare seconds with the unit on it, "45s": the+ * picture's middle is what it is there to show, and m:ss is a number to convert first. A number+ * too wide for the cameo with its s goes without it, and stays without until the number changes,+ * so the string is not laid out twice a frame. */+//-------------------------------------------------------------------------------------------------+void InGameUI::drawCellSeconds( DisplayString *&string, Int seconds, const IRegion2D &cameo, const Image *plate )+{+ UnicodeString bare, unit;+ bare.format( u"%d", seconds > 0 ? seconds : 0 );+ unit.format( u"%ds", seconds > 0 ? seconds : 0 );+ DisplayString *text = NULL;+ if( string != NULL && string->getText().compare( bare ) == 0 )+ text = string;+ else+ {+ text = cellString( string, unit );+ if( !HudReadout_fits( text, cameo ) )+ text = cellString( string, bare );+ }+ HudReadout_draw( text, cameo, HUD_READOUT_BOTTOM_LEFT, GameMakeColor( 245, 245, 245, 255 ), plate );+}++//-------------------------------------------------------------------------------------------------+/** The cells lie over the world rather than in a window, so nothing ahead of PlaceEventTranslator has+ * claimed a click on them; it asks here first, before placement and selection turn the click into+ * an order. A cell is its cell piece, cameo, border and margin, and a "+N" tab is its picture; the+ * tray's edges round the group stay the world's. A cancel is the command bar's own+ * message with the producer on it, which the logic checks is the sender's. */+//-------------------------------------------------------------------------------------------------+Bool InGameUI::handleHudCellClick( const ICoord2D *mouse, Bool cancel )+{+ // the boxes are the last pass's draw, and only if that pass drew: a click comes after the pass's+ // update (logic thread 0) or at the start of the next pass ahead of its draw (1 and 2), and either+ // way update() has counted the drawing pass once since. A pass that drew nothing over the world+ // (-cinema, the load screen, -headless, TiVO's skipped frames) leaves the stamp behind+ if( m_hudCellDrawnPass + 1 != m_hudCellPass )+ return FALSE;++ auto inside = [ mouse ]( const IRegion2D &box )+ {+ return mouse->x >= box.lo.x && mouse->x < box.hi.x && mouse->y >= box.lo.y && mouse->y < box.hi.y;+ };++ // a "+N" tab stands for no one item+ if( inside( m_productionListTab ) || inside( m_superweaponTab ) )+ return TRUE;++ for( Int each = 0; each < m_productionListCells; each++ )+ {+ if( !inside( m_productionListPlace[ each ] ) )+ continue;+ const ProductionListSlot &slot = m_productionList[ each ];+ Object *producer = TheGameLogic->findObjectByID( slot.producer );+ if( producer == NULL )+ return TRUE; // gone since the draw: the click is still the cell's+ if( cancel && !slot.isStructure && producer->isLocallyControlled() )+ {+ GameMessage *msg = TheMessageStream->appendMessage( slot.isUpgrade ? GameMessage::MSG_CANCEL_UPGRADE+ : GameMessage::MSG_CANCEL_UNIT_CREATE );+ msg->appendIntegerArgument( slot.id );+ msg->appendObjectIDArgument( slot.producer );+ }+ else+ TheTacticalView->lookAt( producer->getPosition() );+ return TRUE;+ }++ for( Int each = 0; each < m_superweaponCells; each++ )+ {+ if( !inside( m_superweaponPlace[ each ] ) )+ continue;+ Object *building = TheGameLogic->findObjectByID( m_superweaponJump[ each ] );+ if( building != NULL )+ TheTacticalView->lookAt( building->getPosition() );+ return TRUE;+ }++ return FALSE;+}+void InGameUI::drawFloatingText( void ){FloatingTextData *ftd;@@ -10302,29 +10873,6 @@ void InGameUI::updateAndDrawWorldAnimations( void )} // end updateAndDrawWorldAnimations-Object *InGameUI::findIdleWorker( Object *obj)-{- if(!obj)- return NULL;-- Int index = obj->getControllingPlayer()->getPlayerIndex();- if(m_idleWorkers[index].empty())- return NULL;-- ObjectListIt it = m_idleWorkers[index].begin();- while(it != m_idleWorkers[index].end())- {- Object *itObj = *it;- if(itObj == obj)- {- return itObj;- break;- }- ++it;- }- return NULL;-}-void InGameUI::addIdleWorker( Object *obj ){if(!obj)@@ -10375,73 +10923,10 @@ void InGameUI::removeIdleWorker( Object *obj, Int playerNumber )// The camera stays put; the idle worker buttons look at what this returns, the hotkey does not.Object *InGameUI::selectNextIdleWorker( void ){- Int index = ThePlayerList->getLocalPlayer()->getPlayerIndex();- if(m_idleWorkers[index].empty())- {- DEBUG_ASSERTCRASH(FALSE, ("InGameUI::selectNextIdleWorker We're trying to select a worker when our list is empty for player %s", WideCharAsUtf8( ThePlayerList->getLocalPlayer()->getPlayerDisplayName().str() ).str()));- return NULL;- }- Object *selectThisObject = NULL;-- if(getSelectCount() == 0 || getSelectCount() > 1)- {- selectThisObject = *m_idleWorkers[index].begin();- }- else- {- Drawable *selectedDrawable = TheInGameUI->getFirstSelectedDrawable();-- ObjectListIt it = m_idleWorkers[index].begin();- while(it != m_idleWorkers[index].end())- {- Object *itObj = *it;- if(itObj == selectedDrawable->getObject())- {- ++it;- if(it != m_idleWorkers[index].end())- selectThisObject = *it;- else- selectThisObject = *m_idleWorkers[index].begin();- break;- }- ++it;- }- // if we had something selected that wasn't a worker, we'll get here- if(!selectThisObject)- selectThisObject = *m_idleWorkers[index].begin();-- }- DEBUG_ASSERTCRASH(selectThisObject, ("InGameUI::selectNextIdleWorker Could not select the next IDLE worker"));- if(selectThisObject)- {-- //If our idle worker is contained by anything, we need to select the container instead.- Object *containedBy = selectThisObject->getContainedBy();- if( containedBy )- {- selectThisObject = containedBy;- }-- deselectAllDrawables();- GameMessage *teamMsg = TheMessageStream->appendMessage( GameMessage::MSG_CREATE_SELECTED_GROUP );--- //New group or add to group? Passed in value is true if we are creating a new group.- teamMsg->appendBooleanArgument( TRUE );-- teamMsg->appendObjectIDArgument( selectThisObject->getID() );-- selectDrawable( selectThisObject->getDrawable() );-- /*// removed becuase we're already playing a select sound... left in, just in case i"m wrong.- // play the units sound- const AudioEventRTS *soundEvent = selectThisObject->getTemplate()->getVoiceSelect();- if (soundEvent)- {- TheAudio->addAudioEvent( soundEvent );- }*/- }- return selectThisObject;+ // the same walk the button's light comes from, so a lit button always has a worker to give+ KindOfMaskType mustBeSet, mustBeClear;+ idleUnitKinds( GameMessage::MSG_META_SELECT_NEXT_IDLE_WORKER, &mustBeSet, &mustBeClear );+ return selectNextIdleUnit( mustBeSet, mustBeClear );}// A unit of the local player's that is standing on the field with no order: not a dozer, a worker@@ -10462,11 +10947,108 @@ Bool InGameUI::isIdleCombatUnit( const Object *obj )return ai && ai->isIdle();}-void InGameUI::selectNextIdleUnit( KindOfMaskType mustBeSet, KindOfMaskType mustBeClear )+// A dozer or worker of the local player's with no order, riding in something or not: the idle+// worker button selects what carries it. A Worker out on a supply run is busy even on the frames+// its AI stands idle between two docks. Read here every pass, where the list the dozers keep+// themselves fills only when their sleeping idle state wakes, seconds late.+static Bool isIdleWorker( const Object *obj )+{+ if( !obj->isLocallyControlled() || obj->isEffectivelyDead() || !obj->isKindOf( KINDOF_DOZER ) )+ return FALSE;++ const AIUpdateInterface *ai = obj->getAI();+ if( ai == NULL || !ai->isIdle() )+ return FALSE;++ const SupplyTruckAIInterface *truck = ai->getSupplyTruckAIInterface();+ return truck == NULL || !truck->isCurrentlyFerryingSupplies();+}++// what an idle key of the kinds idleUnitKinds gave cycles over+static Bool isIdleOfKinds( const Object *obj, const KindOfMaskType &mustBeSet, const KindOfMaskType &mustBeClear )+{+ if( mustBeSet.test( KINDOF_DOZER ) )+ return isIdleWorker( obj );+ return InGameUI::isIdleCombatUnit( obj ) && obj->isKindOfMulti( mustBeSet, mustBeClear );+}++void InGameUI::idleUnitKinds( GameMessage::Type t, KindOfMaskType *mustBeSet, KindOfMaskType *mustBeClear )+{+ if( t == GameMessage::MSG_META_SELECT_NEXT_IDLE_WORKER )+ mustBeSet->set( KINDOF_DOZER );+ else if( t == GameMessage::MSG_META_SELECT_NEXT_IDLE_AIRCRAFT )+ mustBeSet->set( KINDOF_AIRCRAFT );+ else if( t == GameMessage::MSG_META_SELECT_NEXT_IDLE_VEHICLE )+ {+ mustBeSet->set( KINDOF_VEHICLE );+ mustBeClear->set( KINDOF_AIRCRAFT );+ }+ else if( t == GameMessage::MSG_META_SELECT_NEXT_IDLE_INFANTRY )+ mustBeSet->set( KINDOF_INFANTRY );+}++//-------------------------------------------------------------------------------------------------+/** One walk of the object list a frame lights each idle button whose kind has a unit standing+ * idle, so a dim one never answers a click with nothing. The worker button is one of them: the+ * four light on the same pass, and each cycles over what lit it. */+//-------------------------------------------------------------------------------------------------+void InGameUI::updateIdleUnitButtons( void )+{+ enum { IDLE_BUTTON_COUNT = 4 };+ static const GameMessage::Type keys[ IDLE_BUTTON_COUNT ] =+ {+ GameMessage::MSG_META_SELECT_NEXT_IDLE_INFANTRY,+ GameMessage::MSG_META_SELECT_NEXT_IDLE_VEHICLE,+ GameMessage::MSG_META_SELECT_NEXT_IDLE_AIRCRAFT,+ GameMessage::MSG_META_SELECT_NEXT_IDLE_WORKER,+ };+ static const NameKeyType ids[ IDLE_BUTTON_COUNT ] =+ {+ NAMEKEY( "ControlBar.wnd:ButtonIdleInfantry" ),+ NAMEKEY( "ControlBar.wnd:ButtonIdleVehicle" ),+ NAMEKEY( "ControlBar.wnd:ButtonIdleAircraft" ),+ NAMEKEY( "ControlBar.wnd:ButtonIdleWorker" ),+ };+ GameWindow *win[ IDLE_BUTTON_COUNT ];+ KindOfMaskType mustBeSet[ IDLE_BUTTON_COUNT ], mustBeClear[ IDLE_BUTTON_COUNT ];+ Bool idle[ IDLE_BUTTON_COUNT ] = { FALSE, FALSE, FALSE, FALSE };+ Int i;+ for( i = 0; i < IDLE_BUTTON_COUNT; i++ )+ {+ win[ i ] = TheWindowManager->winGetWindowFromId( NULL, ids[ i ] );+ idleUnitKinds( keys[ i ], &mustBeSet[ i ], &mustBeClear[ i ] );+ }+ if( win[ 0 ] == NULL || !getInputEnabled() || !TheGameLogic->isInGame() )+ {+ for( i = 0; i < IDLE_BUTTON_COUNT; i++ )+ if( win[ i ] )+ win[ i ]->winEnable( FALSE );+ return;+ }++ // ponytail: the whole object list every render frame; keep a list per kind if it shows in a profile+ Int lit = 0;+ for( Object *obj = TheGameLogic->getFirstObject(); obj && lit < IDLE_BUTTON_COUNT; obj = obj->getNextObject() )+ {+ if( !obj->isLocallyControlled() )+ continue;+ for( i = 0; i < IDLE_BUTTON_COUNT; i++ )+ if( !idle[ i ] && isIdleOfKinds( obj, mustBeSet[ i ], mustBeClear[ i ] ) )+ {+ idle[ i ] = TRUE;+ lit++;+ }+ }+ for( i = 0; i < IDLE_BUTTON_COUNT; i++ )+ if( win[ i ] )+ win[ i ]->winEnable( idle[ i ] );+}++Object *InGameUI::selectNextIdleUnit( KindOfMaskType mustBeSet, KindOfMaskType mustBeClear ){- // Nothing keeps a list of these the way the dozers keep m_idleWorkers, so the key walks the- // object list, which is in creation order and stays put between presses. A lone selected unit- // is the place to carry on from; with nothing or a group selected the walk starts over.+ // The key walks the object list, the one updateIdleUnitButtons lights the buttons from, which is+ // in creation order and stays put between presses. A lone selected unit is the place to carry+ // on from; with nothing or a group selected the walk starts over.const Object *current = getSelectCount() == 1 ? getFirstSelectedDrawable()->getObject() : NULL;Object *first = NULL;Object *selectThisObject = NULL;@@ -10474,7 +11056,7 @@ void InGameUI::selectNextIdleUnit( KindOfMaskType mustBeSet, KindOfMaskType mustfor( Object *obj = TheGameLogic->getFirstObject(); obj; obj = obj->getNextObject() ){- if( isIdleCombatUnit( obj ) && obj->isKindOfMulti( mustBeSet, mustBeClear ) )+ if( isIdleOfKinds( obj, mustBeSet, mustBeClear ) ){if( passedCurrent ){@@ -10492,7 +11074,11 @@ void InGameUI::selectNextIdleUnit( KindOfMaskType mustBeSet, KindOfMaskType mustif( !selectThisObject )selectThisObject = first;if( !selectThisObject )- return;+ return NULL;++ // a worker riding in a tunnel or a transport is selected by what carries it+ if( selectThisObject->getContainedBy() )+ selectThisObject = selectThisObject->getContainedBy();deselectAllDrawables();GameMessage *teamMsg = TheMessageStream->appendMessage( GameMessage::MSG_CREATE_SELECTED_GROUP );@@ -10501,65 +11087,13 @@ void InGameUI::selectNextIdleUnit( KindOfMaskType mustBeSet, KindOfMaskType mustteamMsg->appendBooleanArgument( TRUE );teamMsg->appendObjectIDArgument( selectThisObject->getID() );- // the camera stays where the player has it+ // the camera stays where the player has it; the idle buttons move it themselvesselectDrawable( selectThisObject->getDrawable() );-}--Int InGameUI::getIdleWorkerCount( void )-{- Int index = ThePlayerList->getLocalPlayer()->getPlayerIndex();- return m_idleWorkers[index].size();-}--void InGameUI::showIdleWorkerLayout( void )-{- if (!m_idleWorkerWin)- {- m_idleWorkerWin = TheWindowManager->winGetWindowFromId(NULL, TheNameKeyGenerator->nameToKey("ControlBar.wnd:ButtonIdleWorker"));- DEBUG_ASSERTCRASH(m_idleWorkerWin, ("InGameUI::showIdleWorkerLayout could not find IdleWorker.wnd to load "));- return;- }-- m_idleWorkerWin->winEnable(TRUE);-- m_currentIdleWorkerDisplay = getIdleWorkerCount();--// if(m_currentIdleWorkerDisplay < 1)-// GadgetButtonSetText(m_idleWorkerWin, UnicodeString::TheEmptyString);-// else-// {-// UnicodeString number;-// number.format(L"%d",m_currentIdleWorkerDisplay);-// GadgetButtonSetText(m_idleWorkerWin, number);-// }-}-void InGameUI::hideIdleWorkerLayout( void )-{- if(!m_idleWorkerWin)- return;- GadgetButtonSetText(m_idleWorkerWin, UnicodeString::TheEmptyString);- m_idleWorkerWin->winEnable(FALSE);- m_currentIdleWorkerDisplay = -1;-}--void InGameUI::updateIdleWorker( void )-{- Int idleCount = getIdleWorkerCount();-- if(idleCount > 0 && m_currentIdleWorkerDisplay != idleCount && getInputEnabled())- showIdleWorkerLayout();-- if((idleCount <= 0 && m_idleWorkerWin) || !getInputEnabled())- hideIdleWorkerLayout();+ return selectThisObject;}void InGameUI::resetIdleWorker( void ){- if(m_idleWorkerWin)- {- GadgetButtonSetText(m_idleWorkerWin, UnicodeString::TheEmptyString);- }- m_currentIdleWorkerDisplay = -1;for(Int i = 0; i < MAX_PLAYER_COUNT; ++i){m_idleWorkers[i].clear();@@ -10606,8 +11140,6 @@ void InGameUI::recreateControlBar( void )TheWindowManager->winDestroy( window );}- m_idleWorkerWin = NULL;-// the money gadget goes with those windows, and the new one carries whatever text its .wnd// ships with until update() is told the amount it is showing is not the amount the player hasm_lastMoneyDisplayed = -1;diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cppindex e3716fb1e..3f44d53e2 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp@@ -2942,8 +2942,8 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage//-----------------------------------------------------------------------------------------case GameMessage::MSG_META_SELECT_NEXT_IDLE_WORKER:{- // same list the control bar's idle-worker button cycles; when every dozer and worker- // has a job the list is empty and selectNextIdleWorker returns without doing anything.+ // the same walk the control bar's idle-worker button lights from and cycles; when every+ // dozer and worker has a job selectNextIdleWorker finds none and does nothing.TheInGameUI->selectNextIdleWorker();disp = DESTROY_MESSAGE;@@ -2960,15 +2960,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage// mass-selectable or off-map test.KindOfMaskType mustBeSet;KindOfMaskType mustBeClear;- if( t == GameMessage::MSG_META_SELECT_NEXT_IDLE_AIRCRAFT )- mustBeSet.set( KINDOF_AIRCRAFT );- else if( t == GameMessage::MSG_META_SELECT_NEXT_IDLE_VEHICLE )- {- mustBeSet.set( KINDOF_VEHICLE );- mustBeClear.set( KINDOF_AIRCRAFT );- }- else if( t == GameMessage::MSG_META_SELECT_NEXT_IDLE_INFANTRY )- mustBeSet.set( KINDOF_INFANTRY );+ InGameUI::idleUnitKinds( t, &mustBeSet, &mustBeClear );TheInGameUI->selectNextIdleUnit( mustBeSet, mustBeClear );diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cppindex 26bb48702..d04b8d3ce 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp@@ -108,7 +108,7 @@ static Object *resolvePlacementBuilder( void )}//--------------------------------------------------------------------------------------------------PlaceEventTranslator::PlaceEventTranslator() : m_frameOfUpButton(-1)+PlaceEventTranslator::PlaceEventTranslator() : m_frameOfUpButton(-1), m_cellClickTaken(FALSE), m_cellRightClickTaken(FALSE){}@@ -124,8 +124,46 @@ GameMessageDisposition PlaceEventTranslator::translateGameMessage(const GameMess{GameMessageDisposition disp = KEEP_MESSAGE;+ // MetaEventTranslator runs ahead of this one and puts a logical click after the raw release: a+ // press a HUD cell took owns both, or a cancel on a cell would also give a world order+ const GameMessage::Type type = msg->getType();+ if( m_cellClickTaken )+ {+ if( type == GameMessage::MSG_MOUSE_LEFT_CLICK || type == GameMessage::MSG_MOUSE_LEFT_DOUBLE_CLICK )+ {+ m_cellClickTaken = FALSE;+ return DESTROY_MESSAGE;+ }+ if( type == GameMessage::MSG_RAW_MOUSE_LEFT_BUTTON_UP || type == GameMessage::MSG_RAW_MOUSE_LEFT_DRAG )+ return DESTROY_MESSAGE;+ }+ if( m_cellRightClickTaken )+ {+ if( type == GameMessage::MSG_MOUSE_RIGHT_CLICK || type == GameMessage::MSG_MOUSE_RIGHT_DOUBLE_CLICK )+ {+ m_cellRightClickTaken = FALSE;+ return DESTROY_MESSAGE;+ }+ if( type == GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_UP || type == GameMessage::MSG_RAW_MOUSE_RIGHT_DRAG )+ return DESTROY_MESSAGE;+ }+switch(msg->getType()){+ //---------------------------------------------------------------------------------------------+ // a right press on a HUD cell cancels, as a ctrl press does+ case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN:+ case GameMessage::MSG_RAW_MOUSE_RIGHT_DOUBLE_CLICK:+ {+ m_cellRightClickTaken = FALSE;+ if( TheInGameUI->handleHudCellClick( &msg->getArgument(0)->pixel, TRUE ) )+ {+ m_cellRightClickTaken = TRUE;+ return DESTROY_MESSAGE;+ }+ break;+ }+//---------------------------------------------------------------------------------------------//// While a shift-dragged row is on the ground, the wheel opens and closes the gap instead of@@ -162,6 +200,15 @@ GameMessageDisposition PlaceEventTranslator::translateGameMessage(const GameMesscase GameMessage::MSG_RAW_MOUSE_LEFT_BUTTON_DOWN:case GameMessage::MSG_RAW_MOUSE_LEFT_DOUBLE_CLICK:{+ // 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 cancels+ m_cellClickTaken = FALSE;+ if( TheInGameUI->handleHudCellClick( &msg->getArgument(0)->pixel, TheKeyboard->isCtrl() ) )+ {+ m_cellClickTaken = TRUE;+ return DESTROY_MESSAGE;+ }+// if we're in a building placement mode, do the place and send to all playersconst ThingTemplate *build = TheInGameUI->getPendingPlaceType();if( build && TheInGameUI->isPlacementAnchored() == FALSE )diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cppindex b85a752cd..6e86180b9 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp@@ -1401,9 +1401,14 @@ void W3DRadar::draw( Int pixelX, Int pixelY, Int width, Int height )// draw black border areas where we need mapColor fillColor = GameMakeColor( 0, 0, 0, 255 );Color lineColor = GameMakeColor( 50, 50, 50, 255 );- if( m_mapExtent.width()/width >= m_mapExtent.height()/height )+ if( ul.x == pixelX && ul.y == pixelY ){-+ // a window already cut to the map's shape (ControlBar::fitRadarToMap) has no bands to fill, and+ // their edge lines would fall a pixel outside the map, on the frame+ }+ else if( m_mapExtent.width()/width >= m_mapExtent.height()/height )+ {+// draw horizontal bars at top and bottomTheDisplay->drawFillRect( pixelX, pixelY, width, ul.y - pixelY - 1, fillColor );TheDisplay->drawFillRect( pixelX, lr.y + 1, width, pixelY + height - lr.y - 1, fillColor);diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cppindex b7eb0a6e9..c9b95b554 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp@@ -40,6 +40,7 @@#include "GameClient/ControlBarScheme.h"#include "GameClient/Image.h"#include "GameClient/MapUtil.h"+#include "GameClient/VideoPlayer.h"#include "GameLogic/GameLogic.h"#include "Common/LogicThread.h"#ifdef _INTERNAL@@ -140,7 +141,14 @@ void W3DLeftHUDDraw( GameWindow *window, WinInstanceData *instData )window->winGetScreenPosition( &pos.x, &pos.y );window->winGetSize( &size.x, &size.y );- TheDisplay->drawVideoBuffer( video, pos.x, pos.y, pos.x + size.x, pos.y + size.y );+ // the window takes the map's shape (ControlBar::fitRadarToMap) and the movie keeps its own,+ // centred, with the frame's glass in the bands+ const Real scale = MIN( (Real)size.x / video->width(), (Real)size.y / video->height() );+ const Int movieWidth = REAL_TO_INT( video->width() * scale );+ const Int movieHeight = REAL_TO_INT( video->height() * scale );+ const Int movieX = pos.x + ( size.x - movieWidth ) / 2;+ const Int movieY = pos.y + ( size.y - movieHeight ) / 2;+ TheDisplay->drawVideoBuffer( video, movieX, movieY, movieX + movieWidth, movieY + movieHeight );}else if( TheRadar->isRadarForced() || ( TheRadar->isRadarHidden() == false && hasRadarForDraw( player ) ) ){