Remove premature lobby start button
This commit is contained in:
@@ -38,7 +38,6 @@ var lobby_members_container: GridContainer = null
|
||||
var lobby_title_label: Label = null
|
||||
var lobby_detail_label: Label = null
|
||||
var ready_button: Button = null
|
||||
var start_button: Button = null
|
||||
var fake_peer_button: Button = null
|
||||
var fake_ready_button: Button = null
|
||||
var status_time_left := 0.0
|
||||
@@ -494,8 +493,6 @@ func _handle_packet(sender: int, data, is_loopback: bool = false) -> void:
|
||||
_set_member_ready(ready_sender, bool(data.get("ready", false)))
|
||||
_log("ready state from %s: %s" % [ready_sender, _ready_text(ready_sender)])
|
||||
_update_lobby_room()
|
||||
"lobby_start":
|
||||
_log("lobby start requested by %s: %s" % [sender, data])
|
||||
"run_started":
|
||||
_log("remote run started from %s: %s" % [sender, data.get("state", {})])
|
||||
"players_spawned":
|
||||
@@ -768,7 +765,6 @@ func _create_debug_panel() -> void:
|
||||
lobby_view.add_child(lobby_actions)
|
||||
|
||||
ready_button = _add_panel_button(lobby_actions, "Ready", "toggle_local_ready")
|
||||
start_button = _add_panel_button(lobby_actions, "Start", "request_lobby_start")
|
||||
fake_peer_button = _add_panel_button(lobby_actions, "Fake Peer", "toggle_fake_peer")
|
||||
fake_ready_button = _add_panel_button(lobby_actions, "Fake Ready", "toggle_fake_peer_ready")
|
||||
_add_panel_button(lobby_actions, "Ping", "send_ping")
|
||||
@@ -848,27 +844,6 @@ func toggle_local_ready() -> void:
|
||||
_update_lobby_room()
|
||||
|
||||
|
||||
func request_lobby_start() -> void:
|
||||
if lobby_id == 0:
|
||||
_log("create or join a lobby before starting")
|
||||
return
|
||||
if not is_host:
|
||||
_log("only the lobby host can start")
|
||||
return
|
||||
if not _all_members_ready():
|
||||
_log("cannot start: not all lobby members are ready")
|
||||
return
|
||||
var start_packet := {
|
||||
"type": "lobby_start",
|
||||
"from": steam_id,
|
||||
"lobby_id": str(lobby_id),
|
||||
"member_count": lobby_members.size(),
|
||||
"fake_peer_enabled": fake_peer_enabled
|
||||
}
|
||||
_log("lobby start ready: %s" % start_packet)
|
||||
_send_p2p_packet(0, start_packet)
|
||||
|
||||
|
||||
func toggle_fake_peer() -> void:
|
||||
if lobby_id == 0:
|
||||
_log("create a lobby before adding a fake peer")
|
||||
@@ -1119,8 +1094,6 @@ func _lobby_ready_summary() -> String:
|
||||
func _update_lobby_controls() -> void:
|
||||
if ready_button != null:
|
||||
ready_button.text = "Unready" if _is_member_ready(steam_id) else "Ready"
|
||||
if start_button != null:
|
||||
start_button.disabled = not is_host or not _all_members_ready()
|
||||
if fake_peer_button != null:
|
||||
fake_peer_button.text = "Remove Fake" if fake_peer_enabled else "Add Fake"
|
||||
if fake_ready_button != null:
|
||||
@@ -1189,7 +1162,6 @@ func _free_ui() -> void:
|
||||
lobby_title_label = null
|
||||
lobby_detail_label = null
|
||||
ready_button = null
|
||||
start_button = null
|
||||
fake_peer_button = null
|
||||
fake_ready_button = null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user