forked from mirror/openmw-tes3mp
ESSImport: convert journal indices
This commit is contained in:
parent
6367b4dc0b
commit
875df46ae9
2 changed files with 20 additions and 2 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <components/esm/loadcrea.hpp>
|
||||
#include <components/esm/weatherstate.hpp>
|
||||
#include <components/esm/globalscript.hpp>
|
||||
#include <components/esm/queststate.hpp>
|
||||
|
||||
#include "importcrec.hpp"
|
||||
#include "importcntc.hpp"
|
||||
|
@ -431,7 +432,24 @@ public:
|
|||
std::string id = esm.getHNString("NAME");
|
||||
DIAL dial;
|
||||
dial.load(esm);
|
||||
if (dial.mIndex > 0)
|
||||
mDials[id] = dial;
|
||||
}
|
||||
virtual void write(ESM::ESMWriter &esm)
|
||||
{
|
||||
for (std::map<std::string, DIAL>::const_iterator it = mDials.begin(); it != mDials.end(); ++it)
|
||||
{
|
||||
esm.startRecord(ESM::REC_QUES);
|
||||
ESM::QuestState state;
|
||||
state.mFinished = 0;
|
||||
state.mState = it->second.mIndex;
|
||||
state.mTopic = Misc::StringUtils::lowerCase(it->first);
|
||||
state.save(esm);
|
||||
esm.endRecord(ESM::REC_QUES);
|
||||
}
|
||||
}
|
||||
private:
|
||||
std::map<std::string, DIAL> mDials;
|
||||
};
|
||||
|
||||
class ConvertQUES : public Converter
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace ESM
|
|||
|
||||
struct QuestState
|
||||
{
|
||||
std::string mTopic;
|
||||
std::string mTopic; // lower case id
|
||||
int mState;
|
||||
unsigned char mFinished;
|
||||
|
||||
|
@ -21,4 +21,4 @@ namespace ESM
|
|||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue