@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/util.d.tlua
CHANGED
|
@@ -12,6 +12,7 @@ declare util: UtilLib;
|
|
|
12
12
|
*/
|
|
13
13
|
interface UtilLib {
|
|
14
14
|
worldpicker: UtilworldpickerLib;
|
|
15
|
+
|
|
15
16
|
/**
|
|
16
17
|
* Adds the specified string to a string table, which will cache it and network it to all clients automatically.
|
|
17
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.
|
|
@@ -32,6 +33,7 @@ interface UtilLib {
|
|
|
32
33
|
* @source https://wiki.facepunch.com/gmod/util.AddNetworkString
|
|
33
34
|
*/
|
|
34
35
|
AddNetworkString(str: string): number;
|
|
36
|
+
|
|
35
37
|
/**
|
|
36
38
|
* Function used to calculate aim vector from 2D screen position. It is used in SuperDOF calculate Distance.
|
|
37
39
|
*
|
|
@@ -41,12 +43,14 @@ interface UtilLib {
|
|
|
41
43
|
* @source https://wiki.facepunch.com/gmod/util.AimVector
|
|
42
44
|
*/
|
|
43
45
|
AimVector(ViewAngles: Angle, ViewFOV: number, x: number, y: number, scrWidth: number, scrHeight: number): Vector;
|
|
46
|
+
|
|
44
47
|
/**
|
|
45
48
|
* Decodes the specified string from base64.
|
|
46
49
|
* @realm shared and menu
|
|
47
50
|
* @source https://wiki.facepunch.com/gmod/util.Base64Decode
|
|
48
51
|
*/
|
|
49
52
|
Base64Decode(str: string): string;
|
|
53
|
+
|
|
50
54
|
/**
|
|
51
55
|
* Encodes the specified string to base64.
|
|
52
56
|
*
|
|
@@ -57,18 +61,21 @@ interface UtilLib {
|
|
|
57
61
|
* @source https://wiki.facepunch.com/gmod/util.Base64Encode
|
|
58
62
|
*/
|
|
59
63
|
Base64Encode(str: string, inline?: boolean): string;
|
|
64
|
+
|
|
60
65
|
/**
|
|
61
66
|
* Applies explosion damage to all entities in the specified radius. Performs block checking.
|
|
62
67
|
* @realm server
|
|
63
68
|
* @source https://wiki.facepunch.com/gmod/util.BlastDamage
|
|
64
69
|
*/
|
|
65
70
|
BlastDamage(inflictor: Entity, attacker: Entity, damageOrigin: Vector, damageRadius: number, damage: number): void;
|
|
71
|
+
|
|
66
72
|
/**
|
|
67
73
|
* Applies spherical damage based on damage info to all entities in the specified radius.
|
|
68
74
|
* @realm server
|
|
69
75
|
* @source https://wiki.facepunch.com/gmod/util.BlastDamageInfo
|
|
70
76
|
*/
|
|
71
77
|
BlastDamageInfo(dmg: CTakeDamageInfo, damageOrigin: Vector, damageRadius: number): void;
|
|
78
|
+
|
|
72
79
|
/**
|
|
73
80
|
* Generates the [CRC Checksum](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) of the specified string.
|
|
74
81
|
*
|
|
@@ -79,6 +86,7 @@ interface UtilLib {
|
|
|
79
86
|
* @source https://wiki.facepunch.com/gmod/util.CRC
|
|
80
87
|
*/
|
|
81
88
|
CRC(stringToChecksum: string): string;
|
|
89
|
+
|
|
82
90
|
/**
|
|
83
91
|
* Compresses the given string using the [LZMA](https://en.wikipedia.org/wiki/LZMA) algorithm.
|
|
84
92
|
*
|
|
@@ -93,18 +101,21 @@ interface UtilLib {
|
|
|
93
101
|
* @source https://wiki.facepunch.com/gmod/util.Compress
|
|
94
102
|
*/
|
|
95
103
|
Compress(str: string): string;
|
|
104
|
+
|
|
96
105
|
/**
|
|
97
106
|
* Returns the current date formatted like '2012-10-31 18-00-00'
|
|
98
107
|
* @realm shared and menu
|
|
99
108
|
* @source https://wiki.facepunch.com/gmod/util.DateStamp
|
|
100
109
|
*/
|
|
101
110
|
DateStamp(): string;
|
|
111
|
+
|
|
102
112
|
/**
|
|
103
113
|
* Performs a trace and paints a decal to the surface hit.
|
|
104
114
|
* @realm shared
|
|
105
115
|
* @source https://wiki.facepunch.com/gmod/util.Decal
|
|
106
116
|
*/
|
|
107
117
|
Decal(name: string, start: Vector, _end: Vector, filter?: Entity | Entity[]): void;
|
|
118
|
+
|
|
108
119
|
/**
|
|
109
120
|
* Performs a trace and paints a decal to the surface hit.
|
|
110
121
|
*
|
|
@@ -115,6 +126,7 @@ interface UtilLib {
|
|
|
115
126
|
* @source https://wiki.facepunch.com/gmod/util.DecalEx
|
|
116
127
|
*/
|
|
117
128
|
DecalEx(material: IMaterial, ent: Entity, position: Vector, normal: Vector, color: Color, w: number, h: number): void;
|
|
129
|
+
|
|
118
130
|
/**
|
|
119
131
|
* Gets the full material path by the decal name. Used with [util.DecalEx](https://wiki.facepunch.com/gmod/util.DecalEx).
|
|
120
132
|
*
|
|
@@ -123,6 +135,7 @@ interface UtilLib {
|
|
|
123
135
|
* @source https://wiki.facepunch.com/gmod/util.DecalMaterial
|
|
124
136
|
*/
|
|
125
137
|
DecalMaterial(decalName: string): string;
|
|
138
|
+
|
|
126
139
|
/**
|
|
127
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).
|
|
128
141
|
*
|
|
@@ -139,12 +152,14 @@ interface UtilLib {
|
|
|
139
152
|
* @source https://wiki.facepunch.com/gmod/util.Decompress
|
|
140
153
|
*/
|
|
141
154
|
Decompress(compressedString: string, maxSize?: number): string | nil;
|
|
155
|
+
|
|
142
156
|
/**
|
|
143
157
|
* Gets the distance between a line and a point in 3d space.
|
|
144
158
|
* @realm shared
|
|
145
159
|
* @source https://wiki.facepunch.com/gmod/util.DistanceToLine
|
|
146
160
|
*/
|
|
147
161
|
DistanceToLine(lineStart: Vector, lineEnd: Vector, pointPos: Vector): (number, Vector, number);
|
|
162
|
+
|
|
148
163
|
/**
|
|
149
164
|
* Creates an effect with the specified data.
|
|
150
165
|
*
|
|
@@ -159,6 +174,7 @@ interface UtilLib {
|
|
|
159
174
|
* @source https://wiki.facepunch.com/gmod/util.Effect
|
|
160
175
|
*/
|
|
161
176
|
Effect(effectName: string, effectData: CEffectData, allowOverride?: boolean, ignorePredictionOrRecipientFilter?: boolean | CRecipientFilter): void;
|
|
177
|
+
|
|
162
178
|
/**
|
|
163
179
|
* Filters given text using Steam's filtering system. The function will obey local client's Steam settings for chat filtering:
|
|
164
180
|
*
|
|
@@ -171,6 +187,7 @@ interface UtilLib {
|
|
|
171
187
|
* @source https://wiki.facepunch.com/gmod/util.FilterText
|
|
172
188
|
*/
|
|
173
189
|
FilterText(str: string, context?: number, player?: Player): string;
|
|
190
|
+
|
|
174
191
|
/**
|
|
175
192
|
* Converts the full path of the given file to a relative path.
|
|
176
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.
|
|
@@ -179,6 +196,7 @@ interface UtilLib {
|
|
|
179
196
|
* @source https://wiki.facepunch.com/gmod/util.FullPathToRelative_Menu
|
|
180
197
|
*/
|
|
181
198
|
FullPathToRelative_Menu(fullPath: string, fsPath?: string): string;
|
|
199
|
+
|
|
182
200
|
/**
|
|
183
201
|
* Returns the ID of a custom model activity. This is useful for models that define custom ones.
|
|
184
202
|
*
|
|
@@ -188,6 +206,7 @@ interface UtilLib {
|
|
|
188
206
|
* @source https://wiki.facepunch.com/gmod/util.GetActivityIDByName
|
|
189
207
|
*/
|
|
190
208
|
GetActivityIDByName(arg0: string): number;
|
|
209
|
+
|
|
191
210
|
/**
|
|
192
211
|
* Returns a name for given activity ID. This is useful for models that define custom activities.
|
|
193
212
|
*
|
|
@@ -197,6 +216,7 @@ interface UtilLib {
|
|
|
197
216
|
* @source https://wiki.facepunch.com/gmod/util.GetActivityNameByID
|
|
198
217
|
*/
|
|
199
218
|
GetActivityNameByID(id: number): string;
|
|
219
|
+
|
|
200
220
|
/**
|
|
201
221
|
* Returns the ID of a custom model animation event. This is useful for models that define custom animation events.
|
|
202
222
|
*
|
|
@@ -206,6 +226,7 @@ interface UtilLib {
|
|
|
206
226
|
* @source https://wiki.facepunch.com/gmod/util.GetAnimEventIDByName
|
|
207
227
|
*/
|
|
208
228
|
GetAnimEventIDByName(arg0: string): number;
|
|
229
|
+
|
|
209
230
|
/**
|
|
210
231
|
* Returns a name for given automatically generated numerical animation event ID. This is useful for models that define custom animation events.
|
|
211
232
|
*
|
|
@@ -215,6 +236,7 @@ interface UtilLib {
|
|
|
215
236
|
* @source https://wiki.facepunch.com/gmod/util.GetAnimEventNameByID
|
|
216
237
|
*/
|
|
217
238
|
GetAnimEventNameByID(id: number): string;
|
|
239
|
+
|
|
218
240
|
/**
|
|
219
241
|
* Returns a table containing the info about the model. The model will be loaded and cached if it was not previously.
|
|
220
242
|
*
|
|
@@ -238,6 +260,7 @@ interface UtilLib {
|
|
|
238
260
|
* @source https://wiki.facepunch.com/gmod/util.GetModelInfo
|
|
239
261
|
*/
|
|
240
262
|
GetModelInfo(mdl: string): ModelInfo;
|
|
263
|
+
|
|
241
264
|
/**
|
|
242
265
|
* Retrieves vertex, triangle, and bone data for the visual meshes of a given model.
|
|
243
266
|
*
|
|
@@ -248,6 +271,7 @@ interface UtilLib {
|
|
|
248
271
|
* @source https://wiki.facepunch.com/gmod/util.GetModelMeshes
|
|
249
272
|
*/
|
|
250
273
|
GetModelMeshes(model: string, lod?: number, bodygroupMask?: string | number, skin?: number): (ModelMeshData[], BoneBindPose[]);
|
|
274
|
+
|
|
251
275
|
/**
|
|
252
276
|
* Gets persistent data of an offline player using their SteamID.
|
|
253
277
|
*
|
|
@@ -260,12 +284,14 @@ interface UtilLib {
|
|
|
260
284
|
* @source https://wiki.facepunch.com/gmod/util.GetPData
|
|
261
285
|
*/
|
|
262
286
|
GetPData(steamID: string, name: string, _default: any): string;
|
|
287
|
+
|
|
263
288
|
/**
|
|
264
289
|
* Creates a new PixVis handle. See [util.PixelVisible](https://wiki.facepunch.com/gmod/util.PixelVisible).
|
|
265
290
|
* @realm client
|
|
266
291
|
* @source https://wiki.facepunch.com/gmod/util.GetPixelVisibleHandle
|
|
267
292
|
*/
|
|
268
293
|
GetPixelVisibleHandle(): pixelvis_handle_t;
|
|
294
|
+
|
|
269
295
|
/**
|
|
270
296
|
* Utility function to quickly generate a trace table that starts at the players view position, and ends `32768` units along a specified direction.
|
|
271
297
|
*
|
|
@@ -274,18 +300,21 @@ interface UtilLib {
|
|
|
274
300
|
* @source https://wiki.facepunch.com/gmod/util.GetPlayerTrace
|
|
275
301
|
*/
|
|
276
302
|
GetPlayerTrace(ply: Player, dir?: Vector): Trace;
|
|
303
|
+
|
|
277
304
|
/**
|
|
278
305
|
* Gets information about the sun position and obstruction or nil if there is no sun.
|
|
279
306
|
* @realm client
|
|
280
307
|
* @source https://wiki.facepunch.com/gmod/util.GetSunInfo
|
|
281
308
|
*/
|
|
282
309
|
GetSunInfo(): table;
|
|
310
|
+
|
|
283
311
|
/**
|
|
284
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).
|
|
285
313
|
* @realm shared
|
|
286
314
|
* @source https://wiki.facepunch.com/gmod/util.GetSurfaceData
|
|
287
315
|
*/
|
|
288
316
|
GetSurfaceData(id: number): SurfacePropertyData;
|
|
317
|
+
|
|
289
318
|
/**
|
|
290
319
|
* Returns the matching surface property index for the given surface property name.
|
|
291
320
|
*
|
|
@@ -295,6 +324,7 @@ interface UtilLib {
|
|
|
295
324
|
* @source https://wiki.facepunch.com/gmod/util.GetSurfaceIndex
|
|
296
325
|
*/
|
|
297
326
|
GetSurfaceIndex(surfaceName: string): number;
|
|
327
|
+
|
|
298
328
|
/**
|
|
299
329
|
* Returns the name of a surface property at given ID.
|
|
300
330
|
*
|
|
@@ -304,6 +334,7 @@ interface UtilLib {
|
|
|
304
334
|
* @source https://wiki.facepunch.com/gmod/util.GetSurfacePropName
|
|
305
335
|
*/
|
|
306
336
|
GetSurfacePropName(id: number): string;
|
|
337
|
+
|
|
307
338
|
/**
|
|
308
339
|
* Returns a table of all SteamIDs that have a usergroup.
|
|
309
340
|
*
|
|
@@ -319,72 +350,84 @@ interface UtilLib {
|
|
|
319
350
|
* @source https://wiki.facepunch.com/gmod/util.GetUserGroups
|
|
320
351
|
*/
|
|
321
352
|
GetUserGroups(): table;
|
|
353
|
+
|
|
322
354
|
/**
|
|
323
355
|
* Performs a Ray-OBB (Orientated Bounding Box) intersection and returns position, normal and the fraction if there was an intersection.
|
|
324
356
|
* @realm shared
|
|
325
357
|
* @source https://wiki.facepunch.com/gmod/util.IntersectRayWithOBB
|
|
326
358
|
*/
|
|
327
359
|
IntersectRayWithOBB(rayStart: Vector, rayDelta: Vector, boxOrigin: Vector, boxAngles: Angle, boxMins: Vector, boxMaxs: Vector): (Vector, Vector, number);
|
|
360
|
+
|
|
328
361
|
/**
|
|
329
362
|
* Performs a [ray-plane intersection](https://en.wikipedia.org/wiki/Line%E2%80%93plane_intersection) and returns the hit position or nil.
|
|
330
363
|
* @realm shared
|
|
331
364
|
* @source https://wiki.facepunch.com/gmod/util.IntersectRayWithPlane
|
|
332
365
|
*/
|
|
333
366
|
IntersectRayWithPlane(rayOrigin: Vector, rayDirection: Vector, planePosition: Vector, planeNormal: Vector): Vector;
|
|
367
|
+
|
|
334
368
|
/**
|
|
335
369
|
* Performs a ray-sphere intersection and returns the intersection positions or nil.
|
|
336
370
|
* @realm shared
|
|
337
371
|
* @source https://wiki.facepunch.com/gmod/util.IntersectRayWithSphere
|
|
338
372
|
*/
|
|
339
373
|
IntersectRayWithSphere(rayOrigin: Vector, rayDelta: Vector, spherePosition: Vector, sphereRadius: number): (number, number);
|
|
374
|
+
|
|
340
375
|
/**
|
|
341
376
|
* Returns whether a binary module is installed and is resolvable by [Global.require](https://wiki.facepunch.com/gmod/Global.require).
|
|
342
377
|
* @realm shared and menu
|
|
343
378
|
* @source https://wiki.facepunch.com/gmod/util.IsBinaryModuleInstalled
|
|
344
379
|
*/
|
|
345
380
|
IsBinaryModuleInstalled(name: string): boolean;
|
|
381
|
+
|
|
346
382
|
/**
|
|
347
383
|
* Performs a box-box intersection and returns whether there was an intersection or not.
|
|
348
384
|
* @realm shared
|
|
349
385
|
* @source https://wiki.facepunch.com/gmod/util.IsBoxIntersectingBox
|
|
350
386
|
*/
|
|
351
387
|
IsBoxIntersectingBox(boxMin: Vector, boxMax: Vector, box2Min: Vector, box2Max: Vector): boolean;
|
|
388
|
+
|
|
352
389
|
/**
|
|
353
390
|
* Performs a box-sphere intersection and returns whether there was an intersection or not.
|
|
354
391
|
* @realm shared
|
|
355
392
|
* @source https://wiki.facepunch.com/gmod/util.IsBoxIntersectingSphere
|
|
356
393
|
*/
|
|
357
394
|
IsBoxIntersectingSphere(boxMin: Vector, boxMax: Vector, shpere2Position: Vector, sphere2Radius: number): boolean;
|
|
395
|
+
|
|
358
396
|
/**
|
|
359
397
|
* Checks if a certain position is within the world bounds.
|
|
360
398
|
* @realm server
|
|
361
399
|
* @source https://wiki.facepunch.com/gmod/util.IsInWorld
|
|
362
400
|
*/
|
|
363
401
|
IsInWorld(position: Vector): boolean;
|
|
402
|
+
|
|
364
403
|
/**
|
|
365
404
|
* Checks if the model is loaded in the game.
|
|
366
405
|
* @realm shared
|
|
367
406
|
* @source https://wiki.facepunch.com/gmod/util.IsModelLoaded
|
|
368
407
|
*/
|
|
369
408
|
IsModelLoaded(modelName: string): boolean;
|
|
409
|
+
|
|
370
410
|
/**
|
|
371
411
|
* Performs OBB on OBB intersection test.
|
|
372
412
|
* @realm shared
|
|
373
413
|
* @source https://wiki.facepunch.com/gmod/util.IsOBBIntersectingOBB
|
|
374
414
|
*/
|
|
375
415
|
IsOBBIntersectingOBB(box1Origin: Vector, box1Angles: Angle, box1Mins: Vector, box1Maxs: Vector, box2Origin: Vector, box2Angles: Angle, box2Mins: Vector, box2Maxs: Vector, tolerance: number): boolean;
|
|
416
|
+
|
|
376
417
|
/**
|
|
377
418
|
* Returns whether a point is within a cone or not.
|
|
378
419
|
* @realm shared
|
|
379
420
|
* @source https://wiki.facepunch.com/gmod/util.IsPointInCone
|
|
380
421
|
*/
|
|
381
422
|
IsPointInCone(point: Vector, coneOrigin: Vector, coneAxis: Vector, coneSine: number, coneLength: number): boolean;
|
|
423
|
+
|
|
382
424
|
/**
|
|
383
425
|
* Performs a ray-ray intersection and returns whether there was an intersection or not.
|
|
384
426
|
* @realm shared
|
|
385
427
|
* @source https://wiki.facepunch.com/gmod/util.IsRayIntersectingRay
|
|
386
428
|
*/
|
|
387
429
|
IsRayIntersectingRay(ray1Start: Vector, ray1End: Vector, ray2Start: Vector, ray2End: Vector): (boolean, number, number);
|
|
430
|
+
|
|
388
431
|
/**
|
|
389
432
|
* Check whether the skybox is visible from the point specified.
|
|
390
433
|
*
|
|
@@ -395,18 +438,21 @@ interface UtilLib {
|
|
|
395
438
|
* @source https://wiki.facepunch.com/gmod/util.IsSkyboxVisibleFromPoint
|
|
396
439
|
*/
|
|
397
440
|
IsSkyboxVisibleFromPoint(position: Vector): boolean;
|
|
441
|
+
|
|
398
442
|
/**
|
|
399
443
|
* Returns whether a sphere is intersecting a cone or not.
|
|
400
444
|
* @realm shared
|
|
401
445
|
* @source https://wiki.facepunch.com/gmod/util.IsSphereIntersectingCone
|
|
402
446
|
*/
|
|
403
447
|
IsSphereIntersectingCone(sphereCenter: Vector, sphereRadius: number, coneOrigin: Vector, coneAxis: Vector, coneSine: number, coneCosine: number): boolean;
|
|
448
|
+
|
|
404
449
|
/**
|
|
405
450
|
* Performs a sphere-sphere intersection and returns whether there was an intersection or not.
|
|
406
451
|
* @realm shared
|
|
407
452
|
* @source https://wiki.facepunch.com/gmod/util.IsSphereIntersectingSphere
|
|
408
453
|
*/
|
|
409
454
|
IsSphereIntersectingSphere(sphere1Position: Vector, sphere1Radius: number, sphere2Position: Vector, sphere2Radius: number): boolean;
|
|
455
|
+
|
|
410
456
|
/**
|
|
411
457
|
* Checks if the specified model is valid.
|
|
412
458
|
*
|
|
@@ -436,24 +482,28 @@ interface UtilLib {
|
|
|
436
482
|
* @source https://wiki.facepunch.com/gmod/util.IsValidModel
|
|
437
483
|
*/
|
|
438
484
|
IsValidModel(modelName: string): boolean;
|
|
485
|
+
|
|
439
486
|
/**
|
|
440
487
|
* Checks whether the given numbered physics object of the given entity is valid or not. Most useful for ragdolls.
|
|
441
488
|
* @realm shared
|
|
442
489
|
* @source https://wiki.facepunch.com/gmod/util.IsValidPhysicsObject
|
|
443
490
|
*/
|
|
444
491
|
IsValidPhysicsObject(ent: Entity, physobj: number): boolean;
|
|
492
|
+
|
|
445
493
|
/**
|
|
446
494
|
* Checks if the specified prop is valid (has valid physics object).
|
|
447
495
|
* @realm shared
|
|
448
496
|
* @source https://wiki.facepunch.com/gmod/util.IsValidProp
|
|
449
497
|
*/
|
|
450
498
|
IsValidProp(modelName: string): boolean;
|
|
499
|
+
|
|
451
500
|
/**
|
|
452
501
|
* Checks if the specified model name points to a valid ragdoll.
|
|
453
502
|
* @realm shared
|
|
454
503
|
* @source https://wiki.facepunch.com/gmod/util.IsValidRagdoll
|
|
455
504
|
*/
|
|
456
505
|
IsValidRagdoll(ragdollName: string): boolean;
|
|
506
|
+
|
|
457
507
|
/**
|
|
458
508
|
* Converts a JSON string to a Lua table. It supports comments and trailing commas.
|
|
459
509
|
*
|
|
@@ -465,6 +515,7 @@ interface UtilLib {
|
|
|
465
515
|
* @source https://wiki.facepunch.com/gmod/util.JSONToTable
|
|
466
516
|
*/
|
|
467
517
|
JSONToTable(json: string, ignoreLimits?: boolean, ignoreConversions?: boolean): table | nil;
|
|
518
|
+
|
|
468
519
|
/**
|
|
469
520
|
* Converts a Valve KeyValue string (typically from [util.TableToKeyValues](https://wiki.facepunch.com/gmod/util.TableToKeyValues)) to a Lua table.
|
|
470
521
|
*
|
|
@@ -475,12 +526,14 @@ interface UtilLib {
|
|
|
475
526
|
* @source https://wiki.facepunch.com/gmod/util.KeyValuesToTable
|
|
476
527
|
*/
|
|
477
528
|
KeyValuesToTable(keyValues: string, usesEscapeSequences?: boolean, preserveKeyCase?: boolean): table;
|
|
529
|
+
|
|
478
530
|
/**
|
|
479
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)
|
|
480
532
|
* @realm shared and menu
|
|
481
533
|
* @source https://wiki.facepunch.com/gmod/util.KeyValuesToTablePreserveOrder
|
|
482
534
|
*/
|
|
483
535
|
KeyValuesToTablePreserveOrder(keyValues: string, usesEscapeSequences?: boolean, preserveKeyCase?: boolean): table;
|
|
536
|
+
|
|
484
537
|
/**
|
|
485
538
|
* A convenience function around LocalToWorld-related functions.
|
|
486
539
|
*
|
|
@@ -491,6 +544,7 @@ interface UtilLib {
|
|
|
491
544
|
* @source https://wiki.facepunch.com/gmod/util.LocalToWorld
|
|
492
545
|
*/
|
|
493
546
|
LocalToWorld(ent: Entity, lpos: Vector, bone?: number): Vector;
|
|
547
|
+
|
|
494
548
|
/**
|
|
495
549
|
* Generates the [MD5 hash](https://en.wikipedia.org/wiki/MD5) of the specified string.
|
|
496
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).
|
|
@@ -500,24 +554,28 @@ interface UtilLib {
|
|
|
500
554
|
* @source https://wiki.facepunch.com/gmod/util.MD5
|
|
501
555
|
*/
|
|
502
556
|
MD5(stringToHash: string): string;
|
|
557
|
+
|
|
503
558
|
/**
|
|
504
559
|
* Returns the networked string associated with the given ID from the string table.
|
|
505
560
|
* @realm shared
|
|
506
561
|
* @source https://wiki.facepunch.com/gmod/util.NetworkIDToString
|
|
507
562
|
*/
|
|
508
563
|
NetworkIDToString(stringTableID: number): string;
|
|
564
|
+
|
|
509
565
|
/**
|
|
510
566
|
* Returns the networked ID associated with the given string from the string table.
|
|
511
567
|
* @realm shared
|
|
512
568
|
* @source https://wiki.facepunch.com/gmod/util.NetworkStringToID
|
|
513
569
|
*/
|
|
514
570
|
NetworkStringToID(networkString: string): number;
|
|
571
|
+
|
|
515
572
|
/**
|
|
516
573
|
* Formats a float by stripping off extra `0's` and `.'s`.
|
|
517
574
|
* @realm shared and menu
|
|
518
575
|
* @source https://wiki.facepunch.com/gmod/util.NiceFloat
|
|
519
576
|
*/
|
|
520
577
|
NiceFloat(float: number): string;
|
|
578
|
+
|
|
521
579
|
/**
|
|
522
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.
|
|
523
581
|
*
|
|
@@ -529,12 +587,14 @@ interface UtilLib {
|
|
|
529
587
|
* @source https://wiki.facepunch.com/gmod/util.ParticleTracer
|
|
530
588
|
*/
|
|
531
589
|
ParticleTracer(name: string, startPos: Vector, endPos: Vector, doWhiz: boolean): void;
|
|
590
|
+
|
|
532
591
|
/**
|
|
533
592
|
* Creates a tracer effect with the given parameters. Expanded version of [util.ParticleTracer](https://wiki.facepunch.com/gmod/util.ParticleTracer).
|
|
534
593
|
* @realm shared
|
|
535
594
|
* @source https://wiki.facepunch.com/gmod/util.ParticleTracerEx
|
|
536
595
|
*/
|
|
537
596
|
ParticleTracerEx(name: string, startPos: Vector, endPos: Vector, doWhiz: boolean, entityIndex: number, attachmentIndex: number): void;
|
|
597
|
+
|
|
538
598
|
/**
|
|
539
599
|
* Returns the visibility of a square that is always pointed at the camera in the world-space.
|
|
540
600
|
*
|
|
@@ -544,6 +604,7 @@ interface UtilLib {
|
|
|
544
604
|
* @source https://wiki.facepunch.com/gmod/util.PixelVisible
|
|
545
605
|
*/
|
|
546
606
|
PixelVisible(position: Vector, size: number, PixVis: pixelvis_handle_t): number;
|
|
607
|
+
|
|
547
608
|
/**
|
|
548
609
|
* Returns the contents of the position specified.
|
|
549
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.
|
|
@@ -553,6 +614,7 @@ interface UtilLib {
|
|
|
553
614
|
* @source https://wiki.facepunch.com/gmod/util.PointContents
|
|
554
615
|
*/
|
|
555
616
|
PointContents(position: Vector): CONTENTS;
|
|
617
|
+
|
|
556
618
|
/**
|
|
557
619
|
* Precaches a model for later use. Model is cached after being loaded once.
|
|
558
620
|
* **WARNING**: Modelprecache is limited to 8192 unique models. When it reaches the limit the game will crash.
|
|
@@ -565,6 +627,7 @@ interface UtilLib {
|
|
|
565
627
|
* @source https://wiki.facepunch.com/gmod/util.PrecacheModel
|
|
566
628
|
*/
|
|
567
629
|
PrecacheModel(modelName: string): void;
|
|
630
|
+
|
|
568
631
|
/**
|
|
569
632
|
* Precaches a sound for later use. Sound is cached after being loaded once.
|
|
570
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.
|
|
@@ -576,6 +639,7 @@ interface UtilLib {
|
|
|
576
639
|
* @source https://wiki.facepunch.com/gmod/util.PrecacheSound
|
|
577
640
|
*/
|
|
578
641
|
PrecacheSound(soundName: string): void;
|
|
642
|
+
|
|
579
643
|
/**
|
|
580
644
|
* Performs a trace with the given origin, direction, and filter.
|
|
581
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.
|
|
@@ -585,6 +649,7 @@ interface UtilLib {
|
|
|
585
649
|
* @source https://wiki.facepunch.com/gmod/util.QuickTrace
|
|
586
650
|
*/
|
|
587
651
|
QuickTrace(origin: Vector, dir: Vector, filter?: Entity | Entity[] | string[] | function): TraceResult;
|
|
652
|
+
|
|
588
653
|
/**
|
|
589
654
|
* Converts the relative path of a given file to the full path on disk.
|
|
590
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.
|
|
@@ -593,6 +658,7 @@ interface UtilLib {
|
|
|
593
658
|
* @source https://wiki.facepunch.com/gmod/util.RelativePathToFull_Menu
|
|
594
659
|
*/
|
|
595
660
|
RelativePathToFull_Menu(filePath: string, mountPath?: string): string;
|
|
661
|
+
|
|
596
662
|
/**
|
|
597
663
|
* Returns which Workshop addon the given file belongs to.
|
|
598
664
|
*
|
|
@@ -600,6 +666,7 @@ interface UtilLib {
|
|
|
600
666
|
* @source https://wiki.facepunch.com/gmod/util.RelativePathToGMA_Menu
|
|
601
667
|
*/
|
|
602
668
|
RelativePathToGMA_Menu(filePath: string): table;
|
|
669
|
+
|
|
603
670
|
/**
|
|
604
671
|
* Removes world decals at given position, in given radius. Does not remove decals on models!
|
|
605
672
|
*
|
|
@@ -607,6 +674,7 @@ interface UtilLib {
|
|
|
607
674
|
* @source https://wiki.facepunch.com/gmod/util.RemoveDecalsAt
|
|
608
675
|
*/
|
|
609
676
|
RemoveDecalsAt(pos: Vector, distance: number, limit?: number, permanent?: boolean): number;
|
|
677
|
+
|
|
610
678
|
/**
|
|
611
679
|
* Removes persistent data of an offline player using their SteamID.
|
|
612
680
|
*
|
|
@@ -619,6 +687,7 @@ interface UtilLib {
|
|
|
619
687
|
* @source https://wiki.facepunch.com/gmod/util.RemovePData
|
|
620
688
|
*/
|
|
621
689
|
RemovePData(steamID: string, name: string): void;
|
|
690
|
+
|
|
622
691
|
/**
|
|
623
692
|
* Generates the [SHA-1 hash](https://en.wikipedia.org/wiki/SHA-1) of the specified string.
|
|
624
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).
|
|
@@ -628,12 +697,14 @@ interface UtilLib {
|
|
|
628
697
|
* @source https://wiki.facepunch.com/gmod/util.SHA1
|
|
629
698
|
*/
|
|
630
699
|
SHA1(stringToHash: string): string;
|
|
700
|
+
|
|
631
701
|
/**
|
|
632
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.
|
|
633
703
|
* @realm shared
|
|
634
704
|
* @source https://wiki.facepunch.com/gmod/util.SHA256
|
|
635
705
|
*/
|
|
636
706
|
SHA256(stringToHash: string): string;
|
|
707
|
+
|
|
637
708
|
/**
|
|
638
709
|
* Makes the screen shake.
|
|
639
710
|
*
|
|
@@ -643,6 +714,7 @@ interface UtilLib {
|
|
|
643
714
|
* @source https://wiki.facepunch.com/gmod/util.ScreenShake
|
|
644
715
|
*/
|
|
645
716
|
ScreenShake(pos: Vector, amplitude: number, frequency: number, duration: number, radius: number, airshake?: boolean, filter?: CRecipientFilter): void;
|
|
717
|
+
|
|
646
718
|
/**
|
|
647
719
|
* Sets persistent data for offline player using their SteamID.
|
|
648
720
|
*
|
|
@@ -655,6 +727,7 @@ interface UtilLib {
|
|
|
655
727
|
* @source https://wiki.facepunch.com/gmod/util.SetPData
|
|
656
728
|
*/
|
|
657
729
|
SetPData(steamID: string, name: string, value: any): void;
|
|
730
|
+
|
|
658
731
|
/**
|
|
659
732
|
* Generates a random float value that should be the same on client and server.
|
|
660
733
|
*
|
|
@@ -667,18 +740,21 @@ interface UtilLib {
|
|
|
667
740
|
* @source https://wiki.facepunch.com/gmod/util.SharedRandom
|
|
668
741
|
*/
|
|
669
742
|
SharedRandom(uniqueName: string, min: number, max: number, additionalSeed?: number): number;
|
|
743
|
+
|
|
670
744
|
/**
|
|
671
745
|
* Adds a trail to the specified entity.
|
|
672
746
|
* @realm server
|
|
673
747
|
* @source https://wiki.facepunch.com/gmod/util.SpriteTrail
|
|
674
748
|
*/
|
|
675
749
|
SpriteTrail(ent: Entity, attachmentID: number, color: Color, additive: boolean, startWidth: number, endWidth: number, lifetime: number, textureRes: number, texture: string): Entity;
|
|
750
|
+
|
|
676
751
|
/**
|
|
677
752
|
* Returns a new [Stack](https://wiki.facepunch.com/gmod/Stack) object.
|
|
678
753
|
* @realm shared and menu
|
|
679
754
|
* @source https://wiki.facepunch.com/gmod/util.Stack
|
|
680
755
|
*/
|
|
681
756
|
Stack(): Stack;
|
|
757
|
+
|
|
682
758
|
/**
|
|
683
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.
|
|
684
760
|
*
|
|
@@ -689,12 +765,14 @@ interface UtilLib {
|
|
|
689
765
|
* @source https://wiki.facepunch.com/gmod/util.SteamIDFrom64
|
|
690
766
|
*/
|
|
691
767
|
SteamIDFrom64(id: string): string;
|
|
768
|
+
|
|
692
769
|
/**
|
|
693
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).
|
|
694
771
|
* @realm shared
|
|
695
772
|
* @source https://wiki.facepunch.com/gmod/util.SteamIDTo64
|
|
696
773
|
*/
|
|
697
774
|
SteamIDTo64(id: string): string;
|
|
775
|
+
|
|
698
776
|
/**
|
|
699
777
|
* Converts a string to the specified type.
|
|
700
778
|
*
|
|
@@ -704,6 +782,7 @@ interface UtilLib {
|
|
|
704
782
|
* @source https://wiki.facepunch.com/gmod/util.StringToType
|
|
705
783
|
*/
|
|
706
784
|
StringToType(str: string, typename: string): any;
|
|
785
|
+
|
|
707
786
|
/**
|
|
708
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.
|
|
709
788
|
*
|
|
@@ -717,6 +796,7 @@ interface UtilLib {
|
|
|
717
796
|
* @source https://wiki.facepunch.com/gmod/util.TableToJSON
|
|
718
797
|
*/
|
|
719
798
|
TableToJSON(table: table, prettyPrint?: boolean): string;
|
|
799
|
+
|
|
720
800
|
/**
|
|
721
801
|
* Converts the given table into a Valve keyValue formatted string.
|
|
722
802
|
*
|
|
@@ -728,18 +808,21 @@ interface UtilLib {
|
|
|
728
808
|
* @source https://wiki.facepunch.com/gmod/util.TableToKeyValues
|
|
729
809
|
*/
|
|
730
810
|
TableToKeyValues(table: table, rootKey?: string): string;
|
|
811
|
+
|
|
731
812
|
/**
|
|
732
813
|
* Creates a timer object. The returned timer will be already started with given duration.
|
|
733
814
|
* @realm shared and menu
|
|
734
815
|
* @source https://wiki.facepunch.com/gmod/util.Timer
|
|
735
816
|
*/
|
|
736
817
|
Timer(duration?: number): table;
|
|
818
|
+
|
|
737
819
|
/**
|
|
738
820
|
* Returns the time since this function has been last called
|
|
739
821
|
* @realm shared and menu
|
|
740
822
|
* @source https://wiki.facepunch.com/gmod/util.TimerCycle
|
|
741
823
|
*/
|
|
742
824
|
TimerCycle(): number;
|
|
825
|
+
|
|
743
826
|
/**
|
|
744
827
|
* Runs a trace using the entity's collision model between two points. Does not
|
|
745
828
|
* take the entity's angles into account (traces the unrotated collision model).
|
|
@@ -747,6 +830,7 @@ interface UtilLib {
|
|
|
747
830
|
* @source https://wiki.facepunch.com/gmod/util.TraceEntity
|
|
748
831
|
*/
|
|
749
832
|
TraceEntity(tracedata: Trace, ent: Entity): TraceResult;
|
|
833
|
+
|
|
750
834
|
/**
|
|
751
835
|
* Identical to util.TraceHull but uses an entity's Axis-Aligned Bounding Box
|
|
752
836
|
* (AABB) for `mins`/`maxs` inputs (those two keys are ignored in the table).
|
|
@@ -754,6 +838,7 @@ interface UtilLib {
|
|
|
754
838
|
* @source https://wiki.facepunch.com/gmod/util.TraceEntityHull
|
|
755
839
|
*/
|
|
756
840
|
TraceEntityHull(tracedata: HullTrace, ent: Entity): TraceResult;
|
|
841
|
+
|
|
757
842
|
/**
|
|
758
843
|
* Performs an AABB hull (axis-aligned bounding box, not rotated) trace with the
|
|
759
844
|
* given trace data. This trace type cannot hit hitboxes. See util.TraceLine for
|
|
@@ -762,6 +847,7 @@ interface UtilLib {
|
|
|
762
847
|
* @source https://wiki.facepunch.com/gmod/util.TraceHull
|
|
763
848
|
*/
|
|
764
849
|
TraceHull(TraceData: HullTrace): TraceResult;
|
|
850
|
+
|
|
765
851
|
/**
|
|
766
852
|
* Performs an infinitely thin, invisible ray trace in a line and returns a
|
|
767
853
|
* table with information about what, if anything, the trace hit or intersected.
|
|
@@ -770,12 +856,14 @@ interface UtilLib {
|
|
|
770
856
|
* @source https://wiki.facepunch.com/gmod/util.TraceLine
|
|
771
857
|
*/
|
|
772
858
|
TraceLine(traceConfig: Trace): TraceResult;
|
|
859
|
+
|
|
773
860
|
/**
|
|
774
861
|
* Converts a type to a (nice, but still parsable) string
|
|
775
862
|
* @realm shared and menu
|
|
776
863
|
* @source https://wiki.facepunch.com/gmod/util.TypeToString
|
|
777
864
|
*/
|
|
778
865
|
TypeToString(input: any): string;
|
|
866
|
+
|
|
779
867
|
/**
|
|
780
868
|
* Converts string or a number to a bool, if possible. Alias of [Global.tobool](https://wiki.facepunch.com/gmod/Global.tobool).
|
|
781
869
|
*
|
|
@@ -786,98 +874,6 @@ interface UtilLib {
|
|
|
786
874
|
tobool(input: any): boolean;
|
|
787
875
|
}
|
|
788
876
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
877
|
interface UtilworldpickerLib {
|
|
882
878
|
/**
|
|
883
879
|
* Returns if the user is currently picking an entity.
|
|
@@ -885,6 +881,7 @@ interface UtilworldpickerLib {
|
|
|
885
881
|
* @source https://wiki.facepunch.com/gmod/util.worldpicker.Active
|
|
886
882
|
*/
|
|
887
883
|
Active(): boolean;
|
|
884
|
+
|
|
888
885
|
/**
|
|
889
886
|
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
890
887
|
*
|
|
@@ -895,6 +892,7 @@ interface UtilworldpickerLib {
|
|
|
895
892
|
* @source https://wiki.facepunch.com/gmod/util.worldpicker.Finish
|
|
896
893
|
*/
|
|
897
894
|
Finish(tr: TraceResult): void;
|
|
895
|
+
|
|
898
896
|
/**
|
|
899
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.
|
|
900
898
|
* @realm client
|
|
@@ -902,6 +900,3 @@ interface UtilworldpickerLib {
|
|
|
902
900
|
*/
|
|
903
901
|
Start(callback: (tr: table) => void): void;
|
|
904
902
|
}
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|