diff options
author | Wuzzy <almikes@aol.com> | 2014-10-12 19:50:33 +0200 |
---|---|---|
committer | RealBadAngel <maciej.kasatkin@o2.pl> | 2014-11-09 09:38:43 +0100 |
commit | 18c583ee0b7548d5ea5d5ccd3085008d94620e5c (patch) | |
tree | 41f272d95da1e8199e71f66f026da184e4c7090f /builtin/fstk/buttonbar.lua | |
parent | 9b551d5cbcaf71a8c39bbf7e886290649aed4799 (diff) | |
download | minetest-18c583ee0b7548d5ea5d5ccd3085008d94620e5c.tar.gz minetest-18c583ee0b7548d5ea5d5ccd3085008d94620e5c.tar.bz2 minetest-18c583ee0b7548d5ea5d5ccd3085008d94620e5c.zip |
Add tooltips to main menu subgames button bar
Diffstat (limited to 'builtin/fstk/buttonbar.lua')
-rw-r--r-- | builtin/fstk/buttonbar.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/fstk/buttonbar.lua b/builtin/fstk/buttonbar.lua index 769bfb0be..9a9ec999b 100644 --- a/builtin/fstk/buttonbar.lua +++ b/builtin/fstk/buttonbar.lua @@ -57,10 +57,10 @@ local function buttonbar_formspec(self) end formspec = formspec .. - string.format("image_button[%f,%f;%f,%f;%s;%s;%s;true;%s]", + string.format("image_button[%f,%f;%f,%f;%s;%s;%s;true;%s]tooltip[%s;%s]", btn_pos.x, btn_pos.y, self.btn_size, self.btn_size, self.buttons[i].image, btn_name, self.buttons[i].caption, - borders) + borders, btn_name, self.buttons[i].tooltip) else --print("end of displayable buttons: orientation: " .. self.orientation) --print( "button_end: " .. (btn_pos.y + self.btn_size - (self.btn_size * 0.05))) @@ -140,11 +140,12 @@ local buttonbar_metatable = { delete = function(self) ui.delete(self) end, - add_button = function(self, name, caption, image) + add_button = function(self, name, caption, image, tooltip) if caption == nil then caption = "" end if image == nil then image = "" end + if tooltip == nil then tooltip = "" end - table.insert(self.buttons,{ name=name, caption=caption, image=image}) + table.insert(self.buttons,{ name=name, caption=caption, image=image, tooltip=tooltip}) if self.orientation == "horizontal" then if ( (self.btn_size * #self.buttons) + (self.btn_size * 0.05 *2) > self.size.x ) then |