From f605b026309c7fc7913d1d7f32828fb22bba256f Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 16 Oct 2022 17:47:17 +0200 Subject: [PATCH] Rename public interface config data members --- src/openrct2-ui/WindowManager.cpp | 2 +- src/openrct2-ui/input/Shortcuts.cpp | 2 +- src/openrct2-ui/interface/InGameConsole.cpp | 2 +- src/openrct2-ui/interface/Theme.cpp | 14 ++--- .../windows/EditorObjectSelection.cpp | 8 +-- src/openrct2-ui/windows/NewRide.cpp | 10 ++-- src/openrct2-ui/windows/Options.cpp | 43 +++++++------ src/openrct2-ui/windows/ScenarioSelect.cpp | 6 +- src/openrct2-ui/windows/TopToolbar.cpp | 14 ++--- src/openrct2/config/Config.cpp | 60 +++++++++---------- src/openrct2/config/Config.h | 28 ++++----- src/openrct2/interface/InteractiveConsole.cpp | 4 +- src/openrct2/title/TitleScreen.cpp | 12 ++-- 13 files changed, 102 insertions(+), 103 deletions(-) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 22b02b54de..f85dbefc06 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -159,7 +159,7 @@ public: case WV_FINANCES_RESEARCH: return WindowFinancesResearchOpen(); case WV_RIDE_RESEARCH: - if (gConfigInterface.toolbar_show_research) + if (gConfigInterface.ToolbarShowResearch) { return this->OpenWindow(WindowClass::Research); } diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index fe8f109219..f616e08ca3 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -832,7 +832,7 @@ void ShortcutManager::RegisterDefaultShortcuts() } }); RegisterShortcut(ShortcutId::InterfaceOpenTileInspector, STR_SHORTCUT_OPEN_TILE_INSPECTOR, []() { - if (gConfigInterface.toolbar_show_cheats) + if (gConfigInterface.ToolbarShowCheats) { OpenWindow(WindowClass::TileInspector); } diff --git a/src/openrct2-ui/interface/InGameConsole.cpp b/src/openrct2-ui/interface/InGameConsole.cpp index c7f28d462f..39d8602728 100644 --- a/src/openrct2-ui/interface/InGameConsole.cpp +++ b/src/openrct2-ui/interface/InGameConsole.cpp @@ -28,7 +28,7 @@ static InGameConsole _inGameConsole; static FontSpriteBase InGameConsoleGetFontSpriteBase() { - return (gConfigInterface.console_small_font ? FontSpriteBase::SMALL : FontSpriteBase::MEDIUM); + return (gConfigInterface.ConsoleSmallFont ? FontSpriteBase::SMALL : FontSpriteBase::MEDIUM); } static int32_t InGameConsoleGetLineHeight() diff --git a/src/openrct2-ui/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index 872cfdbdfe..e4696f0994 100644 --- a/src/openrct2-ui/interface/Theme.cpp +++ b/src/openrct2-ui/interface/Theme.cpp @@ -617,9 +617,9 @@ namespace ThemeManager ActiveAvailableThemeIndex = 1; bool configValid = false; - if (!String::IsNullOrEmpty(gConfigInterface.current_theme_preset)) + if (!String::IsNullOrEmpty(gConfigInterface.CurrentThemePreset)) { - if (LoadThemeByConfigName(gConfigInterface.current_theme_preset)) + if (LoadThemeByConfigName(gConfigInterface.CurrentThemePreset)) { configValid = true; } @@ -627,7 +627,7 @@ namespace ThemeManager if (!configValid) { - String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(1)); + String::DiscardDuplicate(&gConfigInterface.CurrentThemePreset, ThemeManagerGetAvailableThemeConfigName(1)); } } @@ -709,7 +709,7 @@ void ThemeManagerSetActiveAvailableTheme(size_t index) } } ThemeManager::ActiveAvailableThemeIndex = index; - String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(index)); + String::DiscardDuplicate(&gConfigInterface.CurrentThemePreset, ThemeManagerGetAvailableThemeConfigName(index)); ColourSchemeUpdateAll(); } @@ -805,7 +805,7 @@ void ThemeRename(const utf8* name) if (Path::Equals(newPath, ThemeManager::AvailableThemes[i].Path)) { ThemeManager::ActiveAvailableThemeIndex = i; - String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(1)); + String::DiscardDuplicate(&gConfigInterface.CurrentThemePreset, ThemeManagerGetAvailableThemeConfigName(1)); break; } } @@ -830,7 +830,7 @@ void ThemeDuplicate(const utf8* name) if (Path::Equals(newPath, ThemeManager::AvailableThemes[i].Path)) { ThemeManager::ActiveAvailableThemeIndex = i; - String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(i)); + String::DiscardDuplicate(&gConfigInterface.CurrentThemePreset, ThemeManagerGetAvailableThemeConfigName(i)); break; } } @@ -841,7 +841,7 @@ void ThemeDelete() File::Delete(ThemeManager::CurrentThemePath); ThemeManager::LoadTheme(const_cast(&PredefinedThemeRCT2)); ThemeManager::ActiveAvailableThemeIndex = 1; - String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(1)); + String::DiscardDuplicate(&gConfigInterface.CurrentThemePreset, ThemeManagerGetAvailableThemeConfigName(1)); } void ThemeManagerInitialise() diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 193398d350..fc07dededb 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -269,7 +269,7 @@ public: widgets[WIDX_FILTER_TEXT_BOX].string = _filter_string; - _filter_flags = gConfigInterface.object_selection_filter_flags; + _filter_flags = gConfigInterface.ObjectSelectionFilterFlags; std::fill_n(_filter_string, sizeof(_filter_string), 0x00); WindowInitScrollWidgets(*this); @@ -367,7 +367,7 @@ public: break; case WIDX_FILTER_RIDE_TAB_ALL: _filter_flags |= FILTER_RIDES; - gConfigInterface.object_selection_filter_flags = _filter_flags; + gConfigInterface.ObjectSelectionFilterFlags = _filter_flags; config_save_default(); FilterUpdateCounts(); @@ -385,7 +385,7 @@ public: case WIDX_FILTER_RIDE_TAB_STALL: _filter_flags &= ~FILTER_RIDES; _filter_flags |= (1 << (widgetIndex - WIDX_FILTER_RIDE_TAB_TRANSPORT + _numSourceGameItems)); - gConfigInterface.object_selection_filter_flags = _filter_flags; + gConfigInterface.ObjectSelectionFilterFlags = _filter_flags; config_save_default(); FilterUpdateCounts(); @@ -546,7 +546,7 @@ public: { _filter_flags ^= (1 << dropdownIndex); } - gConfigInterface.object_selection_filter_flags = _filter_flags; + gConfigInterface.ObjectSelectionFilterFlags = _filter_flags; config_save_default(); FilterUpdateCounts(); diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 73e0b82175..b95543133a 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -343,7 +343,7 @@ public: context_open_window_view(WV_FINANCES_RESEARCH); break; case WIDX_GROUP_BY_TRACK_TYPE: - gConfigInterface.list_ride_vehicles_separately = !gConfigInterface.list_ride_vehicles_separately; + gConfigInterface.ListRideVehiclesSeparately = !gConfigInterface.ListRideVehiclesSeparately; config_save_default(); SetPage(_currentTab); break; @@ -362,7 +362,7 @@ public: { SetPressedTab(); - if (!gConfigInterface.list_ride_vehicles_separately) + if (!gConfigInterface.ListRideVehiclesSeparately) pressed_widgets |= (1LL << WIDX_GROUP_BY_TRACK_TYPE); else pressed_widgets &= ~(1LL << WIDX_GROUP_BY_TRACK_TYPE); @@ -646,7 +646,7 @@ private: rct_ride_entry* rideEntry = get_ride_entry(rideEntryIndex); // Skip if the vehicle isn't the preferred vehicle for this generic track type - if (!gConfigInterface.list_ride_vehicles_separately + if (!gConfigInterface.ListRideVehiclesSeparately && !GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY) && highestVehiclePriority > rideEntry->BuildMenuPriority) { @@ -656,7 +656,7 @@ private: highestVehiclePriority = rideEntry->BuildMenuPriority; // Determines how and where to draw a button for this ride type/vehicle. - if (gConfigInterface.list_ride_vehicles_separately + if (gConfigInterface.ListRideVehiclesSeparately || GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) { // Separate, draw apart @@ -843,7 +843,7 @@ private: if (!_vehicleAvailability.empty()) { - if (gConfigInterface.list_ride_vehicles_separately) + if (gConfigInterface.ListRideVehiclesSeparately) { ft = Formatter(); ft.Add(rideEntry->naming.Name); diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index f1e4034af5..5ce23266ac 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -1549,43 +1549,43 @@ private: Invalidate(); break; case WIDX_TOOLBAR_SHOW_FINANCES: - gConfigInterface.toolbar_show_finances ^= 1; + gConfigInterface.ToolbarShowFinances ^= 1; config_save_default(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_RESEARCH: - gConfigInterface.toolbar_show_research ^= 1; + gConfigInterface.ToolbarShowResearch ^= 1; config_save_default(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_CHEATS: - gConfigInterface.toolbar_show_cheats ^= 1; + gConfigInterface.ToolbarShowCheats ^= 1; config_save_default(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_NEWS: - gConfigInterface.toolbar_show_news ^= 1; + gConfigInterface.ToolbarShowNews ^= 1; config_save_default(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_MUTE: - gConfigInterface.toolbar_show_mute ^= 1; + gConfigInterface.ToolbarShowMute ^= 1; config_save_default(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_CHAT: - gConfigInterface.toolbar_show_chat ^= 1; + gConfigInterface.ToolbarShowChat ^= 1; config_save_default(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_ZOOM: - gConfigInterface.toolbar_show_zoom ^= 1; + gConfigInterface.ToolbarShowZoom ^= 1; config_save_default(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); @@ -1647,13 +1647,13 @@ private: SetCheckboxValue(WIDX_TRAP_CURSOR, gConfigGeneral.TrapCursor); SetCheckboxValue(WIDX_INVERT_DRAG, gConfigGeneral.InvertViewportDrag); SetCheckboxValue(WIDX_ZOOM_TO_CURSOR, gConfigGeneral.ZoomToCursor); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_FINANCES, gConfigInterface.toolbar_show_finances); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_RESEARCH, gConfigInterface.toolbar_show_research); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHEATS, gConfigInterface.toolbar_show_cheats); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_NEWS, gConfigInterface.toolbar_show_news); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_MUTE, gConfigInterface.toolbar_show_mute); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHAT, gConfigInterface.toolbar_show_chat); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_ZOOM, gConfigInterface.toolbar_show_zoom); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_FINANCES, gConfigInterface.ToolbarShowFinances); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_RESEARCH, gConfigInterface.ToolbarShowResearch); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHEATS, gConfigInterface.ToolbarShowCheats); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_NEWS, gConfigInterface.ToolbarShowNews); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_MUTE, gConfigInterface.ToolbarShowMute); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHAT, gConfigInterface.ToolbarShowChat); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_ZOOM, gConfigInterface.ToolbarShowZoom); size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); const utf8* activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); @@ -1730,9 +1730,8 @@ private: { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], Dropdown::Flag::StayOpen, numItems); - auto selectedIndex = gConfigInterface.random_title_sequence - ? numItems - 1 - : static_cast(title_get_current_sequence()); + auto selectedIndex = gConfigInterface.RandomTitleSequence ? numItems - 1 + : static_cast(title_get_current_sequence()); Dropdown::SetChecked(selectedIndex, true); break; } @@ -1774,14 +1773,14 @@ private: auto numItems = static_cast(title_sequence_manager_get_count()); if (dropdownIndex < numItems && dropdownIndex != static_cast(title_get_current_sequence())) { - gConfigInterface.random_title_sequence = false; + gConfigInterface.RandomTitleSequence = false; title_sequence_change_preset(static_cast(dropdownIndex)); config_save_default(); Invalidate(); } else if (dropdownIndex == numItems + 1) { - gConfigInterface.random_title_sequence = true; + gConfigInterface.RandomTitleSequence = true; config_save_default(); Invalidate(); } @@ -1799,7 +1798,7 @@ private: if (dropdownIndex != gConfigGeneral.ScenarioSelectMode) { gConfigGeneral.ScenarioSelectMode = dropdownIndex; - gConfigInterface.scenarioselect_last_tab = 0; + gConfigInterface.ScenarioselectLastTab = 0; config_save_default(); Invalidate(); window_close_by_class(WindowClass::ScenarioSelect); @@ -1811,7 +1810,7 @@ private: void MiscPrepareDraw() { auto ft = Formatter::Common(); - if (gConfigInterface.random_title_sequence) + if (gConfigInterface.RandomTitleSequence) { ft.Add(STR_TITLE_SEQUENCE_RANDOM); } @@ -1903,7 +1902,7 @@ private: if (CsgAtLocationIsUsable(rct1path)) { gConfigGeneral.RCT1Path = std::move(rct1path); - gConfigInterface.scenarioselect_last_tab = 0; + gConfigInterface.ScenarioselectLastTab = 0; config_save_default(); context_show_error(STR_RESTART_REQUIRED, STR_NONE, {}); } diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 5ae7f30c0d..57667d09e8 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -221,9 +221,9 @@ static void WindowScenarioselectInitTabs(rct_window* w) } } - if (showPages & (1 << gConfigInterface.scenarioselect_last_tab)) + if (showPages & (1 << gConfigInterface.ScenarioselectLastTab)) { - w->selected_tab = gConfigInterface.scenarioselect_last_tab; + w->selected_tab = gConfigInterface.ScenarioselectLastTab; } else { @@ -271,7 +271,7 @@ static void WindowScenarioselectMousedown(rct_window* w, WidgetIndex widgetIndex { w->selected_tab = widgetIndex - 4; w->highlighted_scenario = nullptr; - gConfigInterface.scenarioselect_last_tab = w->selected_tab; + gConfigInterface.ScenarioselectLastTab = w->selected_tab; config_save_default(); InitialiseListItems(w); w->Invalidate(); diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index c7cb796e82..fced7ae47e 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -701,22 +701,22 @@ static void WindowTopToolbarInvalidate(rct_window* w) window_top_toolbar_widgets[WIDX_NEWS].type = WindowWidgetType::TrnBtn; window_top_toolbar_widgets[WIDX_NETWORK].type = WindowWidgetType::TrnBtn; - if (!gConfigInterface.toolbar_show_mute) + if (!gConfigInterface.ToolbarShowMute) window_top_toolbar_widgets[WIDX_MUTE].type = WindowWidgetType::Empty; - if (!gConfigInterface.toolbar_show_chat) + if (!gConfigInterface.ToolbarShowChat) window_top_toolbar_widgets[WIDX_CHAT].type = WindowWidgetType::Empty; - if (!gConfigInterface.toolbar_show_research) + if (!gConfigInterface.ToolbarShowResearch) window_top_toolbar_widgets[WIDX_RESEARCH].type = WindowWidgetType::Empty; - if (!gConfigInterface.toolbar_show_cheats) + if (!gConfigInterface.ToolbarShowCheats) window_top_toolbar_widgets[WIDX_CHEATS].type = WindowWidgetType::Empty; - if (!gConfigInterface.toolbar_show_news) + if (!gConfigInterface.ToolbarShowNews) window_top_toolbar_widgets[WIDX_NEWS].type = WindowWidgetType::Empty; - if (!gConfigInterface.toolbar_show_zoom) + if (!gConfigInterface.ToolbarShowZoom) { window_top_toolbar_widgets[WIDX_ZOOM_IN].type = WindowWidgetType::Empty; window_top_toolbar_widgets[WIDX_ZOOM_OUT].type = WindowWidgetType::Empty; @@ -727,7 +727,7 @@ static void WindowTopToolbarInvalidate(rct_window* w) window_top_toolbar_widgets[WIDX_PAUSE].type = WindowWidgetType::Empty; } - if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !gConfigInterface.toolbar_show_finances) + if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !gConfigInterface.ToolbarShowFinances) window_top_toolbar_widgets[WIDX_FINANCES].type = WindowWidgetType::Empty; if (gScreenFlags & SCREEN_FLAGS_EDITOR) diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index e55761e739..d315e8f19f 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -317,20 +317,20 @@ namespace Config if (reader->ReadSection("interface")) { auto model = &gConfigInterface; - model->toolbar_show_finances = reader->GetBoolean("toolbar_show_finances", true); - model->toolbar_show_research = reader->GetBoolean("toolbar_show_research", true); - model->toolbar_show_cheats = reader->GetBoolean("toolbar_show_cheats", false); - model->toolbar_show_news = reader->GetBoolean("toolbar_show_news", false); - model->toolbar_show_mute = reader->GetBoolean("toolbar_show_mute", false); - model->toolbar_show_chat = reader->GetBoolean("toolbar_show_chat", false); - model->toolbar_show_zoom = reader->GetBoolean("toolbar_show_zoom", true); - model->console_small_font = reader->GetBoolean("console_small_font", false); - model->current_theme_preset = reader->GetCString("current_theme", "*RCT2"); - model->current_title_sequence_preset = reader->GetCString("current_title_sequence", "*OPENRCT2"); - model->random_title_sequence = reader->GetBoolean("random_title_sequence", false); - model->object_selection_filter_flags = reader->GetInt32("object_selection_filter_flags", 0x3FFF); - model->scenarioselect_last_tab = reader->GetInt32("scenarioselect_last_tab", 0); - model->list_ride_vehicles_separately = reader->GetBoolean("list_ride_vehicles_separately", false); + model->ToolbarShowFinances = reader->GetBoolean("toolbar_show_finances", true); + model->ToolbarShowResearch = reader->GetBoolean("toolbar_show_research", true); + model->ToolbarShowCheats = reader->GetBoolean("toolbar_show_cheats", false); + model->ToolbarShowNews = reader->GetBoolean("toolbar_show_news", false); + model->ToolbarShowMute = reader->GetBoolean("toolbar_show_mute", false); + model->ToolbarShowChat = reader->GetBoolean("toolbar_show_chat", false); + model->ToolbarShowZoom = reader->GetBoolean("toolbar_show_zoom", true); + model->ConsoleSmallFont = reader->GetBoolean("console_small_font", false); + model->CurrentThemePreset = reader->GetCString("current_theme", "*RCT2"); + model->CurrentTitleSequencePreset = reader->GetCString("current_title_sequence", "*OPENRCT2"); + model->RandomTitleSequence = reader->GetBoolean("random_title_sequence", false); + model->ObjectSelectionFilterFlags = reader->GetInt32("object_selection_filter_flags", 0x3FFF); + model->ScenarioselectLastTab = reader->GetInt32("scenarioselect_last_tab", 0); + model->ListRideVehiclesSeparately = reader->GetBoolean("list_ride_vehicles_separately", false); } } @@ -338,20 +338,20 @@ namespace Config { auto model = &gConfigInterface; writer->WriteSection("interface"); - writer->WriteBoolean("toolbar_show_finances", model->toolbar_show_finances); - writer->WriteBoolean("toolbar_show_research", model->toolbar_show_research); - writer->WriteBoolean("toolbar_show_cheats", model->toolbar_show_cheats); - writer->WriteBoolean("toolbar_show_news", model->toolbar_show_news); - writer->WriteBoolean("toolbar_show_mute", model->toolbar_show_mute); - writer->WriteBoolean("toolbar_show_chat", model->toolbar_show_chat); - writer->WriteBoolean("toolbar_show_zoom", model->toolbar_show_zoom); - writer->WriteBoolean("console_small_font", model->console_small_font); - writer->WriteString("current_theme", model->current_theme_preset); - writer->WriteString("current_title_sequence", model->current_title_sequence_preset); - writer->WriteBoolean("random_title_sequence", model->random_title_sequence); - writer->WriteInt32("object_selection_filter_flags", model->object_selection_filter_flags); - writer->WriteInt32("scenarioselect_last_tab", model->scenarioselect_last_tab); - writer->WriteBoolean("list_ride_vehicles_separately", model->list_ride_vehicles_separately); + writer->WriteBoolean("toolbar_show_finances", model->ToolbarShowFinances); + writer->WriteBoolean("toolbar_show_research", model->ToolbarShowResearch); + writer->WriteBoolean("toolbar_show_cheats", model->ToolbarShowCheats); + writer->WriteBoolean("toolbar_show_news", model->ToolbarShowNews); + writer->WriteBoolean("toolbar_show_mute", model->ToolbarShowMute); + writer->WriteBoolean("toolbar_show_chat", model->ToolbarShowChat); + writer->WriteBoolean("toolbar_show_zoom", model->ToolbarShowZoom); + writer->WriteBoolean("console_small_font", model->ConsoleSmallFont); + writer->WriteString("current_theme", model->CurrentThemePreset); + writer->WriteString("current_title_sequence", model->CurrentTitleSequencePreset); + writer->WriteBoolean("random_title_sequence", model->RandomTitleSequence); + writer->WriteInt32("object_selection_filter_flags", model->ObjectSelectionFilterFlags); + writer->WriteInt32("scenarioselect_last_tab", model->ScenarioselectLastTab); + writer->WriteBoolean("list_ride_vehicles_separately", model->ListRideVehiclesSeparately); } static void ReadSound(IIniReader* reader) @@ -803,8 +803,8 @@ bool config_save(u8string_view path) void config_release() { SafeFree(gConfigGeneral.CustomCurrencySymbol); - SafeFree(gConfigInterface.current_theme_preset); - SafeFree(gConfigInterface.current_title_sequence_preset); + SafeFree(gConfigInterface.CurrentThemePreset); + SafeFree(gConfigInterface.CurrentTitleSequencePreset); SafeFree(gConfigFonts.file_name); SafeFree(gConfigFonts.font_name); } diff --git a/src/openrct2/config/Config.h b/src/openrct2/config/Config.h index 0ed70728ba..bcf9e896bd 100644 --- a/src/openrct2/config/Config.h +++ b/src/openrct2/config/Config.h @@ -121,20 +121,20 @@ struct GeneralConfiguration struct InterfaceConfiguration { - bool toolbar_show_finances; - bool toolbar_show_research; - bool toolbar_show_cheats; - bool toolbar_show_news; - bool toolbar_show_mute; - bool toolbar_show_chat; - bool toolbar_show_zoom; - bool console_small_font; - bool random_title_sequence; - utf8* current_theme_preset; - utf8* current_title_sequence_preset; - int32_t object_selection_filter_flags; - int32_t scenarioselect_last_tab; - bool list_ride_vehicles_separately; + bool ToolbarShowFinances; + bool ToolbarShowResearch; + bool ToolbarShowCheats; + bool ToolbarShowNews; + bool ToolbarShowMute; + bool ToolbarShowChat; + bool ToolbarShowZoom; + bool ConsoleSmallFont; + bool RandomTitleSequence; + utf8* CurrentThemePreset; + utf8* CurrentTitleSequencePreset; + int32_t ObjectSelectionFilterFlags; + int32_t ScenarioselectLastTab; + bool ListRideVehiclesSeparately; }; struct SoundConfiguration diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index ca660ef153..7ff95ca342 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -669,7 +669,7 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv) } else if (argv[0] == "console_small_font") { - console.WriteFormatLine("console_small_font %d", gConfigInterface.console_small_font); + console.WriteFormatLine("console_small_font %d", gConfigInterface.ConsoleSmallFont); } else if (argv[0] == "location") { @@ -1048,7 +1048,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) } else if (argv[0] == "console_small_font" && invalidArguments(&invalidArgs, int_valid[0])) { - gConfigInterface.console_small_font = (int_val[0] != 0); + gConfigInterface.ConsoleSmallFont = (int_val[0] != 0); config_save_default(); console.Execute("get console_small_font"); } diff --git a/src/openrct2/title/TitleScreen.cpp b/src/openrct2/title/TitleScreen.cpp index d4ea5bcf24..0fa285eb0b 100644 --- a/src/openrct2/title/TitleScreen.cpp +++ b/src/openrct2/title/TitleScreen.cpp @@ -201,8 +201,8 @@ void TitleScreen::ChangePresetSequence(size_t preset) } const utf8* configId = title_sequence_manager_get_config_id(preset); - SafeFree(gConfigInterface.current_title_sequence_preset); - gConfigInterface.current_title_sequence_preset = _strdup(configId); + SafeFree(gConfigInterface.CurrentTitleSequencePreset); + gConfigInterface.CurrentTitleSequencePreset = _strdup(configId); if (!_previewingSequence) _currentSequence = preset; @@ -229,7 +229,7 @@ void TitleScreen::TitleInitialise() { _sequencePlayer = GetContext()->GetUiContext()->GetTitleSequencePlayer(); } - if (gConfigInterface.random_title_sequence) + if (gConfigInterface.RandomTitleSequence) { bool RCT1Installed = false, RCT1AAInstalled = false, RCT1LLInstalled = false; int RCT1Count = 0; @@ -319,8 +319,8 @@ bool TitleScreen::TryLoadSequence(bool loadPreview) { // Forcefully change the preset to a preset that works. const utf8* configId = title_sequence_manager_get_config_id(targetSequence); - SafeFree(gConfigInterface.current_title_sequence_preset); - gConfigInterface.current_title_sequence_preset = _strdup(configId); + SafeFree(gConfigInterface.CurrentTitleSequencePreset); + gConfigInterface.CurrentTitleSequencePreset = _strdup(configId); } _currentSequence = targetSequence; gfx_invalidate_screen(); @@ -397,7 +397,7 @@ void title_set_hide_version_info(bool value) size_t title_get_config_sequence() { - return title_sequence_manager_get_index_for_config_id(gConfigInterface.current_title_sequence_preset); + return title_sequence_manager_get_index_for_config_id(gConfigInterface.CurrentTitleSequencePreset); } size_t title_get_current_sequence()