Skip to content

Commit 9523993

Browse files
committed
Fix file menu list of recent games
1 parent 5b27d32 commit 9523993

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/gui/MainWindow.cpp

+4-9
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ void MainWindow::OnFileMenu(wxCommandEvent& event)
674674
const size_t index = menuId - MAINFRAME_MENU_ID_FILE_RECENT_0;
675675
if (index < config.recent_launch_files.size())
676676
{
677-
const auto& path = config.recent_launch_files[index];
677+
fs::path path = _utf8ToPath(config.recent_launch_files[index]);
678678
if (!path.empty())
679679
FileLoad(path, wxLaunchGameEvent::INITIATED_BY::MENU);
680680
}
@@ -2091,17 +2091,12 @@ void MainWindow::RecreateMenu()
20912091
m_fileMenuSeparator1 = nullptr;
20922092
for (size_t i = 0; i < config.recent_launch_files.size(); i++)
20932093
{
2094-
const auto& entry = config.recent_launch_files[i];
2095-
if (entry.empty())
2094+
const std::string& pathStr = config.recent_launch_files[i];
2095+
if (pathStr.empty())
20962096
continue;
2097-
2098-
if (!fs::exists(entry))
2099-
continue;
2100-
21012097
if (recentFileIndex == 0)
21022098
m_fileMenuSeparator0 = m_fileMenu->AppendSeparator();
2103-
2104-
m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_RECENT_0 + i, to_wxString(fmt::format("{}. {}", recentFileIndex, entry)));
2099+
m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_RECENT_0 + i, to_wxString(fmt::format("{}. {}", recentFileIndex, pathStr)));
21052100
recentFileIndex++;
21062101

21072102
if (recentFileIndex >= 8)

0 commit comments

Comments
 (0)