From f643b722652c27a761962a4c571d6aa5671b4ac6 Mon Sep 17 00:00:00 2001 From: Lanerra Date: Wed, 30 Oct 2013 01:17:03 -0700 Subject: [PATCH] - Fixed how tags are handled - Now compatible with Mists of Pandaria --- Tags.lua | 60 +++++++++++++++++++++++++++---------------------------- oUF_Lanerra.lua | 57 +++++++++++++++++----------------------------------- oUF_Lanerra.toc | 4 ++-- 3 files changed, 50 insertions(+), 71 deletions(-) diff --git a/Tags.lua b/Tags.lua index 1b29516..ab70905 100644 --- a/Tags.lua +++ b/Tags.lua @@ -1,18 +1,18 @@ -- Copyright © 2010-2011 Lanerra. See LICENSE file for license terms. -- Define some custom oUF tags -oUF.Tags['LanPvPTime'] = function(unit) +oUF.Tags.Methods['LanPvPTime'] = function(unit) return UnitIsPVP(unit) and not IsPVPTimerRunning() and '*' or IsPVPTimerRunning() and ('%d:%02d'):format((GetPVPTimer() / 1000) / 60, (GetPVPTimer() / 1000) % 60) end -oUF.TagEvents['LanThreat'] = 'UNIT_THREAT_LIST_UPDATE' -oUF.Tags['LanThreat'] = function() +oUF.Tags.Events['LanThreat'] = 'UNIT_THREAT_LIST_UPDATE' +oUF.Tags.Methods['LanThreat'] = function() local _, _, perc = UnitDetailedThreatSituation('player', 'target') return perc and ('%s%d%%|r'):format(hex(GetThreatStatusColor(UnitThreatSituation('player', 'target'))), perc) end -oUF.TagEvents['LanClassification'] = 'UNIT_CLASSIFICATION_CHANGED' -oUF.Tags['LanClassification'] = function(unit) +oUF.Tags.Events['LanClassification'] = 'UNIT_CLASSIFICATION_CHANGED' +oUF.Tags.Methods['LanClassification'] = function(unit) local level = UnitLevel(unit) local colorL = GetQuestDifficultyColor(level) @@ -34,7 +34,7 @@ oUF.Tags['LanClassification'] = function(unit) end end -oUF.Tags['LanLevel'] = function(unit) +oUF.Tags.Methods['LanLevel'] = function(unit) local level = UnitLevel(unit) local colorL = GetQuestDifficultyColor(level) @@ -52,8 +52,8 @@ oUF.Tags['LanLevel'] = function(unit) return format('|cff%02x%02x%02x%s|r', r*255, g*255, b*255, level) end -oUF.TagEvents['LanName'] = 'UNIT_NAME_UPDATE UNIT_HEALTH' -oUF.Tags['LanName'] = function(unit) +oUF.Tags.Events['LanName'] = 'UNIT_NAME_UPDATE UNIT_HEALTH' +oUF.Tags.Methods['LanName'] = function(unit) local colorA local UnitName, UnitRealm = UnitName(unit) local _, class = UnitClass(unit) @@ -79,8 +79,8 @@ oUF.Tags['LanName'] = function(unit) end end -oUF.TagEvents['LanRaidName'] = 'UNIT_NAME_UPDATE UNIT_HEALTH' -oUF.Tags['LanRaidName'] = function(unit) +oUF.Tags.Events['LanRaidName'] = 'UNIT_NAME_UPDATE UNIT_HEALTH' +oUF.Tags.Methods['LanRaidName'] = function(unit) if (not UnitIsConnected(unit)) then Name = '|cffD7BEA5'..'OFFLINE' elseif (UnitIsDead(unit)) then @@ -94,8 +94,8 @@ oUF.Tags['LanRaidName'] = function(unit) return Name end -oUF.TagEvents['LanShortName'] = 'UNIT_NAME_UPDATE UNIT_HEALTH' -oUF.Tags['LanShortName'] = function(unit) +oUF.Tags.Events['LanShortName'] = 'UNIT_NAME_UPDATE UNIT_HEALTH' +oUF.Tags.Methods['LanShortName'] = function(unit) local name = UnitName(unit) if (not UnitIsConnected(unit)) then Name = '|cffD7BEA5'..'OFFLINE' @@ -116,23 +116,23 @@ oUF.Tags['LanShortName'] = function(unit) end end -oUF.TagEvents['LanPower'] = 'UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_MAXRUNIC_POWER UNIT_RUNIC_POWER' -oUF.Tags['LanPower'] = function(unit) +oUF.Tags.Events['LanPower'] = 'UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_MAXRUNIC_POWER UNIT_RUNIC_POWER' +oUF.Tags.Methods['LanPower'] = function(unit) local min = UnitPower(unit) return min end -oUF.TagEvents['LanCombat'] = 'PLAYER_REGEN_DISABLED PLAYER_REGEN_ENABLED' -oUF.Tags['LanCombat'] = function(unit) +oUF.Tags.Events['LanCombat'] = 'PLAYER_REGEN_DISABLED PLAYER_REGEN_ENABLED' +oUF.Tags.Methods['LanCombat'] = function(unit) if unit == 'player' and UnitAffectingCombat('player') then return [[|TInterface\CharacterFrame\UI-StateIcon:0:0:0:0:64:64:37:58:5:26|t]] end end -oUF.UnitlessTagEvents['PLAYER_REGEN_DISABLED'] = true -oUF.UnitlessTagEvents['PLAYER_REGEN_ENABLED'] = true +oUF.Tags.SharedEvents['PLAYER_REGEN_DISABLED'] = true +oUF.Tags.SharedEvents['PLAYER_REGEN_ENABLED'] = true -oUF.TagEvents['LanLeader'] = 'PARTY_LEADER_CHANGED PARTY_MEMBERS_CHANGED' -oUF.Tags['LanLeader'] = function(unit) +oUF.Tags.Events['LanLeader'] = 'PARTY_LEADER_CHANGED PARTY_MEMBERS_CHANGED' +oUF.Tags.Methods['LanLeader'] = function(unit) if UnitIsGroupLeader(unit) then return [[|TInterface\GroupFrame\UI-Group-LeaderIcon:0|t]] elseif UnitInRaid(unit) and UnitIsRaidOfficer(unit) then @@ -140,8 +140,8 @@ oUF.Tags['LanLeader'] = function(unit) end end -oUF.TagEvents['LanMaster'] = 'PARTY_LOOT_METHOD_CHANGED PARTY_MEMBERS_CHANGED' -oUF.Tags['LanMaster'] = function(unit) +oUF.Tags.Events['LanMaster'] = 'PARTY_LOOT_METHOD_CHANGED PARTY_MEMBERS_CHANGED' +oUF.Tags.Methods['LanMaster'] = function(unit) local method, pid, rid = GetLootMethod() if method ~= 'master' then return end local munit @@ -159,37 +159,37 @@ oUF.Tags['LanMaster'] = function(unit) end end -oUF.TagEvents['LanResting'] = 'PLAYER_UPDATE_RESTING' -oUF.Tags['LanResting'] = function(unit) +oUF.Tags.Events['LanResting'] = 'PLAYER_UPDATE_RESTING' +oUF.Tags.Methods['LanResting'] = function(unit) if unit == 'player' and IsResting() then return [[|TInterface\CharacterFrame\UI-StateIcon:0:0:0:-6:64:64:28:6:6:28|t]] end end -oUF.Tags['LanHolyPower'] = function(unit) +oUF.Tags.Methods['LanHolyPower'] = function(unit) local hp = UnitPower('player', SPELL_POWER_HOLY_POWER) if hp > 0 then return string.format('|c50f58cba%d|r', hp) end end -oUF.TagEvents['LanHolyPower'] = 'UNIT_POWER' +oUF.Tags.Events['LanHolyPower'] = 'UNIT_POWER' -oUF.Tags['LanShards'] = function(unit) +oUF.Tags.Methods['LanShards'] = function(unit) local hp = UnitPower('player', SPELL_POWER_SOUL_SHARDS) if hp > 0 then return string.format('|c909482c9%d|r', hp) end end -oUF.TagEvents['LanShards'] = 'UNIT_POWER' +oUF.Tags.Events['LanShards'] = 'UNIT_POWER' -oUF.Tags['LanCombo'] = function(unit) +oUF.Tags.Methods['LanCombo'] = function(unit) local cp = GetComboPoints('player', 'target') if cp > 0 then return string.format('|cffffff00%d|r', cp) end end -oUF.TagEvents['LanCombo'] = 'UNIT_COMBO_POINTS' +oUF.Tags.Events['LanCombo'] = 'UNIT_COMBO_POINTS' diff --git a/oUF_Lanerra.lua b/oUF_Lanerra.lua index edb114b..5a2f761 100644 --- a/oUF_Lanerra.lua +++ b/oUF_Lanerra.lua @@ -7,27 +7,6 @@ ---- Lazy Stuff Goes Here! --- Disable Blizzard options that are rendered useless by having a unit frame addon - ---~ for _, button in pairs({ ---~ 'UnitFramePanelPartyBackground', ---~ 'UnitFramePanelPartyPets', ---~ 'UnitFramePanelFullSizeFocusFrame', - ---~ 'CombatPanelTargetOfTarget', ---~ 'CombatPanelTOTDropDown', ---~ 'CombatPanelTOTDropDownButton', ---~ 'CombatPanelEnemyCastBarsOnPortrait', - ---~ 'DisplayPanelShowAggroPercentage', - ---~ 'FrameCategoriesButton9', ---~ }) do ---~ _G['InterfaceOptions'..button]:SetAlpha(0.35) ---~ _G['InterfaceOptions'..button]:Disable() ---~ _G['InterfaceOptions'..button]:EnableMouse(false) ---~ end - do for k, v in pairs(UnitPopupMenus) do for x, i in pairs(UnitPopupMenus[k]) do @@ -1500,9 +1479,9 @@ oUF:Factory(function(self) self:RegisterEvent('PLAYER_REGEN_ENABLED') else self:UnregisterEvent('PLAYER_REGEN_ENABLED') - if (GetNumRaidMembers() < 26 and GetNumRaidMembers() > 10) then + if (GetNumGroupMembers() < 26 and GetNumGroupMembers() > 10) then raid:SetPoint('CENTER', UIParent, -105, -200) - elseif (GetNumRaidMembers() < 11) then + elseif (GetNumGroupMembers() < 11) then raid:SetPoint('CENTER', UIParent, -21, -200) end end @@ -1580,7 +1559,7 @@ partyToggle:SetScript('OnEvent', function(self) your raid already has. This means, the party will be hidden if the party leader clicks the button to create a raid. If you want to switch to raid view later (meaning, if the members no longer fit into the party frame), you may change the following line accordingly.--]] - if (Settings.Units.Raid.Healer) and (Settings.Units.Party.Healer) then + if (Settings.Units.Raid.Healer) and (Settings.Units.Party.Healer) then if(GetNumGroupMembers() > 0) then _G['oUF_Lanerra_Group']:Hide() _G['oUF_Lanerra_Raid']:Show() @@ -1589,21 +1568,21 @@ partyToggle:SetScript('OnEvent', function(self) _G['oUF_Lanerra_Raid']:Hide() end else - if(GetNumGroupMembers() > 0) then - _G['oUF_Lanerra_Group']:Hide() - _G['oUF_Lanerra_Raid1']:Show() - _G['oUF_Lanerra_Raid2']:Show() - _G['oUF_Lanerra_Raid3']:Show() - _G['oUF_Lanerra_Raid4']:Show() - _G['oUF_Lanerra_Raid5']:Show() - else - _G['oUF_Lanerra_Group']:Show() - _G['oUF_Lanerra_Raid1']:Hide() - _G['oUF_Lanerra_Raid2']:Hide() - _G['oUF_Lanerra_Raid3']:Hide() - _G['oUF_Lanerra_Raid4']:Hide() - _G['oUF_Lanerra_Raid5']:Hide() - end + if(GetNumGroupMembers() > 0) then + _G['oUF_Lanerra_Group']:Hide() + _G['oUF_Lanerra_Raid1']:Show() + _G['oUF_Lanerra_Raid2']:Show() + _G['oUF_Lanerra_Raid3']:Show() + _G['oUF_Lanerra_Raid4']:Show() + _G['oUF_Lanerra_Raid5']:Show() + else + _G['oUF_Lanerra_Group']:Show() + _G['oUF_Lanerra_Raid1']:Hide() + _G['oUF_Lanerra_Raid2']:Hide() + _G['oUF_Lanerra_Raid3']:Hide() + _G['oUF_Lanerra_Raid4']:Hide() + _G['oUF_Lanerra_Raid5']:Hide() + end end end end) \ No newline at end of file diff --git a/oUF_Lanerra.toc b/oUF_Lanerra.toc index 621ba6c..2f52514 100644 --- a/oUF_Lanerra.toc +++ b/oUF_Lanerra.toc @@ -1,5 +1,5 @@ -## Interface: 50000 -## Version: 1.3 +## Interface: 50400 +## Version: 1.4 ## Title: oUF_Lanerra ## Notes: oUF layout by Lanerra -- 1.7.9.5