@@ -150,17 +150,18 @@ function creative.register_tab(name, title, items)
150150 creative .update_creative_inventory (player_name , items )
151151 local inv = player_inventory [player_name ]
152152 local pagenum = math.floor (inv .start_i / (4 * 8 ) + 1 )
153- local pagemax = math.ceil (inv .size / (4 * 8 ))
153+ local pagemax = math.max ( math. ceil (inv .size / (4 * 8 )), 1 )
154154 local esc = minetest .formspec_escape
155155 return sfinv .make_formspec (player , context ,
156+ (inv .size == 0 and (" label[3,2;" .. esc (S (" No items to show." )).. " ]" ) or " " ) ..
156157 " label[5.8,4.15;" .. minetest .colorize (" #FFFF00" , tostring (pagenum )) .. " / " .. tostring (pagemax ) .. " ]" ..
157158 [[
158159 image[4.08,4.2;0.8,0.8;creative_trash_icon.png]
159160 listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]
160161 list[detached:trash;main;4.02,4.1;1,1;]
161162 listring[]
162163 image_button[5,4.05;0.8,0.8;creative_prev_icon.png;creative_prev;]
163- image_button[7.2 ,4.05;0.8,0.8;creative_next_icon.png;creative_next;]
164+ image_button[7.25 ,4.05;0.8,0.8;creative_next_icon.png;creative_next;]
164165 image_button[2.63,4.05;0.8,0.8;creative_search_icon.png;creative_search;]
165166 image_button[3.25,4.05;0.8,0.8;creative_clear_icon.png;creative_clear;]
166167 ]] ..
0 commit comments