Fix: tried to fix compiling errors in esc_item_with_tooltip.gd

This commit is contained in:
2023-10-07 23:38:56 +02:00
parent d4643568c4
commit e6de1f1323
2 changed files with 17 additions and 7 deletions

View File

@@ -28,6 +28,11 @@ export(Array) var target_when_selected_action_is_in = []
# If item is countable (E.g. money) marks the quantity
export(int) var count = 0
# ESCItemComponents children of this node
var components: Dictionary = {}
var custom_data: Dictionary = {}
# If item is countable (E.g. money) marks which texture to use depending of count value.
# Each element is a Dictionary with start and texture keys:
# [
@@ -96,13 +101,13 @@ func _input(event):
if(!active):
highlight(false)
func has_component(key: String)->bool:
return components.has(key)
func has_component(key: String)->bool:
return components.has(key)
func get_component(key: String):
if(has_component(key)):
return components[key]
return null
func get_component(key: String):
if(has_component(key)):
return components[key]
return null
func register_components():
for child in get_children():
@@ -110,4 +115,3 @@ func register_components():
child = child as ESCItemComponent
components[child.get_component_type()] = child
child.register(custom_data)