fixes.
This commit is contained in:
@@ -1515,7 +1515,6 @@
|
||||
)))
|
||||
|
||||
:on-tap (fn [screen entities options]
|
||||
(println "tapping")
|
||||
(when utils/mobile?
|
||||
(handle-touch-up screen entities options)))
|
||||
|
||||
@@ -1551,6 +1550,7 @@
|
||||
(screen! toast-screen :on-toast { :message (str "Saved \"" save-name "\"")}))))
|
||||
|
||||
:on-menu (fn [{:keys [viewport] :as screen} entities options]
|
||||
(println "HERE TESTTTT")
|
||||
(when-not (or (get-in entities [:tweens :fade-out])
|
||||
(get-in entities [:tweens :fade-in]))
|
||||
|
||||
@@ -1621,7 +1621,7 @@
|
||||
(let [scene-entities (-> scene :entities deref)]
|
||||
(and (not (get-in scene-entities [:fg-actions :script-running?]))
|
||||
(get-in scene-entities [:state :active?])
|
||||
(not= (get-in scene-entities [:state :last-room]) :tongue-fight)
|
||||
|
||||
(= 0.0 (get-in scene-entities [:fade :opacity])))))
|
||||
|
||||
(defmulti transition-hud (fn [screen entities new-state state-data]
|
||||
@@ -1960,11 +1960,15 @@
|
||||
:x (- 320 (* utils/ui-scale 16) 4) :y 240
|
||||
:origin-x 16 :origin-y 16
|
||||
:width 16 :height 16
|
||||
:enabled? (not= (get-in (-> scene :entities deref) [:state :last-room])
|
||||
:tongue-fight)
|
||||
:baseline 9000
|
||||
:opacity 0.8)
|
||||
:inventory (assoc (utils/atlas->texture global-atlas "inventory") :x (* 21 utils/ui-scale ) :y (* 27 utils/ui-scale ) :baseline 9000
|
||||
:intersect-width 42 :intersect-height 48
|
||||
:width 42 :height 56
|
||||
:enabled? (not= (get-in (-> scene :entities deref) [:state :last-room])
|
||||
:tongue-fight)
|
||||
:origin-x 21 :origin-y 27
|
||||
:scale-x utils/ui-scale :scale-y utils/ui-scale
|
||||
:open (utils/flip (doto (utils/make-anim-seq global-atlas "open-inventory" [42 56] 0.055 (flatten [(range 6) 6 7 8 7 ]))
|
||||
@@ -1981,6 +1985,13 @@
|
||||
:fps (->> (assoc (label "" (color :white) ) :y 10 :x 280 :baseline 0 :opacity 0.1)
|
||||
(utils/add-actor-to-stage screen))}))
|
||||
|
||||
:on-tongue-fight
|
||||
(fn [screen entities options]
|
||||
(println "OPTIONS ARE" screen)
|
||||
(-> entities
|
||||
(assoc-in [:inventory :enabled?] false)
|
||||
(assoc-in [:save :enabled?] false)))
|
||||
|
||||
:on-render
|
||||
(fn [{:keys [^FitViewport viewport] :as screen} entities options]
|
||||
(.apply viewport)
|
||||
@@ -2008,17 +2019,22 @@
|
||||
(update-in entities [:save] assoc :r 0.75 :g 0.75 :b 0.75)
|
||||
(grow-hud screen entities :save false)))
|
||||
|
||||
entities (or (process-fsm screen entities) entities)]
|
||||
entities (or (process-fsm screen entities) entities)
|
||||
on-tongue-fight? (= :tongue-fight
|
||||
(get-in (-> scene :entities deref) [:state :last-room]))]
|
||||
#_(label! (:fps entities) :set-text (str (game :fps)))
|
||||
|
||||
|
||||
|
||||
(render-one screen (if (and hud-interactable? (not (:already-saved? entities)))
|
||||
(:save entities)
|
||||
(assoc (:save entities) :opacity 0.5)))
|
||||
(render-one screen (if hud-interactable?
|
||||
(:inventory entities)
|
||||
(assoc (:inventory entities) :opacity 0.5)))
|
||||
(when (:enabled? (:save entities))
|
||||
(render-one screen (if (and hud-interactable? (not (:already-saved? entities)))
|
||||
(:save entities)
|
||||
(assoc (:save entities) :opacity 0.5))))
|
||||
|
||||
(when (:enabled? (:inventory entities))
|
||||
(render-one screen (if hud-interactable?
|
||||
(:inventory entities)
|
||||
(assoc (:inventory entities) :opacity 0.5))))
|
||||
(render-one screen (:selected-item entities))
|
||||
(render-one screen (:close entities))
|
||||
entities))
|
||||
@@ -2116,6 +2132,7 @@
|
||||
|
||||
:on-tap
|
||||
(fn [screen entities options]
|
||||
(println "is enabled?" (:enabled? (:inventory entities)))
|
||||
(if (= (button-code :left) (:button options))
|
||||
(let [[x y] (utils/unproject screen options)]
|
||||
(cond
|
||||
@@ -2123,7 +2140,8 @@
|
||||
nil
|
||||
|
||||
|
||||
(utils/intersects? (:inventory entities) [x y])
|
||||
(and (utils/intersects? (:inventory entities) [x y])
|
||||
(:enabled? (:inventory entities)))
|
||||
|
||||
(if (= :selected (get-in entities [:inv-fsm :state]))
|
||||
(update-in entities [:inv-fsm :pending-states] conj [:none (get-in entities [:inv-fsm :state-data])])
|
||||
@@ -2135,7 +2153,7 @@
|
||||
(utils/intersects? (:close entities) [x y])
|
||||
(screen! scene :on-menu {})
|
||||
|
||||
(and (not (:already-saved? entities)) (utils/intersects? (:save entities) [x y]) (hud-interactable?))
|
||||
(and (not (:already-saved? entities)) (utils/intersects? (:save entities) [x y]) (hud-interactable?) (:enabled? (:save entities)))
|
||||
(do
|
||||
(screen! scene :on-save {})
|
||||
(assoc entities :already-saved? true))
|
||||
|
||||
Reference in New Issue
Block a user