void DLGFile::readEntry(const GFFStruct &gff, Entry &entry) { entry.script = gff.getString("Script"); entry.line.speaker = gff.getString("Speaker"); gff.getLocString("Text", entry.line.text); entry.line.sound = gff.getString("Sound"); entry.line.animation = gff.getUint("Animation", 0); entry.line.quest = gff.getString("Quest"); entry.line.questEntry = gff.getUint("QuestEntry", 0xFFFFFFFF); uint32 repliesCount = 0; const GFFList *replies = 0; if (gff.hasField("RepliesList")) replies = &gff.getList("RepliesList", repliesCount); else if (gff.hasField("EntriesList")) replies = &gff.getList("EntriesList", repliesCount); if (replies) { entry.replies.reserve(repliesCount); readLinks(*replies, entry.replies); } entry.line.isEnd = entry.replies.empty(); }
void DLGFile::load(const GFFStruct &dlg) { // General properties _delayEntry = dlg.getUint("DelayEntry", 0); _delayReply = dlg.getUint("DelayReply", 0); _convAbort = dlg.getString("EndConverAbort"); _convEnd = dlg.getString("EndConversation"); _noZoomIn = !dlg.getBool("PreventZoomIn", true); // NPC lines ("entries") uint32 entryCount; const GFFList &entries = dlg.getList("EntryList", entryCount); _entriesNPC.reserve(entryCount); readEntries(entries, _entriesNPC, false); // PC lines ("replies") uint32 replyCount; const GFFList &replies = dlg.getList("ReplyList", replyCount); _entriesPC.reserve(replyCount); readEntries(replies, _entriesPC, true); // Starting lines (greetings) uint32 startCount; const GFFList &starters = dlg.getList("StartingList", startCount); _entriesStart.reserve(startCount); readLinks(starters, _entriesStart); }