2024-09-27 11:47:19 +08:00
|
|
|
|
extends PanelContainer
|
|
|
|
|
class_name StartConfigMes
|
|
|
|
|
var data:Dictionary
|
|
|
|
|
signal click(mes:StartConfigMes,ind:int)
|
|
|
|
|
const LOCK = preload("res://res/ui/ui_010_start_config/tuceng359.png")
|
|
|
|
|
const SELECTED = preload("res://res/ui/ui_010_start_config/tuceng356.png")
|
|
|
|
|
var index:int=0
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
|
func _ready() -> void:
|
|
|
|
|
pass # Replace with function body.
|
2024-09-27 17:51:20 +08:00
|
|
|
|
#-1:上锁,0,解锁未选择,1:解锁且选择 -2:刚实例出来
|
2024-09-27 11:47:19 +08:00
|
|
|
|
var state:int=-2:
|
|
|
|
|
set(val):
|
|
|
|
|
if val!=state:
|
|
|
|
|
state=val
|
|
|
|
|
match val:
|
|
|
|
|
-1:
|
|
|
|
|
%btn_icon.show()
|
|
|
|
|
%btn_icon.texture=LOCK
|
|
|
|
|
%select_label.hide()
|
|
|
|
|
%btn.disabled=true
|
|
|
|
|
0:
|
|
|
|
|
%btn_icon.hide()
|
|
|
|
|
%select_label.show()
|
|
|
|
|
%btn.disabled=false
|
|
|
|
|
1:
|
|
|
|
|
%btn_icon.show()
|
|
|
|
|
%btn_icon.texture=SELECTED
|
|
|
|
|
%select_label.hide()
|
|
|
|
|
%btn.disabled=true
|
|
|
|
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
|
|
|
func _process(delta: float) -> void:
|
|
|
|
|
pass
|
|
|
|
|
func set_data(_data):
|
|
|
|
|
data=_data
|
|
|
|
|
%name.text=data["name"]
|
|
|
|
|
%intro.text=data["introduction"]
|
|
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_btn_pressed() -> void:
|
|
|
|
|
click.emit(self,index)
|
|
|
|
|
pass # Replace with function body.
|