diff --git a/cf-lib/settings/Settings.lua b/cf-lib/settings/Settings.lua deleted file mode 100644 index 9f76538..0000000 --- a/cf-lib/settings/Settings.lua +++ /dev/null @@ -1,32 +0,0 @@ ---- Utility class for manipulating settings ---- @class Settings -local Settings = {} - -local settingTypes = { "bool-setting", "int-setting", "double-setting", "string-setting", "color-setting" } - -local function getSetting(name) - for _, settingType in pairs(settingTypes) do - local setting = data.raw[settingType][name] - if setting then return setting end - end - error("getSetting: Setting with name '" .. name .. "' not found.") -end - -Settings.getSetting = getSetting - -function Settings.force(name, value) - local setting = getSetting(name) - setting.hidden = true - if setting.type == "bool-setting" or setting.type == "color-setting" then - setting.forced_value = value - else - setting.allowed_values = { value } - end -end - -function Settings.default(name, value) - local setting = getSetting(name) - setting.default_value = value -end - -return Settings \ No newline at end of file diff --git a/cf-lib/util/table.lua b/cf-lib/util/table.lua index 57c7fa2..865d683 100644 --- a/cf-lib/util/table.lua +++ b/cf-lib/util/table.lua @@ -70,18 +70,6 @@ function table.filter(target, predicate) return result end ---- Filters a table by removing given key. ---- @param target table The table to filter ---- @param key string The key to remove -function table.filterKey(target, key) - return table.filter( - target, - function(_, currentKey) - return currentKey ~= key - end - ) -end - --- Concatenates two tables into a new table. --- @param table1 table The first table --- @param table2 table The second table