mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Minor bug fixing, added patcher for Export.lua, added plugin options to enable/disable mod
This commit is contained in:
60
mod/Options/optionsDb.lua
Normal file
60
mod/Options/optionsDb.lua
Normal file
@@ -0,0 +1,60 @@
|
||||
local DbOption = require("Options.DbOption")
|
||||
local i18n = require('i18n')
|
||||
|
||||
-- Constants
|
||||
|
||||
|
||||
-- Local variables
|
||||
|
||||
local olympusConfigDialog = nil
|
||||
|
||||
-- Update UI
|
||||
|
||||
local function UpdateOptions()
|
||||
|
||||
-- Check parameters
|
||||
|
||||
if olympusConfigDialog == nil then
|
||||
return
|
||||
end
|
||||
|
||||
local moduleEnabled = olympusConfigDialog.olympusModuleEnabledCheckbox:getState()
|
||||
|
||||
end
|
||||
|
||||
-- Callbacks
|
||||
|
||||
local function OnShowDialog(dialogBox)
|
||||
|
||||
-- Setup local variables
|
||||
|
||||
if olympusConfigDialog ~= dialogBox then
|
||||
olympusConfigDialog = dialogBox
|
||||
end
|
||||
|
||||
-- Update dialog box state
|
||||
|
||||
UpdateOptions()
|
||||
|
||||
end
|
||||
|
||||
-- Module on/off
|
||||
|
||||
local olympusModuleEnabled = DbOption.new():setValue(true):checkbox()
|
||||
:callback(function(value)
|
||||
UpdateOptions()
|
||||
end)
|
||||
|
||||
-- Returns dialog box controls and callbacks
|
||||
|
||||
return
|
||||
{
|
||||
-- Events
|
||||
|
||||
callbackOnShowDialog = OnShowDialog,
|
||||
|
||||
-- Module on/off
|
||||
|
||||
olympusModuleEnabled = olympusModuleEnabled,
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user