Gracefully handle bad mod setting types in Web UI

Make sure all cobinations of missmatched types and missing mod settings
are gracefully handled by the Web UI.

Fixes #609.
This commit is contained in:
Hornwitser committed 2024-04-28 16:59:03 +02:00
1 parent 3cf9f96233
commit 4e1116ae2d
7 files changed
+104 -3

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
local settings = {
["bool-setting"] = true,
["int-setting"] = 123,
["double-setting"] = 1234.5,
["string-setting"] = "string",
["color-setting"] = { r = 1, g = 0, b = 1, a = 1 },
}
local possible_values = { "missing", "bool", "int", "double", "string", "color" }
for name, default_value in pairs(settings) do
for _, value in ipairs(possible_values) do
data:extend({
{
type = name,
name = name .. "-with-" .. value .. "-value",
setting_type = "startup",
default_value = default_value,
}
})
end
end