diff --git a/vita3k/gui/src/app_context_menu.cpp b/vita3k/gui/src/app_context_menu.cpp index 4b6fc5c554..7433423713 100644 --- a/vita3k/gui/src/app_context_menu.cpp +++ b/vita3k/gui/src/app_context_menu.cpp @@ -307,7 +307,8 @@ void draw_app_context_menu(GuiState &gui, EmuEnvState &emuenv, const std::string auto &common = emuenv.common_dialog.lang.common; auto &lang_compat = gui.lang.compatibility; - const auto is_commercial_app = title_id.find("PCS") != std::string::npos; + const auto is_commercial_app = title_id.starts_with("PCS") || title_id.starts_with("NPXS10007"); + const auto is_system_app = title_id.starts_with("NPXS") && !title_id.starts_with("NPXS10007"); const auto has_state_report = gui.compat.compat_db_loaded ? gui.compat.app_compat_db.contains(title_id) : false; const auto compat_state = has_state_report ? gui.compat.app_compat_db[title_id].state : compat::UNKNOWN; const auto compat_state_color = gui.compat.compat_color[compat_state]; @@ -319,7 +320,7 @@ void draw_app_context_menu(GuiState &gui, EmuEnvState &emuenv, const std::string const auto START_STR = app_path == emuenv.io.app_path ? gui.lang.live_area.main["continue"] : gui.lang.live_area.main["start"]; if (ImGui::MenuItem(START_STR.c_str())) pre_run_app(gui, emuenv, app_path); - if (title_id.find("NPXS") == std::string::npos) { + if (!is_system_app) { if (ImGui::BeginMenu(lang_compat.name.c_str())) { if (!is_commercial_app || !gui.compat.compat_db_loaded) { if (ImGui::MenuItem(lang.main["check_app_state"].c_str())) { @@ -499,7 +500,7 @@ void draw_app_context_menu(GuiState &gui, EmuEnvState &emuenv, const std::string } } if (ImGui::MenuItem(lang.main["information"].c_str(), nullptr, &gui.vita_area.app_information)) { - if (title_id.find("NPXS") == std::string::npos) { + if (!is_system_app) { get_app_info(gui, emuenv, app_path); const auto app_size = get_app_size(gui, emuenv, app_path); gui.app_selector.app_info.size = app_size; @@ -610,7 +611,7 @@ void draw_app_context_menu(GuiState &gui, EmuEnvState &emuenv, const std::string ImGui::PushTextWrapPos(display_size.x - (85.f * SCALE.x)); ImGui::TextColored(GUI_COLOR_TEXT, "%s", APP_INDEX->title.c_str()); ImGui::PopTextWrapPos(); - if (title_id.find("NPXS") == std::string::npos) { + if (!is_system_app) { ImGui::Spacing(); ImGui::SetCursorPosX((display_size.x / 2.f) - ImGui::CalcTextSize((lang.info["trophy_earning"] + " ").c_str()).x); ImGui::TextColored(GUI_COLOR_TEXT, "%s %s", lang.info["trophy_earning"].c_str(), gui.app_selector.app_info.trophy.c_str()); diff --git a/vita3k/gui/src/gui.cpp b/vita3k/gui/src/gui.cpp index 6388cb6833..b57266a083 100644 --- a/vita3k/gui/src/gui.cpp +++ b/vita3k/gui/src/gui.cpp @@ -381,7 +381,7 @@ void init_app_background(GuiState &gui, EmuEnvState &emuenv, const std::string & int32_t height = 0; vfs::FileBuffer buffer; - const auto is_sys = app_path.find("NPXS") != std::string::npos; + const auto is_sys = app_path.starts_with("NPXS") && !app_path.starts_with("NPXS10007"); if (is_sys) vfs::read_file(VitaIoDevice::vs0, buffer, emuenv.pref_path.wstring(), "app/" + app_path + "/sce_sys/pic0.png"); else @@ -553,7 +553,7 @@ void init_user_app(GuiState &gui, EmuEnvState &emuenv, const std::string &app_pa } std::map::const_iterator get_app_icon(GuiState &gui, const std::string &app_path) { - const auto &app_type = app_path.find("NPXS") != std::string::npos ? gui.app_selector.sys_apps_icon : gui.app_selector.user_apps_icon; + const auto &app_type = app_path.starts_with("NPXS") && !app_path.starts_with("NPXS10007") ? gui.app_selector.sys_apps_icon : gui.app_selector.user_apps_icon; const auto app_icon = std::find_if(app_type.begin(), app_type.end(), [&](const auto &i) { return i.first == app_path; }); @@ -562,7 +562,7 @@ std::map::const_iterator get_app_icon(GuiState &gui, } std::vector::iterator get_app_index(GuiState &gui, const std::string &app_path) { - auto &app_type = app_path.find("NPXS") != std::string::npos ? gui.app_selector.sys_apps : gui.app_selector.user_apps; + auto &app_type = app_path.starts_with("NPXS") && !app_path.starts_with("NPXS10007") ? gui.app_selector.sys_apps : gui.app_selector.user_apps; const auto app_index = std::find_if(app_type.begin(), app_type.end(), [&](const App &a) { return a.path == app_path; }); diff --git a/vita3k/gui/src/home_screen.cpp b/vita3k/gui/src/home_screen.cpp index 37a111579f..9015723912 100644 --- a/vita3k/gui/src/home_screen.cpp +++ b/vita3k/gui/src/home_screen.cpp @@ -146,7 +146,8 @@ void pre_load_app(GuiState &gui, EmuEnvState &emuenv, bool live_area, const std: } void pre_run_app(GuiState &gui, EmuEnvState &emuenv, const std::string &app_path) { - if (app_path.find("NPXS") == std::string::npos) { + const auto is_sys = app_path.starts_with("NPXS") && !app_path.starts_with("NPXS10007"); + if (!is_sys) { if (emuenv.io.app_path != app_path) { if (!emuenv.io.app_path.empty()) gui.vita_area.app_close = true; @@ -320,7 +321,7 @@ static bool app_filter(const std::string &app) { return true; break; case HOMEBREW: - if (!filter_app({ "PCS" })) + if (!filter_app({ "PCS", "NPXS10007" })) return true; break; } @@ -752,9 +753,9 @@ void draw_home_screen(GuiState &gui, EmuEnvState &emuenv) { const auto display_app = [&](const std::vector &apps_list, std::map &apps_icon) { for (const auto &app : apps_list) { bool selected = false; - const auto is_not_sys_app = app.path.find("NPXS") == std::string::npos; + const auto is_sys = app.path.starts_with("NPXS") && !app.path.starts_with("NPXS10007"); - if (is_not_sys_app) { + if (!is_sys) { // Filter app by region and type if (app_filter(app.title_id)) continue; @@ -779,7 +780,7 @@ void draw_home_screen(GuiState &gui, EmuEnvState &emuenv) { // Get the current app index off the apps list. const auto app_index = static_cast(&app - &apps_list[0]); - const auto current_app_index = is_not_sys_app ? app_index : app_index - 4; + const auto current_app_index = !is_sys ? app_index : app_index - 4; apps_list_filtered.push_back(current_app_index); // Check if the current app is selected. @@ -860,7 +861,7 @@ void draw_home_screen(GuiState &gui, EmuEnvState &emuenv) { ImGui::NextColumn(); // Draw the compatibility badge for commercial apps when they are within the visible area. - if (element_is_within_visible_area && (app.title_id.find("PCS") != std::string::npos)) { + if (element_is_within_visible_area && app.title_id.starts_with("PCS") || app.title_id.starts_with("NPXS10007")) { const auto compat_state = (gui.compat.compat_db_loaded ? gui.compat.app_compat_db.contains(app.title_id) : false) ? gui.compat.app_compat_db[app.title_id].state : compat::UNKNOWN; const auto compat_state_vec4 = gui.compat.compat_color[compat_state]; const ImU32 compat_state_color = IM_COL32((int)(compat_state_vec4.x * 255.0f), (int)(compat_state_vec4.y * 255.0f), (int)(compat_state_vec4.z * 255.0f), (int)(compat_state_vec4.w * 255.0f)); diff --git a/vita3k/gui/src/live_area.cpp b/vita3k/gui/src/live_area.cpp index 41775f71dc..26cedd38ca 100644 --- a/vita3k/gui/src/live_area.cpp +++ b/vita3k/gui/src/live_area.cpp @@ -153,8 +153,8 @@ static std::map items_styles = { void init_live_area(GuiState &gui, EmuEnvState &emuenv, const std::string &app_path) { const auto live_area_lang = gui.lang.user_lang[LIVE_AREA]; - const auto is_sys_app = app_path.find("NPXS") != std::string::npos; - const auto is_ps_app = app_path.find("PCS") != std::string::npos; + const auto is_sys_app = app_path.starts_with("NPXS") && !app_path.starts_with("NPXS10007"); + const auto is_ps_app = app_path.starts_with("PCS") || app_path.starts_with("NPXS10007"); const VitaIoDevice app_device = is_sys_app ? VitaIoDevice::vs0 : VitaIoDevice::ux0; const auto APP_INDEX = get_app_index(gui, app_path); @@ -639,7 +639,7 @@ void draw_live_area_screen(GuiState &gui, EmuEnvState &emuenv) { const auto SCALE = ImVec2(RES_SCALE.x * emuenv.dpi_scale, RES_SCALE.y * emuenv.dpi_scale); const auto app_path = gui.live_area_current_open_apps_list[gui.live_area_app_current_open]; - const VitaIoDevice app_device = app_path.find("NPXS") != std::string::npos ? VitaIoDevice::vs0 : VitaIoDevice::ux0; + const VitaIoDevice app_device = app_path.starts_with("NPXS") && !app_path.starts_with("NPXS10007") ? VitaIoDevice::vs0 : VitaIoDevice::ux0; ImGui::SetNextWindowPos(VIEWPORT_POS, ImGuiCond_Always); ImGui::SetNextWindowSize(VIEWPORT_SIZE, ImGuiCond_Always); @@ -1065,7 +1065,7 @@ void draw_live_area_screen(GuiState &gui, EmuEnvState &emuenv) { const auto ICON_POS_MAX_SCALE = ImVec2(ICON_POS_MINI_SCALE.x + ICON_SIZE_SCALE, ICON_POS_MINI_SCALE.y + ICON_SIZE_SCALE); // check if app icon exist - auto &APP_ICON_TYPE = app_path.find("NPXS") != std::string::npos ? gui.app_selector.sys_apps_icon : gui.app_selector.user_apps_icon; + auto &APP_ICON_TYPE = app_path.starts_with("NPXS") && !app_path.starts_with("NPXS10007") ? gui.app_selector.sys_apps_icon : gui.app_selector.user_apps_icon; if (APP_ICON_TYPE.contains(app_path)) { window_draw_list->AddImageRounded(APP_ICON_TYPE[app_path], ICON_POS_MINI_SCALE, ICON_POS_MAX_SCALE, ImVec2(0, 0), ImVec2(1, 1), IM_COL32_WHITE, 75.f * SCALE.x, ImDrawFlags_RoundCornersAll);