Skip to content

Commit 8873ed5

Browse files
committed
so far
1 parent 96392c9 commit 8873ed5

File tree

7 files changed

+59
-19
lines changed

7 files changed

+59
-19
lines changed

moonwave.toml

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ includeReadme = true
1212
favicon = "https://coderheck.github.io/assets/TRIAosLogoGradient.png"
1313

1414
[[classOrder]]
15-
classes = ["MapLib", "Skills", "PlayerUI", "Settings"]
15+
section = "MapLib"
16+
collapsed = false
17+
classes = ["MapLib"]
18+
19+
[[classOrder]]
20+
section = "Features"
21+
collapsed = true
22+
classes = ["Skills", "PlayerUI", "Settings", "Players", "Cleanup"]
1623

1724
[[navbar.items]]
1825
href = "https://discord.gg/tria"

src/Features/Cleanup/Janitor.lua

+21
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@ local function getJanitors()
1313
return require(script.Parent).Janitors
1414
end
1515

16+
--[=[
17+
@class Janitor
18+
Another class.
19+
]=]
20+
21+
--[=[
22+
@within Cleanup
23+
@since 0.11
24+
@function Janitor.new
25+
@param name string?
26+
@return _tasks: {[string]: any}
27+
@return context: string
28+
@return name: string?
29+
@return index: number | string
30+
@return .isJanitor (value: Janitor?) -> boolean
31+
@return :Give<T>(task: <T>) -> (<T>) -> <T>
32+
@return :Cleanup (taskTable: any) -> {}
33+
@return :Destroy () -> nil
34+
]=]
35+
36+
1637
function Janitor.new(janitorName: string?)
1738
local self = setmetatable({}, Janitor)
1839
self._tasks = {}

src/Features/Cleanup/init.lua

+19
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,26 @@ if RunService:IsServer() then
1414
Round = require(ServerScriptService.server.Services.RoundService.Round)
1515
end
1616

17+
--[=[
18+
@class Cleanup
19+
This is the MapLib Feature. It can be accessed by `MapLib:GetFeature("Cleanup")`.
20+
21+
Description of what this holds
22+
]=]
23+
1724
--< Main >--
1825
local Cleanup = {}
26+
1927
Cleanup.Janitors = {}
2028

29+
2130
Cleanup.Janitor = require(script.Janitor)
2231

32+
--[=[
33+
@since 0.2.4
34+
@return Janitor
35+
This method returns a Janitor class.
36+
]=]
2337
function Cleanup:GetJanitor(janitorName: string?)
2438
if self.Janitors[janitorName] then
2539
return self.Janitors[janitorName]
@@ -28,6 +42,11 @@ function Cleanup:GetJanitor(janitorName: string?)
2842
end
2943
end
3044

45+
--[=[
46+
@since 0.2.4
47+
This method returns all the active Janitor classes.
48+
@return {Janitor}
49+
]=]
3150
function Cleanup:GetJanitors()
3251
return self.Janitors
3352
end

src/Features/PlayerUI.lua

+4-9
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@ local PlayerUI = { context = "client" }
1313
PlayerUI.__index = PlayerUI
1414

1515
--- @class PlayerUI
16-
--- This is the documentation of PlayerUI-related methods.
16+
--- This is the MapLib Feature. It can be accessed by `MapLib:GetFeature("PlayerUI")`.
1717
--- @client
1818

19-
--- @prop cleanup {ScreenGUI}
20-
--- @readonly
21-
--- @private
22-
--- @within PlayerUI
2319
function PlayerUI.new()
2420
local self = setmetatable({}, PlayerUI)
2521

@@ -37,13 +33,12 @@ function PlayerUI.new()
3733
return self
3834
end
3935

40-
--- This function is used to load a `ScreenGui` instance.
41-
function PlayerUI:LoadUI(gui: ScreenGui): ScreenGui
36+
--- This function is used to load a `ScreenGui` from the map into the players PlayerGUI.
37+
function PlayerUI:LoadUI(gui: ScreenGui)
4238
assert(gui:IsA("ScreenGui"), "':LoadUI' must be passed a 'ScreenGUI'")
39+
gui:Clone().Parent = Players.LocalPlayer.PlayerGui
4340

44-
gui.Parent = Players.LocalPlayer.PlayerGui
4541
table.insert(self.cleanup, gui)
46-
return gui
4742
end
4843

4944
return PlayerUI

src/Features/Players.lua

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,19 @@ local Players = {}
1212
Players.__index = Players
1313

1414
--- @class Players
15-
--- This is the documentation about Players-related methods.
16-
15+
--- This is the MapLib Feature. It can be accessed by `MapLib:GetFeature("Players")`.
1716
function Players.new()
1817
local self = setmetatable({}, Players)
1918
return self
2019
end
2120

22-
--- Used to return all players in the current match.
23-
function Players:GetPlayers()
21+
--- Used to return all players in the current round.
22+
function Players:GetPlayers(): { Player }
2423
return PlayerStates:GetPlayersWithState(PlayerStates.GAME)
2524
end
2625

2726
--[=[
28-
@unreleased
27+
@since 0.11
2928
@within Players
3029
This method is used to return players in the radius of the given position.
3130
]=]

src/Features/Settings.lua

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ if RunService:IsClient() then
1212
end
1313

1414
--< Main >--
15-
local Settings = {context = "client"}
15+
local Settings = { context = "client" }
1616
Settings.__index = Settings
1717

1818
--- @class Settings
19-
--- This is the documentation about a map's Settings and related methods.
19+
--- This is the MapLib Feature. It can be accessed by `MapLib:GetFeature("Settings")`.
2020

21-
--- @client
2221
function Settings.new()
2322
local self = setmetatable({}, Settings)
2423

src/Features/Skills.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
local Skills = {}
77

88
--- @class Skills
9-
--- This is the documentation of Skills-related methods.
9+
--- This is the MapLib Feature. It can be accessed by `MapLib:GetFeature("Skills")`.
1010

1111
function Skills.new(MapLib)
1212
local self = setmetatable({}, Skills)

0 commit comments

Comments
 (0)