mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 14:24:33 +01:00
Clean-up OptionsWindow (#16529)
* Rename OptionsWindow tab constants for clarity The new WIDX_FIRST_TAB constant can be used by code that just wants the first tab without worrying about which it is. * Remove use of this-> in OptionsWindow * Replace widget_invalidate with InvalidateWidget * WidgetSetCheckboxValue -> SetCheckboxValue * Move repeated per-tab code into common methods Previously, each FooPrepareDraw() method would call CommonPrepareDrawBefore() at the start, and CommonPrepareDrawAfter() at the end. Let's reduce this duplication by having OnPrepareDraw() call these instead. :^) The same goes for a few other repeated code snippets. * Use WindowFocusOrCreate for OptionsWindow * Fix #16504: Display RCT1-path tooltip When the OptionsWindow was first refactored into a Window class, the AdvancedTooltip() method was created but never called. Hooking it up fixes the crash and makes the path tooltip appear again. :^) * Make MAIN_OPTIONS_ENABLED_WIDGETS a constexpr * Move OptionsWindow constants into the class * WindowInitScrollWidgets() -> InitScrollWidgets()
This commit is contained in: