mirror of
https://github.com/Sokomine/colormachine.git
synced 2024-09-27 15:00:19 +02:00
adjusted colormachine to renamed colors
This commit is contained in:
parent
b8cc8b8624
commit
0a880d88d7
25
init.lua
25
init.lua
|
@ -77,13 +77,14 @@ colormachine.colors = {
|
||||||
"yellow",
|
"yellow",
|
||||||
"lime",
|
"lime",
|
||||||
"green",
|
"green",
|
||||||
"aqua",
|
"spring", -- old name: "aqua",
|
||||||
"cyan",
|
"cyan",
|
||||||
"skyblue",
|
"azure", -- old: "skyblue",
|
||||||
"blue",
|
"blue",
|
||||||
"violet",
|
"violet",
|
||||||
"magenta",
|
"magenta",
|
||||||
"redviolet"
|
"rose" -- old: "redviolet"
|
||||||
|
-- TODO: what about nodes with the old names? aqua -> spring, skyblue -> azure, and redviolet -> rose aliases
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,8 +94,8 @@ local stained_glass_exception = 0;
|
||||||
-- the names of suitable sources of that color (note: this does not work by group!);
|
-- the names of suitable sources of that color (note: this does not work by group!);
|
||||||
-- you can add your own color sources here if you want
|
-- you can add your own color sources here if you want
|
||||||
colormachine.basic_dye_sources = { "flowers:rose", "flowers:tulip", "flowers:dandelion_yellow",
|
colormachine.basic_dye_sources = { "flowers:rose", "flowers:tulip", "flowers:dandelion_yellow",
|
||||||
"", "default:cactus", "", "", "", -- no lime, no aqua, no cyan, no skyblue
|
"", "default:cactus", "", "", "", -- no lime, no spring, no cyan, no azure
|
||||||
"flowers:geranium", "flowers:viola", "", "", -- no magenta, no redviolet
|
"flowers:geranium", "flowers:viola", "", "", -- no magenta, no rose
|
||||||
"default:clay_lump", "", "", "", "default:coal_lump" };
|
"default:clay_lump", "", "", "", "default:coal_lump" };
|
||||||
|
|
||||||
-- if flowers is not installed
|
-- if flowers is not installed
|
||||||
|
@ -111,13 +112,13 @@ colormachine.dye_mixes = { red = {}, -- base color
|
||||||
yellow = {}, -- base color
|
yellow = {}, -- base color
|
||||||
lime = {3,5}, -- yellow + green
|
lime = {3,5}, -- yellow + green
|
||||||
green = {3,9}, -- yellow + blue
|
green = {3,9}, -- yellow + blue
|
||||||
aqua = {5,7}, -- green + cyan
|
spring = {5,7}, -- green + cyan
|
||||||
cyan = {5,9}, -- green + blue
|
cyan = {5,9}, -- green + blue
|
||||||
skyblue = {7,9}, -- cyan + blue
|
azure = {7,9}, -- cyan + blue
|
||||||
blue = {}, -- base color
|
blue = {}, -- base color
|
||||||
violet = {9,11}, -- blue + magenta
|
violet = {9,11}, -- blue + magenta
|
||||||
magenta = {9,1}, -- blue + red
|
magenta = {9,1}, -- blue + red
|
||||||
redviolet = {11,1}, -- magenta + red
|
rose = {11,1}, -- magenta + red
|
||||||
|
|
||||||
white = {}, -- base color
|
white = {}, -- base color
|
||||||
lightgrey = {13,15}, -- white + grey
|
lightgrey = {13,15}, -- white + grey
|
||||||
|
@ -740,7 +741,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
||||||
if( g>0 ) then
|
if( g>0 ) then
|
||||||
return nil; -- no grey values for them
|
return nil; -- no grey values for them
|
||||||
end
|
end
|
||||||
local h_trans = {yellow=1, lime=2, green=3, aqua=4, cyan=5, skyblue=6, blue=7, violet=8, magenta=9, redviolet=10, red=11,orange=12};
|
local h_trans = {yellow=1, lime=2, green=3, spring=4, cyan=5, azure=6, blue=7, violet=8, magenta=9, rose=10, red=11,orange=12, aqua=4, skyblue=6, redviolet=10};
|
||||||
|
|
||||||
local h = h_trans[ colormachine.colors[c] ];
|
local h = h_trans[ colormachine.colors[c] ];
|
||||||
|
|
||||||
|
@ -878,7 +879,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
||||||
return prefix..new_color..postfix;
|
return prefix..new_color..postfix;
|
||||||
elseif( new_color == 'light_red' ) then
|
elseif( new_color == 'light_red' ) then
|
||||||
return prefix..'pink'..postfix;
|
return prefix..'pink'..postfix;
|
||||||
-- lime, aqua, skyblue and redviolet do not exist as standard wool/dye colors
|
-- lime, spring, azure and rose do not exist as standard wool/dye colors
|
||||||
elseif( g == -1 and (c==4 or c==6 or c==8 or c==12) and k_orig ~= 'unifieddyes_') then
|
elseif( g == -1 and (c==4 or c==6 or c==8 or c==12) and k_orig ~= 'unifieddyes_') then
|
||||||
return nil;
|
return nil;
|
||||||
-- all other colors of normal dye/wool exist only in normal shade
|
-- all other colors of normal dye/wool exist only in normal shade
|
||||||
|
@ -1906,7 +1907,9 @@ colormachine.init = function()
|
||||||
form = form.."item_image["..tostring(i)..",1;1,1;"..source.."]";
|
form = form.."item_image["..tostring(i)..",1;1,1;"..source.."]";
|
||||||
|
|
||||||
-- even those colors may be additionally mixed
|
-- even those colors may be additionally mixed
|
||||||
if( #colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ] == 2 ) then
|
if( colormachine.colors_and_greys[ i ]
|
||||||
|
and colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ]
|
||||||
|
and #colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ] == 2 ) then
|
||||||
form = form.. "button["..tostring(i-0.1)..",1.9;0.8,0.2;mix_"..colormachine.colors_and_greys[ i ]..";mix]";
|
form = form.. "button["..tostring(i-0.1)..",1.9;0.8,0.2;mix_"..colormachine.colors_and_greys[ i ]..";mix]";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user