diff --git a/source/utils/config/CategoryRenderer.cpp b/source/utils/config/CategoryRenderer.cpp index 795dfe2..87877fc 100644 --- a/source/utils/config/CategoryRenderer.cpp +++ b/source/utils/config/CategoryRenderer.cpp @@ -95,6 +95,7 @@ ConfigSubState CategoryRenderer::UpdateStateMain(Input &input, const WUPSConfigS mCurrentOpen = mCursorPos; mState = STATE_SUB; mNeedsRedraw = true; + return SUB_STATE_RUNNING; } } } @@ -149,7 +150,7 @@ ConfigSubState CategoryRenderer::UpdateStateMain(Input &input, const WUPSConfigS void CategoryRenderer::ResetNeedsRedraw() { mNeedsRedraw = false; - if (mState == STATE_SUB && mSubCategoryRenderer) { + if (mSubCategoryRenderer) { mSubCategoryRenderer->ResetNeedsRedraw(); } for (auto &item : mItemRenderer) { @@ -162,7 +163,7 @@ bool CategoryRenderer::NeedsRedraw() const { if (mNeedsRedraw) { return true; } - if (mState == STATE_SUB && mSubCategoryRenderer) { + if (mSubCategoryRenderer) { if (mSubCategoryRenderer->NeedsRedraw()) { return true; } diff --git a/source/utils/config/ConfigRenderer.cpp b/source/utils/config/ConfigRenderer.cpp index 4b63a35..d38e79c 100644 --- a/source/utils/config/ConfigRenderer.cpp +++ b/source/utils/config/ConfigRenderer.cpp @@ -66,6 +66,7 @@ void ConfigRenderer::drawConfigEntry(uint32_t yOffset, const GeneralConfigInform ConfigSubState ConfigRenderer::UpdateStateMain(const Input &input) { if (mConfigs.empty()) { + mNeedRedraw = true; return SUB_STATE_ERROR; } auto prevSelectedItem = mCursorPos; @@ -80,10 +81,12 @@ ConfigSubState ConfigRenderer::UpdateStateMain(const Input &input) { mCategoryRenderer.reset(); mCategoryRenderer = make_unique_nothrow(&(mConfigs[mCursorPos].getConfigInformation()), &(mConfigs[mCursorPos].getConfig()), true); } + mNeedRedraw = true; mCurrentOpen = mCursorPos; mState = STATE_SUB; return SUB_STATE_RUNNING; } else if (input.data.buttons_d & (Input::eButtons::BUTTON_B | Input::eButtons::BUTTON_HOME)) { + mNeedRedraw = true; mCategoryRenderer.reset(); for (const auto &element : mConfigs) { CallOnCloseCallback(element.getConfigInformation(), element.getConfig()); @@ -114,7 +117,7 @@ ConfigSubState ConfigRenderer::UpdateStateMain(const Input &input) { bool ConfigRenderer::NeedsRedraw() const { if (mNeedRedraw) { return true; - } else if (mState == STATE_SUB && mCategoryRenderer) { + } else if (mCategoryRenderer) { return mCategoryRenderer->NeedsRedraw(); } return false; @@ -122,12 +125,11 @@ bool ConfigRenderer::NeedsRedraw() const { void ConfigRenderer::ResetNeedsRedraw() { mNeedRedraw = false; - if (mState == STATE_SUB && mCategoryRenderer) { + if (mCategoryRenderer) { mCategoryRenderer->ResetNeedsRedraw(); } } - void ConfigRenderer::Render() const { switch (mState) { case STATE_MAIN: