Move crafting guide button to right side
This commit is contained in:
parent
755a103750
commit
93933a0d73
@ -278,9 +278,8 @@ form = form .. "listring[current_player;craft_out]"
|
||||
form = form .. default.ui.get_itemslot_bg(0.25, 0.25, 1, 4)
|
||||
form = form .. default.ui.get_itemslot_bg(7.25, 3.25, 1, 1)
|
||||
|
||||
-- FIXME: This is placed below the item display, so it would collide with a potential 4th item in a craft recipe
|
||||
-- As of 0.1.1, no craft used more than 3 item stacks so far.
|
||||
form = form .. default.ui.button(1.25, 3.25, 1.0, 1.0, "toggle_filter", "?", nil, S("Show all recipes/show only craftable recipes"))
|
||||
-- TODO: Use ui_icon_craftingguide_active.png when crafting guide is active
|
||||
form = form .. default.ui.tab(8.4, 0.5, "toggle_filter", "ui_icon_craftingguide.png", S("Show all recipes/show only craftable recipes"), "right")
|
||||
form = form .. default.ui.button(7.25, 1.25, 1, 1, "do_craft_1", "1")
|
||||
form = form .. default.ui.button(7.25, 2.25, 1, 1, "do_craft_10", "10")
|
||||
|
||||
|
@ -135,15 +135,27 @@ end
|
||||
|
||||
-- Tabs
|
||||
|
||||
function default.ui.tab(x, y, name, icon, tooltip)
|
||||
function default.ui.tab(x, y, name, icon, tooltip, side)
|
||||
local tooltip = tooltip or ""
|
||||
local shifted_icon = "[combine:16x16:0,0=ui_tab_active.png:0,1="..icon
|
||||
local img_active
|
||||
if side == "right" then
|
||||
img_active = "[combine:16x16:0,0=(ui_tab_active.png^[transformFX):0,1="..icon
|
||||
else
|
||||
img_active = "[combine:16x16:0,0=ui_tab_active.png:0,1="..icon
|
||||
end
|
||||
|
||||
local form = ""
|
||||
local img_inactive
|
||||
if side == "right" then
|
||||
img_inactive = "(ui_tab_inactive.png^[transformFX)^" .. icon
|
||||
else
|
||||
img_inactive = "ui_tab_inactive.png^" .. icon
|
||||
end
|
||||
|
||||
form = form .. "image_button["..x..","..y..";1,1;ui_tab_inactive.png^"
|
||||
..icon..";"..name..";;true;false;"
|
||||
..minetest.formspec_escape(shifted_icon).."]"
|
||||
form = form .. "image_button["..x..","..y..";1,1;"
|
||||
..minetest.formspec_escape(img_inactive)
|
||||
..";"..name..";;true;false;"
|
||||
..minetest.formspec_escape(img_active).."]"
|
||||
|
||||
form = form .. "tooltip["..name..";"..minetest.formspec_escape(tooltip).."]"
|
||||
|
||||
|
BIN
mods/default/textures/ui_icon_craftingguide_active.png
Normal file
BIN
mods/default/textures/ui_icon_craftingguide_active.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 161 B |
Loading…
Reference in New Issue
Block a user