- added some more protection against people tweaking settings or changing profiles while in combat and added a warning message explaining that stuff could be broked if they manage to do it anyway

- fixed cooldown bars that are set to "when ready" to be properly hidden when the module is disabled or profiles are changed
This commit is contained in:
Parnic
2010-09-22 05:47:01 +00:00
parent bd96c59012
commit 1af2c4d831
3 changed files with 28 additions and 5 deletions

View File

@ -98,7 +98,7 @@ function IceElement.prototype:Disable(core)
if (not core) then if (not core) then
self.moduleSettings.enabled = false self.moduleSettings.enabled = false
end end
self:Show(false) self:Show(false, true)
self:UnregisterAllEvents() self:UnregisterAllEvents()
end end

View File

@ -863,6 +863,20 @@ StaticPopupDialogs["ICEHUD_CHANGED_DOGTAG"] = {
hideOnEscape = 0 hideOnEscape = 0
} }
StaticPopupDialogs["ICEHUD_CHANGED_PROFILE_COMBAT"] = {
text = "You have changed IceHUD profiles while in combat. This can cause problems due to Blizzard's secure frame policy. You may need to reload your UI to repair IceHUD.",
button1 = OKAY,
OnShow = function(self)
self:SetFrameStrata("TOOLTIP")
end,
OnHide = function(self)
self:SetFrameStrata("DIALOG")
end,
timeout = 0,
whileDead = 1,
hideOnEscape = 0
}
function IceHUD:OnInitialize() function IceHUD:OnInitialize()
self:SetDebugging(false) self:SetDebugging(false)
self:Debug("IceHUD:OnInitialize()") self:Debug("IceHUD:OnInitialize()")
@ -892,7 +906,13 @@ function IceHUD:OnInitialize()
LibStub("AceConfig-3.0"):RegisterOptionsTable("IceHUD", self.options, "/icehudcl") LibStub("AceConfig-3.0"):RegisterOptionsTable("IceHUD", self.options, "/icehudcl")
ConfigDialog:SetDefaultSize("IceHUD", 750, 650) ConfigDialog:SetDefaultSize("IceHUD", 750, 650)
self:RegisterChatCommand("icehud", function() IceHUD:OpenConfig() end) self:RegisterChatCommand("icehud", function()
if not UnitAffectingCombat("player") then
IceHUD:OpenConfig()
else
DEFAULT_CHAT_FRAME:AddMessage("|cff8888ffIceHUD|r: Combat lockdown restriction. Leave combat and try again.")
end
end)
self:RegisterChatCommand("rl", function() ReloadUI() end) self:RegisterChatCommand("rl", function() ReloadUI() end)
self:SyncSettingsVersions() self:SyncSettingsVersions()
@ -1052,7 +1072,7 @@ function IceHUD:InitLDB()
label = "IceHUD", label = "IceHUD",
icon = "Interface\\Icons\\Spell_Frost_Frost", icon = "Interface\\Icons\\Spell_Frost_Frost",
OnClick = function(button, msg) OnClick = function(button, msg)
if not (UnitAffectingCombat("player")) then if not UnitAffectingCombat("player") then
IceHUD:OpenConfig() IceHUD:OpenConfig()
else else
DEFAULT_CHAT_FRAME:AddMessage("|cff8888ffIceHUD|r: Combat lockdown restriction. Leave combat and try again.") DEFAULT_CHAT_FRAME:AddMessage("|cff8888ffIceHUD|r: Combat lockdown restriction. Leave combat and try again.")
@ -1174,6 +1194,9 @@ function IceHUD:OnDisable()
end end
function IceHUD:PreProfileChanged(db) function IceHUD:PreProfileChanged(db)
if UnitAffectingCombat("player") then
StaticPopup_Show("ICEHUD_CHANGED_PROFILE_COMBAT")
end
self.IceCore:Disable() self.IceCore:Disable()
end end

View File

@ -535,8 +535,8 @@ function IceCustomCDBar.prototype:IsReady()
return is_ready return is_ready
end end
function IceCustomCDBar.prototype:Show(bShouldShow) function IceCustomCDBar.prototype:Show(bShouldShow, bForceHide)
if self.moduleSettings.enabled then if self.moduleSettings.enabled and not bForceHide then
if (self.moduleSettings.displayMode == "Always") then if (self.moduleSettings.displayMode == "Always") then
if not self.bIsVisible then if not self.bIsVisible then
IceCustomCDBar.super.prototype.Show(self, true) IceCustomCDBar.super.prototype.Show(self, true)