1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

Merge branch 'develop' into HEAD

This commit is contained in:
duncanspumpkin
2021-10-10 15:34:56 +01:00
2 changed files with 27 additions and 3 deletions

View File

@@ -712,6 +712,8 @@ static void window_scenery_dropdown(rct_window* w, rct_widgetindex widgetIndex,
w->Invalidate();
}
static ScenerySelection get_scenery_id_by_cursor_pos(rct_window* w, const ScreenCoordsXY& screenCoords);
/**
*
* rct2: 0x006E1B9F
@@ -720,6 +722,28 @@ static void window_scenery_periodic_update(rct_window* w)
{
if (!_selectedScenery.IsUndefined())
{
// Find out what scenery the cursor is over
const CursorState* state = context_get_cursor_state();
rct_widgetindex widgetIndex = window_find_widget_from_point(w, state->position);
if (widgetIndex == WIDX_SCENERY_LIST)
{
ScreenCoordsXY scrollPos = {};
int32_t scrollArea = 0;
int32_t scrollId = 0;
WidgetScrollGetPart(w, &w->widgets[WIDX_SCENERY_LIST], state->position, scrollPos, &scrollArea, &scrollId);
if (scrollArea == SCROLL_PART_VIEW)
{
const ScenerySelection scenery = get_scenery_id_by_cursor_pos(w, scrollPos);
if (scenery == _selectedScenery)
{
return;
}
}
}
// Cursor was not over the currently hover selected scenery so reset hover selection.
// This will happen when the mouse leaves the scroll window and is required so that the cost and description switch to
// the tool scenery selection.
_selectedScenery = {};
}
}

View File

@@ -1002,11 +1002,11 @@ void research_determine_first_of_type()
// The last research item will also be present in gResearchItemsInvented.
// Avoid marking its ride type as "invented" prematurely.
if (gResearchLastItem.has_value() && !gResearchLastItem->IsNull() && researchItem == *gResearchLastItem)
if (gResearchLastItem.has_value() && !gResearchLastItem->IsNull() && researchItem == gResearchLastItem.value())
continue;
// The next research item is (sometimes?) also present in gResearchItemsInvented, even though it isn't invented yet(!)
if (gResearchNextItem.has_value() && !gResearchNextItem->IsNull() && researchItem == *gResearchNextItem)
if (gResearchNextItem.has_value() && !gResearchNextItem->IsNull() && researchItem == gResearchNextItem.value())
continue;
research_mark_ride_type_as_seen(researchItem);
@@ -1026,7 +1026,7 @@ void research_determine_first_of_type()
for (auto& researchItem : gResearchItemsUninvented)
{
// The next research item is (sometimes?) also present in gResearchItemsUninvented
if (gResearchNextItem.has_value() && !gResearchNextItem->IsNull() && researchItem == *gResearchNextItem)
if (gResearchNextItem.has_value() && !gResearchNextItem->IsNull() && researchItem == gResearchNextItem.value())
{
// Copy the "first of type" flag.
researchItem.flags = gResearchNextItem->flags;