From 6b07399bf3ff931a8a0340fbc380cff6972a0953 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 21 Jan 2024 11:54:55 +0100 Subject: [PATCH] Fix issue #125 (Improve forceload formspec) --- basic_machines/forceload.lua | 14 +++++++++----- locale/techage.de.tr | 5 +++-- locale/template.txt | 3 +++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/basic_machines/forceload.lua b/basic_machines/forceload.lua index 8056269..3a9d55f 100644 --- a/basic_machines/forceload.lua +++ b/basic_machines/forceload.lua @@ -114,20 +114,24 @@ local function formspec(name) if player then local lPos = get_pos_list(player) local tRes = {} - for idx,pos in ipairs(lPos) do + tRes[#tRes+1] = "#" + tRes[#tRes+1] = S("Block at pos") + tRes[#tRes+1] = S("Area from") + tRes[#tRes+1] = S("Area to") + for idx,pos in ipairs(lPos) do local pos1, pos2 = calc_area(pos) tRes[#tRes+1] = idx + tRes[#tRes+1] = minetest.formspec_escape(P2S(pos)) tRes[#tRes+1] = minetest.formspec_escape(P2S(pos1)) - tRes[#tRes+1] = "to" tRes[#tRes+1] = minetest.formspec_escape(P2S(pos2)) end - return "size[7,9]".. + return "size[9,9]".. default.gui_bg.. default.gui_bg_img.. default.gui_slots.. "label[0,0;"..S("List of your Forceload Blocks:").."]".. - "tablecolumns[text,width=1.2;text,width=12;text,width=1.6;text,width=12]".. - "table[0,0.6;6.8,8.4;output;"..table.concat(tRes, ",")..";1]" + "tablecolumns[text,width=1.8;text,width=12;text,width=12;text,width=12]".. + "table[0,0.6;8.8,8.4;output;"..table.concat(tRes, ",")..";1]" end end diff --git a/locale/techage.de.tr b/locale/techage.de.tr index 877eb37..b2cb77d 100644 --- a/locale/techage.de.tr +++ b/locale/techage.de.tr @@ -591,6 +591,9 @@ TA2 Flywheel=TA2 Schwungrad ### forceload.lua ### Area already loaded or max. number of Forceload Blocks reached!=Bereich bereits geladen oder maximale Anzahl von Forceload Blöcken erreicht! +Area from=Bereich von +Area to=Bereich bis +Block at pos=Block an Pos List of your Forceload Blocks:=Liste der Forceload Blöcke Punch the block to make the area visible.=Schlage auf den Bock um den Bereich anzuzeigen. Show all forceload blocks in a 64x64x64 range=Zeige alle Forceload Blöcke im Umkreis von 64x64x64 Blöcken @@ -1577,5 +1580,3 @@ TA4 Collider Detector Worker=TA4 Collider Detektor Worker ##### not used anymore ##### - -TA3 Akku Box=TA3 Akku Block diff --git a/locale/template.txt b/locale/template.txt index 49e05cc..2b6be2c 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -591,6 +591,9 @@ TA2 Flywheel= ### forceload.lua ### Area already loaded or max. number of Forceload Blocks reached!= +Area from= +Area to= +Block at pos= List of your Forceload Blocks:= Punch the block to make the area visible.= Show all forceload blocks in a 64x64x64 range=