2020-10-03 14:00:15 +00:00
|
|
|
extends Node2D
|
|
|
|
|
2020-10-08 19:56:03 +00:00
|
|
|
var id = 0
|
2020-10-03 14:00:15 +00:00
|
|
|
# Many thanks to Arkeve! https://github.com/arkeve
|
2020-10-06 13:19:38 +00:00
|
|
|
|
2020-10-03 14:00:15 +00:00
|
|
|
func _ready():
|
2020-10-08 19:56:03 +00:00
|
|
|
match Global.player_inventory_items[self.id].item_id:
|
|
|
|
0:
|
|
|
|
pass
|
|
|
|
1:
|
|
|
|
$TextureRect.texture = load("res://pictures/inventory_iconpictures/miscellaneous/magic_formulae.png")
|
|
|
|
2:
|
|
|
|
$TextureRect.texture = load("res://pictures/inventory_iconpictures/tools_and_weapons/tools/ploeg.png")
|
2020-10-10 20:23:11 +00:00
|
|
|
3:
|
|
|
|
$TextureRect.texture = load("res://pictures/inventory_iconpictures/food_items/herbs/saffron.png")
|
|
|
|
|
|
|
|
if Global.player_inventory_items[self.id].amount > 0:
|
|
|
|
var amountlbl = Label.new()
|
|
|
|
amountlbl.set_position(Vector2(self.position.x+102, self.position.y+102))
|
|
|
|
amountlbl.text = str(Global.player_inventory_items[self.id].amount)
|
|
|
|
add_child(amountlbl)
|