item count WIP

pull/3/head
cblech 9 months ago
parent e99b574d1f
commit fb362e10ad

@ -6,4 +6,5 @@
script = ExtResource("1_t485b") script = ExtResource("1_t485b")
name = "Axe Deo" name = "Axe Deo"
color = Color(0.643898, 0.4587, 0.294335, 1) color = Color(0.643898, 0.4587, 0.294335, 1)
maxStack = 1
metadata/_custom_type_script = "uid://cbskymrxs6ksu" metadata/_custom_type_script = "uid://cbskymrxs6ksu"

@ -6,4 +6,5 @@
script = ExtResource("1_8k5aa") script = ExtResource("1_8k5aa")
name = "Buck the Bucket" name = "Buck the Bucket"
color = Color(0.336269, 0.489145, 0.825324, 1) color = Color(0.336269, 0.489145, 0.825324, 1)
maxStack = 1
metadata/_custom_type_script = "uid://cbskymrxs6ksu" metadata/_custom_type_script = "uid://cbskymrxs6ksu"

@ -6,4 +6,5 @@
script = ExtResource("1_06nef") script = ExtResource("1_06nef")
name = "Your Mom" name = "Your Mom"
color = Color(0.751421, 0.329615, 0.570911, 1) color = Color(0.751421, 0.329615, 0.570911, 1)
maxStack = 1
metadata/_custom_type_script = "uid://cbskymrxs6ksu" metadata/_custom_type_script = "uid://cbskymrxs6ksu"

@ -6,4 +6,5 @@
script = ExtResource("1_07aya") script = ExtResource("1_07aya")
name = "Pick Axe" name = "Pick Axe"
color = Color(0.589014, 0.823353, 0.998475, 1) color = Color(0.589014, 0.823353, 0.998475, 1)
maxStack = 1
metadata/_custom_type_script = "uid://cbskymrxs6ksu" metadata/_custom_type_script = "uid://cbskymrxs6ksu"

@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="ItemResource" load_steps=2 format=3 uid="uid://d1uuxp1lp4aro"]
[ext_resource type="Script" uid="uid://cbskymrxs6ksu" path="res://scripts/CSharp/Common/Inventory/ItemResource.cs" id="1_dustj"]
[resource]
script = ExtResource("1_dustj")
name = "Tomato Seed"
color = Color(0.135039, 0.307214, 0.333128, 1)
maxStack = 20
metadata/_custom_type_script = "uid://cbskymrxs6ksu"

@ -5,9 +5,9 @@
[ext_resource type="PackedScene" uid="uid://5hltxpdxmqcq" path="res://prefabs/interactions/generic_item_on_ground.tscn" id="5_sjt6k"] [ext_resource type="PackedScene" uid="uid://5hltxpdxmqcq" path="res://prefabs/interactions/generic_item_on_ground.tscn" id="5_sjt6k"]
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="6_876p1"] [ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="6_876p1"]
[ext_resource type="Resource" uid="uid://cndd64batns31" path="res://resources/items/bucket.tres" id="6_nvnpb"] [ext_resource type="Resource" uid="uid://cndd64batns31" path="res://resources/items/bucket.tres" id="6_nvnpb"]
[ext_resource type="Script" uid="uid://cywyym5l7ymhr" path="res://scripts/CSharp/Common/Farming/FieldService.cs" id="7_3rkjv"] [ext_resource type="Script" uid="uid://dbkkeo3gw2xgy" path="res://scripts/CSharp/Common/Farming/FieldService.cs" id="7_3rkjv"]
[ext_resource type="Resource" uid="uid://c5yg3lx756v4v" path="res://resources/items/hoe.tres" id="7_hv2km"] [ext_resource type="Resource" uid="uid://c5yg3lx756v4v" path="res://resources/items/hoe.tres" id="7_hv2km"]
[ext_resource type="Resource" uid="uid://datee0flk1e84" path="res://resources/items/pickaxe.tres" id="8_hae25"] [ext_resource type="Resource" uid="uid://d1uuxp1lp4aro" path="res://resources/items/tomato_seed.tres" id="8_hv2km"]
[sub_resource type="PlaneMesh" id="PlaneMesh_8yprl"] [sub_resource type="PlaneMesh" id="PlaneMesh_8yprl"]
@ -67,7 +67,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.1678, -4.76837e-07, -3.9497
_infiniteSupply = true _infiniteSupply = true
[node name="SpawnWithItem" parent="GenericItemOnGround4" index="1"] [node name="SpawnWithItem" parent="GenericItemOnGround4" index="1"]
_blueprint = ExtResource("8_hae25") _blueprint = ExtResource("8_hv2km")
[editable path="GenericItemOnGround"] [editable path="GenericItemOnGround"]
[editable path="GenericItemOnGround2"] [editable path="GenericItemOnGround2"]

@ -3,4 +3,5 @@
public class ItemInstance public class ItemInstance
{ {
public ItemResource blueprint; public ItemResource blueprint;
public int amount = 1;
} }

@ -2,7 +2,7 @@
namespace Babushka.scripts.CSharp.Common.Inventory; namespace Babushka.scripts.CSharp.Common.Inventory;
[GlobalClass] [GlobalClass]
public partial class ItemResource: Resource public partial class ItemResource : Resource
{ {
[Export] [Export]
public string name; public string name;
@ -10,9 +10,13 @@ public partial class ItemResource: Resource
[Export] [Export]
public Color color; public Color color;
[Export]
public int maxStack;
public ItemResource() public ItemResource()
{ {
name = ""; name = "";
color = Colors.Red; color = Colors.Red;
maxStack = 1;
} }
} }

Loading…
Cancel
Save