save object selection filter, closes #1599

This commit is contained in:
IntelOrca 2015-07-24 20:15:13 +01:00
parent b12b1b5faf
commit dd107ee25c
3 changed files with 10 additions and 1 deletions

View File

@ -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[] = {

View File

@ -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 {

View File

@ -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;