Crash on image/panel not found and add TryGet functions for searching

This commit is contained in:
Gustas
2022-10-11 13:52:06 +03:00
committed by abcdefg30
parent e743e6dd61
commit c041ea7d39
4 changed files with 38 additions and 31 deletions

View File

@@ -64,10 +64,7 @@ namespace OpenRA.Mods.Common.Widgets
if (!IgnoreChildMouseOver && !hover)
hover = Children.Contains(Ui.MouseOverWidget);
var panel = getPanelCache.Update((IsDisabled(), Depressed, hover, false, IsSelected() || IsHighlighted()));
if (panel != null)
WidgetUtils.DrawPanel(RenderBounds, panel);
WidgetUtils.DrawPanel(RenderBounds, getPanelCache.Update((IsDisabled(), Depressed, hover, false, IsSelected() || IsHighlighted())));
}
public override Widget Clone() { return new ScrollItemWidget(this); }