gate plugin on Godot 4.6+; drop stale gd-options autoload registrations

plugin.gd now checks Engine.get_version_info() in _enter_tree and pushes a
loud error if the engine is older than 4.6. Doesn't actually disable the
addon's class_names (Godot parses those independently of EditorPlugin), but
gives users a clear "this is the cause" signal before any cryptic downstream
errors land.

Also removes four add_autoload_singleton calls for gd-options-owned scripts
(GameSettings, InputSettings, GraphicsSettings, AudioSettings). They were
copy-paste leftovers from when this addon was forked; gd-options/plugin.gd
already registers them, so this addon was double-registering — gd-dynamic-
sound has no business owning those autoloads.

README documents the 4.6 requirement near the top.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Daniel Samson 2026-04-29 16:45:43 +01:00
parent 59f1d93c6f
commit 5758106b1e
No known key found for this signature in database
GPG Key ID: A9EB2589C60F7268
2 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,8 @@
A Godot 4 audio addon for **dynamic music** (intensity-layered, seamless playlist transitions, fade in/out) and **overlapping one-shot SFX** — both built on `AudioStreamPolyphonic`.
**Requires Godot 4.6 or newer.** Older versions will load the addon but log an error from `plugin.gd` on enable; some `class_name`s may also fail to parse on engines lacking 4.6 GDScript features.
## Installation
1. Copy the `addons/gd-dynamic-sound/` folder into your project's `addons/` directory.

View File

@ -1,12 +1,13 @@
@tool
extends EditorPlugin
const MIN_MAJOR : int = 4
const MIN_MINOR : int = 6
func _enter_tree() -> void:
add_autoload_singleton("GameSettings", "res://addons/gd-options/src/common/game_settings.gd")
add_autoload_singleton("InputSettings", "res://addons/gd-options/src/common/input_settings.gd")
add_autoload_singleton("GraphicsSettings", "res://addons/gd-options/src/common/graphics_settings.gd")
add_autoload_singleton("AudioSettings", "res://addons/gd-options/src/common/audio_settings.gd")
var v : Dictionary = Engine.get_version_info()
if v.major < MIN_MAJOR or (v.major == MIN_MAJOR and v.minor < MIN_MINOR):
push_error("gd-dynamic-sound requires Godot %d.%d+ (running %s). Some classes may fail to load or behave incorrectly." % [MIN_MAJOR, MIN_MINOR, v.string])
func _exit_tree() -> void:
pass