yati: signal change to games menu when a new game is installed.
This commit is contained in:
@@ -43,6 +43,8 @@ enum OrderType {
|
|||||||
|
|
||||||
using LayoutType = grid::LayoutType;
|
using LayoutType = grid::LayoutType;
|
||||||
|
|
||||||
|
void SignalChange();
|
||||||
|
|
||||||
struct Menu final : grid::Menu {
|
struct Menu final : grid::Menu {
|
||||||
Menu(u32 flags);
|
Menu(u32 flags);
|
||||||
~Menu();
|
~Menu();
|
||||||
|
|||||||
@@ -36,6 +36,8 @@
|
|||||||
namespace sphaira::ui::menu::game {
|
namespace sphaira::ui::menu::game {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
constinit UEvent g_change_uevent;
|
||||||
|
|
||||||
struct NspSource final : dump::BaseSource {
|
struct NspSource final : dump::BaseSource {
|
||||||
NspSource(const std::vector<NspEntry>& entries) : m_entries{entries} {
|
NspSource(const std::vector<NspEntry>& entries) : m_entries{entries} {
|
||||||
m_is_file_based_emummc = App::IsFileBaseEmummc();
|
m_is_file_based_emummc = App::IsFileBaseEmummc();
|
||||||
@@ -270,6 +272,10 @@ Result NspEntry::Read(void* buf, s64 off, s64 size, u64* bytes_read) {
|
|||||||
return 0x1;
|
return 0x1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SignalChange() {
|
||||||
|
ueventSignal(&g_change_uevent);
|
||||||
|
}
|
||||||
|
|
||||||
Menu::Menu(u32 flags) : grid::Menu{"Games"_i18n, flags} {
|
Menu::Menu(u32 flags) : grid::Menu{"Games"_i18n, flags} {
|
||||||
this->SetActions(
|
this->SetActions(
|
||||||
std::make_pair(Button::L3, Action{[this](){
|
std::make_pair(Button::L3, Action{[this](){
|
||||||
@@ -455,6 +461,7 @@ Menu::Menu(u32 flags) : grid::Menu{"Games"_i18n, flags} {
|
|||||||
|
|
||||||
fsOpenGameCardDetectionEventNotifier(std::addressof(m_gc_event_notifier));
|
fsOpenGameCardDetectionEventNotifier(std::addressof(m_gc_event_notifier));
|
||||||
fsEventNotifierGetEventHandle(std::addressof(m_gc_event_notifier), std::addressof(m_gc_event), true);
|
fsEventNotifierGetEventHandle(std::addressof(m_gc_event_notifier), std::addressof(m_gc_event), true);
|
||||||
|
ueventCreate(&g_change_uevent, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Menu::~Menu() {
|
Menu::~Menu() {
|
||||||
@@ -469,8 +476,10 @@ Menu::~Menu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Menu::Update(Controller* controller, TouchInfo* touch) {
|
void Menu::Update(Controller* controller, TouchInfo* touch) {
|
||||||
// force update if gamecard state changed.
|
s32 wait_dummy_idx;
|
||||||
m_dirty |= R_SUCCEEDED(eventWait(&m_gc_event, 0));
|
if (R_SUCCEEDED(waitMulti(&wait_dummy_idx, 0, waiterForEvent(&m_gc_event), waiterForUEvent(&g_change_uevent)))) {
|
||||||
|
m_dirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_dirty) {
|
if (m_dirty) {
|
||||||
App::Notify("Updating application record list"_i18n);
|
App::Notify("Updating application record list"_i18n);
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
#include "utils/thread.hpp"
|
#include "utils/thread.hpp"
|
||||||
|
|
||||||
#include "ui/progress_box.hpp"
|
#include "ui/progress_box.hpp"
|
||||||
|
#include "ui/menus/game_menu.hpp"
|
||||||
|
|
||||||
#include "app.hpp"
|
#include "app.hpp"
|
||||||
#include "i18n.hpp"
|
#include "i18n.hpp"
|
||||||
#include "log.hpp"
|
#include "log.hpp"
|
||||||
@@ -873,6 +875,9 @@ Yati::~Yati() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
App::SetAutoSleepDisabled(false);
|
App::SetAutoSleepDisabled(false);
|
||||||
|
|
||||||
|
// force update the game menu, as we may have installed a game.
|
||||||
|
ui::menu::game::SignalChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
Result Yati::Setup(const ConfigOverride& override) {
|
Result Yati::Setup(const ConfigOverride& override) {
|
||||||
|
|||||||
Reference in New Issue
Block a user