2
Makefile
2
Makefile
@@ -34,7 +34,7 @@
|
||||
|
||||
############################## TOOLCHAIN ###############################
|
||||
#
|
||||
CSC = gmcs
|
||||
CSC = dmcs
|
||||
CSFLAGS = -nologo -warn:4 -debug:full -optimize- -codepage:utf8 -unsafe -warnaserror
|
||||
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
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenRA.Editor</RootNamespace>
|
||||
<AssemblyName>OpenRA.Editor</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ApplicationIcon>OpenRA.Editor.Icon.ico</ApplicationIcon>
|
||||
<FileUpgradeFlags>
|
||||
@@ -60,13 +59,13 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
|
||||
@@ -35,6 +35,8 @@ namespace OpenRA
|
||||
fn(ee);
|
||||
}
|
||||
|
||||
public static Lazy<T> Lazy<T>(Func<T> p) { return new Lazy<T>(p); }
|
||||
|
||||
public static IEnumerable<string> GetNamespaces(this Assembly a)
|
||||
{
|
||||
return a.GetTypes().Select(t => t.Namespace).Distinct().Where(n => n != null);
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
@@ -58,7 +57,7 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
@@ -114,7 +113,6 @@
|
||||
<Compile Include="Primitives\Cached.cs" />
|
||||
<Compile Include="Primitives\DisposableAction.cs" />
|
||||
<Compile Include="Primitives\IObservableCollection.cs" />
|
||||
<Compile Include="Primitives\Lazy.cs" />
|
||||
<Compile Include="Primitives\ObservableCollection.cs" />
|
||||
<Compile Include="Primitives\ObservableDictionary.cs" />
|
||||
<Compile Include="Primitives\Pair.cs" />
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA
|
||||
{
|
||||
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()
|
||||
{
|
||||
|
||||
@@ -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); }
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ namespace OpenRA
|
||||
if (initDict.Contains<OwnerInit>())
|
||||
Owner = init.Get<OwnerInit, Player>();
|
||||
|
||||
occupySpace = Lazy.New(() => TraitOrDefault<IOccupySpace>());
|
||||
occupySpace = Exts.Lazy(() => TraitOrDefault<IOccupySpace>());
|
||||
|
||||
if (name != null)
|
||||
{
|
||||
@@ -74,14 +74,14 @@ namespace OpenRA
|
||||
AddTrait(trait.Create(init));
|
||||
}
|
||||
|
||||
facing = Lazy.New(() => TraitOrDefault<IFacing>());
|
||||
health = Lazy.New(() => TraitOrDefault<Health>());
|
||||
effectiveOwner = Lazy.New(() => TraitOrDefault<IEffectiveOwner>());
|
||||
facing = Exts.Lazy(() => TraitOrDefault<IFacing>());
|
||||
health = Exts.Lazy(() => TraitOrDefault<Health>());
|
||||
effectiveOwner = Exts.Lazy(() => TraitOrDefault<IEffectiveOwner>());
|
||||
|
||||
applyIRender = (x, wr) => x.Render(this, wr);
|
||||
applyRenderModifier = (m, p, wr) => p.ModifyRender(this, wr, m);
|
||||
|
||||
Bounds = Lazy.New(() =>
|
||||
Bounds = Exts.Lazy(() =>
|
||||
{
|
||||
var si = Info.Traits.GetOrDefault<SelectableInfo>();
|
||||
var size = (si != null && si.Bounds != null) ? new int2(si.Bounds[0], si.Bounds[1]) :
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
@@ -34,8 +35,8 @@ namespace OpenRA.GameRules
|
||||
: new Dictionary<string, string[]>();
|
||||
}
|
||||
|
||||
public readonly OpenRA.FileFormats.Lazy<Dictionary<string, SoundPool>> VoicePools;
|
||||
public readonly OpenRA.FileFormats.Lazy<Dictionary<string, SoundPool>> NotificationsPools;
|
||||
public readonly Lazy<Dictionary<string, SoundPool>> VoicePools;
|
||||
public readonly Lazy<Dictionary<string, SoundPool>> NotificationsPools;
|
||||
|
||||
public SoundInfo( MiniYaml y )
|
||||
{
|
||||
@@ -45,8 +46,8 @@ namespace OpenRA.GameRules
|
||||
Voices = Load(y, "Voices");
|
||||
Notifications = Load(y, "Notifications");
|
||||
|
||||
VoicePools = Lazy.New(() => Voices.ToDictionary( a => a.Key, a => new SoundPool(a.Value) ));
|
||||
NotificationsPools = Lazy.New(() => Notifications.ToDictionary( a => a.Key, a => new SoundPool(a.Value) ));
|
||||
VoicePools = Exts.Lazy(() => Voices.ToDictionary(a => a.Key, a => new SoundPool(a.Value)));
|
||||
NotificationsPools = Exts.Lazy(() => Notifications.ToDictionary( a => a.Key, a => new SoundPool(a.Value) ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace OpenRA.Graphics
|
||||
Theater = new Theater(world.TileSet);
|
||||
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)
|
||||
|
||||
@@ -123,10 +123,10 @@ namespace OpenRA
|
||||
MapSize = new int2(1, 1),
|
||||
Tileset = tileset.Id,
|
||||
Options = new MapOptions(),
|
||||
MapResources = Lazy.New(() => new TileReference<byte, byte>[1, 1]),
|
||||
MapTiles = Lazy.New(() => new TileReference<ushort, byte>[1, 1] { { tileRef } }),
|
||||
Actors = Lazy.New(() => new Dictionary<string, ActorReference>()),
|
||||
Smudges = Lazy.New(() => new List<SmudgeReference>())
|
||||
MapResources = Exts.Lazy(() => new TileReference<byte, byte>[1, 1]),
|
||||
MapTiles = Exts.Lazy(() => new TileReference<ushort, byte>[1, 1] { { tileRef } }),
|
||||
Actors = Exts.Lazy(() => new Dictionary<string, ActorReference>()),
|
||||
Smudges = Exts.Lazy(() => new List<SmudgeReference>())
|
||||
};
|
||||
|
||||
return map;
|
||||
@@ -185,7 +185,7 @@ namespace OpenRA
|
||||
Players.Add(player.Name, player);
|
||||
}
|
||||
|
||||
Actors = Lazy.New(() =>
|
||||
Actors = Exts.Lazy(() =>
|
||||
{
|
||||
var ret = new Dictionary<string, ActorReference>();
|
||||
foreach (var kv in yaml.NodesDict["Actors"].NodesDict)
|
||||
@@ -194,7 +194,7 @@ namespace OpenRA
|
||||
});
|
||||
|
||||
// Smudges
|
||||
Smudges = Lazy.New(() =>
|
||||
Smudges = Exts.Lazy(() =>
|
||||
{
|
||||
var ret = new List<SmudgeReference>();
|
||||
foreach (var kv in yaml.NodesDict["Smudges"].NodesDict)
|
||||
@@ -217,8 +217,8 @@ namespace OpenRA
|
||||
|
||||
CustomTerrain = new string[MapSize.X, MapSize.Y];
|
||||
|
||||
MapTiles = Lazy.New(() => LoadMapTiles());
|
||||
MapResources = Lazy.New(() => LoadResourceTiles());
|
||||
MapTiles = Exts.Lazy(() => LoadMapTiles());
|
||||
MapResources = Exts.Lazy(() => LoadResourceTiles());
|
||||
|
||||
// The Uid is calculated from the data on-disk, so
|
||||
// format changes must be flushed to disk.
|
||||
@@ -418,8 +418,8 @@ namespace OpenRA
|
||||
var oldMapTiles = MapTiles.Value;
|
||||
var oldMapResources = MapResources.Value;
|
||||
|
||||
MapTiles = Lazy.New(() => Exts.ResizeArray(oldMapTiles, oldMapTiles[0, 0], width, height));
|
||||
MapResources = Lazy.New(() => Exts.ResizeArray(oldMapResources, oldMapResources[0, 0], width, height));
|
||||
MapTiles = Exts.Lazy(() => Exts.ResizeArray(oldMapTiles, oldMapTiles[0, 0], width, height));
|
||||
MapResources = Exts.Lazy(() => Exts.ResizeArray(oldMapResources, oldMapResources[0, 0], width, height));
|
||||
MapSize = new int2(width, height);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<ApplicationIcon>OpenRA.ico</ApplicationIcon>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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); }
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
this.world = world;
|
||||
this.worldRenderer = worldRenderer;
|
||||
tooltipContainer = Lazy.New(() =>
|
||||
tooltipContainer = Exts.Lazy(() =>
|
||||
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
}
|
||||
|
||||
|
||||
@@ -9,10 +9,11 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenRA.Irc</RootNamespace>
|
||||
<AssemblyName>OpenRA.Irc</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<ProductVersion>12.0.0</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -47,11 +48,11 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<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>
|
||||
</ProjectReference>
|
||||
<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>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenRA</RootNamespace>
|
||||
<AssemblyName>OpenRA.Lint</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
@@ -57,14 +56,14 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenRA.Mods.Cnc</RootNamespace>
|
||||
<AssemblyName>OpenRA.Mods.Cnc</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
@@ -59,13 +58,13 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenRA.Mods.D2k</RootNamespace>
|
||||
<AssemblyName>OpenRA.Mods.D2k</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
@@ -63,13 +62,13 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace OpenRA.Mods.RA
|
||||
public readonly ArmamentInfo Info;
|
||||
public readonly WeaponInfo Weapon;
|
||||
public readonly Barrel[] Barrels;
|
||||
|
||||
public readonly Actor self;
|
||||
Lazy<Turreted> Turret;
|
||||
Lazy<IBodyOrientation> Coords;
|
||||
@@ -74,9 +75,9 @@ namespace OpenRA.Mods.RA
|
||||
Info = info;
|
||||
|
||||
// We can't resolve these until runtime
|
||||
Turret = Lazy.New(() => self.TraitsImplementing<Turreted>().FirstOrDefault(t => t.Name == info.Turret));
|
||||
Coords = Lazy.New(() => self.Trait<IBodyOrientation>());
|
||||
limitedAmmo = Lazy.New(() => self.TraitOrDefault<LimitedAmmo>());
|
||||
Turret = Exts.Lazy(() => self.TraitsImplementing<Turreted>().FirstOrDefault(t => t.Name == info.Turret));
|
||||
Coords = Exts.Lazy(() => self.Trait<IBodyOrientation>());
|
||||
limitedAmmo = Exts.Lazy(() => self.TraitOrDefault<LimitedAmmo>());
|
||||
|
||||
Weapon = Rules.Weapons[info.Weapon.ToLowerInvariant()];
|
||||
Burst = Weapon.Burst;
|
||||
|
||||
@@ -45,13 +45,13 @@ namespace OpenRA.Mods.RA
|
||||
this.self = self;
|
||||
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)));
|
||||
|
||||
GetArmaments = () => armaments.Value;
|
||||
|
||||
facing = Lazy.New(() => self.TraitOrDefault<IFacing>());
|
||||
building = Lazy.New(() => self.TraitOrDefault<Building>());
|
||||
facing = Exts.Lazy(() => self.TraitOrDefault<IFacing>());
|
||||
building = Exts.Lazy(() => self.TraitOrDefault<Building>());
|
||||
}
|
||||
|
||||
protected virtual bool CanAttack(Actor self, Target target)
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace OpenRA.Mods.RA
|
||||
: base(self, info)
|
||||
{
|
||||
this.info = info;
|
||||
coords = Lazy.New(() => self.Trait<IBodyOrientation>());
|
||||
coords = Exts.Lazy(() => self.Trait<IBodyOrientation>());
|
||||
armaments = new List<Armament>();
|
||||
muzzles = new List<AnimationWithOffset>();
|
||||
paxFacing = new Dictionary<Actor, IFacing>();
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using OpenRA.FileFormats;
|
||||
@@ -30,9 +31,9 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public CombatDebugOverlay(Actor self)
|
||||
{
|
||||
attack = Lazy.New(() => self.TraitOrDefault<AttackBase>());
|
||||
coords = Lazy.New(() => self.Trait<IBodyOrientation>());
|
||||
health = Lazy.New(() => self.TraitOrDefault<Health>());
|
||||
attack = Exts.Lazy(() => self.TraitOrDefault<AttackBase>());
|
||||
coords = Exts.Lazy(() => self.Trait<IBodyOrientation>());
|
||||
health = Exts.Lazy(() => self.TraitOrDefault<Health>());
|
||||
|
||||
var localPlayer = self.World.LocalPlayer;
|
||||
devMode = localPlayer != null ? localPlayer.PlayerActor.Trait<DeveloperMode>() : null;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.FileFormats;
|
||||
@@ -51,10 +52,10 @@ namespace OpenRA.Mods.RA.Effects
|
||||
|
||||
self.World.AddFrameEndTask(w => w.Add(this));
|
||||
|
||||
huf = Lazy.New(() => self.TraitOrDefault<HiddenUnderFog>());
|
||||
fuf = Lazy.New(() => self.TraitOrDefault<FrozenUnderFog>());
|
||||
disguise = Lazy.New(() => self.TraitOrDefault<Disguise>());
|
||||
cloak = Lazy.New(() => self.TraitOrDefault<Cloak>());
|
||||
huf = Exts.Lazy(() => self.TraitOrDefault<HiddenUnderFog>());
|
||||
fuf = Exts.Lazy(() => self.TraitOrDefault<FrozenUnderFog>());
|
||||
disguise = Exts.Lazy(() => self.TraitOrDefault<Disguise>());
|
||||
cloak = Exts.Lazy(() => self.TraitOrDefault<Cloak>());
|
||||
|
||||
watcher = new Cache<Player, GpsWatcher>(p => p.PlayerActor.Trait<GpsWatcher>());
|
||||
frozen = new Cache<Player, FrozenActorLayer>(p => p.PlayerActor.Trait<FrozenActorLayer>());
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
@@ -41,9 +42,9 @@ namespace OpenRA.Mods.RA
|
||||
// Spawned actors (e.g. building husks) shouldn't be revealed
|
||||
startsRevealed = info.StartsRevealed && !init.Contains<ParentActorInit>();
|
||||
footprint = FootprintUtils.Tiles(init.self);
|
||||
tooltip = Lazy.New(() => init.self.TraitsImplementing<IToolTip>().FirstOrDefault());
|
||||
tooltip = Lazy.New(() => init.self.TraitsImplementing<IToolTip>().FirstOrDefault());
|
||||
health = Lazy.New(() => init.self.TraitOrDefault<Health>());
|
||||
tooltip = Exts.Lazy(() => init.self.TraitsImplementing<IToolTip>().FirstOrDefault());
|
||||
tooltip = Exts.Lazy(() => init.self.TraitsImplementing<IToolTip>().FirstOrDefault());
|
||||
health = Exts.Lazy(() => init.self.TraitOrDefault<Health>());
|
||||
|
||||
frozen = new Dictionary<Player, FrozenActor>();
|
||||
visible = init.world.Players.ToDictionary(p => p, p => false);
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenRA.Mods.RA</RootNamespace>
|
||||
<AssemblyName>OpenRA.Mods.RA</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
|
||||
3
OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs
Executable file → Normal file
3
OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs
Executable file → Normal file
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
@@ -34,7 +35,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
self = init.self;
|
||||
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.ActorRemoved += ActorRemoved;
|
||||
|
||||
2
OpenRA.Mods.RA/Widgets/ResourceBarWidget.cs
Executable file → Normal file
2
OpenRA.Mods.RA/Widgets/ResourceBarWidget.cs
Executable file → Normal file
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.RA.Widgets
|
||||
[ObjectCreator.UseCtor]
|
||||
public ResourceBarWidget(World world)
|
||||
{
|
||||
tooltipContainer = Lazy.New(() =>
|
||||
tooltipContainer = Exts.Lazy(() =>
|
||||
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>OpenRA.Mods.TS</RootNamespace>
|
||||
<AssemblyName>OpenRA.Mods.TS</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenRA.Renderer.Cg</RootNamespace>
|
||||
<AssemblyName>OpenRA.Renderer.Cg</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>OpenRA.Renderer.Glsl</RootNamespace>
|
||||
<AssemblyName>OpenRA.Renderer.Gl</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenRA.Renderer.Null</RootNamespace>
|
||||
<AssemblyName>OpenRA.Renderer.Null</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>OpenRA.Renderer.Sdl2</RootNamespace>
|
||||
<AssemblyName>OpenRA.Renderer.Sdl2</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>OpenRA.Renderer.SdlCommon</RootNamespace>
|
||||
<AssemblyName>OpenRA.Renderer.SdlCommon</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
@@ -50,6 +49,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenRA.TilesetBuilder</RootNamespace>
|
||||
<AssemblyName>OpenRA.TilesetBuilder</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ApplicationIcon>tilesetbuilder_icon copy.ico</ApplicationIcon>
|
||||
<FileUpgradeFlags>
|
||||
@@ -60,13 +59,13 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
|
||||
@@ -141,10 +141,10 @@ namespace OpenRA.Utility
|
||||
map.Bounds = Rectangle.FromLTRB(offsetX, offsetY, offsetX + width, offsetY + height);
|
||||
map.Selectable = true;
|
||||
|
||||
map.Smudges = Lazy.New(() => new List<SmudgeReference>());
|
||||
map.Actors = Lazy.New(() => new Dictionary<string, ActorReference>());
|
||||
map.MapResources = Lazy.New(() => new TileReference<byte, byte>[mapSize, mapSize]);
|
||||
map.MapTiles = Lazy.New(() => new TileReference<ushort, byte>[mapSize, mapSize]);
|
||||
map.Smudges = Exts.Lazy(() => new List<SmudgeReference>());
|
||||
map.Actors = Exts.Lazy(() => new Dictionary<string, ActorReference>());
|
||||
map.MapResources = Exts.Lazy(() => new TileReference<byte, byte>[mapSize, mapSize]);
|
||||
map.MapTiles = Exts.Lazy(() => new TileReference<ushort, byte>[mapSize, mapSize]);
|
||||
|
||||
map.Options = new MapOptions();
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenRA.Utility</RootNamespace>
|
||||
<AssemblyName>OpenRA.Utility</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
@@ -56,15 +55,15 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
|
||||
@@ -138,18 +138,18 @@ Section "-DotNet" DotNet
|
||||
IfErrors error 0
|
||||
IntCmp $0 1 0 error 0
|
||||
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
|
||||
IntCmp $0 1 done error done
|
||||
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?" \
|
||||
IDYES download IDNO error2
|
||||
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
|
||||
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."
|
||||
done:
|
||||
SectionEnd
|
||||
|
||||
Reference in New Issue
Block a user