Remove uses of default.gui_bg/bg_img/slots

Keep their definitions, to not break mods, but move them to legacy.lua.
This commit is contained in:
Paramat 2019-01-03 01:57:13 +00:00 committed by GitHub
parent ccf03ea404
commit 8af8dc49a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 6 additions and 32 deletions

View File

@ -13,9 +13,6 @@ end
local bones_formspec = local bones_formspec =
"size[8,9]" .. "size[8,9]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
"list[current_name;main;0,0.3;8,4;]" .. "list[current_name;main;0,0.3;8,4;]" ..
"list[current_player;main;0,4.85;8,1;]" .. "list[current_player;main;0,4.85;8,1;]" ..
"list[current_player;main;0,6.08;8,3;8]" .. "list[current_player;main;0,6.08;8,3;8]" ..

View File

@ -126,9 +126,7 @@ function creative.register_tab(name, title, items)
"field[0.3,3.5;2.2,1;creative_filter;;" .. minetest.formspec_escape(inv.filter) .. "]" .. "field[0.3,3.5;2.2,1;creative_filter;;" .. minetest.formspec_escape(inv.filter) .. "]" ..
"listring[detached:creative_" .. player_name .. ";main]" .. "listring[detached:creative_" .. player_name .. ";main]" ..
"list[detached:creative_" .. player_name .. ";main;0,0;8,3;" .. tostring(start_i) .. "]" .. "list[detached:creative_" .. player_name .. ";main;0,0;8,3;" .. tostring(start_i) .. "]" ..
default.get_hotbar_bg(0,4.7) .. default.get_hotbar_bg(0,4.7) .. creative.formspec_add, false)
default.gui_bg .. default.gui_bg_img .. default.gui_slots
.. creative.formspec_add, false)
end, end,
on_enter = function(self, player, context) on_enter = function(self, player, context)
local player_name = player:get_player_name() local player_name = player:get_player_name()

View File

@ -4,9 +4,6 @@ function default.chest.get_chest_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," .. pos.z local spos = pos.x .. "," .. pos.y .. "," .. pos.z
local formspec = local formspec =
"size[8,9]" .. "size[8,9]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
"list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" .. "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
"list[current_player;main;0,4.85;8,1;]" .. "list[current_player;main;0,4.85;8,1;]" ..
"list[current_player;main;0,6.08;8,3;8]" .. "list[current_player;main;0,6.08;8,3;8]" ..

View File

@ -50,16 +50,14 @@ local function book_on_use(itemstack, user)
local formspec local formspec
if owner == player_name then if owner == player_name then
formspec = "size[8,8]" .. default.gui_bg .. formspec = "size[8,8]" ..
default.gui_bg_img ..
"field[0.5,1;7.5,0;title;Title:;" .. "field[0.5,1;7.5,0;title;Title:;" ..
minetest.formspec_escape(title) .. "]" .. minetest.formspec_escape(title) .. "]" ..
"textarea[0.5,1.5;7.5,7;text;Contents:;" .. "textarea[0.5,1.5;7.5,7;text;Contents:;" ..
minetest.formspec_escape(text) .. "]" .. minetest.formspec_escape(text) .. "]" ..
"button_exit[2.5,7.5;3,1;save;Save]" "button_exit[2.5,7.5;3,1;save;Save]"
else else
formspec = "size[8,8]" .. default.gui_bg .. formspec = "size[8,8]" ..
default.gui_bg_img ..
"label[0.5,0.5;by " .. owner .. "]" .. "label[0.5,0.5;by " .. owner .. "]" ..
"tablecolumns[color;text]" .. "tablecolumns[color;text]" ..
"tableoptions[background=#00000000;highlight=#00000000;border=false]" .. "tableoptions[background=#00000000;highlight=#00000000;border=false]" ..

View File

@ -5,9 +5,6 @@
function default.get_furnace_active_formspec(fuel_percent, item_percent) function default.get_furnace_active_formspec(fuel_percent, item_percent)
return "size[8,8.5]".. return "size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[context;src;2.75,0.5;1,1;]".. "list[context;src;2.75,0.5;1,1;]"..
"list[context;fuel;2.75,2.5;1,1;]".. "list[context;fuel;2.75,2.5;1,1;]"..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. "image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:"..
@ -28,9 +25,6 @@ end
function default.get_furnace_inactive_formspec() function default.get_furnace_inactive_formspec()
return "size[8,8.5]".. return "size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[context;src;2.75,0.5;1,1;]".. "list[context;src;2.75,0.5;1,1;]"..
"list[context;fuel;2.75,2.5;1,1;]".. "list[context;fuel;2.75,2.5;1,1;]"..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]".. "image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..

View File

@ -9,10 +9,6 @@ default = {}
default.LIGHT_MAX = 14 default.LIGHT_MAX = 14
-- GUI related stuff -- GUI related stuff
default.gui_bg = ""
default.gui_bg_img = ""
default.gui_slots = ""
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
player:set_formspec_prepend([[ player:set_formspec_prepend([[
bgcolor[#080808BB;true] bgcolor[#080808BB;true]
@ -29,9 +25,6 @@ function default.get_hotbar_bg(x,y)
end end
default.gui_survival_form = "size[8,8.5]".. default.gui_survival_form = "size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_player;main;0,4.25;8,1;]".. "list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]".. "list[current_player;main;0,5.5;8,3;8]"..
"list[current_player;craft;1.75,0.5;3,3;]".. "list[current_player;craft;1.75,0.5;3,3;]"..

View File

@ -23,6 +23,9 @@ LIGHT_MAX = default.LIGHT_MAX
-- Formspecs -- Formspecs
default.gui_suvival_form = default.gui_survival_form default.gui_suvival_form = default.gui_survival_form
default.gui_bg = ""
default.gui_bg_img = ""
default.gui_slots = ""
-- Players -- Players
if minetest.get_modpath("player_api") then if minetest.get_modpath("player_api") then

View File

@ -2449,9 +2449,6 @@ minetest.register_node("default:lava_flowing", {
local bookshelf_formspec = local bookshelf_formspec =
"size[8,7;]" .. "size[8,7;]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
"list[context;books;0,0.3;8,2;]" .. "list[context;books;0,0.3;8,2;]" ..
"list[current_player;main;0,2.85;8,1;]" .. "list[current_player;main;0,2.85;8,1;]" ..
"list[current_player;main;0,4.08;8,3;8]" .. "list[current_player;main;0,4.08;8,3;8]" ..

View File

@ -3,9 +3,6 @@
local vessels_shelf_formspec = local vessels_shelf_formspec =
"size[8,7;]" .. "size[8,7;]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
"list[context;vessels;0,0.3;8,2;]" .. "list[context;vessels;0,0.3;8,2;]" ..
"list[current_player;main;0,2.85;8,1;]" .. "list[current_player;main;0,2.85;8,1;]" ..
"list[current_player;main;0,4.08;8,3;8]" .. "list[current_player;main;0,4.08;8,3;8]" ..