27 lines
491 B
GDScript
27 lines
491 B
GDScript
extends VBoxContainer
|
|
|
|
enum ButtonLightType{
|
|
green,# 绿色按钮
|
|
red,#红色按钮
|
|
black,#黑色按钮
|
|
}
|
|
|
|
@export var buttonLightType:ButtonLightType
|
|
|
|
@export var buttonHasLight:bool
|
|
|
|
@export var lightText:String
|
|
|
|
@export var buttonText:String
|
|
|
|
signal clickButtonSignal(openLight:bool,button)
|
|
|
|
|
|
func _ready() -> void:
|
|
$Button/MarginContainer/Label.text=buttonText
|
|
if buttonHasLight:
|
|
$Light.visible = true
|
|
$Light/MarginContainer/Label.text=lightText
|
|
else:
|
|
$Light.visible = false
|