diff --git a/distribution/changelog.txt b/distribution/changelog.txt index acf8da618a..48c29408d5 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -6,6 +6,7 @@ - Feature: [#19547] Add large sloped turns to hybrid coaster and single rail coaster. - Feature: [OpenMusic#25] Added Prehistoric ride music style. - Improved: [#18490] Reduce guests walking through trains on level crossing next to station. +- Improved: [#18996] When marketing campaigns are disabled, disable the Marketing tab in the Finances window. - Improved: [#19764] Miscellaneous scenery tab now grouped next to the all-scenery tab. - Improved: [#19830] “Highlight path issues” will now hide wall elements. - Fix: [#12598] Number of holes is not set correctly when saving track designs. diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 876251a2f0..a8a5207441 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -226,6 +226,11 @@ class FinancesWindow final : public Window private: uint32_t _lastPaintedMonth; + void SetDisabledTabs() + { + disabled_widgets = (gParkFlags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN) ? (1uLL << WIDX_TAB_5) : 0; + } + public: void OnOpen() override { @@ -299,7 +304,7 @@ public: WindowInitScrollWidgets(*this); } - disabled_widgets = 0; + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_6); for (auto i = 0; i < WINDOW_FINANCES_PAGE_COUNT; i++) SetWidgetPressed(WIDX_TAB_1 + i, false); @@ -443,8 +448,9 @@ public: hold_down_widgets = _windowFinancesPageHoldDownWidgets[p]; pressed_widgets = 0; widgets = _windowFinancesPageWidgets[p]; - + SetDisabledTabs(); Invalidate(); + if (p == WINDOW_FINANCES_PAGE_RESEARCH) { width = WW_RESEARCH;