46 _owner(owner), _ended(true) {
58 _owner(owner), _ended(true) {
152 for (std::vector<Link>::const_iterator e =
_entriesStart.begin();
155 std::vector<Entry>::const_iterator line =
_entriesNPC.begin() + e->index;
156 if (!line->replies.empty() || !
runScript(e->active))
199 for (GFF3List::const_iterator e = list.begin(); e != list.end(); ++e) {
200 entries.push_back(
Entry());
202 Entry &entry = entries.back();
206 entry.
line.
id = entries.size() - 1;
213 for (GFF3List::const_iterator l = list.begin(); l != list.end(); ++l) {
214 links.push_back(
Link());
239 replies = &gff.
getList(
"RepliesList");
240 else if (gff.
hasField(
"EntriesList"))
241 replies = &gff.
getList(
"EntriesList");
244 entry.
replies.reserve(replies->size());
258 std::vector<Entry>::iterator &active) {
262 for (std::vector<Link>::const_iterator e = entries.begin(); e != entries.end(); ++e) {
276 std::vector<const Line *> &active) {
280 active.reserve(entries.size());
281 for (std::vector<Link>::const_iterator e = entries.begin(); e != entries.end(); ++e) {
290 return !active.empty();
302 return retVal.
getInt() != 0;
Handling version V3.2/V3.3 of BioWare's GFFs (generic file format).
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
uint32 getDelayReply() const
Return the number of seconds to wait before showing each reply.
void pickReply(uint32 id)
void readEntry(const GFF3Struct &gff, Entry &entry)
std::vector< Entry > _entriesNPC
NPC dialog lines ("entries").
bool getBool(const Common::UString &field, bool def=false) const
bool getLocString(const Common::UString &field, LocString &str) const
DLGFile(Common::SeekableReadStream *dlg, NWScript::Object *owner=0, bool repairNWNPremium=false)
Take over this stream and read a DLG file out of it.
A class holding an UTF-8 string.
std::vector< const Line * > _currentReplies
The current replies.
void readLink(const GFF3Struct &gff, Link &link)
Common::UString active
Script that determines if this link is active.
bool hasField(const Common::UString &field) const
Does this specific field exist?
NWScript::Object * _owner
std::vector< Link > replies
Reply lines.
const GFF3Struct & getTopLevel() const
Returns the top-level struct.
uint64 getUint(const Common::UString &field, uint64 def=0) const
bool _noZoomIn
Starting the conversation does not zoom the camera onto the speaker.
An NCS, BioWare's NWN Compile Script.
bool evaluateEntries(const std::vector< Link > &entries, std::vector< Entry >::iterator &active)
Common::UString sound
ResRef of the sound to play while speaking this entry.
void exceptionDispatcherWarning(const char *s,...)
Exception dispatcher that prints the exception as a warning, and adds another reason on top...
Common::UString voice
ResRef of the voice over for KotOR games.
uint32 index
Index into the entries/replies.
const Line * getOneLiner() const
Return the first active non-branching entry.
bool getNoZoomIn() const
Does starting the conversation zoom in the camera onto the speaker or not?
Basic exceptions to throw.
Line line
The line's contents.
const char * c_str() const
Return the (utf8 encoded) string data.
const Variable & run(Object *owner=0, Object *triggerer=0)
Run the current script, from start to finish.
uint32 id
ID of this line (entry-local).
bool isPC
Is this a PC or NPC line?
void readEntries(const GFF3List &list, std::vector< Entry > &entries, bool isPC)
A GFF (generic file format) V3.2/V3.3 file, found in all Aurora games except Sonic Chronicles: The Da...
bool runScript(const Common::UString &script) const
bool empty() const
Is the string empty?
uint32 _delayReply
Number of seconds to wait before showing each reply.
void load(const GFF3Struct &dlg)
Common::UString _convAbort
Script to run when the conversation was aborted.
static const uint32 kDLGID
uint32 questEntry
Entry ID to set the quest to.
Common::UString _convEnd
Script to run when the conversation ended normally.
std::vector< Entry > _entriesPC
PC dialog lines ("replies").
Common::UString quest
Quest name to modify when speaking this entry.
const std::vector< const Line * > & getCurrentReplies() const
Basic reading stream interfaces.
std::vector< const GFF3Struct * > GFF3List
Handling BioWare's NWN Compiled Scripts.
static const uint32 kEndLine
bool isEnd
Are there no replies to this line?
const GFF3List & getList(const Common::UString &field) const
bool _ended
Has the conversation ended?
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
std::vector< Link > _entriesStart
NPC starting lines (greetings).
uint32 _delayEntry
Number of seconds to wait before showing each entry.
void readLinks(const GFF3List &list, std::vector< Link > &links)
uint32 getDelayEntry() const
Return the number of seconds to wait before showing each entry.
uint32 animation
Animation to play while speaking this entry.
Handling BioWare's DLGs (dialog / conversation files).
Interface for a seekable & readable data stream.
static const uint32 kInvalidLine
std::vector< Entry >::iterator _currentEntry
The current entry.
Common::UString speaker
Tag of the speaker, empty if default.
Common::UString script
Script to run when speaking this entry.
LocString text
The actual text of the entry.
const Line * getCurrentEntry() const
bool evaluateReplies(const std::vector< Link > &entries, std::vector< const Line *> &active)