Skip to content

Commit

Permalink
Added v1.4.0 methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatGravyBoat committed Jun 17, 2022
1 parent 60d47a0 commit f8726e8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
3 changes: 2 additions & 1 deletion datatypes/flower_definition.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
---@field tools string[] @[Optional] a list of tools that can be used on this flower,
---@field variants number @[Optional] specifies the number of variants in your sprite image, defaults to 1
---@field chance number @[Optional] the chance this species will be formed as a mutation, defaults to 100
---@field smoker string[] @[Optional] a list of bee species that this flower can be used to calm in a smoker
---@field smoker string[] @[Optional] a list of bee species that this flower can be used to calm in a smoker
---@field has_lighting boolean @[Optional] if true, the flower will light up at night like Pondshine
5 changes: 5 additions & 0 deletions datatypes/window_definition.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---@class window_definition
---@field id string id to use to create an oid for this item, must be unique across all mods (i.e. window90001)
---@field name string the name of this item, shown in tooltips
---@field shop_buy boolean @[Optional] the amount this item can be bought for if sold by an NPC
---@field shop_sell boolean @[Optional] the amount this item can be sold for at an NPC
6 changes: 6 additions & 0 deletions datatypes/workbench_tabs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---@class workbench_tabs
---@field t1 string
---@field t2 string
---@field t3 string
---@field t4 string
---@field t5 string
29 changes: 28 additions & 1 deletion define_methods.lua
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,31 @@ function api_define_validation_icon(validation, icon_sprite) end
---@param wall wall_definition definition for your new wall
---@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
---@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.
function api_define_wall(wall, wall_sprite) end
function api_define_wall(wall, wall_sprite) end

---
---@since 1.4.0
---@param label string label to show for your mod in the Mod Workbench
---@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.
---@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.
function api_define_workbench(label, tabs) end

---
---@since 1.4.0
---@param oid string the oid of the item to define default stats for
---@param stats table the stats to give to an item when created if it has the given oid
function api_define_item_stats(oid, stats) end

---
---@since 1.4.0
---@param window window_definition definition for your new window
---@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
function api_define_window(window, window_sprite) end

---
---@since 1.4.0
---@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
---@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()
---@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
---@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)
function api_define_liquid(name, color, texture_sprite, preview_sprite) end

0 comments on commit f8726e8

Please sign in to comment.