Skip to content

Commit

Permalink
Change item list highlight color to white (CleverRaven#51447)
Browse files Browse the repository at this point in the history
* Change item list highlight color to white

* Position the cursor on the selected item in the item list
  • Loading branch information
eltank authored and Venera3 committed Sep 21, 2021
1 parent e59ff40 commit 546fb2d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7119,11 +7119,11 @@ game::vmenu_ret game::list_items( const std::vector<map_item_stack> &item_list )
ui.on_redraw( [&]( const ui_adaptor & ) {
reset_item_list_state( w_items_border, iInfoHeight, sort_radius );

int iStartPos = 0;
if( ground_items.empty() ) {
wnoutrefresh( w_items_border );
mvwprintz( w_items, point( 2, 10 ), c_white, _( "You don't see any items around you!" ) );
} else {
int iStartPos = 0;
werase( w_items );
calcStartPos( iStartPos, iActive, iMaxRows, iItemNum );
int iNum = 0;
Expand Down Expand Up @@ -7167,15 +7167,15 @@ game::vmenu_ret game::list_items( const std::vector<map_item_stack> &item_list )
sText += string_format( "[%d]", iter->vIG[iThisPage].count );
}

nc_color col = c_light_green;
if( iNum != iActive ) {
if( high ) {
col = c_yellow;
} else if( low ) {
col = c_red;
} else {
col = iter->example->color_in_inventory();
}
nc_color col = c_light_gray;
if( iNum == iActive ) {
col = hilite( c_white );
} else if( high ) {
col = c_yellow;
} else if( low ) {
col = c_red;
} else {
col = iter->example->color_in_inventory();
}
trim_and_print( w_items, point( 1, iNum - iStartPos ), width - 9, col, sText );
const int numw = iItemNum > 9 ? 2 : 1;
Expand Down Expand Up @@ -7227,6 +7227,8 @@ game::vmenu_ret game::list_items( const std::vector<map_item_stack> &item_list )
activeItem->vIG[page_num].it->color_in_inventory(),
activeItem->vIG[page_num].it->display_name() );
wprintw( w_item_info, " >" );
// move the cursor to the selected item (for screen readers)
wmove( w_items, point( 1, iActive - iStartPos ) );
}

wnoutrefresh( w_items );
Expand Down

0 comments on commit 546fb2d

Please sign in to comment.