diff options
author | est31 <MTest31@outlook.com> | 2015-01-26 23:23:44 +0100 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-01-26 23:51:03 +0100 |
commit | 8b22593f5528e2d493d5dcb577634d3f7a1ce967 (patch) | |
tree | 721b8777447812bc90e52e13b597810a563d933e /common.lua | |
parent | fb98963810d37f0349d73cbe3808630d5f7b0b23 (diff) |
Color up the enable/disable buttons for sorttube
Diffstat (limited to 'common.lua')
-rwxr-xr-x | common.lua | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -126,9 +126,18 @@ end function fs_helpers.cycling_button(meta, base, meta_name, values) local current_value = meta:get_int(meta_name) local new_value = (current_value + 1) % (#values) - local text = values[current_value + 1] + local val = values[current_value + 1] + local text + local texture_name = nil + --when we get a table, we know the caller wants an image_button + if type(val) == "table" then + text = val["text"] + texture_name = val["texture"] + else + text = val + end local field = "fs_helpers_cycling:"..new_value..":"..meta_name - return base..";"..field..";"..minetest.formspec_escape(text).."]" + return base..";"..(texture_name and texture_name..";" or "")..field..";"..minetest.formspec_escape(text).."]" end --------- |