mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Removed redundant Visual Themes section from Game Settings -> Preferences.
This commit is contained in:
@@ -4,7 +4,6 @@ import java.awt.event.ItemEvent;
|
||||
import java.awt.event.ItemListener;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.JCheckBox;
|
||||
@@ -26,7 +25,6 @@ import forge.gui.framework.ICDoc;
|
||||
import forge.gui.framework.SLayoutIO;
|
||||
import forge.gui.toolbox.FComboBoxPanel;
|
||||
import forge.gui.toolbox.FLabel;
|
||||
import forge.gui.toolbox.FSkin;
|
||||
import forge.properties.ForgePreferences;
|
||||
import forge.properties.ForgePreferences.FPref;
|
||||
|
||||
@@ -83,7 +81,6 @@ public enum CSubmenuPreferences implements ICDoc {
|
||||
lstControls.add(Pair.of(view.getCbAltSoundSystem(), FPref.UI_ALT_SOUND_SYSTEM));
|
||||
lstControls.add(Pair.of(view.getCbUiForTouchScreen(), FPref.UI_FOR_TOUCHSCREN));
|
||||
lstControls.add(Pair.of(view.getCbCompactMainMenu(), FPref.UI_COMPACT_MAIN_MENU));
|
||||
lstControls.add(Pair.of(view.getCbShowMatchBackgroundImage(), FPref.UI_MATCH_IMAGE_VISIBLE));
|
||||
lstControls.add(Pair.of(view.getCbUseThemedComboBox(), FPref.UI_THEMED_COMBOBOX));
|
||||
lstControls.add(Pair.of(view.getCbPromptFreeBlocks(), FPref.MATCHPREF_PROMPT_FREE_BLOCKS));
|
||||
|
||||
@@ -120,7 +117,6 @@ public enum CSubmenuPreferences implements ICDoc {
|
||||
|
||||
initializeGameLogVerbosityComboBox();
|
||||
initializeAiProfilesComboBox();
|
||||
initializeSkinsComboBox();
|
||||
initializePlayerNameButton();
|
||||
|
||||
}
|
||||
@@ -217,32 +213,6 @@ public enum CSubmenuPreferences implements ICDoc {
|
||||
panel.setComboBox(comboBox, selectedItem);
|
||||
}
|
||||
|
||||
private void initializeSkinsComboBox() {
|
||||
final FComboBoxPanel<String> panel = this.view.getSkinsComboBoxPanel();
|
||||
String[] installedSkins = FSkin.getSkinNamesArray(true);
|
||||
validatePreferredSkinName(installedSkins);
|
||||
final JComboBox<String> comboBox = new JComboBox<String>(installedSkins);
|
||||
String selectedItem = this.prefs.getPref(FPref.UI_SKIN);
|
||||
panel.setComboBox(comboBox, selectedItem);
|
||||
comboBox.addItemListener(new ItemListener() {
|
||||
@Override
|
||||
public void itemStateChanged(final ItemEvent e) {
|
||||
FSkin.changeSkin(panel.getSelectedItem().toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void updateCurrentSkin() {
|
||||
this.view.getSkinsComboBoxPanel().setSelectedItem(this.prefs.getPref(FPref.UI_SKIN));
|
||||
}
|
||||
|
||||
private void validatePreferredSkinName(String[] installedSkins) {
|
||||
String preferredSkin = this.prefs.getPref(FPref.UI_SKIN);
|
||||
if (!Arrays.asList(installedSkins).contains(preferredSkin)) {
|
||||
this.prefs.setPref(FPref.UI_SKIN, "Default");
|
||||
}
|
||||
}
|
||||
|
||||
private <E> JComboBox<E> createComboBox(E[] items, final ForgePreferences.FPref setting) {
|
||||
final JComboBox<E> comboBox = new JComboBox<E>(items);
|
||||
addComboBoxListener(comboBox, setting);
|
||||
|
||||
@@ -80,14 +80,12 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
private final JCheckBox cbAltSoundSystem = new OptionsCheckBox("Use Alternate Sound System");
|
||||
private final JCheckBox cbUiForTouchScreen = new OptionsCheckBox("Enchance UI for touchscreens");
|
||||
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 JCheckBox cbUseThemedComboBox = new OptionsCheckBox("Themed ComboBox");
|
||||
private final JCheckBox cbPromptFreeBlocks = new OptionsCheckBox("Free Block Handling");
|
||||
|
||||
private final Map<FPref, KeyboardShortcutField> shortcutFields = new HashMap<FPref, KeyboardShortcutField>();
|
||||
|
||||
// ComboBox items are added in CSubmenuPreferences since this is just the View.
|
||||
private final FComboBoxPanel<String> cbpSkin = new FComboBoxPanel<String>("Choose Skin:");
|
||||
private final FComboBoxPanel<GameLogEntryType> cbpGameLogEntryType = new FComboBoxPanel<GameLogEntryType>("Game Log Verbosity:");
|
||||
private final FComboBoxPanel<String> cbpAiProfiles = new FComboBoxPanel<String>("AI Personality:");
|
||||
|
||||
@@ -177,17 +175,6 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
pnlPrefs.add(cbUseThemedComboBox, regularConstraints);
|
||||
pnlPrefs.add(new NoteLabel("Turn off if you are having combo-box color clash (RESTART REQUIRED)."), regularConstraints);
|
||||
|
||||
|
||||
// Themes
|
||||
pnlPrefs.add(new SectionLabel("Visual Themes"), sectionConstraints + ", gaptop 2%");
|
||||
|
||||
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(cbShowMatchBackgroundImage, regularConstraints);
|
||||
pnlPrefs.add(new NoteLabel("Toggle the visibility of the background image on the match screen."), regularConstraints);
|
||||
|
||||
|
||||
// Graphic Options
|
||||
pnlPrefs.add(new SectionLabel("Graphic Options"), sectionConstraints + ", gaptop 2%");
|
||||
|
||||
@@ -460,10 +447,6 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
return cbpGameLogEntryType;
|
||||
}
|
||||
|
||||
public FComboBoxPanel<String> getSkinsComboBoxPanel() {
|
||||
return cbpSkin;
|
||||
}
|
||||
|
||||
/** @return {@link javax.swing.JCheckBox} */
|
||||
public JCheckBox getCbEnforceDeckLegality() {
|
||||
return cbEnforceDeckLegality;
|
||||
@@ -498,11 +481,6 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
return btnReset;
|
||||
}
|
||||
|
||||
/** @return {@link javax.swing.JCheckBox} */
|
||||
public JCheckBox getCbShowMatchBackgroundImage() {
|
||||
return cbShowMatchBackgroundImage;
|
||||
}
|
||||
|
||||
/** @return {@link javax.swing.JCheckBox} */
|
||||
public JCheckBox getCbUseThemedComboBox() {
|
||||
return cbUseThemedComboBox;
|
||||
|
||||
@@ -57,7 +57,6 @@ import org.apache.commons.lang.WordUtils;
|
||||
import forge.FThreads;
|
||||
import forge.Singletons;
|
||||
import forge.gui.GuiUtils;
|
||||
import forge.gui.home.settings.CSubmenuPreferences;
|
||||
import forge.properties.ForgePreferences;
|
||||
import forge.properties.ForgePreferences.FPref;
|
||||
import forge.view.FView;
|
||||
@@ -1634,7 +1633,6 @@ public enum FSkin {
|
||||
Singletons.getControl().getForgeMenu().refresh();
|
||||
FComboBoxWrapper.refreshAllSkins();
|
||||
FComboBoxPanel.refreshAllSkins();
|
||||
CSubmenuPreferences.SINGLETON_INSTANCE.updateCurrentSkin();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user