From d31152e20a50266e21f7b061cff748e78ae243b4 Mon Sep 17 00:00:00 2001 From: Genwald Date: Wed, 16 Jun 2021 12:12:20 -0500 Subject: [PATCH] Disable "Show Mii applet" option in applet mode --- include/mii_qr.hpp | 2 +- source/main.cpp | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/mii_qr.hpp b/include/mii_qr.hpp index 9c27970..6722b7d 100644 --- a/include/mii_qr.hpp +++ b/include/mii_qr.hpp @@ -313,7 +313,7 @@ std::unique_ptr generateQrRGBA(u8 *data, size_t data_size, u32 scale, int } } } - } + } } return out_data; } diff --git a/source/main.cpp b/source/main.cpp index dc9230d..7afdeee 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -12,6 +12,8 @@ #include "miiport.hpp" +const AppletType APPLET_TYPE = appletGetAppletType(); + Result init() { Result res; res = setsysInitialize(); @@ -265,10 +267,14 @@ int main(int argc, char* argv[]) { rootFrame->addTab("Export", exportList); rootFrame->addSeparator(); rootFrame->addTab("About", aboutList); - rootFrame->registerAction("Show Mii applet", brls::Key::X, [] { - miiLaShowMiiEdit(MiiSpecialKeyCode_Special); - return true; - }); + + // This was not working in applet mode. I think this is a memory issue? + if(APPLET_TYPE == AppletType_Application || APPLET_TYPE == AppletType_SystemApplication) { + rootFrame->registerAction("Show Mii applet", brls::Key::X, [] { + miiLaShowMiiEdit(MiiSpecialKeyCode_Special); + return true; + }); + } brls::Application::pushView(rootFrame);