Migrate to System.Lazy.
This commit is contained in:
@@ -43,7 +43,7 @@ namespace OpenRA.Widgets
|
||||
public Action<MouseInput> OnMouseDown = _ => {};
|
||||
public Action<MouseInput> OnMouseUp = _ => {};
|
||||
|
||||
OpenRA.FileFormats.Lazy<TooltipContainerWidget> tooltipContainer;
|
||||
Lazy<TooltipContainerWidget> tooltipContainer;
|
||||
public readonly string TooltipContainer;
|
||||
public readonly string TooltipTemplate = "BUTTON_TOOLTIP";
|
||||
public string TooltipText;
|
||||
@@ -63,7 +63,7 @@ namespace OpenRA.Widgets
|
||||
OnKeyPress = _ => OnClick();
|
||||
IsDisabled = () => Disabled;
|
||||
IsHighlighted = () => Highlighted;
|
||||
tooltipContainer = Lazy.New(() =>
|
||||
tooltipContainer = Exts.Lazy(() =>
|
||||
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace OpenRA.Widgets
|
||||
TooltipTemplate = other.TooltipTemplate;
|
||||
TooltipText = other.TooltipText;
|
||||
TooltipContainer = other.TooltipContainer;
|
||||
tooltipContainer = Lazy.New(() =>
|
||||
tooltipContainer = Exts.Lazy(() =>
|
||||
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Network;
|
||||
|
||||
@@ -23,7 +24,7 @@ namespace OpenRA.Widgets
|
||||
|
||||
public ClientTooltipRegionWidget()
|
||||
{
|
||||
tooltipContainer = Lazy.New(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
tooltipContainer = Exts.Lazy(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
}
|
||||
|
||||
protected ClientTooltipRegionWidget(ClientTooltipRegionWidget other)
|
||||
@@ -31,7 +32,7 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
Template = other.Template;
|
||||
TooltipContainer = other.TooltipContainer;
|
||||
tooltipContainer = Lazy.New(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
tooltipContainer = Exts.Lazy(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
orderManager = other.orderManager;
|
||||
clientIndex = other.clientIndex;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Widgets
|
||||
|
||||
public readonly string TooltipContainer;
|
||||
public readonly string TooltipTemplate = "SPAWN_TOOLTIP";
|
||||
OpenRA.FileFormats.Lazy<TooltipContainerWidget> tooltipContainer;
|
||||
Lazy<TooltipContainerWidget> tooltipContainer;
|
||||
public int TooltipSpawnIndex = -1;
|
||||
|
||||
Rectangle MapRect;
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Widgets
|
||||
|
||||
public MapPreviewWidget()
|
||||
{
|
||||
tooltipContainer = Lazy.New(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
tooltipContainer = Exts.Lazy(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
}
|
||||
|
||||
protected MapPreviewWidget(MapPreviewWidget other)
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Widgets
|
||||
ShowSpawnPoints = other.ShowSpawnPoints;
|
||||
TooltipTemplate = other.TooltipTemplate;
|
||||
TooltipContainer = other.TooltipContainer;
|
||||
tooltipContainer = Lazy.New(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
tooltipContainer = Exts.Lazy(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
}
|
||||
|
||||
public override Widget Clone() { return new MapPreviewWidget(this); }
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
public readonly string TooltipTemplate = "WORLD_TOOLTIP";
|
||||
public readonly string TooltipContainer;
|
||||
OpenRA.FileFormats.Lazy<TooltipContainerWidget> tooltipContainer;
|
||||
Lazy<TooltipContainerWidget> tooltipContainer;
|
||||
|
||||
public WorldTooltipType TooltipType { get; private set; }
|
||||
public IToolTip ActorTooltip { get; private set; }
|
||||
@@ -64,7 +64,7 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
this.world = world;
|
||||
this.worldRenderer = worldRenderer;
|
||||
tooltipContainer = Lazy.New(() =>
|
||||
tooltipContainer = Exts.Lazy(() =>
|
||||
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user