-
Notifications
You must be signed in to change notification settings - Fork 0
/
LuaCATS.lua
500 lines (475 loc) · 15.6 KB
/
LuaCATS.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
---@meta
---@class Class
---@field _ctor fun(self, ...)
---@field _base Class
--#region Widget
---@class Widget:Class
---@field _ctor fun(self, name)
---@field children table[]
---@field callbacks table[]
---@field name string
---@field inst EntityScript
---@field enabled boolean
---@field shown boolean
---@field focus boolean
---@field focus_target boolean
---@field focus_flow table
---@field focus_flow_args table
---
---@field SetCenterAlignment function
---@field StartUpdating function
---@field StopUpdating function
---@field SetPosition function
---@field GetPosition function
---@field SetVAnchor function
---@field SetHAnchor function
---@field Show function
---@field Hide function
---@field OnRawKey function
---@field OnControl function
---@field OnMouseButton fun(self,button:integer, down:boolean, x:number, y:number):boolean
---@field GetDeepestFocus function
---@field SetScale function
---@field SetFocus fun(self)
---@field OnGainFocus fun(self)
---@field OnLoseFocus fun(self)
---@field Kill fun(self)
---@field IsEnabled fun():boolean
---@field GetLocalPosition fun():Vector3
---@field SetVAlign fun(self,integer)
---@field SetHAlign fun(self,integer)
---@field Enable fun(self)
---@field Disable fun(self)
---@field MoveToBack fun(self)
---@field MoveToFront fun(self)
Widget = {}
---@generic T
---@param child T
---@return T child
function Widget:AddChild(child) end
---@class UITransform
---@field SetScale function
---@field SetVAnchor function
---@field GetRotation function
---@field GetLocalPosition function
---@field SetPosition function
---@field SetMaxPropUpscale function
---@field SetScaleMode function
---@field UpdateTransform function
---@field SetHAnchor function
---@field SetRotation function
---@field GetScale function
---@field GetWorldPosition function
---@class TextWidget
---@field EnableWordWrap function
---@field SetVAnchor function
---@field SetColour function
---@field SetFont function
---@field SetHAnchor function
---@field GetString function
---@field GetRegionSize function
---@field SetString function
---@field SetSize function
---@field SetRegionSize function
---@field ShowEditCursor function
---@field SetHorizontalSqueeze function
---@class TextEditWidget
---@field SetAllowClipboardPaste fun(self,enable:boolean)
---@field SetPassword fun(self,enable:boolean)
---@field ShowEditCursor fun(self,enable:boolean)
---@field GetString fun(self):string
---@field SetString fun(self,str:string)
---@field OnKeyDown fun(self,key:integer)
---@field OnKeyUp fun(self,key:integer)
---@field OnTextInput fun(self,text:string)
---@class ImageWidget
---@field GetSize function
---@field SetBlendMode function
---@field SetVAnchor function
---@field SetTexture function
---@field SetTextureHandle function
---@field SetHAnchor function
---@field SetAlphaRange function
---@field SetTint function
---@field SetEffect function
---@field SetSize function
---@field SetEffectParams function
---@field SetUVScale function
---@field EnableEffectParams function
--#endregion
--#region components
---@class container
---@field GiveItem fun(self, item:Item, slot:integer, src_pos, drop_on_fail, skipsound)
--#endregion
--#region entity
---创建实体
---@return EntityScript
function CreateEntity() end
---@class entity
---@field GetGUID fun(self):integer
---@field GetCanSleep function
---@field AddRoadManager function
---@field AddMiniMap function
---@field AddMiniMapEntity function
---@field AddFollower function
---@field AddAnimState function
---@field AddFlooding function
---@field GetParent function
---@field RemoveTag function
---@field Show function
---@field SetParent function
---@field AddEnvelopeManager function
---@field SetClickable function
---@field AddStaticShadow function
---@field GetDebugString function
---@field AddSoundEmitter function
---@field AddLabel function
---@field AddPhysics function
---@field Retire function
---@field SetPrefabName function
---@field WorldToLocalSpace function
---@field IsValid function
---@field SetCanSleep function
---@field AddLight function
---@field LocalToWorldSpaceIncParen function
---@field GetPrefabName function
---@field AddTextEditWidget function
---@field SetSelected function
---@field AddTextWidget function
---@field AddPostProcessor function
---@field AddTag function
---@field AddInteriorManager function
---@field AddWaveComponent function
---@field Hide function
---@field LocalToWorldSpace function
---@field AddSplatManager function
---@field AddBroadcastingOptions function
---@field SetName function
---@field AddDebugRender function
---@field HasTag function
---@field AddLightWatcher function
---@field AddFloodingBlockerEntity function
---@field AddUITransform function
---@field AddFloodingEntity function
---@field AddGroundCreepEntity function
---@field AddGroundCreep function
---@field MoveToFront function
---@field SetAABB function
---@field CallPrefabConstructionCom function
---@field AddShadowManager function
---@field AddDynamicShadow function
---@field AddGraphicsOptions function
---@field AddCloudComponent function
---@field AddFontManager function
---@field AddParticleEmitter function
---@field MoveToBack function
---@field AddVideoWidget function
---@field GetName function
---@field AddImageWidget function
---@field AddMapGenSim function
---@field AddTransform function
---@field AddMapLayerManager function
---@field AddMap function
---@field AddPathfinder function
---@field IsAwake function
---@field IsVisible function
---@field __index table
---@class EntityScript
---@field entity entity
---@field name string|nil
---@field GUID integer
---@field components table
---@field spawntime integer
---@field age integer
---@field persists boolean
---@field inlimbo boolean
---@field data nil|table
---@field listeners nil|table
---@field updatecomponents nil|table
---@field inherentactions nil|table
---@field event_listeners nil|table
---@field event_listening nil|table
---@field pendingtasks nil|table
---@field children nil|table
---@field ininterior nil|boolean
---
---@field UITransform UITransform
---@field ImageWidget ImageWidget
---@field TextWidget TextWidget
---@field TextEditWidget TextEditWidget
---
---@field IsValid fun(self):boolean
---@field Remove fun(self)
---@field AddComponent fun(self, component:string)
---@field RemoveComponent fun(self, component:string)
---@field AddTag fun(self, tag:string)
---@field HasTag fun(self, tag:string):boolean
---@field RemoveTag fun(self, tag:string)
---@field ListenForEvent fun(self,envent:string,fn:fun(ent:EntityScript,data?:any),source?:table)
---@field PushEvent fun(self,event:string,data?:any)
---@field RemoveEventCallback fun(self,envent:string,fn:fun(ent:EntityScript,data?:any),source?:table)
---@field RemoveAllEventCallbacks fun(self)
---@field OnSave fun(self, data:table)
---@field OnLoad fun(self, data:table)
---@field _ctor function
---@field __tostring function
---@field is_a function
---
---@field IsActionValid function
---@field GetIsOnWater function
---@field SetPanelLongDescription function
---@field GetIsOnLand function
---@field GetSaveRecord function
---@field GetPanelLongDescription function
---@field LoadPostPass function
---@field IsPosSurroundedByLand function
---@field AddComponentAtRuntime function
---@field GetIsFlooded function
---@field StartThread function
---@field Teleport function
---@field CanDoAction function
---@field SetBrain function
---@field GetDistanceSqToPoint function
---@field RemoveFromScene function
---@field ResumeTask function
---@field GetHorzDistanceSqToInst function
---@field SetProfile function
---@field GetDebugString function
---@field CancelAllPendingTasks function
---@field GetIsWet function
---@field IsInLimbo function
---@field GetPanelDescriptions function
---@field SetPanelDescription function
---@field SetAddColour function
---@field GetPhysicsRadius function
---@field SetPrefabName function
---@field SetInherentSceneAltAction function
---@field GetIsInInterior function
---@field SetInherentSceneAction function
---@field IsPosSurroundedByTileType function
---@field GetAngleToPoint function
---@field SetPersistData function
---@field StartWallUpdatingComponent function
---@field FaceAwayFromPoint function
---@field ForceFacePoint function
---@field GetCurrentTileType function
---@field GetIsOnTileType function
---@field IsNear function
---@field TimeRemainingInTask function
---@field ReturnToScene function
---@field IsOnValidGround function
---@field SinkIfOnWater function
---@field SetPrefabNameOverride function
---@field AddInherentAction function
---@field GetRotation function
---@field OnUsedAsItem function
---@field CanInteractWith function
---@field RemoveChild function
---@field ClearStateGraph function
---@field PushBufferedAction function
---@field GetBufferedAction function
---@field InterruptBufferedAction function
---@field Hide function
---@field PerformBufferedAction function
---@field StartUpdatingComponent function
---@field OnBuilt function
---@field GetIsOnLandOutside function
---@field GetTaskInfo function
---@field GetTimeAlive function
---@field DoTaskInTime function
---@field DoPeriodicTask function
---@field GetPersistData function
---@field AddChild function
---@field KillTasks function
---@field StopUpdatingComponent function
---@field RemoveComponentAtRuntime function
---@field GetBrainString function
---@field GetDistanceSqToInst function
---@field GetGrandParent function
---@field FacePoint function
---@field GetAdjective function
---@field LongUpdate function
---@field ClearBufferedAction function
---@field GetDisplayName function
---@field GetComponentName function
---@field GetInheritedMoisture function
---@field OnProgress function
---@field IsPosSurroundedByWater function
---@field Show function
---@field ApplyInheritedMoisture function
---@field RunScript function
---@field IsAsleep function
---@field SetStateGraph function
---@field StopUpdatingComponent_Deferred function
---@field UpdateIsInInterior function
---@field HasChildPrefab function
---@field RemoveInherentAction function
---@field StopBrain function
---@field StopWallUpdatingComponent function
---@field GetPosition function
---@field CheckIsInInterior function
---@field RestartBrain function
---@field SpawnChild function
---@class entityPrefab:EntityScript
---@field Transform Transform
---@field inlimbo boolean
---@field parent entityPrefab
---@field AnimState table
---@field prefab string
---@field ininterior boolean
---@field persists boolean
---@field name string
---@field Physics table
---@field age number
---@field MiniMapEntity table
---@field event_listeners table[]
---@field SoundEmitter table
---@field origspawnedFrom table
---@field spawntime number
---@field addcolourdata table
---@field components table<string, table>
---@field pendingtasks table
---
---@field taxue_coin_value number|nil
---@field equip_value number|nil
---@field MAX_EQUIP_VALUE number|nil
---@field loaded_item_list table|nil
---@field advance_list table|nil
---
---@field EMCvalue number|nil
---@field noneexchangeable boolean
--#endregion
---@class Item:entityPrefab
---@field prevcontainer? container
---@field prevslot? integer
---@class Taxue:entityPrefab
---@field EXP_PER number
---@field EXP_ONE number
---@field level number
---@field bank_value number
---@field badluck_num number
---@field exp number
---@field combat_capacity number
---@field charm_value number
---@field exp_extra number
---@field charm_value_extra number
---@field has_ticket? boolean
---@field gamble_multiple? integer
---@field loot_multiple? integer
---@field substitute_item? string
---@field faceblack number
---@field golden number
---@field lockpick_chance number
---@field variation_chance number
---@field thieves_chance number
---@field lollipop_chance number
---@field colourful_windmill_chance number
---@field loaded_dice_chance number
---@field has_surprised_sword boolean
---@return Taxue
function GetPlayer() end
--#region Vector3
---@class Vector3
---@overload fun(x?:number,y?:number,z?:number):Vector3
---@operator add(Vector3):Vector3
---@operator sub(Vector3):Vector3
---@operator mul(Vector3):Vector3
---@operator div(Vector3):Vector3
---@field Dot fun(other:Vector3):number
---@field Corss fun(other:Vector3):Vector3
---@field __tostring fun(self):string
---@field __eq fun(other:Vector3):boolean
---@field Get fun(self): x:number,y:number,z:number
---@field DistSq fun(self,other:Vector3):number
---@field Dist fun(self,other:Vector3):number
---@field LengthSq fun(self):number
---@field Length fun(self):number
---@field Normalize fun(self):self
---@field GetNormalized fun(self):Vector3
---@field Invert fun(self):self
---@field GetInverse fun(self):Vector3
---@field IsVector3 fun(self):boolean
Vector3 = {}
---@param obj Vector3|number|number[]
---@param y number
---@param z number
---@return Vector3|nil
function ToVector3(obj, y, z) end
--#endregion
---@class Transform
---@field SetPosition fun(self,x:number,y:number,z:number)
---@field SetScale fun(self,x:number,y:number,z:number)
---@field GetWorldPosition fun(self):x:number,y:number,z:number
---@field GetRotation fun(self):x:number,y:number,z:number
Transform = {}
---@class TheSim
---@field GetPosition fun():x:integer, y:integer
---@field GetScreenPos fun(self,x:number,y:number,z:number):x:integer, y:integer
---@field FindEntities fun(self,x:number,y:number,z:number,radius:number,tags?:string[],notags?:string[]):entityPrefab[]
---@field GetScreenSize fun(self):w:integer,h:integer
---@field ProfilerPush fun(self,profile:string)
---@field ProfilerPop fun(self)
---@field GetPersistentString fun(self,filepath:string,fn:fun(load_success:boolean,str:string))
---@field SetPersistentString fun(self,name:string,data:string,encode:boolean,callback?:function,local_save?:boolean)
TheSim = {}
---@class Input:Class
---@field GetScreenPosition fun(self):Vector3
---@field GetWorldPosition fun(self):Vector3
---@field GetWorldEntityUnderMouse fun(self):entityPrefab
---@field GetControllerID fun(self):string
---@field GetLocalizedControl fun(self,id:string,key:integer):string
---@field pickConditions table
---@field hoverinst EntityScript
---@field entitiesundermouse EntityScript
---@field useController boolean
---@field enabledebugtoggle boolean
---@field mouse_enabled boolean
---@field position table
---@field onkey table
---@field onkeyup table
---@field onkeydown table
---@field ongesture table
---@field oncontrol table
---@field onmousedown table
---@field onmouseup {events:table<string|integer,table[]>}
---@field ontextinput table
---
---@field GetInputDevices function
---@field OnText function
---@field AddGestureHandler function
---@field OnMouseMove function
---@field EnableAllControllers function
---@field OnUpdate fun(self)
---@field GetControlIsMouseWheel function
---@field EnableDebugToggle function
---@field AddControlMappingHandler function
---@field ControllerConnected function
---@field OnMouseButton function
---@field UpdatePosition function
---@field AddPickCondition function
---@field IsControlPressed function
---@field IsDebugToggleEnabled function
---@field UpdateEntitiesUnderMouse function
---@field AddMoveHandler function
---@field ControllerAttached function
---@field AddGeneralControlHandler function
---@field GetAnalogControlValue function
---@field IsKeyDown function
---@field OnRawKey function
---@field GetHUDEntityUnderMouse function
---@field IsMouseDown function
---@field AddControlHandler function
---@field GetAllEntitiesUnderMouse function
---@field AddTextInputHandler function
---@field RemovePickCondition function
---@field OnControlMapped function
---@field OnFrameStart function
---@field AddMouseButtonHandler function
---@field EnableMouse function
---@field OnGesture function
---@field DisableAllControllers function
---@field AddKeyHandler function
---@field AddKeyUpHandler function
---@field OnControl function
---@field AddKeyDownHandler function
TheInput = {}