Skip to content

Commit

Permalink
Update to 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptsengineer committed May 26, 2024
1 parent aa59624 commit 35f5dff
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 7 deletions.
1 change: 1 addition & 0 deletions addons/inventory-system-demos/base/items/lashing.tres
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ id = 5
max_stack = 16
name = "Lashing"
icon = ExtResource("1_w5ivy")
weight = 2.0
properties = {
"dropped_item": "res://addons/inventory-system-demos/fps/dropped_items/lashing.tscn",
"hand_item": "res://addons/inventory-system-demos/fps/hand_items/lashing.tscn"
Expand Down
1 change: 1 addition & 0 deletions addons/inventory-system-demos/base/items/stone.tres
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ id = 1
max_stack = 8
name = "Stone"
icon = ExtResource("1_ctyjn")
weight = 1.0
properties = {
"dropped_item": "res://addons/inventory-system-demos/fps/dropped_items/rock.tscn",
"hand_item": "res://addons/inventory-system-demos/fps/hand_items/rock.tscn"
Expand Down
1 change: 1 addition & 0 deletions addons/inventory-system-demos/base/items/stone_axe.tres
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ can_stack = false
max_stack = 1
name = "Stone Axe"
icon = ExtResource("1_5x1h2")
weight = 1.0
properties = {
"dropped_item": "res://addons/inventory-system-demos/fps/dropped_items/stone_axe.tscn",
"durability": 100.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ can_stack = false
max_stack = 1
name = "Stone Pickaxe"
icon = ExtResource("1_hlhk0")
weight = 2.0
properties = {
"dropped_item": "res://addons/inventory-system-demos/fps/dropped_items/stone_pickaxe.tscn",
"durability": 100.0,
Expand Down
1 change: 1 addition & 0 deletions addons/inventory-system-demos/base/items/wood.tres
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
max_stack = 16
name = "Wood"
icon = ExtResource("1_q41wd")
weight = 1.0
properties = {
"dropped_item": "res://addons/inventory-system-demos/fps/dropped_items/wood.tscn",
"fuel": 8.0,
Expand Down
1 change: 1 addition & 0 deletions addons/inventory-system-demos/base/items/workbench.tres
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ id = 7
max_stack = 1
name = "Workbench"
icon = ExtResource("1_bhcp7")
weight = 5.0
properties = {
"dropped_item": "res://addons/inventory-system-demos/fps/dropped_items/workbench.tscn",
"hand_item": "res://addons/inventory-system-demos/fps/hand_items/workbench.tscn",
Expand Down
2 changes: 0 additions & 2 deletions addons/inventory-system-demos/fps/workbench.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
[ext_resource type="InventoryDatabase" uid="uid://x5huasdaljjl" path="res://addons/inventory-system-demos/base/database.tres" id="5_d4au8"]

[sub_resource type="InteractAction" id="Resource_ypp5l"]
input = "interact"
description = "Open Station"
code = 0

[sub_resource type="InteractAction" id="Resource_mwd72"]
input = "rotate"
Expand Down
1 change: 1 addition & 0 deletions addons/inventory-system-demos/mp/mp_workbench.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[node name="SyncCraftStation" type="Node" parent="." index="4" node_paths=PackedStringArray("craft_station")]
script = ExtResource("2_qdlmm")
craft_station = NodePath("../CraftStation")
sync_input_inventories = true

[node name="SyncInventory" type="Node" parent="." index="5" node_paths=PackedStringArray("inventory")]
script = ExtResource("3_j3l4y")
Expand Down
6 changes: 2 additions & 4 deletions addons/inventory-system/bin/inventory_system.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ windows.debug.x86_64 = "windows/inventory_system.windows.template_debug.x86_64.d
windows.debug.x86_32 = "windows/inventory_system.windows.template_debug.x86_32.dll"
windows.release.x86_64 = "windows/inventory_system.windows.template_release.x86_64.dll"
windows.release.x86_32 = "windows/inventory_system.windows.template_release.x86_32.dll"
linux.debug.x86_64 = "linux64/inventory_system.linux.template_debug.x86_64.so"
linux.debug.x86_32 = "linux32/inventory_system.linux.template_debug.x86_32.so"
linux.release.x86_64 = "linux64/inventory_system.linux.template_release.x86_64.so"
linux.release.x86_32 = "linux32/inventory_system.linux.template_release.x86_32.so"
linux.debug.x86_64 = "linux/libinventory_system.linux.template_debug.x86_64.so"
linux.release.x86_64 = "linux/libinventory_system.linux.template_release.x86_64.so"

[icons]
ItemCategory = "res://addons/inventory-system/icons/item_category.svg"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ inventory = NodePath("../InventoryHandler/Inventory")

[node name="Crafter" type="Crafter" parent="."]
main_station = NodePath("CraftStation")
inventories_for_stations = Array[NodePath]([NodePath("../InventoryHandler/Inventory"), NodePath("../InventoryHandler/EquipmentInventory")])

[node name="CraftStation" type="CraftStation" parent="Crafter"]
input_inventories = Array[NodePath]([NodePath("../../InventoryHandler/Inventory"), NodePath("../../InventoryHandler/EquipmentInventory")])
Expand Down
22 changes: 22 additions & 0 deletions addons/inventory-system/multiplayer/sync_craft_station.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@ extends Node
class_name SyncCraftStation

@export var craft_station : CraftStation
@export var sync_input_inventories : bool
var craftings_data : Array


func _ready() -> void:
multiplayer.peer_connected.connect(_on_connected.bind())
craft_station.opened.connect(_on_opened)
craft_station.closed.connect(_on_closed)
craft_station.crafting_added.connect(_on_crafting_added)
craft_station.crafting_removed.connect(_on_crafting_removed)
if sync_input_inventories:
craft_station.input_inventory_added.connect(_on_input_inventory_added.bind())
craft_station.input_inventory_removed.connect(_on_input_inventory_removed.bind())


func _on_connected(peer_id : int):
Expand Down Expand Up @@ -46,6 +51,15 @@ func _on_crafting_removed(crafting_index : int):
crafting_removed_rpc.rpc(crafting_index)
craftings_data.remove_at(crafting_index)

func _on_input_inventory_added(inventory_path : NodePath):
if not multiplayer.is_server():
return
input_inventory_added_rpc.rpc(inventory_path)

func _on_input_inventory_removed(inventory_path : NodePath):
if not multiplayer.is_server():
return
input_inventory_removed_rpc.rpc(inventory_path)

@rpc
func open_rpc():
Expand Down Expand Up @@ -74,3 +88,11 @@ func _update_craftings_rpc(craftings_data : Array):
var crafting = Crafting.new()
crafting.from_data(data)
craft_station.craftings.append(crafting)

@rpc
func input_inventory_added_rpc(inventory_path : NodePath):
craft_station.add_input_inventory(craft_station.get_node(inventory_path))

@rpc
func input_inventory_removed_rpc(inventory_path : NodePath):
craft_station.remove_input_inventory(craft_station.get_node(inventory_path))
2 changes: 1 addition & 1 deletion addons/inventory-system/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="Inventory System"
description="Inventory System for Godot 4 Networked"
author="Expresso Bits"
version="1.0.9"
version="1.1.0"
script="inventory-system.gd"

0 comments on commit 35f5dff

Please sign in to comment.