forked from jessy-lua/docs
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdefault_docs.json
More file actions
1512 lines (1512 loc) · 38.7 KB
/
Copy pathdefault_docs.json
File metadata and controls
1512 lines (1512 loc) · 38.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
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
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"cvar": {
"set_string": {
"name": "cvar.set_string",
"args": [
{
"name": "value",
"description": "String value"
}
]
},
"get_string": {
"name": "cvar.get_string",
"description": "Returns nil on failure.",
"args": []
},
"set_float": {
"name": "cvar.set_float",
"args": [
{
"name": "value",
"description": "Float value"
}
]
},
"set_raw_float": {
"name": "cvar.set_raw_float",
"description": "This sets the float value without changing the integer and string values.",
"args": [
{
"name": "value",
"description": "Float value"
}
]
},
"get_float": {
"name": "cvar.get_float",
"description": "Returns nil if called on a ConCommand.",
"args": []
},
"set_int": {
"name": "cvar.set_int",
"args": [
{
"name": "value",
"description": "Integer value"
}
]
},
"set_raw_int": {
"name": "cvar.set_raw_int",
"description": "This sets the integer value without changing the float and string values.",
"args": [
{
"name": "value",
"description": "Integer value"
}
]
},
"get_int": {
"name": "cvar.get_int",
"description": "Returns nil if called on a ConCommand.",
"args": []
},
"invoke_callback": {
"name": "cvar.invoke_callback",
"args": []
}
},
"globals": {
"realtime": {
"name": "globals.realtime",
"description": "Returns the local time in seconds.",
"args": []
},
"curtime": {
"name": "globals.curtime",
"description": "Returns the game time in seconds. This number is synchronized with the server.",
"args": []
},
"frametime": {
"name": "globals.frametime",
"description": "Returns the number of seconds elapsed during the last game frame.",
"args": []
},
"absoluteframetime": {
"name": "globals.absoluteframetime",
"description": "Returns the number of seconds elapsed during the last game frame.",
"args": []
},
"maxplayers": {
"name": "globals.maxplayers",
"description": "Returns the maximum number of players in the server.",
"args": []
},
"tickcount": {
"name": "globals.tickcount",
"description": "Returns the number of ticks elapsed in the server.",
"args": []
},
"tickinterval": {
"name": "globals.tickinterval",
"description": "Returns the time elapsed in one game tick in seconds.",
"args": []
},
"framecount": {
"name": "globals.framecount",
"description": "Returns the number of frames since the game started",
"args": []
},
"mapname": {
"name": "globals.mapname",
"description": "Returns the name of the loaded map, or nil if you are not in game.",
"args": []
},
"lastoutgoingcommand": {
"name": "globals.lastoutgoingcommand",
"description": "Returns the command number of the last outgoing command.",
"args": []
}
},
"entity": {
"get_local_player": {
"name": "entity.get_local_player",
"description": "Returns the entity index for the local player, or nil on failure.",
"args": []
},
"get_all": {
"name": "entity.get_all",
"description": "Returns an array of entity indices. Pass no arguments for all entities.",
"args": [
{
"name": "classname",
"description": "Optional string that specifies the class name of entities that will be added to the list, for example \"CCSPlayer\"."
}
]
},
"get_players": {
"name": "entity.get_players",
"description": "Returns an array of player entity indices. Dormant and dead players will not be added to the list.",
"args": [
{
"name": "enemies_only",
"description": "Optional. If true then you and the players on your team will not be added to the list."
}
]
},
"get_game_rules": {
"name": "entity.get_game_rules",
"description": "Returns entity index of CCSGameRulesProxy instance, or nil if none exists.",
"args": []
},
"get_player_resource": {
"name": "entity.get_player_resource",
"description": "Returns entity index of CCSPlayerResource instance, or nil if none exists.",
"args": []
},
"get_classname": {
"name": "entity.get_classname",
"description": "Returns the name of the entity's class, or nil on failure.",
"args": [
{
"name": "ent",
"description": "Entity index."
}
]
},
"set_prop": {
"name": "entity.set_prop",
"args": [
{
"name": "ent",
"description": "Entity index."
},
{
"name": "propname",
"description": "Name of the networked property."
},
{
"name": "value",
"description": "The property will be set to this value. For vectors or angles, separate the components by commas."
},
{
"name": "array_index",
"description": "Optional. If propname is an array, the value at this array index will be set."
}
]
},
"get_prop": {
"name": "entity.get_prop",
"description": "Returns the value of the property, or nil on failure. For vectors or angles, this returns three values.",
"args": [
{
"name": "ent",
"description": "Entity index."
},
{
"name": "propname",
"description": "Name of the networked property."
},
{
"name": "array_index",
"description": "Optional. If propname is an array, the value at this array index will be returned."
}
]
},
"is_enemy": {
"name": "entity.is_enemy",
"description": "Returns true if the entity is on the other team.",
"args": [
{
"name": "ent",
"description": "Entity index."
}
]
},
"is_alive": {
"name": "entity.is_alive",
"description": "Returns true if the player is not dead.",
"args": [
{
"name": "ent",
"description": "Entity index."
}
]
},
"is_dormant": {
"name": "entity.is_dormant",
"description": "Returns true if the player is not dormant.",
"args": [
{
"name": "ent",
"description": "Entity index."
}
]
},
"get_player_name": {
"name": "entity.get_player_name",
"description": "Returns the player's name, or the string \"unknown\" on failure.",
"args": [
{
"name": "ent",
"description": "Player entity index."
}
]
},
"get_player_weapon": {
"name": "entity.get_player_weapon",
"description": "Returns the entity index of the player's active weapon, or nil if the player is not alive, dormant, etc.",
"args": [
{
"name": "ent",
"description": "Player entity index."
}
]
},
"hitbox_position": {
"name": "entity.hitbox_position",
"description": "Returns world coordinates x, y, z, or nil on failure.",
"args": [
{
"name": "player",
"description": "Entity index of the player."
},
{
"name": "hitbox",
"description": "Either a string of the hitbox name, or an integer index of the hitbox."
}
]
},
"get_steam64": {
"name": "entity.get_steam64",
"description": "Returns steamID3, or nil on failure.",
"args": [
{
"name": "player",
"description": "Entity index of the player."
}
]
},
"get_bounding_box": {
"name": "entity.get_bounding_box",
"description": "Returns x1, y1, x2, y2, alpha_multiplier. The contents of x1, y1, x2, y2 must be ignored when alpha_multiplier is zero, which indicates that the bounding box is invalid and should not be drawn.",
"args": [
{
"name": "player",
"description": "Entity index of the player."
}
]
}
},
"client": {
"set_event_callback": {
"name": "client.set_event_callback",
"description": "Raises an error and prints a message in console upon failure.",
"args": [
{
"name": "event_name",
"description": "Name of the event."
},
{
"name": "callback",
"description": "Lua function to call when this event occurs."
}
]
},
"log": {
"name": "client.log",
"args": [
{
"name": "msg",
"description": "The message"
},
{
"name": "...",
"description": "Optional comma-separated arguments to concatenate with msg."
}
]
},
"color_log": {
"name": "client.color_log",
"args": [
{
"name": "r",
"description": "Red (0-255)"
},
{
"name": "g",
"description": "Red (0-255)"
},
{
"name": "b",
"description": "Red (0-255)"
},
{
"name": "msg",
"description": "The message"
},
{
"name": "...",
"description": "Optional comma-separated arguments to concatenate with msg."
}
]
},
"exec": {
"name": "client.exec",
"args": [
{
"name": "cmd",
"description": "The console command(s) to execute."
},
{
"name": "...",
"description": "Optional comma-separated arguments to concatenate with cmd."
}
]
},
"userid_to_entindex": {
"name": "client.userid_to_entindex",
"description": "Returns the entity index, or 0 on failure.",
"args": [
{
"name": "userid",
"description": "This is given by some game events."
}
]
},
"draw_debug_text": {
"name": "client.draw_debug_text",
"description": "Avoid calling this during the paint event.",
"args": [
{
"name": "x",
"description": "Position in world space"
},
{
"name": "y",
"description": "Position in world space"
},
{
"name": "z",
"description": "Position in world space"
},
{
"name": "line_offset",
"description": "Used for vertical alignment, use 0 for the first line."
},
{
"name": "duration",
"description": "Time in seconds that the text will remain on the screen."
},
{
"name": "r",
"description": "Red (1-255)"
},
{
"name": "g",
"description": "Green (1-255)"
},
{
"name": "b",
"description": "Blue (1-255)"
},
{
"name": "a",
"description": "Alpha (1-255)"
},
{
"name": "...",
"description": "The text that will be drawn"
}
]
},
"draw_hitboxes": {
"name": "client.draw_hitboxes",
"description": "Draws hitbox overlays. Avoid calling this during the paint event.",
"args": [
{
"name": "entindex",
"description": "Entity index"
},
{
"name": "duration",
"description": "Time in seconds"
},
{
"name": "hitboxes",
"description": "Either the hitbox index, an array of hitbox indices, or 19 for all hitboxes"
},
{
"name": "r",
"description": "Red (1-255)"
},
{
"name": "g",
"description": "Green (1-255)"
},
{
"name": "b",
"description": "Blue (1-255)"
},
{
"name": "a",
"description": "Alpha (1-255)"
},
{
"name": "tick",
"description": "Optional integer"
}
]
},
"random_int": {
"name": "client.random_int",
"description": "Returns a random integer between minimum and maximum.",
"args": [
{
"name": "minimum",
"description": "Lowest possible result"
},
{
"name": "maximum",
"description": "Highest possible result"
}
]
},
"random_float": {
"name": "client.random_float",
"description": "Returns a random float between minimum and maximum.",
"args": [
{
"name": "minimum",
"description": "Lowest possible result"
},
{
"name": "maximum",
"description": "Highest possible result"
}
]
},
"screen_size": {
"name": "client.screen_size",
"description": "Returns (width, height).",
"args": []
},
"visible": {
"name": "client.visible",
"description": "Returns true if the position is visible. For example, you could use a player's origin to see if they are visible.",
"args": [
{
"name": "x",
"description": "Position in world space"
},
{
"name": "y",
"description": "Position in world space"
},
{
"name": "z",
"description": "Position in world space"
}
]
},
"trace_line": {
"name": "client.trace_line",
"description": "Returns fraction, entindex. fraction is a percentage in the range [0.0, 1.0] that tells you how far the trace went before hitting something, so 1.0 means nothing was hit. entindex is the entity index that hit, or -1 if no entity was hit.",
"args": [
{
"name": "skip_entindex",
"description": "Ignore this entity while tracing"
},
{
"name": "from_x",
"description": "Position in world space"
},
{
"name": "from_y",
"description": "Position in world space"
},
{
"name": "from_z",
"description": "Position in world space"
},
{
"name": "to_x",
"description": "Position in world space"
},
{
"name": "to_y",
"description": "Position in world space"
},
{
"name": "to_z",
"description": "Position in world space"
}
]
},
"trace_bullet": {
"name": "client.trace_bullet",
"description": "Returns entindex, damage. Entindex is nil when no player is hit.",
"args": [
{
"name": "from_player",
"description": "Entity index of the player whose weapon will be used for this trace"
},
{
"name": "from_x",
"description": "Position in world space"
},
{
"name": "from_y",
"description": "Position in world space"
},
{
"name": "from_z",
"description": "Position in world space"
},
{
"name": "to_x",
"description": "Position in world space"
},
{
"name": "to_y",
"description": "Position in world space"
},
{
"name": "to_z",
"description": "Position in world space"
}
]
},
"scale_damage": {
"name": "client.scale_damage",
"description": "Returns adjusted damage for the specified hitgroup",
"args": [
{
"name": "entindex",
"description": "Player entity index"
},
{
"name": "hitgroup",
"description": "Hit group index"
},
{
"name": "damage",
"description": "Damage"
}
]
},
"delay_call": {
"name": "client.delay_call",
"args": [
{
"name": "delay",
"description": "Time in seconds to wait before calling callback."
},
{
"name": "callback",
"description": "The lua function that will be called after delay seconds."
},
{
"name": "...",
"description": "Optional arguments that will be passed to the callback."
}
]
},
"latency": {
"name": "client.latency",
"description": "Returns your latency in seconds.",
"args": []
},
"real_latency": {
"description": "Returns your current real latency, regardless of ping spike."
},
"camera_angles": {
"name": "client.camera_angles",
"description": "Set camera angles",
"args": [
{
"name": "pitch",
"description": "Optional. If set, pitch that your camera angles will be set to"
},
{
"name": "yaw",
"description": "Optional. If set, pitch that your camera angles will be set to"
}
]
},
"timestamp": {
"name": "client.timestamp",
"description": "Returns high precision timestamp in milliseconds.",
"args": []
},
"eye_position": {
"name": "client.eye_position",
"description": "Returns x, y, z world coordinates of the local player's eye position, or nil on failure.",
"args": []
},
"set_clan_tag": {
"name": "client.set_clan_tag",
"description": "The clan tag is removed if no argument is passed or if it is an empty string. Additional arguments will be concatenated similar to client.log.",
"args": [
{
"name": "...",
"description": "The text that will be drawn"
}
]
},
"system_time": {
"name": "client.system_time",
"args": []
},
"reload_active_scripts": {
"name": "client.reload_active_scripts",
"description": "Reloads all scripts the following frame.",
"args": []
},
"request_full_update": {
"name": "client.request_full_update",
"description": "Request cl_fullupdate and update all networked stuff.",
"args": []
}
},
"ui": {
"new_checkbox": {
"name": "ui.new_checkbox",
"description": "Returns a special value that can be passed to ui.get and ui.set, or throws an error on failure.",
"args": [
{
"name": "tab",
"description": "The name of the tab: AA, RAGE, LEGIT, MISC, PLAYERS, SKINS, or VISUALS."
},
{
"name": "container",
"description": "The name of the existing container to which this control will be added."
},
{
"name": "name",
"description": "The name of the checkbox."
}
]
},
"new_slider": {
"name": "ui.new_slider",
"description": "Returns a special value that can be passed to ui.get and ui.set, or throws an error on failure.",
"args": [
{
"name": "tab",
"description": "The name of the tab: AA, RAGE, LEGIT, MISC, PLAYERS, SKINS, or VISUALS."
},
{
"name": "container",
"description": "The name of the existing container to which this control will be added."
},
{
"name": "name",
"description": "The name of the slider."
},
{
"name": "min",
"description": "The minimum value that can be set using the slider."
},
{
"name": "max",
"description": "The maximum value that can be set using the slider."
},
{
"name": "init_value",
"description": "Optional integer. The initial value. If not provided, the initial value will be min."
},
{
"name": "show_tooltip",
"description": "Optional boolean. true if the slider should display its current value."
},
{
"name": "unit",
"description": "Optional string that is two characters or less. This will be appended to the display value. For example, \"px\" for pixels or \"%\" for a percentage."
},
{
"name": "scale",
"description": "Optional The display value will be multiplied by this scale. For example, 0.1 will make a slider with the range [0-1800] show as 0.0-180.0 with one decimal place."
},
{
"name": "tooltips",
"description": "Optional table used to override the tooltip for the specified values. The key must be within min-max. The value is a string that will be shown instead of the numeric value whenever that value is selected."
}
]
},
"new_combobox": {
"name": "ui.new_combobox",
"description": "Returns a special value that can be passed to ui.get and ui.set, or throws an error on failure.",
"args": [
{
"name": "tab",
"description": "The name of the tab: AA, RAGE, LEGIT, MISC, PLAYERS, SKINS, or VISUALS."
},
{
"name": "container",
"description": "The name of the existing container to which this control will be added."
},
{
"name": "name",
"description": "The name of the combobox."
},
{
"name": "...",
"description": "One or more comma separated string values that will be added to the combobox. Alternatively, a table of strings that will be added."
}
]
},
"new_multiselect": {
"name": "ui.new_multiselect",
"description": "Returns a special value that can be passed to ui.get and ui.set, or throws an error on failure.",
"args": [
{
"name": "tab",
"description": "The name of the tab: AA, RAGE, LEGIT, MISC, PLAYERS, SKINS, or VISUALS."
},
{
"name": "container",
"description": "The name of the existing container to which this control will be added."
},
{
"name": "name",
"description": "The name of the multiselect."
},
{
"name": "...",
"description": "One or more comma separated string values that will be added to the combobox. Alternatively, a table of strings that will be added."
}
]
},
"new_hotkey": {
"name": "ui.new_hotkey",
"description": "Returns a special value that can be passed to ui.get to see if the hotkey is pressed, or throws an error on failure.",
"args": [
{
"name": "tab",
"description": "The name of the tab: AA, RAGE, LEGIT, MISC, PLAYERS, SKINS, or VISUALS."
},
{
"name": "container",
"description": "The name of the existing container to which this control will be added."
},
{
"name": "name",
"description": "The name of the hotkey."
},
{
"name": "inline",
"description": "Optional boolean. If set to true, the hotkey will be placed to the right of the preceding menu item."
}
]
},
"new_button": {
"name": "ui.new_button",
"description": "Throws an error on failure. The return value should not be used with ui.set or ui.get.",
"args": [
{
"name": "tab",
"description": "The name of the tab: AA, RAGE, LEGIT, MISC, PLAYERS, SKINS, or VISUALS."
},
{
"name": "container",
"description": "The name of the existing container to which this checkbox will be added."
},
{
"name": "name",
"description": "The name of the button."
},
{
"name": "callback",
"description": "The lua function that will be called when the button is pressed."
}
]
},
"new_color_picker": {
"name": "ui.new_color_picker",
"description": "Throws an error on failure. The color picker is placed to the right of the previous menu item.",
"args": [
{
"name": "tab",
"description": "The name of the tab: AA, RAGE, LEGIT, MISC, PLAYERS, SKINS, or VISUALS."
},
{
"name": "container",
"description": "The name of the existing container to which this checkbox will be added."
},
{
"name": "name",
"description": "The name of the color picker. This will not be shown, it is only used to identify this item in saved configs."
},
{
"name": "r",
"description": "Optional initial red value (0-255)"
},
{
"name": "g",
"description": "Optional initial green value (0-255)"
},
{
"name": "b",
"description": "Optional initial blue value (0-255)"
},
{
"name": "a",
"description": "Optional initial alpha value (0-255)"
}
]
},
"new_textbox": {
"name": "ui.new_textbox",
"description": "Throws an error on failure. Returns a special value that can be used with ui.get",
"args": [
{
"name": "tab",
"description": "The name of the tab: AA, RAGE, LEGIT, MISC, PLAYERS, SKINS, or VISUALS."
},
{
"name": "container",
"description": "The name of the existing container to which this textbox will be added."
},
{
"name": "name",
"description": "The name of the menu item."
}
]
},
"reference": {
"name": "ui.reference",
"description": "Avoid calling this from inside a function. Returns a reference that can be passed to ui.get and ui.set, or throws an error on failure. This allows you to access a built-in pre-existing menu items. This function returns multiple values when the specified menu item is followed by unnamed menu items, for example a color picker or a hotkey.",
"args": [
{
"name": "tab",
"description": "The name of the tab: AA, RAGE, LEGIT, MISC, PLAYERS, SKINS, or VISUALS."
},
{
"name": "container",
"description": "The name of the existing container to which this checkbox will be added."
},
{
"name": "name",
"description": "The name of the menu item."
}
]
},
"set": {
"name": "ui.set",
"description": "For checkboxes, pass true or false. For a slider, pass a number that is within the slider's minimum/maximum values. For a combobox, pass a string value. For a multiselect combobox, pass zero or more strings. For referenced buttons, param is ignored and the button's callback is invoked. For color pickers, pass the arguments r, g, b, a.",
"args": [
{
"name": "item",
"description": "The result of either ui.new_checkbox, ui.new_slider, or ui.reference."
},
{
"name": "value",
"description": "The value to which the menu item will be set."
},
{
"name": "...",
"description": "Optional. For multiselect comboboxes, you may want to set more than one option."
}
]
},
"get": {
"name": "ui.get",
"description": "For a checkbox, returns true or false. For a slider, returns an integer. For a combobox, returns a string. For a multiselect combobox, returns an array of strings. For a hotkey, returns true if the hotkey is active. For a color picker, returns r, g, b, a. Throws an error on failure.",
"args": [
{
"name": "item",
"description": "The special value returned by ui.new_checkbox, ui.new_slider, ui.new_combobox, ui.new_hotkey, or ui.reference."
}
]
},
"set_callback": {
"name": "ui.set_callback",
"args": [
{
"name": "item",
"description": "The special value returned by ui.new_*. Do not try passing a reference to an existing menu item."
},
{
"name": "callback",
"description": "Lua function that will be called when the menu item changes values. For example, this will be called when the user checks or unchecks a checkbox."
}
]
},
"set_visible": {
"name": "ui.set_visible",
"args": [
{
"name": "item",
"description": "A menu item reference."
},
{
"name": "visible",
"description": "Boolean. Pass false to hide the control from the menu."
}
]
},
"update": {
"name": "ui.update",
"description": "Change current values for e.g. in listbox to passed.",
"args": [
{
"name": "item",
"description": "A menu item reference."
},
{
"name": "...",
"description": "New values for e.g. listbox. Can be passed comma separated values or just table."
}
]
},
"is_menu_open": {
"name": "ui.is_menu_open",
"description": "Returns true if the menu is currently open.",
"args": []
},
"mouse_position": {
"name": "ui.mouse_position",
"description": "Returns current mouse coordinates x, y",
"args": []
}
},
"renderer": {
"text": {
"name": "renderer.text",
"description": "This can only be called from the paint callback.",
"args": [
{
"name": "x",
"description": "Screen coordinate"
},
{
"name": "y",
"description": "Screen coordinate"
},
{
"name": "r",
"description": "Red (1-255)"
},
{
"name": "g",
"description": "Green (1-255)"
},
{
"name": "b",
"description": "Blue (1-255)"
},
{
"name": "a",
"description": "Alpha (1-255)"
},
{
"name": "flags",
"description": "\"+\" for large text, \"-\" for small text, \"c\" for centered text, \"r\" for right-aligned text, \"b\" for bold text. \"c\" can be combined with other flags. nil can be specified for normal sized uncentered text."
},
{
"name": "max_width",
"description": "Text will be clipped if it exceeds this width in pixels. Use 0 for no limit."