New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-add hotkey label for attack move #6010
Conversation
lua/keymap/hotkeylabels.lua
Outdated
@@ -113,6 +113,12 @@ function getKeyTables() | |||
local upgradeKey = false | |||
local orderKeys = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too familiar with this file, but you can add it to the definition here too. The key attack_move
is oddly specific, where does that reference to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same as in the helpText
in this table of OrderInfo
s
Lines 1133 to 1174 in 31772f0
local defaultOrdersTable = { | |
-- Common rules | |
AttackMove = { helpText = "attack_move", bitmapId = 'attack_move', preferredSlot = 1, behavior = AttackMoveBehavior}, | |
RULEUCC_Move = { helpText = "move", bitmapId = 'move', preferredSlot = 2, behavior = StandardOrderBehavior}, | |
RULEUCC_Attack = { helpText = "attack", bitmapId = 'attack', preferredSlot = 3, behavior = AttackOrderBehavior, initialStateFunc = AttackOrderInit}, | |
RULEUCC_Patrol = { helpText = "patrol", bitmapId = 'patrol', preferredSlot = 4, behavior = StandardOrderBehavior}, | |
RULEUCC_Stop = { helpText = "stop", bitmapId = 'stop', preferredSlot = 5, behavior = StopOrderBehavior}, | |
RULEUCC_Guard = { helpText = "assist", bitmapId = 'guard', preferredSlot = 6, behavior = StandardOrderBehavior}, | |
RULEUCC_RetaliateToggle = { helpText = "mode", bitmapId = 'stand-ground', preferredSlot = 7, behavior = RetaliateOrderBehavior, initialStateFunc = RetaliateInitFunction}, | |
-- Unit specific rules | |
RULEUCC_Overcharge = { helpText = "overcharge", bitmapId = 'overcharge', preferredSlot = 8, behavior = OverchargeBehavior, initialStateFunc = OverchargeInit, onframe = OverchargeFrame}, | |
RULEUCC_SiloBuildTactical = { helpText = "build_tactical", bitmapId = 'silo-build-tactical', preferredSlot = 9, behavior = BuildOrderBehavior, initialStateFunc = BuildInitFunction}, | |
RULEUCC_SiloBuildNuke = { helpText = "build_nuke", bitmapId = 'silo-build-nuke', preferredSlot = 9, behavior = BuildOrderBehavior, initialStateFunc = BuildInitFunction}, | |
RULEUCC_Script = { helpText = "special_action", bitmapId = 'overcharge', preferredSlot = 8, behavior = StandardOrderBehavior}, | |
RULEUCC_Transport = { helpText = "transport", bitmapId = 'unload', preferredSlot = 9, behavior = TransportOrderBehavior}, | |
RULEUCC_Nuke = { helpText = "fire_nuke", bitmapId = 'launch-nuke', preferredSlot = 10, behavior = StandardOrderBehavior, ButtonTextFunc = NukeBtnText}, | |
RULEUCC_Tactical = { helpText = "fire_tactical", bitmapId = 'launch-tactical', preferredSlot = 10, behavior = StandardOrderBehavior, ButtonTextFunc = TacticalBtnText}, | |
RULEUCC_Teleport = { helpText = "teleport", bitmapId = 'teleport', preferredSlot = 10, behavior = StandardOrderBehavior}, | |
RULEUCC_Ferry = { helpText = "ferry", bitmapId = 'ferry', preferredSlot = 10, behavior = StandardOrderBehavior}, | |
RULEUCC_Sacrifice = { helpText = "sacrifice", bitmapId = 'sacrifice', preferredSlot = 10, behavior = StandardOrderBehavior}, | |
RULEUCC_Dive = { helpText = "dive", bitmapId = 'dive', preferredSlot = 11, behavior = DiveOrderBehavior, initialStateFunc = DiveInitFunction}, | |
RULEUCC_Reclaim = { helpText = "reclaim", bitmapId = 'reclaim', preferredSlot = 12, behavior = StandardOrderBehavior}, | |
RULEUCC_Capture = { helpText = "capture", bitmapId = 'convert', preferredSlot = 13, behavior = StandardOrderBehavior}, | |
RULEUCC_Repair = { helpText = "repair", bitmapId = 'repair', preferredSlot = 14, behavior = StandardOrderBehavior}, | |
RULEUCC_Dock = { helpText = "dock", bitmapId = 'dock', preferredSlot = 14, behavior = DockOrderBehavior}, | |
DroneL = { helpText = "drone", bitmapId = 'unload02', preferredSlot = 10, behavior = DroneBehavior, initialStateFunc = DroneInit}, | |
DroneR = { helpText = "drone", bitmapId = 'unload02', preferredSlot = 11, behavior = DroneBehavior, initialStateFunc = DroneInit}, | |
ExFac = { helpText = "external_factory", bitmapId = 'exfac', preferredSlot = 10, behavior = ExternalFactoryBehavior}, | |
-- Unit toggle rules | |
RULEUTC_ShieldToggle = { helpText = "toggle_shield", bitmapId = 'shield', preferredSlot = 8, behavior = ScriptButtonOrderBehavior, initialStateFunc = ScriptButtonInitFunction, extraInfo = 0}, | |
RULEUTC_WeaponToggle = { helpText = "toggle_weapon", bitmapId = 'toggle-weapon', preferredSlot = 8, behavior = ScriptButtonOrderBehavior, initialStateFunc = ScriptButtonInitFunction, extraInfo = 1}, | |
RULEUTC_JammingToggle = { helpText = "toggle_jamming", bitmapId = 'jamming', preferredSlot = 9, behavior = ScriptButtonOrderBehavior, initialStateFunc = ScriptButtonInitFunction, extraInfo = 2}, | |
RULEUTC_IntelToggle = { helpText = "toggle_intel", bitmapId = 'intel', preferredSlot = 9, behavior = ScriptButtonOrderBehavior, initialStateFunc = ScriptButtonInitFunction, extraInfo = 3}, | |
RULEUTC_ProductionToggle = { helpText = "toggle_production", bitmapId = 'production', preferredSlot = 10, behavior = ScriptButtonOrderBehavior, initialStateFunc = ScriptButtonInitFunction, extraInfo = 4}, | |
RULEUTC_StealthToggle = { helpText = "toggle_stealth", bitmapId = 'stealth', preferredSlot = 10, behavior = ScriptButtonOrderBehavior, initialStateFunc = ScriptButtonInitFunction, extraInfo = 5}, | |
RULEUTC_GenericToggle = { helpText = "toggle_generic", bitmapId = 'production', preferredSlot = 11, behavior = ScriptButtonOrderBehavior, initialStateFunc = ScriptButtonInitFunction, extraInfo = 6}, | |
RULEUTC_SpecialToggle = { helpText = "toggle_special", bitmapId = 'activate-weapon', preferredSlot = 12, behavior = ScriptButtonOrderBehavior, initialStateFunc = ScriptButtonInitFunction, extraInfo = 7}, | |
RULEUTC_CloakToggle = { helpText = "toggle_cloak", bitmapId = 'intel-counter', preferredSlot = 12, behavior = ScriptButtonOrderBehavior, initialStateFunc = ScriptButtonInitFunction, extraInfo = 8}, | |
} |
because the label is retrieved with that as the key:
Lines 1323 to 1326 in 31772f0
-- Handle Hotbuild labels | |
if orderKeys[orderInfo.helpText] then | |
hotkeyLabel_addLabel(checkbox, checkbox, orderKeys[orderInfo.helpText]) | |
end |
Description of the proposed changes
Closes #5597. Alt + RMB is a special case of a keybind that needs to be manually assigned a text and color in the hotkey labels. This was removed in a refactoring a long time ago 545f16a, and this re-adds that.
Checklist