FactoryPlanner
FactoryPlanner copied to clipboard
Add context menus for modifier actions
Should definitely do this, very powerful idea. Will require quite the refactor of the whole actions and tutorial tooltip system, which is fine since it’s kinda jank anyways.
Would probably remove the tutorial mode tooltips, both for simplicity and performance. If you want to learn about the shortcuts, they’ll be on the context menu.
This would also make space for more actions, if not every action needs a modifier-click. Less essential features like ‘cut’ could be implemented and just not given a shortcut, if that was the thing preventing it from being added.
Has the issue that right click now always brings up the context menu, and any actions tied to right click must be moved. We’ll see how disruptive this will be, but some habit changes will be needed, can’t be seamless unfortunately.
Additionally, some things that don’t use this system (like alternative subfactory-add-mode) should probably switch to it. It didn’t before because that made the tooltip different than I wanted it to be, but if the tutorial tooltip is removed, that’d be fine.
In that vein, the tooltip could still mention some specific, special modifiers that are very important in addition to the normal left click if desired. This wouldn’t be some system though, but just part of the fixed tooltip string. Would need to make sure it only mentions actions that are possible regardless of context, ideally.
This 'modal dialog lite' functionality could also be used elsewhere, like for example a custom module picker instead of using choose-elem. So I should try to make it somewhat generic to use.
This could go hand in hand with this idea: #47
Should also get rid of tutorial dialog, and place the example factory in preferences.
Features that this could enable:
- ‘cut’ in addition to ‘copy’ and ‘paste’
TODO:
- Rejigger modifier-clicks so right click is always left for context menu
- Make action system work for actions without modifier-click
- Fix dimmer for compact dialog
- Allow disabling menu for context actions
- Remove tutorial tooltip preference and update text to mention context menus
- Convert all gui click handlers with use more than left click to this system
- Flip context menu to the left when location is closer than 300? units to the right edge of the screen
- Consider which new context menu features to add
- Write changelog
- Maybe move tutorial section to the preferences dialog?