forked from teamnwah/openmw-tes3coop
fix the global map updating when pinned
This commit is contained in:
parent
8daf790235
commit
71d04e16da
2 changed files with 16 additions and 0 deletions
|
@ -224,6 +224,9 @@ void LocalMapBase::setPlayerPos(const float x, const float y)
|
|||
{
|
||||
if (x == mLastPositionX && y == mLastPositionY)
|
||||
return;
|
||||
|
||||
notifyPlayerUpdate ();
|
||||
|
||||
MyGUI::IntSize size = mLocalMap->getCanvasSize();
|
||||
MyGUI::IntPoint middle = MyGUI::IntPoint((1/3.f + x/3.f)*size.width,(1/3.f + y/3.f)*size.height);
|
||||
MyGUI::IntCoord viewsize = mLocalMap->getCoord();
|
||||
|
@ -239,6 +242,9 @@ void LocalMapBase::setPlayerDir(const float x, const float y)
|
|||
{
|
||||
if (x == mLastDirectionX && y == mLastDirectionY)
|
||||
return;
|
||||
|
||||
notifyPlayerUpdate ();
|
||||
|
||||
MyGUI::ISubWidget* main = mCompass->getSubWidgetMain();
|
||||
MyGUI::RotatingSkin* rotatingSubskin = main->castType<MyGUI::RotatingSkin>();
|
||||
rotatingSubskin->setCenter(MyGUI::IntPoint(16,16));
|
||||
|
@ -407,3 +413,9 @@ void MapWindow::globalMapUpdatePlayer ()
|
|||
MyGUI::IntPoint viewoffs(0.5*viewsize.width - worldX, 0.5*viewsize.height - worldY);
|
||||
mGlobalMap->setViewOffset(viewoffs);
|
||||
}
|
||||
|
||||
void MapWindow::notifyPlayerUpdate ()
|
||||
{
|
||||
if (mGlobal)
|
||||
globalMapUpdatePlayer ();
|
||||
}
|
||||
|
|
|
@ -49,6 +49,8 @@ namespace MWGui
|
|||
void onMarkerFocused(MyGUI::Widget* w1, MyGUI::Widget* w2);
|
||||
void onMarkerUnfocused(MyGUI::Widget* w1, MyGUI::Widget* w2);
|
||||
|
||||
virtual void notifyPlayerUpdate() {}
|
||||
|
||||
OEngine::GUI::Layout* mLayout;
|
||||
|
||||
bool mMapDragAndDrop;
|
||||
|
@ -93,6 +95,8 @@ namespace MWGui
|
|||
|
||||
protected:
|
||||
virtual void onPinToggled();
|
||||
|
||||
virtual void notifyPlayerUpdate();
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue