drew some stuff, ux improvements, more action types

This commit is contained in:
Jeremy Penner 2021-04-25 14:31:39 -04:00
parent 9afb6925cd
commit beb2a60025
6 changed files with 19 additions and 12 deletions

Binary file not shown.

View file

@ -11,15 +11,15 @@
character (or action.character (. characters 1)) character (or action.character (. characters 1))
lines (or action.lines []) lines (or action.lines [])
(character y) (dropdown view [:say :char i] character characters x (+ y style.padding.y) w) (character y) (dropdown view [:say :char i] character characters x (+ y style.padding.y) w)
(line1 y) (textbox view [:say :line1 i] (. lines 1) x (+ y style.padding.y) w) (line1 y) (textbox view [:say :line1 i] (or (. lines 1) "") x (+ y style.padding.y) w)
(line2 y) (textbox view [:say :line2 i] (. lines 2) x y w) (line2 y) (textbox view [:say :line2 i] (or (. lines 2) "") x y w)
(line3 y) (textbox view [:say :line3 i] (. lines 3) x y w) (line3 y) (textbox view [:say :line3 i] (or (. lines 3) "") x y w)
(line4 y) (textbox view [:say :line4 i] (. lines 4) x y w)] (line4 y) (textbox view [:say :line4 i] (or (. lines 4) "") x y w)]
(set action.character character) (set action.character character)
(util.nested-tset action [:lines 1] line1) (util.nested-tset action [:lines 1] (line1:sub 1 33))
(util.nested-tset action [:lines 2] line2) (util.nested-tset action [:lines 2] (line2:sub 1 33))
(util.nested-tset action [:lines 3] line3) (util.nested-tset action [:lines 3] (line3:sub 1 33))
(util.nested-tset action [:lines 4] line4) (util.nested-tset action [:lines 4] (line4:sub 1 33))
y)) y))
(fn [action vm] (fn [action vm]
(local {: say} (require :game.defs)) (local {: say} (require :game.defs))
@ -37,6 +37,9 @@
(set action.position position) (set action.position position)
y)) y))
(fn [action vm] (fn [action vm]
(values action.position :lit action.map :map-player-yx-ptr :set :lit action.map :next-level :set))) (values :move-to-responder action.position :lit action.map :map-player-yx-ptr :set :lit action.map :next-level :set)))
(actions.register-const :move-here :move-to-responder)
(actions.register-const :disappear :disappear)
{} {}

View file

@ -17,4 +17,7 @@
(defmethod actions.edit key edit) (defmethod actions.edit key edit)
(defmethod actions.generate key generate)) (defmethod actions.generate key generate))
(fn actions.register-const [key generated-value]
(actions.register key (fn [action view x y w i] y) #generated-value))
actions.hot actions.hot

View file

@ -18,8 +18,8 @@
:boot :boot
[:jsr :reset] [:jsr :reset]
[:jsr :interpret] [:jsr :interpret]
[:vm :hires [:vm :hires]
(when (util.file-exists "game/title.screen") (values (vm:pstr "TITLE.SCREEN") :loadscreen))]) (when (util.file-exists "game/title.screen") [:vm (vm:pstr "TITLE.SCREEN") :loadscreen]))
(each [addr _ (pairs prg.org-to-block)] (each [addr _ (pairs prg.org-to-block)]
(when (~= addr org.boot.org) (when (~= addr org.boot.org)
(local filename (.. "STUFF." (length prg.files))) (local filename (.. "STUFF." (length prg.files)))

View file

@ -91,6 +91,7 @@
] [:drop])) ] [:drop]))
(vm:word :move-to-responder :get-responder :get :move-player-to) (vm:word :move-to-responder :get-responder :get :move-player-to)
(vm:word :disappear :get-responder 0 :set-entitytile 0xffff :get-responder :set)
(fn append-from-map [map entity-org prefix] (fn append-from-map [map entity-org prefix]
(entity-org:append [:align 0x100]) (entity-org:append [:align 0x100])

File diff suppressed because one or more lines are too long