New scoreboard viewing screengit commit -m "New scoreboard viewing screen"
This commit is contained in:
parent
155c86c013
commit
b61a5122f4
22 changed files with 739 additions and 67 deletions
|
@ -1,26 +1,47 @@
|
|||
tool
|
||||
extends HBoxContainer
|
||||
|
||||
const DIFFICULTY_ICONS = [
|
||||
preload("res://graphics/hud/scores/sweet.png"),
|
||||
preload("res://graphics/hud/scores/salty.png"),
|
||||
preload("res://graphics/hud/scores/spicy.png"),
|
||||
preload("res://graphics/hud/scores/pungent.png"),
|
||||
]
|
||||
|
||||
export var place: int = 0 setget _set_place
|
||||
export var user: String = "Username" setget _set_user
|
||||
export var score: String = "00000" setget _set_score
|
||||
export var player: String = "Username" setget _set_player
|
||||
export var score: int = 0 setget _set_score
|
||||
export var time: float = 0.0 setget _set_time
|
||||
export(int, "Sweet", "Salty", "Spicy", "Pungent") var difficulty: int = 0 setget _set_difficulty
|
||||
|
||||
func _ready() -> void:
|
||||
$Place.text = " %01d " % place
|
||||
$User.text = user
|
||||
$Score.text = score
|
||||
_set_place(place)
|
||||
_set_player(player)
|
||||
_set_score(score)
|
||||
_set_time(time)
|
||||
_set_difficulty(difficulty)
|
||||
|
||||
func _set_place(value: int) -> void:
|
||||
place = value
|
||||
if is_inside_tree():
|
||||
$Place.text = " %01d " % place
|
||||
$Place.text = "%d" % place
|
||||
|
||||
func _set_user(value: String) -> void:
|
||||
user = value
|
||||
func _set_player(value: String) -> void:
|
||||
player = value.substr(0, 10)
|
||||
if is_inside_tree():
|
||||
$User.text = user
|
||||
$Player.text = player
|
||||
|
||||
func _set_score(value: String) -> void:
|
||||
func _set_score(value: int) -> void:
|
||||
score = value
|
||||
if is_inside_tree():
|
||||
$Score.text = score
|
||||
$Score.text = "%05d" % score
|
||||
|
||||
func _set_time(value: float) -> void:
|
||||
time = value
|
||||
if is_inside_tree():
|
||||
$Time.text = Game.format_time(time)
|
||||
|
||||
func _set_difficulty(value: int) -> void:
|
||||
difficulty = value
|
||||
if is_inside_tree():
|
||||
$Difficulty.texture = DIFFICULTY_ICONS[difficulty]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue