Skip to content

Commit f8726e8

Browse files
committed
Added v1.4.0 methods.
1 parent 60d47a0 commit f8726e8

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

datatypes/flower_definition.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
---@field tools string[] @[Optional] a list of tools that can be used on this flower,
1414
---@field variants number @[Optional] specifies the number of variants in your sprite image, defaults to 1
1515
---@field chance number @[Optional] the chance this species will be formed as a mutation, defaults to 100
16-
---@field smoker string[] @[Optional] a list of bee species that this flower can be used to calm in a smoker
16+
---@field smoker string[] @[Optional] a list of bee species that this flower can be used to calm in a smoker
17+
---@field has_lighting boolean @[Optional] if true, the flower will light up at night like Pondshine

datatypes/window_definition.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---@class window_definition
2+
---@field id string id to use to create an oid for this item, must be unique across all mods (i.e. window90001)
3+
---@field name string the name of this item, shown in tooltips
4+
---@field shop_buy boolean @[Optional] the amount this item can be bought for if sold by an NPC
5+
---@field shop_sell boolean @[Optional] the amount this item can be sold for at an NPC

datatypes/workbench_tabs.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---@class workbench_tabs
2+
---@field t1 string
3+
---@field t2 string
4+
---@field t3 string
5+
---@field t4 string
6+
---@field t5 string

define_methods.lua

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,31 @@ function api_define_validation_icon(validation, icon_sprite) end
187187
---@param wall wall_definition definition for your new wall
188188
---@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
189189
---@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.
190-
function api_define_wall(wall, wall_sprite) end
190+
function api_define_wall(wall, wall_sprite) end
191+
192+
---
193+
---@since 1.4.0
194+
---@param label string label to show for your mod in the Mod Workbench
195+
---@param tabs workbench_tabs a table with 5 keys, "t1", "t2", "t3", "t4", "t5". each key should have a string value that will be displayed when that tab is hovered.
196+
---@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.
197+
function api_define_workbench(label, tabs) end
198+
199+
---
200+
---@since 1.4.0
201+
---@param oid string the oid of the item to define default stats for
202+
---@param stats table the stats to give to an item when created if it has the given oid
203+
function api_define_item_stats(oid, stats) end
204+
205+
---
206+
---@since 1.4.0
207+
---@param window window_definition definition for your new window
208+
---@param window_sprite string the spritesheet for the new window, should be 5 frames (16x16), the first 4 like a normal item/obj sprite, the 5th frame is what will be drawn onto the wall when placed down
209+
function api_define_window(window, window_sprite) end
210+
211+
---
212+
---@since 1.4.0
213+
---@param name string the name of the liquid to use, this will be shown in tooltips and be set as the liquid "type" in stats
214+
---@param color string a color name to use for the liquid, this can be a default one or your own that you defined with api_define_color()
215+
---@param texture_sprite string the path to a single 37x34px image used as the liquid "texture". This will be drawn at 50% alpha on top of any tanks with your liquid in it, to help identify your liquid without color
216+
---@param preview_sprite string the path to a single 12x12px image used as the liquid preview when hovering over machines with a tank containing your liquid - this should be a solid filled in image (i.e. your color + your texture combined)
217+
function api_define_liquid(name, color, texture_sprite, preview_sprite) end

0 commit comments

Comments
 (0)