mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- 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:
@ -98,7 +98,7 @@ function IceElement.prototype:Disable(core)
|
||||
if (not core) then
|
||||
self.moduleSettings.enabled = false
|
||||
end
|
||||
self:Show(false)
|
||||
self:Show(false, true)
|
||||
self:UnregisterAllEvents()
|
||||
end
|
||||
|
||||
|
27
IceHUD.lua
27
IceHUD.lua
@ -863,6 +863,20 @@ StaticPopupDialogs["ICEHUD_CHANGED_DOGTAG"] = {
|
||||
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()
|
||||
self:SetDebugging(false)
|
||||
self:Debug("IceHUD:OnInitialize()")
|
||||
@ -892,7 +906,13 @@ function IceHUD:OnInitialize()
|
||||
LibStub("AceConfig-3.0"):RegisterOptionsTable("IceHUD", self.options, "/icehudcl")
|
||||
|
||||
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:SyncSettingsVersions()
|
||||
@ -1052,7 +1072,7 @@ function IceHUD:InitLDB()
|
||||
label = "IceHUD",
|
||||
icon = "Interface\\Icons\\Spell_Frost_Frost",
|
||||
OnClick = function(button, msg)
|
||||
if not (UnitAffectingCombat("player")) then
|
||||
if not UnitAffectingCombat("player") then
|
||||
IceHUD:OpenConfig()
|
||||
else
|
||||
DEFAULT_CHAT_FRAME:AddMessage("|cff8888ffIceHUD|r: Combat lockdown restriction. Leave combat and try again.")
|
||||
@ -1174,6 +1194,9 @@ function IceHUD:OnDisable()
|
||||
end
|
||||
|
||||
function IceHUD:PreProfileChanged(db)
|
||||
if UnitAffectingCombat("player") then
|
||||
StaticPopup_Show("ICEHUD_CHANGED_PROFILE_COMBAT")
|
||||
end
|
||||
self.IceCore:Disable()
|
||||
end
|
||||
|
||||
|
@ -535,8 +535,8 @@ function IceCustomCDBar.prototype:IsReady()
|
||||
return is_ready
|
||||
end
|
||||
|
||||
function IceCustomCDBar.prototype:Show(bShouldShow)
|
||||
if self.moduleSettings.enabled then
|
||||
function IceCustomCDBar.prototype:Show(bShouldShow, bForceHide)
|
||||
if self.moduleSettings.enabled and not bForceHide then
|
||||
if (self.moduleSettings.displayMode == "Always") then
|
||||
if not self.bIsVisible then
|
||||
IceCustomCDBar.super.prototype.Show(self, true)
|
||||
|
Reference in New Issue
Block a user