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

View file

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

View file

@ -118,6 +118,12 @@ void NinePatchComponent::render(const Transform4x4f& parentTrans)
mVertices[0].shaders = Renderer::SHADER_OPACITY;
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();
Renderer::drawTriangleStrips(&mVertices[0], 6*9, trans);
}