Starting item and inventory tools, sketched spear animation templates.
This commit is contained in:
@@ -7,14 +7,25 @@ var item : Item
|
||||
@onready var item_sprite : TextureRect = $Item
|
||||
|
||||
func assign(itm : Item) -> void:
|
||||
item = item
|
||||
item_sprite.texture = item.image
|
||||
item = itm
|
||||
if item.image != null:
|
||||
item_sprite.texture = item.image
|
||||
|
||||
func swap(item_slot : ItemSlot) -> void:
|
||||
var itm = item
|
||||
assign(itm)
|
||||
item_slot.assign(itm)
|
||||
|
||||
func update(itm : Item) -> void:
|
||||
if itm == null:
|
||||
clear()
|
||||
elif itm != item:
|
||||
assign(itm)
|
||||
|
||||
func clear() -> void:
|
||||
item = null
|
||||
item_sprite.texture = null
|
||||
|
||||
func _on_gui_input(event: InputEvent) -> void:
|
||||
var mmevt = event as InputEventMouseMotion
|
||||
var mbevt = event as InputEventMouseButton
|
||||
|
||||
Reference in New Issue
Block a user