-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathget_methods.lua
More file actions
193 lines (156 loc) · 6.5 KB
/
get_methods.lua
File metadata and controls
193 lines (156 loc) · 6.5 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
---
---@param inst_id number the instance you want to get the boundary for
---@return boundary|nil Returns either a boundary or nil with errors logged in the Modding Console.
function api_get_boundary(inst_id) end
---
---@return coordinate
function api_get_camera_position() end
---
---@return coordinate
function api_get_cam() end
---
--- Lets you retrieve your mods data.json file and when loaded will call the data() callback hook.
function api_get_data() end
---
---@param oid string the oid to retrieve a dictionary definition for
---@return table|nil
function api_get_definition(oid) end
---
---@return string returns a string, with either an oid or empty if there's nothing equipped.
function api_get_equipped() end
---
---@return number
function api_get_filename() end
---
---@param tx number the x position to check
---@param ty number the y position to check
---@return string returns a floor oid
function api_get_floor(tx, ty) end
---
---@param radius number? @[Optional] if specified this method will get all objects within this radius from the player, rather than get all onscreen
---@return instance[]
function api_get_flowers(radius) end
---
---@return game_size
function api_get_game_size() end
---
---@param tx number the x position to check
---@param ty number the y position to check
---@return string returns a ground oid
function api_get_ground(tx, ty) end
---
---@param inst_type string | "'item'" | "'obj'" | "'menu_obj'" | "'menu'" | "'slot'" | "'ui'" | "'wall'" | "'carpet'" | "'ground'"
---@return number|nil returns the inst_id of the highlighted instance or nil if nothing highlighted.
function api_get_highlighted(inst_type) end
---
---@param inst_id number an instance id to get the properties for
---@return instance|nil returns instance if found otherwise nil
function api_get_inst(inst_id) end
---
---@param inst_type string | "'item'" | "'obj'" | "'tree'" | "'flower'" | "'menu_obj'"
---@param x1 number left x position of the rectangle box
---@param y1 number top y position of the rectangle box
---@param x2 number right x position of the rectangle box
---@param y2 number bottom y position of the rectangle box
---@return instance[]
function api_get_inst_in_rectangle(inst_type, x1, y1, x2, y2) end
---
---@param inst_type string | "'item'" | "'obj'" | "'tree'" | "'flower'" | "'menu_obj'"
---@param x1 number x center position of the circle
---@param y1 number y center position of the circle
---@param rad number radius of the circle
---@return instance[]
function api_get_inst_in_circle(inst_type, x1, y1, rad) end
---
---@param key_label string either a key character like "A" or one of the following special labels: LEFT, RIGHT, UP, DOWN, ENTER, ESC, SPACE, SHFT, CTRL, ALT, TAB
---@return boolean
function api_get_key_down(key_label) end
---
---@param key_label string either a key character like "A" or one of the following special labels: LEFT, RIGHT, UP, DOWN, ENTER, ESC, SPACE, SHFT, CTRL, ALT, TAB
---@return boolean
function api_get_key_pressed(key_label) end
---
---@param radius number? @[Optional] if specified this method will get all objects within this radius from the player, rather than get all onscreen
---@param oid string? @[Optional] if specified this method will only return objs with a matching oid
---@param coordinate coordinate? @[Optional] if using a radius, this allows you specify the center point to use. If not given, will default to the player
---@return instance[]
function api_get_menu_objects(radius, oid, coordinate) end
---
---@param menu_id number the menu instance to get the menu object inst for
---@return number|nil
function api_get_menus_obj(menu_id) end
---
---@return instance
function api_get_mouse_inst() end
---
---@return coordinate
function api_get_mouse_position() end
---
---@return coordinate
function api_get_mouse_tile_position() end
---
---@param radius number? @[Optional] if specified this method will get all objects within this radius from the player, rather than get all onscreen
---@param oid string? @[Optional] if specified this method will only return objs with a matching oid
---@param coordinate coordinate? @[Optional] if using a radius, this allows you specify the center point to use. If not given, will default to the player
---@return instance[]
function api_get_objects(radius, oid, coordinate) end
---
---@return number
function api_get_player_instance() end
---
---@return coordinate
function api_get_player_position() end
---
---@return coordinate
function api_get_player_tile_position() end
---
---@param inst_id number instance id to get a property for
---@param prop_name string name of the property to try and get
---@return any if fails will return nil and log error in Modding Console.
function api_get_property(inst_id, prop_name) end
---
---@param inst_id number instance id to get a property for
---@param prop_name string name of the property to try and get
---@return any if fails will return nil and log error in Modding Console.
function api_gp(inst_id, prop_name) end
---
---@param menu_id number menu instance to get a slot from
---@param slot_index number index of the slot to get, starting at 1
---@return slot [WIP] the wiki says slot_instance but I cant find what a slot_instance is.
function api_get_slot(menu_id, slot_index) end
---
---@param slot_id number slot instance to get properties for
---@return slot [WIP] the wiki says slot_instance but I cant find what a slot_instance is.
function api_get_slot_inst(slot_id) end
---
---@param menu_id number menu instance to get a slot from
---@return slot[] [WIP] the wiki says slot_instance 's but I cant find what a slot_instance is.
function api_get_slots(menu_id) end
---
---@param oid string sprite to get the reference for. Note: you need to prepend the oid with "sp_"
---@return number|nil returns sprite id if found otherwise nil
function api_get_sprite(oid) end
---
---@return time
function api_get_time() end
---
---@param radius number? @[Optional] if specified this method will get all objects within this radius from the player, rather than get all onscreen
---@return instance[]
function api_get_trees(radius) end
---
---@return weather
function api_get_weather() end
---
---@since 1.3.1
---@return string returns a 2 letter language code, current options: [en, fr, it, de, es, br, jp]
function api_get_language() end
---
---@since 2.1.0
---@param inst_id number instance id
---@return string returns a ZOID
function api_get_zoid_from_inst(inst_id) end
---
---@since 2.1.0
---@param zoid string ZOID
---@return number returns the inst_id of ZOID
function api_get_inst_from_zoid(zoid) end