diff options
author | ShadowNinja <shadowninja@minetest.net> | 2022-01-31 20:00:14 -0500 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2022-04-08 14:55:21 +0100 |
commit | d9effbb179beda350dc3cab3b4d610addf3c7768 (patch) | |
tree | cfae482c3f1fc9c0e0d279a39207d63a4fcb402a /builtin/mainmenu | |
parent | 24a0f55c9c84b2625a564fd07d9da75eaac9c60d (diff) | |
download | minetest-d9effbb179beda350dc3cab3b4d610addf3c7768.tar.gz minetest-d9effbb179beda350dc3cab3b4d610addf3c7768.tar.bz2 minetest-d9effbb179beda350dc3cab3b4d610addf3c7768.zip |
Fix spaces generated by settings file generator
Diffstat (limited to 'builtin/mainmenu')
-rw-r--r-- | builtin/mainmenu/generate_from_settingtypes.lua | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/builtin/mainmenu/generate_from_settingtypes.lua b/builtin/mainmenu/generate_from_settingtypes.lua index 43fc57bb9..4fcaa7076 100644 --- a/builtin/mainmenu/generate_from_settingtypes.lua +++ b/builtin/mainmenu/generate_from_settingtypes.lua @@ -31,7 +31,7 @@ local group_format_template = [[ # octaves = %s, # persistence = %s, # lacunarity = %s, -# flags = %s +# flags =%s # } ]] @@ -55,7 +55,11 @@ local function create_minetest_conf_example() end if entry.comment ~= "" then for _, comment_line in ipairs(entry.comment:split("\n", true)) do - insert(result, "# " .. comment_line .. "\n") + if comment_line == "" then + insert(result, "#\n") + else + insert(result, "# " .. comment_line .. "\n") + end end end insert(result, "# type: " .. entry.type) @@ -73,10 +77,14 @@ local function create_minetest_conf_example() end insert(result, "\n") if group_format == true then + local flags = entry.values[10] + if flags ~= "" then + flags = " "..flags + end insert(result, sprintf(group_format_template, entry.name, entry.values[1], entry.values[2], entry.values[3], entry.values[4], entry.values[5], entry.values[6], entry.values[7], entry.values[8], entry.values[9], - entry.values[10])) + flags)) else local append if entry.default ~= "" then @@ -126,4 +134,3 @@ file = assert(io.open("src/settings_translation_file.cpp", "w")) --file = assert(io.open("settings_translation_file.cpp", "w")) file:write(create_translation_file()) file:close() - |