fix hue table type for wallmounted in craft helper

This commit is contained in:
Vanessa Dannenberg 2018-08-22 03:14:20 -04:00
parent 992bca7e15
commit b49ed1724b
2 changed files with 13 additions and 3 deletions

6
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:

@ -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)