Workaround to prevent the map drawing on top of the world button

This commit is contained in:
scrawl 2013-02-28 21:12:13 +01:00
parent 3efbb5e728
commit b7ab12e7cf
2 changed files with 22 additions and 0 deletions

View file

@ -6,6 +6,8 @@
#include <OgreTextureManager.h> #include <OgreTextureManager.h>
#include <OgreSceneNode.h> #include <OgreSceneNode.h>
#include <MyGUI_Gui.h>
#include "../mwbase/windowmanager.hpp" #include "../mwbase/windowmanager.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
@ -13,6 +15,8 @@
#include "../mwrender/globalmap.hpp" #include "../mwrender/globalmap.hpp"
#include "widgets.hpp"
using namespace MWGui; using namespace MWGui;
LocalMapBase::LocalMapBase() LocalMapBase::LocalMapBase()
@ -96,6 +100,7 @@ void LocalMapBase::applyFogOfWar()
: ""); : "");
} }
} }
notifyMapChanged ();
} }
void LocalMapBase::onMarkerFocused (MyGUI::Widget* w1, MyGUI::Widget* w2) void LocalMapBase::onMarkerFocused (MyGUI::Widget* w1, MyGUI::Widget* w2)
@ -425,3 +430,17 @@ void MapWindow::notifyPlayerUpdate ()
{ {
globalMapUpdatePlayer (); globalMapUpdatePlayer ();
} }
void MapWindow::notifyMapChanged ()
{
// workaround to prevent the map from drawing on top of the button
MyGUI::IntCoord oldCoord = mButton->getCoord ();
MyGUI::Gui::getInstance().destroyWidget (mButton);
mButton = mMainWidget->createWidget<MWGui::Widgets::AutoSizedButton>("MW_Button",
oldCoord, MyGUI::Align::Bottom | MyGUI::Align::Right);
mButton->setProperty ("ExpandDirection", "Left");
mButton->eventMouseButtonClick += MyGUI::newDelegate(this, &MapWindow::onWorldButtonClicked);
mButton->setCaptionWithReplacing( mGlobal ? "#{sLocal}" :
"#{sWorld}");
}

View file

@ -50,6 +50,7 @@ namespace MWGui
void onMarkerUnfocused(MyGUI::Widget* w1, MyGUI::Widget* w2); void onMarkerUnfocused(MyGUI::Widget* w1, MyGUI::Widget* w2);
virtual void notifyPlayerUpdate() {} virtual void notifyPlayerUpdate() {}
virtual void notifyMapChanged() {}
OEngine::GUI::Layout* mLayout; OEngine::GUI::Layout* mLayout;
@ -99,6 +100,8 @@ namespace MWGui
virtual void onPinToggled(); virtual void onPinToggled();
virtual void notifyPlayerUpdate(); virtual void notifyPlayerUpdate();
virtual void notifyMapChanged();
}; };
} }
#endif #endif