45 logger->
log1(
"Loading npc dialog database...");
54 XmlNodeConstPtrConst node)
58 if (!xmlTypeEqual(childNode, XML_ELEMENT_NODE))
61 if (xmlNameEqual(childNode,
"button"))
70 childNode,
"x", 0, 0, 10000);
72 childNode,
"y", 0, 0, 10000);
74 button->
value = value;
76 if (button->
name.empty() && button->
image.empty())
83 childNode,
"imageWidth", 16, 1, 1000);
85 childNode,
"imageHeight", 16, 1, 1000);
88 else if (xmlNameEqual(childNode,
"image"))
93 reportAlways(
"Error: no image attribute found in image tag.")
97 imageInfo->
name = image;
99 childNode,
"x", 0, 0, 10000);
101 childNode,
"y", 0, 0, 10000);
104 else if (xmlNameEqual(childNode,
"text"))
109 reportAlways(
"Error: no text attribute found in text tag.")
113 textInfo->
text = text;
115 childNode,
"x", 0, 0, 10000);
117 childNode,
"y", 0, 0, 10000);
119 childNode,
"width", 20, 10, 10000);
121 childNode,
"height", 20, 10, 10000);
128 XmlNodePtrConst node)
132 node,
"columns", 10000, 1, 10000);
136 XmlNodeConstPtrConst node)
140 if (xmlNameEqual(childNode,
"menu"))
144 else if (xmlNameEqual(childNode,
"inventory"))
158 XmlNodeConstPtrConst root = doc->
rootNode();
167 if (xmlNameEqual(node,
"dialog"))
177 node,
"hideText",
false);
181 else if (xmlNameEqual(node,
"include"))
209 logger->
log1(
"Unloading npc dialog database...");
static void loadXmlFile(const std::string &file, const std::string &name, BadgesInfos &arr, const SkipError skipError)
#define loadXmlDir(name, function)
#define reportAlways(...)
std::string getStringValue(const std::string &key) const
void log1(const char *const log_text)
void delete_all(Container &c)
#define FOR_EACH(type, iter, array)
#define for_each_xml_child_node(var, parent)
void loadXmlFile(const std::string &fileName, const SkipError skipError)
Dialogs::iterator DialogsIter
void deleteDialog(const std::string &name)
std::map< std::string, NpcDialogInfo * > Dialogs
NpcDialogInfo * getDialog(const std::string &name)
bool getBoolProperty(const xmlNodePtr node, const char *const name, const bool def)
int getProperty(const xmlNodePtr node, const char *const name, int def)
int getIntProperty(const xmlNodePtr node, const char *const name, int def, const int min, const int max)
NpcDialogDB::Dialogs mDialogs
static void loadNpcDialogMenu(NpcDialogInfo *const dialog, const xmlNode *const node)
static void loadNpcDialog(NpcDialogInfo *const dialog, const xmlNode *const node)
static void loadNpcDialogInventory(NpcDialogInfo *const dialog, xmlNode *const node)
const bool SkipError_false
const bool SkipError_true
NpcInventoryInfo inventory
const bool UseVirtFs_true