progress on inventory drag out interaction.

This commit is contained in:
Bryce Covert
2016-08-03 12:43:15 -07:00
parent 6ffe5d2caf
commit 8308c28aa7
3 changed files with 17 additions and 14 deletions

View File

@@ -249,8 +249,9 @@ void main ()
(when (and (not (get-in entities [:fg-actions :script-running?]))
(= (get-in entities [:cursor :down-target])
(or (:id interacting-entity) (:id interaction) nil)))
(or (= (get-in entities [:cursor :down-target])
(or (:id interacting-entity) (:id interaction) nil))
(get-in entities [:cursor :came-from-inventory?])))
((or (when (and interacting-entity (not (:cursor interaction)))
(do (screen! hud :on-start-script)
((:get-script interacting-entity) (or (get-selected-inventory-item) (get-in entities [:cursor :current])) [x y])))
@@ -883,7 +884,6 @@ void main ()
entities))
(defn update-cursor [screen {{:keys [current override last active was-active]} :cursor :as entities}]
(if (= 0.0 (get-in entities [:fade :opacity]))
(let [new-current (or override (get-selected-inventory-item) current)]
(when-not (and (= new-current
@@ -896,7 +896,6 @@ void main ()
entities))
(defn get-looped-animation-point [^Animation animation ^double total-time]
(mod total-time (animation! animation :get-animation-duration)))
@@ -1367,11 +1366,12 @@ void main ()
:on-deactivate (fn [screen [entities]]
(assoc-in entities [:state :active?] false))
:on-reactivate (fn [{:keys [script-started?] :as screen} [entities]]
:on-reactivate (fn [{:keys [script-started? came-from-inventory?] :as screen} [entities]]
(screen! hud :on-reactivate :cursor (get-in entities [:cursor :current]) :script-started? script-started?)
(-> entities
(assoc-in [:state :active?] true)
(assoc-in [:cursor :current] :main)))
(assoc-in [:cursor :current] :main)
(assoc-in [:cursor :came-from-inventory?] came-from-inventory?)))
:on-end-safe (fn [screen [entities]]
((actions/get-script entities