mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
Add Elsa Serializer Option (Off by default)
This commit is contained in:
@@ -217,8 +217,9 @@ public class Main extends AndroidApplication {
|
|||||||
Main.this.setRequestedOrientation(Main.this.getResources().getConfiguration().orientation);
|
Main.this.setRequestedOrientation(Main.this.getResources().getConfiguration().orientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ForgePreferences prefs = FModel.getPreferences();
|
||||||
initialize(Forge.getApp(new AndroidClipboard(), adapter, assetsDir, false));
|
boolean propertyConfig = prefs != null && prefs.getPrefBoolean(ForgePreferences.FPref.UI_USE_ELSA);
|
||||||
|
initialize(Forge.getApp(new AndroidClipboard(), adapter, assetsDir, propertyConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
/*@Override
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ public enum CSubmenuPreferences implements ICDoc {
|
|||||||
lstControls.add(Pair.of(view.getCbSingletons(), FPref.DECKGEN_SINGLETONS));
|
lstControls.add(Pair.of(view.getCbSingletons(), FPref.DECKGEN_SINGLETONS));
|
||||||
lstControls.add(Pair.of(view.getCbEnableAICheats(), FPref.UI_ENABLE_AI_CHEATS));
|
lstControls.add(Pair.of(view.getCbEnableAICheats(), FPref.UI_ENABLE_AI_CHEATS));
|
||||||
lstControls.add(Pair.of(view.getCbEnableUnknownCards(), FPref.UI_LOAD_UNKNOWN_CARDS));
|
lstControls.add(Pair.of(view.getCbEnableUnknownCards(), FPref.UI_LOAD_UNKNOWN_CARDS));
|
||||||
|
lstControls.add(Pair.of(view.getCbUseElsa(), FPref.UI_USE_ELSA));
|
||||||
lstControls.add(Pair.of(view.getCbImageFetcher(), FPref.UI_ENABLE_ONLINE_IMAGE_FETCHER));
|
lstControls.add(Pair.of(view.getCbImageFetcher(), FPref.UI_ENABLE_ONLINE_IMAGE_FETCHER));
|
||||||
lstControls.add(Pair.of(view.getCbDisplayFoil(), FPref.UI_OVERLAY_FOIL_EFFECT));
|
lstControls.add(Pair.of(view.getCbDisplayFoil(), FPref.UI_OVERLAY_FOIL_EFFECT));
|
||||||
lstControls.add(Pair.of(view.getCbRandomFoil(), FPref.UI_RANDOM_FOIL));
|
lstControls.add(Pair.of(view.getCbRandomFoil(), FPref.UI_RANDOM_FOIL));
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
private final JCheckBox cbRemindOnPriority = new OptionsCheckBox(localizer.getMessage("cbRemindOnPriority"));
|
private final JCheckBox cbRemindOnPriority = new OptionsCheckBox(localizer.getMessage("cbRemindOnPriority"));
|
||||||
private final JCheckBox cbUseSentry = new OptionsCheckBox(localizer.getMessage("cbUseSentry"));
|
private final JCheckBox cbUseSentry = new OptionsCheckBox(localizer.getMessage("cbUseSentry"));
|
||||||
private final JCheckBox cbEnableUnknownCards = new OptionsCheckBox("Enable Unknown Cards");
|
private final JCheckBox cbEnableUnknownCards = new OptionsCheckBox("Enable Unknown Cards");
|
||||||
|
private final JCheckBox cbUseElsa = new OptionsCheckBox("Use ELSA Serializer");
|
||||||
|
|
||||||
private final Map<FPref, KeyboardShortcutField> shortcutFields = new HashMap<>();
|
private final Map<FPref, KeyboardShortcutField> shortcutFields = new HashMap<>();
|
||||||
|
|
||||||
@@ -291,6 +292,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
pnlPrefs.add(cbEnableUnknownCards, titleConstraints);
|
pnlPrefs.add(cbEnableUnknownCards, titleConstraints);
|
||||||
pnlPrefs.add(new NoteLabel("Enable Unknown Cards to be loaded to Unknown Set. (Requires restart)"), descriptionConstraints);
|
pnlPrefs.add(new NoteLabel("Enable Unknown Cards to be loaded to Unknown Set. (Requires restart)"), descriptionConstraints);
|
||||||
|
|
||||||
|
pnlPrefs.add(cbUseElsa, titleConstraints);
|
||||||
|
pnlPrefs.add(new NoteLabel("Use ELSA Serializer for Network (EXPERIMENTAL Option, Requires restart)"), descriptionConstraints);
|
||||||
|
|
||||||
// Graphic Options
|
// Graphic Options
|
||||||
pnlPrefs.add(new SectionLabel(localizer.getMessage("GraphicOptions")), sectionConstraints + ", gaptop 2%");
|
pnlPrefs.add(new SectionLabel(localizer.getMessage("GraphicOptions")), sectionConstraints + ", gaptop 2%");
|
||||||
|
|
||||||
@@ -589,6 +593,11 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
return cbEnableUnknownCards;
|
return cbEnableUnknownCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return {@link javax.swing.JCheckBox} */
|
||||||
|
public JCheckBox getCbUseElsa() {
|
||||||
|
return cbUseElsa;
|
||||||
|
}
|
||||||
|
|
||||||
/** @return {@link javax.swing.JCheckBox} */
|
/** @return {@link javax.swing.JCheckBox} */
|
||||||
public JCheckBox getCbImageFetcher() {
|
public JCheckBox getCbImageFetcher() {
|
||||||
return cbImageFetcher;
|
return cbImageFetcher;
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import com.badlogic.gdx.backends.iosrobovm.IOSFiles;
|
|||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
import forge.assets.AssetsDownloader;
|
import forge.assets.AssetsDownloader;
|
||||||
import forge.interfaces.IDeviceAdapter;
|
import forge.interfaces.IDeviceAdapter;
|
||||||
|
import forge.model.FModel;
|
||||||
|
import forge.properties.ForgePreferences;
|
||||||
import forge.util.FileUtil;
|
import forge.util.FileUtil;
|
||||||
import org.robovm.apple.foundation.NSAutoreleasePool;
|
import org.robovm.apple.foundation.NSAutoreleasePool;
|
||||||
import org.robovm.apple.uikit.UIApplication;
|
import org.robovm.apple.uikit.UIApplication;
|
||||||
@@ -29,7 +31,9 @@ public class Main extends IOSApplication.Delegate {
|
|||||||
final IOSApplicationConfiguration config = new IOSApplicationConfiguration();
|
final IOSApplicationConfiguration config = new IOSApplicationConfiguration();
|
||||||
config.useAccelerometer = false;
|
config.useAccelerometer = false;
|
||||||
config.useCompass = false;
|
config.useCompass = false;
|
||||||
final ApplicationListener app = Forge.getApp(new IOSClipboard(), new IOSAdapter(), assetsDir, false);
|
ForgePreferences prefs = FModel.getPreferences();
|
||||||
|
boolean propertyConfig = prefs != null && prefs.getPrefBoolean(ForgePreferences.FPref.UI_USE_ELSA);
|
||||||
|
final ApplicationListener app = Forge.getApp(new IOSClipboard(), new IOSAdapter(), assetsDir, propertyConfig);
|
||||||
final IOSApplication iosApp = new IOSApplication(app, config);
|
final IOSApplication iosApp = new IOSApplication(app, config);
|
||||||
return iosApp;
|
return iosApp;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import com.badlogic.gdx.backends.lwjgl.LwjglClipboard;
|
|||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
import forge.assets.AssetsDownloader;
|
import forge.assets.AssetsDownloader;
|
||||||
import forge.interfaces.IDeviceAdapter;
|
import forge.interfaces.IDeviceAdapter;
|
||||||
|
import forge.model.FModel;
|
||||||
|
import forge.properties.ForgePreferences;
|
||||||
import forge.util.FileUtil;
|
import forge.util.FileUtil;
|
||||||
import forge.util.OperatingSystem;
|
import forge.util.OperatingSystem;
|
||||||
import forge.util.RestartUtil;
|
import forge.util.RestartUtil;
|
||||||
@@ -92,8 +94,10 @@ public class Main {
|
|||||||
config.title = "Forge";
|
config.title = "Forge";
|
||||||
config.useHDPI = desktopMode; // enable HiDPI on Mac OS
|
config.useHDPI = desktopMode; // enable HiDPI on Mac OS
|
||||||
|
|
||||||
|
ForgePreferences prefs = FModel.getPreferences();
|
||||||
|
boolean propertyConfig = prefs != null && prefs.getPrefBoolean(ForgePreferences.FPref.UI_USE_ELSA);
|
||||||
new LwjglApplication(Forge.getApp(new LwjglClipboard(), new DesktopAdapter(switchOrientationFile),
|
new LwjglApplication(Forge.getApp(new LwjglClipboard(), new DesktopAdapter(switchOrientationFile),
|
||||||
desktopMode ? desktopModeAssetsDir : assetsDir, false), config);
|
desktopMode ? desktopModeAssetsDir : assetsDir, propertyConfig), config);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DesktopAdapter implements IDeviceAdapter {
|
private static class DesktopAdapter implements IDeviceAdapter {
|
||||||
|
|||||||
@@ -236,6 +236,14 @@ public class SettingsPage extends TabPage<SettingsScreen> {
|
|||||||
"Enable Unknown Cards",
|
"Enable Unknown Cards",
|
||||||
"Enable Unknown Cards to be loaded to Unknown Set. (Requires restart)"),
|
"Enable Unknown Cards to be loaded to Unknown Set. (Requires restart)"),
|
||||||
3);
|
3);
|
||||||
|
lstSettings.addItem(new BooleanSetting(FPref.UI_LOAD_UNKNOWN_CARDS,
|
||||||
|
"Enable Unknown Cards",
|
||||||
|
"Enable Unknown Cards to be loaded to Unknown Set. (Requires restart)"),
|
||||||
|
3);
|
||||||
|
lstSettings.addItem(new BooleanSetting(FPref.UI_USE_ELSA,
|
||||||
|
"Use ELSA Serializer",
|
||||||
|
"Use ELSA Serializer for Network (EXPERIMENTAL Option, Requires restart)"),
|
||||||
|
3);
|
||||||
|
|
||||||
//Graphic Options
|
//Graphic Options
|
||||||
lstSettings.addItem(new BooleanSetting(FPref.UI_ENABLE_ONLINE_IMAGE_FETCHER,
|
lstSettings.addItem(new BooleanSetting(FPref.UI_ENABLE_ONLINE_IMAGE_FETCHER,
|
||||||
|
|||||||
Reference in New Issue
Block a user