Dungeon Browser issue
This commit is contained in:
+19
-10
@@ -3,21 +3,30 @@ extends PanelContainer
|
||||
signal join_pressed(dungeon_id: String)
|
||||
|
||||
var dungeon_id: String = ""
|
||||
|
||||
@onready var tier_label = $HBoxContainer/InfoContainer/TierLabel
|
||||
@onready var creator_label = $HBoxContainer/InfoContainer/CreatorLabel
|
||||
@onready var players_label = $HBoxContainer/InfoContainer/PlayersLabel
|
||||
@onready var status_label = $HBoxContainer/StatusContainer/StatusLabel
|
||||
@onready var timer_label = $HBoxContainer/StatusContainer/TimerLabel
|
||||
@onready var join_button = $HBoxContainer/JoinButton
|
||||
|
||||
var join_window_end: float = 0
|
||||
var is_join_window_open: bool = false
|
||||
|
||||
var tier_label: Label
|
||||
var creator_label: Label
|
||||
var players_label: Label
|
||||
var status_label: Label
|
||||
var timer_label: Label
|
||||
var join_button: Button
|
||||
|
||||
func _ready():
|
||||
tier_label = $HBoxContainer/InfoContainer/TierLabel
|
||||
creator_label = $HBoxContainer/InfoContainer/CreatorLabel
|
||||
players_label = $HBoxContainer/InfoContainer/PlayersLabel
|
||||
status_label = $HBoxContainer/StatusContainer/StatusLabel
|
||||
timer_label = $HBoxContainer/StatusContainer/TimerLabel
|
||||
join_button = $HBoxContainer/JoinButton
|
||||
join_button.pressed.connect(_on_join_pressed)
|
||||
|
||||
func setup(data: Dictionary, is_persisted: bool):
|
||||
# Defer setup to ensure nodes are ready
|
||||
call_deferred("_do_setup", data, is_persisted)
|
||||
|
||||
func _do_setup(data: Dictionary, is_persisted: bool):
|
||||
dungeon_id = data.get("id", "")
|
||||
|
||||
var tier = data.get("tier", 1)
|
||||
@@ -55,8 +64,8 @@ func setup(data: Dictionary, is_persisted: bool):
|
||||
join_button.disabled = true
|
||||
join_button.text = "Full"
|
||||
|
||||
func _process(delta: float):
|
||||
if is_join_window_open:
|
||||
func _process(_delta: float):
|
||||
if is_join_window_open and timer_label:
|
||||
var now = Time.get_ticks_msec() / 1000.0
|
||||
var remaining = max(0, join_window_end - now)
|
||||
if remaining > 0:
|
||||
|
||||
Reference in New Issue
Block a user