From e05e6853faf8563702963f384fb1486cda77c841 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Thu, 17 Mar 2022 03:01:03 -0400 Subject: [PATCH] applets: Rename Mii to MiiEdit --- src/core/CMakeLists.txt | 8 +++--- .../applets/{mii.cpp => mii_edit.cpp} | 9 +++--- .../frontend/applets/{mii.h => mii_edit.h} | 6 ++-- .../{applet_mii.cpp => applet_mii_edit.cpp} | 23 +++++++-------- .../{applet_mii.h => applet_mii_edit.h} | 10 +++---- src/core/hle/service/am/applets/applets.cpp | 28 +++++++++---------- src/core/hle/service/am/applets/applets.h | 8 +++--- src/yuzu/main.cpp | 4 +-- 8 files changed, 49 insertions(+), 47 deletions(-) rename src/core/frontend/applets/{mii.cpp => mii_edit.cpp} (68%) rename src/core/frontend/applets/{mii.h => mii_edit.h} (87%) rename src/core/hle/service/am/applets/{applet_mii.cpp => applet_mii_edit.cpp} (81%) rename src/core/hle/service/am/applets/{applet_mii.h => applet_mii_edit.h} (89%) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 1d4e92edb..f7dd4294f 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -122,8 +122,8 @@ add_library(core STATIC frontend/applets/error.h frontend/applets/general_frontend.cpp frontend/applets/general_frontend.h - frontend/applets/mii.cpp - frontend/applets/mii.h + frontend/applets/mii_edit.cpp + frontend/applets/mii_edit.h frontend/applets/profile_select.cpp frontend/applets/profile_select.h frontend/applets/software_keyboard.cpp @@ -306,8 +306,8 @@ add_library(core STATIC hle/service/am/applets/applet_error.h hle/service/am/applets/applet_general_backend.cpp hle/service/am/applets/applet_general_backend.h - hle/service/am/applets/applet_mii.cpp - hle/service/am/applets/applet_mii.h + hle/service/am/applets/applet_mii_edit.cpp + hle/service/am/applets/applet_mii_edit.h hle/service/am/applets/applet_profile_select.cpp hle/service/am/applets/applet_profile_select.h hle/service/am/applets/applet_software_keyboard.cpp diff --git a/src/core/frontend/applets/mii.cpp b/src/core/frontend/applets/mii_edit.cpp similarity index 68% rename from src/core/frontend/applets/mii.cpp rename to src/core/frontend/applets/mii_edit.cpp index 1c05ff412..948d66f3d 100644 --- a/src/core/frontend/applets/mii.cpp +++ b/src/core/frontend/applets/mii_edit.cpp @@ -3,16 +3,17 @@ // Refer to the license.txt file included. #include "common/logging/log.h" -#include "core/frontend/applets/mii.h" +#include "core/frontend/applets/mii_edit.h" namespace Core::Frontend { -MiiApplet::~MiiApplet() = default; +MiiEditApplet::~MiiEditApplet() = default; -void DefaultMiiApplet::ShowMii( +void DefaultMiiEditApplet::ShowMii( const MiiParameters& parameters, const std::function callback) const { - LOG_INFO(Service_HID, "(STUBBED) called"); + LOG_WARNING(Service_AM, "(STUBBED) called"); + callback(parameters); } diff --git a/src/core/frontend/applets/mii.h b/src/core/frontend/applets/mii_edit.h similarity index 87% rename from src/core/frontend/applets/mii.h rename to src/core/frontend/applets/mii_edit.h index 11ba8a359..0d5bb69a2 100644 --- a/src/core/frontend/applets/mii.h +++ b/src/core/frontend/applets/mii_edit.h @@ -15,16 +15,16 @@ struct MiiParameters { Service::Mii::MiiInfo mii_data{}; }; -class MiiApplet { +class MiiEditApplet { public: - virtual ~MiiApplet(); + virtual ~MiiEditApplet(); virtual void ShowMii(const MiiParameters& parameters, const std::function callback) const = 0; }; -class DefaultMiiApplet final : public MiiApplet { +class DefaultMiiEditApplet final : public MiiEditApplet { public: void ShowMii(const MiiParameters& parameters, const std::function diff --git a/src/core/hle/service/am/applets/applet_mii.cpp b/src/core/hle/service/am/applets/applet_mii_edit.cpp similarity index 81% rename from src/core/hle/service/am/applets/applet_mii.cpp rename to src/core/hle/service/am/applets/applet_mii_edit.cpp index facede97e..ec57d98bd 100644 --- a/src/core/hle/service/am/applets/applet_mii.cpp +++ b/src/core/hle/service/am/applets/applet_mii_edit.cpp @@ -5,19 +5,20 @@ #include "common/assert.h" #include "common/logging/log.h" #include "core/core.h" -#include "core/frontend/applets/mii.h" +#include "core/frontend/applets/mii_edit.h" #include "core/hle/service/am/am.h" -#include "core/hle/service/am/applets/applet_mii.h" +#include "core/hle/service/am/applets/applet_mii_edit.h" +#include "core/reporter.h" namespace Service::AM::Applets { -Mii::Mii(Core::System& system_, LibraryAppletMode applet_mode_, - const Core::Frontend::MiiApplet& frontend_) +MiiEdit::MiiEdit(Core::System& system_, LibraryAppletMode applet_mode_, + const Core::Frontend::MiiEditApplet& frontend_) : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {} -Mii::~Mii() = default; +MiiEdit::~MiiEdit() = default; -void Mii::Initialize() { +void MiiEdit::Initialize() { is_complete = false; const auto storage = broker.PopNormalDataToApplet(); @@ -29,19 +30,19 @@ void Mii::Initialize() { std::memcpy(&input_data, data.data(), sizeof(MiiAppletInput)); } -bool Mii::TransactionComplete() const { +bool MiiEdit::TransactionComplete() const { return is_complete; } -ResultCode Mii::GetStatus() const { +ResultCode MiiEdit::GetStatus() const { return ResultSuccess; } -void Mii::ExecuteInteractive() { +void MiiEdit::ExecuteInteractive() { UNREACHABLE_MSG("Unexpected interactive applet data!"); } -void Mii::Execute() { +void MiiEdit::Execute() { if (is_complete) { return; } @@ -83,7 +84,7 @@ void Mii::Execute() { } } -void Mii::DisplayCompleted(const Core::Frontend::MiiParameters& parameters) { +void MiiEdit::DisplayCompleted(const Core::Frontend::MiiParameters& parameters) { is_complete = true; std::vector reply(sizeof(AppletOutputForCharInfoEditing)); diff --git a/src/core/hle/service/am/applets/applet_mii.h b/src/core/hle/service/am/applets/applet_mii_edit.h similarity index 89% rename from src/core/hle/service/am/applets/applet_mii.h rename to src/core/hle/service/am/applets/applet_mii_edit.h index 42326bfc2..828f28da4 100644 --- a/src/core/hle/service/am/applets/applet_mii.h +++ b/src/core/hle/service/am/applets/applet_mii_edit.h @@ -63,11 +63,11 @@ struct AppletOutputForCharInfoEditing { static_assert(sizeof(AppletOutputForCharInfoEditing) == 0x80, "AppletOutputForCharInfoEditing has incorrect size."); -class Mii final : public Applet { +class MiiEdit final : public Applet { public: - explicit Mii(Core::System& system_, LibraryAppletMode applet_mode_, - const Core::Frontend::MiiApplet& frontend_); - ~Mii() override; + explicit MiiEdit(Core::System& system_, LibraryAppletMode applet_mode_, + const Core::Frontend::MiiEditApplet& frontend_); + ~MiiEdit() override; void Initialize() override; @@ -79,7 +79,7 @@ public: void DisplayCompleted(const Core::Frontend::MiiParameters& parameters); private: - const Core::Frontend::MiiApplet& frontend; + const Core::Frontend::MiiEditApplet& frontend; MiiAppletInput input_data{}; AppletOutputForCharInfoEditing output_data{}; diff --git a/src/core/hle/service/am/applets/applets.cpp b/src/core/hle/service/am/applets/applets.cpp index 79e62679d..1f4c9786a 100644 --- a/src/core/hle/service/am/applets/applets.cpp +++ b/src/core/hle/service/am/applets/applets.cpp @@ -9,7 +9,7 @@ #include "core/frontend/applets/controller.h" #include "core/frontend/applets/error.h" #include "core/frontend/applets/general_frontend.h" -#include "core/frontend/applets/mii.h" +#include "core/frontend/applets/mii_edit.h" #include "core/frontend/applets/profile_select.h" #include "core/frontend/applets/software_keyboard.h" #include "core/frontend/applets/web_browser.h" @@ -20,7 +20,7 @@ #include "core/hle/service/am/applets/applet_controller.h" #include "core/hle/service/am/applets/applet_error.h" #include "core/hle/service/am/applets/applet_general_backend.h" -#include "core/hle/service/am/applets/applet_mii.h" +#include "core/hle/service/am/applets/applet_mii_edit.h" #include "core/hle/service/am/applets/applet_profile_select.h" #include "core/hle/service/am/applets/applet_software_keyboard.h" #include "core/hle/service/am/applets/applet_web_browser.h" @@ -173,12 +173,12 @@ void Applet::Initialize() { AppletFrontendSet::AppletFrontendSet() = default; AppletFrontendSet::AppletFrontendSet(ControllerApplet controller_applet, ErrorApplet error_applet, + MiiEdit mii_edit_, ParentalControlsApplet parental_controls_applet, - MiiApplet mii_applet, PhotoViewer photo_viewer_, - ProfileSelect profile_select_, + PhotoViewer photo_viewer_, ProfileSelect profile_select_, SoftwareKeyboard software_keyboard_, WebBrowser web_browser_) : controller{std::move(controller_applet)}, error{std::move(error_applet)}, - parental_controls{std::move(parental_controls_applet)}, mii{std::move(mii_applet)}, + mii_edit{std::move(mii_edit_)}, parental_controls{std::move(parental_controls_applet)}, photo_viewer{std::move(photo_viewer_)}, profile_select{std::move(profile_select_)}, software_keyboard{std::move(software_keyboard_)}, web_browser{std::move(web_browser_)} {} @@ -205,12 +205,12 @@ void AppletManager::SetAppletFrontendSet(AppletFrontendSet set) { frontend.error = std::move(set.error); } - if (set.parental_controls != nullptr) { - frontend.parental_controls = std::move(set.parental_controls); + if (set.mii_edit != nullptr) { + frontend.mii_edit = std::move(set.mii_edit); } - if (set.mii != nullptr) { - frontend.mii = std::move(set.mii); + if (set.parental_controls != nullptr) { + frontend.parental_controls = std::move(set.parental_controls); } if (set.photo_viewer != nullptr) { @@ -245,15 +245,15 @@ void AppletManager::SetDefaultAppletsIfMissing() { frontend.error = std::make_unique(); } + if (frontend.mii_edit == nullptr) { + frontend.mii_edit = std::make_unique(); + } + if (frontend.parental_controls == nullptr) { frontend.parental_controls = std::make_unique(); } - if (frontend.mii == nullptr) { - frontend.mii = std::make_unique(); - } - if (frontend.photo_viewer == nullptr) { frontend.photo_viewer = std::make_unique(); } @@ -289,7 +289,7 @@ std::shared_ptr AppletManager::GetApplet(AppletId id, LibraryAppletMode case AppletId::SoftwareKeyboard: return std::make_shared(system, mode, *frontend.software_keyboard); case AppletId::MiiEdit: - return std::make_shared(system, mode, *frontend.mii); + return std::make_shared(system, mode, *frontend.mii_edit); case AppletId::Web: case AppletId::Shop: case AppletId::OfflineWeb: diff --git a/src/core/hle/service/am/applets/applets.h b/src/core/hle/service/am/applets/applets.h index 0c44aec79..50a7bdceb 100644 --- a/src/core/hle/service/am/applets/applets.h +++ b/src/core/hle/service/am/applets/applets.h @@ -20,8 +20,8 @@ namespace Core::Frontend { class ControllerApplet; class ECommerceApplet; class ErrorApplet; +class MiiEditApplet; class ParentalControlsApplet; -class MiiApplet; class PhotoViewerApplet; class ProfileSelectApplet; class SoftwareKeyboardApplet; @@ -179,8 +179,8 @@ protected: struct AppletFrontendSet { using ControllerApplet = std::unique_ptr; using ErrorApplet = std::unique_ptr; + using MiiEdit = std::unique_ptr; using ParentalControlsApplet = std::unique_ptr; - using MiiApplet = std::unique_ptr; using PhotoViewer = std::unique_ptr; using ProfileSelect = std::unique_ptr; using SoftwareKeyboard = std::unique_ptr; @@ -188,7 +188,7 @@ struct AppletFrontendSet { AppletFrontendSet(); AppletFrontendSet(ControllerApplet controller_applet, ErrorApplet error_applet, - ParentalControlsApplet parental_controls_applet, MiiApplet mii_applet, + MiiEdit mii_edit_, ParentalControlsApplet parental_controls_applet, PhotoViewer photo_viewer_, ProfileSelect profile_select_, SoftwareKeyboard software_keyboard_, WebBrowser web_browser_); ~AppletFrontendSet(); @@ -201,8 +201,8 @@ struct AppletFrontendSet { ControllerApplet controller; ErrorApplet error; + MiiEdit mii_edit; ParentalControlsApplet parental_controls; - MiiApplet mii; PhotoViewer photo_viewer; ProfileSelect profile_select; SoftwareKeyboard software_keyboard; diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index ecd2f9f24..f2182d901 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -24,7 +24,7 @@ #include "core/file_sys/vfs_real.h" #include "core/frontend/applets/controller.h" #include "core/frontend/applets/general_frontend.h" -#include "core/frontend/applets/mii.h" +#include "core/frontend/applets/mii_edit.h" #include "core/frontend/applets/software_keyboard.h" #include "core/hid/emulated_controller.h" #include "core/hid/hid_core.h" @@ -1280,8 +1280,8 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p system->SetAppletFrontendSet({ std::make_unique(*this), // Controller Selector std::make_unique(*this), // Error Display + nullptr, // Mii Editor nullptr, // Parental Controls - nullptr, // Mii editor nullptr, // Photo Viewer std::make_unique(*this), // Profile Selector std::make_unique(*this), // Software Keyboard