Skip to content

Commit 4ff7cd0

Browse files
committed
Added 1.3.0 methods and fields
1 parent cd29d75 commit 4ff7cd0

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
lines changed

datatypes/instance.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
---@field id number the GMS id for this instance, to use in API methods
33
---@field x number the x position of this inst
44
---@field y number the y position of this inst
5-
---@field oid string the APICO "id" value used with the Dictionary
5+
---@field oid string the APICO "id" value used with the Dictionary - will be nil on item/slot instances
66
---@field sprite_index number the sprite image id used for this instance
77
---@field image_index number the sprite image "frame" currently set for this instance
8+
---@field image_xscale number image xscale used in rendering, i.e. -1 to flip vertically
9+
---@field image_yscale number image yscale used in rendering, i.e. -1 to flip horizontally
810
---@field menu_id number the menu instance for this instance - will be nil if not a menu object instance
911
---@field slots slot[] a list of slot instances - will be nil if not a menu instance

datatypes/item_definition.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
---@field singular boolean @[Optional] if specified, items created with this definition will not be able to stack, like frames - you MUST give it a durability if you set this
1515
---@field durability boolean @[Optional] if specified, items created with this definition will have a durability, like tools
1616
---@field obj string @[Optional] if placeable, this specifies the object oid that will be created when the item is used
17-
---@field honeycore boolean @[Optional] if true, this item will be bought + sold for honeycore instead of rubees
17+
---@field honeycore boolean @[Optional] if true, this item will be bought + sold for honeycore instead of rubees
18+
---@field bee_lore string @[Optional] if set, this will be used as the "lore" in the bee book if this item is a bee's special produce

datatypes/object_definition.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
---@field singular boolean @[Optional] if specified, objects created with this definition will not be able to stack, like frames
1616
---@field honeycore boolean @[Optional] if true, this objects will be bought + sold for honeycore instead of rubees
1717
---@field invisible boolean @[Optional] if true, this object will not be drawn - it's bounding box will still be interactive though!
18+
---@field bed boolean @[Optional] if true, this object will act as a bed when clicked
19+
---@field bench boolean @[Optional] if true, this object will act as a bench when clicked
20+
---@field has_lighting boolean @[Optional] if true, this object will light up at night
1821
---@field has_shadow boolean @[Optional] if true, a shadow will be automatically drawn under this object
1922
---@field pickable boolean @[Optional] if true, you'll be able to pick up this item with the mouse
2023
---@field variants number @[Optional] for nature objects, like trees, this specifies the amount of variants within the sprite for the object

define_methods.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,11 @@ function api_define_tank(menu_id, tank_amount, tank_max, tank_type, tx, ty, tank
172172
---@param trait_map table a table containing keys with a species name, and a value containing a list of available values for this species (see below for example). When a "new" bee is formed through mutation, it will pick randomly from it's trait ranges to get a value for itself.
173173
---@param default_value string[] a value (or values) to use for any species not in the trait_map, or for any existing bee items when they're bred later
174174
---@return string|nil If this method worked it will return Success, otherwise if it fails it will return nil and will log an error in the Modding Console.
175-
function api_define_trait(trait_key, trait_map, default_value) end
175+
function api_define_trait(trait_key, trait_map, default_value) end
176+
177+
---
178+
---@since 1.3.0
179+
---@param validation string the custom validation, i.e. "customX:axe" - this has to match what you put in your layout
180+
---@param icon_sprite string the sprite to use for the validation, shown on slot hover. This should be a single 16x16 sprite.
181+
---@return string|nil If this method worked it will return Success, otherwise if it fails it will return nil and will log an error in the Modding Console.
182+
function api_define_validation_icon(validation, icon_sprite) end

misc_methods.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,13 @@ function api_unlock_quest(quest_id) end
6969
---
7070
---@since 1.2.0
7171
---@return boolean returns if the game is paused or not.
72-
function api_is_game_paused() end
72+
function api_is_game_paused() end
73+
74+
---
75+
---@since 1.3.0
76+
---@param url string the full URL to send the HTTP request to
77+
---@param method_type string the HTTP method type, i.e. GET or POST
78+
---@param headers table a map of headers to apply to your request
79+
---@param body string a body to send with the request (can just be an empty string)
80+
------@return string|nil If this method worked it will return Success, otherwise if it fails it will return nil and will log an error in the Modding Console.
81+
function api_http_request(url, method_type, headers, body) end

0 commit comments

Comments
 (0)