Just like with mutations, i want ability to create tiles for bionics when it is installed on player or NPCs.
I ve been working on that in the past few days, but it's a slow process since I learn about c++ and CDDA's code as I go. Someone with more experience might pick it up and do it much faster
The relevant logic is player::get_overlay_ids() .
You'll want to add something like:
for( const bionic &bio: *my_bionics ) {
// this static cast is kind of gross
const trait_id bio_as_trait( static_cast<trait_id>( bio.id ) );
auto it = base_mutation_overlay_ordering.find( bio_as_trait );
auto it2 = tileset_mutation_overlay_ordering.find( bio_as_trait );
int value = 9999;
if( it != base_mutation_overlay_ordering.end() ) {
value = it->second;
}
if( it2 != tileset_mutation_overlay_ordering.end() ) {
value = it2->second;
}
mutation_sorting.insert( std::pair<int, std::string>( value, bio_as_trait.str() ) );
}
added between the existing get_mutations() for loop and the mutation_sorting for_loop. Then you'd just need to add the bionic overlays to the tileset data and everything else should fall into place, hopefully.
@Fris0uman, are you still working on this one? I'm interested in trying it if you're not.
Go ahead, sorry for the delay but real life got in the way of my progress
Most helpful comment
I ve been working on that in the past few days, but it's a slow process since I learn about c++ and CDDA's code as I go. Someone with more experience might pick it up and do it much faster