Skip to content

Commit

Permalink
Multiple filter patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
PrecisionRender committed Sep 17, 2023
1 parent ba54c34 commit b269530
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions platform/windows/display_server_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,17 @@ Error DisplayServerWindows::file_dialog_show(const String &p_title, const String
Vector<Char16String> filter_names;
Vector<Char16String> filter_exts;
for (const String &E : p_filters) {
String filter_ext_text;
Vector<String> tokens = E.split(";");
if (tokens.size() == 2) {
filter_exts.push_back(tokens[0].strip_edges().utf16());
filter_ext_text = tokens[0].strip_edges();
filter_names.push_back(tokens[1].strip_edges().utf16());
} else if (tokens.size() == 1) {
filter_exts.push_back(tokens[0].strip_edges().utf16());
filter_ext_text = tokens[0].strip_edges();
filter_names.push_back(tokens[0].strip_edges().utf16());
}
Vector<String> ext_tokens = filter_ext_text.split(",");
filter_exts.push_back(String(";").join(ext_tokens).utf16());
}

Vector<COMDLG_FILTERSPEC> filters;
Expand Down Expand Up @@ -260,7 +263,6 @@ Error DisplayServerWindows::file_dialog_show(const String &p_title, const String
}
pfd->SetOptions(flags | FOS_FORCEFILESYSTEM);
pfd->SetTitle((LPCWSTR)p_title.utf16().ptr());

String dir = ProjectSettings::get_singleton()->globalize_path(p_current_directory);
if (dir == ".") {
dir = OS::get_singleton()->get_executable_path().get_base_dir();
Expand Down

0 comments on commit b269530

Please sign in to comment.