refactor: Update window creation and file dialog handling for improved consistency

- Replaced `SDL_Deleter` with `util::SDL_Deleter` in window creation for better utility usage.
- Updated file dialog methods to consistently reference `core::FeatureFlags` for feature flag checks.
- Refactored file extension retrieval in `EditorManager` to use `util::GetFileExtension` for consistency.
- Adjusted `MusicEditor` constructor to accept a ROM pointer, enhancing initialization clarity.
- Commented out unused code in `MusicEditor` to improve readability and maintainability.
- Updated include paths in `overworld_editor.cc` for better organization.
- Cleaned up commented-out code in `editor_selection_dialog.cc` and `welcome_screen.cc` for clarity.
This commit is contained in:
scawful
2025-10-05 00:57:05 -04:00
parent d52b8ae006
commit 04c43fb99e
12 changed files with 135 additions and 122 deletions

View File

@@ -1967,7 +1967,7 @@ void AgentChatWidget::OpenFileInEditor(const std::string& filepath) {
filepath.substr(last_slash + 1) : filepath;
// Set language based on extension
std::string ext = core::GetFileExtension(filepath);
std::string ext = util::GetFileExtension(filepath);
if (ext == "cpp" || ext == "cc" || ext == "h" || ext == "hpp") {
tab.editor.SetLanguageDefinition(TextEditor::LanguageDefinition::CPlusPlus());
} else if (ext == "c") {
@@ -1994,7 +1994,7 @@ void AgentChatWidget::CreateNewFileInEditor(const std::string& filename) {
tab.modified = true;
// Set language based on extension
std::string ext = core::GetFileExtension(filename);
std::string ext = util::GetFileExtension(filename);
if (ext == "cpp" || ext == "cc" || ext == "h" || ext == "hpp") {
tab.editor.SetLanguageDefinition(TextEditor::LanguageDefinition::CPlusPlus());
} else if (ext == "c") {