fixing bugs meow

This commit is contained in:
Tabby 2026-01-17 13:42:34 +11:00
parent c969e0bee2
commit 4a9193e549
27 changed files with 370 additions and 40 deletions

View file

@ -40,4 +40,6 @@ func _on_reset_button_pressed() -> void:
PlayerInventory.botnet.clear()
PlayerInventory.show()
Clock.show()
Locations.show()
Locations.current_location = Locations.Location.workshop
get_tree().change_scene_to_file("res://scenes/workshop.tscn")

View file

@ -1,13 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://dsfal3m4siap2"]
[gd_scene load_steps=5 format=3 uid="uid://dsfal3m4siap2"]
[ext_resource type="Script" uid="uid://c6oycdae5wvjf" path="res://inv_system/inventory.gd" id="1_6uqi0"]
[ext_resource type="Texture2D" uid="uid://dj487wauiay6i" path="res://assets/ewase bins.png" id="1_g14j6"]
[ext_resource type="Script" uid="uid://dal8g1ce37r3w" path="res://demo_scene.gd" id="1_vbegm"]
[ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="7_xersf"]
[sub_resource type="LabelSettings" id="LabelSettings_00tp4"]
font_color = Color(1, 0, 0, 0.5764706)
[node name="ewaste" type="Control" node_paths=PackedStringArray("bin_inventory", "loot_button")]
layout_mode = 3
anchors_preset = 15
@ -38,7 +35,7 @@ layout_mode = 0
offset_left = 751.0
offset_top = 376.0
offset_right = 1027.0
offset_bottom = 545.0
offset_bottom = 576.0
script = ExtResource("1_6uqi0")
inventory_name = "E-waste Recycling Bin"
type = "Loot"
@ -98,11 +95,14 @@ layout_mode = 2
[node name="ItemSlot21" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
layout_mode = 2
[node name="Label2" type="Label" parent="BinPanel/MarginContainer/VBoxContainer"]
[node name="HSeparator" type="HSeparator" parent="BinPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "(Items left here will be destroyed)"
label_settings = SubResource("LabelSettings_00tp4")
horizontal_alignment = 1
theme_override_constants/separation = 14
[node name="Delete" type="Button" parent="BinPanel/MarginContainer/VBoxContainer"]
modulate = Color(1, 0, 0, 1)
layout_mode = 2
text = "Delete Items"
[node name="LootButton" type="Button" parent="."]
layout_mode = 1
@ -121,6 +121,7 @@ text = "Loot E-waste bins!
(Uses 10 time)"
[node name="ReturnButton" type="Button" parent="."]
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
@ -135,5 +136,6 @@ grow_horizontal = 2
grow_vertical = 2
text = "Return to workshop"
[connection signal="pressed" from="BinPanel/MarginContainer/VBoxContainer/Delete" to="." method="_on_delete_pressed"]
[connection signal="pressed" from="LootButton" to="." method="_on_loot_button_pressed"]
[connection signal="pressed" from="ReturnButton" to="." method="_on_return_button_pressed"]

View file

@ -1,9 +0,0 @@
[gd_scene format=3 uid="uid://b5dh55o5mgima"]
[node name="LocationManager" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

View file

@ -0,0 +1,60 @@
extends Control
var block_moving = false
@export var normal_color : Color
@export var selected_color : Color
@export var ewaste_button : Button
@export var workshop_button: Button
@export var room_button : Button
var current_location : Location
@export var move_blocker_panel : PanelContainer
enum Location{
ewaste,
workshop,
room
}
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
hide()
current_location = Location.workshop
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
move_blocker_panel.visible = block_moving
if current_location == Location.ewaste:
ewaste_button.self_modulate = selected_color
else:
ewaste_button.self_modulate = normal_color
if current_location == Location.workshop:
workshop_button.self_modulate = selected_color
else:
workshop_button.self_modulate = normal_color
if current_location == Location.room:
room_button.self_modulate = selected_color
else:
room_button.self_modulate = normal_color
func goto_ewaste():
if current_location == Location.ewaste:
return
current_location = Location.ewaste
get_tree().change_scene_to_file("res://scenes/ewaste.tscn")
func goto_workshop():
if current_location == Location.workshop:
return
current_location = Location.workshop
get_tree().change_scene_to_file("res://scenes/workshop.tscn")
func goto_room():
if current_location == Location.room:
return
current_location = Location.room
get_tree().change_scene_to_file("res://scenes/room.tscn")

View file

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

View file

@ -0,0 +1,77 @@
[gd_scene load_steps=7 format=3 uid="uid://b5dh55o5mgima"]
[ext_resource type="Script" uid="uid://bxymsudka4nnb" path="res://scenes/manager/location_manager.gd" id="1_o5d0c"]
[ext_resource type="Texture2D" uid="uid://m10v3leibbil" path="res://assets/icons/bin.png" id="2_qjxm7"]
[ext_resource type="Texture2D" uid="uid://bqnjkty8ofuw4" path="res://assets/icons/workshop.png" id="3_1ogtx"]
[ext_resource type="Texture2D" uid="uid://c3ti7dy7kvfml" path="res://assets/icons/home.png" id="4_5p1uq"]
[ext_resource type="StyleBox" uid="uid://12bvcki7fqij" path="res://scenes/manager/nuhuh stylebox.tres" id="5_qjxm7"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dc45l"]
content_margin_left = 0.0
content_margin_top = 0.0
content_margin_right = 0.0
content_margin_bottom = 0.0
bg_color = Color(0.101960786, 0.101960786, 0.101960786, 0)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[node name="LocationManager" type="Control" node_paths=PackedStringArray("ewaste_button", "workshop_button", "room_button", "move_blocker_panel")]
z_index = 3
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_o5d0c")
normal_color = Color(1, 1, 1, 1)
selected_color = Color(1, 1, 0, 1)
ewaste_button = NodePath("PanelContainer/VBoxContainer/MoveEwaste")
workshop_button = NodePath("PanelContainer/VBoxContainer/MoveWorkshop")
room_button = NodePath("PanelContainer/VBoxContainer/MoveHome")
move_blocker_panel = NodePath("Move blocker")
[node name="PanelContainer" type="PanelContainer" parent="."]
layout_mode = 0
offset_left = 615.0
offset_top = 175.0
offset_right = 687.0
offset_bottom = 399.0
theme_override_styles/panel = SubResource("StyleBoxFlat_dc45l")
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
layout_mode = 2
[node name="MoveEwaste" type="Button" parent="PanelContainer/VBoxContainer"]
layout_mode = 2
icon = ExtResource("2_qjxm7")
[node name="MoveWorkshop" type="Button" parent="PanelContainer/VBoxContainer"]
layout_mode = 2
icon = ExtResource("3_1ogtx")
[node name="MoveHome" type="Button" parent="PanelContainer/VBoxContainer"]
layout_mode = 2
icon = ExtResource("4_5p1uq")
[node name="Move blocker" type="PanelContainer" parent="."]
layout_mode = 0
offset_left = 603.0
offset_top = 165.0
offset_right = 699.0
offset_bottom = 409.0
theme_override_styles/panel = ExtResource("5_qjxm7")
[node name="Label" type="Label" parent="Move blocker"]
layout_mode = 2
text = "Cannot move"
horizontal_alignment = 1
autowrap_mode = 2
[connection signal="pressed" from="PanelContainer/VBoxContainer/MoveEwaste" to="." method="goto_ewaste"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/MoveWorkshop" to="." method="goto_workshop"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/MoveHome" to="." method="goto_room"]

View file

@ -0,0 +1,13 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://12bvcki7fqij"]
[resource]
content_margin_left = 0.0
content_margin_top = 0.0
content_margin_right = 0.0
content_margin_bottom = 0.0
bg_color = Color(0.27669665, 0.036602646, 0.036598563, 0.7019608)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5

View file

@ -16,4 +16,6 @@ func _process(delta: float) -> void:
func _on_play_button_pressed() -> void:
PlayerInventory.show()
Clock.show()
Locations.show()
Locations.current_location = Locations.Location.workshop
get_tree().change_scene_to_file("res://scenes/workshop.tscn")

View file

@ -80,7 +80,7 @@ text = "Play!"
[node name="RichTextLabel3" type="RichTextLabel" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
bbcode_enabled = true
text = "[i]Credits
text = "[i]Credits[/i]
[ul]Soundtrack by Kane
Playtesting: Maxie, Kane, Sarantis
Octodemy's Inventory Tutorial

View file

@ -11,7 +11,7 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
workshop_button.disabled = sell_panel.filled_slots() > 0 or botnet_panel.filled_slots() > 0
Locations.block_moving = sell_panel.filled_slots() > 0 or botnet_panel.filled_slots() > 0
pass

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://cu2yyw3f2avub"]
[gd_scene load_steps=7 format=3 uid="uid://cu2yyw3f2avub"]
[ext_resource type="Script" uid="uid://cq6xhdlib6c50" path="res://scenes/room.gd" id="1_8pqrt"]
[ext_resource type="Texture2D" uid="uid://crdbk8wkw63k0" path="res://assets/computer.png" id="1_om4aa"]
[ext_resource type="PackedScene" uid="uid://cqqpf7fca5nk1" path="res://inv_system/sell_panel.tscn" id="3_85yof"]
[ext_resource type="Script" uid="uid://bxdc7rrd22mlr" path="res://shop/meowbay.gd" id="4_jxe34"]
[ext_resource type="StyleBox" uid="uid://12bvcki7fqij" path="res://scenes/manager/nuhuh stylebox.tres" id="5_jn645"]
[ext_resource type="PackedScene" uid="uid://nfd41hcidmju" path="res://inv_system/botnet/botnet_panel.tscn" id="5_jxe34"]
[node name="room" type="Control" node_paths=PackedStringArray("sell_panel", "botnet_panel", "workshop_button")]
@ -31,6 +32,7 @@ texture = ExtResource("1_om4aa")
expand_mode = 3
[node name="GotoWorkshop" type="Button" parent="."]
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
@ -52,7 +54,7 @@ offset_top = 148.0
offset_right = 1143.0
offset_bottom = 270.00018
[node name="meowbay" type="PanelContainer" parent="." node_paths=PackedStringArray("listing_grid")]
[node name="meowbay" type="PanelContainer" parent="." node_paths=PackedStringArray("listing_grid", "block_buy")]
layout_mode = 0
offset_left = 790.0
offset_top = 291.46
@ -60,6 +62,7 @@ offset_right = 1143.0
offset_bottom = 590.4607
script = ExtResource("4_jxe34")
listing_grid = NodePath("ScrollContainer/VBoxContainer/listings")
block_buy = NodePath("block_buy")
[node name="ScrollContainer" type="ScrollContainer" parent="meowbay"]
layout_mode = 2
@ -79,6 +82,22 @@ layout_mode = 2
size_flags_horizontal = 3
columns = 2
[node name="block_buy" type="MarginContainer" parent="meowbay"]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 40
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
[node name="BlockBuying" type="PanelContainer" parent="meowbay/block_buy"]
layout_mode = 2
theme_override_styles/panel = ExtResource("5_jn645")
[node name="Label" type="Label" parent="meowbay/block_buy/BlockBuying"]
layout_mode = 2
text = "Cannot buy: Inventory Full!"
horizontal_alignment = 1
[node name="BotnetPanel" parent="." instance=ExtResource("5_jxe34")]
layout_mode = 0
offset_left = 523.0

View file

@ -11,12 +11,13 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if crafting_inv.filled_slots() > 0:
ewaste_button.disabled = true
computer_button.disabled = true
else:
ewaste_button.disabled = false
computer_button.disabled = false
Locations.block_moving = crafting_inv.filled_slots() > 0
#if crafting_inv.filled_slots() > 0:
#ewaste_button.disabled = true
#computer_button.disabled = true
#else:
#ewaste_button.disabled = false
#computer_button.disabled = false
func _on_goto_ewaste_pressed() -> void:

View file

@ -29,6 +29,7 @@ texture = ExtResource("1_d7fqo")
expand_mode = 3
[node name="GotoEwaste" type="Button" parent="."]
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
@ -44,6 +45,7 @@ grow_vertical = 2
text = "Go to ewaste bins"
[node name="GotoComputer" type="Button" parent="."]
visible = false
layout_mode = 0
offset_left = 602.0
offset_top = 344.0