From 05b447e641c72842f775ab81f335f299b0e550b0 Mon Sep 17 00:00:00 2001 From: J-D-K Date: Mon, 18 Aug 2025 14:31:51 -0400 Subject: [PATCH] Revisions --- include/appstates/BackupMenuState.hpp | 5 ++++- include/appstates/BlacklistEditState.hpp | 7 +++++-- include/appstates/DataLoadingState.hpp | 9 ++++++--- include/appstates/MessageState.hpp | 5 ++++- include/appstates/ProgressState.hpp | 6 +++++- include/appstates/SaveCreateState.hpp | 5 ++++- include/appstates/TaskState.hpp | 6 +++++- include/appstates/TitleInfoState.hpp | 5 ++++- include/appstates/TitleOptionState.hpp | 17 ++++++++++++++++- include/appstates/UserOptionState.hpp | 5 ++++- source/appstates/BackupMenuState.cpp | 24 +++++++++++++----------- source/appstates/BlacklistEditState.cpp | 15 ++++++++------- source/appstates/DataLoadingState.cpp | 23 +++++++++++++---------- source/appstates/MessageState.cpp | 13 +++++++------ source/appstates/ProgressState.cpp | 12 ++++++++---- source/appstates/SaveCreateState.cpp | 15 ++++++++------- source/appstates/TaskState.cpp | 14 +++++++++++--- source/appstates/TitleInfoState.cpp | 19 ++++++++----------- source/appstates/TitleOptionState.cpp | 16 ++++++++-------- source/appstates/UserOptionState.cpp | 15 ++++++++------- 20 files changed, 149 insertions(+), 87 deletions(-) diff --git a/include/appstates/BackupMenuState.hpp b/include/appstates/BackupMenuState.hpp index c933ce0..d6af28c 100644 --- a/include/appstates/BackupMenuState.hpp +++ b/include/appstates/BackupMenuState.hpp @@ -21,7 +21,7 @@ class BackupMenuState final : public BaseState BackupMenuState(data::User *user, data::TitleInfo *titleInfo); /// @brief Destructor. This is required even if it doesn't free or do anything. - ~BackupMenuState(); + ~BackupMenuState() {}; /// @brief Creates and returns a new BackupMenuState. static inline std::shared_ptr create(data::User *user, data::TitleInfo *titleInfo) @@ -158,6 +158,9 @@ class BackupMenuState final : public BaseState /// @brief Just creates the pop-up that says Save is empty or w/e. void pop_save_empty(); + /// @brief Performs some operations and then marks the state for purging. + void deactivate_state(); + inline bool user_is_system() { const uint8_t saveType = m_user->get_account_save_type(); diff --git a/include/appstates/BlacklistEditState.hpp b/include/appstates/BlacklistEditState.hpp index 4d6f3f5..9d78b42 100644 --- a/include/appstates/BlacklistEditState.hpp +++ b/include/appstates/BlacklistEditState.hpp @@ -12,8 +12,8 @@ class BlacklistEditState final : public BaseState /// @brief Constructor. Loads the blacklist and ensures the panel is allocated.S BlacklistEditState(); - /// @brief Clears and resets the panel. - ~BlacklistEditState(); + /// @brief Required destructor. + ~BlacklistEditState() {}; /// @brief Creates and returns a new state. static inline std::shared_ptr create() { return std::make_shared(); } @@ -56,4 +56,7 @@ class BlacklistEditState final : public BaseState /// @brief Removes the selected title from the blacklist and refreshes everything. void remove_from_blacklist(); + + /// @brief Performs some operations and marks the state for purging. + void deactivate_state(); }; diff --git a/include/appstates/DataLoadingState.hpp b/include/appstates/DataLoadingState.hpp index f7cb2f9..f41c894 100644 --- a/include/appstates/DataLoadingState.hpp +++ b/include/appstates/DataLoadingState.hpp @@ -26,6 +26,9 @@ class DataLoadingState final : public BaseTask m_task = std::make_unique(function, std::forward(args)...); } + /// @brief Destructor. Runs all DestructFunctions in the vector. + ~DataLoadingState() {}; + template static inline std::shared_ptr create(data::DataContext &context, DestructFunction destructFunction, @@ -46,9 +49,6 @@ class DataLoadingState final : public BaseTask return newState; } - /// @brief Destructor. Runs all DestructFunctions in the vector. - ~DataLoadingState(); - /// @brief Update override. void update() override; @@ -70,4 +70,7 @@ class DataLoadingState final : public BaseTask /// @brief Loads the icon if it hasn't been already. void initialize_static_members(); + + /// @brief + void deactivate_state(); }; diff --git a/include/appstates/MessageState.hpp b/include/appstates/MessageState.hpp index 222e256..990a920 100644 --- a/include/appstates/MessageState.hpp +++ b/include/appstates/MessageState.hpp @@ -16,7 +16,7 @@ class MessageState final : public BaseState MessageState(std::string_view message); /// @brief Required. Does NOTHING~ - ~MessageState(); + ~MessageState() {}; /// @brief Creates and returns a new MessageState. See constructor. static inline std::shared_ptr create(std::string_view message) @@ -64,4 +64,7 @@ class MessageState final : public BaseState /// @brief Allocates and ensures ^ void initialize_static_members(); + + /// @brief Pushes and empty fade in and marks the stage for purging. + void deactivate_state(); }; diff --git a/include/appstates/ProgressState.hpp b/include/appstates/ProgressState.hpp index 4614a98..f8f0077 100644 --- a/include/appstates/ProgressState.hpp +++ b/include/appstates/ProgressState.hpp @@ -26,7 +26,7 @@ class ProgressState final : public BaseTask } /// @brief Required destructor. - ~ProgressState(); + ~ProgressState() {}; /// @brief Creates and returns a new progress state. template @@ -67,5 +67,9 @@ class ProgressState final : public BaseTask /// @brief This is the dialog box everything is rendered to. static inline std::shared_ptr sm_dialog{}; + /// @brief Initializes the shared dialog box. void initialize_static_members(); + + /// @brief Performs some cleanup and marks the state for purging. + void deactivate_state(); }; diff --git a/include/appstates/SaveCreateState.hpp b/include/appstates/SaveCreateState.hpp index 83f898a..6021e47 100644 --- a/include/appstates/SaveCreateState.hpp +++ b/include/appstates/SaveCreateState.hpp @@ -18,7 +18,7 @@ class SaveCreateState final : public BaseState SaveCreateState(data::User *user, TitleSelectCommon *titleSelect); /// @brief Required destructor. - ~SaveCreateState(); + ~SaveCreateState() {}; /// @brief Returns a new SaveCreate state. See constructor for arguments. static inline std::shared_ptr create(data::User *user, TitleSelectCommon *titleSelect) @@ -73,4 +73,7 @@ class SaveCreateState final : public BaseState /// @brief Launches the save creation task. void create_save_data_for(); + + /// @brief Performs some operations and marks the state for purging. + void deactivate_state(); }; diff --git a/include/appstates/TaskState.hpp b/include/appstates/TaskState.hpp index c10062a..12377b6 100644 --- a/include/appstates/TaskState.hpp +++ b/include/appstates/TaskState.hpp @@ -21,7 +21,7 @@ class TaskState final : public BaseTask } /// @brief Required destructor. - ~TaskState(); + ~TaskState() {}; /// @brief Creates and returns a new TaskState. template @@ -45,4 +45,8 @@ class TaskState final : public BaseTask /// @brief Run render routine. Prints m_task's status string to screen, basically. /// @param void render() override; + + private: + /// @brief Performs some operations and marks the state for deletion. + void deactivate_state(); }; diff --git a/include/appstates/TitleInfoState.hpp b/include/appstates/TitleInfoState.hpp index f932751..d509bd2 100644 --- a/include/appstates/TitleInfoState.hpp +++ b/include/appstates/TitleInfoState.hpp @@ -18,7 +18,7 @@ class TitleInfoState final : public BaseState TitleInfoState(data::User *user, data::TitleInfo *titleInfo); /// @brief Required destructor. - ~TitleInfoState(); + ~TitleInfoState() {}; /// @brief Creates a new TitleInfoState. static inline std::shared_ptr create(data::User *user, data::TitleInfo *titleInfo) @@ -64,4 +64,7 @@ class TitleInfoState final : public BaseState /// @brief Helper function for creating text fields. std::shared_ptr create_new_scroll(std::string_view text, int y); + + /// @brief Performs some operations and marks the state for purging. + void deactivate_state(); }; diff --git a/include/appstates/TitleOptionState.hpp b/include/appstates/TitleOptionState.hpp index bfb36e2..8c81110 100644 --- a/include/appstates/TitleOptionState.hpp +++ b/include/appstates/TitleOptionState.hpp @@ -16,7 +16,7 @@ class TitleOptionState final : public BaseState TitleOptionState(data::User *user, data::TitleInfo *titleInfo, TitleSelectCommon *titleSelect); /// @brief Required destructor. - ~TitleOptionState(); + ~TitleOptionState() {}; /// @brief Returns a new TitleOptionState. See constructor. static inline std::shared_ptr create(data::User *user, @@ -85,27 +85,42 @@ class TitleOptionState final : public BaseState /// @brief This is shared by all instances of this class. static inline std::unique_ptr sm_slidePanel{}; + /// @brief Initializes the static members all instances share. void initialize_static_members(); + /// @brief Initializes the values of the struct passed to tasks. void initialize_data_struct(); + /// @brief Creates and pushes the title information state. void create_push_info_state(); + /// @brief Adds the currently highlighted title to the blacklist. void add_to_blacklist(); + /// @brief Changes the current output directory for the title locally and remotely (if needed). void change_output_directory(); + /// @brief Creates and pushes a new instance of file mode (once I get around to it.). void create_push_file_mode(); + /// @brief Deletes all locally stored save backups for the current title. void delete_all_local_backups(); + /// @brief Deletes all backups on the remote server. void delete_all_remote_backups(); + /// @brief Resets the save data for the current title. Basically wipes it clean. void reset_save_data(); + /// @brief Deletes the filesystem from the Switch. void delete_save_from_system(); + /// @brief Extends the container to any size desired. void extend_save_container(); + /// @brief Exports an SVI file for the current title. void export_svi_file(); + + /// @brief Performs some operations and marks the state for purging. + void deactivate_state(); }; diff --git a/include/appstates/UserOptionState.hpp b/include/appstates/UserOptionState.hpp index 603c4ab..3e57c61 100644 --- a/include/appstates/UserOptionState.hpp +++ b/include/appstates/UserOptionState.hpp @@ -17,7 +17,7 @@ class UserOptionState final : public BaseState UserOptionState(data::User *user, TitleSelectCommon *titleSelect); /// @brief Required destructor. - ~UserOptionState(); + ~UserOptionState() {}; /// @brief Returns a new UserOptionState. See constructor. static inline std::shared_ptr create(data::User *user, TitleSelectCommon *titleSelect) @@ -92,4 +92,7 @@ class UserOptionState final : public BaseState /// @brief Deletes all save data for the user. void delete_all_save_data(); + + /// @brief Performs operations to reset static members and marks the state for purging. + void deactivate_state(); }; diff --git a/source/appstates/BackupMenuState.cpp b/source/appstates/BackupMenuState.cpp index 9ce78ce..b71719b 100644 --- a/source/appstates/BackupMenuState.cpp +++ b/source/appstates/BackupMenuState.cpp @@ -45,16 +45,6 @@ BackupMenuState::BackupMenuState(data::User *user, data::TitleInfo *titleInfo) BackupMenuState::refresh(); } -BackupMenuState::~BackupMenuState() -{ - sm_slidePanel->clear_elements(); - sm_slidePanel->reset(); - sm_backupMenu->reset(); - - remote::Storage *remote = remote::get_remote_storage(); - if (remote) { remote->return_to_root(); } -} - void BackupMenuState::update() { const bool hasFocus = BaseState::has_focus(); @@ -84,7 +74,7 @@ void BackupMenuState::update() else if (uploadBackup) { BackupMenuState::upload_backup(); } else if (popEmpty) { BackupMenuState::pop_save_empty(); } else if (bPressed) { sm_slidePanel->close(); } - else if (sm_slidePanel->is_closed()) { BaseState::deactivate(); } + else if (sm_slidePanel->is_closed()) { BackupMenuState::deactivate_state(); } sm_backupMenu->update(hasFocus); } @@ -399,3 +389,15 @@ void BackupMenuState::pop_save_empty() const char *popEmpty = strings::get_by_name(strings::names::BACKUPMENU_POPS, 0); ui::PopMessageManager::push_message(ticks, popEmpty); } + +void BackupMenuState::deactivate_state() +{ + sm_slidePanel->clear_elements(); + sm_slidePanel->reset(); + sm_backupMenu->reset(); + + remote::Storage *remote = remote::get_remote_storage(); + if (remote) { remote->return_to_root(); } + + BaseState::deactivate(); +} diff --git a/source/appstates/BlacklistEditState.cpp b/source/appstates/BlacklistEditState.cpp index e221664..b663e67 100644 --- a/source/appstates/BlacklistEditState.cpp +++ b/source/appstates/BlacklistEditState.cpp @@ -16,12 +16,6 @@ BlacklistEditState::BlacklistEditState() BlacklistEditState::refresh_menu(); } -BlacklistEditState::~BlacklistEditState() -{ - sm_slidePanel->clear_elements(); - sm_slidePanel->reset(); -} - void BlacklistEditState::update() { const bool hasFocus = BaseState::has_focus(); @@ -32,7 +26,7 @@ void BlacklistEditState::update() if (aPressed) { BlacklistEditState::remove_from_blacklist(); } else if (bPressed) { sm_slidePanel->close(); } - else if (sm_slidePanel->is_closed()) { BaseState::deactivate(); } + else if (sm_slidePanel->is_closed()) { BlacklistEditState::deactivate_state(); } } void BlacklistEditState::render() @@ -84,3 +78,10 @@ void BlacklistEditState::remove_from_blacklist() MainMenuState::refresh_view_states(); BlacklistEditState::refresh_menu(); } + +void BlacklistEditState::deactivate_state() +{ + sm_slidePanel->clear_elements(); + sm_slidePanel->reset(); + BaseState::deactivate(); +} diff --git a/source/appstates/DataLoadingState.cpp b/source/appstates/DataLoadingState.cpp index bfda1e1..6b8cdc2 100644 --- a/source/appstates/DataLoadingState.cpp +++ b/source/appstates/DataLoadingState.cpp @@ -8,23 +8,18 @@ namespace constexpr int SCREEN_CENTER = 640; } -DataLoadingState::~DataLoadingState() -{ - // This is to catch stragglers. - m_context.process_icon_queue(); - if (m_destructFunction) { m_destructFunction(); } -} - void DataLoadingState::update() { static constexpr int SCREEN_CENTER = 640; - m_context.process_icon_queue(); - - BaseTask::update(); const std::string status = m_task->get_status(); const int statusWidth = sdl::text::get_width(22, status); m_statusX = SCREEN_CENTER - (statusWidth / 2); + + BaseTask::update_loading_glyph(); + if (!m_task->is_running()) { DataLoadingState::deactivate_state(); } + + m_context.process_icon_queue(); } void DataLoadingState::render() @@ -45,3 +40,11 @@ void DataLoadingState::initialize_static_members() sm_jksvIcon = sdl::TextureManager::load("LoadingIcon", "romfs:/Textures/LoadingIcon.png"); } + +void DataLoadingState::deactivate_state() +{ + // This is to catch any stragglers. + m_context.process_icon_queue(); + if (m_destructFunction) { m_destructFunction(); } + BaseState::deactivate(); +} diff --git a/source/appstates/MessageState.cpp b/source/appstates/MessageState.cpp index 0e24628..08a7b28 100644 --- a/source/appstates/MessageState.cpp +++ b/source/appstates/MessageState.cpp @@ -12,11 +12,6 @@ MessageState::MessageState(std::string_view message) MessageState::initialize_static_members(); } -MessageState::~MessageState() -{ - FadeState::create_and_push(colors::DIM_BACKGROUND, colors::ALPHA_FADE_END, colors::ALPHA_FADE_BEGIN, nullptr); -} - void MessageState::update() { // To do: I only use this in one place right now. I'm not sure this guards correctly here? @@ -24,7 +19,7 @@ void MessageState::update() m_triggerGuard = m_triggerGuard || (aPressed && !m_triggerGuard); const bool finished = m_triggerGuard && aPressed; - if (finished) { BaseState::deactivate(); } + if (finished) { MessageState::deactivate_state(); } } void MessageState::render() @@ -47,3 +42,9 @@ void MessageState::initialize_static_members() sm_okX = HALF_WIDTH - (sdl::text::get_width(22, sm_okText) / 2); sm_dialog = ui::DialogBox::create(280, 262, 720, 256); } + +void MessageState::deactivate_state() +{ + FadeState::create_and_push(colors::DIM_BACKGROUND, colors::ALPHA_FADE_END, colors::ALPHA_FADE_BEGIN, nullptr); + BaseState::deactivate(); +} diff --git a/source/appstates/ProgressState.cpp b/source/appstates/ProgressState.cpp index e7bad20..e1b8b37 100644 --- a/source/appstates/ProgressState.cpp +++ b/source/appstates/ProgressState.cpp @@ -22,15 +22,13 @@ namespace constexpr int SIZE_FONT_SIZE = 18; } -ProgressState::~ProgressState() { FadeState::create_and_push(colors::DIM_BACKGROUND, 0x88, 0x00, nullptr); } - void ProgressState::update() { sys::ProgressTask *task = static_cast(m_task.get()); const double current = task->get_progress(); - // Base routine. - BaseTask::update(); + BaseTask::update_loading_glyph(); + if (!m_task->is_running()) { ProgressState::deactivate_state(); } m_progressBarWidth = std::round(SIZE_BAR_WIDTH * current); m_progress = std::round(current * 100); @@ -68,3 +66,9 @@ void ProgressState::initialize_static_members() sm_dialog = ui::DialogBox::create(280, 262, 720, 256); } + +void ProgressState::deactivate_state() +{ + FadeState::create_and_push(colors::DIM_BACKGROUND, colors::ALPHA_FADE_END, colors::ALPHA_FADE_BEGIN, nullptr); + BaseState::deactivate(); +} diff --git a/source/appstates/SaveCreateState.cpp b/source/appstates/SaveCreateState.cpp index 4d571c6..15a6c0f 100644 --- a/source/appstates/SaveCreateState.cpp +++ b/source/appstates/SaveCreateState.cpp @@ -31,12 +31,6 @@ SaveCreateState::SaveCreateState(data::User *user, TitleSelectCommon *titleSelec SaveCreateState::initialize_menu(); } -SaveCreateState::~SaveCreateState() -{ - sm_slidePanel->clear_elements(); - sm_slidePanel->reset(); -} - void SaveCreateState::update() { const bool hasFocus = BaseState::has_focus(); @@ -56,7 +50,7 @@ void SaveCreateState::update() if (aPressed) { SaveCreateState::create_save_data_for(); } else if (bPressed) { sm_slidePanel->close(); } - else if (panelClosed) { BaseState::deactivate(); } + else if (panelClosed) { SaveCreateState::deactivate_state(); } } void SaveCreateState::render() @@ -102,6 +96,13 @@ void SaveCreateState::create_save_data_for() StateManager::push_state(createTask); } +void SaveCreateState::deactivate_state() +{ + sm_slidePanel->clear_elements(); + sm_slidePanel->reset(); + BaseState::deactivate(); +} + static bool compare_info(data::TitleInfo *infoA, data::TitleInfo *infoB) { // Get pointers to both titles. diff --git a/source/appstates/TaskState.cpp b/source/appstates/TaskState.cpp index eaeed24..6d3ec3d 100644 --- a/source/appstates/TaskState.cpp +++ b/source/appstates/TaskState.cpp @@ -7,9 +7,11 @@ #include "strings/strings.hpp" #include "ui/PopMessageManager.hpp" -TaskState::~TaskState() { FadeState::create_and_push(colors::DIM_BACKGROUND, 0x88, 0x00, nullptr); } - -void TaskState::update() { BaseTask::update(); } +void TaskState::update() +{ + BaseTask::update_loading_glyph(); + if (!m_task->is_running()) { TaskState::deactivate_state(); } +} void TaskState::render() { @@ -21,3 +23,9 @@ void TaskState::render() BaseTask::render_loading_glyph(); } + +void TaskState::deactivate_state() +{ + FadeState::create_and_push(colors::DIM_BACKGROUND, colors::ALPHA_FADE_END, colors::ALPHA_FADE_BEGIN, nullptr); + BaseState::deactivate(); +} diff --git a/source/appstates/TitleInfoState.cpp b/source/appstates/TitleInfoState.cpp index 5914bd7..82b1066 100644 --- a/source/appstates/TitleInfoState.cpp +++ b/source/appstates/TitleInfoState.cpp @@ -34,12 +34,6 @@ TitleInfoState::TitleInfoState(data::User *user, data::TitleInfo *titleInfo) TitleInfoState::create_info_scrolls(); } -TitleInfoState::~TitleInfoState() -{ - // Clear this so the next time it's called, the vector is cleared. - sm_slidePanel->clear_elements(); -} - void TitleInfoState::update() { // Grab this instead of calling the function over and over. @@ -49,11 +43,7 @@ void TitleInfoState::update() sm_slidePanel->update(hasFocus); if (input::button_pressed(HidNpadButton_B)) { sm_slidePanel->close(); } - else if (sm_slidePanel->is_closed()) - { - sm_slidePanel->reset(); - BaseState::deactivate(); - } + else if (sm_slidePanel->is_closed()) { TitleInfoState::deactivate_state(); } } void TitleInfoState::render() @@ -154,3 +144,10 @@ std::shared_ptr TitleInfoState::create_new_scroll(std::string_vi m_fieldClear = m_fieldClear ? false : true; return textFieldScroll; } + +void TitleInfoState::deactivate_state() +{ + sm_slidePanel->clear_elements(); + sm_slidePanel->reset(); + BaseState::deactivate(); +} diff --git a/source/appstates/TitleOptionState.cpp b/source/appstates/TitleOptionState.cpp index cc071ef..5fd7cce 100644 --- a/source/appstates/TitleOptionState.cpp +++ b/source/appstates/TitleOptionState.cpp @@ -52,12 +52,6 @@ TitleOptionState::TitleOptionState(data::User *user, data::TitleInfo *titleInfo, TitleOptionState::initialize_data_struct(); } -TitleOptionState::~TitleOptionState() -{ - sm_slidePanel->reset(); - sm_titleOptionMenu->set_selected(0); -} - void TitleOptionState::update() { const bool hasFocus = BaseState::has_focus(); @@ -98,7 +92,7 @@ void TitleOptionState::update() } } else if (bPressed) { sm_slidePanel->close(); } - else if (sm_slidePanel->is_closed()) { BaseState::deactivate(); } + else if (sm_slidePanel->is_closed()) { TitleOptionState::deactivate_state(); } } void TitleOptionState::render() @@ -171,7 +165,6 @@ void TitleOptionState::change_output_directory() const bool empty = std::char_traits::length(pathBuffer.data()) <= 0; if (!sanitized || empty) { - logger::log("here"); ui::PopMessageManager::push_message(popTicks, popFailed); return; } @@ -325,3 +318,10 @@ void TitleOptionState::export_svi_file() const char *popSuccess = strings::get_by_name(strings::names::TITLEOPTION_POPS, 4); ui::PopMessageManager::push_message(popTicks, popSuccess); } + +void TitleOptionState::deactivate_state() +{ + sm_slidePanel->reset(); + sm_titleOptionMenu->set_selected(0); + BaseState::deactivate(); +} diff --git a/source/appstates/UserOptionState.cpp b/source/appstates/UserOptionState.cpp index e3d3ff3..7302230 100644 --- a/source/appstates/UserOptionState.cpp +++ b/source/appstates/UserOptionState.cpp @@ -47,12 +47,6 @@ UserOptionState::UserOptionState(data::User *user, TitleSelectCommon *titleSelec UserOptionState::initialize_data_struct(); } -UserOptionState::~UserOptionState() -{ - sm_menuPanel->clear_elements(); - sm_menuPanel->reset(); -} - void UserOptionState::update() { const bool hasFocus = BaseState::has_focus(); @@ -81,7 +75,7 @@ void UserOptionState::update() } } else if (bPressed) { sm_menuPanel->close(); } - else if (sm_menuPanel->is_closed()) { BaseState::deactivate(); } + else if (sm_menuPanel->is_closed()) { UserOptionState::deactivate_state(); } } void UserOptionState::render() @@ -158,3 +152,10 @@ void UserOptionState::delete_all_save_data() const std::string queryString = stringutil::get_formatted_string(confirmFormat, nickname); TaskConfirm::create_and_push(queryString, true, tasks::useroptions::delete_all_save_data_for_user, m_dataStruct); } + +void UserOptionState::deactivate_state() +{ + sm_menuPanel->clear_elements(); + sm_menuPanel->reset(); + BaseState::deactivate(); +}