Merge remote-tracking branch 'upstream/master'

This commit is contained in:
dP
2024-02-19 12:16:07 +05:30
183 changed files with 9534 additions and 5696 deletions
+7
View File
@@ -1289,8 +1289,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)
@@ -1339,6 +1344,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;
}