Use label instead of extra texture

This commit is contained in:
NO11 2021-11-13 17:26:17 +00:00
parent 1483c45cc9
commit bcb6251d20

@ -1,5 +1,6 @@
local S = minetest.get_translator(minetest.get_current_modname())
local F = minetest.formspec_escape
local C = minetest.colorize
-- Prepare player info table
local players = {}
@ -360,10 +361,7 @@ function mcl_inventory.set_creative_formspec(player, start_i, pagenum, inv_size,
armor_slot_imgs = armor_slot_imgs .. "image[5.5,2.75;1,1;mcl_inventory_empty_armor_slot_boots.png]"
end
local switch_overlay = "blank.png"
if get_stack_size(player) == 64 then
switch_overlay = "mcl_inventory_button_switch_stack.png"
end
local stack_size = get_stack_size(player)
-- Survival inventory slots
main_list = "list[current_player;main;0,3.75;9,3;9]"..
@ -394,7 +392,8 @@ function mcl_inventory.set_creative_formspec(player, start_i, pagenum, inv_size,
--"style_type[image_button;border=;bgimg=;bgimg_pressed=]"..
"tooltip[__mcl_achievements;"..F(S("Achievements")).."]"..
-- switch stack size button
"image_button[9,5;1,1;default_apple.png^" .. switch_overlay .. ";__switch_stack;]"..
"image_button[9,5;1,1;default_apple.png;__switch_stack;]"..
"label[9.4,5.4;".. F(C("#FFFFFF", stack_size ~= 1 and stack_size or "")) .."]"..
"tooltip[__switch_stack;"..F(S("Switch stack size")).."]"
-- For shortcuts