2011-04-08 13:58:21 +00:00
|
|
|
#include "loaddial.hpp"
|
|
|
|
|
2012-09-23 18:41:41 +00:00
|
|
|
#include "esmreader.hpp"
|
|
|
|
#include "esmwriter.hpp"
|
2013-09-24 11:17:28 +00:00
|
|
|
#include "defs.hpp"
|
2012-09-17 07:37:50 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2013-09-24 11:17:28 +00:00
|
|
|
unsigned int Dialogue::sRecordId = REC_DIAL;
|
2011-04-08 13:58:21 +00:00
|
|
|
|
|
|
|
void Dialogue::load(ESMReader &esm)
|
|
|
|
{
|
|
|
|
esm.getSubNameIs("DATA");
|
|
|
|
esm.getSubHeader();
|
|
|
|
int si = esm.getSubSize();
|
|
|
|
if (si == 1)
|
2012-09-17 07:37:50 +00:00
|
|
|
esm.getT(mType);
|
2011-04-08 13:58:21 +00:00
|
|
|
else if (si == 4)
|
|
|
|
{
|
|
|
|
// These are just markers, their values are not used.
|
|
|
|
int i;
|
|
|
|
esm.getT(i);
|
|
|
|
esm.getHNT(i, "DELE");
|
2012-09-17 07:37:50 +00:00
|
|
|
mType = Deleted;
|
2011-04-08 13:58:21 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
esm.fail("Unknown sub record size");
|
|
|
|
}
|
|
|
|
|
2013-09-16 10:32:35 +00:00
|
|
|
void Dialogue::save(ESMWriter &esm) const
|
2012-04-06 19:04:30 +00:00
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
if (mType != Deleted)
|
|
|
|
esm.writeHNT("DATA", mType);
|
2012-04-06 19:04:30 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
esm.writeHNT("DATA", (int)1);
|
|
|
|
esm.writeHNT("DELE", (int)1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-20 15:13:31 +00:00
|
|
|
void Dialogue::blank()
|
|
|
|
{
|
|
|
|
mInfo.clear();
|
|
|
|
}
|
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
}
|