Minor bug fixing, added patcher for Export.lua, added plugin options to enable/disable mod

This commit is contained in:
Pax1601
2023-02-18 12:52:43 +01:00
parent 433b4bdf56
commit 0308f7c6a3
51 changed files with 767 additions and 271 deletions

163
mod/Options/options.dlg Normal file
View File

@@ -0,0 +1,163 @@
-- Olympus
-- Layout
local TopMargin = 48
local LeftMargin = 32
local CenterMargin = 80
local LeftColumnX = LeftMargin
local LeftColumnLabelWidth = 232
local LeftColumnOptionWidth = 272
local LeftColumnWidth = LeftColumnLabelWidth + LeftColumnOptionWidth
local RightColumnX = LeftColumnX + LeftColumnWidth + CenterMargin
local RightColumnLabelWidth = 192
local RightColumnOptionWidth = 128
local RightColumnWidth = RightColumnLabelWidth + RightColumnOptionWidth
local LineHeight = 24
local TotalLineHeight = LineHeight + 8
local HelpLineHeight = 16
-- Styles
local TitleSkin = {
["params"] = {
["name"] = "staticOptionsTitleSkin",
},
["states"] = {
["released"] = {
[1] = {
["text"] = {
["horzAlign"] = {
["type"] = "min"
}
}
}
}
}
}
local OptionLabelSkin = {
["params"] = {
["name"] = "staticOptionsCaptionSkin",
}
}
local WarningSkin = {
["params"] = {
["name"] = "staticOptionsCaptionSkin",
},
["states"] = {
["released"] = {
[1] = {
["text"] = {
["horzAlign"] = {
["type"] = "min"
},
["color"] = "0xEFB441ff",
}
}
}
}
}
local CheckBoxSkin = {
["params"] = {
["name"] = "checkBoxSkin_options",
}
}
local ComboListSkin = {
["params"] = {
["name"] = "comboListSkin_options",
}
}
local EditBoxSkin = {
["params"] = {
["name"] = "editBoxSkin_login",
}
}
-- Content
dialog = {
["children"] = {
["containerPlugin"] = {
["children"] = {
-----------------------------------------------
-- [X] Enable Olympus Module
-----------------------------------------------
-- Olympus Module Enabled
["olympusModuleEnabledCheckbox"] = {
["params"] = {
["bounds"] = {
["x"] = LeftColumnX,
["y"] = TopMargin,
["w"] = 256,
["h"] = LineHeight,
},
["enabled"] = true,
["state"] = false,
["text"] = "$Olympus_MODULE_ENABLED_LABEL",
["tooltip"] = "",
["visible"] = true,
["zindex"] = 0,
["tabOrder"] = 1,
},
["skin"] = CheckBoxSkin,
["type"] = "CheckBox",
},
},
["params"] = {
["bounds"] = {
["h"] = 600,
["w"] = 974,
["x"] = 0,
["y"] = 0,
},
["enabled"] = true,
["text"] = "",
["tooltip"] = "",
["visible"] = true,
["zindex"] = 0,
},
["skin"] = {
["params"] = {
["name"] = "panelSkin",
},
},
["type"] = "Panel",
},
},
["params"] = {
["bounds"] = {
["h"] = 851,
["w"] = 1135,
["x"] = 0,
["y"] = 0,
},
["draggable"] = true,
["enabled"] = true,
["hasCursor"] = true,
["lockFlow"] = false,
["modal"] = false,
["offscreen"] = false,
["resizable"] = false,
["text"] = "New dialog",
["zOrder"] = 0,
},
["skin"] = {
["params"] = {
["name"] = "windowSkin",
},
},
["type"] = "Window",
}

View File

@@ -0,0 +1,7 @@
cdata =
{
-- Module on/off
Olympus_MODULE_ENABLED_LABEL = _("Olympus Module Enabled"),
}

60
mod/Options/optionsDb.lua Normal file
View 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,
}