2024-10-07 05:05:27 +00:00
|
|
|
extends Node2D
|
|
|
|
|
|
|
|
var key
|
|
|
|
|
|
|
|
@onready var data = Data.data.creatures[key]
|
|
|
|
@onready var image = Data.data.images[key]
|
|
|
|
|
|
|
|
@onready var sprite_2d: Sprite2D = $Sprite2D
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
sprite_2d.texture = image
|
|
|
|
|
|
|
|
|
|
|
|
func _on_mouse_handler_clicked() -> void:
|
2024-10-07 17:07:46 +00:00
|
|
|
Triggerer.trigger("grab_creature", {"creature": key, "old_window": get_window(), "old_position": position})
|
|
|
|
Persister.persist_data("grabbing", true)
|
|
|
|
queue_free()
|