Integrate Advanced Key Actions
Allows you to create key actions based on selected units' category.
CategoryMatcher("Enter OC mode / Transport / Toggle repeat build")
{
CategoryAction(), -- do nothing if no selection
CategoryAction(categories.TRANSPORTATION)
:Action "StartCommandMode order RULEUCC_Transport",
CategoryAction(categories.COMMAND + categories.SUBCOMMANDER)
:Action(import('/lua/ui/game/orders.lua').EnterOverchargeMode),
CategoryAction(categories.FACTORY * categories.STRUCTURE)
:Action(import("/lua/keymap/misckeyactions.lua").ToggleRepeatBuild)
}
@4z0t there's a hiccup in this implementation, if you rename the actions then the old actions 'linger' in the key actions menu:
Wouldn't it be better to support the standard syntax instead?
@Garanas this is because old ones are still present in your prefs file.
I understand that, but that is because we manually add the key. If it is present in the 'standard way' then this behavior does not happen.
The key is made of description, there is no point in adding second string that will represent key in this table, it will only make it more complex for modders to use.
And this also happens when mod adds it's own keyactions and then being removed, so, combined actions add nothing new in this behaviour.
What is new is that it is now in the repository. If we'd, for example, update one of the combined actions with one more additional action we'll also need to update the description. At that point, all players will have a lingering, not functioning hotkey in their preference file.
@Garanas I think this should keep simplicity and at the same time be strict enough for main repo
You're not addressing the issue. A lingering, not-functioning hotkey is confusing for everyone involved.
How are you going to fix it? Clear all of them from prefs file? What if there are custom ones and people wanna keep them? And I'm not gonna fix it in this PR either.