mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-05 14:41:32 +00:00
Merge remote-tracking branch 'zini/master' into nif-fixes
This commit is contained in:
commit
ae5c0663f5
4 changed files with 50 additions and 13 deletions
|
@ -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}");
|
||||||
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -37,14 +37,14 @@ public:
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
int getVer() const { return mCtx.header.version; }
|
int getVer() const { return mCtx.header.version; }
|
||||||
float getFVer() { if(mCtx.header.version == VER_12) return 1.2; else return 1.3; }
|
float getFVer() const { if(mCtx.header.version == VER_12) return 1.2; else return 1.3; }
|
||||||
int getSpecial() { return mSpf; }
|
int getSpecial() const { return mSpf; }
|
||||||
int getType() { return mCtx.header.type; }
|
int getType() const { return mCtx.header.type; }
|
||||||
const std::string getAuthor() { return mCtx.header.author.toString(); }
|
const std::string getAuthor() const { return mCtx.header.author.toString(); }
|
||||||
const std::string getDesc() { return mCtx.header.desc.toString(); }
|
const std::string getDesc() const { return mCtx.header.desc.toString(); }
|
||||||
const SaveData &getSaveData() const { return mSaveData; }
|
const SaveData &getSaveData() const { return mSaveData; }
|
||||||
const MasterList &getMasters() { return mMasters; }
|
const MasterList &getMasters() const { return mMasters; }
|
||||||
const NAME &retSubName() { return mCtx.subName; }
|
const NAME &retSubName() const { return mCtx.subName; }
|
||||||
uint32_t getSubSize() const { return mCtx.leftSub; }
|
uint32_t getSubSize() const { return mCtx.leftSub; }
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
|
|
@ -7,12 +7,27 @@ namespace ESM
|
||||||
{
|
{
|
||||||
void Apparatus::load(ESMReader &esm)
|
void Apparatus::load(ESMReader &esm)
|
||||||
{
|
{
|
||||||
mModel = esm.getHNString("MODL");
|
// we will not treat duplicated subrecords as errors here
|
||||||
mName = esm.getHNString("FNAM");
|
while (esm.hasMoreSubs())
|
||||||
esm.getHNT(mData, "AADT", 16);
|
{
|
||||||
mScript = esm.getHNOString("SCRI");
|
esm.getSubName();
|
||||||
mIcon = esm.getHNString("ITEX");
|
NAME subName = esm.retSubName();
|
||||||
|
|
||||||
|
if (subName == "MODL")
|
||||||
|
mModel = esm.getHString();
|
||||||
|
else if (subName == "FNAM")
|
||||||
|
mName = esm.getHString();
|
||||||
|
else if (subName == "AADT")
|
||||||
|
esm.getHT(mData);
|
||||||
|
else if (subName == "SCRI")
|
||||||
|
mScript = esm.getHString();
|
||||||
|
else if (subName == "ITEX")
|
||||||
|
mIcon = esm.getHString();
|
||||||
|
else
|
||||||
|
esm.fail("wrong subrecord type " + subName.toString() + " for APPA record");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Apparatus::save(ESMWriter &esm)
|
void Apparatus::save(ESMWriter &esm)
|
||||||
{
|
{
|
||||||
esm.writeHNCString("MODL", mModel);
|
esm.writeHNCString("MODL", mModel);
|
||||||
|
|
Loading…
Reference in a new issue