From ab71f15b82705ad5458198563d99864fb5737bba Mon Sep 17 00:00:00 2001 From: Tabby <41929769+tabby-cat-nya@users.noreply.github.com> Date: Mon, 12 Jan 2026 20:20:16 +1100 Subject: [PATCH] scavenge book working, fixed issue with blocked slots --- crafting/recipe book/scavengeBook.gd | 4 ++++ inv_system/player_inventory.tscn | 25 +++++++++++++++++++++---- mouseTweaks.gd | 2 ++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/crafting/recipe book/scavengeBook.gd b/crafting/recipe book/scavengeBook.gd index 4abae1a..e32511e 100644 --- a/crafting/recipe book/scavengeBook.gd +++ b/crafting/recipe book/scavengeBook.gd @@ -15,4 +15,8 @@ func scavs_ready(): for scav in RecipeManager.scavenge_recipes: # TODO: create an item slot with the scav recipie icon, bock dragging # show details about scavenge results in tooltip? + var new_slot = load("res://inv_system/item_slot.tscn").instantiate() as ItemSlot + new_slot.item = scav.input + new_slot.block_taking = true + grid.add_child(new_slot) pass diff --git a/inv_system/player_inventory.tscn b/inv_system/player_inventory.tscn index 3fea26d..c502f79 100644 --- a/inv_system/player_inventory.tscn +++ b/inv_system/player_inventory.tscn @@ -71,10 +71,9 @@ offset_left = 83.0 offset_top = 67.0 offset_right = 431.0 offset_bottom = 544.0 -current_tab = 2 +current_tab = 0 [node name="Inventory" type="PanelContainer" parent="TabContainer" node_paths=PackedStringArray("grid", "inv_label")] -visible = false layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_2jtfh") script = ExtResource("2_hk4hx") @@ -221,13 +220,31 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="Scavenge" type="PanelContainer" parent="TabContainer"] +[node name="Scavenge" type="PanelContainer" parent="TabContainer" node_paths=PackedStringArray("grid")] +visible = false layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_8qgtd") script = ExtResource("5_bdgfq") +grid = NodePath("MarginContainer/VBoxContainer/GridContainer") metadata/_tab_index = 2 -[node name="GridContainer" type="GridContainer" parent="TabContainer/Scavenge"] +[node name="MarginContainer" type="MarginContainer" parent="TabContainer/Scavenge"] +layout_mode = 2 +theme_override_constants/margin_left = 5 +theme_override_constants/margin_top = 5 +theme_override_constants/margin_right = 5 +theme_override_constants/margin_bottom = 5 + +[node name="VBoxContainer" type="VBoxContainer" parent="TabContainer/Scavenge/MarginContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="TabContainer/Scavenge/MarginContainer/VBoxContainer"] +layout_mode = 2 +text = "These items can be scavenged into other resources" +horizontal_alignment = 1 +autowrap_mode = 2 + +[node name="GridContainer" type="GridContainer" parent="TabContainer/Scavenge/MarginContainer/VBoxContainer"] layout_mode = 2 columns = 5 diff --git a/mouseTweaks.gd b/mouseTweaks.gd index 3d6d020..4ecf76c 100644 --- a/mouseTweaks.gd +++ b/mouseTweaks.gd @@ -12,6 +12,8 @@ func _ready() -> void: # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: if Input.is_action_pressed("quick_move") and hovered_slot: + if hovered_slot.block_taking: + return # figure out what the "other" inventory is and move it var current_inv : String = hovered_slot.type var target_inv : Inventory