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
|
2020-10-19 20:44:21 +00:00
|
|
|
|
|
|
|
# Id 0-40 - Map foraging - 'Random' spawning
|
2020-10-08 19:56:03 +00:00
|
|
|
1:
|
2021-04-08 19:18:46 +00:00
|
|
|
$TextureRect.texture = load("res://pictures/inventory_iconpictures/food_items/surroundings/berries.png")
|
2020-10-08 19:56:03 +00:00
|
|
|
2:
|
2021-04-08 19:18:46 +00:00
|
|
|
$TextureRect.texture = load("res://pictures/inventory_iconpictures/plants/wood_log.png.png")
|
2020-10-10 20:23:11 +00:00
|
|
|
3:
|
|
|
|
$TextureRect.texture = load("res://pictures/inventory_iconpictures/food_items/herbs/saffron.png")
|
2020-10-19 20:44:21 +00:00
|
|
|
|
|
|
|
# Id 41-80 - Tools - Every tool map interaction NOT weapons
|
|
|
|
41:
|
|
|
|
$TextureRect.texture = load("res://pictures/inventory_iconpictures/tools_and_weapons/tools/ploeg.png")
|
|
|
|
|
|
|
|
# Id 81-160 - Armour/Clothing
|
|
|
|
|
|
|
|
# Id 161-240 - Farming and planting
|
2020-10-10 20:23:11 +00:00
|
|
|
|
|
|
|
if Global.player_inventory_items[self.id].amount > 0:
|
|
|
|
var amountlbl = Label.new()
|
2020-10-19 20:44:21 +00:00
|
|
|
amountlbl.set_position(Vector2(self.position.x+105, self.position.y+105))
|
2020-10-10 20:23:11 +00:00
|
|
|
amountlbl.text = str(Global.player_inventory_items[self.id].amount)
|
|
|
|
add_child(amountlbl)
|