26 lines
560 B
GDScript
26 lines
560 B
GDScript
extends HBoxContainer
|
|
|
|
export(String) var id = "Some UUID"
|
|
export(String) var text = "Lobby" setget set_text
|
|
export(int) var max_players = 20 setget set_max_players
|
|
export(int) var current_players = 1 setget set_current_players
|
|
export(bool) var locked = false
|
|
|
|
func _ready():
|
|
_update_text()
|
|
|
|
func _update_text():
|
|
$Label.text = "%s (%d/%d players)" % [text, current_players, max_players]
|
|
|
|
func set_text(t):
|
|
text = t
|
|
_update_text()
|
|
|
|
func set_max_players(n):
|
|
max_players = n
|
|
_update_text()
|
|
|
|
func set_current_players(n):
|
|
current_players = n
|
|
_update_text()
|