scavenge book working, fixed issue with blocked slots
This commit is contained in:
parent
c952938134
commit
ab71f15b82
3 changed files with 27 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue