fixed achievement to actually show.
This commit is contained in:
@@ -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