Skip to content
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

Merged
merged 5 commits into from Mar 23, 2024

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Mar 20, 2024

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.
image

Checklist

  • Changes are annotated, including comments where useful
  • Changes are documented in the changelog for the next game version

@lL1l1 lL1l1 added the area: ui Anything to do with the User Interface of the Game label Mar 20, 2024
@@ -113,6 +113,12 @@ function getKeyTables()
local upgradeKey = false
local orderKeys = {}
Copy link
Member

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?

Copy link
Contributor Author

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 OrderInfos

fa/lua/ui/game/orders.lua

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:

fa/lua/ui/game/orders.lua

Lines 1323 to 1326 in 31772f0

-- Handle Hotbuild labels
if orderKeys[orderInfo.helpText] then
hotkeyLabel_addLabel(checkbox, checkbox, orderKeys[orderInfo.helpText])
end

@Garanas Garanas merged commit 15648e6 into FAForever:deploy/fafdevelop Mar 23, 2024
@lL1l1 lL1l1 deleted the UI/alt+rmb branch April 1, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ui Anything to do with the User Interface of the Game
Projects
None yet
Development

Successfully merging this pull request may close these issues.

There is no hotkey label for the AttackMove order
2 participants