From 178829785cb1247e5edc4149024fad77fe34bdb7 Mon Sep 17 00:00:00 2001 From: Ategon <benjamin@barbeau.net> Date: Mon, 7 Oct 2024 01:05:27 -0400 Subject: [PATCH] Add UI --- Fonts/Theme.tres | 2 + Main.tscn | 24 +- addons/clickthrough/clickthrough.cs | 21 ++ .../detection/area/area_detector.gd | 51 ++++ .../detection/area/area_detector.tscn | 12 + .../transparent/transparent_detector.gd | 66 +++++ .../transparent/transparent_detector.tscn | 6 + addons/clickthrough/examples/example_icon.gd | 60 +++++ .../examples/multiple_windows/example.tscn | 43 +++ .../examples/single_window/example.tscn | 25 ++ .../clickthrough_csharp/ClickthroughCSharp.cs | 48 ++++ .../ClickthroughCSharp.tscn | 6 + .../clickthrough_gdscript.gd | 65 +++++ .../clickthrough_gdscript.tscn | 6 + addons/clickthrough/plugin.cfg | 7 + components/Cursor/Cursor.tscn | 9 +- components/Cursor/MouseHandler.tscn | 1 + components/Cursor/cursor-ui.png | Bin 0 -> 2239 bytes components/Cursor/cursor-ui.png.import | 34 +++ components/Cursor/cursor.gd | 136 +++++++++- components/Cursor/cursor.png | Bin 0 -> 1171 bytes components/Cursor/cursor.png.import | 34 +++ components/Cursor/cursor_pixel_2.png | Bin 0 -> 204 bytes components/Cursor/cursor_pixel_2.png.import | 34 +++ components/Cursor/grab-1.aseprite | Bin 0 -> 368 bytes components/Cursor/grab-1.png | Bin 0 -> 138 bytes components/Cursor/grab-1.png.import | 34 +++ components/Cursor/hover-1.aseprite | Bin 0 -> 383 bytes components/Cursor/hover-1.png | Bin 0 -> 148 bytes components/Cursor/hover-1.png.import | 34 +++ components/Cursor/normal-1.aseprite | Bin 0 -> 390 bytes components/Cursor/normal-1.png | Bin 0 -> 155 bytes components/Cursor/normal-1.png.import | 34 +++ components/Logger/Logger.tscn | 1 + components/Logger/logger.gd | 15 +- components/Menu/Menu.tscn | 252 +++++++++--------- components/Persister/persister.gd | 54 +++- main.gd | 38 +++ parts/creatures/1x1-1.txt | 2 + parts/creatures/1x2-1.txt | 2 + parts/creatures/2x1-1.txt | 2 + parts/creatures/2x2-1.txt | 2 + parts/creatures/images/1x1-1.aseprite | Bin 0 -> 347 bytes parts/creatures/images/1x1-1.png | Bin 0 -> 94 bytes parts/creatures/images/1x1-1.png.import | 34 +++ parts/creatures/images/1x2-1.aseprite | Bin 0 -> 351 bytes parts/creatures/images/1x2-1.png | Bin 0 -> 100 bytes parts/creatures/images/1x2-1.png.import | 34 +++ parts/creatures/images/2x1-1.aseprite | Bin 0 -> 351 bytes parts/creatures/images/2x1-1.png | Bin 0 -> 99 bytes parts/creatures/images/2x1-1.png.import | 34 +++ parts/creatures/images/2x2-1.aseprite | Bin 0 -> 357 bytes parts/creatures/images/2x2-1.png | Bin 0 -> 109 bytes parts/creatures/images/2x2-1.png.import | 34 +++ parts/dialogue/dummy.txt | 2 + parts/globals.txt | 1 + parts/zones/desert.txt | 7 + parts/zones/farm.txt | 7 + parts/zones/forest.txt | 7 + parts/zones/images/desert.aseprite | Bin 0 -> 763 bytes parts/zones/images/desert.png | Bin 0 -> 730 bytes parts/zones/images/desert.png.import | 34 +++ parts/zones/images/farm.aseprite | Bin 0 -> 738 bytes parts/zones/images/farm.png | Bin 0 -> 687 bytes parts/zones/images/farm.png.import | 34 +++ parts/zones/images/forest.aseprite | Bin 0 -> 769 bytes parts/zones/images/forest.png | Bin 0 -> 667 bytes parts/zones/images/forest.png.import | 34 +++ parts/zones/images/home.aseprite | Bin 0 -> 1172 bytes parts/zones/images/home.png | Bin 0 -> 794 bytes parts/zones/images/home.png.import | 34 +++ parts/zones/images/lake.aseprite | Bin 0 -> 744 bytes parts/zones/images/lake.png | Bin 0 -> 659 bytes parts/zones/images/lake.png.import | 34 +++ parts/zones/lake.txt | 7 + project.godot | 25 +- src/Creature.tscn | 21 ++ src/Zone.tscn | 13 + src/creature.gd | 23 ++ src/manager/TimeManager.tscn | 6 + src/manager/time_manager.gd | 37 +++ src/ui/ActionButton.tscn | 25 ++ src/ui/MainUI.tscn | 144 ++++++++++ src/ui/TextActionButton.tscn | 30 +++ src/ui/action_button.gd | 39 +++ src/ui/coin.aseprite | Bin 0 -> 439 bytes src/ui/coin.png | Bin 0 -> 199 bytes src/ui/coin.png.import | 34 +++ src/ui/day_text.gd | 22 ++ src/ui/gold_text.gd | 11 + src/ui/pause.aseprite | Bin 0 -> 361 bytes src/ui/pause.png | Bin 0 -> 116 bytes src/ui/pause.png.import | 34 +++ src/ui/pause_menu.gd | 16 ++ src/ui/quit.aseprite | Bin 0 -> 388 bytes src/ui/quit.png | Bin 0 -> 166 bytes src/ui/quit.png.import | 34 +++ src/ui/text_action_button.gd | 33 +++ src/ui/time_text.gd | 14 + src/ui/top-left.aseprite | Bin 0 -> 745 bytes src/ui/top-left.png | Bin 0 -> 381 bytes src/ui/top-left.png.import | 34 +++ src/ui/upgrades.aseprite | Bin 0 -> 397 bytes src/ui/upgrades.png | Bin 0 -> 163 bytes src/ui/upgrades.png.import | 34 +++ src/zone.gd | 20 ++ 106 files changed, 1993 insertions(+), 153 deletions(-) create mode 100644 addons/clickthrough/clickthrough.cs create mode 100644 addons/clickthrough/detection/area/area_detector.gd create mode 100644 addons/clickthrough/detection/area/area_detector.tscn create mode 100644 addons/clickthrough/detection/transparent/transparent_detector.gd create mode 100644 addons/clickthrough/detection/transparent/transparent_detector.tscn create mode 100644 addons/clickthrough/examples/example_icon.gd create mode 100644 addons/clickthrough/examples/multiple_windows/example.tscn create mode 100644 addons/clickthrough/examples/single_window/example.tscn create mode 100644 addons/clickthrough/nodes/clickthrough_csharp/ClickthroughCSharp.cs create mode 100644 addons/clickthrough/nodes/clickthrough_csharp/ClickthroughCSharp.tscn create mode 100644 addons/clickthrough/nodes/clickthrough_gdscript/clickthrough_gdscript.gd create mode 100644 addons/clickthrough/nodes/clickthrough_gdscript/clickthrough_gdscript.tscn create mode 100644 addons/clickthrough/plugin.cfg create mode 100644 components/Cursor/cursor-ui.png create mode 100644 components/Cursor/cursor-ui.png.import create mode 100644 components/Cursor/cursor.png create mode 100644 components/Cursor/cursor.png.import create mode 100644 components/Cursor/cursor_pixel_2.png create mode 100644 components/Cursor/cursor_pixel_2.png.import create mode 100644 components/Cursor/grab-1.aseprite create mode 100644 components/Cursor/grab-1.png create mode 100644 components/Cursor/grab-1.png.import create mode 100644 components/Cursor/hover-1.aseprite create mode 100644 components/Cursor/hover-1.png create mode 100644 components/Cursor/hover-1.png.import create mode 100644 components/Cursor/normal-1.aseprite create mode 100644 components/Cursor/normal-1.png create mode 100644 components/Cursor/normal-1.png.import create mode 100644 main.gd create mode 100644 parts/creatures/1x1-1.txt create mode 100644 parts/creatures/1x2-1.txt create mode 100644 parts/creatures/2x1-1.txt create mode 100644 parts/creatures/2x2-1.txt create mode 100644 parts/creatures/images/1x1-1.aseprite create mode 100644 parts/creatures/images/1x1-1.png create mode 100644 parts/creatures/images/1x1-1.png.import create mode 100644 parts/creatures/images/1x2-1.aseprite create mode 100644 parts/creatures/images/1x2-1.png create mode 100644 parts/creatures/images/1x2-1.png.import create mode 100644 parts/creatures/images/2x1-1.aseprite create mode 100644 parts/creatures/images/2x1-1.png create mode 100644 parts/creatures/images/2x1-1.png.import create mode 100644 parts/creatures/images/2x2-1.aseprite create mode 100644 parts/creatures/images/2x2-1.png create mode 100644 parts/creatures/images/2x2-1.png.import create mode 100644 parts/dialogue/dummy.txt create mode 100644 parts/globals.txt create mode 100644 parts/zones/desert.txt create mode 100644 parts/zones/farm.txt create mode 100644 parts/zones/forest.txt create mode 100644 parts/zones/images/desert.aseprite create mode 100644 parts/zones/images/desert.png create mode 100644 parts/zones/images/desert.png.import create mode 100644 parts/zones/images/farm.aseprite create mode 100644 parts/zones/images/farm.png create mode 100644 parts/zones/images/farm.png.import create mode 100644 parts/zones/images/forest.aseprite create mode 100644 parts/zones/images/forest.png create mode 100644 parts/zones/images/forest.png.import create mode 100644 parts/zones/images/home.aseprite create mode 100644 parts/zones/images/home.png create mode 100644 parts/zones/images/home.png.import create mode 100644 parts/zones/images/lake.aseprite create mode 100644 parts/zones/images/lake.png create mode 100644 parts/zones/images/lake.png.import create mode 100644 parts/zones/lake.txt create mode 100644 src/Creature.tscn create mode 100644 src/Zone.tscn create mode 100644 src/creature.gd create mode 100644 src/manager/TimeManager.tscn create mode 100644 src/manager/time_manager.gd create mode 100644 src/ui/ActionButton.tscn create mode 100644 src/ui/MainUI.tscn create mode 100644 src/ui/TextActionButton.tscn create mode 100644 src/ui/action_button.gd create mode 100644 src/ui/coin.aseprite create mode 100644 src/ui/coin.png create mode 100644 src/ui/coin.png.import create mode 100644 src/ui/day_text.gd create mode 100644 src/ui/gold_text.gd create mode 100644 src/ui/pause.aseprite create mode 100644 src/ui/pause.png create mode 100644 src/ui/pause.png.import create mode 100644 src/ui/pause_menu.gd create mode 100644 src/ui/quit.aseprite create mode 100644 src/ui/quit.png create mode 100644 src/ui/quit.png.import create mode 100644 src/ui/text_action_button.gd create mode 100644 src/ui/time_text.gd create mode 100644 src/ui/top-left.aseprite create mode 100644 src/ui/top-left.png create mode 100644 src/ui/top-left.png.import create mode 100644 src/ui/upgrades.aseprite create mode 100644 src/ui/upgrades.png create mode 100644 src/ui/upgrades.png.import create mode 100644 src/zone.gd diff --git a/Fonts/Theme.tres b/Fonts/Theme.tres index 267a889..062fe31 100644 --- a/Fonts/Theme.tres +++ b/Fonts/Theme.tres @@ -5,3 +5,5 @@ [resource] default_font = ExtResource("1_y7uny") default_font_size = 8 +RichTextLabel/colors/font_outline_color = Color(0, 0, 0, 1) +RichTextLabel/constants/outline_size = 4 diff --git a/Main.tscn b/Main.tscn index bf09a1d..8a7da48 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,3 +1,25 @@ -[gd_scene format=3 uid="uid://bs6ojoud4mvb8"] +[gd_scene load_steps=5 format=3 uid="uid://bs6ojoud4mvb8"] + +[ext_resource type="Script" path="res://main.gd" id="1_x66oe"] +[ext_resource type="PackedScene" uid="uid://ccdhbljb3e0oh" path="res://src/ui/MainUI.tscn" id="2_anen6"] +[ext_resource type="PackedScene" uid="uid://cr2nvts234wlw" path="res://src/manager/TimeManager.tscn" id="2_rrhko"] +[ext_resource type="Texture2D" uid="uid://c37jv23kd15ay" path="res://parts/zones/images/home.png" id="3_kjcur"] [node name="Main" type="Node2D"] +script = ExtResource("1_x66oe") + +[node name="TimeManager" parent="." instance=ExtResource("2_rrhko")] + +[node name="CanvasLayer" parent="." instance=ExtResource("2_anen6")] + +[node name="Sprite2D" type="Sprite2D" parent="."] +visible = false +position = Vector2(156, 90) +texture = ExtResource("3_kjcur") + +[node name="Timer" type="Timer" parent="."] +wait_time = 3.0 +one_shot = true +autostart = true + +[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] diff --git a/addons/clickthrough/clickthrough.cs b/addons/clickthrough/clickthrough.cs new file mode 100644 index 0000000..ca4782c --- /dev/null +++ b/addons/clickthrough/clickthrough.cs @@ -0,0 +1,21 @@ +#if TOOLS +using Godot; +using System; + +[Tool] +public partial class clickthrough : EditorPlugin +{ + string AutoloadName = "Clickthrough"; + public override void _EnterTree() + { + // Initialization of the plugin goes here. + // AddAutoloadSingleton(AutoloadName, "res://addons/clickthrough/autoloads/clickthrough_gdscript/clickthrough_gdscript.tscn"); + } + + public override void _ExitTree() + { + // Clean-up of the plugin goes here. + // RemoveAutoloadSingleton(AutoloadName); + } +} +#endif diff --git a/addons/clickthrough/detection/area/area_detector.gd b/addons/clickthrough/detection/area/area_detector.gd new file mode 100644 index 0000000..8b147d0 --- /dev/null +++ b/addons/clickthrough/detection/area/area_detector.gd @@ -0,0 +1,51 @@ +#region Header +#01. tool + +#02. class_name + +#03. extends +extends Area2D +#endregion + +#region Documentation +#----------------------------------------------------------- +#04. # docstring +## hoge +#----------------------------------------------------------- +#endregion + +#region Body +#05. signals +#----------------------------------------------------------- + +#----------------------------------------------------------- +#06. enums +#----------------------------------------------------------- + +#----------------------------------------------------------- +#08. variables +#----------------------------------------------------------- +@onready var clickthrough: Clickthrough = get_parent() +#----------------------------------------------------------- +#09. methods +#----------------------------------------------------------- +func _ready() -> void: + area_entered.connect(_on_area_entered) + area_exited.connect(_on_area_exited) + pass + +func _physics_process(delta: float) -> void: + global_position = get_global_mouse_position() + pass +#----------------------------------------------------------- +#10. signal methods +#----------------------------------------------------------- + +func _on_area_entered(area: Area2D) -> void: + clickthrough.set_clickability(true) + pass + +func _on_area_exited(area: Area2D) -> void: + clickthrough.set_clickability(false) + pass +#endregion \ No newline at end of file diff --git a/addons/clickthrough/detection/area/area_detector.tscn b/addons/clickthrough/detection/area/area_detector.tscn new file mode 100644 index 0000000..e0e4ee4 --- /dev/null +++ b/addons/clickthrough/detection/area/area_detector.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=3 format=3 uid="uid://bcxwso7cge4dc"] + +[ext_resource type="Script" path="res://addons/clickthrough/detection/area/area_detector.gd" id="1_uqx6j"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_mo2k3"] +size = Vector2(1, 1) + +[node name="AreaDetector" type="Area2D"] +script = ExtResource("1_uqx6j") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_mo2k3") diff --git a/addons/clickthrough/detection/transparent/transparent_detector.gd b/addons/clickthrough/detection/transparent/transparent_detector.gd new file mode 100644 index 0000000..cf67ccb --- /dev/null +++ b/addons/clickthrough/detection/transparent/transparent_detector.gd @@ -0,0 +1,66 @@ +#region Header +#01. tool + +#02. class_name + +#03. extends +extends Node +#endregion + +#region Documentation +#----------------------------------------------------------- +#04. # docstring +## hoge +#----------------------------------------------------------- +#endregion + +#region Body +#05. signals +#----------------------------------------------------------- + +#----------------------------------------------------------- +#06. enums +#----------------------------------------------------------- + +#----------------------------------------------------------- +#08. variables +#----------------------------------------------------------- +@onready var clickthrough: Clickthrough = get_parent() + +var clickability = false; +var prev_clickability = clickability; +#----------------------------------------------------------- +#09. methods +#----------------------------------------------------------- +func _ready() -> void: + pass + +func _physics_process(delta: float) -> void: + detect_passthrough() + if (prev_clickability != clickability): + clickthrough.set_clickability(clickability) + prev_clickability = clickability + pass + +func detect_passthrough() -> void: + var viewport = get_viewport() + + var img = viewport.get_texture().get_image() + var rect = viewport.get_visible_rect() + + var mousePosition = viewport.get_mouse_position() + if (mousePosition.x < 0 || mousePosition.y < 0 || mousePosition.x > rect.size.x || mousePosition.y > rect.size.y): return; + var viewX = mousePosition.x + rect.position.x + var viewY = mousePosition.y + rect.position.y + + var x = img.get_size().x * viewX / rect.size.x + var y = img.get_size().y * viewY / rect.size.y + + if (x < img.get_size().x && y < img.get_size().y): + var pixel = img.get_pixel(x, y) + clickability = pixel.a > 0 +#----------------------------------------------------------- +#10. signal methods +#----------------------------------------------------------- + +#endregion \ No newline at end of file diff --git a/addons/clickthrough/detection/transparent/transparent_detector.tscn b/addons/clickthrough/detection/transparent/transparent_detector.tscn new file mode 100644 index 0000000..97e6328 --- /dev/null +++ b/addons/clickthrough/detection/transparent/transparent_detector.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://dgvbaum76wg1i"] + +[ext_resource type="Script" path="res://addons/clickthrough/detection/transparent/transparent_detector.gd" id="1_tavpw"] + +[node name="TransparentDetector" type="Node"] +script = ExtResource("1_tavpw") diff --git a/addons/clickthrough/examples/example_icon.gd b/addons/clickthrough/examples/example_icon.gd new file mode 100644 index 0000000..4aac32e --- /dev/null +++ b/addons/clickthrough/examples/example_icon.gd @@ -0,0 +1,60 @@ +#region Header +#01. tool + +#02. class_name + +#03. extends +extends Sprite2D +#endregion + +#region Documentation +#----------------------------------------------------------- +#04. # docstring +## hoge +#----------------------------------------------------------- +#endregion + +#region Body +#05. signals +#----------------------------------------------------------- + +#----------------------------------------------------------- +#06. enums +#----------------------------------------------------------- + +#----------------------------------------------------------- +#08. variables +#----------------------------------------------------------- +var is_dragging = false +var initial_position = Vector2.ZERO +var initial_mouse_position = Vector2.ZERO +#----------------------------------------------------------- +#09. methods +#----------------------------------------------------------- +func _ready() -> void: + var left_click = InputEventMouseButton.new() + left_click.button_index = MOUSE_BUTTON_LEFT + if !InputMap.has_action("click"): + InputMap.add_action("click") + InputMap.action_add_event("click", left_click) + +func _process(delta: float) -> void: + if Input.is_action_just_pressed("click") and is_mouse_over(): + is_dragging = true + initial_position = global_position + initial_mouse_position = get_global_mouse_position() + + if is_dragging: + if Input.is_action_just_released("click"): + is_dragging = false + + global_position = get_global_mouse_position() - initial_mouse_position + initial_position + +func is_mouse_over() -> bool: + if get_global_mouse_position().x >= global_position.x - get_rect().size.x / 2 and get_global_mouse_position().x <= global_position.x + get_rect().size.x / 2: + if get_global_mouse_position().y >= global_position.y - get_rect().size.y / 2 and get_global_mouse_position().y <= global_position.y + get_rect().size.y / 2: + return true + return false +#----------------------------------------------------------- +#10. signal methods +#----------------------------------------------------------- diff --git a/addons/clickthrough/examples/multiple_windows/example.tscn b/addons/clickthrough/examples/multiple_windows/example.tscn new file mode 100644 index 0000000..7b68b62 --- /dev/null +++ b/addons/clickthrough/examples/multiple_windows/example.tscn @@ -0,0 +1,43 @@ +[gd_scene load_steps=8 format=3 uid="uid://bosbfg5o0uwlb"] + +[ext_resource type="Script" path="res://addons/clickthrough/nodes/clickthrough_gdscript/clickthrough_gdscript.gd" id="1_x62ys"] +[ext_resource type="PackedScene" uid="uid://bcxwso7cge4dc" path="res://addons/clickthrough/detection/area/area_detector.tscn" id="2_h64ku"] +[ext_resource type="PackedScene" uid="uid://blkxbgp2i3glp" path="res://addons/clickthrough/nodes/clickthrough_gdscript/clickthrough_gdscript.tscn" id="3_7g5le"] +[ext_resource type="Script" path="res://addons/clickthrough/examples/example_icon.gd" id="4_8dtw3"] +[ext_resource type="PackedScene" uid="uid://dgvbaum76wg1i" path="res://addons/clickthrough/detection/transparent/transparent_detector.tscn" id="4_j8qig"] +[ext_resource type="Texture2D" uid="uid://crlrvohm2m7l7" path="res://icon.svg" id="5_cf4y8"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_c0p6e"] +size = Vector2(128, 128) + +[node name="Example" type="Node2D"] + +[node name="Clickthrough" type="Node" parent="."] +script = ExtResource("1_x62ys") +window_mode = 4 + +[node name="AreaDetector" parent="Clickthrough" instance=ExtResource("2_h64ku")] + +[node name="Icon" type="Sprite2D" parent="."] +position = Vector2(104, 269) +texture = ExtResource("5_cf4y8") +script = ExtResource("4_8dtw3") + +[node name="Area2D" type="Area2D" parent="Icon"] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Icon/Area2D"] +shape = SubResource("RectangleShape2D_c0p6e") + +[node name="Window" type="Window" parent="."] +initial_position = 1 +size = Vector2i(800, 600) + +[node name="Clickthrough" parent="Window" instance=ExtResource("3_7g5le")] +borderless = false + +[node name="TransparentDetector" parent="Window/Clickthrough" instance=ExtResource("4_j8qig")] + +[node name="Icon" type="Sprite2D" parent="Window"] +position = Vector2(432, 194) +texture = ExtResource("5_cf4y8") +script = ExtResource("4_8dtw3") diff --git a/addons/clickthrough/examples/single_window/example.tscn b/addons/clickthrough/examples/single_window/example.tscn new file mode 100644 index 0000000..317ada1 --- /dev/null +++ b/addons/clickthrough/examples/single_window/example.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=6 format=3 uid="uid://dfb5nqnjgjpva"] + +[ext_resource type="Texture2D" uid="uid://crlrvohm2m7l7" path="res://icon.svg" id="1_f0jmc"] +[ext_resource type="PackedScene" uid="uid://blkxbgp2i3glp" path="res://addons/clickthrough/nodes/clickthrough_gdscript/clickthrough_gdscript.tscn" id="2_6xmh1"] +[ext_resource type="Script" path="res://addons/clickthrough/examples/example_icon.gd" id="2_spq04"] +[ext_resource type="PackedScene" uid="uid://dgvbaum76wg1i" path="res://addons/clickthrough/detection/transparent/transparent_detector.tscn" id="4_rwt05"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_m2cmf"] +size = Vector2(128, 128) + +[node name="Example" type="Node2D"] + +[node name="Icon" type="Sprite2D" parent="."] +position = Vector2(162, 115) +texture = ExtResource("1_f0jmc") +script = ExtResource("2_spq04") + +[node name="Area2D" type="Area2D" parent="Icon"] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Icon/Area2D"] +shape = SubResource("RectangleShape2D_m2cmf") + +[node name="Clickthrough" parent="." instance=ExtResource("2_6xmh1")] + +[node name="TransparentDetector" parent="Clickthrough" instance=ExtResource("4_rwt05")] diff --git a/addons/clickthrough/nodes/clickthrough_csharp/ClickthroughCSharp.cs b/addons/clickthrough/nodes/clickthrough_csharp/ClickthroughCSharp.cs new file mode 100644 index 0000000..999d1c9 --- /dev/null +++ b/addons/clickthrough/nodes/clickthrough_csharp/ClickthroughCSharp.cs @@ -0,0 +1,48 @@ +using Godot; +using System; +using System.Runtime.InteropServices; + +public partial class ClickthroughCSharp : Node +{ + // SetWindowLong() modifies a specific flag value associated with a window. + // We pass the window handle, the index of the property, and the flags the property will have + [DllImport("user32.dll")] + private static extern int SetWindowLong(IntPtr hWnd, int nIndex, uint dwNewLong); + + // This is the index of the property we want to modify + private const int GwlExStyle = -20; + + // The flags we want to set + private const uint WsExLayered = 0x00080000; // Makes the window "layered" + private const uint WsExTransparent = 0x00000020; // Makes the window "clickable through" + // check https://learn.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles + + // This is the variable containing the window handle + private IntPtr _hWnd; + + public override void _Ready() + { + // We store the window handle + _hWnd = (IntPtr)DisplayServer.WindowGetNativeHandle(DisplayServer.HandleType.WindowHandle, GetWindow().GetWindowId()); + + // We can set the properties already from here + SetWindowLong(_hWnd, GwlExStyle, WsExLayered ); + + SetClickthrough(true); + } + + // This function sets the property of being clickable or not, we will call this function from the mouse detection + public void SetClickthrough(bool clickthrough) + { + if (clickthrough) + { + // We set the window as layered and click-through + SetWindowLong(_hWnd, GwlExStyle, WsExLayered | WsExTransparent); + } + else + { + // We only set the window as layered, so it will be clickable + SetWindowLong(_hWnd, GwlExStyle, WsExLayered); + } + } +} diff --git a/addons/clickthrough/nodes/clickthrough_csharp/ClickthroughCSharp.tscn b/addons/clickthrough/nodes/clickthrough_csharp/ClickthroughCSharp.tscn new file mode 100644 index 0000000..df1d6af --- /dev/null +++ b/addons/clickthrough/nodes/clickthrough_csharp/ClickthroughCSharp.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://4eoe7w32hidm"] + +[ext_resource type="Script" path="res://addons/clickthrough/nodes/clickthrough_csharp/ClickthroughCSharp.cs" id="1_fydb6"] + +[node name="ClickThroughCSharp" type="Node"] +script = ExtResource("1_fydb6") diff --git a/addons/clickthrough/nodes/clickthrough_gdscript/clickthrough_gdscript.gd b/addons/clickthrough/nodes/clickthrough_gdscript/clickthrough_gdscript.gd new file mode 100644 index 0000000..d6b8317 --- /dev/null +++ b/addons/clickthrough/nodes/clickthrough_gdscript/clickthrough_gdscript.gd @@ -0,0 +1,65 @@ +#region Header +#01. tool + +#02. class_name +class_name Clickthrough +#03. extends +extends Node +#endregion + +#region Documentation +#----------------------------------------------------------- +#04. # docstring +## hoge +#----------------------------------------------------------- +#endregion + +#region Body +#05. signals +#----------------------------------------------------------- + +#----------------------------------------------------------- +#06. enums +#----------------------------------------------------------- + +#----------------------------------------------------------- +#08. variables +#----------------------------------------------------------- +@export var transparent_bg: bool = true +@export var window_mode: DisplayServer.WindowMode = DisplayServer.WindowMode.WINDOW_MODE_WINDOWED +@export var always_on_top: bool = true +@export var unfocusable: bool = true +@export var unresizable: bool = true +@export var borderless: bool = true + + +@onready var clickthrough_csharp_packed_script: PackedScene = preload("res://addons/clickthrough/nodes/clickthrough_csharp/ClickthroughCSharp.tscn") +@onready var clickthrough_csharp = clickthrough_csharp_packed_script.instantiate() +#----------------------------------------------------------- +#09. methods +#----------------------------------------------------------- +func _ready() -> void: + DisplayServer.window_set_flag(DisplayServer.WindowFlags.WINDOW_FLAG_TRANSPARENT, transparent_bg, get_window().get_window_id()) + DisplayServer.window_set_flag(DisplayServer.WindowFlags.WINDOW_FLAG_ALWAYS_ON_TOP, always_on_top, get_window().get_window_id()) + if transparent_bg: + get_window().transparent = true + + DisplayServer.window_set_mode(window_mode, get_window().get_window_id()) + DisplayServer.window_set_flag(DisplayServer.WindowFlags.WINDOW_FLAG_RESIZE_DISABLED, unresizable, get_window().get_window_id()) + DisplayServer.window_set_flag(DisplayServer.WindowFlags.WINDOW_FLAG_NO_FOCUS, unfocusable, get_window().get_window_id()) + DisplayServer.window_set_flag(DisplayServer.WindowFlags.WINDOW_FLAG_BORDERLESS, borderless, get_window().get_window_id()) + + await get_window().ready + add_child(clickthrough_csharp) + get_viewport().size_changed.connect(_on_viewport_size_changed) + pass + +func set_clickability(clickability: bool) -> void: + clickthrough_csharp.SetClickthrough(!clickability) + +#----------------------------------------------------------- +#10. signal methods +#----------------------------------------------------------- +func _on_viewport_size_changed() -> void: + get_window().borderless = false + get_window().borderless = borderless \ No newline at end of file diff --git a/addons/clickthrough/nodes/clickthrough_gdscript/clickthrough_gdscript.tscn b/addons/clickthrough/nodes/clickthrough_gdscript/clickthrough_gdscript.tscn new file mode 100644 index 0000000..2204fd5 --- /dev/null +++ b/addons/clickthrough/nodes/clickthrough_gdscript/clickthrough_gdscript.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://blkxbgp2i3glp"] + +[ext_resource type="Script" path="res://addons/clickthrough/nodes/clickthrough_gdscript/clickthrough_gdscript.gd" id="1_l4q5i"] + +[node name="Clickthrough" type="Node"] +script = ExtResource("1_l4q5i") diff --git a/addons/clickthrough/plugin.cfg b/addons/clickthrough/plugin.cfg new file mode 100644 index 0000000..0cda6f2 --- /dev/null +++ b/addons/clickthrough/plugin.cfg @@ -0,0 +1,7 @@ +[plugin] + +name="Godot-Clickthrough" +description="" +author="Darnoman" +version="0.1" +script="clickthrough.cs" diff --git a/components/Cursor/Cursor.tscn b/components/Cursor/Cursor.tscn index 938b920..e30aae1 100644 --- a/components/Cursor/Cursor.tscn +++ b/components/Cursor/Cursor.tscn @@ -1,21 +1,24 @@ [gd_scene load_steps=4 format=3 uid="uid://qecwga1b4yqn"] [ext_resource type="Script" path="res://components/Cursor/cursor.gd" id="1_nmkwm"] -[ext_resource type="Texture2D" uid="uid://yg134s8wlxmi" path="res://icon.svg" id="2_yaf0k"] +[ext_resource type="Texture2D" uid="uid://kd8031vdmxb8" path="res://components/Cursor/normal-1.png" id="2_ucp64"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_4cq27"] +size = Vector2(8, 8) [node name="Cursor" type="CanvasLayer"] +process_mode = 3 script = ExtResource("1_nmkwm") [node name="MouseControl" type="Area2D" parent="."] +input_pickable = false [node name="CollisionShape2D" type="CollisionShape2D" parent="MouseControl"] shape = SubResource("RectangleShape2D_4cq27") [node name="Sprite2D" type="Sprite2D" parent="MouseControl"] -scale = Vector2(0.15625, 0.15625) -texture = ExtResource("2_yaf0k") +position = Vector2(2, 4) +texture = ExtResource("2_ucp64") [connection signal="area_entered" from="MouseControl" to="." method="_on_mouse_control_area_entered"] [connection signal="area_exited" from="MouseControl" to="." method="_on_mouse_control_area_exited"] diff --git a/components/Cursor/MouseHandler.tscn b/components/Cursor/MouseHandler.tscn index e610a47..e022e63 100644 --- a/components/Cursor/MouseHandler.tscn +++ b/components/Cursor/MouseHandler.tscn @@ -3,4 +3,5 @@ [ext_resource type="Script" path="res://components/Cursor/mouse_handler.gd" id="1_n30mb"] [node name="MouseHandler" type="Area2D"] +process_mode = 3 script = ExtResource("1_n30mb") diff --git a/components/Cursor/cursor-ui.png b/components/Cursor/cursor-ui.png new file mode 100644 index 0000000000000000000000000000000000000000..dd476d365f7de5285591960af5df8abd7551f1af GIT binary patch literal 2239 zcmV;w2tfCVP)<h;3K|Lk000e1NJLTq005u>005u}1^@s6i_d2*00001b5ch_0Itp) z=>Px-c}YY;RCt{2on4mPG!RCsIqV^HXV^rB2eOC28|)2O0t<l$vWg_#$ts42i4$Y| zBbBO3U#Y))PR>at(^k23UA82*EkXz(gb+dqA%qY@2qA<JLI@#*5JCtcgb+dqA%qY@ z2qA<JLJBzb4uF{PF#G%aZc$W10rT_l`OoXw&n5xief~SFkQ6X4bMcM@{7XPZ{I+)h zM8zcBkMdQ(?^k|r67WGlMYO7bPo3JmH|AAu5^zntCG$%7w}|}d6<{qbBGgK^2ZcPQ zwCe5gPM!t))iyLenp3c)c=K&i!hK$g$S+b}_12g^2b1sGAUxz-0+AReH2ItI@g&a` zOe^2f_PbEic!Yd&MiDVOZyLJgy0qb5Nz5!^2Jz-}$#qGiy%U*D!mxau&u2MbE^@h? zzx?cay~*u*mD}y6*<^UGj~eVP-yC!iLvwXLpXKp~M|t)5D3{CS%g?W$<$L?jTaAd} zInFc@?KyJWlLzu3z1?o|>hV$D{QT4Z1-xG6d_K$Vc9TDT`@Lqf;iKcd#;Ozh{^ND` z{~x})?EZftmI-Q|K<|2nILh~gBJW`mHVasqge8qKwkD`WocXj!cd|>^B%oHlISnFe z5(FWQ$ad~D`6%fJ3b;d%gb?z1RjjNMb{FvFi?34%r;}=bAqNRdG`aGSP_bQC3AZ-x zdi^&smv4?jMAN~PC9OFEIVHPE_>I?wkJyq=MC9qI+L^TvJZ=0ug!dn>CT9q%%bdpT zy5&(_0kw(Q6K{#K5~i+rTX>v~U%oik<k+POh6z|B-W=t1VKr;}qa7S&kWhK;ZQdDS z*MM39Mf@f7m_SFCaIG(TNti-F5g!R_;?FMOQT{9QYt|WCgAlldf5pILms&X@rcp|% zjin?G>-?4yHVXdmNp*YBf3QeW%jh(-gvOZJn(1yB5qXwSdpg#1+Va#j9RxKoOcIuk zOiP&`kbCiz9=MgcHMw)9sRDW(-A8CDp|)at_;g#X-kKPW^3`&kycJKcQ)?-q6VVo@ z;fd(PT1vPkV(TDnif8#pvyGZxuWn#L_)17G3B9Vd_CT1&V<Dd<kq5WQLVnbw^cFSO zV?gWIB7%F0jGC6|vKDMv1x0dK!l;#=TB1(HM*<dQN7JcUCESbq&LvdQ?QR&6yb@Z) zFc_*GFA>nK3igH)9^<_)rWG*TsaV8U!cj!5*pKQRE)~%AB4tzwMao1RMN|#u*MQp2 z>@A@;Syw71ysBW0fbK)J5eFr6ELJK;!(|kVG$28fFf$%i(DlpR5#Jjr#cH(#VcBeL zU!tn1^_|n23RoP$*24P{)~8~TaVp`K0H~AMM}$m7qexhT*BvXK07+OJh*rSrJw=eP zWqJl(zKPT6gdk#ZqFXB9T}UW`C0}X$01_5q5vA(tH}V^GYm{~n@>EI5K3K<(FbGjK zw4|mQ_8OER%O_G6pLHd)&WY6^WH<@Y<(nv(&_+HTTaJQ<kuZyVa{whQN}}~NjJt#$ zjIuliDB&TV5t%>ad;)1yipY^@76)0O%!j`OC7{TCO1SLI2tiuguoBR7CFHdDQ$+96 zaWrckX)&3c<x-;ScS5!(k+AntT?C#IqFfI~2&j5g?!8sQEk>8nQ^4kDG~a`SrIX1m zvUFSxImAmqvpv?{(v^wP)^}_0*dy1g-)WRQ(kOV2=lZVIXxnl<*t!C`554Z88hTAA zBTl&YeDh>mV;~9iBw|8Y17ZaX&%}t=LrXF)t<}=)e!z+O%7^CkidqRRS2xfqAyNf2 zlW*<cB_LLTt<?=JBUi%E7e70`Tp6koT0Ag3a=RL=s$h$NuHO&NEMeqSO6&HtSPAI9 z6c_nU4wO@o=dJQ62btAV60|+$^6cm}D&OcRA~>BCRS6SJ$B1mW26;Ek#I)K`n_#3$ z7%{2b3ybGSyH&uJ>SysJdXy?Sfi{(5MQat*ysFDIQ?;+ALaA=G9L0V*ol;8J`g$+u zQ}7xYJ85F%`8+M@1Qa>$NMuPzldv`3lmd$6e&p>a5-Q>}xduE*hno-9$ROJmnXhL> zY~&M3TmeTQ>j7jXpNOM?qu)4cMYczSSjs1o@Qvvsf-GDkZcj!qy%Ay5?{|!Zb>*7~ zdqnRZ_wXh2%y`Ks5-<oUy%wZ|n0U%p{mUzu-xJ8wF%I7HsXnlR%U#hFu|F2KTe*B_ zf!kx)C}BS$<ZJri0!la#QSvo^cmX9GfJpgFHn4zCMNLe!d}bS2VESF*H7KGzJ>)ap z&<d_1QbIc-rd!-Mw1LSYCuQ`br+nrc+rV_C9sOm}ndmK_%LX@ayWL|=NQ!t2f_!cp z-5}(iqq&e2ahqO)j<5}H5PIX==#TT&f+C;$#y9AC_vOGhe-?oxUq}N7bhqK2ghZ1s ztdRmBEErivMEOD+ssP4<QG`Sp@pf%U35)@mWkjuh;f*x{Wk41ok>%^spdl~@pvs6Y zU$;gbfH43?#tiaxZP*En-j}{2A`d!X8ty<BBY>Y?|K%edainOxGef@HF3YJGCIApZ z?C_Q_n|vZ5K>*@rikE~L<r4u41Q>H;tR>8L-8Tm&kVKf+V<ll``9#2iNl24LtrBLJ zPXsWaq^M1@ere&}M^p_t0~u6us*MVG6&Y+l^AWxFxV=R{`BZ&a`9#2jOHSRJ{CwUW z0^h&z0Vc;p!cpZDNfKmonj{=qK9NL$CPyXVNP~?n(gmCt@Ac-CeaTmKjX_HJL=p#{ z6pt#Hx(`zapBO6<)AwKc9Y{>8ghTY*5Id0=t%Sq$+b}zlm>LO(>o1Oi`!k$WHQe>i zgK<;|hwQ5%cPcq+A`aV6!|qse<`S}x2qA<JLI@#*5JCtcgb+ef@-M~G*IxAL!&v|T N002ovPDHLkV1h?$87%++ literal 0 HcmV?d00001 diff --git a/components/Cursor/cursor-ui.png.import b/components/Cursor/cursor-ui.png.import new file mode 100644 index 0000000..262d0b2 --- /dev/null +++ b/components/Cursor/cursor-ui.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cn2asbux7pygf" +path="res://.godot/imported/cursor-ui.png-342ebc343c2c58c466eef67d0e8042ef.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://components/Cursor/cursor-ui.png" +dest_files=["res://.godot/imported/cursor-ui.png-342ebc343c2c58c466eef67d0e8042ef.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/components/Cursor/cursor.gd b/components/Cursor/cursor.gd index 11c8dce..8b78d11 100644 --- a/components/Cursor/cursor.gd +++ b/components/Cursor/cursor.gd @@ -2,29 +2,139 @@ extends Base @onready var mouse_control = $"MouseControl" +@onready var sprite_2d: Sprite2D = $MouseControl/Sprite2D + +const CURSOR_UI = preload("res://components/Cursor/hover-1.png") +const CURSOR_HOLD = preload("res://components/Cursor/grab-1.png") +const CURSOR = preload("res://components/Cursor/normal-1.png") +var rotation_tween + +var cursor_tween +var hovered_objects = 0 +var holding = false +var held_item + +func _ready() -> void: + Persister.data_persisted.connect(_on_data_persisted) + Triggerer.listen("grab_creature", _on_grab_creature) + + +func _on_grab_creature(data): + held_item = data.creature + holding = true + + +func _on_release(): + holding = false + var overlapping_areas = mouse_control.get_overlapping_areas() + overlapping_areas.sort_custom(func(a, b): + return a.z_index > b.z_index + ) + + for area in overlapping_areas: + if area.has_method("_on_released"): + var current_node = area + var hidden = false + while current_node: + if "modulate" in current_node: + if current_node.modulate.a < 1: + hidden = true + break + current_node = current_node.get_parent() + + if hidden: + continue + + if not area._on_released(): + break + + +func _on_click(): + var overlapping_areas = mouse_control.get_overlapping_areas() + overlapping_areas.sort_custom(func(a, b): + return a.z_index > b.z_index + ) + + for area in overlapping_areas: + if area.has_method("_on_clicked"): + var current_node = area + var hidden = false + while current_node: + if "modulate" in current_node: + if current_node.modulate.a < 1: + hidden = true + break + if "visible" in current_node: + if not current_node.visible: + hidden = true + break + current_node = current_node.get_parent() + + if hidden: + continue + + if not area._on_clicked(): + break func _process(delta): + if Input.is_action_just_released("left_click"): + _on_release() + if Input.is_action_just_pressed("left_click"): + _on_click() Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) mouse_control.position = mouse_control.get_global_mouse_position() - if Input.is_action_just_pressed("left_click"): - var overlapping_areas = mouse_control.get_overlapping_areas() - overlapping_areas.sort_custom(func(a, b): - return a.z_index > b.z_index - ) - - for area in overlapping_areas: - if area.has_method("_on_clicked"): - if not area._on_clicked(): - break - + if held_item: + held_item.position = mouse_control.position + + if not Input.is_action_pressed("left_click"): + sprite_2d.rotation = move_toward(sprite_2d.rotation, 0, delta) + sprite_2d.scale = sprite_2d.scale.move_toward(Vector2.ONE, delta) + else: + sprite_2d.scale = sprite_2d.scale.move_toward(Vector2.ONE * 0.9, delta * 2) + sprite_2d.rotation = move_toward(sprite_2d.rotation, -0.1, delta * 2) func _on_mouse_control_area_entered(area): if area.has_method("_on_hovered"): - area._on_hovered() + var current_node = area + var hidden = false + while current_node: + if "visible" in current_node: + if not current_node.visible: + hidden = true + break + current_node = current_node.get_parent() + + if not hidden: + area._on_hovered() + hovered_objects += 1 + + _update_cursor() func _on_mouse_control_area_exited(area): if area.has_method("_on_unhovered"): - area._on_unhovered() + var current_node = area + var hidden = false + while current_node: + if "visible" in current_node: + if not current_node.visible: + hidden = true + break + current_node = current_node.get_parent() + + if not hidden: + area._on_unhovered() + hovered_objects -= 1 + + _update_cursor() + + +func _update_cursor(): + if holding: + sprite_2d.texture = CURSOR_HOLD + if hovered_objects: + sprite_2d.texture = CURSOR_UI + else: + sprite_2d.texture = CURSOR diff --git a/components/Cursor/cursor.png b/components/Cursor/cursor.png new file mode 100644 index 0000000000000000000000000000000000000000..366ced9913c7a0bb5462200359cc76d5b082f9d8 GIT binary patch literal 1171 zcmeAS@N?(olHy`uVBq!ia0vp^3qY8I4M=vMPuB%fjKx9jP7LeL$-HD>VDa^IaSW-L z^Y-rDs>N13Zi(gd?)}$I?|Wfj!g$l;--a#sF3WN#uYcA)cfvIWhK2*vKmUt6_j~rq zYO(McQy=$*$vq1!={R$$m|gd}gL$B!k@orC=yQ#E6_rWmHmj|j&)Hny)en5rmS$@8 zfQ$L=2c5+0wyP&T43m1%W*@S9UF283ZI2wx&zw4Ev-*AC+*$0us@59+Ucdh4^8f#) zmxQfP>$$M&_>_;iR&1}W)<4;tb=F|LecRk6ed|rn7K+cj`m}dFlaKuUv}Yg1XJ38U zd!9*0SpHX~>kmzbM~7AWIqtK1)EMlRUij3v<G8H-y)%~$Uj^IWd$*;4$KdVDX5%ge zF83ezd3Vb*av#4Q-1Al?=PpORjC#SY_KQCz@$9<uzl%HO{d{Sj{cKybr0%~k>o-b% z>%^=hGynLueu2GhiHt(?U)wEFx^AT6@QC~FbeAi$+V-=>gdEv2z2AU|@t>F^m!RC2 z8U@qck%c+mH~-0$;$Ov3sZ#NbXW9S24<bC8Of4dePF)O&t_>5E96SUSmT(9Jv2ajD zc;z|<-Ec4eqSl%{f*b$c?Qcjgcc}SUx&Hrd-L^VI;}`D#4enq0D$n<Ujj3ka%Gduj z+g3Cy>@)R={=Zpa4}a5-YeuPm*Dv~D#qlUQ_{Xp4Lp!Pkj%?p{;p_HehE)PbraRyG z^_}GsP;9#QiC_ILMWqTY)1_bY1CtgMSR8E^yl}eo?@tS{HB01=KVn|F)zf~$Dfds= zlj~IG>#JT>`x_(_e|nAYudP1&X2i|@()}`K)?$!LY<EqU7GLhj6!*IRPS%T49?a~H zYtNh1{@uNv|HsR7>;Fj?eTe%H^j*0_OQq`?`|BNTGz&yvOkDZkdMdx_QEEtf{Ptg+ z#xwjx9|-3<y0m*#Slh7v7n9`pC@b)wT5zGjeQ8BTwVgrxp4%t=Y;;+hc|%!2aMwF$ zts-6L`AwY@eynTR&!!{u@YDYflG)e)Mi+WE{Sy4~yKH-1d2Z;j%D(?$G27ygzTsG~ zT;!3l6<fyX?RhQU_tTeLOrP}ddV|Z3W3^`smbaEO-U{{;Q~XtG_Tlxh`Erb%0@L3e zyMF6uuz}zs<^CU0yX$x()DF!&9-kAo+<e;}PEYxTk9KsQdG+a-ZT05)2GK8K<<u9w z-SgP^en$G-%%90&Wr_7y*It!*^WwAW=1+S*`Yk<puXf|HH8$oqRvJXCFXsa0>&0`= zG=Hs|eF`Xe=cL7r6~!t*!N+rbnxAIREZd%b^zs?|8pFGJXE(oKU`Y5Z&LJ%;sNT3T Q5|j=+UHx3vIVCg!0O_9!Jpcdz literal 0 HcmV?d00001 diff --git a/components/Cursor/cursor.png.import b/components/Cursor/cursor.png.import new file mode 100644 index 0000000..33ac808 --- /dev/null +++ b/components/Cursor/cursor.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cp6rlekidrafu" +path="res://.godot/imported/cursor.png-ab5b6c93c7e19595ea2eadb14e17d081.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://components/Cursor/cursor.png" +dest_files=["res://.godot/imported/cursor.png-ab5b6c93c7e19595ea2eadb14e17d081.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/components/Cursor/cursor_pixel_2.png b/components/Cursor/cursor_pixel_2.png new file mode 100644 index 0000000000000000000000000000000000000000..83553b9b3fe884eb7b59462ccd11ce57b0e5d48d GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|+B{txLp(a~ zUa{tDP~c%pFpxRe_<R03=JEq4TUwmr?VHP7f8A_f_GNa4%U;3Kl6y8xj}OLX&y(k8 zkZEdgQRwm&-%@-bDbJyMBm2GFM+zDT5>;nqO#RWD`d%mWO`5<ehs~aP2R_-xbg1Yt zu+C=8?#MUJo4h>txV8Y}l?~ekf0oMRU;O@<v9HSD<GHi%Jb*4@@O1TaS?83{1OQ#o BO>O`H literal 0 HcmV?d00001 diff --git a/components/Cursor/cursor_pixel_2.png.import b/components/Cursor/cursor_pixel_2.png.import new file mode 100644 index 0000000..7339949 --- /dev/null +++ b/components/Cursor/cursor_pixel_2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bufstw81c021x" +path="res://.godot/imported/cursor_pixel_2.png-642708b7cfb3eb8b33fd4ecdd3a72582.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://components/Cursor/cursor_pixel_2.png" +dest_files=["res://.godot/imported/cursor_pixel_2.png-642708b7cfb3eb8b33fd4ecdd3a72582.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/components/Cursor/grab-1.aseprite b/components/Cursor/grab-1.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..acd33321704238bd4a3d6346392af4525ccb7a4b GIT binary patch literal 368 zcmXS5WMFu(l#zi42o)HB9EKDiMgX7~NRUAQ2x$R601f^1kp*lk3y>`a#Ow-SE0L_r z0<u{^u2TRqloU){HEhx>4g15a?-#1wT#)we@T}jT%w|3f$l7OMJ|)jPQ$NUC#mL6e z-oC^jp(#4=Ve;(%@n@f$zWwL_|NpbsZf~h;&&<k-3=1lA>RMxDbTd5pdiAdU>0Vv= z2J#@A6qtb|4EzT&*cp5hD^rUU3>|?SRt1n06T^Qd5DfyH3>*v<bCMGpn*Se35IErW gc(QYNGxvl=Z1b&F*f8srdZY<_vSwybKQJ!|04$zKMgRZ+ literal 0 HcmV?d00001 diff --git a/components/Cursor/grab-1.png b/components/Cursor/grab-1.png new file mode 100644 index 0000000000000000000000000000000000000000..80138963b9b7a3cf2bb278835cade1f5a9cca4d6 GIT binary patch literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}E}kxqAsQ36 z`aAM5C~z?S|DSGkr7_g(c2~ELqsR|lsc=_uXAOo4yVBS7onTw8F_%YW`s8&2+m_}e kq}}?~liq*j@%#mhVKpLL+EdeOfaWoHy85}Sb4q9e0NR)<WdHyG literal 0 HcmV?d00001 diff --git a/components/Cursor/grab-1.png.import b/components/Cursor/grab-1.png.import new file mode 100644 index 0000000..8720ca4 --- /dev/null +++ b/components/Cursor/grab-1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dllpn5ymw1vic" +path="res://.godot/imported/grab-1.png-9007848d1041f8e4fb5480358cceb970.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://components/Cursor/grab-1.png" +dest_files=["res://.godot/imported/grab-1.png-9007848d1041f8e4fb5480358cceb970.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/components/Cursor/hover-1.aseprite b/components/Cursor/hover-1.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..371d2f6f8b57e100a9a9640b33c69cb337cf28c1 GIT binary patch literal 383 zcmb<tWMFu(l#zi42o)HB9EKDiMgX7~NRUAQ2x$TS0}cK4kp*lk3y>`a#Ow-SE0L_r z0<u{^u2TRqloU){HEhx>4g15a?-#1wT#)we@T}jT%w|3f$l7OMJ|)jPQ$NUC#mL6e z-oC^jp(#4=Ve;(%@n@f$zWwL_|NpbsZf~h;&&<k-3=1lA>RMxDbTd5pdiAdU>0Vv= z2J#@A6qtb|41iq7&ft?+nOdY^7y#t3DnO+EGeKwu22KWUhKf1K2@TEvJtV|`@H45b tIJi`79b0#lg<E*@8nNjzyQE?oL`;8NQT)lj+Da#};q-nUhAEy~y#cotPptp| literal 0 HcmV?d00001 diff --git a/components/Cursor/hover-1.png b/components/Cursor/hover-1.png new file mode 100644 index 0000000000000000000000000000000000000000..f186d5b67f44e89e64e2dac4440a605e6a8ab923 GIT binary patch literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}ex5FlAsQ2> z_IvU%DDW^X{r|t%Rw8&&g4S|9pTM4=px#80J1NUPXFl+lyoE*MCDY?lUt7aFhd58a uXJoh?&S}rJ>k``o1<S>^YM02bH(@kXlHkdj7x^1#GJ~h9pUXO@geCydCoePr literal 0 HcmV?d00001 diff --git a/components/Cursor/hover-1.png.import b/components/Cursor/hover-1.png.import new file mode 100644 index 0000000..db03016 --- /dev/null +++ b/components/Cursor/hover-1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dbk7ho64arub4" +path="res://.godot/imported/hover-1.png-258b1cb2fef34712ac3214495fdd027d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://components/Cursor/hover-1.png" +dest_files=["res://.godot/imported/hover-1.png-258b1cb2fef34712ac3214495fdd027d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/components/Cursor/normal-1.aseprite b/components/Cursor/normal-1.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..6185ef8108f087b5d27f336223f081a6c7d23466 GIT binary patch literal 390 zcmZo;WMFu(l#zi42o)HB9EKDiMgX7~NRUAQ2x$S>fTsWY$O5*N1!#d75VI?Qtwgde z3&>^xxlRGdP*N~))v!skH0%$vzF(+zb3xj>!?S*WGMo7{AZwq2`IJ2GO#L8l6(bu< zd;1cDgr?}chsm@5$De(2`u3my|NqZkyS=5ZJu@pSGAyXfscVgq(arGW>(#sZr+anf z8_0ufQeXy>Fz_G9U}x}2tV}IZFboHBSQQu;n1J+u5CH}p4BQMAbCMGhew=SOaO1## zbN#pn!OYW+FJ{y0cjoP~5i^zel##XJl=A9>OZg+^y6qplb2euWw^)#9z`&sSVge5U Dc)?Qh literal 0 HcmV?d00001 diff --git a/components/Cursor/normal-1.png b/components/Cursor/normal-1.png new file mode 100644 index 0000000000000000000000000000000000000000..9d426158c2f21dc3c8b06c26ca732f15e852fe0d GIT binary patch literal 155 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}p`I>|AsQ2V zFFNuu2naAASXa^1{D1$sgYp)gyl*cFUsBxIHuvE*wuw*7_nNku{%{npP~=ilX>?Mw z5MWSPowRc5ym<XJi+109@N80qCD-g1Kc^PGil3>~EX^`C+~Pja0tQc4KbLh*2~7a$ CaW$;~ literal 0 HcmV?d00001 diff --git a/components/Cursor/normal-1.png.import b/components/Cursor/normal-1.png.import new file mode 100644 index 0000000..cbbefce --- /dev/null +++ b/components/Cursor/normal-1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://kd8031vdmxb8" +path="res://.godot/imported/normal-1.png-0502d4153ec1a4e68c1a9b6e052b8e7a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://components/Cursor/normal-1.png" +dest_files=["res://.godot/imported/normal-1.png-0502d4153ec1a4e68c1a9b6e052b8e7a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/components/Logger/Logger.tscn b/components/Logger/Logger.tscn index 6b955d8..80151ee 100644 --- a/components/Logger/Logger.tscn +++ b/components/Logger/Logger.tscn @@ -4,3 +4,4 @@ [node name="Logger" type="Node"] script = ExtResource("1_gse6q") +log_level = 2 diff --git a/components/Logger/logger.gd b/components/Logger/logger.gd index f1831bc..d15ebfc 100644 --- a/components/Logger/logger.gd +++ b/components/Logger/logger.gd @@ -1,4 +1,3 @@ -@icon("res://components/Logger/scroll-text.svg") extends Node ## A logger to log data to relevant locations ## @@ -9,10 +8,10 @@ extends Node signal log_created(message: String, level: LogLevel) enum LogLevel { - DEBUG, - INFO, - WARN, - ERROR + DEBUG = 0, + INFO = 1, + WARN = 2, + ERROR = 3 } ## The log level that should be outputted as a minimum. @@ -21,11 +20,17 @@ enum LogLevel { ## Log a message at log level debug (meant for troubleshooting). func debug(message: String, arguments: Dictionary = {}) -> void: + if log_level > LogLevel.DEBUG: + return + _log(message, LogLevel.DEBUG, arguments) ## Log a message at log level info (log to indicate something happened). func info(message: String, arguments: Dictionary = {}) -> void: + if log_level > LogLevel.INFO: + return + _log(message, LogLevel.INFO, arguments) diff --git a/components/Menu/Menu.tscn b/components/Menu/Menu.tscn index 02acd1c..92a6b24 100644 --- a/components/Menu/Menu.tscn +++ b/components/Menu/Menu.tscn @@ -23,106 +23,6 @@ shader_parameter/color = Vector4(1, 0.9, 0.65, 0.1) shader_parameter/hdr = false shader_parameter/seed = 5.0 -[sub_resource type="Animation" id="Animation_5jiy0"] -resource_name = "show_main" -length = 5.0 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("CanvasLayer/MainMenu/GameInfo/GameTitle:position") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), -"update": 0, -"values": [Vector2(135, 168), Vector2(185.297, 168), Vector2(226.423, 168), Vector2(259.221, 168), Vector2(284.538, 168), Vector2(303.219, 168), Vector2(316.109, 168), Vector2(324.053, 168), Vector2(327.897, 168), Vector2(328.486, 168), Vector2(326.665, 168), Vector2(323.28, 168), Vector2(319.175, 168), Vector2(315.197, 168), Vector2(312.19, 168), Vector2(311, 168)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("CanvasLayer/MainMenu/GameInfo/GameUnderline:position") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), -"update": 0, -"values": [Vector2(650, 194), Vector2(582.556, 194), Vector2(527.41, 194), Vector2(483.431, 194), Vector2(449.483, 194), Vector2(424.434, 194), Vector2(407.15, 194), Vector2(396.497, 194), Vector2(391.343, 194), Vector2(390.553, 194), Vector2(392.995, 194), Vector2(397.534, 194), Vector2(403.038, 194), Vector2(408.372, 194), Vector2(412.404, 194), Vector2(414, 194)] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("CanvasLayer/MainMenu/GameInfo/Author:position") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), -"update": 0, -"values": [Vector2(648, 199), Vector2(561.123, 199), Vector2(490.088, 199), Vector2(433.436, 199), Vector2(389.707, 199), Vector2(357.44, 199), Vector2(335.176, 199), Vector2(321.454, 199), Vector2(314.814, 199), Vector2(313.797, 199), Vector2(316.942, 199), Vector2(322.79, 199), Vector2(329.879, 199), Vector2(336.751, 199), Vector2(341.944, 199), Vector2(344, 199)] -} -tracks/3/type = "value" -tracks/3/imported = false -tracks/3/enabled = true -tracks/3/path = NodePath("CanvasLayer/MainMenu/Rays:position") -tracks/3/interp = 1 -tracks/3/loop_wrap = true -tracks/3/keys = { -"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), -"update": 0, -"values": [Vector2(0, 0), Vector2(32.0074, 0), Vector2(58.1781, 0), Vector2(79.0498, 0), Vector2(95.1607, 0), Vector2(107.048, 0), Vector2(115.251, 0), Vector2(120.307, 0), Vector2(122.753, 0), Vector2(123.127, 0), Vector2(121.969, 0), Vector2(119.814, 0), Vector2(117.202, 0), Vector2(114.671, 0), Vector2(112.757, 0), Vector2(112, 0)] -} -tracks/4/type = "value" -tracks/4/imported = false -tracks/4/enabled = true -tracks/4/path = NodePath("CanvasLayer/MainMenu/MenuButtons/PlayButton:position") -tracks/4/interp = 1 -tracks/4/loop_wrap = true -tracks/4/keys = { -"times": PackedFloat32Array(0.9, 0.933333, 0.966667, 1, 1.03333, 1.06667, 1.1, 1.13333, 1.16667, 1.2), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), -"update": 0, -"values": [Vector2(-110, 128), Vector2(-39.3658, 128), Vector2(9.80145, 128), Vector2(41.0148, 128), Vector2(57.7873, 128), Vector2(63.6323, 128), Vector2(62.0629, 128), Vector2(56.5923, 128), Vector2(50.7336, 128), Vector2(48, 128)] -} -tracks/5/type = "value" -tracks/5/imported = false -tracks/5/enabled = true -tracks/5/path = NodePath("CanvasLayer/MainMenu/MenuButtons/OptionsButton:position") -tracks/5/interp = 1 -tracks/5/loop_wrap = true -tracks/5/keys = { -"times": PackedFloat32Array(1.15, 1.18333, 1.21667, 1.25, 1.28333, 1.31667, 1.35, 1.38333, 1.41667, 1.45), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), -"update": 0, -"values": [Vector2(-110, 160), Vector2(-32.2129, 160), Vector2(21.9332, 160), Vector2(56.3074, 160), Vector2(74.7784, 160), Vector2(81.2154, 160), Vector2(79.487, 160), Vector2(73.4624, 160), Vector2(67.0104, 160), Vector2(64, 160)] -} -tracks/6/type = "value" -tracks/6/imported = false -tracks/6/enabled = true -tracks/6/path = NodePath("CanvasLayer/MainMenu/MenuButtons/CreditsButton:position") -tracks/6/interp = 1 -tracks/6/loop_wrap = true -tracks/6/keys = { -"times": PackedFloat32Array(1.4, 1.43333, 1.46667, 1.5, 1.53333, 1.56667, 1.6, 1.63333, 1.66667, 1.7), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), -"update": 0, -"values": [Vector2(-110, 192), Vector2(-25.0601, 192), Vector2(34.065, 192), Vector2(71.6, 192), Vector2(91.7696, 192), Vector2(98.7984, 192), Vector2(96.9111, 192), Vector2(90.3325, 192), Vector2(83.2872, 192), Vector2(80, 192)] -} -tracks/7/type = "value" -tracks/7/imported = false -tracks/7/enabled = true -tracks/7/path = NodePath("CanvasLayer/MainMenu/MenuButtons/QuitButton:position") -tracks/7/interp = 1 -tracks/7/loop_wrap = true -tracks/7/keys = { -"times": PackedFloat32Array(1.65, 1.68333, 1.71667, 1.75, 1.78333, 1.81667, 1.85, 1.88333, 1.91667, 1.95), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), -"update": 0, -"values": [Vector2(-110, 224), Vector2(-17.9072, 224), Vector2(46.1968, 224), Vector2(86.8927, 224), Vector2(108.761, 224), Vector2(116.381, 224), Vector2(114.335, 224), Vector2(107.203, 224), Vector2(99.5641, 224), Vector2(96, 224)] -} - [sub_resource type="Animation" id="Animation_u1e5j"] length = 0.001 tracks/0/type = "value" @@ -222,6 +122,105 @@ tracks/7/keys = { "values": [Vector2(-110, 224)] } +[sub_resource type="Animation" id="Animation_awvye"] +resource_name = "hide_credits" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("CanvasLayer/MainMenu/MenuButtons/PlayButton:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 0, +"values": [Vector2(-110, 128), Vector2(-89.6356, 128), Vector2(-70.6756, 128), Vector2(-53.12, 128), Vector2(-36.9689, 128), Vector2(-22.2222, 128), Vector2(-8.87999, 128), Vector2(3.05778, 128), Vector2(13.5911, 128), Vector2(22.72, 128), Vector2(30.4444, 128), Vector2(36.7645, 128), Vector2(41.68, 128), Vector2(45.1911, 128), Vector2(47.2978, 128), Vector2(48, 128)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("CanvasLayer/MainMenu/MenuButtons/OptionsButton:position") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 0, +"values": [Vector2(-110, 160), Vector2(-87.5733, 160), Vector2(-66.6933, 160), Vector2(-47.36, 160), Vector2(-29.5733, 160), Vector2(-13.3333, 160), Vector2(1.36001, 160), Vector2(14.5067, 160), Vector2(26.1067, 160), Vector2(36.16, 160), Vector2(44.6667, 160), Vector2(51.6267, 160), Vector2(57.04, 160), Vector2(60.9067, 160), Vector2(63.2267, 160), Vector2(64, 160)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("CanvasLayer/MainMenu/MenuButtons/CreditsButton:position") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 0, +"values": [Vector2(-110, 192), Vector2(-85.5111, 192), Vector2(-62.7111, 192), Vector2(-41.6, 192), Vector2(-22.1778, 192), Vector2(-4.44444, 192), Vector2(11.6, 192), Vector2(25.9556, 192), Vector2(38.6222, 192), Vector2(49.6, 192), Vector2(58.8889, 192), Vector2(66.4889, 192), Vector2(72.4, 192), Vector2(76.6222, 192), Vector2(79.1555, 192), Vector2(80, 192)] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("CanvasLayer/MainMenu/MenuButtons/QuitButton:position") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 0, +"values": [Vector2(-110, 224), Vector2(-83.4489, 224), Vector2(-58.7289, 224), Vector2(-35.84, 224), Vector2(-14.7822, 224), Vector2(4.44445, 224), Vector2(21.84, 224), Vector2(37.4044, 224), Vector2(51.1378, 224), Vector2(63.04, 224), Vector2(73.1111, 224), Vector2(81.3511, 224), Vector2(87.76, 224), Vector2(92.3378, 224), Vector2(95.0844, 224), Vector2(96, 224)] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("CanvasLayer/MainMenu/GameInfo/GameTitle:position") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 0, +"values": [Vector2(645, 168), Vector2(601.951, 168), Vector2(561.871, 168), Vector2(524.76, 168), Vector2(490.618, 168), Vector2(459.444, 168), Vector2(431.24, 168), Vector2(406.004, 168), Vector2(383.738, 168), Vector2(364.44, 168), Vector2(348.111, 168), Vector2(334.751, 168), Vector2(324.36, 168), Vector2(316.938, 168), Vector2(312.484, 168), Vector2(311, 168)] +} +tracks/5/type = "value" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath("CanvasLayer/MainMenu/GameInfo/GameUnderline:position") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/keys = { +"times": PackedFloat32Array(0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 0, +"values": [Vector2(650, 194), Vector2(615.089, 194), Vector2(582.97, 194), Vector2(553.645, 194), Vector2(527.112, 194), Vector2(503.373, 194), Vector2(482.426, 194), Vector2(464.272, 194), Vector2(448.911, 194), Vector2(436.343, 194), Vector2(426.568, 194), Vector2(419.586, 194), Vector2(415.396, 194), Vector2(414, 194)] +} +tracks/6/type = "value" +tracks/6/imported = false +tracks/6/enabled = true +tracks/6/path = NodePath("CanvasLayer/MainMenu/GameInfo/Author:position") +tracks/6/interp = 1 +tracks/6/loop_wrap = true +tracks/6/keys = { +"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 0, +"values": [Vector2(648, 199), Vector2(608.818, 199), Vector2(572.338, 199), Vector2(538.56, 199), Vector2(507.484, 199), Vector2(479.111, 199), Vector2(453.44, 199), Vector2(430.471, 199), Vector2(410.204, 199), Vector2(392.64, 199), Vector2(377.778, 199), Vector2(365.618, 199), Vector2(356.16, 199), Vector2(349.404, 199), Vector2(345.351, 199), Vector2(344, 199)] +} +tracks/7/type = "value" +tracks/7/imported = false +tracks/7/enabled = true +tracks/7/path = NodePath("CanvasLayer/MainMenu/Rays:position") +tracks/7/interp = 1 +tracks/7/loop_wrap = true +tracks/7/keys = { +"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 0, +"values": [Vector2(0, 0), Vector2(14.4356, 0), Vector2(27.8756, 0), Vector2(40.32, 0), Vector2(51.7689, 0), Vector2(62.2222, 0), Vector2(71.68, 0), Vector2(80.1422, 0), Vector2(87.6089, 0), Vector2(94.08, 0), Vector2(99.5555, 0), Vector2(104.036, 0), Vector2(107.52, 0), Vector2(110.009, 0), Vector2(111.502, 0), Vector2(112, 0)] +} + [sub_resource type="Animation" id="Animation_ob40t"] resource_name = "hide_main" tracks/0/type = "value" @@ -420,103 +419,104 @@ tracks/7/keys = { "values": [Vector2(112, 0), Vector2(97.5644, 0), Vector2(84.1244, 0), Vector2(71.68, 0), Vector2(60.2311, 0), Vector2(49.7778, 0), Vector2(40.32, 0), Vector2(31.8578, 0), Vector2(24.3911, 0), Vector2(17.92, 0), Vector2(12.4445, 0), Vector2(7.96444, 0), Vector2(4.48, 0), Vector2(1.99111, 0), Vector2(0.49778, 0), Vector2(0, 0)] } -[sub_resource type="Animation" id="Animation_awvye"] -resource_name = "hide_credits" +[sub_resource type="Animation" id="Animation_5jiy0"] +resource_name = "show_main" +length = 5.0 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("CanvasLayer/MainMenu/MenuButtons/PlayButton:position") +tracks/0/path = NodePath("CanvasLayer/MainMenu/GameInfo/GameTitle:position") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { "times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), "update": 0, -"values": [Vector2(-110, 128), Vector2(-89.6356, 128), Vector2(-70.6756, 128), Vector2(-53.12, 128), Vector2(-36.9689, 128), Vector2(-22.2222, 128), Vector2(-8.87999, 128), Vector2(3.05778, 128), Vector2(13.5911, 128), Vector2(22.72, 128), Vector2(30.4444, 128), Vector2(36.7645, 128), Vector2(41.68, 128), Vector2(45.1911, 128), Vector2(47.2978, 128), Vector2(48, 128)] +"values": [Vector2(135, 168), Vector2(185.297, 168), Vector2(226.423, 168), Vector2(259.221, 168), Vector2(284.538, 168), Vector2(303.219, 168), Vector2(316.109, 168), Vector2(324.053, 168), Vector2(327.897, 168), Vector2(328.486, 168), Vector2(326.665, 168), Vector2(323.28, 168), Vector2(319.175, 168), Vector2(315.197, 168), Vector2(312.19, 168), Vector2(311, 168)] } tracks/1/type = "value" tracks/1/imported = false tracks/1/enabled = true -tracks/1/path = NodePath("CanvasLayer/MainMenu/MenuButtons/OptionsButton:position") +tracks/1/path = NodePath("CanvasLayer/MainMenu/GameInfo/GameUnderline:position") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/keys = { "times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), "update": 0, -"values": [Vector2(-110, 160), Vector2(-87.5733, 160), Vector2(-66.6933, 160), Vector2(-47.36, 160), Vector2(-29.5733, 160), Vector2(-13.3333, 160), Vector2(1.36001, 160), Vector2(14.5067, 160), Vector2(26.1067, 160), Vector2(36.16, 160), Vector2(44.6667, 160), Vector2(51.6267, 160), Vector2(57.04, 160), Vector2(60.9067, 160), Vector2(63.2267, 160), Vector2(64, 160)] +"values": [Vector2(650, 194), Vector2(582.556, 194), Vector2(527.41, 194), Vector2(483.431, 194), Vector2(449.483, 194), Vector2(424.434, 194), Vector2(407.15, 194), Vector2(396.497, 194), Vector2(391.343, 194), Vector2(390.553, 194), Vector2(392.995, 194), Vector2(397.534, 194), Vector2(403.038, 194), Vector2(408.372, 194), Vector2(412.404, 194), Vector2(414, 194)] } tracks/2/type = "value" tracks/2/imported = false tracks/2/enabled = true -tracks/2/path = NodePath("CanvasLayer/MainMenu/MenuButtons/CreditsButton:position") +tracks/2/path = NodePath("CanvasLayer/MainMenu/GameInfo/Author:position") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/keys = { "times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), "update": 0, -"values": [Vector2(-110, 192), Vector2(-85.5111, 192), Vector2(-62.7111, 192), Vector2(-41.6, 192), Vector2(-22.1778, 192), Vector2(-4.44444, 192), Vector2(11.6, 192), Vector2(25.9556, 192), Vector2(38.6222, 192), Vector2(49.6, 192), Vector2(58.8889, 192), Vector2(66.4889, 192), Vector2(72.4, 192), Vector2(76.6222, 192), Vector2(79.1555, 192), Vector2(80, 192)] +"values": [Vector2(648, 199), Vector2(561.123, 199), Vector2(490.088, 199), Vector2(433.436, 199), Vector2(389.707, 199), Vector2(357.44, 199), Vector2(335.176, 199), Vector2(321.454, 199), Vector2(314.814, 199), Vector2(313.797, 199), Vector2(316.942, 199), Vector2(322.79, 199), Vector2(329.879, 199), Vector2(336.751, 199), Vector2(341.944, 199), Vector2(344, 199)] } tracks/3/type = "value" tracks/3/imported = false tracks/3/enabled = true -tracks/3/path = NodePath("CanvasLayer/MainMenu/MenuButtons/QuitButton:position") +tracks/3/path = NodePath("CanvasLayer/MainMenu/Rays:position") tracks/3/interp = 1 tracks/3/loop_wrap = true tracks/3/keys = { "times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), "update": 0, -"values": [Vector2(-110, 224), Vector2(-83.4489, 224), Vector2(-58.7289, 224), Vector2(-35.84, 224), Vector2(-14.7822, 224), Vector2(4.44445, 224), Vector2(21.84, 224), Vector2(37.4044, 224), Vector2(51.1378, 224), Vector2(63.04, 224), Vector2(73.1111, 224), Vector2(81.3511, 224), Vector2(87.76, 224), Vector2(92.3378, 224), Vector2(95.0844, 224), Vector2(96, 224)] +"values": [Vector2(0, 0), Vector2(32.0074, 0), Vector2(58.1781, 0), Vector2(79.0498, 0), Vector2(95.1607, 0), Vector2(107.048, 0), Vector2(115.251, 0), Vector2(120.307, 0), Vector2(122.753, 0), Vector2(123.127, 0), Vector2(121.969, 0), Vector2(119.814, 0), Vector2(117.202, 0), Vector2(114.671, 0), Vector2(112.757, 0), Vector2(112, 0)] } tracks/4/type = "value" tracks/4/imported = false tracks/4/enabled = true -tracks/4/path = NodePath("CanvasLayer/MainMenu/GameInfo/GameTitle:position") +tracks/4/path = NodePath("CanvasLayer/MainMenu/MenuButtons/PlayButton:position") tracks/4/interp = 1 tracks/4/loop_wrap = true tracks/4/keys = { -"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"times": PackedFloat32Array(0.9, 0.933333, 0.966667, 1, 1.03333, 1.06667, 1.1, 1.13333, 1.16667, 1.2), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), "update": 0, -"values": [Vector2(645, 168), Vector2(601.951, 168), Vector2(561.871, 168), Vector2(524.76, 168), Vector2(490.618, 168), Vector2(459.444, 168), Vector2(431.24, 168), Vector2(406.004, 168), Vector2(383.738, 168), Vector2(364.44, 168), Vector2(348.111, 168), Vector2(334.751, 168), Vector2(324.36, 168), Vector2(316.938, 168), Vector2(312.484, 168), Vector2(311, 168)] +"values": [Vector2(-110, 128), Vector2(-39.3658, 128), Vector2(9.80145, 128), Vector2(41.0148, 128), Vector2(57.7873, 128), Vector2(63.6323, 128), Vector2(62.0629, 128), Vector2(56.5923, 128), Vector2(50.7336, 128), Vector2(48, 128)] } tracks/5/type = "value" tracks/5/imported = false tracks/5/enabled = true -tracks/5/path = NodePath("CanvasLayer/MainMenu/GameInfo/GameUnderline:position") +tracks/5/path = NodePath("CanvasLayer/MainMenu/MenuButtons/OptionsButton:position") tracks/5/interp = 1 tracks/5/loop_wrap = true tracks/5/keys = { -"times": PackedFloat32Array(0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"times": PackedFloat32Array(1.15, 1.18333, 1.21667, 1.25, 1.28333, 1.31667, 1.35, 1.38333, 1.41667, 1.45), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), "update": 0, -"values": [Vector2(650, 194), Vector2(615.089, 194), Vector2(582.97, 194), Vector2(553.645, 194), Vector2(527.112, 194), Vector2(503.373, 194), Vector2(482.426, 194), Vector2(464.272, 194), Vector2(448.911, 194), Vector2(436.343, 194), Vector2(426.568, 194), Vector2(419.586, 194), Vector2(415.396, 194), Vector2(414, 194)] +"values": [Vector2(-110, 160), Vector2(-32.2129, 160), Vector2(21.9332, 160), Vector2(56.3074, 160), Vector2(74.7784, 160), Vector2(81.2154, 160), Vector2(79.487, 160), Vector2(73.4624, 160), Vector2(67.0104, 160), Vector2(64, 160)] } tracks/6/type = "value" tracks/6/imported = false tracks/6/enabled = true -tracks/6/path = NodePath("CanvasLayer/MainMenu/GameInfo/Author:position") +tracks/6/path = NodePath("CanvasLayer/MainMenu/MenuButtons/CreditsButton:position") tracks/6/interp = 1 tracks/6/loop_wrap = true tracks/6/keys = { -"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"times": PackedFloat32Array(1.4, 1.43333, 1.46667, 1.5, 1.53333, 1.56667, 1.6, 1.63333, 1.66667, 1.7), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), "update": 0, -"values": [Vector2(648, 199), Vector2(608.818, 199), Vector2(572.338, 199), Vector2(538.56, 199), Vector2(507.484, 199), Vector2(479.111, 199), Vector2(453.44, 199), Vector2(430.471, 199), Vector2(410.204, 199), Vector2(392.64, 199), Vector2(377.778, 199), Vector2(365.618, 199), Vector2(356.16, 199), Vector2(349.404, 199), Vector2(345.351, 199), Vector2(344, 199)] +"values": [Vector2(-110, 192), Vector2(-25.0601, 192), Vector2(34.065, 192), Vector2(71.6, 192), Vector2(91.7696, 192), Vector2(98.7984, 192), Vector2(96.9111, 192), Vector2(90.3325, 192), Vector2(83.2872, 192), Vector2(80, 192)] } tracks/7/type = "value" tracks/7/imported = false tracks/7/enabled = true -tracks/7/path = NodePath("CanvasLayer/MainMenu/Rays:position") +tracks/7/path = NodePath("CanvasLayer/MainMenu/MenuButtons/QuitButton:position") tracks/7/interp = 1 tracks/7/loop_wrap = true tracks/7/keys = { -"times": PackedFloat32Array(0, 0.0333333, 0.0666667, 0.1, 0.133333, 0.166667, 0.2, 0.233333, 0.266667, 0.3, 0.333333, 0.366667, 0.4, 0.433333, 0.466667, 0.5), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"times": PackedFloat32Array(1.65, 1.68333, 1.71667, 1.75, 1.78333, 1.81667, 1.85, 1.88333, 1.91667, 1.95), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), "update": 0, -"values": [Vector2(0, 0), Vector2(14.4356, 0), Vector2(27.8756, 0), Vector2(40.32, 0), Vector2(51.7689, 0), Vector2(62.2222, 0), Vector2(71.68, 0), Vector2(80.1422, 0), Vector2(87.6089, 0), Vector2(94.08, 0), Vector2(99.5555, 0), Vector2(104.036, 0), Vector2(107.52, 0), Vector2(110.009, 0), Vector2(111.502, 0), Vector2(112, 0)] +"values": [Vector2(-110, 224), Vector2(-17.9072, 224), Vector2(46.1968, 224), Vector2(86.8927, 224), Vector2(108.761, 224), Vector2(116.381, 224), Vector2(114.335, 224), Vector2(107.203, 224), Vector2(99.5641, 224), Vector2(96, 224)] } [sub_resource type="AnimationLibrary" id="AnimationLibrary_twm3r"] diff --git a/components/Persister/persister.gd b/components/Persister/persister.gd index 706d642..e18a771 100644 --- a/components/Persister/persister.gd +++ b/components/Persister/persister.gd @@ -25,6 +25,8 @@ func _spawned(): ## Store data in a category func persist_data(key: String, value, category := PersisterEnums.Scope.RUN) -> void: # Only allow ints, bools or strings to be persisted and as Strings + var original_pass = value + if value is int: value = str(value) @@ -47,16 +49,19 @@ func persist_data(key: String, value, category := PersisterEnums.Scope.RUN) -> v _info("Set key <%s> in category {%s} to value |%s|" % [key, _get_category_name(category), value]) _persisted[category][key] = value + if _triggerer: + _triggerer.trigger(key, {"value": original_pass}) + _emit_change(key, value, category) ## Get the value associated with a key in the highest priority or specified category -func get_value(key: String, category: PersisterEnums.Scope = PersisterEnums.Scope.UNKNOWN): +func get_value(key: String, category: PersisterEnums.Scope = PersisterEnums.Scope.UNKNOWN, default = null): if category == PersisterEnums.Scope.UNKNOWN: category = _get_key_category(key) if category == PersisterEnums.Scope.UNKNOWN: - return null + return default if _persisted[category][key].is_valid_int(): return int(_persisted[category][key]) @@ -116,6 +121,51 @@ func change_value(key: String, value: int, category := PersisterEnums.Scope.RUN) persist_data(key, value + old_value, category) +func change_value_clamp_min(key: String, value: int, min: int, category := PersisterEnums.Scope.RUN) -> void: + change_value_clamp(key, value, min, INF, category) + + +func change_value_clamp_max(key: String, value: int, max: int, category := PersisterEnums.Scope.RUN) -> void: + change_value_clamp(key, value, -INF, max, category) + + +func change_value_clamp(key: String, value: int, min: int, max: int, category := PersisterEnums.Scope.RUN) -> void: + if min > max and not min == -9223372036854775808 and not max == -9223372036854775808: + _warn("Attempted to change clamp value %s with higher min %s than max %s" % [key, min, max]) + return + + if not _persisted.has(category): + _persisted[category] = {} + + if not _persisted[category].has(key): + if value < min and not min == -9223372036854775808: + value = min + + if value > max and not max == -9223372036854775808: + value = max + + persist_data(key, value, category) + return + + if is_nan(int(_persisted[category][key])): + _error("Attempted to add number |%d| to key <%s> in category {%s} that is not a number (value: |%s|)" % [value, key, category, _persisted[category][key]]) + return + + var old_value = int(_persisted[category][key]) + var new_value = value + old_value + + if new_value < min and not min == -9223372036854775808: + new_value = min + + if new_value > max and not max == -9223372036854775808: + new_value = max + + if old_value == new_value: + return + + _info("Added clamped number |%d| to key <%s> in category {%s} (old: |%d|) (new: |%d|)" % [value, key, _get_category_name(category), old_value, new_value]) + persist_data(key, new_value, category) + func change_save(index: int): _save() persist_data("save", index) diff --git a/main.gd b/main.gd new file mode 100644 index 0000000..7efad57 --- /dev/null +++ b/main.gd @@ -0,0 +1,38 @@ +extends Node2D + +@onready var zones = Data.data.zones + +const CURSOR = preload("res://components/Cursor/Cursor.tscn") +const ZONE = preload("res://src/Zone.tscn") + +func _ready() -> void: + Triggerer.listen("spawn_window", _on_spawn_window) + Triggerer.listen("quit", _on_quit) + DisplayServer.window_set_title("Home") + get_viewport().transparent_bg = true + + +func _process(delta: float) -> void: + if Input.is_action_just_pressed("test"): + Triggerer.trigger("spawn_window", {"key": ["farm", "desert", "lake", "forest"].pick_random()}) + + +func _on_spawn_window(data) -> void: + var zone = zones[data.key] + + var new_window = ZONE.instantiate() + new_window.key = data.key + new_window.size = Vector2(int(zone.size[0]) * 12 * 4, int(zone.size[1]) * 12 * 4) + new_window.position = Vector2(int(zone.spawn_position[0]), int(zone.spawn_position[1])) + var new_cursor = CURSOR.instantiate() + new_window.add_child(new_cursor) + + get_tree().root.add_child(new_window) + + +func _on_timer_timeout() -> void: + Triggerer.trigger("spawn_window", {"key": ["farm", "desert", "lake", "forest"].pick_random()}) + + +func _on_quit(_data) -> void: + get_tree().quit() diff --git a/parts/creatures/1x1-1.txt b/parts/creatures/1x1-1.txt new file mode 100644 index 0000000..7b5010e --- /dev/null +++ b/parts/creatures/1x1-1.txt @@ -0,0 +1,2 @@ +width: 1 +height: 1 diff --git a/parts/creatures/1x2-1.txt b/parts/creatures/1x2-1.txt new file mode 100644 index 0000000..2a1583c --- /dev/null +++ b/parts/creatures/1x2-1.txt @@ -0,0 +1,2 @@ +width: 1 +height: 2 diff --git a/parts/creatures/2x1-1.txt b/parts/creatures/2x1-1.txt new file mode 100644 index 0000000..f649798 --- /dev/null +++ b/parts/creatures/2x1-1.txt @@ -0,0 +1,2 @@ +width: 2 +height: 1 diff --git a/parts/creatures/2x2-1.txt b/parts/creatures/2x2-1.txt new file mode 100644 index 0000000..e167a48 --- /dev/null +++ b/parts/creatures/2x2-1.txt @@ -0,0 +1,2 @@ +width: 2 +height: 2 diff --git a/parts/creatures/images/1x1-1.aseprite b/parts/creatures/images/1x1-1.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..572f20cb4f4300a1db122a22b1d879d7fbb552aa GIT binary patch literal 347 zcma!MWMFu(l#zi42o)HB9EKDiMgX7~NRUAQ2x$Rs0}cK4kp*lk3y>`a#Ow-SE0L_r z0<u{^u2TRqloU){HEhx>4g15a?-#1wT#)we@T}jT%w|3f$l7OMJ|)jPQ$NUC#mL6e z-oC^jp(#4=Ve;(%@n@f$zWwL_|NpbsZf~h;&&<k-3=1lA>RMxDbTd5pdiAdU>0Vv= z2J#@A6qtb|4EzT&*cp5hD^rUU40V7URt1REe<ldc01mv0IlJRmeEa`TL+)rw62rMk Gi4OoxaziEn literal 0 HcmV?d00001 diff --git a/parts/creatures/images/1x1-1.png b/parts/creatures/images/1x1-1.png new file mode 100644 index 0000000000000000000000000000000000000000..808a583eb90168a394df867f9cd1859c447d809d GIT binary patch literal 94 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}5}q!OAsQ2t q_r$OGHouYOfJ@h-Kwf1}W`;dmn0jZXJZcB3VeoYIb6Mw<&;$VA(HW@# literal 0 HcmV?d00001 diff --git a/parts/creatures/images/1x1-1.png.import b/parts/creatures/images/1x1-1.png.import new file mode 100644 index 0000000..f5406f8 --- /dev/null +++ b/parts/creatures/images/1x1-1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dnvnm78idadmn" +path="res://.godot/imported/1x1-1.png-759493f29db93b9b5b7fc6e9d3ae57b7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://parts/creatures/images/1x1-1.png" +dest_files=["res://.godot/imported/1x1-1.png-759493f29db93b9b5b7fc6e9d3ae57b7.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/parts/creatures/images/1x2-1.aseprite b/parts/creatures/images/1x2-1.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..27471577e3a04b3755be6a33821967982cd81e8a GIT binary patch literal 351 zcma!NWMFu(l#zjlL4rYn0mxxU0b&FIih%?f1b~nh;6BjMUmsb(wz2@(VnEEU0Jajz zx-1}@1>`yfAVW#P#8ty4&C;+x%=&(z+RX)N?+(xU{mE?R(}1jf2If=pyfgKKyj6^B zEbZ+}3=*26^ByM8{vUt#$?4mF{{R0!d+qj?y7tVhtjMsSGN-OJMn*Toldo6r>Ywh_ zm2V&qvPpp%NW#E>AcLL3C$TcMNWstm$YE80Nd0Gm&<x<ftC(~8R{96~Y?1y)fi_+2 M49pBxhZp__0AlY$3;+NC literal 0 HcmV?d00001 diff --git a/parts/creatures/images/1x2-1.png b/parts/creatures/images/1x2-1.png new file mode 100644 index 0000000000000000000000000000000000000000..ba5900d4ae5bbc98ecb2681f7130db6b78940be3 GIT binary patch literal 100 zcmeAS@N?(olHy`uVBq!ia0vp^JU}eL!3HGH8OdY;DaPU;cPEB*=VV?2IdYyZjv*Gk x$!Bh*f0*CMa=@kQQ6TSPDL2!eEQMHR2A$1J?Yp|t{s2`nc)I$ztaD0e0swDL8*2an literal 0 HcmV?d00001 diff --git a/parts/creatures/images/1x2-1.png.import b/parts/creatures/images/1x2-1.png.import new file mode 100644 index 0000000..6b056e5 --- /dev/null +++ b/parts/creatures/images/1x2-1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cmdnc7nf7h6fr" +path="res://.godot/imported/1x2-1.png-b08cca67c9386c6382072a61026ad76c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://parts/creatures/images/1x2-1.png" +dest_files=["res://.godot/imported/1x2-1.png-b08cca67c9386c6382072a61026ad76c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/parts/creatures/images/2x1-1.aseprite b/parts/creatures/images/2x1-1.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..48e7c5e6d4b6b68203496e98c86f075f215dbb01 GIT binary patch literal 351 zcma!NWMFu(l#xM#frmkX0mxxU0b&FIih%?f1b~nh;6BjMUmsb(wz2@(VnEEU0Jajz zx-1}@1>`yfAVW#P#8ty4&C;+x%=&(z+RX)N?+(xU{mE?R(}1jf2If=pyfgKKyj6^B zEbZ+}3=*26^ByM8{vUt#$?4mF{{R0!d+qj?y7tVhtjMsSGN-OJMn*Toldo6r>Ywh_ zm2V&qvPpp%NW#E>AcLL3C$TcMNWstm$YE80Nd0Gm&<x<ftC$m=obsjqtcKjt#T6p_ M3~UU~xdQ$J09Qsr6aWAK literal 0 HcmV?d00001 diff --git a/parts/creatures/images/2x1-1.png b/parts/creatures/images/2x1-1.png new file mode 100644 index 0000000000000000000000000000000000000000..bc11a3705ad7e6ba2e2d2be73b419f3badf7212e GIT binary patch literal 99 zcmeAS@N?(olHy`uVBq!ia0vp^5<twu!3HEN3~Eb(6k~CayA#8@b22Z199d5n#}JF& v<e21?FY_DQ8ak)7^+y?G9bCbB_$U*@BvU5!&uz-wK!psRu6{1-oD!M<RcRW> literal 0 HcmV?d00001 diff --git a/parts/creatures/images/2x1-1.png.import b/parts/creatures/images/2x1-1.png.import new file mode 100644 index 0000000..46af076 --- /dev/null +++ b/parts/creatures/images/2x1-1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://daocx5uhmoupt" +path="res://.godot/imported/2x1-1.png-4cfaf02a2d3aa1aceed33f923f29dec3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://parts/creatures/images/2x1-1.png" +dest_files=["res://.godot/imported/2x1-1.png-4cfaf02a2d3aa1aceed33f923f29dec3.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/parts/creatures/images/2x2-1.aseprite b/parts/creatures/images/2x2-1.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..4c9e5694736e13e376b5ef33d1863249faff3d87 GIT binary patch literal 357 zcmYdgWMFu(l#xLK2o)HB9EKDiMgX7~NRUAQ2x$SH0uBB3kp*lk3y>`a#Ow-SE0L_r z0<u{^u2TRqloU){HEhx>4g15a?-#1wT#)we@T}jT%w|3f$l7OMJ|)jPQ$NUC#mL6e z-oC^jp(#4=Ve;(%@n@f$zWwL_|NpbsZf~h;&&<k-3=1lA>RMxDbTd5pdiAdU>0Vv= z2J#@A6qtb|4EzT&*cp5hD^rUU49$QXRt1REe<ldc01mv0IozMZe#)D4xqsA<JG!_+ Qr2kQ%O_Kq`yAvPu02`4;YybcN literal 0 HcmV?d00001 diff --git a/parts/creatures/images/2x2-1.png b/parts/creatures/images/2x2-1.png new file mode 100644 index 0000000000000000000000000000000000000000..852e42d0e3ba293f76a799b4e1ccdd9eea8adce4 GIT binary patch literal 109 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|)ID7sLp(Z@ zc|L{xJn!Iqz{UHpyRO96gey&f+-@+&3U-DQKNvr>IrzE)wJ><P`njxgN@xNA(#Ie5 literal 0 HcmV?d00001 diff --git a/parts/creatures/images/2x2-1.png.import b/parts/creatures/images/2x2-1.png.import new file mode 100644 index 0000000..d8c1b18 --- /dev/null +++ b/parts/creatures/images/2x2-1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b38egd0hr54w5" +path="res://.godot/imported/2x2-1.png-434c30559a5927276d09c09d64707ad9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://parts/creatures/images/2x2-1.png" +dest_files=["res://.godot/imported/2x2-1.png-434c30559a5927276d09c09d64707ad9.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/parts/dialogue/dummy.txt b/parts/dialogue/dummy.txt new file mode 100644 index 0000000..36e9836 --- /dev/null +++ b/parts/dialogue/dummy.txt @@ -0,0 +1,2 @@ +dummy[] + dummy: dummy diff --git a/parts/globals.txt b/parts/globals.txt new file mode 100644 index 0000000..872f12d --- /dev/null +++ b/parts/globals.txt @@ -0,0 +1 @@ +day_length: 240 diff --git a/parts/zones/desert.txt b/parts/zones/desert.txt new file mode 100644 index 0000000..d4e1ce1 --- /dev/null +++ b/parts/zones/desert.txt @@ -0,0 +1,7 @@ +name: Desert +spawn_position[] + 300 + 300 +size[] + 6 + 6 diff --git a/parts/zones/farm.txt b/parts/zones/farm.txt new file mode 100644 index 0000000..8913982 --- /dev/null +++ b/parts/zones/farm.txt @@ -0,0 +1,7 @@ +name: Farm +spawn_position[] + 300 + 300 +size[] + 6 + 5 diff --git a/parts/zones/forest.txt b/parts/zones/forest.txt new file mode 100644 index 0000000..eae2012 --- /dev/null +++ b/parts/zones/forest.txt @@ -0,0 +1,7 @@ +name: Forest +spawn_position[] + 300 + 300 +size[] + 5 + 6 diff --git a/parts/zones/images/desert.aseprite b/parts/zones/images/desert.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..4b76aeb1ab675eb6a2420b0b507560787d09624d GIT binary patch literal 763 zcmey(#K7=iDI<di5GpV*GB7Zt05Jjp#Xy1#JU~bbPz|*I*GCqxtt>zb#DJJx0c<6b zby+|*3&?c}K!%cniK~W9nx$cXnDzZawVMml-W{Ix`;*zsrvX{}49utGd1vYed8-)N zSlZi{7$h`B=RHiG{XhQflhe2V{Qv)d_S)?&b?up1S&?BuWlmjdjEruECtt7L)j!>< zE8jpKWRn6jkc5H%Kn6R5Phw?ik%HkFpc_~f7#Khb{sWy30gepr3>9<U&c5r*V#w37 z-Pmi9(yWKAQVY1XEJReil^_3Um=^u}Q{*O#ITJU_S<ZZ-c>Lq#d-id8XVW*jAFTde zQ@z*LUiSXII(NhOS3hk2wfFlY+x1QJujbErSs^0bn|kzn#fOhMufOKhtdD#8^i}>I z_I+2gH)gEAu<={{@7Et+P5p4HF<#y*ts*w~qK)nOp76LH_P6ZwtzT_?_3ZWLTZ`xI z`W5~E@*>m6mOFk)zfYXkyn4TSbMHCdtbO@P=X>O@?rVyl>Hj(9@cCC!H`zB`EfHhi z`}v@s%$hrkA29HhJxXAmy>{7V3j>~A4SH+dv9JD|cC6oG#=|m$UktGseR>PH=LkP! z;Jd(jwi(F2Bfdj_#zpoQPQ@jRu@B~OuopDwWypcp`wr9|?6GqYpS76#1=DjEiw5Qr z$IlCZ?C-4axYJh8v0e1jws8Br3)^dV>AySFd~J39KNGuK&5Pzt{Sf%K>$+jAyxp_C zN^zAR=eW+2JbU>wSH*qli_$k<ys@zI4?FUES9N}Zsr$9Bf5mIw`{sXP+verF|KRz1 hCe?gf{1?eg{TTRn9{W+Z&tLX1-MjvWb=sY7Hvrb~BFg{( literal 0 HcmV?d00001 diff --git a/parts/zones/images/desert.png b/parts/zones/images/desert.png new file mode 100644 index 0000000000000000000000000000000000000000..68592e84fe946fd65195ad9c3e82548babdcba19 GIT binary patch literal 730 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!jKx9jP7LeL$-HD>V4C9T;uumf z=j|NBqQ?e2t`E<A)4TJ8X|`>%^h*Od^Smp|iZ))|mUpS5WX6t@k~#4Q&Wc$w2D=2P zaHyzQ`guIvucf%(gIQVl&rHq^p1$RmWc`<JKDKPp^gmp_`}WD)DVuxM{`~ZtK7A+C zgDwLZI#Zb6FWDxUFA!zmTC3st%B6VX+sD=0%FoN+Qc_nx?o_<-)&GCiSFGYESv8-1 za%TF?p8c!q<-)dxNpqh)x@P*vQ_tT&Nt%B2ruIA~ndhm6YHuIp$zJk*Eh@M*-geoE zlW*r`9$T;8|I^IR@qSD4^ey*<>h4;scJ<5KtpB>*Svup$n&&%y<V@OVyf%K;{j<-G z-Fi6P%E<1%WtqDC6}f#^+yD4&S+#7Tnn!d>myhi}eZ>lo-!C2~Z>e_Isp5@)vv&Or zpq2aBf4<266d^wQUb}wTSGh03ACKPi5{MTlKmF$0d<~<TjqIx>9GZM4C^TP_ObOkf z`M6s)bPZGJnFp6w%_vo#y6eW52a_AcS2u_^i|^(OF=VdTI8nio&0_-No(R@GGZ<IR zVB90I=SFS=HI#@OELnc^$_vrziIcU9ikxrR`ZQjj-u(E+)0pQxj}E_DuG0DVN)@Ys z=6|t&TjI7Jsj>H1di99F-@pIwZ_WEX<6>HT*|is2j^BLaJ<GnP#Pi{AN3FMcZ7+Vh zW_;6_SRu`wA-(L<yR?pZ{~g4txU;+F-1!({b(7y&E^Z&QZs=Yy^T%(uJ3q<4De!ux zkz0Q0%oiaW_vuP6bC@qClf`emcC{DR+q`4jj&p8Z!SPFYXT%vG@72ZqkG<|OeChs| Voxat3Ixw*^c)I$ztaD0e0s!opT3P@A literal 0 HcmV?d00001 diff --git a/parts/zones/images/desert.png.import b/parts/zones/images/desert.png.import new file mode 100644 index 0000000..cff7016 --- /dev/null +++ b/parts/zones/images/desert.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bvsvyi0xp0o83" +path="res://.godot/imported/desert.png-83f64cc39e843c9764beded9278d927d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://parts/zones/images/desert.png" +dest_files=["res://.godot/imported/desert.png-83f64cc39e843c9764beded9278d927d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/parts/zones/images/farm.aseprite b/parts/zones/images/farm.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..a40eb4df765b6b73af722e5535a0db3c2b1ec397 GIT binary patch literal 738 zcmaFF#K7=iDI<digAIcM10w?iLkbWh08k7h$iM@Hv;av!`+t380o%#~v_K4q*%iQ6 zB3YLOWV3)=rvPLqDVVrw*rZt+_J>*DFI2m^Ano1ZS-(G-&3qb=wa>tON}hM7evr3{ zk&UIjeThLrQ*_?L<k|n@&ptVQ`_KRX|7Wk=-cr||nUxh87F6ccwZ_QkW_a@T>RtWQ zy}I%Z<UuwmFat>#_zz^TGx#J{rWPp}ZU(x6Re^y4q~Jf$=@8(^V9ii5=WX;`Ul&83 z>e+@u!W((&XE1I{XmWP#N|F4|{AI`V7+K9-<!i5+g+*--s+O^T`}gtFYc*ltG%B{8 z-+uk}=gS}8zKx!`G5qlPN9pgUe&54YCstq3_H|WG$aK;Bj~h>KK6`!h$GsI3r>{O< z!C%vDe(Fk8W9i%a->EiLsy0OjJ}bXs>M!>CdinF2iYKZS2WlQ{3+)Rv@6%5Tw=De{ z@&EFbIf;Dh<R07hSnjB@k<8hW@AP<2;5<qDu3Fapm*lri=C$w6PL(|&b~#e!%QtrG z!VN`zM(ocL)cL|T+)T3SZaxqpzJ`1C>w{VQXMR-XOWPrPrZOQmBQJJ?Ud8+jzB7%b zjJG%HMTpnLeW+B#Bb76Cv%5*0aQSJ@J*&H4Khm@LVBLCxRY!iU<Epb>6{7Z!e)6*K zV-B<omh9hSknUw1YHz!~;rX3_@>^H$6>gcorsMgJ>hfC~d)Ivat^ebmY;EcCy<R^1 i51zlLVZc5^eO2!%pc$VVBCh(M*M4C6OkZ61YbXGv*ax2g literal 0 HcmV?d00001 diff --git a/parts/zones/images/farm.png b/parts/zones/images/farm.png new file mode 100644 index 0000000000000000000000000000000000000000..29f76116b42b67d1544f7fe4202071aa9247bfe6 GIT binary patch literal 687 zcmV;g0#N;lP)<h;3K|Lk000e1NJLTq002k;002A)1^@s6#a{f700001b5ch_0Itp) z=>Px%X-PyuRCt{2n=y96Fbsx8Uv~zUUZC_0EXiSbEG$`>7&>)j>B7rl%EB3d3$S$H z1n$r%O%%yWLZNo5Z))v7Hqr~S#d|-1!r_>^!!dW-*iiJ8N8jXSzjNzFQvN-jB_ldU zpNUOBo+Tq+4#Y`rGu*(pV2pZSlGusrBJ0(6wl^O?+AIY}$9!|4>R;b>rA|sxW3ZZ> z@hlnPclBjDFSXp5Z!Tm#jh8<EKo>htPNH~-V4Ua43An;tE7I?aIRMmOJtRxPZ9ZUx zuP2U48^@rpg0WL-ZwbC`nAI!=x7_CC!@dnTLe^tkSet0<NbR5MceA=NSNvj!#wXRW z2l^oQ@U1@NU&5Vg9BhKPMTW@G<GTyqA}!ITkKyheq3AiJ*lS<0^W+4050Yrx<e@G! zy@V7ydk^}LNU_%vgcrokEV=zB3JfWB?<r<jf>bO)3bh)fonS*oirr4J0z1VNe(e;~ zZlqKfn%?+jtQRY=Ud(#2>#$Qy!FsWtSb`KRK?>H36<9B(V5gXZ^<vhG-3IH$3al5i zUhF#T6jQKXtS6Qr1xt{E^<o9qiz(PCreM98^<sCRi;rq(w2D1T!DT79E*7I9aM|x1 z#!lxNH3*B<e@PO?$@x<N7%Rg2VqO#D{U8>5Qy2Zy=X0rBuM${p^TrwtOXhN$!+84R z%)|RZEEdZydVCS8zBr0#X5luB#bVh-k3W$4-olbB1$Q{+j(V_Y@sbK!ta>hPMD%z9 z$Tp!+Yf2xz=4@)5Vr^|gL!gcAi}lTOPQDl{mVGUmK3kNxKcS0-Y_aUCH_zCWd;xf1 Vs(`-F!88B>002ovPDHLkV1oO5LDT>M literal 0 HcmV?d00001 diff --git a/parts/zones/images/farm.png.import b/parts/zones/images/farm.png.import new file mode 100644 index 0000000..11f98d2 --- /dev/null +++ b/parts/zones/images/farm.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cvhlm0uknvwsm" +path="res://.godot/imported/farm.png-ee6a284a064d9a624e7e48aefd058831.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://parts/zones/images/farm.png" +dest_files=["res://.godot/imported/farm.png-ee6a284a064d9a624e7e48aefd058831.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/parts/zones/images/forest.aseprite b/parts/zones/images/forest.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..a6cc9cb0521b2adef479f8392a9f110135e8b615 GIT binary patch literal 769 zcmZQ%W?*=*l##)P!Gl48fsuiMAq9vL04N3$WZ(fpT7X6-28LfBS-`fk04)#$Vs-_v zl}OfQ0og1d*C_xQN(v^f8a8Q`hW%mI_Y2i-E=YTKc-HSvW;34#WbHFBpOWXDsUPI6 zVq{}!Z(m}N&=j5bFnRX>__I$=-~RLe|Nq%*x3|=_XJ%zZh6R;5b*(Wnx*48)y?R&w zbg!;_19^~53cx^tga1GlJA+SRWonUv;U%COSQQu;Knnf?oelw}4DJjSbKcH=n8|F& z)0)4z?@H$`pZ_IoW!-)gidYXmcHQ*!z+4sOMvo->oZ58nkNuwuZEk-*fBf;6$mlTJ z+wZSGfBg6DkMEy%UppqZcK*i=(Ql`@zf8CJ#IqqjTl(wWrQ3Jxu#K)e^Cj%h2}#+< z+P{qJGA|eL{yumAx%%si%3n_$`5pMnrN262_VG{FUr%Vp?1;13wvBz0<Z*4CTeIAc z?@GEQm%8kQM7&{ISKo6k>A(DoKkmw^TV8kM(Z%X#hYQzTJOAj*lR#0m*Z)@<O@1D8 z+vjYF>SXumR!@`I??uLIpG+>lXZ=-q+01o|-tO?z{;E=K*SYL<T;8&|=LOG(G@o3& z_K?b~b=5m({@N3Mx-4e-)T&9g^Ia~N>YHCa_q-!*)xjqh!xDvjukXF%Q+sc9s`a|d zUbZLa`7e68Yx?ZW=fy6@R}(&EtTup{Y4`rB(R<?+2{Fp6)=Tc|w%sKkaMYl##$Ech zyXBf*$(7eD0{Uxr$nWg6ZI-kADVbp!2lO?E?fSW8?he+`J?Eq)znn?DD|o<g)3eE9 p_QlcfFQ=!@x_dG~Eyg{!$ET{deP_Vxv&oe$^CbT<9KYv~2>?E|Djxs< literal 0 HcmV?d00001 diff --git a/parts/zones/images/forest.png b/parts/zones/images/forest.png new file mode 100644 index 0000000000000000000000000000000000000000..7a88f8f6d4b720ebb4ffc4848ce7f3f35497f1a8 GIT binary patch literal 667 zcmeAS@N?(olHy`uVBq!ia0vp^HbCsb!3HE(`A=I4q!^2X+?^QKos)UVz`zvh>Eakt zG3V_Z+oD4T0<G75s<>vwC_LdY`IaalCAB?7WaXtx7YyupOy)4|VDRPgTOjgLDtoW? z?3ofOmHV|OhS~Ekxw@=^G2>y0-kFy%Gq#z<Ki14&ckcGbglpYfepT9d3*T}(zQ?K# z$e6CSadI?|c!BQ==RMvgw*%*=?EUroi`nn$oOz84bJy)lKU!Zazskb1WbsD5GNAfB z((^A@ik{xO^Vd8{|L^|C`(LD7Kk3TD$9U&^X%VB|#7NKV-7}aQYE35CFmJx;+;p7% z_LA0k!Sk65Bkn87vHzL!iRVmFct~?BcY%$u-1pA%*;$Tj;$M|7+-ES|rl$E__$g*( zs|nI~uB-hQ*2^y5(6rOjNny)hJJ$3|lU@XEFM6L6|50X=*lUk?b@2n`5sR`X_7&D1 z_x6aoQEtJeqB|`?$HHv$mjAL}dzKuXxir~@^>|-t`)#8V505AlZ|00?+cH)cWW?P6 z=*1o7ovkaYF>9$eTX^Qm2RAN8S&5l=PtVYmwI*H0RzvRNho64xx|M8d=MUH<wSS%n z4D0~zx7l|R_q<uyb*#4do;Jg=W1C~otWBsn@3i63-v2crg|9=oPRCxHu{d#g>^m+A z|M%;BL2{QLiHCmo336F1wmpHPEb345{ZcP2V6eT6k$Clg@$`5vj(taptpqO4=T?Zm zRkQbStWHa>&fTk*o+$%aZ~ikph?%E&Gc$IYO}ed@`sbT|(fO~f>ID8Uy)R0SZ(7;9 R7MR)?JYD@<);T3K0RYA>C{6$X literal 0 HcmV?d00001 diff --git a/parts/zones/images/forest.png.import b/parts/zones/images/forest.png.import new file mode 100644 index 0000000..a060ffb --- /dev/null +++ b/parts/zones/images/forest.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bqf2ip155wi0f" +path="res://.godot/imported/forest.png-fe66986e2efa37433265a3b2795eec5e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://parts/zones/images/forest.png" +dest_files=["res://.godot/imported/forest.png-fe66986e2efa37433265a3b2795eec5e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/parts/zones/images/home.aseprite b/parts/zones/images/home.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..3262282af2fb9063844869d8f4a5faaa14bf5e3f GIT binary patch literal 1172 zcmbQj!ocugDI<dg;}!-521W)3h7=%10H7F1kbwsXX#qrl_W%0G0=5;%WDo;lb_KAN zNY-Tm*(@N}DF7Kt3MQ@^HfffI{bAPk3)OBeNPBm9*6&YdGoJ=z?K3c+lINYNALOlK zWMgS>Ut*BZ6rJ}ldG`PKvrkUn{`3F;|JiG|x74*~W@SZ&1(i8<tuZpX8J>K-dRPB+ zudaLpd5}#C%s>(b{sS583_gjKsYMEgsX!T41&GvtCYTaX;8o0ddrndGZ~y~~qj&1Z zkO0%G!r7f|{of8WEdBiL*Z+C17rg&#`Rd5C&p&JI=AVB~JoWwGEq;<TfQ;V%^?Kb8 z5-s}tbM5|bhe>c5#1Hv@x5|^|BcQ&z*X#d&AT=aDN7uh?Cne~>4!r*>+n(f*_;W4( Z_d|&PNC=SaqfrG5Gcuz}|MWhkxd6QrjEDdL literal 0 HcmV?d00001 diff --git a/parts/zones/images/home.png b/parts/zones/images/home.png new file mode 100644 index 0000000000000000000000000000000000000000..d349f1aaf93abbf029a2c26be6815eb12fb09e8d GIT binary patch literal 794 zcmeAS@N?(olHy`uVBq!ia0y~yV6*_Tw{WllNrozeS|G_-9OUlAu<o49O9lp}E1oWn zAr*7p-rdN1$U%hFu{owUn90bi$aLKaOU<_qyy~$DVa6N39=htkX18ts-`zYFInPf# zKmGf&)USK{YJY!Ae|x`uAKMRQCiWCgnF*=|4$}@WMq=S?jeC3F@b|a3x94wt-^9F$ zh3|xrg@X5k2AxK%ob0`~_9p{XZ@16B&q}~(kfr5;K(+JlmLJ4wIf}EM#)bghk^Vgv zr&|%qE5)w@J$bWM9G};q%I~>u&A(q)HtO7g4&7_~%QkrZy!GbxCs3OAboFyt=akR{ E0839E>;M1& literal 0 HcmV?d00001 diff --git a/parts/zones/images/home.png.import b/parts/zones/images/home.png.import new file mode 100644 index 0000000..76e22aa --- /dev/null +++ b/parts/zones/images/home.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c37jv23kd15ay" +path="res://.godot/imported/home.png-bb98419f444d713366b962183b74da8c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://parts/zones/images/home.png" +dest_files=["res://.godot/imported/home.png-bb98419f444d713366b962183b74da8c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/parts/zones/images/lake.aseprite b/parts/zones/images/lake.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..f14674afabe5b79bfdfdc29fb05c7d1664078c1a GIT binary patch literal 744 zcmaFC#K7=iDI-G&g8_pA10w?iLkbWh08k7h$iM@Hv;Y}E`+t380o%#~v_K4q*%iQ6 zB3YLOWV3)=rvPLqDVVrw*rZt+_J>*DFI2m^Ano1ZS-(G-&3qb=wa>tON}hM7evr3{ zk&UIjeThLrQ*_?L<k|n@&ptVQ`_KRX|7Wk=-cr||nUxh87F6ccwZ_QkW_a@T>RtWQ zy}I%Z<UuwmFat>#_zz^TGx#J{rWPp}?gYAlRe^y4q~Jf$=@8({pwCb-=k2V!nJk7p zE!#IwnbLL1Coaf&U3W;qLB_)iWN&^td^GAU$C0-;o9peiT$3u1N&j6}V>A2wt#_-o zfBXFPXHC8Jzdg2_&0b&qY8-cMZ`t|PuhREeCBI3}UA#}Ls(*Iw`Len<*Q#qKJbq`I zcE#LoZ|~gF8`uABk6-P+evNzDx7xS0vHkBYW*`6TRrTb?&cr=8H%9W@KdaM!uIuQV zcU#kpzVSt;?Y=(aqR!^KuXir$-B)}uC&p;~68Vi?FO)w&v<Sa`-ooYF#+>R~N6-AW z6E?oD^u5eb*x2y)ah*kHw=Iu7v&*g0_?%B=@!XrID#hk*pHz1wXW8VrzJ=T5(gka` zeSUWJmn8esvlhlr&z7d`V(*wa<7t}M#kAX(_0nP&?~zPjwrA%#pYLZ)<4%CI>7I%x zJIC0yb7P{e=rhK`$7!$As@Ej`e!-KP9Cpn(ZpC)f6A{PHBz^L$dXgczIbXo6|GDT_ zvu_c+D!Zk7-f@>-i1v%)Rq31fb<a=!z2VHKvJ}>DS|0u?-E{Lb$zzJrkNv8Soi1|L R1%^gf)#(@F>Hdq~0s#CD9`pbJ literal 0 HcmV?d00001 diff --git a/parts/zones/images/lake.png b/parts/zones/images/lake.png new file mode 100644 index 0000000000000000000000000000000000000000..8107ae7b3cf15033d745dc2fa0b8f54d0cdbd988 GIT binary patch literal 659 zcmV;E0&M+>P)<h;3K|Lk000e1NJLTq002|~001xu1^@s6j}Bdp00001b5ch_0Itp) z=>Px%O-V#SRA_<in=x|2Fc3x8ne;Aba)FRD(AbAzXlUG0QKU*sL&Nwm&~OIe0yHT& zfl_4Fw${6{VPu2seHBRG67vySEwch>;B?N->71LUwz29d@2<|<@nF`Aq<9_Al8Cm^ zXNIniXGtXa1ppv+a+Bc%t^voOcbUp|R0mnF{=c2gzSL$Z7~1CQ8;bt>=TPV*Q)`V? zGviqj;ok8zoflfJ&DA#~J@tn^|3(M9PA;NYDSf$4F2DsUD=2Lja{#cHHj<@aHhYM0 z`D2?j@euV@&?}0y3UN8(w~(b^mb<)o*fjyiko4#S?yb}-#ClWRE2<N7oA=nDen|W9 z8-0*_xT_Bt5?s{hU=8I4QPhv8;0#I<ZSq>~92csdL-NY{$zLZIz;mcX+dm0V7rI_T z@`^o&D$Ph<S%%_)elttD|3rZ!dF71q%KfOJo>4<RW9^|$5nd^gywWKDAR6U8<1NZJ zWe`*sx?XuQn#;G)b7(HFx%_LRQQk9}%lCvD>KQfEGn&gki01O1(J1d3&E++h9{~5% zl8>EMUS%nmECq8<+4LB>9S;V*qJ6bJ6gOKnl?Q#{YG?tNa>ngqZi(@{6-vo=m->(2 z&qB9eC9vG(wJ~bfYL>ek;%RyN0nb~ZTzlzKj|;7O_kbc6+;S6!a_yx{J^rEWTIB^< z3g&dq4Xs0`o3FGXk44Y<goyWa0OZo=SKZ_K&^J|g*P?ve(&sVKrc|E2>&e}g2;tgG tU)O3}rQyzel@9jG*IxS4Yn^@1`~gYX)uF6Ude8s>002ovPDHLkV1oPSLMQ+L literal 0 HcmV?d00001 diff --git a/parts/zones/images/lake.png.import b/parts/zones/images/lake.png.import new file mode 100644 index 0000000..35ff5e9 --- /dev/null +++ b/parts/zones/images/lake.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://yfm0e42qvsuu" +path="res://.godot/imported/lake.png-a28a97afe870002293b8b431e484f676.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://parts/zones/images/lake.png" +dest_files=["res://.godot/imported/lake.png-a28a97afe870002293b8b431e484f676.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/parts/zones/lake.txt b/parts/zones/lake.txt new file mode 100644 index 0000000..9fccfa8 --- /dev/null +++ b/parts/zones/lake.txt @@ -0,0 +1,7 @@ +name: Lake +spawn_position[] + 300 + 300 +size[] + 7 + 4 diff --git a/project.godot b/project.godot index e558bd0..6299970 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="ld-56" -run/main_scene="res://components/Menu/Menu.tscn" +run/main_scene="res://Main.tscn" config/features=PackedStringArray("4.3", "GL Compatibility") config/icon="res://icon.svg" @@ -27,8 +27,18 @@ Dialogue="*res://components/Dialogue/Dialogue.tscn" [display] -window/size/viewport_width=640 -window/size/viewport_height=360 +window/size/viewport_width=312 +window/size/viewport_height=180 +window/size/mode=3 +window/size/resizable=false +window/size/borderless=true +window/size/transparent=true +window/size/no_focus=true +window/size/window_width_override=1248 +window/size/window_height_override=720 +window/subwindows/embed_subwindows=false +window/stretch/scale=4.0 +window/per_pixel_transparency/allowed=true [editor_plugins] @@ -51,3 +61,12 @@ escape={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } +test={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":84,"key_label":0,"unicode":116,"location":0,"echo":false,"script":null) +] +} + +[rendering] + +textures/canvas_textures/default_texture_filter=0 diff --git a/src/Creature.tscn b/src/Creature.tscn new file mode 100644 index 0000000..913bdda --- /dev/null +++ b/src/Creature.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=5 format=3 uid="uid://yao5smo8c43u"] + +[ext_resource type="Script" path="res://src/creature.gd" id="1_34bi4"] +[ext_resource type="Texture2D" uid="uid://dnvnm78idadmn" path="res://parts/creatures/images/1x1-1.png" id="2_upgji"] +[ext_resource type="PackedScene" uid="uid://dykc1mgg5uopw" path="res://components/Cursor/MouseHandler.tscn" id="3_vlaga"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_4rqgs"] +size = Vector2(12, 12) + +[node name="Creature" type="Node2D"] +script = ExtResource("1_34bi4") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("2_upgji") + +[node name="MouseHandler" parent="." instance=ExtResource("3_vlaga")] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="MouseHandler"] +shape = SubResource("RectangleShape2D_4rqgs") + +[connection signal="clicked" from="MouseHandler" to="." method="_on_mouse_handler_clicked"] diff --git a/src/Zone.tscn b/src/Zone.tscn new file mode 100644 index 0000000..9f29208 --- /dev/null +++ b/src/Zone.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=2 format=3 uid="uid://c1bqwhwmkp8aw"] + +[ext_resource type="Script" path="res://src/zone.gd" id="1_gihyf"] + +[node name="Zone" type="Window"] +canvas_item_default_texture_filter = 0 +position = Vector2i(0, 36) +unresizable = true +content_scale_mode = 1 +content_scale_factor = 4.0 +script = ExtResource("1_gihyf") + +[node name="Sprite2D" type="Sprite2D" parent="."] diff --git a/src/creature.gd b/src/creature.gd new file mode 100644 index 0000000..b73e515 --- /dev/null +++ b/src/creature.gd @@ -0,0 +1,23 @@ +extends Node2D + +var key + +@onready var data = Data.data.creatures[key] +@onready var image = Data.data.images[key] + +@onready var sprite_2d: Sprite2D = $Sprite2D + +var grabbed = false + +func _ready() -> void: + sprite_2d.texture = image + + +func _process(delta: float) -> void: + if Input.is_action_just_released("left_click"): + grabbed = false + + +func _on_mouse_handler_clicked() -> void: + Triggerer.trigger("grab_creature", {"creature": self}) + grabbed = true diff --git a/src/manager/TimeManager.tscn b/src/manager/TimeManager.tscn new file mode 100644 index 0000000..41c933e --- /dev/null +++ b/src/manager/TimeManager.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://cr2nvts234wlw"] + +[ext_resource type="Script" path="res://src/manager/time_manager.gd" id="1_o1jjn"] + +[node name="TimeManager" type="Node"] +script = ExtResource("1_o1jjn") diff --git a/src/manager/time_manager.gd b/src/manager/time_manager.gd new file mode 100644 index 0000000..1fb655e --- /dev/null +++ b/src/manager/time_manager.gd @@ -0,0 +1,37 @@ +extends Node + +@onready var globals = Data.data.globals + +var time = 0 +var current_day = 1 +var current_minutes = 1 +var delay = 2 + + +func _ready() -> void: + time = int(globals.day_length) / 24.0 * 7.0 + + Persister.persist_data("day", current_day) + Persister.persist_data("time", int(time * 1000)) + Persister.persist_data("hour", 7) + Persister.persist_data("minutes", 0) + + +func _process(delta: float) -> void: + if delay > 0: + delay -= delta + return + + time += delta + Persister.persist_data("time", int(time * 1000)) + + var minute_length = int(globals.day_length) / 144.0 + + while current_minutes * minute_length < time: + current_minutes += 1 + Persister.persist_data("hour", (current_minutes / 6) % 24) + Persister.persist_data("minutes", current_minutes % 6 * 10) + + while current_day * int(globals.day_length) < time: + current_day += 1 + Persister.persist_data("day", current_day) diff --git a/src/ui/ActionButton.tscn b/src/ui/ActionButton.tscn new file mode 100644 index 0000000..e4015af --- /dev/null +++ b/src/ui/ActionButton.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=5 format=3 uid="uid://br46gg7k10wt2"] + +[ext_resource type="Texture2D" uid="uid://dwabjc45s6l27" path="res://src/ui/quit.png" id="2_1lquh"] +[ext_resource type="Script" path="res://src/ui/action_button.gd" id="2_fxgn7"] +[ext_resource type="PackedScene" uid="uid://dykc1mgg5uopw" path="res://components/Cursor/MouseHandler.tscn" id="2_okvbn"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_cxpom"] +size = Vector2(12, 12) + +[node name="ActionButton" type="Node2D"] +script = ExtResource("2_fxgn7") +color = Color(1, 1, 1, 1) + +[node name="Sprite2D" type="Sprite2D" parent="."] +position = Vector2(4.76837e-07, 4.76837e-07) +texture = ExtResource("2_1lquh") + +[node name="MouseHandler" parent="." instance=ExtResource("2_okvbn")] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="MouseHandler"] +shape = SubResource("RectangleShape2D_cxpom") + +[connection signal="clicked" from="MouseHandler" to="." method="_on_mouse_handler_clicked"] +[connection signal="hovered" from="MouseHandler" to="." method="_on_mouse_handler_hovered"] +[connection signal="unhovered" from="MouseHandler" to="." method="_on_mouse_handler_unhovered"] diff --git a/src/ui/MainUI.tscn b/src/ui/MainUI.tscn new file mode 100644 index 0000000..f1b8121 --- /dev/null +++ b/src/ui/MainUI.tscn @@ -0,0 +1,144 @@ +[gd_scene load_steps=13 format=3 uid="uid://ccdhbljb3e0oh"] + +[ext_resource type="Theme" uid="uid://ck7603ob4gflc" path="res://Fonts/Theme.tres" id="1_k6a0m"] +[ext_resource type="Texture2D" uid="uid://ca5dpjaoimrej" path="res://src/ui/top-left.png" id="2_nvcj5"] +[ext_resource type="Texture2D" uid="uid://cndrtahwhbkli" path="res://src/ui/coin.png" id="3_b8a62"] +[ext_resource type="Script" path="res://src/ui/day_text.gd" id="3_k76r2"] +[ext_resource type="Script" path="res://src/ui/time_text.gd" id="4_7xwp1"] +[ext_resource type="Script" path="res://src/ui/gold_text.gd" id="5_uk4d4"] +[ext_resource type="PackedScene" uid="uid://br46gg7k10wt2" path="res://src/ui/ActionButton.tscn" id="7_gchpm"] +[ext_resource type="Script" path="res://src/ui/pause_menu.gd" id="8_bnf8a"] +[ext_resource type="Texture2D" uid="uid://ccvmfqybnygqp" path="res://src/ui/pause.png" id="8_vlg72"] +[ext_resource type="Texture2D" uid="uid://dwabjc45s6l27" path="res://src/ui/quit.png" id="8_ytenc"] +[ext_resource type="Texture2D" uid="uid://d1h8n8h0to033" path="res://src/ui/upgrades.png" id="9_5s7ww"] +[ext_resource type="PackedScene" uid="uid://b782aedv3v7df" path="res://src/ui/TextActionButton.tscn" id="9_pynn5"] + +[node name="CanvasLayer" type="CanvasLayer"] + +[node name="Control" type="Control" parent="."] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_k6a0m") + +[node name="TextureRect" type="TextureRect" parent="Control"] +layout_mode = 0 +offset_left = 4.0 +offset_top = 4.0 +offset_right = 48.0 +offset_bottom = 31.0 +texture = ExtResource("2_nvcj5") + +[node name="DayText" type="RichTextLabel" parent="Control/TextureRect"] +clip_contents = false +layout_mode = 0 +offset_left = 2.0 +offset_top = 4.0 +offset_right = 57.0 +offset_bottom = 42.0 +bbcode_enabled = true +text = "[center]Wednesday" +script = ExtResource("3_k76r2") + +[node name="TimeText" type="RichTextLabel" parent="Control/TextureRect"] +modulate = Color(0.589096, 0.589096, 0.589096, 1) +clip_contents = false +layout_mode = 0 +offset_left = 10.0 +offset_top = 15.0 +offset_right = 65.0 +offset_bottom = 53.0 +bbcode_enabled = true +text = "[center]07:00am" +script = ExtResource("4_7xwp1") + +[node name="GoldText" type="RichTextLabel" parent="Control/TextureRect"] +modulate = Color(0.870588, 0.619608, 0.254902, 1) +clip_contents = false +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -14.0 +offset_top = -15.0 +offset_right = 41.0 +offset_bottom = 3.0 +grow_horizontal = 2 +grow_vertical = 0 +bbcode_enabled = true +text = "[center]000 G" +script = ExtResource("5_uk4d4") + +[node name="GoldIcon" type="TextureRect" parent="Control/TextureRect"] +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -7.0 +offset_top = -16.0 +offset_right = 1.0 +offset_bottom = -8.0 +grow_horizontal = 2 +grow_vertical = 0 +texture = ExtResource("3_b8a62") + +[node name="TopRight" type="Control" parent="Control"] +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -40.0 +offset_bottom = 40.0 +grow_horizontal = 0 + +[node name="PauseButton" parent="Control/TopRight" instance=ExtResource("7_gchpm")] +position = Vector2(28, 13) +key = "paused" +value = "true" +image = ExtResource("8_vlg72") +color = Color(0.991606, 1, 0.496144, 1) + +[node name="BuildButton" parent="Control/TopRight" instance=ExtResource("7_gchpm")] +position = Vector2(28, 32) +key = "upgrade_menu" +value = "true" +image = ExtResource("9_5s7ww") +color = Color(0.680476, 1, 0.652914, 1) + +[node name="QuitButton" parent="Control/TopRight" instance=ExtResource("7_gchpm")] +position = Vector2(28, 51) +key = "quit" +value = "value" +image = ExtResource("8_ytenc") +color = Color(1, 0.734185, 0.691036, 1) + +[node name="PauseMenu" type="Control" parent="."] +visible = false +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("8_bnf8a") + +[node name="ActionButton" parent="PauseMenu" instance=ExtResource("9_pynn5")] +position = Vector2(160, 96) +key = "paused" +value = "false" + +[node name="ColorRect" type="ColorRect" parent="PauseMenu"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 0.458824) diff --git a/src/ui/TextActionButton.tscn b/src/ui/TextActionButton.tscn new file mode 100644 index 0000000..8b9740c --- /dev/null +++ b/src/ui/TextActionButton.tscn @@ -0,0 +1,30 @@ +[gd_scene load_steps=5 format=3 uid="uid://b782aedv3v7df"] + +[ext_resource type="Script" path="res://src/ui/text_action_button.gd" id="1_ha7o3"] +[ext_resource type="Theme" uid="uid://ck7603ob4gflc" path="res://Fonts/Theme.tres" id="2_riwvn"] +[ext_resource type="PackedScene" uid="uid://dykc1mgg5uopw" path="res://components/Cursor/MouseHandler.tscn" id="3_vqkdk"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_cxpom"] +size = Vector2(100, 12) + +[node name="TextActionButton" type="Node2D"] +script = ExtResource("1_ha7o3") + +[node name="RichTextLabel" type="RichTextLabel" parent="."] +clip_contents = false +offset_left = -50.0 +offset_top = -4.0 +offset_right = 52.0 +offset_bottom = 10.0 +theme = ExtResource("2_riwvn") +bbcode_enabled = true +text = "[center]Button" + +[node name="MouseHandler" parent="." instance=ExtResource("3_vqkdk")] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="MouseHandler"] +shape = SubResource("RectangleShape2D_cxpom") + +[connection signal="clicked" from="MouseHandler" to="." method="_on_mouse_handler_clicked"] +[connection signal="hovered" from="MouseHandler" to="." method="_on_mouse_handler_hovered"] +[connection signal="unhovered" from="MouseHandler" to="." method="_on_mouse_handler_unhovered"] diff --git a/src/ui/action_button.gd b/src/ui/action_button.gd new file mode 100644 index 0000000..132d7fe --- /dev/null +++ b/src/ui/action_button.gd @@ -0,0 +1,39 @@ +extends Node2D +@export var key: String +@export var value: String +@export var image: Texture2D +@export var color: Color + +var size_tween + +@onready var sprite_2d: Sprite2D = $Sprite2D + +func _ready() -> void: + sprite_2d.texture = image + +func _on_mouse_handler_clicked() -> void: + Persister.persist_data(key, value) + + +func _on_mouse_handler_hovered() -> void: + if size_tween: + size_tween.kill() + + size_tween = create_tween() + size_tween.set_ease(Tween.EASE_OUT) + size_tween.set_trans(Tween.TRANS_BACK) + size_tween.set_parallel() + size_tween.tween_property(self, "scale", Vector2.ONE * 1.04, 0.25) + size_tween.tween_property(self, "modulate", color, 0.25) + + +func _on_mouse_handler_unhovered() -> void: + if size_tween: + size_tween.kill() + + size_tween = create_tween() + size_tween.set_ease(Tween.EASE_OUT) + size_tween.set_trans(Tween.TRANS_QUAD) + size_tween.set_parallel() + size_tween.tween_property(self, "scale", Vector2.ONE, 0.25) + size_tween.tween_property(self, "modulate", Color.WHITE, 0.25) diff --git a/src/ui/coin.aseprite b/src/ui/coin.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..51e089d4c0e844ea47d838c0a3cf990b52f90d6c GIT binary patch literal 439 zcmdna$iVPmDI)_15GpVLISeU4i~xEJj37Y<0U)FWFbA6c>mv);Ru-TIVnEEU0Jajz zx+y?53&?eP;tCe3R&h3Q-TwW%iuYY!a`(2Rv94;Eo?DYq>2l{4ry?%gn&_)-ROR8g zwmkg6l;Z1Kr#!#9*+fP?K}V;<TYF!*_Pu$IFAf%{h^jlv8kVY9EHyAVA8vE2%}!3% z(m_42%B*^kUC*(=>GxZfa&n0Xh{%h|YAEQLTY3eA7nL_opSEJ_rsL<&yng#q9^@tk zW+Yes2eR22d=e{DixdpwfE-o@i0pqR2+aTv=88GV2?+@go(TQy=QUP1xz{3s;n??Q zmQ9A6tY-Y!SCnhv7S^o8o^<%i;?sxE98>Lo!zLhqlh<IcLG^~8jI;kUtgtBS1_0e_ BX4?P& literal 0 HcmV?d00001 diff --git a/src/ui/coin.png b/src/ui/coin.png new file mode 100644 index 0000000000000000000000000000000000000000..5f564b6ab045847cb5ecacc161823ddcabee2003 GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|8a-VcLnNlQ z_S<r`7znt<A31hql2yV)Co%p<qBc$2Bi}!=bh>fKY0KTz*AZEYk}aZTyB_|YY0kCa z!qanSb3U#P5t_b{S>c>q!!CY?6;9KC8<icox!F(NGdg|6Z-;q7o?Ff>SnW1z(`(<? xXZYRgVoR=axMzu+xc-4bU}5b(|HJ#u`RD!6SF78Z!3%T@gQu&X%Q~loCIEr1O??0W literal 0 HcmV?d00001 diff --git a/src/ui/coin.png.import b/src/ui/coin.png.import new file mode 100644 index 0000000..599762d --- /dev/null +++ b/src/ui/coin.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cndrtahwhbkli" +path="res://.godot/imported/coin.png-cd55e2ee13cb064f5049ad0ae96e103e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/ui/coin.png" +dest_files=["res://.godot/imported/coin.png-cd55e2ee13cb064f5049ad0ae96e103e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/src/ui/day_text.gd b/src/ui/day_text.gd new file mode 100644 index 0000000..23e8221 --- /dev/null +++ b/src/ui/day_text.gd @@ -0,0 +1,22 @@ +extends RichTextLabel + +const days = [ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday" +] + + +func _ready() -> void: + Triggerer.listen("day", _on_day) + _on_day({"value": 1}) + + +func _on_day(data): + var value = data.value + + text = "[center]%s" % [days[(value - 1) % 7]] diff --git a/src/ui/gold_text.gd b/src/ui/gold_text.gd new file mode 100644 index 0000000..e5f3c36 --- /dev/null +++ b/src/ui/gold_text.gd @@ -0,0 +1,11 @@ +extends RichTextLabel + + +func _ready() -> void: + Triggerer.listen("gold", _on_gold) + + +func _on_gold(data): + var value = data.value + + text = "[center]%03d G" % [value] diff --git a/src/ui/pause.aseprite b/src/ui/pause.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..d5401542a392931b987415af2d236c97d8969feb GIT binary patch literal 361 zcmc~~WMFu(l#zi42o)HB9EKDiMgX7~NRUAQ2x$Rc0uBB3kp*lk3y>`a#Ow-SE0L_r z0<u{^u2TRqloU){HEhx>4g15a?-#1wT#)we@T}jT%w|3f$l7OMJ|)jPQ$NUC#mL6e z-oC^jp(#4=Ve;(%@n@f$zWwL_|NpbsZf~h;&&<k-3=1lA>RMxDbTd5pdiAdU>0Vv= z2J#@A6qtb|4EzT&*cp5hD^rUU46T41Rs{y2Qy3ZkGr^Q_F>o<d%t=m2_;J3WE0H1g Zk3G+V)y~55q3zDHh7Wld1lZRH0ss+NMNt3% literal 0 HcmV?d00001 diff --git a/src/ui/pause.png b/src/ui/pause.png new file mode 100644 index 0000000000000000000000000000000000000000..0498c2cfc95f5f9c572b34b41c6f78ca4748f43f GIT binary patch literal 116 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}dY&$hAsQ2t z6BGmuoL>Gv(q()w;{X5u=|BF<$I1oI;dEwYG+5Or;ZSsBViqGaLz}z+`_<<yEI^$M Mp00i_>zopr0IC=v;{X5v literal 0 HcmV?d00001 diff --git a/src/ui/pause.png.import b/src/ui/pause.png.import new file mode 100644 index 0000000..85c1892 --- /dev/null +++ b/src/ui/pause.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ccvmfqybnygqp" +path="res://.godot/imported/pause.png-abc352f92340fb90c312fe929559e59d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/ui/pause.png" +dest_files=["res://.godot/imported/pause.png-abc352f92340fb90c312fe929559e59d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/src/ui/pause_menu.gd b/src/ui/pause_menu.gd new file mode 100644 index 0000000..4c1717d --- /dev/null +++ b/src/ui/pause_menu.gd @@ -0,0 +1,16 @@ +extends Control + +var tween + + +func _ready() -> void: + modulate = Color.TRANSPARENT + Triggerer.listen("paused", _on_pause_menu) + + +func _on_pause_menu(data) -> void: + if tween: + tween.kill() + + tween = create_tween() + tween.tween_property(self, "modulate", Color.WHITE if data.value else Color.TRANSPARENT, 0.25) diff --git a/src/ui/quit.aseprite b/src/ui/quit.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..d07567a2f6c9daf3264dd43bfc0400a58d759eb0 GIT binary patch literal 388 zcmZo+WMFu(l#zi42o)HB9EKDiMgX7~NRUAQ2x$RWfTsWY$O5*N1!#d75VI?Qtwgde z3&>^xxlRGdP*N~))v!skH0%$vzF(+zb3xj>!?S*WGMo7{AZwq2`IJ2GO#L8l6(bu< zd;1cDgr?}chsm@5$De(2`u3my|NqZkyS=5ZJu@pSGAyXfscVgq(arGW>(#sZr+anf z8_0ufQeXy>Fz_G9U}x}2tV}IZFboB9SQQ{r|Ct~(132(1<|HR1{5anr`<UtfMMlQG xJFYC~P7dzB8fRi#arXE#H;MTI3qovHzFXK<U)ZXyw|nEwZsufGhM%=xxdH#9Ret~g literal 0 HcmV?d00001 diff --git a/src/ui/quit.png b/src/ui/quit.png new file mode 100644 index 0000000000000000000000000000000000000000..eefec51d3994ea5faf90a6bc2ebbb61302c41f77 GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}37#&FAsQ2> z20HQ`FyLrf`v1R?b>fv<rp6l$xfV@hXt`P8<+Vzt=&)N-ZG*ze%9&qy=Du+(vJjlI zN5e9v{ZQeabp=}&T@XLtwN8}j)!VBF8E$ai7Lt7P{QB|2S5`gZ-<XbGP*L1+>|83) OE(T9mKbLh*2~7Y1Lq2N& literal 0 HcmV?d00001 diff --git a/src/ui/quit.png.import b/src/ui/quit.png.import new file mode 100644 index 0000000..b569337 --- /dev/null +++ b/src/ui/quit.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dwabjc45s6l27" +path="res://.godot/imported/quit.png-6fb6e27403f0123d0e44c30d15486f6b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/ui/quit.png" +dest_files=["res://.godot/imported/quit.png-6fb6e27403f0123d0e44c30d15486f6b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/src/ui/text_action_button.gd b/src/ui/text_action_button.gd new file mode 100644 index 0000000..cdd39a0 --- /dev/null +++ b/src/ui/text_action_button.gd @@ -0,0 +1,33 @@ +extends Node2D +@export var key: String +@export var value: String +@export var text: String + +@onready var rich_text_label: RichTextLabel = $RichTextLabel + +var size_tween + + +func _on_mouse_handler_clicked() -> void: + rich_text_label.text = text + Persister.persist_data(key, value) + + +func _on_mouse_handler_hovered() -> void: + if size_tween: + size_tween.kill() + + size_tween = create_tween() + size_tween.set_ease(Tween.EASE_OUT) + size_tween.set_trans(Tween.TRANS_BACK) + size_tween.tween_property(self, "scale", Vector2.ONE * 1.04, 0.25) + + +func _on_mouse_handler_unhovered() -> void: + if size_tween: + size_tween.kill() + + size_tween = create_tween() + size_tween.set_ease(Tween.EASE_OUT) + size_tween.set_trans(Tween.TRANS_QUAD) + size_tween.tween_property(self, "scale", Vector2.ONE, 0.25) diff --git a/src/ui/time_text.gd b/src/ui/time_text.gd new file mode 100644 index 0000000..4823424 --- /dev/null +++ b/src/ui/time_text.gd @@ -0,0 +1,14 @@ +extends RichTextLabel + + +func _ready() -> void: + Triggerer.listen("minutes", _on_minutes) + + +func _on_minutes(data): + var value = data.value + + text = "[center]%s" % [_convert_to_text(value, Persister.get_value("hour"))] + +func _convert_to_text(minutes, hour): + return "%02d:%02d%s" % [12 if not hour % 12 else hour % 12, minutes, "am" if hour < 12 or hour > 23 else "pm"] diff --git a/src/ui/top-left.aseprite b/src/ui/top-left.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..9684b39bc7cff27ebb0ea70c76ce4de8876ca595 GIT binary patch literal 745 zcmaFK#K7=iDI<dggFb@-10w?iLkbWhfF1)QNRUAQ2x$Q_f%gCU$N{#M189L55VI?Q ztwgeJ3XshLa-E*If`zJ8oK0M}fB&xHeV3Qqy)9|1s~V=~)?`$=+<C>RhzqwS`f3|h zc{r{u4?i%a`1;l<&#!Jakx@_3(dqEk-dC=DZ=U0eg9R$0>W;F8r79Ln4GhkQ+uUli zlasY{P!Fs!t6pT+b1ZQB{g$PiTp|J@@}jaD3VP<2UIF1n<&D#)t=PKh`1v!h-@cRw zxk-T;$(8?sY<32p#LCnn1w;JOM);+TrvZ&(Re+fN9~eXsV8NitP%-E24MVO50|A%7 z+Y!;Xsu|zcn;s3znR4W&<iA7jzb8(}m_2=Q>-P20DL?icelBbG{zGN^`Q2Zv?`^$) zC2`g7E7gB~{<&iP@Nm1na?QPmpZVsO``dlp|Loq~TAz0-&fj|RIr6LZx3j-l=hx-e z{P=K{Uw+@I+K)R+nf5y|9Et!sgB2J#j0}7X2v-R*C;(mc_=(WZ^OjxiA2sBTF0K#> zmNaHyT>2}qA?WXu8O^@-n$I3w_V2Mg^5S?ppXRTPGoAbDQi?fNGBSKxDW?xga;yqW z3``8dNapf0@B__FPB_5(?ria&es?K-g)sf4uO=LI%#lz#T9Z=y;+N-D_nx|%UmIS! niz$cc+ZAU#%qu$FEn$1(OY-F7OZy`}uUyzCvzH;-;rLttIy>Lk literal 0 HcmV?d00001 diff --git a/src/ui/top-left.png b/src/ui/top-left.png new file mode 100644 index 0000000000000000000000000000000000000000..ff2a21ceab09f4f7eabfe93d8431fa22d92946fc GIT binary patch literal 381 zcmeAS@N?(olHy`uVBq!ia0vp^7C@}e!3HF^g>u>gDaPU;cPEB*=VV?2+2)=ujv*P1 zZ)Z62H5mxF+AouiUA0}|PS4{4<3qYvmg<!*RBh#38YGqG74PIErSREksc~+hP3(OS z308)uKR1=i1ip|fm)XXrWEL4<1xF{jwI1BQ)N*L+-Qe}l*K+*jc-|JvxQCfX^=G{S zx0gCMlf(6pjgLEy{WJ1NUA-nc+s7+R_u!^H_JifVSL2^asGgn3G(+#pzMCu++p^9D zZ(XUWk(!m|anO>}bCTEn7YqLX+<vC~+Kq`v7Kq1e%9!zf%|`7`MoZV{DNENZIMB6P zBizGr^SPOmp52I;l09<+OKta$AC~KyQq+@eH7ZuUTYq!egh{$xa~xm3aW>d;_EChA zNiExSucB$pb#r?>vzFgUxmKgH^PSu=AGVj1rYNynurNjiO_DKC=HO9Xda`oztwWPV Z<Uda?)2%X`{|^|R44$rjF6*2UngF%Ho@@XB literal 0 HcmV?d00001 diff --git a/src/ui/top-left.png.import b/src/ui/top-left.png.import new file mode 100644 index 0000000..4864f7f --- /dev/null +++ b/src/ui/top-left.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ca5dpjaoimrej" +path="res://.godot/imported/top-left.png-9dc28911b5667671317f66a658dbfab6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/ui/top-left.png" +dest_files=["res://.godot/imported/top-left.png-9dc28911b5667671317f66a658dbfab6.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/src/ui/upgrades.aseprite b/src/ui/upgrades.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..e7af775b8310fa2114e1e5af841950f31b947c6f GIT binary patch literal 397 zcmeBWWMFu(l#zi42o)HB9EKDiMgX7~NRUAQ2x$R$fu{fZ$O5*N1!#d75VI?Qtwgde z3&>^xxlRGdP*N~))v!skH0%$vzF(+zb3xj>!?S*WGMo7{AZwq2`IJ2GO#L8l6(bu< zd;1cDgr?}chsm@5$De(2`u3my|NqZkyS=5ZJu@pSGAyXfscVgq(arGW>(#sZr+anf z8_0ufQeXy>Fz_G9U}x}2tV}IZFpL9oSQQ{r|Ct~(132(1<|HRHH2<$KF#8}cePHo( zdmsKyH$`3@e5t4O)?uQ1So=}FHCY>99L?4<vy<D(lkrM|W5rQPIhR$g+xsU(u`$e2 HTptJk?+#ZP literal 0 HcmV?d00001 diff --git a/src/ui/upgrades.png b/src/ui/upgrades.png new file mode 100644 index 0000000000000000000000000000000000000000..ea234b2a98c1f3e9fb06ac99af8bec265d820478 GIT binary patch literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}v7RoDAsQ2F z1097J6gisy{ZIe4;daZ5V@ER_wsbH*l+R&jn6#^X&8?&#F?wF-rfyVu=y~$)gihfp zZJUm~d!wm+v^s75Wsb!+CUe!l4_Vba{f|~&#IvmVCXLS9UthLMYxRBW&~)`F&>{v; LS3j3^P6<r_J1{_o literal 0 HcmV?d00001 diff --git a/src/ui/upgrades.png.import b/src/ui/upgrades.png.import new file mode 100644 index 0000000..b4d2b31 --- /dev/null +++ b/src/ui/upgrades.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d1h8n8h0to033" +path="res://.godot/imported/upgrades.png-0873bc255fb4a99c78c3c3ca7fcf6ec3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/ui/upgrades.png" +dest_files=["res://.godot/imported/upgrades.png-0873bc255fb4a99c78c3c3ca7fcf6ec3.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/src/zone.gd b/src/zone.gd new file mode 100644 index 0000000..b1e33ac --- /dev/null +++ b/src/zone.gd @@ -0,0 +1,20 @@ +extends Window + +var key + +@onready var data = Data.data.zones[key] +@onready var image = Data.data.images[key] + +@onready var sprite_2d: Sprite2D = $Sprite2D + +const CREATURE = preload("res://src/Creature.tscn") + +func _ready() -> void: + title = data.name + sprite_2d.texture = image + sprite_2d.position = Vector2(int(data.size[0]) * 12 / 2, int(data.size[1]) * 12 / 2) + + var new_creature = CREATURE.instantiate() + new_creature.position = Vector2(50, 50) + new_creature.key = "1x1-1" + add_child(new_creature)