Fix Move windows script
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user