diff --git a/games/default/files/3d_armor/armor.lua b/games/default/files/3d_armor/armor.lua index b69db8317..793aa70d7 100644 --- a/games/default/files/3d_armor/armor.lua +++ b/games/default/files/3d_armor/armor.lua @@ -24,27 +24,6 @@ end local time = 0 -sfinv.override_page("sfinv:crafting", { - title = "Crafting", - get = function(self, player, context) - local player_name = player:get_player_name(); - local form = [[ - listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF] - list[current_player;craft;4,1;2,1;1] - list[current_player;craft;4,2;2,1;4] - list[current_player;craftpreview;7.05,1.54;1,1;] - list[detached:split;main;7.99,3.15;1,1;] - image[1.5,0;2,4;default_player2d.png] - ]] .. - "list[detached:"..player_name.."_armor;armor;0,0;1,1;]".. - "list[detached:"..player_name.."_armor;armor;0,1;1,1;1]".. - "list[detached:"..player_name.."_armor;armor;0,2;1,1;2]".. - "list[detached:"..player_name.."_armor;armor;0,3;1,1;3]".. - "image_button_exit[8.4,-0.1;0.75,0.75;close.png;exit;;true;true;]" - return sfinv.make_formspec(player, context, form , true) - end, -}) - armor = { player_hp = {}, elements = {"head", "torso", "legs", "feet"}, diff --git a/games/default/files/3d_armor/depends.txt b/games/default/files/3d_armor/depends.txt index 975e65250..4ad96d515 100644 --- a/games/default/files/3d_armor/depends.txt +++ b/games/default/files/3d_armor/depends.txt @@ -1,2 +1 @@ default -sfinv diff --git a/games/default/files/crafting/depends.txt b/games/default/files/crafting/depends.txt new file mode 100644 index 000000000..bd9956403 --- /dev/null +++ b/games/default/files/crafting/depends.txt @@ -0,0 +1,3 @@ +default +sfinv +3d_armor? diff --git a/games/default/files/crafting/init.lua b/games/default/files/crafting/init.lua new file mode 100644 index 000000000..115c14030 --- /dev/null +++ b/games/default/files/crafting/init.lua @@ -0,0 +1,72 @@ +local show_armor = minetest.get_modpath("3d_armor") + +local function item_drop(itemstack, dropper, pos) + if dropper:is_player() then + local v = dropper:get_look_dir() + local p = {x=pos.x, y=pos.y+1.2, z=pos.z} + p.x = p.x+(math.random(1,3)*0.2) + p.z = p.z+(math.random(1,3)*0.2) + local obj = minetest.env:add_item(p, itemstack) + if obj then + v.x = v.x*4 + v.y = v.y*4 + 2 + v.z = v.z*4 + obj:setvelocity(v) + end + else + minetest.add_item(pos, itemstack) + end + return itemstack +end + +local function drop_fields(player, name) + local inv = player:get_inventory() + for i,stack in ipairs(inv:get_list(name)) do + item_drop(stack, player, player:get_pos()) + stack:clear() + inv:set_stack(name, i, stack) + end +end + +sfinv.override_page("sfinv:crafting", { + title = "Crafting", + get = function(self, player, context) + local form = [[ + background[-0.19,-0.25;9.41,9.49;crafting_gui_formbg.png] + listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF] + list[current_player;craft;4,1;2,1;1] + list[current_player;craft;4,2;2,1;4] + list[current_player;craftpreview;7.05,1.54;1,1;] + list[detached:split;main;7.99,3.15;1,1;] + image[1.5,0;2,4;default_player2d.png] + image_button_exit[8.4,-0.1;0.75,0.75;close.png;exit;;true;true] + ]] + if show_armor then + local player_name = player:get_player_name() + form = form .. + "list[detached:"..player_name.."_armor;armor;0,0;1,1;]".. + "list[detached:"..player_name.."_armor;armor;0,1;1,1;1]".. + "list[detached:"..player_name.."_armor;armor;0,2;1,1;2]".. + "list[detached:"..player_name.."_armor;armor;0,3;1,1;3]" + end + return sfinv.make_formspec(player, context, form, true) + end, + on_player_receive_fields = function(self, player, context, fields) + if fields.quit then + drop_fields(player, "craft") + end + end, +}) + +local split_inv = minetest.create_detached_inventory("split", { + allow_move = function(_, _, _, _, _, count, _) + return count + end, + allow_put = function(_, _, _, stack, _) + return stack:get_count() / 2 + end, + allow_take = function(_, _, _, stack, _) + return stack:get_count() + end, +}) +split_inv:set_size("main", 1) diff --git a/games/default/files/crafting/textures/crafting_gui_formbg.png b/games/default/files/crafting/textures/crafting_gui_formbg.png new file mode 100644 index 000000000..7d8e39ae9 Binary files /dev/null and b/games/default/files/crafting/textures/crafting_gui_formbg.png differ diff --git a/games/default/files/creative/inventory.lua b/games/default/files/creative/inventory.lua index 49c547430..391b51ccc 100644 --- a/games/default/files/creative/inventory.lua +++ b/games/default/files/creative/inventory.lua @@ -1,6 +1,67 @@ local player_inventory = {} local inventory_cache = {} +local offset = {} +local hoch = {} +local bg = {} + +offset["blocks"] = "-0.29,-0.25" +offset["deco"] = "0.98,-0.25" +offset["mese"] = "2.23,-0.25" +offset["rail"] = "3.495,-0.25" +offset["misc"] = "4.75,-0.25" +offset["all"] = "8.99,-0.25" +offset["food"] = "-0.29,8.12" +offset["tools"] = "0.98,8.12" +offset["combat"] = "2.23,8.12" +offset["brew"] = "4.78,8.12" +offset["matr"] = "3.495,8.12" +offset["inv"] = "8.99,8.12" + +hoch["blocks"] = "" +hoch["deco"] = "" +hoch["mese"] = "" +hoch["rail"] = "" +hoch["misc"] = "" +hoch["all"] = "" +hoch["food"] = "^[transformfy" +hoch["tools"] = "^[transformfy" +hoch["combat"] = "^[transformfy" +hoch["brew"] = "^[transformfy" +hoch["matr"] = "^[transformfy" +hoch["inv"] = "^[transformfy" + +local dark_bg = "crafting_creative_bg_dark.png" + +local function reset_menu_item_bg() + bg["blocks"] = dark_bg + bg["deco"] = dark_bg + bg["mese"] = dark_bg + bg["rail"] = dark_bg + bg["misc"] = dark_bg + bg["all"] = dark_bg + bg["food"] = dark_bg + bg["tools"] = dark_bg + bg["combat"] = dark_bg + bg["brew"] = dark_bg + bg["matr"] = dark_bg + bg["inv"] = dark_bg +end + +local function get_item_list(group) + local item_list = {} + for name, def in pairs(minetest.registered_items) do + if (not def.groups.not_in_creative_inventory or + def.groups.not_in_creative_inventory == 0) and + def.description and def.description ~= "" then + if minetest.get_item_group(name, group) > 0 then + item_list[name] = def + end + end + end + return item_list +end + local function init_creative_cache(items) inventory_cache[items] = {} local i_cache = inventory_cache[items] @@ -90,6 +151,63 @@ trash:set_size("main", 1) creative.formspec_add = "" +local function get_creative_formspec(player_name, start_i, pagenum, page, pagemax) + reset_menu_item_bg() + pagenum = math.floor(pagenum) or 1 + local slider_height = 4 / pagemax + local slider_pos = slider_height * (pagenum - 1) + 2.2 + local formspec = "" + local main_list = "list[detached:creative_" .. player_name .. + ";main;0,1.75;9,5;"..tostring(start_i).."]" + local name = "all" + if page ~= nil then name = page end + bg[name] = "crafting_creative_bg.png" + if name == "inv" then + main_list = "image[-0.2,1.7;11.35,2.33;crafting_creative_bg.png]".. + "image[-0.3,0.15;3,4.3;crafting_inventory_armor2.png]".. + "list[current_player;main;0,3.75;9,3;9]".. + "list[detached:"..player_name.."_armor;armor;0.02,1.7;1,1;]".. + "list[detached:"..player_name.."_armor;armor;0.02,2.7;1,1;1]".. + "list[detached:"..player_name.."_armor;armor;0.98,1.7;1,1;2]".. + "list[detached:"..player_name.."_armor;armor;0.98,2.7;1,1;3]" + end + local formspec = "image_button_exit[8.4,-0.1;0.75,0.75;close.png;exit;;true;true;]".. + "background[-0.19,-0.25;10.5,9.87;crafting_inventory_creative.png]".. + "bgcolor[#080808BB;true]".. + "listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]".. + "label[-5,-5;"..name.."]".. + "image[" .. offset[name] .. ";1.5,1.44;crafting_creative_active.png"..hoch[name].."]".. + "image_button[-0.1,0;1,1;"..bg["blocks"].."^crafting_creative_build.png;build;]".. --build blocks + "image_button[1.15,0;1,1;"..bg["deco"].."^crafting_creative_deko.png;deco;]".. --decoration blocks + "image_button[2.415,0;1,1;"..bg["mese"].."^crafting_creative_mese.png;mese;]".. --bluestone + "image_button[3.693,0;1,1;"..bg["rail"].."^crafting_creative_rail.png;rail;]".. --transportation + "image_button[4.93,0;1,1;"..bg["misc"].."^crafting_creative_misc.png;misc;]".. --miscellaneous + "image_button[9.19,0;1,1;"..bg["all"].."^crafting_creative_all.png;default;]".. --search + "image[0,1;5,0.75;fnt_"..name..".png]".. + "list[current_player;main;0,7;9,1;]".. + main_list.. + "image_button[9.03,1.74;0.85,0.6;crafting_creative_up.png;creative_prev;]".. + "image_button[9.03,6.15;0.85,0.6;crafting_creative_down.png;creative_next;]".. + "image_button[-0.1,8.28;1,1;"..bg["food"].."^crafting_food.png;food;]".. --foodstuff + "image_button[1.15,8.28;1,1;"..bg["tools"].."^crafting_creative_tool.png;tools;]".. --tools + "image_button[2.415,8.28;1,1;"..bg["combat"].."^crafting_creative_sword.png;combat;]".. --combat + "image_button[3.693,8.28;1,1;"..bg["matr"].."^crafting_creative_matr.png;matr;]".. --brewing + "image_button[4.93,8.28;1,1;"..bg["brew"].."^crafting_inventory_brew.png;brew;]".. --materials^ + "image_button[9.19,8.28;1,1;"..bg["inv"].."^crafting_creative_inv.png;inv;]".. --inventory + "list[detached:creative_trash;main;9,7;1,1;]".. + "image[9,7;1,1;crafting_creative_trash.png]".. + "image[9.04," .. tostring(slider_pos) .. ";0.78,"..tostring(slider_height) .. ";crafting_slider.png]" + + if name == "all" then + formspec = formspec .. "field_close_on_enter[suche;false]" .. + "field[5.3,1.3;4,0.75;suche;;]" + end + if pagenum ~= nil then + formspec = formspec .. "p"..tostring(pagenum) + end + return formspec +end + function creative.register_tab(name, title, items) sfinv.register_page("creative:" .. name, { title = title, @@ -101,34 +219,11 @@ function creative.register_tab(name, title, items) creative.update_creative_inventory(player_name, items) local inv = player_inventory[player_name] local start_i = inv.start_i or 0 - local pagenum = math.floor(start_i / (3*9) + 1) - local pagemax = math.ceil(inv.size / (3*9)) - return sfinv.make_formspec(player, context, - "label[6.75,3.85;" .. minetest.colorize("#FFFF00", tostring(pagenum)) .. " / " .. tostring(pagemax) .. "]" .. - [[ - background[-0.19,-0.25;9.41,10.48;creative_gui_formbg.png] - image[4,3.7;1,1;creative_trash_icon.png] - listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF] - list[current_player;main;0,5.5;9,3;9] - list[current_player;main;0,8.74;9,1;] - list[detached:creative_trash;main;4,3.7;1,1;] - listring[] - button[5.5.0,3.7;0.8,0.9;creative_prev;<] - button[8.25,3.7;0.8,0.9;creative_next;>] - button[2.1,3.9;0.8,0.5;creative_search;?] - button[2.75,3.9;0.8,0.5;creative_clear;X] - tooltip[creative_search;Search] - tooltip[creative_clear;Reset] - tooltip[creative_prev;Previous page] - tooltip[creative_next;Next page] - listring[current_player;main] - field_close_on_enter[creative_filter;false] - ]] .. - "field[0.3,4.0;2.2,1;creative_filter;;" .. minetest.formspec_escape(inv.filter) .. "]" .. - "listring[detached:creative_" .. player_name .. ";main]" .. - "list[detached:creative_" .. player_name .. ";main;0,0.5;9,3;" .. tostring(start_i) .. "]" .. - "image_button_exit[8.4,-0.1;0.75,0.75;close.png;exit;;true;true;]".. - creative.formspec_add, false, "size[9,9.75]") + local pagenum = math.floor(start_i / (5*9) + 1) + local pagemax = math.ceil(inv.size / (5*9)) + local formspec = get_creative_formspec(player_name, start_i, + pagenum, name, pagemax) + return sfinv.make_formspec(player, context, formspec, false, "size[10,9.3]") end, on_enter = function(self, player, context) local player_name = player:get_player_name() @@ -142,30 +237,48 @@ function creative.register_tab(name, title, items) local inv = player_inventory[player_name] assert(inv) - if fields.creative_clear then + if fields.build then + sfinv.set_page(player, "creative:blocks") + elseif fields.deco then + sfinv.set_page(player, "creative:deco") + elseif fields.mese then + sfinv.set_page(player, "creative:mese") + elseif fields.rail then + sfinv.set_page(player, "creative:rail") + elseif fields.misc then + sfinv.set_page(player, "creative:misc") + elseif fields.default then + sfinv.set_page(player, "creative:all") + elseif fields.food then + sfinv.set_page(player, "creative:food") + elseif fields.tools then + sfinv.set_page(player, "creative:tools") + elseif fields.combat then + sfinv.set_page(player, "creative:combat") + elseif fields.matr then + sfinv.set_page(player, "creative:matr") + elseif fields.inv then + sfinv.set_page(player, "creative:inv") + elseif fields.brew then + sfinv.set_page(player, "creative:brew") + elseif fields.suche and + fields.key_enter_field == "suche" then inv.start_i = 0 - inv.filter = "" - creative.update_creative_inventory(player_name, items) - sfinv.set_player_inventory_formspec(player, context) - elseif fields.creative_search or - fields.key_enter_field == "creative_filter" then - inv.start_i = 0 - inv.filter = fields.creative_filter:lower() + inv.filter = fields.suche:lower() creative.update_creative_inventory(player_name, items) sfinv.set_player_inventory_formspec(player, context) elseif not fields.quit then local start_i = inv.start_i or 0 - if fields.creative_prev then - start_i = start_i - 3*9 + start_i = start_i - 5*9 if start_i < 0 then - start_i = inv.size - (inv.size % (3*9)) + start_i = inv.size - (inv.size % (5*9)) if inv.size == start_i then - start_i = math.max(0, inv.size - (3*9)) + start_i = math.max(0, inv.size - (5*9)) end end elseif fields.creative_next then - start_i = start_i + 3*9 + start_i = start_i + 5*9 if start_i >= inv.size then start_i = 0 end @@ -179,9 +292,19 @@ function creative.register_tab(name, title, items) end creative.register_tab("all", "All", minetest.registered_items) -creative.register_tab("nodes", "Nodes", minetest.registered_nodes) -creative.register_tab("tools", "Tools", minetest.registered_tools) -creative.register_tab("craftitems", "Items", minetest.registered_craftitems) +creative.register_tab("inv", "Inv", {}) +minetest.after(0, function() + creative.register_tab("blocks", "1", get_item_list("building")) + creative.register_tab("deco", "2", get_item_list("decorative")) + creative.register_tab("mese", "3", get_item_list("mese")) + creative.register_tab("rail", "4", get_item_list("rail")) + creative.register_tab("misc", "5", get_item_list("misc")) + creative.register_tab("food", "6", get_item_list("foodstuffs")) + creative.register_tab("tools", "7", get_item_list("tools")) + creative.register_tab("combat", "8", get_item_list("combat")) + creative.register_tab("matr", "9", get_item_list("materials")) + creative.register_tab("brew", "10", get_item_list("brewing")) +end) local old_homepage_name = sfinv.get_homepage_name function sfinv.get_homepage_name(player) diff --git a/games/default/files/creative/textures/crafting_armor_boots.png b/games/default/files/creative/textures/crafting_armor_boots.png new file mode 100644 index 000000000..3721cb151 Binary files /dev/null and b/games/default/files/creative/textures/crafting_armor_boots.png differ diff --git a/games/default/files/creative/textures/crafting_armor_chest.png b/games/default/files/creative/textures/crafting_armor_chest.png new file mode 100644 index 000000000..2cf93b655 Binary files /dev/null and b/games/default/files/creative/textures/crafting_armor_chest.png differ diff --git a/games/default/files/creative/textures/crafting_armor_helmet.png b/games/default/files/creative/textures/crafting_armor_helmet.png new file mode 100644 index 000000000..61e1afb7c Binary files /dev/null and b/games/default/files/creative/textures/crafting_armor_helmet.png differ diff --git a/games/default/files/creative/textures/crafting_armor_legs.png b/games/default/files/creative/textures/crafting_armor_legs.png new file mode 100644 index 000000000..c0e076851 Binary files /dev/null and b/games/default/files/creative/textures/crafting_armor_legs.png differ diff --git a/games/default/files/creative/textures/crafting_creative_active.png b/games/default/files/creative/textures/crafting_creative_active.png new file mode 100644 index 000000000..d80ff4a6e Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_active.png differ diff --git a/games/default/files/creative/textures/crafting_creative_all.png b/games/default/files/creative/textures/crafting_creative_all.png new file mode 100644 index 000000000..c83f82c58 Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_all.png differ diff --git a/games/default/files/creative/textures/crafting_creative_bg.png b/games/default/files/creative/textures/crafting_creative_bg.png new file mode 100644 index 000000000..49778cb9a Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_bg.png differ diff --git a/games/default/files/creative/textures/crafting_creative_bg_dark.png b/games/default/files/creative/textures/crafting_creative_bg_dark.png new file mode 100644 index 000000000..bda61b56f Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_bg_dark.png differ diff --git a/games/default/files/creative/textures/crafting_creative_build.png b/games/default/files/creative/textures/crafting_creative_build.png new file mode 100644 index 000000000..eed465005 Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_build.png differ diff --git a/games/default/files/creative/textures/crafting_creative_deko.png b/games/default/files/creative/textures/crafting_creative_deko.png new file mode 100644 index 000000000..c47dd91c5 Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_deko.png differ diff --git a/games/default/files/creative/textures/crafting_creative_down.png b/games/default/files/creative/textures/crafting_creative_down.png new file mode 100644 index 000000000..c4b95716f Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_down.png differ diff --git a/games/default/files/creative/textures/crafting_creative_inv.png b/games/default/files/creative/textures/crafting_creative_inv.png new file mode 100644 index 000000000..a8a716953 Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_inv.png differ diff --git a/games/default/files/creative/textures/crafting_creative_matr.png b/games/default/files/creative/textures/crafting_creative_matr.png new file mode 100644 index 000000000..3d7597cc6 Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_matr.png differ diff --git a/games/default/files/creative/textures/crafting_creative_mese.png b/games/default/files/creative/textures/crafting_creative_mese.png new file mode 100644 index 000000000..6a0e8c63d Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_mese.png differ diff --git a/games/default/files/creative/textures/crafting_creative_misc.png b/games/default/files/creative/textures/crafting_creative_misc.png new file mode 100644 index 000000000..5eb9dd0f0 Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_misc.png differ diff --git a/games/default/files/creative/textures/crafting_creative_rail.png b/games/default/files/creative/textures/crafting_creative_rail.png new file mode 100644 index 000000000..3a971a0a4 Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_rail.png differ diff --git a/games/default/files/creative/textures/crafting_creative_sword.png b/games/default/files/creative/textures/crafting_creative_sword.png new file mode 100644 index 000000000..05a0113e2 Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_sword.png differ diff --git a/games/default/files/creative/textures/crafting_creative_tool.png b/games/default/files/creative/textures/crafting_creative_tool.png new file mode 100644 index 000000000..5ab5ff7dc Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_tool.png differ diff --git a/games/default/files/creative/textures/creative_trash_icon.png b/games/default/files/creative/textures/crafting_creative_trash.png similarity index 100% rename from games/default/files/creative/textures/creative_trash_icon.png rename to games/default/files/creative/textures/crafting_creative_trash.png diff --git a/games/default/files/creative/textures/crafting_creative_up.png b/games/default/files/creative/textures/crafting_creative_up.png new file mode 100644 index 000000000..5bddb169a Binary files /dev/null and b/games/default/files/creative/textures/crafting_creative_up.png differ diff --git a/games/default/files/creative/textures/crafting_food.png b/games/default/files/creative/textures/crafting_food.png new file mode 100644 index 000000000..c2f8527e6 Binary files /dev/null and b/games/default/files/creative/textures/crafting_food.png differ diff --git a/games/default/files/creative/textures/crafting_formspec_inv.png b/games/default/files/creative/textures/crafting_formspec_inv.png new file mode 100644 index 000000000..7d8e39ae9 Binary files /dev/null and b/games/default/files/creative/textures/crafting_formspec_inv.png differ diff --git a/games/default/files/creative/textures/crafting_inventory_armor2.png b/games/default/files/creative/textures/crafting_inventory_armor2.png new file mode 100644 index 000000000..4d6752c28 Binary files /dev/null and b/games/default/files/creative/textures/crafting_inventory_armor2.png differ diff --git a/games/default/files/creative/textures/crafting_inventory_brew.png b/games/default/files/creative/textures/crafting_inventory_brew.png new file mode 100644 index 000000000..45083fc5b Binary files /dev/null and b/games/default/files/creative/textures/crafting_inventory_brew.png differ diff --git a/games/default/files/creative/textures/crafting_inventory_chest.png b/games/default/files/creative/textures/crafting_inventory_chest.png new file mode 100644 index 000000000..083eb3763 Binary files /dev/null and b/games/default/files/creative/textures/crafting_inventory_chest.png differ diff --git a/games/default/files/creative/textures/crafting_inventory_creative.png b/games/default/files/creative/textures/crafting_inventory_creative.png new file mode 100644 index 000000000..038c3a09b Binary files /dev/null and b/games/default/files/creative/textures/crafting_inventory_creative.png differ diff --git a/games/default/files/creative/textures/crafting_player2d.png b/games/default/files/creative/textures/crafting_player2d.png new file mode 100644 index 000000000..b6dab9d7e Binary files /dev/null and b/games/default/files/creative/textures/crafting_player2d.png differ diff --git a/games/default/files/creative/textures/crafting_slider.png b/games/default/files/creative/textures/crafting_slider.png new file mode 100644 index 000000000..d51eea155 Binary files /dev/null and b/games/default/files/creative/textures/crafting_slider.png differ diff --git a/games/default/files/creative/textures/creative_gui_formbg.png b/games/default/files/creative/textures/creative_gui_formbg.png deleted file mode 100644 index 8238a49e6..000000000 Binary files a/games/default/files/creative/textures/creative_gui_formbg.png and /dev/null differ diff --git a/games/default/files/creative/textures/fnt_all.png b/games/default/files/creative/textures/fnt_all.png new file mode 100644 index 000000000..963fdda6d Binary files /dev/null and b/games/default/files/creative/textures/fnt_all.png differ diff --git a/games/default/files/creative/textures/fnt_blocks.png b/games/default/files/creative/textures/fnt_blocks.png new file mode 100644 index 000000000..dd49aa2d8 Binary files /dev/null and b/games/default/files/creative/textures/fnt_blocks.png differ diff --git a/games/default/files/creative/textures/fnt_brew.png b/games/default/files/creative/textures/fnt_brew.png new file mode 100644 index 000000000..e3b631db6 Binary files /dev/null and b/games/default/files/creative/textures/fnt_brew.png differ diff --git a/games/default/files/creative/textures/fnt_combat.png b/games/default/files/creative/textures/fnt_combat.png new file mode 100644 index 000000000..e2e35be61 Binary files /dev/null and b/games/default/files/creative/textures/fnt_combat.png differ diff --git a/games/default/files/creative/textures/fnt_deco.png b/games/default/files/creative/textures/fnt_deco.png new file mode 100644 index 000000000..ff07c19b2 Binary files /dev/null and b/games/default/files/creative/textures/fnt_deco.png differ diff --git a/games/default/files/creative/textures/fnt_food.png b/games/default/files/creative/textures/fnt_food.png new file mode 100644 index 000000000..c575f02a0 Binary files /dev/null and b/games/default/files/creative/textures/fnt_food.png differ diff --git a/games/default/files/creative/textures/fnt_inv.png b/games/default/files/creative/textures/fnt_inv.png new file mode 100644 index 000000000..a513a20e0 Binary files /dev/null and b/games/default/files/creative/textures/fnt_inv.png differ diff --git a/games/default/files/creative/textures/fnt_matr.png b/games/default/files/creative/textures/fnt_matr.png new file mode 100644 index 000000000..538a7d0aa Binary files /dev/null and b/games/default/files/creative/textures/fnt_matr.png differ diff --git a/games/default/files/creative/textures/fnt_mese.png b/games/default/files/creative/textures/fnt_mese.png new file mode 100644 index 000000000..62cc092dd Binary files /dev/null and b/games/default/files/creative/textures/fnt_mese.png differ diff --git a/games/default/files/creative/textures/fnt_misc.png b/games/default/files/creative/textures/fnt_misc.png new file mode 100644 index 000000000..b12930f40 Binary files /dev/null and b/games/default/files/creative/textures/fnt_misc.png differ diff --git a/games/default/files/creative/textures/fnt_rail.png b/games/default/files/creative/textures/fnt_rail.png new file mode 100644 index 000000000..52c82f3a6 Binary files /dev/null and b/games/default/files/creative/textures/fnt_rail.png differ diff --git a/games/default/files/creative/textures/fnt_tools.png b/games/default/files/creative/textures/fnt_tools.png new file mode 100644 index 000000000..6d57024b6 Binary files /dev/null and b/games/default/files/creative/textures/fnt_tools.png differ diff --git a/games/default/files/sfinv/api.lua b/games/default/files/sfinv/api.lua index 3f414fa8d..e0ce4f75b 100644 --- a/games/default/files/sfinv/api.lua +++ b/games/default/files/sfinv/api.lua @@ -4,7 +4,7 @@ sfinv = { contexts = {}, enabled = true, gui_bg = "bgcolor[#080808BB;true]", - gui_bg_img = "background[-0.19,-0.25;9.41,9.49;gui_formbg.png]", + gui_bg_img = "", gui_slots = "listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]", } @@ -30,13 +30,15 @@ function sfinv.override_page(name, def) end function sfinv.get_nav_fs(player, context, nav, current_idx) - -- Only show tabs if there is more than one page + --[[ Only show tabs if there is more than one page if #nav > 1 then return "tabheader[0,0;sfinv_nav_tabs;" .. table.concat(nav, ",") .. ";" .. current_idx .. ";true;false]" else return "" end + ]]-- + return "" end local theme_main = "bgcolor[#080808BB;true]" .. sfinv.gui_bg .. diff --git a/games/default/files/sfinv/init.lua b/games/default/files/sfinv/init.lua index dd964840f..8e5d29734 100644 --- a/games/default/files/sfinv/init.lua +++ b/games/default/files/sfinv/init.lua @@ -4,26 +4,8 @@ sfinv.register_page("sfinv:crafting", { title = "Crafting", get = function(self, player, context) return sfinv.make_formspec(player, context, [[ - listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF] - list[current_player;craft;4,1;2,1;1] - list[current_player;craft;4,2;2,1;4] - list[current_player;craftpreview;7.05,1.54;1,1;] - list[detached:split;main;7.99,3.15;1,1;] - image[1.5,0;2,4;default_player2d.png;] - image_button_exit[8.4,-0.1;0.75,0.75;close.png;exit;;true;true] + list[current_player;craft;1.75,0.5;3,3;] + list[current_player;craftpreview;5.75,1.5;1,1;] ]], true) end }) - -local split_inv = minetest.create_detached_inventory("split", { - allow_move = function(_, _, _, _, _, count, _) - return count - end, - allow_put = function(_, _, _, stack, _) - return stack:get_count() / 2 - end, - allow_take = function(_, _, _, stack, _) - return stack:get_count() - end, -}) -split_inv:set_size("main", 1)