From a84f7935fa01eea7531e3d233bd5acae7e683930 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 7 Mar 2019 12:42:08 +0100 Subject: [PATCH] Revert "Utilize formspec prepend" This reverts commit ea0c2e9568dcb9d63f777ac62307af65c9a47603. --- mods/CORE/mcl_formspec_prepend/init.lua | 6 ------ mods/CORE/mcl_formspec_prepend/mod.conf | 2 -- mods/CORE/mcl_init/init.lua | 7 +++++++ mods/ENTITIES/mobs_mc/villager.lua | 1 + mods/HELP/mcl_craftguide/init.lua | 2 ++ mods/HUD/mcl_inventory/creative.lua | 1 + mods/HUD/mcl_inventory/init.lua | 1 + mods/ITEMS/REDSTONE/mcl_dispensers/depends.txt | 1 + mods/ITEMS/REDSTONE/mcl_dispensers/init.lua | 1 + mods/ITEMS/REDSTONE/mcl_droppers/depends.txt | 1 + mods/ITEMS/REDSTONE/mcl_droppers/init.lua | 1 + mods/ITEMS/mcl_anvils/depends.txt | 1 + mods/ITEMS/mcl_anvils/init.lua | 1 + mods/ITEMS/mcl_beds/functions.lua | 2 +- mods/ITEMS/mcl_chests/depends.txt | 1 + mods/ITEMS/mcl_chests/init.lua | 5 +++++ mods/ITEMS/mcl_crafting_table/depends.txt | 1 + mods/ITEMS/mcl_crafting_table/init.lua | 1 + mods/ITEMS/mcl_furnaces/depends.txt | 1 + mods/ITEMS/mcl_furnaces/init.lua | 2 ++ mods/ITEMS/mcl_hoppers/init.lua | 1 + 21 files changed, 31 insertions(+), 9 deletions(-) delete mode 100644 mods/CORE/mcl_formspec_prepend/init.lua delete mode 100644 mods/CORE/mcl_formspec_prepend/mod.conf diff --git a/mods/CORE/mcl_formspec_prepend/init.lua b/mods/CORE/mcl_formspec_prepend/init.lua deleted file mode 100644 index 8babbd728..000000000 --- a/mods/CORE/mcl_formspec_prepend/init.lua +++ /dev/null @@ -1,6 +0,0 @@ -minetest.register_on_joinplayer(function(player) - local bg = ""--"bgcolor[#080808BB;true]" - local slots = "listcolors[#9990;#FFF7;#FFF0;#000;#FFF]" - local prepend = bg .. slots --- player:set_formspec_prepend(prepend) -end) diff --git a/mods/CORE/mcl_formspec_prepend/mod.conf b/mods/CORE/mcl_formspec_prepend/mod.conf deleted file mode 100644 index b724158a4..000000000 --- a/mods/CORE/mcl_formspec_prepend/mod.conf +++ /dev/null @@ -1,2 +0,0 @@ -name = mcl_formspec_prepend -description = Set formspec prepend string for all players diff --git a/mods/CORE/mcl_init/init.lua b/mods/CORE/mcl_init/init.lua index fda683e0a..de50bf00a 100644 --- a/mods/CORE/mcl_init/init.lua +++ b/mods/CORE/mcl_init/init.lua @@ -1,6 +1,13 @@ -- Some global variables (don't overwrite them!) mcl_vars = {} +--- GUI / inventory menu colors +mcl_vars.gui_slots = "listcolors[#9990;#FFF7;#FFF0;#000;#FFF]" +mcl_vars.gui_bg = "bgcolor[#080808BB;true]" +mcl_vars.gui_bg_img = "" + +mcl_vars.inventory_header = mcl_vars.gui_slots .. mcl_vars.gui_bg + -- Mapgen variables local mg_name = minetest.get_mapgen_setting("mg_name") local minecraft_height_limit = 256 diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index d96dfd169..e2d91310d 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -491,6 +491,7 @@ local function show_trade_formspec(playername, trader, tradenum) "size[9,8.75]" .."background[-0.19,-0.25;9.41,9.49;mobs_mc_trading_formspec_bg.png]" ..disabled_img + ..mcl_vars.inventory_header .."label[4,0;"..minetest.formspec_escape(profession).."]" .."list[current_player;main;0,4.5;9,3;9]" .."list[current_player;main;0,7.74;9,1;]" diff --git a/mods/HELP/mcl_craftguide/init.lua b/mods/HELP/mcl_craftguide/init.lua index a8c75cbf6..6b3d41328 100644 --- a/mods/HELP/mcl_craftguide/init.lua +++ b/mods/HELP/mcl_craftguide/init.lua @@ -315,6 +315,8 @@ function craftguide:get_formspec(player_name, is_fuel) data.pagemax = max(1, ceil(#data.items / ipp)) local formspec = "size["..data.iX..","..(iY+3)..".6;]".. + mcl_vars.gui_slots .. + mcl_vars.gui_bg .. [=[background[1,1;1,1;craftguide_bg.png;true] button[2.4,0.21;0.8,0.5;search;?] button[3.05,0.21;0.8,0.5;clear;X] diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index e7d09ce01..536cc56a1 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -378,6 +378,7 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz end formspec = "size[10,9.3]".. + mcl_vars.inventory_header.. "background[-0.19,-0.25;10.5,9.87;"..inv_bg.."]".. "label[-5,-5;"..name.."]".. tab(name, "blocks") .. diff --git a/mods/HUD/mcl_inventory/init.lua b/mods/HUD/mcl_inventory/init.lua index cea5ffd01..bed3c4850 100644 --- a/mods/HUD/mcl_inventory/init.lua +++ b/mods/HUD/mcl_inventory/init.lua @@ -86,6 +86,7 @@ local function set_inventory(player, armor_change_only) local form = "size[9,8.75]".. "background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png]".. + mcl_vars.inventory_header.. player_preview.. --armor "list[detached:"..player_name.."_armor;armor;0,0;1,1;1]".. diff --git a/mods/ITEMS/REDSTONE/mcl_dispensers/depends.txt b/mods/ITEMS/REDSTONE/mcl_dispensers/depends.txt index a6648be24..c17d2db09 100644 --- a/mods/ITEMS/REDSTONE/mcl_dispensers/depends.txt +++ b/mods/ITEMS/REDSTONE/mcl_dispensers/depends.txt @@ -1,3 +1,4 @@ +mcl_init mesecons mcl_sounds mcl_tnt diff --git a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua index 98b297a42..2c3c6b789 100644 --- a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua @@ -13,6 +13,7 @@ local setup_dispenser = function(pos) -- Set formspec and inventory local form = "size[9,8.75]".. "background[-0.19,-0.25;9.41,9.49;crafting_inventory_9_slots.png]".. + mcl_vars.inventory_header.. "image[3,-0.2;5,0.75;mcl_dispensers_fnt_dispenser.png]".. "list[current_player;main;0,4.5;9,3;9]".. "list[current_player;main;0,7.74;9,1;]".. diff --git a/mods/ITEMS/REDSTONE/mcl_droppers/depends.txt b/mods/ITEMS/REDSTONE/mcl_droppers/depends.txt index 3abc2f249..d8d7ca50f 100644 --- a/mods/ITEMS/REDSTONE/mcl_droppers/depends.txt +++ b/mods/ITEMS/REDSTONE/mcl_droppers/depends.txt @@ -1,3 +1,4 @@ +mcl_init mesecons mcl_util doc? diff --git a/mods/ITEMS/REDSTONE/mcl_droppers/init.lua b/mods/ITEMS/REDSTONE/mcl_droppers/init.lua index baa453e76..be42e79a4 100644 --- a/mods/ITEMS/REDSTONE/mcl_droppers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_droppers/init.lua @@ -13,6 +13,7 @@ local setup_dropper = function(pos) -- Set formspec and inventory local form = "size[9,8.75]".. "background[-0.19,-0.25;9.41,9.49;crafting_inventory_9_slots.png]".. + mcl_vars.inventory_header.. "image[3,-0.2;5,0.75;mcl_droppers_fnt_dropper.png]".. "list[current_player;main;0,4.5;9,3;9]".. "list[current_player;main;0,7.74;9,1;]".. diff --git a/mods/ITEMS/mcl_anvils/depends.txt b/mods/ITEMS/mcl_anvils/depends.txt index a2749e992..021df7cb0 100644 --- a/mods/ITEMS/mcl_anvils/depends.txt +++ b/mods/ITEMS/mcl_anvils/depends.txt @@ -1,3 +1,4 @@ +mcl_init mcl_sounds mcl_core? screwdriver? diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index 790541cbe..8b3717a34 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -15,6 +15,7 @@ local function get_anvil_formspec(set_name) end return "size[9,8.75]".. "background[-0.19,-0.25;9.41,9.49;mcl_anvils_inventory.png]".. + mcl_vars.inventory_header.. "list[current_player;main;0,4.5;9,3;9]".. "list[current_player;main;0,7.74;9,1;]".. "list[context;input;1,2.5;1,1;]".. diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index e91094812..0f5716098 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -196,7 +196,7 @@ end local function update_formspecs(finished) local ges = #minetest.get_connected_players() - local form_n = "size[8,15;true]no_prepend[]" + local form_n = "size[8,15;true]" local all_in_bed = ges == player_in_bed local night_skip = is_night_skip_enabled() local button_leave = "button_exit[2,12;4,0.75;leave;Leave bed]" diff --git a/mods/ITEMS/mcl_chests/depends.txt b/mods/ITEMS/mcl_chests/depends.txt index 114024130..cd00aa229 100644 --- a/mods/ITEMS/mcl_chests/depends.txt +++ b/mods/ITEMS/mcl_chests/depends.txt @@ -1,3 +1,4 @@ +mcl_init mcl_core mcl_sounds mcl_end diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index 770e05bae..57c991ce3 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -170,6 +170,7 @@ minetest.register_node("mcl_chests:"..basename, { minetest.show_formspec(clicker:get_player_name(), "mcl_chests:"..formspec_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z, "size[9,8.75]".. + mcl_vars.inventory_header.. "background[-0.19,-0.25;9.41,10.48;mcl_chests_inventory_chest.png]".. "image[0,-0.2;5,0.75;mcl_chests_fnt_chest.png]".. "list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]".. @@ -292,6 +293,7 @@ minetest.register_node("mcl_chests:"..basename.."_left", { "mcl_chests:"..formspec_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z, "size[9,11.5]".. "background[-0.19,-0.25;9.41,12.5;mcl_chests_inventory_chest_large.png]".. + mcl_vars.inventory_header.. "list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]".. "list[nodemeta:"..pos_other.x..","..pos_other.y..","..pos_other.z..";main;0,3.5;9,3;]".. "list[current_player;main;0,7.5;9,3;9]".. @@ -413,6 +415,7 @@ minetest.register_node("mcl_chests:"..basename.."_right", { "size[9,11.5]".. "background[-0.19,-0.25;9.41,12.5;mcl_chests_inventory_chest_large.png]".. + mcl_vars.inventory_header.. "list[nodemeta:"..pos_other.x..","..pos_other.y..","..pos_other.z..";main;0,0.5;9,3;]".. "list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,3.5;9,3;]".. "list[current_player;main;0,7.5;9,3;9]".. @@ -615,6 +618,7 @@ minetest.register_node("mcl_chests:ender_chest", { local meta = minetest.get_meta(pos) meta:set_string("formspec", "size[9,8.75]".. + mcl_vars.inventory_header.. "background[-0.19,-0.25;9.41,10.48;mcl_chests_inventory_chest.png]".. "image[0,-0.2;5,0.75;mcl_chests_fnt_ender_chest.png]".. "list[current_player;enderchest;0,0.5;9,3;]".. @@ -709,6 +713,7 @@ for color, desc in pairs(boxtypes) do local meta = minetest.get_meta(pos) meta:set_string("formspec", "size[9,8.75]".. + mcl_vars.inventory_header.. "background[-0.19,-0.25;9.41,10.48;mcl_chests_inventory_chest.png]".. "image[0,-0.2;5,0.75;mcl_chests_fnt_shulker_box.png]".. "list[current_name;main;0,0.5;9,3;]".. diff --git a/mods/ITEMS/mcl_crafting_table/depends.txt b/mods/ITEMS/mcl_crafting_table/depends.txt index 3d96266de..e3b8528c2 100644 --- a/mods/ITEMS/mcl_crafting_table/depends.txt +++ b/mods/ITEMS/mcl_crafting_table/depends.txt @@ -1 +1,2 @@ +mcl_init mcl_sounds diff --git a/mods/ITEMS/mcl_crafting_table/init.lua b/mods/ITEMS/mcl_crafting_table/init.lua index 72ea0a8cd..37dc74a29 100644 --- a/mods/ITEMS/mcl_crafting_table/init.lua +++ b/mods/ITEMS/mcl_crafting_table/init.lua @@ -14,6 +14,7 @@ minetest.register_node("mcl_crafting_table:crafting_table", { local form = "size[9,8.75]".. "background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png^crafting_inventory_workbench.png]".. + mcl_vars.inventory_header.. "list[current_player;main;0,4.5;9,3;9]".. "list[current_player;main;0,7.74;9,1;]".. "list[current_player;craft;1.75,0.5;3,3;]".. diff --git a/mods/ITEMS/mcl_furnaces/depends.txt b/mods/ITEMS/mcl_furnaces/depends.txt index 017e4fb6c..441fdfde6 100644 --- a/mods/ITEMS/mcl_furnaces/depends.txt +++ b/mods/ITEMS/mcl_furnaces/depends.txt @@ -1,3 +1,4 @@ +mcl_init mcl_core mcl_sounds mcl_craftguide diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index a81a86b36..9a8804fde 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -6,6 +6,7 @@ local function active_formspec(fuel_percent, item_percent) return "size[9,8.75]".. "background[-0.19,-0.25;9.41,9.49;crafting_inventory_furnace.png]".. + mcl_vars.inventory_header.. "list[current_player;main;0,4.5;9,3;9]".. "list[current_player;main;0,7.74;9,1;]".. "list[current_name;src;2.75,0.5;1,1;]".. @@ -28,6 +29,7 @@ end local inactive_formspec = "size[9,8.75]".. "background[-0.19,-0.25;9.41,9.49;crafting_inventory_furnace.png]".. + mcl_vars.inventory_header.. "list[current_player;main;0,4.5;9,3;9]".. "list[current_player;main;0,7.74;9,1;]".. "list[current_name;src;2.75,0.5;1,1;]".. diff --git a/mods/ITEMS/mcl_hoppers/init.lua b/mods/ITEMS/mcl_hoppers/init.lua index cced02c6a..c7f7b0b9a 100644 --- a/mods/ITEMS/mcl_hoppers/init.lua +++ b/mods/ITEMS/mcl_hoppers/init.lua @@ -6,6 +6,7 @@ local chest = minetest.get_content_id("mcl_chests:chest") local mcl_hoppers_formspec = "size[9,7]".. "background[-0.19,-0.25;9.41,10.48;mcl_hoppers_inventory.png]".. + mcl_vars.inventory_header.. "list[current_name;main;2,0.5;5,1;]".. "list[current_player;main;0,2.5;9,3;9]".. "list[current_player;main;0,5.74;9,1;]"..