added debug profile record
parent
3f6a7e36d0
commit
30f114873d
@ -0,0 +1,50 @@
|
||||
|
||||
#include "debugprofile.hpp"
|
||||
|
||||
#include "esmreader.hpp"
|
||||
#include "esmwriter.hpp"
|
||||
#include "defs.hpp"
|
||||
|
||||
unsigned int ESM::DebugProfile::sRecordId = REC_DBGP;
|
||||
|
||||
void ESM::DebugProfile::load (ESMReader& esm)
|
||||
{
|
||||
mDescription = esm.getHNString ("DESC");
|
||||
mScript = esm.getHNString ("SCRP");
|
||||
|
||||
int default_ = 0;
|
||||
esm.getHNOT (default_, "DEFA");
|
||||
|
||||
mDefault = default_!=0;
|
||||
|
||||
int bypass = 0;
|
||||
esm.getHNOT (bypass, "BYNG");
|
||||
|
||||
mBypassNewGame = bypass!=0;
|
||||
}
|
||||
|
||||
void ESM::DebugProfile::save (ESMWriter& esm) const
|
||||
{
|
||||
esm.writeHNCString ("DESC", mDescription);
|
||||
esm.writeHNCString ("SCRP", mScript);
|
||||
|
||||
if (mDefault)
|
||||
{
|
||||
int default_ = 1;
|
||||
esm.writeHNT ("DEFA", default_);
|
||||
}
|
||||
|
||||
if (mBypassNewGame)
|
||||
{
|
||||
int bypass = 1;
|
||||
esm.writeHNT ("BYNG", bypass);
|
||||
}
|
||||
}
|
||||
|
||||
void ESM::DebugProfile::blank()
|
||||
{
|
||||
mDescription.clear();
|
||||
mScript.clear();
|
||||
mDefault = false;
|
||||
mBypassNewGame = false;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
#ifndef COMPONENTS_ESM_DEBUGPROFILE_H
|
||||
#define COMPONENTS_ESM_DEBUGPROFILE_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
class ESMReader;
|
||||
class ESMWriter;
|
||||
|
||||
struct DebugProfile
|
||||
{
|
||||
static unsigned int sRecordId;
|
||||
|
||||
std::string mId;
|
||||
|
||||
std::string mDescription;
|
||||
|
||||
std::string mScript;
|
||||
|
||||
bool mDefault;
|
||||
|
||||
bool mBypassNewGame;
|
||||
|
||||
void load (ESMReader& esm);
|
||||
void save (ESMWriter& esm) const;
|
||||
|
||||
/// Set record to default state (does not touch the ID).
|
||||
void blank();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue