Skip to content

Commit 8f72147

Browse files
committed
Added wall definition and fixed formatting issue in misc methods
1 parent 4ff7cd0 commit 8f72147

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

datatypes/wall_definition.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---@class wall_definition
2+
---@field id string id to use to create an oid for this item. Unless defining a flower, your new item oid will be a your mod_id + the item id give, i.e. "sample_mod_my_item"
3+
---@field name string the name of this item, shown in tooltips
4+
---@field shop_buy number? @[Optional] the amount this item can be bought for if sold by an NPC
5+
---@field shop_sell number? @[Optional] the amount this item can be sold for at an NPC

define_methods.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,11 @@ function api_define_trait(trait_key, trait_map, default_value) end
179179
---@param validation string the custom validation, i.e. "customX:axe" - this has to match what you put in your layout
180180
---@param icon_sprite string the sprite to use for the validation, shown on slot hover. This should be a single 16x16 sprite.
181181
---@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
182+
function api_define_validation_icon(validation, icon_sprite) end
183+
184+
---
185+
---@since 1.3.0
186+
---@param wall wall_definition definition for your new wall
187+
---@param wall_sprite string the spritesheet for the new wall, needs to contain both the item sprites and wall variants, see the example in the Sample Mod
188+
---@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.
189+
function api_define_wall(wall, wall_sprite) end

misc_methods.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ function api_is_game_paused() end
7777
---@param method_type string the HTTP method type, i.e. GET or POST
7878
---@param headers table a map of headers to apply to your request
7979
---@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.
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.
8181
function api_http_request(url, method_type, headers, body) end

0 commit comments

Comments
 (0)