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