mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Temporary visual fix for skin restart issue.
This commit is contained in:
@@ -192,19 +192,21 @@ public enum CSubmenuPreferences implements ICSubmenu {
|
|||||||
view.getLstChooseSkin().ensureIndexIsVisible(view.getLstChooseSkin().getSelectedIndex());
|
view.getLstChooseSkin().ensureIndexIsVisible(view.getLstChooseSkin().getSelectedIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
private void updateSkin() {
|
private void updateSkin() {
|
||||||
final VSubmenuPreferences view = VSubmenuPreferences.SINGLETON_INSTANCE;
|
final VSubmenuPreferences view = VSubmenuPreferences.SINGLETON_INSTANCE;
|
||||||
final ForgePreferences prefs = Singletons.getModel().getPreferences();
|
|
||||||
final String name = view.getLstChooseSkin().getSelectedValue().toString();
|
final String name = view.getLstChooseSkin().getSelectedValue().toString();
|
||||||
|
final ForgePreferences prefs = Singletons.getModel().getPreferences();
|
||||||
if (name.equals(prefs.getPref(FPref.UI_SKIN))) { return; }
|
if (name.equals(prefs.getPref(FPref.UI_SKIN))) { return; }
|
||||||
|
|
||||||
RestartUtil.restartApplication(new Runnable() {
|
view.getScrChooseSkin().setVisible(false);
|
||||||
@Override
|
view.getLblChooseSkin().setText("Please restart Forge (click here to close).");
|
||||||
public void run() {
|
view.getLblChooseSkin().setHoverable(true);
|
||||||
prefs.setPref(FPref.UI_SKIN, name);
|
view.getLblChooseSkin().setCommand(new Command() { @Override
|
||||||
prefs.save();
|
public void execute() { RestartUtil.restartApplication(new Runnable() {
|
||||||
}
|
@Override public void run() { } }); } });
|
||||||
});
|
|
||||||
|
prefs.setPref(FPref.UI_SKIN, name);
|
||||||
|
prefs.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ public enum VSubmenuPreferences implements IVSubmenu {
|
|||||||
.text("Choose Skin").fontScaleAuto(false).fontStyle(Font.BOLD).fontSize(14).build();
|
.text("Choose Skin").fontScaleAuto(false).fontStyle(Font.BOLD).fontSize(14).build();
|
||||||
|
|
||||||
private final JList lstChooseSkin = new FList();
|
private final JList lstChooseSkin = new FList();
|
||||||
|
private final FLabel lblChooseSkin = new FLabel.Builder().fontSize(12).fontStyle(Font.ITALIC)
|
||||||
|
.text("Various user-created themes for Forge backgrounds, fonts, and colors.")
|
||||||
|
.fontAlign(SwingConstants.LEFT).build();
|
||||||
|
private final JScrollPane scrChooseSkin = new FScrollPane(lstChooseSkin);
|
||||||
|
|
||||||
private final JCheckBox cbRemoveSmall = new OptionsCheckBox("Remove Small Creatures");
|
private final JCheckBox cbRemoveSmall = new OptionsCheckBox("Remove Small Creatures");
|
||||||
private final JCheckBox cbSingletons = new OptionsCheckBox("Singleton Mode");
|
private final JCheckBox cbSingletons = new OptionsCheckBox("Singleton Mode");
|
||||||
@@ -116,11 +120,8 @@ public enum VSubmenuPreferences implements IVSubmenu {
|
|||||||
pnlPrefs.add(new SectionLabel("Graphic Options"), sectionConstraints);
|
pnlPrefs.add(new SectionLabel("Graphic Options"), sectionConstraints);
|
||||||
|
|
||||||
pnlPrefs.add(lblTitleSkin, regularConstraints);
|
pnlPrefs.add(lblTitleSkin, regularConstraints);
|
||||||
pnlPrefs.add(new NoteLabel("Various user-created themes for Forge backgrounds, fonts, and colors."), regularConstraints);
|
pnlPrefs.add(lblChooseSkin, regularConstraints);
|
||||||
pnlPrefs.add(new FScrollPane(lstChooseSkin), "h 120px!, w 150px!, gap 10% 0 0 2%, wrap");
|
pnlPrefs.add(scrChooseSkin, "h 200px!, w 200px!, gap 10% 0 0 2%, wrap");
|
||||||
|
|
||||||
pnlPrefs.add(new FLabel.Builder().text("Card Size").fontStyle(Font.BOLD).build(), regularConstraints);
|
|
||||||
pnlPrefs.add(new NoteLabel("Size of cards in hand and playing field, when possible"), regularConstraints);
|
|
||||||
|
|
||||||
pnlPrefs.add(cbRandomFoil, regularConstraints);
|
pnlPrefs.add(cbRandomFoil, regularConstraints);
|
||||||
pnlPrefs.add(new NoteLabel("Adds foiled effects to random cards."), regularConstraints);
|
pnlPrefs.add(new NoteLabel("Adds foiled effects to random cards."), regularConstraints);
|
||||||
@@ -325,6 +326,16 @@ public enum VSubmenuPreferences implements IVSubmenu {
|
|||||||
return lstChooseSkin;
|
return lstChooseSkin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return {@link forge.gui.toolbox.FLabel} */
|
||||||
|
public final FLabel getLblChooseSkin() {
|
||||||
|
return lblChooseSkin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return {@link javax.swing.JScrollPane} */
|
||||||
|
public final JScrollPane getScrChooseSkin() {
|
||||||
|
return scrChooseSkin;
|
||||||
|
}
|
||||||
|
|
||||||
/** @return {@link javax.swing.JCheckBox} */
|
/** @return {@link javax.swing.JCheckBox} */
|
||||||
public final JCheckBox getCbRemoveSmall() {
|
public final JCheckBox getCbRemoveSmall() {
|
||||||
return cbRemoveSmall;
|
return cbRemoveSmall;
|
||||||
|
|||||||
Reference in New Issue
Block a user