本文整理汇总了C++中SkillInfo::setIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ SkillInfo::setIcon方法的具体用法?C++ SkillInfo::setIcon怎么用?C++ SkillInfo::setIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkillInfo
的用法示例。
在下文中一共展示了SkillInfo::setIcon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadSkills
void SkillDialog::loadSkills()
{
clearSkills();
XML::Document doc(SKILLS_FILE);
xmlNodePtr root = doc.rootNode();
int setCount = 0;
std::string setName;
ScrollArea *scroll;
SkillListBox *listbox;
SkillTab *tab;
if (!root || !xmlStrEqual(root->name, BAD_CAST "skills"))
{
logger->log("Error loading skills file: %s", SKILLS_FILE);
if (Net::getNetworkType() == ServerInfo::TMWATHENA)
{
SkillModel *model = new SkillModel();
SkillInfo *skill = new SkillInfo;
skill->id = 1;
skill->name = "basic";
skill->setIcon("");
skill->modifiable = true;
skill->visible = true;
skill->model = model;
skill->update();
model->addSkill(skill);
mSkills[1] = skill;
model->updateVisibilities();
listbox = new SkillListBox(model);
scroll = new ScrollArea(listbox);
scroll->setOpaque(false);
scroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER);
scroll->setVerticalScrollPolicy(ScrollArea::SHOW_ALWAYS);
tab = new SkillTab("Skills", listbox);
mTabs->addTab(tab, scroll);
update();
}
return;
}
for_each_xml_child_node(set, root)
{
if (xmlStrEqual(set->name, BAD_CAST "set"))
{
setCount++;
setName = XML::getProperty(set, "name", strprintf(_("Skill Set %d"), setCount));
SkillModel *model = new SkillModel();
for_each_xml_child_node(node, set)
{
if (xmlStrEqual(node->name, BAD_CAST "skill"))
{
int id = atoi(XML::getProperty(node, "id", "-1").c_str());
std::string name = XML::getProperty(node, "name", strprintf(_("Skill %d"), id));
std::string icon = XML::getProperty(node, "icon", "");
SkillInfo *skill = new SkillInfo;
skill->id = id;
skill->name = name;
skill->setIcon(icon);
skill->modifiable = false;
skill->visible = false;
skill->model = model;
skill->update();
model->addSkill(skill);
mSkills[id] = skill;
}
}
model->updateVisibilities();
listbox = new SkillListBox(model);
scroll = new ScrollArea(listbox);
scroll->setOpaque(false);
scroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER);
scroll->setVerticalScrollPolicy(ScrollArea::SHOW_ALWAYS);
tab = new SkillTab(setName, listbox);
mTabs->addTab(tab, scroll);
}
}