Skip to content

Commit 3fc93ed

Browse files
committed
fix: _G -> Globals; feat: (re-)implement index page always visible
1 parent 966f416 commit 3fc93ed

12 files changed

Lines changed: 46 additions & 38 deletions
File renamed without changes.

artlayer.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ layerNum = 1
1111
--- The alpha of the art layer, represented by a number in the range of 0 - 1. An alpha of 0 means the layer is completely transparent; 1 means fully visible. By default 1.
1212
alpha = 1
1313

14-
--- The blend mode of the art layer. Use @{_G.BlendMode|BlendMode} enum values. By default `BlendMode.NORMAL`.
14+
--- The blend mode of the art layer. Use @{Globals.BlendMode|BlendMode} enum values. By default `BlendMode.NORMAL`.
1515
--- Not all blend modes are guaranteed to have any effect when used by art layers
16-
--- @see _G.BlendMode
16+
--- @see Globals.BlendMode
1717
blendMode = "normal"
1818

1919
--- Whether or not the art layer was destroyed. Calling `destroy` sets this to true. Read-only.

block.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ypos = 0
2121
--- Provides the broken block, the side from which it was broken, and the reason;
2222
--- the reason may be either a Projectile, a Player (which may also be a LocalPlayer), or nil
2323
--- @see eventlistener
24-
--- @see _G.instanceof
24+
--- @see Globals.instanceof
2525
--- @usage game.level.getBlockAt(5, 7).onBreak.addListener(function(event)
2626
---- event.cancelled = true --Prevents the block from breaking
2727
----
@@ -78,7 +78,7 @@ end
7878
--- @usage block.bulkteleportto(false, true, 0, -7, 0, -8, 1, -8, 0, -8)
7979
--- @usage block.bulkteleportto(false, true, tovararg({{x = 0, y = -7}, {x = 0, y = -8}, {x = 1, y = -8}, {x = 1, y = -7}}))
8080
--- @see teleportto
81-
--- @see _G.tovararg
81+
--- @see Globals.tovararg
8282
function bulkteleportto(removecurrentblock, removetargetspot, ...)
8383
end
8484

config.ld

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
file = "./"
22
project = "PR3R Lua"
33
title = "PR3R Lua Documentation"
4-
description = "Platform Racing 3 is two-dimensional online racing game. Create your own levels and blocks, or play levels created by other players! Feature rich tools to make your vision come true! Draw amazing art or create unique consepts using different combinations of block types!"
4+
full_description = "Platform Racing 3 is two-dimensional online racing game. Create your own levels and blocks, or play levels created by other players! Feature rich tools to make your vision come true! Draw amazing art or create unique consepts using different combinations of block types!"
55
format = "markdown"
66
output = "index"
77
dir = "../PR3-Doc/" -- This is relative to working directory from which LDoc is called, NOT the source directory LDoc is reading from
@@ -15,10 +15,17 @@ wrap = true
1515
sort_modules = false -- Custom sorting is implemented in postprocess_html
1616

1717
--- Modifies the display name for a reference link.
18-
--- @param item string
19-
--- @param default_handler function
18+
--- @param item string The item whose display name is being modified
19+
--- @param default_handler function The default display_name function
20+
--- @return string newName The new display name
2021
custom_display_name_handler = function(item, default_handler)
21-
return default_handler(item):gsub("^_G%.", ""):gsub("^_G$", "Globals")
22+
-- The display name of the item
23+
local name = default_handler(item)
24+
25+
-- Replace "Globals.xyz" with "xyz"
26+
name = name:gsub("^Globals%.", "")
27+
28+
return name
2229
end
2330

2431
--- Postprocesses the HTML generated by LDoc.

game.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ end
115115
---- for i, v in pairs(players) do
116116
---- v.setmetadata("index", i)
117117
---- end
118-
--- @see _G.tovararg
118+
--- @see Globals.tovararg
119119
--- @see remoteplayer
120120
function getAllPlayers()
121121
end

ldoc.ltp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@
7171
# end
7272
# end
7373

74-
# if not ldoc.single and module then -- reference back to project index
74+
# -- 'if' and 'end' are commented out to always show the index
75+
# -- if not ldoc.single and module then -- reference back to project index
7576
<ul>
76-
<li><a href="../$(ldoc.output).html">Index</a></li>
77+
<li><a href="../$(ldoc.output).html">Documentation</a></li>
7778
</ul>
78-
# end
79+
# -- end
7980

8081
# --------- contents of module -------------
8182
# if module and not ldoc.no_summary and #module.items > 0 then

level.lua

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

2323
--- Gets a list of all blocks existing in the level.
2424
--- @return An AS3 array of all blocks in the level.
25-
--- @see _G.totable
25+
--- @see Globals.totable
2626
--- @usage local blocks = totable(game.level.getAllBlocks())
2727
---- for i, v in pairs(blocks) do
2828
---- v.setmetatable("index", i)

player.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ end
620620
--- + !typename: (***string***) the full item name. (e.g. "lasergun", "bow", etc.)
621621
---
622622
--- @see giveitem
623-
--- @see _G.totable
623+
--- @see Globals.totable
624624
function getitem()
625625
end
626626

@@ -752,7 +752,7 @@ end
752752
--- @tparam int keycode The specified key that is being checked.
753753
--- @return Returns true if pressed, otherwise false.
754754
--- @usage local Zpressed = tolua(player.keypressed(keys.Z))
755-
--- @see _G.keys
755+
--- @see Globals.keys
756756
function keypressed(keycode)
757757
end
758758

projectile.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
...
33

44
--- The shooter.
5-
--- May be either a @{_G.Player|Player} (which may also be a @{_G.LocalPlayer|LocalPlayer}) or nil.
6-
--- @see _G.Player
5+
--- May be either a @{Globals.Player|Player} (which may also be a @{Globals.LocalPlayer|LocalPlayer}) or nil.
6+
--- @see Globals.Player
77
shooter = nil

sprite.lua

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ greenOffset = 0
4646
--- A number value from -255 to 255 that is added to the alpha channel after it is multiplied by blueMultiplier. By default 0.
4747
blueOffset = 0
4848

49-
--- The blend mode of the sprite. Use @{_G.BlendMode|BlendMode} enum values. By default `BlendMode.NORMAL`.
50-
--- @see _G.BlendMode
49+
--- The blend mode of the sprite. Use @{Globals.BlendMode|BlendMode} enum values. By default `BlendMode.NORMAL`.
50+
--- @see Globals.BlendMode
5151
blendMode = "normal"
5252

5353
--- Whether or not the sprite was destroyed. Calling `destroy` sets this to true. Read-only.
@@ -110,9 +110,9 @@ end
110110
---- * !interpolationMethod: (***string***) Which color space interpolation method to use. Use ColorInterpolationMethod.RGB or ColorInterpolationMethod.LINEAR_RGB. By default ColorInterpolationMethod.RGB.
111111
----
112112
--- @see endFill
113-
--- @see _G.GradientType
114-
--- @see _G.GradientSpreadMethod
115-
--- @see _G.ColorInterpolationMethod
113+
--- @see Globals.GradientType
114+
--- @see Globals.GradientSpreadMethod
115+
--- @see Globals.ColorInterpolationMethod
116116
--- @usage local colors = toarray{0xFF0000FF, 0xFFFFFFFF} -- The gradient will be blue on the left and white on the right
117117
---- local ratios = toarray{0.3 * 255, 1 * 255} -- The gradient will be fully blue up to 30% of the way through the fill, then transition from blue to white across the remaining 70%
118118
---- someSprite.beginGradientFill(colors, ratios, toobject{type = GradientType.LINEAR, width = 100, height = 200}) -- The width and height of the gradient box will now match that of our next draw call.
@@ -183,13 +183,13 @@ end
183183
----
184184
---- + !horizontal: Do not scale the line thickness if the sprite is scaled only horizontally and not vertically.
185185
----
186-
---- * !caps: (***string***) The type of caps at the end of lines drawn with this line style. Use @{_G.CapsStyle|CapsStyle} enum values. By default `CapsStyle.ROUND`.
186+
---- * !caps: (***string***) The type of caps at the end of lines drawn with this line style. Use @{Globals.CapsStyle|CapsStyle} enum values. By default `CapsStyle.ROUND`.
187187
----
188-
---- * !joints: (***string***) The type of joint appearance at the angles formed by lines drawn with this line style. Use @{_G.JointStyle|JointStyle} enum values. By default `JointStyle.ROUND`. When using JointStyle.MITER, the length of miters is limited by the `miterLimit` parameter.
188+
---- * !joints: (***string***) The type of joint appearance at the angles formed by lines drawn with this line style. Use @{Globals.JointStyle|JointStyle} enum values. By default `JointStyle.ROUND`. When using JointStyle.MITER, the length of miters is limited by the `miterLimit` parameter.
189189
----
190190
---- * !miterLimit: (***int***) The maximum length, in pixels, of mitered joints used for the angles formed by lines drawn with this line style. By default 3. This value is clamped between 1 and 255.
191-
--- @see _G.CapsStyle
192-
--- @see _G.JointStyle
191+
--- @see Globals.CapsStyle
192+
--- @see Globals.JointStyle
193193
--- @usage someSprite.lineStyle(0xFFFF0000, 5) -- Draw a solid red line with a thickness of 5 pixels
194194
---- someSprite.lineTo(000, 100) -- Draw the line from (0, 0) to (0, 100)
195195
---- someSprite.lineStyle(0xFF000000, 1) -- Draw a solid black line with a thickness of 1 pixel
@@ -228,9 +228,9 @@ end
228228
---- * !interpolationMethod: (***string***) Which color space interpolation method to use. Use ColorInterpolationMethod.RGB or ColorInterpolationMethod.LINEAR_RGB. By default ColorInterpolationMethod.RGB.
229229
----
230230
--- @see endFill
231-
--- @see _G.GradientType
232-
--- @see _G.GradientSpreadMethod
233-
--- @see _G.ColorInterpolationMethod
231+
--- @see Globals.GradientType
232+
--- @see Globals.GradientSpreadMethod
233+
--- @see Globals.ColorInterpolationMethod
234234
--- @usage local colors = toarray{0xFF0000FF, 0xFFFFFFFF} -- The gradient will be blue on the left and white on the right
235235
---- local ratios = toarray{0.3 * 255, 1 * 255} -- The gradient will be fully blue up to 30% of the way through the fill, then transition from blue to white across the remaining 70%
236236
---- someSprite.lineStyle(0,24)
@@ -333,7 +333,7 @@ end
333333
--- @tparam string commands A string containing all of the commands for the path, e.g "M 100 100 L 250.5 -130.221 L 300 300 L 100 100". A command string can be built with the GraphicsPathCommand helper.
334334
--- @tparam string winding A string defining the winding for the path. Use GraphicsPathWinding.EVEN_ODD or GraphicsPathWinding.NON_ZERO. By default GraphicsPathWinding.EVEN_ODD.
335335
--- @see GraphicsPathCommand
336-
--- @see _G.GraphicsPathWinding
336+
--- @see Globals.GraphicsPathWinding
337337
--- @usage local path = GraphicsPathCommand.new().moveTo(100,100).lineTo(250.5,-130.221).lineTo(300,300).lineTo(100,100).toString()
338338
---- someSprite.drawPath(path, GraphicsPathWinding.NON_ZERO)
339339
function drawPath(commands, winding)
@@ -414,7 +414,7 @@ end
414414
----
415415
---- * !wordWrap: (***bool***) Whether or not the text should be word wrapped within the text field's size. By default false.
416416
----
417-
--- @see _G.TextFormatAlign
417+
--- @see Globals.TextFormatAlign
418418
--- @usage someSprite.addText(string.rep("Hello, world! ", 30), 0, 0, 0xFFFFAA00, 14, toobject{bold = true, wordWrap = true, width = 150, align = TextFormatAlign.CENTER}) -- Creates orange text at (0, 0), word-wrapping with a width of 150 pixels.
419419
function addText(text, x, y, color, size, vars)
420420
end

0 commit comments

Comments
 (0)