mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
disbanded 'constant' class from game
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -247,7 +247,6 @@ forge-game/.settings/org.eclipse.jdt.core.prefs -text
|
|||||||
forge-game/.settings/org.eclipse.m2e.core.prefs -text
|
forge-game/.settings/org.eclipse.m2e.core.prefs -text
|
||||||
forge-game/pom.xml -text
|
forge-game/pom.xml -text
|
||||||
forge-game/src/main/java/forge/Command.java svneol=native#text/plain
|
forge-game/src/main/java/forge/Command.java svneol=native#text/plain
|
||||||
forge-game/src/main/java/forge/Constant.java svneol=native#text/plain
|
|
||||||
forge-game/src/main/java/forge/ImageKeys.java -text
|
forge-game/src/main/java/forge/ImageKeys.java -text
|
||||||
forge-game/src/main/java/forge/game/CardTraitBase.java -text
|
forge-game/src/main/java/forge/game/CardTraitBase.java -text
|
||||||
forge-game/src/main/java/forge/game/Game.java -text
|
forge-game/src/main/java/forge/game/Game.java -text
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* Forge: Play Magic: the Gathering.
|
|
||||||
* Copyright (C) 2011 Forge Team
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package forge;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Constant interface.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author Forge
|
|
||||||
* @version $Id$
|
|
||||||
*/
|
|
||||||
public final class Constant {
|
|
||||||
// used to pass information between the GUI screens
|
|
||||||
/**
|
|
||||||
* The Class Runtime.
|
|
||||||
*/
|
|
||||||
public static class Preferences {
|
|
||||||
/** The Constant DevMode. */
|
|
||||||
// one for normal mode, one for quest mode
|
|
||||||
public static boolean DEV_MODE;
|
|
||||||
/** The Constant UpldDrft. */
|
|
||||||
public static boolean UPLOAD_DRAFT;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Runtime {
|
|
||||||
/** The Constant NetConn. */
|
|
||||||
public static volatile boolean NET_CONN = false;
|
|
||||||
|
|
||||||
/** The Constant width. */
|
|
||||||
public static final int WIDTH = 300;
|
|
||||||
|
|
||||||
/** The Constant height. */
|
|
||||||
public static final int HEIGHT = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Interface Keywords.
|
|
||||||
*/
|
|
||||||
public static class Keywords {
|
|
||||||
|
|
||||||
/** The loaded. */
|
|
||||||
public static final boolean[] LOADED = { false };
|
|
||||||
|
|
||||||
/** The Non stacking list. */
|
|
||||||
public static final List<String> NON_STACKING_LIST = new ArrayList<String>();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // Constant
|
|
||||||
|
|
||||||
|
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
package forge.game.card;
|
package forge.game.card;
|
||||||
|
|
||||||
import forge.Constant;
|
|
||||||
import forge.ImageKeys;
|
import forge.ImageKeys;
|
||||||
import forge.card.CardCharacteristicName;
|
import forge.card.CardCharacteristicName;
|
||||||
import forge.card.ColorSet;
|
import forge.card.ColorSet;
|
||||||
@@ -40,6 +39,8 @@ public final class CardUtil {
|
|||||||
// disable instantiation
|
// disable instantiation
|
||||||
private CardUtil() { }
|
private CardUtil() { }
|
||||||
|
|
||||||
|
public static final List<String> NON_STACKING_LIST = new ArrayList<String>();
|
||||||
|
|
||||||
public static ColorSet getColors(final Card c) {
|
public static ColorSet getColors(final Card c) {
|
||||||
return c.determineColor();
|
return c.determineColor();
|
||||||
}
|
}
|
||||||
@@ -51,7 +52,7 @@ public final class CardUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return !kw.startsWith("Protection") && !kw.startsWith("CantBeBlockedBy")
|
return !kw.startsWith("Protection") && !kw.startsWith("CantBeBlockedBy")
|
||||||
&& !Constant.Keywords.NON_STACKING_LIST.contains(kw);
|
&& !NON_STACKING_LIST.contains(kw);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getShortColorsString(final Iterable<String> colors) {
|
public static String getShortColorsString(final Iterable<String> colors) {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
package forge.control;
|
package forge.control;
|
||||||
|
|
||||||
import forge.Constant.Preferences;
|
|
||||||
import forge.FThreads;
|
import forge.FThreads;
|
||||||
import forge.ImageCache;
|
import forge.ImageCache;
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
@@ -492,7 +491,7 @@ public enum FControl implements KeyEventDispatcher {
|
|||||||
|
|
||||||
|
|
||||||
for (final VField field : VMatchUI.SINGLETON_INSTANCE.getFieldViews()) {
|
for (final VField field : VMatchUI.SINGLETON_INSTANCE.getFieldViews()) {
|
||||||
field.getDetailsPanel().getLblLibrary().setHoverable(Preferences.DEV_MODE);
|
field.getDetailsPanel().getLblLibrary().setHoverable(ForgePreferences.DEV_MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// per player observers were set in CMatchUI.SINGLETON_INSTANCE.initMatch
|
// per player observers were set in CMatchUI.SINGLETON_INSTANCE.initMatch
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package forge.gui.home.settings;
|
package forge.gui.home.settings;
|
||||||
|
|
||||||
import forge.Command;
|
import forge.Command;
|
||||||
import forge.Constant.Preferences;
|
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.ai.AiProfileUtil;
|
import forge.ai.AiProfileUtil;
|
||||||
import forge.control.FControl.CloseAction;
|
import forge.control.FControl.CloseAction;
|
||||||
@@ -55,7 +54,7 @@ public enum CSubmenuPreferences implements ICDoc {
|
|||||||
public void itemStateChanged(final ItemEvent arg0) {
|
public void itemStateChanged(final ItemEvent arg0) {
|
||||||
final boolean toggle = view.getCbDevMode().isSelected();
|
final boolean toggle = view.getCbDevMode().isSelected();
|
||||||
prefs.setPref(FPref.DEV_MODE_ENABLED, String.valueOf(toggle));
|
prefs.setPref(FPref.DEV_MODE_ENABLED, String.valueOf(toggle));
|
||||||
Preferences.DEV_MODE = toggle;
|
ForgePreferences.DEV_MODE = toggle;
|
||||||
prefs.save();
|
prefs.save();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
package forge.gui.match.controllers;
|
package forge.gui.match.controllers;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
|
|
||||||
import forge.Command;
|
import forge.Command;
|
||||||
import forge.Constant.Preferences;
|
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
@@ -34,6 +34,7 @@ import forge.gui.input.InputPayMana;
|
|||||||
import forge.gui.match.ZoneAction;
|
import forge.gui.match.ZoneAction;
|
||||||
import forge.gui.match.views.VField;
|
import forge.gui.match.views.VField;
|
||||||
import forge.gui.player.HumanPlay;
|
import forge.gui.player.HumanPlay;
|
||||||
|
import forge.properties.ForgePreferences;
|
||||||
|
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
@@ -72,7 +73,7 @@ public class CField implements ICDoc {
|
|||||||
ZoneAction handAction = new ZoneAction(player.getZone(ZoneType.Hand), MatchConstants.HUMANHAND) {
|
ZoneAction handAction = new ZoneAction(player.getZone(ZoneType.Hand), MatchConstants.HUMANHAND) {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if ( player.getLobbyPlayer() == viewer || Preferences.DEV_MODE || player.hasKeyword("Play with your hand revealed."))
|
if ( player.getLobbyPlayer() == viewer || ForgePreferences.DEV_MODE || player.hasKeyword("Play with your hand revealed."))
|
||||||
super.actionPerformed(e);
|
super.actionPerformed(e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -80,7 +81,7 @@ public class CField implements ICDoc {
|
|||||||
ZoneAction libraryAction = new ZoneAction(player.getZone(ZoneType.Library), MatchConstants.HUMANLIBRARY) {
|
ZoneAction libraryAction = new ZoneAction(player.getZone(ZoneType.Library), MatchConstants.HUMANLIBRARY) {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (Preferences.DEV_MODE)
|
if (ForgePreferences.DEV_MODE)
|
||||||
super.actionPerformed(e);
|
super.actionPerformed(e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package forge.gui.player;
|
package forge.gui.player;
|
||||||
|
|
||||||
import forge.Constant.Preferences;
|
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.player.LobbyPlayer;
|
import forge.game.player.LobbyPlayer;
|
||||||
@@ -8,6 +7,7 @@ import forge.game.player.Player;
|
|||||||
import forge.game.player.PlayerController;
|
import forge.game.player.PlayerController;
|
||||||
import forge.gui.FNetOverlay;
|
import forge.gui.FNetOverlay;
|
||||||
import forge.gui.GuiDisplayUtil;
|
import forge.gui.GuiDisplayUtil;
|
||||||
|
import forge.properties.ForgePreferences;
|
||||||
import forge.properties.ForgePreferences.FPref;
|
import forge.properties.ForgePreferences.FPref;
|
||||||
|
|
||||||
public class LobbyPlayerHuman extends LobbyPlayer {
|
public class LobbyPlayerHuman extends LobbyPlayer {
|
||||||
@@ -30,7 +30,7 @@ public class LobbyPlayerHuman extends LobbyPlayer {
|
|||||||
Player player = new Player(GuiDisplayUtil.personalizeHuman(getName()), game);
|
Player player = new Player(GuiDisplayUtil.personalizeHuman(getName()), game);
|
||||||
player.setFirstController(new PlayerControllerHuman(game, player, this));
|
player.setFirstController(new PlayerControllerHuman(game, player, this));
|
||||||
|
|
||||||
if( Preferences.DEV_MODE && Singletons.getModel().getPreferences().getPrefBoolean(FPref.DEV_UNLIMITED_LAND))
|
if( ForgePreferences.DEV_MODE && Singletons.getModel().getPreferences().getPrefBoolean(FPref.DEV_UNLIMITED_LAND))
|
||||||
player.canCheatPlayUnlimitedLands = true;
|
player.canCheatPlayUnlimitedLands = true;
|
||||||
|
|
||||||
return player;
|
return player;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package forge.gui.toolbox.special;
|
package forge.gui.toolbox.special;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import forge.Constant.Preferences;
|
|
||||||
import forge.card.MagicColor;
|
import forge.card.MagicColor;
|
||||||
import forge.game.mana.ManaPool;
|
import forge.game.mana.ManaPool;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
@@ -12,10 +12,13 @@ import forge.gui.toolbox.FLabel;
|
|||||||
import forge.gui.toolbox.FSkin;
|
import forge.gui.toolbox.FSkin;
|
||||||
import forge.gui.toolbox.FSkin.SkinProp;
|
import forge.gui.toolbox.FSkin.SkinProp;
|
||||||
import forge.gui.toolbox.FSkin.SkinnedPanel;
|
import forge.gui.toolbox.FSkin.SkinnedPanel;
|
||||||
|
import forge.properties.ForgePreferences;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
@@ -210,7 +213,7 @@ public class PlayerDetailsPanel extends JPanel {
|
|||||||
lblExile.setHoverable(true);
|
lblExile.setHoverable(true);
|
||||||
lblExile.addMouseListener(new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { exileAction.actionPerformed(null); } } );
|
lblExile.addMouseListener(new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { exileAction.actionPerformed(null); } } );
|
||||||
|
|
||||||
if (Preferences.DEV_MODE) {
|
if (ForgePreferences.DEV_MODE) {
|
||||||
lblLibrary.setHoverable(true);
|
lblLibrary.setHoverable(true);
|
||||||
lblLibrary.addMouseListener(new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { libraryAction.actionPerformed(null); } } );
|
lblLibrary.addMouseListener(new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { libraryAction.actionPerformed(null); } } );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
package forge.limited;
|
package forge.limited;
|
||||||
|
|
||||||
import com.google.common.base.Supplier;
|
import com.google.common.base.Supplier;
|
||||||
import forge.Constant.Preferences;
|
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.card.CardEdition;
|
import forge.card.CardEdition;
|
||||||
import forge.card.IUnOpenedProduct;
|
import forge.card.IUnOpenedProduct;
|
||||||
@@ -32,11 +32,13 @@ import forge.item.IPaperCard;
|
|||||||
import forge.item.PaperCard;
|
import forge.item.PaperCard;
|
||||||
import forge.item.SealedProduct;
|
import forge.item.SealedProduct;
|
||||||
import forge.model.CardBlock;
|
import forge.model.CardBlock;
|
||||||
|
import forge.properties.ForgePreferences;
|
||||||
import forge.properties.NewConstants;
|
import forge.properties.NewConstants;
|
||||||
import forge.util.FileUtil;
|
import forge.util.FileUtil;
|
||||||
import forge.util.HttpUtil;
|
import forge.util.HttpUtil;
|
||||||
import forge.util.ItemPool;
|
import forge.util.ItemPool;
|
||||||
import forge.util.storage.IStorage;
|
import forge.util.storage.IStorage;
|
||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -313,7 +315,7 @@ public final class BoosterDraft implements IBoosterDraft {
|
|||||||
+ " - booster pack = " + thisBooster);
|
+ " - booster pack = " + thisBooster);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Preferences.UPLOAD_DRAFT) {
|
if (ForgePreferences.UPLOAD_DRAFT) {
|
||||||
for (int i = 0; i < thisBooster.size(); i++) {
|
for (int i = 0; i < thisBooster.size(); i++) {
|
||||||
final PaperCard cc = thisBooster.get(i);
|
final PaperCard cc = thisBooster.get(i);
|
||||||
final String cnBk = cc.getName() + "|" + cc.getEdition();
|
final String cnBk = cc.getName() + "|" + cc.getEdition();
|
||||||
@@ -345,7 +347,7 @@ public final class BoosterDraft implements IBoosterDraft {
|
|||||||
/** This will upload drafting picks to cardforge HQ. */
|
/** This will upload drafting picks to cardforge HQ. */
|
||||||
@Override
|
@Override
|
||||||
public void finishedDrafting() {
|
public void finishedDrafting() {
|
||||||
if (!Preferences.UPLOAD_DRAFT || 1 >= draftPicks.size()) {
|
if (!ForgePreferences.UPLOAD_DRAFT || 1 >= draftPicks.size()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,11 +17,12 @@
|
|||||||
*/
|
*/
|
||||||
package forge.limited;
|
package forge.limited;
|
||||||
|
|
||||||
import forge.Constant.Preferences;
|
|
||||||
import forge.card.ColorSet;
|
import forge.card.ColorSet;
|
||||||
import forge.deck.Deck;
|
import forge.deck.Deck;
|
||||||
import forge.item.PaperCard;
|
import forge.item.PaperCard;
|
||||||
|
import forge.properties.ForgePreferences;
|
||||||
import forge.util.Aggregates;
|
import forge.util.Aggregates;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.MutablePair;
|
import org.apache.commons.lang3.tuple.MutablePair;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
@@ -66,7 +67,7 @@ public class BoosterDraftAI {
|
|||||||
* @return a {@link forge.CardList} object.
|
* @return a {@link forge.CardList} object.
|
||||||
*/
|
*/
|
||||||
public PaperCard choose(final List<PaperCard> chooseFrom, final int player) {
|
public PaperCard choose(final List<PaperCard> chooseFrom, final int player) {
|
||||||
if (Preferences.DEV_MODE) {
|
if (ForgePreferences.DEV_MODE) {
|
||||||
System.out.println("Player[" + player + "] pack: " + chooseFrom.toString());
|
System.out.println("Player[" + player + "] pack: " + chooseFrom.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,7 +154,7 @@ public class BoosterDraftAI {
|
|||||||
final Deck[] out = new Deck[this.deck.size()];
|
final Deck[] out = new Deck[this.deck.size()];
|
||||||
|
|
||||||
for (int i = 0; i < this.deck.size(); i++) {
|
for (int i = 0; i < this.deck.size(); i++) {
|
||||||
if (Preferences.DEV_MODE) {
|
if (ForgePreferences.DEV_MODE) {
|
||||||
System.out.println("Deck[" + i + "]");
|
System.out.println("Deck[" + i + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,12 @@
|
|||||||
*/
|
*/
|
||||||
package forge.model;
|
package forge.model;
|
||||||
|
|
||||||
import forge.Constant;
|
|
||||||
import forge.Constant.Preferences;
|
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.ai.AiProfileUtil;
|
import forge.ai.AiProfileUtil;
|
||||||
import forge.card.CardType;
|
import forge.card.CardType;
|
||||||
import forge.error.ExceptionHandler;
|
import forge.error.ExceptionHandler;
|
||||||
import forge.game.GameFormat;
|
import forge.game.GameFormat;
|
||||||
|
import forge.game.card.CardUtil;
|
||||||
import forge.gauntlet.GauntletData;
|
import forge.gauntlet.GauntletData;
|
||||||
import forge.limited.GauntletMini;
|
import forge.limited.GauntletMini;
|
||||||
import forge.properties.ForgePreferences;
|
import forge.properties.ForgePreferences;
|
||||||
@@ -140,7 +139,7 @@ public class FModel {
|
|||||||
this.fantasyBlocks = new StorageBase<CardBlock>("Custom blocks", new CardBlock.Reader("res/blockdata/fantasyblocks.txt", Singletons.getMagicDb().getEditions()));
|
this.fantasyBlocks = new StorageBase<CardBlock>("Custom blocks", new CardBlock.Reader("res/blockdata/fantasyblocks.txt", Singletons.getMagicDb().getEditions()));
|
||||||
this.worlds = new StorageBase<QuestWorld>("Quest worlds", new QuestWorld.Reader("res/quest/world/worlds.txt"));
|
this.worlds = new StorageBase<QuestWorld>("Quest worlds", new QuestWorld.Reader("res/quest/world/worlds.txt"));
|
||||||
// TODO - there's got to be a better place for this...oblivion?
|
// TODO - there's got to be a better place for this...oblivion?
|
||||||
Preferences.DEV_MODE = this.preferences.getPrefBoolean(FPref.DEV_MODE_ENABLED);
|
ForgePreferences.DEV_MODE = this.preferences.getPrefBoolean(FPref.DEV_MODE_ENABLED);
|
||||||
|
|
||||||
this.loadDynamicGamedata();
|
this.loadDynamicGamedata();
|
||||||
|
|
||||||
@@ -161,6 +160,9 @@ public class FModel {
|
|||||||
return quest;
|
return quest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static boolean KeywordsLoaded = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load dynamic gamedata.
|
* Load dynamic gamedata.
|
||||||
*/
|
*/
|
||||||
@@ -235,17 +237,17 @@ public class FModel {
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Constant.Keywords.LOADED[0]) {
|
if (!KeywordsLoaded) {
|
||||||
final List<String> nskwListFile = FileUtil.readFile(NewConstants.KEYWORD_LIST_FILE);
|
final List<String> nskwListFile = FileUtil.readFile(NewConstants.KEYWORD_LIST_FILE);
|
||||||
|
|
||||||
if (nskwListFile.size() > 1) {
|
if (nskwListFile.size() > 1) {
|
||||||
for (String s : nskwListFile) {
|
for (String s : nskwListFile) {
|
||||||
if (s.length() > 1) {
|
if (s.length() > 1) {
|
||||||
Constant.Keywords.NON_STACKING_LIST.add(s);
|
CardUtil.NON_STACKING_LIST.add(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Constant.Keywords.LOADED[0] = true;
|
KeywordsLoaded = true;
|
||||||
/*
|
/*
|
||||||
* if (Constant.Runtime.DevMode[0]) {
|
* if (Constant.Runtime.DevMode[0]) {
|
||||||
* System.out.println(Constant.Keywords.NonStackingList[0].list); }
|
* System.out.println(Constant.Keywords.NonStackingList[0].list); }
|
||||||
|
|||||||
@@ -17,8 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
package forge.properties;
|
package forge.properties;
|
||||||
|
|
||||||
import forge.Constant;
|
|
||||||
import forge.Constant.Preferences;
|
|
||||||
import forge.ai.AiProfileUtil;
|
import forge.ai.AiProfileUtil;
|
||||||
import forge.control.FControl.CloseAction;
|
import forge.control.FControl.CloseAction;
|
||||||
import forge.game.GameLogEntryType;
|
import forge.game.GameLogEntryType;
|
||||||
@@ -214,6 +212,11 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
|||||||
this.setPref(FPref.DEV_UNLIMITED_LAND, v.getLblUnlimitedLands().getEnabled());
|
this.setPref(FPref.DEV_UNLIMITED_LAND, v.getLblUnlimitedLands().getEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// was not used anywhere else
|
||||||
|
private final boolean NET_CONN = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Needs to be reworked for efficiency with rest of prefs saves in
|
* TODO: Needs to be reworked for efficiency with rest of prefs saves in
|
||||||
* codebase.
|
* codebase.
|
||||||
@@ -221,8 +224,8 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
|||||||
public void actuateMatchPreferences() {
|
public void actuateMatchPreferences() {
|
||||||
final List<VField> fieldViews = VMatchUI.SINGLETON_INSTANCE.getFieldViews();
|
final List<VField> fieldViews = VMatchUI.SINGLETON_INSTANCE.getFieldViews();
|
||||||
|
|
||||||
Preferences.DEV_MODE = this.getPrefBoolean(FPref.DEV_MODE_ENABLED);
|
DEV_MODE = this.getPrefBoolean(FPref.DEV_MODE_ENABLED);
|
||||||
Preferences.UPLOAD_DRAFT = Constant.Runtime.NET_CONN && this.getPrefBoolean(FPref.UI_UPLOAD_DRAFT);
|
UPLOAD_DRAFT = NET_CONN; // && this.getPrefBoolean(FPref.UI_UPLOAD_DRAFT);
|
||||||
|
|
||||||
// AI field is at index [0]
|
// AI field is at index [0]
|
||||||
PhaseIndicator fvAi = fieldViews.get(1).getPhaseIndicator();
|
PhaseIndicator fvAi = fieldViews.get(1).getPhaseIndicator();
|
||||||
@@ -273,4 +276,11 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
|||||||
protected String getPrefDefault(FPref key) {
|
protected String getPrefDefault(FPref key) {
|
||||||
return key.getDefault();
|
return key.getDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** The Constant DevMode. */
|
||||||
|
// one for normal mode, one for quest mode
|
||||||
|
public static boolean DEV_MODE;
|
||||||
|
/** The Constant UpldDrft. */
|
||||||
|
public static boolean UPLOAD_DRAFT;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
package forge.util;
|
package forge.util;
|
||||||
|
|
||||||
import forge.Constant.Preferences;
|
import forge.properties.ForgePreferences;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
@@ -145,7 +145,7 @@ public class HttpUtil {
|
|||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Preferences.DEV_MODE) {
|
if (ForgePreferences.DEV_MODE) {
|
||||||
System.out.println(response.toString());
|
System.out.println(response.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
package forge.view.arcane;
|
package forge.view.arcane;
|
||||||
|
|
||||||
import forge.Constant;
|
|
||||||
import forge.FThreads;
|
import forge.FThreads;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
import forge.gui.match.CMatchUI;
|
import forge.gui.match.CMatchUI;
|
||||||
@@ -59,7 +58,7 @@ public abstract class CardPanelContainer extends SkinnedPanel {
|
|||||||
*/
|
*/
|
||||||
private int cardWidthMin = 50;
|
private int cardWidthMin = 50;
|
||||||
|
|
||||||
private int cardWidthMax = Constant.Runtime.WIDTH;
|
private int cardWidthMax = 300;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user