mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2024-11-22 23:43:45 +01:00
turn unavail colors in selector into non-clickable flat images
(instead of making them all buttons)
This commit is contained in:
parent
ccbedcd3d6
commit
44629935d2
22
init.lua
22
init.lua
@ -806,6 +806,7 @@ local hps = 0.6 -- horizontal position scale
|
|||||||
local vps = 1.3 -- vertical position scale
|
local vps = 1.3 -- vertical position scale
|
||||||
local vs = 0.3 -- vertical shift/offset
|
local vs = 0.3 -- vertical shift/offset
|
||||||
local color_button_size = ";0.75,0.75;"
|
local color_button_size = ";0.75,0.75;"
|
||||||
|
local color_square_size = ";0.69,0.69;"
|
||||||
|
|
||||||
function unifieddyes.make_colored_square(hexcolor, colorname, showall, creative, painting_with, nodepalette, hp, v2, selindic, inv, explist)
|
function unifieddyes.make_colored_square(hexcolor, colorname, showall, creative, painting_with, nodepalette, hp, v2, selindic, inv, explist)
|
||||||
|
|
||||||
@ -833,13 +834,22 @@ function unifieddyes.make_colored_square(hexcolor, colorname, showall, creative,
|
|||||||
selindic = "unifieddyes_white_square.png"..colorize..overlay..unavail_overlay.."]"..
|
selindic = "unifieddyes_white_square.png"..colorize..overlay..unavail_overlay.."]"..
|
||||||
"tooltip["..colorname..";"..colorname.."]"
|
"tooltip["..colorname..";"..colorname.."]"
|
||||||
end
|
end
|
||||||
|
local form
|
||||||
|
|
||||||
local form = "image_button["..
|
if unavail_overlay == "" then
|
||||||
(hp*hps)..","..(v2*vps+vs)..
|
form = "image_button["..
|
||||||
color_button_size..
|
(hp*hps)..","..(v2*vps+vs)..
|
||||||
"unifieddyes_white_square.png"..colorize..overlay..unavail_overlay..";"..
|
color_button_size..
|
||||||
colorname..";]"..
|
"unifieddyes_white_square.png"..colorize..overlay..unavail_overlay..";"..
|
||||||
"tooltip["..colorname..";"..colorname.."]"
|
colorname..";]"..
|
||||||
|
"tooltip["..colorname..";"..colorname.."]"
|
||||||
|
else
|
||||||
|
form = "image["..
|
||||||
|
(hp*hps)..","..(v2*vps+vs)..
|
||||||
|
color_square_size..
|
||||||
|
"unifieddyes_white_square.png"..colorize..overlay..unavail_overlay.."]"..
|
||||||
|
"tooltip["..colorname.." (unavailable);"..colorname.."]"
|
||||||
|
end
|
||||||
|
|
||||||
return form, selindic
|
return form, selindic
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user