Migrate to System.Lazy.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Mods.RA;
|
||||
@@ -32,7 +33,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
{
|
||||
this.world = world;
|
||||
|
||||
tabsWidget = Lazy.New(() =>
|
||||
tabsWidget = Exts.Lazy(() =>
|
||||
Ui.Root.Get<ProductionTabsWidget>(info.ProductionTabsWidget));
|
||||
}
|
||||
|
||||
|
||||
3
OpenRA.Mods.Cnc/Widgets/ProductionPaletteWidget.cs
Executable file → Normal file
3
OpenRA.Mods.Cnc/Widgets/ProductionPaletteWidget.cs
Executable file → Normal file
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
@@ -65,7 +66,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
{
|
||||
this.World = world;
|
||||
this.worldRenderer = worldRenderer;
|
||||
tooltipContainer = Lazy.New(() =>
|
||||
tooltipContainer = Exts.Lazy(() =>
|
||||
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
|
||||
cantBuild = new Animation("clock");
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
bool rightPressed = false;
|
||||
Rectangle leftButtonRect;
|
||||
Rectangle rightButtonRect;
|
||||
OpenRA.FileFormats.Lazy<ProductionPaletteWidget> paletteWidget;
|
||||
Lazy<ProductionPaletteWidget> paletteWidget;
|
||||
string queueGroup;
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
// Only visible if the production palette has icons to display
|
||||
IsVisible = () => queueGroup != null && Groups[queueGroup].Tabs.Count > 0;
|
||||
|
||||
paletteWidget = Lazy.New(() => Ui.Root.Get<ProductionPaletteWidget>(PaletteWidget));
|
||||
paletteWidget = Exts.Lazy(() => Ui.Root.Get<ProductionPaletteWidget>(PaletteWidget));
|
||||
}
|
||||
|
||||
public bool SelectNextTab(bool reverse)
|
||||
|
||||
3
OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs
Executable file → Normal file
3
OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs
Executable file → Normal file
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
@@ -48,7 +49,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
{
|
||||
this.worldRenderer = worldRenderer;
|
||||
spm = world.LocalPlayer.PlayerActor.Trait<SupportPowerManager>();
|
||||
tooltipContainer = Lazy.New(() =>
|
||||
tooltipContainer = Exts.Lazy(() =>
|
||||
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
|
||||
icon = new Animation("icon");
|
||||
|
||||
Reference in New Issue
Block a user