diff --git a/Net/network_manager.gd b/Net/network_manager.gd index 18bb5f3..d474f04 100644 --- a/Net/network_manager.gd +++ b/Net/network_manager.gd @@ -431,6 +431,8 @@ func request_join(ip: String) -> void: pending_ip = ip func consume_pending_session() -> void: + if is_online(): + return if pending_action == "host": pending_action = "" host() diff --git a/Scenes/day_controller.gd b/Scenes/day_controller.gd index 75be1d5..52a33e8 100644 --- a/Scenes/day_controller.gd +++ b/Scenes/day_controller.gd @@ -9,7 +9,8 @@ var customers_served: int = 0 func _ready() -> void: - GameManager.set_game_state(GameManager.GameState.BUILDING) + if NetworkManager.owns_world(): + GameManager.set_game_state(GameManager.GameState.BUILDING) Signals.game_state_changed.connect(_on_game_state_changed) Signals.table_satisfied.connect(_on_table_statisfied) diff --git a/global/debug/move_windows.gd b/global/debug/move_windows.gd index 27c5687..5b975bd 100644 --- a/global/debug/move_windows.gd +++ b/global/debug/move_windows.gd @@ -1,20 +1,20 @@ extends Node +## Nudge down from the screen top so the window's title bar/menu stays visible. +const SERVER_Y_OFFSET := 45 + func _ready() -> void: - if OS.has_feature("editor"): - # Force subwindows to be native OS windows instead of embedded viewports + # Only the (non-VR) server window needs positioning; the VR instance's + # window is left wherever the OS/editor puts it. + if OS.has_feature("editor") and OS.get_cmdline_args().has("--server"): get_tree().root.gui_embed_subwindows = false get_tree().create_timer(0.05).timeout.connect(_position_window) func _position_window() -> void: - var is_server: bool = OS.get_cmdline_args().has("--server") var screen_rect: Rect2i = DisplayServer.screen_get_usable_rect(DisplayServer.window_get_current_screen()) - + @warning_ignore("integer_division") var window_width: int = screen_rect.size.x / 2 - var window_height: int = int(screen_rect.size.y * (2.0 / 3.0)) - - DisplayServer.window_set_size(Vector2i(window_width - 10, window_height)) - if is_server: - var x_pos: int = screen_rect.position.x + window_width - DisplayServer.window_set_position(Vector2i(x_pos, screen_rect.position.y)) + var x_pos: int = screen_rect.position.x + window_width + var y_pos: int = screen_rect.position.y + SERVER_Y_OFFSET + DisplayServer.window_set_position(Vector2i(x_pos, y_pos)) diff --git a/test/vr_spectator_camera.gd b/test/vr_spectator_camera.gd index 2e7225a..23dce85 100644 --- a/test/vr_spectator_camera.gd +++ b/test/vr_spectator_camera.gd @@ -12,7 +12,7 @@ var _camera: Camera3D func _ready() -> void: var xr_interface := XRServer.find_interface("OpenXR") if xr_interface and xr_interface.is_initialized(): - SweetLogger.warning("{0} disabled - this instance is the VR client", [name]) + SweetLogger.debug("{0} disabled - this instance is the VR client", [name]) return if not _players: SweetLogger.warning("{0} could not resolve players_path {1}", [name, players_path])