drag & drop with inventory slots
This commit is contained in:
@@ -14,8 +14,6 @@ const SPRITE_SCENE: PackedScene = preload("res://entities/interactables/item_obj
|
||||
|
||||
@onready var object_sprite: ItemObjectSprite = generate_sprite()
|
||||
|
||||
var dragging := false
|
||||
|
||||
func _init(_item = null):
|
||||
if _item:
|
||||
item = _item
|
||||
@@ -26,15 +24,6 @@ func _ready():
|
||||
object_sprite.apply_texture_to_sprite(item.icon, ITEM_SPRITE_SIZE)
|
||||
object_sprite.generate_particles(item.get_particles())
|
||||
|
||||
func _process(_delta):
|
||||
if dragging:
|
||||
global_position = get_global_mouse_position()
|
||||
|
||||
func _on_mouse_entered():
|
||||
mouse_over = true
|
||||
if not dragging:
|
||||
Pointer.inspect(self)
|
||||
|
||||
func pointer_text() -> String:
|
||||
var name_suffix = ""
|
||||
|
||||
@@ -60,12 +49,6 @@ func interact(player : Player) -> bool:
|
||||
|
||||
return false
|
||||
|
||||
func start_dragging():
|
||||
dragging = true
|
||||
|
||||
func stop_dragging():
|
||||
dragging = false
|
||||
|
||||
func pickup_animation(target_position: Vector2):
|
||||
available = false
|
||||
var tween: Tween = get_tree().create_tween()
|
||||
|
||||
Reference in New Issue
Block a user