Merge pull request #5082 from pchote/dotnetfour

Upgrade to .NET 4.0
This commit is contained in:
Matthias Mailänder
2014-04-11 09:17:50 +02:00
42 changed files with 99 additions and 149 deletions

View File

@@ -34,7 +34,7 @@
############################## TOOLCHAIN ############################### ############################## TOOLCHAIN ###############################
# #
CSC = gmcs CSC = dmcs
CSFLAGS = -nologo -warn:4 -debug:full -optimize- -codepage:utf8 -unsafe -warnaserror CSFLAGS = -nologo -warn:4 -debug:full -optimize- -codepage:utf8 -unsafe -warnaserror
DEFINE = DEBUG;TRACE DEFINE = DEBUG;TRACE
COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll thirdparty/ICSharpCode.SharpZipLib.dll thirdparty/FuzzyLogicLibrary.dll thirdparty/Mono.Nat.dll COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll thirdparty/ICSharpCode.SharpZipLib.dll thirdparty/FuzzyLogicLibrary.dll thirdparty/Mono.Nat.dll

View File

@@ -10,7 +10,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Editor</RootNamespace> <RootNamespace>OpenRA.Editor</RootNamespace>
<AssemblyName>OpenRA.Editor</AssemblyName> <AssemblyName>OpenRA.Editor</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ApplicationIcon>OpenRA.Editor.Icon.ico</ApplicationIcon> <ApplicationIcon>OpenRA.Editor.Icon.ico</ApplicationIcon>
<FileUpgradeFlags> <FileUpgradeFlags>
@@ -60,13 +59,13 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core"> <Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Xml.Linq"> <Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data.DataSetExtensions"> <Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />

View File

@@ -35,6 +35,8 @@ namespace OpenRA
fn(ee); fn(ee);
} }
public static Lazy<T> Lazy<T>(Func<T> p) { return new Lazy<T>(p); }
public static IEnumerable<string> GetNamespaces(this Assembly a) public static IEnumerable<string> GetNamespaces(this Assembly a)
{ {
return a.GetTypes().Select(t => t.Namespace).Distinct().Where(n => n != null); return a.GetTypes().Select(t => t.Namespace).Distinct().Where(n => n != null);

View File

@@ -15,7 +15,6 @@
<OldToolsVersion>3.5</OldToolsVersion> <OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation> <UpgradeBackupLocation>
</UpgradeBackupLocation> </UpgradeBackupLocation>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<PublishUrl>publish\</PublishUrl> <PublishUrl>publish\</PublishUrl>
<Install>true</Install> <Install>true</Install>
<InstallFrom>Disk</InstallFrom> <InstallFrom>Disk</InstallFrom>
@@ -58,7 +57,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core"> <Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
@@ -114,7 +113,6 @@
<Compile Include="Primitives\Cached.cs" /> <Compile Include="Primitives\Cached.cs" />
<Compile Include="Primitives\DisposableAction.cs" /> <Compile Include="Primitives\DisposableAction.cs" />
<Compile Include="Primitives\IObservableCollection.cs" /> <Compile Include="Primitives\IObservableCollection.cs" />
<Compile Include="Primitives\Lazy.cs" />
<Compile Include="Primitives\ObservableCollection.cs" /> <Compile Include="Primitives\ObservableCollection.cs" />
<Compile Include="Primitives\ObservableDictionary.cs" /> <Compile Include="Primitives\ObservableDictionary.cs" />
<Compile Include="Primitives\Pair.cs" /> <Compile Include="Primitives\Pair.cs" />

View File

@@ -22,7 +22,7 @@ namespace OpenRA
{ {
public static PlatformType CurrentPlatform { get { return currentPlatform.Value; } } public static PlatformType CurrentPlatform { get { return currentPlatform.Value; } }
static Lazy<PlatformType> currentPlatform = Lazy.New((Func<PlatformType>)GetCurrentPlatform); static Lazy<PlatformType> currentPlatform = new Lazy<PlatformType>(GetCurrentPlatform);
static PlatformType GetCurrentPlatform() static PlatformType GetCurrentPlatform()
{ {

View File

@@ -1,48 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
namespace OpenRA.FileFormats
{
public class Lazy<T>
{
Func<T> p;
T value;
public Lazy(Func<T> p)
{
if (p == null)
throw new ArgumentNullException();
this.p = p;
}
public T Value
{
get
{
if (p == null)
return value;
value = p();
p = null;
return value;
}
}
public T Force() { return Value; }
}
public static class Lazy
{
public static Lazy<T> New<T>(Func<T> p) { return new Lazy<T>(p); }
}
}

View File

@@ -62,7 +62,7 @@ namespace OpenRA
if (initDict.Contains<OwnerInit>()) if (initDict.Contains<OwnerInit>())
Owner = init.Get<OwnerInit, Player>(); Owner = init.Get<OwnerInit, Player>();
occupySpace = Lazy.New(() => TraitOrDefault<IOccupySpace>()); occupySpace = Exts.Lazy(() => TraitOrDefault<IOccupySpace>());
if (name != null) if (name != null)
{ {
@@ -74,14 +74,14 @@ namespace OpenRA
AddTrait(trait.Create(init)); AddTrait(trait.Create(init));
} }
facing = Lazy.New(() => TraitOrDefault<IFacing>()); facing = Exts.Lazy(() => TraitOrDefault<IFacing>());
health = Lazy.New(() => TraitOrDefault<Health>()); health = Exts.Lazy(() => TraitOrDefault<Health>());
effectiveOwner = Lazy.New(() => TraitOrDefault<IEffectiveOwner>()); effectiveOwner = Exts.Lazy(() => TraitOrDefault<IEffectiveOwner>());
applyIRender = (x, wr) => x.Render(this, wr); applyIRender = (x, wr) => x.Render(this, wr);
applyRenderModifier = (m, p, wr) => p.ModifyRender(this, wr, m); applyRenderModifier = (m, p, wr) => p.ModifyRender(this, wr, m);
Bounds = Lazy.New(() => Bounds = Exts.Lazy(() =>
{ {
var si = Info.Traits.GetOrDefault<SelectableInfo>(); var si = Info.Traits.GetOrDefault<SelectableInfo>();
var size = (si != null && si.Bounds != null) ? new int2(si.Bounds[0], si.Bounds[1]) : var size = (si != null && si.Bounds != null) ? new int2(si.Bounds[0], si.Bounds[1]) :

View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
@@ -34,8 +35,8 @@ namespace OpenRA.GameRules
: new Dictionary<string, string[]>(); : new Dictionary<string, string[]>();
} }
public readonly OpenRA.FileFormats.Lazy<Dictionary<string, SoundPool>> VoicePools; public readonly Lazy<Dictionary<string, SoundPool>> VoicePools;
public readonly OpenRA.FileFormats.Lazy<Dictionary<string, SoundPool>> NotificationsPools; public readonly Lazy<Dictionary<string, SoundPool>> NotificationsPools;
public SoundInfo( MiniYaml y ) public SoundInfo( MiniYaml y )
{ {
@@ -45,8 +46,8 @@ namespace OpenRA.GameRules
Voices = Load(y, "Voices"); Voices = Load(y, "Voices");
Notifications = Load(y, "Notifications"); Notifications = Load(y, "Notifications");
VoicePools = Lazy.New(() => Voices.ToDictionary( a => a.Key, a => new SoundPool(a.Value) )); VoicePools = Exts.Lazy(() => Voices.ToDictionary(a => a.Key, a => new SoundPool(a.Value)));
NotificationsPools = Lazy.New(() => Notifications.ToDictionary( a => a.Key, a => new SoundPool(a.Value) )); NotificationsPools = Exts.Lazy(() => Notifications.ToDictionary( a => a.Key, a => new SoundPool(a.Value) ));
} }
} }

View File

@@ -56,7 +56,7 @@ namespace OpenRA.Graphics
Theater = new Theater(world.TileSet); Theater = new Theater(world.TileSet);
terrainRenderer = new TerrainRenderer(world, this); terrainRenderer = new TerrainRenderer(world, this);
devTrait = Lazy.New(() => world.LocalPlayer != null ? world.LocalPlayer.PlayerActor.Trait<DeveloperMode>() : null); devTrait = new Lazy<DeveloperMode>(() => world.LocalPlayer != null ? world.LocalPlayer.PlayerActor.Trait<DeveloperMode>() : null);
} }
PaletteReference CreatePaletteReference(string name) PaletteReference CreatePaletteReference(string name)

View File

@@ -123,10 +123,10 @@ namespace OpenRA
MapSize = new int2(1, 1), MapSize = new int2(1, 1),
Tileset = tileset.Id, Tileset = tileset.Id,
Options = new MapOptions(), Options = new MapOptions(),
MapResources = Lazy.New(() => new TileReference<byte, byte>[1, 1]), MapResources = Exts.Lazy(() => new TileReference<byte, byte>[1, 1]),
MapTiles = Lazy.New(() => new TileReference<ushort, byte>[1, 1] { { tileRef } }), MapTiles = Exts.Lazy(() => new TileReference<ushort, byte>[1, 1] { { tileRef } }),
Actors = Lazy.New(() => new Dictionary<string, ActorReference>()), Actors = Exts.Lazy(() => new Dictionary<string, ActorReference>()),
Smudges = Lazy.New(() => new List<SmudgeReference>()) Smudges = Exts.Lazy(() => new List<SmudgeReference>())
}; };
return map; return map;
@@ -185,7 +185,7 @@ namespace OpenRA
Players.Add(player.Name, player); Players.Add(player.Name, player);
} }
Actors = Lazy.New(() => Actors = Exts.Lazy(() =>
{ {
var ret = new Dictionary<string, ActorReference>(); var ret = new Dictionary<string, ActorReference>();
foreach (var kv in yaml.NodesDict["Actors"].NodesDict) foreach (var kv in yaml.NodesDict["Actors"].NodesDict)
@@ -194,7 +194,7 @@ namespace OpenRA
}); });
// Smudges // Smudges
Smudges = Lazy.New(() => Smudges = Exts.Lazy(() =>
{ {
var ret = new List<SmudgeReference>(); var ret = new List<SmudgeReference>();
foreach (var kv in yaml.NodesDict["Smudges"].NodesDict) foreach (var kv in yaml.NodesDict["Smudges"].NodesDict)
@@ -217,8 +217,8 @@ namespace OpenRA
CustomTerrain = new string[MapSize.X, MapSize.Y]; CustomTerrain = new string[MapSize.X, MapSize.Y];
MapTiles = Lazy.New(() => LoadMapTiles()); MapTiles = Exts.Lazy(() => LoadMapTiles());
MapResources = Lazy.New(() => LoadResourceTiles()); MapResources = Exts.Lazy(() => LoadResourceTiles());
// The Uid is calculated from the data on-disk, so // The Uid is calculated from the data on-disk, so
// format changes must be flushed to disk. // format changes must be flushed to disk.
@@ -418,8 +418,8 @@ namespace OpenRA
var oldMapTiles = MapTiles.Value; var oldMapTiles = MapTiles.Value;
var oldMapResources = MapResources.Value; var oldMapResources = MapResources.Value;
MapTiles = Lazy.New(() => Exts.ResizeArray(oldMapTiles, oldMapTiles[0, 0], width, height)); MapTiles = Exts.Lazy(() => Exts.ResizeArray(oldMapTiles, oldMapTiles[0, 0], width, height));
MapResources = Lazy.New(() => Exts.ResizeArray(oldMapResources, oldMapResources[0, 0], width, height)); MapResources = Exts.Lazy(() => Exts.ResizeArray(oldMapResources, oldMapResources[0, 0], width, height));
MapSize = new int2(width, height); MapSize = new int2(width, height);
} }

View File

@@ -16,7 +16,6 @@
<UpgradeBackupLocation> <UpgradeBackupLocation>
</UpgradeBackupLocation> </UpgradeBackupLocation>
<IsWebBootstrapper>false</IsWebBootstrapper> <IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<ApplicationIcon>OpenRA.ico</ApplicationIcon> <ApplicationIcon>OpenRA.ico</ApplicationIcon>
<PublishUrl>publish\</PublishUrl> <PublishUrl>publish\</PublishUrl>
<Install>true</Install> <Install>true</Install>

View File

@@ -63,7 +63,7 @@ namespace OpenRA.Widgets
OnKeyPress = _ => OnClick(); OnKeyPress = _ => OnClick();
IsDisabled = () => Disabled; IsDisabled = () => Disabled;
IsHighlighted = () => Highlighted; IsHighlighted = () => Highlighted;
tooltipContainer = Lazy.New(() => tooltipContainer = Exts.Lazy(() =>
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer)); Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
} }
@@ -95,7 +95,7 @@ namespace OpenRA.Widgets
TooltipTemplate = other.TooltipTemplate; TooltipTemplate = other.TooltipTemplate;
TooltipText = other.TooltipText; TooltipText = other.TooltipText;
TooltipContainer = other.TooltipContainer; TooltipContainer = other.TooltipContainer;
tooltipContainer = Lazy.New(() => tooltipContainer = Exts.Lazy(() =>
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer)); Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
} }

View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.Network; using OpenRA.Network;
@@ -23,7 +24,7 @@ namespace OpenRA.Widgets
public ClientTooltipRegionWidget() public ClientTooltipRegionWidget()
{ {
tooltipContainer = Lazy.New(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer)); tooltipContainer = Exts.Lazy(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
} }
protected ClientTooltipRegionWidget(ClientTooltipRegionWidget other) protected ClientTooltipRegionWidget(ClientTooltipRegionWidget other)
@@ -31,7 +32,7 @@ namespace OpenRA.Widgets
{ {
Template = other.Template; Template = other.Template;
TooltipContainer = other.TooltipContainer; TooltipContainer = other.TooltipContainer;
tooltipContainer = Lazy.New(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer)); tooltipContainer = Exts.Lazy(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
orderManager = other.orderManager; orderManager = other.orderManager;
clientIndex = other.clientIndex; clientIndex = other.clientIndex;
} }

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Widgets
public MapPreviewWidget() public MapPreviewWidget()
{ {
tooltipContainer = Lazy.New(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer)); tooltipContainer = Exts.Lazy(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
} }
protected MapPreviewWidget(MapPreviewWidget other) protected MapPreviewWidget(MapPreviewWidget other)
@@ -48,7 +48,7 @@ namespace OpenRA.Widgets
ShowSpawnPoints = other.ShowSpawnPoints; ShowSpawnPoints = other.ShowSpawnPoints;
TooltipTemplate = other.TooltipTemplate; TooltipTemplate = other.TooltipTemplate;
TooltipContainer = other.TooltipContainer; 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); } public override Widget Clone() { return new MapPreviewWidget(this); }

View File

@@ -64,7 +64,7 @@ namespace OpenRA.Widgets
{ {
this.world = world; this.world = world;
this.worldRenderer = worldRenderer; this.worldRenderer = worldRenderer;
tooltipContainer = Lazy.New(() => tooltipContainer = Exts.Lazy(() =>
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer)); Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
} }

View File

@@ -9,10 +9,11 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Irc</RootNamespace> <RootNamespace>OpenRA.Irc</RootNamespace>
<AssemblyName>OpenRA.Irc</AssemblyName> <AssemblyName>OpenRA.Irc</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile> <TargetFrameworkProfile>
</TargetFrameworkProfile> </TargetFrameworkProfile>
<ProductVersion>12.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@@ -47,11 +48,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj"> <ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
<Project>{bdaeab25-991e-46a7-af1e-4f0e03358daa}</Project> <Project>{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}</Project>
<Name>OpenRA.FileFormats</Name> <Name>OpenRA.FileFormats</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj"> <ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj">
<Project>{0dfb103f-2962-400f-8c6d-e2c28ccba633}</Project> <Project>{0DFB103F-2962-400F-8C6D-E2C28CCBA633}</Project>
<Name>OpenRA.Game</Name> <Name>OpenRA.Game</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>

View File

@@ -10,7 +10,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA</RootNamespace> <RootNamespace>OpenRA</RootNamespace>
<AssemblyName>OpenRA.Lint</AssemblyName> <AssemblyName>OpenRA.Lint</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>
@@ -57,14 +56,14 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core"> <Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq"> <Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data.DataSetExtensions"> <Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />

View File

@@ -10,7 +10,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Mods.Cnc</RootNamespace> <RootNamespace>OpenRA.Mods.Cnc</RootNamespace>
<AssemblyName>OpenRA.Mods.Cnc</AssemblyName> <AssemblyName>OpenRA.Mods.Cnc</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>
@@ -59,13 +58,13 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core"> <Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Xml.Linq"> <Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data.DataSetExtensions"> <Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />

View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.Mods.RA; using OpenRA.Mods.RA;
@@ -32,7 +33,7 @@ namespace OpenRA.Mods.Cnc.Widgets
{ {
this.world = world; this.world = world;
tabsWidget = Lazy.New(() => tabsWidget = Exts.Lazy(() =>
Ui.Root.Get<ProductionTabsWidget>(info.ProductionTabsWidget)); Ui.Root.Get<ProductionTabsWidget>(info.ProductionTabsWidget));
} }

3
OpenRA.Mods.Cnc/Widgets/ProductionPaletteWidget.cs Executable file → Normal file
View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
@@ -65,7 +66,7 @@ namespace OpenRA.Mods.Cnc.Widgets
{ {
this.World = world; this.World = world;
this.worldRenderer = worldRenderer; this.worldRenderer = worldRenderer;
tooltipContainer = Lazy.New(() => tooltipContainer = Exts.Lazy(() =>
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer)); Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
cantBuild = new Animation("clock"); cantBuild = new Animation("clock");

View File

@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Cnc.Widgets
// Only visible if the production palette has icons to display // Only visible if the production palette has icons to display
IsVisible = () => queueGroup != null && Groups[queueGroup].Tabs.Count > 0; 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) public bool SelectNextTab(bool reverse)

3
OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs Executable file → Normal file
View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
@@ -48,7 +49,7 @@ namespace OpenRA.Mods.Cnc.Widgets
{ {
this.worldRenderer = worldRenderer; this.worldRenderer = worldRenderer;
spm = world.LocalPlayer.PlayerActor.Trait<SupportPowerManager>(); spm = world.LocalPlayer.PlayerActor.Trait<SupportPowerManager>();
tooltipContainer = Lazy.New(() => tooltipContainer = Exts.Lazy(() =>
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer)); Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
icon = new Animation("icon"); icon = new Animation("icon");

View File

@@ -10,7 +10,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Mods.D2k</RootNamespace> <RootNamespace>OpenRA.Mods.D2k</RootNamespace>
<AssemblyName>OpenRA.Mods.D2k</AssemblyName> <AssemblyName>OpenRA.Mods.D2k</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>
@@ -63,13 +62,13 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core"> <Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Xml.Linq"> <Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data.DataSetExtensions"> <Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />

View File

@@ -58,6 +58,7 @@ namespace OpenRA.Mods.RA
public readonly ArmamentInfo Info; public readonly ArmamentInfo Info;
public readonly WeaponInfo Weapon; public readonly WeaponInfo Weapon;
public readonly Barrel[] Barrels; public readonly Barrel[] Barrels;
public readonly Actor self; public readonly Actor self;
Lazy<Turreted> Turret; Lazy<Turreted> Turret;
Lazy<IBodyOrientation> Coords; Lazy<IBodyOrientation> Coords;
@@ -74,9 +75,9 @@ namespace OpenRA.Mods.RA
Info = info; Info = info;
// We can't resolve these until runtime // We can't resolve these until runtime
Turret = Lazy.New(() => self.TraitsImplementing<Turreted>().FirstOrDefault(t => t.Name == info.Turret)); Turret = Exts.Lazy(() => self.TraitsImplementing<Turreted>().FirstOrDefault(t => t.Name == info.Turret));
Coords = Lazy.New(() => self.Trait<IBodyOrientation>()); Coords = Exts.Lazy(() => self.Trait<IBodyOrientation>());
limitedAmmo = Lazy.New(() => self.TraitOrDefault<LimitedAmmo>()); limitedAmmo = Exts.Lazy(() => self.TraitOrDefault<LimitedAmmo>());
Weapon = Rules.Weapons[info.Weapon.ToLowerInvariant()]; Weapon = Rules.Weapons[info.Weapon.ToLowerInvariant()];
Burst = Weapon.Burst; Burst = Weapon.Burst;

View File

@@ -45,13 +45,13 @@ namespace OpenRA.Mods.RA
this.self = self; this.self = self;
this.info = info; this.info = info;
var armaments = Lazy.New(() => self.TraitsImplementing<Armament>() var armaments = Exts.Lazy(() => self.TraitsImplementing<Armament>()
.Where(a => info.Armaments.Contains(a.Info.Name))); .Where(a => info.Armaments.Contains(a.Info.Name)));
GetArmaments = () => armaments.Value; GetArmaments = () => armaments.Value;
facing = Lazy.New(() => self.TraitOrDefault<IFacing>()); facing = Exts.Lazy(() => self.TraitOrDefault<IFacing>());
building = Lazy.New(() => self.TraitOrDefault<Building>()); building = Exts.Lazy(() => self.TraitOrDefault<Building>());
} }
protected virtual bool CanAttack(Actor self, Target target) protected virtual bool CanAttack(Actor self, Target target)

View File

@@ -58,7 +58,7 @@ namespace OpenRA.Mods.RA
: base(self, info) : base(self, info)
{ {
this.info = info; this.info = info;
coords = Lazy.New(() => self.Trait<IBodyOrientation>()); coords = Exts.Lazy(() => self.Trait<IBodyOrientation>());
armaments = new List<Armament>(); armaments = new List<Armament>();
muzzles = new List<AnimationWithOffset>(); muzzles = new List<AnimationWithOffset>();
paxFacing = new Dictionary<Actor, IFacing>(); paxFacing = new Dictionary<Actor, IFacing>();

View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using OpenRA.FileFormats; using OpenRA.FileFormats;
@@ -30,9 +31,9 @@ namespace OpenRA.Mods.RA
public CombatDebugOverlay(Actor self) public CombatDebugOverlay(Actor self)
{ {
attack = Lazy.New(() => self.TraitOrDefault<AttackBase>()); attack = Exts.Lazy(() => self.TraitOrDefault<AttackBase>());
coords = Lazy.New(() => self.Trait<IBodyOrientation>()); coords = Exts.Lazy(() => self.Trait<IBodyOrientation>());
health = Lazy.New(() => self.TraitOrDefault<Health>()); health = Exts.Lazy(() => self.TraitOrDefault<Health>());
var localPlayer = self.World.LocalPlayer; var localPlayer = self.World.LocalPlayer;
devMode = localPlayer != null ? localPlayer.PlayerActor.Trait<DeveloperMode>() : null; devMode = localPlayer != null ? localPlayer.PlayerActor.Trait<DeveloperMode>() : null;

View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using OpenRA.Effects; using OpenRA.Effects;
using OpenRA.FileFormats; using OpenRA.FileFormats;
@@ -51,10 +52,10 @@ namespace OpenRA.Mods.RA.Effects
self.World.AddFrameEndTask(w => w.Add(this)); self.World.AddFrameEndTask(w => w.Add(this));
huf = Lazy.New(() => self.TraitOrDefault<HiddenUnderFog>()); huf = Exts.Lazy(() => self.TraitOrDefault<HiddenUnderFog>());
fuf = Lazy.New(() => self.TraitOrDefault<FrozenUnderFog>()); fuf = Exts.Lazy(() => self.TraitOrDefault<FrozenUnderFog>());
disguise = Lazy.New(() => self.TraitOrDefault<Disguise>()); disguise = Exts.Lazy(() => self.TraitOrDefault<Disguise>());
cloak = Lazy.New(() => self.TraitOrDefault<Cloak>()); cloak = Exts.Lazy(() => self.TraitOrDefault<Cloak>());
watcher = new Cache<Player, GpsWatcher>(p => p.PlayerActor.Trait<GpsWatcher>()); watcher = new Cache<Player, GpsWatcher>(p => p.PlayerActor.Trait<GpsWatcher>());
frozen = new Cache<Player, FrozenActorLayer>(p => p.PlayerActor.Trait<FrozenActorLayer>()); frozen = new Cache<Player, FrozenActorLayer>(p => p.PlayerActor.Trait<FrozenActorLayer>());

View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
@@ -41,9 +42,9 @@ namespace OpenRA.Mods.RA
// Spawned actors (e.g. building husks) shouldn't be revealed // Spawned actors (e.g. building husks) shouldn't be revealed
startsRevealed = info.StartsRevealed && !init.Contains<ParentActorInit>(); startsRevealed = info.StartsRevealed && !init.Contains<ParentActorInit>();
footprint = FootprintUtils.Tiles(init.self); footprint = FootprintUtils.Tiles(init.self);
tooltip = Lazy.New(() => init.self.TraitsImplementing<IToolTip>().FirstOrDefault()); tooltip = Exts.Lazy(() => init.self.TraitsImplementing<IToolTip>().FirstOrDefault());
tooltip = Lazy.New(() => init.self.TraitsImplementing<IToolTip>().FirstOrDefault()); tooltip = Exts.Lazy(() => init.self.TraitsImplementing<IToolTip>().FirstOrDefault());
health = Lazy.New(() => init.self.TraitOrDefault<Health>()); health = Exts.Lazy(() => init.self.TraitOrDefault<Health>());
frozen = new Dictionary<Player, FrozenActor>(); frozen = new Dictionary<Player, FrozenActor>();
visible = init.world.Players.ToDictionary(p => p, p => false); visible = init.world.Players.ToDictionary(p => p, p => false);

View File

@@ -10,7 +10,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Mods.RA</RootNamespace> <RootNamespace>OpenRA.Mods.RA</RootNamespace>
<AssemblyName>OpenRA.Mods.RA</AssemblyName> <AssemblyName>OpenRA.Mods.RA</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>

3
OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs Executable file → Normal file
View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
@@ -34,7 +35,7 @@ namespace OpenRA.Mods.RA
{ {
self = init.self; self = init.self;
DevMode = init.self.Trait<DeveloperMode>(); DevMode = init.self.Trait<DeveloperMode>();
RadarPings = Lazy.New(() => init.world.WorldActor.TraitOrDefault<RadarPings>()); RadarPings = Exts.Lazy(() => init.world.WorldActor.TraitOrDefault<RadarPings>());
init.world.ActorAdded += ActorAdded; init.world.ActorAdded += ActorAdded;
init.world.ActorRemoved += ActorRemoved; init.world.ActorRemoved += ActorRemoved;

2
OpenRA.Mods.RA/Widgets/ResourceBarWidget.cs Executable file → Normal file
View File

@@ -39,7 +39,7 @@ namespace OpenRA.Mods.RA.Widgets
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public ResourceBarWidget(World world) public ResourceBarWidget(World world)
{ {
tooltipContainer = Lazy.New(() => tooltipContainer = Exts.Lazy(() =>
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer)); Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
} }

View File

@@ -9,7 +9,6 @@
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>OpenRA.Mods.TS</RootNamespace> <RootNamespace>OpenRA.Mods.TS</RootNamespace>
<AssemblyName>OpenRA.Mods.TS</AssemblyName> <AssemblyName>OpenRA.Mods.TS</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@@ -64,8 +63,8 @@
</Target> </Target>
--> -->
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)mods/ts/" <PostBuildEvent>mkdir "$(SolutionDir)mods/ts/"
copy "$(TargetPath)" "$(SolutionDir)mods/ts/" copy "$(TargetPath)" "$(SolutionDir)mods/ts/"
cd "$(SolutionDir)"</PostBuildEvent> cd "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@@ -10,7 +10,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Renderer.Cg</RootNamespace> <RootNamespace>OpenRA.Renderer.Cg</RootNamespace>
<AssemblyName>OpenRA.Renderer.Cg</AssemblyName> <AssemblyName>OpenRA.Renderer.Cg</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>

View File

@@ -9,7 +9,6 @@
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>OpenRA.Renderer.Glsl</RootNamespace> <RootNamespace>OpenRA.Renderer.Glsl</RootNamespace>
<AssemblyName>OpenRA.Renderer.Gl</AssemblyName> <AssemblyName>OpenRA.Renderer.Gl</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion> <OldToolsVersion>3.5</OldToolsVersion>

View File

@@ -10,7 +10,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Renderer.Null</RootNamespace> <RootNamespace>OpenRA.Renderer.Null</RootNamespace>
<AssemblyName>OpenRA.Renderer.Null</AssemblyName> <AssemblyName>OpenRA.Renderer.Null</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>

View File

@@ -9,7 +9,6 @@
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>OpenRA.Renderer.Sdl2</RootNamespace> <RootNamespace>OpenRA.Renderer.Sdl2</RootNamespace>
<AssemblyName>OpenRA.Renderer.Sdl2</AssemblyName> <AssemblyName>OpenRA.Renderer.Sdl2</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>

View File

@@ -9,7 +9,6 @@
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>OpenRA.Renderer.SdlCommon</RootNamespace> <RootNamespace>OpenRA.Renderer.SdlCommon</RootNamespace>
<AssemblyName>OpenRA.Renderer.SdlCommon</AssemblyName> <AssemblyName>OpenRA.Renderer.SdlCommon</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion> <OldToolsVersion>3.5</OldToolsVersion>
@@ -50,6 +49,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause> <ConsolePause>false</ConsolePause>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />

View File

@@ -10,7 +10,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.TilesetBuilder</RootNamespace> <RootNamespace>OpenRA.TilesetBuilder</RootNamespace>
<AssemblyName>OpenRA.TilesetBuilder</AssemblyName> <AssemblyName>OpenRA.TilesetBuilder</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ApplicationIcon>tilesetbuilder_icon copy.ico</ApplicationIcon> <ApplicationIcon>tilesetbuilder_icon copy.ico</ApplicationIcon>
<FileUpgradeFlags> <FileUpgradeFlags>
@@ -60,13 +59,13 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core"> <Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Xml.Linq"> <Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data.DataSetExtensions"> <Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />

View File

@@ -141,10 +141,10 @@ namespace OpenRA.Utility
map.Bounds = Rectangle.FromLTRB(offsetX, offsetY, offsetX + width, offsetY + height); map.Bounds = Rectangle.FromLTRB(offsetX, offsetY, offsetX + width, offsetY + height);
map.Selectable = true; map.Selectable = true;
map.Smudges = Lazy.New(() => new List<SmudgeReference>()); map.Smudges = Exts.Lazy(() => new List<SmudgeReference>());
map.Actors = Lazy.New(() => new Dictionary<string, ActorReference>()); map.Actors = Exts.Lazy(() => new Dictionary<string, ActorReference>());
map.MapResources = Lazy.New(() => new TileReference<byte, byte>[mapSize, mapSize]); map.MapResources = Exts.Lazy(() => new TileReference<byte, byte>[mapSize, mapSize]);
map.MapTiles = Lazy.New(() => new TileReference<ushort, byte>[mapSize, mapSize]); map.MapTiles = Exts.Lazy(() => new TileReference<ushort, byte>[mapSize, mapSize]);
map.Options = new MapOptions(); map.Options = new MapOptions();

View File

@@ -10,7 +10,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Utility</RootNamespace> <RootNamespace>OpenRA.Utility</RootNamespace>
<AssemblyName>OpenRA.Utility</AssemblyName> <AssemblyName>OpenRA.Utility</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>
@@ -56,15 +55,15 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core"> <Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq"> <Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data.DataSetExtensions"> <Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />

View File

@@ -138,18 +138,18 @@ Section "-DotNet" DotNet
IfErrors error 0 IfErrors error 0
IntCmp $0 1 0 error 0 IntCmp $0 1 0 error 0
ClearErrors ClearErrors
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "SP" ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4.0" "SP"
IfErrors error 0 IfErrors error 0
IntCmp $0 1 done error done IntCmp $0 1 done error done
error: error:
MessageBox MB_YESNO ".NET Framework v3.5 SP1 or later is required to run OpenRA. $\n \ MessageBox MB_YESNO ".NET Framework v4.0 or later is required to run OpenRA. $\n \
Do you wish for the installer to launch your web browser in order to download and install it?" \ Do you wish for the installer to launch your web browser in order to download and install it?" \
IDYES download IDNO error2 IDYES download IDNO error2
download: download:
ExecShell "open" "http://www.microsoft.com/downloads/en/details.aspx?familyid=ab99342f-5d1a-413d-8319-81da479ab0d7" ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=17113"
Goto done Goto done
error2: error2:
MessageBox MB_OK "Installation will continue but be aware that OpenRA will not run unless .NET v3.5 SP1 \ MessageBox MB_OK "Installation will continue, but be aware that OpenRA will not run unless .NET v4.0 \
or later is installed." or later is installed."
done: done:
SectionEnd SectionEnd