fa icon indicating copy to clipboard operation
fa copied to clipboard

Allow Hotbuild to redirect orders to exfac units like the buttons do

Open gordenwunderlich opened this issue 2 years ago • 5 comments

https://github.com/FAForever/fa/assets/7266458/38e0c0c2-219e-415b-ba32-ba24ee881ef9

should work for both normal and alternate hotbuild (templates not yet)

Needs more testing since I just quickly copied the code from @clyfordv but I wanted to at least put this out there.

gordenwunderlich avatar Nov 10 '23 15:11 gordenwunderlich

@4z0t can you take the time to review this? I generally do not use hotkeys

Garanas avatar Dec 19 '23 17:12 Garanas

@4z0t I moved the filter code to a different function, that also fixes the issue of declaring the local twice. Should I put the part with if exFacUnits then into a separate function as well? It feels kinda weird to hide the simple if behind another function call.

gordenwunderlich avatar Jan 07 '24 21:01 gordenwunderlich

There's no need to write a separate function for that if statement. If you can apply the Pascal convention to the name of the function today then we can include it with the hotfix

Garanas avatar Jan 08 '24 13:01 Garanas

I changed the name of the new function, though all other functions in that file are still lowerCamelCase

gordenwunderlich avatar Jan 08 '24 14:01 gordenwunderlich

Tested and works. The only thing that does appear to be missing, is that the automatic enabling of repeat build does not work.

To remedy this, you can add categories.EXTERNALFACTORY and/or categories.EXTERNALFACTORYUNIT to line 684 in gamemain.lua. Though this will not solve this problem either, because the code requires you to select the factory for it to change it to repeat build. So if you never select the external factory, it will not have repeat build enabled automatically.

Basilisk3 avatar Mar 19 '24 18:03 Basilisk3