From d2e8c2509eecccdd6c2732e021b7b2c5ee47a962 Mon Sep 17 00:00:00 2001 From: 8street Date: Thu, 2 Jan 2020 10:44:56 +0300 Subject: [PATCH] Fix extended pickup window (#36593) --- src/pickup.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pickup.cpp b/src/pickup.cpp index 288ea626d3f7b..73d76bf4df594 100644 --- a/src/pickup.cpp +++ b/src/pickup.cpp @@ -622,6 +622,7 @@ void Pickup::pick_up( const tripoint &p, int min, from_where get_items_from ) int selected = 0; int iScrollPos = 0; + std::string clear_buffer( pickupW, ' ' ); std::string filter; std::string new_filter; // Indexes of items that match the filter @@ -636,10 +637,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( raw_input_char ) - '0';