2024-09-23 11:47:55 +08:00
|
|
|
extends MarginContainer
|
2024-09-23 17:27:43 +08:00
|
|
|
@onready var name_debug: Label = $name_debug
|
2024-09-23 11:47:55 +08:00
|
|
|
|
2024-09-23 17:27:43 +08:00
|
|
|
signal touch_click(data:Dictionary)
|
|
|
|
var data:Dictionary
|
|
|
|
var scene_id:String
|
|
|
|
var ind:String
|
|
|
|
func set_data(_data:Dictionary):
|
|
|
|
data=_data
|
2024-10-04 18:08:33 +08:00
|
|
|
name_debug.text=data["name"]
|
2024-09-23 17:27:43 +08:00
|
|
|
position=Vector2(data["position"][0],data["position"][1])
|
|
|
|
pass
|
2024-09-23 11:47:55 +08:00
|
|
|
|
2024-09-23 17:27:43 +08:00
|
|
|
func update_time():
|
2024-09-23 11:47:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
pass
|
2024-09-23 17:27:43 +08:00
|
|
|
func judge():
|
|
|
|
var res:bool=true
|
|
|
|
if data.has("condition"):
|
|
|
|
var condition_data:Array=data["condition"]
|
|
|
|
for i in condition_data.size():
|
|
|
|
var new_condition_data:Dictionary=condition_data[i].duplicate()
|
|
|
|
var type:String=new_condition_data["type"]
|
|
|
|
var _data:Dictionary=new_condition_data["data"]
|
|
|
|
_data["scene_id"]=data["scene_id"]
|
|
|
|
_data["touch_id"]=data["name"]
|
|
|
|
_data["index"]=str(i)
|
|
|
|
res=res and Global.call_condition_triger(type,_data)
|
|
|
|
if res:
|
|
|
|
self.show()
|
|
|
|
else:
|
|
|
|
self.hide()
|
|
|
|
|
|
|
|
func _on_tool_button_pressed() -> void:
|
2024-10-04 18:08:33 +08:00
|
|
|
if data.has("triger"):
|
|
|
|
for i in data["triger"]:
|
|
|
|
var type=data["triger"]["type"]
|
|
|
|
var data=data["triger"]["data"]
|
|
|
|
Global.call_triger(type,data)
|
|
|
|
pass
|
2024-09-23 17:27:43 +08:00
|
|
|
pass # Replace with function body.
|