Skip to content

Commit

Permalink
style(autofix.ci): automated formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Dec 31, 2024
1 parent a78bffc commit 0c6b442
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
4 changes: 1 addition & 3 deletions data/raw/keybindings/keybindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1539,15 +1539,13 @@
"name": "Toggle safe fuel mod",
"bindings": [ { "input_method": "keyboard", "key": "S" } ]
},

{
{
"type": "keybinding",
"id": "TOGGLE_SPRITE",
"category": "BIONICS",
"name": "Toggle sprite",
"bindings": [ { "input_method": "keyboard", "key": "H" } ]
},

{
"type": "keybinding",
"id": "TOGGLE_AUTO_START",
Expand Down
6 changes: 3 additions & 3 deletions src/bionics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2931,7 +2931,7 @@ void bionic::serialize( JsonOut &json ) const
if( energy_stored > 0_kJ ) {
json.member( "energy_stored", energy_stored );
}
json.member("show_sprite", show_sprite);
json.member( "show_sprite", show_sprite );

json.end_object();
}
Expand All @@ -2956,8 +2956,8 @@ void bionic::deserialize( JsonIn &jsin )
if( jo.has_float( "auto_start_threshold" ) ) {
auto_start_threshold = jo.get_float( "auto_start_threshold" );
}
if (jo.has_bool("show_sprite")) {
show_sprite = jo.get_bool("show_sprite");
if( jo.has_bool( "show_sprite" ) ) {
show_sprite = jo.get_bool( "show_sprite" );
}
if( jo.has_array( "bionic_tags" ) ) {
for( const std::string line : jo.get_array( "bionic_tags" ) ) {
Expand Down
13 changes: 6 additions & 7 deletions src/bionics_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static void draw_bionics_titlebar( const catacurses::window &window, Character *
"[<color_yellow>%s</color>] Toggle sprite visibility, "
"[<color_yellow>%s</color>] Toggle auto start mode." ),
ctxt.get_desc( "REASSIGN" ), ctxt.get_desc( "NEXT_TAB" ), ctxt.get_desc( "TOGGLE_SAFE_FUEL" ),
ctxt.get_desc("TOGGLE_SPRITE"),
ctxt.get_desc( "TOGGLE_SPRITE" ),
ctxt.get_desc( "TOGGLE_AUTO_START" ) );
desc_append += string_format( _( " [<color_yellow>%s</color>] Sort: %s" ), ctxt.get_desc( "SORT" ),
sort_mode_str( uistate.bionic_sort_mode ) );
Expand Down Expand Up @@ -319,8 +319,8 @@ static std::string build_bionic_poweronly_string( const bionic &bio )
if( bio.incapacitated_time > 0_turns ) {
properties.emplace_back( _( "(incapacitated)" ) );
}
if (!bio.show_sprite) {
properties.emplace_back( _("(hidden)" ) );
if( !bio.show_sprite ) {
properties.emplace_back( _( "(hidden)" ) );
}
if( !bio.has_flag( flag_SAFE_FUEL_OFF ) && ( !bio.info().fuel_opts.empty() ||
bio.info().is_remote_fueled ) ) {
Expand Down Expand Up @@ -847,10 +847,9 @@ void show_bionics_ui( Character &who )
}
}

}
else if (action == "TOGGLE_SPRITE") {
auto& bio_list = tab_mode == TAB_ACTIVE ? active : passive;
if (!current_bionic_list->empty()) {
} else if( action == "TOGGLE_SPRITE" ) {
auto &bio_list = tab_mode == TAB_ACTIVE ? active : passive;
if( !current_bionic_list->empty() ) {
tmp = bio_list[cursor];
tmp->show_sprite = !tmp->show_sprite;
}
Expand Down
2 changes: 1 addition & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3664,7 +3664,7 @@ std::vector<std::string> Character::get_overlay_ids() const

// then get bionics
for( const bionic &bio : *my_bionics ) {
if (!bio.show_sprite) {
if( !bio.show_sprite ) {
continue;
}
overlay_id = ( bio.powered ? "active_" : "" ) + bio.id.str();
Expand Down

0 comments on commit 0c6b442

Please sign in to comment.