diff options
author | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-09-13 00:17:13 -0400 |
---|---|---|
committer | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-09-13 00:17:13 -0400 |
commit | 44629935d25bb9b4ead5567a13e733f8d1c60fcd (patch) | |
tree | 30322baa211b38746db7fbe4253f3b2b668a9064 | |
parent | ccbedcd3d6a604c8ca45b77337fd59b30c1caf96 (diff) | |
download | unifieddyes-44629935d25bb9b4ead5567a13e733f8d1c60fcd.tar unifieddyes-44629935d25bb9b4ead5567a13e733f8d1c60fcd.tar.gz unifieddyes-44629935d25bb9b4ead5567a13e733f8d1c60fcd.tar.bz2 unifieddyes-44629935d25bb9b4ead5567a13e733f8d1c60fcd.tar.xz unifieddyes-44629935d25bb9b4ead5567a13e733f8d1c60fcd.zip |
turn unavail colors in selector into non-clickable flat images
(instead of making them all buttons)
-rw-r--r-- | init.lua | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -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 = "image_button[".. - (hp*hps)..","..(v2*vps+vs).. - color_button_size.. - "unifieddyes_white_square.png"..colorize..overlay..unavail_overlay..";".. - colorname..";]".. - "tooltip["..colorname..";"..colorname.."]" + local form + + 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 |