Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Princess configuration #3041

Merged
merged 13 commits into from
Aug 3, 2021
Merged

Princess configuration #3041

merged 13 commits into from
Aug 3, 2021

Conversation

SJuliez
Copy link
Member

@SJuliez SJuliez commented Aug 2, 2021

  • Modernizes the Bot Config Dialog
  • Princess Presets now only care about the 5 behavior sliders (technically, the rest is saved too, but when selecting a Preset only the five slider values are pulled). The other settings are scenario specific and don't feel like they belong to a "Behavior Preset"
  • When adding a bot, the Configuration (<- that means all settings, including prio targets) of already existing local bots (= those added through the Add Bot button in the lobby) can be copied; they are offered at the bottom of the presets list (see screenshots)
  • Princess Configurations are saved in savegames; they can be recalled by the new Replace Players Dialog; When this is opened all stored configs are used to preselect and preconfigure Princess bots. If no changes are wanted, it's basically sufficient to press OK after calling up the dialog and all previously existing bots will be restored
  • When reinstating bots in the lobby, they are local bots and fully configurable
  • Hex and unit targets are now shown with some more info to them. Units can be added in the lobby from the main unit list. For both there's a dialog to enter them somewhat conveniently. Duplicate entries are avoided.

Resolves #2986
Resolves #2958
Resolves #2853

image
image
image

Copy link
Member

@NickAragua NickAragua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor nitpicks, looks pretty good otherwise.

coordsList.setCellRenderer(new BuildingHexRenderer());
coordsList.setFont(UIUtil.getScaledFont());
coordsList.setVisibleRowCount(6);
coordsList.setPrototypeCellValue(new Coords(-21, 22));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a little specific.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean the prototype cell value, that's only passed to the renderer to get the cell size when the list is empty. This prevents it from changing size when it goes from empty to containing items (the changed size doesn't appear directly, only when resizing the dialog, but then it looks a little silly)

private static JMenu prioTargetMenu(ClientGUI cg, boolean enabled, ActionListener listener,
Collection<Entity> entities) {

JMenu menu = new JMenu("Set Prio Target for");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure that we have enough bits that we can spell "Priority" fully.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, done

@HammerGS
Copy link
Member

HammerGS commented Aug 3, 2021

Just a comment from the forums that might be applicable here.

https://bg.battletech.com/forums/megamek-games/princess-settings-popup-tooltip-vs-help/

@NickAragua NickAragua merged commit d97cea6 into MegaMek:master Aug 3, 2021
@SJuliez SJuliez deleted the botconfig branch December 26, 2021 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants