forked from Sleepless-Development/sleepless_interact
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__types.lua
56 lines (51 loc) · 1.78 KB
/
__types.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
---@class InteractOption
---@field label string
---@field icon string
---@field options InteractOption[]
---@field groups? string | string[] | table<string, number>
---@field items? string | string[] | table<string, number>
---@field anyItem? boolean
---@field remove? boolean
---@field canInteract? fun(id: any, entity?: number, coords: vector3, distance: number)
---@field onSelect? fun(data: Interaction)
---@field export? string
---@field event? string
---@field serverEvent? string
---@field command? string
---@class InteractionData
---@field cooldown number
---@field renderDistance number
---@field activeDistance number
---@field resource string
---@field bone? string
---@class Interaction
---@field id string unique identifier for the interaction
---@field options InteractOption[]
---@field renderDistance number
---@field activeDistance number
---@field currentDistance number
---@field sprite? { dict?: string, txt?: string, color?: vector4 }
---@field cooldown number
---@field removeWhenDead boolean
---@field DuiOptions {text: string, icon: string}
---@field getCoords fun(data: self): vector3
---@field getDistance fun(data: self): number
---@field shouldRender fun(data: self): boolean
---@field shouldBeActive fun(data: self): boolean
---@field isActive boolean
---@field isDestroyed boolean
---@field resource string
---@field globalType? string
---@field private lastActionTime number
---@class CoordsInteraction: Interaction
---@field coords vector3 | vector3[]
---@field onEnter fun(data: CPoint)
---@field onExit fun(data: CPoint)
---@field nearby fun(data: CPoint)
---@field private point CPoint
---@class LocalEntityInteraction: Interaction
---@field entity number
---@field offset vector3
---@field bone string
---@class NetEntityInteraction: LocalEntityInteraction
---@field netId number