- Show the puzzle description in a pop-up dialog window when the puzzle starts.

This commit is contained in:
Agetian
2017-07-27 04:29:28 +00:00
parent acfdf23c22
commit 26f50d109a
3 changed files with 5 additions and 2 deletions

View File

@@ -90,6 +90,7 @@ public enum CSubmenuPuzzleSolve implements ICDoc, IMenuProvider {
@Override
public final void run() {
selected.applyToGame(hostedMatch.getGame());
SOptionPane.showMessageDialog(selected.getGoalDescription(), selected.getName(), SOptionPane.INFORMATION_ICON);
}
});

View File

@@ -14,6 +14,7 @@ import forge.screens.LaunchScreen;
import forge.screens.LoadingOverlay;
import forge.screens.home.NewGameMenu;
import forge.toolbox.FLabel;
import forge.toolbox.FOptionPane;
import forge.toolbox.FTextArea;
import forge.toolbox.GuiChoose;
import forge.util.Callback;
@@ -79,6 +80,7 @@ public class PuzzleScreen extends LaunchScreen {
GameRules rules = new GameRules(GameType.Puzzle);
rules.setGamesPerMatch(1);
hostedMatch.startMatch(rules, null, players, human, GuiBase.getInterface().getNewGuiGame());
FOptionPane.showMessageDialog(chosen.getGoalDescription(), chosen.getName());
}
});
}

View File

@@ -48,7 +48,7 @@ public class Puzzle extends GameState implements InventoryItem, Comparable {
}
}
private String getGoalDescription() {
public String getGoalDescription() {
StringBuilder desc = new StringBuilder();
String name = this.name == null ? "Unnamed Puzzle" : this.name;
@@ -66,7 +66,7 @@ public class Puzzle extends GameState implements InventoryItem, Comparable {
if (this.description != null) {
desc.append("\n\n");
desc.append(this.description);
desc.append(this.description.replace("\\n", "\n"));
}
return desc.toString();