From a9b5e1d911bb91f93bbb6a51d6c2b8ebac92596b Mon Sep 17 00:00:00 2001 From: Thijs Waalen Date: Sat, 6 Sep 2014 19:28:59 +0200 Subject: [PATCH 1/6] LuaDocs spelling fixes --- OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs | 4 ++-- OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs | 2 +- OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs | 2 +- OpenRA.Utility/Command.cs | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs index d8a454c854..8f4d91abfb 100644 --- a/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs @@ -21,7 +21,7 @@ namespace OpenRA.Scripting { public ActorGlobal(ScriptContext context) : base(context) { } - [Desc("Create a new actor. initTable specifies a list of key-value pairs that definite initial parameters for the actor's traits.")] + [Desc("Create a new actor. initTable specifies a list of key-value pairs that define initial parameters for the actors traits.")] public Actor Create(string type, bool addToWorld, LuaTable initTable) { var initDict = new TypeDictionary(); @@ -68,7 +68,7 @@ namespace OpenRA.Scripting return ai.GetBuildTime(); } - [Desc("Returns the cruise altitude of the requested unit type (zero if it ground-based).")] + [Desc("Returns the cruise altitude of the requested unit type (zero if it is ground-based).")] public int CruiseAltitude(string type) { ActorInfo ai; diff --git a/OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs index ca49084cc2..7eb6d180a5 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs @@ -80,7 +80,7 @@ namespace OpenRA.Mods.RA.Scripting } [ScriptActorPropertyActivity] - [Desc("Run an arbitrary lua function.")] + [Desc("Run an arbitrary Lua function.")] public void CallFunc(LuaFunction func) { self.QueueActivity(new CallLuaFunc(func)); diff --git a/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs index ee1e52a064..a72a93944a 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA.Scripting public PlayerProperties(ScriptContext context, Player player) : base(context, player) { } - [Desc("The player's name.")] + [Desc("The players name.")] public string Name { get { return player.PlayerName; } } [Desc("Returns an array of actors representing all ground attack units of this player.")] diff --git a/OpenRA.Utility/Command.cs b/OpenRA.Utility/Command.cs index 4bfd6e74d0..92fa94826e 100644 --- a/OpenRA.Utility/Command.cs +++ b/OpenRA.Utility/Command.cs @@ -396,7 +396,7 @@ namespace OpenRA.Utility { Game.modData = new ModData(args[1]); - Console.WriteLine("This is an automatically generated lising of the new Lua map scripting API, generated for {0} of OpenRA.", Game.modData.Manifest.Mod.Version); + Console.WriteLine("This is an automatically generated listing of the new Lua map scripting API, generated for {0} of OpenRA.", Game.modData.Manifest.Mod.Version); Console.WriteLine(); Console.WriteLine("OpenRA allows custom maps and missions to be scripted using Lua 5.1.\n" + "These scripts run in a sandbox that prevents access to unsafe functions (e.g. OS or file access), " + @@ -408,12 +408,12 @@ namespace OpenRA.Utility Console.WriteLine("Map scripts can interact with the game engine in three ways:\n" + "* Global tables provide functions for interacting with the global world state, or performing general helper tasks.\n" + "They exist in the global namespace, and can be called directly using ```.```.\n" + - "* Individual actors expose a collection of properties and commands that query information of modify their state.\n" + + "* Individual actors expose a collection of properties and commands that query information or modify their state.\n" + " * Some commands, marked as queued activity, are asynchronous. Activities are queued on the actor, and will run in " + "sequence until the queue is empty or the Stop command is called. Actors that are not performing an activity are Idle " + "(actor.IsIdle will return true). The properties and commands available on each actor depends on the traits that the actor " + "specifies in its rule definitions.\n" + - "* Individual players explose a collection of properties and commands that query information of modify their state.\n" + + "* Individual players expose a collection of properties and commands that query information or modify their state.\n" + "The properties and commands available on each actor depends on the traits that the actor specifies in its rule definitions.\n"); Console.WriteLine(); From eb959c585821cbb30fc63c26590b09703754dcd5 Mon Sep 17 00:00:00 2001 From: Thijs Waalen Date: Sat, 6 Sep 2014 19:28:59 +0200 Subject: [PATCH 2/6] LuaDocs punctuation fixes --- OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs | 2 +- OpenRA.Mods.RA/Scripting/Global/MapGlobal.cs | 2 +- OpenRA.Mods.RA/Scripting/Global/TriggerGlobal.cs | 8 ++++---- OpenRA.Mods.RA/Scripting/Global/UtilsGlobal.cs | 4 ++-- .../Scripting/Properties/ProductionProperties.cs | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs index 8f4d91abfb..2db3964360 100644 --- a/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs @@ -58,7 +58,7 @@ namespace OpenRA.Scripting return a; } - [Desc("Returns the build time (in ticks) of the requested unit type")] + [Desc("Returns the build time (in ticks) of the requested unit type.")] public int BuildTime(string type) { ActorInfo ai; diff --git a/OpenRA.Mods.RA/Scripting/Global/MapGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/MapGlobal.cs index d7d45366f7..6c874430b5 100644 --- a/OpenRA.Mods.RA/Scripting/Global/MapGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/MapGlobal.cs @@ -100,7 +100,7 @@ namespace OpenRA.Mods.RA.Scripting } [Desc("Returns the actor that was specified with a given name in " + - "the map file (or nil, if the actor is dead or not found")] + "the map file (or nil, if the actor is dead or not found).")] public Actor NamedActor(string actorName) { Actor ret; diff --git a/OpenRA.Mods.RA/Scripting/Global/TriggerGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/TriggerGlobal.cs index 4fd96055d1..4e00d39da9 100644 --- a/OpenRA.Mods.RA/Scripting/Global/TriggerGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/TriggerGlobal.cs @@ -130,14 +130,14 @@ namespace OpenRA.Mods.RA.Scripting GetScriptTriggers(player.PlayerActor).RegisterCallback(Trigger.OnObjectiveAdded, func, context); } - [Desc("Call a function when this player completes an objective " + + [Desc("Call a function when this player completes an objective. " + "The callback function will be called as func(Player player, int objectiveID).")] public void OnObjectiveCompleted(Player player, LuaFunction func) { GetScriptTriggers(player.PlayerActor).RegisterCallback(Trigger.OnObjectiveCompleted, func, context); } - [Desc("Call a function when this player fails an objective " + + [Desc("Call a function when this player fails an objective. " + "The callback function will be called as func(Player player, int objectiveID).")] public void OnObjectiveFailed(Player player, LuaFunction func) { @@ -165,13 +165,13 @@ namespace OpenRA.Mods.RA.Scripting GetScriptTriggers(a).RegisterCallback(Trigger.OnCapture, func, context); } - [Desc("Removes all triggers from this actor")] + [Desc("Removes all triggers from this actor.")] public void ClearAll(Actor a) { GetScriptTriggers(a).ClearAll(); } - [Desc("Removes the specified trigger from this actor")] + [Desc("Removes the specified trigger from this actor.")] public void Clear(Actor a, string triggerName) { var trigger = (Trigger)Enum.Parse(typeof(Trigger), triggerName); diff --git a/OpenRA.Mods.RA/Scripting/Global/UtilsGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/UtilsGlobal.cs index 95b9c089e3..bfa1b49e8a 100644 --- a/OpenRA.Mods.RA/Scripting/Global/UtilsGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/UtilsGlobal.cs @@ -58,7 +58,7 @@ namespace OpenRA.Mods.RA.Scripting return true; } - [Desc("Skips over the first numElements members of the array and returns the rest")] + [Desc("Skips over the first numElements members of the array and returns the rest.")] public LuaTable Skip(LuaTable table, int numElements) { var t = context.CreateTable(); @@ -75,7 +75,7 @@ namespace OpenRA.Mods.RA.Scripting return table.Values.Random(context.World.SharedRandom); } - [Desc("Expands the given footprint one step along the coordinate axes, and (if requested) diagonals")] + [Desc("Expands the given footprint one step along the coordinate axes, and (if requested) diagonals.")] public LuaTable ExpandFootprint(LuaTable cells, bool allowDiagonal) { var footprint = cells.Values.Select(c => diff --git a/OpenRA.Mods.RA/Scripting/Properties/ProductionProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/ProductionProperties.cs index 6b8596b6a1..5e923fbe73 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/ProductionProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/ProductionProperties.cs @@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA.Scripting } [ScriptActorPropertyActivity] - [Desc("Build a unit, ignoring the production queue. The activity will wait if the exit is blocked")] + [Desc("Build a unit, ignoring the production queue. The activity will wait if the exit is blocked.")] public void Produce(string actorType, string raceVariant = null) { ActorInfo actorInfo; From f47fe759706afc3534a2554b97ac5f0d74d51015 Mon Sep 17 00:00:00 2001 From: Thijs Waalen Date: Sat, 6 Sep 2014 19:28:59 +0200 Subject: [PATCH 3/6] LuaDocs consistency fixes --- .../Scripting/Global/ReinforcementsGlobal.cs | 20 +++++++++---------- .../Properties/MissionObjectiveProperties.cs | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/OpenRA.Mods.RA/Scripting/Global/ReinforcementsGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/ReinforcementsGlobal.cs index c21b66a007..6dc646a029 100644 --- a/OpenRA.Mods.RA/Scripting/Global/ReinforcementsGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/ReinforcementsGlobal.cs @@ -68,10 +68,10 @@ namespace OpenRA.Mods.RA.Scripting } [Desc("Send reinforcements consisting of multiple units. Supports ground-based, naval and air units. " + - "The first member of the 'entryPath' array will be the units' spawnpoint, " + - "while the last one will be their destination. If 'actionFunc' is given, " + - "it will be executed once a unit has reached its destination. 'actionFunc' " + - "will be called as 'actionFunc(Actor actor)'")] + "The first member of the entryPath array will be the units' spawnpoint, " + + "while the last one will be their destination. If actionFunc is given, " + + "it will be executed once a unit has reached its destination. actionFunc " + + "will be called as actionFunc(Actor actor)")] public LuaTable Reinforce(Player owner, LuaTable actorTypes, LuaTable entryPath, int interval = 25, LuaFunction actionFunc = null) { var actors = new List(); @@ -120,13 +120,13 @@ namespace OpenRA.Mods.RA.Scripting } [Desc("Send reinforcements in a transport. A transport can be a ground unit (APC etc.), ships and aircraft. " + - "The first member of the 'entryPath' array will be the spawnpoint for the transport, " + - "while the last one will be its destination. The last member of the 'exitPath' array " + + "The first member of the entryPath array will be the spawnpoint for the transport, " + + "while the last one will be its destination. The last member of the exitPath array " + "is be the place where the transport will be removed from the game. When the transport " + - "has reached the destination, it will unload its cargo unless a custom 'actionFunc' has " + - "been supplied. Afterwards, the transport will follow the 'exitPath' and leave the map, " + - "unless a custom 'exitFunc' has been supplied. 'actionFunc' will be called as " + - "'actionFunc(Actor transport, Actor[] cargo). 'exitFunc' will be called as 'exitFunc(Actor transport)'.")] + "has reached the destination, it will unload its cargo unless a custom actionFunc has " + + "been supplied. Afterwards, the transport will follow the exitPath and leave the map, " + + "unless a custom exitFunc has been supplied. actionFunc will be called as " + + "actionFunc(Actor transport, Actor[] cargo). exitFunc will be called as exitFunc(Actor transport).")] public LuaTable ReinforceWithTransport(Player owner, string actorType, LuaTable cargoTypes, LuaTable entryPath, LuaTable exitPath = null, LuaFunction actionFunc = null, LuaFunction exitFunc = null) { diff --git a/OpenRA.Mods.RA/Scripting/Properties/MissionObjectiveProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/MissionObjectiveProperties.cs index 89a14e9b14..d18c8eea55 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/MissionObjectiveProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/MissionObjectiveProperties.cs @@ -61,7 +61,7 @@ namespace OpenRA.Mods.RA.Scripting } [ScriptActorPropertyActivity] - [Desc("Returns true if 'player' has lost all units/actors that have the 'MustBeDestroyed' trait.")] + [Desc("Returns true if the player has lost all units/actors that have the MustBeDestroyed trait.")] public bool HasNoRequiredUnits() { return player.HasNoRequiredUnits(); From 4f4bdf249b67f311a829ce9dbf08a87a83463bcb Mon Sep 17 00:00:00 2001 From: Thijs Waalen Date: Sat, 6 Sep 2014 21:42:19 +0200 Subject: [PATCH 4/6] Fix wrong changes of possessive --- OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs | 2 +- OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs index 2db3964360..ccb8854a70 100644 --- a/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs @@ -21,7 +21,7 @@ namespace OpenRA.Scripting { public ActorGlobal(ScriptContext context) : base(context) { } - [Desc("Create a new actor. initTable specifies a list of key-value pairs that define initial parameters for the actors traits.")] + [Desc("Create a new actor. initTable specifies a list of key-value pairs that define initial parameters for the actor's traits.")] public Actor Create(string type, bool addToWorld, LuaTable initTable) { var initDict = new TypeDictionary(); diff --git a/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs index a72a93944a..ee1e52a064 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA.Scripting public PlayerProperties(ScriptContext context, Player player) : base(context, player) { } - [Desc("The players name.")] + [Desc("The player's name.")] public string Name { get { return player.PlayerName; } } [Desc("Returns an array of actors representing all ground attack units of this player.")] From 3a80ee27cdcc97982c4efd8d60863386edc7e75c Mon Sep 17 00:00:00 2001 From: Thijs Waalen Date: Sat, 6 Sep 2014 21:56:33 +0200 Subject: [PATCH 5/6] Fix spelling for Actor.Create description --- OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs index ccb8854a70..c7c3ba6554 100644 --- a/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/ActorGlobal.cs @@ -21,7 +21,7 @@ namespace OpenRA.Scripting { public ActorGlobal(ScriptContext context) : base(context) { } - [Desc("Create a new actor. initTable specifies a list of key-value pairs that define initial parameters for the actor's traits.")] + [Desc("Create a new actor. initTable specifies a list of key-value pairs that defines the initial parameters for the actor's traits.")] public Actor Create(string type, bool addToWorld, LuaTable initTable) { var initDict = new TypeDictionary(); From de66e947e022dcb8671ca54a43dda4868b401242 Mon Sep 17 00:00:00 2001 From: Thijs Waalen Date: Sun, 7 Sep 2014 00:21:38 +0200 Subject: [PATCH 6/6] Changed "the player" to "this player" for the mission objective properties --- .../Scripting/Properties/MissionObjectiveProperties.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.RA/Scripting/Properties/MissionObjectiveProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/MissionObjectiveProperties.cs index d18c8eea55..7259ba81c6 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/MissionObjectiveProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/MissionObjectiveProperties.cs @@ -44,7 +44,7 @@ namespace OpenRA.Mods.RA.Scripting [ScriptActorPropertyActivity] [Desc("Mark an objective as completed. This needs the objective ID returned " + - "by AddObjective as argument. When the player has completed all primary " + + "by AddObjective as argument. When this player has completed all primary " + "objectives, (s)he has won the game.")] public void MarkCompletedObjective(int id) { @@ -61,7 +61,7 @@ namespace OpenRA.Mods.RA.Scripting } [ScriptActorPropertyActivity] - [Desc("Returns true if the player has lost all units/actors that have the MustBeDestroyed trait.")] + [Desc("Returns true if this player has lost all units/actors that have the MustBeDestroyed trait.")] public bool HasNoRequiredUnits() { return player.HasNoRequiredUnits();