overlays: hide friends list in home menu if rpcn is not configured
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run

This commit is contained in:
Megamouse 2025-03-26 23:51:41 +01:00 committed by Ani
parent 6921684cd9
commit a469bfd4da
3 changed files with 32 additions and 16 deletions

View file

@ -684,5 +684,12 @@ namespace rsx
return CELL_OK;
}
bool friends_list_dialog::rpcn_configured()
{
cfg_rpcn cfg;
cfg.load();
return !cfg.get_npid().empty() && !cfg.get_password().empty();
}
} // namespace overlays
} // namespace RSX

View file

@ -59,6 +59,8 @@ namespace rsx
error_code show(bool enable_overlay, std::function<void(s32 status)> on_close);
void callback_handler(rpcn::NotificationType ntype, const std::string& username, bool status);
static bool rpcn_configured();
};
}
}

View file

@ -38,6 +38,8 @@ namespace rsx
add_page(std::make_shared<home_menu_settings>(x, y, width, height, use_separators, this));
if (rsx::overlays::friends_list_dialog::rpcn_configured())
{
std::unique_ptr<overlay_element> friends = std::make_unique<home_menu_entry>(get_localized_string(localized_string_id::HOME_MENU_FRIENDS));
add_item(friends, [](pad_button btn) -> page_navigation
{
@ -58,6 +60,11 @@ namespace rsx
});
return page_navigation::stay;
});
}
else
{
rsx_log.notice("Friends list hidden in home menu. RPCN is not configured.");
}
// get current trophy name for trophy list overlay
std::string trop_name;