mirror of https://github.com/OpenRCT2/OpenRCT2.git
save object selection filter, closes #1599
This commit is contained in:
parent
b12b1b5faf
commit
dd107ee25c
|
@ -195,6 +195,7 @@ config_property_definition _interfaceDefinitions[] = {
|
|||
{ offsetof(interface_configuration, console_small_font), "console_small_font", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
|
||||
{ offsetof(interface_configuration, current_theme_preset), "current_theme", CONFIG_VALUE_TYPE_STRING, { .value_string = "*RCT2" }, NULL },
|
||||
{ offsetof(interface_configuration, current_title_sequence_preset), "current_title_sequence", CONFIG_VALUE_TYPE_STRING, { .value_string = "*OPENRCT2" },NULL },
|
||||
{ offsetof(interface_configuration, object_selection_filter_flags), "object_selection_filter_flags",CONFIG_VALUE_TYPE_UINT32, 0x7EF, NULL },
|
||||
};
|
||||
|
||||
config_property_definition _soundDefinitions[] = {
|
||||
|
|
|
@ -171,6 +171,7 @@ typedef struct {
|
|||
uint8 console_small_font;
|
||||
utf8string current_theme_preset;
|
||||
utf8string current_title_sequence_preset;
|
||||
uint32 object_selection_filter_flags;
|
||||
} interface_configuration;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -400,7 +400,7 @@ void window_editor_object_selection_open()
|
|||
(1 << WIDX_LIST_SORT_TYPE) |
|
||||
(1 << WIDX_LIST_SORT_RIDE);
|
||||
|
||||
_filter_flags = FILTER_ALL;
|
||||
_filter_flags = gConfigInterface.object_selection_filter_flags;
|
||||
memset(_filter_string, 0, sizeof(_filter_string));
|
||||
|
||||
for (int i = WIDX_TAB_1; i <= WIDX_TAB_11; i++)
|
||||
|
@ -793,6 +793,9 @@ static void window_editor_object_selection_mouseup(rct_window *w, int widgetInde
|
|||
break;
|
||||
case WIDX_FILTER_RIDE_TAB_ALL:
|
||||
_filter_flags |= 0x7E0;
|
||||
gConfigInterface.object_selection_filter_flags = _filter_flags;
|
||||
config_save_default();
|
||||
|
||||
filter_update_counts();
|
||||
visible_list_refresh(w);
|
||||
|
||||
|
@ -810,6 +813,8 @@ static void window_editor_object_selection_mouseup(rct_window *w, int widgetInde
|
|||
case WIDX_FILTER_RIDE_TAB_STALL:
|
||||
_filter_flags &= ~0x7E0;
|
||||
_filter_flags |= (1 << (widgetIndex - WIDX_FILTER_RIDE_TAB_TRANSPORT + 5));
|
||||
gConfigInterface.object_selection_filter_flags = _filter_flags;
|
||||
config_save_default();
|
||||
|
||||
filter_update_counts();
|
||||
visible_list_refresh(w);
|
||||
|
@ -914,6 +919,8 @@ static void window_editor_object_selection_dropdown(rct_window *w, int widgetInd
|
|||
switch (widgetIndex) {
|
||||
case WIDX_FILTER_DROPDOWN:
|
||||
_filter_flags ^= (1 << dropdownIndex);
|
||||
gConfigInterface.object_selection_filter_flags = _filter_flags;
|
||||
config_save_default();
|
||||
|
||||
filter_update_counts();
|
||||
w->scrolls->v_top = 0;
|
||||
|
|
Loading…
Reference in New Issue