Settings tab: add v3f type
authorest31 <MTest31@outlook.com>
Sun, 8 Nov 2015 20:07:41 +0000 (21:07 +0100)
committerest31 <MTest31@outlook.com>
Sun, 8 Nov 2015 20:19:21 +0000 (21:19 +0100)
Add the v3f type, currently is just a nice placeholder for string.
Currently undocumented, on wish of @PilzAdam, to support future changes.

builtin/mainmenu/tab_settings.lua
builtin/settingtypes.txt

index 6d71904cde47042de34c24034b8de9021407b062..db8d08d5eb699bea1fbfdbeb907029cb3ba60186 100644 (file)
@@ -112,7 +112,7 @@ local function parse_setting_line(settings, line, read_all, base_level, allow_se
        end
 
        if setting_type == "string" or setting_type == "noise_params"
-                       or setting_type == "key" then
+                       or setting_type == "key" or setting_type == "v3f" then
                local default = remaining_line:match("^(.*)$")
 
                if not default then
@@ -381,6 +381,9 @@ local function create_change_setting_formspec(dialogdata)
                formspec = formspec .. ",,"
                                .. "," .. fgettext("Format: <offset>, <scale>, (<spreadX>, <spreadY>, <spreadZ>), <seed>, <octaves>, <persistence>") .. ","
                                .. "," .. fgettext("Optionally the lacunarity can be appended with a leading comma.") .. ","
+       elseif setting.type == "v3f" then
+               formspec = formspec .. ",,"
+                               .. "," .. fgettext_ne("Format is 3 numbers separated by commas and inside brackets.") .. ","
        end
 
        formspec = formspec:sub(1, -2) -- remove trailing comma
@@ -424,7 +427,7 @@ local function create_change_setting_formspec(dialogdata)
                                .. "button[8,3.75;2,1;btn_browser_path;" .. fgettext("Browse") .. "]"
 
        else
-               -- TODO: fancy input for float, int, flags, noise_params
+               -- TODO: fancy input for float, int, flags, noise_params, v3f
                local width = 10
                local text = get_current_value(setting)
                if dialogdata.error_message then
index 607fbe607b771a86a499dad0ecb7e8ed27530810..3c44ea664ffd79a8aa38910e89cebf5b8e80034d 100644 (file)
@@ -941,15 +941,11 @@ mgfractal_spflags (Mapgen fractal flags) flags nojulia julia,nojulia
 mgfractal_m_iterations (Mapgen fractal mandelbrot iterations) int 9
 
 #    Mandelbrot set: Approximate (X,Y,Z) scales in nodes.
-#    Format is 3 numbers separated by commas and inside brackets.
-mgfractal_m_scale (Mapgen fractal mandelbrot scale) string (1024.0, 256.0, 1024.0)
-#    Type 'string' is currently used for a v3f.
+mgfractal_m_scale (Mapgen fractal mandelbrot scale) v3f (1024.0, 256.0, 1024.0)
 
 #    Mandelbrot set: (X,Y,Z) offsets from world centre.
-#    Format is 3 numbers separated by commas and inside brackets.
 #    Range roughly -2 to 2, multiply by m_scale for offsets in nodes.
-mgfractal_m_offset (Mapgen fractal mandelbrot offset) string (1.75, 0.0, 0.0)
-#    Type 'string' is currently used for a v3f.
+mgfractal_m_offset (Mapgen fractal mandelbrot offset) v3f (1.75, 0.0, 0.0)
 
 #    Mandelbrot set: W co-ordinate of the generated 3D slice of the 4D shape.
 #    Range roughly -2 to 2.
@@ -960,15 +956,11 @@ mgfractal_m_slice_w (Mapgen fractal mandelbrot slice w) float 0.0
 mgfractal_j_iterations (Mapgen fractal julia iterations) int 9
 
 #    Julia set: Approximate (X,Y,Z) scales in nodes.
-#    Format is 3 numbers separated by commas and inside brackets.
-mgfractal_j_scale (Mapgen fractal julia scale) string (2048.0, 512.0, 2048.0)
-#    Type 'string' is currently used for a v3f.
+mgfractal_j_scale (Mapgen fractal julia scale) v3f (2048.0, 512.0, 2048.0)
 
 #    Julia set: (X,Y,Z) offsets from world centre.
-#    Format is 3 numbers separated by commas and inside brackets.
 #    Range roughly -2 to 2, multiply by j_scale for offsets in nodes.
-mgfractal_j_offset (Mapgen fractal julia offset) string (0.0, 1.0, 0.0)
-#    Type 'string' is currently used for a v3f.
+mgfractal_j_offset (Mapgen fractal julia offset) v3f (0.0, 1.0, 0.0)
 
 #    Julia set: W co-ordinate of the generated 3D slice of the 4D shape.
 #    Range roughly -2 to 2.