23 lines
590 B
GDScript3
23 lines
590 B
GDScript3
|
extends Panel
|
||
|
|
||
|
export var isBot: bool = false
|
||
|
export var playerName: String = "Nobody"
|
||
|
|
||
|
export var pickedColor: Color
|
||
|
export var pickingColor: Color
|
||
|
|
||
|
onready var playerIcon := $PlayerIcon
|
||
|
onready var playerNameLabel := $PlayerName
|
||
|
|
||
|
func _ready():
|
||
|
if isBot:
|
||
|
var atl := (playerIcon.texture as AtlasTexture).duplicate()
|
||
|
atl.region.position.x = 0
|
||
|
playerIcon.texture = atl
|
||
|
playerNameLabel.text = playerName
|
||
|
|
||
|
func set_picked(picked: bool):
|
||
|
if picked:
|
||
|
playerNameLabel.add_color_override("font_color", pickedColor)
|
||
|
else:
|
||
|
playerNameLabel.add_color_override("font_color", pickingColor)
|