From 057baacf2d8c3417d14d19a02edc82456246dc69 Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Mon, 27 Aug 2018 19:30:36 -0400 Subject: [PATCH] make "Your selection" legend show your selected color or show a "?" when a color hasn't been chosen --- init.lua | 21 ++++++++++++++++----- textures/unifieddyes_question.png | Bin 0 -> 917 bytes 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 textures/unifieddyes_question.png diff --git a/init.lua b/init.lua index 1338428..c8fc385 100644 --- a/init.lua +++ b/init.lua @@ -833,6 +833,8 @@ function unifieddyes.show_airbrush_form(player) local inv = player:get_inventory() local base_form = "size[15,8.5]label[7,-0.25;Select a color:]" + local selindic = "unifieddyes_select_overlay.png^unifieddyes_question.png]" + local size="0.75,0.75;" local hps=0.6 local vps=1.3 @@ -864,16 +866,20 @@ function unifieddyes.show_airbrush_form(player) local color = string.format("%02x", r2)..string.format("%02x", g2)..string.format("%02x", b2) local dye = "dye:"..val..hue..sat + local overlay = "" + local colorize = minetest.formspec_escape("^[colorize:#"..color..":255") + if not creative and inv:contains_item("main", dye) then overlay = "^unifieddyes_available_overlay.png" end if dye == unifieddyes.player_selected_dye[player_name] then overlay = "^unifieddyes_select_overlay.png" + selindic = "unifieddyes_white_square.png"..colorize..overlay.."]".. + "tooltip["..val..hue..sat..";"..val..hue..sat.."]" end - local colorize = minetest.formspec_escape("^[colorize:#"..color..":255") base_form = base_form.."image_button[".. (hp*hps)..","..(v2*vps+vs)..";".. size.. @@ -914,16 +920,18 @@ function unifieddyes.show_airbrush_form(player) local dye = "dye:"..val..hue..sat local overlay = "" + local colorize = minetest.formspec_escape("^[colorize:#"..color..":255") + if not creative and inv:contains_item("main", dye) then overlay = "^unifieddyes_available_overlay.png" end if dye == unifieddyes.player_selected_dye[player_name] then overlay = "^unifieddyes_select_overlay.png" + selindic = "unifieddyes_white_square.png"..colorize..overlay.."]".. + "tooltip["..val..hue..sat..";"..val..hue..sat.."]" end - local colorize = minetest.formspec_escape("^[colorize:#"..color..":255") - base_form = base_form.."image_button[".. (hp*hps)..","..(v2*vps+vs)..";".. size.. @@ -952,15 +960,18 @@ function unifieddyes.show_airbrush_form(player) local dye = "dye:"..grey2 local overlay = "" + local colorize = minetest.formspec_escape("^[colorize:#"..grey..":255") + if not creative and inv:contains_item("main", dye) then overlay = "^unifieddyes_available_overlay.png" end if dye == unifieddyes.player_selected_dye[player_name] then overlay = "^unifieddyes_select_overlay.png" + slindic = "unifieddyes_white_square.png"..colorize..overlay.."]".. + "tooltip["..grey2..";"..grey2.."]" end - local colorize = minetest.formspec_escape("^[colorize:#"..grey..":255") base_form = base_form.."image_button[".. (hp*hps)..","..(v2*vps+vs)..";".. size.. @@ -975,7 +986,7 @@ function unifieddyes.show_airbrush_form(player) "unifieddyes_available_overlay.png]".. "label[11.0,"..(vps*5.1+vs)..";Dyes on hand]".. "image[12.5,"..(vps*5+vs)..";"..size.. - "unifieddyes_select_overlay.png]".. + selindic.. "label[13.2,"..(vps*5.1+vs)..";Your selection]" end diff --git a/textures/unifieddyes_question.png b/textures/unifieddyes_question.png new file mode 100644 index 0000000000000000000000000000000000000000..0b25633efd32197ccb287ba295d3d9a7c1610f90 GIT binary patch literal 917 zcmV;G18V$fZM@Bhj!6T zH^qUOO-*Yc7Ui^bx7$8nBTW0gu} zOVSNL!DKRNT@-voQq>38*x0xYeAe07xjs5NTHf8=t>vJ6KA)eNnR%_5rG6B+E$O>p z@U^wIqevtoAP+1~OicWwIyO5yn*(lKh=io5q>LBS^@C4MP06yX&jI%K_Fk<=U~_X* zU0q!}!1ePm9=ARf|G{w_s?{n0(P)%#IQ%*g>FMby)^iMp!`Qan3w+Qr0b|TBz_$Rl zZJSUi1VAd4BAd;|fR7!=xmM3No6Y)!Zw3@|#zGCO#3u&_2Up7Fa@=)Ydu3%s)6>%~ zU<1*^!$Z^E-F?PsX=#aKu?P@u5T||v@;75V9{)NPi^;Za0Rq(9+k0EmnN7I8y{&

psZ{EtTJUr_t)ZczQNpc(~ z9goL<2$WpF9ME^+PIylCZ+OX<5{X1IQ1TowRwHxMj`DvhNyo>>_kaf;cnWx_*;t_# zIpl%D^73*4cpfNAdJp(MP;#{+bK{LqNqV8bzyAvl=uWHaZ8ZZPxLh0pS-%p%dZ2Ns zU9$7De_7JHq(Ze?-C12-y#;i)`$B4a