Skip to content

Commit 2a63ec6

Browse files
committed
Merge branch 'lua-docs-grammar-fixes' into 'master'
Lua docs: minor grammar fixes (mostly missing articles) See merge request OpenMW/openmw!4996
2 parents 422e113 + dfc1345 commit 2a63ec6

File tree

19 files changed

+105
-102
lines changed

19 files changed

+105
-102
lines changed

files/data/openmw_aux/time.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ end
5151

5252
---
5353
-- Run given function repeatedly.
54-
-- Note that loading a save stops the evaluation. If it should work always, call it during initialization of the script (i.e. not in a handler)
54+
-- Note that loading a save stops the evaluation. If it should always work, call it during the initialization of the script (i.e. not in a handler)
5555
-- @function [parent=#time] runRepeatedly
5656
-- @param #function fn the function that should be called
5757
-- @param #number period interval

files/data/openmw_aux/util.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ local function deepToString(val, level, prefix)
2323
end
2424

2525
---
26-
-- Works like `tostring` but shows also content of tables.
26+
-- Works like `tostring` but also shows the content of tables.
2727
-- @function [parent=#util] deepToString
28-
-- @param #any value The value to convert to string
29-
-- @param #number maxDepth Max depth of tables unpacking (optional, 1 by default)
28+
-- @param #any value The value to convert to a string
29+
-- @param #number maxDepth Max depth of table unpacking (optional, 1 by default)
3030
function aux_util.deepToString(value, maxDepth)
3131
return deepToString(value, maxDepth, '')
3232
end
3333

3434
---
35-
-- Finds the element the minimizes `scoreFn`.
35+
-- Finds the element in the array given the lowest score by `scoreFn`.
3636
-- @function [parent=#util] findMinScore
3737
-- @param #table array Any array
3838
-- @param #function scoreFn Function that returns either nil/false or a number for each element of the array
39-
-- @return element The element the minimizes `scoreFn`
40-
-- @return #number score The output of `scoreFn(element)`
39+
-- @return element The element given the lowest score
40+
-- @return #number score The score given to the chosen element by `scoreFn`
4141
-- @return #number index The index of the chosen element in the array
4242
-- @usage -- Find the nearest NPC
4343
-- local nearestNPC, distToNPC = aux_util.findMinScore(

files/data/scripts/omw/activationhandlers.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ return {
5858
-- @field [parent=#Activation] #number version
5959
version = 0,
6060

61-
--- Add new activation handler for a specific object.
61+
--- Add a new activation handler for a specific object.
6262
-- If `handler(object, actor)` returns false, other handlers for
6363
-- the same object (including type handlers) will be skipped.
6464
-- @function [parent=#Activation] addHandlerForObject
@@ -73,7 +73,7 @@ return {
7373
handlers[#handlers + 1] = handler
7474
end,
7575

76-
--- Add new activation handler for a type of objects.
76+
--- Add a new activation handler for a type of object.
7777
-- If `handler(object, actor)` returns false, other handlers for
7878
-- the same object (including type handlers) will be skipped.
7979
-- @function [parent=#Activation] addHandlerForType

files/data/scripts/omw/ai.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ return {
8686
-- @return #boolean
8787
isFleeing = function() return self:_isFleeing() end,
8888

89-
--- Start new AI package.
89+
--- Start a new AI package.
9090
-- @function [parent=#AI] startPackage
9191
-- @param #table options See the "AI packages" page.
9292
startPackage = startPackage,
@@ -128,7 +128,7 @@ return {
128128
end
129129
end,
130130

131-
--- Get list of targets of all packages of the given type.
131+
--- Get a list of targets from all packages of the given type.
132132
-- @function [parent=#AI] getTargets
133133
-- @param #string packageType
134134
-- @return #list<openmw.core#GameObject>

files/data/scripts/omw/camera/camera.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,16 @@ return {
250250
-- @field [parent=#Camera] #number version
251251
version = 1,
252252

253-
--- Return primary mode (MODE.FirstPerson or MODE.ThirdPerson).
253+
--- Return the primary mode (MODE.FirstPerson or MODE.ThirdPerson).
254254
-- @function [parent=#Camera] getPrimaryMode
255255
-- @return #number @{openmw.camera#MODE}
256256
getPrimaryMode = function() return primaryMode end,
257257

258-
--- Get base third person distance (without applying angle and speed modifiers).
258+
--- Get the base third person distance (without applying angle and speed modifiers).
259259
-- @function [parent=#Camera] getBaseThirdPersonDistance
260260
-- @return #number
261261
getBaseThirdPersonDistance = function() return third_person.baseDistance end,
262-
--- Set base third person distance
262+
--- Set the base third person distance
263263
-- @function [parent=#Camera] setBaseThirdPersonDistance
264264
-- @param #number value
265265
setBaseThirdPersonDistance = function(v) third_person.baseDistance = v end,

files/data/scripts/omw/combat/local.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ end
299299

300300
---
301301
-- @type AttackInfo
302-
-- @field [parent=#AttackInfo] #table damage A table mapping stat name (health, fatigue, or magicka) to number. For example, {health = 50, fatigue = 10} will cause 50 damage to health and 10 to fatigue (before adjusting for armor and difficulty). This field is ignored for failed attacks.
302+
-- @field [parent=#AttackInfo] #table damage A table mapping a stat name (health, fatigue, or magicka) to a number. For example, {health = 50, fatigue = 10} will cause 50 damage to health and 10 to fatigue (before adjusting for armor and difficulty). This field is ignored for failed attacks.
303303
-- @field [parent=#AttackInfo] #number strength A number between 0 and 1 representing the attack strength. This field is ignored for failed attacks.
304304
-- @field [parent=#AttackInfo] #boolean successful Whether the attack was successful or not.
305305
-- @field [parent=#AttackInfo] #AttackSourceType sourceType What class of attack this is.
@@ -333,7 +333,7 @@ return {
333333

334334
--- Add new onHit handler for this actor
335335
-- If `handler(attack)` returns false, other handlers for
336-
-- the call will be skipped. where attack is the same @{#AttackInfo} passed to #Combat.onHit
336+
-- the call will be skipped. Where attack is the same @{#AttackInfo} passed to #Combat.onHit
337337
-- @function [parent=#Combat] addOnHitHandler
338338
-- @param #function handler The handler.
339339
addOnHitHandler = function(handler)
@@ -349,7 +349,7 @@ return {
349349
-- @return #number Damage adjusted for armor
350350
adjustDamageForArmor = function(damage, actor) return adjustDamageForArmor(damage, actor or self) end,
351351

352-
--- Calculates a difficulty multiplier based on current difficulty settings
352+
--- Calculates a difficulty multiplier based on the current difficulty settings
353353
-- and adjusts damage accordingly. Has no effect if both this actor and the
354354
-- attacker are NPCs, or if both are Players.
355355
-- @function [parent=#Combat] adjustDamageForDifficulty

files/data/scripts/omw/crimes.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ local I = require('openmw.interfaces')
77
-- @field openmw.core#GameObject victim The victim of the crime (optional)
88
-- @field openmw.types#OFFENSE_TYPE_IDS type The type of the crime to commit. See @{openmw.types#OFFENSE_TYPE_IDS} (required)
99
-- @field #string faction ID of the faction the crime is committed against (optional)
10-
-- @field #number arg The amount to increase the player bounty by, if the crime type is theft. Ignored otherwise (optional, defaults to 0)
10+
-- @field #number arg The amount to increase the player bounty by if the crime type is theft. Ignored otherwise (optional, defaults to 0)
1111
-- @field #boolean victimAware Whether the victim is aware of the crime (optional, defaults to false)
1212

1313
---

files/data/scripts/omw/mechanics/animationcontroller.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ return {
100100
-- @param #table options The table of play options that will be passed to @{openmw.animation#playBlended}
101101
playBlendedAnimation = playBlendedAnimation,
102102

103-
--- Add new playBlendedAnimation handler for this actor
103+
--- Add a new playBlendedAnimation handler for this actor
104104
-- If `handler(groupname, options)` returns false, other handlers for
105105
-- the call will be skipped.
106106
-- @function [parent=#AnimationController] addPlayBlendedAnimationHandler
@@ -109,13 +109,13 @@ return {
109109
playBlendedHandlers[#playBlendedHandlers + 1] = handler
110110
end,
111111

112-
--- Add new text key handler for this actor
112+
--- Add a new text key handler for this actor
113113
-- While playing, some animations emit text key events. Register a handle to listen for all
114114
-- text key events associated with this actor's animations.
115115
-- If `handler(groupname, key)` returns false, other handlers for
116116
-- the call will be skipped.
117117
-- @function [parent=#AnimationController] addTextKeyHandler
118-
-- @param #string groupname Name of the animation group to listen to keys for. If the empty string or nil, all keys will be received
118+
-- @param #string groupname Name of the animation group to listen to keys for. If it is an empty string or nil, all keys will be received
119119
-- @param #function handler The handler.
120120
addTextKeyHandler = function(groupname, handler)
121121
if not groupname then

files/data/scripts/omw/skillhandlers.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ local NPC = require('openmw.types').NPC
77
local Skill = core.stats.Skill
88

99
---
10-
-- Table of skill use types defined by morrowind.
10+
-- Table of skill use types defined by Morrowind.
1111
-- Each entry corresponds to an index into the available skill gain values
1212
-- of a @{openmw.core#SkillRecord}
1313
-- @type SkillUseType
@@ -188,7 +188,7 @@ return {
188188
-- If `handler(skillid, source, options)` returns false, other handlers (including the default skill level up handler)
189189
-- will be skipped. Where skillid and source are the parameters passed to @{#SkillProgression.skillLevelUp}, and options is
190190
-- a modifiable table of skill level up values, and can be modified to change the behavior of later handlers.
191-
-- These values are calculated based on vanilla mechanics. Setting any value to nil will cause that mechanic to be skipped. By default contains these values:
191+
-- These values are calculated based on vanilla mechanics. Setting any value to nil will cause that mechanic to be skipped. By default it contains these values:
192192
--
193193
-- * `skillIncreaseValue` - The numeric amount of skill levels gained. By default this is 1, except when the source is jail in which case it will instead be -1 for all skills except sneak and security.
194194
-- * `levelUpProgress` - The numeric amount of level up progress gained.
@@ -216,7 +216,7 @@ return {
216216

217217
--- Trigger a skill use, activating relevant handlers
218218
-- @function [parent=#SkillProgression] skillUsed
219-
-- @param #string skillid The if of the skill that was used
219+
-- @param #string skillid The ID of the skill that was used
220220
-- @param options A table of parameters. Must contain one of `skillGain` or `useType`. It's best to always include `useType` if applicable, even if you set `skillGain`, as it may be used
221221
-- by handlers to make decisions. See the addSkillUsedHandler example at the top of this page.
222222
--

files/data/scripts/omw/usehandlers.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ return {
5858
handlers[#handlers + 1] = handler
5959
end,
6060

61-
--- Add new use action handler for a type of objects.
61+
--- Add new use action handler for a type of object.
6262
-- If `handler(object, actor, options)` returns false, other handlers for
6363
-- the same object (including type handlers) will be skipped.
6464
-- @function [parent=#ItemUsage] addHandlerForType

0 commit comments

Comments
 (0)