summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-08-22 03:14:20 -0400
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-08-22 03:14:20 -0400
commitb49ed1724b97782be3d783343147c67e018048c7 (patch)
tree18b21c654cc5ffce8e1ebffeaf513f57d1895b35
parent992bca7e15e91601688c187d874e3f413bcd2d79 (diff)
downloadunifieddyes-b49ed1724b97782be3d783343147c67e018048c7.tar
unifieddyes-b49ed1724b97782be3d783343147c67e018048c7.tar.gz
unifieddyes-b49ed1724b97782be3d783343147c67e018048c7.tar.bz2
unifieddyes-b49ed1724b97782be3d783343147c67e018048c7.tar.xz
unifieddyes-b49ed1724b97782be3d783343147c67e018048c7.zip
fix hue table type for wallmounted in craft helper
-rw-r--r--API.md6
-rw-r--r--init.lua10
2 files changed, 13 insertions, 3 deletions
diff --git a/API.md b/API.md
index e5fe12a..eff27ed 100644
--- a/API.md
+++ b/API.md
@@ -123,8 +123,10 @@ If your mod used the old paradigm where you craft a neutral-colored item, place
`palette` specifies the palette type to iterate through ("extended" and "wallmounted" are obvious, and if not specified, it'll use the 89 color palette).
`type` can be "shapeless" or unspecified/`nil`, and works the same as in the normal call.
-
-`recipe` is the same as in the normal call, except that Unified Dyes will replace all instances of the string "NEUTRAL_NODE" with the item specified in the preceding `neutral_node` field (this can be the same as the output node, minus the stack size anyway). Every instance of "MAIN_DYE" will be replaced with a portion of dye, as Unified Dyes' recipe helper works through its color lists (i.e. this key will become whatever dye is needed for each recipe).
+
+`neutral_node` should specify the name of whatever item or node serves as the base, neutrally-colored material in your recipe. If there isn't one, set this to an empty string.
+
+`recipe` is the same as in the normal call, except that Unified Dyes will replace all instances of the string "NEUTRAL_NODE" with the item specified in the preceding `neutral_node` field. Every instance of "MAIN_DYE" will be replaced with a portion of dye, as Unified Dyes' recipe helper works through its color lists (i.e. this key will become whatever dye is needed for each recipe).
If your mod never has never used Unified Dyes at all, in short, do the following:
diff --git a/init.lua b/init.lua
index 82a41ef..1ae39c4 100644
--- a/init.lua
+++ b/init.lua
@@ -185,7 +185,11 @@ end
local function register_c(craft, hue, sat, val)
local color = ""
if val then
- color = "dye:"..val..hue[1]..sat
+ if craft.palette == "wallmounted" then
+ color = "dye:"..val..hue..sat
+ else
+ color = "dye:"..val..hue[1]..sat
+ end
else
color = "dye:"..hue -- if val is nil, then it's grey.
end
@@ -230,6 +234,10 @@ function unifieddyes.register_color_craft(craft)
for _,val in ipairs(vals_table) do
for _,sat in ipairs(sats_table) do
+ print("[UD] craft = ")
+ print(dump(craft))
+ print("[UD] hue = "..dump(hue).." ~~ sat = "..dump(sat).." ~~ val = "..dump(val))
+
if sat == "_s50" and val ~= "" and val ~= "medium_" and val ~= "dark_" then break end
register_c(craft, hue, sat, val)