Files
puzzle-quest/project.godot
T
Vaillant Jeremy 60d9f614ee Replace Event + GlobalAnimation autoloads with class_name + static funcs
Two of the five autoloads were stateless helper bundles, not the
persistent application-wide systems that the Godot 4 best-practice
guide reserves autoload slots for. Convert them to plain classes with
all-static methods so they no longer need a Node living under /root.

- scripts/Animation.gd -> scripts/game_animation.gd (renamed:
  conflict with the built-in Animation class; the autoload sidestepped
  it by being called GlobalAnimation). class_name GameAnimation,
  every helper static. The dissolve tween now captures its target
  material in a lambda closure, eliminating the current_material
  member that the autoload kept as shared mutable state.
- scripts/Event.gd -> scripts/event.gd, class_name Event, every
  handler static. Added Event.level_pressed(name) -> Callable for the
  one place ChooseScene needed dynamic lookup of a per-level handler
  (replaces the old _build_method('_on_' + name + '_pressed') +
  Callable(autoload, string) reflection trick with an explicit match).

Updated call sites:
- scripts/Global.gd: animation.connect('animation_started',
  Callable(Event, '...')) -> animation.animation_started.connect(
  Event._loading_is_started). Same for animation_finished.
- scenes/levels/Levels.gd: GlobalAnimation.* -> GameAnimation.*;
  Quit/TextureButton.connect('pressed', Callable(Event, '...')) ->
  pressed.connect(Event._on_main_scene_pressed).
- scenes/UI/choose_scenes/ChooseScene.gd: per-level button connects
  go through Event.level_pressed(); reset button's bound callable now
  reads Event._on_reset_level.bind(...); cleanup no longer relies on
  is_connected with an unbound Callable (which would never match a
  bound one anyway) -- iterates reset.pressed.get_connections()
  instead. Drop the now-dead _build_method helper.

Also: organise scripts/ by promoting the one-shot migration helpers
(migrate_shaders, migrate_misc, resave_scenes, devisualize_shaders,
find_visualshaders) into scripts/migration/. They are not part of
the runtime and should not be browsable next to the autoloads.

Autoload count goes 5 -> 3 (Loading, Global, Setting remain --
Setting will move to a Resource in a later refactor).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 21:50:00 +02:00

71 lines
2.1 KiB
Plaintext

; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="Puzzle Quest"
config/description="A treasure chest fill with any Jiggsaw !"
run/main_scene="res://scenes/Main.tscn"
config/quit_on_go_back=false
config/features=PackedStringArray("4.6")
boot_splash/stretch_mode=0
boot_splash/image="res://releases/splash-screen.png"
config/icon="res://icon.png"
config/macos_native_icon="res://releases/mac/project.icns"
config/windows_native_icon="res://releases/windows/project.ico"
[autoload]
Loading="*res://scenes/UI/loading/Loading.tscn"
Global="*res://scripts/Global.gd"
Setting="*res://scripts/Setting.gd"
[display]
window/size/viewport_width=1280
window/size/viewport_height=720
window/size/resizable=false
window/stretch/mode="2d"
window/stretch/aspect="expand"
window/handheld/orientation="sensor_landscape"
[editor_plugins]
enabled=PackedStringArray("res://addons/lod/plugin.cfg")
[importer_defaults]
scene={
"animation/import": false,
"materials/keep_on_reimport": false,
"materials/storage": 0,
"meshes/light_baking": 1,
"meshes/storage": 1,
"nodes/root_type": "ArrayMesh",
"skins/use_named_skins": false
}
[input]
ui_end={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194318,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194305,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
[internationalization]
locale/translations=PackedStringArray("res://locales/fr.po", "res://locales/en.po")
[rendering]
environment/defaults/default_environment="res://default_env.tres"