Fix dwarfexport to use enum macros

develop
Quietust 2012-03-15 20:43:27 -05:00
parent 5464564ef6
commit aa7f13266b
1 changed files with 4 additions and 5 deletions

@ -110,7 +110,7 @@ static void printTraits(color_ostream &con, df::unit* cre, ostream& out)
{
FOR_ENUM_ITEMS(personality_facet_type,index)
{
out << " <Trait name='" << df::enums::personality_facet_type::get_key(index) <<
out << " <Trait name='" << ENUM_KEY_STR(personality_facet_type, index) <<
"' value='" << s->traits[index] << "'>";
//FIXME: needs reimplementing trait string generation
/*
@ -143,12 +143,11 @@ static void printLabors(color_ostream &con, df::unit* cre, ostream& out)
{
// Using British spelling here, consistent with Runesmith
out << " <Labours>" << endl;
for (int iCount = 0; iCount < sizeof(cre->status.labors); iCount++)
FOR_ENUM_ITEMS(unit_labor, iCount)
{
if (cre->status.labors[iCount]) {
// Get the caption for the labor index.
df::enums::unit_labor::unit_labor thisLabor = (df::enums::unit_labor::unit_labor)iCount;
element("Labour", get_caption(thisLabor), out);
element("Labour", ENUM_ATTR_STR(unit_labor, caption, iCount), out);
}
}
out << " </Labours>" << endl;
@ -158,7 +157,7 @@ static void printSkill(color_ostream &con, df::unit_skill* skill, ostream& out)
{
out << " <Skill>" << endl;
element("Name", get_caption(skill->id), out);
element("Name", ENUM_ATTR_STR(job_skill, caption, skill->id), out);
element("Level", skill->rating, out);
out << " </Skill>" << endl;