|
@@ -226,27 +226,29 @@ a|Restart()ing a running game restarts the game context and applies the updated
|
|
|
|
|
|
== Saving and Loading Settings
|
|
== Saving and Loading Settings
|
|
|
|
|
|
-An AppSettings object also supports the following methods to save your settings under a unique key (in this example "`com.foo.MyCoolGame3`"):
|
|
|
|
|
|
+An AppSettings object also supports the following methods to save your settings under a unique key (in this example "`com/foo/mycoolgame3`"):
|
|
|
|
|
|
-* Use `settings.save("com.foo.MyCoolGame3")` to save your settings via standard java.io serialization.
|
|
|
|
-* Use `settings.load("com.foo.MyCoolGame3")` to load your settings.
|
|
|
|
|
|
+* Use `settings.save("com/foo/mycoolgame3")` to save your settings via standard java.io serialization.
|
|
|
|
+* Use `settings.load("com/foo/mycoolgame3")` to load your settings.
|
|
* Use `settings2.copyFrom(settings)` to copy a settings object.
|
|
* Use `settings2.copyFrom(settings)` to copy a settings object.
|
|
|
|
|
|
Usage:
|
|
Usage:
|
|
|
|
|
|
-Provide the unique name of your jME3 application as the String argument. For example `com.foo.MyCoolGame3`.
|
|
|
|
|
|
+Provide the unique name of your jME3 application as the String argument. For example `com/foo/mycoolgame3`.
|
|
|
|
|
|
[source,java]
|
|
[source,java]
|
|
----
|
|
----
|
|
|
|
|
|
- try { settings.save("com.foo.MyCoolGame3"); }
|
|
|
|
|
|
+ try { settings.save("com/foo/mycoolgame3"); }
|
|
catch (BackingStoreException ex) { /** could not save settings */ }
|
|
catch (BackingStoreException ex) { /** could not save settings */ }
|
|
|
|
|
|
----
|
|
----
|
|
|
|
|
|
* On Windows, the preferences are saved under the following registry key: +
|
|
* On Windows, the preferences are saved under the following registry key: +
|
|
-`HKEY_CURRENT_USER\Software\JavaSoft\Prefs\com\foo\MyCoolGame3`
|
|
|
|
|
|
+`HKEY_CURRENT_USER\Software\JavaSoft\Prefs\com\foo\mycoolgame3`
|
|
* On Linux, the preferences are saved in an XML file under: +
|
|
* On Linux, the preferences are saved in an XML file under: +
|
|
-`$HOME/.java/.userPrefs/com/foo/MyCoolGame3`
|
|
|
|
|
|
+`$HOME/.java/.userPrefs/com/foo/mycoolgame3`
|
|
* On Mac +++<abbr title="Operating System">OS</abbr>+++ X, the preferences are saved as XML file under: +
|
|
* On Mac +++<abbr title="Operating System">OS</abbr>+++ X, the preferences are saved as XML file under: +
|
|
-`$HOME/Library/Preferences/com.foo.MyCoolGame3.plist`
|
|
|
|
|
|
+`$HOME/Library/Preferences/com.foo.mycoolgame3.plist`
|
|
|
|
+
|
|
|
|
+CAUTION: Due to a current bug and inconsistent behavior observed related to the preferences save location, to ensure correct behavior, save() and load() should only use forward slashes (/) and must be all lowercase. More information can be found link:https://github.com/jMonkeyEngine/jmonkeyengine/issues/1161[here].
|