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,10 +101,10 @@ func _input(event):
if(!active):
highlight(false)
func has_component(key: String)->bool:
func has_component(key: String)->bool:
return components.has(key)
func get_component(key: String):
func get_component(key: String):
if(has_component(key)):
return components[key]
return null
@@ -110,4 +115,3 @@ func register_components():
child = child as ESCItemComponent
components[child.get_component_type()] = child
child.register(custom_data)

View File

@@ -284,6 +284,11 @@ _global_script_classes=[ {
"language": "GDScript",
"path": "res://addons/escoria-core/game/core-scripts/esc_item.gd"
}, {
"base": "Node",
"class": "ESCItemComponent",
"language": "GDScript",
"path": "res://gymkhana/addons/escoria-ui-return-monkey-island/item_components/ESCItemComponent.gd"
}, {
"base": "Resource",
"class": "ESCItemCountManager",
"language": "GDScript",
@@ -785,6 +790,7 @@ _global_script_class_icons={
"ESCInventoryItem": "",
"ESCInventoryManager": "",
"ESCItem": "res://addons/escoria-core/design/esc_item.svg",
"ESCItemComponent": "",
"ESCItemCountManager": "",
"ESCItemWithTooltip": "res://addons/escoria-core/design/esc_item.svg",
"ESCLocation": "res://addons/escoria-core/design/esc_location.svg",