Adds a new Squad Selection widget for creating and managing squads of units#8045
Adds a new Squad Selection widget for creating and managing squads of units#8045MadeByGabe wants to merge 5 commits into
Conversation
db283a9 to
e189cd0
Compare
|
I would:
|
And I should close this PR until that's merged, or just remove the hotkey binds and make a PR for the binds after both are merged? |
I guess removing hot key binds should work, so this one can get the review in the meantime |
e189cd0 to
33fe9a3
Compare
I made a separate PR for the FactoryQ Manager but I kept the meta+[0-9] hotkeys because even though there is conflict, the FactoryQ Manager is off by default so it shouldn't cause issues. |
Adds unit_squad_selection.lua: automagical squad creation and proximity-based selection. Effectively inert by default. Included: options panel integration, i18n strings, and some default keybinds num_keys.txt: default Meta+[0-9] / Shift+Meta+[0-9] squad_select_group binds,
c09746c to
b87a018
Compare
…options An onchange that did widgetHandler:Enable/DisableWidget and then called init() inline would read the pre-toggle state since Enable/DisableWidget are deferred. The result was for example that changing keybinds to grid would show/hide the grid sub-options one action late. (Change to legacy -> you see grid options. Change back to grid -> you don't see the grid options) If the newly added scheduleInit flag is set, the options rebuild is deferred to the next frame which allows reading the correct state of the widgets.
|
I split up the widget into 3 parts: Hull visualization is a companion widget now. That was a good idea and it was already possible anyway, we even have two more companion widgets for visualization though none of them are feature complete yet. I split off the utility functions into a separate file. I technically could split off even the core squad logic but I decided against that because in my opinion that would hurt the maintainability of the widget. I also improved type annotations though there were some issues so it's not perfect but I don't think perfect is possible currently. Finally I fixed a bug in the options panel. I maybe should make a separate PR for that and I will do that if requested. I didn't do it now because that bug only affects the keyboard layout and the grid menu options and those are not very important. |
Work done
Adds a new Squad Selection widget for creating and managing squads of units, plus the keybinds and options it needs.
This widget is fairly big with lots of features. There is a website that demos most features with short videoclips but I think it's better to just try it out with as much information as the average player would have after reading a short changelog. An example changelog below.
But first some notes:
ctrl+left-click). So players won't even notice the widget is on unless they intentionally use it (which could happen by accident but is unlikely).Included keybind change: The FactoryQ Manager load hotkeys (
Meta+[0-9]) conflict with the Squad Selection select group hotkeys. #8047 fixes this by adding a new action to the FactoryQ Manager that accepts the load hotkeys only when the preset panel is open.Test steps
Sorry but exhaustive step-by-step testing isn't practical for a widget this interaction heavy. The example changelog below is a good starting point for testing.
An example changelog for the widget could be:
Added a new widget that allows players to create and manage squads of units.
Note: most units the factories make already belong to a reserve squad assigned to that factory.
I'm not sure what's the process of getting this merged, I assume it's going to be difficult because it's a huge change but I tried to do my best to make it as good as possible.
This widget is already used by a few dozen players and most of its features have been tested for months (except the
right-click-drag move-orders, those are unit control features...).AI / LLM usage statement:
Everything related to this widget was assisted by Claude Code. It also wrote some of the code, either by transforming my pseudocode/drafts or by implementing decision matrices I made. Everything was reviewed and tested by me for weeks/months.
Links:
Feature demonstration website (Please try the widget out first as if you were an average player because the demos are confusing, it's difficult to demo selection features in videos):
https://bar-stuff.madebygabe.dev/squad-selection
(Relevant Discord thread: https://discord.com/channels/549281623154229250/1483283773939257344)
The features that weren't mentioned in the changelog above:
The features that weren't mentioned in the changelog above can be tried out with these example binds. Technically these could be added to the default binds but I think it's better to let players experience the basic features first.