@@ -56,6 +56,7 @@ class ControlBarSchemeManager;
5656class UpgradeTemplate ;
5757class ControlBarResizer ;
5858class GameWindowTransitionsHandler ;
59+ class DisplayString ;
5960
6061enum ProductionID CPP_11 (: Int);
6162
@@ -96,6 +97,8 @@ enum CommandOption CPP_11(: Int)
9697 SCRIPT_ONLY = 0x00080000 , // Only a script can use this command (not by users)
9798 IGNORES_UNDERPOWERED = 0x00100000 , // this button isn't disabled if its object is merely underpowered
9899 USES_MINE_CLEARING_WEAPONSET= 0x00200000 , // uses the special mine-clearing weaponset, even if not current
100+ CAN_USE_WAYPOINTS = 0x00400000 , // button has option to use a waypoint path
101+ MUST_BE_STOPPED = 0x00800000 , // Unit must be stopped in order to be able to use button.
99102};
100103
101104#ifdef DEFINE_COMMAND_OPTION_NAMES
@@ -127,6 +130,8 @@ static const char *const TheCommandOptionNames[] =
127130 " SCRIPT_ONLY" ,
128131 " IGNORES_UNDERPOWERED" ,
129132 " USES_MINE_CLEARING_WEAPONSET" ,
133+ " CAN_USE_WAYPOINTS" ,
134+ " MUST_BE_STOPPED" ,
130135
131136 nullptr
132137};
@@ -181,25 +186,33 @@ enum GUICommandType CPP_11(: Int)
181186 GUI_COMMAND_FIRE_WEAPON, // /< fire a weapon
182187 GUI_COMMAND_SPECIAL_POWER, // /< do a special power
183188 GUI_COMMAND_PURCHASE_SCIENCE, // /< purchase science
184- GUI_COMMAND_HACK_INTERNET, // /< Hey author, write me!
189+ GUI_COMMAND_HACK_INTERNET, // /< gain income from the ether (by hacking the internet)
185190 GUI_COMMAND_TOGGLE_OVERCHARGE, // /< Overcharge command for power plants
186191#ifdef ALLOW_SURRENDER
187192 GUI_COMMAND_POW_RETURN_TO_PRISON, // /< POW Truck, return to prison
188193#endif
189194 GUI_COMMAND_COMBATDROP, // /< rappel contents to ground or bldg
190195 GUI_COMMAND_SWITCH_WEAPON, // /< switch weapon use
191196
192- // Context senstive command modes
197+ // Context sensitive command modes
193198 GUICOMMANDMODE_HIJACK_VEHICLE,
194199 GUICOMMANDMODE_CONVERT_TO_CARBOMB,
200+ GUICOMMANDMODE_SABOTAGE_BUILDING,
195201#ifdef ALLOW_SURRENDER
196202 GUICOMMANDMODE_PICK_UP_PRISONER, // /< POW Truck assigned to pick up a specific prisoner
197203#endif
198204
199205 // context-insensitive command mode(s)
200206 GUICOMMANDMODE_PLACE_BEACON,
201207
202- GUI_COMMAND_SPECIAL_POWER_FROM_COMMAND_CENTER, // /< do a special power from localPlayer's command center, regardless of selection
208+ GUI_COMMAND_SPECIAL_POWER_FROM_SHORTCUT, // /< do a special power from localPlayer's command center, regardless of selection
209+ #if RTS_GENERALS
210+ GUI_COMMAND_SPECIAL_POWER_FROM_COMMAND_CENTER = GUI_COMMAND_SPECIAL_POWER_FROM_SHORTCUT, // /< Legacy name
211+ #endif
212+ GUI_COMMAND_SPECIAL_POWER_CONSTRUCT, // /< do a special power using the construct building interface
213+ GUI_COMMAND_SPECIAL_POWER_CONSTRUCT_FROM_SHORTCUT, // /< do a shortcut special power using the construct building interface
214+
215+ GUI_COMMAND_SELECT_ALL_UNITS_OF_TYPE,
203216
204217 // add more commands here, don't forget to update the string command list below too ...
205218
@@ -241,11 +254,19 @@ static const char *const TheGuiCommandNames[] =
241254 " SWITCH_WEAPON" ,
242255 " HIJACK_VEHICLE" ,
243256 " CONVERT_TO_CARBOMB" ,
257+ " SABOTAGE_BUILDING" ,
244258#ifdef ALLOW_SURRENDER
245259 " PICK_UP_PRISONER" ,
246260#endif
247261 " PLACE_BEACON" ,
248- " SPECIAL_POWER_FROM_COMMAND_CENTER" ,
262+ #if RTS_GENERALS
263+ " SPECIAL_POWER_FROM_COMMAND_CENTER" , // /< Legacy name
264+ #else
265+ " SPECIAL_POWER_FROM_SHORTCUT" ,
266+ #endif
267+ " SPECIAL_POWER_CONSTRUCT" ,
268+ " SPECIAL_POWER_CONSTRUCT_FROM_SHORTCUT" ,
269+ " SELECT_ALL_UNITS_OF_TYPE" ,
249270
250271 nullptr
251272};
@@ -386,16 +407,16 @@ class CommandButton : public Overridable
386407/* * Command sets are collections of configurable command buttons. They are used in the
387408 * command context sensitive window in the battle user interface */
388409// -------------------------------------------------------------------------------------------------
389- enum { MAX_COMMANDS_PER_SET = 12 }; // user interface max button limit for commands
410+ enum { MAX_COMMANDS_PER_SET = 18 }; // user interface max is 14 (but internally it's 18 for script only buttons!)
390411enum { MAX_RIGHT_HUD_UPGRADE_CAMEOS = 5 };
391412enum {
392- MAX_PURCHASE_SCIENCE_RANK_1 = 3 ,
393- MAX_PURCHASE_SCIENCE_RANK_3 = 12 ,
394- MAX_PURCHASE_SCIENCE_RANK_8 = 1 ,
413+ MAX_PURCHASE_SCIENCE_RANK_1 = 4 ,
414+ MAX_PURCHASE_SCIENCE_RANK_3 = 15 ,
415+ MAX_PURCHASE_SCIENCE_RANK_8 = 4 ,
395416 };
396417enum { MAX_STRUCTURE_INVENTORY_BUTTONS = 10 }; // there are this many physical buttons in "inventory" windows for structures
397418enum { MAX_BUILD_QUEUE_BUTTONS = 9 };// physical button count for the build queue
398- enum { MAX_SPECIAL_POWER_SHORTCUTS = 5 };
419+ enum { MAX_SPECIAL_POWER_SHORTCUTS = 11 };
399420class CommandSet : public Overridable
400421{
401422
@@ -760,6 +781,11 @@ class ControlBar : public SubsystemInterface
760781 void initSpecialPowershortcutBar ( Player *player);
761782
762783 void triggerRadarAttackGlow ();
784+
785+ void drawSpecialPowerShortcutMultiplierText ();
786+
787+ Bool hasAnyShortcutSelection () const ;
788+
763789protected:
764790 void updateRadarAttackGlow ();
765791
@@ -824,7 +850,7 @@ class ControlBar : public SubsystemInterface
824850 static void populateInvDataCallback ( Object *obj, void *userData );
825851
826852 // the following methods are for updating the currently showing context
827- CommandAvailability getCommandAvailability ( const CommandButton *command, Object *obj, GameWindow *win, Bool forceDisabledEvaluation = FALSE ) const ;
853+ CommandAvailability getCommandAvailability ( const CommandButton *command, Object *obj, GameWindow *win, GameWindow *applyToWin = nullptr , Bool forceDisabledEvaluation = FALSE ) const ;
828854 void updateContextMultiSelect ();
829855 void updateContextPurchaseScience ();
830856 void updateContextCommand ();
@@ -893,6 +919,7 @@ class ControlBar : public SubsystemInterface
893919 GameWindow *m_sciencePurchaseWindowsRank8[ MAX_PURCHASE_SCIENCE_RANK_8 ]; // /< command window controls for easy access
894920 GameWindow *m_specialPowerShortcutButtons[ MAX_SPECIAL_POWER_SHORTCUTS ];
895921 GameWindow *m_specialPowerShortcutButtonParents[ MAX_SPECIAL_POWER_SHORTCUTS ];
922+ DisplayString *m_shortcutDisplayStrings[ MAX_SPECIAL_POWER_SHORTCUTS ];
896923 Int m_currentlyUsedSpecialPowersButtons; // /< Value will be <= MAX_SPECIAL_POWER_SHORTCUTS;
897924
898925
0 commit comments