Skip to content

Commit fcaa3b4

Browse files
authored
Add LuaCATS documentation for UI and UIManager (LoneGazebo#11654)
* Add LuaCATS for UI, and other. * Add LuaCATS for UIManager * Make pseudo types aliases instead of classes.
1 parent 5b6b5ec commit fcaa3b4

21 files changed

+1002
-19
lines changed

LuaCATS/City.d.lua

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--- @meta
2+
3+
--- @class City
4+
local City = {}
5+
6+
--- Gets city owner player id.
7+
--- @return PlayerId
8+
function City:GetOwner() end

LuaCATS/Context.d.lua

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--- @meta
2+
3+
--- @class Context

LuaCATS/Control.d.lua

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--- @meta
2+
3+
--- @class Control : Context

LuaCATS/Deal.d.lua

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
--- @meta
2+
3+
--- @class Deal
4+
local Deal = {}

LuaCATS/Global.d.lua

+13-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
--- for more information
66
--- @see require
77
--- @param filename string # Filename to load, or regex to load files
8-
--- @param useRegex? boolean #
8+
--- @param useRegex? boolean #
99
--- @return nil | string[]
10-
function include(filename, useRegex) end
10+
function include(filename, useRegex) end
11+
12+
--- TODO docs
13+
--- @param vector2 { x: number, y: number }
14+
--- @return integer #
15+
function ToHexFromGrid(vector2) end
16+
17+
--- TODO docs
18+
--- @param x integer
19+
--- @param y integer
20+
--- @return integer, integer #
21+
function ToGridFromHex(x, y) end

LuaCATS/Locale.d.lua

+16-16
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,16 @@ function Locale.ToNumber(num, format) end
9898
--- @class SpokenLanguage: Language
9999
--- @field Path string
100100

101-
--- ```lua
101+
--- ```lua
102102
--- -- Example
103-
--- Locale.GetCurrentLanguage() -- { Type = 'en_US', DisplayName = 'English' }
103+
--- Locale.GetCurrentLanguage() -- { Type = 'en_US', DisplayName = 'English' }
104104
--- ```
105105
--- @return { Type: string, DisplayName: string }
106106
function Locale.GetCurrentLanguage() end
107107

108-
--- ```lua
108+
--- ```lua
109109
--- -- Example
110-
--- Locale.GetCurrentSpokenLanguage() -- { Type = 'en_US', Path = 'English', DisplayName = 'English' }
110+
--- Locale.GetCurrentSpokenLanguage() -- { Type = 'en_US', Path = 'English', DisplayName = 'English' }
111111
--- ```
112112
--- @return SpokenLanguage
113113
function Locale.GetCurrentSpokenLanguage() end
@@ -153,15 +153,15 @@ function Locale.IsASCII(str) end
153153
--- @return boolean
154154
function Locale.IsUTF8(str) end
155155

156-
--- ```lua
156+
--- ```lua
157157
--- -- Example
158158
--- Locale.ConvertPosixTimeToString(0) -- "1970-01-01 01:00"
159159
--- ```
160160
--- @param time number
161161
--- @return string
162162
function Locale.ConvertPosixTimeToString(time) end
163163

164-
--- ```lua
164+
--- ```lua
165165
--- -- Example
166166
--- Locale.IsNilOrEmpty('') -- true
167167
--- Locale.IsNilOrEmpty(nil) -- true
@@ -173,7 +173,7 @@ function Locale.IsNilOrEmpty(str) end
173173

174174
--- Checks if `str` consists of whitespaces or is `nil`.
175175
--- <b> Do not use this function to check strings like `"[NEWLINE]"`, `"[SPACE]"` etc. </b>
176-
--- ```lua
176+
--- ```lua
177177
--- -- Example
178178
--- Locale.IsNilOrWhitespace('') -- true
179179
--- Locale.IsNilOrWhitespace(nil) -- true
@@ -195,10 +195,10 @@ function Locale.IsNilOrWhitespace(str) end
195195
function Locale.Substring(str, startIndex, endIndex) end
196196

197197
--- Converts `num` to curreny string depending on current language.
198-
--- ```lua
198+
--- ```lua
199199
--- -- Example
200200
--- -- if current language is en_US
201-
--- Locale.ToCurrency(123) -- '$123.00'
201+
--- Locale.ToCurrency(123) -- '$123.00'
202202
--- Locale.ToCurrency(123.256) -- '$123.26'
203203
--- -- if current language is pl_PL
204204
--- Locale.ToCurrency(123) -- '123,00 zł'
@@ -208,7 +208,7 @@ function Locale.Substring(str, startIndex, endIndex) end
208208
function Locale.ToCurrency(num) end
209209

210210
--- Converts `num` to ordinal string depending on current language
211-
--- ```lua
211+
--- ```lua
212212
--- -- Example
213213
--- -- if current language is en_US
214214
--- Locale.ToOrdinal(1) -- "1ˢᵗ"
@@ -224,7 +224,7 @@ function Locale.ToCurrency(num) end
224224
function Locale.ToOrdinal(num) end
225225

226226
--- Convers `num` to percent, where `1` is `"100%"`. Expect different result depending on current language
227-
--- ```lua
227+
--- ```lua
228228
--- -- Example
229229
--- -- if current language is en_US
230230
--- Locale.ToPercent(1) -- "100%"
@@ -246,15 +246,15 @@ function Locale.ToPercent(num) end
246246
--- Locale.ToSpellout(1) -- "one"
247247
--- Locale.ToSpellout(-555.12) -- "minus five hundred fifty-five point one two"
248248
--- Locale.ToSpellout(5/0) -- "eighteen quadrillion..." very long number, looks like something like max number
249-
--- -- if current language is pl_PL
249+
--- -- if current language is pl_PL
250250
--- Locale.ToSpellout(555) -- "pięćset pięćdziesiąt pięć"
251251
--- ```
252252
--- @param num number
253253
--- @return string
254254
function Locale.ToSpellout(num) end
255255

256-
--- Converts specified `num` to roman numeral string.
257-
--- It is limited by some maximum number after which
256+
--- Converts specified `num` to roman numeral string.
257+
--- It is limited by some maximum number after which
258258
--- just converts number to current language representation
259259
--- ```lua
260260
--- -- Example
@@ -268,10 +268,10 @@ function Locale.ToRomanNumeral(num) end
268268

269269
--- Unknown behaviour
270270
--- @deprecated
271-
--- @param ... any
271+
--- @param ... unknown
272272
function Locale.LocalSystemCPToUTF8(...) end
273273

274274
--- Unknown behaviour
275275
--- @deprecated
276-
--- @param ... any
276+
--- @param ... unknown
277277
function Locale.UTF8ToLocalSystemCP(...) end

LuaCATS/Player.d.lua

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--- @meta
2+
3+
--- @class Player
4+
local Player = {}
5+
6+
--- Gets player ID
7+
--- @return PlayerId
8+
function Player:GetId() end

LuaCATS/Plot.d.lua

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
--- @meta
2+
3+
--- @class Plot
4+
local Plot = {}
5+
6+
--- TODO docs
7+
--- @return integer
8+
--- @nodiscard
9+
function Plot:GetX() end
10+
11+
--- TODO docs
12+
--- @return integer
13+
--- @nodiscard
14+
function Plot:GetY() end
15+
16+
--- Gets plot owner id
17+
--- @return PlayerId
18+
--- @nodiscard
19+
function Plot:GetOwner() end
20+
21+
--- TODO docs
22+
--- @return AreaId
23+
--- @nodiscard
24+
function Plot:GetArea() end
25+
26+
--- TODO docs
27+
--- @return TeamId
28+
--- @nodiscard
29+
function Plot:GetTeam() end
30+
31+
--- Gets the number of units stationed in specified plot.
32+
--- @return integer
33+
--- @nodiscard
34+
function Plot:GetNumUnits() end
35+
36+
--- Determines the amount of culture yielded by working the plot.
37+
--- @return number
38+
--- @nodiscard
39+
function Plot:GetCulture() end
40+
41+
--- TOOD docs
42+
--- @return boolean
43+
--- @nodiscard
44+
function Plot:IsCity() end
45+
46+
--- TODO docs
47+
--- @return City | nil
48+
--- @nodiscard
49+
function Plot:GetPlotCity() end
50+
51+
--- TODO docs
52+
--- @return boolean
53+
--- @nodiscard
54+
function Plot:IsWater() end
55+
56+
--- TODO docs
57+
--- @return boolean
58+
--- @nodiscard
59+
function Plot:IsRiver() end
60+
61+
--- TODO docs
62+
--- @return boolean
63+
--- @nodiscard
64+
function Plot:IsLake() end
65+
66+
--- TODO docs
67+
--- @return boolean
68+
--- @nodiscard
69+
function Plot:IsHills() end
70+
71+
--- TODO docs
72+
--- @return boolean
73+
--- @nodiscard
74+
function Plot:IsOwned() end
75+
76+
--- TODO docs
77+
--- @return boolean
78+
--- @nodiscard
79+
function Plot:IsMountain() end
80+
81+
--- TODO docs
82+
--- @return boolean
83+
--- @nodiscard
84+
function Plot:IsFreshWater() end
85+
86+
--- TODO docs
87+
--- @return boolean
88+
--- @nodiscard
89+
function Plot:IsFlatlands() end
90+
91+
--- TODO docs
92+
--- @return boolean
93+
--- @nodiscard
94+
function Plot:IsCoastalLand() end
95+
96+
--- TODO docs
97+
--- @return boolean
98+
--- @nodiscard
99+
function Plot:IsRoutePillaged() end
100+
101+
--- TODO docs
102+
--- @return boolean
103+
--- @nodiscard
104+
function Plot:IsImprovementEmbassy() end
105+
106+
--- TODO docs
107+
--- @return boolean
108+
--- @nodiscard
109+
function Plot:IsImprovementPillaged() end
110+
111+
--- TODO docs
112+
--- @return boolean
113+
--- @nodiscard
114+
function Plot:IsImpassable() end
115+
116+
--- Checks if plot is revealed by specified team.
117+
--- @param teamId TeamId
118+
--- @param debug boolean
119+
--- @return boolean
120+
--- @nodiscard
121+
function Plot:IsRevealed(teamId, debug) end

LuaCATS/Pseudo.d.lua

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--- @meta
2+
3+
--- @alias PlayerId integer
4+
--- @alias AreaId integer
5+
--- @alias CityId integer
6+
--- @alias PlotId integer
7+
--- @alias TeamId integer
8+
--- @alias UnitId integer

0 commit comments

Comments
 (0)