@tlua/gmod 1.0.4 → 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 +0 -31
- package/types/ai.d.tlua +0 -11
- package/types/ai_schedule.d.tlua +0 -1
- package/types/ai_task.d.tlua +0 -1
- package/types/angle.d.tlua +0 -37
- package/types/avatarimage.d.tlua +0 -1
- package/types/awesomium.d.tlua +0 -1
- package/types/baseclass.d.tlua +0 -4
- package/types/bf_read.d.tlua +0 -23
- package/types/bit.d.tlua +0 -23
- package/types/button.d.tlua +0 -1
- package/types/cam.d.tlua +0 -33
- package/types/ceffectdata.d.tlua +0 -65
- package/types/chat.d.tlua +0 -11
- package/types/checkbutton.d.tlua +0 -1
- package/types/cleanup.d.tlua +0 -15
- package/types/cluaemitter.d.tlua +0 -25
- package/types/clualocomotion.d.tlua +0 -81
- package/types/cluaparticle.d.tlua +0 -89
- package/types/cmovedata.d.tlua +0 -95
- package/types/cnavarea.d.tlua +0 -155
- package/types/cnavladder.d.tlua +0 -45
- package/types/cnewparticleeffect.d.tlua +0 -53
- package/types/color.d.tlua +0 -57
- package/types/concommand.d.tlua +0 -9
- package/types/constraint.d.tlua +0 -57
- package/types/construct.d.tlua +0 -3
- package/types/contentheader.d.tlua +1 -6
- package/types/contenticon.d.tlua +1 -18
- package/types/contentsidebar.d.tlua +1 -8
- package/types/contentsidebartoolbox.d.tlua +0 -1
- package/types/contextbase.d.tlua +1 -8
- package/types/controlpanel.d.tlua +6 -31
- package/types/controlpresets.d.tlua +1 -26
- package/types/convar.d.tlua +0 -33
- package/types/cookie.d.tlua +0 -7
- package/types/coroutine.d.tlua +0 -15
- package/types/crecipientfilter.d.tlua +0 -33
- package/types/csent.d.tlua +0 -1
- package/types/csoundpatch.d.tlua +0 -29
- package/types/ctakedamageinfo.d.tlua +0 -67
- package/types/ctrllistbox.d.tlua +0 -1
- package/types/ctrlnumpad.d.tlua +0 -13
- package/types/cusercmd.d.tlua +0 -55
- package/types/custom_entity_fields.d.tlua +0 -1
- package/types/cvars.d.tlua +0 -13
- package/types/dadjustablemodelpanel.d.tlua +1 -14
- package/types/dalphabar.d.tlua +1 -6
- package/types/dbinder.d.tlua +1 -8
- package/types/dbubblecontainer.d.tlua +1 -4
- package/types/dbutton.d.tlua +1 -16
- package/types/dcategoryheader.d.tlua +0 -1
- package/types/dcategorylist.d.tlua +0 -1
- package/types/dcheckbox.d.tlua +1 -10
- package/types/dcheckboxlabel.d.tlua +0 -19
- package/types/dcollapsiblecategory.d.tlua +1 -46
- package/types/dcolorbutton.d.tlua +1 -14
- package/types/dcolorcombo.d.tlua +1 -10
- package/types/dcolorcube.d.tlua +1 -26
- package/types/dcolormixer.d.tlua +1 -54
- package/types/dcolorpalette.d.tlua +1 -46
- package/types/dcolumnsheet.d.tlua +1 -10
- package/types/dcombobox.d.tlua +1 -34
- package/types/ddragbase.d.tlua +1 -26
- package/types/ddrawer.d.tlua +1 -16
- package/types/debug.d.tlua +25 -60
- package/types/debugoverlay.d.tlua +0 -23
- package/types/dentityproperties.d.tlua +1 -10
- package/types/derma.d.tlua +0 -21
- package/types/dexpandbutton.d.tlua +1 -6
- package/types/dfilebrowser.d.tlua +0 -41
- package/types/dform.d.tlua +1 -36
- package/types/dframe.d.tlua +0 -49
- package/types/dgrid.d.tlua +1 -22
- package/types/dhorizontaldivider.d.tlua +1 -40
- package/types/dhorizontalscroller.d.tlua +1 -22
- package/types/dhscrollbar.d.tlua +1 -22
- package/types/dhtml.d.tlua +1 -16
- package/types/dhtmlcontrols.d.tlua +0 -11
- package/types/diconbrowser.d.tlua +1 -22
- package/types/diconlayout.d.tlua +1 -36
- package/types/dimage.d.tlua +1 -39
- package/types/dimagebutton.d.tlua +0 -19
- package/types/dkillicon.d.tlua +0 -1
- package/types/dlabel.d.tlua +1 -66
- package/types/dlabeleditable.d.tlua +1 -10
- package/types/dlabelurl.d.tlua +1 -20
- package/types/dlistbox.d.tlua +1 -16
- package/types/dlistboxitem.d.tlua +1 -8
- package/types/dlistlayout.d.tlua +0 -1
- package/types/dlistview.d.tlua +1 -68
- package/types/dlistview_column.d.tlua +1 -28
- package/types/dlistview_columnplain.d.tlua +0 -1
- package/types/dlistview_draggerbar.d.tlua +0 -1
- package/types/dlistview_line.d.tlua +1 -26
- 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 +1 -53
- package/types/dmenubar.d.tlua +1 -11
- package/types/dmenuoption.d.tlua +1 -26
- package/types/dmenuoptioncvar.d.tlua +1 -12
- package/types/dmodelpanel.d.tlua +1 -44
- package/types/dmodelselect.d.tlua +1 -4
- package/types/dmodelselectmulti.d.tlua +1 -4
- package/types/dnotify.d.tlua +1 -20
- package/types/dnumberscratch.d.tlua +1 -52
- package/types/dnumberwang.d.tlua +1 -32
- package/types/dnumpad.d.tlua +0 -1
- package/types/dnumslider.d.tlua +0 -35
- package/types/dpanel.d.tlua +1 -28
- package/types/dpanellist.d.tlua +0 -23
- package/types/dpaneloverlay.d.tlua +1 -14
- package/types/dpanelselect.d.tlua +0 -1
- package/types/dpanpanel.d.tlua +1 -12
- package/types/dprogress.d.tlua +1 -6
- package/types/dproperties.d.tlua +1 -8
- package/types/dproperty_boolean.d.tlua +0 -1
- package/types/dproperty_combo.d.tlua +1 -6
- package/types/dproperty_entity.d.tlua +0 -1
- package/types/dproperty_float.d.tlua +0 -1
- package/types/dproperty_generic.d.tlua +1 -10
- package/types/dproperty_int.d.tlua +0 -1
- package/types/dproperty_vectorcolor.d.tlua +0 -1
- package/types/dpropertysheet.d.tlua +9 -41
- package/types/dragndrop.d.tlua +0 -21
- package/types/draw.d.tlua +0 -22
- package/types/drgbpicker.d.tlua +1 -8
- package/types/drive.d.tlua +6 -31
- package/types/dscrollbargrip.d.tlua +0 -1
- package/types/dscrollpanel.d.tlua +0 -21
- package/types/dshape.d.tlua +1 -14
- package/types/dsizetocontents.d.tlua +1 -10
- package/types/dslider.d.tlua +1 -56
- package/types/dsprite.d.tlua +1 -18
- package/types/dtab.d.tlua +1 -16
- package/types/dtextentry.d.tlua +1 -86
- package/types/dtilelayout.d.tlua +1 -42
- package/types/dtooltip.d.tlua +1 -12
- package/types/dtree.d.tlua +1 -32
- package/types/dtree_node.d.tlua +1 -136
- package/types/dtree_node_button.d.tlua +0 -1
- package/types/duplicator.d.tlua +0 -60
- package/types/dverticaldivider.d.tlua +1 -46
- package/types/dvscrollbar.d.tlua +1 -22
- package/types/editablepanel.d.tlua +0 -1
- package/types/effect.d.tlua +1 -8
- package/types/effects.d.tlua +0 -13
- package/types/engine.d.tlua +0 -43
- package/types/entity.d.tlua +2 -1319
- package/types/ents.d.tlua +0 -44
- package/types/enums.d.tlua +0 -1
- package/types/file.d.tlua +0 -79
- 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 +0 -15
- package/types/game.d.tlua +0 -79
- package/types/gameevent.d.tlua +4 -9
- package/types/gamemode.d.tlua +0 -6
- package/types/global.d.tlua +0 -18
- package/types/gm.d.tlua +0 -535
- package/types/gmod.d.tlua +0 -1
- package/types/gmsave.d.tlua +0 -9
- package/types/gui.d.tlua +0 -43
- package/types/gwen.d.tlua +0 -7
- package/types/halo.d.tlua +0 -5
- package/types/hammer.d.tlua +0 -1
- package/types/hook.d.tlua +0 -9
- package/types/html.d.tlua +0 -1
- package/types/http.d.tlua +0 -3
- package/types/iconeditor.d.tlua +1 -22
- package/types/igmodaudiochannel.d.tlua +0 -83
- package/types/imagecheckbox.d.tlua +1 -8
- package/types/imaterial.d.tlua +0 -53
- package/types/imesh.d.tlua +0 -11
- package/types/input.d.tlua +0 -47
- package/types/invalidateinternalentitycache.d.tlua +0 -1
- package/types/irestore.d.tlua +0 -19
- package/types/isave.d.tlua +0 -19
- package/types/itexture.d.tlua +0 -21
- package/types/ivideowriter.d.tlua +0 -11
- package/types/jit.d.tlua +9 -42
- package/types/killicon.d.tlua +0 -15
- package/types/label.d.tlua +0 -1
- package/types/language.d.tlua +0 -3
- package/types/list.d.tlua +0 -17
- package/types/makeballoon.d.tlua +0 -1
- package/types/markup.d.tlua +0 -5
- package/types/markupobject.d.tlua +0 -11
- package/types/material.d.tlua +0 -1
- package/types/math.d.tlua +200 -371
- package/types/matproxy.d.tlua +0 -7
- package/types/matselect.d.tlua +1 -22
- package/types/menu.d.tlua +0 -1
- package/types/menubar.d.tlua +0 -5
- package/types/mesh.d.tlua +0 -39
- package/types/modelimage.d.tlua +0 -1
- package/types/motionsensor.d.tlua +0 -21
- package/types/navmesh.d.tlua +0 -53
- package/types/net.d.tlua +0 -104
- package/types/nextbot.d.tlua +10 -83
- package/types/notification.d.tlua +0 -5
- package/types/npc.d.tlua +1 -364
- package/types/numpad.d.tlua +0 -15
- package/types/os.d.tlua +0 -8
- package/types/package.d.tlua +0 -1
- package/types/panel.d.tlua +2 -662
- package/types/panellist.d.tlua +0 -1
- package/types/pathfollower.d.tlua +0 -63
- package/types/permissions.d.tlua +0 -13
- package/types/physcollide.d.tlua +0 -7
- package/types/physenv.d.tlua +0 -23
- package/types/physobj.d.tlua +0 -157
- package/types/pixelvis_handle_t.d.tlua +0 -1
- package/types/player.d.tlua +11 -594
- package/types/player_manager.d.tlua +0 -27
- package/types/preseteditor.d.tlua +0 -1
- package/types/presets.d.tlua +0 -13
- package/types/projectedtexture.d.tlua +0 -97
- package/types/properties.d.tlua +0 -11
- package/types/propselect.d.tlua +1 -10
- package/types/radiobutton.d.tlua +0 -1
- package/types/render.d.tlua +0 -285
- package/types/resource.d.tlua +0 -5
- package/types/richtext.d.tlua +0 -1
- package/types/sandbox.d.tlua +1 -108
- package/types/saverestore.d.tlua +0 -25
- package/types/schedule.d.tlua +0 -13
- package/types/scripted_ents.d.tlua +0 -21
- package/types/search.d.tlua +0 -3
- package/types/serverlist.d.tlua +0 -15
- package/types/slidebar.d.tlua +0 -1
- package/types/slider.d.tlua +0 -1
- package/types/sound.d.tlua +0 -21
- package/types/spawnicon.d.tlua +1 -16
- package/types/spawnmenu.d.tlua +0 -48
- package/types/spawnmenucontentpanel.d.tlua +1 -10
- package/types/sql.d.tlua +0 -19
- package/types/stack.d.tlua +0 -11
- package/types/steamworks.d.tlua +0 -37
- package/types/string.d.tlua +0 -96
- package/types/structures.d.tlua +0 -7
- package/types/surface.d.tlua +0 -69
- package/types/surfaceinfo.d.tlua +0 -11
- package/types/system.d.tlua +0 -21
- package/types/table.d.tlua +0 -93
- package/types/task.d.tlua +0 -19
- package/types/team.d.tlua +0 -39
- package/types/textentry.d.tlua +0 -1
- package/types/tgaimage.d.tlua +0 -1
- package/types/timer.d.tlua +0 -29
- package/types/tool.d.tlua +1 -90
- package/types/ugcpublishwindow.d.tlua +1 -18
- package/types/umsg.d.tlua +0 -25
- package/types/undo.d.tlua +0 -21
- package/types/urllabel.d.tlua +0 -1
- package/types/usermessage.d.tlua +0 -5
- package/types/utf8.d.tlua +0 -15
- package/types/util.d.tlua +0 -185
- package/types/vector.d.tlua +0 -73
- package/types/vehicle.d.tlua +2 -102
- package/types/vgui.d.tlua +0 -33
- package/types/video.d.tlua +0 -1
- package/types/vmatrix.d.tlua +0 -71
- package/types/weapon.d.tlua +2 -168
- package/types/weapons.d.tlua +0 -12
- package/types/widgets.d.tlua +0 -3
- package/types/workshopfilebase.d.tlua +0 -11
package/types/util.d.tlua
CHANGED
|
@@ -12,9 +12,7 @@ declare util: UtilLib;
|
|
|
12
12
|
*/
|
|
13
13
|
interface UtilLib {
|
|
14
14
|
worldpicker: UtilworldpickerLib;
|
|
15
|
-
}
|
|
16
15
|
|
|
17
|
-
interface UtilLib {
|
|
18
16
|
/**
|
|
19
17
|
* Adds the specified string to a string table, which will cache it and network it to all clients automatically.
|
|
20
18
|
* Whenever you want to create a net message with [net.Start](https://wiki.facepunch.com/gmod/net.Start), you must add the name of that message as a networked string via this function.
|
|
@@ -35,9 +33,7 @@ interface UtilLib {
|
|
|
35
33
|
* @source https://wiki.facepunch.com/gmod/util.AddNetworkString
|
|
36
34
|
*/
|
|
37
35
|
AddNetworkString(str: string): number;
|
|
38
|
-
}
|
|
39
36
|
|
|
40
|
-
interface UtilLib {
|
|
41
37
|
/**
|
|
42
38
|
* Function used to calculate aim vector from 2D screen position. It is used in SuperDOF calculate Distance.
|
|
43
39
|
*
|
|
@@ -47,18 +43,14 @@ interface UtilLib {
|
|
|
47
43
|
* @source https://wiki.facepunch.com/gmod/util.AimVector
|
|
48
44
|
*/
|
|
49
45
|
AimVector(ViewAngles: Angle, ViewFOV: number, x: number, y: number, scrWidth: number, scrHeight: number): Vector;
|
|
50
|
-
}
|
|
51
46
|
|
|
52
|
-
interface UtilLib {
|
|
53
47
|
/**
|
|
54
48
|
* Decodes the specified string from base64.
|
|
55
49
|
* @realm shared and menu
|
|
56
50
|
* @source https://wiki.facepunch.com/gmod/util.Base64Decode
|
|
57
51
|
*/
|
|
58
52
|
Base64Decode(str: string): string;
|
|
59
|
-
}
|
|
60
53
|
|
|
61
|
-
interface UtilLib {
|
|
62
54
|
/**
|
|
63
55
|
* Encodes the specified string to base64.
|
|
64
56
|
*
|
|
@@ -69,27 +61,21 @@ interface UtilLib {
|
|
|
69
61
|
* @source https://wiki.facepunch.com/gmod/util.Base64Encode
|
|
70
62
|
*/
|
|
71
63
|
Base64Encode(str: string, inline?: boolean): string;
|
|
72
|
-
}
|
|
73
64
|
|
|
74
|
-
interface UtilLib {
|
|
75
65
|
/**
|
|
76
66
|
* Applies explosion damage to all entities in the specified radius. Performs block checking.
|
|
77
67
|
* @realm server
|
|
78
68
|
* @source https://wiki.facepunch.com/gmod/util.BlastDamage
|
|
79
69
|
*/
|
|
80
70
|
BlastDamage(inflictor: Entity, attacker: Entity, damageOrigin: Vector, damageRadius: number, damage: number): void;
|
|
81
|
-
}
|
|
82
71
|
|
|
83
|
-
interface UtilLib {
|
|
84
72
|
/**
|
|
85
73
|
* Applies spherical damage based on damage info to all entities in the specified radius.
|
|
86
74
|
* @realm server
|
|
87
75
|
* @source https://wiki.facepunch.com/gmod/util.BlastDamageInfo
|
|
88
76
|
*/
|
|
89
77
|
BlastDamageInfo(dmg: CTakeDamageInfo, damageOrigin: Vector, damageRadius: number): void;
|
|
90
|
-
}
|
|
91
78
|
|
|
92
|
-
interface UtilLib {
|
|
93
79
|
/**
|
|
94
80
|
* Generates the [CRC Checksum](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) of the specified string.
|
|
95
81
|
*
|
|
@@ -100,9 +86,7 @@ interface UtilLib {
|
|
|
100
86
|
* @source https://wiki.facepunch.com/gmod/util.CRC
|
|
101
87
|
*/
|
|
102
88
|
CRC(stringToChecksum: string): string;
|
|
103
|
-
}
|
|
104
89
|
|
|
105
|
-
interface UtilLib {
|
|
106
90
|
/**
|
|
107
91
|
* Compresses the given string using the [LZMA](https://en.wikipedia.org/wiki/LZMA) algorithm.
|
|
108
92
|
*
|
|
@@ -117,27 +101,21 @@ interface UtilLib {
|
|
|
117
101
|
* @source https://wiki.facepunch.com/gmod/util.Compress
|
|
118
102
|
*/
|
|
119
103
|
Compress(str: string): string;
|
|
120
|
-
}
|
|
121
104
|
|
|
122
|
-
interface UtilLib {
|
|
123
105
|
/**
|
|
124
106
|
* Returns the current date formatted like '2012-10-31 18-00-00'
|
|
125
107
|
* @realm shared and menu
|
|
126
108
|
* @source https://wiki.facepunch.com/gmod/util.DateStamp
|
|
127
109
|
*/
|
|
128
110
|
DateStamp(): string;
|
|
129
|
-
}
|
|
130
111
|
|
|
131
|
-
interface UtilLib {
|
|
132
112
|
/**
|
|
133
113
|
* Performs a trace and paints a decal to the surface hit.
|
|
134
114
|
* @realm shared
|
|
135
115
|
* @source https://wiki.facepunch.com/gmod/util.Decal
|
|
136
116
|
*/
|
|
137
117
|
Decal(name: string, start: Vector, _end: Vector, filter?: Entity | Entity[]): void;
|
|
138
|
-
}
|
|
139
118
|
|
|
140
|
-
interface UtilLib {
|
|
141
119
|
/**
|
|
142
120
|
* Performs a trace and paints a decal to the surface hit.
|
|
143
121
|
*
|
|
@@ -148,9 +126,7 @@ interface UtilLib {
|
|
|
148
126
|
* @source https://wiki.facepunch.com/gmod/util.DecalEx
|
|
149
127
|
*/
|
|
150
128
|
DecalEx(material: IMaterial, ent: Entity, position: Vector, normal: Vector, color: Color, w: number, h: number): void;
|
|
151
|
-
}
|
|
152
129
|
|
|
153
|
-
interface UtilLib {
|
|
154
130
|
/**
|
|
155
131
|
* Gets the full material path by the decal name. Used with [util.DecalEx](https://wiki.facepunch.com/gmod/util.DecalEx).
|
|
156
132
|
*
|
|
@@ -159,9 +135,7 @@ interface UtilLib {
|
|
|
159
135
|
* @source https://wiki.facepunch.com/gmod/util.DecalMaterial
|
|
160
136
|
*/
|
|
161
137
|
DecalMaterial(decalName: string): string;
|
|
162
|
-
}
|
|
163
138
|
|
|
164
|
-
interface UtilLib {
|
|
165
139
|
/**
|
|
166
140
|
* Decompresses the given string using [LZMA](https://en.wikipedia.org/wiki/LZMA) algorithm. Used to decompress strings previously compressed with [util.Compress](https://wiki.facepunch.com/gmod/util.Compress).
|
|
167
141
|
*
|
|
@@ -178,18 +152,14 @@ interface UtilLib {
|
|
|
178
152
|
* @source https://wiki.facepunch.com/gmod/util.Decompress
|
|
179
153
|
*/
|
|
180
154
|
Decompress(compressedString: string, maxSize?: number): string | nil;
|
|
181
|
-
}
|
|
182
155
|
|
|
183
|
-
interface UtilLib {
|
|
184
156
|
/**
|
|
185
157
|
* Gets the distance between a line and a point in 3d space.
|
|
186
158
|
* @realm shared
|
|
187
159
|
* @source https://wiki.facepunch.com/gmod/util.DistanceToLine
|
|
188
160
|
*/
|
|
189
161
|
DistanceToLine(lineStart: Vector, lineEnd: Vector, pointPos: Vector): (number, Vector, number);
|
|
190
|
-
}
|
|
191
162
|
|
|
192
|
-
interface UtilLib {
|
|
193
163
|
/**
|
|
194
164
|
* Creates an effect with the specified data.
|
|
195
165
|
*
|
|
@@ -204,9 +174,7 @@ interface UtilLib {
|
|
|
204
174
|
* @source https://wiki.facepunch.com/gmod/util.Effect
|
|
205
175
|
*/
|
|
206
176
|
Effect(effectName: string, effectData: CEffectData, allowOverride?: boolean, ignorePredictionOrRecipientFilter?: boolean | CRecipientFilter): void;
|
|
207
|
-
}
|
|
208
177
|
|
|
209
|
-
interface UtilLib {
|
|
210
178
|
/**
|
|
211
179
|
* Filters given text using Steam's filtering system. The function will obey local client's Steam settings for chat filtering:
|
|
212
180
|
*
|
|
@@ -219,9 +187,7 @@ interface UtilLib {
|
|
|
219
187
|
* @source https://wiki.facepunch.com/gmod/util.FilterText
|
|
220
188
|
*/
|
|
221
189
|
FilterText(str: string, context?: number, player?: Player): string;
|
|
222
|
-
}
|
|
223
190
|
|
|
224
|
-
interface UtilLib {
|
|
225
191
|
/**
|
|
226
192
|
* Converts the full path of the given file to a relative path.
|
|
227
193
|
* You can use [util.RelativePathToFull_Menu](https://wiki.facepunch.com/gmod/util.RelativePathToFull_Menu) to convert the relative path back to the full path.
|
|
@@ -230,9 +196,7 @@ interface UtilLib {
|
|
|
230
196
|
* @source https://wiki.facepunch.com/gmod/util.FullPathToRelative_Menu
|
|
231
197
|
*/
|
|
232
198
|
FullPathToRelative_Menu(fullPath: string, fsPath?: string): string;
|
|
233
|
-
}
|
|
234
199
|
|
|
235
|
-
interface UtilLib {
|
|
236
200
|
/**
|
|
237
201
|
* Returns the ID of a custom model activity. This is useful for models that define custom ones.
|
|
238
202
|
*
|
|
@@ -242,9 +206,7 @@ interface UtilLib {
|
|
|
242
206
|
* @source https://wiki.facepunch.com/gmod/util.GetActivityIDByName
|
|
243
207
|
*/
|
|
244
208
|
GetActivityIDByName(arg0: string): number;
|
|
245
|
-
}
|
|
246
209
|
|
|
247
|
-
interface UtilLib {
|
|
248
210
|
/**
|
|
249
211
|
* Returns a name for given activity ID. This is useful for models that define custom activities.
|
|
250
212
|
*
|
|
@@ -254,9 +216,7 @@ interface UtilLib {
|
|
|
254
216
|
* @source https://wiki.facepunch.com/gmod/util.GetActivityNameByID
|
|
255
217
|
*/
|
|
256
218
|
GetActivityNameByID(id: number): string;
|
|
257
|
-
}
|
|
258
219
|
|
|
259
|
-
interface UtilLib {
|
|
260
220
|
/**
|
|
261
221
|
* Returns the ID of a custom model animation event. This is useful for models that define custom animation events.
|
|
262
222
|
*
|
|
@@ -266,9 +226,7 @@ interface UtilLib {
|
|
|
266
226
|
* @source https://wiki.facepunch.com/gmod/util.GetAnimEventIDByName
|
|
267
227
|
*/
|
|
268
228
|
GetAnimEventIDByName(arg0: string): number;
|
|
269
|
-
}
|
|
270
229
|
|
|
271
|
-
interface UtilLib {
|
|
272
230
|
/**
|
|
273
231
|
* Returns a name for given automatically generated numerical animation event ID. This is useful for models that define custom animation events.
|
|
274
232
|
*
|
|
@@ -278,9 +236,7 @@ interface UtilLib {
|
|
|
278
236
|
* @source https://wiki.facepunch.com/gmod/util.GetAnimEventNameByID
|
|
279
237
|
*/
|
|
280
238
|
GetAnimEventNameByID(id: number): string;
|
|
281
|
-
}
|
|
282
239
|
|
|
283
|
-
interface UtilLib {
|
|
284
240
|
/**
|
|
285
241
|
* Returns a table containing the info about the model. The model will be loaded and cached if it was not previously.
|
|
286
242
|
*
|
|
@@ -304,9 +260,7 @@ interface UtilLib {
|
|
|
304
260
|
* @source https://wiki.facepunch.com/gmod/util.GetModelInfo
|
|
305
261
|
*/
|
|
306
262
|
GetModelInfo(mdl: string): ModelInfo;
|
|
307
|
-
}
|
|
308
263
|
|
|
309
|
-
interface UtilLib {
|
|
310
264
|
/**
|
|
311
265
|
* Retrieves vertex, triangle, and bone data for the visual meshes of a given model.
|
|
312
266
|
*
|
|
@@ -317,9 +271,7 @@ interface UtilLib {
|
|
|
317
271
|
* @source https://wiki.facepunch.com/gmod/util.GetModelMeshes
|
|
318
272
|
*/
|
|
319
273
|
GetModelMeshes(model: string, lod?: number, bodygroupMask?: string | number, skin?: number): (ModelMeshData[], BoneBindPose[]);
|
|
320
|
-
}
|
|
321
274
|
|
|
322
|
-
interface UtilLib {
|
|
323
275
|
/**
|
|
324
276
|
* Gets persistent data of an offline player using their SteamID.
|
|
325
277
|
*
|
|
@@ -332,18 +284,14 @@ interface UtilLib {
|
|
|
332
284
|
* @source https://wiki.facepunch.com/gmod/util.GetPData
|
|
333
285
|
*/
|
|
334
286
|
GetPData(steamID: string, name: string, _default: any): string;
|
|
335
|
-
}
|
|
336
287
|
|
|
337
|
-
interface UtilLib {
|
|
338
288
|
/**
|
|
339
289
|
* Creates a new PixVis handle. See [util.PixelVisible](https://wiki.facepunch.com/gmod/util.PixelVisible).
|
|
340
290
|
* @realm client
|
|
341
291
|
* @source https://wiki.facepunch.com/gmod/util.GetPixelVisibleHandle
|
|
342
292
|
*/
|
|
343
293
|
GetPixelVisibleHandle(): pixelvis_handle_t;
|
|
344
|
-
}
|
|
345
294
|
|
|
346
|
-
interface UtilLib {
|
|
347
295
|
/**
|
|
348
296
|
* Utility function to quickly generate a trace table that starts at the players view position, and ends `32768` units along a specified direction.
|
|
349
297
|
*
|
|
@@ -352,27 +300,21 @@ interface UtilLib {
|
|
|
352
300
|
* @source https://wiki.facepunch.com/gmod/util.GetPlayerTrace
|
|
353
301
|
*/
|
|
354
302
|
GetPlayerTrace(ply: Player, dir?: Vector): Trace;
|
|
355
|
-
}
|
|
356
303
|
|
|
357
|
-
interface UtilLib {
|
|
358
304
|
/**
|
|
359
305
|
* Gets information about the sun position and obstruction or nil if there is no sun.
|
|
360
306
|
* @realm client
|
|
361
307
|
* @source https://wiki.facepunch.com/gmod/util.GetSunInfo
|
|
362
308
|
*/
|
|
363
309
|
GetSunInfo(): table;
|
|
364
|
-
}
|
|
365
310
|
|
|
366
|
-
interface UtilLib {
|
|
367
311
|
/**
|
|
368
312
|
* Returns data of a [surface property](https://developer.valvesoftware.com/wiki/Material_surface_properties) at given ID. New surface properties can be added via [physenv.AddSurfaceData](https://wiki.facepunch.com/gmod/physenv.AddSurfaceData).
|
|
369
313
|
* @realm shared
|
|
370
314
|
* @source https://wiki.facepunch.com/gmod/util.GetSurfaceData
|
|
371
315
|
*/
|
|
372
316
|
GetSurfaceData(id: number): SurfacePropertyData;
|
|
373
|
-
}
|
|
374
317
|
|
|
375
|
-
interface UtilLib {
|
|
376
318
|
/**
|
|
377
319
|
* Returns the matching surface property index for the given surface property name.
|
|
378
320
|
*
|
|
@@ -382,9 +324,7 @@ interface UtilLib {
|
|
|
382
324
|
* @source https://wiki.facepunch.com/gmod/util.GetSurfaceIndex
|
|
383
325
|
*/
|
|
384
326
|
GetSurfaceIndex(surfaceName: string): number;
|
|
385
|
-
}
|
|
386
327
|
|
|
387
|
-
interface UtilLib {
|
|
388
328
|
/**
|
|
389
329
|
* Returns the name of a surface property at given ID.
|
|
390
330
|
*
|
|
@@ -394,9 +334,7 @@ interface UtilLib {
|
|
|
394
334
|
* @source https://wiki.facepunch.com/gmod/util.GetSurfacePropName
|
|
395
335
|
*/
|
|
396
336
|
GetSurfacePropName(id: number): string;
|
|
397
|
-
}
|
|
398
337
|
|
|
399
|
-
interface UtilLib {
|
|
400
338
|
/**
|
|
401
339
|
* Returns a table of all SteamIDs that have a usergroup.
|
|
402
340
|
*
|
|
@@ -412,108 +350,84 @@ interface UtilLib {
|
|
|
412
350
|
* @source https://wiki.facepunch.com/gmod/util.GetUserGroups
|
|
413
351
|
*/
|
|
414
352
|
GetUserGroups(): table;
|
|
415
|
-
}
|
|
416
353
|
|
|
417
|
-
interface UtilLib {
|
|
418
354
|
/**
|
|
419
355
|
* Performs a Ray-OBB (Orientated Bounding Box) intersection and returns position, normal and the fraction if there was an intersection.
|
|
420
356
|
* @realm shared
|
|
421
357
|
* @source https://wiki.facepunch.com/gmod/util.IntersectRayWithOBB
|
|
422
358
|
*/
|
|
423
359
|
IntersectRayWithOBB(rayStart: Vector, rayDelta: Vector, boxOrigin: Vector, boxAngles: Angle, boxMins: Vector, boxMaxs: Vector): (Vector, Vector, number);
|
|
424
|
-
}
|
|
425
360
|
|
|
426
|
-
interface UtilLib {
|
|
427
361
|
/**
|
|
428
362
|
* Performs a [ray-plane intersection](https://en.wikipedia.org/wiki/Line%E2%80%93plane_intersection) and returns the hit position or nil.
|
|
429
363
|
* @realm shared
|
|
430
364
|
* @source https://wiki.facepunch.com/gmod/util.IntersectRayWithPlane
|
|
431
365
|
*/
|
|
432
366
|
IntersectRayWithPlane(rayOrigin: Vector, rayDirection: Vector, planePosition: Vector, planeNormal: Vector): Vector;
|
|
433
|
-
}
|
|
434
367
|
|
|
435
|
-
interface UtilLib {
|
|
436
368
|
/**
|
|
437
369
|
* Performs a ray-sphere intersection and returns the intersection positions or nil.
|
|
438
370
|
* @realm shared
|
|
439
371
|
* @source https://wiki.facepunch.com/gmod/util.IntersectRayWithSphere
|
|
440
372
|
*/
|
|
441
373
|
IntersectRayWithSphere(rayOrigin: Vector, rayDelta: Vector, spherePosition: Vector, sphereRadius: number): (number, number);
|
|
442
|
-
}
|
|
443
374
|
|
|
444
|
-
interface UtilLib {
|
|
445
375
|
/**
|
|
446
376
|
* Returns whether a binary module is installed and is resolvable by [Global.require](https://wiki.facepunch.com/gmod/Global.require).
|
|
447
377
|
* @realm shared and menu
|
|
448
378
|
* @source https://wiki.facepunch.com/gmod/util.IsBinaryModuleInstalled
|
|
449
379
|
*/
|
|
450
380
|
IsBinaryModuleInstalled(name: string): boolean;
|
|
451
|
-
}
|
|
452
381
|
|
|
453
|
-
interface UtilLib {
|
|
454
382
|
/**
|
|
455
383
|
* Performs a box-box intersection and returns whether there was an intersection or not.
|
|
456
384
|
* @realm shared
|
|
457
385
|
* @source https://wiki.facepunch.com/gmod/util.IsBoxIntersectingBox
|
|
458
386
|
*/
|
|
459
387
|
IsBoxIntersectingBox(boxMin: Vector, boxMax: Vector, box2Min: Vector, box2Max: Vector): boolean;
|
|
460
|
-
}
|
|
461
388
|
|
|
462
|
-
interface UtilLib {
|
|
463
389
|
/**
|
|
464
390
|
* Performs a box-sphere intersection and returns whether there was an intersection or not.
|
|
465
391
|
* @realm shared
|
|
466
392
|
* @source https://wiki.facepunch.com/gmod/util.IsBoxIntersectingSphere
|
|
467
393
|
*/
|
|
468
394
|
IsBoxIntersectingSphere(boxMin: Vector, boxMax: Vector, shpere2Position: Vector, sphere2Radius: number): boolean;
|
|
469
|
-
}
|
|
470
395
|
|
|
471
|
-
interface UtilLib {
|
|
472
396
|
/**
|
|
473
397
|
* Checks if a certain position is within the world bounds.
|
|
474
398
|
* @realm server
|
|
475
399
|
* @source https://wiki.facepunch.com/gmod/util.IsInWorld
|
|
476
400
|
*/
|
|
477
401
|
IsInWorld(position: Vector): boolean;
|
|
478
|
-
}
|
|
479
402
|
|
|
480
|
-
interface UtilLib {
|
|
481
403
|
/**
|
|
482
404
|
* Checks if the model is loaded in the game.
|
|
483
405
|
* @realm shared
|
|
484
406
|
* @source https://wiki.facepunch.com/gmod/util.IsModelLoaded
|
|
485
407
|
*/
|
|
486
408
|
IsModelLoaded(modelName: string): boolean;
|
|
487
|
-
}
|
|
488
409
|
|
|
489
|
-
interface UtilLib {
|
|
490
410
|
/**
|
|
491
411
|
* Performs OBB on OBB intersection test.
|
|
492
412
|
* @realm shared
|
|
493
413
|
* @source https://wiki.facepunch.com/gmod/util.IsOBBIntersectingOBB
|
|
494
414
|
*/
|
|
495
415
|
IsOBBIntersectingOBB(box1Origin: Vector, box1Angles: Angle, box1Mins: Vector, box1Maxs: Vector, box2Origin: Vector, box2Angles: Angle, box2Mins: Vector, box2Maxs: Vector, tolerance: number): boolean;
|
|
496
|
-
}
|
|
497
416
|
|
|
498
|
-
interface UtilLib {
|
|
499
417
|
/**
|
|
500
418
|
* Returns whether a point is within a cone or not.
|
|
501
419
|
* @realm shared
|
|
502
420
|
* @source https://wiki.facepunch.com/gmod/util.IsPointInCone
|
|
503
421
|
*/
|
|
504
422
|
IsPointInCone(point: Vector, coneOrigin: Vector, coneAxis: Vector, coneSine: number, coneLength: number): boolean;
|
|
505
|
-
}
|
|
506
423
|
|
|
507
|
-
interface UtilLib {
|
|
508
424
|
/**
|
|
509
425
|
* Performs a ray-ray intersection and returns whether there was an intersection or not.
|
|
510
426
|
* @realm shared
|
|
511
427
|
* @source https://wiki.facepunch.com/gmod/util.IsRayIntersectingRay
|
|
512
428
|
*/
|
|
513
429
|
IsRayIntersectingRay(ray1Start: Vector, ray1End: Vector, ray2Start: Vector, ray2End: Vector): (boolean, number, number);
|
|
514
|
-
}
|
|
515
430
|
|
|
516
|
-
interface UtilLib {
|
|
517
431
|
/**
|
|
518
432
|
* Check whether the skybox is visible from the point specified.
|
|
519
433
|
*
|
|
@@ -524,27 +438,21 @@ interface UtilLib {
|
|
|
524
438
|
* @source https://wiki.facepunch.com/gmod/util.IsSkyboxVisibleFromPoint
|
|
525
439
|
*/
|
|
526
440
|
IsSkyboxVisibleFromPoint(position: Vector): boolean;
|
|
527
|
-
}
|
|
528
441
|
|
|
529
|
-
interface UtilLib {
|
|
530
442
|
/**
|
|
531
443
|
* Returns whether a sphere is intersecting a cone or not.
|
|
532
444
|
* @realm shared
|
|
533
445
|
* @source https://wiki.facepunch.com/gmod/util.IsSphereIntersectingCone
|
|
534
446
|
*/
|
|
535
447
|
IsSphereIntersectingCone(sphereCenter: Vector, sphereRadius: number, coneOrigin: Vector, coneAxis: Vector, coneSine: number, coneCosine: number): boolean;
|
|
536
|
-
}
|
|
537
448
|
|
|
538
|
-
interface UtilLib {
|
|
539
449
|
/**
|
|
540
450
|
* Performs a sphere-sphere intersection and returns whether there was an intersection or not.
|
|
541
451
|
* @realm shared
|
|
542
452
|
* @source https://wiki.facepunch.com/gmod/util.IsSphereIntersectingSphere
|
|
543
453
|
*/
|
|
544
454
|
IsSphereIntersectingSphere(sphere1Position: Vector, sphere1Radius: number, sphere2Position: Vector, sphere2Radius: number): boolean;
|
|
545
|
-
}
|
|
546
455
|
|
|
547
|
-
interface UtilLib {
|
|
548
456
|
/**
|
|
549
457
|
* Checks if the specified model is valid.
|
|
550
458
|
*
|
|
@@ -574,36 +482,28 @@ interface UtilLib {
|
|
|
574
482
|
* @source https://wiki.facepunch.com/gmod/util.IsValidModel
|
|
575
483
|
*/
|
|
576
484
|
IsValidModel(modelName: string): boolean;
|
|
577
|
-
}
|
|
578
485
|
|
|
579
|
-
interface UtilLib {
|
|
580
486
|
/**
|
|
581
487
|
* Checks whether the given numbered physics object of the given entity is valid or not. Most useful for ragdolls.
|
|
582
488
|
* @realm shared
|
|
583
489
|
* @source https://wiki.facepunch.com/gmod/util.IsValidPhysicsObject
|
|
584
490
|
*/
|
|
585
491
|
IsValidPhysicsObject(ent: Entity, physobj: number): boolean;
|
|
586
|
-
}
|
|
587
492
|
|
|
588
|
-
interface UtilLib {
|
|
589
493
|
/**
|
|
590
494
|
* Checks if the specified prop is valid (has valid physics object).
|
|
591
495
|
* @realm shared
|
|
592
496
|
* @source https://wiki.facepunch.com/gmod/util.IsValidProp
|
|
593
497
|
*/
|
|
594
498
|
IsValidProp(modelName: string): boolean;
|
|
595
|
-
}
|
|
596
499
|
|
|
597
|
-
interface UtilLib {
|
|
598
500
|
/**
|
|
599
501
|
* Checks if the specified model name points to a valid ragdoll.
|
|
600
502
|
* @realm shared
|
|
601
503
|
* @source https://wiki.facepunch.com/gmod/util.IsValidRagdoll
|
|
602
504
|
*/
|
|
603
505
|
IsValidRagdoll(ragdollName: string): boolean;
|
|
604
|
-
}
|
|
605
506
|
|
|
606
|
-
interface UtilLib {
|
|
607
507
|
/**
|
|
608
508
|
* Converts a JSON string to a Lua table. It supports comments and trailing commas.
|
|
609
509
|
*
|
|
@@ -615,9 +515,7 @@ interface UtilLib {
|
|
|
615
515
|
* @source https://wiki.facepunch.com/gmod/util.JSONToTable
|
|
616
516
|
*/
|
|
617
517
|
JSONToTable(json: string, ignoreLimits?: boolean, ignoreConversions?: boolean): table | nil;
|
|
618
|
-
}
|
|
619
518
|
|
|
620
|
-
interface UtilLib {
|
|
621
519
|
/**
|
|
622
520
|
* Converts a Valve KeyValue string (typically from [util.TableToKeyValues](https://wiki.facepunch.com/gmod/util.TableToKeyValues)) to a Lua table.
|
|
623
521
|
*
|
|
@@ -628,18 +526,14 @@ interface UtilLib {
|
|
|
628
526
|
* @source https://wiki.facepunch.com/gmod/util.KeyValuesToTable
|
|
629
527
|
*/
|
|
630
528
|
KeyValuesToTable(keyValues: string, usesEscapeSequences?: boolean, preserveKeyCase?: boolean): table;
|
|
631
|
-
}
|
|
632
529
|
|
|
633
|
-
interface UtilLib {
|
|
634
530
|
/**
|
|
635
531
|
* Similar to [util.KeyValuesToTable](https://wiki.facepunch.com/gmod/util.KeyValuesToTable), but it also preserves order of keys (since Lua dictionary-style tables do not guarantee a specific order), and allows handling of repeated keys. (since each key can only appear once in a dictionary data structure)
|
|
636
532
|
* @realm shared and menu
|
|
637
533
|
* @source https://wiki.facepunch.com/gmod/util.KeyValuesToTablePreserveOrder
|
|
638
534
|
*/
|
|
639
535
|
KeyValuesToTablePreserveOrder(keyValues: string, usesEscapeSequences?: boolean, preserveKeyCase?: boolean): table;
|
|
640
|
-
}
|
|
641
536
|
|
|
642
|
-
interface UtilLib {
|
|
643
537
|
/**
|
|
644
538
|
* A convenience function around LocalToWorld-related functions.
|
|
645
539
|
*
|
|
@@ -650,9 +544,7 @@ interface UtilLib {
|
|
|
650
544
|
* @source https://wiki.facepunch.com/gmod/util.LocalToWorld
|
|
651
545
|
*/
|
|
652
546
|
LocalToWorld(ent: Entity, lpos: Vector, bone?: number): Vector;
|
|
653
|
-
}
|
|
654
547
|
|
|
655
|
-
interface UtilLib {
|
|
656
548
|
/**
|
|
657
549
|
* Generates the [MD5 hash](https://en.wikipedia.org/wiki/MD5) of the specified string.
|
|
658
550
|
* **WARNING**: MD5 is considered cryptographically broken and is known to be vulnerable to a variety of attacks including duplicate return values. If security or duplicate returns is a concern, use [util.SHA256](https://wiki.facepunch.com/gmod/util.SHA256).
|
|
@@ -662,36 +554,28 @@ interface UtilLib {
|
|
|
662
554
|
* @source https://wiki.facepunch.com/gmod/util.MD5
|
|
663
555
|
*/
|
|
664
556
|
MD5(stringToHash: string): string;
|
|
665
|
-
}
|
|
666
557
|
|
|
667
|
-
interface UtilLib {
|
|
668
558
|
/**
|
|
669
559
|
* Returns the networked string associated with the given ID from the string table.
|
|
670
560
|
* @realm shared
|
|
671
561
|
* @source https://wiki.facepunch.com/gmod/util.NetworkIDToString
|
|
672
562
|
*/
|
|
673
563
|
NetworkIDToString(stringTableID: number): string;
|
|
674
|
-
}
|
|
675
564
|
|
|
676
|
-
interface UtilLib {
|
|
677
565
|
/**
|
|
678
566
|
* Returns the networked ID associated with the given string from the string table.
|
|
679
567
|
* @realm shared
|
|
680
568
|
* @source https://wiki.facepunch.com/gmod/util.NetworkStringToID
|
|
681
569
|
*/
|
|
682
570
|
NetworkStringToID(networkString: string): number;
|
|
683
|
-
}
|
|
684
571
|
|
|
685
|
-
interface UtilLib {
|
|
686
572
|
/**
|
|
687
573
|
* Formats a float by stripping off extra `0's` and `.'s`.
|
|
688
574
|
* @realm shared and menu
|
|
689
575
|
* @source https://wiki.facepunch.com/gmod/util.NiceFloat
|
|
690
576
|
*/
|
|
691
577
|
NiceFloat(float: number): string;
|
|
692
|
-
}
|
|
693
578
|
|
|
694
|
-
interface UtilLib {
|
|
695
579
|
/**
|
|
696
580
|
* Creates an orange box (.pcf) tracer effect with the given parameters. See [util.ParticleTracerEx](https://wiki.facepunch.com/gmod/util.ParticleTracerEx) for version with additional arguments.
|
|
697
581
|
*
|
|
@@ -703,18 +587,14 @@ interface UtilLib {
|
|
|
703
587
|
* @source https://wiki.facepunch.com/gmod/util.ParticleTracer
|
|
704
588
|
*/
|
|
705
589
|
ParticleTracer(name: string, startPos: Vector, endPos: Vector, doWhiz: boolean): void;
|
|
706
|
-
}
|
|
707
590
|
|
|
708
|
-
interface UtilLib {
|
|
709
591
|
/**
|
|
710
592
|
* Creates a tracer effect with the given parameters. Expanded version of [util.ParticleTracer](https://wiki.facepunch.com/gmod/util.ParticleTracer).
|
|
711
593
|
* @realm shared
|
|
712
594
|
* @source https://wiki.facepunch.com/gmod/util.ParticleTracerEx
|
|
713
595
|
*/
|
|
714
596
|
ParticleTracerEx(name: string, startPos: Vector, endPos: Vector, doWhiz: boolean, entityIndex: number, attachmentIndex: number): void;
|
|
715
|
-
}
|
|
716
597
|
|
|
717
|
-
interface UtilLib {
|
|
718
598
|
/**
|
|
719
599
|
* Returns the visibility of a square that is always pointed at the camera in the world-space.
|
|
720
600
|
*
|
|
@@ -724,9 +604,7 @@ interface UtilLib {
|
|
|
724
604
|
* @source https://wiki.facepunch.com/gmod/util.PixelVisible
|
|
725
605
|
*/
|
|
726
606
|
PixelVisible(position: Vector, size: number, PixVis: pixelvis_handle_t): number;
|
|
727
|
-
}
|
|
728
607
|
|
|
729
|
-
interface UtilLib {
|
|
730
608
|
/**
|
|
731
609
|
* Returns the contents of the position specified.
|
|
732
610
|
* **NOTE**: This function will sample only the world environments. It can be used to check if [Entity:GetPos](https://wiki.facepunch.com/gmod/Entity:GetPos) is underwater for example unlike [Entity:WaterLevel](https://wiki.facepunch.com/gmod/Entity:WaterLevel) which works for players only.
|
|
@@ -736,9 +614,7 @@ interface UtilLib {
|
|
|
736
614
|
* @source https://wiki.facepunch.com/gmod/util.PointContents
|
|
737
615
|
*/
|
|
738
616
|
PointContents(position: Vector): CONTENTS;
|
|
739
|
-
}
|
|
740
617
|
|
|
741
|
-
interface UtilLib {
|
|
742
618
|
/**
|
|
743
619
|
* Precaches a model for later use. Model is cached after being loaded once.
|
|
744
620
|
* **WARNING**: Modelprecache is limited to 8192 unique models. When it reaches the limit the game will crash.
|
|
@@ -751,9 +627,7 @@ interface UtilLib {
|
|
|
751
627
|
* @source https://wiki.facepunch.com/gmod/util.PrecacheModel
|
|
752
628
|
*/
|
|
753
629
|
PrecacheModel(modelName: string): void;
|
|
754
|
-
}
|
|
755
630
|
|
|
756
|
-
interface UtilLib {
|
|
757
631
|
/**
|
|
758
632
|
* Precaches a sound for later use. Sound is cached after being loaded once.
|
|
759
633
|
* **NOTE**: Soundcache is limited to 16384 unique sounds on the server. Due to this fact this function is disabled on purpose, as exceeding the limit causes the server to shutdown.
|
|
@@ -765,9 +639,7 @@ interface UtilLib {
|
|
|
765
639
|
* @source https://wiki.facepunch.com/gmod/util.PrecacheSound
|
|
766
640
|
*/
|
|
767
641
|
PrecacheSound(soundName: string): void;
|
|
768
|
-
}
|
|
769
642
|
|
|
770
|
-
interface UtilLib {
|
|
771
643
|
/**
|
|
772
644
|
* Performs a trace with the given origin, direction, and filter.
|
|
773
645
|
* **NOTE**: This function will throw an error in the menu realm because it internally uses util.TraceLine which doesn't exist in the menu realm and thus error.
|
|
@@ -777,9 +649,7 @@ interface UtilLib {
|
|
|
777
649
|
* @source https://wiki.facepunch.com/gmod/util.QuickTrace
|
|
778
650
|
*/
|
|
779
651
|
QuickTrace(origin: Vector, dir: Vector, filter?: Entity | Entity[] | string[] | function): TraceResult;
|
|
780
|
-
}
|
|
781
652
|
|
|
782
|
-
interface UtilLib {
|
|
783
653
|
/**
|
|
784
654
|
* Converts the relative path of a given file to the full path on disk.
|
|
785
655
|
* You can use [util.FullPathToRelative_Menu](https://wiki.facepunch.com/gmod/util.FullPathToRelative_Menu) to convert the full path back to the relative path.
|
|
@@ -788,9 +658,7 @@ interface UtilLib {
|
|
|
788
658
|
* @source https://wiki.facepunch.com/gmod/util.RelativePathToFull_Menu
|
|
789
659
|
*/
|
|
790
660
|
RelativePathToFull_Menu(filePath: string, mountPath?: string): string;
|
|
791
|
-
}
|
|
792
661
|
|
|
793
|
-
interface UtilLib {
|
|
794
662
|
/**
|
|
795
663
|
* Returns which Workshop addon the given file belongs to.
|
|
796
664
|
*
|
|
@@ -798,9 +666,7 @@ interface UtilLib {
|
|
|
798
666
|
* @source https://wiki.facepunch.com/gmod/util.RelativePathToGMA_Menu
|
|
799
667
|
*/
|
|
800
668
|
RelativePathToGMA_Menu(filePath: string): table;
|
|
801
|
-
}
|
|
802
669
|
|
|
803
|
-
interface UtilLib {
|
|
804
670
|
/**
|
|
805
671
|
* Removes world decals at given position, in given radius. Does not remove decals on models!
|
|
806
672
|
*
|
|
@@ -808,9 +674,7 @@ interface UtilLib {
|
|
|
808
674
|
* @source https://wiki.facepunch.com/gmod/util.RemoveDecalsAt
|
|
809
675
|
*/
|
|
810
676
|
RemoveDecalsAt(pos: Vector, distance: number, limit?: number, permanent?: boolean): number;
|
|
811
|
-
}
|
|
812
677
|
|
|
813
|
-
interface UtilLib {
|
|
814
678
|
/**
|
|
815
679
|
* Removes persistent data of an offline player using their SteamID.
|
|
816
680
|
*
|
|
@@ -823,9 +687,7 @@ interface UtilLib {
|
|
|
823
687
|
* @source https://wiki.facepunch.com/gmod/util.RemovePData
|
|
824
688
|
*/
|
|
825
689
|
RemovePData(steamID: string, name: string): void;
|
|
826
|
-
}
|
|
827
690
|
|
|
828
|
-
interface UtilLib {
|
|
829
691
|
/**
|
|
830
692
|
* Generates the [SHA-1 hash](https://en.wikipedia.org/wiki/SHA-1) of the specified string.
|
|
831
693
|
* **WARNING**: SHA-1 is considered cryptographically broken and is known to be vulnerable to a variety of attacks. If security is a concern, use [util.SHA256](https://wiki.facepunch.com/gmod/util.SHA256).
|
|
@@ -835,18 +697,14 @@ interface UtilLib {
|
|
|
835
697
|
* @source https://wiki.facepunch.com/gmod/util.SHA1
|
|
836
698
|
*/
|
|
837
699
|
SHA1(stringToHash: string): string;
|
|
838
|
-
}
|
|
839
700
|
|
|
840
|
-
interface UtilLib {
|
|
841
701
|
/**
|
|
842
702
|
* Generates the [SHA-256 hash](https://en.wikipedia.org/wiki/SHA-2) of the specified string. This is mostly unique and is astronomically unlikely to return the same hash for a different string unlike [util.CRC](https://wiki.facepunch.com/gmod/util.CRC) or [util.MD5](https://wiki.facepunch.com/gmod/util.MD5) which are both much more vulnerable to duplicate returns.
|
|
843
703
|
* @realm shared
|
|
844
704
|
* @source https://wiki.facepunch.com/gmod/util.SHA256
|
|
845
705
|
*/
|
|
846
706
|
SHA256(stringToHash: string): string;
|
|
847
|
-
}
|
|
848
707
|
|
|
849
|
-
interface UtilLib {
|
|
850
708
|
/**
|
|
851
709
|
* Makes the screen shake.
|
|
852
710
|
*
|
|
@@ -856,9 +714,7 @@ interface UtilLib {
|
|
|
856
714
|
* @source https://wiki.facepunch.com/gmod/util.ScreenShake
|
|
857
715
|
*/
|
|
858
716
|
ScreenShake(pos: Vector, amplitude: number, frequency: number, duration: number, radius: number, airshake?: boolean, filter?: CRecipientFilter): void;
|
|
859
|
-
}
|
|
860
717
|
|
|
861
|
-
interface UtilLib {
|
|
862
718
|
/**
|
|
863
719
|
* Sets persistent data for offline player using their SteamID.
|
|
864
720
|
*
|
|
@@ -871,9 +727,7 @@ interface UtilLib {
|
|
|
871
727
|
* @source https://wiki.facepunch.com/gmod/util.SetPData
|
|
872
728
|
*/
|
|
873
729
|
SetPData(steamID: string, name: string, value: any): void;
|
|
874
|
-
}
|
|
875
730
|
|
|
876
|
-
interface UtilLib {
|
|
877
731
|
/**
|
|
878
732
|
* Generates a random float value that should be the same on client and server.
|
|
879
733
|
*
|
|
@@ -886,27 +740,21 @@ interface UtilLib {
|
|
|
886
740
|
* @source https://wiki.facepunch.com/gmod/util.SharedRandom
|
|
887
741
|
*/
|
|
888
742
|
SharedRandom(uniqueName: string, min: number, max: number, additionalSeed?: number): number;
|
|
889
|
-
}
|
|
890
743
|
|
|
891
|
-
interface UtilLib {
|
|
892
744
|
/**
|
|
893
745
|
* Adds a trail to the specified entity.
|
|
894
746
|
* @realm server
|
|
895
747
|
* @source https://wiki.facepunch.com/gmod/util.SpriteTrail
|
|
896
748
|
*/
|
|
897
749
|
SpriteTrail(ent: Entity, attachmentID: number, color: Color, additive: boolean, startWidth: number, endWidth: number, lifetime: number, textureRes: number, texture: string): Entity;
|
|
898
|
-
}
|
|
899
750
|
|
|
900
|
-
interface UtilLib {
|
|
901
751
|
/**
|
|
902
752
|
* Returns a new [Stack](https://wiki.facepunch.com/gmod/Stack) object.
|
|
903
753
|
* @realm shared and menu
|
|
904
754
|
* @source https://wiki.facepunch.com/gmod/util.Stack
|
|
905
755
|
*/
|
|
906
756
|
Stack(): Stack;
|
|
907
|
-
}
|
|
908
757
|
|
|
909
|
-
interface UtilLib {
|
|
910
758
|
/**
|
|
911
759
|
* Given a [64bit SteamID](https://wiki.facepunch.com/gmod/Player:SteamID64) will return a [STEAM_0:0:0](https://wiki.facepunch.com/gmod/Player:SteamID) style Steam ID.
|
|
912
760
|
*
|
|
@@ -917,18 +765,14 @@ interface UtilLib {
|
|
|
917
765
|
* @source https://wiki.facepunch.com/gmod/util.SteamIDFrom64
|
|
918
766
|
*/
|
|
919
767
|
SteamIDFrom64(id: string): string;
|
|
920
|
-
}
|
|
921
768
|
|
|
922
|
-
interface UtilLib {
|
|
923
769
|
/**
|
|
924
770
|
* Converts a [STEAM_0:0:0](https://wiki.facepunch.com/gmod/Player:SteamID) style SteamID to a [64bit SteamID](https://wiki.facepunch.com/gmod/Player:SteamID64).
|
|
925
771
|
* @realm shared
|
|
926
772
|
* @source https://wiki.facepunch.com/gmod/util.SteamIDTo64
|
|
927
773
|
*/
|
|
928
774
|
SteamIDTo64(id: string): string;
|
|
929
|
-
}
|
|
930
775
|
|
|
931
|
-
interface UtilLib {
|
|
932
776
|
/**
|
|
933
777
|
* Converts a string to the specified type.
|
|
934
778
|
*
|
|
@@ -938,9 +782,7 @@ interface UtilLib {
|
|
|
938
782
|
* @source https://wiki.facepunch.com/gmod/util.StringToType
|
|
939
783
|
*/
|
|
940
784
|
StringToType(str: string, typename: string): any;
|
|
941
|
-
}
|
|
942
785
|
|
|
943
|
-
interface UtilLib {
|
|
944
786
|
/**
|
|
945
787
|
* Converts a table to a JSON string. Keep in mind that not every data type can be stored in the JSON format, notably any entity will not be written, as if it wasn't in the table. Same goes for materials and textures, etc.
|
|
946
788
|
*
|
|
@@ -954,9 +796,7 @@ interface UtilLib {
|
|
|
954
796
|
* @source https://wiki.facepunch.com/gmod/util.TableToJSON
|
|
955
797
|
*/
|
|
956
798
|
TableToJSON(table: table, prettyPrint?: boolean): string;
|
|
957
|
-
}
|
|
958
799
|
|
|
959
|
-
interface UtilLib {
|
|
960
800
|
/**
|
|
961
801
|
* Converts the given table into a Valve keyValue formatted string.
|
|
962
802
|
*
|
|
@@ -968,27 +808,21 @@ interface UtilLib {
|
|
|
968
808
|
* @source https://wiki.facepunch.com/gmod/util.TableToKeyValues
|
|
969
809
|
*/
|
|
970
810
|
TableToKeyValues(table: table, rootKey?: string): string;
|
|
971
|
-
}
|
|
972
811
|
|
|
973
|
-
interface UtilLib {
|
|
974
812
|
/**
|
|
975
813
|
* Creates a timer object. The returned timer will be already started with given duration.
|
|
976
814
|
* @realm shared and menu
|
|
977
815
|
* @source https://wiki.facepunch.com/gmod/util.Timer
|
|
978
816
|
*/
|
|
979
817
|
Timer(duration?: number): table;
|
|
980
|
-
}
|
|
981
818
|
|
|
982
|
-
interface UtilLib {
|
|
983
819
|
/**
|
|
984
820
|
* Returns the time since this function has been last called
|
|
985
821
|
* @realm shared and menu
|
|
986
822
|
* @source https://wiki.facepunch.com/gmod/util.TimerCycle
|
|
987
823
|
*/
|
|
988
824
|
TimerCycle(): number;
|
|
989
|
-
}
|
|
990
825
|
|
|
991
|
-
interface UtilLib {
|
|
992
826
|
/**
|
|
993
827
|
* Runs a trace using the entity's collision model between two points. Does not
|
|
994
828
|
* take the entity's angles into account (traces the unrotated collision model).
|
|
@@ -996,10 +830,7 @@ interface UtilLib {
|
|
|
996
830
|
* @source https://wiki.facepunch.com/gmod/util.TraceEntity
|
|
997
831
|
*/
|
|
998
832
|
TraceEntity(tracedata: Trace, ent: Entity): TraceResult;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
833
|
|
|
1002
|
-
interface UtilLib {
|
|
1003
834
|
/**
|
|
1004
835
|
* Identical to util.TraceHull but uses an entity's Axis-Aligned Bounding Box
|
|
1005
836
|
* (AABB) for `mins`/`maxs` inputs (those two keys are ignored in the table).
|
|
@@ -1007,10 +838,7 @@ interface UtilLib {
|
|
|
1007
838
|
* @source https://wiki.facepunch.com/gmod/util.TraceEntityHull
|
|
1008
839
|
*/
|
|
1009
840
|
TraceEntityHull(tracedata: HullTrace, ent: Entity): TraceResult;
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
841
|
|
|
1013
|
-
interface UtilLib {
|
|
1014
842
|
/**
|
|
1015
843
|
* Performs an AABB hull (axis-aligned bounding box, not rotated) trace with the
|
|
1016
844
|
* given trace data. This trace type cannot hit hitboxes. See util.TraceLine for
|
|
@@ -1019,10 +847,7 @@ interface UtilLib {
|
|
|
1019
847
|
* @source https://wiki.facepunch.com/gmod/util.TraceHull
|
|
1020
848
|
*/
|
|
1021
849
|
TraceHull(TraceData: HullTrace): TraceResult;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
850
|
|
|
1025
|
-
interface UtilLib {
|
|
1026
851
|
/**
|
|
1027
852
|
* Performs an infinitely thin, invisible ray trace in a line and returns a
|
|
1028
853
|
* table with information about what, if anything, the trace hit or intersected.
|
|
@@ -1031,19 +856,14 @@ interface UtilLib {
|
|
|
1031
856
|
* @source https://wiki.facepunch.com/gmod/util.TraceLine
|
|
1032
857
|
*/
|
|
1033
858
|
TraceLine(traceConfig: Trace): TraceResult;
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
859
|
|
|
1037
|
-
interface UtilLib {
|
|
1038
860
|
/**
|
|
1039
861
|
* Converts a type to a (nice, but still parsable) string
|
|
1040
862
|
* @realm shared and menu
|
|
1041
863
|
* @source https://wiki.facepunch.com/gmod/util.TypeToString
|
|
1042
864
|
*/
|
|
1043
865
|
TypeToString(input: any): string;
|
|
1044
|
-
}
|
|
1045
866
|
|
|
1046
|
-
interface UtilLib {
|
|
1047
867
|
/**
|
|
1048
868
|
* Converts string or a number to a bool, if possible. Alias of [Global.tobool](https://wiki.facepunch.com/gmod/Global.tobool).
|
|
1049
869
|
*
|
|
@@ -1061,9 +881,7 @@ interface UtilworldpickerLib {
|
|
|
1061
881
|
* @source https://wiki.facepunch.com/gmod/util.worldpicker.Active
|
|
1062
882
|
*/
|
|
1063
883
|
Active(): boolean;
|
|
1064
|
-
}
|
|
1065
884
|
|
|
1066
|
-
interface UtilworldpickerLib {
|
|
1067
885
|
/**
|
|
1068
886
|
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1069
887
|
*
|
|
@@ -1074,9 +892,7 @@ interface UtilworldpickerLib {
|
|
|
1074
892
|
* @source https://wiki.facepunch.com/gmod/util.worldpicker.Finish
|
|
1075
893
|
*/
|
|
1076
894
|
Finish(tr: TraceResult): void;
|
|
1077
|
-
}
|
|
1078
895
|
|
|
1079
|
-
interface UtilworldpickerLib {
|
|
1080
896
|
/**
|
|
1081
897
|
* Starts picking an entity in the world. This will suppress the next mouse click, and instead use it as a direction in the trace sent to the callback.
|
|
1082
898
|
* @realm client
|
|
@@ -1084,4 +900,3 @@ interface UtilworldpickerLib {
|
|
|
1084
900
|
*/
|
|
1085
901
|
Start(callback: (tr: table) => void): void;
|
|
1086
902
|
}
|
|
1087
|
-
|