forked from interstellar_development/freeftf
new work towards M8
This commit is contained in:
parent
5cd0c24223
commit
bb7fd5cb3b
13 changed files with 194 additions and 75 deletions
|
|
@ -11,9 +11,29 @@ extends Control
|
|||
|
||||
var elevated = false
|
||||
var done
|
||||
var map_name = "mansion"
|
||||
|
||||
func _ready():
|
||||
$player_customization/name.text = Game.settings["username"]
|
||||
var username_cmdline
|
||||
var roomname_cmdline
|
||||
for argument in OS.get_cmdline_args():
|
||||
if argument == "--username":
|
||||
username_cmdline = "ready"
|
||||
continue
|
||||
if argument == "--roomname":
|
||||
roomname_cmdline = "ready"
|
||||
continue
|
||||
if argument == "--autojoin":
|
||||
_on_join_pressed()
|
||||
if username_cmdline == "ready":
|
||||
username_cmdline = null
|
||||
$player_customization/name.text = argument
|
||||
if roomname_cmdline == "ready":
|
||||
roomname_cmdline = null
|
||||
$player_customization/ip.text = argument
|
||||
multiplayer.connected_to_server.connect(_on_connected_ok)
|
||||
multiplayer.peer_connected.connect(_sync_options)
|
||||
|
||||
func server_prepare():
|
||||
if Game.is_server:
|
||||
|
|
@ -23,6 +43,8 @@ func server_prepare():
|
|||
$start/start.show()
|
||||
$start/start.disabled = false
|
||||
$player_list/list.text = " "
|
||||
$options.show()
|
||||
$options/map_name/OptionButton.disabled = false
|
||||
|
||||
func _process(_delta):
|
||||
server_prepare()
|
||||
|
|
@ -55,3 +77,17 @@ func _on_connected_ok():
|
|||
$player_customization/join.disabled = true
|
||||
$player_customization/name.editable = false
|
||||
$player_customization/ip.editable = false
|
||||
|
||||
|
||||
func _on_option_button_item_selected(index):
|
||||
match index:
|
||||
0:
|
||||
map_name = "mansion"
|
||||
_:
|
||||
map_name = "mansion"
|
||||
for id in Game.player_list:
|
||||
Client.rpc_id(id, "sync_level", map_name)
|
||||
|
||||
func _sync_options():
|
||||
for id in Game.player_list:
|
||||
Client.rpc_id(id, "sync_level", map_name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue