- re-added "enabled" checkbox in the settings to allow users to completely enable/disable the mod (this seems to have been something we got for free with one of the ace2 libraries and is no longer present after the move to ace3)

This commit is contained in:
Parnic
2010-09-15 13:17:20 +00:00
parent d5f2ccb14a
commit 1f4a4491ea
2 changed files with 20 additions and 8 deletions

View File

@ -39,6 +39,7 @@ function IceCore.prototype:SetupDefaults()
local defaultPreset = "RoundBar"
self.defaults = {
profile = {
enable = true,
gap = 150,
verticalPos = -110,
horizontalPos = 0,
@ -118,7 +119,11 @@ function IceCore.prototype:CheckDisplayUpdateMessage()
end
function IceCore.prototype:Enable()
function IceCore.prototype:Enable(userToggle)
if userToggle then
self.settings.enable = true
end
self:DrawFrame()
for i = 1, table.getn(self.elements) do
@ -269,7 +274,11 @@ function IceCore.prototype:SetModuleDatabases()
end
function IceCore.prototype:Disable()
function IceCore.prototype:Disable(userToggle)
if userToggle then
self.settings.enable = false
end
self:ConfigModeToggle(false)
for i = 1, table.getn(self.elements) do

View File

@ -377,6 +377,7 @@ Expand "|cffffdc42Module Settings|r", expand PlayerInfo (or TargetInfo for targe
IceHUD.IceCore:SetFontFamily(info.option.values[value])
end,
values = SML:List('font'),
order = 94.75,
},
barSettings = {
@ -531,24 +532,24 @@ Expand "|cffffdc42Module Settings|r", expand PlayerInfo (or TargetInfo for targe
args = {},
order = 42
},
--[[
enabled = {
type = "toggle",
name = "|cff11aa11Enabled|r",
name = "Enabled",
desc = "Enable/disable IceHUD",
get = function()
return IceHUD.IceCore:IsEnabled()
end,
set = function(info, value)
if (value) then
IceHUD.IceCore:Enable()
IceHUD.IceCore:Enable(true)
else
IceHUD.IceCore:Disable()
IceHUD.IceCore:Disable(true)
end
end,
order = 91
},
]]
debug = {
type = "toggle",
name = "Debugging",
@ -1021,7 +1022,9 @@ end
function IceHUD:OnEnable(isFirst)
self:Debug("IceHUD:OnEnable()")
if self.db.profile.enable then
self.IceCore:Enable()
end
if isFirst then
self:SetDebugging(self.IceCore:GetDebug())