cmdline args for running debug sessions

This commit is contained in:
veclavtalica 2025-02-11 15:28:27 +03:00
parent 40f96d3f07
commit 7af091a2ce
2 changed files with 14 additions and 0 deletions

View File

@ -22,6 +22,9 @@ func _ready() -> void:
_on_chat_history_scroll_changed.bind(_chat_history_scroll_inactive)
)
if "--on-top" in OS.get_cmdline_args():
get_window().grab_focus()
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
if not multiplayer.is_server():

View File

@ -17,6 +17,14 @@ var _game_started := false
func _ready() -> void:
for arg in OS.get_cmdline_args():
if arg == "--host":
_on_host_button_pressed()
return
elif arg == "--join":
_on_join_button_pressed()
return
_start_menu.show()
_chat_menu.hide()
@ -46,6 +54,9 @@ func _register_player(username: String) -> void:
list_label.text = username
_player_list.add_child(list_label)
if id != 1 and "--immediate-start" in OS.get_cmdline_args():
_on_start_button_pressed()
@rpc("authority", "call_local", "reliable")
func _unregister_player(id: int) -> void: