Minor optimization and tweaks.
This commit is contained in:
@@ -54,7 +54,7 @@ LSM:Register("sound", "Omen: Aoogah!", [[Interface\AddOns\Omen\aoogah.ogg]])
|
||||
-----------------------------------------------------------------------------
|
||||
-- Localize some global functions
|
||||
local floor, format = floor, format
|
||||
local tinsert, tremove, sort, wipe = tinsert, tremove, sort, wipe
|
||||
local tinsert, tremove, next, sort, wipe = tinsert, tremove, next, sort, wipe
|
||||
local UnitDetailedThreatSituation = UnitDetailedThreatSituation
|
||||
local UnitExists, UnitGUID, UnitName, UnitClass = UnitExists, UnitGUID, UnitName, UnitClass
|
||||
local UnitIsPlayer, UnitPlayerControlled, UnitCanAttack = UnitIsPlayer, UnitPlayerControlled, UnitCanAttack
|
||||
@@ -1091,12 +1091,11 @@ function Omen:UpdatePartyGUIDs()
|
||||
end
|
||||
|
||||
local _
|
||||
for k, v in pairs(guidClassLookup) do
|
||||
guidClassLookup[k] = nil
|
||||
end
|
||||
if UnitGUID("player") then
|
||||
guidNameLookup[UnitGUID("player")] = UnitName("player")
|
||||
_, guidClassLookup[UnitGUID("player")] = UnitClass("player")
|
||||
local me = UnitGUID("player")
|
||||
wipe(guidClassLookup)
|
||||
if me then -- Because it sometimes is nil on zoning/logging in.
|
||||
guidNameLookup[me] = UnitName("player")
|
||||
_, guidClassLookup[me] = UnitClass("player")
|
||||
end
|
||||
if UnitExists("pet") then
|
||||
guidClassLookup[UnitGUID("pet")] = "PET"
|
||||
@@ -1126,9 +1125,9 @@ function Omen:UpdatePartyGUIDs()
|
||||
end
|
||||
end
|
||||
end
|
||||
guidNameLookup["AGGRO"] = L["> Pull Aggro <"]
|
||||
guidClassLookup["AGGRO"] = "AGGRO"
|
||||
end
|
||||
guidNameLookup["AGGRO"] = L["> Pull Aggro <"]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
@@ -1559,7 +1558,7 @@ do
|
||||
Omen_TitleDropDownMenu.displayMode = "MENU"
|
||||
Omen_TitleDropDownMenu.initialize = function(self, level)
|
||||
if not level then return end
|
||||
for k in pairs(info) do info[k] = nil end
|
||||
wipe(info)
|
||||
if level == 1 then
|
||||
-- Create the title of the menu
|
||||
info.isTitle = 1
|
||||
@@ -1593,6 +1592,7 @@ do
|
||||
info.func = function()
|
||||
testMode = not testMode
|
||||
Omen:UpdateBars()
|
||||
LibStub("AceConfigRegistry-3.0"):NotifyChange("Omen")
|
||||
end
|
||||
info.checked = testMode
|
||||
info.tooltipTitle = L["Test Mode"]
|
||||
|
||||
Reference in New Issue
Block a user