From 5ff3964642a7f4d333745371dfc23a6044100b18 Mon Sep 17 00:00:00 2001 From: Qrox Date: Wed, 29 Apr 2020 23:06:23 +0800 Subject: [PATCH] Remove uilist::refresh --- src/editmap.cpp | 3 --- src/ui.cpp | 10 +--------- src/ui.h | 1 - 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/editmap.cpp b/src/editmap.cpp index fd9f080b85bf4..d532fa4e88d7e 100644 --- a/src/editmap.cpp +++ b/src/editmap.cpp @@ -1298,7 +1298,6 @@ void editmap::edit_itm() pgettext( "item manipulation debug menu entry for adding an item on a tile", "Add item" ) ); ilmenu.setup(); ilmenu.filterlist(); - ilmenu.refresh(); } } while( ilmenu.ret != UILIST_CANCEL ); } @@ -1757,11 +1756,9 @@ void editmap::mapgen_preview( const real_coords &tc, uilist &gmenu ) if( gpmenu.ret_act == "LEFT" ) { gmenu.scrollby( -1 ); gmenu.show(); - gmenu.refresh(); } else if( gpmenu.ret_act == "RIGHT" ) { gmenu.scrollby( 1 ); gmenu.show(); - gmenu.refresh(); } } showpreview = gpmenu.ret == UILIST_TIMEOUT ? !showpreview : true; diff --git a/src/ui.cpp b/src/ui.cpp index 87a32bdd64f95..6f5a2022d7282 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -698,16 +698,8 @@ void uilist::show() } apply_scrollbar(); - this->refresh( true ); -} - -/** - * wrefresh + wrefresh callback's window - */ -void uilist::refresh( bool refresh_callback ) -{ wrefresh( window ); - if( refresh_callback && callback != nullptr ) { + if( callback != nullptr ) { callback->refresh( this ); } } diff --git a/src/ui.h b/src/ui.h index 46cda3a9401c9..498e50098058a 100644 --- a/src/ui.h +++ b/src/ui.h @@ -233,7 +233,6 @@ class uilist void query( bool loop = true, int timeout = -1 ); void filterlist(); void apply_scrollbar(); - void refresh( bool refresh_callback = true ); void addentry( const std::string &str ); void addentry( int r, bool e, int k, const std::string &str ); // K is templated so it matches a `char` literal and a `int` value.