Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config_resources/default_settings.tres
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[ext_resource type="PackedScene" uid="uid://dxep4xm1sl8im" path="res://scenes/key_mapping_menu.tscn" id="1_qho2n"]
[ext_resource type="PackedScene" uid="uid://cl4m4q2eurcn0" path="res://scenes/options_menu.tscn" id="2_b4w4u"]
[ext_resource type="Script" uid="uid://cgtk0ximoo5ty" path="res://scripts/game_settings_resource.gd" id="3_qb8m4"]
[ext_resource type="Script" uid="uid://cgtk0ximoo5ty" path="res://scripts/resources/game_settings_resource.gd" id="3_qb8m4"]

[resource]
script = ExtResource("3_qb8m4")
Expand Down
18 changes: 9 additions & 9 deletions files/docs/Development_Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ use the following signature:
- `new_value`: **Variant** (The newly assigned, clamped value)

#### 2. Core Files Reference

| Component | File Path | Responsibility |
|----------------------------|-------------------------------------------|-----------------------------------------------------------------------------------|
| **Data Source (Subject)** | `res://scripts/game_settings_resource.gd` | Defines properties (difficulty, log level), performs clamping, and emits signals. |
| **Logic Observer** | `res://scripts/globals.gd` | Connects to the resource to trigger centralized logging and `_save_settings()`. |
| **UI Observer (Gameplay)** | `res://scripts/gameplay_settings.gd` | Syncs sliders and labels with the resource state using `set_value_no_signal`. |
| **UI Observer (Advanced)** | `res://scripts/advanced_settings.gd` | Syncs log level dropdowns and handles web-specific JavaScript callbacks. |
| **Persistence Settings** | `res://scripts/settings.gd` | Manages low-level `InputMap` serialization and legacy migration logic. |

<!-- markdownlint-disable MD033 -->
| Component | File Path | Responsibility |
|-------------------------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------|
| **Data Source (Subject)** | `res://scripts/resources/game_settings_resource.gd` | Defines properties (difficulty, log level), performs clamping, and emits signals. |
| <del>**Logic Observer** | <del>`res://scripts/globals.gd`</del> | <del>Connects to the resource to trigger centralized logging and `_save_settings()`.</del> |
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
| **UI Observer (Gameplay)** | `res://scripts/ui/menus/gameplay_settings.gd` | Syncs sliders and labels with the resource state using `set_value_no_signal`. |
| **UI Observer (Advanced)** | `res://scripts/ui/menus/advanced_settings.gd` | Syncs log level dropdowns and handles web-specific JavaScript callbacks. |
| <del>**Persistence Settings**</del> | <del>`res://scripts/settings.gd`</del> | <del>Manages low-level `InputMap` serialization and legacy migration logic.</del> |
<!-- markdownlint-enable MD033 -->
#### 3. Connection Example for UI

To prevent infinite recursion, UI handlers should always check for equality or use `no_signal` methods when responding to the resource:
Expand Down
4 changes: 2 additions & 2 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ general/default_playback_type.web=0

Globals="*res://scripts/core/globals.gd"
Settings="*res://scripts/core/settings.gd"
AudioConstants="*res://scripts/audio_constants.gd"
AudioConstants="*res://scripts/resources/audio_constants.gd"
AudioManager="*res://scripts/managers/audio_manager.gd"
AudioWebBridge="*res://scripts/audio_web_bridge.gd"
AudioWebBridge="*res://scripts/system/audio_web_bridge.gd"
Comment thread
coderabbitai[bot] marked this conversation as resolved.

[debug]

Expand Down
2 changes: 1 addition & 1 deletion scenes/Player.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=7 format=3 uid="uid://37rarq1yywmc"]

[ext_resource type="Script" uid="uid://bcplrymg5tt06" path="res://scripts/player.gd" id="1_tuyoq"]
[ext_resource type="Script" uid="uid://bcplrymg5tt06" path="res://scripts/entities/player.gd" id="1_tuyoq"]
[ext_resource type="PackedScene" uid="uid://bafpwe0qf0vm0" path="res://scenes/weapon.tscn" id="2_fjrip"]
[ext_resource type="PackedScene" uid="uid://blc0ioe12jlnk" path="res://scenes/bullet.tscn" id="3_smehm"]
[ext_resource type="PackedScene" uid="uid://bh47kclxgeeah" path="res://scenes/rotor_left.tscn" id="4_ur7pv"]
Expand Down
2 changes: 1 addition & 1 deletion scenes/bullet.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://blc0ioe12jlnk"]

[ext_resource type="Script" uid="uid://uyw8e8i6adxn" path="res://scripts/bullet.gd" id="1_mkf8s"]
[ext_resource type="Script" uid="uid://uyw8e8i6adxn" path="res://scripts/entities/bullet.gd" id="1_mkf8s"]
[ext_resource type="Texture2D" uid="uid://b7utqr70u1mex" path="res://files/sprite/laser_sprites/01.png" id="2_y25gk"]

[sub_resource type="CircleShape2D" id="CircleShape2D_l5glv"]
Expand Down
4 changes: 2 additions & 2 deletions scenes/main_scene.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
[ext_resource type="Texture2D" uid="uid://btyfigdtk3x88" path="res://files/random_decor/crates_4.png" id="68_f3krf"]
[ext_resource type="Texture2D" uid="uid://bvxu5x1awjrjv" path="res://files/random_decor/dirt_001.png" id="69_7tyuc"]
[ext_resource type="Texture2D" uid="uid://f4hxu68qa4fi" path="res://files/random_decor/dirt_002.png" id="70_isor2"]
[ext_resource type="Script" uid="uid://blu5qujicfa7e" path="res://scripts/hud.gd" id="72_sgkfd"]
[ext_resource type="Script" uid="uid://b5x2ehdthhrla" path="res://scripts/parallax_manager.gd" id="76_qj6t7"]
[ext_resource type="Script" uid="uid://blu5qujicfa7e" path="res://scripts/ui/hud.gd" id="72_sgkfd"]
[ext_resource type="Script" uid="uid://b5x2ehdthhrla" path="res://scripts/managers/parallax_manager.gd" id="76_qj6t7"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pu3yx"]
bg_color = Color(0.2627451, 0.2627451, 0.2627451, 0.5882353)
Expand Down
2 changes: 1 addition & 1 deletion scenes/weapon.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://bafpwe0qf0vm0"]

[ext_resource type="Script" uid="uid://dcr6gx3oaboj8" path="res://scripts/weapon.gd" id="1_xasec"]
[ext_resource type="Script" uid="uid://dcr6gx3oaboj8" path="res://scripts/entities/weapon.gd" id="1_xasec"]

[node name="WeaponManager" type="Node2D"]
script = ExtResource("1_xasec")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions test/gut/gut_test_helper.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Shared helper functions and mock builders for GUT unit tests.
extends RefCounted

const PLAYER_SCRIPT_PATH: String = "res://scripts/player.gd"
const PLAYER_SCRIPT_PATH: String = "res://scripts/entities/player.gd"


## Helper to safely hard-free a node without causing engine crashes.
Expand Down Expand Up @@ -60,7 +60,7 @@ static func build_mock_player_scene() -> Node:
panel.add_child(stats)

# Assign the extracted hud.gd script directly to the mock panel
var hud_script := load("res://scripts/hud.gd")
var hud_script := load("res://scripts/ui/hud.gd")
if hud_script:
panel.set_script(hud_script)

Expand Down
2 changes: 1 addition & 1 deletion test/gut/test_audio_web_bridge.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

extends "res://addons/gut/test.gd"

const AudioWebBridge = preload("res://scripts/audio_web_bridge.gd")
const AudioWebBridge = preload("res://scripts/system/audio_web_bridge.gd")

func before_each() -> void:
# Reset AudioManager to a known clean state before each test
Expand Down
2 changes: 1 addition & 1 deletion test/gut/test_game_settings_resource.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

extends "res://addons/gut/test.gd"

const GameplaySettings = preload("res://scripts/gameplay_settings.gd")
const GameplaySettings = preload("res://scripts/ui/menus/gameplay_settings.gd")
var gameplay_menu: Control
var _resource: GameSettingsResource

Expand Down
2 changes: 1 addition & 1 deletion test/gut/test_gameplay_settings_js.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

extends "res://addons/gut/test.gd"

const GameplaySettings = preload("res://scripts/gameplay_settings.gd")
const GameplaySettings = preload("res://scripts/ui/menus/gameplay_settings.gd")
var gameplay_menu: Control

func before_each() -> void:
Expand Down
2 changes: 1 addition & 1 deletion test/gut/test_gameplay_settings_lifecycle.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

extends "res://addons/gut/test.gd"

const GameplaySettings = preload("res://scripts/gameplay_settings.gd")
const GameplaySettings = preload("res://scripts/ui/menus/gameplay_settings.gd")
var gameplay_menu: Control

func before_each() -> void:
Expand Down
2 changes: 1 addition & 1 deletion test/gut/test_gameplay_settings_ui.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

extends "res://addons/gut/test.gd"

const GameplaySettings = preload("res://scripts/gameplay_settings.gd")
const GameplaySettings = preload("res://scripts/ui/menus/gameplay_settings.gd")
var gameplay_menu: Control
var _resource: GameSettingsResource

Expand Down
Loading