Skip to content
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

Fix extended pickup window #36593

Merged
merged 11 commits into from
Jan 2, 2020
13 changes: 10 additions & 3 deletions src/pickup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,11 @@ void Pickup::pick_up( const tripoint &p, int min, from_where get_items_from )
int selected = 0;
int iScrollPos = 0;

std::string clear_buffer;
8street marked this conversation as resolved.
Show resolved Hide resolved
for( int cur_column = 0; cur_column <= pickupW; cur_column += 10 ) {
clear_buffer += " ";
}

std::string filter;
std::string new_filter;
// Indexes of items that match the filter
Expand All @@ -636,10 +641,12 @@ void Pickup::pick_up( const tripoint &p, int min, from_where get_items_from )
const std::string pickup_chars =
ctxt.get_available_single_char_hotkeys( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:;" );
int idx = -1;
for( int i = 1; i < pickupH; i++ ) {
mvwprintw( w_pickup, point( 0, i ),
" " );

//clear all items names
for( int cur_row = 1; cur_row < pickupH; cur_row++ ) {
mvwprintw( w_pickup, point( 0, cur_row ), clear_buffer );
}

if( action == "ANY_INPUT" &&
raw_input_char >= '0' && raw_input_char <= '9' ) {
int raw_input_char_value = static_cast<char>( raw_input_char ) - '0';
Expand Down