2021-04-21 00:13:51 +00:00
|
|
|
(local util (require :lib.util))
|
|
|
|
(local {: defmulti : defmethod} (util.require :lib.multimethod))
|
|
|
|
(local {: textfield} (util.require :editor.imstate))
|
|
|
|
|
|
|
|
(local actions (util.hot-table ...))
|
|
|
|
|
|
|
|
(set actions.edit (defmulti #$1.action :edit ...))
|
|
|
|
(set actions.generate (defmulti #$1.action :generate ...))
|
|
|
|
|
|
|
|
(defmethod actions.edit :default (fn [action view x y w i] y))
|
|
|
|
|
2021-04-25 03:39:50 +00:00
|
|
|
(fn actions.register [key edit generate]
|
|
|
|
(when (= actions.actionlist nil)
|
|
|
|
(set actions.actionlist []))
|
2021-04-25 15:54:12 +00:00
|
|
|
(lume.remove actions.actionlist key)
|
2021-04-25 03:39:50 +00:00
|
|
|
(table.insert actions.actionlist key)
|
|
|
|
(defmethod actions.edit key edit)
|
|
|
|
(defmethod actions.generate key generate))
|
|
|
|
|
2021-04-21 00:13:51 +00:00
|
|
|
actions.hot
|