mirror of
https://github.com/minetest-mods/i3.git
synced 2024-12-27 11:20:40 +01:00
Minor cleaning
This commit is contained in:
parent
e091ca1c43
commit
6f26524885
11
init.lua
11
init.lua
@ -2541,22 +2541,17 @@ if rawget(_G, "worldedit") then
|
|||||||
local wfs = split(worldedit.pages.worldedit_gui.get_formspec(name), "]")
|
local wfs = split(worldedit.pages.worldedit_gui.get_formspec(name), "]")
|
||||||
local new_fs = {}
|
local new_fs = {}
|
||||||
|
|
||||||
for i, elem in ipairs(wfs) do
|
for i = 3, 1, -1 do
|
||||||
if sub(elem, 1, 4) == "size" or sub(elem, 1, 5) == "label" or
|
|
||||||
find(elem, "worldedit_gui_exit") then
|
|
||||||
remove(wfs, i)
|
remove(wfs, i)
|
||||||
end
|
end
|
||||||
|
|
||||||
wfs[i] = wfs[i] .. "]"
|
|
||||||
end
|
|
||||||
|
|
||||||
for i, elem in ipairs(wfs) do
|
for i, elem in ipairs(wfs) do
|
||||||
local ename, field, str = match(elem, "(.*)%[.*%d+;(.*);(.*)]")
|
local ename, field, str = match(elem, "(.*)%[.*%d+;(.*);(.*)$")
|
||||||
|
|
||||||
local X = i % 3
|
local X = i % 3
|
||||||
X = X + (X * 2.42) + 0.2
|
X = X + (X * 2.42) + 0.2
|
||||||
|
|
||||||
local Y = floor((i % (#wfs - 1) - X) / 3 + 1) + 1.2
|
local Y = floor((i % #wfs - X) / 3 - 1) + 2.2
|
||||||
|
|
||||||
insert(new_fs, fmt("%s[%f,%f;3,0.8;%s;%s]",
|
insert(new_fs, fmt("%s[%f,%f;3,0.8;%s;%s]",
|
||||||
ename, X, Y, field, str:gsub("/", " / ")))
|
ename, X, Y, field, str:gsub("/", " / ")))
|
||||||
|
Loading…
Reference in New Issue
Block a user