@tlua/gmod 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/types/achievementicon.d.tlua +0 -1
- package/types/achievements.d.tlua +15 -16
- package/types/ai.d.tlua +5 -6
- package/types/ai_schedule.d.tlua +0 -1
- package/types/ai_task.d.tlua +0 -1
- package/types/angle.d.tlua +18 -19
- package/types/avatarimage.d.tlua +0 -1
- package/types/awesomium.d.tlua +0 -1
- package/types/baseclass.d.tlua +1 -3
- package/types/bf_read.d.tlua +10 -12
- package/types/bit.d.tlua +11 -12
- package/types/button.d.tlua +0 -1
- package/types/cam.d.tlua +16 -17
- package/types/ceffectdata.d.tlua +31 -33
- package/types/chat.d.tlua +5 -6
- package/types/checkbutton.d.tlua +0 -1
- package/types/cleanup.d.tlua +7 -8
- package/types/cluaemitter.d.tlua +11 -13
- package/types/clualocomotion.d.tlua +39 -41
- package/types/cluaparticle.d.tlua +43 -45
- package/types/cmovedata.d.tlua +46 -48
- package/types/cnavarea.d.tlua +76 -78
- package/types/cnavladder.d.tlua +21 -23
- package/types/cnewparticleeffect.d.tlua +25 -27
- package/types/color.d.tlua +28 -29
- package/types/concommand.d.tlua +4 -5
- package/types/constraint.d.tlua +28 -29
- package/types/construct.d.tlua +1 -2
- package/types/contentheader.d.tlua +1 -3
- package/types/contenticon.d.tlua +7 -9
- package/types/contentsidebar.d.tlua +2 -4
- package/types/contentsidebartoolbox.d.tlua +0 -1
- package/types/contextbase.d.tlua +2 -4
- package/types/controlpanel.d.tlua +11 -14
- package/types/controlpresets.d.tlua +11 -13
- package/types/convar.d.tlua +15 -17
- package/types/cookie.d.tlua +3 -4
- package/types/coroutine.d.tlua +7 -8
- package/types/crecipientfilter.d.tlua +15 -17
- package/types/csent.d.tlua +0 -1
- package/types/csoundpatch.d.tlua +13 -15
- package/types/ctakedamageinfo.d.tlua +32 -34
- package/types/ctrllistbox.d.tlua +0 -1
- package/types/ctrlnumpad.d.tlua +5 -7
- package/types/cusercmd.d.tlua +26 -28
- package/types/custom_entity_fields.d.tlua +0 -1
- package/types/cvars.d.tlua +6 -7
- package/types/dadjustablemodelpanel.d.tlua +5 -7
- package/types/dalphabar.d.tlua +1 -3
- package/types/dbinder.d.tlua +2 -4
- package/types/dbubblecontainer.d.tlua +0 -2
- package/types/dbutton.d.tlua +6 -8
- package/types/dcategoryheader.d.tlua +0 -1
- package/types/dcategorylist.d.tlua +0 -1
- package/types/dcheckbox.d.tlua +3 -5
- package/types/dcheckboxlabel.d.tlua +9 -10
- package/types/dcollapsiblecategory.d.tlua +21 -23
- package/types/dcolorbutton.d.tlua +5 -7
- package/types/dcolorcombo.d.tlua +3 -5
- package/types/dcolorcube.d.tlua +11 -13
- package/types/dcolormixer.d.tlua +25 -27
- package/types/dcolorpalette.d.tlua +21 -23
- package/types/dcolumnsheet.d.tlua +3 -5
- package/types/dcombobox.d.tlua +15 -17
- package/types/ddragbase.d.tlua +11 -13
- package/types/ddrawer.d.tlua +6 -8
- package/types/debug.d.tlua +16 -19
- package/types/debugoverlay.d.tlua +11 -12
- package/types/dentityproperties.d.tlua +3 -5
- package/types/derma.d.tlua +10 -11
- package/types/dexpandbutton.d.tlua +1 -3
- package/types/dfilebrowser.d.tlua +20 -21
- package/types/dform.d.tlua +16 -18
- package/types/dframe.d.tlua +24 -25
- package/types/dgrid.d.tlua +9 -11
- package/types/dhorizontaldivider.d.tlua +18 -20
- package/types/dhorizontalscroller.d.tlua +9 -11
- package/types/dhscrollbar.d.tlua +9 -11
- package/types/dhtml.d.tlua +6 -8
- package/types/dhtmlcontrols.d.tlua +5 -6
- package/types/diconbrowser.d.tlua +9 -11
- package/types/diconlayout.d.tlua +16 -18
- package/types/dimage.d.tlua +17 -20
- package/types/dimagebutton.d.tlua +9 -10
- package/types/dkillicon.d.tlua +0 -1
- package/types/dlabel.d.tlua +31 -33
- package/types/dlabeleditable.d.tlua +3 -5
- package/types/dlabelurl.d.tlua +8 -10
- package/types/dlistbox.d.tlua +6 -8
- package/types/dlistboxitem.d.tlua +2 -4
- package/types/dlistlayout.d.tlua +0 -1
- package/types/dlistview.d.tlua +32 -34
- package/types/dlistview_column.d.tlua +12 -14
- package/types/dlistview_columnplain.d.tlua +0 -1
- package/types/dlistview_draggerbar.d.tlua +0 -1
- package/types/dlistview_line.d.tlua +11 -13
- package/types/dlistviewheaderlabel.d.tlua +0 -1
- package/types/dlistviewlabel.d.tlua +0 -1
- package/types/dlistviewline.d.tlua +0 -1
- package/types/dmenu.d.tlua +23 -28
- package/types/dmenubar.d.tlua +2 -7
- package/types/dmenuoption.d.tlua +11 -13
- package/types/dmenuoptioncvar.d.tlua +4 -6
- package/types/dmodelpanel.d.tlua +20 -22
- package/types/dmodelselect.d.tlua +0 -2
- package/types/dmodelselectmulti.d.tlua +0 -2
- package/types/dnotify.d.tlua +8 -10
- package/types/dnumberscratch.d.tlua +24 -26
- package/types/dnumberwang.d.tlua +14 -16
- package/types/dnumpad.d.tlua +0 -1
- package/types/dnumslider.d.tlua +17 -18
- package/types/dpanel.d.tlua +12 -14
- package/types/dpanellist.d.tlua +11 -12
- package/types/dpaneloverlay.d.tlua +5 -7
- package/types/dpanelselect.d.tlua +0 -1
- package/types/dpanpanel.d.tlua +4 -6
- package/types/dprogress.d.tlua +1 -3
- package/types/dproperties.d.tlua +2 -4
- package/types/dproperty_boolean.d.tlua +0 -1
- package/types/dproperty_combo.d.tlua +1 -3
- package/types/dproperty_entity.d.tlua +0 -1
- package/types/dproperty_float.d.tlua +0 -1
- package/types/dproperty_generic.d.tlua +3 -5
- package/types/dproperty_int.d.tlua +0 -1
- package/types/dproperty_vectorcolor.d.tlua +0 -1
- package/types/dpropertysheet.d.tlua +15 -17
- package/types/dragndrop.d.tlua +10 -11
- package/types/draw.d.tlua +10 -12
- package/types/drgbpicker.d.tlua +2 -4
- package/types/drive.d.tlua +11 -13
- package/types/dscrollbargrip.d.tlua +0 -1
- package/types/dscrollpanel.d.tlua +10 -11
- package/types/dshape.d.tlua +5 -7
- package/types/dsizetocontents.d.tlua +3 -5
- package/types/dslider.d.tlua +26 -28
- package/types/dsprite.d.tlua +7 -9
- package/types/dtab.d.tlua +6 -8
- package/types/dtextentry.d.tlua +41 -43
- package/types/dtilelayout.d.tlua +19 -21
- package/types/dtooltip.d.tlua +4 -6
- package/types/dtree.d.tlua +14 -16
- package/types/dtree_node.d.tlua +66 -68
- package/types/dtree_node_button.d.tlua +0 -1
- package/types/duplicator.d.tlua +29 -31
- package/types/dverticaldivider.d.tlua +21 -23
- package/types/dvscrollbar.d.tlua +9 -11
- package/types/editablepanel.d.tlua +0 -1
- package/types/effect.d.tlua +2 -4
- package/types/effects.d.tlua +6 -7
- package/types/engine.d.tlua +21 -22
- package/types/entity.d.tlua +643 -674
- package/types/ents.d.tlua +19 -25
- package/types/enums.d.tlua +0 -1
- package/types/file.d.tlua +39 -40
- package/types/file_class.d.tlua +0 -1
- package/types/fingerposer.d.tlua +0 -1
- package/types/fingervar.d.tlua +0 -1
- package/types/frame.d.tlua +0 -1
- package/types/frame_blend.d.tlua +7 -8
- package/types/game.d.tlua +39 -40
- package/types/gameevent.d.tlua +0 -1
- package/types/gamemode.d.tlua +2 -4
- package/types/global.d.tlua +0 -18
- package/types/gm.d.tlua +266 -268
- package/types/gmod.d.tlua +0 -1
- package/types/gmsave.d.tlua +4 -5
- package/types/gui.d.tlua +21 -22
- package/types/gwen.d.tlua +3 -4
- package/types/halo.d.tlua +2 -3
- package/types/hammer.d.tlua +0 -1
- package/types/hook.d.tlua +4 -5
- package/types/html.d.tlua +0 -1
- package/types/http.d.tlua +1 -2
- package/types/iconeditor.d.tlua +9 -11
- package/types/igmodaudiochannel.d.tlua +40 -42
- package/types/imagecheckbox.d.tlua +2 -4
- package/types/imaterial.d.tlua +25 -27
- package/types/imesh.d.tlua +4 -6
- package/types/input.d.tlua +22 -25
- package/types/invalidateinternalentitycache.d.tlua +0 -1
- package/types/irestore.d.tlua +8 -10
- package/types/isave.d.tlua +8 -10
- package/types/itexture.d.tlua +9 -11
- package/types/ivideowriter.d.tlua +4 -6
- package/types/jit.d.tlua +16 -17
- package/types/killicon.d.tlua +7 -8
- package/types/label.d.tlua +0 -1
- package/types/language.d.tlua +1 -2
- package/types/list.d.tlua +8 -9
- package/types/makeballoon.d.tlua +0 -1
- package/types/markup.d.tlua +2 -3
- package/types/markupobject.d.tlua +4 -6
- package/types/material.d.tlua +0 -1
- package/types/math.d.tlua +83 -84
- package/types/matproxy.d.tlua +3 -4
- package/types/matselect.d.tlua +9 -11
- package/types/menu.d.tlua +0 -1
- package/types/menubar.d.tlua +2 -3
- package/types/mesh.d.tlua +19 -20
- package/types/modelimage.d.tlua +0 -1
- package/types/motionsensor.d.tlua +10 -11
- package/types/navmesh.d.tlua +26 -27
- package/types/net.d.tlua +51 -53
- package/types/nextbot.d.tlua +34 -37
- package/types/notification.d.tlua +2 -3
- package/types/npc.d.tlua +180 -182
- package/types/numpad.d.tlua +7 -8
- package/types/os.d.tlua +3 -5
- package/types/package.d.tlua +0 -1
- package/types/panel.d.tlua +329 -331
- package/types/panellist.d.tlua +0 -1
- package/types/pathfollower.d.tlua +30 -32
- package/types/permissions.d.tlua +6 -7
- package/types/physcollide.d.tlua +2 -4
- package/types/physenv.d.tlua +11 -12
- package/types/physobj.d.tlua +77 -79
- package/types/pixelvis_handle_t.d.tlua +0 -1
- package/types/player.d.tlua +288 -293
- package/types/player_manager.d.tlua +13 -14
- package/types/preseteditor.d.tlua +0 -1
- package/types/presets.d.tlua +6 -7
- package/types/projectedtexture.d.tlua +47 -49
- package/types/properties.d.tlua +5 -6
- package/types/propselect.d.tlua +3 -5
- package/types/radiobutton.d.tlua +0 -1
- package/types/render.d.tlua +142 -143
- package/types/resource.d.tlua +2 -3
- package/types/richtext.d.tlua +0 -1
- package/types/sandbox.d.tlua +52 -54
- package/types/saverestore.d.tlua +12 -13
- package/types/schedule.d.tlua +5 -7
- package/types/scripted_ents.d.tlua +9 -12
- package/types/search.d.tlua +1 -2
- package/types/serverlist.d.tlua +7 -8
- package/types/slidebar.d.tlua +0 -1
- package/types/slider.d.tlua +0 -1
- package/types/sound.d.tlua +10 -11
- package/types/spawnicon.d.tlua +6 -8
- package/types/spawnmenu.d.tlua +23 -25
- package/types/spawnmenucontentpanel.d.tlua +3 -5
- package/types/sql.d.tlua +9 -10
- package/types/stack.d.tlua +4 -6
- package/types/steamworks.d.tlua +18 -19
- package/types/string.d.tlua +46 -50
- package/types/structures.d.tlua +0 -7
- package/types/surface.d.tlua +34 -35
- package/types/surfaceinfo.d.tlua +4 -6
- package/types/system.d.tlua +10 -11
- package/types/table.d.tlua +45 -48
- package/types/task.d.tlua +8 -10
- package/types/team.d.tlua +19 -20
- package/types/textentry.d.tlua +0 -1
- package/types/tgaimage.d.tlua +0 -1
- package/types/timer.d.tlua +14 -15
- package/types/tool.d.tlua +42 -46
- package/types/ugcpublishwindow.d.tlua +7 -9
- package/types/umsg.d.tlua +12 -13
- package/types/undo.d.tlua +10 -11
- package/types/urllabel.d.tlua +0 -1
- package/types/usermessage.d.tlua +2 -3
- package/types/utf8.d.tlua +7 -8
- package/types/util.d.tlua +90 -95
- package/types/vector.d.tlua +36 -37
- package/types/vehicle.d.tlua +48 -51
- package/types/vgui.d.tlua +14 -19
- package/types/video.d.tlua +0 -1
- package/types/vmatrix.d.tlua +35 -36
- package/types/weapon.d.tlua +81 -84
- package/types/weapons.d.tlua +5 -7
- package/types/widgets.d.tlua +1 -2
- package/types/workshopfilebase.d.tlua +4 -6
package/types/table.d.tlua
CHANGED
|
@@ -18,18 +18,21 @@ interface TableLib {
|
|
|
18
18
|
* @source https://wiki.facepunch.com/gmod/table.Add
|
|
19
19
|
*/
|
|
20
20
|
Add(target: table, source: table): table;
|
|
21
|
+
|
|
21
22
|
/**
|
|
22
23
|
* Changes all keys to sequential integers. This creates a new table object and does not affect the original.
|
|
23
24
|
* @realm shared and menu
|
|
24
25
|
* @source https://wiki.facepunch.com/gmod/table.ClearKeys
|
|
25
26
|
*/
|
|
26
27
|
ClearKeys(table: table, saveKeys?: boolean): table;
|
|
28
|
+
|
|
27
29
|
/**
|
|
28
30
|
* Collapses a table with keyvalue structure
|
|
29
31
|
* @realm shared and menu
|
|
30
32
|
* @source https://wiki.facepunch.com/gmod/table.CollapseKeyValue
|
|
31
33
|
*/
|
|
32
34
|
CollapseKeyValue(input: table): table;
|
|
35
|
+
|
|
33
36
|
/**
|
|
34
37
|
* Creates and returns a deep copy of a table.
|
|
35
38
|
*
|
|
@@ -40,12 +43,14 @@ interface TableLib {
|
|
|
40
43
|
* @source https://wiki.facepunch.com/gmod/table.Copy
|
|
41
44
|
*/
|
|
42
45
|
Copy<T extends table>(originalTable: T): T;
|
|
46
|
+
|
|
43
47
|
/**
|
|
44
48
|
* Empties the target table, and merges all values from the source table into it.
|
|
45
49
|
* @realm shared and menu
|
|
46
50
|
* @source https://wiki.facepunch.com/gmod/table.CopyFromTo
|
|
47
51
|
*/
|
|
48
52
|
CopyFromTo(source: table, target: table): void;
|
|
53
|
+
|
|
49
54
|
/**
|
|
50
55
|
* Counts the amount of keys in a table. This should only be used when a table is not numerically and sequentially indexed. For those tables, consider the length (**#**) operator.
|
|
51
56
|
*
|
|
@@ -55,18 +60,21 @@ interface TableLib {
|
|
|
55
60
|
* @source https://wiki.facepunch.com/gmod/table.Count
|
|
56
61
|
*/
|
|
57
62
|
Count(tbl: table): number;
|
|
63
|
+
|
|
58
64
|
/**
|
|
59
65
|
* Converts a table that has been sanitised with [table.Sanitise](https://wiki.facepunch.com/gmod/table.Sanitise) back to its original form
|
|
60
66
|
* @realm shared and menu
|
|
61
67
|
* @source https://wiki.facepunch.com/gmod/table.DeSanitise
|
|
62
68
|
*/
|
|
63
69
|
DeSanitise(tbl: table): table;
|
|
70
|
+
|
|
64
71
|
/**
|
|
65
72
|
* Removes all values from a table. If your table is not a metatable, it is almost always better to use `tab = {}` to preserve performance.
|
|
66
73
|
* @realm shared and menu
|
|
67
74
|
* @source https://wiki.facepunch.com/gmod/table.Empty
|
|
68
75
|
*/
|
|
69
76
|
Empty(tbl: table): void;
|
|
77
|
+
|
|
70
78
|
/**
|
|
71
79
|
* Returns the value positioned after the supplied value in a table. If it isn't found then the first element in the table is returned
|
|
72
80
|
*
|
|
@@ -75,6 +83,7 @@ interface TableLib {
|
|
|
75
83
|
* @deprecated Instead, iterate the table using ipairs or increment from the previous index using Global.next. Non-numerically indexed tables are not ordered.
|
|
76
84
|
*/
|
|
77
85
|
FindNext(tbl: table, value: any): any;
|
|
86
|
+
|
|
78
87
|
/**
|
|
79
88
|
* Returns the value positioned before the supplied value in a table. If it isn't found then the last element in the table is returned
|
|
80
89
|
*
|
|
@@ -83,6 +92,7 @@ interface TableLib {
|
|
|
83
92
|
* @deprecated Instead, iterate your table with ipairs, storing the previous value and checking for the target. Non-numerically indexed tables are not ordered.
|
|
84
93
|
*/
|
|
85
94
|
FindPrev(tbl: table, value: any): any;
|
|
95
|
+
|
|
86
96
|
/**
|
|
87
97
|
* Flips key-value pairs of each element within a table, so that each value becomes the key, and each key becomes the value.
|
|
88
98
|
*
|
|
@@ -100,12 +110,14 @@ interface TableLib {
|
|
|
100
110
|
* @source https://wiki.facepunch.com/gmod/table.Flip
|
|
101
111
|
*/
|
|
102
112
|
Flip(input: table): table;
|
|
113
|
+
|
|
103
114
|
/**
|
|
104
115
|
* Inserts a value in to the given table even if the table is non-existent
|
|
105
116
|
* @realm shared and menu
|
|
106
117
|
* @source https://wiki.facepunch.com/gmod/table.ForceInsert
|
|
107
118
|
*/
|
|
108
119
|
ForceInsert(tab?: table, value?: any): table;
|
|
120
|
+
|
|
109
121
|
/**
|
|
110
122
|
* Returns the first key found in the given table
|
|
111
123
|
*
|
|
@@ -114,6 +126,7 @@ interface TableLib {
|
|
|
114
126
|
* @deprecated Instead, expect the first key to be 1. Non-numerically indexed tables are not ordered and do not have a first key.
|
|
115
127
|
*/
|
|
116
128
|
GetFirstKey(tab: table): any;
|
|
129
|
+
|
|
117
130
|
/**
|
|
118
131
|
* Returns the first value found in the given table
|
|
119
132
|
*
|
|
@@ -122,12 +135,14 @@ interface TableLib {
|
|
|
122
135
|
* @deprecated Instead, index the table with a key of 1. Non-numerically indexed tables are not ordered and do not have a first key.
|
|
123
136
|
*/
|
|
124
137
|
GetFirstValue(tab: table): any;
|
|
138
|
+
|
|
125
139
|
/**
|
|
126
140
|
* Returns all keys of a table.
|
|
127
141
|
* @realm shared and menu
|
|
128
142
|
* @source https://wiki.facepunch.com/gmod/table.GetKeys
|
|
129
143
|
*/
|
|
130
144
|
GetKeys(tabl: table): table;
|
|
145
|
+
|
|
131
146
|
/**
|
|
132
147
|
* Returns the last key found in the given table
|
|
133
148
|
*
|
|
@@ -136,6 +151,7 @@ interface TableLib {
|
|
|
136
151
|
* @deprecated Instead, use the result of the length (#) operator, ensuring it is not zero. Non-numerically indexed tables are not ordered and do not have a last key.
|
|
137
152
|
*/
|
|
138
153
|
GetLastKey(tab: table): any;
|
|
154
|
+
|
|
139
155
|
/**
|
|
140
156
|
* Returns the last value found in the given table
|
|
141
157
|
*
|
|
@@ -144,12 +160,14 @@ interface TableLib {
|
|
|
144
160
|
* @deprecated Instead, index the table with the result of the length (#) operator, ensuring it is not zero. Non-numerically indexed tables are not ordered and do not have a last key.
|
|
145
161
|
*/
|
|
146
162
|
GetLastValue(tab: table): any;
|
|
163
|
+
|
|
147
164
|
/**
|
|
148
165
|
* Returns a key of the supplied table with the highest number value.
|
|
149
166
|
* @realm shared and menu
|
|
150
167
|
* @source https://wiki.facepunch.com/gmod/table.GetWinningKey
|
|
151
168
|
*/
|
|
152
169
|
GetWinningKey(inputTable: table): any;
|
|
170
|
+
|
|
153
171
|
/**
|
|
154
172
|
* Checks if a table has a value.
|
|
155
173
|
* **WARNING**: This function is **very inefficient for large tables** (O(n)) and should probably not be called in things that run each frame. Instead, consider a table structure such as example 2 below. Also see: [Tables: Bad Habits](https://wiki.facepunch.com/gmod/Tables:_Bad_Habits)
|
|
@@ -161,6 +179,7 @@ interface TableLib {
|
|
|
161
179
|
* @source https://wiki.facepunch.com/gmod/table.HasValue
|
|
162
180
|
*/
|
|
163
181
|
HasValue(tbl: table, value: any): boolean;
|
|
182
|
+
|
|
164
183
|
/**
|
|
165
184
|
* Copies any missing data from `base` to `target`, and sets the `target`'s `BaseClass` member to the `base` table's pointer.
|
|
166
185
|
*
|
|
@@ -175,6 +194,7 @@ interface TableLib {
|
|
|
175
194
|
* @source https://wiki.facepunch.com/gmod/table.Inherit
|
|
176
195
|
*/
|
|
177
196
|
Inherit(target: table, base: table): table;
|
|
197
|
+
|
|
178
198
|
/**
|
|
179
199
|
* Returns whether or not the given table is empty.
|
|
180
200
|
*
|
|
@@ -186,30 +206,35 @@ interface TableLib {
|
|
|
186
206
|
* @source https://wiki.facepunch.com/gmod/table.IsEmpty
|
|
187
207
|
*/
|
|
188
208
|
IsEmpty(tab: table): boolean;
|
|
209
|
+
|
|
189
210
|
/**
|
|
190
211
|
* Returns whether or not the table's keys are sequential
|
|
191
212
|
* @realm shared and menu
|
|
192
213
|
* @source https://wiki.facepunch.com/gmod/table.IsSequential
|
|
193
214
|
*/
|
|
194
215
|
IsSequential(tab: table): boolean;
|
|
216
|
+
|
|
195
217
|
/**
|
|
196
218
|
* Returns the first key found to be containing the supplied value
|
|
197
219
|
* @realm shared and menu
|
|
198
220
|
* @source https://wiki.facepunch.com/gmod/table.KeyFromValue
|
|
199
221
|
*/
|
|
200
222
|
KeyFromValue(tab: table, value: any): any;
|
|
223
|
+
|
|
201
224
|
/**
|
|
202
225
|
* Returns a table of keys containing the supplied value
|
|
203
226
|
* @realm shared and menu
|
|
204
227
|
* @source https://wiki.facepunch.com/gmod/table.KeysFromValue
|
|
205
228
|
*/
|
|
206
229
|
KeysFromValue(tab: table, value: any): table;
|
|
230
|
+
|
|
207
231
|
/**
|
|
208
232
|
* Returns a copy of the input table with all string keys converted to be lowercase recursively
|
|
209
233
|
* @realm shared and menu
|
|
210
234
|
* @source https://wiki.facepunch.com/gmod/table.LowerKeyNames
|
|
211
235
|
*/
|
|
212
236
|
LowerKeyNames(tbl: table): table;
|
|
237
|
+
|
|
213
238
|
/**
|
|
214
239
|
* Returns an array of values of given with given key from each table of given table.
|
|
215
240
|
*
|
|
@@ -218,6 +243,7 @@ interface TableLib {
|
|
|
218
243
|
* @source https://wiki.facepunch.com/gmod/table.MemberValuesFromKey
|
|
219
244
|
*/
|
|
220
245
|
MemberValuesFromKey(inputTable: table, keyName: any): table;
|
|
246
|
+
|
|
221
247
|
/**
|
|
222
248
|
* **NOTE**: This function can cause a stack overflow under certain circumstances.
|
|
223
249
|
*
|
|
@@ -233,6 +259,7 @@ interface TableLib {
|
|
|
233
259
|
* @source https://wiki.facepunch.com/gmod/table.Merge
|
|
234
260
|
*/
|
|
235
261
|
Merge(destination: table, source: table, forceOverride?: boolean): table;
|
|
262
|
+
|
|
236
263
|
/**
|
|
237
264
|
* Packs a set of items into a table and returns the new table. It is meant as an alternative implementation of `table.pack` from newer versions of Lua.
|
|
238
265
|
*
|
|
@@ -240,6 +267,7 @@ interface TableLib {
|
|
|
240
267
|
* @source https://wiki.facepunch.com/gmod/table.Pack
|
|
241
268
|
*/
|
|
242
269
|
Pack(...: any): (table, number);
|
|
270
|
+
|
|
243
271
|
/**
|
|
244
272
|
* Returns a random value from the supplied table.
|
|
245
273
|
*
|
|
@@ -254,6 +282,7 @@ interface TableLib {
|
|
|
254
282
|
* @source https://wiki.facepunch.com/gmod/table.Random
|
|
255
283
|
*/
|
|
256
284
|
Random(haystack: table): (any, any);
|
|
285
|
+
|
|
257
286
|
/**
|
|
258
287
|
* Removes the first instance of a given value from the specified table with [table.remove](https://wiki.facepunch.com/gmod/table.remove), then returns the key that the value was found at.
|
|
259
288
|
*
|
|
@@ -263,12 +292,14 @@ interface TableLib {
|
|
|
263
292
|
* @source https://wiki.facepunch.com/gmod/table.RemoveByValue
|
|
264
293
|
*/
|
|
265
294
|
RemoveByValue(tbl: table, val: any): any;
|
|
295
|
+
|
|
266
296
|
/**
|
|
267
297
|
* Returns a reversed copy of a sequential table. Any non-sequential and non-numeric keyvalue pairs will not be copied.
|
|
268
298
|
* @realm shared and menu
|
|
269
299
|
* @source https://wiki.facepunch.com/gmod/table.Reverse
|
|
270
300
|
*/
|
|
271
301
|
Reverse(tbl: table): table;
|
|
302
|
+
|
|
272
303
|
/**
|
|
273
304
|
* Converts [Vector](https://wiki.facepunch.com/gmod/Vector)s, [Angle](https://wiki.facepunch.com/gmod/Angle)s and [boolean](https://wiki.facepunch.com/gmod/boolean)s to be able to be converted to and from key-values via [util.TableToKeyValues](https://wiki.facepunch.com/gmod/util.TableToKeyValues).
|
|
274
305
|
*
|
|
@@ -277,6 +308,7 @@ interface TableLib {
|
|
|
277
308
|
* @source https://wiki.facepunch.com/gmod/table.Sanitise
|
|
278
309
|
*/
|
|
279
310
|
Sanitise(tab: table): table;
|
|
311
|
+
|
|
280
312
|
/**
|
|
281
313
|
* Performs an inline [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) on the table in `O(n)` time
|
|
282
314
|
*
|
|
@@ -284,6 +316,7 @@ interface TableLib {
|
|
|
284
316
|
* @source https://wiki.facepunch.com/gmod/table.Shuffle
|
|
285
317
|
*/
|
|
286
318
|
Shuffle(target: table): void;
|
|
319
|
+
|
|
287
320
|
/**
|
|
288
321
|
* Returns a list of keys sorted based on values of those keys.
|
|
289
322
|
*
|
|
@@ -293,12 +326,14 @@ interface TableLib {
|
|
|
293
326
|
* @source https://wiki.facepunch.com/gmod/table.SortByKey
|
|
294
327
|
*/
|
|
295
328
|
SortByKey(tab: table, descending?: boolean): table;
|
|
329
|
+
|
|
296
330
|
/**
|
|
297
331
|
* Sorts a table by a named member.
|
|
298
332
|
* @realm shared and menu
|
|
299
333
|
* @source https://wiki.facepunch.com/gmod/table.SortByMember
|
|
300
334
|
*/
|
|
301
335
|
SortByMember(tab: table, memberKey: any, ascending?: boolean): void;
|
|
336
|
+
|
|
302
337
|
/**
|
|
303
338
|
* Sorts a table in reverse order from [table.sort](https://wiki.facepunch.com/gmod/table.sort).
|
|
304
339
|
* **NOTE**: This function modifies the table you give to it. Like table.sort, it does not return anything.
|
|
@@ -308,18 +343,21 @@ interface TableLib {
|
|
|
308
343
|
* @source https://wiki.facepunch.com/gmod/table.SortDesc
|
|
309
344
|
*/
|
|
310
345
|
SortDesc(tbl: table): void;
|
|
346
|
+
|
|
311
347
|
/**
|
|
312
348
|
* Converts a table into a string
|
|
313
349
|
* @realm shared and menu
|
|
314
350
|
* @source https://wiki.facepunch.com/gmod/table.ToString
|
|
315
351
|
*/
|
|
316
352
|
ToString(tbl: table, displayName?: string, niceFormatting?: boolean): string;
|
|
353
|
+
|
|
317
354
|
/**
|
|
318
355
|
* Concatenates the contents of a table to a string.
|
|
319
356
|
* @realm shared and menu
|
|
320
357
|
* @source https://wiki.facepunch.com/gmod/table.concat
|
|
321
358
|
*/
|
|
322
359
|
concat(tbl: table, concatenator?: string, startPos?: number, endPos?: number): string;
|
|
360
|
+
|
|
323
361
|
/**
|
|
324
362
|
* Iterates for each key-value pair in the table, calling the function with the key and value of the pair. If the function returns anything, the loop is broken.
|
|
325
363
|
*
|
|
@@ -330,6 +368,7 @@ interface TableLib {
|
|
|
330
368
|
* @deprecated This was deprecated in Lua 5.1 and removed in 5.2. You should use Global.pairs instead.
|
|
331
369
|
*/
|
|
332
370
|
ForEach(tbl: table, callback: (key: any, val: any) => void): void;
|
|
371
|
+
|
|
333
372
|
/**
|
|
334
373
|
* Iterates for each numeric index in the table in order.
|
|
335
374
|
*
|
|
@@ -340,6 +379,7 @@ interface TableLib {
|
|
|
340
379
|
* @deprecated This was deprecated in Lua 5.1 and removed in 5.2. You should use Global.ipairs() instead.
|
|
341
380
|
*/
|
|
342
381
|
foreachi(table: table, func: function): void;
|
|
382
|
+
|
|
343
383
|
/**
|
|
344
384
|
* Returns the length of the table.
|
|
345
385
|
* @realm shared and menu
|
|
@@ -347,6 +387,7 @@ interface TableLib {
|
|
|
347
387
|
* @deprecated This function was deprecated in Lua 5.1 and is removed in 5.2. Use the length (#) operator instead.
|
|
348
388
|
*/
|
|
349
389
|
getn(tbl: table): number;
|
|
390
|
+
|
|
350
391
|
/**
|
|
351
392
|
* Inserts a value at the end of the table.
|
|
352
393
|
* @realm shared
|
|
@@ -362,12 +403,14 @@ interface TableLib {
|
|
|
362
403
|
* @realm menu
|
|
363
404
|
*/
|
|
364
405
|
insert(tbl: table, position: number, value: any): number;
|
|
406
|
+
|
|
365
407
|
/**
|
|
366
408
|
* Returns the highest numerical key.
|
|
367
409
|
* @realm shared and menu
|
|
368
410
|
* @source https://wiki.facepunch.com/gmod/table.maxn
|
|
369
411
|
*/
|
|
370
412
|
maxn(tbl: table): number;
|
|
413
|
+
|
|
371
414
|
/**
|
|
372
415
|
* Moves elements from one part of a table to another part a given table. This is similar to assigning elements from the source table to the destination table in multiple assignments.
|
|
373
416
|
*
|
|
@@ -375,6 +418,7 @@ interface TableLib {
|
|
|
375
418
|
* @source https://wiki.facepunch.com/gmod/table.move
|
|
376
419
|
*/
|
|
377
420
|
move(sourceTbl: table, from: number, to: number, dest: number, destTbl?: table): table;
|
|
421
|
+
|
|
378
422
|
/**
|
|
379
423
|
* Removes a value from a table and shifts any other values down to fill the gap.
|
|
380
424
|
* **NOTE**: Does nothing if index is less than 1 or greater than `#tbl`
|
|
@@ -383,6 +427,7 @@ interface TableLib {
|
|
|
383
427
|
* @source https://wiki.facepunch.com/gmod/table.remove
|
|
384
428
|
*/
|
|
385
429
|
remove(tbl: table, index?: number): any;
|
|
430
|
+
|
|
386
431
|
/**
|
|
387
432
|
* Sorts a sequential table either ascending or by the given sort function.
|
|
388
433
|
* **NOTE**: This function modifies the table you give to it and internally uses the [quick sort algorithm](http://www.lua.org/source/5.2/ltablib.c.html#sort).
|
|
@@ -393,51 +438,3 @@ interface TableLib {
|
|
|
393
438
|
*/
|
|
394
439
|
sort(tbl: table, sorter?: (a: any, b: any) => boolean): void;
|
|
395
440
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
package/types/task.d.tlua
CHANGED
|
@@ -12,36 +12,42 @@ interface Task {
|
|
|
12
12
|
* @source https://wiki.facepunch.com/gmod/Task:Init
|
|
13
13
|
*/
|
|
14
14
|
Init(self: Task): void;
|
|
15
|
+
|
|
15
16
|
/**
|
|
16
17
|
* Initialises the AI task as an engine task.
|
|
17
18
|
* @realm server
|
|
18
19
|
* @source https://wiki.facepunch.com/gmod/Task:InitEngine
|
|
19
20
|
*/
|
|
20
21
|
InitEngine(self: Task, taskname: string, taskdata: number): void;
|
|
22
|
+
|
|
21
23
|
/**
|
|
22
24
|
* Initialises the AI task as NPC method-based.
|
|
23
25
|
* @realm server
|
|
24
26
|
* @source https://wiki.facepunch.com/gmod/Task:InitFunctionName
|
|
25
27
|
*/
|
|
26
28
|
InitFunctionName(self: Task, startname: string, runname: string, taskdata: number): void;
|
|
29
|
+
|
|
27
30
|
/**
|
|
28
31
|
* Determines if the task is an engine task (`TYPE_ENGINE`, 1).
|
|
29
32
|
* @realm server
|
|
30
33
|
* @source https://wiki.facepunch.com/gmod/Task:IsEngineType
|
|
31
34
|
*/
|
|
32
35
|
IsEngineType(self: Task): void;
|
|
36
|
+
|
|
33
37
|
/**
|
|
34
38
|
* Determines if the task is an NPC method-based task (`TYPE_FNAME`, 2).
|
|
35
39
|
* @realm server
|
|
36
40
|
* @source https://wiki.facepunch.com/gmod/Task:IsFNameType
|
|
37
41
|
*/
|
|
38
42
|
IsFNameType(self: Task): void;
|
|
43
|
+
|
|
39
44
|
/**
|
|
40
45
|
* Runs the AI task.
|
|
41
46
|
* @realm server
|
|
42
47
|
* @source https://wiki.facepunch.com/gmod/Task:Run
|
|
43
48
|
*/
|
|
44
49
|
Run(self: Task, target: NPC): void;
|
|
50
|
+
|
|
45
51
|
/**
|
|
46
52
|
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
47
53
|
* Runs the AI task as an NPC method. This requires the task to be of type `TYPE_FNAME`.
|
|
@@ -49,12 +55,14 @@ interface Task {
|
|
|
49
55
|
* @source https://wiki.facepunch.com/gmod/Task:Run_FName
|
|
50
56
|
*/
|
|
51
57
|
Run_FName(self: Task, target: NPC): void;
|
|
58
|
+
|
|
52
59
|
/**
|
|
53
60
|
* Starts the AI task.
|
|
54
61
|
* @realm server
|
|
55
62
|
* @source https://wiki.facepunch.com/gmod/Task:Start
|
|
56
63
|
*/
|
|
57
64
|
Start(self: Task, target: NPC): void;
|
|
65
|
+
|
|
58
66
|
/**
|
|
59
67
|
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
60
68
|
* Starts the AI task as an NPC method.
|
|
@@ -63,13 +71,3 @@ interface Task {
|
|
|
63
71
|
*/
|
|
64
72
|
Start_FName(self: Task, target: NPC): void;
|
|
65
73
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
package/types/team.d.tlua
CHANGED
|
@@ -13,36 +13,42 @@ interface TeamLib {
|
|
|
13
13
|
* @source https://wiki.facepunch.com/gmod/team.AddScore
|
|
14
14
|
*/
|
|
15
15
|
AddScore(index: number, increment: number): void;
|
|
16
|
+
|
|
16
17
|
/**
|
|
17
18
|
* Returns the team index of the team with the least players. Falls back to TEAM_UNASSIGNED
|
|
18
19
|
* @realm shared
|
|
19
20
|
* @source https://wiki.facepunch.com/gmod/team.BestAutoJoinTeam
|
|
20
21
|
*/
|
|
21
22
|
BestAutoJoinTeam(): number;
|
|
23
|
+
|
|
22
24
|
/**
|
|
23
25
|
* Returns the real table consisting of information on every defined team
|
|
24
26
|
* @realm shared
|
|
25
27
|
* @source https://wiki.facepunch.com/gmod/team.GetAllTeams
|
|
26
28
|
*/
|
|
27
29
|
GetAllTeams(): table;
|
|
30
|
+
|
|
28
31
|
/**
|
|
29
32
|
* Returns the selectable classes for the given team. This can be added to with [team.SetClass](https://wiki.facepunch.com/gmod/team.SetClass)
|
|
30
33
|
* @realm shared
|
|
31
34
|
* @source https://wiki.facepunch.com/gmod/team.GetClass
|
|
32
35
|
*/
|
|
33
36
|
GetClass(index: number): table;
|
|
37
|
+
|
|
34
38
|
/**
|
|
35
39
|
* Returns the team's color.
|
|
36
40
|
* @realm shared
|
|
37
41
|
* @source https://wiki.facepunch.com/gmod/team.GetColor
|
|
38
42
|
*/
|
|
39
43
|
GetColor(teamIndex: number): Color;
|
|
44
|
+
|
|
40
45
|
/**
|
|
41
46
|
* Returns the name of the team.
|
|
42
47
|
* @realm shared
|
|
43
48
|
* @source https://wiki.facepunch.com/gmod/team.GetName
|
|
44
49
|
*/
|
|
45
50
|
GetName(teamIndex: number): string;
|
|
51
|
+
|
|
46
52
|
/**
|
|
47
53
|
* Returns a table with all player of the specified team.
|
|
48
54
|
* **NOTE**: This function returns a sequential table, meaning it should be looped with [Global.ipairs](https://wiki.facepunch.com/gmod/Global.ipairs) instead of [Global.pairs](https://wiki.facepunch.com/gmod/Global.pairs) for efficiency reasons.
|
|
@@ -52,54 +58,63 @@ interface TeamLib {
|
|
|
52
58
|
* @source https://wiki.facepunch.com/gmod/team.GetPlayers
|
|
53
59
|
*/
|
|
54
60
|
GetPlayers(teamIndex: number): table;
|
|
61
|
+
|
|
55
62
|
/**
|
|
56
63
|
* Returns the score of the team.
|
|
57
64
|
* @realm shared
|
|
58
65
|
* @source https://wiki.facepunch.com/gmod/team.GetScore
|
|
59
66
|
*/
|
|
60
67
|
GetScore(teamIndex: number): number;
|
|
68
|
+
|
|
61
69
|
/**
|
|
62
70
|
* Returns a table of valid spawnpoint classes the team can use. These are set with [team.SetSpawnPoint](https://wiki.facepunch.com/gmod/team.SetSpawnPoint).
|
|
63
71
|
* @realm shared
|
|
64
72
|
* @source https://wiki.facepunch.com/gmod/team.GetSpawnPoint
|
|
65
73
|
*/
|
|
66
74
|
GetSpawnPoint(index: number): table;
|
|
75
|
+
|
|
67
76
|
/**
|
|
68
77
|
* Returns a table of valid spawnpoint entities the team can use. These are set with [team.SetSpawnPoint](https://wiki.facepunch.com/gmod/team.SetSpawnPoint).
|
|
69
78
|
* @realm shared
|
|
70
79
|
* @source https://wiki.facepunch.com/gmod/team.GetSpawnPoints
|
|
71
80
|
*/
|
|
72
81
|
GetSpawnPoints(index: number): table;
|
|
82
|
+
|
|
73
83
|
/**
|
|
74
84
|
* Returns if a team is joinable or not. This is set in [team.SetUp](https://wiki.facepunch.com/gmod/team.SetUp).
|
|
75
85
|
* @realm shared
|
|
76
86
|
* @source https://wiki.facepunch.com/gmod/team.Joinable
|
|
77
87
|
*/
|
|
78
88
|
Joinable(index: number): boolean;
|
|
89
|
+
|
|
79
90
|
/**
|
|
80
91
|
* Returns the amount of players in a team.
|
|
81
92
|
* @realm shared
|
|
82
93
|
* @source https://wiki.facepunch.com/gmod/team.NumPlayers
|
|
83
94
|
*/
|
|
84
95
|
NumPlayers(teamIndex: number): number;
|
|
96
|
+
|
|
85
97
|
/**
|
|
86
98
|
* Sets valid classes for use by a team. Classes can be created using [player_manager.RegisterClass](https://wiki.facepunch.com/gmod/player_manager.RegisterClass)
|
|
87
99
|
* @realm shared
|
|
88
100
|
* @source https://wiki.facepunch.com/gmod/team.SetClass
|
|
89
101
|
*/
|
|
90
102
|
SetClass(index: number, classes: any): void;
|
|
103
|
+
|
|
91
104
|
/**
|
|
92
105
|
* Sets the team's color.
|
|
93
106
|
* @realm shared
|
|
94
107
|
* @source https://wiki.facepunch.com/gmod/team.SetColor
|
|
95
108
|
*/
|
|
96
109
|
SetColor(teamIndex: number, color: Color): void;
|
|
110
|
+
|
|
97
111
|
/**
|
|
98
112
|
* Sets the score of the given team
|
|
99
113
|
* @realm shared
|
|
100
114
|
* @source https://wiki.facepunch.com/gmod/team.SetScore
|
|
101
115
|
*/
|
|
102
116
|
SetScore(index: number, score: number): void;
|
|
117
|
+
|
|
103
118
|
/**
|
|
104
119
|
* Sets valid spawnpoint classes for use by a team.
|
|
105
120
|
*
|
|
@@ -110,24 +125,28 @@ interface TeamLib {
|
|
|
110
125
|
* @source https://wiki.facepunch.com/gmod/team.SetSpawnPoint
|
|
111
126
|
*/
|
|
112
127
|
SetSpawnPoint(index: number, classes: any): void;
|
|
128
|
+
|
|
113
129
|
/**
|
|
114
130
|
* Creates a new team. See [GM:CreateTeams](https://wiki.facepunch.com/gmod/GM:CreateTeams) for the hook to call this in.
|
|
115
131
|
* @realm shared
|
|
116
132
|
* @source https://wiki.facepunch.com/gmod/team.SetUp
|
|
117
133
|
*/
|
|
118
134
|
SetUp(teamIndex: number, teamName: string, teamColor: Color, isJoinable?: boolean): void;
|
|
135
|
+
|
|
119
136
|
/**
|
|
120
137
|
* Returns the total number of deaths of all players in the team.
|
|
121
138
|
* @realm shared
|
|
122
139
|
* @source https://wiki.facepunch.com/gmod/team.TotalDeaths
|
|
123
140
|
*/
|
|
124
141
|
TotalDeaths(index: number): number;
|
|
142
|
+
|
|
125
143
|
/**
|
|
126
144
|
* Get's the total frags in a team.
|
|
127
145
|
* @realm shared
|
|
128
146
|
* @source https://wiki.facepunch.com/gmod/team.TotalFrags
|
|
129
147
|
*/
|
|
130
148
|
TotalFrags(entityOrNumber: Entity): number;
|
|
149
|
+
|
|
131
150
|
/**
|
|
132
151
|
* Returns true if the given team index is valid
|
|
133
152
|
* @realm shared
|
|
@@ -135,23 +154,3 @@ interface TeamLib {
|
|
|
135
154
|
*/
|
|
136
155
|
Valid(index: number): boolean;
|
|
137
156
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
package/types/textentry.d.tlua
CHANGED
package/types/tgaimage.d.tlua
CHANGED