-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
settings-final-fixes.lua
42 lines (36 loc) · 1.83 KB
/
settings-final-fixes.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
lazyAPI.get_stage() -- in order to get this stage internally
ZKSettings.set_default_colors()
local addons_api = require("addons/core/addons_api")
local insecure_addons_list = require("addons/core/insecure-addons-list")
local safe_addons_list = require("addons/core/safe-addons-list")
addons_api.remove_duplicate_addons(safe_addons_list)
local COLON = {"colon"}
for name, addon in pairs(insecure_addons_list) do
if data.raw["bool-setting"]["zk-lib_" .. name] then
ZKSettings.create_bool_setting("zk-lib-during-game_" .. name, "runtime-global", false, {
localised_name = {'', "[color=orange]! ", {"zk-lib.addons"}, COLON, "[/color] ", {"mod-name." .. name}},
localised_description = {'', "[color=orange]", {"zk-lib.insecure-addon"}, "[/color]\n\n",
{"gui-mod-info.description"} , COLON, {"mod-description." .. name}, "\n\n",
{"gui-mod-info.author"} , COLON, (addon.author or '') .. "\n",
{"gui-mod-info.mod-portal-page"} , COLON, (addon.mod_portal_page or '') .. "\n",
{"gui-mod-info.homepage"} , COLON, addon.homepage or ''
}
})
if addon.have_settings then
require("addons/settings/" .. name)
end
end
end
for name, addon in pairs(safe_addons_list) do
ZKSettings.create_bool_setting("zk-lib-during-game_" .. name, "runtime-global", false, {
localised_name = {'', "[color=orange]", {"zk-lib.addons"}, COLON, "[/color] ", {"mod-name." .. name}},
localised_description = {'', {"gui-mod-info.description"} , COLON, " ", {"mod-description." .. name}, "\n\n",
{"gui-mod-info.author"} , COLON, " " .. (addon.author or '') .. "\n",
{"gui-mod-info.mod-portal-page"} , COLON, " " .. (addon.mod_portal_page or '') .. "\n",
{"gui-mod-info.homepage"} , COLON, " " .. (addon.homepage or '')
}
})
if addon.have_settings then
require("addons/settings/" .. name)
end
end