diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 08763a2eb1..3db68cbb08 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -26,6 +26,8 @@ - Fix: [#22582] Lighting effects are not enabled/disabled correctly, making the game appear frozen. - Fix: [#22606] Virtual floor is sometimes drawn above the path when placing paths. - Fix: [#22625] Fix compilation with orignal ride ratings. +- Fix: [#22671] Game default to hide supports on startup. +- Fix: [#22671] Unchecking invisible option does not uncheck see-through option on transparency options and vice versa. 0.4.13 (2024-08-04) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index a94227003b..bc1b991ec2 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -36,9 +36,9 @@ static Widget _mainWidgets[] = { widgets = _mainWidgets; ViewportCreate(this, windowPos, width, height, Focus(CoordsXYZ(0x0FFF, 0x0FFF, 0))); - if (viewport != nullptr && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) + if (viewport != nullptr) { - SetViewportFlags(); + SetViewportFlags(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO); viewport->rotation = 0; } gShowGridLinesRefCount = 0; @@ -53,9 +53,14 @@ static Widget _mainWidgets[] = { } private: - void SetViewportFlags() + void SetViewportFlags(bool isTitleWindow) { viewport->flags |= VIEWPORT_FLAG_SOUND_ON; + if (isTitleWindow) + { + return; + } + if (Config::Get().general.InvisibleRides) { viewport->flags |= VIEWPORT_FLAG_INVISIBLE_RIDES; diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index 78761eda4a..5baafd4eea 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -158,6 +158,18 @@ static Widget _transparancyWidgets[] = } private: + uint32_t ToggleSeeThrough(uint32_t wflags, uint32_t seeThroughFlag, uint32_t transparencyFlag) + { + wflags ^= seeThroughFlag; + // If see-through is disabled, we also want to disable invisible + if (!(wflags & seeThroughFlag)) + { + wflags &= ~transparencyFlag; + } + SaveInConfig(wflags); + return wflags; + } + uint32_t ToggleTransparency(uint32_t wflags, uint32_t transparencyFlag, uint32_t seeThroughFlag) { wflags ^= transparencyFlag; @@ -165,6 +177,10 @@ static Widget _transparancyWidgets[] = { wflags |= seeThroughFlag; } + else + { + wflags &= ~seeThroughFlag; + } SaveInConfig(wflags); return wflags; } @@ -182,22 +198,22 @@ static Widget _transparancyWidgets[] = switch (widgetIndex) { case WIDX_HIDE_RIDES: - wflags ^= VIEWPORT_FLAG_HIDE_RIDES; + wflags = ToggleSeeThrough(wflags, VIEWPORT_FLAG_HIDE_RIDES, VIEWPORT_FLAG_INVISIBLE_RIDES); break; case WIDX_HIDE_VEHICLES: - wflags ^= VIEWPORT_FLAG_HIDE_VEHICLES; + wflags = ToggleSeeThrough(wflags, VIEWPORT_FLAG_HIDE_VEHICLES, VIEWPORT_FLAG_INVISIBLE_VEHICLES); break; case WIDX_HIDE_SCENERY: - wflags ^= VIEWPORT_FLAG_HIDE_SCENERY; + wflags = ToggleSeeThrough(wflags, VIEWPORT_FLAG_HIDE_SCENERY, VIEWPORT_FLAG_INVISIBLE_SCENERY); break; case WIDX_HIDE_VEGETATION: - wflags ^= VIEWPORT_FLAG_HIDE_VEGETATION; + wflags = ToggleSeeThrough(wflags, VIEWPORT_FLAG_HIDE_VEGETATION, VIEWPORT_FLAG_INVISIBLE_VEGETATION); break; case WIDX_HIDE_PATHS: - wflags ^= VIEWPORT_FLAG_HIDE_PATHS; + wflags = ToggleSeeThrough(wflags, VIEWPORT_FLAG_HIDE_PATHS, VIEWPORT_FLAG_INVISIBLE_PATHS); break; case WIDX_HIDE_SUPPORTS: - wflags ^= VIEWPORT_FLAG_HIDE_SUPPORTS; + wflags = ToggleSeeThrough(wflags, VIEWPORT_FLAG_HIDE_SUPPORTS, VIEWPORT_FLAG_INVISIBLE_SUPPORTS); break; case WIDX_INVISIBLE_RIDES: wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_RIDES, VIEWPORT_FLAG_HIDE_RIDES); diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 62d44ef40b..26baa662dd 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -248,7 +248,7 @@ namespace OpenRCT2::Config model->InvisibleTrees = reader->GetBoolean("invisible_trees", false); model->InvisibleScenery = reader->GetBoolean("invisible_scenery", false); model->InvisiblePaths = reader->GetBoolean("invisible_paths", false); - model->InvisibleSupports = reader->GetBoolean("invisible_supports", true); + model->InvisibleSupports = reader->GetBoolean("invisible_supports", false); model->LastVersionCheckTime = reader->GetInt64("last_version_check_time", 0); }