mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2024-12-23 19:41:49 +01:00
Reset active state in config menu when active selection is aborted (by pressing B or home)
This commit is contained in:
parent
3cf0f5d9fd
commit
99987df459
@ -5,7 +5,8 @@ ConfigDisplayItem::ConfigDisplayItem(GeneralConfigInformation &info,
|
|||||||
std::unique_ptr<WUPSConfigAPIBackend::WUPSConfig> config,
|
std::unique_ptr<WUPSConfigAPIBackend::WUPSConfig> config,
|
||||||
const bool isActive) : mConfig(std::move(config)),
|
const bool isActive) : mConfig(std::move(config)),
|
||||||
mInfo(std::move(info)),
|
mInfo(std::move(info)),
|
||||||
mIsActivePlugin(isActive) {
|
mIsActivePlugin(isActive),
|
||||||
|
mInitialIsActivePlugin(isActive) {
|
||||||
assert(mConfig);
|
assert(mConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,3 +25,7 @@ bool ConfigDisplayItem::isActivePlugin() const {
|
|||||||
void ConfigDisplayItem::toggleIsActivePlugin() {
|
void ConfigDisplayItem::toggleIsActivePlugin() {
|
||||||
mIsActivePlugin = !mIsActivePlugin;
|
mIsActivePlugin = !mIsActivePlugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConfigDisplayItem::resetIsActivePlugin() {
|
||||||
|
mIsActivePlugin = mInitialIsActivePlugin;
|
||||||
|
}
|
@ -24,8 +24,11 @@ public:
|
|||||||
|
|
||||||
void toggleIsActivePlugin();
|
void toggleIsActivePlugin();
|
||||||
|
|
||||||
|
void resetIsActivePlugin();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<WUPSConfigAPIBackend::WUPSConfig> mConfig;
|
std::unique_ptr<WUPSConfigAPIBackend::WUPSConfig> mConfig;
|
||||||
GeneralConfigInformation mInfo;
|
GeneralConfigInformation mInfo;
|
||||||
bool mIsActivePlugin;
|
bool mIsActivePlugin;
|
||||||
|
bool mInitialIsActivePlugin;
|
||||||
};
|
};
|
@ -120,6 +120,9 @@ ConfigSubState ConfigRenderer::UpdateStateMain(const Input &input) {
|
|||||||
}
|
}
|
||||||
} else if (input.data.buttons_d & (Input::eButtons::BUTTON_B | Input::eButtons::BUTTON_HOME)) {
|
} else if (input.data.buttons_d & (Input::eButtons::BUTTON_B | Input::eButtons::BUTTON_HOME)) {
|
||||||
if (mSetActivePluginsMode) {
|
if (mSetActivePluginsMode) {
|
||||||
|
for (auto &cur : mConfigs) {
|
||||||
|
cur.resetIsActivePlugin();
|
||||||
|
}
|
||||||
mNeedRedraw = true;
|
mNeedRedraw = true;
|
||||||
mSetActivePluginsMode = false;
|
mSetActivePluginsMode = false;
|
||||||
return SUB_STATE_RUNNING;
|
return SUB_STATE_RUNNING;
|
||||||
|
Loading…
Reference in New Issue
Block a user