mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- New Visual Themes setting to hide or show background image on match screen. Default show.
This commit is contained in:
@@ -1,442 +1,453 @@
|
|||||||
/*
|
/*
|
||||||
* Forge: Play Magic: the Gathering.
|
* Forge: Play Magic: the Gathering.
|
||||||
* Copyright (C) 2011 Forge Team
|
* Copyright (C) 2011 Forge Team
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package forge.control;
|
package forge.control;
|
||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.event.ComponentAdapter;
|
import java.awt.event.ComponentAdapter;
|
||||||
import java.awt.event.ComponentEvent;
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.awt.event.WindowListener;
|
import java.awt.event.WindowListener;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JLayeredPane;
|
import javax.swing.JLayeredPane;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.WindowConstants;
|
import javax.swing.WindowConstants;
|
||||||
|
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
import forge.Constant.Preferences;
|
import forge.Constant.Preferences;
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.control.KeyboardShortcuts.Shortcut;
|
import forge.control.KeyboardShortcuts.Shortcut;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.player.LobbyPlayer;
|
import forge.game.player.LobbyPlayer;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.gui.GuiDialog;
|
import forge.gui.GuiDialog;
|
||||||
import forge.gui.SOverlayUtils;
|
import forge.gui.SOverlayUtils;
|
||||||
import forge.gui.deckeditor.CDeckEditorUI;
|
import forge.gui.deckeditor.CDeckEditorUI;
|
||||||
import forge.gui.deckeditor.VDeckEditorUI;
|
import forge.gui.deckeditor.VDeckEditorUI;
|
||||||
import forge.gui.framework.EDocID;
|
import forge.gui.framework.EDocID;
|
||||||
import forge.gui.framework.InvalidLayoutFileException;
|
import forge.gui.framework.InvalidLayoutFileException;
|
||||||
import forge.gui.framework.SDisplayUtil;
|
import forge.gui.framework.SDisplayUtil;
|
||||||
import forge.gui.framework.SLayoutIO;
|
import forge.gui.framework.SLayoutIO;
|
||||||
import forge.gui.framework.SOverflowUtil;
|
import forge.gui.framework.SOverflowUtil;
|
||||||
import forge.gui.framework.SResizingUtil;
|
import forge.gui.framework.SResizingUtil;
|
||||||
import forge.gui.home.CHomeUI;
|
import forge.gui.home.CHomeUI;
|
||||||
import forge.gui.home.VHomeUI;
|
import forge.gui.home.VHomeUI;
|
||||||
import forge.gui.match.CMatchUI;
|
import forge.gui.match.CMatchUI;
|
||||||
import forge.gui.match.VMatchUI;
|
import forge.gui.match.VMatchUI;
|
||||||
import forge.gui.match.controllers.CDock;
|
import forge.gui.match.controllers.CDock;
|
||||||
import forge.gui.match.controllers.CLog;
|
import forge.gui.match.controllers.CLog;
|
||||||
import forge.gui.match.controllers.CMessage;
|
import forge.gui.match.controllers.CMessage;
|
||||||
import forge.gui.match.controllers.CStack;
|
import forge.gui.match.controllers.CStack;
|
||||||
import forge.gui.match.nonsingleton.VField;
|
import forge.gui.match.nonsingleton.VField;
|
||||||
import forge.gui.match.views.VAntes;
|
import forge.gui.match.views.VAntes;
|
||||||
import forge.gui.toolbox.FSkin;
|
import forge.gui.toolbox.FSkin;
|
||||||
import forge.net.NetServer;
|
import forge.net.NetServer;
|
||||||
import forge.properties.NewConstants;
|
import forge.properties.ForgePreferences.FPref;
|
||||||
import forge.quest.data.QuestPreferences.QPref;
|
import forge.properties.NewConstants;
|
||||||
import forge.quest.io.QuestDataIO;
|
import forge.quest.data.QuestPreferences.QPref;
|
||||||
import forge.sound.SoundSystem;
|
import forge.quest.io.QuestDataIO;
|
||||||
import forge.view.FView;
|
import forge.sound.SoundSystem;
|
||||||
|
import forge.view.FView;
|
||||||
/**
|
|
||||||
* <p>
|
/**
|
||||||
* FControl.
|
* <p>
|
||||||
* </p>
|
* FControl.
|
||||||
* Controls all Forge UI functionality inside one JFrame. This class switches
|
* </p>
|
||||||
* between various display states in that JFrame. Controllers are instantiated
|
* Controls all Forge UI functionality inside one JFrame. This class switches
|
||||||
* separately by each state's top level view class.
|
* between various display states in that JFrame. Controllers are instantiated
|
||||||
*/
|
* separately by each state's top level view class.
|
||||||
public enum FControl {
|
*/
|
||||||
instance;
|
public enum FControl {
|
||||||
|
instance;
|
||||||
private List<Shortcut> shortcuts;
|
|
||||||
private JLayeredPane display;
|
private List<Shortcut> shortcuts;
|
||||||
private Screens state = Screens.UNKNOWN;
|
private JLayeredPane display;
|
||||||
|
private Screens state = Screens.UNKNOWN;
|
||||||
private WindowListener waDefault, waConcede, waLeaveBazaar, waLeaveEditor;
|
|
||||||
|
private WindowListener waDefault, waConcede, waLeaveBazaar, waLeaveEditor;
|
||||||
public static enum Screens {
|
|
||||||
UNKNOWN,
|
public static enum Screens {
|
||||||
HOME_SCREEN,
|
UNKNOWN,
|
||||||
MATCH_SCREEN,
|
HOME_SCREEN,
|
||||||
DECK_EDITOR_CONSTRUCTED,
|
MATCH_SCREEN,
|
||||||
QUEST_BAZAAR,
|
DECK_EDITOR_CONSTRUCTED,
|
||||||
DECK_EDITOR_LIMITED,
|
QUEST_BAZAAR,
|
||||||
DECK_EDITOR_QUEST,
|
DECK_EDITOR_LIMITED,
|
||||||
QUEST_CARD_SHOP,
|
DECK_EDITOR_QUEST,
|
||||||
DRAFTING_PROCESS
|
QUEST_CARD_SHOP,
|
||||||
}
|
DRAFTING_PROCESS
|
||||||
|
}
|
||||||
private final SoundSystem soundSystem = new SoundSystem();
|
|
||||||
|
private final SoundSystem soundSystem = new SoundSystem();
|
||||||
/**
|
|
||||||
* <p>
|
/**
|
||||||
* FControl.
|
* <p>
|
||||||
* </p>
|
* FControl.
|
||||||
* Controls all Forge UI functionality inside one JFrame. This class
|
* </p>
|
||||||
* switches between various display states in that JFrame. Controllers are
|
* Controls all Forge UI functionality inside one JFrame. This class
|
||||||
* instantiated separately by each state's top level view class.
|
* switches between various display states in that JFrame. Controllers are
|
||||||
*/
|
* instantiated separately by each state's top level view class.
|
||||||
private FControl() {
|
*/
|
||||||
this.waDefault = new WindowAdapter() {
|
private FControl() {
|
||||||
@Override
|
this.waDefault = new WindowAdapter() {
|
||||||
public void windowClosing(final WindowEvent e) {
|
@Override
|
||||||
Singletons.getView().getFrame().setDefaultCloseOperation(
|
public void windowClosing(final WindowEvent e) {
|
||||||
WindowConstants.EXIT_ON_CLOSE);
|
Singletons.getView().getFrame().setDefaultCloseOperation(
|
||||||
|
WindowConstants.EXIT_ON_CLOSE);
|
||||||
System.exit(0);
|
|
||||||
}
|
System.exit(0);
|
||||||
};
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// "Close" button override during match
|
|
||||||
this.waConcede = new WindowAdapter() {
|
// "Close" button override during match
|
||||||
@Override
|
this.waConcede = new WindowAdapter() {
|
||||||
public void windowClosing(final WindowEvent e) {
|
@Override
|
||||||
Singletons.getView().getFrame().setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
public void windowClosing(final WindowEvent e) {
|
||||||
|
Singletons.getView().getFrame().setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||||
if (!FControl.this.game.isGameOver())
|
|
||||||
stopGame();
|
if (!FControl.this.game.isGameOver())
|
||||||
else {
|
stopGame();
|
||||||
Singletons.getControl().changeState(FControl.Screens.HOME_SCREEN);
|
else {
|
||||||
SOverlayUtils.hideOverlay();
|
Singletons.getControl().changeState(FControl.Screens.HOME_SCREEN);
|
||||||
}
|
SOverlayUtils.hideOverlay();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
};
|
||||||
// "Close" button override while inside bazaar (will probably be used later for other things)
|
|
||||||
this.waLeaveBazaar = new WindowAdapter() {
|
// "Close" button override while inside bazaar (will probably be used later for other things)
|
||||||
@Override
|
this.waLeaveBazaar = new WindowAdapter() {
|
||||||
public void windowClosing(final WindowEvent e) {
|
@Override
|
||||||
Singletons.getView().getFrame().setDefaultCloseOperation(
|
public void windowClosing(final WindowEvent e) {
|
||||||
WindowConstants.DO_NOTHING_ON_CLOSE);
|
Singletons.getView().getFrame().setDefaultCloseOperation(
|
||||||
|
WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||||
changeState(Screens.HOME_SCREEN);
|
|
||||||
}
|
changeState(Screens.HOME_SCREEN);
|
||||||
};
|
}
|
||||||
|
};
|
||||||
this.waLeaveEditor = new WindowAdapter() {
|
|
||||||
@Override
|
this.waLeaveEditor = new WindowAdapter() {
|
||||||
public void windowClosing(final WindowEvent ev) {
|
@Override
|
||||||
Singletons.getView().getFrame().setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
public void windowClosing(final WindowEvent ev) {
|
||||||
|
Singletons.getView().getFrame().setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||||
if (CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController().exit()) {
|
|
||||||
changeState(Screens.HOME_SCREEN);
|
if (CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController().exit()) {
|
||||||
}
|
changeState(Screens.HOME_SCREEN);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
};
|
||||||
|
}
|
||||||
/** After view and model have been initialized, control can start.
|
|
||||||
* @param isHeadlessMode */
|
/** After view and model have been initialized, control can start.
|
||||||
public void initialize() {
|
* @param isHeadlessMode */
|
||||||
// Preloads skin components (using progress bar).
|
public void initialize() {
|
||||||
FSkin.loadFull();
|
// Preloads skin components (using progress bar).
|
||||||
|
FSkin.loadFull();
|
||||||
//This must be done here or at least between the skin being loaded and any FTabbedPanes being created.
|
|
||||||
//Why,Swing? Why is this not a property of JTabbbedPane?
|
//This must be done here or at least between the skin being loaded and any FTabbedPanes being created.
|
||||||
UIManager.put("TabbedPane.selected", FSkin.getColor(FSkin.Colors.CLR_ACTIVE));
|
//Why,Swing? Why is this not a property of JTabbbedPane?
|
||||||
UIManager.put("TabbedPane.contentOpaque", FSkin.getColor(FSkin.Colors.CLR_THEME));
|
UIManager.put("TabbedPane.selected", FSkin.getColor(FSkin.Colors.CLR_ACTIVE));
|
||||||
UIManager.put("TabbedPane.unselectedBackground", FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
UIManager.put("TabbedPane.contentOpaque", FSkin.getColor(FSkin.Colors.CLR_THEME));
|
||||||
|
UIManager.put("TabbedPane.unselectedBackground", FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||||
this.shortcuts = KeyboardShortcuts.attachKeyboardShortcuts();
|
|
||||||
this.display = FView.SINGLETON_INSTANCE.getLpnDocument();
|
this.shortcuts = KeyboardShortcuts.attachKeyboardShortcuts();
|
||||||
|
this.display = FView.SINGLETON_INSTANCE.getLpnDocument();
|
||||||
FSkin.setProgessBarMessage("About to load current quest.");
|
|
||||||
// Preload quest data if present
|
FSkin.setProgessBarMessage("About to load current quest.");
|
||||||
final File dirQuests = new File(NewConstants.QUEST_SAVE_DIR);
|
// Preload quest data if present
|
||||||
final String questname = Singletons.getModel().getQuestPreferences().getPref(QPref.CURRENT_QUEST);
|
final File dirQuests = new File(NewConstants.QUEST_SAVE_DIR);
|
||||||
final File data = new File(dirQuests.getPath(), questname);
|
final String questname = Singletons.getModel().getQuestPreferences().getPref(QPref.CURRENT_QUEST);
|
||||||
if (data.exists()) {
|
final File data = new File(dirQuests.getPath(), questname);
|
||||||
Singletons.getModel().getQuest().load(QuestDataIO.loadData(data));
|
if (data.exists()) {
|
||||||
}
|
Singletons.getModel().getQuest().load(QuestDataIO.loadData(data));
|
||||||
|
}
|
||||||
// Handles resizing in null layouts of layers in JLayeredPane.
|
|
||||||
Singletons.getView().getFrame().addComponentListener(new ComponentAdapter() {
|
// Handles resizing in null layouts of layers in JLayeredPane.
|
||||||
@Override
|
Singletons.getView().getFrame().addComponentListener(new ComponentAdapter() {
|
||||||
public void componentResized(final ComponentEvent e) {
|
@Override
|
||||||
sizeChildren();
|
public void componentResized(final ComponentEvent e) {
|
||||||
}
|
sizeChildren();
|
||||||
});
|
}
|
||||||
|
});
|
||||||
FView.SINGLETON_INSTANCE.getLpnDocument().addMouseListener(SOverflowUtil.getHideOverflowListener());
|
|
||||||
FView.SINGLETON_INSTANCE.getLpnDocument().addComponentListener(SResizingUtil.getWindowResizeListener());
|
FView.SINGLETON_INSTANCE.getLpnDocument().addMouseListener(SOverflowUtil.getHideOverflowListener());
|
||||||
|
FView.SINGLETON_INSTANCE.getLpnDocument().addComponentListener(SResizingUtil.getWindowResizeListener());
|
||||||
FSkin.setProgessBarMessage("Opening main window...");
|
|
||||||
SwingUtilities.invokeLater(new Runnable() { @Override
|
FSkin.setProgessBarMessage("Opening main window...");
|
||||||
public void run() { Singletons.getView().initialize(); } });
|
SwingUtilities.invokeLater(new Runnable() { @Override
|
||||||
}
|
public void run() { Singletons.getView().initialize(); } });
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Switches between display states in top level JFrame.
|
/**
|
||||||
*/
|
* Switches between display states in top level JFrame.
|
||||||
public void changeState(Screens screen) {
|
*/
|
||||||
clearChildren(JLayeredPane.DEFAULT_LAYER);
|
public void changeState(Screens screen) {
|
||||||
this.state = screen;
|
clearChildren(JLayeredPane.DEFAULT_LAYER);
|
||||||
|
this.state = screen;
|
||||||
Singletons.getView().getFrame().removeWindowListener(waDefault);
|
|
||||||
Singletons.getView().getFrame().removeWindowListener(waConcede);
|
Singletons.getView().getFrame().removeWindowListener(waDefault);
|
||||||
Singletons.getView().getFrame().removeWindowListener(waLeaveBazaar);
|
Singletons.getView().getFrame().removeWindowListener(waConcede);
|
||||||
Singletons.getView().getFrame().removeWindowListener(waLeaveEditor);
|
Singletons.getView().getFrame().removeWindowListener(waLeaveBazaar);
|
||||||
|
Singletons.getView().getFrame().removeWindowListener(waLeaveEditor);
|
||||||
// Fire up new state
|
|
||||||
switch (screen) {
|
// Fire up new state
|
||||||
case HOME_SCREEN:
|
switch (screen) {
|
||||||
SOverlayUtils.hideTargetingOverlay();
|
case HOME_SCREEN:
|
||||||
VHomeUI.SINGLETON_INSTANCE.populate();
|
SOverlayUtils.hideTargetingOverlay();
|
||||||
CHomeUI.SINGLETON_INSTANCE.initialize();
|
VHomeUI.SINGLETON_INSTANCE.populate();
|
||||||
FView.SINGLETON_INSTANCE.getPnlInsets().setVisible(true);
|
CHomeUI.SINGLETON_INSTANCE.initialize();
|
||||||
FView.SINGLETON_INSTANCE.getPnlInsets().setForegroundImage(new ImageIcon());
|
FView.SINGLETON_INSTANCE.getPnlInsets().setVisible(true);
|
||||||
Singletons.getView().getFrame().addWindowListener(waDefault);
|
FView.SINGLETON_INSTANCE.getPnlInsets().setForegroundImage(new ImageIcon());
|
||||||
break;
|
Singletons.getView().getFrame().addWindowListener(waDefault);
|
||||||
|
break;
|
||||||
case MATCH_SCREEN:
|
|
||||||
VMatchUI.SINGLETON_INSTANCE.populate();
|
case MATCH_SCREEN:
|
||||||
FView.SINGLETON_INSTANCE.getPnlInsets().setVisible(true);
|
VMatchUI.SINGLETON_INSTANCE.populate();
|
||||||
FView.SINGLETON_INSTANCE.getPnlInsets().setForegroundImage(FSkin.getIcon(FSkin.Backgrounds.BG_MATCH));
|
FView.SINGLETON_INSTANCE.getPnlInsets().setVisible(true);
|
||||||
Singletons.getView().getFrame().addWindowListener(waConcede);
|
showMatchBackgroundImage();
|
||||||
SOverlayUtils.showTargetingOverlay();
|
Singletons.getView().getFrame().addWindowListener(waConcede);
|
||||||
break;
|
SOverlayUtils.showTargetingOverlay();
|
||||||
|
break;
|
||||||
case DECK_EDITOR_CONSTRUCTED:
|
|
||||||
case DECK_EDITOR_LIMITED:
|
case DECK_EDITOR_CONSTRUCTED:
|
||||||
case DECK_EDITOR_QUEST:
|
case DECK_EDITOR_LIMITED:
|
||||||
case QUEST_CARD_SHOP:
|
case DECK_EDITOR_QUEST:
|
||||||
case DRAFTING_PROCESS:
|
case QUEST_CARD_SHOP:
|
||||||
SOverlayUtils.hideTargetingOverlay();
|
case DRAFTING_PROCESS:
|
||||||
VDeckEditorUI.SINGLETON_INSTANCE.populate();
|
SOverlayUtils.hideTargetingOverlay();
|
||||||
FView.SINGLETON_INSTANCE.getPnlInsets().setVisible(true);
|
VDeckEditorUI.SINGLETON_INSTANCE.populate();
|
||||||
FView.SINGLETON_INSTANCE.getPnlInsets().setForegroundImage(new ImageIcon());
|
FView.SINGLETON_INSTANCE.getPnlInsets().setVisible(true);
|
||||||
Singletons.getView().getFrame().addWindowListener(waLeaveEditor);
|
FView.SINGLETON_INSTANCE.getPnlInsets().setForegroundImage(new ImageIcon());
|
||||||
break;
|
Singletons.getView().getFrame().addWindowListener(waLeaveEditor);
|
||||||
|
break;
|
||||||
case QUEST_BAZAAR:
|
|
||||||
SOverlayUtils.hideTargetingOverlay();
|
case QUEST_BAZAAR:
|
||||||
display.add(Singletons.getView().getViewBazaar(), JLayeredPane.DEFAULT_LAYER);
|
SOverlayUtils.hideTargetingOverlay();
|
||||||
FView.SINGLETON_INSTANCE.getPnlInsets().setVisible(false);
|
display.add(Singletons.getView().getViewBazaar(), JLayeredPane.DEFAULT_LAYER);
|
||||||
sizeChildren();
|
FView.SINGLETON_INSTANCE.getPnlInsets().setVisible(false);
|
||||||
Singletons.getView().getFrame().addWindowListener(waLeaveBazaar);
|
sizeChildren();
|
||||||
break;
|
Singletons.getView().getFrame().addWindowListener(waLeaveBazaar);
|
||||||
|
break;
|
||||||
default:
|
|
||||||
throw new RuntimeException("unhandled screen: " + screen);
|
default:
|
||||||
}
|
throw new RuntimeException("unhandled screen: " + screen);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public void changeStateAutoFixLayout(Screens newState, String stateName) {
|
|
||||||
try {
|
private void showMatchBackgroundImage() {
|
||||||
changeState(newState);
|
if (isMatchBackgroundImageVisible()) {
|
||||||
} catch (InvalidLayoutFileException ex) {
|
FView.SINGLETON_INSTANCE.getPnlInsets().setForegroundImage(FSkin.getIcon(FSkin.Backgrounds.BG_MATCH));
|
||||||
GuiDialog.message("Your " + stateName + " layout file could not be read. It will be deleted after you press OK.\nThe game will proceed with default layout.");
|
}
|
||||||
File fLayout = new File(SLayoutIO.getFilePreferred(newState));
|
}
|
||||||
fLayout.delete();
|
|
||||||
// try again
|
private boolean isMatchBackgroundImageVisible() {
|
||||||
changeState(newState);
|
return Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_MATCH_IMAGE_VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public void changeStateAutoFixLayout(Screens newState, String stateName) {
|
||||||
/**
|
try {
|
||||||
* Returns the int reflecting the current state of the top level frame
|
changeState(newState);
|
||||||
* (see field definitions and class methods for details).
|
} catch (InvalidLayoutFileException ex) {
|
||||||
*
|
GuiDialog.message("Your " + stateName + " layout file could not be read. It will be deleted after you press OK.\nThe game will proceed with default layout.");
|
||||||
* @return {@link java.lang.Integer}
|
File fLayout = new File(SLayoutIO.getFilePreferred(newState));
|
||||||
* */
|
fLayout.delete();
|
||||||
public Screens getState() {
|
// try again
|
||||||
return this.state;
|
changeState(newState);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/** @return List<Shortcut> A list of attached keyboard shortcut descriptions and properties. */
|
|
||||||
public List<Shortcut> getShortcuts() {
|
/**
|
||||||
return this.shortcuts;
|
* Returns the int reflecting the current state of the top level frame
|
||||||
}
|
* (see field definitions and class methods for details).
|
||||||
|
*
|
||||||
/** Remove all children from a specified layer. */
|
* @return {@link java.lang.Integer}
|
||||||
private void clearChildren(final int layer0) {
|
* */
|
||||||
final Component[] children = FView.SINGLETON_INSTANCE.getLpnDocument()
|
public Screens getState() {
|
||||||
.getComponentsInLayer(layer0);
|
return this.state;
|
||||||
|
}
|
||||||
for (final Component c : children) {
|
|
||||||
display.remove(c);
|
/** @return List<Shortcut> A list of attached keyboard shortcut descriptions and properties. */
|
||||||
}
|
public List<Shortcut> getShortcuts() {
|
||||||
}
|
return this.shortcuts;
|
||||||
|
}
|
||||||
/** Sizes children of JLayeredPane to fully fit their layers. */
|
|
||||||
private void sizeChildren() {
|
/** Remove all children from a specified layer. */
|
||||||
Component[] children = display.getComponentsInLayer(JLayeredPane.DEFAULT_LAYER);
|
private void clearChildren(final int layer0) {
|
||||||
if (children.length != 0) { children[0].setSize(display.getSize()); }
|
final Component[] children = FView.SINGLETON_INSTANCE.getLpnDocument()
|
||||||
|
.getComponentsInLayer(layer0);
|
||||||
children = display.getComponentsInLayer(FView.TARGETING_LAYER);
|
|
||||||
if (children.length != 0) { children[0].setSize(display.getSize()); }
|
for (final Component c : children) {
|
||||||
|
display.remove(c);
|
||||||
children = display.getComponentsInLayer(JLayeredPane.MODAL_LAYER);
|
}
|
||||||
if (children.length != 0) { children[0].setSize(display.getSize()); }
|
}
|
||||||
}
|
|
||||||
|
/** Sizes children of JLayeredPane to fully fit their layers. */
|
||||||
/**
|
private void sizeChildren() {
|
||||||
* TODO: Write javadoc for this method.
|
Component[] children = display.getComponentsInLayer(JLayeredPane.DEFAULT_LAYER);
|
||||||
* @return
|
if (children.length != 0) { children[0].setSize(display.getSize()); }
|
||||||
*/
|
|
||||||
private Lobby lobby = null;
|
children = display.getComponentsInLayer(FView.TARGETING_LAYER);
|
||||||
public Lobby getLobby() {
|
if (children.length != 0) { children[0].setSize(display.getSize()); }
|
||||||
if (lobby == null) {
|
|
||||||
lobby = new Lobby();
|
children = display.getComponentsInLayer(JLayeredPane.MODAL_LAYER);
|
||||||
}
|
if (children.length != 0) { children[0].setSize(display.getSize()); }
|
||||||
return lobby;
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
public Player getCurrentPlayer() {
|
* TODO: Write javadoc for this method.
|
||||||
// try current priority
|
* @return
|
||||||
Player currentPriority = game.getPhaseHandler().getPriorityPlayer();
|
*/
|
||||||
if( null != currentPriority && currentPriority.getLobbyPlayer() == getLobby().getGuiPlayer() )
|
private Lobby lobby = null;
|
||||||
return currentPriority;
|
public Lobby getLobby() {
|
||||||
|
if (lobby == null) {
|
||||||
// otherwise find just any player, belonging to this lobbyplayer
|
lobby = new Lobby();
|
||||||
for(Player p : game.getPlayers())
|
}
|
||||||
if(p.getLobbyPlayer() == getLobby().getGuiPlayer() )
|
return lobby;
|
||||||
return p;
|
}
|
||||||
|
|
||||||
return null;
|
public Player getCurrentPlayer() {
|
||||||
}
|
// try current priority
|
||||||
|
Player currentPriority = game.getPhaseHandler().getPriorityPlayer();
|
||||||
public boolean mayShowCard(Card c) {
|
if( null != currentPriority && currentPriority.getLobbyPlayer() == getLobby().getGuiPlayer() )
|
||||||
return game == null || !gameHasHumanPlayer || c.canBeShownTo(getCurrentPlayer());
|
return currentPriority;
|
||||||
}
|
|
||||||
|
// otherwise find just any player, belonging to this lobbyplayer
|
||||||
/**
|
for(Player p : game.getPlayers())
|
||||||
* TODO: Write javadoc for this method.
|
if(p.getLobbyPlayer() == getLobby().getGuiPlayer() )
|
||||||
* @return
|
return p;
|
||||||
*/
|
|
||||||
public SoundSystem getSoundSystem() {
|
return null;
|
||||||
return soundSystem;
|
}
|
||||||
}
|
|
||||||
|
public boolean mayShowCard(Card c) {
|
||||||
/**
|
return game == null || !gameHasHumanPlayer || c.canBeShownTo(getCurrentPlayer());
|
||||||
* TODO: Write javadoc for this method.
|
}
|
||||||
* @return
|
|
||||||
*/
|
/**
|
||||||
private final NetServer server = new NetServer();
|
* TODO: Write javadoc for this method.
|
||||||
public NetServer getServer() {
|
* @return
|
||||||
// TODO Auto-generated method stub
|
*/
|
||||||
return server;
|
public SoundSystem getSoundSystem() {
|
||||||
}
|
return soundSystem;
|
||||||
|
}
|
||||||
private Game game;
|
|
||||||
private boolean gameHasHumanPlayer;
|
/**
|
||||||
|
* TODO: Write javadoc for this method.
|
||||||
public Game getObservedGame() {
|
* @return
|
||||||
return game;
|
*/
|
||||||
}
|
private final NetServer server = new NetServer();
|
||||||
|
public NetServer getServer() {
|
||||||
public final void stopGame() {
|
// TODO Auto-generated method stub
|
||||||
List<Player> pp = new ArrayList<Player>();
|
return server;
|
||||||
for(Player p : game.getPlayers()) {
|
}
|
||||||
if ( p.getOriginalLobbyPlayer() == getLobby().getGuiPlayer() )
|
|
||||||
pp.add(p);
|
private Game game;
|
||||||
}
|
private boolean gameHasHumanPlayer;
|
||||||
boolean hasHuman = !pp.isEmpty();
|
|
||||||
|
public Game getObservedGame() {
|
||||||
if ( pp.isEmpty() )
|
return game;
|
||||||
pp.addAll(game.getPlayers()); // no human? then all players surrender!
|
}
|
||||||
|
|
||||||
for(Player p: pp)
|
public final void stopGame() {
|
||||||
p.concede();
|
List<Player> pp = new ArrayList<Player>();
|
||||||
|
for(Player p : game.getPlayers()) {
|
||||||
Player priorityPlayer = game.getPhaseHandler().getPriorityPlayer();
|
if ( p.getOriginalLobbyPlayer() == getLobby().getGuiPlayer() )
|
||||||
boolean humanHasPriority = priorityPlayer == null || priorityPlayer.getLobbyPlayer() == getLobby().getGuiPlayer();
|
pp.add(p);
|
||||||
|
}
|
||||||
if ( hasHuman && humanHasPriority )
|
boolean hasHuman = !pp.isEmpty();
|
||||||
game.getAction().checkGameOverCondition();
|
|
||||||
else
|
if ( pp.isEmpty() )
|
||||||
game.isGameOver(); // this is synchronized method - it's used to make Game-0 thread see changes made here
|
pp.addAll(game.getPlayers()); // no human? then all players surrender!
|
||||||
|
|
||||||
playbackControl.onGameStopRequested();
|
for(Player p: pp)
|
||||||
}
|
p.concede();
|
||||||
|
|
||||||
private InputQueue inputQueue;
|
Player priorityPlayer = game.getPhaseHandler().getPriorityPlayer();
|
||||||
public InputQueue getInputQueue() {
|
boolean humanHasPriority = priorityPlayer == null || priorityPlayer.getLobbyPlayer() == getLobby().getGuiPlayer();
|
||||||
return inputQueue;
|
|
||||||
}
|
if ( hasHuman && humanHasPriority )
|
||||||
|
game.getAction().checkGameOverCondition();
|
||||||
|
else
|
||||||
private final FControlGameEventHandler fcVisitor = new FControlGameEventHandler(this);
|
game.isGameOver(); // this is synchronized method - it's used to make Game-0 thread see changes made here
|
||||||
private final FControlGamePlayback playbackControl = new FControlGamePlayback(this);
|
|
||||||
public void attachToGame(Game game0) {
|
playbackControl.onGameStopRequested();
|
||||||
// TODO: Detach from other game we might be looking at
|
}
|
||||||
|
|
||||||
inputQueue = new InputQueue();
|
private InputQueue inputQueue;
|
||||||
|
public InputQueue getInputQueue() {
|
||||||
this.game = game0;
|
return inputQueue;
|
||||||
game.subscribeToEvents(Singletons.getControl().getSoundSystem());
|
}
|
||||||
|
|
||||||
LobbyPlayer humanLobbyPlayer = getLobby().getGuiPlayer();
|
|
||||||
// The UI controls should use these game data as models
|
private final FControlGameEventHandler fcVisitor = new FControlGameEventHandler(this);
|
||||||
CMatchUI.SINGLETON_INSTANCE.initMatch(game.getRegisteredPlayers(), humanLobbyPlayer);
|
private final FControlGamePlayback playbackControl = new FControlGamePlayback(this);
|
||||||
CDock.SINGLETON_INSTANCE.setModel(game, humanLobbyPlayer);
|
public void attachToGame(Game game0) {
|
||||||
CStack.SINGLETON_INSTANCE.setModel(game.getStack(), humanLobbyPlayer);
|
// TODO: Detach from other game we might be looking at
|
||||||
CLog.SINGLETON_INSTANCE.setModel(game.getGameLog());
|
|
||||||
|
inputQueue = new InputQueue();
|
||||||
|
|
||||||
Singletons.getModel().getPreferences().actuateMatchPreferences();
|
this.game = game0;
|
||||||
|
game.subscribeToEvents(Singletons.getControl().getSoundSystem());
|
||||||
changeStateAutoFixLayout(Screens.MATCH_SCREEN, "match");
|
|
||||||
SDisplayUtil.showTab(EDocID.REPORT_LOG.getDoc());
|
LobbyPlayer humanLobbyPlayer = getLobby().getGuiPlayer();
|
||||||
|
// The UI controls should use these game data as models
|
||||||
CMessage.SINGLETON_INSTANCE.getInputControl().setGame(game);
|
CMatchUI.SINGLETON_INSTANCE.initMatch(game.getRegisteredPlayers(), humanLobbyPlayer);
|
||||||
|
CDock.SINGLETON_INSTANCE.setModel(game, humanLobbyPlayer);
|
||||||
// Listen to DuelOutcome event to show ViewWinLose
|
CStack.SINGLETON_INSTANCE.setModel(game.getStack(), humanLobbyPlayer);
|
||||||
game.subscribeToEvents(fcVisitor);
|
CLog.SINGLETON_INSTANCE.setModel(game.getGameLog());
|
||||||
|
|
||||||
// Add playback controls to match if needed
|
|
||||||
gameHasHumanPlayer = false;
|
Singletons.getModel().getPreferences().actuateMatchPreferences();
|
||||||
for(Player p : game.getPlayers()) {
|
|
||||||
if ( p.getController().getLobbyPlayer() == getLobby().getGuiPlayer() )
|
changeStateAutoFixLayout(Screens.MATCH_SCREEN, "match");
|
||||||
gameHasHumanPlayer = true;
|
SDisplayUtil.showTab(EDocID.REPORT_LOG.getDoc());
|
||||||
}
|
|
||||||
|
CMessage.SINGLETON_INSTANCE.getInputControl().setGame(game);
|
||||||
if (!gameHasHumanPlayer) {
|
|
||||||
game.subscribeToEvents(playbackControl);
|
// Listen to DuelOutcome event to show ViewWinLose
|
||||||
}
|
game.subscribeToEvents(fcVisitor);
|
||||||
|
|
||||||
VAntes.SINGLETON_INSTANCE.setModel(game.getRegisteredPlayers());
|
// Add playback controls to match if needed
|
||||||
|
gameHasHumanPlayer = false;
|
||||||
for (final VField field : VMatchUI.SINGLETON_INSTANCE.getFieldViews()) {
|
for(Player p : game.getPlayers()) {
|
||||||
field.getDetailsPanel().getLblLibrary().setHoverable(Preferences.DEV_MODE);
|
if ( p.getController().getLobbyPlayer() == getLobby().getGuiPlayer() )
|
||||||
}
|
gameHasHumanPlayer = true;
|
||||||
|
}
|
||||||
// per player observers were set in CMatchUI.SINGLETON_INSTANCE.initMatch
|
|
||||||
//Set Field shown to current player.
|
if (!gameHasHumanPlayer) {
|
||||||
VField nextField = CMatchUI.SINGLETON_INSTANCE.getFieldViewFor(game.getPlayers().get(0));
|
game.subscribeToEvents(playbackControl);
|
||||||
SDisplayUtil.showTab(nextField);
|
}
|
||||||
}
|
|
||||||
}
|
VAntes.SINGLETON_INSTANCE.setModel(game.getRegisteredPlayers());
|
||||||
|
|
||||||
|
for (final VField field : VMatchUI.SINGLETON_INSTANCE.getFieldViews()) {
|
||||||
|
field.getDetailsPanel().getLblLibrary().setHoverable(Preferences.DEV_MODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// per player observers were set in CMatchUI.SINGLETON_INSTANCE.initMatch
|
||||||
|
//Set Field shown to current player.
|
||||||
|
VField nextField = CMatchUI.SINGLETON_INSTANCE.getFieldViewFor(game.getPlayers().get(0));
|
||||||
|
SDisplayUtil.showTab(nextField);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public enum CSubmenuPreferences implements ICDoc {
|
|||||||
|
|
||||||
this.view = VSubmenuPreferences.SINGLETON_INSTANCE;
|
this.view = VSubmenuPreferences.SINGLETON_INSTANCE;
|
||||||
this.prefs = Singletons.getModel().getPreferences();
|
this.prefs = Singletons.getModel().getPreferences();
|
||||||
|
|
||||||
// This updates variable right now and is not standard
|
// This updates variable right now and is not standard
|
||||||
view.getCbDevMode().addItemListener(new ItemListener() {
|
view.getCbDevMode().addItemListener(new ItemListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -83,6 +83,7 @@ public enum CSubmenuPreferences implements ICDoc {
|
|||||||
lstControls.add(Pair.of(view.getCbOverlayCardName(), FPref.UI_OVERLAY_CARD_NAME));
|
lstControls.add(Pair.of(view.getCbOverlayCardName(), FPref.UI_OVERLAY_CARD_NAME));
|
||||||
lstControls.add(Pair.of(view.getCbOverlayCardPower(), FPref.UI_OVERLAY_CARD_POWER));
|
lstControls.add(Pair.of(view.getCbOverlayCardPower(), FPref.UI_OVERLAY_CARD_POWER));
|
||||||
lstControls.add(Pair.of(view.getCbOverlayCardManaCost(), FPref.UI_OVERLAY_CARD_MANA_COST));
|
lstControls.add(Pair.of(view.getCbOverlayCardManaCost(), FPref.UI_OVERLAY_CARD_MANA_COST));
|
||||||
|
lstControls.add(Pair.of(view.getCbShowMatchBackgroundImage(), FPref.UI_MATCH_IMAGE_VISIBLE));
|
||||||
|
|
||||||
for(final Pair<JCheckBox, FPref> kv : lstControls) {
|
for(final Pair<JCheckBox, FPref> kv : lstControls) {
|
||||||
kv.getKey().addItemListener(new ItemListener() {
|
kv.getKey().addItemListener(new ItemListener() {
|
||||||
@@ -113,19 +114,21 @@ public enum CSubmenuPreferences implements ICDoc {
|
|||||||
public void run() {
|
public void run() {
|
||||||
CSubmenuPreferences.this.resetMatchScreenLayout();
|
CSubmenuPreferences.this.resetMatchScreenLayout();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
initializeGameLogVerbosityComboBox();
|
initializeGameLogVerbosityComboBox();
|
||||||
initializeAiProfilesComboBox();
|
initializeAiProfilesComboBox();
|
||||||
initializeSkinsComboBox();
|
initializeSkinsComboBox();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see forge.control.home.IControlSubmenu#update()
|
* @see forge.control.home.IControlSubmenu#update()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
|
|
||||||
this.view = VSubmenuPreferences.SINGLETON_INSTANCE;
|
this.view = VSubmenuPreferences.SINGLETON_INSTANCE;
|
||||||
this.prefs = Singletons.getModel().getPreferences();
|
this.prefs = Singletons.getModel().getPreferences();
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import javax.swing.border.MatteBorder;
|
|||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import forge.GameLogEntryType;
|
import forge.GameLogEntryType;
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.control.KeyboardShortcuts;
|
import forge.control.KeyboardShortcuts;
|
||||||
@@ -82,6 +81,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
private final JCheckBox cbOverlayCardPower = new OptionsCheckBox("Power/Toughness");
|
private final JCheckBox cbOverlayCardPower = new OptionsCheckBox("Power/Toughness");
|
||||||
private final JCheckBox cbOverlayCardManaCost = new OptionsCheckBox("Mana Cost");
|
private final JCheckBox cbOverlayCardManaCost = new OptionsCheckBox("Mana Cost");
|
||||||
private final JCheckBox cbCompactMainMenu = new OptionsCheckBox("Use Compact Main Sidebar Menu");
|
private final JCheckBox cbCompactMainMenu = new OptionsCheckBox("Use Compact Main Sidebar Menu");
|
||||||
|
private final JCheckBox cbShowMatchBackgroundImage = new OptionsCheckBox("Show Background Image on Match Screen");
|
||||||
|
|
||||||
private final Map<FPref, KeyboardShortcutField> shortcutFields = new HashMap<FPref, KeyboardShortcutField>();
|
private final Map<FPref, KeyboardShortcutField> shortcutFields = new HashMap<FPref, KeyboardShortcutField>();
|
||||||
|
|
||||||
@@ -166,6 +166,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
|
|
||||||
pnlPrefs.add(cbpGameLogEntryType, "w 80%!, gap 10% 0 0 10px, span 2 1");
|
pnlPrefs.add(cbpGameLogEntryType, "w 80%!, gap 10% 0 0 10px, span 2 1");
|
||||||
pnlPrefs.add(new NoteLabel("Changes how much information is displayed in the game log. Sorted by least to most verbose."), regularConstraints);
|
pnlPrefs.add(new NoteLabel("Changes how much information is displayed in the game log. Sorted by least to most verbose."), regularConstraints);
|
||||||
|
|
||||||
|
|
||||||
// Themes
|
// Themes
|
||||||
pnlPrefs.add(new SectionLabel("Visual Themes"), sectionConstraints + ", gaptop 2%");
|
pnlPrefs.add(new SectionLabel("Visual Themes"), sectionConstraints + ", gaptop 2%");
|
||||||
@@ -173,6 +174,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
pnlPrefs.add(cbpSkin, "w 80%!, gap 10% 0 0 10px, span 2 1");
|
pnlPrefs.add(cbpSkin, "w 80%!, gap 10% 0 0 10px, span 2 1");
|
||||||
pnlPrefs.add(new NoteLabel("Change the overall look and feel of Forge (RESTART REQUIRED)."), regularConstraints);
|
pnlPrefs.add(new NoteLabel("Change the overall look and feel of Forge (RESTART REQUIRED)."), regularConstraints);
|
||||||
|
|
||||||
|
pnlPrefs.add(cbShowMatchBackgroundImage, regularConstraints);
|
||||||
|
pnlPrefs.add(new NoteLabel("Toggle the visibility of the background image on the match screen."), regularConstraints);
|
||||||
|
|
||||||
|
|
||||||
// Graphic Options
|
// Graphic Options
|
||||||
pnlPrefs.add(new SectionLabel("Graphic Options"), sectionConstraints + ", gaptop 2%");
|
pnlPrefs.add(new SectionLabel("Graphic Options"), sectionConstraints + ", gaptop 2%");
|
||||||
|
|
||||||
@@ -188,13 +193,14 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
pnlPrefs.add(cbUiForTouchScreen, regularConstraints);
|
pnlPrefs.add(cbUiForTouchScreen, regularConstraints);
|
||||||
pnlPrefs.add(new NoteLabel("Increases some UI elements to provide a better experience on touchscreen devices. (Needs restart)"), regularConstraints);
|
pnlPrefs.add(new NoteLabel("Increases some UI elements to provide a better experience on touchscreen devices. (Needs restart)"), regularConstraints);
|
||||||
|
|
||||||
// Overlay options
|
// Card Overlay options
|
||||||
pnlPrefs.add(new SectionLabel("Card Overlay Options"), sectionConstraints);
|
pnlPrefs.add(new SectionLabel("Card Overlay Options"), sectionConstraints);
|
||||||
pnlPrefs.add(new NoteLabel("Show text overlays which are easier to read when cards are reduced in size to fit the play area."), regularConstraints);
|
pnlPrefs.add(new NoteLabel("Show text overlays which are easier to read when cards are reduced in size to fit the play area."), regularConstraints);
|
||||||
pnlPrefs.add(cbOverlayCardName, regularConstraints);
|
pnlPrefs.add(cbOverlayCardName, regularConstraints);
|
||||||
pnlPrefs.add(cbOverlayCardPower, regularConstraints);
|
pnlPrefs.add(cbOverlayCardPower, regularConstraints);
|
||||||
pnlPrefs.add(cbOverlayCardManaCost, regularConstraints);
|
pnlPrefs.add(cbOverlayCardManaCost, regularConstraints);
|
||||||
|
|
||||||
|
|
||||||
// Sound options
|
// Sound options
|
||||||
pnlPrefs.add(new SectionLabel("Sound Options"), sectionConstraints + ", gaptop 2%");
|
pnlPrefs.add(new SectionLabel("Sound Options"), sectionConstraints + ", gaptop 2%");
|
||||||
|
|
||||||
@@ -204,6 +210,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
pnlPrefs.add(cbAltSoundSystem, regularConstraints);
|
pnlPrefs.add(cbAltSoundSystem, regularConstraints);
|
||||||
pnlPrefs.add(new NoteLabel("Use the alternate sound system (only use in case your have issues with sound not playing or disappearing)"), regularConstraints);
|
pnlPrefs.add(new NoteLabel("Use the alternate sound system (only use in case your have issues with sound not playing or disappearing)"), regularConstraints);
|
||||||
|
|
||||||
|
|
||||||
// Keyboard shortcuts
|
// Keyboard shortcuts
|
||||||
final JLabel lblShortcuts = new SectionLabel("Keyboard Shortcuts");
|
final JLabel lblShortcuts = new SectionLabel("Keyboard Shortcuts");
|
||||||
pnlPrefs.add(lblShortcuts, sectionConstraints + ", gaptop 2%");
|
pnlPrefs.add(lblShortcuts, sectionConstraints + ", gaptop 2%");
|
||||||
@@ -467,6 +474,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
public FComboBoxPanel<String> getSkinsComboBoxPanel() {
|
public FComboBoxPanel<String> getSkinsComboBoxPanel() {
|
||||||
return cbpSkin;
|
return cbpSkin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return {@link javax.swing.JCheckBox} */
|
/** @return {@link javax.swing.JCheckBox} */
|
||||||
public JCheckBox getCbEnforceDeckLegality() {
|
public JCheckBox getCbEnforceDeckLegality() {
|
||||||
return cbEnforceDeckLegality;
|
return cbEnforceDeckLegality;
|
||||||
@@ -496,9 +504,11 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
return btnReset;
|
return btnReset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return {@link javax.swing.JCheckBox} */
|
||||||
|
public JCheckBox getCbShowMatchBackgroundImage() {
|
||||||
|
return cbShowMatchBackgroundImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//========== Overridden from IVDoc
|
//========== Overridden from IVDoc
|
||||||
|
|
||||||
public final FLabel getBtnDeleteMatchUI() {
|
public final FLabel getBtnDeleteMatchUI() {
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
|||||||
UI_RANDOM_CARD_ART ("false"),
|
UI_RANDOM_CARD_ART ("false"),
|
||||||
UI_CURRENT_AI_PROFILE (AiProfileUtil.AI_PROFILE_RANDOM_MATCH),
|
UI_CURRENT_AI_PROFILE (AiProfileUtil.AI_PROFILE_RANDOM_MATCH),
|
||||||
UI_CLONE_MODE_SOURCE ("false"), /** */
|
UI_CLONE_MODE_SOURCE ("false"), /** */
|
||||||
|
UI_MATCH_IMAGE_VISIBLE ("true"),
|
||||||
|
|
||||||
UI_FOR_TOUCHSCREN("false"),
|
UI_FOR_TOUCHSCREN("false"),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user