fix bug where the context menu does not go away when you click off

This commit is contained in:
Damien Ostler 2024-01-08 00:11:47 -05:00
parent f892d0b022
commit 3bdb5d3a2a

View File

@ -75,6 +75,8 @@ func try_to_open_context_menu():
if(inventory_context_menu!=null):
inventory_context_menu.queue_free()
show_context_menu(mouse_position,item.item_config)
else:
hide_context_menu()
# Function to show the context menu at a specific position
@ -89,7 +91,8 @@ func show_context_menu(mouse_pos: Vector2, item: ItemConfiguration):
# Function to hide the context menu
func hide_context_menu():
inventory_context_menu.queue_free()
if(inventory_context_menu!=null):
inventory_context_menu.queue_free()
func context_menu_open():
print("OPEN!")