Add error message when trying to load project from CWD.

This commit is contained in:
Pāvels Nadtočajevs 2025-11-16 10:09:23 +02:00
parent 8deb221829
commit a7358ddd12
No known key found for this signature in database
GPG key ID: 8413210218EF35D2
7 changed files with 43 additions and 2 deletions

View file

@ -1678,6 +1678,14 @@ Error OS_Windows::set_cwd(const String &p_cwd) {
return OK;
}
String OS_Windows::get_cwd() const {
Char16String real_current_dir_name;
size_t str_len = GetCurrentDirectoryW(0, nullptr);
real_current_dir_name.resize_uninitialized(str_len + 1);
GetCurrentDirectoryW(real_current_dir_name.size(), (LPWSTR)real_current_dir_name.ptrw());
return String::utf16((const char16_t *)real_current_dir_name.get_data()).trim_prefix(R"(\\?\)").replace_char('\\', '/');
}
Vector<String> OS_Windows::get_system_fonts() const {
if (!dwrite_init) {
return Vector<String>();