mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-12-29 04:00:24 +01:00
don't display the refill slot image if no creative priv/mode
(leftover from when it was part of the craft grid image) Also fixed a typo in the corresponding list[] element that made it not work.
This commit is contained in:
parent
6d892dda5b
commit
8e94d86420
@ -53,14 +53,6 @@ function ui.get_formspec(player, page)
|
|||||||
formspec[3] = ui.standard_background
|
formspec[3] = ui.standard_background
|
||||||
end
|
end
|
||||||
|
|
||||||
if ui.is_creative(player_name)
|
|
||||||
and page == "craft" then -- add the "Refill" slot.
|
|
||||||
formspec[n] = string.format("image[%f,%f;%f,%f;ui_single_slot.png]",
|
|
||||||
ui_peruser.craft_x - 2.5, ui_peruser.craft_y + 2.5,
|
|
||||||
ui.imgscale, ui.imgscale)
|
|
||||||
n = n+1
|
|
||||||
end
|
|
||||||
|
|
||||||
local perplayer_formspec = ui.get_per_player_formspec(player_name)
|
local perplayer_formspec = ui.get_per_player_formspec(player_name)
|
||||||
local fsdata = pagedef.get_formspec(player, perplayer_formspec)
|
local fsdata = pagedef.get_formspec(player, perplayer_formspec)
|
||||||
|
|
||||||
|
@ -194,8 +194,11 @@ ui.register_page("craft", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
if ui.is_creative(player_name) then
|
if ui.is_creative(player_name) then
|
||||||
|
formspec[n] = string.format("image[%f,%f;%f,%f;ui_single_slot.png]",
|
||||||
|
perplayer_formspec.craft_x - 2.5, perplayer_formspec.craft_y + 2.5,
|
||||||
|
ui.imgscale, ui.imgscale)
|
||||||
formspec[n+1] = string.format("label[%f,%f;%s]", craftx - 2.3, crafty + 2.4,F(S("Refill:")))
|
formspec[n+1] = string.format("label[%f,%f;%s]", craftx - 2.3, crafty + 2.4,F(S("Refill:")))
|
||||||
formspec[n+2] = string.format("list[detached:%s;refill;main;%f,%f;1,1;]",
|
formspec[n+2] = string.format("list[detached:%srefill;main;%f,%f;1,1;]",
|
||||||
F(player_name), craftx - 2.35, crafty + 2.65)
|
F(player_name), craftx - 2.35, crafty + 2.65)
|
||||||
end
|
end
|
||||||
return {formspec=table.concat(formspec)}
|
return {formspec=table.concat(formspec)}
|
||||||
|
Loading…
Reference in New Issue
Block a user