themes: tooltipps are per code not per text. Therefore the tooltipps should not be displayed in some cases (like calculator have all numbers the same code and same tooltipp, so no

tooltipp usefull)
This commit is contained in:
Alexander Weber 2017-12-18 18:08:06 +01:00
parent 4b3178b0dd
commit f9513e4ab0

View File

@ -35,9 +35,13 @@ theme_class.__index = theme_class
-- get prepared button textures
function theme_class:get_button(area, prefix, code, text, tooltip)
return'image_button['..area..';'..self[prefix.."_button"]..';'..code..';'.. minetest.colorize(self[prefix.."_textcolor"] or self.textcolor,minetest.formspec_escape(text))..']'..
"tooltip["..code..";"..minetest.formspec_escape(tooltip or text).."]"
local formspec = 'image_button['..area..';'..self[prefix.."_button"]..';'..code..';'.. minetest.colorize(self[prefix.."_textcolor"] or self.textcolor,minetest.formspec_escape(text))..']'
if tooltip then
formspec = formspec.."tooltip["..code..";"..minetest.formspec_escape(tooltip).."]"
end
return formspec
end
-- Get themed label
function theme_class:get_label(area, label)
return'label['..area..';'..minetest.colorize(self.textcolor, minetest.formspec_escape(label))..']'