Fixed a regression where the graying-out of menu entries didn't work.

This commit is contained in:
Leon Styhre 2020-09-27 14:41:59 +02:00
parent 6e2c8d4f32
commit 107c747374
3 changed files with 9 additions and 3 deletions

View file

@ -336,10 +336,11 @@ void Window::render()
} }
if (Settings::getInstance()->getString("MenuOpeningEffect") == "fade-in") { if (Settings::getInstance()->getString("MenuOpeningEffect") == "fade-in") {
// Fade-in menu. // Fade-in menu.
if (mTopOpacity < 255) if (mTopOpacity < 255) {
mTopOpacity = Math::clamp(mTopOpacity+15, 0, 255); mTopOpacity = Math::clamp(mTopOpacity+15, 0, 255);
top->setOpacity(mTopOpacity); top->setOpacity(mTopOpacity);
} }
}
#endif #endif
top->render(transform); top->render(transform);

View file

@ -229,7 +229,6 @@ void ComponentList::render(const Transform4x4f& parentTrans)
} }
} }
else { else {
it->component->setOpacity(mOpacity);
it->component->render(trans); it->component->render(trans);
} }
} }

View file

@ -118,6 +118,12 @@ void NinePatchComponent::render(const Transform4x4f& parentTrans)
mVertices[0].shaders = Renderer::SHADER_OPACITY; mVertices[0].shaders = Renderer::SHADER_OPACITY;
mVertices[0].opacity = mOpacity / 255.0; mVertices[0].opacity = mOpacity / 255.0;
} }
else if (mVertices[0].shaders & Renderer::SHADER_OPACITY) {
// We have reached full opacity, so disable the opacity shader and set
// the vertex opacity to 1.0.
mVertices[0].shaders ^= Renderer::SHADER_OPACITY;
mVertices[0].opacity = 1.0;
}
mTexture->bind(); mTexture->bind();
Renderer::drawTriangleStrips(&mVertices[0], 6*9, trans); Renderer::drawTriangleStrips(&mVertices[0], 6*9, trans);
} }