1
0
mirror of git://repo.or.cz/minetest_schemedit.git synced 2025-07-05 01:20:23 +02:00

11 Commits
1.4.0 ... 1.4.1

Author SHA1 Message Date
ad6bf63f3b Version 1.4.1 2021-04-04 17:33:19 +02:00
433878a938 Add use_texture_alpha compability 2021-04-04 17:29:53 +02:00
e9ad4bcf00 Hide ypos field for slice editing 2021-04-04 17:23:59 +02:00
329f394499 Fix invalid slice_list on import 2021-04-04 17:10:02 +02:00
f0c5c2659f Prevent adding dupe slice definitions 2021-04-04 16:44:14 +02:00
cd808777c8 Update locale files 2021-04-04 16:35:42 +02:00
0240a09800 Tweak slice edit buttons 2021-04-04 16:35:19 +02:00
6f8a575786 Update locale files 2021-04-04 16:23:16 +02:00
cb1e33485e Remove symbols in slice buttons 2021-04-04 16:20:20 +02:00
8e0794217d Fix incorrect placement of prob stuff in import 2021-04-04 16:13:56 +02:00
b8e5c5cda7 Add use_texture_alpha="clip" for void 2021-04-02 23:20:09 +02:00
4 changed files with 99 additions and 63 deletions

View File

@ -1,7 +1,7 @@
# Schematic Editor [`schemedit`]
## Version
1.4.0
1.4.1
## Description
This is a mod which allows you to edit and export schematics (`.mts` files).

View File

@ -456,7 +456,10 @@ schemedit.add_form("main", {
meta.x_size = schematic.size.x
meta.y_size = schematic.size.y
meta.z_size = schematic.size.z
meta.slices = minetest.serialize(schematic.yslice_prob)
meta.slices = minetest.serialize(renumber(schematic.yslice_prob))
local special_x_size = meta.x_size
local special_y_size = meta.y_size
local special_z_size = meta.z_size
if node.param2 == 1 then
pos1 = vector.add(pos, {x=1,y=0,z=-meta.z_size+1})
@ -483,9 +486,9 @@ schemedit.add_form("main", {
-- Add special schematic data to nodes
if success then
local d = 1
for z=0, meta.z_size-1 do
for y=0, meta.y_size-1 do
for x=0, meta.x_size-1 do
for z=0, special_z_size-1 do
for y=0, special_y_size-1 do
for x=0, special_x_size-1 do
local data = schematic_for_meta.data[d]
local pp = {x=pos1.x+x, y=pos1.y+y, z=pos1.z+z}
if data.prob == 0 then
@ -559,17 +562,22 @@ schemedit.add_form("slice", {
if self.panel_add or self.panel_edit then
local ypos_default, prob_default = "", ""
local done_button = "button[5,7.18;2,1;done_add;"..F(S("Done")).."]"
local done_button = "button[5,7.18;2,1;done_add;"..F(S("Add")).."]"
if self.panel_edit then
done_button = "button[5,7.18;2,1;done_edit;"..F(S("Done")).."]"
done_button = "button[5,7.18;2,1;done_edit;"..F(S("Apply")).."]"
if slice_list[self.selected] then
ypos_default = slice_list[self.selected].ypos
prob_default = slice_list[self.selected].prob
end
end
local field_ypos = ""
if self.panel_add then
field_ypos = "field[0.3,7.5;2.5,1;ypos;"..F(S("Y position (max. @1):", (meta.y_size - 1)))..";"..ypos_default.."]"
end
form = form..[[
field[0.3,7.5;2.5,1;ypos;]]..F(S("Y position (max. @1):", (meta.y_size - 1)))..[[;]]..ypos_default..[[]
]]..field_ypos..[[
field[2.8,7.5;2.5,1;prob;]]..F(S("Probability (0-255):"))..[[;]]..prob_default..[[]
field_close_on_enter[ypos;false]
field_close_on_enter[prob;false]
@ -577,19 +585,22 @@ schemedit.add_form("slice", {
end
if not self.panel_edit then
form = form.."button[0,6;2.4,1;add;"..F(S("+ Add slice")).."]"
if self.panel_add then
form = form.."button[0,6;2.4,1;add;"..F(S("Cancel")).."]"
else
form = form.."button[0,6;2.4,1;add;"..F(S("Add slice")).."]"
end
end
if slices ~= "" and self.selected and not self.panel_add then
if not self.panel_edit then
form = form..[[
button[2.4,6;2.4,1;remove;]]..F(S("- Remove slice"))..[[]
button[4.8,6;2.4,1;edit;]]..F(S("+/- Edit slice"))..[[]
button[2.4,6;2.4,1;remove;]]..F(S("Remove slice"))..[[]
button[4.8,6;2.4,1;edit;]]..F(S("Edit slice"))..[[]
]]
else
form = form..[[
button[2.4,6;2.4,1;remove;]]..F(S("- Remove slice"))..[[]
button[4.8,6;2.4,1;edit;]]..F(S("+/- Edit slice"))..[[]
button[4.8,6;2.4,1;edit;]]..F(S("Back"))..[[]
]]
end
end
@ -620,8 +631,10 @@ schemedit.add_form("slice", {
end
local ypos, prob = tonumber(fields.ypos), tonumber(fields.prob)
if (fields.done_add or fields.done_edit) and fields.ypos and fields.prob and
fields.ypos ~= "" and fields.prob ~= "" and ypos and prob and
if fields.done_edit then
ypos = 0
end
if (fields.done_add or fields.done_edit) and ypos and prob and
ypos <= (meta:get_int("y_size") - 1) and prob >= 0 and prob <= 255 then
local slice_list = minetest.deserialize(meta:get_string("slices"))
local index = #slice_list + 1
@ -629,7 +642,21 @@ schemedit.add_form("slice", {
index = self.selected
end
slice_list[index] = {ypos = ypos, prob = prob}
local dupe = false
if fields.done_add then
for k,v in pairs(slice_list) do
if v.ypos == ypos then
v.prob = prob
dupe = true
end
end
end
if fields.done_edit and slice_list[index] then
ypos = slice_list[index].ypos
end
if not dupe then
slice_list[index] = {ypos = ypos, prob = prob}
end
meta:set_string("slices", minetest.serialize(slice_list))
@ -644,7 +671,7 @@ schemedit.add_form("slice", {
meta:set_string("slices", minetest.serialize(renumber(slice_list)))
-- Update formspec
self.selected = 1
self.selected = math.max(1, self.selected-1)
self.panel_edit = nil
schemedit.show_formspec(pos, player, "slice")
end
@ -1192,11 +1219,19 @@ S("The node HUD is not updated automatically and may be outdated. The node HUD o
end,
})
local use_texture_alpha_void
if minetest.features.use_texture_alpha_string_modes then
use_texture_alpha_void = "clip"
else
use_texture_alpha_void = true
end
minetest.register_node("schemedit:void", {
description = S("Schematic Void"),
_doc_items_longdesc = S("This is an utility block used in the creation of schematic files. It should be used together with a schematic creator. When saving a schematic, all nodes with a schematic void will be left unchanged when the schematic is placed again. Technically, this is equivalent to a block with the node probability set to 0."),
_doc_items_usagehelp = S("Just place the schematic void like any other block and use the schematic creator to save a portion of the world."),
tiles = { "schemedit_void.png" },
use_texture_alpha = use_texture_alpha_void,
drawtype = "nodebox",
is_ground_content = false,
paramtype = "light",

View File

@ -1,48 +1,57 @@
# textdomain: schemedit
<world path>=<Weltpfad>
<name>=<Name>
Insufficient privileges! You need the “@1” privilege to use this.=Unzureichende Privilegien! Sie benötigen das „@1“-Privileg, um dies benutzen zu können.
Probability: @1=Wahrscheinlichkeit: @1
Not Set=Nicht gesetzt
Force placement=Platzierung erzwingen
Import schematic=Schematic importieren
Main=Grundeinstellungen
Hide border=Rand verbergen
Show border=Rand anzeigen
Position: @1=Position: @1
Owner: @1=Eigentümer: @1
Size: @1=Größe: @1
Schematic name: @1=Schematic-Name: @1
Size: @1=Größe: @1
Schematic name:=Schematic-Name:
OK=OK
Save schematic name=Schematic-Name speichern
Export schematic=Schematic exportieren
Import schematic=Schematic importieren
Imported schematic from @1=Schematic von @1 importiert
Failed to import schematic from @1=Schematic konnte nicht von @1 importiert werden
The schematic will be exported as a .mts file and stored in@n@1=Das Schematic wird als .mts-Datei gespeichert in:@n@1
Export/import path:@n@1=Export-/Importpfad:@n@1
<name>=<Name>
Air to voids=Luft zu Lücken
Voids to air=Lücken zu Luft
Turn all air nodes into schematic void nodes=Alle Luft-Nodes zu Schematic-Lücken umwandeln
Turn all schematic void nodes into air nodes=Alle Schematic-Lücken zu Luft-Nodes umwandeln
X size:=X-Größe:
Y size:=Y-Größe:
Z size:=Z-Größe:
Save size=Größe speichern
Help=Hilfe
Exported schematic to @1=Schematic nach @1 exportiert
Failed to export schematic to @1=Schematic konnte nicht nach @1 exportiert werden
Imported schematic from @1=Schematic von @1 importiert
Failed to import schematic from @1=Schematic konnte nicht von @1 importiert werden
Y Slices=Y-Scheiben
Y @= @1; Probability @= @2=Y @= @1; Wahrscheinlichkeit @= @2
Done=Fertig
Add=Hinzufügen
Apply=Anwenden
Y position (max. @1):=Y-Position (max. @1):
Probability (0-255):=Wahrscheinlichkeit (0-255):
+ Add slice=+ Neue Scheibe
+/- Edit slice=+/- Scheibe bearbeiten
- Remove slice=- Scheibe entfernen
Cancel=Abbrechen
Add slice=Neue Scheibe
Remove slice=Scheibe entfernen
Edit slice=Scheibe anpassen
Back=Zurück
Schematic Node Probability Tool=Schematic-Node-Wahrscheinlichkeitswerkzeug
Probability (0-255)=Wahrscheinlichkeit
Cancel=Abbrechen
Apply=Anwenden
Probability that the node will be placed=Wahrscheinlichkeit, dass der Node platizert wird
If enabled, the node will replace nodes other than air and ignore=Wenn aktiviert, wird der Node alle Nodes außer Luft und Ignorieren ersetzen
Allows you to access schemedit nodes not owned by you=Damit können Sie auf Schemedit-Nodes, die ihnen nicht gehören, zugreifen
Importing a schematic will load a schematic from the world directory, place it in front of the schematic creator and sets probability and force-place data accordingly.=Das Importieren eines Schematics wird eine Schematicdatei aus dem Weltverzeichnis laden, sie vor dem Schematic-Macher platzieren und die Wahrscheinlichkeits- und Zwangsplatzierungsdaten entsprechend setzen.
Schematic Creator=Schematic-Macher
The schematic creator is used to save a region of the world into a schematic file (.mts).=Der Schematic-Macher wird benutzt, um eine Region der Welt in eine Schematic-Datei (.mts) zu speichern.
To get started, place the block facing directly in front of any bottom left corner of the structure you want to save. This block can only be accessed by the placer or by anyone with the “schematic_override” privilege.=Um anzufangen, platzieren Sie den Block direkt vor einer beliebigen unteren linken Ecke des Gebäudes, das Sie speichern möchten. Dieser Block kann nur vom Platzierer oder von Spielern mit dem „schematic_override“-Privileg benutzt werden.
To save a region, use the block, enter the size and a schematic name and hit “Export schematic”. The file will always be saved in the world directory. Note you can use this name in the /placeschem command to place the schematic again.=Um eine Region zu speichern, benutzen Sie den Block, geben Sie die Größe und einen Schematic-Namen ein und klicken Sie auf „Schematic exportieren“. Die Datei wird immer im Weltverzeichnis gespeichert. Beachten Sie, dass Sie diesen Namen im „/placeschem“-Befehl benutzen können, um das Schematic erneut zu platzieren.
Importing a schematic will load a schematic from the world directory, place it in front of the schematic creator and sets probability and force-place data accordingly.=Das Importieren eines Schematics wird eine Schematicdatei aus dem Weltverzeichnis laden, sie vor dem Schematic-Macher platzieren und die Wahrscheinlichkeits- und Zwangsplatzierungsdaten entsprechend setzen.
The other features of the schematic creator are optional and are used to allow to add randomness and fine-tuning.=Die anderen Funktionen des Schematic-Machers sind optional und werden für Zufälligkeit und Feinjustierungen benutzt.
Y slices are used to remove entire slices based on chance. For each slice of the schematic region along the Y axis, you can specify that it occurs only with a certain chance. In the Y slice tab, you have to specify the Y slice height (0 @= bottom) and a probability from 0 to 255 (255 is for 100%). By default, all Y slices occur always.=Y-Scheiben werden benutzt, um ganze Scheiben mit einer gewissen Wahrscheinlichkeit auszulassen. Für jede Scheibe der Schematic-Region entlang der Y-Achse können Sie festlegen, dass sie nur mit einer gewissen Wahrscheinlichkeit auftritt. In der Registerkarte „Y-Scheiben“ müssen Sie die Höhe der Y-Scheibe festlegen (0 @= Boden) sowie eine Wahrscheinlichkeit zwischen 0 und 255 (255 steht für 100%). Standardmäßig treten alle Y-Scheiben immer auf.
With a schematic node probability tool, you can set a probability for each node and enable them to overwrite all nodes when placed as schematic. This tool must be used prior to the file export.=Mit einem Schematic-Node-Wahrscheinlichkeitswerkzeug können Sie die Wahrscheinlichkeit für jeden Node setzen und sie dazu aktivieren, alle Nodes zu ersetzen, wenn sie als Schematic platziert werden. Dieses Werkzeug muss vor dem Dateiexport benutzt werden.
@ -66,16 +75,6 @@ Place schematic at the position specified or the current player position (loaded
<schematic name>[.mts] [<x> <y> <z>]=<Schematic-Name>[.mts] [<x> <y> <z>]
No schematic file specified.=Keinen Schematic-Namen angegeben.
Schematic file could not be loaded!=Schematic-Datei konnte nicht geladen werden!
Main=Grundeinstellungen
X size:=X-Größe:
Y size:=Y-Größe:
Z size:=Z-Größe:
Insufficient privileges! You need the “@1” privilege to use this.=Unzureichende Privilegien! Sie benötigen das „@1“-Privileg, um dies benutzen zu können.
Convert .mts schematic file to .lua file (loaded from @1)=„.mts“-Schematicdatei zu „.lua“-Datei konvertieren (geladen von @1)
<schematic name>[.mts] [comments]=<Schematic-Name>[.mts] [comments]
Failed.=Fehlgeschlagen.
Air to voids=Luft zu Lücken
Voids to air=Lücken zu Luft
Turn all air nodes into schematic void nodes=Alle Luft-Nodes zu Schematic-Lücken umwandeln
Turn all schematic void nodes into air nodes=Alle Schematic-Lücken zu Luft-Nodes umwandeln
Failed!=Fehlgeschlagen!

View File

@ -1,41 +1,53 @@
# textdomain: schemedit
<world path>=
<name>=
Not Set=
Insufficient privileges! You need the “@1” privilege to use this.=
Probability: @1=
Not Set=
Force placement=
Import schematic=
Main=
Hide border=
Show border=
Position: @1=
Owner: @1=
Size: @1=
Schematic name: @1=
Size: @1=
Schematic name:=
OK=
Save schematic name=
Export schematic=
Import schematic=
Imported schematic from @1=
Failed to import schematic from @1=
Export/import path:@n@1=
<name>=
Air to voids=
Voids to air=
Turn all air nodes into schematic void nodes=
Turn all schematic void nodes into air nodes=
X size:=
Y size:=
Z size:=
Save size=
Help=
Exported schematic to @1=
Failed to export schematic to @1=
Imported schematic from @1=
Failed to import schematic from @1=
Y Slices=
Y @= @1; Probability @= @2=
Done=
Add=
Apply=
Y position (max. @1):=
Probability (0-255):=
+ Add slice=
+/- Edit slice=
Cancel=
Add slice=
Remove slice=
Edit slice=
Back=
Schematic Node Probability Tool=
Probability (0-255)=
Cancel=
Apply=
Probability that the node will be placed=
If enabled, the node will replace nodes other than air and ignore=
Allows you to access schemedit nodes not owned by you=
Importing a schematic will load a schematic from the world directory, place it in front of the schematic creator and sets probability and force-place data accordingly.=
Schematic Creator=
The schematic creator is used to save a region of the world into a schematic file (.mts).=
To get started, place the block facing directly in front of any bottom left corner of the structure you want to save. This block can only be accessed by the placer or by anyone with the “schematic_override” privilege.=
@ -43,7 +55,6 @@ To save a region, use the block, enter the size and a schematic name and hit “
The other features of the schematic creator are optional and are used to allow to add randomness and fine-tuning.=
Y slices are used to remove entire slices based on chance. For each slice of the schematic region along the Y axis, you can specify that it occurs only with a certain chance. In the Y slice tab, you have to specify the Y slice height (0 @= bottom) and a probability from 0 to 255 (255 is for 100%). By default, all Y slices occur always.=
With a schematic node probability tool, you can set a probability for each node and enable them to overwrite all nodes when placed as schematic. This tool must be used prior to the file export.=
Importing a schematic will load a schematic from the world directory, place it in front of the schematic creator and sets probability and force-place data accordingly.=
(owned by @1)=
This is an advanced tool which only makes sense when used together with a schematic creator. It is used to finetune the way how nodes from a schematic are placed.=
It allows you to set two things:=
@ -64,15 +75,6 @@ Place schematic at the position specified or the current player position (loaded
<schematic name>[.mts] [<x> <y> <z>]=
No schematic file specified.=
Schematic file could not be loaded!=
Main=
X size:=
Y size:=
Z size:=
Insufficient privileges! You need the “@1” privilege to use this.=
Convert .mts schematic file to .lua file (loaded from @1)=
<schematic name>[.mts] [comments]=
Failed.=
Air to voids=
Voids to air=
Turn all air nodes into schematic void nodes=
Turn all schematic void nodes into air nodes=
Failed!=