use of mage.client.util.gui.MageDialogState in project mage by magefree.
the class ReplayTask method getChoice.
public void getChoice(GameView gameView, Map<String, Serializable> options, Choice choice, UUID objectId) {
updateGame(gameView, false, options, null);
hideAll();
DialogManager.getManager(gameId).fadeOut();
// TODO: remember last choices and search incremental for same events?
PickChoiceDialog pickChoice = new PickChoiceDialog();
pickChoice.showDialog(choice, null, objectId, choiceWindowState, bigCard);
// special mode adds # to the answer (server side code must process that prefix, see replacementEffectChoice)
String specialPrefix = choice.isChosenSpecial() ? "#" : "";
String valueToSend;
if (choice.isKeyChoice()) {
valueToSend = choice.getChoiceKey();
} else {
valueToSend = choice.getChoice();
}
SessionHandler.sendPlayerString(gameId, valueToSend == null ? null : specialPrefix + valueToSend);
// keep dialog position
choiceWindowState = new MageDialogState(pickChoice);
pickChoice.removeDialog();
}
Aggregations