mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
- Show the puzzle description in a pop-up dialog window when the puzzle starts.
This commit is contained in:
@@ -90,6 +90,7 @@ public enum CSubmenuPuzzleSolve implements ICDoc, IMenuProvider {
|
|||||||
@Override
|
@Override
|
||||||
public final void run() {
|
public final void run() {
|
||||||
selected.applyToGame(hostedMatch.getGame());
|
selected.applyToGame(hostedMatch.getGame());
|
||||||
|
SOptionPane.showMessageDialog(selected.getGoalDescription(), selected.getName(), SOptionPane.INFORMATION_ICON);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import forge.screens.LaunchScreen;
|
|||||||
import forge.screens.LoadingOverlay;
|
import forge.screens.LoadingOverlay;
|
||||||
import forge.screens.home.NewGameMenu;
|
import forge.screens.home.NewGameMenu;
|
||||||
import forge.toolbox.FLabel;
|
import forge.toolbox.FLabel;
|
||||||
|
import forge.toolbox.FOptionPane;
|
||||||
import forge.toolbox.FTextArea;
|
import forge.toolbox.FTextArea;
|
||||||
import forge.toolbox.GuiChoose;
|
import forge.toolbox.GuiChoose;
|
||||||
import forge.util.Callback;
|
import forge.util.Callback;
|
||||||
@@ -79,6 +80,7 @@ public class PuzzleScreen extends LaunchScreen {
|
|||||||
GameRules rules = new GameRules(GameType.Puzzle);
|
GameRules rules = new GameRules(GameType.Puzzle);
|
||||||
rules.setGamesPerMatch(1);
|
rules.setGamesPerMatch(1);
|
||||||
hostedMatch.startMatch(rules, null, players, human, GuiBase.getInterface().getNewGuiGame());
|
hostedMatch.startMatch(rules, null, players, human, GuiBase.getInterface().getNewGuiGame());
|
||||||
|
FOptionPane.showMessageDialog(chosen.getGoalDescription(), chosen.getName());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class Puzzle extends GameState implements InventoryItem, Comparable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getGoalDescription() {
|
public String getGoalDescription() {
|
||||||
StringBuilder desc = new StringBuilder();
|
StringBuilder desc = new StringBuilder();
|
||||||
|
|
||||||
String name = this.name == null ? "Unnamed Puzzle" : this.name;
|
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) {
|
if (this.description != null) {
|
||||||
desc.append("\n\n");
|
desc.append("\n\n");
|
||||||
desc.append(this.description);
|
desc.append(this.description.replace("\\n", "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return desc.toString();
|
return desc.toString();
|
||||||
|
|||||||
Reference in New Issue
Block a user