New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set tiles for installed CBMs #27548

Closed
SomeDeadGuy opened this Issue Jan 11, 2019 · 4 comments

Comments

Projects
None yet
4 participants
@SomeDeadGuy
Copy link

SomeDeadGuy commented Jan 11, 2019

Just like with mutations, i want ability to create tiles for bionics when it is installed on player or NPCs.

@Fris0uman

This comment has been minimized.

Copy link
Contributor

Fris0uman commented Jan 11, 2019

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

@mlangsdorf

This comment has been minimized.

Copy link
Contributor

mlangsdorf commented Jan 11, 2019

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.

@halfahermit

This comment has been minimized.

Copy link
Contributor

halfahermit commented Jan 13, 2019

@Fris0uman, are you still working on this one? I'm interested in trying it if you're not.

@Fris0uman

This comment has been minimized.

Copy link
Contributor

Fris0uman commented Jan 14, 2019

Go ahead, sorry for the delay but real life got in the way of my progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment