Add start of sharedconfig callbacks
This commit is contained in:
parent
79cd101467
commit
400318bb63
13
script.lua
13
script.lua
@ -29,6 +29,13 @@ local_state={}
|
|||||||
old_state={}
|
old_state={}
|
||||||
-- master state variables and configuration (do not access within pings) --
|
-- master state variables and configuration (do not access within pings) --
|
||||||
do
|
do
|
||||||
|
local function refresh_armor()
|
||||||
|
if player:isLoaded() then PartsManager.refreshPartList(VANILLA_GROUPS.ARMOR) end
|
||||||
|
end
|
||||||
|
local function refresh_tail()
|
||||||
|
if player:isLoaded() then PartsManager.refreshPart(model.Body_Tail) end
|
||||||
|
end
|
||||||
|
|
||||||
local defaults={
|
local defaults={
|
||||||
["armor_enabled"]=true,
|
["armor_enabled"]=true,
|
||||||
["vanilla_enabled"]=false,
|
["vanilla_enabled"]=false,
|
||||||
@ -36,8 +43,12 @@ do
|
|||||||
["print_settings"]=false,
|
["print_settings"]=false,
|
||||||
["tail_enabled"]=true,
|
["tail_enabled"]=true,
|
||||||
}
|
}
|
||||||
|
local callbacks={
|
||||||
|
["armor_enabled"]=refresh_armor,
|
||||||
|
["tail_enabled"]=refresh_tail
|
||||||
|
}
|
||||||
|
|
||||||
sharedconfig.load_defaults(defaults)
|
sharedconfig.load_defaults(defaults, callbacks)
|
||||||
end
|
end
|
||||||
|
|
||||||
function printSettings()
|
function printSettings()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user