Add Native File Dialog support and enhance file dialog management

- Introduced a feature flag to toggle between Native File Dialog (NFD) and bespoke file dialog implementations.
- Updated FileDialogWrapper to utilize the feature flag for opening files and folders, improving cross-platform compatibility.
- Enhanced the UI to allow users to configure the file dialog mode, providing better user control over file handling.
- Added new methods for testing both NFD and bespoke implementations directly from the UI, improving testing capabilities.
- Updated test management to include options for enabling/disabling individual tests, enhancing flexibility in test execution.
This commit is contained in:
scawful
2025-09-25 17:07:44 -04:00
parent a5ed2f4d27
commit aaa7af9f07
7 changed files with 413 additions and 18 deletions

View File

@@ -38,6 +38,9 @@ class FeatureFlags {
// Log to the console.
bool kLogToConsole = false;
// Use NFD (Native File Dialog) instead of bespoke file dialog implementation.
bool kUseNativeFileDialog = true;
// Overworld flags
struct Overworld {
// Load and render overworld sprites to the screen. Unstable.
@@ -100,6 +103,8 @@ class FeatureFlags {
std::to_string(get().overworld.kLoadCustomOverworld) + "\n";
result += "kApplyZSCustomOverworldASM: " +
std::to_string(get().overworld.kApplyZSCustomOverworldASM) + "\n";
result += "kUseNativeFileDialog: " +
std::to_string(get().kUseNativeFileDialog) + "\n";
return result;
}
};
@@ -145,6 +150,7 @@ struct FlagsMenu {
Checkbox("Enable Console Logging", &FeatureFlags::get().kLogToConsole);
Checkbox("Log Instructions to Emulator Debugger",
&FeatureFlags::get().kLogInstructions);
Checkbox("Use Native File Dialog (NFD)", &FeatureFlags::get().kUseNativeFileDialog);
}
};