Skip to content

Commit 8af8dc4

Browse files
authored
Remove uses of default.gui_bg/bg_img/slots
Keep their definitions, to not break mods, but move them to legacy.lua.
1 parent ccf03ea commit 8af8dc4

File tree

9 files changed

+6
-32
lines changed

9 files changed

+6
-32
lines changed

mods/bones/init.lua

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ end
1313

1414
local bones_formspec =
1515
"size[8,9]" ..
16-
default.gui_bg ..
17-
default.gui_bg_img ..
18-
default.gui_slots ..
1916
"list[current_name;main;0,0.3;8,4;]" ..
2017
"list[current_player;main;0,4.85;8,1;]" ..
2118
"list[current_player;main;0,6.08;8,3;8]" ..

mods/creative/inventory.lua

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

mods/default/chests.lua

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ function default.chest.get_chest_formspec(pos)
44
local spos = pos.x .. "," .. pos.y .. "," .. pos.z
55
local formspec =
66
"size[8,9]" ..
7-
default.gui_bg ..
8-
default.gui_bg_img ..
9-
default.gui_slots ..
107
"list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
118
"list[current_player;main;0,4.85;8,1;]" ..
129
"list[current_player;main;0,6.08;8,3;8]" ..

mods/default/craftitems.lua

+2-4
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,14 @@ local function book_on_use(itemstack, user)
5050

5151
local formspec
5252
if owner == player_name then
53-
formspec = "size[8,8]" .. default.gui_bg ..
54-
default.gui_bg_img ..
53+
formspec = "size[8,8]" ..
5554
"field[0.5,1;7.5,0;title;Title:;" ..
5655
minetest.formspec_escape(title) .. "]" ..
5756
"textarea[0.5,1.5;7.5,7;text;Contents:;" ..
5857
minetest.formspec_escape(text) .. "]" ..
5958
"button_exit[2.5,7.5;3,1;save;Save]"
6059
else
61-
formspec = "size[8,8]" .. default.gui_bg ..
62-
default.gui_bg_img ..
60+
formspec = "size[8,8]" ..
6361
"label[0.5,0.5;by " .. owner .. "]" ..
6462
"tablecolumns[color;text]" ..
6563
"tableoptions[background=#00000000;highlight=#00000000;border=false]" ..

mods/default/furnace.lua

-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55

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

2926
function default.get_furnace_inactive_formspec()
3027
return "size[8,8.5]"..
31-
default.gui_bg..
32-
default.gui_bg_img..
33-
default.gui_slots..
3428
"list[context;src;2.75,0.5;1,1;]"..
3529
"list[context;fuel;2.75,2.5;1,1;]"..
3630
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..

mods/default/init.lua

-7
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ default = {}
99
default.LIGHT_MAX = 14
1010

1111
-- GUI related stuff
12-
default.gui_bg = ""
13-
default.gui_bg_img = ""
14-
default.gui_slots = ""
15-
1612
minetest.register_on_joinplayer(function(player)
1713
player:set_formspec_prepend([[
1814
bgcolor[#080808BB;true]
@@ -29,9 +25,6 @@ function default.get_hotbar_bg(x,y)
2925
end
3026

3127
default.gui_survival_form = "size[8,8.5]"..
32-
default.gui_bg..
33-
default.gui_bg_img..
34-
default.gui_slots..
3528
"list[current_player;main;0,4.25;8,1;]"..
3629
"list[current_player;main;0,5.5;8,3;8]"..
3730
"list[current_player;craft;1.75,0.5;3,3;]"..

mods/default/legacy.lua

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ LIGHT_MAX = default.LIGHT_MAX
2323

2424
-- Formspecs
2525
default.gui_suvival_form = default.gui_survival_form
26+
default.gui_bg = ""
27+
default.gui_bg_img = ""
28+
default.gui_slots = ""
2629

2730
-- Players
2831
if minetest.get_modpath("player_api") then

mods/default/nodes.lua

-3
Original file line numberDiff line numberDiff line change
@@ -2449,9 +2449,6 @@ minetest.register_node("default:lava_flowing", {
24492449

24502450
local bookshelf_formspec =
24512451
"size[8,7;]" ..
2452-
default.gui_bg ..
2453-
default.gui_bg_img ..
2454-
default.gui_slots ..
24552452
"list[context;books;0,0.3;8,2;]" ..
24562453
"list[current_player;main;0,2.85;8,1;]" ..
24572454
"list[current_player;main;0,4.08;8,3;8]" ..

mods/vessels/init.lua

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
local vessels_shelf_formspec =
55
"size[8,7;]" ..
6-
default.gui_bg ..
7-
default.gui_bg_img ..
8-
default.gui_slots ..
96
"list[context;vessels;0,0.3;8,2;]" ..
107
"list[current_player;main;0,2.85;8,1;]" ..
118
"list[current_player;main;0,4.08;8,3;8]" ..

0 commit comments

Comments
 (0)