fix bugs
This commit is contained in:
@@ -44,23 +44,39 @@ func _ready():
|
||||
|
||||
func _check_command_line_args():
|
||||
var args = OS.get_cmdline_args()
|
||||
print("GameUI: Parsing command-line arguments: ", args)
|
||||
|
||||
# Parse arguments
|
||||
var should_host = false
|
||||
var should_join = false
|
||||
var should_debug = false
|
||||
var join_address = "127.0.0.1"
|
||||
var local_count = 1
|
||||
|
||||
for arg in args:
|
||||
if arg == "--host":
|
||||
should_host = true
|
||||
print("GameUI: Found --host argument")
|
||||
elif arg == "--join":
|
||||
should_join = true
|
||||
print("GameUI: Found --join argument")
|
||||
elif arg == "--room-debug":
|
||||
should_debug = true
|
||||
print("GameUI: Found --room-debug argument")
|
||||
elif arg.begins_with("--address="):
|
||||
join_address = arg.split("=")[1]
|
||||
elif arg.begins_with("--players="):
|
||||
local_count = int(arg.split("=")[1])
|
||||
|
||||
print("GameUI: Parsed flags - should_host: ", should_host, ", should_join: ", should_join, ", should_debug: ", should_debug)
|
||||
|
||||
# Set debug flag only if --room-debug is used with --host or --join
|
||||
if should_debug and (should_host or should_join):
|
||||
network_manager.show_room_labels = true
|
||||
print("Debug mode enabled: room labels will be shown")
|
||||
else:
|
||||
print("GameUI: Debug mode NOT enabled - should_debug: ", should_debug, ", should_host: ", should_host, ", should_join: ", should_join)
|
||||
|
||||
# Auto-start based on arguments
|
||||
if should_host:
|
||||
print("Auto-hosting due to --host argument")
|
||||
|
||||
Reference in New Issue
Block a user