forked from External/mage
Remembering toggle state for BigCard component between games
This commit is contained in:
parent
435798f7d5
commit
29e57830b4
2 changed files with 46 additions and 1 deletions
|
|
@ -69,6 +69,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
public static final String KEY_CARD_IMAGES_USE_DEFAULT = "cardImagesUseDefault";
|
||||
public static final String KEY_CARD_IMAGES_PATH = "cardImagesPath";
|
||||
public static final String KEY_CARD_IMAGES_CHECK = "cardImagesCheck";
|
||||
public static final String KEY_BIG_CARD_TOGGLED = "bigCardToggled";
|
||||
|
||||
public static final String KEY_PROXY_ADDRESS = "proxyAddress";
|
||||
public static final String KEY_PROXY_PORT = "proxyPort";
|
||||
|
|
@ -967,7 +968,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
prefs.flush();
|
||||
} catch (BackingStoreException ex) {
|
||||
ex.printStackTrace();
|
||||
JOptionPane.showMessageDialog(null, "Error: couldn't save phase stops. Please try again.");
|
||||
JOptionPane.showMessageDialog(null, "Error: couldn't save preferences. Please try once again.");
|
||||
}
|
||||
|
||||
dialog.setVisible(false);
|
||||
|
|
@ -1246,6 +1247,18 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
cache.put(key, value);
|
||||
}
|
||||
|
||||
public static void saveValue(String key, String value) {
|
||||
Preferences prefs = MageFrame.getPreferences();
|
||||
prefs.put(key, value);
|
||||
try {
|
||||
prefs.flush();
|
||||
} catch (BackingStoreException ex) {
|
||||
ex.printStackTrace();
|
||||
JOptionPane.showMessageDialog(null, "Error: couldn't save preferences. Please try once again.");
|
||||
}
|
||||
updateCache(key, value);
|
||||
}
|
||||
|
||||
private void addAvatars() {
|
||||
try {
|
||||
addAvatar(jPanel10, 51, true, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue