diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2019-11-27 14:43:52 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2019-11-27 14:43:52 +0100 |
commit | 3d30197a7f37d15da1649a9b40a24774b4aae06d (patch) | |
tree | ffa5686af360894a9b4578edff759fd2ee742ad1 /core/src/ch/asynk/rustanddust/RustAndDust.java | |
parent | 46e76a564882f4297d9f3a0644aeb758dbf9f276 (diff) | |
download | RustAndDust-3d30197a7f37d15da1649a9b40a24774b4aae06d.zip RustAndDust-3d30197a7f37d15da1649a9b40a24774b4aae06d.tar.gz |
better sqlite path on unix
Diffstat (limited to 'core/src/ch/asynk/rustanddust/RustAndDust.java')
-rw-r--r-- | core/src/ch/asynk/rustanddust/RustAndDust.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/src/ch/asynk/rustanddust/RustAndDust.java b/core/src/ch/asynk/rustanddust/RustAndDust.java index c25862f..af6dcee 100644 --- a/core/src/ch/asynk/rustanddust/RustAndDust.java +++ b/core/src/ch/asynk/rustanddust/RustAndDust.java @@ -65,6 +65,7 @@ public class RustAndDust extends Game public static final String DOM = "RustAndDust"; public static final String DB_FILE = "rustanddust.sqlite"; + public static final String CONFIG_PATH = ".config/rustanddust"; public AssetManager manager; public Factory factory; @@ -122,7 +123,11 @@ public class RustAndDust extends Game { switch (Gdx.app.getType()) { case Desktop: - return String.format("data/%s", DB_FILE); + if (!System.getProperty("os.name").startsWith("Windo")) { + final String dir = String.format("%s/%s", System.getProperty("user.home"), CONFIG_PATH); + new java.io.File(dir).mkdir(); + return String.format("%s/%s", dir, DB_FILE); + } } return DB_FILE; } @@ -135,7 +140,6 @@ public class RustAndDust extends Game debug("create() [" + Gdx.graphics.getWidth() + ";" + Gdx.graphics.getHeight() + "] " + Gdx.graphics.getDensity() + " -> " + hudCorrection); db = new DB(Gdx.files.internal(dbFile()).path(), false); - db.setup(); manager = new AssetManager(); factory = new Factory(this); |