|
4 | 4 | #include "overlay_home_menu_settings.h" |
5 | 5 | #include "overlay_home_menu_savestate.h" |
6 | 6 | #include "Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.h" |
| 7 | +#include "Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.h" |
7 | 8 | #include "Emu/RSX/Overlays/overlay_manager.h" |
8 | 9 | #include "Emu/System.h" |
9 | 10 | #include "Emu/system_config.h" |
| 11 | +#include "Emu/Cell/Modules/sceNpTrophy.h" |
10 | 12 |
|
11 | 13 | extern atomic_t<bool> g_user_asked_for_recording; |
12 | 14 | extern atomic_t<bool> g_user_asked_for_screenshot; |
@@ -55,6 +57,32 @@ namespace rsx |
55 | 57 | return page_navigation::stay; |
56 | 58 | }); |
57 | 59 |
|
| 60 | + // get current trophy name for trophy list overlay |
| 61 | + std::string trop_name; |
| 62 | + { |
| 63 | + current_trophy_name& current_id = g_fxo->get<current_trophy_name>(); |
| 64 | + std::lock_guard lock(current_id.mtx); |
| 65 | + trop_name = current_id.name; |
| 66 | + } |
| 67 | + if (!trop_name.empty()) |
| 68 | + { |
| 69 | + std::unique_ptr<overlay_element> trophies = std::make_unique<home_menu_entry>(get_localized_string(localized_string_id::HOME_MENU_TROPHIES)); |
| 70 | + add_item(trophies, [trop_name = std::move(trop_name)](pad_button btn) -> page_navigation |
| 71 | + { |
| 72 | + if (btn != pad_button::cross) return page_navigation::stay; |
| 73 | + |
| 74 | + rsx_log.notice("User selected trophies in home menu"); |
| 75 | + Emu.CallFromMainThread([trop_name = std::move(trop_name)]() |
| 76 | + { |
| 77 | + if (auto manager = g_fxo->try_get<rsx::overlays::display_manager>()) |
| 78 | + { |
| 79 | + manager->create<rsx::overlays::trophy_list_dialog>()->show(trop_name); |
| 80 | + } |
| 81 | + }); |
| 82 | + return page_navigation::stay; |
| 83 | + }); |
| 84 | + } |
| 85 | + |
58 | 86 | std::unique_ptr<overlay_element> screenshot = std::make_unique<home_menu_entry>(get_localized_string(localized_string_id::HOME_MENU_SCREENSHOT)); |
59 | 87 | add_item(screenshot, [](pad_button btn) -> page_navigation |
60 | 88 | { |
|
0 commit comments