diff --git a/forge-game/src/main/java/forge/game/GameType.java b/forge-game/src/main/java/forge/game/GameType.java index 735f2f7629b..a30d361b1f6 100644 --- a/forge-game/src/main/java/forge/game/GameType.java +++ b/forge-game/src/main/java/forge/game/GameType.java @@ -13,19 +13,19 @@ import forge.game.player.RegisteredPlayer; public enum GameType { // deck composition rules, isPoolRestricted, can sideboard between matches - Sealed (DeckFormat.Limited, true, true, true, "Sealed", null), - Draft (DeckFormat.Limited, true, true, true, "Draft", null), - Winston (DeckFormat.Limited, true, true, true, "Winston", null), - Gauntlet (DeckFormat.Limited, true, true, true, "Gauntlet", null), - Quest (DeckFormat.QuestDeck, true, true, false, "Quest", null), - QuestDraft (DeckFormat.Limited, true, true, true, "Quest Draft", null), - Constructed (DeckFormat.Constructed, false, true, true, "Constructed", null), - Vanguard (DeckFormat.Vanguard, true, true, true, "Vanguard", null), - Commander (DeckFormat.Commander, false, false, false, "Commander", null), - Planechase (DeckFormat.Planechase, false, false, true, "Planechase", null), - Archenemy (DeckFormat.Archenemy, false, false, true, "Archenemy", null), - ArchenemyRumble (DeckFormat.Archenemy, false, false, true, "Archenemy Rumble", null), - MomirBasic (DeckFormat.Constructed, false, false, false, "Momir Basic", new Function() { + Sealed (DeckFormat.Limited, true, true, true, "Sealed", "", null), + Draft (DeckFormat.Limited, true, true, true, "Draft", "", null), + Winston (DeckFormat.Limited, true, true, true, "Winston", "", null), + Gauntlet (DeckFormat.Limited, true, true, true, "Gauntlet", "", null), + Quest (DeckFormat.QuestDeck, true, true, false, "Quest", "", null), + QuestDraft (DeckFormat.Limited, true, true, true, "Quest Draft", "", null), + Constructed (DeckFormat.Constructed, false, true, true, "Constructed", "", null), + Vanguard (DeckFormat.Vanguard, true, true, true, "Vanguard", "Each player has a special \"Avatar\" card that affects the game.", null), + Commander (DeckFormat.Commander, false, false, false, "Commander", "Each player has a legendary \"General\" card which can be cast at any time and determines deck colors.", null), + Planechase (DeckFormat.Planechase, false, false, true, "Planechase", "Plane cards apply global effects. Plane card changed when a player rolls \"Chaos\" on the planar die.", null), + Archenemy (DeckFormat.Archenemy, false, false, true, "Archenemy", "One player is the Archenemy and can play scheme cards.", null), + ArchenemyRumble (DeckFormat.Archenemy, false, false, true, "Archenemy Rumble", "All players are Archenemies and can play scheme cards.", null), + MomirBasic (DeckFormat.Constructed, false, false, false, "Momir Basic", "Each player has a deck containing 60 basic lands and the Momir Vig avatar.", new Function() { @Override public Deck apply(RegisteredPlayer player) { Deck deck = new Deck(); @@ -43,15 +43,16 @@ public enum GameType { private final DeckFormat deckFormat; private final boolean isCardPoolLimited, canSideboard, addWonCardsMidGame; - private final String name; + private final String name, description; private final Function deckAutoGenerator; - GameType(DeckFormat deckFormat0, boolean isCardPoolLimited0, boolean canSideboard0, boolean addWonCardsMidgame0, String name0, Function deckAutoGenerator0) { + GameType(DeckFormat deckFormat0, boolean isCardPoolLimited0, boolean canSideboard0, boolean addWonCardsMidgame0, String name0, String description0, Function deckAutoGenerator0) { deckFormat = deckFormat0; isCardPoolLimited = isCardPoolLimited0; canSideboard = canSideboard0; addWonCardsMidGame = addWonCardsMidgame0; name = name0; + description = description0; deckAutoGenerator = deckAutoGenerator0; } @@ -104,4 +105,8 @@ public enum GameType { public String toString() { return name; } + + public String getDescription() { + return description; + } } diff --git a/forge-gui-desktop/src/main/java/forge/screens/home/sanctioned/VSubmenuConstructed.java b/forge-gui-desktop/src/main/java/forge/screens/home/sanctioned/VSubmenuConstructed.java index d4ea4a8bc94..fc387b3155d 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/home/sanctioned/VSubmenuConstructed.java +++ b/forge-gui-desktop/src/main/java/forge/screens/home/sanctioned/VSubmenuConstructed.java @@ -29,7 +29,6 @@ import forge.screens.home.*; import forge.toolbox.*; import forge.toolbox.FSkin.SkinColor; import forge.toolbox.FSkin.SkinImage; -import forge.util.GuiDisplayUtil; import forge.util.Lang; import forge.util.MyRandom; import forge.util.NameGenerator; @@ -1144,7 +1143,7 @@ public enum VSubmenuConstructed implements IVSubmenu { variantType = variantType0; - setToolTipText(GuiDisplayUtil.getVariantDescription(variantType0)); + setToolTipText(variantType.getDescription()); addItemListener(new ItemListener() { @Override diff --git a/forge-gui-mobile/src/forge/screens/constructed/ConstructedScreen.java b/forge-gui-mobile/src/forge/screens/constructed/ConstructedScreen.java index 8e9afb87fa4..aafc8af6651 100644 --- a/forge-gui-mobile/src/forge/screens/constructed/ConstructedScreen.java +++ b/forge-gui-mobile/src/forge/screens/constructed/ConstructedScreen.java @@ -46,7 +46,6 @@ import forge.toolbox.FOptionPane; import forge.toolbox.FScrollPane; import forge.toolbox.FTextField; import forge.util.Callback; -import forge.util.GuiDisplayUtil; import forge.util.Lang; import forge.util.NameGenerator; import forge.util.Utils; @@ -951,11 +950,9 @@ public class ConstructedScreen extends LaunchScreen { private class Variant { private final GameType gameType; - private final String description; private Variant(GameType gameType0) { gameType = gameType0; - description = GuiDisplayUtil.getVariantDescription(gameType0); } private void draw(Graphics g, FSkinFont font, FSkinColor color, float x, float y, float w, float h) { @@ -1026,7 +1023,7 @@ public class ConstructedScreen extends LaunchScreen { g.drawText(text, font, foreColor, x, y, w, h, false, HAlignment.LEFT, false); value.draw(g, font, foreColor, x, y, w, h); h += SettingsScreen.SETTING_PADDING; - g.drawText(value.description, SettingsScreen.DESC_FONT, SettingsScreen.DESC_COLOR, x, y + h, w, totalHeight - h + w * SettingsScreen.INSETS_FACTOR, true, HAlignment.LEFT, false); + g.drawText(value.gameType.getDescription(), SettingsScreen.DESC_FONT, SettingsScreen.DESC_COLOR, x, y + h, w, totalHeight - h + w * SettingsScreen.INSETS_FACTOR, true, HAlignment.LEFT, false); } } } diff --git a/forge-gui/src/main/java/forge/util/GuiDisplayUtil.java b/forge-gui/src/main/java/forge/util/GuiDisplayUtil.java index b1d79987b58..f30a3279da3 100644 --- a/forge-gui/src/main/java/forge/util/GuiDisplayUtil.java +++ b/forge-gui/src/main/java/forge/util/GuiDisplayUtil.java @@ -519,23 +519,4 @@ public final class GuiDisplayUtil { String playerName = FModel.getPreferences().getPref(FPref.PLAYER_NAME); return text.replaceAll("(?i)human", playerName); } - - public static String getVariantDescription(GameType variant) { - switch (variant) { - case Archenemy: - return "One player is the Archenemy and can play scheme cards."; - case ArchenemyRumble: - return "All players are Archenemies and can play scheme cards."; - case Commander: - return "Each player has a legendary \"General\" card which can be cast at any time and determines deck colors."; - case MomirBasic: - return "Each player has a deck containing 60 basic lands and the Momir Vig avatar."; - case Planechase: - return "Plane cards apply global effects. Plane card changed when a player rolls \"Chaos\" on the planar die."; - case Vanguard: - return "Each player has a special \"Avatar\" card that affects the game."; - default: - return ""; //other game types don't need descriptions - } - } } // end class GuiDisplayUtil