Merge pull request #11017 from Mailaender/radar-refactor

Grouped the radar traits together
This commit is contained in:
reaperrr
2016-04-12 17:07:01 +02:00
8 changed files with 34 additions and 16 deletions

View File

@@ -260,7 +260,6 @@
<Compile Include="Traits\Air\FlyAwayOnIdle.cs" />
<Compile Include="Traits\Air\FallsToEarth.cs" />
<Compile Include="Traits\Air\ReturnOnIdle.cs" />
<Compile Include="Traits\AppearsOnRadar.cs" />
<Compile Include="Traits\Armament.cs" />
<Compile Include="Traits\Armor.cs" />
<Compile Include="Traits\AttackMove.cs" />
@@ -403,12 +402,10 @@
<Compile Include="Traits\ProductionFromMapEdge.cs" />
<Compile Include="Traits\ProductionParadrop.cs" />
<Compile Include="Traits\ProductionQueueFromSelection.cs" />
<Compile Include="Traits\ProvidesRadar.cs" />
<Compile Include="Traits\ProximityCaptor.cs" />
<Compile Include="Traits\ProximityCapturable.cs" />
<Compile Include="Traits\BodyOrientation.cs" />
<Compile Include="Traits\QuantizeFacingsFromSequence.cs" />
<Compile Include="Traits\RadarColorFromTerrain.cs" />
<Compile Include="Traits\Render\AutoSelectionSize.cs" />
<Compile Include="Traits\Render\Hovers.cs" />
<Compile Include="Traits\Render\LeavesTrails.cs" />
@@ -739,6 +736,10 @@
<Compile Include="Traits\World\MissionData.cs" />
<Compile Include="UtilityCommands\ExtractMapRules.cs" />
<Compile Include="Traits\ScriptTags.cs" />
<Compile Include="Traits\Radar\AppearsOnRadar.cs" />
<Compile Include="Traits\Radar\ProvidesRadar.cs" />
<Compile Include="Traits\Radar\RadarColorFromTerrain.cs" />
<Compile Include="Traits\Radar\JamsRadar.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>

View File

@@ -15,6 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Attach this to the player actor.")]
public class PowerManagerInfo : ITraitInfo, Requires<DeveloperModeInfo>
{
public readonly int AdviceInterval = 250;

View File

@@ -15,7 +15,7 @@ using System.Linq;
using OpenRA.Primitives;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
namespace OpenRA.Mods.Common.Traits.Radar
{
public class AppearsOnRadarInfo : ITraitInfo
{

View File

@@ -0,0 +1,24 @@
#region Copyright & License Information
/*
* Copyright 2007-2016 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, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Radar
{
[Desc("When an actor with this trait is in range of an actor with ProvidesRadar, it will temporarily disable the radar minimap for the enemy player.")]
public class JamsRadarInfo : TraitInfo<JamsRadar>
{
[Desc("Range for jamming.")]
public readonly WDist Range = WDist.Zero;
}
public class JamsRadar { }
}

View File

@@ -12,7 +12,7 @@
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
namespace OpenRA.Mods.Common.Traits.Radar
{
[Desc("This actor enables the radar minimap.")]
public class ProvidesRadarInfo : TraitInfo<ProvidesRadar> { }
@@ -33,13 +33,4 @@ namespace OpenRA.Mods.Common.Traits
> a.Actor.Info.TraitInfo<JamsRadarInfo>().Range.LengthSquared);
}
}
[Desc("When an actor with this trait is in range of an actor with ProvidesRadar, it will temporarily disable the radar minimap for the enemy player.")]
public class JamsRadarInfo : TraitInfo<JamsRadar>
{
[Desc("Range for jamming.")]
public readonly WDist Range = WDist.Zero;
}
public class JamsRadar { }
}

View File

@@ -12,7 +12,7 @@
using System.Drawing;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
namespace OpenRA.Mods.Common.Traits.Radar
{
public class RadarColorFromTerrainInfo : ITraitInfo
{

View File

@@ -11,7 +11,7 @@
using System.Drawing;
using System.Linq;
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.Common.Traits.Radar;
using OpenRA.Traits;
using OpenRA.Widgets;

View File

@@ -14,6 +14,7 @@ using System.Drawing;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.Common.Traits.Radar;
using OpenRA.Traits;
namespace OpenRA.Mods.RA.Traits