Merge pull request #9134 from clemty/docs

minor LUA and trait documentation fixes, whitespace fixes
This commit is contained in:
reaperrr
2015-08-24 21:26:20 +02:00
28 changed files with 51 additions and 51 deletions

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Scripting
radarPings = context.World.WorldActor.TraitOrDefault<RadarPings>();
}
[Desc("Creates a new beacon that stays for the specified time at the specified WPos." +
[Desc("Creates a new beacon that stays for the specified time at the specified WPos. " +
"Does not remove player set beacons, nor gets removed by placing them.")]
public Beacon New(Player owner, WPos position, int duration = 30 * 25, bool showRadarPings = true, string palettePrefix = "player")
{

View File

@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Create a new WDist.")]
public WDist New(int r) { return new WDist(r); }
[Desc("Create a new WDist by cell distance")]
[Desc("Create a new WDist by cell distance.")]
public WDist FromCells(int numCells) { return WDist.FromCells(numCells); }
}

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Scripting
get { return DateTime.Today.Month == 10 && DateTime.Today.Day == 31; }
}
[Desc("Get the current game time (in ticks)")]
[Desc("Get the current game time (in ticks).")]
public int GameTime
{
get { return Context.World.WorldTick; }

View File

@@ -283,8 +283,8 @@ namespace OpenRA.Mods.Common.Scripting
}
}
[Desc("Call a function when a ground-based actor enters this cell footprint." +
"Returns the trigger id for later removal using RemoveFootprintTrigger(int id)." +
[Desc("Call a function when a ground-based actor enters this cell footprint. " +
"Returns the trigger id for later removal using RemoveFootprintTrigger(int id). " +
"The callback function will be called as func(Actor a, int id).")]
public int OnEnteredFootprint(CPos[] cells, LuaFunction func)
{
@@ -309,8 +309,8 @@ namespace OpenRA.Mods.Common.Scripting
return triggerId;
}
[Desc("Call a function when a ground-based actor leaves this cell footprint." +
"Returns the trigger id for later removal using RemoveFootprintTrigger(int id)." +
[Desc("Call a function when a ground-based actor leaves this cell footprint. " +
"Returns the trigger id for later removal using RemoveFootprintTrigger(int id). " +
"The callback function will be called as func(Actor a, int id).")]
public int OnExitedFootprint(CPos[] cells, LuaFunction func)
{
@@ -341,8 +341,8 @@ namespace OpenRA.Mods.Common.Scripting
Context.World.ActorMap.RemoveCellTrigger(id);
}
[Desc("Call a function when an actor enters this range." +
"Returns the trigger id for later removal using RemoveProximityTrigger(int id)." +
[Desc("Call a function when an actor enters this range. " +
"Returns the trigger id for later removal using RemoveProximityTrigger(int id). " +
"The callback function will be called as func(Actor a, int id).")]
public int OnEnteredProximityTrigger(WPos pos, WDist range, LuaFunction func)
{
@@ -367,8 +367,8 @@ namespace OpenRA.Mods.Common.Scripting
return triggerId;
}
[Desc("Call a function when an actor leaves this range." +
"Returns the trigger id for later removal using RemoveProximityTrigger(int id)." +
[Desc("Call a function when an actor leaves this range. " +
"Returns the trigger id for later removal using RemoveProximityTrigger(int id). " +
"The callback function will be called as func(Actor a, int id).")]
public int OnExitedProximityTrigger(WPos pos, WDist range, LuaFunction func)
{
@@ -393,7 +393,7 @@ namespace OpenRA.Mods.Common.Scripting
return triggerId;
}
[Desc("Removes a previously created proximitry trigger.")]
[Desc("Removes a previously created proximity trigger.")]
public void RemoveProximityTrigger(int id)
{
Context.World.ActorMap.RemoveProximityTrigger(id);
@@ -407,20 +407,20 @@ namespace OpenRA.Mods.Common.Scripting
}
[Desc("Call a function when this actor is discovered by an enemy or a player with a Neutral stance. " +
"The callback function will be called as func(Actor discovered, Player discoverer)")]
"The callback function will be called as func(Actor discovered, Player discoverer).")]
public void OnDiscovered(Actor a, LuaFunction func)
{
GetScriptTriggers(a).RegisterCallback(Trigger.OnDiscovered, func, Context);
}
[Desc("Call a function when this player is discovered by an enemy or neutral player. " +
"The callback function will be called as func(Player discovered, Player discoverer, Actor discoveredActor)")]
"The callback function will be called as func(Player discovered, Player discoverer, Actor discoveredActor).")]
public void OnPlayerDiscovered(Player discovered, LuaFunction func)
{
GetScriptTriggers(discovered.PlayerActor).RegisterCallback(Trigger.OnPlayerDiscovered, func, Context);
}
[Desc("Removes all triggers from this actor." +
[Desc("Removes all triggers from this actor. " +
"Note that the removal will only take effect at the end of a tick, " +
"so you must not add new triggers at the same time that you are calling this function.")]
public void ClearAll(Actor a)
@@ -428,7 +428,7 @@ namespace OpenRA.Mods.Common.Scripting
GetScriptTriggers(a).ClearAll();
}
[Desc("Removes the specified trigger from this actor." +
[Desc("Removes the specified trigger from this actor. " +
"Note that the removal will only take effect at the end of a tick, " +
"so you must not add new triggers at the same time that you are calling this function.")]
public void Clear(Actor a, string triggerName)

View File

@@ -108,7 +108,7 @@ namespace OpenRA.Mods.Common.Scripting
}
[ScriptActorPropertyActivity]
[Desc("Returns true if this player has lost all units/actors that have" +
[Desc("Returns true if this player has lost all units/actors that have " +
"the MustBeDestroyed trait (according to the short game option).")]
public bool HasNoRequiredUnits()
{

View File

@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Scripting
}
[ScriptActorPropertyActivity]
[Desc("Moves from outside the world into the cell grid")]
[Desc("Moves from outside the world into the cell grid.")]
public void MoveIntoWorld(CPos cell)
{
Self.QueueActivity(mobile.MoveIntoWorld(Self, cell, mobile.ToSubCell));

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Scripting
.ToArray();
}
[Desc("Returns all living actors of the specified type of this player")]
[Desc("Returns all living actors of the specified type of this player.")]
public Actor[] GetActorsByType(string type)
{
var result = new List<Actor>();

View File

@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Scripting
rp = self.Trait<RallyPoint>();
}
[Desc("Query or set a factory's rally point")]
[Desc("Query or set a factory's rally point.")]
public CPos RallyPoint
{
get { return rp.Location; }
@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Scripting
pb = self.Trait<PrimaryBuilding>();
}
[Desc("Query or set the factory's primary building status")]
[Desc("Query or set the factory's primary building status.")]
public bool IsPrimaryBuilding
{
get { return pb.IsPrimary; }
@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Scripting
return true;
}
[Desc("Check whether the factory's production queue that builds this type of actor is currently busy." +
[Desc("Check whether the factory's production queue that builds this type of actor is currently busy. " +
"Note: it does not check whether this particular type of actor is being produced.")]
public bool IsProducing(string actorType)
{
@@ -204,7 +204,7 @@ namespace OpenRA.Mods.Common.Scripting
"If an actionFunc is given, it will be called as actionFunc(Actor[] actors) once " +
"production of all actors has been completed. The actors array is guaranteed to " +
"only contain alive actors. Note: This function will fail to work when called " +
"during the first tick")]
"during the first tick.")]
public bool Build(string[] actorTypes, LuaFunction actionFunc = null)
{
var typeToQueueMap = new Dictionary<string, string>();
@@ -252,7 +252,7 @@ namespace OpenRA.Mods.Common.Scripting
return true;
}
[Desc("Check whether the production queue that builds this type of actor is currently busy." +
[Desc("Check whether the production queue that builds this type of actor is currently busy. " +
"Note: it does not check whether this particular type of actor is being produced.")]
public bool IsProducing(string actorType)
{

View File

@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits
{
class C4DemolitionInfo : ITraitInfo
{
[Desc("Delay to demolish the target once the C4 is planted." +
[Desc("Delay to demolish the target once the C4 is planted. " +
"Measured in game ticks. Default is 1.8 seconds.")]
public readonly int C4Delay = 45;

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Be sure to use lowercase. Default value is \"e1\".")]
public readonly string[] ActorTypes = { "e1" };
[Desc("Spawns actors only if the selling player's faction is in this list." +
[Desc("Spawns actors only if the selling player's faction is in this list. " +
"Leave empty to allow all factions by default.")]
public readonly string[] Factions = { };

View File

@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Palette to render the sprite in. Reference the world actor's PaletteFrom* traits.")]
[PaletteReference] public readonly string Palette = "chrome";
[Desc("Point in the actor's bounding box used as reference for offsetting the decoration image." +
[Desc("Point in the actor's bounding box used as reference for offsetting the decoration image. " +
"Possible values are any combination of Top, VCenter, Bottom and Left, HCenter, Right separated by a comma.")]
public readonly ReferencePoints ReferencePoint = ReferencePoints.Top | ReferencePoints.Left;

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("The upgrades to grant when deploying and revoke when undeploying.")]
public readonly string[] Upgrades = { };
[Desc("The terrain types that this actor can deploy on to receive these upgrades." +
[Desc("The terrain types that this actor can deploy on to receive these upgrades. " +
"Leave empty to allow any.")]
public readonly string[] AllowedTerrainTypes = { };

View File

@@ -35,7 +35,7 @@ namespace OpenRA.Mods.RA.Traits
[Desc("Map player to use when 'InternalName' is defined on 'OwnerType'.")]
public readonly string InternalOwner = null;
[Desc("DeathType that triggers the actor spawn." +
[Desc("DeathType that triggers the actor spawn. " +
"Leave empty to spawn an actor ignoring the DeathTypes.")]
public readonly string DeathType = null;

View File

@@ -14,7 +14,7 @@ NodHelis = {
{ DateTime.Seconds(HeliDelay[1]), { NodHeliEntry.Location, NodHeliLZ1.Location }, { "e1", "e1", "e3" } },
{ DateTime.Seconds(HeliDelay[2]), { NodHeliEntry.Location, NodHeliLZ2.Location }, { "e1", "e1", "e1", "e1" } },
{ DateTime.Seconds(HeliDelay[3]), { NodHeliEntry.Location, NodHeliLZ3.Location }, { "e1", "e1", "e3" } }
}
}
SendHeli = function(heli)
units = Reinforcements.ReinforceWithTransport(nod, "tran", heli[3], heli[2], { heli[2][1] })