Omen will now remember its visible state when you log out (applicable only if auto-show/hide is off).
This commit is contained in:
@@ -266,6 +266,7 @@ local function stopmoving(self)
|
||||
Omen:UpdateBars()
|
||||
Omen.Anchor.IsMovingOrSizing = nil
|
||||
end
|
||||
if self == Omen.Anchor then db.Shown = self:IsShown() end
|
||||
end
|
||||
local function sizing(self)
|
||||
local w = Omen.Anchor:GetWidth()
|
||||
@@ -325,6 +326,7 @@ function Omen:CreateFrames()
|
||||
self.Anchor:SetWidth(225)
|
||||
self.Anchor:SetHeight(150)
|
||||
self.Anchor:SetScript("OnHide", stopmoving)
|
||||
self.Anchor:SetScript("OnShow", function(self) db.Shown = true end)
|
||||
|
||||
-- Create Title
|
||||
self.Title = CreateFrame("Button", "OmenTitle", self.Anchor)
|
||||
@@ -474,6 +476,7 @@ function Omen:PLAYER_LOGIN()
|
||||
self:UpdateGrips()
|
||||
self:ClearAll()
|
||||
self:UnregisterEvent("PLAYER_LOGIN")
|
||||
if not db.Shown then self.Anchor:Hide() end -- Auto-show/hide will override this later if enabled
|
||||
|
||||
if LDB then
|
||||
OmenLauncher = LDB:NewDataObject("Omen", {
|
||||
@@ -1289,7 +1292,7 @@ local function updatethreat(unitid, mobunitid)
|
||||
local guid = UnitGUID(unitid)
|
||||
if guid and not threatTable[guid] then
|
||||
local isTanking, state, scaledPercent, rawPercent, threatValue = UnitDetailedThreatSituation(unitid, mobunitid)
|
||||
-- Threat can be negative due to temporary threat reduction effects such as Fade and Mirror Image.
|
||||
-- Threat can be negative due to temporary threat reduction effects such as Fade and Mirror Image (-410057408).
|
||||
-- So we cap the minimum threat to display at 0. We use the special value -1 to indicate nil here.
|
||||
threatTable[guid] = (threatValue and (threatValue >= 0 and threatValue or 0)) or -1
|
||||
if threatValue and threatValue > topthreat then topthreat = threatValue end
|
||||
|
||||
Reference in New Issue
Block a user