Advertisement
Muche42

DSTConfig - indentation patch

Feb 22nd, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.53 KB | None | 0 0
  1. --- resources/Main.lua
  2. +++ resources/Main.indent.lua
  3. @@ -30,13 +30,13 @@ function main(args)
  4.                  local configuration_options = manager:get("configuration_options")
  5.                  -- Setup mod table
  6.                  logger:lua(name .. " | " .. workshop)
  7. -                r = concat(r, "--" .. name)
  8. -                r = concat(r, "[\"" .. workshop .. "\"] = {enabled = true,")
  9. +                r = concat(r, "\t--" .. name)
  10. +                r = concat(r, "\t[\"" .. workshop .. "\"] = {enabled = true,")
  11.                  -- We have config options. Parse them.
  12.                  if (configuration_options ~= nil) then
  13.                      -- Is this table actually valid?
  14.                      if (isTable(configuration_options)) then
  15. -                        r = concat(r, "configuration_options = {")
  16. +                        r = concat(r, "\t\tconfiguration_options = {")
  17.                          for k, v in pairs(configuration_options) do
  18.                              -- Check for missing elements.
  19.                              if (contains(v, "name") ~= true or contains(v, "default") ~= true) then
  20. @@ -71,7 +71,7 @@ function main(args)
  21.                                      if (string.match(o_name, "\"")) then
  22.                                          o_name = factory:replace(o_name, "\"", "\\\"")
  23.                                      end
  24. -                                    r = concat2(r, "[\"" .. o_name .. "\"] = ")
  25. +                                    r = concat2(r, "\t\t\t[\"" .. o_name .. "\"] = ")
  26.                                      -- Check variable type. See Utils.lua.
  27.                                      if (isString(o_default)) then
  28.                                          r = concat(r, "\"" .. o_default .. "\",")
  29. @@ -81,15 +81,15 @@ function main(args)
  30.                                  end
  31.                              end
  32.                          end
  33. -                        r = concat(r, "},")
  34. +                        r = concat(r, "\t\t},")
  35.                      else
  36.                          logger:lua("Invalid configuration_options value in " .. name)
  37.                      end
  38.                  else
  39.                      -- No options. Make a blank table.
  40. -                    r = concat(r, "configuration_options = {},")
  41. +                    r = concat(r, "\t\tconfiguration_options = {},")
  42.                  end
  43. -                r = concat(r, "},")
  44. +                r = concat(r, "\t},")
  45.              else
  46.                  logger:lua("modinfo.lua for " .. value .. " is invalid.")
  47.              end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement