This commit is contained in:
Ategon 2024-10-07 01:05:27 -04:00
parent f538fdaacd
commit 178829785c
106 changed files with 1993 additions and 153 deletions

View file

@ -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

View file

@ -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"]

View file

@ -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

View file

@ -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

View file

@ -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")

View file

@ -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

View file

@ -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")

View file

@ -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
#-----------------------------------------------------------

View file

@ -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")

View file

@ -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")]

View file

@ -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);
}
}
}

View file

@ -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")

View file

@ -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

View file

@ -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")

View file

@ -0,0 +1,7 @@
[plugin]
name="Godot-Clickthrough"
description=""
author="Darnoman"
version="0.1"
script="clickthrough.cs"

View file

@ -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"]

View file

@ -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")

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -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

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

View file

@ -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

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

View file

@ -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

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

View file

@ -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

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

View file

@ -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

View file

@ -4,3 +4,4 @@
[node name="Logger" type="Node"]
script = ExtResource("1_gse6q")
log_level = 2

View file

@ -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)

View file

@ -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"]

View file

@ -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)

38
main.gd Normal file
View file

@ -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()

View file

@ -0,0 +1,2 @@
width: 1
height: 1

View file

@ -0,0 +1,2 @@
width: 1
height: 2

View file

@ -0,0 +1,2 @@
width: 2
height: 1

View file

@ -0,0 +1,2 @@
width: 2
height: 2

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B

View file

@ -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

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

View file

@ -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

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

View file

@ -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

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

View file

@ -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

2
parts/dialogue/dummy.txt Normal file
View file

@ -0,0 +1,2 @@
dummy[]
dummy: dummy

1
parts/globals.txt Normal file
View file

@ -0,0 +1 @@
day_length: 240

7
parts/zones/desert.txt Normal file
View file

@ -0,0 +1,7 @@
name: Desert
spawn_position[]
300
300
size[]
6
6

7
parts/zones/farm.txt Normal file
View file

@ -0,0 +1,7 @@
name: Farm
spawn_position[]
300
300
size[]
6
5

7
parts/zones/forest.txt Normal file
View file

@ -0,0 +1,7 @@
name: Forest
spawn_position[]
300
300
size[]
5
6

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

View file

@ -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

Binary file not shown.

BIN
parts/zones/images/farm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

View file

@ -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

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

View file

@ -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

Binary file not shown.

BIN
parts/zones/images/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

View file

@ -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

Binary file not shown.

BIN
parts/zones/images/lake.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

View file

@ -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

7
parts/zones/lake.txt Normal file
View file

@ -0,0 +1,7 @@
name: Lake
spawn_position[]
300
300
size[]
7
4

View file

@ -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

21
src/Creature.tscn Normal file
View file

@ -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"]

13
src/Zone.tscn Normal file
View file

@ -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="."]

23
src/creature.gd Normal file
View file

@ -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

View file

@ -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")

View file

@ -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)

25
src/ui/ActionButton.tscn Normal file
View file

@ -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"]

144
src/ui/MainUI.tscn Normal file
View file

@ -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)

View file

@ -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"]

39
src/ui/action_button.gd Normal file
View file

@ -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)

BIN
src/ui/coin.aseprite Normal file

Binary file not shown.

BIN
src/ui/coin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

34
src/ui/coin.png.import Normal file
View file

@ -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

22
src/ui/day_text.gd Normal file
View file

@ -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]]

11
src/ui/gold_text.gd Normal file
View file

@ -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]

BIN
src/ui/pause.aseprite Normal file

Binary file not shown.

BIN
src/ui/pause.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

34
src/ui/pause.png.import Normal file
View file

@ -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

16
src/ui/pause_menu.gd Normal file
View file

@ -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)

BIN
src/ui/quit.aseprite Normal file

Binary file not shown.

BIN
src/ui/quit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

34
src/ui/quit.png.import Normal file
View file

@ -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

View file

@ -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)

14
src/ui/time_text.gd Normal file
View file

@ -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"]

BIN
src/ui/top-left.aseprite Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more