ConfigMenu: Fix calling onCloseCallback for item which are not in a category

This commit is contained in:
Maschell 2024-02-24 15:16:52 +01:00
parent 823c94ca9c
commit 3a91c90e76
2 changed files with 9 additions and 1 deletions

View File

@ -84,7 +84,7 @@ ConfigSubState ConfigRenderer::UpdateStateMain(const Input &input) {
} else if (input.data.buttons_d & (Input::eButtons::BUTTON_B | Input::eButtons::BUTTON_HOME)) {
mCategoryRenderer.reset();
for (const auto &element : mConfigs) {
CallOnCloseCallback(element.getConfigInformation(), element.getConfig().getCategories());
CallOnCloseCallback(element.getConfigInformation(), element.getConfig());
}
return SUB_STATE_RETURN;
}
@ -152,3 +152,10 @@ void ConfigRenderer::CallOnCloseCallback(const GeneralConfigInformation &info, c
}
}
}
void ConfigRenderer::CallOnCloseCallback(const GeneralConfigInformation &info, const WUPSConfigAPIBackend::WUPSConfig &config) {
CallOnCloseCallback(info, config.getCategories());
for (const auto &item : config.getItems()) {
item->onCloseCallback();
}
}

View File

@ -39,4 +39,5 @@ private:
int32_t mRenderOffset = 0;
int32_t mCurrentOpen = -1;
void CallOnCloseCallback(const GeneralConfigInformation &info, const std::vector<std::unique_ptr<WUPSConfigAPIBackend::WUPSConfigCategory>> &categories);
void CallOnCloseCallback(const GeneralConfigInformation &info, const WUPSConfigAPIBackend::WUPSConfig &config);
};