Skip to content

Commit

Permalink
Don't use in/output inventories
Browse files Browse the repository at this point in the history
  • Loading branch information
andersmmg committed May 14, 2023
1 parent 0ab255a commit f2a3c14
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions addons/inventory-system/demos/fps/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ func open_inventory(inventory : Inventory):


func open_station(craft_station : CraftStation):
craft_station.input_inventory = $InventoryHandler/Inventory
craft_station.output_inventory = $InventoryHandler/Inventory
if not crafter.is_open(craft_station):
crafter.open(craft_station)

Expand Down
4 changes: 2 additions & 2 deletions addons/inventory-system/ui/craft/craft_station_ui.gd
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func open(craft_station : CraftStation):
input_inventory_ui.set_inventory(craft_station.input_inventory)
if valid_output:
input_inventory_ui.set_inventory(craft_station.input_inventory)
input_inventory_ui.visible = valid_input
output_inventory_ui.visible = valid_output
input_inventory_ui.visible = valid_input && false
output_inventory_ui.visible = valid_output && false


## Hidden this UI
Expand Down
2 changes: 1 addition & 1 deletion addons/inventory-system/ui/inventory_system_ui.gd
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func _slot_point_down(event : InputEvent, slot_index : int, inventory : Inventor
amount = ceili(slot.amount/2.0)
inventory_handler.to_transaction(slot_index, inventory, amount)
$SlotClick.play()


func _inventory_point_down(event : InputEvent, inventory : Inventory):
if event.button_index == 3:
Expand Down

2 comments on commit f2a3c14

@scriptsengineer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be a craft station node option?

@scriptsengineer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea of future implementation is that special crafting stations like a bonfire keep items in an inventory, even if it's not a UI, something like physical 3d or 2d slots in the world. see in expressobits#32

Please sign in to comment.