initial commit

This commit is contained in:
2026-07-04 18:22:23 -06:00
commit 55522fc6fc
272 changed files with 12391 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
[gd_scene format=3 uid="uid://djlwditktkdqm"]
[ext_resource type="Script" uid="uid://c50oovdcf5gxc" path="res://settings/display/display_settings.gd" id="1_ib3mg"]
[ext_resource type="PackedScene" uid="uid://ckcinb605j6ad" path="res://settings/display/circle_size_control.tscn" id="2_a0g1l"]
[ext_resource type="PackedScene" uid="uid://bgl2fwudm05ut" path="res://settings/display/rect_size_control.tscn" id="3_pqjgl"]
[sub_resource type="SphereMesh" id="SphereMesh_ib3mg"]
[node name="DisplaySettings" type="Control" unique_id=684790483]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_ib3mg")
circle_size_control = ExtResource("2_a0g1l")
rect_size_control = ExtResource("3_pqjgl")
[node name="ScreenBounds" type="MeshInstance2D" parent="." unique_id=667660467]
mesh = SubResource("SphereMesh_ib3mg")
[node name="ModeSelect" type="HBoxContainer" parent="." unique_id=1117896761]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Circle" type="Button" parent="ModeSelect" unique_id=2138250498]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
text = "Circle"
[node name="Control" type="Control" parent="ModeSelect" unique_id=2025198438]
custom_minimum_size = Vector2(2, 0)
layout_mode = 2
[node name="Rectangle" type="Button" parent="ModeSelect" unique_id=355408003]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
text = "Rectangle"
[node name="SaveSelect" type="HBoxContainer" parent="." unique_id=1028302836]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Save" type="Button" parent="SaveSelect" unique_id=491990024]
custom_minimum_size = Vector2(75, 0)
layout_mode = 2
text = "Save"
[node name="Control" type="Control" parent="SaveSelect" unique_id=786463583]
custom_minimum_size = Vector2(10, 0)
layout_mode = 2
[node name="Cancel" type="Button" parent="SaveSelect" unique_id=1362360997]
custom_minimum_size = Vector2(75, 0)
layout_mode = 2
text = "Cancel"
[connection signal="pressed" from="ModeSelect/Circle" to="." method="_on_circle_selected"]
[connection signal="pressed" from="ModeSelect/Rectangle" to="." method="_on_rectangle_selected"]
[connection signal="pressed" from="SaveSelect/Save" to="." method="_on_save_pressed"]
[connection signal="pressed" from="SaveSelect/Cancel" to="." method="_on_cancel_pressed"]
+22
View File
@@ -0,0 +1,22 @@
extends Control
var mesh: SphereMesh
# Called when the node enters the scene tree for the first time.
func set_mesh(new_mesh: Mesh):
mesh = new_mesh
func _on_add_pressed() -> void:
if mesh == null:
return
mesh.radius += 10
mesh.height += 20
func _on_subtract_pressed() -> void:
if mesh == null:
return
mesh.radius = max(10, mesh.radius - 10)
mesh.height = max(20, mesh.height - 20)
@@ -0,0 +1 @@
uid://brtt56wqrwvao
+36
View File
@@ -0,0 +1,36 @@
[gd_scene format=3 uid="uid://ckcinb605j6ad"]
[ext_resource type="Script" uid="uid://brtt56wqrwvao" path="res://settings/display/circle_size_control.gd" id="1_kd2yb"]
[node name="CircleSizeControl" type="Control" unique_id=1419353433]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -1870.0
offset_bottom = -1040.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_kd2yb")
[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=1694966628]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Add" type="Button" parent="HBoxContainer" unique_id=1001424814]
custom_minimum_size = Vector2(20, 0)
layout_mode = 2
text = "+"
[node name="Control" type="Control" parent="HBoxContainer" unique_id=818821295]
custom_minimum_size = Vector2(2, 0)
layout_mode = 2
[node name="Subtract" type="Button" parent="HBoxContainer" unique_id=848604585]
custom_minimum_size = Vector2(20, 0)
layout_mode = 2
text = "-"
[connection signal="pressed" from="HBoxContainer/Add" to="." method="_on_add_pressed"]
[connection signal="pressed" from="HBoxContainer/Subtract" to="." method="_on_subtract_pressed"]
+85
View File
@@ -0,0 +1,85 @@
extends Control
var sphere_mesh = SphereMesh.new()
var quad_mesh = QuadMesh.new()
@export var circle_size_control: PackedScene
@export var rect_size_control: PackedScene
var size_control_instance: Node
var screen_bound_mesh: MeshInstance2D
var current_mode: int
var mode_container: HBoxContainer
var save_container: HBoxContainer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
DisplayData.WINDOW_SIZE = Vector2(DisplayServer.window_get_size())
DisplayData.WINDOW_CENTER = DisplayData.WINDOW_SIZE / 2
screen_bound_mesh = get_node("ScreenBounds")
mode_container = get_node("ModeSelect")
var mode_container_size = mode_container.size
var mode_container_position = Vector2(DisplayData.WINDOW_CENTER.x - mode_container_size.x/2, DisplayData.WINDOW_CENTER.y - mode_container_size.y)
mode_container.position = mode_container_position
save_container = get_node("SaveSelect")
var save_container_size = save_container.size
var save_container_position = Vector2(DisplayData.WINDOW_CENTER.x - save_container_size.x/2, DisplayData.WINDOW_CENTER.y + save_container_size.y * 4)
save_container.position = save_container_position
func update():
current_mode = DisplayData.DISPLAY_MODE_IDX
if current_mode == 0:
_on_circle_selected()
screen_bound_mesh.mesh.radius = DisplayData.DISPLAY_PARAMETERS[0]
screen_bound_mesh.mesh.height = DisplayData.DISPLAY_PARAMETERS[1]
else:
_on_rectangle_selected()
screen_bound_mesh.mesh.size = Vector2(DisplayData.DISPLAY_PARAMETERS[0], DisplayData.DISPLAY_PARAMETERS[1])
func _on_circle_selected() -> void:
if size_control_instance != null:
remove_child(size_control_instance)
size_control_instance.queue_free()
screen_bound_mesh.mesh = sphere_mesh
screen_bound_mesh.mesh.radius = 0.5 * min(DisplayData.WINDOW_SIZE.x, DisplayData.WINDOW_SIZE.y)
screen_bound_mesh.mesh.height = 2 * screen_bound_mesh.mesh.radius
screen_bound_mesh.position = DisplayData.WINDOW_CENTER
size_control_instance = circle_size_control.instantiate()
size_control_instance.set_mesh(screen_bound_mesh.mesh)
var container_size = size_control_instance.get_node("HBoxContainer").size
var container_position = Vector2(DisplayData.WINDOW_CENTER.x - container_size.x/2, DisplayData.WINDOW_CENTER.y + container_size.y/2)
add_child(size_control_instance)
size_control_instance.position = container_position
current_mode = 0
func _on_rectangle_selected() -> void:
if size_control_instance != null:
remove_child(size_control_instance)
size_control_instance.queue_free()
screen_bound_mesh.mesh = quad_mesh
screen_bound_mesh.mesh.size = DisplayData.WINDOW_SIZE
screen_bound_mesh.position = DisplayData.WINDOW_CENTER
size_control_instance = rect_size_control.instantiate()
size_control_instance.set_mesh(screen_bound_mesh.mesh)
var container_size = size_control_instance.size
var container_position = Vector2(DisplayData.WINDOW_CENTER.x - 90, DisplayData.WINDOW_CENTER.y + 36)
add_child(size_control_instance)
size_control_instance.position = container_position
current_mode = 1
func _on_save_pressed() -> void:
var current_bounds = []
if current_mode == 0:
current_bounds = [screen_bound_mesh.mesh.radius, screen_bound_mesh.mesh.height]
else:
current_bounds = [screen_bound_mesh.mesh.size.x, screen_bound_mesh.mesh.size.y]
SettingSignals.display_settings_saved.emit(current_mode, current_bounds)
SettingSignals.display_settings_closed.emit()
func _on_cancel_pressed() -> void:
SettingSignals.display_settings_closed.emit()
+1
View File
@@ -0,0 +1 @@
uid://c50oovdcf5gxc
+19
View File
@@ -0,0 +1,19 @@
extends Control
var mesh: QuadMesh
# Called when the node enters the scene tree for the first time.
func set_mesh(new_mesh: Mesh):
mesh = new_mesh
func _on_add_width_pressed() -> void:
mesh.size = Vector2(mesh.size.x + 20, mesh.size.y)
func _on_subtract_width_pressed() -> void:
mesh.size = Vector2(max(20, mesh.size.x - 20), mesh.size.y)
func _on_add_height_pressed() -> void:
mesh.size = Vector2(mesh.size.x, mesh.size.y + 20)
func _on_subtract_height_pressed() -> void:
mesh.size = Vector2(mesh.size.x, max(20, mesh.size.y - 20))
@@ -0,0 +1 @@
uid://bone10ua14y73
+59
View File
@@ -0,0 +1,59 @@
[gd_scene format=3 uid="uid://bgl2fwudm05ut"]
[ext_resource type="Script" uid="uid://bone10ua14y73" path="res://settings/display/rect_size_control.gd" id="1_d1ns0"]
[node name="RectSizeControl" type="Control" unique_id=2029271709]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -1740.0
offset_bottom = -1008.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_d1ns0")
[node name="VBoxContainer2" type="VBoxContainer" parent="." unique_id=679844861]
layout_mode = 0
offset_left = 138.0
offset_right = 180.0
offset_bottom = 72.0
[node name="AddHeight" type="Button" parent="VBoxContainer2" unique_id=969154940]
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
text = "+"
[node name="Control" type="Control" parent="VBoxContainer2" unique_id=700596433]
custom_minimum_size = Vector2(2, 2)
layout_mode = 2
[node name="SubtractHeight" type="Button" parent="VBoxContainer2" unique_id=1431826556]
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
text = "-"
[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=377418965]
layout_mode = 0
offset_top = 15.0
offset_right = 80.0
offset_bottom = 57.0
[node name="SubtractWidth" type="Button" parent="HBoxContainer" unique_id=1816095727]
custom_minimum_size = Vector2(35, 20)
layout_mode = 2
text = "-"
[node name="Control" type="Control" parent="HBoxContainer" unique_id=320269460]
custom_minimum_size = Vector2(2, 0)
layout_mode = 2
[node name="AddWidth" type="Button" parent="HBoxContainer" unique_id=831071522]
custom_minimum_size = Vector2(35, 20)
layout_mode = 2
text = "+"
[connection signal="pressed" from="VBoxContainer2/AddHeight" to="." method="_on_add_height_pressed"]
[connection signal="pressed" from="VBoxContainer2/SubtractHeight" to="." method="_on_subtract_height_pressed"]
[connection signal="pressed" from="HBoxContainer/SubtractWidth" to="." method="_on_subtract_width_pressed"]
[connection signal="pressed" from="HBoxContainer/AddWidth" to="." method="_on_add_width_pressed"]