GUI: improved choose creature type dialog - important creature types added to the start of the list and marked as my/opponent (closes #8478)

This commit is contained in:
Oleg Agafonov 2024-07-19 03:17:53 +04:00
parent 7b2e9b390c
commit a974af3c61
41 changed files with 239 additions and 138 deletions

View file

@ -547,6 +547,7 @@ public class HumanPlayer extends PlayerImpl {
while (canRespond()) {
prepareForResponse(game);
if (!isExecutingMacro()) {
replacementEffectChoice.onChooseStart(game, playerId);
game.fireChooseChoiceEvent(playerId, replacementEffectChoice);
}
waitForResponse(game);
@ -571,6 +572,7 @@ public class HumanPlayer extends PlayerImpl {
int index = 0;
for (String key : effectsMap.keySet()) {
if (replacementEffectChoice.getChoiceKey().equals(key)) {
replacementEffectChoice.onChooseEnd(game, playerId, replacementEffectChoice.getChoiceKey());
return index;
}
index++;
@ -624,6 +626,7 @@ public class HumanPlayer extends PlayerImpl {
while (canRespond()) {
prepareForResponse(game);
if (!isExecutingMacro()) {
choice.onChooseStart(game, playerId);
game.fireChooseChoiceEvent(playerId, choice);
}
waitForResponse(game);
@ -635,9 +638,11 @@ public class HumanPlayer extends PlayerImpl {
} else {
choice.setChoice(val);
}
choice.onChooseEnd(game, playerId, val);
return true;
} else if (!choice.isRequired()) {
// cancel
choice.onChooseEnd(game, playerId, null);
return false;
}
}