fixed inventory + using Sync bindings
This commit is contained in:
@@ -32,12 +32,21 @@ func _exit_tree() -> void:
|
||||
|
||||
func close() -> void:
|
||||
menu_closing.emit()
|
||||
hide()
|
||||
queue_free()
|
||||
|
||||
func hide_menu() -> void:
|
||||
_scene_tree.paused = _initial_pause_state
|
||||
Input.set_mouse_mode(_initial_mouse_mode)
|
||||
if is_instance_valid(_initial_focus_control) and _initial_focus_control.is_inside_tree():
|
||||
_initial_focus_control.focus_mode = _initial_focus_mode
|
||||
_initial_focus_control.grab_focus()
|
||||
queue_free()
|
||||
|
||||
GUIDE.disable_mapping_context(menu_context)
|
||||
for previous_context in previous_mapping_contexts:
|
||||
GUIDE.enable_mapping_context(previous_context)
|
||||
|
||||
visible = false
|
||||
|
||||
func _handle_cancel_input() -> void:
|
||||
close()
|
||||
@@ -45,7 +54,7 @@ func _handle_cancel_input() -> void:
|
||||
func _on_close_button_pressed() -> void:
|
||||
close()
|
||||
|
||||
func _enter_tree() -> void:
|
||||
func show_menu() -> void:
|
||||
_scene_tree = get_tree()
|
||||
_initial_pause_state = _scene_tree.paused
|
||||
_initial_mouse_mode = Input.get_mouse_mode()
|
||||
@@ -61,5 +70,11 @@ func _enter_tree() -> void:
|
||||
for previous_context in previous_mapping_contexts:
|
||||
GUIDE.disable_mapping_context(previous_context)
|
||||
GUIDE.enable_mapping_context(menu_context)
|
||||
|
||||
visible = true
|
||||
|
||||
func _enter_tree() -> void:
|
||||
print("enter_tree")
|
||||
show_menu()
|
||||
back_action.triggered.connect(_handle_cancel_input)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user