-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkbox.lua
30 lines (29 loc) · 1.06 KB
/
checkbox.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
local t = {}
local fileHelper = require("Resources.coroModLoader.modLoader.modApi.fileHelper")
function t:createCheckbox(modName,description,context)
context = context or nil
local datas =
{
label = description,
contextText = context,
getValue = function()
return modLoaderApi:getActivatedMod(modName)
end,
setValue = function(_boolean)
modLoaderApi:setActivatedMod(modName,_boolean)
fileHelper:write(json.encode(modLoaderApi.modList),"Resources/coroModLoader/mods.json","w")
modListEdited = true
end
}
local Obj = {}
local AbstractCheckboxSetting = require("classes.interface.settingObjects.AbstractCheckboxSetting")
function Obj:shouldBeRendered(_isFromTitleScreen)
return true
end
function Obj:new(_parent, _settingsScrollView, _UID, _focusArrow, _options)
local checkboxSetting, checkboxNavigation = AbstractCheckboxSetting:new(_parent,_settingsScrollView, modName.."Checkbox", _focusArrow, datas)
return checkboxSetting, checkboxNavigation
end
return Obj
end
return t