mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
Added option (enabled by default) to hide mod during shell games
This commit is contained in:
11
IceCore.lua
11
IceCore.lua
@ -94,6 +94,7 @@ function IceCore.prototype:SetupDefaults()
|
||||
|
||||
bHideDuringPetBattles = true,
|
||||
bHideInBarberShop = true,
|
||||
bHideDuringShellGame = true,
|
||||
},
|
||||
global = {
|
||||
lastRunVersion = 0,
|
||||
@ -254,6 +255,7 @@ function IceCore.prototype:Enable(userToggle)
|
||||
self.IceHUDFrame:RegisterEvent("PET_BATTLE_OVER")
|
||||
self.IceHUDFrame:RegisterEvent("BARBER_SHOP_OPEN")
|
||||
self.IceHUDFrame:RegisterEvent("BARBER_SHOP_CLOSE")
|
||||
self.IceHUDFrame:RegisterEvent("UNIT_AURA")
|
||||
self.IceHUDFrame:SetScript("OnEvent", function(self, event, ...)
|
||||
if (event == "PET_BATTLE_OPENING_START") then
|
||||
if IceHUD.IceCore.settings.bHideDuringPetBattles then
|
||||
@ -271,6 +273,15 @@ function IceCore.prototype:Enable(userToggle)
|
||||
if IceHUD.IceCore.settings.bHideInBarberShop then
|
||||
self:Show()
|
||||
end
|
||||
elseif (event == "UNIT_AURA") then
|
||||
local unit = ...
|
||||
if IceHUD.IceCore.settings.bHideDuringShellGame and unit == "player" and IceHUD:HasDebuffs("player", {271571})[1] and UnitInVehicle("player") then
|
||||
self:RegisterEvent("UNIT_EXITED_VEHICLE")
|
||||
self:Hide()
|
||||
end
|
||||
elseif (event == "UNIT_EXITED_VEHICLE") then
|
||||
self:UnregisterEvent("UNIT_EXITED_VEHICLE")
|
||||
self:Show()
|
||||
end
|
||||
end)
|
||||
|
||||
|
@ -398,6 +398,23 @@ Blizzard added a "Personal Resource Display" feature in the 7.0 game client. You
|
||||
end,
|
||||
order = 35,
|
||||
},
|
||||
|
||||
bHideDuringShellGame = {
|
||||
type = 'toggle',
|
||||
name = L["Hide during shell game"],
|
||||
desc = L["This will hide the entire mod when playing the BfA Tortollan shell game world quest."],
|
||||
width = 'double',
|
||||
get = function()
|
||||
return IceHUD.IceCore.settings.bHideDuringShellGame
|
||||
end,
|
||||
set = function(info, value)
|
||||
IceHUD.IceCore.settings.bHideDuringShellGame = value
|
||||
if not value then
|
||||
IceHUD.IceCore.IceHUDFrame:Show()
|
||||
end
|
||||
end,
|
||||
order = 36,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user