@tlua/gmod 1.0.1
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/README.md +28 -0
- package/__metadata.json +4 -0
- package/_globals.d.tlua +178 -0
- package/_gmod-std.d.tlua +35 -0
- package/achievementicon.d.tlua +12 -0
- package/achievements.d.tlua +162 -0
- package/ai.d.tlua +65 -0
- package/ai_schedule.d.tlua +17 -0
- package/ai_task.d.tlua +17 -0
- package/angle.d.tlua +197 -0
- package/avatarimage.d.tlua +10 -0
- package/awesomium.d.tlua +14 -0
- package/baseclass.d.tlua +42 -0
- package/bf_read.d.tlua +110 -0
- package/bit.d.tlua +121 -0
- package/button.d.tlua +13 -0
- package/cam.d.tlua +220 -0
- package/ceffectdata.d.tlua +337 -0
- package/chat.d.tlua +62 -0
- package/checkbutton.d.tlua +14 -0
- package/cleanup.d.tlua +88 -0
- package/cluaemitter.d.tlua +119 -0
- package/clualocomotion.d.tlua +383 -0
- package/cluaparticle.d.tlua +426 -0
- package/cmovedata.d.tlua +476 -0
- package/cnavarea.d.tlua +845 -0
- package/cnavladder.d.tlua +209 -0
- package/cnewparticleeffect.d.tlua +259 -0
- package/color.d.tlua +339 -0
- package/concommand.d.tlua +69 -0
- package/constraint.d.tlua +311 -0
- package/construct.d.tlua +26 -0
- package/contentheader.d.tlua +32 -0
- package/contenticon.d.tlua +86 -0
- package/contentsidebar.d.tlua +45 -0
- package/contentsidebartoolbox.d.tlua +13 -0
- package/contextbase.d.tlua +37 -0
- package/controlpanel.d.tlua +140 -0
- package/controlpresets.d.tlua +118 -0
- package/convar.d.tlua +162 -0
- package/cookie.d.tlua +60 -0
- package/coroutine.d.tlua +90 -0
- package/crecipientfilter.d.tlua +152 -0
- package/csent.d.tlua +10 -0
- package/csoundpatch.d.tlua +150 -0
- package/ctakedamageinfo.d.tlua +366 -0
- package/ctrllistbox.d.tlua +12 -0
- package/ctrlnumpad.d.tlua +73 -0
- package/cusercmd.d.tlua +320 -0
- package/custom_classes.d.tlua +65 -0
- package/custom_entity_fields.d.tlua +96 -0
- package/cvars.d.tlua +80 -0
- package/dadjustablemodelpanel.d.tlua +81 -0
- package/dalphabar.d.tlua +27 -0
- package/dbinder.d.tlua +37 -0
- package/dbubblecontainer.d.tlua +18 -0
- package/dbutton.d.tlua +88 -0
- package/dcategoryheader.d.tlua +13 -0
- package/dcategorylist.d.tlua +11 -0
- package/dcheckbox.d.tlua +46 -0
- package/dcheckboxlabel.d.tlua +90 -0
- package/dcollapsiblecategory.d.tlua +240 -0
- package/dcolorbutton.d.tlua +73 -0
- package/dcolorcombo.d.tlua +54 -0
- package/dcolorcube.d.tlua +137 -0
- package/dcolormixer.d.tlua +303 -0
- package/dcolorpalette.d.tlua +294 -0
- package/dcolumnsheet.d.tlua +49 -0
- package/dcombobox.d.tlua +161 -0
- package/ddragbase.d.tlua +151 -0
- package/ddrawer.d.tlua +72 -0
- package/debug.d.tlua +236 -0
- package/debugoverlay.d.tlua +193 -0
- package/dentityproperties.d.tlua +63 -0
- package/derma.d.tlua +119 -0
- package/dexpandbutton.d.tlua +30 -0
- package/dfilebrowser.d.tlua +228 -0
- package/dform.d.tlua +176 -0
- package/dframe.d.tlua +261 -0
- package/dgrid.d.tlua +113 -0
- package/dhorizontaldivider.d.tlua +196 -0
- package/dhorizontalscroller.d.tlua +104 -0
- package/dhscrollbar.d.tlua +109 -0
- package/dhtml.d.tlua +91 -0
- package/dhtmlcontrols.d.tlua +62 -0
- package/diconbrowser.d.tlua +113 -0
- package/diconlayout.d.tlua +190 -0
- package/dimage.d.tlua +221 -0
- package/dimagebutton.d.tlua +103 -0
- package/dkillicon.d.tlua +9 -0
- package/dlabel.d.tlua +385 -0
- package/dlabeleditable.d.tlua +51 -0
- package/dlabelurl.d.tlua +100 -0
- package/dlistbox.d.tlua +82 -0
- package/dlistboxitem.d.tlua +42 -0
- package/dlistlayout.d.tlua +14 -0
- package/dlistview.d.tlua +360 -0
- package/dlistview_column.d.tlua +135 -0
- package/dlistview_columnplain.d.tlua +11 -0
- package/dlistview_draggerbar.d.tlua +11 -0
- package/dlistview_line.d.tlua +140 -0
- package/dlistviewheaderlabel.d.tlua +11 -0
- package/dlistviewlabel.d.tlua +11 -0
- package/dlistviewline.d.tlua +11 -0
- package/dmenu.d.tlua +266 -0
- package/dmenubar.d.tlua +42 -0
- package/dmenuoption.d.tlua +135 -0
- package/dmenuoptioncvar.d.tlua +64 -0
- package/dmodelpanel.d.tlua +207 -0
- package/dmodelselect.d.tlua +20 -0
- package/dmodelselectmulti.d.tlua +19 -0
- package/dnotify.d.tlua +93 -0
- package/dnumberscratch.d.tlua +284 -0
- package/dnumberwang.d.tlua +147 -0
- package/dnumpad.d.tlua +11 -0
- package/dnumslider.d.tlua +182 -0
- package/dpanel.d.tlua +152 -0
- package/dpanellist.d.tlua +109 -0
- package/dpaneloverlay.d.tlua +65 -0
- package/dpanelselect.d.tlua +13 -0
- package/dpanpanel.d.tlua +64 -0
- package/dprogress.d.tlua +27 -0
- package/dproperties.d.tlua +52 -0
- package/dproperty_boolean.d.tlua +12 -0
- package/dproperty_combo.d.tlua +31 -0
- package/dproperty_entity.d.tlua +12 -0
- package/dproperty_float.d.tlua +12 -0
- package/dproperty_generic.d.tlua +50 -0
- package/dproperty_int.d.tlua +12 -0
- package/dproperty_vectorcolor.d.tlua +14 -0
- package/dpropertysheet.d.tlua +167 -0
- package/dragndrop.d.tlua +123 -0
- package/draw.d.tlua +162 -0
- package/drgbpicker.d.tlua +49 -0
- package/drive.d.tlua +159 -0
- package/dscrollbargrip.d.tlua +13 -0
- package/dscrollpanel.d.tlua +110 -0
- package/dshape.d.tlua +72 -0
- package/dsizetocontents.d.tlua +46 -0
- package/dslider.d.tlua +302 -0
- package/dsprite.d.tlua +84 -0
- package/dtab.d.tlua +81 -0
- package/dtextentry.d.tlua +442 -0
- package/dtilelayout.d.tlua +218 -0
- package/dtooltip.d.tlua +76 -0
- package/dtree.d.tlua +185 -0
- package/dtree_node.d.tlua +793 -0
- package/dtree_node_button.d.tlua +13 -0
- package/duplicator.d.tlua +338 -0
- package/dverticaldivider.d.tlua +223 -0
- package/dvscrollbar.d.tlua +109 -0
- package/editablepanel.d.tlua +10 -0
- package/effect.d.tlua +121 -0
- package/effects.d.tlua +77 -0
- package/engine.d.tlua +248 -0
- package/entity.d.tlua +8295 -0
- package/ents.d.tlua +267 -0
- package/enums.d.tlua +7082 -0
- package/file.d.tlua +419 -0
- package/file_class.d.tlua +7 -0
- package/fingerposer.d.tlua +12 -0
- package/fingervar.d.tlua +13 -0
- package/frame.d.tlua +11 -0
- package/frame_blend.d.tlua +105 -0
- package/game.d.tlua +482 -0
- package/gameevent.d.tlua +968 -0
- package/gamemode.d.tlua +48 -0
- package/global.d.tlua +3156 -0
- package/gm.d.tlua +3218 -0
- package/gmod.d.tlua +20 -0
- package/gmsave.d.tlua +53 -0
- package/gui.d.tlua +232 -0
- package/gwen.d.tlua +55 -0
- package/halo.d.tlua +42 -0
- package/hammer.d.tlua +17 -0
- package/hook.d.tlua +64 -0
- package/html.d.tlua +22 -0
- package/http.d.tlua +72 -0
- package/iconeditor.d.tlua +130 -0
- package/igmodaudiochannel.d.tlua +419 -0
- package/imagecheckbox.d.tlua +48 -0
- package/imaterial.d.tlua +288 -0
- package/imesh.d.tlua +70 -0
- package/index.d.tlua +277 -0
- package/input.d.tlua +252 -0
- package/invalidateinternalentitycache.d.tlua +13 -0
- package/irestore.d.tlua +94 -0
- package/isave.d.tlua +94 -0
- package/itexture.d.tlua +108 -0
- package/ivideowriter.d.tlua +53 -0
- package/jit.d.tlua +243 -0
- package/killicon.d.tlua +84 -0
- package/label.d.tlua +20 -0
- package/language.d.tlua +26 -0
- package/list.d.tlua +112 -0
- package/makeballoon.d.tlua +15 -0
- package/markup.d.tlua +38 -0
- package/markupobject.d.tlua +53 -0
- package/material.d.tlua +9 -0
- package/math.d.tlua +899 -0
- package/matproxy.d.tlua +60 -0
- package/matselect.d.tlua +106 -0
- package/menu.d.tlua +20 -0
- package/menubar.d.tlua +39 -0
- package/mesh.d.tlua +183 -0
- package/modelimage.d.tlua +12 -0
- package/motionsensor.d.tlua +115 -0
- package/navmesh.d.tlua +274 -0
- package/net.d.tlua +639 -0
- package/nextbot.d.tlua +380 -0
- package/notification.d.tlua +35 -0
- package/npc.d.tlua +1787 -0
- package/numpad.d.tlua +89 -0
- package/os.d.tlua +56 -0
- package/package.d.tlua +15 -0
- package/package.json +18 -0
- package/panel.d.tlua +3650 -0
- package/panellist.d.tlua +13 -0
- package/pathfollower.d.tlua +301 -0
- package/permissions.d.tlua +77 -0
- package/physcollide.d.tlua +40 -0
- package/physenv.d.tlua +136 -0
- package/physobj.d.tlua +799 -0
- package/pixelvis_handle_t.d.tlua +9 -0
- package/player.d.tlua +3320 -0
- package/player_manager.d.tlua +147 -0
- package/preseteditor.d.tlua +13 -0
- package/presets.d.tlua +79 -0
- package/projectedtexture.d.tlua +553 -0
- package/properties.d.tlua +65 -0
- package/propselect.d.tlua +50 -0
- package/radiobutton.d.tlua +13 -0
- package/render.d.tlua +1700 -0
- package/resource.d.tlua +73 -0
- package/richtext.d.tlua +17 -0
- package/sandbox.d.tlua +576 -0
- package/saverestore.d.tlua +148 -0
- package/schedule.d.tlua +69 -0
- package/scripted_ents.d.tlua +124 -0
- package/search.d.tlua +26 -0
- package/serverlist.d.tlua +85 -0
- package/slidebar.d.tlua +12 -0
- package/slider.d.tlua +11 -0
- package/sound.d.tlua +140 -0
- package/spawnicon.d.tlua +95 -0
- package/spawnmenu.d.tlua +286 -0
- package/spawnmenucontentpanel.d.tlua +52 -0
- package/sql.d.tlua +154 -0
- package/stack.d.tlua +57 -0
- package/steamworks.d.tlua +208 -0
- package/string.d.tlua +535 -0
- package/structures.d.tlua +4442 -0
- package/surface.d.tlua +463 -0
- package/surfaceinfo.d.tlua +70 -0
- package/system.d.tlua +134 -0
- package/table.d.tlua +533 -0
- package/task.d.tlua +92 -0
- package/team.d.tlua +195 -0
- package/textentry.d.tlua +12 -0
- package/tgaimage.d.tlua +11 -0
- package/timer.d.tlua +198 -0
- package/tool.d.tlua +466 -0
- package/ugcpublishwindow.d.tlua +83 -0
- package/umsg.d.tlua +147 -0
- package/undo.d.tlua +122 -0
- package/urllabel.d.tlua +13 -0
- package/usermessage.d.tlua +48 -0
- package/utf8.d.tlua +89 -0
- package/util.d.tlua +1087 -0
- package/vector.d.tlua +413 -0
- package/vehicle.d.tlua +472 -0
- package/vgui.d.tlua +201 -0
- package/video.d.tlua +17 -0
- package/vmatrix.d.tlua +392 -0
- package/weapon.d.tlua +913 -0
- package/weapons.d.tlua +90 -0
- package/widgets.d.tlua +29 -0
- package/workshopfilebase.d.tlua +68 -0
package/surface.d.tlua
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
// AUTO-GENERATED tlua declarations. Do not edit by hand.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The surface library allows you to draw text and shapes on the screen. Primarily used for making HUDs & custom GUI panels.
|
|
5
|
+
* @source https://wiki.facepunch.com/gmod/surface
|
|
6
|
+
*/
|
|
7
|
+
declare surface: SurfaceLib;
|
|
8
|
+
|
|
9
|
+
interface SurfaceLib {
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new font.
|
|
12
|
+
*
|
|
13
|
+
* To prevent the font from displaying incorrectly when using the `outline` setting, set `antialias` to false. This will ensure the text properly fills out the entire outline.
|
|
14
|
+
*
|
|
15
|
+
* Be sure to check the [List of Default Fonts](https://wiki.facepunch.com/gmod/Default_Fonts) first! Those fonts can be used without using this function.
|
|
16
|
+
*
|
|
17
|
+
* See Also: [Finding the Font Name](https://wiki.facepunch.com/gmod/Finding_the_Font_Name).
|
|
18
|
+
*
|
|
19
|
+
* **WARNING**: Due to the static nature of fonts, do **NOT** create the font more than once. You should only be creating them once, it is recommended to create them at the top of your script. Do not use this function within [GM:HUDPaint](https://wiki.facepunch.com/gmod/GM:HUDPaint) or any other hook!
|
|
20
|
+
*
|
|
21
|
+
* Define fonts that you will actually use, as fonts are very taxing on performance and will cause crashes! Do not create fonts for every size.
|
|
22
|
+
*
|
|
23
|
+
*
|
|
24
|
+
*
|
|
25
|
+
* @realm client and menu
|
|
26
|
+
* @source https://wiki.facepunch.com/gmod/surface.CreateFont
|
|
27
|
+
*/
|
|
28
|
+
CreateFont(fontName: string, fontData: FontData): void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface SurfaceLib {
|
|
32
|
+
/**
|
|
33
|
+
* Enables or disables the clipping used by the VGUI that limits the drawing operations to a panels bounds.
|
|
34
|
+
*
|
|
35
|
+
* Identical to [Global.DisableClipping](https://wiki.facepunch.com/gmod/Global.DisableClipping). See also [Panel:NoClipping](https://wiki.facepunch.com/gmod/Panel:NoClipping).
|
|
36
|
+
*
|
|
37
|
+
* @realm client and menu
|
|
38
|
+
* @source https://wiki.facepunch.com/gmod/surface.DisableClipping
|
|
39
|
+
* @deprecated Alias of Global.DisableClipping so use that instead.
|
|
40
|
+
*/
|
|
41
|
+
DisableClipping(disable: boolean): boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface SurfaceLib {
|
|
45
|
+
/**
|
|
46
|
+
* Draws a hollow circle, made of lines. For a filled circle, see examples for [surface.DrawPoly](https://wiki.facepunch.com/gmod/surface.DrawPoly).
|
|
47
|
+
*
|
|
48
|
+
*
|
|
49
|
+
*
|
|
50
|
+
* @realm client and menu
|
|
51
|
+
* @source https://wiki.facepunch.com/gmod/surface.DrawCircle
|
|
52
|
+
*/
|
|
53
|
+
DrawCircle(originX: number, originY: number, radius: number, r: number, g: number, b: number, a?: number): void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface SurfaceLib {
|
|
57
|
+
DrawCircle(originX: number, originY: number, radius: number, color: Color): void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface SurfaceLib {
|
|
61
|
+
/**
|
|
62
|
+
* Draws a line from one point to another.
|
|
63
|
+
*
|
|
64
|
+
*
|
|
65
|
+
*
|
|
66
|
+
* @realm client and menu
|
|
67
|
+
* @source https://wiki.facepunch.com/gmod/surface.DrawLine
|
|
68
|
+
*/
|
|
69
|
+
DrawLine(startX: number, startY: number, endX: number, endY: number): void;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface SurfaceLib {
|
|
73
|
+
/**
|
|
74
|
+
* Draws a hollow box with a given border width.
|
|
75
|
+
*
|
|
76
|
+
*
|
|
77
|
+
*
|
|
78
|
+
* @realm client and menu
|
|
79
|
+
* @source https://wiki.facepunch.com/gmod/surface.DrawOutlinedRect
|
|
80
|
+
*/
|
|
81
|
+
DrawOutlinedRect(x: number, y: number, w: number, h: number, thickness?: number): void;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
interface SurfaceLib {
|
|
85
|
+
/**
|
|
86
|
+
* Draws a textured polygon (secretly a triangle fan) with a maximum of 4096 vertices.
|
|
87
|
+
* Only works properly with convex polygons. You may try to render concave polygons, but there is no guarantee that things wont get messed up.
|
|
88
|
+
*
|
|
89
|
+
* Unlike most surface library functions, non-integer coordinates are not rounded.
|
|
90
|
+
*
|
|
91
|
+
* **WARNING**: You must reset the drawing color and texture before calling the function to ensure consistent results. See examples below.
|
|
92
|
+
*
|
|
93
|
+
*
|
|
94
|
+
*
|
|
95
|
+
*
|
|
96
|
+
* @realm client and menu
|
|
97
|
+
* @source https://wiki.facepunch.com/gmod/surface.DrawPoly
|
|
98
|
+
*/
|
|
99
|
+
DrawPoly(vertices: table): void;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface SurfaceLib {
|
|
103
|
+
/**
|
|
104
|
+
* Draws a solid rectangle on the screen.
|
|
105
|
+
*
|
|
106
|
+
*
|
|
107
|
+
*
|
|
108
|
+
* @realm client and menu
|
|
109
|
+
* @source https://wiki.facepunch.com/gmod/surface.DrawRect
|
|
110
|
+
*/
|
|
111
|
+
DrawRect(x: number, y: number, width: number, height: number): void;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface SurfaceLib {
|
|
115
|
+
/**
|
|
116
|
+
* Draw the specified text on the screen, using the previously set [position](https://wiki.facepunch.com/gmod/surface.SetTextPos), [font](https://wiki.facepunch.com/gmod/surface.SetFont) and [color](https://wiki.facepunch.com/gmod/surface.SetTextColor). This function does **not** handle newlines.
|
|
117
|
+
*
|
|
118
|
+
* This function moves the [text position](https://wiki.facepunch.com/gmod/surface.SetTextPos) by the length of the drawn text - this can be used to change text properties (such as font or color) without having to manually recalculate the text position. See example #2 for example use of this behavior.
|
|
119
|
+
*
|
|
120
|
+
*
|
|
121
|
+
*
|
|
122
|
+
* @realm client and menu
|
|
123
|
+
* @source https://wiki.facepunch.com/gmod/surface.DrawText
|
|
124
|
+
*/
|
|
125
|
+
DrawText(text: string, forceAdditive?: boolean): void;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface SurfaceLib {
|
|
129
|
+
/**
|
|
130
|
+
* Draw a textured rectangle with the given position and dimensions on the screen, using the current active texture set with [surface.SetMaterial](https://wiki.facepunch.com/gmod/surface.SetMaterial). It is also affected by [surface.SetDrawColor](https://wiki.facepunch.com/gmod/surface.SetDrawColor).
|
|
131
|
+
*
|
|
132
|
+
* See also [render.SetMaterial](https://wiki.facepunch.com/gmod/render.SetMaterial) and [render.DrawScreenQuadEx](https://wiki.facepunch.com/gmod/render.DrawScreenQuadEx).
|
|
133
|
+
* See also [surface.DrawTexturedRectUV](https://wiki.facepunch.com/gmod/surface.DrawTexturedRectUV) and [surface.DrawTexturedRectRotated](https://wiki.facepunch.com/gmod/surface.DrawTexturedRectRotated).
|
|
134
|
+
*
|
|
135
|
+
*
|
|
136
|
+
*
|
|
137
|
+
* @realm client and menu
|
|
138
|
+
* @source https://wiki.facepunch.com/gmod/surface.DrawTexturedRect
|
|
139
|
+
*/
|
|
140
|
+
DrawTexturedRect(x: number, y: number, width: number, height: number): void;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
interface SurfaceLib {
|
|
144
|
+
/**
|
|
145
|
+
* Draw a textured rotated rectangle with the given position and dimensions and angle on the screen, using the current active texture.
|
|
146
|
+
*
|
|
147
|
+
* See also [surface.DrawTexturedRectUV](https://wiki.facepunch.com/gmod/surface.DrawTexturedRectUV) and [surface.DrawTexturedRect](https://wiki.facepunch.com/gmod/surface.DrawTexturedRect).
|
|
148
|
+
*
|
|
149
|
+
*
|
|
150
|
+
*
|
|
151
|
+
* @realm client and menu
|
|
152
|
+
* @source https://wiki.facepunch.com/gmod/surface.DrawTexturedRectRotated
|
|
153
|
+
*/
|
|
154
|
+
DrawTexturedRectRotated(x: number, y: number, width: number, height: number, rotation: number): void;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
interface SurfaceLib {
|
|
158
|
+
/**
|
|
159
|
+
* Draws a textured rectangle with a repeated or partial texture.
|
|
160
|
+
*
|
|
161
|
+
* `u` and `v` refer to texture coordinates.
|
|
162
|
+
* * (u, v) = (0, 0) is the top left
|
|
163
|
+
* * (u, v) = (1, 0) is the top right
|
|
164
|
+
* * (u, v) = (1, 1) is the bottom right
|
|
165
|
+
* * (u, v) = (0, 1) is the bottom left
|
|
166
|
+
*
|
|
167
|
+
* Using a start point of (1, 0) and an end point to (0, 1), you can draw an image flipped horizontally, same goes with other directions. Going above 1 will tile the texture. Negative values are allowed as well.
|
|
168
|
+
*
|
|
169
|
+
* Here's a helper image:
|
|
170
|
+
*
|
|
171
|
+
*
|
|
172
|
+
* See also [surface.DrawTexturedRect](https://wiki.facepunch.com/gmod/surface.DrawTexturedRect) and [surface.DrawTexturedRectRotated](https://wiki.facepunch.com/gmod/surface.DrawTexturedRectRotated).
|
|
173
|
+
*
|
|
174
|
+
* **NOTE**: If you are using a .png image, you need supply the "noclamp" flag as second parameter for [Global.Material](https://wiki.facepunch.com/gmod/Global.Material) if you intend to use tiling.
|
|
175
|
+
*
|
|
176
|
+
*
|
|
177
|
+
* **NOTE**: If you find that `surface.DrawTexturedRectUV` is getting your texture coordinates (u0, v0), (u1, v1) wrong and you're rendering with a material created with [Global.CreateMaterial](https://wiki.facepunch.com/gmod/Global.CreateMaterial), try adjusting them with the following code:
|
|
178
|
+
*
|
|
179
|
+
* ```
|
|
180
|
+
* local du = 0.5 / 32 -- half pixel anticorrection
|
|
181
|
+
* local dv = 0.5 / 32 -- half pixel anticorrection
|
|
182
|
+
* local u0, v0 = (u0 - du) / (1 - 2 * du), (v0 - dv) / (1 - 2 * dv)
|
|
183
|
+
* local u1, v1 = (u1 - du) / (1 - 2 * du), (v1 - dv) / (1 - 2 * dv)
|
|
184
|
+
* ```
|
|
185
|
+
*
|
|
186
|
+
*
|
|
187
|
+
* **Explanation:**
|
|
188
|
+
* `surface.DrawTexturedRectUV` tries to correct the texture coordinates by half a pixel (something to do with sampling) and computes the correction using `IMaterial::GetMappingWidth()`/`GetMappingHeight()`. If the material was created without a `$basetexture`, then `GetMappingWidth()`/`GetMappingHeight()` uses the width and height of the error material (which is 32x32).
|
|
189
|
+
*
|
|
190
|
+
*
|
|
191
|
+
*
|
|
192
|
+
*
|
|
193
|
+
* The UV offsets might require (sub-)pixel correction for accurate tiling results.
|
|
194
|
+
*
|
|
195
|
+
* @realm client and menu
|
|
196
|
+
* @source https://wiki.facepunch.com/gmod/surface.DrawTexturedRectUV
|
|
197
|
+
*/
|
|
198
|
+
DrawTexturedRectUV(x: number, y: number, width: number, height: number, startU: number, startV: number, endU: number, endV: number): void;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
interface SurfaceLib {
|
|
202
|
+
/**
|
|
203
|
+
* Returns the current alpha multiplier affecting drawing operations. This is set by [surface.SetAlphaMultiplier](https://wiki.facepunch.com/gmod/surface.SetAlphaMultiplier) or by the game engine in certain other cases.
|
|
204
|
+
* @realm client and menu
|
|
205
|
+
* @source https://wiki.facepunch.com/gmod/surface.GetAlphaMultiplier
|
|
206
|
+
*/
|
|
207
|
+
GetAlphaMultiplier(): number;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
interface SurfaceLib {
|
|
211
|
+
/**
|
|
212
|
+
* Returns the current color affecting draw operations.
|
|
213
|
+
*
|
|
214
|
+
*
|
|
215
|
+
* @realm client and menu
|
|
216
|
+
* @source https://wiki.facepunch.com/gmod/surface.GetDrawColor
|
|
217
|
+
*/
|
|
218
|
+
GetDrawColor(): Color;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
interface SurfaceLib {
|
|
222
|
+
/**
|
|
223
|
+
* Returns the [HUD icon](https://github.com/Facepunch/garrysmod/blob/master/garrysmod/scripts/hud_textures.txt) TextureID of a texture with the specified name.
|
|
224
|
+
*
|
|
225
|
+
* You probably want to use [Global.Material](https://wiki.facepunch.com/gmod/Global.Material) and [surface.SetMaterial](https://wiki.facepunch.com/gmod/surface.SetMaterial).
|
|
226
|
+
* @realm client
|
|
227
|
+
* @source https://wiki.facepunch.com/gmod/surface.GetHUDTexture
|
|
228
|
+
*/
|
|
229
|
+
GetHUDTexture(name: string): number;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
interface SurfaceLib {
|
|
233
|
+
/**
|
|
234
|
+
* Retrieves the position and [ScissorRect](https://wiki.facepunch.com/gmod/render.SetScissorRect) information for the [Panel](https://wiki.facepunch.com/gmod/Panel) that is currently being drawn.
|
|
235
|
+
*
|
|
236
|
+
* When using the [surface](https://wiki.facepunch.com/gmod/surface) library (and, by extension, the [draw](https://wiki.facepunch.com/gmod/draw) library) inside of the [PANEL:Paint](https://wiki.facepunch.com/gmod/PANEL:Paint) function, the origin (The on-screen position of `(0,0)`) is automatically shifted to the top-left corner of the panel to make it easier to draw the panel's contents. Additionally, [render.SetScissorRect](https://wiki.facepunch.com/gmod/render.SetScissorRect) is used to clip (or "mask") all drawn content to within the boundaries of the panel. This function returns the information used by the [surface](https://wiki.facepunch.com/gmod/surface) library about the current panel's origin and [ScissorRect](https://wiki.facepunch.com/gmod/render.SetScissorRect).
|
|
237
|
+
*
|
|
238
|
+
* @realm client
|
|
239
|
+
* @source https://wiki.facepunch.com/gmod/surface.GetPanelPaintState
|
|
240
|
+
*/
|
|
241
|
+
GetPanelPaintState(): PanelPaintState;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
interface SurfaceLib {
|
|
245
|
+
/**
|
|
246
|
+
* Retrieves the currently active scissor rect for the surface library. A faster, narrower version of [surface.GetPanelPaintState](https://wiki.facepunch.com/gmod/surface.GetPanelPaintState).
|
|
247
|
+
*
|
|
248
|
+
* Useful for panel retrieving current panel's culling from [PANEL:Paint](https://wiki.facepunch.com/gmod/PANEL:Paint).
|
|
249
|
+
*
|
|
250
|
+
* This does **NOT** return values set by [render.SetScissorRect](https://wiki.facepunch.com/gmod/render.SetScissorRect).
|
|
251
|
+
*
|
|
252
|
+
* @realm client
|
|
253
|
+
* @source https://wiki.facepunch.com/gmod/surface.GetScissorRect
|
|
254
|
+
*/
|
|
255
|
+
GetScissorRect(): (boolean, number, number, number, number);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
interface SurfaceLib {
|
|
259
|
+
/**
|
|
260
|
+
* Returns the current color affecting text draw operations.
|
|
261
|
+
*
|
|
262
|
+
*
|
|
263
|
+
* @realm client and menu
|
|
264
|
+
* @source https://wiki.facepunch.com/gmod/surface.GetTextColor
|
|
265
|
+
*/
|
|
266
|
+
GetTextColor(): Color;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
interface SurfaceLib {
|
|
270
|
+
/**
|
|
271
|
+
* Returns the X and Y co-ordinate that has been set with [surface.SetTextPos](https://wiki.facepunch.com/gmod/surface.SetTextPos) or changed by [surface.DrawText](https://wiki.facepunch.com/gmod/surface.DrawText).
|
|
272
|
+
* @realm client and menu
|
|
273
|
+
* @source https://wiki.facepunch.com/gmod/surface.GetTextPos
|
|
274
|
+
*/
|
|
275
|
+
GetTextPos(): (number, number);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
interface SurfaceLib {
|
|
279
|
+
/**
|
|
280
|
+
* Returns the width and height (in pixels) of the given text with the font that has been set with [surface.SetFont](https://wiki.facepunch.com/gmod/surface.SetFont).
|
|
281
|
+
*
|
|
282
|
+
* **NOTE**: Takes into account new lines, the returned height is for the entire text, but [surface.DrawText](https://wiki.facepunch.com/gmod/surface.DrawText) does not!
|
|
283
|
+
*
|
|
284
|
+
* @realm client and menu
|
|
285
|
+
* @source https://wiki.facepunch.com/gmod/surface.GetTextSize
|
|
286
|
+
*/
|
|
287
|
+
GetTextSize(text: string): (number, number);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
interface SurfaceLib {
|
|
291
|
+
/**
|
|
292
|
+
* Returns the texture id of the material with the given name/path, for use with [surface.SetTexture](https://wiki.facepunch.com/gmod/surface.SetTexture).
|
|
293
|
+
*
|
|
294
|
+
* Opposite version of this function is [surface.GetTextureNameByID](https://wiki.facepunch.com/gmod/surface.GetTextureNameByID).
|
|
295
|
+
*
|
|
296
|
+
* **NOTE**: This function will not work with .png or .jpg images. For that, see [Global.Material](https://wiki.facepunch.com/gmod/Global.Material). You will probably want to use it regardless.
|
|
297
|
+
*
|
|
298
|
+
*
|
|
299
|
+
* @realm client and menu
|
|
300
|
+
* @source https://wiki.facepunch.com/gmod/surface.GetTextureID
|
|
301
|
+
*/
|
|
302
|
+
GetTextureID(nameOrPath: string): number;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
interface SurfaceLib {
|
|
306
|
+
/**
|
|
307
|
+
* Returns name/path of texture by ID. Opposite version of this function is [surface.GetTextureID](https://wiki.facepunch.com/gmod/surface.GetTextureID).
|
|
308
|
+
*
|
|
309
|
+
*
|
|
310
|
+
* @realm client and menu
|
|
311
|
+
* @source https://wiki.facepunch.com/gmod/surface.GetTextureNameByID
|
|
312
|
+
*/
|
|
313
|
+
GetTextureNameByID(id: number): string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
interface SurfaceLib {
|
|
317
|
+
/**
|
|
318
|
+
* Returns the size of the texture with the associated texture ID.
|
|
319
|
+
*
|
|
320
|
+
* For `.png/.jpg` textures loaded with [Global.Material](https://wiki.facepunch.com/gmod/Global.Material) you can use the `$realheight` and `$realwidth` material parameters ([IMaterial:GetInt](https://wiki.facepunch.com/gmod/IMaterial:GetInt)) to get the size of the image.
|
|
321
|
+
*
|
|
322
|
+
* @realm client and menu
|
|
323
|
+
* @source https://wiki.facepunch.com/gmod/surface.GetTextureSize
|
|
324
|
+
*/
|
|
325
|
+
GetTextureSize(textureID: number): (number, number);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
interface SurfaceLib {
|
|
329
|
+
/**
|
|
330
|
+
* Play a sound file directly on the client (such as UI sounds, etc).
|
|
331
|
+
*
|
|
332
|
+
* **NOTE**: Valid sample rates: **11025 Hz, 22050 Hz and 44100 Hz**, otherwise you may see this kind of message:
|
|
333
|
+
*
|
|
334
|
+
* `Unsupported 32-bit wave file your_sound.wav` and
|
|
335
|
+
* `Invalid sample rate (48000) for sound 'your_sound.wav'`
|
|
336
|
+
*
|
|
337
|
+
*
|
|
338
|
+
* @realm client and menu
|
|
339
|
+
* @source https://wiki.facepunch.com/gmod/surface.PlaySound
|
|
340
|
+
*/
|
|
341
|
+
PlaySound(soundfile: string): void;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
interface SurfaceLib {
|
|
345
|
+
/**
|
|
346
|
+
* Returns the height of the current client's screen.
|
|
347
|
+
*
|
|
348
|
+
* @realm client and menu
|
|
349
|
+
* @source https://wiki.facepunch.com/gmod/surface.ScreenHeight
|
|
350
|
+
* @deprecated You should use Global.ScrH instead.
|
|
351
|
+
*/
|
|
352
|
+
ScreenHeight(): number;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
interface SurfaceLib {
|
|
356
|
+
/**
|
|
357
|
+
* Returns the width of the current client's screen.
|
|
358
|
+
*
|
|
359
|
+
* @realm client and menu
|
|
360
|
+
* @source https://wiki.facepunch.com/gmod/surface.ScreenWidth
|
|
361
|
+
* @deprecated You should use Global.ScrW instead.
|
|
362
|
+
*/
|
|
363
|
+
ScreenWidth(): number;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
interface SurfaceLib {
|
|
367
|
+
/**
|
|
368
|
+
* Sets the alpha multiplier that will influence all upcoming drawing operations.
|
|
369
|
+
* See also [render.SetBlend](https://wiki.facepunch.com/gmod/render.SetBlend).
|
|
370
|
+
*
|
|
371
|
+
* @realm client and menu
|
|
372
|
+
* @source https://wiki.facepunch.com/gmod/surface.SetAlphaMultiplier
|
|
373
|
+
*/
|
|
374
|
+
SetAlphaMultiplier(multiplier: number): void;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
interface SurfaceLib {
|
|
378
|
+
/**
|
|
379
|
+
* Set the color of any future shapes to be drawn, can be set by either using R, G, B, A as separate values or by a [Color](https://wiki.facepunch.com/gmod/Color).
|
|
380
|
+
*
|
|
381
|
+
* **NOTE**: The alpha value may not work properly if you're using a material without `$vertexalpha`.
|
|
382
|
+
*
|
|
383
|
+
* **NOTE**: Due to post processing and gamma correction the color you set with this function may appear differently when rendered. This problem does not occur on materials drawn with [surface.DrawTexturedRect](https://wiki.facepunch.com/gmod/surface.DrawTexturedRect).
|
|
384
|
+
*
|
|
385
|
+
*
|
|
386
|
+
* @realm client and menu
|
|
387
|
+
* @source https://wiki.facepunch.com/gmod/surface.SetDrawColor
|
|
388
|
+
*/
|
|
389
|
+
SetDrawColor(r: number, g: number, b: number, a?: number): void;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
interface SurfaceLib {
|
|
393
|
+
SetDrawColor(color: Color): void;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
interface SurfaceLib {
|
|
397
|
+
/**
|
|
398
|
+
* Set the current font to be used for text operations later.
|
|
399
|
+
*
|
|
400
|
+
* The fonts must first be created with [surface.CreateFont](https://wiki.facepunch.com/gmod/surface.CreateFont) or be one of the [Default Fonts](https://wiki.facepunch.com/gmod/Default_Fonts).
|
|
401
|
+
*
|
|
402
|
+
* @realm client and menu
|
|
403
|
+
* @source https://wiki.facepunch.com/gmod/surface.SetFont
|
|
404
|
+
*/
|
|
405
|
+
SetFont(fontName: string): void;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
interface SurfaceLib {
|
|
409
|
+
/**
|
|
410
|
+
* Sets the material to be used in all upcoming draw operations using the surface library.
|
|
411
|
+
*
|
|
412
|
+
* Not to be confused with [render.SetMaterial](https://wiki.facepunch.com/gmod/render.SetMaterial).
|
|
413
|
+
*
|
|
414
|
+
* If you need to unset the texture, use the [draw.NoTexture](https://wiki.facepunch.com/gmod/draw.NoTexture) convenience function.
|
|
415
|
+
*
|
|
416
|
+
* **WARNING**: [Global.Material](https://wiki.facepunch.com/gmod/Global.Material) function calls are expensive to be done inside this function or inside rendering context, you should be caching the results of [Global.Material](https://wiki.facepunch.com/gmod/Global.Material) calls
|
|
417
|
+
*
|
|
418
|
+
*
|
|
419
|
+
*
|
|
420
|
+
* @realm client and menu
|
|
421
|
+
* @source https://wiki.facepunch.com/gmod/surface.SetMaterial
|
|
422
|
+
*/
|
|
423
|
+
SetMaterial(material: IMaterial): void;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
interface SurfaceLib {
|
|
427
|
+
/**
|
|
428
|
+
* Set the color of any future text to be drawn, can be set by either using R, G, B, A as separate numbers or by providing a [Color](https://wiki.facepunch.com/gmod/Color).
|
|
429
|
+
*
|
|
430
|
+
* @realm client and menu
|
|
431
|
+
* @source https://wiki.facepunch.com/gmod/surface.SetTextColor
|
|
432
|
+
*/
|
|
433
|
+
SetTextColor(r: number, g: number, b: number, a?: number): void;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
interface SurfaceLib {
|
|
437
|
+
SetTextColor(color: Color): void;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
interface SurfaceLib {
|
|
441
|
+
/**
|
|
442
|
+
* Set the top-left position to draw any future text at.
|
|
443
|
+
* @realm client and menu
|
|
444
|
+
* @source https://wiki.facepunch.com/gmod/surface.SetTextPos
|
|
445
|
+
*/
|
|
446
|
+
SetTextPos(x: number, y: number): void;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
interface SurfaceLib {
|
|
450
|
+
/**
|
|
451
|
+
* Sets the texture to be used in all upcoming draw operations using the surface library.
|
|
452
|
+
*
|
|
453
|
+
* This is a legacy method, and should probably not be used, see [surface.SetMaterial](https://wiki.facepunch.com/gmod/surface.SetMaterial) and [IMaterial](https://wiki.facepunch.com/gmod/IMaterial) for a better alternative.
|
|
454
|
+
*
|
|
455
|
+
*
|
|
456
|
+
*
|
|
457
|
+
*
|
|
458
|
+
* @realm client and menu
|
|
459
|
+
* @source https://wiki.facepunch.com/gmod/surface.SetTexture
|
|
460
|
+
*/
|
|
461
|
+
SetTexture(textureID: number): void;
|
|
462
|
+
}
|
|
463
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// AUTO-GENERATED tlua declarations. Do not edit by hand.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A brush surface object returned by [Entity:GetBrushSurfaces](https://wiki.facepunch.com/gmod/Entity:GetBrushSurfaces).
|
|
5
|
+
*
|
|
6
|
+
* Brush surfaces are a part of what makes up the map geometry aside from displacements. Any primitive brush model, including most breakable windows, can be represented by this object.
|
|
7
|
+
*
|
|
8
|
+
* **NOTE**: This object internally uses the `SurfaceHandle_t` class, which is an alias for `msurface2_t*`.
|
|
9
|
+
*
|
|
10
|
+
* @source https://wiki.facepunch.com/gmod/SurfaceInfo
|
|
11
|
+
*/
|
|
12
|
+
interface SurfaceInfo {}
|
|
13
|
+
|
|
14
|
+
interface SurfaceInfo {
|
|
15
|
+
/**
|
|
16
|
+
* Returns the brush surface's material.
|
|
17
|
+
* @realm shared
|
|
18
|
+
* @source https://wiki.facepunch.com/gmod/SurfaceInfo:GetMaterial
|
|
19
|
+
*/
|
|
20
|
+
GetMaterial(self: SurfaceInfo): IMaterial;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface SurfaceInfo {
|
|
24
|
+
/**
|
|
25
|
+
* Returns a list of vertices the brush surface is built from.
|
|
26
|
+
* @realm shared
|
|
27
|
+
* @source https://wiki.facepunch.com/gmod/SurfaceInfo:GetVertices
|
|
28
|
+
*/
|
|
29
|
+
GetVertices(self: SurfaceInfo): Vector[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface SurfaceInfo {
|
|
33
|
+
/**
|
|
34
|
+
* Checks if the brush surface is a nodraw surface, meaning it will not be drawn by the engine.
|
|
35
|
+
*
|
|
36
|
+
* **NOTE**: This internally checks the SURFDRAW_NODRAW flag.
|
|
37
|
+
*
|
|
38
|
+
*
|
|
39
|
+
* @realm shared
|
|
40
|
+
* @source https://wiki.facepunch.com/gmod/SurfaceInfo:IsNoDraw
|
|
41
|
+
*/
|
|
42
|
+
IsNoDraw(self: SurfaceInfo): boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface SurfaceInfo {
|
|
46
|
+
/**
|
|
47
|
+
* Checks if the brush surface is displaying the skybox.
|
|
48
|
+
*
|
|
49
|
+
* **NOTE**: This internally checks the SURFDRAW_SKY flag.
|
|
50
|
+
*
|
|
51
|
+
*
|
|
52
|
+
* @realm shared
|
|
53
|
+
* @source https://wiki.facepunch.com/gmod/SurfaceInfo:IsSky
|
|
54
|
+
*/
|
|
55
|
+
IsSky(self: SurfaceInfo): boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface SurfaceInfo {
|
|
59
|
+
/**
|
|
60
|
+
* Checks if the brush surface is water.
|
|
61
|
+
*
|
|
62
|
+
* **NOTE**: This internally checks the SURFDRAW_WATER flag.
|
|
63
|
+
*
|
|
64
|
+
*
|
|
65
|
+
* @realm shared
|
|
66
|
+
* @source https://wiki.facepunch.com/gmod/SurfaceInfo:IsWater
|
|
67
|
+
*/
|
|
68
|
+
IsWater(self: SurfaceInfo): boolean;
|
|
69
|
+
}
|
|
70
|
+
|
package/system.d.tlua
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// AUTO-GENERATED tlua declarations. Do not edit by hand.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The system library provides functions that allow you to gather information about the system running the game, such as operating system, uptime and battery level.
|
|
5
|
+
* @source https://wiki.facepunch.com/gmod/system
|
|
6
|
+
*/
|
|
7
|
+
declare system: SystemLib;
|
|
8
|
+
|
|
9
|
+
interface SystemLib {
|
|
10
|
+
/**
|
|
11
|
+
* Returns the total uptime of the current application as reported by Steam.
|
|
12
|
+
*
|
|
13
|
+
* This will return a similar value to [Global.SysTime](https://wiki.facepunch.com/gmod/Global.SysTime).
|
|
14
|
+
*
|
|
15
|
+
* **NOTE**: This function does not work on Dedicated Servers and will instead return no value.
|
|
16
|
+
*
|
|
17
|
+
*
|
|
18
|
+
* @realm shared and menu
|
|
19
|
+
* @source https://wiki.facepunch.com/gmod/system.AppTime
|
|
20
|
+
*/
|
|
21
|
+
AppTime(): number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface SystemLib {
|
|
25
|
+
/**
|
|
26
|
+
* Returns the current battery power.
|
|
27
|
+
* @realm shared and menu
|
|
28
|
+
* @source https://wiki.facepunch.com/gmod/system.BatteryPower
|
|
29
|
+
*/
|
|
30
|
+
BatteryPower(): number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface SystemLib {
|
|
34
|
+
/**
|
|
35
|
+
* Flashes the window, turning the border to white briefly
|
|
36
|
+
* @realm client and menu
|
|
37
|
+
* @source https://wiki.facepunch.com/gmod/system.FlashWindow
|
|
38
|
+
*/
|
|
39
|
+
FlashWindow(): void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface SystemLib {
|
|
43
|
+
/**
|
|
44
|
+
* Returns the country code of this computer, determined by the IP of the client. Uses the steamworks API function `SteamUtils()->GetIPCountry()`.
|
|
45
|
+
*
|
|
46
|
+
* **NOTE**: This function does not work on Dedicated Servers and will instead return no value.
|
|
47
|
+
*
|
|
48
|
+
*
|
|
49
|
+
* @realm shared and menu
|
|
50
|
+
* @source https://wiki.facepunch.com/gmod/system.GetCountry
|
|
51
|
+
*/
|
|
52
|
+
GetCountry(): string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface SystemLib {
|
|
56
|
+
/**
|
|
57
|
+
* Returns whether or not the game window has focus.
|
|
58
|
+
*
|
|
59
|
+
* **NOTE**: This function does not work on dedicated servers and will instead return no value.
|
|
60
|
+
*
|
|
61
|
+
*
|
|
62
|
+
* @realm shared and menu
|
|
63
|
+
* @source https://wiki.facepunch.com/gmod/system.HasFocus
|
|
64
|
+
*/
|
|
65
|
+
HasFocus(): boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface SystemLib {
|
|
69
|
+
/**
|
|
70
|
+
* Returns whether the current OS is Linux.
|
|
71
|
+
* @realm shared and menu
|
|
72
|
+
* @source https://wiki.facepunch.com/gmod/system.IsLinux
|
|
73
|
+
*/
|
|
74
|
+
IsLinux(): boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface SystemLib {
|
|
78
|
+
/**
|
|
79
|
+
* Returns whether the current OS is OSX.
|
|
80
|
+
* @realm shared and menu
|
|
81
|
+
* @source https://wiki.facepunch.com/gmod/system.IsOSX
|
|
82
|
+
*/
|
|
83
|
+
IsOSX(): boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface SystemLib {
|
|
87
|
+
/**
|
|
88
|
+
* Returns whether the game is being run in a window or in fullscreen (you can change this by opening the menu, clicking 'Options', then clicking the 'Video' tab, and changing the Display Mode using the dropdown menu):
|
|
89
|
+
*
|
|
90
|
+
*
|
|
91
|
+
*
|
|
92
|
+
* @realm client and menu
|
|
93
|
+
* @source https://wiki.facepunch.com/gmod/system.IsWindowed
|
|
94
|
+
*/
|
|
95
|
+
IsWindowed(): boolean;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface SystemLib {
|
|
99
|
+
/**
|
|
100
|
+
* Returns whether the current OS is Windows.
|
|
101
|
+
* @realm shared and menu
|
|
102
|
+
* @source https://wiki.facepunch.com/gmod/system.IsWindows
|
|
103
|
+
*/
|
|
104
|
+
IsWindows(): boolean;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
interface SystemLib {
|
|
108
|
+
/**
|
|
109
|
+
* Returns the synchronized Steam time. This is the number of seconds since the [Unix epoch](http://en.wikipedia.org/wiki/Unix_time).
|
|
110
|
+
*
|
|
111
|
+
* **NOTE**: This function does not work on Dedicated Servers and will instead return no value.
|
|
112
|
+
*
|
|
113
|
+
*
|
|
114
|
+
* @realm shared and menu
|
|
115
|
+
* @source https://wiki.facepunch.com/gmod/system.SteamTime
|
|
116
|
+
*/
|
|
117
|
+
SteamTime(): number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface SystemLib {
|
|
121
|
+
/**
|
|
122
|
+
* Returns the amount of seconds since the Steam user last moved their mouse.
|
|
123
|
+
*
|
|
124
|
+
* This is a direct binding to ISteamUtils->GetSecondsSinceComputerActive, and is most likely related to Steam's automatic "Away" online status.
|
|
125
|
+
*
|
|
126
|
+
* **NOTE**: This function does not work on Dedicated Servers and will instead return no value.
|
|
127
|
+
*
|
|
128
|
+
*
|
|
129
|
+
* @realm shared and menu
|
|
130
|
+
* @source https://wiki.facepunch.com/gmod/system.UpTime
|
|
131
|
+
*/
|
|
132
|
+
UpTime(): number;
|
|
133
|
+
}
|
|
134
|
+
|