mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
fixing couter-logical defaultNo parameter
This commit is contained in:
@@ -562,7 +562,7 @@ public final class GameActionUtil {
|
||||
* @return a boolean.
|
||||
*/
|
||||
public static boolean showYesNoDialog(final Card c, final String question) {
|
||||
return GameActionUtil.showYesNoDialog(c, question, false);
|
||||
return GameActionUtil.showYesNoDialog(c, question, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -578,7 +578,7 @@ public final class GameActionUtil {
|
||||
* true if the default option should be "No", false otherwise
|
||||
* @return a boolean.
|
||||
*/
|
||||
public static boolean showYesNoDialog(final Card c, String question, final boolean defaultNo) {
|
||||
public static boolean showYesNoDialog(final Card c, String question, final boolean defaultChoice) {
|
||||
CMatchUI.SINGLETON_INSTANCE.setCard(c);
|
||||
final StringBuilder title = new StringBuilder();
|
||||
title.append(c.getName()).append(" - Ability");
|
||||
@@ -588,7 +588,7 @@ public final class GameActionUtil {
|
||||
}
|
||||
|
||||
int answer;
|
||||
if (defaultNo) {
|
||||
if (!defaultChoice) {
|
||||
final Object[] options = { "Yes", "No" };
|
||||
answer = JOptionPane.showOptionDialog(null, question, title.toString(), JOptionPane.YES_NO_OPTION,
|
||||
JOptionPane.PLAIN_MESSAGE, null, options, options[1]);
|
||||
|
||||
@@ -144,18 +144,18 @@ public class Untap extends Phase implements java.io.Serializable {
|
||||
if (c.isTapped()) {
|
||||
if (c.getController().isHuman()) {
|
||||
String prompt = "Untap " + c.getName() + "?";
|
||||
boolean defaultNo = false;
|
||||
boolean defaultChoice = true;
|
||||
if (c.getGainControlTargets().size() > 0) {
|
||||
final ArrayList<Card> targets = c.getGainControlTargets();
|
||||
prompt += "\r\n" + c + " is controlling: ";
|
||||
for (final Card target : targets) {
|
||||
prompt += target;
|
||||
if (AllZoneUtil.isCardInPlay(target)) {
|
||||
defaultNo |= true;
|
||||
defaultChoice = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (GameActionUtil.showYesNoDialog(c, prompt, defaultNo)) {
|
||||
if (GameActionUtil.showYesNoDialog(c, prompt, defaultChoice)) {
|
||||
c.untap();
|
||||
}
|
||||
} else { // computer
|
||||
|
||||
Reference in New Issue
Block a user