aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-07-23 13:48:25 -0500
committerColin Okay <okay@toyful.space>2022-07-23 13:48:25 -0500
commit56b362557e5a5f8c1450058fc9e0ef4891473821 (patch)
tree620da7876c356e7ee2ce9ddfdc7b1ee7c79e00d6
parent066d60b4954e398656023b2436d2fde497f998d4 (diff)
[fix] ensure unit menu membership matches scene inclusion
-rw-r--r--gui/menus.lisp7
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))