mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 06:23:04 +01:00
Fill scrollbar gap in news window if no scrollbar is visible
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
- Fix: [#25299] The Mine Train Coaster left large helix draws incorrect sprites at certain angles (original bug).
|
||||
- Fix: [#25328] Spiral Slide in Blackpool Pleasure Beach has its entrance and exit the wrong way round (bug in the original scenario).
|
||||
- Fix: [#25342] The Go-Karts medium right gentle sloped turn does not have a tunnel at the end.
|
||||
- Fix: [#25349] Items in Recent Messages are too narrow if there is no scrollbar visible.
|
||||
- Fix: [#25350] The scrolling intro background switches colour halfway through (original bug).
|
||||
- Fix: [#25350] When skipping the scrolling intro, the screen does not get cleared properly.
|
||||
- Fix: [#25350] Scrolling intro cannot be skipped using a mouse click.
|
||||
|
||||
@@ -446,6 +446,10 @@ namespace OpenRCT2::Ui::Windows
|
||||
int32_t i = 0;
|
||||
|
||||
const auto backgroundPaletteIndex = ColourMapA[colours[3].colour].light;
|
||||
// Fill the scrollbar gap if no scrollbar is visible
|
||||
const bool scrollbarVisible = scrolls[0].contentHeight > widgets[WIDX_SCROLL].height();
|
||||
const auto scrollbarFill = scrollbarVisible ? 0 : kScrollBarWidth;
|
||||
|
||||
for (const auto& newsItem : getGameState().newsItems.GetArchived())
|
||||
{
|
||||
if (y >= rt.y + rt.height)
|
||||
@@ -458,9 +462,9 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
|
||||
// Outer frame
|
||||
GfxFillRectInset(rt, { -1, y, 383, y + itemHeight - 1 }, colours[1], INSET_RECT_F_30);
|
||||
GfxFillRectInset(rt, { -1, y, 383 + scrollbarFill, y + itemHeight - 1 }, colours[1], INSET_RECT_F_30);
|
||||
// Background
|
||||
GfxFillRect(rt, { 0, y + 1, 381, y + itemHeight - 2 }, backgroundPaletteIndex);
|
||||
GfxFillRect(rt, { 0, y + 1, 381 + scrollbarFill, y + itemHeight - 2 }, backgroundPaletteIndex);
|
||||
|
||||
// Date text
|
||||
{
|
||||
@@ -480,7 +484,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
// Subject button
|
||||
if ((newsItem.typeHasSubject()) && !(newsItem.hasButton()))
|
||||
{
|
||||
auto screenCoords = ScreenCoordsXY{ 328, y + lineHeight + 4 };
|
||||
auto screenCoords = ScreenCoordsXY{ 328 + scrollbarFill, y + lineHeight + 4 };
|
||||
|
||||
int32_t press = 0;
|
||||
if (_pressedNewsItemIndex != -1)
|
||||
@@ -561,7 +565,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
// Location button
|
||||
if ((newsItem.typeHasLocation()) && !(newsItem.hasButton()))
|
||||
{
|
||||
auto screenCoords = ScreenCoordsXY{ 352, y + lineHeight + 4 };
|
||||
auto screenCoords = ScreenCoordsXY{ 352 + scrollbarFill, y + lineHeight + 4 };
|
||||
|
||||
int32_t press = 0;
|
||||
if (_pressedNewsItemIndex != -1)
|
||||
|
||||
Reference in New Issue
Block a user