added machine item slots so ican start building gameplay

This commit is contained in:
2026-06-05 20:49:48 -05:00
parent 04f8bb7c2d
commit 0d39c2dfb4
874 changed files with 18068 additions and 18 deletions

View File

@@ -20,7 +20,7 @@ func updateHotbar(hotbar: HotbarResource):
MainGame.currentHeldItemID = item.ID
slotInstance.setItem(item, is_selected)
func givePlayerItem(ID:String, ):
func givePlayerItem(ID:String):
var segments = ID.split(":")
for index in hotbar.slots.size():
@@ -29,15 +29,17 @@ func givePlayerItem(ID:String, ):
hotbar.slots[index] = load("res://GameShit/ItemHandlers/{namespace}/{id}.tres".format({"namespace": segments[0], "id": segments[1]}))
updateHotbar(hotbar)
return
else:
print("there will be a UIThrowException call eventually but im too lazy to implement it rn")
print("UI.Command.give.InventoryFullException")
func removePlayerHeldItem():
hotbar.slots[MainGame.selectedSlot] = load("res://GameShit/ItemHandlers/base/air.tres")
updateHotbar(hotbar)
func _ready() -> void:
## connect the InventoryBus signal for the shit
InventoryBus.givePlayerItem.connect(givePlayerItem)
InventoryBus.removeHeldItem.connect(removePlayerHeldItem)
## throw in some default slots
if hotbar.slots.is_empty():