Changeset - r27414:a842cd485b96
[Not reviewed]
master
0 1 0
PeterN - 13 months ago 2023-05-22 07:03:20
peter1138@openttd.org
Change: Remember waypoint filter string. (#10857)
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/rail_gui.cpp
Show inline comments
 
@@ -2001,9 +2001,9 @@ struct BuildRailWaypointWindow : PickerW
 
	const StationClass *waypoints;
 
	WaypointList list;
 
	StringFilter string_filter; ///< Filter for waypoint name
 
	QueryString editbox;        ///< Filter editbox
 
	static QueryString editbox; ///< Filter editbox
 

	
 
	BuildRailWaypointWindow(WindowDesc *desc, Window *parent) : PickerWindowBase(desc, parent), editbox(FILTER_LENGTH * MAX_CHAR_LENGTH, FILTER_LENGTH)
 
	BuildRailWaypointWindow(WindowDesc *desc, Window *parent) : PickerWindowBase(desc, parent)
 
	{
 
		this->waypoints = StationClass::Get(STAT_CLASS_WAYP);
 

	
 
@@ -2016,6 +2016,7 @@ struct BuildRailWaypointWindow : PickerW
 

	
 
		this->querystrings[WID_BRW_FILTER] = &this->editbox;
 
		this->editbox.cancel_button = QueryString::ACTION_CLEAR;
 
		this->string_filter.SetFilterTerm(this->editbox.text.buf);
 

	
 
		this->list.ForceRebuild();
 
		this->BuildPickerList();
 
@@ -2170,6 +2171,8 @@ struct BuildRailWaypointWindow : PickerW
 
	}
 
};
 

	
 
/* static */ QueryString BuildRailWaypointWindow::editbox(BuildRailWaypointWindow::FILTER_LENGTH * MAX_CHAR_LENGTH, BuildRailWaypointWindow::FILTER_LENGTH);
 

	
 
/** Nested widget definition for the build NewGRF rail waypoint window */
 
static const NWidgetPart _nested_build_waypoint_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
0 comments (0 inline, 0 general)