Send unit names over remotefortressreader

develop
Japa 2015-11-29 00:03:26 +05:30
parent 33302251c3
commit 23a5ce69bf
2 changed files with 7 additions and 0 deletions

@ -229,6 +229,9 @@ message UnitDefinition
optional uint32 flags3 = 10; optional uint32 flags3 = 10;
optional bool is_soldier = 11; optional bool is_soldier = 11;
optional BodySizeInfo size_info = 12; optional BodySizeInfo size_info = 12;
optional string name = 13;
optional int32 blood_max = 14;
optional int32 blood_count = 15;
} }
message UnitList message UnitList

@ -1343,6 +1343,10 @@ static command_result GetUnitList(color_ostream &stream, const EmptyMessage *in,
size_info->set_area_base(unit->body.size_info.area_base); size_info->set_area_base(unit->body.size_info.area_base);
size_info->set_length_cur(unit->body.size_info.length_cur); size_info->set_length_cur(unit->body.size_info.length_cur);
size_info->set_length_base(unit->body.size_info.length_base); size_info->set_length_base(unit->body.size_info.length_base);
if (unit->name.has_name)
{
send_unit->set_name(DF2UTF(Translation::TranslateName(Units::getVisibleName(unit))));
}
} }
return CR_OK; return CR_OK;
} }