diff options
author | Colin Okay <okay@toyful.space> | 2022-07-23 13:48:25 -0500 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2022-07-23 13:48:25 -0500 |
commit | 56b362557e5a5f8c1450058fc9e0ef4891473821 (patch) | |
tree | 620da7876c356e7ee2ce9ddfdc7b1ee7c79e00d6 /gui/menus.lisp | |
parent | 066d60b4954e398656023b2436d2fde497f998d4 (diff) |
[fix] ensure unit menu membership matches scene inclusion
Diffstat (limited to 'gui/menus.lisp')
-rw-r--r-- | gui/menus.lisp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gui/menus.lisp b/gui/menus.lisp index 2a2e938..2bc5c22 100644 --- a/gui/menus.lisp +++ b/gui/menus.lisp @@ -44,13 +44,16 @@ (defmethod add-menu-option ((menu menu) option) (setf (unit-region option) (unit-region menu)) (setf (menu-options menu) - (nconc (menu-options menu) (list option)))) + (nconc (menu-options menu) (list option))) + (when (unit-in-scene-p menu) + (add-unit option))) (defun remove-menu-option (menu option) (when (member option (menu-options menu)) (setf (unit-region option) *application*) (setf (menu-options menu) - (delete option (menu-options menu))))) + (delete option (menu-options menu))) + (drop-unit option))) (defmethod render ((menu menu)) (dolist (o (menu-options menu)) |