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

@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="ItemData" format=3 uid="uid://0ijsy5ujklkr"]
[ext_resource type="Script" uid="uid://cjb16s8q73wkx" path="res://GameShit/PlayerController/Hotbar/ItemData.gd" id="1_vonxn"]
[ext_resource type="Texture2D" uid="uid://bcrb8esjinigi" path="res://Templates/coal.png" id="2_84k4e"]
[resource]
script = ExtResource("1_vonxn")
Name = "Coal"
ID = "base:coal"
texture = ExtResource("2_84k4e")
metadata/_custom_type_script = "uid://cjb16s8q73wkx"

View File

@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="ItemData" format=3 uid="uid://rtbdd6jsvxth"]
[ext_resource type="Script" uid="uid://cjb16s8q73wkx" path="res://GameShit/PlayerController/Hotbar/ItemData.gd" id="1_o3acf"]
[ext_resource type="Texture2D" uid="uid://baf35rlx38k64" path="res://Templates/ingot_dark.png" id="2_dm6g8"]
[resource]
script = ExtResource("1_o3acf")
ID = "base:iron_ingot"
texture = ExtResource("2_dm6g8")
metadata/_custom_type_script = "uid://cjb16s8q73wkx"

View File

@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="ItemData" format=3 uid="uid://bylulldued5dk"]
[ext_resource type="Script" uid="uid://cjb16s8q73wkx" path="res://GameShit/PlayerController/Hotbar/ItemData.gd" id="1_plyu3"]
[ext_resource type="Texture2D" uid="uid://be57ssdg50kqm" path="res://Templates/Pill.png" id="2_x4v60"]
[resource]
script = ExtResource("1_plyu3")
ID = "base:raw_iron"
texture = ExtResource("2_x4v60")
metadata/_custom_type_script = "uid://cjb16s8q73wkx"

View File

@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="ItemData" format=3 uid="uid://b2cpqvxwlk3ub"]
[ext_resource type="Script" uid="uid://cjb16s8q73wkx" path="res://GameShit/PlayerController/Hotbar/ItemData.gd" id="1_oy3om"]
[ext_resource type="Texture2D" uid="uid://djybyd6myepyf" path="res://Assets/textures/Dirt.png" id="2_y4hc2"]
[resource]
script = ExtResource("1_oy3om")
Name = "Smelting Machine"
ID = "base:smeltingMachine"
texture = ExtResource("2_y4hc2")
metadata/_custom_type_script = "uid://cjb16s8q73wkx"

Binary file not shown.

View File

@@ -64,7 +64,7 @@ func runCommand(message: String):
if (arg.begins_with("\"") and arg.ends_with("\"")) or (arg.begins_with("'") and arg.ends_with("'")):
arg = arg.substr(1, arg.length() - 2)
commandArgs.append(arg)
if commandArgs.size() > 0:
if commandArgs.size() > 0:
var command_name = commandArgs[0]
if Commands.has(command_name):
Commands[command_name].runCommand(commandArgs.slice(1))

View File

@@ -0,0 +1,21 @@
extends RayCast3D
# Keep track of what we were just looking at
var current_target: Object = null
func _physics_process(_delta: float) -> void:
if is_colliding():
var collider = get_collider()
if current_target != collider:
_clear_current_highlight()
current_target = collider
if current_target.has_method("startHighlight"):
current_target.startHighlight()
else:
_clear_current_highlight()
func _clear_current_highlight() -> void:
if current_target != null:
if current_target.has_method("stopHighlight"):
current_target.stopHighlight()
current_target = null

View File

@@ -0,0 +1 @@
uid://peb1cm1x2b2u

View File

@@ -56,7 +56,7 @@ func _input(event: InputEvent) -> void:
if is_left:
if event.pressed:
spawnObjectByID(MainGame.selectedBlockID, get_collision_point(), rot)
spawnObjectByID(MainGame.selectedBlockID, get_collision_point() + Vector3(0, 0.5, 0), rot)
if MainGame.currentHeldItemID == "base:hammer":
var is_left = event.button_index == MOUSE_BUTTON_LEFT
if is_left:

View File

@@ -8,6 +8,7 @@
[ext_resource type="PackedScene" uid="uid://cjdago36f5tk1" path="res://GameShit/PlayerController/Hotbar/HotbarSlot.tscn" id="7_eb4xd"]
[ext_resource type="Resource" uid="uid://ng8hm4a1u2ya" path="res://GameShit/PlayerController/Hotbar/MainBar.res" id="8_jteqg"]
[ext_resource type="PackedScene" uid="uid://bliihydr5ja7g" path="res://GameShit/PlayerController/ChatSystem/ChatBox.tscn" id="8_x05u2"]
[ext_resource type="Script" uid="uid://peb1cm1x2b2u" path="res://GameShit/PlayerController/ControllerSystem/Highlight.gd" id="9_dt52j"]
[sub_resource type="SphereMesh" id="SphereMesh_3mwrl"]
@@ -95,6 +96,12 @@ grow_horizontal = 1
pivot_offset = Vector2(0, 120)
metadata/_edit_use_anchors_ = true
[node name="HighlightRaycast" type="RayCast3D" parent="Camera3D" unique_id=1504301830]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, -0.51586515)
target_position = Vector3(0, -4, 0)
script = ExtResource("9_dt52j")
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=639269486]
transform = Transform3D(0.5, 0, 0, 0, 1, 0, 0, 0, 0.5, 0, 0, 0)
shape = SubResource("CapsuleShape3D_3mwrl")

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():