# HG changeset patch # User # Date 2020-05-05 22:35:45 # Node ID 0669fc214b7419b1f4b2999790b5e6df3f651eab # Parent 65a579dbf36457933393c67324573b1b06d0c85e Remove curact, implement selact diff --git a/src/api.ps b/src/api.ps --- a/src/api.ps +++ b/src/api.ps @@ -146,10 +146,8 @@ (void)) (defun call-act (title) - (setf *current-action title) (with-frame (funcall (getprop *acts title :act))) - (setf *current-action nil) (void)) ;;; Text windows @@ -190,8 +188,8 @@ (create :title title :img img :act act :selected nil)) (update-acts)) -(defun del-act (&optional title) - (delete (getprop *acts (or title *current-action))) +(defun del-act (title) + (delete (getprop *acts title)) (update-acts)) (defun clear-act () diff --git a/src/intrinsic-macros.lisp b/src/intrinsic-macros.lisp --- a/src/intrinsic-macros.lisp +++ b/src/intrinsic-macros.lisp @@ -102,9 +102,6 @@ ;;; 14act -(defpsmacro curact () - `*current-action) - (defpsmacro showacts (enable) `(api-call enable-frame :acts ,enable)) diff --git a/src/intrinsics.ps b/src/intrinsics.ps --- a/src/intrinsics.ps +++ b/src/intrinsics.ps @@ -191,6 +191,11 @@ ;;; 14act +(defun selact () + (loop :for (k v) :of *acts + :do (when (@ v :selected) + (return-from selact (@ v :name))))) + (defun curacts () (let ((acts (api-call copy-obj *acts))) (lambda () diff --git a/src/main.ps b/src/main.ps --- a/src/main.ps +++ b/src/main.ps @@ -7,7 +7,6 @@ ;; Inventory (objects) (var *objs (create)) (var *current-location nil) -(var *current-action nil) ;; Game time (var *started-at (chain *date (now))) ;; Timers diff --git a/src/package.lisp b/src/package.lisp --- a/src/package.lisp +++ b/src/package.lisp @@ -8,7 +8,7 @@ (:export #:api-call #:by-id #:has - #:*globals #:*objs #:*current-location #:*current-action + #:*globals #:*objs #:*current-location #:*started-at #:*timer-interval #:*timer-obj #:*loaded-games #:*acts #:*state-stash #:*playing #:*locals