Send appearance info over remotefortressreader.cpp

develop
Japa 2016-06-20 22:59:59 +05:30
parent b338d0218e
commit 5fff0efec5
2 changed files with 40 additions and 0 deletions

@ -253,6 +253,14 @@ message BodySizeInfo
optional int32 length_base = 6; /*!< (size_base*10000)^0.333 */
}
message UnitAppearance
{
repeated int32 body_modifiers = 1;
repeated int32 bp_modifiers = 2;
optional int32 size_modifier = 3;
}
message UnitDefinition
{
required int32 id = 1;
@ -270,6 +278,7 @@ message UnitDefinition
optional string name = 13;
optional int32 blood_max = 14;
optional int32 blood_count = 15;
}
message UnitList
@ -434,6 +443,9 @@ message RegionMaps
message BodyPartLayerRaw
{
optional string layer_name = 1;
optional int32 tissue_id = 2;
optional int32 layer_depth = 3;
repeated int32 bp_modifiers = 4;
}
message BodyPartRaw
@ -446,6 +458,11 @@ message BodyPartRaw
optional int32 relsize = 6;
}
message BpAppearanceModifier
{
optional string type = 1;
}
message CasteRaw
{
optional int32 index = 1;
@ -456,6 +473,10 @@ message CasteRaw
optional int32 gender = 6;
repeated BodyPartRaw body_parts = 7;
optional int32 total_relsize = 8;
repeated BpAppearanceModifier modifiers = 9;
repeated int32 modifier_idx = 10;
repeated int32 part_idx = 11;
repeated int32 layer_idx = 12;
}
message CreatureRaw

@ -2306,12 +2306,31 @@ static command_result GetCreatureRaws(color_ostream &stream, const EmptyMessage
auto send_layer = send_part->add_layers();
send_layer->set_layer_name(orig_layer->layer_name);
send_layer->set_tissue_id(orig_layer->tissue_id);
send_layer->set_layer_depth(orig_layer->layer_depth);
for (int layerModIndex = 0; layerModIndex < orig_layer->bp_modifiers.size(); layerModIndex++)
{
send_layer->add_bp_modifiers(orig_layer->bp_modifiers[layerModIndex]);
}
}
send_part->set_relsize(orig_part->relsize);
}
send_caste->set_total_relsize(orig_caste->body_info.total_relsize);
for (int k = 0; k < orig_caste->bp_appearance.modifiers.size(); k++)
{
auto send_mod = send_caste->add_modifiers();
auto orig_mod = orig_caste->bp_appearance.modifiers[k];
send_mod->set_type(ENUM_KEY_STR(appearance_modifier_type, orig_mod->type));
}
for (int k = 0; k < orig_caste->bp_appearance.modifier_idx.size(); k++)
{
send_caste->add_modifier_idx(orig_caste->bp_appearance.modifier_idx[k]);
send_caste->add_part_idx(orig_caste->bp_appearance.part_idx[k]);
send_caste->add_layer_idx(orig_caste->bp_appearance.layer_idx[k]);
}
}
}