OpenTTD Source
20241125-master-g5b02f51e17
|
File for dealing with picker windows More...
#include "stdafx.h"
#include "core/backup_type.hpp"
#include "gui.h"
#include "hotkeys.h"
#include "ini_type.h"
#include "picker_gui.h"
#include "querystring_gui.h"
#include "settings_type.h"
#include "sortlist_type.h"
#include "sound_func.h"
#include "sound_type.h"
#include "string_func.h"
#include "stringfilter_type.h"
#include "strings_func.h"
#include "widget_type.h"
#include "window_func.h"
#include "window_gui.h"
#include "window_type.h"
#include "zoom_func.h"
#include "widgets/picker_widget.h"
#include "table/sprites.h"
#include <charconv>
#include "safeguards.h"
Go to the source code of this file.
Functions | |
static std::vector< PickerCallbacks * > & | GetPickerCallbacks () |
static void | PickerLoadConfig (const IniFile &ini, PickerCallbacks &callbacks) |
Load favourites of a picker from config. More... | |
static void | PickerSaveConfig (IniFile &ini, const PickerCallbacks &callbacks) |
Save favourites of a picker to config. More... | |
void | PickerLoadConfig (const IniFile &ini) |
Load favourites of all registered Pickers from config. More... | |
void | PickerSaveConfig (IniFile &ini) |
Save favourites of all registered Pickers to config. More... | |
static bool | ClassIDSorter (int const &a, int const &b) |
Sort classes by id. | |
static bool | ClassTagNameFilter (int const *item, PickerFilterData &filter) |
Filter classes by class name. | |
static bool | TypeIDSorter (PickerItem const &a, PickerItem const &b) |
Sort types by id. | |
static bool | TypeTagNameFilter (PickerItem const *item, PickerFilterData &filter) |
Filter types by class name. | |
std::unique_ptr< NWidgetBase > | MakePickerClassWidgets () |
Create nested widgets for the class picker widgets. | |
std::unique_ptr< NWidgetBase > | MakePickerTypeWidgets () |
Create nested widgets for the type picker widgets. | |
Variables | |
static const std::initializer_list< PickerClassList::SortFunction *const > | _class_sorter_funcs = { &ClassIDSorter } |
Sort functions of the PickerClassList. | |
static const std::initializer_list< PickerClassList::FilterFunction *const > | _class_filter_funcs = { &ClassTagNameFilter } |
Filter functions of the PickerClassList. | |
static const std::initializer_list< PickerTypeList::SortFunction *const > | _type_sorter_funcs = { TypeIDSorter } |
Sort functions of the PickerTypeList. | |
static const std::initializer_list< PickerTypeList::FilterFunction *const > | _type_filter_funcs = { TypeTagNameFilter } |
Filter functions of the PickerTypeList. | |
File for dealing with picker windows
Definition in file picker_gui.cpp.
void PickerLoadConfig | ( | const IniFile & | ini | ) |
Load favourites of all registered Pickers from config.
ini | IniFile to load to. |
Definition at line 109 of file picker_gui.cpp.
|
static |
Load favourites of a picker from config.
ini | IniFile to load to. |
callbacks | Picker to load. |
Definition at line 60 of file picker_gui.cpp.
References ConvertHexToBytes(), IniLoadFile::GetGroup(), PickerCallbacks::ini_group, IniGroup::items, IniItem::name, and PickerCallbacks::saved.
void PickerSaveConfig | ( | IniFile & | ini | ) |
Save favourites of all registered Pickers to config.
ini | IniFile to save to. |
Definition at line 118 of file picker_gui.cpp.
|
static |
Save favourites of a picker to config.
ini | IniFile to save to. |
callbacks | Picker to save. |
Definition at line 94 of file picker_gui.cpp.
References BSWAP32(), IniGroup::Clear(), IniGroup::CreateItem(), IniLoadFile::GetOrCreateGroup(), PickerCallbacks::ini_group, and PickerCallbacks::saved.