[XAM] Count empty path as exit request in XamLoaderGetLaunchData
This commit is contained in:
committed by
Radosław Gliński
parent
b723d6e7c2
commit
ccd5c50c74
@@ -383,30 +383,21 @@ void XamLoaderLaunchTitle_entry(lpstring_t raw_name_ptr, dword_t flags) {
|
|||||||
loader_data.launch_flags = flags;
|
loader_data.launch_flags = flags;
|
||||||
|
|
||||||
// Translate the launch path to a full path.
|
// Translate the launch path to a full path.
|
||||||
if (raw_name_ptr) {
|
if (raw_name_ptr && !raw_name_ptr.value().empty()) {
|
||||||
auto path = raw_name_ptr.value();
|
loader_data.launch_path = xe::path_to_utf8(raw_name_ptr.value());
|
||||||
if (path.empty()) {
|
loader_data.launch_data_present = true;
|
||||||
loader_data.launch_path = "game:\\default.xex";
|
|
||||||
} else {
|
|
||||||
loader_data.launch_path = xe::path_to_utf8(path);
|
|
||||||
loader_data.launch_data_present = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
xam->SaveLoaderData();
|
xam->SaveLoaderData();
|
||||||
|
|
||||||
if (loader_data.launch_data_present) {
|
auto display_window = kernel_state()->emulator()->display_window();
|
||||||
auto display_window = kernel_state()->emulator()->display_window();
|
auto imgui_drawer = kernel_state()->emulator()->imgui_drawer();
|
||||||
auto imgui_drawer = kernel_state()->emulator()->imgui_drawer();
|
|
||||||
|
|
||||||
if (display_window && imgui_drawer) {
|
if (display_window && imgui_drawer) {
|
||||||
display_window->app_context().CallInUIThreadSynchronous(
|
display_window->app_context().CallInUIThreadSynchronous([imgui_drawer]() {
|
||||||
[imgui_drawer]() {
|
xe::ui::ImGuiDialog::ShowMessageBox(
|
||||||
xe::ui::ImGuiDialog::ShowMessageBox(
|
imgui_drawer, "Title was restarted",
|
||||||
imgui_drawer, "Title was restarted",
|
"Title closed with new launch data. \nPlease restart Xenia. "
|
||||||
"Title closed with new launch data. \nPlease restart Xenia. "
|
"Game will be loaded automatically.");
|
||||||
"Game will be loaded automatically.");
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
assert_always("Game requested exit to dashboard via XamLoaderLaunchTitle");
|
assert_always("Game requested exit to dashboard via XamLoaderLaunchTitle");
|
||||||
|
|||||||
Reference in New Issue
Block a user