Merge branch 'master' into jgrpp

# Conflicts:
#	regression/regression/result.txt
#	src/autoreplace_cmd.cpp
#	src/industry_gui.cpp
#	src/landscape.cpp
#	src/network/network_content.cpp
#	src/newgrf_roadstop.cpp
#	src/pathfinder/yapf/yapf_ship.cpp
#	src/road_gui.cpp
#	src/saveload/ai_sl.cpp
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/station.cpp
#	src/station_gui.cpp
#	src/video/cocoa/cocoa_ogl.h
#	src/video/sdl2_opengl_v.h
#	src/video/video_driver.hpp
#	src/video/win32_v.h
#	src/widget_type.h
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_type.h
#	src/window.cpp
This commit is contained in:
Jonathan G Rennison
2024-02-19 18:50:33 +00:00
119 changed files with 4346 additions and 2129 deletions

View File

@@ -1292,8 +1292,13 @@ void NWidgetStacked::AssignSizePosition(SizingType sizing, int x, int y, uint gi
void NWidgetStacked::FillWidgetLookup(WidgetLookup &widget_lookup)
{
/* We need to update widget_lookup later. */
this->widget_lookup = &widget_lookup;
if (this->index >= 0) widget_lookup[this->index] = this;
NWidgetContainer::FillWidgetLookup(widget_lookup);
/* In case widget IDs are repeated, make sure Window::GetWidget works on displayed widgets. */
if (static_cast<size_t>(this->shown_plane) < this->children.size()) this->children[shown_plane]->FillWidgetLookup(widget_lookup);
}
void NWidgetStacked::Draw(const Window *w)
@@ -1342,6 +1347,8 @@ bool NWidgetStacked::SetDisplayedPlane(int plane)
{
if (this->shown_plane == plane) return false;
this->shown_plane = plane;
/* In case widget IDs are repeated, make sure Window::GetWidget works on displayed widgets. */
if (static_cast<size_t>(this->shown_plane) < this->children.size()) this->children[shown_plane]->FillWidgetLookup(*this->widget_lookup);
return true;
}