mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-25 15:54:31 +01:00
* Part of #21421: refactor TUNNEL_MAX_COUNT * Part of #21421: deleted unused OBJECT_SELECTION_NOT_... * Part of #21421: refactor MAX_SERVER_DESCRIPTION_LENGTH * Part of #21421: refactor EXPENDITURE_TABLE_MONTH_COUNT * Part of #21421: refactor FINANCE_GRAPH_SIZE * Part of #21421: refactor NETWORK_STREAM_VERSION and _ID * Part of #21421: MONEY_STRING_MAXLENGTH * Part of #21421: deleted MAX_USER_STRINGS * Part of #21421: refactor USER_STRING_MAX_LENGTH * Part of #21421: deleted USER_STRING_END * Part of #21421: refactor REAL_NAME_START * Part of #21421: refactor REAL_NAME_END * Part of #21421: deleted FONT(X) and FONT_OPENRCT2_SPRITE * Part of #21421: refactor CURRENCY_SYMBOL_MAX_SIZE * Part of #21421: refactor CURRENCY_RATE_MAX_NUM_DIGITS * Part of #21421: refactor SCROLLABLE_ROW_HEIGHT * Part of #21421: refactor ADD_CLAMP_BODY * Part of #21421: applied clang-format to Util.cpp * Part of #21421: incorporate feedback from #21760 * Part of #21421: revert to nbsp in Currency.cpp * Part of #21421: fix merge conflict * Part of #21421: fix more merge conflict * Part of #21421: apply clang format * Part of #21421: using std::numerics for finding bounds * Part of #21421: fix reference to kAddClampBody * Part of #21421: improved on comments about AddClamp func * Part of #21421: apply correct network stream version number * Part of #21421: apply clang-format
This commit is contained in:
@@ -465,19 +465,19 @@ static Widget window_object_load_error_widgets[] = {
|
||||
|
||||
ScreenSize OnScrollGetSize(const int32_t scrollIndex) override
|
||||
{
|
||||
return ScreenSize(0, no_list_items * SCROLLABLE_ROW_HEIGHT);
|
||||
return ScreenSize(0, no_list_items * kScrollableRowHeight);
|
||||
}
|
||||
|
||||
void OnScrollMouseDown(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
|
||||
{
|
||||
const auto selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
|
||||
const auto selectedItem = screenCoords.y / kScrollableRowHeight;
|
||||
SelectObjectFromList(selectedItem);
|
||||
}
|
||||
|
||||
void OnScrollMouseOver(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
|
||||
{
|
||||
// Highlight item that the cursor is over, or remove highlighting if none
|
||||
const auto selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
|
||||
const auto selectedItem = screenCoords.y / kScrollableRowHeight;
|
||||
if (selectedItem < 0 || selectedItem >= no_list_items)
|
||||
_highlightedIndex = -1;
|
||||
else
|
||||
@@ -513,15 +513,15 @@ static Widget window_object_load_error_widgets[] = {
|
||||
for (int32_t i = 0; i < no_list_items; i++)
|
||||
{
|
||||
ScreenCoordsXY screenCoords;
|
||||
screenCoords.y = i * SCROLLABLE_ROW_HEIGHT;
|
||||
screenCoords.y = i * kScrollableRowHeight;
|
||||
if (screenCoords.y > dpi.y + dpi.height)
|
||||
break;
|
||||
|
||||
if (screenCoords.y + SCROLLABLE_ROW_HEIGHT < dpi.y)
|
||||
if (screenCoords.y + kScrollableRowHeight < dpi.y)
|
||||
continue;
|
||||
|
||||
const auto screenRect = ScreenRect{ { 0, screenCoords.y },
|
||||
{ listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } };
|
||||
{ listWidth, screenCoords.y + kScrollableRowHeight - 1 } };
|
||||
// If hovering over item, change the color and fill the backdrop.
|
||||
if (i == selected_list_item)
|
||||
GfxFillRect(dpi, screenRect, ColourMapA[colours[1]].darker);
|
||||
|
||||
Reference in New Issue
Block a user