Added a bunch of TraitLocationAttributes

Also moved a few traits to their proper subfolders.
This commit is contained in:
penev92
2021-10-12 23:40:07 +03:00
committed by Matthias Mailänder
parent 67598dd151
commit f056cbba13
31 changed files with 31 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Traits
{
[TraitLocation(SystemActors.EditorWorld)]
class TSEditorResourceLayerInfo : EditorResourceLayerInfo, Requires<EditorActorLayerInfo>
{
public readonly string VeinType = "Veins";

View File

@@ -18,6 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Traits
{
[TraitLocation(SystemActors.World)]
class TSResourceLayerInfo : ResourceLayerInfo
{
public readonly string VeinType = "Veins";

View File

@@ -13,9 +13,11 @@ using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Traits
{
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
[Desc("Renders the Tiberian Sun Tiberium resources.", "Attach this to the world actor")]
public class TSTiberiumRendererInfo : ResourceRendererInfo
{

View File

@@ -19,6 +19,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Traits
{
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
[Desc("Renders the Tiberian Sun Vein resources.", "Attach this to the world actor")]
public class TSVeinsRendererInfo : TraitInfo, Requires<IResourceLayerInfo>, IMapPreviewSignatureInfo
{

View File

@@ -15,6 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Traits
{
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
public class VoxelNormalsPaletteInfo : TraitInfo
{
[PaletteDefinition]

View File

@@ -16,6 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
public class CloakPaletteEffectInfo : TraitInfo<CloakPaletteEffect> { }
public class CloakPaletteEffect : IPaletteModifier, ITick

View File

@@ -17,6 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Used for day/night effects.")]
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
public class GlobalLightingPaletteEffectInfo : TraitInfo, ILobbyCustomRulesIgnore
{
[Desc("Do not modify graphics that use any palette in this list.")]

View File

@@ -14,6 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("A placeholder bot that doesn't do anything.")]
[TraitLocation(SystemActors.Player)]
public sealed class DummyBotInfo : TraitInfo, IBotInfo
{
[Desc("Human-readable name this bot uses.")]

View File

@@ -18,6 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Bot that uses BotModules.")]
[TraitLocation(SystemActors.Player)]
public sealed class ModularBotInfo : TraitInfo, IBotInfo
{
[FieldLoader.Require]

View File

@@ -26,6 +26,7 @@ namespace OpenRA.Mods.Common.Traits
CPos Location { get; }
}
[TraitLocation(SystemActors.World)]
class BridgeLayerInfo : TraitInfo
{
public override object Create(ActorInitializer init) { return new BridgeLayer(init.World); }

View File

@@ -17,6 +17,7 @@ namespace OpenRA.Mods.Common.Traits
{
[Desc("Sets a custom terrain type for cells that are obscured by back-facing cliffs.",
"This trait replicates the default CliffBackImpassability=2 behaviour from the TS/RA2 rules.ini.")]
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
class CliffBackImpassabilityLayerInfo : TraitInfo
{
public readonly string TerrainType = "Impassable";

View File

@@ -18,6 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[TraitLocation(SystemActors.World)]
[Desc("Configuration options for the lobby player color picker. Attach this to the world actor.")]
public class ColorPickerManagerInfo : TraitInfo<ColorPickerManager>, IRulesetLoaded
{

View File

@@ -16,6 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[TraitLocation(SystemActors.World)]
public class ElevatedBridgeLayerInfo : TraitInfo, Requires<DomainIndexInfo>, ILobbyCustomRulesIgnore
{
[Desc("Terrain type used by cells outside any elevated bridge footprint.")]

View File

@@ -18,6 +18,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Placeholder to make static elevated bridges work.",
"Define individual trait instances for each elevated bridge footprint in the map.")]
[TraitLocation(SystemActors.World)]
public class ElevatedBridgePlaceholderInfo : TraitInfo<ElevatedBridgePlaceholder>, Requires<ElevatedBridgeLayerInfo>, ILobbyCustomRulesIgnore
{
[FieldLoader.Require]

View File

@@ -15,6 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[TraitLocation(SystemActors.World)]
public class ExitsDebugOverlayManagerInfo : TraitInfo
{
[Desc("The font used to draw cell vectors. Should match the value as-is in the Fonts section of the mod manifest (do not convert to lowercase).")]

View File

@@ -15,6 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[TraitLocation(SystemActors.World)]
public class JumpjetActorLayerInfo : TraitInfo
{
[Desc("Terrain type of the airborne layer.")]

View File

@@ -10,9 +10,11 @@
#endregion
using System.Collections.Generic;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
[Desc("Used by Mobile. Required for jumpjet actors. Attach these to the world actor. You can have multiple variants by adding @suffixes.")]
public class JumpjetLocomotorInfo : LocomotorInfo
{

View File

@@ -14,6 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Defines the FMVs that can be played by missions.")]
[TraitLocation(SystemActors.World)]
public class MissionDataInfo : TraitInfo<MissionData>
{
[Desc("Briefing text displayed in the mission browser.")]

View File

@@ -15,6 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Controls the map difficulty, tech level, and short game lobby options.")]
[TraitLocation(SystemActors.World)]
public class ScriptLobbyDropdownInfo : TraitInfo, ILobbyOptions
{
[FieldLoader.Require]

View File

@@ -15,6 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[TraitLocation(SystemActors.World)]
public class SubterraneanActorLayerInfo : TraitInfo
{
[Desc("Terrain type of the underground layer.")]

View File

@@ -10,10 +10,12 @@
#endregion
using System.Collections.Generic;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Used by Mobile. Required for subterranean actors. Attach these to the world actor. You can have multiple variants by adding @suffixes.")]
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
public class SubterraneanLocomotorInfo : LocomotorInfo
{
[Desc("Pathfinding cost for submerging or reemerging.")]

View File

@@ -17,6 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
[Desc("Add to the world actor to apply a global lighting tint and allow actors using the TerrainLightSource to add localised lighting.")]
public class TerrainLightingInfo : TraitInfo, ILobbyCustomRulesIgnore
{

View File

@@ -15,6 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[TraitLocation(SystemActors.World)]
public class TerrainTunnelInfo : TraitInfo<TerrainTunnel>, Requires<TerrainTunnelLayerInfo>, ILobbyCustomRulesIgnore
{
[FieldLoader.Require]

View File

@@ -16,6 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[TraitLocation(SystemActors.World)]
public class TerrainTunnelLayerInfo : TraitInfo, Requires<DomainIndexInfo>, ILobbyCustomRulesIgnore
{
[Desc("Terrain type used by cells outside any tunnel footprint.")]

View File

@@ -18,6 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Adds a particle-based overlay.")]
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
public class WeatherOverlayInfo : TraitInfo, ILobbyCustomRulesIgnore
{
[Desc("Average number of particles per 100x100 px square.")]

View File

@@ -15,6 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.D2k.Traits
{
[TraitLocation(SystemActors.Player)]
[Desc("A player with this trait will receive a free harvester when his last one gets eaten by a sandworm, provided he has at least one refinery.")]
public class HarvesterInsuranceInfo : TraitInfo
{

View File

@@ -16,6 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.D2k.Traits
{
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
class D2kFogPaletteInfo : TraitInfo
{
[PaletteDefinition]

View File

@@ -17,6 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.D2k.Traits
{
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
[Desc("Create a palette by applying a scale and offset to the colors in another palette.")]
class PaletteFromScaledPaletteInfo : TraitInfo
{