void GFFLocation::read(const GFFStruct &strct) { _area = strct.getUint("Area"); _position[0] = strct.getDouble("PositionX"); _position[1] = strct.getDouble("PositionY"); _position[2] = strct.getDouble("PositionZ"); _orientation[0] = strct.getDouble("OrientationX"); _orientation[1] = strct.getDouble("OrientationY"); _orientation[2] = strct.getDouble("OrientationZ"); }
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); }
void GFFVariable::read(const GFFStruct &strct, Common::UString &name) { clear(); name = strct.getString("Name"); Type type = (Type) strct.getUint("Type", kTypeNone); if ((type <= kTypeNone) || (type > kTypeLocation)) throw Common::Exception("GFFVariable::read(): Unknown variable type %d", _type); if (type == kTypeInt ) { setInt(strct.getSint("Value")); } else if (type == kTypeFloat ) { setFloat(strct.getDouble("Value")); } else if (type == kTypeString ) { setString(strct.getString("Value")); } else if (type == kTypeObjectID) { setObjectID(strct.getUint("Value")); } else if (type == kTypeLocation) { _type = kTypeLocation; _value.typeLocation = new GFFLocation(); _value.typeLocation->read(strct.getStruct("Value")); } }
void DLGFile::readLink(const GFFStruct &gff, Link &link) { link.index = gff.getUint("Index", 0xFFFFFFFF); link.active = gff.getString("Active"); }
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(); }