summaryrefslogtreecommitdiff
path: root/src/station_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/station_gui.cpp')
-rw-r--r--src/station_gui.cpp38
1 files changed, 5 insertions, 33 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index 2e05722b4..d9535480c 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -168,39 +168,6 @@ static int CDECL StationRatingMaxSorter(const void *a, const void *b)
typedef GUIList<const Station*> GUIStationList;
/**
- * Set the station sort flag for all station-list windows.
- * @param sl_flag Sort list flag to set for all station-list windows
- */
-static void SetStationListsFlag(SortListFlags sl_flag)
-{
- Window *const *wz;
-
- FOR_ALL_WINDOWS(wz) {
- Window *w = *wz;
- if (w->window_class == WC_STATION_LIST) {
- dynamic_cast<GUIStationList*>(w)->flags |= sl_flag;
- w->SetDirty();
- }
- }
-}
-
-/**
- * Set the 'VL_REBUILD' flag for all station lists
- */
-void RebuildStationLists()
-{
- SetStationListsFlag(VL_REBUILD);
-}
-
-/**
- * Set the 'VL_RESORT' flag for all station lists
- */
-void ResortStationLists()
-{
- SetStationListsFlag(VL_RESORT);
-}
-
-/**
* Rebuild station list if the VL_REBUILD flag is set
*
* @param sl pointer to plstations_d (station list and flags)
@@ -605,6 +572,11 @@ struct PlayerStationsWindow : public Window, public GUIStationList
{
this->vscroll.cap += delta.y / 10;
}
+
+ virtual void OnInvalidateData(int data)
+ {
+ this->flags |= (data == 0 ? VL_REBUILD : VL_RESORT);
+ }
};
Listing PlayerStationsWindow::station_sort = {0, 0};