forked from mirror/OpenTTD
(svn r13165) -Codechange: replace some RebuildXXXList/ResortXXXList+InvalidateWindowXXX with InvalidateWindowXXXData.
This commit is contained in:
@@ -167,39 +167,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
|
||||
*
|
||||
@@ -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};
|
||||
|
Reference in New Issue
Block a user