mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 22:25:38 +00:00
GridComponent item opacity is now adjusted for hidden entries and entries marked as not being games.
This commit is contained in:
parent
74162f1740
commit
f6c8921132
|
@ -525,20 +525,35 @@ template <typename T> void GridComponent<T>::render(const glm::mat4& parentTrans
|
||||||
if (mLastCursor != mCursor)
|
if (mLastCursor != mCursor)
|
||||||
renderEntries.emplace_back(mCursor);
|
renderEntries.emplace_back(mCursor);
|
||||||
|
|
||||||
float opacity {mUnfocusedItemOpacity};
|
|
||||||
float scale {1.0f};
|
float scale {1.0f};
|
||||||
|
float opacity {1.0f};
|
||||||
|
|
||||||
trans[3].y -= (mItemSize.y + mItemSpacing.y) * mScrollPos;
|
trans[3].y -= (mItemSize.y + mItemSpacing.y) * mScrollPos;
|
||||||
mRenderer->setMatrix(trans);
|
mRenderer->setMatrix(trans);
|
||||||
|
|
||||||
for (auto it = renderEntries.cbegin(); it != renderEntries.cend(); ++it) {
|
for (auto it = renderEntries.cbegin(); it != renderEntries.cend(); ++it) {
|
||||||
|
float metadataOpacity {1.0f};
|
||||||
|
|
||||||
|
if constexpr (std::is_same_v<T, FileData*>) {
|
||||||
|
// If a game is marked as hidden, lower the opacity a lot.
|
||||||
|
// If a game is marked to not be counted, lower the opacity a moderate amount.
|
||||||
|
if (mEntries.at(*it).object->getHidden())
|
||||||
|
metadataOpacity = 0.4f;
|
||||||
|
else if (!mEntries.at(*it).object->getCountAsGame())
|
||||||
|
metadataOpacity = 0.7f;
|
||||||
|
}
|
||||||
|
|
||||||
|
opacity = mUnfocusedItemOpacity * metadataOpacity;
|
||||||
|
|
||||||
if (*it == static_cast<size_t>(mCursor)) {
|
if (*it == static_cast<size_t>(mCursor)) {
|
||||||
scale = glm::mix(1.0f, mItemScale, mTransitionFactor);
|
scale = glm::mix(1.0f, mItemScale, mTransitionFactor);
|
||||||
opacity = glm::mix(mUnfocusedItemOpacity, 1.0f, mTransitionFactor);
|
opacity = glm::mix(mUnfocusedItemOpacity * metadataOpacity, 1.0f * metadataOpacity,
|
||||||
|
mTransitionFactor);
|
||||||
}
|
}
|
||||||
else if (*it == static_cast<size_t>(mLastCursor)) {
|
else if (*it == static_cast<size_t>(mLastCursor)) {
|
||||||
scale = glm::mix(mItemScale, 1.0f, mTransitionFactor);
|
scale = glm::mix(mItemScale, 1.0f, mTransitionFactor);
|
||||||
opacity = glm::mix(1.0f, mUnfocusedItemOpacity, mTransitionFactor);
|
opacity = glm::mix(1.0f * metadataOpacity, mUnfocusedItemOpacity * metadataOpacity,
|
||||||
|
mTransitionFactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
mEntries.at(*it).data.item->setScale(scale);
|
mEntries.at(*it).data.item->setScale(scale);
|
||||||
|
|
Loading…
Reference in a new issue