Merge remote-tracking branch 'scrawl/master'
commit
1150b41c18
@ -0,0 +1,17 @@
|
|||||||
|
#include "convertscpt.hpp"
|
||||||
|
|
||||||
|
#include <components/misc/stringops.hpp>
|
||||||
|
|
||||||
|
#include "convertscri.hpp"
|
||||||
|
|
||||||
|
namespace ESSImport
|
||||||
|
{
|
||||||
|
|
||||||
|
void convertSCPT(const SCPT &scpt, ESM::GlobalScript &out)
|
||||||
|
{
|
||||||
|
out.mId = Misc::StringUtils::lowerCase(scpt.mSCHD.mName.toString());
|
||||||
|
out.mRunning = scpt.mRunning;
|
||||||
|
convertSCRI(scpt.mSCRI, out.mLocals);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
#ifndef OPENMW_ESSIMPORT_CONVERTSCPT_H
|
||||||
|
#define OPENMW_ESSIMPORT_CONVERTSCPT_H
|
||||||
|
|
||||||
|
#include <components/esm/globalscript.hpp>
|
||||||
|
|
||||||
|
#include "importscpt.hpp"
|
||||||
|
|
||||||
|
namespace ESSImport
|
||||||
|
{
|
||||||
|
|
||||||
|
void convertSCPT(const SCPT& scpt, ESM::GlobalScript& out);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -1,82 +0,0 @@
|
|||||||
#ifndef OPENMW_ESM_NPCC_H
|
|
||||||
#define OPENMW_ESM_NPCC_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
// TODO: create implementation files to remove this
|
|
||||||
#include "esmreader.hpp"
|
|
||||||
|
|
||||||
namespace ESM {
|
|
||||||
|
|
||||||
class ESMReader;
|
|
||||||
class ESMWriter;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* NPC change information (found in savegame files only). We can't
|
|
||||||
* read these yet.
|
|
||||||
*
|
|
||||||
* Some general observations about savegames:
|
|
||||||
*
|
|
||||||
* SCPT records do not define new scripts, but assign values to the
|
|
||||||
* variables of existing ones.
|
|
||||||
*
|
|
||||||
* VFXM, SPLM - no clue
|
|
||||||
*
|
|
||||||
* FMAP - MAPH and MAPD, global map image.
|
|
||||||
*
|
|
||||||
* JOUR - the entire journal in html
|
|
||||||
*
|
|
||||||
* QUES - seems to contain all the quests in the game, not just the
|
|
||||||
* ones you have done or begun.
|
|
||||||
*
|
|
||||||
* REGN - lists all regions in the game, even unvisited ones.
|
|
||||||
* notable differences to Regions in ESM files: mMapColor may be missing, and includes an unknown WNAM subrecord.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* The DIAL/INFO blocks contain changes to characters' dialog status.
|
|
||||||
*
|
|
||||||
* Dammit there's a lot of stuff in there! Should really have
|
|
||||||
* suspected as much. The strategy further is to completely ignore
|
|
||||||
* save files for the time being.
|
|
||||||
*
|
|
||||||
* Several records have a "change" variant, like NPCC, CNTC
|
|
||||||
* (contents), and CREC (creature.) These seem to alter specific
|
|
||||||
* instances of creatures, npcs, etc. I have not identified most of
|
|
||||||
* their subrecords yet.
|
|
||||||
*
|
|
||||||
* Several NPCC records have names that begin with "chargen ", I don't
|
|
||||||
* know if it means something special yet.
|
|
||||||
*
|
|
||||||
* The CNTC blocks seem to be instances of leveled lists. When a
|
|
||||||
* container is supposed to contain this leveled list of this type,
|
|
||||||
* but is referenced elsewhere in the file by an INDX, the CNTC with
|
|
||||||
* the corresponding leveled list identifier and INDX will determine
|
|
||||||
* the container contents instead.
|
|
||||||
*
|
|
||||||
* Some classes of objects seem to be altered, and these include an
|
|
||||||
* INDX, which is probably an index used by specific references other
|
|
||||||
* places within the save file. I guess this means 'use this class for
|
|
||||||
* these objects, not the general class.' All the indices I have
|
|
||||||
* encountered so far are zero, but they have been for different
|
|
||||||
* classes (different containers, really) so possibly we start from
|
|
||||||
* zero for each class. This looks like a mess, but is probably still
|
|
||||||
* easier than to duplicate everything. I think WRITING this format
|
|
||||||
* will be harder than reading it.
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct LoadNPCC
|
|
||||||
{
|
|
||||||
static unsigned int sRecordId;
|
|
||||||
|
|
||||||
std::string mId;
|
|
||||||
|
|
||||||
void load(ESMReader &esm)
|
|
||||||
{
|
|
||||||
esm.skipRecord();
|
|
||||||
}
|
|
||||||
void save(ESMWriter &esm) const
|
|
||||||
{
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -0,0 +1,58 @@
|
|||||||
|
#include "windowcaption.hpp"
|
||||||
|
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
|
namespace Gui
|
||||||
|
{
|
||||||
|
|
||||||
|
WindowCaption::WindowCaption()
|
||||||
|
: mLeft(NULL)
|
||||||
|
, mRight(NULL)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowCaption::initialiseOverride()
|
||||||
|
{
|
||||||
|
Base::initialiseOverride();
|
||||||
|
|
||||||
|
assignWidget(mLeft, "Left");
|
||||||
|
assignWidget(mRight, "Right");
|
||||||
|
|
||||||
|
assignWidget(mClient, "Client");
|
||||||
|
if (!mClient)
|
||||||
|
throw std::runtime_error("WindowCaption needs an EditBox Client widget in its skin");
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowCaption::setCaption(const MyGUI::UString &_value)
|
||||||
|
{
|
||||||
|
EditBox::setCaption(_value);
|
||||||
|
align();
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowCaption::setSize(const MyGUI::IntSize& _value)
|
||||||
|
{
|
||||||
|
Base::setSize(_value);
|
||||||
|
align();
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowCaption::setCoord(const MyGUI::IntCoord& _value)
|
||||||
|
{
|
||||||
|
Base::setCoord(_value);
|
||||||
|
align();
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowCaption::align()
|
||||||
|
{
|
||||||
|
MyGUI::IntSize textSize = getTextSize();
|
||||||
|
MyGUI::Widget* caption = mClient;
|
||||||
|
caption->setSize(textSize.width + 24, caption->getHeight());
|
||||||
|
|
||||||
|
int barwidth = (getWidth()-caption->getWidth())/2;
|
||||||
|
caption->setPosition(barwidth, caption->getTop());
|
||||||
|
if (mLeft)
|
||||||
|
mLeft->setCoord(0, mLeft->getTop(), barwidth, mLeft->getHeight());
|
||||||
|
if (mRight)
|
||||||
|
mRight->setCoord(barwidth + caption->getWidth(), mRight->getTop(), barwidth, mRight->getHeight());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
#ifndef OPENMW_WIDGETS_WINDOWCAPTION_H
|
||||||
|
#define OPENMW_WIDGETS_WINDOWCAPTION_H
|
||||||
|
|
||||||
|
#include <MyGUI_EditBox.h>
|
||||||
|
|
||||||
|
namespace Gui
|
||||||
|
{
|
||||||
|
|
||||||
|
/// Window caption that automatically adjusts "Left" and "Right" widgets in its skin
|
||||||
|
/// based on the text size of the caption in the middle
|
||||||
|
class WindowCaption : public MyGUI::EditBox
|
||||||
|
{
|
||||||
|
MYGUI_RTTI_DERIVED(WindowCaption)
|
||||||
|
public:
|
||||||
|
WindowCaption();
|
||||||
|
|
||||||
|
virtual void setCaption(const MyGUI::UString &_value);
|
||||||
|
virtual void initialiseOverride();
|
||||||
|
|
||||||
|
virtual void setSize(const MyGUI::IntSize& _value);
|
||||||
|
virtual void setCoord(const MyGUI::IntCoord& _value);
|
||||||
|
|
||||||
|
private:
|
||||||
|
MyGUI::Widget* mLeft;
|
||||||
|
MyGUI::Widget* mRight;
|
||||||
|
|
||||||
|
void align();
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue