Adding ModOptions
This commit is contained in:
14
media/lua/client/TOC_ClientOptions.lua
Normal file
14
media/lua/client/TOC_ClientOptions.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
--Default options.
|
||||||
|
local options = {
|
||||||
|
box1 = true,
|
||||||
|
box2 = false
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Connecting the options to the menu, so user can change them.
|
||||||
|
if ModOptions and ModOptions.getInstance then
|
||||||
|
ModOptions:getInstance(options, "Amputation2", "The Only Cure but better")
|
||||||
|
end
|
||||||
|
|
||||||
|
--Make a link
|
||||||
|
TOC_Options = {}
|
||||||
|
TOC_Options = options
|
||||||
@@ -116,7 +116,7 @@ function TheOnlyCure.DeclareTraits()
|
|||||||
TraitFactory.setMutualExclusive("amputee2", "amputee3")
|
TraitFactory.setMutualExclusive("amputee2", "amputee3")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- ModOptions implement it you cuck
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
9
media/lua/server/TOC_ServerOptions.lua
Normal file
9
media/lua/server/TOC_ServerOptions.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
local options = TOC_Options
|
||||||
|
|
||||||
|
-- Check actual options at game loading.
|
||||||
|
Events.OnGameStart.Add(function()
|
||||||
|
if not isClient() then -- only host may take these options
|
||||||
|
print("checkbox1 = ", options.box1)
|
||||||
|
print("checkbox2 = ", options.box2)
|
||||||
|
end
|
||||||
|
end)
|
||||||
Reference in New Issue
Block a user