From d410239bfefcee745063bf694949315f76dc74be Mon Sep 17 00:00:00 2001 From: Niklp <89982526+Niklp09@users.noreply.github.com> Date: Tue, 25 Jul 2023 21:37:34 +0200 Subject: [PATCH] Fix inventory preview with mcl2 (#84) --- README.md | 2 +- init.lua | 5 ++--- lua/api.lua | 3 +-- lua/controller.lua | 1 - 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 40c2998..0a50cc0 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ drawer upgrades to your drawer! They are available in different sizes and are crafted by steel, gold, obsidian, diamonds or mithril. ## Notes -This mod requires Minetest 0.4.14 or later. The `default` mod from MTG or the +This mod requires Minetest 5.0 or later. The `default` mod from MTG or the MineClone 2 mods are only optional dependencies for crafting recipes. ## To-Do diff --git a/init.lua b/init.lua index 85917e7..51ccc34 100755 --- a/init.lua +++ b/init.lua @@ -58,10 +58,9 @@ drawers.CONTROLLER_RANGE = 14 drawers.gui_bg = "bgcolor[#080808BB;true]" drawers.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" +drawers.inventory_list = "list[current_player;main;0.5,2.5;8,4;]" if (core.get_modpath("mcl_core")) and mcl_core then -- MCL2 - drawers.gui_bg_img = "background[5,5;1,1;crafting_creative_bg.png;true]" -else - drawers.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]" + drawers.inventory_list = "list[current_player;main;0,2.5;9,4;]" end -- diff --git a/lua/api.lua b/lua/api.lua index 2aedd25..0f9efec 100755 --- a/lua/api.lua +++ b/lua/api.lua @@ -37,11 +37,10 @@ drawers.node_box_simple = { drawers.drawer_formspec = "size[9,6.7]" .. "list[context;upgrades;2,0.5;5,1;]" .. - "list[current_player;main;0.5,2.5;8,4;]" .. + drawers.inventory_list .. "listring[context;upgrades]" .. "listring[current_player;main]" .. drawers.gui_bg .. - drawers.gui_bg_img .. drawers.gui_slots .. drawers.get_upgrade_slots_bg(2, 0.5) diff --git a/lua/controller.lua b/lua/controller.lua index e117512..9d2b9cb 100644 --- a/lua/controller.lua +++ b/lua/controller.lua @@ -51,7 +51,6 @@ local function controller_formspec(pos) local formspec = "size[8,8.5]".. drawers.gui_bg.. - drawers.gui_bg_img.. drawers.gui_slots.. "label[0,0;" .. S("Drawer Controller") .. "]" .. "list[current_name;src;3.5,1.75;1,1;]"..