steam shares should work.

This commit is contained in:
Bryce Covert
2015-11-22 14:20:58 -08:00
parent bbf8e5f61f
commit 88d2d11a31

View File

@@ -15,7 +15,9 @@
(defmacro steamify [steam-version & [regular-version]]
(if has-steam?
steam-version
`(if has-steam?
~steam-version
~regular-version)
regular-version))
(defn init []
@@ -71,7 +73,7 @@
(-> bb (.put bytes) )
(.fileWrite rs filename bb (* 2 (count bytes))))
(let [f (files! :local filename)]
(.write f bytes false))))
(.writeBytes f bytes false))))
(defn list-edn-files []
(steamify
@@ -83,20 +85,6 @@
(for [save-file (.list (files! :local ".") ".edn")]
(.name save-file))))
(defn snapshot-list []
(steamify
(let [rs (SteamRemoteStorage. nil)]
(for [i (range (.getFileCount rs))
:let [len (* 1024 1024)
n (.getFileNameAndSize rs i (make-array Integer/TYPE 1))
bb (ByteBuffer/allocateDirect len)]
:when (.endsWith n ".edn")]
(do
(.fileRead rs n bb len)
(-> bb .asCharBuffer .toString edn/read-string))))
(for [save-file (.list (files! :local ".") ".edn")]
(edn/read-string (.readString save-file)))))
(defn save-screenshot [pm filename]
(steamify
(let [rs (SteamRemoteStorage. nil)