Properly account for map tile visibility

This commit is contained in:
Evil Eye 2025-09-11 17:03:06 +02:00
parent 6e45e562a8
commit d6ce23aba7

View File

@ -603,7 +603,7 @@ namespace MWGui
bool needRedraw = false; bool needRedraw = false;
for (MapEntry& entry : mMaps) for (MapEntry& entry : mMaps)
{ {
if (widgetCropped(entry.mMapWidget, mLocalMap)) if (!entry.mMapWidget->getVisible() || widgetCropped(entry.mMapWidget, mLocalMap))
continue; continue;
if (!entry.mMapTexture) if (!entry.mMapTexture)
@ -748,6 +748,8 @@ namespace MWGui
const auto size = MyGUI::IntSize(std::ceil(mapWidgetSize), std::ceil(mapWidgetSize)); const auto size = MyGUI::IntSize(std::ceil(mapWidgetSize), std::ceil(mapWidgetSize));
for (auto& entry : mMaps) for (auto& entry : mMaps)
{ {
if (!entry.mMapWidget->getVisible())
continue;
const auto position = getPosition(entry.mCellX, entry.mCellY, 0, 0); const auto position = getPosition(entry.mCellX, entry.mCellY, 0, 0);
entry.mMapWidget->setCoord({ position, size }); entry.mMapWidget->setCoord({ position, size });
entry.mFogWidget->setCoord({ position, size }); entry.mFogWidget->setCoord({ position, size });
@ -1377,8 +1379,7 @@ namespace MWGui
NoDrop::setAlpha(alpha); NoDrop::setAlpha(alpha);
// can't allow showing map with partial transparency, as the fog of war will also go transparent // can't allow showing map with partial transparency, as the fog of war will also go transparent
// and reveal parts of the map you shouldn't be able to see // and reveal parts of the map you shouldn't be able to see
for (MapEntry& entry : mMaps) mLocalMap->setVisible(alpha == 1);
entry.mMapWidget->setVisible(alpha == 1);
} }
void MapWindow::customMarkerCreated(MyGUI::Widget* marker) void MapWindow::customMarkerCreated(MyGUI::Widget* marker)