make fancy file picker function game-specific

This commit is contained in:
2025-03-02 16:30:25 -06:00
committed by Celtic Minstrel
parent 5bc1643be7
commit 18294b4f1b
6 changed files with 28 additions and 10 deletions

View File

@@ -2017,17 +2017,17 @@ fs::path run_autosave_picker(fs::path auto_folder, cDialog* parent) {
return cFilePicker(auto_folder, false, parent, true).run();
}
fs::path run_file_picker(bool saving) {
if(!has_feature_flag("file-picker-dialog", "V1") /* TODO check file picker preference */){
if(saving)
return nav_put_or_temp_party();
else
return nav_get_or_decode_party();
}
fs::path fancy_file_picker(bool saving) {
// TODO this is set up to be configurable, but not yet exposed in preferences.
fs::path save_folder = get_string_pref("SaveFolder", saveDir.string());
return run_file_picker(save_folder, saving);
}
fs::path run_file_picker(bool saving){
if(has_feature_flag("file-picker-dialog", "V1") && get_bool_pref("FancyFilePicker", true)){
return fancy_file_picker(saving);
}
return os_file_picker(saving);
}

View File

@@ -25,8 +25,8 @@ void pick_preferences(bool record = true);
void save_prefs();
void tip_of_day();
struct scen_header_type pick_a_scen();
fs::path run_file_picker(bool saving);
fs::path fancy_file_picker(bool saving);
// Pick from the autosaves made while playing in a given save file
fs::path run_autosave_picker(fs::path save_file, cDialog* parent = nullptr);
fs::path run_autosave_picker(fs::path auto_folder, cDialog* parent = nullptr);
#endif