Don't allow confirm dialog without title

This commit is contained in:
elcnesh
2015-04-02 08:48:12 +00:00
parent c100b90c70
commit 398ef0ac4f
4 changed files with 2 additions and 9 deletions

View File

@@ -64,7 +64,6 @@ public interface IGuiGame {
void showErrorDialog(String message); void showErrorDialog(String message);
void showErrorDialog(String message, String title); void showErrorDialog(String message, String title);
boolean showConfirmDialog(String message);
boolean showConfirmDialog(String message, String title); boolean showConfirmDialog(String message, String title);
boolean showConfirmDialog(String message, String title, boolean defaultYes); boolean showConfirmDialog(String message, String title, boolean defaultYes);
boolean showConfirmDialog(String message, String title, String yesButtonText, String noButtonText); boolean showConfirmDialog(String message, String title, String yesButtonText, String noButtonText);

View File

@@ -616,11 +616,6 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
showErrorDialog(message, "Error"); showErrorDialog(message, "Error");
} }
@Override
public boolean showConfirmDialog(final String message) {
return showConfirmDialog(message, null);
}
@Override @Override
public boolean showConfirmDialog(final String message, final String title) { public boolean showConfirmDialog(final String message, final String title) {
return showConfirmDialog(message, title, true); return showConfirmDialog(message, title, true);

View File

@@ -93,8 +93,7 @@ public class HumanPlay {
final HumanPlaySpellAbility req = new HumanPlaySpellAbility(controller, sa, payment); final HumanPlaySpellAbility req = new HumanPlaySpellAbility(controller, sa, payment);
req.playAbility(true, false, false); req.playAbility(true, false, false);
} } else if (payManaCostIfNeeded(controller, p, sa)) {
else if (payManaCostIfNeeded(controller, p, sa)) {
if (sa.isSpell() && !source.isCopiedSpell()) { if (sa.isSpell() && !source.isCopiedSpell()) {
sa.setHostCard(p.getGame().getAction().moveToStack(source)); sa.setHostCard(p.getGame().getAction().moveToStack(source));
} }

View File

@@ -1453,7 +1453,7 @@ public class PlayerControllerHuman
try { try {
state.initFromGame(game); state.initFromGame(game);
File f = GuiBase.getInterface().getSaveFile(new File(ForgeConstants.USER_GAMES_DIR, "state.txt")); File f = GuiBase.getInterface().getSaveFile(new File(ForgeConstants.USER_GAMES_DIR, "state.txt"));
if (f != null && (!f.exists() || getGui().showConfirmDialog("Overwrite existing file?"))) { if (f != null && (!f.exists() || getGui().showConfirmDialog("Overwrite existing file?", "File exists!"))) {
final BufferedWriter bw = new BufferedWriter(new FileWriter(f)); final BufferedWriter bw = new BufferedWriter(new FileWriter(f));
bw.write(state.toString()); bw.write(state.toString());
bw.close(); bw.close();