fixed achievement to actually show.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
+ something about shepherd
|
||||
+ Worthy in wisdom
|
||||
+ Worthy in courage
|
||||
+
|
||||
+ Worthy in might
|
||||
+ Escaped jail
|
||||
+ Returned monacle
|
||||
|
||||
@@ -1 +1 @@
|
||||
14
|
||||
15
|
||||
|
||||
@@ -28,9 +28,17 @@
|
||||
[org.clojure/data.csv "0.1.3"]]
|
||||
|
||||
:warn-on-reflection true}
|
||||
:steam {
|
||||
:dependencies [[com.code-disaster.steamworks4j/steamworks4j "1.2.2"]]
|
||||
}
|
||||
:steam {:dependencies [[com.code-disaster.steamworks4j/steamworks4j "1.2.2"]]}
|
||||
:steam-dev {
|
||||
:source-paths ["src" "src-common" "src-dev"]
|
||||
:jvm-opts ["-Duse-repl=true"]
|
||||
:dependencies [[com.badlogicgames.gdx/gdx-tools "1.5.3"]
|
||||
[org.clojure/tools.nrepl "0.2.7"]
|
||||
[slamhound "1.5.5"]
|
||||
[org.clojure/data.csv "0.1.3"]
|
||||
[com.code-disaster.steamworks4j/steamworks4j "1.2.2"]]
|
||||
|
||||
:warn-on-reflection true}
|
||||
}
|
||||
:aot [advent.core.desktop-launcher]
|
||||
:main advent.core.desktop-launcher)
|
||||
|
||||
@@ -99,12 +99,14 @@
|
||||
(actions/update-entity entities :peeling #(assoc % :opacity 0))
|
||||
(actions/update-state entities (fn [state] (assoc state :opened-crack? true))))))
|
||||
:scripts {:stick (actions/get-script entities
|
||||
|
||||
(if (get-in @entities [:state :opened-crack?])
|
||||
(actions/talk entities :ego "I could shove the stick in that hole, but why?")
|
||||
(actions/do-dialogue entities
|
||||
:ego "It looks like that wall is crumbling."
|
||||
:ego "I can probably scratch it off with my hand.")))
|
||||
:sword (actions/get-script entities
|
||||
|
||||
(actions/do-dialogue entities
|
||||
:ego "I should be careful with this sword."
|
||||
:ego "It's sharp!"))})
|
||||
|
||||
@@ -15,6 +15,30 @@
|
||||
(when (and has-steam? (eval `(SteamAPI/isSteamRunning)))
|
||||
(eval `(SteamAPI/runCallbacks))))
|
||||
|
||||
(defn set-achievement [achievement]
|
||||
(defn achievement-fn [f achievement]
|
||||
(when has-steam?
|
||||
(eval `(.setAchievement (SteamUserStats. nil) ~achievement))))
|
||||
(eval `(let [stats# (atom nil)]
|
||||
(reset! stats# (SteamUserStats. (reify SteamUserStatsCallback
|
||||
(onUserStatsReceived [this# game-id# steam-user-id# result#]
|
||||
(~f @stats# ~achievement)
|
||||
)
|
||||
(onUserStatsStored [this# gameId# result#]
|
||||
)
|
||||
(onUserAchievementStored [_ _ _ _ _ _]
|
||||
))))
|
||||
(.requestCurrentStats @stats#)))))
|
||||
|
||||
(def set-achievement (partial achievement-fn
|
||||
(fn [stats achievement]
|
||||
(.setAchievement stats achievement)
|
||||
(.storeStats stats))))
|
||||
|
||||
(def clear-achievement (partial achievement-fn
|
||||
(fn [stats achievement]
|
||||
(.clearAchievement stats achievement)
|
||||
(.storeStats stats))))
|
||||
|
||||
(def all-achievements ["MASTER_SLEUTH"])
|
||||
|
||||
(defn clear-all-achievements []
|
||||
(doall (map clear-achievement all-achievements)))
|
||||
|
||||
Reference in New Issue
Block a user