- local filter = creative_inventory[player_name].filter or ""
- pagenum = math.floor(pagenum)
- local pagemax = math.floor((creative_inventory[player_name].size - 1) / (6*4) + 1)
-
- player:set_inventory_formspec(
- "size[13,7.5]"..
- --"image[6,0.6;1,2;player.png]"..
- default.gui_bg..
- default.gui_bg_img..
- default.gui_slots..
- "list[current_player;main;5,3.5;8,1;]"..
- "list[current_player;main;5,4.75;8,3;8]"..
- "list[current_player;craft;8,0;3,3;]"..
- "list[current_player;craftpreview;12,1;1,1;]"..
- "image[11,1;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
- "list[detached:creative_" .. player_name .. ";main;0.05,1;4,6;" .. tostring(start_i) .. "]"..
- "tablecolumns[color;text;color;text]"..
- "tableoptions[background=#00000000;highlight=#00000000;border=false]"..
- "table[1.4,7.2;1.1,0.5;pagenum;#FFFF00," .. tostring(pagenum) .. ",#FFFFFF,/ " .. tostring(pagemax) .. "]"..
- "button[0,7;1,1;creative_prev;<<]"..
- "button[3.08,7;1,1;creative_next;>>]"..
- "button[2.55,0.2;0.8,0.5;search;?]"..
- "button[3.3,0.2;0.8,0.5;clear;X]"..
- "tooltip[search;Search]"..
- "tooltip[clear;Reset]"..
- "listring[current_player;main]"..
- "listring[current_player;craft]"..
- "listring[current_player;main]"..
- "listring[detached:creative_" .. player_name .. ";main]"..
- "label[5,1.5;Trash:]"..
- "list[detached:creative_trash;main;5,2;1,1;]"..
- "field[0.3,0.3;2.6,1;filter;;" .. filter .. "]"..
- default.get_hotbar_bg(5,3.5)
+ local inv = player_inventory[player_name]
+ local pagenum = math.floor(start_i / (3*8) + 1)
+ local pagemax = math.ceil(inv.size / (3*8))
+
+ player:set_inventory_formspec([[
+ size[8,8.6]
+ image[4.06,3.4;0.8,0.8;creative_trash_icon.png]
+ list[current_player;main;0,4.7;8,1;]
+ list[current_player;main;0,5.85;8,3;8]
+ list[detached:creative_trash;main;4,3.3;1,1;]
+ listring[]
+ tablecolumns[color;text;color;text]
+ tableoptions[background=#00000000;highlight=#00000000;border=false]
+ button[5.4,3.2;0.8,0.9;creative_prev;<]
+ button[7.25,3.2;0.8,0.9;creative_next;>]
+ button[2.1,3.4;0.8,0.5;creative_search;?]
+ button[2.75,3.4;0.8,0.5;creative_clear;X]
+ tooltip[creative_search;Search]
+ tooltip[creative_clear;Reset]
+ listring[current_player;main]
+ ]] ..
+ "field[0.3,3.5;2.2,1;creative_filter;;" .. inv.filter .. "]" ..
+ "listring[detached:creative_" .. player_name .. ";main]" ..
+ "tabheader[0,0;creative_tabs;Crafting,All,Nodes,Tools,Items;" .. tostring(inv.tab_id) .. ";true;false]" ..
+ "list[detached:creative_" .. player_name .. ";main;0,0;8,3;" .. tostring(start_i) .. "]" ..
+ "table[6.05,3.35;1.15,0.5;pagenum;#FFFF00," .. tostring(pagenum) .. ",#FFFFFF,/ " .. tostring(pagemax) .. "]" ..
+ default.get_hotbar_bg(0,4.7) ..
+ default.gui_bg .. default.gui_bg_img .. default.gui_slots
+ .. creative.formspec_add
+ )
+end
+
+creative.set_crafting_formspec = function(player)
+ player:set_inventory_formspec([[
+ size[8,8.6]
+ list[current_player;craft;2,0.75;3,3;]
+ list[current_player;craftpreview;6,1.75;1,1;]
+ list[current_player;main;0,4.7;8,1;]
+ list[current_player;main;0,5.85;8,3;8]
+ list[detached:creative_trash;main;0,2.75;1,1;]
+ image[0.06,2.85;0.8,0.8;creative_trash_icon.png]
+ image[5,1.75;1,1;gui_furnace_arrow_bg.png^[transformR270]
+ tabheader[0,0;creative_tabs;Crafting,All,Nodes,Tools,Items;1;true;false]
+ listring[current_player;main]
+ listring[current_player;craft]
+ ]] ..
+ default.get_hotbar_bg(0,4.7) ..
+ default.gui_bg .. default.gui_bg_img .. default.gui_slots