ModOptions WIP (paused)!
Allows other mods to be customized.
Any mod author can add custom options to their mod.
Requirements
(!) THIS MOD IS COMPATIBLE ONLY WITH BUILD 41
(!) For Build 42 see [url=https://steamcommunity.com/sharedfiles/filedetails/?id=3386860561]here[/url].
Steam Workshop Issues
1. Quit the game.
2. Unsubscribe. Wait ~1 minute.
3. Subscribe. Wait ~1 minute.
4. Make sure the mod version is [b]1.4.4[/b]
Minimal Code (for modders)
Put it in subfolder media/lua/client of your mod folder.
-- These are the 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, "MyModID", "My Mod")
end
-- Check actual options at game loading.
Events.OnGameStart.Add(function()
print("checkbox1 = ", OPTIONS.box1)
print("checkbox2 = ", OPTIONS.box2)
end)
This mod should be enbaled.
But note that your mod will work without this mod!
So you do not have to create a hard dependence on this mod.
For more info, see [url=https://steamcommunity.com/workshop/filedetails/discussion/2169435993/4260919351480715709/]Guide[/url].
TODO:
- Options other than checkbox (done)
- Option like edit input.
- Option like change color.
- Possibility to add custom tab
- Possibility to tune by server admins only (using UI)
- Sandbox options. (done)
Workshop ID: 2169435993
Mod ID: modoptions