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

4
API.md
View File

@ -124,7 +124,9 @@ If your mod used the old paradigm where you craft a neutral-colored item, place
`type` can be "shapeless" or unspecified/`nil`, and works the same as in the normal call. `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: If your mod never has never used Unified Dyes at all, in short, do the following:

View File

@ -185,7 +185,11 @@ end
local function register_c(craft, hue, sat, val) local function register_c(craft, hue, sat, val)
local color = "" local color = ""
if val then if val then
if craft.palette == "wallmounted" then
color = "dye:"..val..hue..sat
else
color = "dye:"..val..hue[1]..sat color = "dye:"..val..hue[1]..sat
end
else else
color = "dye:"..hue -- if val is nil, then it's grey. color = "dye:"..hue -- if val is nil, then it's grey.
end end
@ -230,6 +234,10 @@ function unifieddyes.register_color_craft(craft)
for _,val in ipairs(vals_table) do for _,val in ipairs(vals_table) do
for _,sat in ipairs(sats_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 if sat == "_s50" and val ~= "" and val ~= "medium_" and val ~= "dark_" then break end
register_c(craft, hue, sat, val) register_c(craft, hue, sat, val)