mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-19 19:15:26 +00:00
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
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:
parent
6921684cd9
commit
a469bfd4da
3 changed files with 32 additions and 16 deletions
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,26 +38,33 @@ namespace rsx
|
|||
|
||||
add_page(std::make_shared<home_menu_settings>(x, y, width, height, use_separators, this));
|
||||
|
||||
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
|
||||
if (rsx::overlays::friends_list_dialog::rpcn_configured())
|
||||
{
|
||||
if (btn != pad_button::cross) return page_navigation::stay;
|
||||
|
||||
rsx_log.notice("User selected friends in home menu");
|
||||
Emu.CallFromMainThread([]()
|
||||
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
|
||||
{
|
||||
if (auto manager = g_fxo->try_get<rsx::overlays::display_manager>())
|
||||
{
|
||||
const error_code result = manager->create<rsx::overlays::friends_list_dialog>()->show(true, [](s32 status)
|
||||
{
|
||||
rsx_log.notice("Closing friends list with status %d", status);
|
||||
});
|
||||
if (btn != pad_button::cross) return page_navigation::stay;
|
||||
|
||||
(result ? rsx_log.error : rsx_log.notice)("Opened friends list with result %d", s32{result});
|
||||
}
|
||||
rsx_log.notice("User selected friends in home menu");
|
||||
Emu.CallFromMainThread([]()
|
||||
{
|
||||
if (auto manager = g_fxo->try_get<rsx::overlays::display_manager>())
|
||||
{
|
||||
const error_code result = manager->create<rsx::overlays::friends_list_dialog>()->show(true, [](s32 status)
|
||||
{
|
||||
rsx_log.notice("Closing friends list with status %d", status);
|
||||
});
|
||||
|
||||
(result ? rsx_log.error : rsx_log.notice)("Opened friends list with result %d", s32{result});
|
||||
}
|
||||
});
|
||||
return page_navigation::stay;
|
||||
});
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue