During certain phases (movement, firing, etc) a StatusPhaseDisplay is used to display buttons for each possible action during that phase. The order of these buttons has changed recently. Different people will want different button orders based on how they play MM, so the best way to handle the situation would be to allow users to specify their own order for buttons.
Added some of this feature in [r11006].
I refactored the code a bit. There is StatusPhaseDisplay, which is a parent class for each phase that has a StatusBar: Movement, Firing, Physical, Targeting, SelectArtyAutoHitHex. Each of these phases then has an enum which defines what commands can be performed in those phases. Currently, these enums were all named Command, I renamed them to be <Phase>Command. I also created a Command interface in StatusPhaseDisplay.
At some point, I plan to move these out to their own classes somewhere in the common package. These really are separate from the UI itself: regardless of what UI we use, these commands (or actions) need to be able to be performed in their respective phase. So, if we have these outside of the UI, different UIs can use the enums to generate UI elements to perform those commands.
Anyways, I also added a priority state variable to each Command type, where the priority determines the order the button appears in the button panel.
Finally, I added a new tab to the client config dialog for button order. Within there is a tab pane that has a tab for each StatusPhaseDisplay, and in the tab is a list that lists all the buttons. The button names can be clicked and dragged to change the ordering, which effects their priority.
This has worked in my testing. What is not implemented yet (and what makes this feature incomplete) is that the orderings are not saved and loaded. Also, orderings won't update the UI if it's already created. Currently, you have to change the ordering and enter the game. Changing ordering in-game has no effect.
Related
Commit: [r11006]
Please fix the tab indentation from that commit. Thanks!
Ok, I'll get it fixed up. So, what happened is that for a while my Eclipse workspace for exp was set to use tabs instead of spaces. So I think there's some amount of tabs that got added because of that. I'll try to get it fixed up as I notice it.
Fixed a number of tab/space issues in [r11008].
Related
Commit: [r11008]
In [r11007] I made some bug fixes to the original commit, and also added code to have the order changes take effect during a game. Next I'll work on saving/loading the orders.
Related
Commit: [r11007]
Added saving/loading of the button order in [r11009].
Related
Commit: [r11009]
The scrolling wasn't working quite right for the button order tab. This is fixed in [r11011]. I think this feature is complete now.
Related
Commit: [r11011]