-
Notifications
You must be signed in to change notification settings - Fork 7
Add theme changing support at runtime #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds a theme system: new theme assets, theme initialization/copying to user data, theme loading with fallback, scene refactors to use theme_type_variation instead of inline StyleBox overrides, UI tweaks, docs, and settings integration for selecting themes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Core
participant FS as FileSystem
participant RL as ResourceLoader
participant UI as SceneTree
User->>Core: Launch app
activate Core
Core->>Core: _ready()
Core->>Core: _initialize_themes()
Core->>FS: ensure `user://themes/` exists
Core->>FS: copy `res://data/themes/*.tres` -> `user://themes/` if missing
Core->>Core: _handle_settings()
alt theme exists at user://themes/{theme_name}.tres
Core->>RL: load user://themes/{theme_name}.tres
else
Core->>Core: _initialize_themes()
Core->>RL: load user://themes/dark.tres
end
RL-->>Core: Theme resource
Core->>UI: apply Theme (ui elements use theme_type_variation)
deactivate Core
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Pre-merge checks❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
|
Type of Change
Description
Provides a theme loading system that load themes from
user://themes/by names, also an initializer that sync missing internal themes with this folder (internal themes:res://data/themes/). Users can change mode with Editor UI > Theme Name in settings (supports change without restart). New external themes can be added with paste them inuser://themes/.Testing
Works fine in sync, change, and load.
Impact
Syncs internal themes based on file existent, so will sync one time in most cases. Then loads theme from its file based on settings, this task takes ~5ms in startup.
Additional Information
Nothing
Checklist
Summary by CodeRabbit
New Features
UI/Style
Documentation
Performance
Chores