more android tweaks.

This commit is contained in:
Bryce Covert
2015-09-11 23:01:22 -07:00
parent 0945a7fa78
commit 4d14cac8d9
3 changed files with 20 additions and 9 deletions

View File

@@ -49,10 +49,19 @@
resized ))
(defn save [entities]
(spit "save.edn" (entities :state)))
(doto (.getPreferences (Gdx/app) "ticks-tales-saves")
(.putString "save-1" (pr-str (entities :state)))
.flush))
(defn has-save? []
(-> (.getPreferences (Gdx/app) "ticks-tales-saves")
(.contains "save-1")))
(defn load []
(assoc (edn/read-string (slurp "save.edn")) :active? true))
(-> (.getPreferences (Gdx/app) "ticks-tales-saves")
(.getString "save-1")
edn/read-string
(assoc :active? true)))
(defn load-settings! []
(when (.exists (io/file "settings.edn"))