forked from FAForever/fa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUser.lua
1301 lines (1093 loc) · 29.4 KB
/
User.lua
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
---@meta
---@class UIHighlightedCommand
---@field x number
---@field y number
---@field z number
---@field targetId? EntityId
---@field blueprintId? UnitId
---@field commandType number
---@alias SubmergeStatus
---| -1 # submerged
---| 0 # unknown
---| 1 # not submerged
---@alias FireState
---| 0 # Return fire
---| 1 # Hold fire
---| 2 # Ground fire
---@alias Keycode
--- | 'BACK'
--- | 'TAB'
--- | 'RETURN'
--- | 'ESCAPE'
--- | 'SPACE'
--- | 'DELETE'
--- | 'START'
--- | 'LBUTTON'
--- | 'RBUTTON'
--- | 'CANCEL'
--- | 'MBUTTON'
--- | 'CLEAR'
--- | 'SHIFT'
--- | 'ALT'
--- | 'CONTROL'
--- | 'MENU'
--- | 'PAUSE'
--- | 'CAPITAL'
--- | 'PRIOR'
--- | 'NEXT'
--- | 'END'
--- | 'HOME'
--- | 'LEFT'
--- | 'UP'
--- | 'RIGHT'
--- | 'DOWN'
--- | 'SELECT'
--- | 'PRINT'
--- | 'EXECUTE'
--- | 'SNAPSHOT'
--- | 'INSERT'
--- | 'HELP'
--- | 'NUMPAD0'
--- | 'NUMPAD1'
--- | 'NUMPAD2'
--- | 'NUMPAD3'
--- | 'NUMPAD4'
--- | 'NUMPAD5'
--- | 'NUMPAD6'
--- | 'NUMPAD7'
--- | 'NUMPAD8'
--- | 'NUMPAD9'
--- | 'MULTIPLY'
--- | 'ADD'
--- | 'SEPARATOR'
--- | 'SUBTRACT'
--- | 'DECIMAL'
--- | 'DIVIDE'
--- | 'F1'
--- | 'F2'
--- | 'F3'
--- | 'F4'
--- | 'F5'
--- | 'F6'
--- | 'F7'
--- | 'F8'
--- | 'F9'
--- | 'F10'
--- | 'F11'
--- | 'F12'
--- | 'F13'
--- | 'F14'
--- | 'F15'
--- | 'F16'
--- | 'F17'
--- | 'F18'
--- | 'F19'
--- | 'F20'
--- | 'F21'
--- | 'F22'
--- | 'F23'
--- | 'F24'
--- | 'NUMLOCK'
--- | 'SCROLL'
--- | 'PAGEUP'
--- | 'PAGEDOWN'
--- | 'NUMPAD_SPACE'
--- | 'NUMPAD_TAB'
--- | 'NUMPAD_ENTER'
--- | 'NUMPAD_F1'
--- | 'NUMPAD_F2'
--- | 'NUMPAD_F3'
--- | 'NUMPAD_F4'
--- | 'NUMPAD_HOME'
--- | 'NUMPAD_LEFT'
--- | 'NUMPAD_UP'
--- | 'NUMPAD_RIGHT'
--- | 'NUMPAD_DOWN'
--- | 'NUMPAD_PRIOR'
--- | 'NUMPAD_PAGEUP'
--- | 'NUMPAD_NEXT'
--- | 'NUMPAD_PAGEDOWN'
--- | 'NUMPAD_END'
--- | 'NUMPAD_BEGIN'
--- | 'NUMPAD_INSERT'
--- | 'NUMPAD_DELETE'
--- | 'NUMPAD_EQUAL'
--- | 'NUMPAD_MULTIPLY'
--- | 'NUMPAD_ADD'
--- | 'NUMPAD_SEPARATOR'
--- | 'NUMPAD_SUBTRACT'
--- | 'NUMPAD_DECIMAL'
--- | 'NUMPAD_DIVIDE'
--- Repeatedly the selection box of the unit to the hovered-over state to create a blinking effect
---@param entityId EntityId
---@param onTime number
---@param offTime number
---@param totalTime number
function AddBlinkyBox(entityId, onTime, offTime, totalTime)
end
---
---@param meshInfo MeshInfo
---@param duration number
function AddCommandFeedbackBlip(meshInfo, duration)
end
---
---@param func fun(text: string): any
function AddConsoleOutputReciever(func)
end
---
---@param control Control
function AddInputCapture(control)
end
---
---@param selection UserUnit[]
function AddSelectUnits(selection)
end
--- Adds unit to the session extra select list
---@param unit UserUnit
function AddToSessionExtraSelectList(unit)
end
--- Returns `true` if there is anything currently on the capture stack
---@return boolean
function AnyInputCapture()
end
--- Clears and disables the build templates
function ClearBuildTemplates()
end
---
function ClearCurrentFactoryForQueueDisplay()
end
--- Destroys all controls in frame, `nil` head will clear all frames
---@param head number | nil
function ClearFrame(head)
end
--- Clears the session extra select list
function ClearSessionExtraSelectList()
end
--- Performs a console command
---@param command string
function ConExecute(command)
end
--- Performs a console command, saved to stack
---@param command string
function ConExecuteSave(command)
end
--- Gets console commands that `text` can auto-complete to
---@param text string
---@return string[]
function ConTextMatches(text)
end
--- Copies the current replay to another file
---@param profile string
---@param newFilename FileName
function CopyCurrentReplay(profile, newFilename)
end
---Copies given string to clipboard, returns true if succeeded
---@param s string
---@return boolean
function CopyToClipboard(s)
end
--- Creates a Unit AtMouse
---@param blueprintId string
---@param ownerArmyIndex number
---@param offsetMouseWorldPosX number
---@param offsetMouseWorldPosZ number
---@param rotation number
---@return UserUnit
function CreateUnitAtMouse(blueprintId, ownerArmyIndex, offsetMouseWorldPosX, offsetMouseWorldPosZ, rotation)
end
--- Gets the current time in seconds, counting from 0 at application start.
--- This is wall-clock time and is unaffected by gameplay.
---@return number
function CurrentTime()
end
--- Returns `true` if debug facilities are enabled
---@return boolean
function DebugFacilitiesEnabled()
end
---
---@param queueIndex number
---@param count number
function DecreaseBuildCountInQueue(queueIndex, count)
end
---Deletes a command from the player command queue.
---Each player has an array that holds all commands for all units, the commandID indexes to that array.
---Note: this function doesn't receive any units as arguments--you will have to retrieve the commandId by UserUnit:GetCommandQueue()[commandIndex].ID
---@param commandId number commandId, from UserUnit:GetCommandQueue()[commandIndex].ID
function DeleteCommand(commandId)
end
---
function DisableWorldSounds()
end
--- Ejects another client from your session
---@param clientIndex number
function EjectSessionClient(clientIndex)
end
---
function EnableWorldSounds()
end
--- Kills current UI and starts main menu from top
function EngineStartFrontEndUI()
end
--- Kills current UI and starts splash screens
function EngineStartSplashScreens()
end
--- Filters a list of units to exclude from those found in the category
---@param category EntityCategory
---@param units UserUnit[]
---@return UserUnit[]
function EntityCategoryFilterOut(category, units)
end
--- Executes some Lua code in the sim. Requires cheats to be enabled
---@param func function
---@param value any
function ExecLuaInSim(func, value)
end
--- Requests that the application shut down
function ExitApplication()
end
--- Quits the sim, but not the app
function ExitGame()
end
--- Flushes mouse/keyboard events
function FlushEvents()
end
--- Formats a string displaying the time specified in seconds
---@param seconds number
---@return string
function FormatTime(seconds)
end
--- Gets the current game time in ticks. The game time is the simulation time,
--- that stops when the game is paused.
---@return number
function GameTick()
end
--- Gets the current game time in seconds. The game time is the simulation time,
--- that stops when the game is paused.
---@return number
function GameTime()
end
--- Generates and enables build templates from the current selection
function GenerateBuildTemplateFromSelection()
end
--- Gets active build template back to Lua
---@return UIBuildTemplate
function GetActiveBuildTemplate()
end
---
---@return number[]
function GetAntiAliasingOptions()
end
---
--- Note that this is cached by `/lua/ui/override/ArmiesTable.lua`
---@return ArmiesTable
function GetArmiesTable()
end
--- Returns a table of avatar units for the army
---@return UserUnit[]
function GetArmyAvatars()
end
--- It is unknown where this result gets pulled from
---@param armyIndex number
---@return number
function GetArmyScore(armyIndex)
end
--- Gets a list of units assisting me
---@param units UserUnit[]
---@return UserUnit[]
function GetAssistingUnitsList(units)
end
--- Gets a list of units blueprint attached to transports
---@param units UserUnit[]
---@return UserUnit[]
function GetAttachedUnitsList(units)
end
---
---@param name string
---@return Camera
function GetCamera(name)
end
--- Gets the "arguments" (tokens split by spaces) that follow a commandline option,
--- disregarding if they start with `/` like other commandline options.
--- Returns `false` if there are not `maxArgs` tokens after the `option`.
---@see GetCommandLineArgTable(option) for parsing key-values
---@param option string
---@param maxArgs number
---@return string[] | false
function GetCommandLineArg(option, maxArgs)
end
--- Returns 'splash', 'frontend', or 'game' depending on the current state of the UI
---@return 'splash' | 'frontend' | 'game' | 'none'
function GetCurrentUIState()
end
---
---@return UICursor
function GetCursor()
end
--- Gets the player's economy totals, for things such as resources `reclaimed` or `income`
---@return EconomyTotals
function GetEconomyTotals()
end
--- Gets the right fire state for the units passed in
---@param units UserUnit[]
---@return FireState
function GetFireState(units)
end
--- Returns the root UI frame for a given head
---@param head number
---@return Frame
function GetFrame(head)
end
---
---@param key string
---@return any
function GetFrontEndData(key)
end
--- Returns the current game speed
---@return number
function GetGameSpeed()
end
--- Returns a formatted string displaying the time the game has been played
---@return string
function GetGameTime()
end
--- Returns information about the command of the command graph that is below the cursor
---@return UIHighlightedCommand?
function GetHighlightCommand()
end
--- Returns a table of idle engineer units for the army
---@return UserUnit[]
function GetIdleEngineers()
end
--- Returns a table of idle factory units for the army
---@return UserUnit[]
function GetIdleFactories()
end
--- Returns the current capture control, or `nil` if none
---@returns Control | nil
function GetInputCapture()
end
--- Sees if any units in the list are auto-building
---@param units UserUnit[]
---@return boolean
function GetIsAutoMode(units)
end
--- Sees if any units in the list are auto-surfacing
---@param units UserUnit[]
---@return boolean
function GetIsAutoSurfaceMode(units)
end
--- Sees if any units in the list are paused
---@param units UserUnit[]
---@return boolean
function GetIsPaused(units)
end
--- Returns a boolean that indicates the unit is paused
---@param unit UserUnit[]
---@return boolean
function GetIsPausedOfUnit(unit)
end
--- Sees if any units in the list are submerged
---@param units UserUnit[]
---@return SubmergeStatus
function GetIsSubmerged(units)
end
---
---@return Vector2
function GetMouseScreenPos()
end
---
---@return Vector
function GetMouseWorldPos()
end
---
---@return number
function GetMovieVolume()
end
--- Returns the current number of root frames (typically one per head)
---@return number
function GetNumRootFrames()
end
---
---@param key string
---@return string[]
function GetOptions(key)
end
--- Retrieves a value in the memory-stored preference file. The value retrieved is a deep copy of what resides in the actual
--- preference file. Therefore this function can be expensive to use directly - if you're not careful you may be allocating
--- kilobytes worth of data!
---
--- You're encouraged to use `/lua/user/prefs.lua` to interact with the preference file.
---@param string string
---@param default any?
---@return any
function GetPreference(string, default)
end
---
---@return boolean
function GetResourceSharing()
end
--- Gets the rollover information about the unit the cursor is currently hovered over.
--- The output of this function is replicated by `/lua/keymap/selectedinfo.lua#GetUnitRolloverInfo`
--- for any unit.
---@return RolloverInfo
function GetRolloverInfo()
end
--- Gets the state for the script bit
---@param unit UserUnit
---@param bit number
---@return boolean
function GetScriptBit(unit, bit)
end
--- Returns a table of the currently selected units
---@return UserUnit[]
function GetSelectedUnits()
end
--- Returns a table of the various clients in the current session.
--- Note that this is cached by `/lua/ui/override/SessionClients.lua`
---@return Client[]
function GetSessionClients()
end
---
---@return number
function GetSimRate()
end
---
---@return number
function GetSimTicksPerSecond()
end
--- Gets information on a profile based file, `nil` if unable to find
---@param profileName string
---@param basename string
---@param type string
---@return table
function GetSpecialFileInfo(profileName, basename, type)
end
--- Given the base name of a special file, returns the complete path
---@param profilename string
---@param filename string
---@param type string
---@return string
function GetSpecialFilePath(profilename, filename, type)
end
--- Returns a table of strings which are the names of files in special locations (currently SaveFile, Replay)
---@param type string
---@return { extension: string, directory: string, files: table<string, string[]> }
function GetSpecialFiles(type)
end
---
---@param type string
---@return string
function GetSpecialFolder(type)
end
--- Returns a formatted string displaying the System time
---@return string
function GetSystemTime()
end
--- Returns System time in seconds
---@return number
function GetSystemTimeSeconds()
end
---
---@param filename string
---@param border number? defaults to 1
---@return number width
---@return number height
function GetTextureDimensions(filename, border)
end
--- Gets the alpha multiplier for 2D UI controls
---@return number
function GetUIControlsAlpha()
end
--- Given a set of units, gets the union of orders and unit categories (for determining builds). You can use `GetUnitCommandFromCommandCap` to convert the toggles to unit commands
---@param unitSet any
---@return string[] orders
---@return CommandCap[] availableToggles
---@return EntityCategory buildableCategories
function GetUnitCommandData(unitSet)
end
--- Retrieves the orders, toggles and buildable categories of the given unit. You can use `GetUnitCommandFromCommandCap` to convert the toggles to unit commands
---@param unit any
---@return string[] orders
---@return CommandCap[] availableToggles
---@return EntityCategory buildableCategories
function GetUnitCommandDataOfUnit(unit)
end
--- Givens a `RULEUCC` type command, return the equivalent `UNITCOMMAND` command.
--- See `/lua/ui/game/commandgraphparams.lua#CommandGraphParams`.
---@param rule CommandCap
---@return string
function GetUnitCommandFromCommandCap(rule)
end
--- Return a table of the currently selected units
---@return UserUnit[]
function GetValidAttackingUnits()
end
---
---@param category string
---@return number
function GetVolume(category)
end
---@return boolean
function GpgNetActive()
end
---@param command string
---@param ... number | string
function GpgNetSend(command, ...)
end
---
---@return boolean
function HasCommandLineArg(option)
end
--- Add a set of key mappings
---@param keyMapTable table<string, string>
function IN_AddKeyMapTable(keyMapTable)
end
--- Clear all key mappings
function IN_ClearKeyMap()
end
--- Remove the keys from the key map
---@param keyMapTable table<string, string>
function IN_RemoveKeyMapTable(keyMapTable)
end
---
---@param queueIndex any
---@param count number
function IncreaseBuildCountInQueue(queueIndex, count)
end
--- For internal use by `Bitmap.__init()`
---@param bitmap Bitmap
---@param parent Control
function InternalCreateBitmap(bitmap, parent)
end
--- For internal use by `Border.__init()`
---@param border Border
---@param parent Control
function InternalCreateBorder(border, parent)
end
--- For internal use by `CreateDiscoveryService()`
---@param serviceClass fa-class
---@return UILobbyDiscoveryService
function InternalCreateDiscoveryService(serviceClass)
end
--- For internal use by `Dragger.__init()`
---@param dragger Dragger
function InternalCreateDragger(dragger)
end
--- For internal use by `Edit.__init()`
---@param edit Edit
---@param parent Control
function InternalCreateEdit(edit, parent)
end
--- For internal use by `Frame.__init()`
---@param frame Frame
function InternalCreateFrame(frame)
end
--- For internal use by `Group.__init()`
---@param group Group
---@param parent Control
function InternalCreateGroup(group, parent)
end
--- For internal use by `Histogram.__init()`
---@param histogram Histogram
---@param parent Control
function InternalCreateHistogram(histogram, parent)
end
--- For internal use by `ItemList.__init()`
---@param itemList ItemList
---@param parent Control
function InternalCreateItemList(itemList, parent)
end
---@alias UILobbyProtocols "UDP" | "TCP" | "None
--- For internal use by `CreateLobbyComm()`
---@generic T
---@param lobbyComClass T
---@param protocol UILobbyProtocols
---@param localPort number
---@param maxConnections number
---@param playerName string
---@param playerUID? string
---@param natTraversalProvider? userdata
---@return T
function InternalCreateLobby(lobbyComClass, protocol, localPort, maxConnections, playerName, playerUID, natTraversalProvider)
end
--- For internal use by `MapPreview.__init()`
---@param mapPreview MapPreview
---@param parent Control
function InternalCreateMapPreview(mapPreview, parent)
end
--- For internal use by `Mesh.__init()`
---@param mesh Mesh
---@param parent Control
function InternalCreateMesh(mesh, parent)
end
--- For internal use by `Movie.__init()`
---@param movie Movie
---@param parent Control
function InternalCreateMovie(movie, parent)
end
--- For internal use by `ScrollBar.__init()`
---@param scrollBar Scrollbar
---@param parent Control
---@param axis ScrollAxis found in `/lua/scrollbar.lua#ScrollAxis`
function InternalCreateScrollbar(scrollBar, parent, axis)
end
--- For internal use by `Text.__init()`. This adds the engine lazyvars
--- `FontAscent`, `FontDescent`, `FontExternalLeading`, and `TextAdvance`.
---@param text Text
---@param parent Control
function InternalCreateText(text, parent)
end
--- For internal use by `WldUIProvider.__init()`
---@param wldUIProvider WldUIProvider
function InternalCreateWldUIProvider(wldUIProvider)
end
--- For internal use by `WorldMesh.__init()`
---@param worldMesh WorldMesh
function InternalCreateWorldMesh(worldMesh)
end
--- Save the current session
---@param filename string
---@param friendlyname string
---@param oncompletion fun(worked: boolean, errmsg: string)
function InternalSaveGame(filename, friendlyname, oncompletion)
end
---
---@param keyCode string | number
---@return boolean
function IsKeyDown(keyCode)
end
---
---@param playerId string
---@return boolean
function IsObserver(playerId)
end
--- Issue a factory build or upgrade command to your selection
---@param command UserUnitBlueprintCommand
---@param blueprintid UnitId
---@param count number
---@param clear boolean? defaults to false
function IssueBlueprintCommand(command, blueprintid, count, clear)
end
--- Issue a factory build or upgrade command to the given units
---@see IssueBlueprintCommand
---@param units UserUnit[]
---@param command UserUnitBlueprintCommand
---@param blueprintid UnitId
---@param count number
---@param clear boolean? defaults to false
function IssueBlueprintCommandToUnits(units, command, blueprintid, count, clear)
end
--- Issue a factory build or upgrade command to the given unit
---@see IssueBlueprintCommand
---@param unit UserUnit
---@param command UserUnitBlueprintCommand
---@param blueprintid UnitId
---@param count number
---@param clear boolean? defaults to false
function IssueBlueprintCommandToUnit(unit, command, blueprintid, count, clear)
end
---
---@param command any
---@param string any?
---@param clear boolean?
function IssueCommand(command, string, clear)
end
---
---@param clear boolean
function IssueDockCommand(clear)
end
---
---@param unitList UserUnit[]
---@param command string
---@param string? string
---@param clear? boolean
function IssueUnitCommand(unitList, command, string, clear)
end
--- Given a MS Windows char code, returns the Maui char code
---@param charcode number
---@return number
function KeycodeMSWToMaui(charcode)
end
--- Given a char code from a key event, returns the MS Windows char code
---@param charcode number
---@return number
function KeycodeMauiToMSW(charcode)
end
---@deprecated
--- Will not work
function LaunchGPGNet()
end
--- Starts a replay of a given file, returns false if unable to launch
---@param filename string
---@return boolean
function LaunchReplaySession(filename)
end
--- Launch a new single player session
---@param sessionInfo UIScenarioInfo
function LaunchSinglePlayerSession(sessionInfo)
end
---
---@param filename string
---@return boolean
function LoadSavedGame(filename)
end
---
---@param blueprintId string
function MapBorderAdd(blueprintId)
end
---
function MapBorderClear()
end
--- Open the default browser window to the specified URL
---@param url string
function OpenURL(url)
end
---
---@param category string
---@param pause boolean
function PauseSound(category, pause)
end
---
---@param category string
---@param pause boolean
function PauseVoice(category, pause)
end
---
---@param sound SoundHandle
---@param prepareOnly? boolean
---@return SoundHandle
function PlaySound(sound, prepareOnly)
end
---
---@param params any
function PlayTutorialVO(params)
end
---
---@param sound SoundHandle
---@param duck? boolean
---@return SoundHandle
function PlayVoice(sound, duck)
end
--- Make `dragger` the active dragger from a particular frame.
--- You can pass `nil` to cancel the current dragger.
---@param originFrame Frame
---@param keycode 'LBUTTON' | 'MBUTTON' | 'RBUTTON'
---@param dragger Dragger | nil
function PostDragger(originFrame, keycode, dragger)
end
--- Start a background load with the given map and mods.
--- If `hipri` is true, this will interrupt any previous loads in progress.
---@param mapname string # path to the `scmap` file
---@param mods ModInfo[]
---@param hipri? boolean
function PrefetchSession(mapname, mods, hipri)
end
---
---@param handler function
function RemoveConsoleOutputReciever(handler)
end
--- Remove unit from the session extra select list
---@param unit UserUnit
function RemoveFromSessionExtraSelectList(unit)
end
--- Remove the control from the capture array (always first from back)
---@param control Control
function RemoveInputCapture(control)
end
--- Remove the profile directory and all special files
---@param profile string
function RemoveProfileDirectories(profile)
end
--- Remove a profile based file from the disc
---@param profilename string
---@param basename string
---@param type string
function RemoveSpecialFile(profilename, basename, type)
end
---
---@param render boolean
function RenderOverlayEconomy(render)
end
---
---@param render boolean
function RenderOverlayIntel(render)
end
---
---@param render boolean
function RenderOverlayMilitary(render)
end
--- Restart the current mission/skirmish/etc
function RestartSession()
end
--- Writes the preferences to disk to make it persistent. This is an expensive operation. The
--- game does this automatically when it exits, there should be no reason to call this manually.
---
--- You're encouraged to use `/lua/user/prefs.lua` to interact with the preference file.
function SavePreferences()
end
--- Select the specified units
---@param units UserUnit[]?
function SelectUnits(units)
end
--- Return true iff the active session can be restarted
---@return boolean
function SessionCanRestart()
end
--- End the current game session.
--- The session says active, we just disconnect from everyone else and freeze play.
function SessionEndGame()
end
--- Return a table of command sources
---@return string[]
function SessionGetCommandSourceNames()
end