Fix no overwrite alert on Windows if there are capitalization differences (#18375)

This commit is contained in:
Henry Cheng 2022-10-26 02:19:44 -04:00 committed by GitHub
parent 38d5793b0b
commit cf9ec0bd4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 13 deletions

View File

@ -18,6 +18,7 @@
- Fix: [#18122] Ghosts count towards “Great scenery!” guest thought.
- Fix: [#18134] Underground on-ride photo section partially clips through adjacent terrain edge.
- Fix: [#18257] Guests waiting on extended railway crossings.
- Fix: [#18354] Overwrite alert does not show when save name has different casing on Windows.
- Fix: [#18379] Tunnel entrances for underground Mini Golf Hole E are not rendered correctly.
0.4.2 (2022-10-05)

View File

@ -20,6 +20,7 @@
#include <openrct2/GameState.h>
#include <openrct2/PlatformEnvironment.h>
#include <openrct2/config/Config.h>
#include <openrct2/core/File.h>
#include <openrct2/core/FileScanner.h>
#include <openrct2/core/Guard.hpp>
#include <openrct2/core/Path.hpp>
@ -570,8 +571,6 @@ static void WindowLoadsaveScrollmouseover(rct_window* w, int32_t scrollIndex, co
static void WindowLoadsaveTextinput(rct_window* w, WidgetIndex widgetIndex, char* text)
{
bool overwrite;
if (text == nullptr || text[0] == 0)
return;
@ -608,17 +607,7 @@ static void WindowLoadsaveTextinput(rct_window* w, WidgetIndex widgetIndex, char
const u8string path = Path::WithExtension(
Path::Combine(_directory, text), RemovePatternWildcard(_extensionPattern));
overwrite = false;
for (auto& item : _listItems)
{
if (String::Equals(item.path, path))
{
overwrite = true;
break;
}
}
if (overwrite)
if (File::Exists(path))
WindowOverwritePromptOpen(text, path.c_str());
else
WindowLoadsaveSelect(w, path.c_str());