Fix minor exploit when map window is shown with transparency

deque
scrawl 10 years ago
parent 2b5adb325b
commit 2c58a879ec

@ -844,6 +844,15 @@ namespace MWGui
}
}
void MapWindow::setAlpha(float alpha)
{
NoDrop::setAlpha(alpha);
// 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
for (std::vector<MyGUI::ImageBox*>::iterator it = mMapWidgets.begin(); it != mMapWidgets.end(); ++it)
(*it)->setVisible(alpha == 1);
}
// -------------------------------------------------------------------
EditNoteDialog::EditNoteDialog()

@ -171,6 +171,8 @@ namespace MWGui
void setCellName(const std::string& cellName);
virtual void setAlpha(float alpha);
void renderGlobalMap(Loading::Listener* loadingListener);
// adds the marker to the global map

@ -96,11 +96,16 @@ void NoDrop::onFrame(float dt)
if (mTransparent)
{
mWidget->setNeedMouseFocus(false); // Allow click-through
mWidget->setAlpha(std::max(0.13f, mWidget->getAlpha() - dt*5));
setAlpha(std::max(0.13f, mWidget->getAlpha() - dt*5));
}
else
{
mWidget->setNeedMouseFocus(true);
mWidget->setAlpha(std::min(1.0f, mWidget->getAlpha() + dt*5));
setAlpha(std::min(1.0f, mWidget->getAlpha() + dt*5));
}
}
void NoDrop::setAlpha(float alpha)
{
mWidget->setAlpha(alpha);
}

@ -55,6 +55,7 @@ namespace MWGui
NoDrop(DragAndDrop* drag, MyGUI::Widget* widget);
void onFrame(float dt);
virtual void setAlpha(float alpha);
private:
MyGUI::Widget* mWidget;

Loading…
Cancel
Save