WIP checkpoint: PC2: Wire "Enter World" from the browse list to the playable level
This commit is contained in:
+3
-5
@@ -79,13 +79,11 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
_update_input_direction(key)
|
||||
elif not key.pressed:
|
||||
_clear_input_direction(key)
|
||||
# Release the mouse so the player can get back to a menu/cursor.
|
||||
# Escape exits the level back to the world browse list, mirroring
|
||||
# the Back button pattern already used in world_list.gd/main_menu.gd.
|
||||
if key.pressed and key.keycode == KEY_ESCAPE:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
elif event is InputEventMouseButton and event.pressed:
|
||||
# Clicking back into the viewport re-captures the mouse.
|
||||
if Input.mouse_mode == Input.MOUSE_MODE_VISIBLE and DisplayServer.get_name() != "headless":
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
get_tree().change_scene_to_file("res://scenes/world_list.tscn")
|
||||
elif event is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
|
||||
_handle_mouse_look(event as InputEventMouseMotion)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user