Codechange: Optionally allow passing state to GUIList sorter function.

GUIList sorter functions can currently only use global state, which makes per-window-instance sorting difficult.
This commit is contained in:
Peter Nelson
2023-12-02 23:28:01 +00:00
committed by Peter Nelson
parent 4d9f335f36
commit dcf730f1f6
13 changed files with 67 additions and 43 deletions

View File

@@ -19,7 +19,7 @@
#include "window_gui.h"
#include "widgets/dropdown_type.h"
typedef GUIList<const Vehicle*, CargoID> GUIVehicleList;
typedef GUIList<const Vehicle*, std::nullptr_t, CargoID> GUIVehicleList;
struct GUIVehicleGroup {
VehicleList::const_iterator vehicles_begin; ///< Pointer to beginning element of this vehicle group.
@@ -62,7 +62,7 @@ struct GUIVehicleGroup {
}
};
typedef GUIList<GUIVehicleGroup, CargoID> GUIVehicleGroupList;
typedef GUIList<GUIVehicleGroup, std::nullptr_t, CargoID> GUIVehicleGroupList;
struct BaseVehicleListWindow : public Window {