mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2024-12-24 01:30:29 +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
12
init.lua
12
init.lua
@ -806,6 +806,7 @@ local hps = 0.6 -- horizontal position scale
|
||||
local vps = 1.3 -- vertical position scale
|
||||
local vs = 0.3 -- vertical shift/offset
|
||||
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)
|
||||
|
||||
@ -833,13 +834,22 @@ function unifieddyes.make_colored_square(hexcolor, colorname, showall, creative,
|
||||
selindic = "unifieddyes_white_square.png"..colorize..overlay..unavail_overlay.."]"..
|
||||
"tooltip["..colorname..";"..colorname.."]"
|
||||
end
|
||||
local form
|
||||
|
||||
local form = "image_button["..
|
||||
if unavail_overlay == "" then
|
||||
form = "image_button["..
|
||||
(hp*hps)..","..(v2*vps+vs)..
|
||||
color_button_size..
|
||||
"unifieddyes_white_square.png"..colorize..overlay..unavail_overlay..";"..
|
||||
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
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user