Skip to content

Commit

Permalink
Fix for cascaded menus on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
RodZill4 committed Dec 24, 2023
1 parent 30c5ad6 commit 8ccc0a6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions material_maker/globals_menu_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,13 @@ class MenuDisplayServer:
func add_item(label: String, id: int = -1, accel : Key = 0 as Key):
if accel & KEY_MASK_CTRL:
accel = ((accel & ~KEY_MASK_CTRL) | KEY_MASK_META) as Key
var key = str(get_instance_id())+","+str(id)
var tag = str(get_instance_id())+","+str(id)
var callback : Callable = mm_globals.menu_manager.my_callback
var index : int = DisplayServer.global_menu_add_item(menu_name, label, callback, callback, key, accel)
var index : int = DisplayServer.global_menu_add_item(menu_name, label, callback, callback, tag, accel)
if id == -1:
id = index
tag = str(get_instance_id())+","+str(id)
DisplayServer.global_menu_set_item_tag(menu_name, index, tag)
indexes[id] = index

func add_icon_item(_icon: Texture2D, label: String, id: int = -1, accel: Key = 0 as Key):
Expand Down

0 comments on commit 8ccc0a6

Please sign in to comment.