Class MinimapHexPicker
java.lang.Object
megamek.client.ui.dialogs.BotCommands.MinimapHexPicker
Lets the player pick the hexes for a bot order by clicking them on a map with no full board view, such as the
Commander window's minimap. It works like
HexTargetPicker does on the board: clicked hexes are marked and
numbered on the map, clicking a marked hex again unmarks it, and a small dialog lists them with Done and Cancel. A
one-hex order finishes on the first click. Picking is cancelled if the game phase changes.
The picked hexes go out as dash-joined hex numbers, e.g. 1508-1504, the same text the typed prompt
sends.
-
Constructor Summary
ConstructorsConstructorDescriptionMinimapHexPicker(HexPickingMap map, IGame game, String orderDescription, boolean singleHex, int maxHexes, Consumer<String> onTargetsSelected) -
Method Summary
Modifier and TypeMethodDescriptionvoidstart()Starts picking: listens for clicks on the map and shows the Done / Cancel dialog.
-
Constructor Details
-
MinimapHexPicker
public MinimapHexPicker(HexPickingMap map, IGame game, String orderDescription, boolean singleHex, int maxHexes, Consumer<String> onTargetsSelected) - Parameters:
map- the map to pick hexes ongame- the game, watched so a phase change cancels the pickorderDescription- what the order is, shown in the dialogsingleHex-trueto finish after the first hexmaxHexes- the most hexes that may be picked, or 0 for no limitonTargetsSelected- called with the picked hexes as dash-joined hex numbers, only if any were picked and the player chose Done
-
-
Method Details
-
start
public void start()Starts picking: listens for clicks on the map and shows the Done / Cancel dialog.
-