From dc12648a3efd8da82e148d2610536753434eff73 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Mon, 21 Oct 2013 14:26:54 +0200 Subject: [PATCH] add fixed dialogue records when creating a new omwgame file --- apps/opencs/model/doc/document.cpp | 73 ++++++++++++++++++++++++++++++ apps/opencs/model/world/data.cpp | 6 +-- apps/opencs/model/world/data.hpp | 4 +- 3 files changed, 78 insertions(+), 5 deletions(-) diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index d7138f6714..64f627b5aa 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -2137,6 +2137,79 @@ void CSMDoc::Document::createBase() getData().getSkills().add (record); } + + static const char *sVoice[] = + { + "Intruder", + "Attack", + "Hello", + "Thief", + "Alarm", + "Idle", + "Flee", + "Hit", + 0 + }; + + for (int i=0; sVoice[i]; ++i) + { + ESM::Dialogue record; + record.mId = sVoice[i]; + record.mType = ESM::Dialogue::Voice; + record.blank(); + + getData().getTopics().add (record); + } + + static const char *sGreetings[] = + { + "Greeting 0", + "Greeting 1", + "Greeting 2", + "Greeting 3", + "Greeting 4", + "Greeting 5", + "Greeting 6", + "Greeting 7", + "Greeting 8", + "Greeting 9", + 0 + }; + + for (int i=0; sGreetings[i]; ++i) + { + ESM::Dialogue record; + record.mId = sGreetings[i]; + record.mType = ESM::Dialogue::Greeting; + record.blank(); + + getData().getTopics().add (record); + } + + static const char *sPersuasion[] = + { + "Intimidate Success", + "Intimidate Fail", + "Service Refusal", + "Admire Success", + "Taunt Success", + "Bribe Success", + "Info Refusal", + "Admire Fail", + "Taunt Fail", + "Bribe Fail", + 0 + }; + + for (int i=0; sPersuasion[i]; ++i) + { + ESM::Dialogue record; + record.mId = sPersuasion[i]; + record.mType = ESM::Dialogue::Persuasion; + record.blank(); + + getData().getTopics().add (record); + } } CSMDoc::Document::Document (const std::vector& files, diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index 70e0e891db..c854711b13 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -330,12 +330,12 @@ CSMWorld::IdCollection& CSMWorld::Data::getSpells() } -const CSMWorld::IdCollection& CSMWorld::Data::getTopcis() const +const CSMWorld::IdCollection& CSMWorld::Data::getTopics() const { return mTopics; } -CSMWorld::IdCollection& CSMWorld::Data::getTopcis() +CSMWorld::IdCollection& CSMWorld::Data::getTopics() { return mTopics; } @@ -525,7 +525,7 @@ bool CSMWorld::Data::hasId (const std::string& id) const getRegions().searchId (id)!=-1 || getBirthsigns().searchId (id)!=-1 || getSpells().searchId (id)!=-1 || - getTopcis().searchId (id)!=-1 || + getTopics().searchId (id)!=-1 || getJournals().searchId (id)!=-1 || getCells().searchId (id)!=-1 || getReferenceables().searchId (id)!=-1; diff --git a/apps/opencs/model/world/data.hpp b/apps/opencs/model/world/data.hpp index 74304e029b..cf31c94947 100644 --- a/apps/opencs/model/world/data.hpp +++ b/apps/opencs/model/world/data.hpp @@ -119,9 +119,9 @@ namespace CSMWorld IdCollection& getSpells(); - const IdCollection& getTopcis() const; + const IdCollection& getTopics() const; - IdCollection& getTopcis(); + IdCollection& getTopics(); const IdCollection& getJournals() const;