fixing bugs meow
This commit is contained in:
parent
c969e0bee2
commit
4a9193e549
27 changed files with 370 additions and 40 deletions
|
|
@ -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
|
||||
60
scenes/manager/location_manager.gd
Normal file
60
scenes/manager/location_manager.gd
Normal 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")
|
||||
1
scenes/manager/location_manager.gd.uid
Normal file
1
scenes/manager/location_manager.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bxymsudka4nnb
|
||||
77
scenes/manager/locations panel.tscn
Normal file
77
scenes/manager/locations panel.tscn
Normal 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"]
|
||||
13
scenes/manager/nuhuh stylebox.tres
Normal file
13
scenes/manager/nuhuh stylebox.tres
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue