From 4d94927b09ae68665be328a13ba0dfbd68493af1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 27 Jun 2010 18:13:25 -0700 Subject: [PATCH 001/794] Added help text if you have an unit override set in zone configuration that 'conflicts' with the global one, so people don't forget about ozone overrides --- options/config.lua | 68 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index 687b5ace..de5f925b 100644 --- a/options/config.lua +++ b/options/config.lua @@ -3472,6 +3472,19 @@ local function loadUnitOptions() Config.unitTable.args.indicators.args[indicator] = Config.indicatorTable end + -- Check for unit conflicts + local function hideZoneConflict() + for _, zone in pairs(ShadowUF.db.profile.visibility) do + for unit, status in pairs(zone) do + if( L.units[unit] and ( not status and ShadowUF.db.profile.units[unit].enabled or status and not ShadowUF.db.profile.units[unit].enabled ) ) then + return nil + end + end + end + + return true + end + options.args.enableUnits = { type = "group", name = L["Enabled units"], @@ -3482,7 +3495,13 @@ local function loadUnitOptions() type = "group", inline = true, name = L["Help"], - hidden = hideBasicOption, + hidden = function() + if( not hideZoneConflict() or hideBasicOption() ) then + return true + end + + return nil + end, args = { help = { order = 0, @@ -3491,6 +3510,53 @@ local function loadUnitOptions() }, }, }, + zoneenabled = { + order = 1.5, + type = "group", + inline = true, + name = L["Zone configuration units"], + hidden = hideZoneConflict, + args = { + help = { + order = 1, + type = "description", + name = L["|cffff2020Warning!|r Some units have overrides set in zone configuration, and may show (or not show up) in certain zone. Regardless of the settings below."] + }, + sep = { + order = 2, + type = "header", + name = "", + }, + units = { + order = 3, + type = "description", + name = function() + local text = {} + + for zoneType, zone in pairs(ShadowUF.db.profile.visibility) do + local errors = {} + for unit, status in pairs(zone) do + if( L.units[unit] ) then + if ( not status and ShadowUF.db.profile.units[unit].enabled ) then + table.insert(errors, string.format(L["|cffff2020%s|r units disabled"], L.units[unit])) + elseif( status and not ShadowUF.db.profile.units[unit].enabled ) then + table.insert(errors, string.format(L["|cff20ff20%s|r units enabled"], L.units[unit])) + end + end + end + + if( #(errors) > 1 ) then + table.insert(text, string.format("|cfffed000%s|r have the following overrides: %s", AREA_NAMES[zoneType], table.concat(errors, ", "))) + elseif( #(errors) == 1 ) then + table.insert(text, string.format("|cfffed000%s|r has the override: %s", AREA_NAMES[zoneType], errors[1])) + end + end + + return #(text) > 0 and table.concat(text, "|n") or "" + end, + }, + }, + }, enabled = { order = 2, type = "group", From 3892a245cfdf7d19f392ce6797febafc10ea1523 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 30 Jun 2010 20:57:40 -0700 Subject: [PATCH 002/794] Fixing a bug when anchoring one aura group to another, and the other group is not shown --- modules/auras.lua | 4 ++-- modules/indicators.lua | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 50e6415b..e575ad77 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -561,10 +561,10 @@ local function anchorGroupToGroup(frame, config, group, childConfig, childGroup) if( group.totalAuras == 0 ) then local position = positionData[config.anchorPoint] childGroup.buttons[1]:ClearAllPoints() - childGroup.buttons[1]:SetPoint(ShadowUF.Layout:GetPoint(config.anchorPoint), group.anchorTo, ShadowUF.Layout:GetRelative(config.anchorPoint), config.x + (position.xMod * ShadowUF.db.profile.backdrop.inset), config.y + (position.yMod * -ShadowUF.db.profile.backdrop.inset)) + childGroup.buttons[1]:SetPoint(ShadowUF.Layout:GetPoint(config.anchorPoint), group.anchorTo, ShadowUF.Layout:GetRelative(config.anchorPoint), config.x + (position.xMod * ShadowUF.db.profile.backdrop.inset), config.y + (position.yMod * ShadowUF.db.profile.backdrop.inset)) return end - + local anchorTo for i=#(group.buttons), 1, -1 do local button = group.buttons[i] diff --git a/modules/indicators.lua b/modules/indicators.lua index dbc054da..8c64a758 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -21,14 +21,18 @@ function Indicators:UpdateHappiness(frame) if( not frame.indicators.happiness or not frame.indicators.happiness.enabled ) then return end local happiness = GetPetHappiness() + -- No pet if( not happiness ) then frame.indicators.happiness:Hide() + -- Happy! elseif( happiness == 3 ) then frame.indicators.happiness:SetTexCoord(0, 0.1875, 0, 0.359375) frame.indicators.happiness:Show() + -- Content :| elseif( happiness == 2 ) then frame.indicators.happiness:SetTexCoord(0.1875, 0.375, 0, 0.359375) frame.indicators.happiness:Show() + -- Unhappy :( elseif( happiness == 1 ) then frame.indicators.happiness:SetTexCoord(0.375, 0.5625, 0, 0.359375) frame.indicators.happiness:Show() From a619dfc81a06708927b9ed1183d8efe6769013e1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 30 Jun 2010 21:08:51 -0700 Subject: [PATCH 003/794] TOC bump to make sure I swapped branches correctly --- ShadowedUnitFrames.toc | 93 +++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 718f941a..88b4d8f5 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,50 +1,51 @@ -## Interface: 30300 -## Title: Shadowed Unit Frames -## Notes: An apple a day keeps the raptor away, or so they say -## Author: Shadowed -## Version: @project-version@ -## SavedVariables: ShadowedUFDB +## Interface: 40000 +## Title: Shadowed Unit Frames +## Notes: An apple a day keeps the raptor away, or so they say +## Author: Shadowed +## Version: @project-version@ +## SavedVariables: ShadowedUFDB ## OptionalDeps: Ace3, LibSharedMedia-3.0, LibHealComm-4.0, AceGUI-3.0-SharedMediaWidgets - -#@no-lib-strip@ -libs\LibStub\LibStub.lua -libs\CallbackHandler-1.0\CallbackHandler-1.0\CallbackHandler-1.0.xml -libs\LibSharedMedia-3.0\lib.xml -libs\LibHealComm-4.0\LibHealComm-4.0.xml -libs\AceDB-3.0\AceDB-3.0.xml #@end-no-lib-strip@ - -localization\enUS.lua -localization\deDE.lua -localization\esES.lua -localization\esMX.lua -localization\frFR.lua -localization\koKR.lua -localization\ruRU.lua -localization\zhCN.lua -localization\zhTW.lua - -ShadowedUnitFrames.lua -modules\units.lua -modules\layout.lua -modules\movers.lua -modules\defaultlayout.lua -modules\highlight.lua -modules\tags.lua -modules\health.lua -modules\power.lua -modules\portrait.lua -modules\indicators.lua -modules\xp.lua -modules\cast.lua -modules\auras.lua -modules\combattext.lua -modules\totems.lua -modules\runes.lua -modules\fader.lua -modules\combopoints.lua -modules\incheal.lua -modules\range.lua -modules\empty.lua + +#@no-lib-strip@ +libs\LibStub\LibStub.lua +libs\CallbackHandler-1.0\CallbackHandler-1.0\CallbackHandler-1.0.xml +libs\LibSharedMedia-3.0\lib.xml +libs\LibHealComm-4.0\LibHealComm-4.0.xml +libs\AceDB-3.0\AceDB-3.0.xml +#@end-no-lib-strip@ + +localization\enUS.lua +localization\deDE.lua +localization\esES.lua +localization\esMX.lua +localization\frFR.lua +localization\koKR.lua +localization\ruRU.lua +localization\zhCN.lua +localization\zhTW.lua + +ShadowedUnitFrames.lua +modules\units.lua +modules\layout.lua +modules\movers.lua +modules\defaultlayout.lua +modules\highlight.lua +modules\tags.lua +modules\health.lua +modules\power.lua +modules\portrait.lua +modules\indicators.lua +modules\xp.lua +modules\cast.lua +modules\auras.lua +modules\combattext.lua +modules\totems.lua +modules\runes.lua +modules\fader.lua +modules\combopoints.lua +modules\incheal.lua +modules\range.lua +modules\empty.lua modules\druid.lua #@do-not-package@ options\config.lua From bd9601e5198ad1dee4c16086769bcb0f210f9427 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 2 Jul 2010 00:10:03 -0700 Subject: [PATCH 004/794] Initial commit of Cataclysm features, drycoded and most definitely will not work yet Redid combo points so other modules can attach to it Updated all events to use the new UNIT_POWER/UNIT_MAXPOWER as the old events seem to have been deprecated Added Eclipse bar for Druids Added Soul Shard for Warlocks, functions like combo points so you can either show them as little icons or a bar Fixed event registration bug for range fader --- .gitignore | 2 + ShadowedUnitFrames.lua | 30 +++++++-- ShadowedUnitFrames.toc | 6 +- modules/combopoints.lua | 83 ++++++++++++----------- modules/defaultlayout.lua | 35 +++++++--- modules/druid.lua | 20 ++++-- modules/eclipse.lua | 76 +++++++++++++++++++++ modules/fader.lua | 25 +++---- modules/health.lua | 30 ++------- modules/power.lua | 12 +--- modules/soulshards.lua | 34 ++++++++++ modules/tags.lua | 32 ++++----- modules/units.lua | 18 +++++ options/config.lua | 135 +++++++++++++++++++++++++++++++++++++- 14 files changed, 411 insertions(+), 127 deletions(-) create mode 100644 .gitignore create mode 100644 modules/eclipse.lua create mode 100644 modules/soulshards.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..24b392cd --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +suf.tmproj +.DS_Store \ No newline at end of file diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index d0db7dc1..25f23502 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 1 +ShadowUF.dbRevision = 2 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -83,11 +83,23 @@ function ShadowUF:OnInitialize() end function ShadowUF:CheckUpgrade() + -- July 1st + if( self.db.profile.revision <= 1 ) then + self.db.profile.units.player.fader.combatAlpha = self.db.profile.units.player.fader.combatAlpha or 1.0 + self.db.profile.units.player.fader.inactiveAlpha = self.db.profile.units.player.fader.inactiveAlpha or 0.6 + self.db.profile.units.target.comboPoints.height = self.db.profile.units.target.comboPoints.height or 0.40 + self.db.profile.units.player.eclipseBar = {enabled = true, background = true, height = 0.40, order = 70} + self.db.profile.units.player.soulShards = {anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true} + + self:LoadDefaultLayout(true) + end + + -- June 19th - if( not ShadowUF.db.profile.font.color ) then - ShadowUF.db.profile.font.color = {r = 1, g = 1, b = 1, a = 1} + if( not self.db.profile.font.color ) then + self.db.profile.font.color = {r = 1, g = 1, b = 1, a = 1} for unit, config in pairs(self.db.profile.units) do - local indicators = ShadowUF.db.profile.units[unit].indicators + local indicators = self.db.profile.units[unit].indicators if( indicators and indicators.class ) then indicators.class.anchorTo = "$parent" indicators.class.anchorPoint = "BL" @@ -244,7 +256,9 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.totemBar = {enabled = false} self.defaults.profile.units.player.druidBar = {enabled = false} self.defaults.profile.units.player.xpBar = {enabled = false} - self.defaults.profile.units.player.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} + self.defaults.profile.units.player.fader = {enabled = false} + self.defaults.profile.units.player.soulShards = {enabled = false} + self.defaults.profile.units.player.eclipseBar = {enabled = false} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} -- PET self.defaults.profile.units.pet.enabled = true @@ -260,7 +274,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.focustarget.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} -- TARGET self.defaults.profile.units.target.enabled = true - self.defaults.profile.units.target.comboPoints = {enabled = true, isBar = false, height = 0.40, order = 30, anchorTo = "$parent", anchorPoint = "BR", x = 0, y = 0} + self.defaults.profile.units.target.comboPoints = {} self.defaults.profile.units.target.indicators.lfdRole = {enabled = false, size = 0, x = 0, y = 0} -- TARGETTARGET/TARGETTARGETTARGET self.defaults.profile.units.targettarget.enabled = true @@ -449,6 +463,10 @@ function ShadowUF:HideBlizzardFrames() PlayerFrameHealthBar:UnregisterAllEvents() PlayerFrameManaBar:UnregisterAllEvents() + PlayerFrameAlternateManaBar:UnregisterAllEvents() + EclipseBarFrame:UnregisterAllEvents() + RuneFrame:UnregisterAllEvents() + ShardBarFrame:UnregisterAllEvents() end if( ShadowUF.db.profile.hidden.pet ) then diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 88b4d8f5..1df52d58 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -10,7 +10,7 @@ libs\LibStub\LibStub.lua libs\CallbackHandler-1.0\CallbackHandler-1.0\CallbackHandler-1.0.xml libs\LibSharedMedia-3.0\lib.xml -libs\LibHealComm-4.0\LibHealComm-4.0.xml +#libs\LibHealComm-4.0\LibHealComm-4.0.xml libs\AceDB-3.0\AceDB-3.0.xml #@end-no-lib-strip@ @@ -43,10 +43,12 @@ modules\totems.lua modules\runes.lua modules\fader.lua modules\combopoints.lua -modules\incheal.lua +#modules\incheal.lua modules\range.lua modules\empty.lua modules\druid.lua +modules\eclipse.lua +modules\soulshards.lua #@do-not-package@ options\config.lua #@end-do-not-package@ \ No newline at end of file diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 3b4a31c0..c6f83766 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -1,55 +1,62 @@ local Combo = {} ShadowUF:RegisterModule(Combo, "comboPoints", ShadowUF.L["Combo points"]) +local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) + frame.comboPoints.config = cpConfig + frame.comboPointType = cpvisualConfig.key frame:RegisterNormalEvent("UNIT_COMBO_POINTS", self, "Update") frame:RegisterUpdateFunc(self, "Update") end function Combo:OnLayoutApplied(frame, config) + local key = frame.comboPointType + local pointsFrame = frame[key] + local pointsConfig = pointsFrame.config + config = config[key] -- Not a bar so set the containers frame configuration - if( config.comboPoints and not config.comboPoints.isBar ) then - ShadowUF.Layout:ToggleVisibility(frame.comboPoints, frame.visibility.comboPoints) + if( config and not visualConfig.isBar ) then + ShadowUF.Layout:ToggleVisibility(pointsFrame, frame.visibility[key]) end - if( not frame.visibility.comboPoints ) then return end + if( not frame.visibility[key] ) then return end -- Hide the active combo points - if( frame.comboPoints.points ) then - for _, texture in pairs(frame.comboPoints.points) do + if( pointsFrame.points ) then + for _, texture in pairs(pointsFrame.points) do texture:Hide() end end -- Setup for bar display! - if( config.comboPoints.isBar ) then - frame.comboPoints.blocks = frame.comboPoints.blocks or {} - frame.comboPoints.points = frame.comboPoints.blocks + if( visualConfig.isBar ) then + pointsFrame.blocks = pointsFrame.blocks or {} + pointsFrame.points = pointsFrame.blocks -- Position bars, the 5 accounts for borders - local blockWidth = (frame.comboPoints:GetWidth() - 4 ) / MAX_COMBO_POINTS - for id=1, MAX_COMBO_POINTS do - frame.comboPoints.blocks[id] = frame.comboPoints.blocks[id] or frame.comboPoints:CreateTexture(nil, "OVERLAY") - local texture = frame.comboPoints.blocks[id] + local blockWidth = (pointsFrame:GetWidth() - 4 ) / pointsConfig.max + for id=1, pointsConfig.max do + pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") + local texture = pointsFrame.blocks[id] texture:SetVertexColor(1, 0.80, 0) texture:SetHorizTile(false) texture:SetTexture(ShadowUF.Layout.mediaPath.statusbar) - texture:SetHeight(frame.comboPoints:GetHeight()) + texture:SetHeight(pointsFrame:GetHeight()) texture:SetWidth(blockWidth) texture:ClearAllPoints() - if( config.comboPoints.growth == "LEFT" ) then + if( visualConfig.growth == "LEFT" ) then if( id > 1 ) then - texture:SetPoint("TOPRIGHT", frame.comboPoints.blocks[id - 1], "TOPLEFT", -1, 0) + texture:SetPoint("TOPRIGHT", pointsFrame.blocks[id - 1], "TOPLEFT", -1, 0) else - texture:SetPoint("TOPRIGHT", frame.comboPoints, "TOPRIGHT", 0, 0) + texture:SetPoint("TOPRIGHT", pointsFrame, "TOPRIGHT", 0, 0) end else if( id > 1 ) then - texture:SetPoint("TOPLEFT", frame.comboPoints.blocks[id - 1], "TOPRIGHT", 1, 0) + texture:SetPoint("TOPLEFT", pointsFrame.blocks[id - 1], "TOPRIGHT", 1, 0) else - texture:SetPoint("TOPLEFT", frame.comboPoints, "TOPLEFT", 0, 0) + texture:SetPoint("TOPLEFT", pointsFrame, "TOPLEFT", 0, 0) end end end @@ -59,45 +66,43 @@ function Combo:OnLayoutApplied(frame, config) local point, relativePoint local x, y = 0, 0 - if( config.comboPoints.growth == "LEFT" ) then + if( visualConfig.growth == "LEFT" ) then point, relativePoint = "BOTTOMRIGHT", "BOTTOMLEFT" - x = config.comboPoints.spacing - elseif( config.comboPoints.growth == "RIGHT" ) then + x = visualConfig.spacing + elseif( visualConfig.growth == "RIGHT" ) then point, relativePoint = "BOTTOMLEFT", "BOTTOMRIGHT" - x = config.comboPoints.spacing - elseif( config.comboPoints.growth == "UP" ) then + x = visualConfig.spacing + elseif( visualConfig.growth == "UP" ) then point, relativePoint = "BOTTOMLEFT", "TOPLEFT" - y = config.comboPoints.spacing - elseif( config.comboPoints.growth == "DOWN" ) then + y = visualConfig.spacing + elseif( visualConfig.growth == "DOWN" ) then point, relativePoint = "TOPLEFT", "BOTTOMLEFT" - y = config.comboPoints.spacing + y = visualConfig.spacing end - frame.comboPoints.icons = frame.comboPoints.icons or {} - frame.comboPoints.points = frame.comboPoints.icons + pointsFrame.icons = pointsFrame.icons or {} + pointsFrame.points = pointsFrame.icons - for id=1, MAX_COMBO_POINTS do - frame.comboPoints.icons[id] = frame.comboPoints.icons[id] or frame.comboPoints:CreateTexture(nil, "OVERLAY") + for id=1, pointsConfig.max do + pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = frame.comboPoints.icons[id] - texture:SetTexture("Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo") - texture:SetHeight(config.comboPoints.size) - texture:SetWidth(config.comboPoints.size) + texture:SetTexture(pointsConfig.icon) + texture:SetSize(visualConfig.size, visualConfig.size) if( id > 1 ) then texture:ClearAllPoints() - texture:SetPoint(point, frame.comboPoints.icons[id - 1], relativePoint, x, y) + texture:SetPoint(point, pointsFrame.icons[id - 1], relativePoint, x, y) else texture:ClearAllPoints() - texture:SetPoint("CENTER", frame.comboPoints, "CENTER", 0, 0) + texture:SetPoint("CENTER", pointsFrame, "CENTER", 0, 0) end end -- Position the main frame - frame.comboPoints:SetHeight(0.1) - frame.comboPoints:SetWidth(0.1) - - ShadowUF.Layout:AnchorFrame(frame, frame.comboPoints, config.comboPoints) + pointsFrame:Setsize(0.1, 0.1) + + ShadowUF.Layout:AnchorFrame(frame, pointsFrame, visualConfig) end end diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 64a89852..556e7cf2 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -43,7 +43,7 @@ local function finalizeData(config, useMerge) mergeToChild(config.parentUnit, child) -- Strip any invalid tables verifyTable(child, self.defaults.profile.units[unit]) - -- Merge it in + -- Merge the new child table into the actual units mergeToChild(child, self.db.profile.units[unit], true) -- Merge position in too @@ -63,6 +63,20 @@ local function finalizeData(config, useMerge) for key, data in pairs(config) do self.db.profile[key] = data end + else + for key, data in pairs(config) do + if( key ~= "parentUnit" and key ~= "units" and key ~= "positions" and key ~= "hidden" ) then + if( self.db.profile[key] == nil ) then + self.db.profile[key] = data + else + for subKey, subValue in pairs(data) do + if( self.db.profile[key][subKey] == nil ) then + self.db.profile[key][subKey] = subValue + end + end + end + end + end end end @@ -128,6 +142,9 @@ function ShadowUF:LoadDefaultLayout(useMerge) HAPPINESS = {r = 0.50, g = 0.90, b = 0.70}, RUNES = {r = 0.50, g = 0.50, b = 0.50}, RUNIC_POWER = {b = 0.60, g = 0.45, r = 0.35}, + ECLIPSE_SUN = {r = 0.2, g = 0.80, b = 1.0}, + ECLIPSE_MOON = {r = 0.2, g = 0.80, b = 1.0}, + ECLIPSE_FULL = {r = 0, g = 0.32, b = 0.43}, AMMOSLOT = {r = 0.85, g = 0.60, b = 0.55}, FUEL = {r = 0.85, g = 0.47, b = 0.36}, } @@ -213,11 +230,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) emptyBar = {background = true, height = 1, reactionType = "none", order = 0}, healthBar = {background = true, colorType = "class", reactionType = "npc", height = 1.20, order = 10}, powerBar = {background = true, height = 1.0, order = 20}, - druidBar = {background = true, height = 0.40, order = 25}, xpBar = {background = true, height = 0.25, order = 55}, castBar = {background = true, height = 0.60, order = 40, icon = "HIDE", name = {enabled = true, size = 0, anchorTo = "$parent", rank = true, anchorPoint = "CLI", x = 1, y = 0}, time = {enabled = true, size = 0, anchorTo = "$parent", anchorPoint = "CRI", x = -1, y = 0}}, - runeBar = {background = false, height = 0.40, order = 70}, - totemBar = {background = false, height = 0.40, order = 70}, } -- Units configuration @@ -278,16 +292,19 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[name]"}, }, }, - - player = { + player = { width = 190, height = 45, scale = 1.0, portrait = {enabled = true, fullAfter = 50}, castBar = {order = 60}, xpBar = {order = 55}, - runeBar = {enabled = true, order = 70}, - totemBar = {enabled = true, order = 70}, + fader = {combatAlpha = 1.0, inactiveAlpha = 0.6} + runeBar = {enabled = true, background = false, height = 0.40, order = 70}, + totemBar = {enabled = true, background = false, height = 0.40, order = 70}, + druidBar = {enabled = true, background = true, height = 0.40, order = 70}, + eclipseBar = {enabled = true, background = true, height = 0.40, order = 70}, + soulShards = {anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true}, auras = { buffs = {enabled = false, maxRows = 1, temporary = playerClass == "ROGUE" or playerClass == "SHAMAN"}, debuffs = {enabled = false, maxRows = 1}, @@ -524,7 +541,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) scale = 1.0, portrait = {enabled = true, alignment = "RIGHT", fullAfter = 50}, castBar = {order = 60}, - comboPoints = {anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true}, + comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, indicators = { lfdRole = {enabled = false} }, diff --git a/modules/druid.lua b/modules/druid.lua index ee16c047..62e00151 100755 --- a/modules/druid.lua +++ b/modules/druid.lua @@ -4,8 +4,6 @@ ShadowUF:RegisterModule(Druid, "druidBar", ShadowUF.L["Druid mana bar"], true, " function Druid:OnEnable(frame) frame.druidBar = frame.druidBar or ShadowUF.Units:CreateBar(frame) - frame:RegisterUnitEvent("UNIT_MAXMANA", self, "Update") - frame:RegisterUnitEvent("UNIT_MANA", self, "Update") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "PowerChanged") frame:RegisterUpdateFunc(self, "PowerChanged") @@ -34,13 +32,21 @@ function Druid:OnLayoutApplied(frame) end end --- While power type is mana, show the bar once it is mana hide it. function Druid:PowerChanged(frame) local powerType = UnitPowerType(frame.unit) - ShadowUF.Layout:SetBarVisibility(frame, "druidBar", powerType == 1 or powerType == 3) + if( powerType == SPELL_POWER_FOCUS or powerType == SPELL_POWER_RAGE ) then + frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") + ShadowUF.Layout:SetBarVisibility(frame, "druidBar", true) + else + frame:UnregisterEvent("UNIT_POWER", self) + frame:UnregisterEvent("UNIT_MAXPOWER", self) + ShadowUF.Layout:SetBarVisibility(frame, "druidBar", nil) + end end -function Druid:Update(frame) - frame.druidBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, 0)) - frame.druidBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, 0)) +function Druid:Update(frame, event, unit, powerType) + if( powerType ~= "MANA" ) then return end + frame.druidBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, SPELL_POWER_MANA)) + frame.druidBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, SPELL_POWER_MANA)) end diff --git a/modules/eclipse.lua b/modules/eclipse.lua new file mode 100644 index 00000000..3e16beb2 --- /dev/null +++ b/modules/eclipse.lua @@ -0,0 +1,76 @@ +-- Moon on left, Sun on right +-- Cast Arcane -> Move to Sun (Buff Nature) +-- Cast Nature -> Move to Moon (Buff Arcane) +local Eclipse = {types = {"sun", "moon"}} +ShadowUF:RegisterModule(Druid, "eclipseBar", ShadowUF.L["Eclipse bar"], true, "DRUID") + +local function updatePower(self) + local power = UnitPower(self.parent.unit, ECLIPSE_BAR_POWER_INDEX) + local maxPower = UnitPowerMax(self.parent.unit, ECLIPSE_BAR_POWER_INDEX) + if( power == self.currentPower and maxPower == self.currentPower ) then return end + self.currentPower = power + self.currentMax = maxPower + + self:SetMinMaxValues(0, maxPower) + self:SetValue(power) + + -- Only update the eclipse coloring if we're doing a state change + if( self.maxPower and power < maxPower ) then + self.maxPower = nil + self.parent:SetBarColor("eclipseBar", ShadowUF.db.profile.units[self.parent.unit].eclipseBar.invert, ShadowUF.db.profile.powerColors.ECLIPSE.r, ShadowUF.db.profile.powerColors.ECLIPSE.g, ShadowUF.db.profile.powerColors.ECLIPSE.b) + elseif( not self.maxPower and power == maxPower ) then + self.maxPower = true + self.parent:SetBarColor("eclipseBar", ShadowUF.db.profile.units[self.parent.unit].eclipseBar.invert, ShadowUF.db.profile.powerColors.ECLIPSE_FULL.r, ShadowUF.db.profile.powerColors.ECLIPSE_FULL.g, ShadowUF.db.profile.powerColors.ECLIPSE_FULL.b) + end +end + +function Eclipse:OnEnable(frame) + if( not frame.eclipseBar ) then + frame.eclipseBar = CreateFrame("Frame", nil, frame) + for _, type in pairs(self.types) do + frame.eclipseBar[type] = frame.eclipseBar:CreateTexture(nil, "ARTWORK") + frame.eclipseBar[type].icon = frame.eclipseBar:CreateTexture(nil, "ARTWORK") + frame.eclipseBar[type].icon:SetTexture("Interface\\PlayerFrame\\UI-DruidEclipse") + end + + frame.eclipseBar.moon:SetTexture("Interface\\Icons\\Spell_Arcane_StarFire") + frame.eclipseBar.sun:SetTexture("Interface\\Icons\\Spell_Nature_AbolishMagic") + + --frame.eclipseBar.sun:SetTexture(0.26562500, 0.50781250, 0.00781250, 0.24218750) + --frame.eclipseBar.moon:SetTexCoord(0.00781250, 0.25000000, 0.00781250, 0.24218750) + end + + frame:RegisterNormalEvent("UPDATE_SHAPESHIFT_FORM", self, "UpdateVisibility") + frame:RegisterNormalEvent("PLAYER_TALENT_UPDATE", self, "UpdateVisibility") + frame:RegisterNormalEvent("MASTERY_UPDATE", self, "UpdateVisibility") + + frame:RegisterUpdateFunc(self, "UpdateVisibility") +end + +function Eclipse:OnDisable(frame) + frame:UnregisterAll(self) +end + +function Eclipse:OnLayoutApplied(frame) + if( not frame.visibility.eclipseBar ) then return end + + for _, type in pairs(self.types) do + local color = ShadowUF.db.profile.powerColors["ECLIPSE_" .. string.upper(type)] + frame.eclipseBar[type]:SetTexture(ShadowUF.Layout.mediaPath.statusbar) + frame.eclipseBar[type]:SetVertexColor(color.r, color.g, color.b) + frame.eclipseBar[type]:SetHorizTile(false) + frame.eclipseBar[type].icon:SetSize(frame.eclipseBar:GetHeight(), frame.eclipseBar:GetHeight()) + end + + frame.eclipseBar.moon.icon:SetPoint("TOPLEFT", frame.eclipseBar, "TOPLEFT", 0, 0) + frame.eclipseBar.moon:SetPoint("TOPLEFT", frame.eclipseBar.moon.icon, "TOPRIGHT") + frame.eclipseBar.moon:SetPoint("BOTTOMLEFT", frame.eclipseBar.moon.icon, "BOTTOMRIGHT") + + frame.eclipseBar.sun.icon:SetPoint("TOPRIGHT", frame.eclipseBar.bar, "TOPLEFT", 0, 0) + frame.eclipseBar.sun:SetPoint("TOPRIGHT", frame.eclipseBar.bar, "TOPLEFT", 0, 0) + frame.eclipseBar.sun:SetPoint("BOTTOMRIGHT", frame.eclipseBar.bar, "BOTTOMLEFT", 0, 0) +end + +function Eclipse:UpdateVisibility() + ShadowUF.Layout:SetBarVisibility(frame, "eclipseBar", GetShapeshiftFormID() == MOONKIN_FORM and GetMasteryIndex(GetActiveTalentGroup()) == 1) +end \ No newline at end of file diff --git a/modules/fader.lua b/modules/fader.lua index 46a8faf3..ee4cb774 100755 --- a/modules/fader.lua +++ b/modules/fader.lua @@ -1,4 +1,5 @@ local Fader = {} +local powerDepletes = {[SPELL_POWER_MANA] = true, [SPELL_POWER_ENERGY] = true, [SPELL_POWER_FOCUS] = true} ShadowUF:RegisterModule(Fader, "fader", ShadowUF.L["Combat fader"]) local function faderUpdate(self, elapsed) @@ -80,22 +81,22 @@ function Fader:PLAYER_REGEN_ENABLED(frame, event) frame:RegisterNormalEvent("UNIT_SPELLCAST_START", self, "CastStart") frame:RegisterNormalEvent("UNIT_SPELLCAST_STOP", self, "CastStop") frame:RegisterUnitEvent("UNIT_HEALTH", self, "Update") - frame:RegisterUnitEvent("UNIT_MANA", self, "Update") frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXMANA", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") end function Fader:PLAYER_REGEN_DISABLED(frame, event) self:Update(frame, event) - frame:UnregisterEvent("PLAYER_TARGET_CHANGED") - frame:UnregisterEvent("UNIT_SPELLCAST_CHANNEL_START") - frame:UnregisterEvent("UNIT_SPELLCAST_CHANNEL_STOP") - frame:UnregisterEvent("UNIT_SPELLCAST_START") - frame:UnregisterEvent("UNIT_SPELLCAST_STOP") - frame:UnregisterEvent("UNIT_HEALTH") - frame:UnregisterEvent("UNIT_MANA") - frame:UnregisterEvent("UNIT_MAXHEALTH") - frame:UnregisterEvent("UNIT_MAXMANA") + frame:UnregisterEvent("PLAYER_TARGET_CHANGED", self) + frame:UnregisterEvent("UNIT_SPELLCAST_CHANNEL_START", self) + frame:UnregisterEvent("UNIT_SPELLCAST_CHANNEL_STOP", self) + frame:UnregisterEvent("UNIT_SPELLCAST_START", self) + frame:UnregisterEvent("UNIT_SPELLCAST_STOP", self) + frame:UnregisterEvent("UNIT_HEALTH", self) + frame:UnregisterEvent("UNIT_POWER", self) + frame:UnregisterEvent("UNIT_MAXHEALTH", self) + frame:UnregisterEvent("UNIT_MAXPOWER", self) end @@ -125,7 +126,7 @@ function Fader:Update(frame, event) elseif( frame.fader.playerCasting ) then startFading(frame, "in", ShadowUF.db.profile.units[frame.unitType].fader.combatAlpha, true) -- Ether mana or energy is not at 100%, fade in - elseif( ( UnitPowerType(frame.unit) == 0 or UnitPowerType(frame.unit) == 3 ) and UnitPower(frame.unit) ~= UnitPowerMax(frame.unit) ) then + elseif( powerDepletes[UnitPowerType(frame.unit)] and UnitPower(frame.unit) ~= UnitPowerMax(frame.unit) ) then startFading(frame, "in", ShadowUF.db.profile.units[frame.unitType].fader.combatAlpha) -- Health is not at max, fade in elseif( UnitHealth(frame.unit) ~= UnitHealthMax(frame.unit) ) then diff --git a/modules/health.lua b/modules/health.lua index d701f8f0..9741316a 100644 --- a/modules/health.lua +++ b/modules/health.lua @@ -45,7 +45,7 @@ local function updateTimer(self) -- The target is not offline, and we have a health percentage so update the gradient if( not self.parent.healthBar.wasOffline and self.parent.healthBar.hasPercent ) then - Health:SetBarColor(self.parent.healthBar, ShadowUF.db.profile.units[self.parent.unitType].healthBar.invert, getGradientColor(self.parent.unit)) + self.parent:SetBarColor("healthBar", ShadowUF.db.profile.units[self.parent.unitType].healthBar.invert, getGradientColor(self.parent.unit)) end end @@ -82,22 +82,6 @@ function Health:OnDisable(frame) frame:UnregisterAll(self) end -function Health:SetBarColor(bar, invert, r, g, b) - if( not invert ) then - bar:SetStatusBarColor(r, g, b, ShadowUF.db.profile.bars.alpha) - if( not bar.background.overrideColor ) then - bar.background:SetVertexColor(r, g, b, ShadowUF.db.profile.bars.backgroundAlpha) - end - else - bar.background:SetVertexColor(r, g, b, ShadowUF.db.profile.bars.alpha) - if( not bar.background.overrideColor ) then - bar:SetStatusBarColor(0, 0, 0, 1 - ShadowUF.db.profile.bars.backgroundAlpha) - else - bar:SetStatusBarColor(bar.background.overrideColor.r, bar.background.overrideColor.g, bar.background.overrideColor.b, 1 - ShadowUF.db.profile.bars.backgroundAlpha) - end - end -end - function Health:UpdateColor(frame) frame.healthBar.hasReaction = nil frame.healthBar.hasPercent = nil @@ -108,10 +92,10 @@ function Health:UpdateColor(frame) local reactionType = ShadowUF.db.profile.units[frame.unitType].healthBar.reactionType if( not UnitIsConnected(unit) ) then frame.healthBar.wasOffline = true - self:SetBarColor(frame.healthBar, ShadowUF.db.profile.units[frame.unitType].healthBar.invert, ShadowUF.db.profile.healthColors.offline.r, ShadowUF.db.profile.healthColors.offline.g, ShadowUF.db.profile.healthColors.offline.b) + frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, ShadowUF.db.profile.healthColors.offline.r, ShadowUF.db.profile.healthColors.offline.g, ShadowUF.db.profile.healthColors.offline.b) return elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorAggro and UnitThreatSituation(frame.unit) == 3 ) then - self:SetBarColor(frame.healthBar, ShadowUF.db.profile.units[frame.unitType].healthBar.invert, ShadowUF.db.profile.healthColors.hostile.r, ShadowUF.db.profile.healthColors.hostile.g, ShadowUF.db.profile.healthColors.hostile.b) + frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, ShadowUF.db.profile.healthColors.hostile.r, ShadowUF.db.profile.healthColors.hostile.g, ShadowUF.db.profile.healthColors.hostile.b) return elseif( frame.inVehicle ) then color = ShadowUF.db.profile.classColors.VEHICLE @@ -151,10 +135,10 @@ function Health:UpdateColor(frame) end if( color ) then - self:SetBarColor(frame.healthBar, ShadowUF.db.profile.units[frame.unitType].healthBar.invert, color.r, color.g, color.b) + frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, color.r, color.g, color.b) else frame.healthBar.hasPercent = true - self:SetBarColor(frame.healthBar, ShadowUF.db.profile.units[frame.unitType].healthBar.invert, getGradientColor(unit)) + frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, getGradientColor(unit)) end end @@ -169,13 +153,13 @@ function Health:Update(frame) if( isOffline ) then frame.healthBar.wasOffline = true frame.unitIsOnline = nil - self:SetBarColor(frame.healthBar, ShadowUF.db.profile.units[frame.unitType].healthBar.invert, ShadowUF.db.profile.healthColors.offline.r, ShadowUF.db.profile.healthColors.offline.g, ShadowUF.db.profile.healthColors.offline.b) + frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, ShadowUF.db.profile.healthColors.offline.r, ShadowUF.db.profile.healthColors.offline.g, ShadowUF.db.profile.healthColors.offline.b) -- The unit was offline, but they no longer are so we need to do a forced color update elseif( frame.healthBar.wasOffline ) then frame.healthBar.wasOffline = nil self:UpdateColor(frame) -- Color health by percentage elseif( frame.healthBar.hasPercent ) then - self:SetBarColor(frame.healthBar, ShadowUF.db.profile.units[frame.unitType].healthBar.invert, getGradientColor(frame.unit)) + frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, getGradientColor(frame.unit)) end end \ No newline at end of file diff --git a/modules/power.lua b/modules/power.lua index fcb8d19e..7e3bd0ca 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -17,16 +17,8 @@ end function Power:OnEnable(frame) frame.powerBar = frame.powerBar or ShadowUF.Units:CreateBar(frame) - frame:RegisterUnitEvent("UNIT_MANA", self, "Update") - frame:RegisterUnitEvent("UNIT_RAGE", self, "Update") - frame:RegisterUnitEvent("UNIT_ENERGY", self, "Update") - frame:RegisterUnitEvent("UNIT_FOCUS", self, "Update") - frame:RegisterUnitEvent("UNIT_RUNIC_POWER", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXMANA", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXRAGE", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXENERGY", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXFOCUS", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXRUNIC_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdateColor") frame:RegisterUpdateFunc(self, "UpdateColor") diff --git a/modules/soulshards.lua b/modules/soulshards.lua new file mode 100644 index 00000000..7e10c7f0 --- /dev/null +++ b/modules/soulshards.lua @@ -0,0 +1,34 @@ +local Souls = {} +ShadowUF:RegisterModule(Combo, "soulShards", ShadowUF.L["Soul shards"], nil, "WARLOCK") +local soulsConfig = {max = SHARD_BAR_NUM_SHARDS, key = "soulShards", icon = ""} + +function Souls:OnEnable(frame) + frame.soulShards = frame.soulShards or CreateFrame("Frame", nil, frame) + frame.soulShards.config = soulsConfig + frame.comboPointType = "shardPoints" + + frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") + frame:RegisterUpdateFunc(self, "Update") +end + +function Souls:OnDisable(frame) + frame:UnregisterAll(self) +end + +function Souls:Update(frame, event, unit, powerType) + if( event == "UNIT_POWER" and powerType ~= "SOUL_SHARDS" ) then return end + + -- Bar display, hide it if we don't have any combo points + if( ShadowUF.db.profile.units[frame.unitType].soulShards.isBar ) then + ShadowUF.Layout:SetBarVisibility(frame, "soulShards", points > 0) + end + + for id, pointTexture in pairs(frame.soulShards.points) do + if( id <= points ) then + pointTexture:Show() + else + pointTexture:Hide() + end + end +end diff --git a/modules/tags.lua b/modules/tags.lua index 9000d6e7..067bd986 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -815,37 +815,37 @@ Tags.defaultEvents = { ["incheal"] = "HEALCOMM", ["afk"] = "PLAYER_FLAGS_CHANGED", -- Yes, I know it's called PLAYER_FLAGS_CHANGED, but arg1 is the unit including non-players. ["afk:time"] = "PLAYER_FLAGS_CHANGED", - ["status:time"] = "UNIT_MANA", + ["status:time"] = "UNIT_POWER", ["pvp:time"] = "PLAYER_FLAGS_CHANGED", ["curhp"] = "UNIT_HEALTH", ["abscurhp"] = "UNIT_HEALTH", ["curmaxhp"] = "UNIT_HEALTH UNIT_MAXHEALTH", ["absolutehp"] = "UNIT_HEALTH UNIT_MAXHEALTH", ["smart:curmaxhp"] = "UNIT_HEALTH UNIT_MAXHEALTH", - ["curpp"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_DISPLAYPOWER", - ["abscurpp"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_DISPLAYPOWER UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_MAXRUNIC_POWERR", - ["curmaxpp"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_DISPLAYPOWER UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_MAXRUNIC_POWER", - ["absolutepp"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_DISPLAYPOWER UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_MAXRUNIC_POWER", - ["smart:curmaxpp"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_DISPLAYPOWER UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_MAXRUNIC_POWER", - ["druid:curpp"] = "UNIT_MANA UNIT_DISPLAYPOWER", - ["druid:abscurpp"] = "UNIT_MANA UNIT_DISPLAYPOWER", - ["druid:curmaxpp"] = "UNIT_MANA UNIT_MAXMANA UNIT_DISPLAYPOWER", - ["druid:absolutepp"] = "UNIT_MANA UNIT_MAXMANA UNIT_DISPLAYPOWER", + ["curpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", + ["abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWERR", + ["curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["absolutepp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["smart:curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["druid:curpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", + ["druid:abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", + ["druid:curmaxpp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["druid:absolutepp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", ["level"] = "UNIT_LEVEL PLAYER_LEVEL_UP", ["levelcolor"] = "UNIT_LEVEL PLAYER_LEVEL_UP", ["maxhp"] = "UNIT_MAXHEALTH", ["def:name"] = "UNIT_NAME_UPDATE UNIT_MAXHEALTH UNIT_HEALTH", ["absmaxhp"] = "UNIT_MAXHEALTH", - ["maxpp"] = "UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_MAXRUNIC_POWER", - ["absmaxpp"] = "UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_MAXRUNIC_POWER", + ["maxpp"] = "UNIT_MAXPOWER", + ["absmaxpp"] = "UNIT_MAXPOWER", ["missinghp"] = "UNIT_HEALTH UNIT_MAXHEALTH", - ["missingpp"] = "UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_MAXRUNIC_POWER UNIT_RUNIC_POWER", + ["missingpp"] = "UNIT_POWER UNIT_MAXPOWER", ["name"] = "UNIT_NAME_UPDATE", ["abbrev:name"] = "UNIT_NAME_UPDATE", ["server"] = "UNIT_NAME_UPDATE", ["colorname"] = "UNIT_NAME_UPDATE", ["perhp"] = "UNIT_HEALTH UNIT_MAXHEALTH", - ["perpp"] = "UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_MAXRUNIC_POWER UNIT_RUNIC_POWER", + ["perpp"] = "UNIT_POWER UNIT_MAXPOWER", ["status"] = "UNIT_HEALTH PLAYER_UPDATE_RESTING", ["smartlevel"] = "UNIT_LEVEL PLAYER_LEVEL_UP UNIT_CLASSIFICATION_CHANGED", ["cpoints"] = "UNIT_COMBO_POINTS PLAYER_TARGET_CHANGED", @@ -1147,8 +1147,8 @@ local function loadAPIEvents() ["UnitFactionGroup"] = "UNIT_FACTION PLAYER_FLAGS_CHANGED", ["UnitHealth%("] = "UNIT_HEALTH", ["UnitHealthMax"] = "UNIT_MAXHEALTH", - ["UnitPower%("] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER", - ["UnitPowerMax"] = "UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_MAXRUNIC_POWER", + ["UnitPower%("] = "UNIT_POWER", + ["UnitPowerMax"] = "UNIT_MAXPOWER", ["UnitPowerType"] = "UNIT_DISPLAYPOWER", ["UnitIsDead"] = "UNIT_HEALTH", ["UnitIsGhost"] = "UNIT_HEALTH", diff --git a/modules/units.lua b/modules/units.lua index 8255da44..afae7768 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -128,6 +128,23 @@ local function SetRangeAlpha(self, alpha) end end +local function SetBarColor(self, key, invert, r, g, b) + local bar = self[key] + if( not invert ) then + bar:SetStatusBarColor(r, g, b, ShadowUF.db.profile.bars.alpha) + if( not bar.background.overrideColor ) then + bar.background:SetVertexColor(r, g, b, ShadowUF.db.profile.bars.backgroundAlpha) + end + else + bar.background:SetVertexColor(r, g, b, ShadowUF.db.profile.bars.alpha) + if( not bar.background.overrideColor ) then + bar:SetStatusBarColor(0, 0, 0, 1 - ShadowUF.db.profile.bars.backgroundAlpha) + else + bar:SetStatusBarColor(bar.background.overrideColor.r, bar.background.overrideColor.g, bar.background.overrideColor.b, 1 - ShadowUF.db.profile.bars.backgroundAlpha) + end + end +end + -- Event handling local function OnEvent(self, event, unit, ...) if( not unitEvents[event] or self.unit == unit ) then @@ -584,6 +601,7 @@ function Units:CreateUnit(...) frame.SetRangeAlpha = SetRangeAlpha frame.DisableRangeAlpha = DisableRangeAlpha frame.UnregisterUpdateFunc = UnregisterUpdateFunc + frame.SetBarColor = SetBarColor frame.FullUpdate = FullUpdate frame.SetVisibility = SetVisibility frame.topFrameLevel = 5 diff --git a/options/config.lua b/options/config.lua index de5f925b..006bec66 100644 --- a/options/config.lua +++ b/options/config.lua @@ -1086,16 +1086,34 @@ local function loadGeneralOptions() hasAlpha = true, arg = "powerColors.RUNIC_POWER", }, - AMMOSLOT = { + ECLIPSE_MOON = { order = 7, type = "color", + name = L["Eclipse (Moon)"], + desc = L["Bar coloring for the moon portion of the eclipse bar."] + hidden = function(info) return select(2, UnitClass("player")) ~= "DRUID" end, + hasAlpha = true, + arg = "powerColors.ECLIPSE_MOON", + }, + ECLIPSE_SUN = { + order = 8, + type = "color", + name = L["Eclipse (Sun)"], + desc = L["Bar coloring for the moon portion of the eclipse bar."] + hidden = function(info) return select(2, UnitClass("player")) ~= "DRUID" end, + hasAlpha = true, + arg = "powerColors.ECLIPSE_SUN", + }, + AMMOSLOT = { + order = 9, + type = "color", name = L["Ammo"], hasAlpha = true, arg = "powerColors.AMMOSLOT", hidden = hideAdvancedOption, }, FUEL = { - order = 8, + order = 10, type = "color", name = L["Fuel"], hasAlpha = true, @@ -2333,7 +2351,110 @@ local function loadUnitOptions() }, }, }, - -- This might need some help text indicating why the options disappeared, will see. + -- SOUL SHARDS + barSouls = { + order = 4, + type = "group", + inline = true, + name = L["Soul Shards"], + hidden = function(info) return not getVariable(info[2], "soulShards", nil, "isBar") or not getVariable(info[2], nil, nil, "comboPoints") end, + args = { + enabled = { + order = 1, + type = "toggle", + name = string.format(L["Enable %s"], L["Soul Shards"]), + hidden = false, + arg = "soulShards.enabled", + }, + growth = { + order = 2, + type = "select", + name = L["Growth"], + values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"]}, + hidden = false, + arg = "soulShards.growth", + }, + }, + }, + soulShards = { + order = 4, + type = "group", + inline = true, + name = L["Soul Shards"], + hidden = function(info) if( info[2] == "global" or getVariable(info[2], "soulShards", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, + args = { + enabled = { + order = 0, + type = "toggle", + name = string.format(L["Enable %s"], L["Soul Shards"]), + hidden = false, + arg = "soulShards.enabled", + }, + sep1 = { + order = 1, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, + growth = { + order = 2, + type = "select", + name = L["Growth"], + values = {["UP"] = L["Up"], ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["DOWN"] = L["Down"]}, + hidden = false, + arg = "soulShards.growth", + }, + size = { + order = 2, + type = "range", + name = L["Size"], + min = 0, max = 50, step = 1, softMin = 0, softMax = 20, + hidden = hideAdvancedOption, + arg = "soulShards.size", + }, + spacing = { + order = 3, + type = "range", + name = L["Spacing"], + min = -20, max = 20, step = 1, softMin = -10, softMax = 10, + hidden = hideAdvancedOption, + arg = "soulShards.spacing", + }, + sep2 = { + order = 4, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, + anchorPoint = { + order = 5, + type = "select", + name = L["Anchor point"], + values = positionList, + hidden = false, + arg = "soulShards.anchorPoint", + }, + x = { + order = 6, + type = "range", + name = L["X Offset"], + min = -20, max = 20, step = 1, + hidden = false, + arg = "soulShards.x", + }, + y = { + order = 7, + type = "range", + name = L["Y Offset"], + min = -20, max = 20, step = 1, + hidden = false, + arg = "soulShards.y", + }, + }, + }, + -- COMBO POINTS barComboPoints = { order = 4, type = "group", @@ -2979,6 +3100,14 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "runeBar.enabled", }, + eclipseBar = { + order = 1.25, + type = "toggle", + name = string.format(L["Enable %s"], L["Eclipse bar"]), + desc = L["Adds eclipse bars and how far into sun or moon eclipse is.."], + hidden = hideRestrictedOption, + arg = "eclipseBar.enabled", + }, totemBar = { order = 1.5, type = "toggle", From 3b1b1956e201d8b4a62bf4445515b4b106778b54 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 2 Jul 2010 00:12:41 -0700 Subject: [PATCH 005/794] Fixed typo in defaultlayout.lua --- modules/defaultlayout.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 556e7cf2..010aad0e 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -299,7 +299,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) portrait = {enabled = true, fullAfter = 50}, castBar = {order = 60}, xpBar = {order = 55}, - fader = {combatAlpha = 1.0, inactiveAlpha = 0.6} + fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.6}, runeBar = {enabled = true, background = false, height = 0.40, order = 70}, totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, From 95f6dea2ceaf9acae3dc802088a405fc4ae4c49b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 4 Jul 2010 13:30:25 -0700 Subject: [PATCH 006/794] Trying out a tweak to buff hiding, if the buff frames are already hidden by another mode, we won't hide them, if they are not hidden then we will --- ShadowedUnitFrames.lua | 2 +- modules/defaultlayout.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index d0db7dc1..1b6e80fa 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -42,7 +42,7 @@ function ShadowUF:OnInitialize() } self:LoadUnitDefaults() - + -- Initialize DB self.db = LibStub:GetLibrary("AceDB-3.0"):New("ShadowedUFDB", self.defaults, true) self.db.RegisterCallback(self, "OnProfileChanged", "ProfilesChanged") diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 64a89852..2becaf8d 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -88,7 +88,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) borderColor = {r = 0.30, g = 0.30, b = 0.50, a = 1}, } config.hidden = { - cast = false, runes = true, buffs = false, party = true, player = true, pet = true, target = true, focus = true, boss = true, arena = true + cast = false, runes = true, buffs = BuffFrame:IsShown() and true or false, party = true, player = true, pet = true, target = true, focus = true, boss = true, arena = true } config.font = { name = "Myriad Condensed Web", From 21ed251aaac1cd2bfee83153f3629ed503256cef Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 14 Aug 2010 11:59:45 -0700 Subject: [PATCH 007/794] Removed resurection range checking for now, causing some weird issues on range checking --- modules/range.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index 23348943..2bf5b343 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -14,10 +14,10 @@ local function checkRange(self, elapsed) if( self.timeElapsed <= 0.50 ) then return end self.timeElapsed = 0 - if( self.isFriendly and resurrectSpell and UnitIsDead(self.parent.unit) ) then - self.parent:SetRangeAlpha(IsSpellInRange(resurrectSpell, self.parent.unit) == 1 and ShadowUF.db.profile.units[self.parent.unitType].range.inAlpha or ShadowUF.db.profile.units[self.parent.unitType].range.oorAlpha) + --if( self.isFriendly and resurrectSpell and UnitIsDead(self.parent.unit) ) then + -- self.parent:SetRangeAlpha(IsSpellInRange(resurrectSpell, self.parent.unit) == 1 and ShadowUF.db.profile.units[self.parent.unitType].range.inAlpha or ShadowUF.db.profile.units[self.parent.unitType].range.oorAlpha) -- We set a spell for them in our flags check, use that - elseif( self.spell ) then + if( self.spell ) then self.parent:SetRangeAlpha(IsSpellInRange(self.spell, self.parent.unit) == 1 and ShadowUF.db.profile.units[self.parent.unitType].range.inAlpha or ShadowUF.db.profile.units[self.parent.unitType].range.oorAlpha) -- That didn't work, but they are grouped lets try the actual API for this, it's a bit flaky though and not that useful generally elseif( self.grouped ) then From 3fb7edd53dfa444cef1b1ca53035748fa4091c6c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 14 Aug 2010 12:05:44 -0700 Subject: [PATCH 008/794] Added red color code around tag errors --- options/config.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index de5f925b..1ccd6bfb 100644 --- a/options/config.lua +++ b/options/config.lua @@ -4603,7 +4603,12 @@ local function loadTagOptions() error = { order = 0, type = "description", - name = function() return tagData.error or "" end, + name = function() + if( tagData.error ) then + return "|cffff0000" .. tagData.error .. "|r" + end + return "" + end, hidden = function() return not tagData.error end, }, errorHeader = { From 744c1584a5c79b36713a460ea509ba78c415975f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 13 Oct 2010 14:11:08 -0700 Subject: [PATCH 009/794] Trying to force CC branch to commit --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 1df52d58..b722302f 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ ## Interface: 40000 ## Title: Shadowed Unit Frames -## Notes: An apple a day keeps the raptor away, or so they say +## Notes: An apple a day keeps the raptor away, or so they say. ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB From bff4363e57f6c59d5284990f9d2629d35f8c65ed Mon Sep 17 00:00:00 2001 From: Chris Heald Date: Wed, 13 Oct 2010 14:37:45 -0700 Subject: [PATCH 010/794] Fix drycode errors. Loads, no party/raid frames yet --- modules/combopoints.lua | 6 ++++-- modules/eclipse.lua | 2 +- modules/soulshards.lua | 2 +- options/config.lua | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index c6f83766..28f603c9 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -5,14 +5,16 @@ local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", icon = "Interface function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) frame.comboPoints.config = cpConfig - frame.comboPointType = cpvisualConfig.key + frame.comboPointType = cpConfig.key frame:RegisterNormalEvent("UNIT_COMBO_POINTS", self, "Update") frame:RegisterUpdateFunc(self, "Update") end function Combo:OnLayoutApplied(frame, config) - local key = frame.comboPointType + local key = frame.comboPointType local pointsFrame = frame[key] + if not pointsFrame then return end + local pointsConfig = pointsFrame.config config = config[key] -- Not a bar so set the containers frame configuration diff --git a/modules/eclipse.lua b/modules/eclipse.lua index 3e16beb2..9fa89bc3 100644 --- a/modules/eclipse.lua +++ b/modules/eclipse.lua @@ -2,7 +2,7 @@ -- Cast Arcane -> Move to Sun (Buff Nature) -- Cast Nature -> Move to Moon (Buff Arcane) local Eclipse = {types = {"sun", "moon"}} -ShadowUF:RegisterModule(Druid, "eclipseBar", ShadowUF.L["Eclipse bar"], true, "DRUID") +ShadowUF:RegisterModule(Eclipse, "eclipseBar", ShadowUF.L["Eclipse bar"], true, "DRUID") local function updatePower(self) local power = UnitPower(self.parent.unit, ECLIPSE_BAR_POWER_INDEX) diff --git a/modules/soulshards.lua b/modules/soulshards.lua index 7e10c7f0..c812a257 100644 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -1,5 +1,5 @@ local Souls = {} -ShadowUF:RegisterModule(Combo, "soulShards", ShadowUF.L["Soul shards"], nil, "WARLOCK") +ShadowUF:RegisterModule(Souls, "soulShards", ShadowUF.L["Soul shards"], nil, "WARLOCK") local soulsConfig = {max = SHARD_BAR_NUM_SHARDS, key = "soulShards", icon = ""} function Souls:OnEnable(frame) diff --git a/options/config.lua b/options/config.lua index 006bec66..b505528c 100644 --- a/options/config.lua +++ b/options/config.lua @@ -1090,7 +1090,7 @@ local function loadGeneralOptions() order = 7, type = "color", name = L["Eclipse (Moon)"], - desc = L["Bar coloring for the moon portion of the eclipse bar."] + desc = L["Bar coloring for the moon portion of the eclipse bar."], hidden = function(info) return select(2, UnitClass("player")) ~= "DRUID" end, hasAlpha = true, arg = "powerColors.ECLIPSE_MOON", @@ -1099,7 +1099,7 @@ local function loadGeneralOptions() order = 8, type = "color", name = L["Eclipse (Sun)"], - desc = L["Bar coloring for the moon portion of the eclipse bar."] + desc = L["Bar coloring for the moon portion of the eclipse bar."], hidden = function(info) return select(2, UnitClass("player")) ~= "DRUID" end, hasAlpha = true, arg = "powerColors.ECLIPSE_SUN", From 96015d5a44b99614a645e92623174861d685c288 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 14 Oct 2010 13:56:25 +0200 Subject: [PATCH 011/794] Fix some more drycode errors. --- ShadowedUnitFrames.lua | 3 ++- modules/combopoints.lua | 26 +++++++++++++------------- modules/eclipse.lua | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 25f23502..9806deaf 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -83,8 +83,9 @@ function ShadowUF:OnInitialize() end function ShadowUF:CheckUpgrade() + local revision = self.db.profile.revision or 1 -- July 1st - if( self.db.profile.revision <= 1 ) then + if( revision ) then self.db.profile.units.player.fader.combatAlpha = self.db.profile.units.player.fader.combatAlpha or 1.0 self.db.profile.units.player.fader.inactiveAlpha = self.db.profile.units.player.fader.inactiveAlpha or 0.6 self.db.profile.units.target.comboPoints.height = self.db.profile.units.target.comboPoints.height or 0.40 diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 28f603c9..d0b9c5c8 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -18,7 +18,7 @@ function Combo:OnLayoutApplied(frame, config) local pointsConfig = pointsFrame.config config = config[key] -- Not a bar so set the containers frame configuration - if( config and not visualConfig.isBar ) then + if( config and not config.isBar ) then ShadowUF.Layout:ToggleVisibility(pointsFrame, frame.visibility[key]) end @@ -32,7 +32,7 @@ function Combo:OnLayoutApplied(frame, config) end -- Setup for bar display! - if( visualConfig.isBar ) then + if( config.isBar ) then pointsFrame.blocks = pointsFrame.blocks or {} pointsFrame.points = pointsFrame.blocks @@ -48,7 +48,7 @@ function Combo:OnLayoutApplied(frame, config) texture:SetWidth(blockWidth) texture:ClearAllPoints() - if( visualConfig.growth == "LEFT" ) then + if( config.growth == "LEFT" ) then if( id > 1 ) then texture:SetPoint("TOPRIGHT", pointsFrame.blocks[id - 1], "TOPLEFT", -1, 0) else @@ -68,18 +68,18 @@ function Combo:OnLayoutApplied(frame, config) local point, relativePoint local x, y = 0, 0 - if( visualConfig.growth == "LEFT" ) then + if( config.growth == "LEFT" ) then point, relativePoint = "BOTTOMRIGHT", "BOTTOMLEFT" - x = visualConfig.spacing - elseif( visualConfig.growth == "RIGHT" ) then + x = config.spacing + elseif( config.growth == "RIGHT" ) then point, relativePoint = "BOTTOMLEFT", "BOTTOMRIGHT" - x = visualConfig.spacing - elseif( visualConfig.growth == "UP" ) then + x = config.spacing + elseif( config.growth == "UP" ) then point, relativePoint = "BOTTOMLEFT", "TOPLEFT" - y = visualConfig.spacing - elseif( visualConfig.growth == "DOWN" ) then + y = config.spacing + elseif( config.growth == "DOWN" ) then point, relativePoint = "TOPLEFT", "BOTTOMLEFT" - y = visualConfig.spacing + y = config.spacing end @@ -90,7 +90,7 @@ function Combo:OnLayoutApplied(frame, config) pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = frame.comboPoints.icons[id] texture:SetTexture(pointsConfig.icon) - texture:SetSize(visualConfig.size, visualConfig.size) + texture:SetSize(config.size, config.size) if( id > 1 ) then texture:ClearAllPoints() @@ -104,7 +104,7 @@ function Combo:OnLayoutApplied(frame, config) -- Position the main frame pointsFrame:Setsize(0.1, 0.1) - ShadowUF.Layout:AnchorFrame(frame, pointsFrame, visualConfig) + ShadowUF.Layout:AnchorFrame(frame, pointsFrame, config) end end diff --git a/modules/eclipse.lua b/modules/eclipse.lua index 9fa89bc3..b3bd4207 100644 --- a/modules/eclipse.lua +++ b/modules/eclipse.lua @@ -71,6 +71,6 @@ function Eclipse:OnLayoutApplied(frame) frame.eclipseBar.sun:SetPoint("BOTTOMRIGHT", frame.eclipseBar.bar, "BOTTOMLEFT", 0, 0) end -function Eclipse:UpdateVisibility() +function Eclipse:UpdateVisibility(frame) ShadowUF.Layout:SetBarVisibility(frame, "eclipseBar", GetShapeshiftFormID() == MOONKIN_FORM and GetMasteryIndex(GetActiveTalentGroup()) == 1) end \ No newline at end of file From cb1c560df265073bcfde19716326976a6c76bda0 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 14 Oct 2010 14:16:02 +0200 Subject: [PATCH 012/794] Use the new secure initialConfigFunction (not 100%, but frames show up) --- modules/units.lua | 49 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index afae7768..45dd17b6 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -551,19 +551,29 @@ end Units.OnAttributeChanged = OnAttributeChanged --- Header unit initialized -local function initializeUnit(self) - local unitType = self:GetParent().unitType - local config = ShadowUF.db.profile.units[unitType] +local secureInitializeUnit = [[ + local header = self:GetParent() + + self:SetHeight(header:GetAttribute("style-height")) + self:SetWidth(header:GetAttribute("style-width")) + self:SetScale(header:GetAttribute("style-scale")) - self.ignoreAnchor = true - self.unitType = unitType - self:SetAttribute("initial-height", config.height) - self:SetAttribute("initial-width", config.width) - self:SetAttribute("initial-scale", config.scale) self:SetAttribute("toggleForVehicle", true) + + self:SetAttribute("*type1", "target") + self:SetAttribute("*type2", "menu") - Units:CreateUnit(self) + header:CallMethod("initialConfigFunction", self:GetName()) +]] + +-- Header unit initialized +local function initializeUnit(header, frameName) + local frame = _G[frameName] + + frame.ignoreAnchor = true + frame.unitType = header.unitType + + Units:CreateUnit(frame) end -- Show tooltip @@ -620,8 +630,11 @@ function Units:CreateUnit(...) frame:SetScript("PostClick", PostClick) frame:RegisterForClicks("AnyUp") - frame:SetAttribute("*type1", "target") - frame:SetAttribute("*type2", "menu") + -- non-header frames don't set those, so we need to do it + if( not InCombatLockdown() ) then + frame:SetAttribute("*type1", "target") + frame:SetAttribute("*type2", "menu") + end return frame end @@ -821,6 +834,7 @@ function Units:LoadSplitGroupHeader(type) if( headerFrames.raid ) then headerFrames.raid:Hide() end headerFrames.raidParent = nil + local config = ShadowUF.db.profile.units[unitType] for id, enabled in pairs(ShadowUF.db.profile.units[type].filters) do local frame = headerFrames["raid" .. id] if( enabled ) then @@ -831,6 +845,7 @@ function Units:LoadSplitGroupHeader(type) frame:SetAttribute("showRaid", true) frame:SetAttribute("groupFilter", id) frame:UnregisterEvent("UNIT_NAME_UPDATE") + frame:SetAttribute("initialConfigFunction", secureInitializeUnit) frame.initialConfigFunction = initializeUnit frame.isHeaderFrame = true frame.unitType = type @@ -840,6 +855,10 @@ function Units:LoadSplitGroupHeader(type) --frame:SetBackdropBorderColor(1, 0, 0, 1) --frame:SetBackdropColor(0, 0, 0, 0) + frame:SetAttribute("style-height", config.height) + frame:SetAttribute("style-width", config.width) + frame:SetAttribute("style-scale", config.scale) + headerFrames["raid" .. id] = frame end @@ -890,10 +909,16 @@ function Units:LoadGroupHeader(type) headerFrame:SetAttribute("template", "SecureUnitButtonTemplate") headerFrame:SetAttribute("initial-unitWatch", true) + headerFrame:SetAttribute("initialConfigFunction", secureInitializeUnit) headerFrame.initialConfigFunction = initializeUnit headerFrame.isHeaderFrame = true headerFrame.unitType = type headerFrame:UnregisterEvent("UNIT_NAME_UPDATE") + -- set style + local config = ShadowUF.db.profile.units[type] + headerFrame:SetAttribute("style-height", config.height) + headerFrame:SetAttribute("style-width", config.width) + headerFrame:SetAttribute("style-scale", config.scale) ShadowUF.Layout:AnchorFrame(UIParent, headerFrame, ShadowUF.db.profile.positions[type]) From a5711242a2d68caac76abb8d8ab1b22c8ca0c4a8 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 14 Oct 2010 14:32:53 +0200 Subject: [PATCH 013/794] Properly refresh layout properties on the header when re-loading the layout. --- modules/layout.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/layout.lua b/modules/layout.lua index b08d3fff..f2ab55e5 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -96,7 +96,16 @@ function Layout:Reload(unit) frame:FullUpdate() end end - + + for header in pairs(ShadowUF.Units.headerFrames) do + if( header.unitType and ( not unit or header.unitType == unit ) ) then + local config = ShadowUF.db.profile.units[header.unitType] + header:SetAttribute("style-height", config.height) + header:SetAttribute("style-width", config.width) + header:SetAttribute("style-scale", config.scale) + end + end + ShadowUF:FireModuleEvent("OnLayoutReload", unit) end From d5289119aca99ad85f32a918da7c80c2f1751a51 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 14 Oct 2010 15:09:34 +0200 Subject: [PATCH 014/794] Added Clique support (click casting, no mouseover-key bindings yet) --- ShadowedUnitFrames.toc | 2 +- modules/units.lua | 37 +++++++++++++++++++++++++++++++------ 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index b722302f..943b1ab3 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -4,7 +4,7 @@ ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB -## OptionalDeps: Ace3, LibSharedMedia-3.0, LibHealComm-4.0, AceGUI-3.0-SharedMediaWidgets +## OptionalDeps: Ace3, LibSharedMedia-3.0, LibHealComm-4.0, AceGUI-3.0-SharedMediaWidgets, Clique #@no-lib-strip@ libs\LibStub\LibStub.lua diff --git a/modules/units.lua b/modules/units.lua index 45dd17b6..23ea4010 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -446,8 +446,10 @@ OnAttributeChanged = function(self, name, unit) self.unitInitialized = true -- Add to Clique - ClickCastFrames = ClickCastFrames or {} - ClickCastFrames[self] = true + if( not self:GetAttribute("isHeaderDriven") ) then + ClickCastFrames = ClickCastFrames or {} + ClickCastFrames[self] = true + end -- Handles switching the internal unit variable to that of their vehicle if( self.unit == "player" or self.unitRealType == "party" or self.unitRealType == "raid" ) then @@ -562,10 +564,21 @@ local secureInitializeUnit = [[ self:SetAttribute("*type1", "target") self:SetAttribute("*type2", "menu") + + self:SetAttribute("isHeaderDriven", true) + -- Clique integration + local clickHeader = header:GetFrameRef("clickcast_header") + if clickHeader then + clickHeader:SetAttribute("clickcast_button", self) + clickHeader:RunAttribute("clickcast_register") + end + header:CallMethod("initialConfigFunction", self:GetName()) ]] +local unitButtonTemplate = ClickCastHeader and "ClickCastUnitTemplate,SecureUnitButtonTemplate" or "SecureUnitButtonTemplate" + -- Header unit initialized local function initializeUnit(header, frameName) local frame = _G[frameName] @@ -840,7 +853,7 @@ function Units:LoadSplitGroupHeader(type) if( enabled ) then if( not frame ) then frame = CreateFrame("Frame", "SUFHeader" .. type .. id, UIParent, "SecureGroupHeaderTemplate") - frame:SetAttribute("template", "SecureUnitButtonTemplate") + frame:SetAttribute("template", unitButtonTemplate) frame:SetAttribute("initial-unitWatch", true) frame:SetAttribute("showRaid", true) frame:SetAttribute("groupFilter", id) @@ -859,6 +872,12 @@ function Units:LoadSplitGroupHeader(type) frame:SetAttribute("style-width", config.width) frame:SetAttribute("style-scale", config.scale) + if ClickCastHeader then + -- the OnLoad adds the functions like SetFrameRef to the header + SecureHandler_OnLoad(frame) + frame:SetFrameRef("clickcast_header", ClickCastHeader) + end + headerFrames["raid" .. id] = frame end @@ -906,8 +925,8 @@ function Units:LoadGroupHeader(type) headerFrames[type] = headerFrame self:SetHeaderAttributes(headerFrame, type) - - headerFrame:SetAttribute("template", "SecureUnitButtonTemplate") + + headerFrame:SetAttribute("template", unitButtonTemplate) headerFrame:SetAttribute("initial-unitWatch", true) headerFrame:SetAttribute("initialConfigFunction", secureInitializeUnit) headerFrame.initialConfigFunction = initializeUnit @@ -919,7 +938,13 @@ function Units:LoadGroupHeader(type) headerFrame:SetAttribute("style-height", config.height) headerFrame:SetAttribute("style-width", config.width) headerFrame:SetAttribute("style-scale", config.scale) - + + if ClickCastHeader then + -- the OnLoad adds the functions like SetFrameRef to the header + SecureHandler_OnLoad(headerFrame) + headerFrame:SetFrameRef("clickcast_header", ClickCastHeader) + end + ShadowUF.Layout:AnchorFrame(UIParent, headerFrame, ShadowUF.db.profile.positions[type]) -- We have to do party hiding based off raid as a state driver so that we can smoothly hide the party frames based off of combat and such From 6a29831b0364b89da852c7c60ebb6879c052df8b Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 14 Oct 2010 15:18:05 +0200 Subject: [PATCH 015/794] Fix a logic error in config upgrade code. --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 9806deaf..0797a001 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -85,7 +85,7 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 -- July 1st - if( revision ) then + if( revision <= 1 ) then self.db.profile.units.player.fader.combatAlpha = self.db.profile.units.player.fader.combatAlpha or 1.0 self.db.profile.units.player.fader.inactiveAlpha = self.db.profile.units.player.fader.inactiveAlpha or 0.6 self.db.profile.units.target.comboPoints.height = self.db.profile.units.target.comboPoints.height or 0.40 From f0ef3663b1845180c3c20db33561022441e911ae Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 14 Oct 2010 17:43:24 +0200 Subject: [PATCH 016/794] TOTEM_PRIORITIES -> SHAMAN_TOTEM_PRIORITIES --- modules/totems.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/totems.lua b/modules/totems.lua index fd9e92d9..23e57305 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -15,12 +15,14 @@ function Totems:OnEnable(frame) frame.totemBar = CreateFrame("Frame", nil, frame) frame.totemBar.totems = {} + local priorities = (select(2, UnitClass("player")) == "SHAMAN") and SHAMAN_TOTEM_PRIORITIES or STANDARD_TOTEM_PRIORITIES + for id=1, MAX_TOTEMS do local totem = ShadowUF.Units:CreateBar(frame) totem:SetFrameLevel(1) totem:SetMinMaxValues(0, 1) totem:SetValue(0) - totem.id = MAX_TOTEMS == 1 and 1 or TOTEM_PRIORITIES[id] + totem.id = MAX_TOTEMS == 1 and 1 or priorities[id] if( id > 1 ) then totem:SetPoint("TOPLEFT", frame.totemBar.totems[id - 1], "TOPRIGHT", 1, 0) From 8e59cff3d0c04d62da00f48c41ed918e645a4e10 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 14 Oct 2010 17:59:15 +0200 Subject: [PATCH 017/794] Disable canceling of buffs, its no longer possible because Blizzard said so. --- modules/auras.lua | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index e575ad77..29f0c719 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -200,16 +200,6 @@ local function hideTooltip(self) GameTooltip:Hide() end -local function cancelBuff(self) - if( not ShadowUF.db.profile.locked ) then return end - - if( self.filter == "TEMP" ) then - CancelItemTempEnchantment(self.auraID - 15) - else - CancelUnitBuff(self.unit, self.auraID, self.filter) - end -end - local function updateButton(id, group, config) local button = group.buttons[id] if( not button ) then @@ -218,14 +208,13 @@ local function updateButton(id, group, config) button = group.buttons[id] button:SetScript("OnEnter", showTooltip) button:SetScript("OnLeave", hideTooltip) - button:SetScript("OnClick", cancelBuff) button:RegisterForClicks("RightButtonUp") button.cooldown = CreateFrame("Cooldown", nil, button) button.cooldown:SetAllPoints(button) button.cooldown:SetReverse(true) button.cooldown:SetFrameLevel(7) - button.cooldown:Hide() + button.cooldown:Hide() button.stack = button:CreateFontString(nil, "OVERLAY") button.stack:SetFont("Interface\\AddOns\\ShadowedUnitFrames\\media\\fonts\\Myriad Condensed Web.ttf", 10, "OUTLINE") @@ -238,7 +227,7 @@ local function updateButton(id, group, config) button.stack:SetJustifyH("RIGHT") button.border = button:CreateTexture(nil, "OVERLAY") - button.border:SetPoint("CENTER", button) + button.border:SetPoint("CENTER", button) button.icon = button:CreateTexture(nil, "BACKGROUND") button.icon:SetAllPoints(button) From 1d018802fb11ca8b688ce6df976ed516683ebec0 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 14 Oct 2010 21:09:06 +0200 Subject: [PATCH 018/794] Bump the .toc of the options addon --- options/ShadowedUF_Options.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index adaff560..08fcfc8b 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 30300 +## Interface: 40000 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From 9b4594adc32b68552ef05831408f8f69ee776838 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 14 Oct 2010 21:31:18 +0200 Subject: [PATCH 019/794] Ignore commented out files in the .toc --- localcheck.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localcheck.lua b/localcheck.lua index aa1603ac..00f81fc6 100755 --- a/localcheck.lua +++ b/localcheck.lua @@ -149,7 +149,7 @@ for line in io.lines(TOC_FILE) do ignore = nil end - if( not ignore and string.match(line, "%.lua") ) then + if( not ignore and string.match(line, "%.lua") and not string.match(line, "^%s*#")) then -- Make sure it's a valid file local blacklist for _, check in pairs(FILE_BLACKLIST) do From ba21d9931282b52814f6a6250599672be35ba289 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 14 Oct 2010 23:44:29 +0200 Subject: [PATCH 020/794] Fix creation of split headers. --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 23ea4010..7651cd8f 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -847,7 +847,7 @@ function Units:LoadSplitGroupHeader(type) if( headerFrames.raid ) then headerFrames.raid:Hide() end headerFrames.raidParent = nil - local config = ShadowUF.db.profile.units[unitType] + local config = ShadowUF.db.profile.units[type] for id, enabled in pairs(ShadowUF.db.profile.units[type].filters) do local frame = headerFrames["raid" .. id] if( enabled ) then From 9b04b83e4f08867e838587f75d02e14de0c407df Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 18:20:24 +0200 Subject: [PATCH 021/794] When creating a party frame, make sure partyDisabled is set to nil. --- modules/units.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 7651cd8f..daea1fae 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -906,21 +906,21 @@ function Units:LoadGroupHeader(type) headerFrame:Hide() end end - + + -- if we're creating a party, make sure to enable it + if( type == "party" ) then + stateMonitor:SetAttribute("partyDisabled", nil) + end + -- Already created, so just reshow and we out if( headerFrames[type] ) then headerFrames[type]:Show() - - if( type == "party" ) then - stateMonitor:SetAttribute("partyDisabled", nil) - end - if( type == "party" or type == "raid" ) then self:CheckGroupVisibility() end return end - + local headerFrame = CreateFrame("Frame", "SUFHeader" .. type, UIParent, type == "raidpet" and "SecureGroupPetHeaderTemplate" or "SecureGroupHeaderTemplate") headerFrames[type] = headerFrame From ec66656e2186aed6ffd9f7f888e2fa02583ee0b7 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 18:42:08 +0200 Subject: [PATCH 022/794] Fix role indicator. --- modules/indicators.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 8c64a758..2762402e 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -66,14 +66,14 @@ end function Indicators:UpdateLFDRole(frame, event) if( not frame.indicators.lfdRole or not frame.indicators.lfdRole.enabled ) then return end - local isTank, isHealer, isDamage = UnitGroupRolesAssigned(frame.unitOwner) - if( isTank ) then + local role = UnitGroupRolesAssigned(frame.unitOwner) + if( role == "TANK" ) then frame.indicators.lfdRole:SetTexCoord(0, 19/64, 22/64, 41/64) frame.indicators.lfdRole:Show() - elseif( isHealer ) then + elseif( role == "HEALER" ) then frame.indicators.lfdRole:SetTexCoord(20/64, 39/64, 1/64, 20/64) frame.indicators.lfdRole:Show() - elseif( isDamage ) then + elseif( role == "DAMAGER" ) then frame.indicators.lfdRole:SetTexCoord(20/64, 39/64, 22/64, 41/64) frame.indicators.lfdRole:Show() else From 5c64f2c1aa2b056783058242001c2d08e21d268e Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 19:29:03 +0200 Subject: [PATCH 023/794] frame:UnregisterEvent --> frame:UnregisterSingleEvent .. that can't have worked before .. why am i just finding this now .. o.O --- modules/druid.lua | 4 ++-- modules/fader.lua | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/druid.lua b/modules/druid.lua index 62e00151..19f44fd4 100755 --- a/modules/druid.lua +++ b/modules/druid.lua @@ -39,8 +39,8 @@ function Druid:PowerChanged(frame) frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") ShadowUF.Layout:SetBarVisibility(frame, "druidBar", true) else - frame:UnregisterEvent("UNIT_POWER", self) - frame:UnregisterEvent("UNIT_MAXPOWER", self) + frame:UnregisterSingleEvent("UNIT_POWER", self) + frame:UnregisterSingleEvent("UNIT_MAXPOWER", self) ShadowUF.Layout:SetBarVisibility(frame, "druidBar", nil) end end diff --git a/modules/fader.lua b/modules/fader.lua index ee4cb774..2cb485e1 100755 --- a/modules/fader.lua +++ b/modules/fader.lua @@ -88,15 +88,15 @@ end function Fader:PLAYER_REGEN_DISABLED(frame, event) self:Update(frame, event) - frame:UnregisterEvent("PLAYER_TARGET_CHANGED", self) - frame:UnregisterEvent("UNIT_SPELLCAST_CHANNEL_START", self) - frame:UnregisterEvent("UNIT_SPELLCAST_CHANNEL_STOP", self) - frame:UnregisterEvent("UNIT_SPELLCAST_START", self) - frame:UnregisterEvent("UNIT_SPELLCAST_STOP", self) - frame:UnregisterEvent("UNIT_HEALTH", self) - frame:UnregisterEvent("UNIT_POWER", self) - frame:UnregisterEvent("UNIT_MAXHEALTH", self) - frame:UnregisterEvent("UNIT_MAXPOWER", self) + frame:UnregisterSingleEvent("PLAYER_TARGET_CHANGED", self) + frame:UnregisterSingleEvent("UNIT_SPELLCAST_CHANNEL_START", self) + frame:UnregisterSingleEvent("UNIT_SPELLCAST_CHANNEL_STOP", self) + frame:UnregisterSingleEvent("UNIT_SPELLCAST_START", self) + frame:UnregisterSingleEvent("UNIT_SPELLCAST_STOP", self) + frame:UnregisterSingleEvent("UNIT_HEALTH", self) + frame:UnregisterSingleEvent("UNIT_POWER", self) + frame:UnregisterSingleEvent("UNIT_MAXHEALTH", self) + frame:UnregisterSingleEvent("UNIT_MAXPOWER", self) end From dba4879b3e30649c485257d6c1cd874348982916 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 20:46:46 +0200 Subject: [PATCH 024/794] Finished implementation of a basic eclipse module. Still needs visual improvements, but it works. --- ShadowedUnitFrames.lua | 7 ++++ modules/defaultlayout.lua | 5 +-- modules/eclipse.lua | 84 +++++++++++++++++++-------------------- 3 files changed, 51 insertions(+), 45 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index f1e1d49f..b7cd50f7 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -84,6 +84,13 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + + -- October 15th + if( revision <= 2 ) then + self.db.profile.powerColors.ECLIPSE_SUN = {r = 1.0, g = 1.0, b = 0.00} + self.db.profile.powerColors.ECLIPSE_MOON = {r = 0.30, g = 0.52, b = 0.90} + end + -- July 1st if( revision <= 1 ) then self.db.profile.units.player.fader.combatAlpha = self.db.profile.units.player.fader.combatAlpha or 1.0 diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 04c99762..0e6ac613 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -142,9 +142,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) HAPPINESS = {r = 0.50, g = 0.90, b = 0.70}, RUNES = {r = 0.50, g = 0.50, b = 0.50}, RUNIC_POWER = {b = 0.60, g = 0.45, r = 0.35}, - ECLIPSE_SUN = {r = 0.2, g = 0.80, b = 1.0}, - ECLIPSE_MOON = {r = 0.2, g = 0.80, b = 1.0}, - ECLIPSE_FULL = {r = 0, g = 0.32, b = 0.43}, + ECLIPSE_SUN = {r = 1.0, g = 1.0, b = 0.0}, + ECLIPSE_MOON = {r = 0.30, g = 0.52, b = 0.90}, AMMOSLOT = {r = 0.85, g = 0.60, b = 0.55}, FUEL = {r = 0.85, g = 0.47, b = 0.36}, } diff --git a/modules/eclipse.lua b/modules/eclipse.lua index b3bd4207..e90d82a0 100644 --- a/modules/eclipse.lua +++ b/modules/eclipse.lua @@ -4,42 +4,31 @@ local Eclipse = {types = {"sun", "moon"}} ShadowUF:RegisterModule(Eclipse, "eclipseBar", ShadowUF.L["Eclipse bar"], true, "DRUID") -local function updatePower(self) - local power = UnitPower(self.parent.unit, ECLIPSE_BAR_POWER_INDEX) - local maxPower = UnitPowerMax(self.parent.unit, ECLIPSE_BAR_POWER_INDEX) - if( power == self.currentPower and maxPower == self.currentPower ) then return end - self.currentPower = power - self.currentMax = maxPower - - self:SetMinMaxValues(0, maxPower) - self:SetValue(power) - - -- Only update the eclipse coloring if we're doing a state change - if( self.maxPower and power < maxPower ) then - self.maxPower = nil - self.parent:SetBarColor("eclipseBar", ShadowUF.db.profile.units[self.parent.unit].eclipseBar.invert, ShadowUF.db.profile.powerColors.ECLIPSE.r, ShadowUF.db.profile.powerColors.ECLIPSE.g, ShadowUF.db.profile.powerColors.ECLIPSE.b) - elseif( not self.maxPower and power == maxPower ) then - self.maxPower = true - self.parent:SetBarColor("eclipseBar", ShadowUF.db.profile.units[self.parent.unit].eclipseBar.invert, ShadowUF.db.profile.powerColors.ECLIPSE_FULL.r, ShadowUF.db.profile.powerColors.ECLIPSE_FULL.g, ShadowUF.db.profile.powerColors.ECLIPSE_FULL.b) - end -end - function Eclipse:OnEnable(frame) if( not frame.eclipseBar ) then frame.eclipseBar = CreateFrame("Frame", nil, frame) - for _, type in pairs(self.types) do - frame.eclipseBar[type] = frame.eclipseBar:CreateTexture(nil, "ARTWORK") - frame.eclipseBar[type].icon = frame.eclipseBar:CreateTexture(nil, "ARTWORK") - frame.eclipseBar[type].icon:SetTexture("Interface\\PlayerFrame\\UI-DruidEclipse") - end - - frame.eclipseBar.moon:SetTexture("Interface\\Icons\\Spell_Arcane_StarFire") - frame.eclipseBar.sun:SetTexture("Interface\\Icons\\Spell_Nature_AbolishMagic") - - --frame.eclipseBar.sun:SetTexture(0.26562500, 0.50781250, 0.00781250, 0.24218750) - --frame.eclipseBar.moon:SetTexCoord(0.00781250, 0.25000000, 0.00781250, 0.24218750) + -- the arrow marker + frame.eclipseBar.marker = CreateFrame("Frame", nil, frame.eclipseBar) + frame.eclipseBar.marker:SetPoint("CENTER", frame.eclipseBar) + frame.eclipseBar.marker.texture = frame.eclipseBar.marker:CreateTexture(nil, "OVERLAY") + frame.eclipseBar.marker.texture:SetTexture([[Interface\PlayerFrame\UI-DruidEclipse]]) + frame.eclipseBar.marker.texture:SetTexCoord(1.0, 0.914, 0.82, 1.0) + frame.eclipseBar.marker.texture:SetBlendMode("ADD") + frame.eclipseBar.marker.texture:SetAllPoints(frame.eclipseBar.marker) + + -- the actual bar textures + frame.eclipseBar.moon = frame.eclipseBar:CreateTexture(nil, "ARTWORK") + frame.eclipseBar.moon:SetPoint("TOPLEFT", frame.eclipseBar, "TOPLEFT") + frame.eclipseBar.moon:SetPoint("BOTTOMRIGHT", frame.eclipseBar, "BOTTOM") + + frame.eclipseBar.sun = frame.eclipseBar:CreateTexture(nil, "ARTWORK") + frame.eclipseBar.sun:SetPoint("TOPRIGHT", frame.eclipseBar, "TOPRIGHT") + frame.eclipseBar.sun:SetPoint("BOTTOMLEFT", frame.eclipseBar, "BOTTOM") end + frame:RegisterNormalEvent("UNIT_POWER", self, "Update") + frame:RegisterNormalEvent("UNIT_MAXPOWER", self, "Update") + frame:RegisterNormalEvent("ECLIPSE_DIRECTION_CHANGE", self, "UpdateDirection") frame:RegisterNormalEvent("UPDATE_SHAPESHIFT_FORM", self, "UpdateVisibility") frame:RegisterNormalEvent("PLAYER_TALENT_UPDATE", self, "UpdateVisibility") frame:RegisterNormalEvent("MASTERY_UPDATE", self, "UpdateVisibility") @@ -59,18 +48,29 @@ function Eclipse:OnLayoutApplied(frame) frame.eclipseBar[type]:SetTexture(ShadowUF.Layout.mediaPath.statusbar) frame.eclipseBar[type]:SetVertexColor(color.r, color.g, color.b) frame.eclipseBar[type]:SetHorizTile(false) - frame.eclipseBar[type].icon:SetSize(frame.eclipseBar:GetHeight(), frame.eclipseBar:GetHeight()) end - - frame.eclipseBar.moon.icon:SetPoint("TOPLEFT", frame.eclipseBar, "TOPLEFT", 0, 0) - frame.eclipseBar.moon:SetPoint("TOPLEFT", frame.eclipseBar.moon.icon, "TOPRIGHT") - frame.eclipseBar.moon:SetPoint("BOTTOMLEFT", frame.eclipseBar.moon.icon, "BOTTOMRIGHT") - - frame.eclipseBar.sun.icon:SetPoint("TOPRIGHT", frame.eclipseBar.bar, "TOPLEFT", 0, 0) - frame.eclipseBar.sun:SetPoint("TOPRIGHT", frame.eclipseBar.bar, "TOPLEFT", 0, 0) - frame.eclipseBar.sun:SetPoint("BOTTOMRIGHT", frame.eclipseBar.bar, "BOTTOMLEFT", 0, 0) + frame.eclipseBar.marker:SetSize(frame.eclipseBar:GetHeight() * 2, frame.eclipseBar:GetHeight() * 2) + Eclipse:UpdateVisibility(frame) end function Eclipse:UpdateVisibility(frame) - ShadowUF.Layout:SetBarVisibility(frame, "eclipseBar", GetShapeshiftFormID() == MOONKIN_FORM and GetMasteryIndex(GetActiveTalentGroup()) == 1) -end \ No newline at end of file + local form = GetShapeshiftFormID() + ShadowUF.Layout:SetBarVisibility(frame, "eclipseBar", (form == MOONKIN_FORM or not form) and GetPrimaryTalentTree() == 1) + Eclipse:UpdateDirection(frame) + Eclipse:Update(frame, nil, nil, "ECLIPSE") +end + +function Eclipse:UpdateDirection(frame) + local direction = GetEclipseDirection() + if direction then + frame.eclipseBar.marker.texture:SetTexCoord(unpack(ECLIPSE_MARKER_COORDS[direction])) + end +end + +function Eclipse:Update(frame, event, unit, id) + if (id == "ECLIPSE") then + local power = UnitPower("player", SPELL_POWER_ECLIPSE) + local xpos = (frame.eclipseBar:GetWidth()/2) * (power/100) + frame.eclipseBar.marker:SetPoint("CENTER", frame.eclipseBar, "CENTER", xpos, 0) + end +end From d7abc79d35bba662a5924e8a4e13c1ede9e28c2a Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 21:49:25 +0200 Subject: [PATCH 025/794] Fixed soul shards module. --- ShadowedUnitFrames.lua | 6 +++++- modules/combopoints.lua | 7 ++++--- modules/soulshards.lua | 9 +++++---- options/config.lua | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index b7cd50f7..5211c560 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -89,6 +89,10 @@ function ShadowUF:CheckUpgrade() if( revision <= 2 ) then self.db.profile.powerColors.ECLIPSE_SUN = {r = 1.0, g = 1.0, b = 0.00} self.db.profile.powerColors.ECLIPSE_MOON = {r = 0.30, g = 0.52, b = 0.90} + if self.db.profile.units.player.soulShards then + self.db.profile.units.player.soulShards.height = self.db.profile.units.player.soulShards.height or 0.40 + self.db.profile.units.player.soulShards.enabled = true + end end -- July 1st @@ -97,7 +101,7 @@ function ShadowUF:CheckUpgrade() self.db.profile.units.player.fader.inactiveAlpha = self.db.profile.units.player.fader.inactiveAlpha or 0.6 self.db.profile.units.target.comboPoints.height = self.db.profile.units.target.comboPoints.height or 0.40 self.db.profile.units.player.eclipseBar = {enabled = true, background = true, height = 0.40, order = 70} - self.db.profile.units.player.soulShards = {anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true} + self.db.profile.units.player.soulShards = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} self:LoadDefaultLayout(true) end diff --git a/modules/combopoints.lua b/modules/combopoints.lua index d0b9c5c8..43ed7cb7 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -1,5 +1,6 @@ local Combo = {} ShadowUF:RegisterModule(Combo, "comboPoints", ShadowUF.L["Combo points"]) +ShadowUF.ComboPoints = Combo local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function Combo:OnEnable(frame) @@ -13,8 +14,8 @@ end function Combo:OnLayoutApplied(frame, config) local key = frame.comboPointType local pointsFrame = frame[key] - if not pointsFrame then return end - + if not pointsFrame then return end + local pointsConfig = pointsFrame.config config = config[key] -- Not a bar so set the containers frame configuration @@ -88,7 +89,7 @@ function Combo:OnLayoutApplied(frame, config) for id=1, pointsConfig.max do pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") - local texture = frame.comboPoints.icons[id] + local texture = pointsFrame.icons[id] texture:SetTexture(pointsConfig.icon) texture:SetSize(config.size, config.size) diff --git a/modules/soulshards.lua b/modules/soulshards.lua index c812a257..0ce0bbc2 100644 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -1,11 +1,11 @@ -local Souls = {} -ShadowUF:RegisterModule(Souls, "soulShards", ShadowUF.L["Soul shards"], nil, "WARLOCK") +local Souls = setmetatable({}, {__index = ShadowUF.ComboPoints}) +ShadowUF:RegisterModule(Souls, "soulShards", ShadowUF.L["Soul Shards"], nil, "WARLOCK") local soulsConfig = {max = SHARD_BAR_NUM_SHARDS, key = "soulShards", icon = ""} function Souls:OnEnable(frame) frame.soulShards = frame.soulShards or CreateFrame("Frame", nil, frame) frame.soulShards.config = soulsConfig - frame.comboPointType = "shardPoints" + frame.comboPointType = soulsConfig.key frame:RegisterUnitEvent("UNIT_POWER", self, "Update") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") @@ -19,9 +19,10 @@ end function Souls:Update(frame, event, unit, powerType) if( event == "UNIT_POWER" and powerType ~= "SOUL_SHARDS" ) then return end + local points = UnitPower("player", SPELL_POWER_SOUL_SHARDS) -- Bar display, hide it if we don't have any combo points if( ShadowUF.db.profile.units[frame.unitType].soulShards.isBar ) then - ShadowUF.Layout:SetBarVisibility(frame, "soulShards", points > 0) + ShadowUF.Layout:SetBarVisibility(frame, "soulShards", points and points > 0) end for id, pointTexture in pairs(frame.soulShards.points) do diff --git a/options/config.lua b/options/config.lua index f55778d4..f1277dab 100644 --- a/options/config.lua +++ b/options/config.lua @@ -2357,7 +2357,7 @@ local function loadUnitOptions() type = "group", inline = true, name = L["Soul Shards"], - hidden = function(info) return not getVariable(info[2], "soulShards", nil, "isBar") or not getVariable(info[2], nil, nil, "comboPoints") end, + hidden = function(info) return not getVariable(info[2], "soulShards", nil, "isBar") or not getVariable(info[2], nil, nil, "soulShards") end, args = { enabled = { order = 1, From 246fd1781a9fc38388d2f28eb72f360848978f53 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 22:35:06 +0200 Subject: [PATCH 026/794] Implemented a Holy Power module. --- ShadowedUnitFrames.lua | 1 + ShadowedUnitFrames.toc | 1 + modules/holypower.lua | 35 ++++++++++++++ options/config.lua | 103 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+) create mode 100644 modules/holypower.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 5211c560..2493ff5b 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -93,6 +93,7 @@ function ShadowUF:CheckUpgrade() self.db.profile.units.player.soulShards.height = self.db.profile.units.player.soulShards.height or 0.40 self.db.profile.units.player.soulShards.enabled = true end + self.db.profile.units.player.holyPower = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} end -- July 1st diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 943b1ab3..d14f981c 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -49,6 +49,7 @@ modules\empty.lua modules\druid.lua modules\eclipse.lua modules\soulshards.lua +modules\holypower.lua #@do-not-package@ options\config.lua #@end-do-not-package@ \ No newline at end of file diff --git a/modules/holypower.lua b/modules/holypower.lua new file mode 100644 index 00000000..a79658a6 --- /dev/null +++ b/modules/holypower.lua @@ -0,0 +1,35 @@ +local HolyPower = setmetatable({}, {__index = ShadowUF.ComboPoints}) +ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN") +local soulsConfig = {max = MAX_HOLY_POWER, key = "holyPower", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} + +function HolyPower:OnEnable(frame) + frame.holyPower = frame.holyPower or CreateFrame("Frame", nil, frame) + frame.holyPower.config = soulsConfig + frame.comboPointType = soulsConfig.key + + frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") + frame:RegisterUpdateFunc(self, "Update") +end + +function HolyPower:OnDisable(frame) + frame:UnregisterAll(self) +end + +function HolyPower:Update(frame, event, unit, powerType) + if( event == "UNIT_POWER" and powerType ~= "HOLY_POWER" ) then return end + + local points = UnitPower("player", SPELL_POWER_HOLY_POWER) + -- Bar display, hide it if we don't have any combo points + if( ShadowUF.db.profile.units[frame.unitType].holyPower.isBar ) then + ShadowUF.Layout:SetBarVisibility(frame, "holyPower", points and points > 0) + end + + for id, pointTexture in pairs(frame.holyPower.points) do + if( id <= points ) then + pointTexture:Show() + else + pointTexture:Hide() + end + end +end diff --git a/options/config.lua b/options/config.lua index f1277dab..2b22d09e 100644 --- a/options/config.lua +++ b/options/config.lua @@ -2454,6 +2454,109 @@ local function loadUnitOptions() }, }, }, + -- HOLY POWER + barHolyPower = { + order = 4, + type = "group", + inline = true, + name = L["Holy Power"], + hidden = function(info) return not getVariable(info[2], "holyPower", nil, "isBar") or not getVariable(info[2], nil, nil, "holyPower") end, + args = { + enabled = { + order = 1, + type = "toggle", + name = string.format(L["Enable %s"], L["Holy Power"]), + hidden = false, + arg = "holyPower.enabled", + }, + growth = { + order = 2, + type = "select", + name = L["Growth"], + values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"]}, + hidden = false, + arg = "holyPower.growth", + }, + }, + }, + holyPower = { + order = 4, + type = "group", + inline = true, + name = L["Holy Power"], + hidden = function(info) if( info[2] == "global" or getVariable(info[2], "holyPower", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, + args = { + enabled = { + order = 0, + type = "toggle", + name = string.format(L["Enable %s"], L["Holy Power"]), + hidden = false, + arg = "holyPower.enabled", + }, + sep1 = { + order = 1, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, + growth = { + order = 2, + type = "select", + name = L["Growth"], + values = {["UP"] = L["Up"], ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["DOWN"] = L["Down"]}, + hidden = false, + arg = "holyPower.growth", + }, + size = { + order = 2, + type = "range", + name = L["Size"], + min = 0, max = 50, step = 1, softMin = 0, softMax = 20, + hidden = hideAdvancedOption, + arg = "holyPower.size", + }, + spacing = { + order = 3, + type = "range", + name = L["Spacing"], + min = -20, max = 20, step = 1, softMin = -10, softMax = 10, + hidden = hideAdvancedOption, + arg = "holyPower.spacing", + }, + sep2 = { + order = 4, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, + anchorPoint = { + order = 5, + type = "select", + name = L["Anchor point"], + values = positionList, + hidden = false, + arg = "holyPower.anchorPoint", + }, + x = { + order = 6, + type = "range", + name = L["X Offset"], + min = -20, max = 20, step = 1, + hidden = false, + arg = "holyPower.x", + }, + y = { + order = 7, + type = "range", + name = L["Y Offset"], + min = -20, max = 20, step = 1, + hidden = false, + arg = "holyPower.y", + }, + }, + }, -- COMBO POINTS barComboPoints = { order = 4, From 118ce3118c8db4f73d5f6cb1ac1e96c92ad1af17 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 22:35:31 +0200 Subject: [PATCH 027/794] Enable the non-bar mode for all the combopoint derived modules. --- ShadowedUnitFrames.lua | 7 ++++--- modules/soulshards.lua | 2 +- options/config.lua | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 2493ff5b..c5a4c359 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -270,8 +270,9 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.druidBar = {enabled = false} self.defaults.profile.units.player.xpBar = {enabled = false} self.defaults.profile.units.player.fader = {enabled = false} - self.defaults.profile.units.player.soulShards = {enabled = false} - self.defaults.profile.units.player.eclipseBar = {enabled = false} + self.defaults.profile.units.player.soulShards = {enabled = false, isBar = true} + self.defaults.profile.units.player.eclipseBar = {enabled = false, isBar = true} + self.defaults.profile.units.player.holyPower = {enabled = false, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} -- PET self.defaults.profile.units.pet.enabled = true @@ -287,7 +288,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.focustarget.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} -- TARGET self.defaults.profile.units.target.enabled = true - self.defaults.profile.units.target.comboPoints = {} + self.defaults.profile.units.target.comboPoints = {enabled = true, isBar = true} self.defaults.profile.units.target.indicators.lfdRole = {enabled = false, size = 0, x = 0, y = 0} -- TARGETTARGET/TARGETTARGETTARGET self.defaults.profile.units.targettarget.enabled = true diff --git a/modules/soulshards.lua b/modules/soulshards.lua index 0ce0bbc2..40266c2c 100644 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -1,6 +1,6 @@ local Souls = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(Souls, "soulShards", ShadowUF.L["Soul Shards"], nil, "WARLOCK") -local soulsConfig = {max = SHARD_BAR_NUM_SHARDS, key = "soulShards", icon = ""} +local soulsConfig = {max = SHARD_BAR_NUM_SHARDS, key = "soulShards", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function Souls:OnEnable(frame) frame.soulShards = frame.soulShards or CreateFrame("Frame", nil, frame) diff --git a/options/config.lua b/options/config.lua index 2b22d09e..1f5eb766 100644 --- a/options/config.lua +++ b/options/config.lua @@ -565,7 +565,7 @@ local function loadGeneralOptions() -- Strip module settings that aren't with SUF by default if( not layoutData.modules ) then - local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true} + local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true} for _, unitData in pairs(layout.units) do for key, data in pairs(unitData) do if( type(data) == "table" and not validModules[key] and ShadowUF.modules[key] ) then From f7a89f703d1a649d0bca927b668ebdca6c8fab7c Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 22:36:45 +0200 Subject: [PATCH 028/794] Fixed a typo --- modules/combopoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 43ed7cb7..d8c43b71 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -103,7 +103,7 @@ function Combo:OnLayoutApplied(frame, config) end -- Position the main frame - pointsFrame:Setsize(0.1, 0.1) + pointsFrame:SetSize(0.1, 0.1) ShadowUF.Layout:AnchorFrame(frame, pointsFrame, config) end From 0f9150d46e1c802ff8d40a0f3063ca04fe79e5ca Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 22:40:14 +0200 Subject: [PATCH 029/794] Don't have to set the attribute for eclipse, its always a bar. --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index c5a4c359..098d7ca1 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -271,7 +271,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.xpBar = {enabled = false} self.defaults.profile.units.player.fader = {enabled = false} self.defaults.profile.units.player.soulShards = {enabled = false, isBar = true} - self.defaults.profile.units.player.eclipseBar = {enabled = false, isBar = true} + self.defaults.profile.units.player.eclipseBar = {enabled = false} self.defaults.profile.units.player.holyPower = {enabled = false, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} -- PET From bf5128296504a607766e9c8410397e462e7a1af5 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 22:52:27 +0200 Subject: [PATCH 030/794] Slightly adjust default positions for soulshard/holy power buttons. --- ShadowedUnitFrames.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 098d7ca1..34e1bb66 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -93,7 +93,7 @@ function ShadowUF:CheckUpgrade() self.db.profile.units.player.soulShards.height = self.db.profile.units.player.soulShards.height or 0.40 self.db.profile.units.player.soulShards.enabled = true end - self.db.profile.units.player.holyPower = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} + self.db.profile.units.player.holyPower = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} end -- July 1st @@ -102,7 +102,7 @@ function ShadowUF:CheckUpgrade() self.db.profile.units.player.fader.inactiveAlpha = self.db.profile.units.player.fader.inactiveAlpha or 0.6 self.db.profile.units.target.comboPoints.height = self.db.profile.units.target.comboPoints.height or 0.40 self.db.profile.units.player.eclipseBar = {enabled = true, background = true, height = 0.40, order = 70} - self.db.profile.units.player.soulShards = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} + self.db.profile.units.player.soulShards = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} self:LoadDefaultLayout(true) end From aba90eb0ff91cd743fe0853dbe8c45d51a586b7c Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 22:52:57 +0200 Subject: [PATCH 031/794] Hide soul shards and holy power for classes that don't support them. --- options/config.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/options/config.lua b/options/config.lua index 1f5eb766..8216c46a 100644 --- a/options/config.lua +++ b/options/config.lua @@ -2357,7 +2357,7 @@ local function loadUnitOptions() type = "group", inline = true, name = L["Soul Shards"], - hidden = function(info) return not getVariable(info[2], "soulShards", nil, "isBar") or not getVariable(info[2], nil, nil, "soulShards") end, + hidden = function(info) return hideRestrictedOption(info) or not getVariable(info[2], "soulShards", nil, "isBar") or not getVariable(info[2], nil, nil, "soulShards") end, args = { enabled = { order = 1, @@ -2460,7 +2460,7 @@ local function loadUnitOptions() type = "group", inline = true, name = L["Holy Power"], - hidden = function(info) return not getVariable(info[2], "holyPower", nil, "isBar") or not getVariable(info[2], nil, nil, "holyPower") end, + hidden = function(info) return hideRestrictedOption(info) or not getVariable(info[2], "holyPower", nil, "isBar") or not getVariable(info[2], nil, nil, "holyPower") end, args = { enabled = { order = 1, From 492aa444c6d9bf638dabb7d11461eade1c65659e Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 23:39:32 +0200 Subject: [PATCH 032/794] Increase config version so the upgrade code doesn't run everytime. (doh) --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 34e1bb66..07e3c6da 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 2 +ShadowUF.dbRevision = 3 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} From 988733c93c0ab277e093c53c180c72a1004ef6c0 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 23:39:55 +0200 Subject: [PATCH 033/794] Switch some variable names around. --- modules/holypower.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/holypower.lua b/modules/holypower.lua index a79658a6..7c6b5617 100644 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -1,11 +1,11 @@ local HolyPower = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN") -local soulsConfig = {max = MAX_HOLY_POWER, key = "holyPower", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local holyConfig = {max = MAX_HOLY_POWER, key = "holyPower", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function HolyPower:OnEnable(frame) frame.holyPower = frame.holyPower or CreateFrame("Frame", nil, frame) - frame.holyPower.config = soulsConfig - frame.comboPointType = soulsConfig.key + frame.holyPower.config = holyConfig + frame.comboPointType = holyConfig.key frame:RegisterUnitEvent("UNIT_POWER", self, "Update") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") From 6af43b9d1fb1530382280962d59c89352f7b887f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 15 Oct 2010 23:50:40 +0200 Subject: [PATCH 034/794] Tweak defaults some. --- ShadowedUnitFrames.lua | 6 +++--- modules/defaultlayout.lua | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 07e3c6da..ae6db4de 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -270,9 +270,9 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.druidBar = {enabled = false} self.defaults.profile.units.player.xpBar = {enabled = false} self.defaults.profile.units.player.fader = {enabled = false} - self.defaults.profile.units.player.soulShards = {enabled = false, isBar = true} - self.defaults.profile.units.player.eclipseBar = {enabled = false} - self.defaults.profile.units.player.holyPower = {enabled = false, isBar = true} + self.defaults.profile.units.player.soulShards = {enabled = true, isBar = true} + self.defaults.profile.units.player.eclipseBar = {enabled = true} + self.defaults.profile.units.player.holyPower = {enabled = true, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} -- PET self.defaults.profile.units.pet.enabled = true diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 0e6ac613..af2bd089 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -303,7 +303,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, eclipseBar = {enabled = true, background = true, height = 0.40, order = 70}, - soulShards = {anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true}, + soulShards = {anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true}, + holyPower = {anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true}, auras = { buffs = {enabled = false, maxRows = 1, temporary = playerClass == "ROGUE" or playerClass == "SHAMAN"}, debuffs = {enabled = false, maxRows = 1}, From 8040cb6c5fc763f6b3b64ca6aaa624f155dceaa4 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 16 Oct 2010 00:01:12 +0200 Subject: [PATCH 035/794] Unbreak holy power config. --- ShadowedUnitFrames.lua | 2 ++ options/config.lua | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index ae6db4de..cf9c4ced 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -94,6 +94,8 @@ function ShadowUF:CheckUpgrade() self.db.profile.units.player.soulShards.enabled = true end self.db.profile.units.player.holyPower = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} + + self:LoadDefaultLayout(true) end -- July 1st diff --git a/options/config.lua b/options/config.lua index 8216c46a..3e6ce9db 100644 --- a/options/config.lua +++ b/options/config.lua @@ -2357,7 +2357,7 @@ local function loadUnitOptions() type = "group", inline = true, name = L["Soul Shards"], - hidden = function(info) return hideRestrictedOption(info) or not getVariable(info[2], "soulShards", nil, "isBar") or not getVariable(info[2], nil, nil, "soulShards") end, + hidden = function(info) return playerClass ~= "WARLOCK" or not getVariable(info[2], "soulShards", nil, "isBar") or not getVariable(info[2], nil, nil, "soulShards") end, args = { enabled = { order = 1, @@ -2460,7 +2460,7 @@ local function loadUnitOptions() type = "group", inline = true, name = L["Holy Power"], - hidden = function(info) return hideRestrictedOption(info) or not getVariable(info[2], "holyPower", nil, "isBar") or not getVariable(info[2], nil, nil, "holyPower") end, + hidden = function(info) return playerClass ~= "PALADIN" or not getVariable(info[2], "soulShards", nil, "isBar") or not getVariable(info[2], nil, nil, "soulShards") end, args = { enabled = { order = 1, From cab86cf5be164a2343465a5ac72897c7ddab457f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 16 Oct 2010 01:26:10 +0200 Subject: [PATCH 036/794] Sort the config upgrade code to apply the fixed in order, and not backwards. Also added a check to ensure a proper order on the comboPoint widget. --- ShadowedUnitFrames.lua | 123 ++++++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 58 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index cf9c4ced..486838ae 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -85,67 +85,19 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 - -- October 15th - if( revision <= 2 ) then - self.db.profile.powerColors.ECLIPSE_SUN = {r = 1.0, g = 1.0, b = 0.00} - self.db.profile.powerColors.ECLIPSE_MOON = {r = 0.30, g = 0.52, b = 0.90} - if self.db.profile.units.player.soulShards then - self.db.profile.units.player.soulShards.height = self.db.profile.units.player.soulShards.height or 0.40 - self.db.profile.units.player.soulShards.enabled = true - end - self.db.profile.units.player.holyPower = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} - - self:LoadDefaultLayout(true) - end + local loadDefault = false - -- July 1st - if( revision <= 1 ) then - self.db.profile.units.player.fader.combatAlpha = self.db.profile.units.player.fader.combatAlpha or 1.0 - self.db.profile.units.player.fader.inactiveAlpha = self.db.profile.units.player.fader.inactiveAlpha or 0.6 - self.db.profile.units.target.comboPoints.height = self.db.profile.units.target.comboPoints.height or 0.40 - self.db.profile.units.player.eclipseBar = {enabled = true, background = true, height = 0.40, order = 70} - self.db.profile.units.player.soulShards = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} - - self:LoadDefaultLayout(true) - end - - - -- June 19th - if( not self.db.profile.font.color ) then - self.db.profile.font.color = {r = 1, g = 1, b = 1, a = 1} - for unit, config in pairs(self.db.profile.units) do - local indicators = self.db.profile.units[unit].indicators - if( indicators and indicators.class ) then - indicators.class.anchorTo = "$parent" - indicators.class.anchorPoint = "BL" - indicators.class.x = 0 - indicators.class.y = 0 - end - end - end - - -- April 29th - if( self.db.profile.filters.zones ) then - for unit, filter in pairs(self.db.profile.filters.zones) do - if( self.db.profile.filters.whitelists[filter] ) then - self.db.profile.filters.zonewhite[unit] = filter - else - self.db.profile.filters.zoneblack[unit] = filter - end - end - end - -- February 16th if( not self.db.profile.units.raidpet.enabled and self.db.profile.units.raidpet.height == 0 and self.db.profile.units.raidpet.width == 0 and self.db.profile.positions.raidpet.anchorPoint == "" and self.db.profile.positions.raidpet.point == "" ) then - self:LoadDefaultLayout(true) + loadDefault = true end - + self.db.profile.units.party.unitsPerColumn = self.db.profile.units.party.unitsPerColumn or 5 self.db.profile.units.raid.groupsPerRow = self.db.profile.units.raid.groupsPerRow or 8 - + local castName = {enabled = true, size = 0, anchorTo = "$parent", rank = true, anchorPoint = "CLI", x = 1, y = 0} local castTime = {enabled = true, size = 0, anchorTo = "$parent", anchorPoint = "CRI", x = -1, y = 0} - + for unit, config in pairs(self.db.profile.units) do config.portrait = config.portrait or {} config.portrait.type = config.portrait.type or "3D" @@ -155,29 +107,84 @@ function ShadowUF:CheckUpgrade() config.portrait.height = config.portrait.height or 0.50 config.highlight.size = config.highlight.size or 10 - + config.castBar = config.castBar or {} config.castBar.icon = config.castBar.icon or "HIDE" config.castBar.height = config.castBar.height or 0.60 config.castBar.order = config.castBar.order or 40 - + config.castBar.name = config.castBar.name or {} config.castBar.time = config.castBar.time or {} - + for key, value in pairs(castName) do if( config.castBar.name[key] == nil ) then config.castBar.name[key] = value end end - + for key, value in pairs(castTime) do if( config.castBar.time[key] == nil ) then config.castBar.time[key] = value end end end + + -- April 29th + if( self.db.profile.filters.zones ) then + for unit, filter in pairs(self.db.profile.filters.zones) do + if( self.db.profile.filters.whitelists[filter] ) then + self.db.profile.filters.zonewhite[unit] = filter + else + self.db.profile.filters.zoneblack[unit] = filter + end + end + end + + -- June 19th + if( not self.db.profile.font.color ) then + self.db.profile.font.color = {r = 1, g = 1, b = 1, a = 1} + for unit, config in pairs(self.db.profile.units) do + local indicators = self.db.profile.units[unit].indicators + if( indicators and indicators.class ) then + indicators.class.anchorTo = "$parent" + indicators.class.anchorPoint = "BL" + indicators.class.x = 0 + indicators.class.y = 0 + end + end + end + + -- July 1st + if( revision <= 1 ) then + self.db.profile.units.player.fader.combatAlpha = self.db.profile.units.player.fader.combatAlpha or 1.0 + self.db.profile.units.player.fader.inactiveAlpha = self.db.profile.units.player.fader.inactiveAlpha or 0.6 + self.db.profile.units.target.comboPoints.height = self.db.profile.units.target.comboPoints.height or 0.40 + self.db.profile.units.player.eclipseBar = {enabled = true, background = true, height = 0.40, order = 70} + self.db.profile.units.player.soulShards = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} + + loadDefault = true + end + + -- October 15th + if( revision <= 2 ) then + self.db.profile.powerColors.ECLIPSE_SUN = {r = 1.0, g = 1.0, b = 0.00} + self.db.profile.powerColors.ECLIPSE_MOON = {r = 0.30, g = 0.52, b = 0.90} + if self.db.profile.units.player.soulShards then + self.db.profile.units.player.soulShards.height = self.db.profile.units.player.soulShards.height or 0.40 + self.db.profile.units.player.soulShards.enabled = true + end + self.db.profile.units.player.holyPower = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} + + loadDefault = true + end + + self.db.profile.units.target.comboPoints.order = self.db.profile.units.target.comboPoints.order or 60 + + if loadDefault then + self:LoadDefaultLayout(true) + end end - + function ShadowUF:LoadUnits() -- CanHearthAndResurrectFromArea() returns true for world pvp areas, according to BattlefieldFrame.lua local instanceType = CanHearthAndResurrectFromArea() and "pvp" or select(2, IsInInstance()) From ee9079743dff7b0c5752f774d216b9c6066bdd73 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 16 Oct 2010 01:34:46 +0200 Subject: [PATCH 037/794] Increase the frame level of the combo points. --- modules/combopoints.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index d8c43b71..6885c145 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -16,6 +16,8 @@ function Combo:OnLayoutApplied(frame, config) local pointsFrame = frame[key] if not pointsFrame then return end + pointsFrame:SetFrameLevel(frame:GetFrameLevel() + 5) + local pointsConfig = pointsFrame.config config = config[key] -- Not a bar so set the containers frame configuration From 69722f7a6867c4a1c099bb1b0a6189e9d9f731fc Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 16 Oct 2010 08:58:29 +0200 Subject: [PATCH 038/794] Add height to the soulShards and holyPower presets. --- ShadowedUnitFrames.lua | 3 +++ modules/defaultlayout.lua | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 486838ae..720852a3 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -180,6 +180,9 @@ function ShadowUF:CheckUpgrade() self.db.profile.units.target.comboPoints.order = self.db.profile.units.target.comboPoints.order or 60 + self.db.profile.units.target.soulShards.height = self.db.profile.units.target.soulShards.height or 0.40 + self.db.profile.units.target.holyPower.height = self.db.profile.units.target.holyPower.height or 0.40 + if loadDefault then self:LoadDefaultLayout(true) end diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index af2bd089..6a0f221e 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -302,9 +302,9 @@ function ShadowUF:LoadDefaultLayout(useMerge) runeBar = {enabled = true, background = false, height = 0.40, order = 70}, totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, - eclipseBar = {enabled = true, background = true, height = 0.40, order = 70}, - soulShards = {anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true}, - holyPower = {anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true}, + eclipseBar = {enabled = true, background = true, order = 70, height = 0.40}, + soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true}, + holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true}, auras = { buffs = {enabled = false, maxRows = 1, temporary = playerClass == "ROGUE" or playerClass == "SHAMAN"}, debuffs = {enabled = false, maxRows = 1}, From 8398b539cac06ac27097e2bd0bd89b29e632d50e Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 16 Oct 2010 09:50:44 +0200 Subject: [PATCH 039/794] Fix config migration. --- ShadowedUnitFrames.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 720852a3..b4ce8b20 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -180,8 +180,8 @@ function ShadowUF:CheckUpgrade() self.db.profile.units.target.comboPoints.order = self.db.profile.units.target.comboPoints.order or 60 - self.db.profile.units.target.soulShards.height = self.db.profile.units.target.soulShards.height or 0.40 - self.db.profile.units.target.holyPower.height = self.db.profile.units.target.holyPower.height or 0.40 + self.db.profile.units.player.soulShards.height = self.db.profile.units.player.soulShards.height or 0.40 + self.db.profile.units.player.holyPower.height = self.db.profile.units.player.holyPower.height or 0.40 if loadDefault then self:LoadDefaultLayout(true) From f95f492ee0decdeb06298dcdee3eb98adb2168af Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 16 Oct 2010 16:01:27 +0200 Subject: [PATCH 040/794] Enhance Hide Blizzard -> Party to work with the compact (raid-style) party frames as well. --- ShadowedUnitFrames.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index b4ce8b20..428271c9 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -465,6 +465,16 @@ function ShadowUF:HideBlizzardFrames() _G[name .. "HealthBar"]:UnregisterAllEvents() _G[name .. "ManaBar"]:UnregisterAllEvents() end + + CompactPartyFrame:UnregisterAllEvents() + CompactPartyFrame.Show = self.noop + CompactPartyFrame:Hide() + + for i=1, MEMBERS_PER_RAID_GROUP do + local name = "CompactPartyFrameMember" .. i + local frame = _G[name] + frame:UnregisterAllEvents() + end end if( ShadowUF.db.profile.hidden.buffs ) then From 5652a6c9c5cbbf51d1e8426ee330cc442d3f5eaa Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 16 Oct 2010 16:25:10 +0200 Subject: [PATCH 041/794] Add the ability to hide the raid frames (off by default, because raid frames are also off by default) --- ShadowedUnitFrames.lua | 27 +++++++++++++++++++++++++-- options/config.lua | 1 + 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 428271c9..50321084 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -37,7 +37,7 @@ function ShadowUF:OnInitialize() range = {}, filters = {zonewhite = {}, zoneblack = {}, whitelists = {}, blacklists = {}}, visibility = {arena = {}, pvp = {}, party = {}, raid = {}}, - hidden = {cast = false, runes = true, buffs = true, party = true, player = true, pet = true, target = true, focus = true, boss = true, arena = true}, + hidden = {cast = false, runes = true, buffs = false, party = true, raid = false, player = true, pet = true, target = true, focus = true, boss = true, arena = true}, }, } @@ -477,6 +477,26 @@ function ShadowUF:HideBlizzardFrames() end end + -- this doesn't really belong here, but oh well! + if CompactRaidFrameManager then + CompactRaidFrameManager:SetFrameStrata("DIALOG") + end + + if( ShadowUF.db.profile.hidden.raid ) then + if CompactRaidFrameContainer then + CompactRaidFrameContainer:Hide() + CompactRaidFrameContainer.Show = self.noop + CompactRaidFrameContainer:UnregisterAllEvents() + + CompactRaidFrameManagerContainerResizeFrame:Hide() + CompactRaidFrameManagerContainerResizeFrame.Show = self.noop + + CompactRaidFrameManager:Hide() + CompactRaidFrameManager.Show = self.noop + CompactRaidFrameManager:UnregisterAllEvents() + end + end + if( ShadowUF.db.profile.hidden.buffs ) then BuffFrame:UnregisterAllEvents() BuffFrame.Show = self.noop @@ -616,9 +636,12 @@ end local frame = CreateFrame("Frame") frame:RegisterEvent("PLAYER_LOGIN") +frame:RegisterEvent("ADDON_LOADED") frame:SetScript("OnEvent", function(self, event, addon) if( event == "PLAYER_LOGIN" ) then ShadowUF:OnInitialize() self:UnregisterEvent("PLAYER_LOGIN") + elseif event == "ADDON_LOADED" and addon == "Blizzard_CompactRaidFrames" then + ShadowUF:HideBlizzardFrames() end -end) \ No newline at end of file +end) diff --git a/options/config.lua b/options/config.lua index 3e6ce9db..3c7df4ee 100644 --- a/options/config.lua +++ b/options/config.lua @@ -1347,6 +1347,7 @@ local function loadHideOptions() cast = Config.hideTable, runes = Config.hideTable, party = Config.hideTable, + raid = Config.hideTable, player = Config.hideTable, pet = Config.hideTable, target = Config.hideTable, From aab28045f74badedd543b0bb13c1e5b5f1545da5 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 16 Oct 2010 17:23:26 +0200 Subject: [PATCH 042/794] Added options to Holy Power and Soul Shards to keep the bar visible even when empty. --- modules/defaultlayout.lua | 4 ++-- modules/holypower.lua | 2 +- modules/soulshards.lua | 2 +- options/config.lua | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 6a0f221e..2268a7dd 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -303,8 +303,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, eclipseBar = {enabled = true, background = true, order = 70, height = 0.40}, - soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true}, - holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true}, + soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, + holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, auras = { buffs = {enabled = false, maxRows = 1, temporary = playerClass == "ROGUE" or playerClass == "SHAMAN"}, debuffs = {enabled = false, maxRows = 1}, diff --git a/modules/holypower.lua b/modules/holypower.lua index 7c6b5617..ff382988 100644 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -22,7 +22,7 @@ function HolyPower:Update(frame, event, unit, powerType) local points = UnitPower("player", SPELL_POWER_HOLY_POWER) -- Bar display, hide it if we don't have any combo points if( ShadowUF.db.profile.units[frame.unitType].holyPower.isBar ) then - ShadowUF.Layout:SetBarVisibility(frame, "holyPower", points and points > 0) + ShadowUF.Layout:SetBarVisibility(frame, "holyPower", ShadowUF.db.profile.units[frame.unitType].holyPower.showAlways or (points and points > 0)) end for id, pointTexture in pairs(frame.holyPower.points) do diff --git a/modules/soulshards.lua b/modules/soulshards.lua index 40266c2c..48802ce7 100644 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -22,7 +22,7 @@ function Souls:Update(frame, event, unit, powerType) local points = UnitPower("player", SPELL_POWER_SOUL_SHARDS) -- Bar display, hide it if we don't have any combo points if( ShadowUF.db.profile.units[frame.unitType].soulShards.isBar ) then - ShadowUF.Layout:SetBarVisibility(frame, "soulShards", points and points > 0) + ShadowUF.Layout:SetBarVisibility(frame, "soulShards", ShadowUF.db.profile.units[frame.unitType].soulShards.showAlways or (points and points > 0)) end for id, pointTexture in pairs(frame.soulShards.points) do diff --git a/options/config.lua b/options/config.lua index 3c7df4ee..43afaeef 100644 --- a/options/config.lua +++ b/options/config.lua @@ -2375,6 +2375,13 @@ local function loadUnitOptions() hidden = false, arg = "soulShards.growth", }, + showAlways = { + order = 3, + type = "toggle", + name = L["Don't hide when empty"], + hidden = false, + arg = "soulShards.showAlways", + }, }, }, soulShards = { @@ -2478,6 +2485,13 @@ local function loadUnitOptions() hidden = false, arg = "holyPower.growth", }, + showAlways = { + order = 3, + type = "toggle", + name = L["Don't hide when empty"], + hidden = false, + arg = "holyPower.showAlways", + }, }, }, holyPower = { From a90ebb17c6095260e8276a76124ba63b9ce391e6 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 16 Oct 2010 18:40:20 +0200 Subject: [PATCH 043/794] Re-init a header after setting its attributes. --- modules/units.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index daea1fae..a88cafbc 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -667,8 +667,8 @@ function Units:ReloadHeader(type) elseif( headerFrames[type] ) then self:SetHeaderAttributes(headerFrames[type], type) - ShadowUF:FireModuleEvent("OnLayoutReload", type) ShadowUF.Layout:AnchorFrame(UIParent, headerFrames[type], ShadowUF.db.profile.positions[type]) + ShadowUF:FireModuleEvent("OnLayoutReload", type) end end @@ -825,6 +825,10 @@ function Units:SetHeaderAttributes(frame, type) stateMonitor:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.party.hideSemiRaid) stateMonitor:SetAttribute("hideAnyRaid", ShadowUF.db.profile.units.party.hideAnyRaid) end + -- calling :Show basically resets the header + if frame:IsShown() then + frame:Show() + end end -- Load a single unit such as player, target, pet, etc From d391d98d04d650bdde411bb53ad1cfecc966349e Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 16 Oct 2010 23:48:27 +0200 Subject: [PATCH 044/794] Fix some old references to the old power events that broke tag power updating. --- modules/tags.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 067bd986..c299a2dd 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1105,11 +1105,8 @@ Tags.defaultNames = { -- List of event types Tags.eventType = { - ["UNIT_ENERGY"] = "power", - ["UNIT_FOCUS"] = "power", - ["UNIT_MANA"] = "power", - ["UNIT_RAGE"] = "power", - ["UNIT_RUNIC_POWER"] = "power", + ["UNIT_POWER"] = "power", + ["UNIT_MAXPOWER"] = "power", ["UNIT_HEALTH"] = "health", ["UNIT_MAXHEALTH"] = "health", ["RAID_ROSTER_UPDATE"] = "unitless", From 3c3a9a88ea96629e3e2d2017d9ba8163bbfcfd3b Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 17 Oct 2010 12:37:21 +0200 Subject: [PATCH 045/794] Updated IncHeal module to use the UNIT_HEAL_PREDICTION event instead of HealComm. --- .pkgmeta | 10 ++---- ShadowedUnitFrames.toc | 5 ++- modules/incheal.lua | 72 ++---------------------------------------- 3 files changed, 7 insertions(+), 80 deletions(-) diff --git a/.pkgmeta b/.pkgmeta index 542192a1..a1c3d83a 100644 --- a/.pkgmeta +++ b/.pkgmeta @@ -1,7 +1,7 @@ package-as: ShadowedUnitFrames move-folders: - ShadowedUnitFrames/options: ShadowedUF_Options + ShadowedUnitFrames/options: ShadowedUF_Options externals: libs/LibStub: @@ -15,9 +15,6 @@ externals: libs/LibSharedMedia-3.0: url: svn://svn.wowace.com/wow/libsharedmedia-3-0/mainline/trunk tag: latest - libs/LibHealComm-4.0: - url: git://git.wowace.com/wow/libhealcomm-4-0/mainline.git - tag: latest options/libs/AceConfig-3.0: url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConfig-3.0 options/libs/AceDBOptions-3.0: @@ -28,6 +25,5 @@ externals: url: svn://svn.wowace.com/wow/ace-gui-3-0-shared-media-widgets/mainline/trunk tag: latest ignore: - - globalcheck.lua - - localcheck.lua - + - globalcheck.lua + - localcheck.lua diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index d14f981c..3adeb6c0 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -4,13 +4,12 @@ ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB -## OptionalDeps: Ace3, LibSharedMedia-3.0, LibHealComm-4.0, AceGUI-3.0-SharedMediaWidgets, Clique +## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, Clique #@no-lib-strip@ libs\LibStub\LibStub.lua libs\CallbackHandler-1.0\CallbackHandler-1.0\CallbackHandler-1.0.xml libs\LibSharedMedia-3.0\lib.xml -#libs\LibHealComm-4.0\LibHealComm-4.0.xml libs\AceDB-3.0\AceDB-3.0.xml #@end-no-lib-strip@ @@ -43,7 +42,7 @@ modules\totems.lua modules\runes.lua modules\fader.lua modules\combopoints.lua -#modules\incheal.lua +modules\incheal.lua modules\range.lua modules\empty.lua modules\druid.lua diff --git a/modules/incheal.lua b/modules/incheal.lua index f0e94043..55efa934 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -1,14 +1,7 @@ -local HealComm = LibStub("LibHealComm-4.0", true) -if( not HealComm ) then return end - local IncHeal = {} local frames = {} -local playerEndTime, playerGUID ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) ShadowUF.Tags.customEvents["HEALCOMM"] = IncHeal - --- How far ahead to show heals at most -local INCOMING_SECONDS = 3 function IncHeal:OnEnable(frame) frames[frame] = true @@ -16,9 +9,8 @@ function IncHeal:OnEnable(frame) frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") frame:RegisterUpdateFunc(self, "UpdateFrame") - - self:Setup() end function IncHeal:OnDisable(frame) @@ -27,7 +19,6 @@ function IncHeal:OnDisable(frame) if( not frame.hasHCTag ) then frames[frame] = nil - self:Setup() end end @@ -72,8 +63,6 @@ end function IncHeal:EnableTag(frame) frames[frame] = true frame.hasHCTag = true - - self:Setup() end function IncHeal:DisableTag(frame) @@ -81,35 +70,9 @@ function IncHeal:DisableTag(frame) if( not frame.visibility.incHeal ) then frames[frame] = nil - self:Setup() end end --- Check if we need to register callbacks -function IncHeal:Setup() - playerGUID = UnitGUID("player") - - local enabled - for frame in pairs(frames) do - enabled = true - break - end - - if( not enabled ) then - if( HealComm ) then - HealComm:UnregisterAllCallbacks(IncHeal) - end - return - end - - HealComm.RegisterCallback(self, "HealComm_HealStarted", "HealComm_HealUpdated") - HealComm.RegisterCallback(self, "HealComm_HealStopped") - HealComm.RegisterCallback(self, "HealComm_HealDelayed", "HealComm_HealUpdated") - HealComm.RegisterCallback(self, "HealComm_HealUpdated") - HealComm.RegisterCallback(self, "HealComm_ModifierChanged") - HealComm.RegisterCallback(self, "HealComm_GUIDDisappeared") -end - -- Update any tags using HC function IncHeal:UpdateTags(frame, amount) if( not frame.fontStrings or not frame.hasHCTag ) then return end @@ -124,9 +87,7 @@ end local function updateHealthBar(frame, interrupted) -- This makes sure that when a heal like Tranquility is cast, it won't show the entire cast but cap it at 4 seconds into the future - local time = GetTime() - local timeBand = playerEndTime and math.min(playerEndTime - time, INCOMING_SECONDS) or INCOMING_SECONDS - local healed = (HealComm:GetHealAmount(frame.unitGUID, HealComm.ALL_HEALS, time + timeBand) or 0) * HealComm:GetHealModifier(frame.unitGUID) + local healed = UnitGetIncomingHeals(frame.unit) or 0 -- Update any tags that are using HC data IncHeal:UpdateTags(frame, healed) @@ -164,32 +125,3 @@ end function IncHeal:UpdateFrame(frame) updateHealthBar(frame, true) end - -function IncHeal:UpdateIncoming(interrupted, ...) - for frame in pairs(frames) do - for i=1, select("#", ...) do - if( select(i, ...) == frame.unitGUID ) then - updateHealthBar(frame, interrupted) - end - end - end -end - --- Handle callbacks from HealComm -function IncHeal:HealComm_HealUpdated(event, casterGUID, spellID, healType, endTime, ...) - if( casterGUID == playerGUID and bit.band(healType, HealComm.CASTED_HEALS) > 0 ) then playerEndTime = endTime end - self:UpdateIncoming(nil, ...) -end - -function IncHeal:HealComm_HealStopped(event, casterGUID, spellID, healType, interrupted, ...) - if( casterGUID == playerGUID and bit.band(healType, HealComm.CASTED_HEALS) > 0 ) then playerEndTime = nil end - self:UpdateIncoming(interrupted, ...) -end - -function IncHeal:HealComm_ModifierChanged(event, guid) - self:UpdateIncoming(nil, guid) -end - -function IncHeal:HealComm_GUIDDisappeared(event, guid) - self:UpdateIncoming(true, guid) -end From ee79a4788cee81966719fa140cb5a5b53a175cd3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 17 Oct 2010 12:01:02 -0700 Subject: [PATCH 046/794] Default auras are no longer hidden by default --- modules/defaultlayout.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 2268a7dd..b536e4b0 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -102,7 +102,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) borderColor = {r = 0.30, g = 0.30, b = 0.50, a = 1}, } config.hidden = { - cast = false, runes = true, buffs = BuffFrame:IsShown() and true or false, party = true, player = true, pet = true, target = true, focus = true, boss = true, arena = true + cast = false, runes = true, buffs = false, party = true, player = true, pet = true, target = true, focus = true, boss = true, arena = true } config.font = { name = "Myriad Condensed Web", From dd5da685f4045aac3c82b2e391d949dd34c38b4c Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 18 Oct 2010 17:52:44 +0200 Subject: [PATCH 047/794] Let the party header take care of its own show/hide and don't interfer --- modules/units.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index a88cafbc..372fab6e 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -918,7 +918,10 @@ function Units:LoadGroupHeader(type) -- Already created, so just reshow and we out if( headerFrames[type] ) then - headerFrames[type]:Show() + -- party takes care of its own visibility + if( type ~= "party" ) then + headerFrames[type]:Show() + end if( type == "party" or type == "raid" ) then self:CheckGroupVisibility() end From c2d223861d4f647e779a117b388123793abb5c4d Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 18 Oct 2010 17:58:00 +0200 Subject: [PATCH 048/794] Cleanup the party visibility patch some. --- modules/units.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 372fab6e..11af41ad 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -911,17 +911,14 @@ function Units:LoadGroupHeader(type) end end - -- if we're creating a party, make sure to enable it - if( type == "party" ) then - stateMonitor:SetAttribute("partyDisabled", nil) - end - -- Already created, so just reshow and we out if( headerFrames[type] ) then - -- party takes care of its own visibility - if( type ~= "party" ) then - headerFrames[type]:Show() + headerFrames[type]:Show() + + if( type == "party" ) then + stateMonitor:SetAttribute("partyDisabled", nil) end + if( type == "party" or type == "raid" ) then self:CheckGroupVisibility() end @@ -958,6 +955,7 @@ function Units:LoadGroupHeader(type) -- technically this isn't the cleanest solution because party frames will still have unit watches active -- but this isn't as big of a deal, because SUF automatically will unregister the OnEvent for party frames while hidden if( type == "party" ) then + stateMonitor:SetAttribute("partyDisabled", nil) stateMonitor:SetFrameRef("partyHeader", headerFrame) stateMonitor:WrapScript(stateMonitor, "OnAttributeChanged", [[ if( name ~= "state-raidmonitor" and name ~= "partydisabled" and name ~= "hideanyraid" and name ~= "hidesemiraid" ) then return end From 01c98f1e2d758ae1f9ea0ac3784739d5cb5c0942 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 18 Oct 2010 17:58:39 +0200 Subject: [PATCH 049/794] Tweaks to raid hiding code. --- ShadowedUnitFrames.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 50321084..bdae33b2 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -488,9 +488,6 @@ function ShadowUF:HideBlizzardFrames() CompactRaidFrameContainer.Show = self.noop CompactRaidFrameContainer:UnregisterAllEvents() - CompactRaidFrameManagerContainerResizeFrame:Hide() - CompactRaidFrameManagerContainerResizeFrame.Show = self.noop - CompactRaidFrameManager:Hide() CompactRaidFrameManager.Show = self.noop CompactRaidFrameManager:UnregisterAllEvents() From 4d1838d9e5b663cec8313d68b5238a23345804be Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 18 Oct 2010 18:09:28 +0200 Subject: [PATCH 050/794] Fix display of the Group Role in unlocked mode. --- modules/movers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/movers.lua b/modules/movers.lua index cc8a9391..d110a91b 100644 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -73,7 +73,7 @@ local function createConfigEnv() end, UnitGroupRolesAssigned = function(unit) local role = getValue("UnitGroupRolesAssigned", unit, math.random(1, 3)) - return role == 1, role == 2, role == 3 + return role == 1 and "TANK" or (role == 2 and "HEALER" or (role == 3 and "DAMAGER")) end, UnitPowerType = function(unit) local powerType = math.random(0, 4) From c3da98b94d8b25dadbc3a1a6d240be26edd3ee5b Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 18 Oct 2010 18:14:51 +0200 Subject: [PATCH 051/794] Add an option for the combo points bar to be always shown, even without combo points. --- modules/combopoints.lua | 2 +- options/config.lua | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 6885c145..ca4e61cb 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -125,7 +125,7 @@ function Combo:Update(frame) -- Bar display, hide it if we don't have any combo points if( ShadowUF.db.profile.units[frame.unitType].comboPoints.isBar ) then - ShadowUF.Layout:SetBarVisibility(frame, "comboPoints", points > 0) + ShadowUF.Layout:SetBarVisibility(frame, "comboPoints", ShadowUF.db.profile.units[frame.unitType].comboPoints.showAlways or (points and points > 0)) end for id, pointTexture in pairs(frame.comboPoints.points) do diff --git a/options/config.lua b/options/config.lua index 43afaeef..b5229e08 100644 --- a/options/config.lua +++ b/options/config.lua @@ -2595,6 +2595,13 @@ local function loadUnitOptions() hidden = false, arg = "comboPoints.growth", }, + showAlways = { + order = 3, + type = "toggle", + name = L["Don't hide when empty"], + hidden = false, + arg = "comboPoints.showAlways", + }, }, }, comboPoints = { From f195558e6c0fa42e9078639476800c5faf44ffe3 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 18 Oct 2010 18:39:05 +0200 Subject: [PATCH 052/794] Turns out, pet happiness is handled by UNIT_POWER now. --- modules/health.lua | 4 ++-- modules/indicators.lua | 8 ++++---- modules/tags.lua | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/health.lua b/modules/health.lua index 9741316a..91379ae0 100644 --- a/modules/health.lua +++ b/modules/health.lua @@ -57,10 +57,10 @@ function Health:OnEnable(frame) frame:RegisterUnitEvent("UNIT_HEALTH", self, "Update") frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "Update") frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdateColor") - frame:RegisterUnitEvent("UNIT_THREAT_SITUATION_UPDATE", self, "UpdateColor") + frame:RegisterUnitEvent("UNIT_THREAT_SITUATION_UPDATE", self, "UpdateColor") if( frame.unit == "pet" ) then - frame:RegisterUnitEvent("UNIT_HAPPINESS", self, "UpdateColor") + frame:RegisterUnitEvent("UNIT_POWER", self, "UpdateColor") end frame:RegisterUpdateFunc(self, "UpdateColor") diff --git a/modules/indicators.lua b/modules/indicators.lua index 2762402e..0c2dc244 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -17,8 +17,8 @@ function Indicators:UpdateClass(frame) end end -function Indicators:UpdateHappiness(frame) - if( not frame.indicators.happiness or not frame.indicators.happiness.enabled ) then return end +function Indicators:UpdateHappiness(frame, event, unit, power) + if( power ~= "HAPPINESS" or not frame.indicators.happiness or not frame.indicators.happiness.enabled ) then return end local happiness = GetPetHappiness() -- No pet @@ -339,7 +339,7 @@ function Indicators:OnEnable(frame) end if( config.indicators.happiness and config.indicators.happiness.enabled ) then - frame:RegisterUnitEvent("UNIT_HAPPINESS", self, "UpdateHappiness") + frame:RegisterUnitEvent("UNIT_POWER", self, "UpdateHappiness") frame:RegisterUpdateFunc(self, "UpdateHappiness") frame.indicators.happiness = frame.indicators.happiness or frame.indicators:CreateTexture(nil, "OVERLAY") @@ -395,4 +395,4 @@ function Indicators:OnLayoutApplied(frame, config) frame.indicators:SetScript("OnUpdate", nil) end end -end \ No newline at end of file +end diff --git a/modules/tags.lua b/modules/tags.lua index c299a2dd..e40de5bb 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1172,7 +1172,7 @@ local function loadAPIEvents() ["GetNumPartyMembers"] = "PARTY_MEMBERS_CHANGED", ["GetNumRaidMembers"] = "RAID_ROSTER_UPDATE", ["GetRaidRosterInfo"] = "RAID_ROSTER_UPDATE", - ["GetPetHappiness"] = "UNIT_HAPPINESS", + ["GetPetHappiness"] = "UNIT_POWER", ["GetReadyCheckStatus"] = "READY_CHECK READY_CHECK_CONFIRM READY_CHECK_FINISHED", ["GetLootMethod"] = "PARTY_LOOT_METHOD_CHANGED", ["GetThreatStatusColor"] = "UNIT_THREAT_SITUATION_UPDATE", From 516f33f1c8e5d81e786d77007b47bb08c9a7b85c Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 17 Oct 2010 12:46:40 +0200 Subject: [PATCH 053/794] Some cleanups in heal prediction code. --- modules/incheal.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index 55efa934..6029461e 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -85,7 +85,7 @@ function IncHeal:UpdateTags(frame, amount) end end -local function updateHealthBar(frame, interrupted) +function IncHeal:UpdateFrame(frame) -- This makes sure that when a heal like Tranquility is cast, it won't show the entire cast but cap it at 4 seconds into the future local healed = UnitGetIncomingHeals(frame.unit) or 0 @@ -121,7 +121,3 @@ local function updateHealthBar(frame, interrupted) end end end - -function IncHeal:UpdateFrame(frame) - updateHealthBar(frame, true) -end From b258028d0cd989ad6bb3e1527bc1ebf66684b169 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 20 Oct 2010 17:24:34 +0200 Subject: [PATCH 054/794] Fix anchoring of split headers with groups per row set to 1. --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 11af41ad..ba46e031 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -749,7 +749,7 @@ function Units:SetHeaderAttributes(frame, type) childHeader:SetAttribute("yOffset", frame:GetAttribute("yOffset")) childHeader:ClearAllPoints() - if( id % config.groupsPerRow == 1 ) then + if( (id - 1) % config.groupsPerRow == 0 ) then local x = config.groupSpacing * xColMod local y = config.groupSpacing * yColMod From e1860b6631460b4bba1e16bf929e09b75d3268f7 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 20 Oct 2010 17:53:47 +0200 Subject: [PATCH 055/794] Fix combo points anchoring. --- ShadowedUnitFrames.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index bdae33b2..6286fcb0 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -178,10 +178,14 @@ function ShadowUF:CheckUpgrade() loadDefault = true end - self.db.profile.units.target.comboPoints.order = self.db.profile.units.target.comboPoints.order or 60 + -- Ongoing fixes + if( revision <= 3 ) then + self.db.profile.units.target.comboPoints.order = self.db.profile.units.target.comboPoints.order or 60 + self.db.profile.units.target.comboPoints.anchorTo = self.db.profile.units.target.comboPoints.anchorTo or "$parent" - self.db.profile.units.player.soulShards.height = self.db.profile.units.player.soulShards.height or 0.40 - self.db.profile.units.player.holyPower.height = self.db.profile.units.player.holyPower.height or 0.40 + self.db.profile.units.player.soulShards.height = self.db.profile.units.player.soulShards.height or 0.40 + self.db.profile.units.player.holyPower.height = self.db.profile.units.player.holyPower.height or 0.40 + end if loadDefault then self:LoadDefaultLayout(true) From c0feaff5b1f63cf56eb08eeee71d051999a76116 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 20 Oct 2010 20:02:38 +0200 Subject: [PATCH 056/794] Fix Druid mana bar when in cat form. (Who the hell set this to trigger on focus instead of energy? <.<) --- modules/druid.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/druid.lua b/modules/druid.lua index 19f44fd4..88814b96 100755 --- a/modules/druid.lua +++ b/modules/druid.lua @@ -34,7 +34,7 @@ end function Druid:PowerChanged(frame) local powerType = UnitPowerType(frame.unit) - if( powerType == SPELL_POWER_FOCUS or powerType == SPELL_POWER_RAGE ) then + if( powerType == SPELL_POWER_ENERGY or powerType == SPELL_POWER_RAGE ) then frame:RegisterUnitEvent("UNIT_POWER", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") ShadowUF.Layout:SetBarVisibility(frame, "druidBar", true) From 4e068a5e76364456ba5a633055f7f6cbe7154568 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 20 Oct 2010 20:54:56 +0200 Subject: [PATCH 057/794] Use shapeshift form ids to detect cat/bear instead of power types. --- modules/druid.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/druid.lua b/modules/druid.lua index 88814b96..d39c106d 100755 --- a/modules/druid.lua +++ b/modules/druid.lua @@ -4,7 +4,7 @@ ShadowUF:RegisterModule(Druid, "druidBar", ShadowUF.L["Druid mana bar"], true, " function Druid:OnEnable(frame) frame.druidBar = frame.druidBar or ShadowUF.Units:CreateBar(frame) - frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "PowerChanged") + frame:RegisterNormalEvent("UPDATE_SHAPESHIFT_FORM", self, "PowerChanged") frame:RegisterUpdateFunc(self, "PowerChanged") frame:RegisterUpdateFunc(self, "Update") @@ -33,8 +33,8 @@ function Druid:OnLayoutApplied(frame) end function Druid:PowerChanged(frame) - local powerType = UnitPowerType(frame.unit) - if( powerType == SPELL_POWER_ENERGY or powerType == SPELL_POWER_RAGE ) then + local form = GetShapeshiftFormID() + if( form == CAT_FORM or form == BEAR_FORM ) then frame:RegisterUnitEvent("UNIT_POWER", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") ShadowUF.Layout:SetBarVisibility(frame, "druidBar", true) From b94daab634846102e280950f79cc7513e0bb7b26 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 21 Oct 2010 15:53:08 +0200 Subject: [PATCH 058/794] Fix an alignment problem in soulshard/holy power bars. --- modules/combopoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index ca4e61cb..ebffb39b 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -40,7 +40,7 @@ function Combo:OnLayoutApplied(frame, config) pointsFrame.points = pointsFrame.blocks -- Position bars, the 5 accounts for borders - local blockWidth = (pointsFrame:GetWidth() - 4 ) / pointsConfig.max + local blockWidth = (pointsFrame:GetWidth() - (pointsConfig.max - 1)) / pointsConfig.max for id=1, pointsConfig.max do pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.blocks[id] From 50da7e562bd2af57f0ab0917b01614887255ebad Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 21 Oct 2010 18:08:00 +0200 Subject: [PATCH 059/794] Show holy power/soul shards in config mode. --- modules/movers.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/movers.lua b/modules/movers.lua index d110a91b..c7f1838a 100644 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -32,7 +32,12 @@ local function createConfigEnv() UnitIsPlayer = function(unit) return unit ~= "boss" and unit ~= "pet" and not string.match(unit, "(%w+)pet") end, UnitHealth = function(unit) return getValue("UnitHealth", unit, math.random(20000, 50000)) end, UnitHealthMax = function(unit) return 50000 end, - UnitPower = function(unit) return getValue("UnitPower", unit, math.random(20000, 50000)) end, + UnitPower = function(unit, powerType) + if powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS then + return 3 + end + return getValue("UnitPower", unit, math.random(20000, 50000)) + end, UnitExists = function(unit) return true end, UnitPowerMax = function(unit) return 50000 end, UnitIsPartyLeader = function() return true end, From ac1973259303a51e870dcd0ed9364098092b66c3 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 21 Oct 2010 18:31:43 +0200 Subject: [PATCH 060/794] Fix rune cooldowns. --- modules/runes.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/runes.lua b/modules/runes.lua index e37e12dd..d7c9dbda 100755 --- a/modules/runes.lua +++ b/modules/runes.lua @@ -78,7 +78,7 @@ function Runes:UpdateUsable(frame, event, id, usable) local rune = frame.runeBar.runes[id] local startTime, cooldown, cooled = GetRuneCooldown(id) if( not cooled ) then - rune.endTime = GetTime() + cooldown + rune.endTime = startTime + cooldown rune:SetMinMaxValues(startTime, rune.endTime) rune:SetValue(GetTime()) rune:SetAlpha(0.40) From 4d9443f3eea974e7d63a4e2d2e83ca96ae14a4d3 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 23 Oct 2010 14:38:43 +0200 Subject: [PATCH 061/794] Fix framelevel of the LFD Cooldown frame. --- ShadowedUnitFrames.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 6286fcb0..a6b1c1b9 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -577,6 +577,16 @@ function ShadowUF:HideBlizzardFrames() Arena_LoadUI = self.noop end + -- fix LFD Cooldown Frame + -- this is technically not our problem, but due to having the frames on the same strata, it looks like this to the users + -- and the fix is simple enough + hooksecurefunc(LFDQueueFrameCooldownFrame, "SetFrameLevel", function(frame, value) + local parentLevel = LFDParentFrame:GetFrameLevel() + 5 + if value < parentLevel then + frame:SetFrameLevel(parentLevel + 10) + end + end) + -- Don't modify the raid menu because that will taint the MA/MT stuff and it'll break and that's bad for key, list in pairs(UnitPopupMenus) do if( key ~= "RAID" ) then From 837071f83fd83ad08cca5f4348ac5b7c43aa41b1 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 24 Oct 2010 15:43:19 +0200 Subject: [PATCH 062/794] Implemented support for Cliques hover-key-bindings. --- modules/highlight.lua | 16 ++++++++++++---- modules/movers.lua | 12 ++++++------ modules/units.lua | 21 ++++++++++++++++++--- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/modules/highlight.lua b/modules/highlight.lua index 95bef4a5..c086adfb 100644 --- a/modules/highlight.lua +++ b/modules/highlight.lua @@ -89,11 +89,11 @@ function Highlight:OnEnable(frame) end if( ShadowUF.db.profile.units[frame.unitType].highlight.mouseover and not frame.highlight.OnEnter ) then - frame.highlight.OnEnter = frame:GetScript("OnEnter") - frame.highlight.OnLeave = frame:GetScript("OnLeave") + frame.highlight.OnEnter = frame.OnEnter + frame.highlight.OnLeave = frame.OnLeave - frame:SetScript("OnEnter", OnEnter) - frame:SetScript("OnLeave", OnLeave) + frame.OnEnter = OnEnter + frame.OnLeave = OnLeave end end @@ -113,6 +113,14 @@ function Highlight:OnDisable(frame) frame.highlight.hasMouseover = nil frame.highlight:Hide() + + if frame.highlight.OnEnter then + frame.OnEnter = frame.highlight.OnEnter + frame.OnLeave = frame.highlight.OnLeave + + frame.highlight.OnEnter = nil + frame.highlight.OnLeave = nil + end end function Highlight:Update(frame) diff --git a/modules/movers.lua b/modules/movers.lua index c7f1838a..40281961 100644 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -154,14 +154,14 @@ local function setupUnits(childrenOnly) end elseif( not frame.configMode and ShadowUF.db.profile.units[frame.unitType].enabled ) then frame.originalUnit = frame:GetAttribute("unit") - frame.originalOnEnter = frame:GetScript("OnEnter") - frame.originalOnLeave = frame:GetScript("OnLeave") + frame.originalOnEnter = frame.OnEnter + frame.originalOnLeave = frame.OnLeave frame.originalOnUpdate = frame:GetScript("OnUpdate") frame:SetMovable(not ShadowUF.Units.childUnits[frame.unitType]) frame:SetScript("OnDragStop", OnDragStop) frame:SetScript("OnDragStart", OnDragStart) - frame:SetScript("OnEnter", OnEnter) - frame:SetScript("OnLeave", OnLeave) + frame.OnEnter = OnEnter + frame.OnLeave = OnLeave frame:SetScript("OnEvent", nil) frame:SetScript("OnUpdate", nil) frame:RegisterForDrag("LeftButton") @@ -293,8 +293,8 @@ function Movers:Disable() frame:SetScript("OnDragStart", nil) frame:SetScript("OnEvent", frame:IsVisible() and ShadowUF.Units.OnEvent) frame:SetScript("OnUpdate", frame.originalOnUpdate) - frame:SetScript("OnEnter", frame.originalOnEnter) - frame:SetScript("OnLeave", frame.originalOnLeave) + frame.OnEnter = frame.originalOnEnter + frame.OnLeave = frame.originalOnLeave frame:SetMovable(false) frame:RegisterForDrag() diff --git a/modules/units.lua b/modules/units.lua index ba46e031..ea7939f0 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -591,6 +591,18 @@ end -- Show tooltip local function OnEnter(self) + if self.OnEnter then + self:OnEnter() + end +end + +local function OnLeave(self) + if self.OnLeave then + self:OnLeave() + end +end + +local function SUF_OnEnter(self) if( not ShadowUF.db.profile.tooltipCombat or not InCombatLockdown() ) then UnitFrame_OnEnter(self) end @@ -636,13 +648,16 @@ function Units:CreateUnit(...) frame:SetScript("OnAttributeChanged", OnAttributeChanged) frame:SetScript("OnEvent", OnEvent) - frame:SetScript("OnEnter", OnEnter) - frame:SetScript("OnLeave", UnitFrame_OnLeave) + frame:HookScript("OnEnter", OnEnter) + frame:HookScript("OnLeave", OnLeave) frame:SetScript("OnShow", OnShow) frame:SetScript("OnHide", OnHide) frame:SetScript("PostClick", PostClick) + + frame.OnEnter = SUF_OnEnter + frame.OnLeave = UnitFrame_OnLeave - frame:RegisterForClicks("AnyUp") + frame:RegisterForClicks("AnyUp") -- non-header frames don't set those, so we need to do it if( not InCombatLockdown() ) then frame:SetAttribute("*type1", "target") From a2a59fdf9f2e741dced21e6bbd0043f9e125962d Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 24 Oct 2010 16:26:48 +0200 Subject: [PATCH 063/794] Work around an issue in the Blizzard raid pet header, that caused raid pets to not be functional at all anymore. --- modules/units.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/units.lua b/modules/units.lua index ea7939f0..4a62bec4 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -958,6 +958,10 @@ function Units:LoadGroupHeader(type) headerFrame:SetAttribute("style-width", config.width) headerFrame:SetAttribute("style-scale", config.scale) + if type == "raidpet" then + headerFrame:SetAttribute("filterOnPet", true) + end + if ClickCastHeader then -- the OnLoad adds the functions like SetFrameRef to the header SecureHandler_OnLoad(headerFrame) From 51c6376c37080377828f0a5df3ac4bd3a0ed89b2 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 31 Oct 2010 16:41:07 +0100 Subject: [PATCH 064/794] - Soul Shards now use a new, unique icon - Changed defaults for soul shards to look better - Fixed z-fighting between soulshard/holypower bars, and indicators. --- ShadowedUnitFrames.lua | 2 +- modules/combopoints.lua | 4 ++-- modules/defaultlayout.lua | 2 +- modules/indicators.lua | 2 +- modules/soulshards.lua | 4 ++-- options/config.lua | 18 +++++++++--------- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index a6b1c1b9..1930027a 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -160,7 +160,7 @@ function ShadowUF:CheckUpgrade() self.db.profile.units.player.fader.inactiveAlpha = self.db.profile.units.player.fader.inactiveAlpha or 0.6 self.db.profile.units.target.comboPoints.height = self.db.profile.units.target.comboPoints.height or 0.40 self.db.profile.units.player.eclipseBar = {enabled = true, background = true, height = 0.40, order = 70} - self.db.profile.units.player.soulShards = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} + self.db.profile.units.player.soulShards = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -8, y = 2, size = 12, height = 0.40, spacing = -2, growth = "LEFT", isBar = true} loadDefault = true end diff --git a/modules/combopoints.lua b/modules/combopoints.lua index ebffb39b..e61a7d28 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -16,8 +16,8 @@ function Combo:OnLayoutApplied(frame, config) local pointsFrame = frame[key] if not pointsFrame then return end - pointsFrame:SetFrameLevel(frame:GetFrameLevel() + 5) - + pointsFrame:SetFrameLevel(frame.topFrameLevel + 1) + local pointsConfig = pointsFrame.config config = config[key] -- Not a bar so set the containers frame configuration diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index b536e4b0..dceec904 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -303,7 +303,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, eclipseBar = {enabled = true, background = true, order = 70, height = 0.40}, - soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, + soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, auras = { buffs = {enabled = false, maxRows = 1, temporary = playerClass == "ROGUE" or playerClass == "SHAMAN"}, diff --git a/modules/indicators.lua b/modules/indicators.lua index 0c2dc244..5299ddff 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -238,7 +238,7 @@ function Indicators:OnEnable(frame) -- Forces the indicators to be above the bars/portraits/etc if( not frame.indicators ) then frame.indicators = CreateFrame("Frame", nil, frame) - frame.indicators:SetFrameLevel(frame.topFrameLevel + 1) + frame.indicators:SetFrameLevel(frame.topFrameLevel + 2) end -- Now lets enable all the indicators diff --git a/modules/soulshards.lua b/modules/soulshards.lua index 48802ce7..f15d0599 100644 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -1,6 +1,6 @@ local Souls = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(Souls, "soulShards", ShadowUF.L["Soul Shards"], nil, "WARLOCK") -local soulsConfig = {max = SHARD_BAR_NUM_SHARDS, key = "soulShards", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local soulsConfig = {max = SHARD_BAR_NUM_SHARDS, key = "soulShards", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\shard"} function Souls:OnEnable(frame) frame.soulShards = frame.soulShards or CreateFrame("Frame", nil, frame) @@ -20,7 +20,7 @@ function Souls:Update(frame, event, unit, powerType) if( event == "UNIT_POWER" and powerType ~= "SOUL_SHARDS" ) then return end local points = UnitPower("player", SPELL_POWER_SOUL_SHARDS) - -- Bar display, hide it if we don't have any combo points + -- Bar display, hide it if we don't have any soul shards if( ShadowUF.db.profile.units[frame.unitType].soulShards.isBar ) then ShadowUF.Layout:SetBarVisibility(frame, "soulShards", ShadowUF.db.profile.units[frame.unitType].soulShards.showAlways or (points and points > 0)) end diff --git a/options/config.lua b/options/config.lua index b5229e08..7ccde61b 100644 --- a/options/config.lua +++ b/options/config.lua @@ -2425,7 +2425,7 @@ local function loadUnitOptions() order = 3, type = "range", name = L["Spacing"], - min = -20, max = 20, step = 1, softMin = -10, softMax = 10, + min = -30, max = 30, step = 1, softMin = -15, softMax = 15, hidden = hideAdvancedOption, arg = "soulShards.spacing", }, @@ -2448,7 +2448,7 @@ local function loadUnitOptions() order = 6, type = "range", name = L["X Offset"], - min = -20, max = 20, step = 1, + min = -30, max = 30, step = 1, hidden = false, arg = "soulShards.x", }, @@ -2456,7 +2456,7 @@ local function loadUnitOptions() order = 7, type = "range", name = L["Y Offset"], - min = -20, max = 20, step = 1, + min = -30, max = 30, step = 1, hidden = false, arg = "soulShards.y", }, @@ -2535,7 +2535,7 @@ local function loadUnitOptions() order = 3, type = "range", name = L["Spacing"], - min = -20, max = 20, step = 1, softMin = -10, softMax = 10, + min = -30, max = 30, step = 1, softMin = -15, softMax = 15, hidden = hideAdvancedOption, arg = "holyPower.spacing", }, @@ -2558,7 +2558,7 @@ local function loadUnitOptions() order = 6, type = "range", name = L["X Offset"], - min = -20, max = 20, step = 1, + min = -30, max = 30, step = 1, hidden = false, arg = "holyPower.x", }, @@ -2566,7 +2566,7 @@ local function loadUnitOptions() order = 7, type = "range", name = L["Y Offset"], - min = -20, max = 20, step = 1, + min = -30, max = 30, step = 1, hidden = false, arg = "holyPower.y", }, @@ -2645,7 +2645,7 @@ local function loadUnitOptions() order = 3, type = "range", name = L["Spacing"], - min = -20, max = 20, step = 1, softMin = -10, softMax = 10, + min = -30, max = 30, step = 1, softMin = -15, softMax = 15, hidden = hideAdvancedOption, arg = "comboPoints.spacing", }, @@ -2668,7 +2668,7 @@ local function loadUnitOptions() order = 6, type = "range", name = L["X Offset"], - min = -20, max = 20, step = 1, + min = -30, max = 30, step = 1, hidden = false, arg = "comboPoints.x", }, @@ -2676,7 +2676,7 @@ local function loadUnitOptions() order = 7, type = "range", name = L["Y Offset"], - min = -20, max = 20, step = 1, + min = -30, max = 30, step = 1, hidden = false, arg = "comboPoints.y", }, From d9910daacc0d958e54e80e646be3184b788c9363 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 31 Oct 2010 16:54:27 +0100 Subject: [PATCH 065/794] Add the ability to color the combo points, soul shards and holy power bars. Defaults to class colors. --- ShadowedUnitFrames.lua | 2 ++ modules/combopoints.lua | 5 +++-- modules/defaultlayout.lua | 3 +++ modules/holypower.lua | 2 +- modules/soulshards.lua | 2 +- options/config.lua | 23 +++++++++++++++++++++++ 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 1930027a..ca71a163 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -185,6 +185,8 @@ function ShadowUF:CheckUpgrade() self.db.profile.units.player.soulShards.height = self.db.profile.units.player.soulShards.height or 0.40 self.db.profile.units.player.holyPower.height = self.db.profile.units.player.holyPower.height or 0.40 + + loadDefault = true end if loadDefault then diff --git a/modules/combopoints.lua b/modules/combopoints.lua index e61a7d28..fb71a9b7 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -1,7 +1,7 @@ local Combo = {} ShadowUF:RegisterModule(Combo, "comboPoints", ShadowUF.L["Combo points"]) ShadowUF.ComboPoints = Combo -local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBOPOINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) @@ -44,7 +44,8 @@ function Combo:OnLayoutApplied(frame, config) for id=1, pointsConfig.max do pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.blocks[id] - texture:SetVertexColor(1, 0.80, 0) + local color = ShadowUF.db.profile.powerColors[pointsConfig.colorKey or "COMBOPOINTS"] + texture:SetVertexColor(color.r, color.g, color.b) texture:SetHorizTile(false) texture:SetTexture(ShadowUF.Layout.mediaPath.statusbar) texture:SetHeight(pointsFrame:GetHeight()) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index dceec904..5a35bcdc 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -146,6 +146,9 @@ function ShadowUF:LoadDefaultLayout(useMerge) ECLIPSE_MOON = {r = 0.30, g = 0.52, b = 0.90}, AMMOSLOT = {r = 0.85, g = 0.60, b = 0.55}, FUEL = {r = 0.85, g = 0.47, b = 0.36}, + COMBOPOINTS = {r = 1.0, g = 0.80, b = 0.0}, + HOLYPOWER = {r = 0.96, g = 0.55, b = 0.73}, + SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, } config.healthColors = { tapped = {r = 0.5, g = 0.5, b = 0.5}, diff --git a/modules/holypower.lua b/modules/holypower.lua index ff382988..1393ea68 100644 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -1,6 +1,6 @@ local HolyPower = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN") -local holyConfig = {max = MAX_HOLY_POWER, key = "holyPower", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local holyConfig = {max = MAX_HOLY_POWER, key = "holyPower", colorKey = "HOLYPOWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function HolyPower:OnEnable(frame) frame.holyPower = frame.holyPower or CreateFrame("Frame", nil, frame) diff --git a/modules/soulshards.lua b/modules/soulshards.lua index f15d0599..9c64acee 100644 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -1,6 +1,6 @@ local Souls = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(Souls, "soulShards", ShadowUF.L["Soul Shards"], nil, "WARLOCK") -local soulsConfig = {max = SHARD_BAR_NUM_SHARDS, key = "soulShards", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\shard"} +local soulsConfig = {max = SHARD_BAR_NUM_SHARDS, key = "soulShards", colorKey = "SOULSHARDS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\shard"} function Souls:OnEnable(frame) frame.soulShards = frame.soulShards or CreateFrame("Frame", nil, frame) diff --git a/options/config.lua b/options/config.lua index 7ccde61b..cd0d93be 100644 --- a/options/config.lua +++ b/options/config.lua @@ -1120,6 +1120,29 @@ local function loadGeneralOptions() arg = "powerColors.FUEL", hidden = hideAdvancedOption, }, + COMBOPOINTS = { + order = 11, + type = "color", + name = L["Combo points"], + hasAlpha = true, + arg = "powerColors.COMBOPOINTS", + }, + HOLYPOWER = { + order = 12, + type = "color", + name = L["Holy Power"], + hasAlpha = true, + arg = "powerColors.HOLYPOWER", + hidden = function(info) return select(2, UnitClass("player")) ~= "PALADIN" end, + }, + SOULSHARDS = { + order = 13, + type = "color", + name = L["Soul Shards"], + hasAlpha = true, + arg = "powerColors.SOULSHARDS", + hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, + }, }, }, cast = { From b42190cf671c629330333d2cfa3f5e6156ef36fa Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 31 Oct 2010 16:55:02 +0100 Subject: [PATCH 066/794] Add missing gfx. --- media/textures/shard.tga | Bin 0 -> 3225 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 media/textures/shard.tga diff --git a/media/textures/shard.tga b/media/textures/shard.tga new file mode 100644 index 0000000000000000000000000000000000000000..2d459b50e94db296c70b8ff58186064292d5c1ae GIT binary patch literal 3225 zcmYjT2Ut{B7QO=lCawi3f|5ws=*GCwSfa*6U6UYcBKDR@vM~yZn1Twd8zU$xxCja& zRzv|Ch#(^tnhFAn6fp|IP-ZB@Fu?SAZy-DWo;M`l=DqK~@4hMjf6uw+oO>91o&9mS zGr9+}5raptlfq}B#Zwmx&msG0aA6`QdNW3NXCvr7AWQ~NvwL^wDkm=|S#qlrfY&z8 z@WGyWK~RRZB4TR<{FnRx6fOLc)x^}WFkv$EN9MO-7YnF7`*uuM_S|H}^S~zx!viC) zxvzog^FEv&e*zaBkC-pL9)WX1!ccL%0)8%j+9=`QBPGQW`}l}>-#$fO^7Hf0n@ST( zfro%LO^cRjiTTzimykB;6nxkctY-_cjIf&K;Vb~jcHz)gs>(EJtH~rK|EC3Rp=!ccN)R( z=Fz)ef$jwjs2!7wIcyScTE(Nwt_a_;6{u!ns1g*A%&$QI)_%-(p6+)@U>|jK#7Xw! zK7ZSatO~8M(Fny61ytE8@U1*dp(ZGNy3w|@3oY}dkS~*?ePI)-U2ma$P#SiKd{Azk zhCG{dh!6!rvg!#G!Odv!tbl&A4#e*|;H5a{Gr#`!@;9_??}RQ&kCr(dFyZZ*R*q7LyHFlpWxiu|AM$ldG)$C2pRGq*WE;5SJlfVP(di{c>xWHvIj$0wZekpw zJt(kAMun{y=hz-_;T+UU+Ms>E1?n;NX735!e^Svs)A@1tI4Iv!LgLYm3VR7ETxrc& zYP6lEe+6hE|4+r|vZ&k{bOAZmiFoCjkH(p0c@>JoBdV-#pxP#fA|MA({L2yd@i8YsWWO+s5pps0=Tu?N z43!3XPjL_U0#X(8Fb3<8?^uN_n@70wNiNzFJ75S_LmSv_S(zrL6R(ElB8aU<@t{jM zMSE25Q;oB(hfqRMku&NF4zOK#v8x$7JT_WX!v&$yj@FKD`O*1M6{yVWay9r|QjDU! z`9+W1u}^W?CLbBo#OS`!ONu?v{Ieaply1l-m!N!P8ulJ+*whZ0j3hZa!QWi(yf+!OEMZt)fd<=)) zI#_F|QI=uMmvh!JXDjCgpRu_x>I~2+wPxN#hQ?D0#~Z+JQG*LILiS}RPOuCd7o|d7 zEQRhMNiUb9g_7ujOA=DpUc|8PA=}i32#=izV5?BTZqR4@;Kp3Ac;Yf4Kpp-h&3xIQ zk344Ua$|3qCF!-`j1)^9Bz=mou^0R%%I{zU)Z4U(W7l!Q`U(_c3Aig9bcfV1`DxI$ zpawN_3-NMY4ayc5;z#mrF#8%FY%H9agCL1iA4>*0{z>|mzXvruh|5QDR3Wq-8t^9V!wrGUQCZjyNje3U?*mU?VV% zd0--85*r5xdN1{nbkP!AEYfe#jJ?m^cD}g%3?7`!$KB9uC~Fi0>T*(iM%Y4FLfFBh zePuhTr$AfW1+Ideq2{3%_u|g%bi}i8>=b>AEaz)zahGB;dlNI+c)Y{hEyuy!k@HZ$ zReO_CXYBvgtLI;LGBj(^bgBV)?`NT1EQ3kX2fmLK1s^05$bOA)FFKr>(37SFuO-zS zQdiPO!!23PZI-$8p0npDwcUB2aNC(+&g8GUY zkAoiLQSc*L!BNCopN5Kd?D3RJB)^k_439gwF!m~BYqb>mbh!z`)_2!>8S1r^rb^WA zeTEksD)HZJGpetZqvg5;`e%CR?&@GDG=S@*73j$RXa#yUNMYhkP@YwzZo8D2FCxY& z2Ip-rqin%5%pWuz?=m-7F?K#-LL$OM2maQwMJ*B<31+c(+1sBa>Ml^>s3p(!5PAte z5T>f2>QX_|paIv%fm3qOCTL;EGobf)7djR5DpGny_+44ms)G8l3OyxMJn8P<-3|3t zHFSwu=<+p?FZx~emtH&?U5i9I2#Q8mQIjzfM{Po}c<2ms#_}x8n!Lu&(ipi4YCo+D zJgGiMYIVdZ8BpY^$%_wZeu?()1mP%^GJhQ!z18RpS3_N9!iyP=6n#A8RK_0;E5g$u zH3*?{waI=3R@lukSM8T23H-B|`#>A!EWBL}y&9n}(u1!j_9nuw1Zp}g^Bhu&<6$V_ z(D{`C^;5Oz_*sqKy9T_R*@(7G4lT#@sIqUs-9ciCo(Sx9`N5nw<<>xxL>tLiS$0_@ zC*=^vx9}J#WE{0lpoYm3|HdAwh!h|9$LAr>J`ar{t&r^QLEU$qP@FKKZdo_-9dhx| zIUnxK2^HJgFvII>JHZM|17JB`O0!DCxE}IR7qK=IsEOgU990$r^m{139j_vHR63q- zsDUQigvMYQ&e%Wr$MC=A)ZYNX| z$jh39UiA7aP&gq2H*L=$iN)e1JA%s-l5lV0BV>tkQDh@UiAyUIKT0--{&gQ**zl0U z0;z+AxtN$KUU>~MQUl399bneq(V;h3fv4UD$Z@)WbHk%>bm%^6Cqi(U&VW>wh6i@7 z=8~y0q;5$!5ZBWG2!taotVLzpj65B9{gesaS-7t58=YN9{d%GqvR+OY3Y|XUu_^fQLB`QFOZq)#7SohG*jN*2B0Savep7 ziy_{aj(-fBh0kn1#=7ClvA}ko`IK)W{6G8N|K8;XP8nx2EwNA?RmUvrv>ef&&iQon z=JlK5_mv;~*ZX6`!VU1A=Z&djr(%lx6fAM}gx|z(uyexq*!HF`e(> Date: Sun, 31 Oct 2010 17:04:56 +0100 Subject: [PATCH 067/794] Allow larger values for frame width/height and scale. --- modules/defaultlayout.lua | 2 +- options/config.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 5a35bcdc..a532303c 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -137,7 +137,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) config.powerColors = { MANA = {r = 0.30, g = 0.50, b = 0.85}, RAGE = {r = 0.90, g = 0.20, b = 0.30}, - FOCUS = {r = 1.0, g = 0.85, b = 0}, + FOCUS = {r = 1.0, g = 0.50, b = 0.25}, ENERGY = {r = 1.0, g = 0.85, b = 0.10}, HAPPINESS = {r = 0.50, g = 0.90, b = 0.70}, RUNES = {r = 0.50, g = 0.50, b = 0.50}, diff --git a/options/config.lua b/options/config.lua index cd0d93be..696d44c8 100644 --- a/options/config.lua +++ b/options/config.lua @@ -3081,7 +3081,7 @@ local function loadUnitOptions() order = 0, type = "range", name = L["Scale"], - min = 0.50, max = 1.50, step = 0.01, + min = 0.25, max = 2, step = 0.01, isPercent = true, arg = "scale", }, @@ -3089,14 +3089,14 @@ local function loadUnitOptions() order = 1, type = "range", name = L["Height"], - min = 0, max = 100, step = 1, + min = 0, softMax = 100, step = 1, arg = "height", }, width = { order = 2, type = "range", name = L["Width"], - min = 0, max = 300, step = 1, + min = 0, softMax = 300, step = 1, arg = "width", }, }, From 6d28798defb3be9baafbec96f3ce9bfa04654a35 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 13 Nov 2010 09:31:23 +0100 Subject: [PATCH 068/794] Remove Dire Bear Form from the druid form tag, as its all about Bear Form now. --- modules/tags.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index e40de5bb..91b4399b 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -275,7 +275,6 @@ Druid.MoonkinForm = GetSpellInfo(24858) Druid.TravelForm = GetSpellInfo(783) Druid.BearForm = GetSpellInfo(5487) Druid.TreeForm = GetSpellInfo(33891) -Druid.DireBearForm = GetSpellInfo(9634) Druid.AquaticForm = GetSpellInfo(1066) Druid.SwiftFlightForm = GetSpellInfo(40120) Druid.FlightForm = GetSpellInfo(33943) @@ -295,7 +294,7 @@ Tags.defaultTags = { return ShadowUF.L["T"] elseif( UnitAura(unit, Druid.MoonkinForm, Druid.Shapeshift) ) then return ShadowUF.L["M"] - elseif( UnitAura(unit, Druid.DireBearForm, Druid.Shapeshift) or UnitAura(unit, Druid.BearForm, Druid.Shapeshift) ) then + elseif( UnitAura(unit, Druid.BearForm, Druid.Shapeshift) ) then return ShadowUF.L["B"] elseif( UnitAura(unit, Druid.SwiftFlightForm, Druid.Shapeshift) or UnitAura(unit, Druid.FlightForm, Druid.Shapeshift) ) then return ShadowUF.L["F"] @@ -315,7 +314,7 @@ Tags.defaultTags = { return ShadowUF.L["Tree"] elseif( UnitAura(unit, Druid.MoonkinForm, Druid.Shapeshift) ) then return ShadowUF.L["Moonkin"] - elseif( UnitAura(unit, Druid.DireBearForm, Druid.Shapeshift) or UnitAura(unit, Druid.BearForm, Druid.Shapeshift) ) then + elseif( UnitAura(unit, Druid.BearForm, Druid.Shapeshift) ) then return ShadowUF.L["Bear"] elseif( UnitAura(unit, Druid.SwiftFlightForm, Druid.Shapeshift) or UnitAura(unit, Druid.FlightForm, Druid.Shapeshift) ) then return ShadowUF.L["Flight"] From 76af63b38b6501afc88d0466ddb8d7f5629b81ab Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 15 Nov 2010 18:01:33 +0100 Subject: [PATCH 069/794] Fix up spell ids for range detection in the range fader. --- modules/range.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index 2bf5b343..6161aa13 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -1,7 +1,7 @@ local Range = { - friendly = {["PRIEST"] = GetSpellInfo(2050), ["DRUID"] = GetSpellInfo(48378), ["PALADIN"] = GetSpellInfo(48782), ["SHAMAN"] = GetSpellInfo(49273)}, - hostile = {["PRIEST"] = GetSpellInfo(48127), ["DRUID"] = GetSpellInfo(48461), ["PALADIN"] = GetSpellInfo(62124), ["HUNTER"] = GetSpellInfo(75), ["WARLOCK"] = GetSpellInfo(686), ["SHAMAN"] = GetSpellInfo(529), ["MAGE"] = GetSpellInfo(133), ["DEATHKNIGHT"] = GetSpellInfo(49576)}, - resurrect = {["PALADIN"] = GetSpellInfo(48950), ["PRIEST"] = GetSpellInfo(25435), ["SHAMAN"] = GetSpellInfo(2008), ["DRUID"] = GetSpellInfo(48477)} + friendly = {["PRIEST"] = GetSpellInfo(2061), ["DRUID"] = GetSpellInfo(5185), ["PALADIN"] = GetSpellInfo(635), ["SHAMAN"] = GetSpellInfo(331)}, + hostile = {["PRIEST"] = GetSpellInfo(585), ["DRUID"] = GetSpellInfo(5176), ["PALADIN"] = GetSpellInfo(62124), ["HUNTER"] = GetSpellInfo(75), ["WARLOCK"] = GetSpellInfo(686), ["SHAMAN"] = GetSpellInfo(403), ["MAGE"] = GetSpellInfo(133), ["DEATHKNIGHT"] = GetSpellInfo(49576)}, + resurrect = {["PALADIN"] = GetSpellInfo(7328), ["PRIEST"] = GetSpellInfo(2006), ["SHAMAN"] = GetSpellInfo(2008), ["DRUID"] = GetSpellInfo(50769)} } ShadowUF:RegisterModule(Range, "range", ShadowUF.L["Range indicator"]) From bef96f9712f4547b4c6ead9ef6571daed5f99b0d Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 15 Nov 2010 18:14:21 +0100 Subject: [PATCH 070/794] Use UNIT_CONNECTION to detect connect/disconnect events. --- modules/health.lua | 1 + modules/power.lua | 1 + modules/tags.lua | 32 ++++++++++++++++---------------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/modules/health.lua b/modules/health.lua index 91379ae0..176147e4 100644 --- a/modules/health.lua +++ b/modules/health.lua @@ -56,6 +56,7 @@ function Health:OnEnable(frame) frame:RegisterUnitEvent("UNIT_HEALTH", self, "Update") frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "Update") + frame:RegisterUnitEvent("UNIT_CONNECTION", self, "Update") frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdateColor") frame:RegisterUnitEvent("UNIT_THREAT_SITUATION_UPDATE", self, "UpdateColor") diff --git a/modules/power.lua b/modules/power.lua index 7e3bd0ca..9f125a8a 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -19,6 +19,7 @@ function Power:OnEnable(frame) frame:RegisterUnitEvent("UNIT_POWER", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") + frame:RegisterUnitEvent("UNIT_CONNECTION", self, "Update") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdateColor") frame:RegisterUpdateFunc(self, "UpdateColor") diff --git a/modules/tags.lua b/modules/tags.lua index 91b4399b..115bf33b 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -809,20 +809,20 @@ Tags.defaultEvents = { ["short:druidform"] = "UNIT_AURA", ["druidform"] = "UNIT_AURA", ["guild"] = "UNIT_NAME_UPDATE", -- Not sure when this data is available, guessing - ["abs:incheal"] = "HEALCOMM", - ["incheal:name"] = "HEALCOMM", - ["incheal"] = "HEALCOMM", + ["abs:incheal"] = "UNIT_HEAL_PREDICTION", + ["incheal:name"] = "UNIT_HEAL_PREDICTION", + ["incheal"] = "UNIT_HEAL_PREDICTION", ["afk"] = "PLAYER_FLAGS_CHANGED", -- Yes, I know it's called PLAYER_FLAGS_CHANGED, but arg1 is the unit including non-players. - ["afk:time"] = "PLAYER_FLAGS_CHANGED", - ["status:time"] = "UNIT_POWER", + ["afk:time"] = "PLAYER_FLAGS_CHANGED UNIT_CONNECTION", + ["status:time"] = "UNIT_POWER UNIT_CONNECTION", ["pvp:time"] = "PLAYER_FLAGS_CHANGED", - ["curhp"] = "UNIT_HEALTH", - ["abscurhp"] = "UNIT_HEALTH", - ["curmaxhp"] = "UNIT_HEALTH UNIT_MAXHEALTH", - ["absolutehp"] = "UNIT_HEALTH UNIT_MAXHEALTH", - ["smart:curmaxhp"] = "UNIT_HEALTH UNIT_MAXHEALTH", + ["curhp"] = "UNIT_HEALTH UNIT_CONNECTION", + ["abscurhp"] = "UNIT_HEALTH UNIT_CONNECTION", + ["curmaxhp"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION", + ["absolutehp"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION", + ["smart:curmaxhp"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION", ["curpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", - ["abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWERR", + ["abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", ["curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", ["absolutepp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", ["smart:curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", @@ -837,15 +837,15 @@ Tags.defaultEvents = { ["absmaxhp"] = "UNIT_MAXHEALTH", ["maxpp"] = "UNIT_MAXPOWER", ["absmaxpp"] = "UNIT_MAXPOWER", - ["missinghp"] = "UNIT_HEALTH UNIT_MAXHEALTH", + ["missinghp"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION", ["missingpp"] = "UNIT_POWER UNIT_MAXPOWER", ["name"] = "UNIT_NAME_UPDATE", ["abbrev:name"] = "UNIT_NAME_UPDATE", ["server"] = "UNIT_NAME_UPDATE", ["colorname"] = "UNIT_NAME_UPDATE", - ["perhp"] = "UNIT_HEALTH UNIT_MAXHEALTH", - ["perpp"] = "UNIT_POWER UNIT_MAXPOWER", - ["status"] = "UNIT_HEALTH PLAYER_UPDATE_RESTING", + ["perhp"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION", + ["perpp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_CONNECTION", + ["status"] = "UNIT_HEALTH PLAYER_UPDATE_RESTING UNIT_CONNECTION", ["smartlevel"] = "UNIT_LEVEL PLAYER_LEVEL_UP UNIT_CLASSIFICATION_CHANGED", ["cpoints"] = "UNIT_COMBO_POINTS PLAYER_TARGET_CHANGED", ["rare"] = "UNIT_CLASSIFICATION_CHANGED", @@ -1148,7 +1148,7 @@ local function loadAPIEvents() ["UnitPowerType"] = "UNIT_DISPLAYPOWER", ["UnitIsDead"] = "UNIT_HEALTH", ["UnitIsGhost"] = "UNIT_HEALTH", - ["UnitIsConnected"] = "UNIT_HEALTH", + ["UnitIsConnected"] = "UNIT_HEALTH UNIT_CONNECTION", ["UnitIsAFK"] = "PLAYER_FLAGS_CHANGED", ["UnitIsDND"] = "PLAYER_FLAGS_CHANGED", ["UnitIsPVP"] = "PLAYER_FLAGS_CHANGED UNIT_FACTION", From 35cc473a7dea6b1d79c588653b2c715cad1e6375 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 15 Nov 2010 18:47:20 +0100 Subject: [PATCH 071/794] Use UNIT_CONNECTION in range checker as well (not useful to poll range on offline people) --- modules/range.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/range.lua b/modules/range.lua index 6161aa13..c810e1c7 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -45,6 +45,7 @@ function Range:OnEnable(frame) -- I want to say UNIT_FACTION is the function thats called when a unit is MCed, but not 100% sure frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdateFlags") + frame:RegisterUnitEvent("UNIT_CONNECTION", self, "UpdateFlags") frame:RegisterNormalEvent("PARTY_MEMBERS_CHANGED", self, "UpdateFlags") frame:RegisterNormalEvent("RAID_ROSTER_UPDATE", self, "UpdateFlags") From 4d1a96032b883ff1a2d740dca75193d4f6f117e3 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 16 Nov 2010 18:17:39 +0100 Subject: [PATCH 072/794] Add the Dungeon Role to the raid frames. --- ShadowedUnitFrames.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index ca71a163..8e0dc931 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 3 +ShadowUF.dbRevision = 4 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -178,7 +178,7 @@ function ShadowUF:CheckUpgrade() loadDefault = true end - -- Ongoing fixes + -- November 16th if( revision <= 3 ) then self.db.profile.units.target.comboPoints.order = self.db.profile.units.target.comboPoints.order or 60 self.db.profile.units.target.comboPoints.anchorTo = self.db.profile.units.target.comboPoints.anchorTo or "$parent" @@ -186,6 +186,8 @@ function ShadowUF:CheckUpgrade() self.db.profile.units.player.soulShards.height = self.db.profile.units.player.soulShards.height or 0.40 self.db.profile.units.player.holyPower.height = self.db.profile.units.player.holyPower.height or 0.40 + self.db.profile.units.raid.indicators.lfdRole = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = 14, anchorTo = "$parent"} + loadDefault = true end @@ -342,6 +344,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.raid.filters = {[1] = true, [2] = true, [3] = true, [4] = true, [5] = true, [6] = true, [7] = true, [8] = true} self.defaults.profile.units.raid.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} self.defaults.profile.units.raid.combatText.enabled = false + self.defaults.profile.units.raid.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} -- RAID PET self.defaults.profile.units.raidpet.groupBy = "GROUP" self.defaults.profile.units.raidpet.sortOrder = "ASC" From d83470d36aff51525156d9e1fdd0e5ee6571967e Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 16 Nov 2010 18:27:33 +0100 Subject: [PATCH 073/794] Make the blizzard runebar work again. --- ShadowedUnitFrames.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 8e0dc931..cbe402e4 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -452,11 +452,15 @@ end -- Stolen from haste ShadowUF.noop = function() end function ShadowUF:HideBlizzardFrames() - if( ShadowUF.db.profile.hidden.runes ) then + local _, class = UnitClass("player") + if( ShadowUF.db.profile.hidden.runes or class ~= "DEATHKNIGHT" ) then RuneFrame.Show = self.noop RuneFrame:Hide() + RuneFrame:UnregisterAllEvents() + elseif( class == "DEATHKNIGHT" ) then + RuneFrame:Show() end - + if( ShadowUF.db.profile.hidden.cast ) then CastingBarFrame:UnregisterAllEvents() PetCastingBarFrame:UnregisterAllEvents() @@ -527,7 +531,6 @@ function ShadowUF:HideBlizzardFrames() PlayerFrameManaBar:UnregisterAllEvents() PlayerFrameAlternateManaBar:UnregisterAllEvents() EclipseBarFrame:UnregisterAllEvents() - RuneFrame:UnregisterAllEvents() ShardBarFrame:UnregisterAllEvents() end From e77455c8a875132bfaab6abee53928d9a089fd31 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 27 Nov 2010 12:39:02 +0100 Subject: [PATCH 074/794] Run our initialization before Clique, so the on-press mode works properly. --- modules/units.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 4a62bec4..fd875691 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -566,15 +566,16 @@ local secureInitializeUnit = [[ self:SetAttribute("*type2", "menu") self:SetAttribute("isHeaderDriven", true) - + + -- initialize frame + header:CallMethod("initialConfigFunction", self:GetName()) + -- Clique integration local clickHeader = header:GetFrameRef("clickcast_header") if clickHeader then clickHeader:SetAttribute("clickcast_button", self) clickHeader:RunAttribute("clickcast_register") end - - header:CallMethod("initialConfigFunction", self:GetName()) ]] local unitButtonTemplate = ClickCastHeader and "ClickCastUnitTemplate,SecureUnitButtonTemplate" or "SecureUnitButtonTemplate" From c2e86036d18594031930b7a50e54dd441f2d2439 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 28 Dec 2010 13:28:14 +0100 Subject: [PATCH 075/794] Added a Alt. Power bar module to display the alternate power of units used in some raid encounters. --- ShadowedUnitFrames.lua | 13 +++++++++++- ShadowedUnitFrames.toc | 1 + modules/altpower.lua | 42 +++++++++++++++++++++++++++++++++++++++ modules/defaultlayout.lua | 2 ++ options/config.lua | 10 +++++++++- 5 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 modules/altpower.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index cbe402e4..5e1403f0 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 4 +ShadowUF.dbRevision = 5 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -191,6 +191,14 @@ function ShadowUF:CheckUpgrade() loadDefault = true end + if( revision <= 4 ) then + self.db.profile.powerColors.ALTERNATE = {r = 0.71, g = 0.0, b = 1.0} + for unit, config in pairs(self.db.profile.units) do + config.altPowerBar = {enabled = false, background = true, height = 0.40, order = 100} + end + self.db.profile.units.boss.altPowerBar.enabled = true + end + if loadDefault then self:LoadDefaultLayout(true) end @@ -278,6 +286,8 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units[unit].indicators.ready = {enabled = true, size = 0} end end + + self.defaults.profile.units[unit].altPowerBar = {enabled = false} end -- PLAYER @@ -334,6 +344,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.boss.auras.debuffs.maxRows = 1 self.defaults.profile.units.boss.auras.buffs.maxRows = 1 self.defaults.profile.units.boss.offset = 0 + self.defaults.profile.units.boss.altPowerBar.enabled = true -- RAID self.defaults.profile.units.raid.groupBy = "GROUP" self.defaults.profile.units.raid.sortOrder = "ASC" diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 3adeb6c0..fab6b114 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -49,6 +49,7 @@ modules\druid.lua modules\eclipse.lua modules\soulshards.lua modules\holypower.lua +modules\altpower.lua #@do-not-package@ options\config.lua #@end-do-not-package@ \ No newline at end of file diff --git a/modules/altpower.lua b/modules/altpower.lua new file mode 100644 index 00000000..ae74ee25 --- /dev/null +++ b/modules/altpower.lua @@ -0,0 +1,42 @@ +local AltPower = {} +ShadowUF:RegisterModule(AltPower, "altPowerBar", ShadowUF.L["Alt. Power bar"], true) + +local ALTERNATE_POWER_INDEX = ALTERNATE_POWER_INDEX + +function AltPower:OnEnable(frame) + frame.altPowerBar = frame.altPowerBar or ShadowUF.Units:CreateBar(frame) + + frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", self, "UpdateVisibility") + frame:RegisterUnitEvent("UNIT_POWER_BAR_HIDE", self, "UpdateVisibility") + + frame:RegisterUpdateFunc(self, "Update") + frame:RegisterUpdateFunc(self, "UpdateVisibility") +end + +function AltPower:OnLayoutApplied(frame) + if( frame.visibility.altPowerBar ) then + local color = ShadowUF.db.profile.powerColors.ALTERNATE + frame.altPowerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) + end +end + +function AltPower:OnDisable(frame) + frame:UnregisterAll(self) +end + +function AltPower:UpdateVisibility(frame) + local barType, minPower, _, _, _, hideFromOthers = UnitAlternatePowerInfo(frame.unit) + local visible = barType and not hideFromOthers + ShadowUF.Layout:SetBarVisibility(frame, "altPowerBar", visible) +end + +function AltPower:Update(frame) + local cur = UnitPower(frame.unit, ALTERNATE_POWER_INDEX) + local max = UnitPowerMax(frame.unit, ALTERNATE_POWER_INDEX) + local barType, min = UnitAlternatePowerInfo(frame.unit) + frame.altPowerBar.currentPower = cur + frame.altPowerBar:SetMinMaxValues(min or 0, max or 0) + frame.altPowerBar:SetValue(cur or 0) +end \ No newline at end of file diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index a532303c..2f3601d4 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -149,6 +149,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) COMBOPOINTS = {r = 1.0, g = 0.80, b = 0.0}, HOLYPOWER = {r = 0.96, g = 0.55, b = 0.73}, SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, + ALTERNATE = {r = 0.71, g = 0.0, b = 1.0}, } config.healthColors = { tapped = {r = 0.5, g = 0.5, b = 0.5}, @@ -234,6 +235,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) powerBar = {background = true, height = 1.0, order = 20}, xpBar = {background = true, height = 0.25, order = 55}, castBar = {background = true, height = 0.60, order = 40, icon = "HIDE", name = {enabled = true, size = 0, anchorTo = "$parent", rank = true, anchorPoint = "CLI", x = 1, y = 0}, time = {enabled = true, size = 0, anchorTo = "$parent", anchorPoint = "CRI", x = -1, y = 0}}, + altPowerBar = {background = true, height = 0.40, order = 100}, } -- Units configuration diff --git a/options/config.lua b/options/config.lua index 696d44c8..3fe1a7c8 100644 --- a/options/config.lua +++ b/options/config.lua @@ -565,7 +565,7 @@ local function loadGeneralOptions() -- Strip module settings that aren't with SUF by default if( not layoutData.modules ) then - local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true} + local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true} for _, unitData in pairs(layout.units) do for key, data in pairs(unitData) do if( type(data) == "table" and not validModules[key] and ShadowUF.modules[key] ) then @@ -3256,6 +3256,14 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "eclipseBar.enabled", }, + altPowerBar = { + order = 1.4, + type = "toggle", + name = string.format(L["Enable %s"], L["Alt. Power bar"]), + desc = L["Shows a bar for alternate power info (used in some encounters)"], + hidden = hideRestrictedOption, + arg = "altPowerBar.enabled", + }, totemBar = { order = 1.5, type = "toggle", From 6d03c3adaf61bf8411684544fd5165967173324f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 28 Dec 2010 13:28:51 +0100 Subject: [PATCH 076/794] Greatly simplified the range module which should fix units showing in/out of range, when they are actually not. --- modules/range.lua | 63 ++++++++++++++--------------------------------- 1 file changed, 19 insertions(+), 44 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index c810e1c7..88016441 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -1,32 +1,35 @@ local Range = { friendly = {["PRIEST"] = GetSpellInfo(2061), ["DRUID"] = GetSpellInfo(5185), ["PALADIN"] = GetSpellInfo(635), ["SHAMAN"] = GetSpellInfo(331)}, hostile = {["PRIEST"] = GetSpellInfo(585), ["DRUID"] = GetSpellInfo(5176), ["PALADIN"] = GetSpellInfo(62124), ["HUNTER"] = GetSpellInfo(75), ["WARLOCK"] = GetSpellInfo(686), ["SHAMAN"] = GetSpellInfo(403), ["MAGE"] = GetSpellInfo(133), ["DEATHKNIGHT"] = GetSpellInfo(49576)}, - resurrect = {["PALADIN"] = GetSpellInfo(7328), ["PRIEST"] = GetSpellInfo(2006), ["SHAMAN"] = GetSpellInfo(2008), ["DRUID"] = GetSpellInfo(50769)} } ShadowUF:RegisterModule(Range, "range", ShadowUF.L["Range indicator"]) local playerClass = select(2, UnitClass("player")) -local friendlySpell, hostileSpell -local resurrectSpell = Range.resurrect[playerClass] +local friendlySpell = Range.friendly[playerClass] +local hostileSpell = Range.hostile[playerClass] local function checkRange(self, elapsed) self.timeElapsed = self.timeElapsed + elapsed if( self.timeElapsed <= 0.50 ) then return end self.timeElapsed = 0 - --if( self.isFriendly and resurrectSpell and UnitIsDead(self.parent.unit) ) then - -- self.parent:SetRangeAlpha(IsSpellInRange(resurrectSpell, self.parent.unit) == 1 and ShadowUF.db.profile.units[self.parent.unitType].range.inAlpha or ShadowUF.db.profile.units[self.parent.unitType].range.oorAlpha) - -- We set a spell for them in our flags check, use that - if( self.spell ) then - self.parent:SetRangeAlpha(IsSpellInRange(self.spell, self.parent.unit) == 1 and ShadowUF.db.profile.units[self.parent.unitType].range.inAlpha or ShadowUF.db.profile.units[self.parent.unitType].range.oorAlpha) + local frame = self.parent + local spell + -- check which spell to use + if UnitIsFriend("player", frame.unit) then + spell = friendlySpell + elseif UnitCanAttack("player", frame.unit) then + spell = hostileSpell + end + + if( spell ) then + self.parent:SetRangeAlpha(IsSpellInRange(spell, frame.unit) == 1 and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) -- That didn't work, but they are grouped lets try the actual API for this, it's a bit flaky though and not that useful generally - elseif( self.grouped ) then - self.parent:SetRangeAlpha(UnitInRange(self.parent.unit, "player") and ShadowUF.db.profile.units[self.parent.unitType].range.inAlpha or ShadowUF.db.profile.units[self.parent.unitType].range.oorAlpha) + elseif( UnitInRaid(frame.unit) or UnitInParty(frame.unit) ) then + self.parent:SetRangeAlpha(UnitInRange(frame.unit, "player") and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) -- Nope, fall back to interaction :( - elseif( self.isFriendly ) then - self.parent:SetRangeAlpha(CheckInteractDistance(self.parent.unit, 4) and ShadowUF.db.profile.units[self.parent.unitType].range.inAlpha or ShadowUF.db.profile.units[self.parent.unitType].range.oorAlpha) else - self.parent:SetRangeAlpha(ShadowUF.db.profile.units[self.parent.unitType].range.inAlpha) + self.parent:SetRangeAlpha(CheckInteractDistance(frame.unit, 4) and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) end end @@ -40,24 +43,14 @@ function Range:OnEnable(frame) frame.range:SetScript("OnUpdate", checkRange) frame.range.timeElapsed = 0 frame.range.parent = frame - frame.range:Hide() + frame.range:Show() end - - -- I want to say UNIT_FACTION is the function thats called when a unit is MCed, but not 100% sure - frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdateFlags") - frame:RegisterUnitEvent("UNIT_CONNECTION", self, "UpdateFlags") - frame:RegisterNormalEvent("PARTY_MEMBERS_CHANGED", self, "UpdateFlags") - frame:RegisterNormalEvent("RAID_ROSTER_UPDATE", self, "UpdateFlags") - - frame:RegisterUpdateFunc(self, "UpdateFlags") frame:RegisterUpdateFunc(self, "ForceUpdate") end function Range:OnLayoutApplied(frame) - if( frame.visibility.range ) then - frame.range.hostileSpell = ShadowUF.db.profile.range["hostile" .. playerClass] or self.hostile[playerClass] - frame.range.friendlySpell = ShadowUF.db.profile.range["friendly" .. playerClass] or self.friendly[playerClass] - end + hostileSpell = ShadowUF.db.profile.range["hostile" .. playerClass] or self.hostile[playerClass] + friendlySpell = ShadowUF.db.profile.range["friendly" .. playerClass] or self.friendly[playerClass] end function Range:OnDisable(frame) @@ -68,21 +61,3 @@ function Range:OnDisable(frame) frame:SetRangeAlpha(1.0) end end - --- I'd rather store the flags here, they rarely change and we can do that based off events, no sense in doing it eveyr 0.50s -function Range:UpdateFlags(frame) - frame.range.canAttack = UnitCanAttack("player", frame.unit) - frame.range.isFriendly = UnitIsFriend("player", frame.unit) and UnitCanAssist("player", frame.unit) - frame.range.grouped = UnitInRaid(frame.unit) or UnitInParty(frame.unit) - frame.range.spell = frame.range.canAttack and frame.range.hostileSpell or frame.range.isFriendly and frame.range.friendlySpell or nil - - -- No sense in updating range if we have no data - if( UnitIsGhost(frame.unit) or not UnitIsConnected(frame.unit) or ( not frame.range.spell and not frame.range.grouped and not frame.range.isFriendly ) ) then - frame:SetRangeAlpha(ShadowUF.db.profile.units[frame.unitType].range.inAlpha) - frame.range:Hide() - else - frame.range:Show() - end -end - - From 35a7a4526e081bf7a085a5d9e9c9878c4f5fd817 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 28 Dec 2010 13:47:03 +0100 Subject: [PATCH 077/794] Update the alt. power bar when showing it. --- modules/altpower.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index ae74ee25..c9aa4054 100644 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -11,7 +11,6 @@ function AltPower:OnEnable(frame) frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", self, "UpdateVisibility") frame:RegisterUnitEvent("UNIT_POWER_BAR_HIDE", self, "UpdateVisibility") - frame:RegisterUpdateFunc(self, "Update") frame:RegisterUpdateFunc(self, "UpdateVisibility") end @@ -28,11 +27,13 @@ end function AltPower:UpdateVisibility(frame) local barType, minPower, _, _, _, hideFromOthers = UnitAlternatePowerInfo(frame.unit) - local visible = barType and not hideFromOthers + local visible = barType and (frame.unit == "player" or not hideFromOthers) ShadowUF.Layout:SetBarVisibility(frame, "altPowerBar", visible) + AltPower:Update(frame, nil, nil, "ALTERNATE") end -function AltPower:Update(frame) +function AltPower:Update(frame, event, unit, type) + if( type ~= "ALTERNATE" ) then return end local cur = UnitPower(frame.unit, ALTERNATE_POWER_INDEX) local max = UnitPowerMax(frame.unit, ALTERNATE_POWER_INDEX) local barType, min = UnitAlternatePowerInfo(frame.unit) From a3f150cb1b9b92eac25186ce0208bbb367dbd66f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 28 Dec 2010 13:47:26 +0100 Subject: [PATCH 078/794] Add a hide option for the player alt. power bar (off by default). --- ShadowedUnitFrames.lua | 11 +++++++++-- options/config.lua | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 5e1403f0..120e3e1f 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -37,7 +37,7 @@ function ShadowUF:OnInitialize() range = {}, filters = {zonewhite = {}, zoneblack = {}, whitelists = {}, blacklists = {}}, visibility = {arena = {}, pvp = {}, party = {}, raid = {}}, - hidden = {cast = false, runes = true, buffs = false, party = true, raid = false, player = true, pet = true, target = true, focus = true, boss = true, arena = true}, + hidden = {cast = false, runes = true, buffs = false, party = true, raid = false, player = true, pet = true, target = true, focus = true, boss = true, arena = true, playerAltPower = false}, }, } @@ -591,11 +591,18 @@ function ShadowUF:HideBlizzardFrames() _G[name .. "ManaBar"]:UnregisterAllEvents() end end - + if( ShadowUF.db.profile.hidden.arena ) then Arena_LoadUI = self.noop end + if( ShadowUF.db.profile.hidden.playerAltPower ) then + PlayerPowerBarAlt:UnregisterEvent("UNIT_POWER_BAR_SHOW") + PlayerPowerBarAlt:UnregisterEvent("UNIT_POWER_BAR_HIDE") + PlayerPowerBarAlt:UnregisterEvent("PLAYER_ENTERING_WORLD") + PlayerPowerBarAlt:Hide() + end + -- fix LFD Cooldown Frame -- this is technically not our problem, but due to having the frames on the same strata, it looks like this to the users -- and the fix is simple enough diff --git a/options/config.lua b/options/config.lua index 3fe1a7c8..59e65668 100644 --- a/options/config.lua +++ b/options/config.lua @@ -1331,7 +1331,7 @@ local function loadHideOptions() type = "toggle", name = function(info) local key = info[#(info)] - return L.units[key] and string.format(L["Hide %s frames"], string.lower(L.units[key])) or string.format(L["Hide %s"], key == "cast" and L["player cast bar"] or key == "runes" and L["rune bar"] or key == "buffs" and L["buff frames"]) + return L.units[key] and string.format(L["Hide %s frames"], string.lower(L.units[key])) or string.format(L["Hide %s"], key == "cast" and L["player cast bar"] or key == "runes" and L["rune bar"] or key == "buffs" and L["buff frames"] or key == "playerAltPower" and L["player alt. power"]) end, set = function(info, value) set(info, value) @@ -1377,6 +1377,7 @@ local function loadHideOptions() focus = Config.hideTable, boss = Config.hideTable, arena = Config.hideTable, + playerAltPower = Config.hideTable, }, }, } From 220d031349816600583c3e80bfafa662eb412f9b Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 30 Jan 2011 18:14:58 +0100 Subject: [PATCH 079/794] In levelcolor tag, show ?? for friendly targets with unknown level instead of -1 --- modules/tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tags.lua b/modules/tags.lua index 115bf33b..a88d193f 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -589,7 +589,7 @@ Tags.defaultTags = { return color .. (level > 0 and level or "??") .. "|r" else - return level + return level > 0 and level or "??" end end]], ["faction"] = [[function(unit, unitOwner) return UnitFactionGroup(unitOwner) end]], From cd8be9c2b00cfaaeffd9f8b9bb1e5ba6b1b5b54d Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 9 Feb 2011 17:02:33 +0100 Subject: [PATCH 080/794] Allow the boss frames being shown in 5man instances as well as raids. --- ShadowedUnitFrames.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 120e3e1f..73cbc312 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -211,7 +211,11 @@ function ShadowUF:LoadUnits() for _, type in pairs(self.unitList) do local enabled = self.db.profile.units[type].enabled if( ShadowUF.Units.zoneUnits[type] and enabled ) then - enabled = ShadowUF.Units.zoneUnits[type] == instanceType + if( type == "boss" ) then + enabled = (instanceType == "raid" or instanceType == "party") + else + enabled = ShadowUF.Units.zoneUnits[type] == instanceType + end elseif( instanceType ~= "none" ) then if( self.db.profile.visibility[instanceType][type] == false ) then enabled = false From b1f1ee89e5a84245d4df4c92830d95432c741cf4 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 19 Feb 2011 16:25:19 +0100 Subject: [PATCH 081/794] Use Rejuvenation for Druid Friendly Range checking. --- modules/range.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/range.lua b/modules/range.lua index 88016441..1023e1db 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -1,5 +1,5 @@ local Range = { - friendly = {["PRIEST"] = GetSpellInfo(2061), ["DRUID"] = GetSpellInfo(5185), ["PALADIN"] = GetSpellInfo(635), ["SHAMAN"] = GetSpellInfo(331)}, + friendly = {["PRIEST"] = GetSpellInfo(2061), ["DRUID"] = GetSpellInfo(774), ["PALADIN"] = GetSpellInfo(635), ["SHAMAN"] = GetSpellInfo(331)}, hostile = {["PRIEST"] = GetSpellInfo(585), ["DRUID"] = GetSpellInfo(5176), ["PALADIN"] = GetSpellInfo(62124), ["HUNTER"] = GetSpellInfo(75), ["WARLOCK"] = GetSpellInfo(686), ["SHAMAN"] = GetSpellInfo(403), ["MAGE"] = GetSpellInfo(133), ["DEATHKNIGHT"] = GetSpellInfo(49576)}, } ShadowUF:RegisterModule(Range, "range", ShadowUF.L["Range indicator"]) From 81d650391939238264950812b53b80c9e9d8c752 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 20 Mar 2011 12:43:33 +0100 Subject: [PATCH 082/794] Fix hiding of the compact party frame with 4.1 --- ShadowedUnitFrames.lua | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 73cbc312..b03f0a40 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -464,6 +464,18 @@ function ShadowUF:ProfilesChanged() self.modules.movers:Update() end +local function hideCompactParty() + CompactPartyFrame:UnregisterAllEvents() + CompactPartyFrame.Show = self.noop + CompactPartyFrame:Hide() + + for i=1, MEMBERS_PER_RAID_GROUP do + local name = "CompactPartyFrameMember" .. i + local frame = _G[name] + frame:UnregisterAllEvents() + end +end + -- Stolen from haste ShadowUF.noop = function() end function ShadowUF:HideBlizzardFrames() @@ -494,14 +506,10 @@ function ShadowUF:HideBlizzardFrames() _G[name .. "ManaBar"]:UnregisterAllEvents() end - CompactPartyFrame:UnregisterAllEvents() - CompactPartyFrame.Show = self.noop - CompactPartyFrame:Hide() - - for i=1, MEMBERS_PER_RAID_GROUP do - local name = "CompactPartyFrameMember" .. i - local frame = _G[name] - frame:UnregisterAllEvents() + if CompactPartyFrame then + hideCompactParty() + elseif CompactPartyFrame_Generate then -- 4.1 + hooksecurefunc("CompactPartyFrame_Generate", hideCompactParty) end end From 145b5eeb58ed32bf1d900d4e5f8400262790f09b Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 20 Mar 2011 14:20:43 +0100 Subject: [PATCH 083/794] Fix error in compactparty hide code. --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index b03f0a40..7cbb5066 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -466,7 +466,7 @@ end local function hideCompactParty() CompactPartyFrame:UnregisterAllEvents() - CompactPartyFrame.Show = self.noop + CompactPartyFrame.Show = ShadowUF.noop CompactPartyFrame:Hide() for i=1, MEMBERS_PER_RAID_GROUP do From 9841d3298c928b9ba43936670d38887f6511ad66 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 27 Apr 2011 16:52:12 +0200 Subject: [PATCH 084/794] Update .toc --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index fab6b114..96cf01b2 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,4 +1,4 @@ -## Interface: 40000 +## Interface: 40100 ## Title: Shadowed Unit Frames ## Notes: An apple a day keeps the raptor away, or so they say. ## Author: Shadowed From c95336f6f80c5a5111a58d2b14ba30069485c282 Mon Sep 17 00:00:00 2001 From: Zachary Anker Date: Tue, 28 Jun 2011 15:55:22 -0700 Subject: [PATCH 085/794] TOC bump 40200 --- ShadowedUnitFrames.toc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 96cf01b2..b2786b62 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ -## Interface: 40100 +## Interface: 40200 ## Title: Shadowed Unit Frames -## Notes: An apple a day keeps the raptor away, or so they say. +## Notes: If an apple a day keeps the raptor away, what does an orange prevent? ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB From 97eb19aa88261c2404710525d019be23988fda39 Mon Sep 17 00:00:00 2001 From: Zachary Anker Date: Tue, 28 Jun 2011 15:59:08 -0700 Subject: [PATCH 086/794] Removed pet happiness --- ShadowedUnitFrames.lua | 1 - modules/defaultlayout.lua | 2 -- modules/health.lua | 9 --------- modules/indicators.lua | 32 +------------------------------- modules/movers.lua | 1 - modules/tags.lua | 1 - options/config.lua | 21 ++------------------- 7 files changed, 3 insertions(+), 64 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 7cbb5066..b2ea1c03 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -310,7 +310,6 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} -- PET self.defaults.profile.units.pet.enabled = true - self.defaults.profile.units.pet.indicators.happiness = {enabled = true, size = 16, anchorPoint = "BR", anchorTo = "$parent", x = 2, y = -2} self.defaults.profile.units.pet.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} self.defaults.profile.units.pet.xpBar = {enabled = false} -- FOCUS diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 2f3601d4..6ddb9503 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -139,7 +139,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) RAGE = {r = 0.90, g = 0.20, b = 0.30}, FOCUS = {r = 1.0, g = 0.50, b = 0.25}, ENERGY = {r = 1.0, g = 0.85, b = 0.10}, - HAPPINESS = {r = 0.50, g = 0.90, b = 0.70}, RUNES = {r = 0.50, g = 0.50, b = 0.50}, RUNIC_POWER = {b = 0.60, g = 0.45, r = 0.35}, ECLIPSE_SUN = {r = 1.0, g = 1.0, b = 0.0}, @@ -571,7 +570,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, indicators = { - happiness = {enabled = false, anchorTo = "$parent", anchorPoint = "BR", size = 14, x = 3, y = 13}, }, text = { {text = "[name]"}, diff --git a/modules/health.lua b/modules/health.lua index 176147e4..c0b7d23f 100644 --- a/modules/health.lua +++ b/modules/health.lua @@ -102,15 +102,6 @@ function Health:UpdateColor(frame) color = ShadowUF.db.profile.classColors.VEHICLE elseif( not UnitIsTappedByPlayer(unit) and UnitIsTapped(unit) and UnitCanAttack("player", unit) ) then color = ShadowUF.db.profile.healthColors.tapped - elseif( unit == "pet" and reactionType == "happiness" and GetPetHappiness() ) then - local happiness = GetPetHappiness() - if( happiness == 3 ) then - color = ShadowUF.db.profile.healthColors.friendly - elseif( happiness == 2 ) then - color = ShadowUF.db.profile.healthColors.neutral - elseif( happiness == 1 ) then - color = ShadowUF.db.profile.healthColors.hostile - end elseif( not UnitPlayerOrPetInRaid(unit) and not UnitPlayerOrPetInParty(unit) and ( ( ( reactionType == "player" or reactionType == "both" ) and UnitIsPlayer(unit) and not UnitIsFriend(unit, "player") ) or ( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(unit) ) ) ) then if( not UnitIsFriend(unit, "player") and UnitPlayerControlled(unit) ) then if( UnitCanAttack("player", unit) ) then diff --git a/modules/indicators.lua b/modules/indicators.lua index 5299ddff..5455b79c 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -1,4 +1,4 @@ -local Indicators = {list = {"status", "pvp", "leader", "masterLoot", "raidTarget", "happiness", "ready", "role", "lfdRole", "class"}} +local Indicators = {list = {"status", "pvp", "leader", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class"}} local leavingWorld ShadowUF:RegisterModule(Indicators, "indicators", ShadowUF.L["Indicators"]) @@ -17,28 +17,6 @@ function Indicators:UpdateClass(frame) end end -function Indicators:UpdateHappiness(frame, event, unit, power) - if( power ~= "HAPPINESS" or not frame.indicators.happiness or not frame.indicators.happiness.enabled ) then return end - - local happiness = GetPetHappiness() - -- No pet - if( not happiness ) then - frame.indicators.happiness:Hide() - -- Happy! - elseif( happiness == 3 ) then - frame.indicators.happiness:SetTexCoord(0, 0.1875, 0, 0.359375) - frame.indicators.happiness:Show() - -- Content :| - elseif( happiness == 2 ) then - frame.indicators.happiness:SetTexCoord(0.1875, 0.375, 0, 0.359375) - frame.indicators.happiness:Show() - -- Unhappy :( - elseif( happiness == 1 ) then - frame.indicators.happiness:SetTexCoord(0.375, 0.5625, 0, 0.359375) - frame.indicators.happiness:Show() - end -end - function Indicators:UpdateMasterLoot(frame) if( not frame.indicators.masterLoot or not frame.indicators.masterLoot.enabled ) then return end @@ -337,15 +315,7 @@ function Indicators:OnEnable(frame) frame.indicators.ready = frame.indicators.ready or frame.indicators:CreateTexture(nil, "OVERLAY") end - - if( config.indicators.happiness and config.indicators.happiness.enabled ) then - frame:RegisterUnitEvent("UNIT_POWER", self, "UpdateHappiness") - frame:RegisterUpdateFunc(self, "UpdateHappiness") - frame.indicators.happiness = frame.indicators.happiness or frame.indicators:CreateTexture(nil, "OVERLAY") - frame.indicators.happiness:SetTexture("Interface\\PetPaperDollFrame\\UI-PetHappiness") - end - if( config.indicators.lfdRole and config.indicators.lfdRole.enabled ) then if( frame.unit == "player" ) then frame:RegisterNormalEvent("PLAYER_ROLES_ASSIGNED", self, "UpdateLFDRole") diff --git a/modules/movers.lua b/modules/movers.lua index 40281961..737973f0 100644 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -22,7 +22,6 @@ local function createConfigEnv() GetRaidTargetIndex = function(unit) return getValue("GetRaidTargetIndex", unit, math.random(1, 8)) end, GetLootMethod = function(unit) return "master", 0, 0 end, GetComboPoints = function() return MAX_COMBO_POINTS end, - GetPetHappiness = function() return getValue("GetPetHappiness", "pet", math.random(1, 3)) end, UnitInRaid = function() return true end, UnitInParty = function() return true end, UnitIsUnit = function(unitA, unitB) return unitB == "player" and true or false end, diff --git a/modules/tags.lua b/modules/tags.lua index a88d193f..c1941dba 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1171,7 +1171,6 @@ local function loadAPIEvents() ["GetNumPartyMembers"] = "PARTY_MEMBERS_CHANGED", ["GetNumRaidMembers"] = "RAID_ROSTER_UPDATE", ["GetRaidRosterInfo"] = "RAID_ROSTER_UPDATE", - ["GetPetHappiness"] = "UNIT_POWER", ["GetReadyCheckStatus"] = "READY_CHECK READY_CHECK_CONFIRM READY_CHECK_FINISHED", ["GetLootMethod"] = "PARTY_LOOT_METHOD_CHANGED", ["GetThreatStatusColor"] = "UNIT_THREAT_SITUATION_UPDATE", diff --git a/options/config.lua b/options/config.lua index 59e65668..772baf59 100644 --- a/options/config.lua +++ b/options/config.lua @@ -36,9 +36,9 @@ local PAGE_DESC = { ["tags"] = L["Advanced tag management, allows you to add your own custom tags."], ["filter"] = L["Simple aura filtering by whitelists and blacklists."], } -local INDICATOR_NAMES = {["happiness"] = L["Happiness"], ["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon role"], ["masterLoot"] = L["Master looter"], ["pvp"] = L["PvP Flag"],["raidTarget"] = L["Raid target"], ["ready"] = L["Ready status"], ["role"] = L["Raid role"], ["status"] = L["Combat status"], ["class"] = L["Class icon"]} +local INDICATOR_NAMES = {["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon role"], ["masterLoot"] = L["Master looter"], ["pvp"] = L["PvP Flag"],["raidTarget"] = L["Raid target"], ["ready"] = L["Ready status"], ["role"] = L["Raid role"], ["status"] = L["Combat status"], ["class"] = L["Class icon"]} local AREA_NAMES = {["arena"] = L["Arenas"],["none"] = L["Everywhere else"], ["party"] = L["Party instances"], ["pvp"] = L["Battlegrounds"], ["raid"] = L["Raid instances"],} -local INDICATOR_DESC = {["happiness"] = L["Indicator for your pet's happiness, only applies to Hunters."], +local INDICATOR_DESC = { ["leader"] = L["Crown indicator for group leaders."], ["lfdRole"] = L["Role the unit is playing in dungeons formed through the Looking For Dungeon system."], ["masterLoot"] = L["Bag indicator for master looters."], ["pvp"] = L["PVP flag indicator, Horde for Horde flagged pvpers and Alliance for Alliance flagged pvpers."], ["raidTarget"] = L["Raid target indicator."], ["ready"] = L["Ready status of group members."], @@ -1072,13 +1072,6 @@ local function loadGeneralOptions() arg = "powerColors.ENERGY", width = "half", }, - HAPPINESS = { - order = 5, - type = "color", - name = L["Happiness"], - hasAlpha = true, - arg = "powerColors.HAPPINESS", - }, RUNIC_POWER = { order = 6, type = "color", @@ -3345,16 +3338,6 @@ local function loadUnitOptions() values = {["class"] = L["Class"], ["static"] = L["Static"], ["percent"] = L["Health percent"]}, arg = "healthBar.colorType", }, - reactionPet = { - order = 5, - type = "toggle", - name = L["Color by happiness"], - desc = L["Colors the health bar by how happy your pet is."], - arg = "healthBar.reactionType", - set = function(info, value) setVariable(info[2], "healthBar", nil, "reactionType", value and "happiness" or "none") end, - get = function(info) return getVariable(info[2], "healthBar", nil, "reactionType") == "happiness" and true or false end, - hidden = function(info) return info[2] ~= "pet" end, - }, reaction = { order = 5, type = "select", From 98803128104fe371ab72dee2ff0935116f188a16 Mon Sep 17 00:00:00 2001 From: Zachary Anker Date: Tue, 28 Jun 2011 16:00:11 -0700 Subject: [PATCH 087/794] TOC bump SUF Options to 40200 --- options/ShadowedUF_Options.toc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index 08fcfc8b..db41ba72 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 40000 +## Interface: 40200 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed @@ -12,4 +12,4 @@ libs\AceGUI-3.0-SharedMediaWidgets\widget.xml libs\AceConfig-3.0\AceConfig-3.0.xml #@end-no-lib-strip@ -config.lua \ No newline at end of file +config.lua From dce14d5be60ea095106d38ea56309ed29e161431 Mon Sep 17 00:00:00 2001 From: Zachary Anker Date: Mon, 25 Jul 2011 21:09:21 -0700 Subject: [PATCH 088/794] Remove the Show = noop change for compact raid frames as it taints now, and that's bad. --- ShadowedUnitFrames.lua | 4 ++-- options/config.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index b2ea1c03..da294643 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -520,11 +520,11 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.raid ) then if CompactRaidFrameContainer then CompactRaidFrameContainer:Hide() - CompactRaidFrameContainer.Show = self.noop + -- CompactRaidFrameContainer.Show = self.noop CompactRaidFrameContainer:UnregisterAllEvents() CompactRaidFrameManager:Hide() - CompactRaidFrameManager.Show = self.noop + -- CompactRaidFrameManager.Show = self.noop CompactRaidFrameManager:UnregisterAllEvents() end end diff --git a/options/config.lua b/options/config.lua index 772baf59..4110ae2d 100644 --- a/options/config.lua +++ b/options/config.lua @@ -1363,7 +1363,7 @@ local function loadHideOptions() cast = Config.hideTable, runes = Config.hideTable, party = Config.hideTable, - raid = Config.hideTable, + -- raid = Config.hideTable, player = Config.hideTable, pet = Config.hideTable, target = Config.hideTable, From ad9ea51632746554714a78942683ce63018a4519 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 18 Sep 2011 22:27:30 -0700 Subject: [PATCH 089/794] No update is complete without TOC shenanigans --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index b2786b62..4721b414 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ ## Interface: 40200 ## Title: Shadowed Unit Frames -## Notes: If an apple a day keeps the raptor away, what does an orange prevent? +## Notes: This update sponsored by The Book of the New Sun. ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB From 9a813efae0a6306da6e6deb83e1b39679afd5c6f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 18 Sep 2011 22:28:32 -0700 Subject: [PATCH 090/794] Remove config upgrade code, if someone hasn't upgraded by now then it sucks to be them --- ShadowedUnitFrames.lua | 124 ++--------------------------------------- 1 file changed, 5 insertions(+), 119 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index da294643..9e8ac6b6 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -83,125 +83,11 @@ function ShadowUF:OnInitialize() end function ShadowUF:CheckUpgrade() - local revision = self.db.profile.revision or 1 - - local loadDefault = false - - -- February 16th - if( not self.db.profile.units.raidpet.enabled and self.db.profile.units.raidpet.height == 0 and self.db.profile.units.raidpet.width == 0 and self.db.profile.positions.raidpet.anchorPoint == "" and self.db.profile.positions.raidpet.point == "" ) then - loadDefault = true - end - - self.db.profile.units.party.unitsPerColumn = self.db.profile.units.party.unitsPerColumn or 5 - self.db.profile.units.raid.groupsPerRow = self.db.profile.units.raid.groupsPerRow or 8 - - local castName = {enabled = true, size = 0, anchorTo = "$parent", rank = true, anchorPoint = "CLI", x = 1, y = 0} - local castTime = {enabled = true, size = 0, anchorTo = "$parent", anchorPoint = "CRI", x = -1, y = 0} - - for unit, config in pairs(self.db.profile.units) do - config.portrait = config.portrait or {} - config.portrait.type = config.portrait.type or "3D" - config.portrait.fullBefore = config.portrait.fullBefore or 0 - config.portrait.fullAfter = config.portrait.fullAfter or 100 - config.portrait.order = config.portrait.order or 40 - config.portrait.height = config.portrait.height or 0.50 - - config.highlight.size = config.highlight.size or 10 - - config.castBar = config.castBar or {} - config.castBar.icon = config.castBar.icon or "HIDE" - config.castBar.height = config.castBar.height or 0.60 - config.castBar.order = config.castBar.order or 40 - - config.castBar.name = config.castBar.name or {} - config.castBar.time = config.castBar.time or {} - - for key, value in pairs(castName) do - if( config.castBar.name[key] == nil ) then - config.castBar.name[key] = value - end - end - - for key, value in pairs(castTime) do - if( config.castBar.time[key] == nil ) then - config.castBar.time[key] = value - end - end - end - - -- April 29th - if( self.db.profile.filters.zones ) then - for unit, filter in pairs(self.db.profile.filters.zones) do - if( self.db.profile.filters.whitelists[filter] ) then - self.db.profile.filters.zonewhite[unit] = filter - else - self.db.profile.filters.zoneblack[unit] = filter - end - end - end - - -- June 19th - if( not self.db.profile.font.color ) then - self.db.profile.font.color = {r = 1, g = 1, b = 1, a = 1} - for unit, config in pairs(self.db.profile.units) do - local indicators = self.db.profile.units[unit].indicators - if( indicators and indicators.class ) then - indicators.class.anchorTo = "$parent" - indicators.class.anchorPoint = "BL" - indicators.class.x = 0 - indicators.class.y = 0 - end - end - end - - -- July 1st - if( revision <= 1 ) then - self.db.profile.units.player.fader.combatAlpha = self.db.profile.units.player.fader.combatAlpha or 1.0 - self.db.profile.units.player.fader.inactiveAlpha = self.db.profile.units.player.fader.inactiveAlpha or 0.6 - self.db.profile.units.target.comboPoints.height = self.db.profile.units.target.comboPoints.height or 0.40 - self.db.profile.units.player.eclipseBar = {enabled = true, background = true, height = 0.40, order = 70} - self.db.profile.units.player.soulShards = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -8, y = 2, size = 12, height = 0.40, spacing = -2, growth = "LEFT", isBar = true} - - loadDefault = true - end - - -- October 15th - if( revision <= 2 ) then - self.db.profile.powerColors.ECLIPSE_SUN = {r = 1.0, g = 1.0, b = 0.00} - self.db.profile.powerColors.ECLIPSE_MOON = {r = 0.30, g = 0.52, b = 0.90} - if self.db.profile.units.player.soulShards then - self.db.profile.units.player.soulShards.height = self.db.profile.units.player.soulShards.height or 0.40 - self.db.profile.units.player.soulShards.enabled = true - end - self.db.profile.units.player.holyPower = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 6, size = 14, height = 0.40, spacing = -4, growth = "LEFT", isBar = true} - - loadDefault = true - end - - -- November 16th - if( revision <= 3 ) then - self.db.profile.units.target.comboPoints.order = self.db.profile.units.target.comboPoints.order or 60 - self.db.profile.units.target.comboPoints.anchorTo = self.db.profile.units.target.comboPoints.anchorTo or "$parent" - - self.db.profile.units.player.soulShards.height = self.db.profile.units.player.soulShards.height or 0.40 - self.db.profile.units.player.holyPower.height = self.db.profile.units.player.holyPower.height or 0.40 - - self.db.profile.units.raid.indicators.lfdRole = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = 14, anchorTo = "$parent"} - - loadDefault = true - end - - if( revision <= 4 ) then - self.db.profile.powerColors.ALTERNATE = {r = 0.71, g = 0.0, b = 1.0} - for unit, config in pairs(self.db.profile.units) do - config.altPowerBar = {enabled = false, background = true, height = 0.40, order = 100} - end - self.db.profile.units.boss.altPowerBar.enabled = true - end - - if loadDefault then - self:LoadDefaultLayout(true) - end + -- local revision = self.db.profile.revision or 1 + -- local loadDefault = false + -- if loadDefault then + -- self:LoadDefaultLayout(true) + -- end end function ShadowUF:LoadUnits() From b0c35e879b3f913e24be24f9410c598803618e17 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 18 Sep 2011 23:22:33 -0700 Subject: [PATCH 091/794] Added Mushroom bar for Druids --- modules/totems.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/totems.lua b/modules/totems.lua index 23e57305..b11d7a4c 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -6,6 +6,9 @@ local MAX_TOTEMS = MAX_TOTEMS if( select(2, UnitClass("player")) == "DEATHKNIGHT" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Guardian bar"], true, "DEATHKNIGHT") +elseif( select(2, UnitClass("player")) == "DRUID" ) then + MAX_TOTEMS = 3 + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Mushroom bar"], true, "DRUID") else ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Totem bar"], true, "SHAMAN") end From bb0a6df0d2e43331cfee41589b166602ae891330 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 18 Sep 2011 23:33:32 -0700 Subject: [PATCH 092/794] Syntax --- ShadowedUnitFrames.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 9e8ac6b6..583a9834 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -430,10 +430,10 @@ function ShadowUF:HideBlizzardFrames() PlayerFrame.Show = self.noop PlayerFrame:Hide() - PlayerFrame:RegisterEvent('UNIT_ENTERING_VEHICLE') - PlayerFrame:RegisterEvent('UNIT_ENTERED_VEHICLE') - PlayerFrame:RegisterEvent('UNIT_EXITING_VEHICLE') - PlayerFrame:RegisterEvent('UNIT_EXITED_VEHICLE') + PlayerFrame:RegisterEvent("UNIT_ENTERING_VEHICLE") + PlayerFrame:RegisterEvent("UNIT_ENTERED_VEHICLE") + PlayerFrame:RegisterEvent("UNIT_EXITING_VEHICLE") + PlayerFrame:RegisterEvent("UNIT_EXITED_VEHICLE") PlayerFrameHealthBar:UnregisterAllEvents() PlayerFrameManaBar:UnregisterAllEvents() From 376d540fb801c935a6e0e369c54aab5bad6604a6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 18 Sep 2011 23:42:29 -0700 Subject: [PATCH 093/794] Reenable hide raid frames, redid hide raid frames code too to make it work without tainting hopefully --- ShadowedUnitFrames.lua | 29 +++++++++++++++++++---------- options/config.lua | 2 +- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 583a9834..40fbd78e 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -399,20 +399,29 @@ function ShadowUF:HideBlizzardFrames() end -- this doesn't really belong here, but oh well! - if CompactRaidFrameManager then + if( CompactRaidFrameManager ) then CompactRaidFrameManager:SetFrameStrata("DIALOG") end if( ShadowUF.db.profile.hidden.raid ) then - if CompactRaidFrameContainer then - CompactRaidFrameContainer:Hide() - -- CompactRaidFrameContainer.Show = self.noop - CompactRaidFrameContainer:UnregisterAllEvents() - - CompactRaidFrameManager:Hide() - -- CompactRaidFrameManager.Show = self.noop - CompactRaidFrameManager:UnregisterAllEvents() - end + function hide_raid() + CompactRaidFrameManager:UnregisterEvent("RAID_ROSTER_UPDATE") + CompactRaidFrameManager:UnregisterEvent("PLAYER_ENTERING_WORLD") + CompactRaidFrameManager:Hide() + + shown = CompactRaidFrameManager_GetSetting("IsShown") + if( shown and shown ~= "0" ) then + CompactRaidFrameManager_SetSetting("IsShown", "0") + end + end + + hooksecurefunc("CompactRaidFrameManager_UpdateShown", function() + if( ShadowUF.db.profile.hidden.raid ) then + hide_raid(); + end + end) + + hide_raid(); end if( ShadowUF.db.profile.hidden.buffs ) then diff --git a/options/config.lua b/options/config.lua index 4110ae2d..fa7eca3c 100644 --- a/options/config.lua +++ b/options/config.lua @@ -1363,7 +1363,7 @@ local function loadHideOptions() cast = Config.hideTable, runes = Config.hideTable, party = Config.hideTable, - -- raid = Config.hideTable, + raid = Config.hideTable, player = Config.hideTable, pet = Config.hideTable, target = Config.hideTable, From a954e3198de520badd6785ffc6c849ccd130ff11 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 18 Sep 2011 23:52:35 -0700 Subject: [PATCH 094/794] Leaked globals --- ShadowedUnitFrames.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 40fbd78e..d8ca3d1b 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -404,12 +404,12 @@ function ShadowUF:HideBlizzardFrames() end if( ShadowUF.db.profile.hidden.raid ) then - function hide_raid() + local function hide_raid() CompactRaidFrameManager:UnregisterEvent("RAID_ROSTER_UPDATE") CompactRaidFrameManager:UnregisterEvent("PLAYER_ENTERING_WORLD") CompactRaidFrameManager:Hide() - shown = CompactRaidFrameManager_GetSetting("IsShown") + local shown = CompactRaidFrameManager_GetSetting("IsShown") if( shown and shown ~= "0" ) then CompactRaidFrameManager_SetSetting("IsShown", "0") end From 6351d7fd123f7fc944c500cbef0b5e8b9f101209 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 19 Sep 2011 19:28:13 -0700 Subject: [PATCH 095/794] Added Monochrome as an outline option --- options/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index fa7eca3c..77944b6d 100644 --- a/options/config.lua +++ b/options/config.lua @@ -857,7 +857,7 @@ local function loadGeneralOptions() order = 3, type = "select", name = L["Outline"], - values = {["OUTLINE"] = L["Thin outline"], ["THICKOUTLINE"] = L["Thick outline"], [""] = L["None"]}, + values = {["MONOCHROME"] = L["Monochrome"], ["OUTLINE"] = L["Thin outline"], ["THICKOUTLINE"] = L["Thick outline"], [""] = L["None"]}, arg = "font.extra", hidden = hideAdvancedOption, }, From 78654c24be8a01b75e799046804d9c4bb5f484f3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 19 Sep 2011 19:44:56 -0700 Subject: [PATCH 096/794] Small syntax cleanup Changed health frequent updates to use the event Updated power module to update on hide and show events --- ShadowedUnitFrames.lua | 6 ++--- modules/auras.lua | 4 +--- modules/health.lua | 52 +++++++++++++++++++----------------------- modules/power.lua | 2 ++ 4 files changed, 30 insertions(+), 34 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index d8ca3d1b..a205a280 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -391,10 +391,10 @@ function ShadowUF:HideBlizzardFrames() _G[name .. "ManaBar"]:UnregisterAllEvents() end - if CompactPartyFrame then + if( CompactPartyFrame ) then hideCompactParty() - elseif CompactPartyFrame_Generate then -- 4.1 - hooksecurefunc("CompactPartyFrame_Generate", hideCompactParty) + elseif( CompactPartyFrame_Generate ) then + hooksecurefunc("CompactPartyFrame_Generate", hideCompactParty) end end diff --git a/modules/auras.lua b/modules/auras.lua index 29f0c719..5256f433 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -78,7 +78,7 @@ local function positionButton(id, group, config) button.isAuraAnchor = nil -- Alright, in order to find out where an aura group is going to be anchored to certain buttons need - -- to be flagged as suitable anchors visually, this speeds it up bcause this data is cached and doesn't + -- to be flagged as suitable anchors visually, this speeds it up because this data is cached and doesn't -- have to be recalculated unless auras are specifically changed if( id > 1 ) then if( position.isSideGrowth and id <= config.perRow ) then @@ -154,7 +154,6 @@ local function positionAllButtons(group, config) offset = offset + 1 end - --print(columnID, math.ceil(offset)) position.column(button, anchorButton, math.ceil(offset)) else position.aura(button, group.buttons[id - 1]) @@ -168,7 +167,6 @@ local function positionAllButtons(group, config) offset = offset + 2 end - --print(1, offset) position.initialAnchor(button, offset) end end diff --git a/modules/health.lua b/modules/health.lua index c0b7d23f..ff82de49 100644 --- a/modules/health.lua +++ b/modules/health.lua @@ -24,31 +24,6 @@ end Health.getGradientColor = getGradientColor --- Not doing full health update, because other checks can lag behind without much issue -local function updateTimer(self) - local currentHealth = UnitHealth(self.parent.unit) - if( currentHealth == self.currentHealth ) then return end - self.currentHealth = currentHealth - self:SetValue(currentHealth) - - -- As much as I would rather not have to do this in an OnUpdate, I don't have much choice large health changes in a single update will make them very clearly be lagging behind - for _, fontString in pairs(self.parent.fontStrings) do - if( fontString.fastHealth ) then - fontString:UpdateTags() - end - end - - -- Update incoming heal number - if( self.parent.incHeal and self.parent.incHeal.healed ) then - self.parent.incHeal:SetValue(currentHealth + self.parent.incHeal.healed) - end - - -- The target is not offline, and we have a health percentage so update the gradient - if( not self.parent.healthBar.wasOffline and self.parent.healthBar.hasPercent ) then - self.parent:SetBarColor("healthBar", ShadowUF.db.profile.units[self.parent.unitType].healthBar.invert, getGradientColor(self.parent.unit)) - end -end - function Health:OnEnable(frame) if( not frame.healthBar ) then frame.healthBar = ShadowUF.Units:CreateBar(frame) @@ -72,10 +47,9 @@ function Health:OnLayoutApplied(frame) if( not frame.visibility.healthBar ) then return end if( ShadowUF.db.profile.units[frame.unitType].healthBar.predicted ) then - frame.healthBar:SetScript("OnUpdate", updateTimer) - frame.healthBar.parent = frame + frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "UpdateFrequent") else - frame.healthBar:SetScript("OnUpdate", nil) + frame:UnregisterEvent("UNIT_HEALTH_FREQUENT", self) end end @@ -134,6 +108,28 @@ function Health:UpdateColor(frame) end end +function Health:UpdateFrequent(frame) + frame.healthBar.currentHealth = UnitHealth(frame.unit) + frame.healthBar:SetValue(frame.healthBar.currentHealth) + + -- As much as I would rather not have to do this in an OnUpdate, I don't have much choice large health changes in a single update will make them very clearly be lagging behind + for _, fontString in pairs(frame.fontStrings) do + if( fontString.fastHealth ) then + fontString:UpdateTags() + end + end + + -- Update incoming heal number + if( frame.incHeal and frame.incHeal.healed ) then + frame.incHeal:SetValue(frame.healthBar.currentHealth + self.parent.incHeal.healed) + end + + -- The target is not offline, and we have a health percentage so update the gradient + if( not frame.healthBar.wasOffline and frame.healthBar.hasPercent ) then + frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, getGradientColor(frame.unit)) + end +end + function Health:Update(frame) local isOffline = not UnitIsConnected(frame.unit) frame.isDead = UnitIsDeadOrGhost(frame.unit) diff --git a/modules/power.lua b/modules/power.lua index 9f125a8a..e45fd23f 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -20,6 +20,8 @@ function Power:OnEnable(frame) frame:RegisterUnitEvent("UNIT_POWER", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") frame:RegisterUnitEvent("UNIT_CONNECTION", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER_BAR_HIDE", self, "Update") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdateColor") frame:RegisterUpdateFunc(self, "UpdateColor") From 3da4b4df99a6661d17e046a82dc2773f1deb3dc9 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 19 Sep 2011 19:48:51 -0700 Subject: [PATCH 097/794] Moved monochrome position because I can --- options/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index 77944b6d..7c184574 100644 --- a/options/config.lua +++ b/options/config.lua @@ -857,7 +857,7 @@ local function loadGeneralOptions() order = 3, type = "select", name = L["Outline"], - values = {["MONOCHROME"] = L["Monochrome"], ["OUTLINE"] = L["Thin outline"], ["THICKOUTLINE"] = L["Thick outline"], [""] = L["None"]}, + values = {["OUTLINE"] = L["Thin outline"], ["THICKOUTLINE"] = L["Thick outline"], ["MONOCHROME"] = L["Monochrome"], [""] = L["None"]}, arg = "font.extra", hidden = hideAdvancedOption, }, From f49739cc670d773c3ce3dda2de4cc77b09731148 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 19 Sep 2011 20:07:36 -0700 Subject: [PATCH 098/794] Added support for Blizzards built in resurrection system as an indicator --- ShadowedUnitFrames.lua | 16 ++++++++++------ modules/defaultlayout.lua | 19 ++++++++++++++++--- modules/indicators.lua | 24 +++++++++++++++++++++--- modules/movers.lua | 1 + options/config.lua | 2 +- 5 files changed, 49 insertions(+), 13 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index a205a280..84a6c60e 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 5 +ShadowUF.dbRevision = 6 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -83,11 +83,15 @@ function ShadowUF:OnInitialize() end function ShadowUF:CheckUpgrade() - -- local revision = self.db.profile.revision or 1 - -- local loadDefault = false - -- if loadDefault then - -- self:LoadDefaultLayout(true) - -- end + local revision = self.db.profile.revision or 1 + if( revision <= 5 ) then + for _, unit in pairs({"player", "focus", "target", "raid", "party", "mainassist", "maintank"}) do + local db = self.db.profile.units[unit] + if( not db.indicators.resurrect ) then + db.indicators.resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + end + end + end end function ShadowUF:LoadUnits() diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 6ddb9503..cccda294 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -258,6 +258,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) masterLoot = {anchorTo = "$parent", anchorPoint = "TR", size = 12, x = -2, y = -10}, role = {enabled = false, anchorTo = "$parent", anchorPoint = "BR", size = 14, x = 0, y = 14}, ready = {anchorTo = "$parent", anchorPoint = "LC", size = 24, x = 25, y = 0}, + resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} }, text = { {text = "[(()afk() )][name]"}, @@ -309,6 +310,9 @@ function ShadowUF:LoadDefaultLayout(useMerge) eclipseBar = {enabled = true, background = true, order = 70, height = 0.40}, soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, + indicators = { + resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + }, auras = { buffs = {enabled = false, maxRows = 1, temporary = playerClass == "ROGUE" or playerClass == "SHAMAN"}, debuffs = {enabled = false, maxRows = 1}, @@ -332,6 +336,9 @@ function ShadowUF:LoadDefaultLayout(useMerge) portrait = {enabled = true, fullAfter = 50}, castBar = {order = 60}, offset = 23, + indicators = { + resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + }, auras = { buffs = {enabled = true, maxRows = 1}, debuffs = {enabled = true, maxRows = 1}, @@ -441,6 +448,9 @@ function ShadowUF:LoadDefaultLayout(useMerge) incHeal = {cap = 1}, portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, + indicators = { + resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + }, auras = { buffs = {enabled = false}, debuffs = {enabled = false}, @@ -482,6 +492,9 @@ function ShadowUF:LoadDefaultLayout(useMerge) incHeal = {cap = 1}, portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, + indicators = { + resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + }, auras = { buffs = {enabled = false}, debuffs = {enabled = false}, @@ -547,7 +560,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) castBar = {order = 60}, comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, indicators = { - lfdRole = {enabled = false} + lfdRole = {enabled = false}, + resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} }, auras = { buffs = {enabled = true}, @@ -569,8 +583,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) healthBar = {reactionType = "none"}, portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, - indicators = { - }, text = { {text = "[name]"}, {text = "[curmaxhp]"}, @@ -603,6 +615,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) castBar = {order = 60}, indicators = { lfdRole = {enabled = false}, + resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} }, text = { {text = "[(()afk() )][name]"}, diff --git a/modules/indicators.lua b/modules/indicators.lua index 5455b79c..2b76dff8 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -1,4 +1,4 @@ -local Indicators = {list = {"status", "pvp", "leader", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class"}} +local Indicators = {list = {"status", "pvp", "leader", "resurrect", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class"}} local leavingWorld ShadowUF:RegisterModule(Indicators, "indicators", ShadowUF.L["Indicators"]) @@ -17,6 +17,16 @@ function Indicators:UpdateClass(frame) end end +function Indicators:UpdateResurrect(frame) + if( not frame.indicators.resurrect or not frame.indicators.resurrect.enabled ) then return end + + if( UnitHasIncomingResurrection(frame.unit) ) then + frame.indicators.resurrect:Show() + else + frame.indicators.resurrect:Hide() + end +end + function Indicators:UpdateMasterLoot(frame) if( not frame.indicators.masterLoot or not frame.indicators.masterLoot.enabled ) then return end @@ -241,7 +251,15 @@ function Indicators:OnEnable(frame) elseif( frame.indicators.status ) then frame.indicators:SetScript("OnUpdate", nil) end - + + if( config.indicators.resurrect and config.indicators.resurrect.enabled ) then + frame:RegisterNormalEvent("INCOMING_RESURRECT_CHANGED", self, "UpdateResurrect") + frame:RegisterUpdateFunc(self, "UpdateResurrect") + + frame.indicators.resurrect = frame.indicators.resurrect or frame.indicators:CreateTexture(nil, "OVERLAY") + frame.indicators.resurrect:SetTexture("Interface\\RaidFrame\\Raid-Icon-Rez") + end + if( config.indicators.pvp and config.indicators.pvp.enabled ) then frame:RegisterUnitEvent("PLAYER_FLAGS_CHANGED", self, "UpdatePVPFlag") frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdatePVPFlag") @@ -349,7 +367,7 @@ function Indicators:OnLayoutApplied(frame, config) for _, key in pairs(self.list) do local indicator = frame.indicators[key] - if( indicator and config.indicators[key].enabled and config.indicators[key].size ) then + if( indicator and config.indicators[key] and config.indicators[key].enabled and config.indicators[key].size ) then indicator.enabled = true indicator:SetHeight(config.indicators[key].size) indicator:SetWidth(config.indicators[key].size) diff --git a/modules/movers.lua b/modules/movers.lua index 737973f0..27f8cbe2 100644 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -37,6 +37,7 @@ local function createConfigEnv() end return getValue("UnitPower", unit, math.random(20000, 50000)) end, + UnitHasIncomingResurrection = function(unit) return true end, UnitExists = function(unit) return true end, UnitPowerMax = function(unit) return 50000 end, UnitIsPartyLeader = function() return true end, diff --git a/options/config.lua b/options/config.lua index 7c184574..6976a838 100644 --- a/options/config.lua +++ b/options/config.lua @@ -36,7 +36,7 @@ local PAGE_DESC = { ["tags"] = L["Advanced tag management, allows you to add your own custom tags."], ["filter"] = L["Simple aura filtering by whitelists and blacklists."], } -local INDICATOR_NAMES = {["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon role"], ["masterLoot"] = L["Master looter"], ["pvp"] = L["PvP Flag"],["raidTarget"] = L["Raid target"], ["ready"] = L["Ready status"], ["role"] = L["Raid role"], ["status"] = L["Combat status"], ["class"] = L["Class icon"]} +local INDICATOR_NAMES = {["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon role"], ["masterLoot"] = L["Master looter"], ["pvp"] = L["PvP Flag"],["raidTarget"] = L["Raid target"], ["ready"] = L["Ready status"], ["role"] = L["Raid role"], ["status"] = L["Combat status"], ["class"] = L["Class icon"], ["resurrect"] = L["Ressurect status"]} local AREA_NAMES = {["arena"] = L["Arenas"],["none"] = L["Everywhere else"], ["party"] = L["Party instances"], ["pvp"] = L["Battlegrounds"], ["raid"] = L["Raid instances"],} local INDICATOR_DESC = { ["leader"] = L["Crown indicator for group leaders."], ["lfdRole"] = L["Role the unit is playing in dungeons formed through the Looking For Dungeon system."], From 8ac9e1fbeb9f8569686468faa87f05b0eb6387c9 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 19 Sep 2011 20:10:44 -0700 Subject: [PATCH 099/794] Fixed inc heal tags --- modules/tags.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index c1941dba..62eddf27 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -765,13 +765,16 @@ Tags.defaultTags = { return UnitPower(unit, 0) end]], ["abs:incheal"] = [[function(unit, unitOwner, fontString) - return fontString.incoming and string.format("%d", fontString.incoming) + local heal = UnitGetIncomingHeals(unit) + return heal and string.format("%d", heal) end]], ["incheal"] = [[function(unit, unitOwner, fontString) - return fontString.incoming and ShadowUF:FormatLargeNumber(fontString.incoming) or nil + local heal = UnitGetIncomingHeals(unit) + return heal and ShadowUF:FormatLargeNumber(heal) end]], ["incheal:name"] = [[function(unit, unitOwner, fontString) - return fontString.incoming and string.format("+%d", fontString.incoming) or ShadowUF.tagFunc.name(unit, unitOwner) + local heal = UnitGetIncomingHeals(unit) + return heal and string.format("+%d", heal) or ShadowUF.tagFunc.name(unit, unitOwner) end]], ["unit:raid:targeting"] = [[function(unit, unitOwner, fontString) if( GetNumRaidMembers() == 0 ) then return nil end From f59e086cb45198066d31ac36a637d245dca3d61d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 19 Sep 2011 22:58:35 -0700 Subject: [PATCH 100/794] Force regen to get updated locales in --- localcheck.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/localcheck.lua b/localcheck.lua index 00f81fc6..cb26fdea 100755 --- a/localcheck.lua +++ b/localcheck.lua @@ -216,12 +216,13 @@ body = string.format("%s--%s\r\n", body, boundary) http.request({ method = "POST", - url = string.format("http://www.%s.com/addons/%s/localization/import/?api-key=%s", SITE_LOCATION, ADDON_SLUG, CURSE_API_KEY), + url = string.format("http://www.%s.com/addons/%s/localization/import/?api-key=", SITE_LOCATION, ADDON_SLUG, CURSE_API_KEY), sink = ltn12.sink.table(source), source = ltn12.source.string(body), headers = { ["Content-Type"] = string.format("multipart/form-data; boundary=\"%s\"", boundary), ["Content-Length"] = string.len(body), + ["Referer"] = string.format("http://www.%s.com/addons/%s/localization/import/", SITE_LOCATION, ADDON_SLUG) }, }) From 3448028a322ce942f9de7ddf46cc6d0eee6f777f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 20 Sep 2011 10:47:42 -0700 Subject: [PATCH 101/794] Fixed typo when using frequent health updates and inc heal --- modules/health.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/health.lua b/modules/health.lua index ff82de49..a2d703bc 100644 --- a/modules/health.lua +++ b/modules/health.lua @@ -121,7 +121,7 @@ function Health:UpdateFrequent(frame) -- Update incoming heal number if( frame.incHeal and frame.incHeal.healed ) then - frame.incHeal:SetValue(frame.healthBar.currentHealth + self.parent.incHeal.healed) + frame.incHeal:SetValue(frame.healthBar.currentHealth + frame.incHeal.healed) end -- The target is not offline, and we have a health percentage so update the gradient From 5128754f022abb8bb9d88fe6db108865be3bad39 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 20 Sep 2011 18:42:44 -0700 Subject: [PATCH 102/794] Fixed a bug in disabling the totem bar --- modules/totems.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/totems.lua b/modules/totems.lua index b11d7a4c..efc71b79 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -52,6 +52,11 @@ end function Totems:OnDisable(frame) frame:UnregisterAll(self) + frame:UnregisterUpdateFunc(self, "Update") + + for _, totem in pairs(frame.totemBar.totems) do + totem:Hide() + end end function Totems:OnLayoutApplied(frame) From e76251acf631e562589e67e3685dc12bb7877b10 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 21 Sep 2011 00:13:49 -0700 Subject: [PATCH 103/794] Moved show only curable and highlight curable to take talents into account due to Blizzard being Blizzard Spellstealable buffs can be scaled up using the self scale option when advanced settings are enabled Added phase indicators Added UNIT_PHASE full updates to UFs Added PARTY_MEMBER_ENABLE/DISABLE updates to events --- ShadowedUnitFrames.lua | 10 +++++--- modules/auras.lua | 16 +++++++----- modules/defaultlayout.lua | 21 ++++++++++----- modules/highlight.lua | 18 +++++++++++-- modules/indicators.lua | 19 +++++++++++++- modules/movers.lua | 1 + modules/units.lua | 54 ++++++++++++++++++++++++++++++++++++--- options/config.lua | 30 +++++++++++++++++++--- 8 files changed, 142 insertions(+), 27 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 84a6c60e..985e9a6a 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 6 +ShadowUF.dbRevision = 7 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -84,11 +84,15 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 - if( revision <= 5 ) then + if( revision <= 6 ) then for _, unit in pairs({"player", "focus", "target", "raid", "party", "mainassist", "maintank"}) do local db = self.db.profile.units[unit] if( not db.indicators.resurrect ) then - db.indicators.resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + db.indicators.resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"} + end + + if( not db.indicators.phase ) then + db.indicators.phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} end end end diff --git a/modules/auras.lua b/modules/auras.lua index 5256f433..97032d14 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -1,8 +1,8 @@ local Auras = {} local stealableColor = {r = 1, g = 1, b = 1} local playerUnits = {player = true, vehicle = true, pet = true} -local mainHand, offHand = {time = 0}, {time = 0} -local tempEnchantScan +local mainHand, offHand, tempEnchantScan = {time = 0}, {time = 0} +local canCure = ShadowUF.Units.canCure ShadowUF:RegisterModule(Auras, "auras", ShadowUF.L["Auras"]) function Auras:OnEnable(frame) @@ -295,8 +295,8 @@ local function updateGroup(self, type, config, reverseConfig) -- This is a bit of an odd filter, when used with a HELPFUL filter, it will only return buffs you can cast on group members -- When used with HARMFUL it will only return debuffs you can cure - if( config.raid ) then - group.filter = group.filter .. "|RAID" + if( config.raid and group.type == "buffs" ) then + group.filter = group.filter .. "|RAID" end for id, button in pairs(group.buttons) do @@ -465,7 +465,9 @@ end -- Scan for auras local function scan(parent, frame, type, config, filter) if( frame.totalAuras >= frame.maxAuras or not config.enabled ) then return end - + + local curable = (type == "debuffs" and config.raid) + local isFriendly = UnitIsFriend(frame.parent.unit, "player") local index = 0 while( true ) do @@ -473,7 +475,7 @@ local function scan(parent, frame, type, config, filter) local name, rank, texture, count, auraType, duration, endTime, caster, isStealable = UnitAura(frame.parent.unit, index, filter) if( not name ) then break end - if( ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and parent.whitelist[name] or parent.blacklist[type] and not parent.blacklist[name] ) ) then + if( ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and parent.whitelist[name] or parent.blacklist[type] and not parent.blacklist[name] ) and ( not curable or canCure[auraType] ) ) then -- Create any buttons we need frame.totalAuras = frame.totalAuras + 1 if( #(frame.buttons) < frame.totalAuras ) then @@ -500,7 +502,7 @@ local function scan(parent, frame, type, config, filter) end -- Enlarge our own auras - if( config.enlargeSelf and playerUnits[caster] ) then + if( config.enlargeSelf and playerUnits[caster] or ( isStealable and not isFriendly and config.enlargeStealable ) ) then button.isSelfScaled = true button:SetScale(config.selfScale) else diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index cccda294..2120a9d6 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -258,7 +258,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) masterLoot = {anchorTo = "$parent", anchorPoint = "TR", size = 12, x = -2, y = -10}, role = {enabled = false, anchorTo = "$parent", anchorPoint = "BR", size = 14, x = 0, y = 14}, ready = {anchorTo = "$parent", anchorPoint = "LC", size = 24, x = 25, y = 0}, - resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, + phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, text = { {text = "[(()afk() )][name]"}, @@ -311,7 +312,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, indicators = { - resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, + phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, auras = { buffs = {enabled = false, maxRows = 1, temporary = playerClass == "ROGUE" or playerClass == "SHAMAN"}, @@ -337,7 +339,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) castBar = {order = 60}, offset = 23, indicators = { - resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, + phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, auras = { buffs = {enabled = true, maxRows = 1}, @@ -449,7 +452,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, indicators = { - resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, + phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, auras = { buffs = {enabled = false}, @@ -493,7 +497,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, indicators = { - resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, + phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, auras = { buffs = {enabled = false}, @@ -561,7 +566,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, indicators = { lfdRole = {enabled = false}, - resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, + phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, auras = { buffs = {enabled = true}, @@ -615,7 +621,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) castBar = {order = 60}, indicators = { lfdRole = {enabled = false}, - resurrect = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = -14, anchorTo = "$parent"} + resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, + phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, text = { {text = "[(()afk() )][name]"}, diff --git a/modules/highlight.lua b/modules/highlight.lua index c086adfb..682742ed 100644 --- a/modules/highlight.lua +++ b/modules/highlight.lua @@ -1,5 +1,6 @@ local Highlight = {} local goldColor, mouseColor = {r = 0.75, g = 0.75, b = 0.35}, {r = 0.75, g = 0.75, b = 0.50} +local canCure = ShadowUF.Units.canCure ShadowUF:RegisterModule(Highlight, "highlight", ShadowUF.L["Highlight"]) -- Might seem odd to hook my code in the core manually, but HookScript is ~40% slower due to it being a secure hook @@ -157,7 +158,20 @@ function Highlight:UpdateAttention(frame) end function Highlight:UpdateAura(frame) - -- In theory, we don't need aura scanning because the first debuff returned is always one we can cure... in theory - frame.highlight.hasDebuff = UnitIsFriend(frame.unit, "player") and select(5, UnitDebuff(frame.unit, 1, "RAID")) or nil + frame.highlight.hasDebuff = nil + if( UnitIsFriend(frame.unit, "player") ) then + local id = 0 + while( true ) do + id = id + 1 + local name, _, _, _, auraType = UnitDebuff(frame.unit, id) + if( not name ) then break end + + if( canCure[auraType] ) then + frame.highlight.hasDebuff = auraType + break + end + end + end + self:Update(frame) end diff --git a/modules/indicators.lua b/modules/indicators.lua index 2b76dff8..8244a31f 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -1,4 +1,4 @@ -local Indicators = {list = {"status", "pvp", "leader", "resurrect", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class"}} +local Indicators = {list = {"status", "pvp", "leader", "resurrect", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class", "phase"}} local leavingWorld ShadowUF:RegisterModule(Indicators, "indicators", ShadowUF.L["Indicators"]) @@ -17,6 +17,16 @@ function Indicators:UpdateClass(frame) end end +function Indicators:UpdatePhase(frame) + if( not frame.indicators.phase or not frame.indicators.phase.enabled ) then return end + + if( UnitIsPlayer(frame.unit) and not UnitInPhase(frame.unit) ) then + frame.indicators.phase:Show() + else + frame.indicators.phase:Hide() + end +end + function Indicators:UpdateResurrect(frame) if( not frame.indicators.resurrect or not frame.indicators.resurrect.enabled ) then return end @@ -251,6 +261,13 @@ function Indicators:OnEnable(frame) elseif( frame.indicators.status ) then frame.indicators:SetScript("OnUpdate", nil) end + + if( config.indicators.phase and config.indicators.phase.enabled ) then + frame:RegisterUpdateFunc(self, "UpdatePhase") + + frame.indicators.phase = frame.indicators.phase or frame.indicators:CreateTexture(nil, "OVERLAY") + frame.indicators.phase:SetTexture("Interface\\TargetingFrame\\UI-PhasingIcon") + end if( config.indicators.resurrect and config.indicators.resurrect.enabled ) then frame:RegisterNormalEvent("INCOMING_RESURRECT_CHANGED", self, "UpdateResurrect") diff --git a/modules/movers.lua b/modules/movers.lua index 27f8cbe2..25f34563 100644 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -38,6 +38,7 @@ local function createConfigEnv() return getValue("UnitPower", unit, math.random(20000, 50000)) end, UnitHasIncomingResurrection = function(unit) return true end, + UnitInPhase = function(unit) return true end, UnitExists = function(unit) return true end, UnitPowerMax = function(unit) return 50000 end, UnitIsPartyLeader = function() return true end, diff --git a/modules/units.lua b/modules/units.lua index fd875691..617f6ae1 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -1,10 +1,11 @@ -local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}} +local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}, canCure = {}} Units.childUnits = {["partytarget"] = "party", ["partypet"] = "party", ["maintanktarget"] = "maintank", ["mainassisttarget"] = "mainassist", ["bosstarget"] = "boss", ["arenatarget"] = "arena", ["arenapet"] = "arena"} Units.zoneUnits = {["arena"] = "arena", ["boss"] = "raid"} local stateMonitor = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") local playerClass = select(2, UnitClass("player")) -local unitFrames, headerFrames, frameList, unitEvents, childUnits, queuedCombat = Units.unitFrames, Units.headerFrames, Units.frameList, Units.unitEvents, Units.childUnits, {} +local unitFrames, headerFrames, frameList, unitEvents, childUnits, queuedCombat, canCure = Units.unitFrames, Units.headerFrames, Units.frameList, Units.unitEvents, Units.childUnits, {}, Units.canCure +local curableData = {["PRIEST"] = {["Magic"] = true, ["Disease"] = true}, ["DRUID"] = {["Curse"] = true, ["Poison"] = true, ["Magic"] = GetSpellInfo(88423)}, ["SHAMAN"] = {["Curse"] = true, ["Magic"] = GetSpellInfo(77130)}, ["PALADIN"] = {["Poison"] = true, ["Disease"] = true, ["Magic"] = GetSpellInfo(53551)}} local _G = getfenv(0) ShadowUF.Units = Units @@ -458,6 +459,9 @@ OnAttributeChanged = function(self, name, unit) self:RegisterUpdateFunc(Units, "CheckVehicleStatus") end + -- Phase change, do a full update on it + self:RegisterUnitEvent("UNIT_PHASE", self, "FullUpdate") + -- Pet changed, going from pet -> vehicle for one if( self.unit == "pet" or self.unitType == "partypet" ) then self.unitRealOwner = self.unit == "pet" and "player" or ShadowUF.partyUnits[self.unitID] @@ -520,6 +524,8 @@ OnAttributeChanged = function(self, name, unit) -- Party members need to watch for changes elseif( self.unitRealType == "party" ) then self:RegisterNormalEvent("PARTY_MEMBERS_CHANGED", Units, "CheckGroupedUnitStatus") + self:RegisterNormalEvent("PARTY_MEMBER_ENABLE", Units, "CheckGroupedUnitStatus") + self:RegisterNormalEvent("PARTY_MEMBER_DISABLE", Units, "CheckGroupedUnitStatus") self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") -- *target units are not real units, thus they do not receive events and must be polled for data @@ -1230,9 +1236,45 @@ function Units:CheckPlayerZone(force) end end +-- Monitor talents to figure out what the user can currently cure +function Units:SetCurable() + table.wipe(canCure) + + local list = curableData[select(2, UnitClass("player"))] + if( list ) then + for magic, spell in pairs(list) do + if( spell == true ) then + canCure[magic] = true + -- Need some specific talents for this + else + for tab=1, GetNumTalentTabs() do + for talent=1, GetNumTalents(tab) do + local name, _, _, _, currentRank = GetTalentInfo(tab, talent) + if( name == spell and currentRank > 0 ) then + canCure[magic] = true + end + end + end + end + end + end + + -- Reload frames + for frame in pairs(ShadowUF.Units.frameList) do + if( frame.unit and frame:IsVisible() and UnitIsFriend(frame.unit, "player") ) then + local config = ShadowUF.db.profile.units[frame.unitType]; + if( ( config.auras and config.auras.debuffs and config.auras.debuffs.raid ) or ( config.highlight and config.highlight.hasDebuff ) ) then + frame:FullUpdate() + end + end + end +end + local centralFrame = CreateFrame("Frame") centralFrame:RegisterEvent("PLAYER_REGEN_ENABLED") centralFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") +centralFrame:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") +centralFrame:RegisterEvent("PLAYER_TALENT_UPDATE") centralFrame:SetScript("OnEvent", function(self, event, unit) -- Check if the player changed zone types and we need to change module status, while they are dead -- we won't change their zone type as releasing from an instance will change the zone type without them @@ -1244,11 +1286,15 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) self:UnregisterEvent("PLAYER_UNGHOST") Units:CheckPlayerZone() end - -- They're alive again so they "officially" changed zone types now elseif( event == "PLAYER_UNGHOST" ) then Units:CheckPlayerZone() - + -- Monitor talent changes + elseif( event == "ACTIVE_TALENT_GROUP_CHANGED" ) then + Units:SetCurable() + elseif( event == "PLAYER_TALENT_UPDATE" ) then + self:UnregisterEvent(event) + Units:SetCurable() -- This is slightly hackish, but it suits the purpose just fine for somthing thats rarely called. elseif( event == "PLAYER_REGEN_ENABLED" ) then -- Now do all of the creation for child wrapping diff --git a/options/config.lua b/options/config.lua index 6976a838..c2999916 100644 --- a/options/config.lua +++ b/options/config.lua @@ -36,7 +36,7 @@ local PAGE_DESC = { ["tags"] = L["Advanced tag management, allows you to add your own custom tags."], ["filter"] = L["Simple aura filtering by whitelists and blacklists."], } -local INDICATOR_NAMES = {["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon role"], ["masterLoot"] = L["Master looter"], ["pvp"] = L["PvP Flag"],["raidTarget"] = L["Raid target"], ["ready"] = L["Ready status"], ["role"] = L["Raid role"], ["status"] = L["Combat status"], ["class"] = L["Class icon"], ["resurrect"] = L["Ressurect status"]} +local INDICATOR_NAMES = {["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon role"], ["masterLoot"] = L["Master looter"], ["pvp"] = L["PvP Flag"],["raidTarget"] = L["Raid target"], ["ready"] = L["Ready status"], ["role"] = L["Raid role"], ["status"] = L["Combat status"], ["class"] = L["Class icon"], ["resurrect"] = L["Resurrect status"], ["phase"] = L["Phase status"]} local AREA_NAMES = {["arena"] = L["Arenas"],["none"] = L["Everywhere else"], ["party"] = L["Party instances"], ["pvp"] = L["Battlegrounds"], ["raid"] = L["Raid instances"],} local INDICATOR_DESC = { ["leader"] = L["Crown indicator for group leaders."], ["lfdRole"] = L["Role the unit is playing in dungeons formed through the Looking For Dungeon system."], @@ -1822,6 +1822,13 @@ local function loadUnitOptions() return ShadowUF.db.profile.advanced and advancedAuraList or defaultAuraList end + local function hideStealable(info) + if( not ShadowUF.db.profile.advanced ) then return true end + if( info[2] == "player" or info[2] == "pet" or info[#(info) - 1] == "debuffs" ) then return true end + + return false + end + Config.auraTable = { type = "group", inline = true, @@ -1870,6 +1877,14 @@ local function loadUnitOptions() name = "", width = "full", }, + enlargeStealable = { + order = 6.5, + type = "toggle", + name = L["Enlarge stealable auras"], + desc = L["If you can Spellsteal an aura, then it will be shown scaled using the scaled aura size option."], + arg = "auras.$parent.enlargeStealable", + hidden = hideStealable, + }, player = { order = 7, type = "toggle", @@ -1884,6 +1899,15 @@ local function loadUnitOptions() desc = function(info) return info[#(info) - 1] == "buffs" and L["Filter out any auras that you cannot cast on another player, or yourself."] or L["Filter out any aura that you cannot cure."] end, width = "double", arg = "auras.$parent.raid", + hidden = function(info) return not hideStealable(info) end, + }, + raid2 = { + order = 8, + type = "toggle", + name = function(info) return info[#(info) - 1] == "buffs" and L["Show castable on other auras only"] or L["Show curable only"] end, + desc = function(info) return info[#(info) - 1] == "buffs" and L["Filter out any auras that you cannot cast on another player, or yourself."] or L["Filter out any aura that you cannot cure."] end, + arg = "auras.$parent.raid", + hidden = hideStealable, }, sep3 = { order = 9, @@ -1909,8 +1933,8 @@ local function loadUnitOptions() selfScale = { order = 11, type = "range", - name = L["Self aura size"], - desc = L["Scale for auras that you casted, any number above 100% is bigger tahn default, any number below 100% is smaller than default."], + name = L["Scaled aura size"], + desc = L["Scale for auras that you casted or can Spellsteal, any number above 100% is bigger than default, any number below 100% is smaller than default."], min = 1, max = 3, step = 0.10, isPercent = true, disabled = function(info) return not getVariable(info[2], "auras", info[#(info) - 1], "enlargeSelf") end, From 736d8b45c325f8b4e538626b825b1055a7387e85 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 22 Sep 2011 08:47:34 -0700 Subject: [PATCH 104/794] Only filter out curable auras on friendlies, not on enemies too --- modules/auras.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 97032d14..f5f02b7f 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -466,9 +466,8 @@ end local function scan(parent, frame, type, config, filter) if( frame.totalAuras >= frame.maxAuras or not config.enabled ) then return end - local curable = (type == "debuffs" and config.raid) - local isFriendly = UnitIsFriend(frame.parent.unit, "player") + local curable = (isFriendly and type == "debuffs" and config.raid) local index = 0 while( true ) do index = index + 1 From 4f4ec4333c5e0a6ffbb4dc56b983f6a1b466f049 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 22 Sep 2011 22:37:50 -0700 Subject: [PATCH 105/794] Delete threshold should be texts 1 - 5, not 1 - 6 --- options/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index c2999916..1ebf08d5 100644 --- a/options/config.lua +++ b/options/config.lua @@ -409,7 +409,7 @@ local function loadGeneralOptions() if( not getVariable("player", "text", nil, id) ) then return true end return getVariable("player", "text", id, "anchorTo") ~= info[#(info) - 1] end, - disabled = function(info) return tonumber(info[#(info)]) <= 6 end, + disabled = function(info) return tonumber(info[#(info)]) <= 5 end, confirmText = L["Are you sure you want to delete this text? All settings for it will be deleted."], confirm = true, func = function(info) From c40a14647a270c91bc490c62e985886fe4dbb91b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 24 Sep 2011 22:50:10 -0700 Subject: [PATCH 106/794] Added hide raid in <6 raid option --- modules/units.lua | 48 +++++++++++++++++++++++++++++++++++++--------- options/config.lua | 16 ++++++++++++++-- 2 files changed, 53 insertions(+), 11 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 617f6ae1..07366873 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -844,8 +844,14 @@ function Units:SetHeaderAttributes(frame, type) self:CheckGroupVisibility() -- Need to update our flags on the state monitor so it knows what to do - stateMonitor:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.party.hideSemiRaid) - stateMonitor:SetAttribute("hideAnyRaid", ShadowUF.db.profile.units.party.hideAnyRaid) + if( stateMonitor.party ) then + stateMonitor.party:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.party.hideSemiRaid) + stateMonitor.party:SetAttribute("hideAnyRaid", ShadowUF.db.profile.units.party.hideAnyRaid) + end + + if( stateMonitor.raid ) then + stateMonitor.raid:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) + end end -- calling :Show basically resets the header if frame:IsShown() then @@ -937,9 +943,13 @@ function Units:LoadGroupHeader(type) if( headerFrames[type] ) then headerFrames[type]:Show() - if( type == "party" ) then + if( type == "party" and stateMonitor.party ) then stateMonitor:SetAttribute("partyDisabled", nil) end + + if( type == "raid" and stateMonitor.raid ) then + stateMonitor.raid:SetAttribute("raidDisabled", nil) + end if( type == "party" or type == "raid" ) then self:CheckGroupVisibility() @@ -981,9 +991,10 @@ function Units:LoadGroupHeader(type) -- technically this isn't the cleanest solution because party frames will still have unit watches active -- but this isn't as big of a deal, because SUF automatically will unregister the OnEvent for party frames while hidden if( type == "party" ) then - stateMonitor:SetAttribute("partyDisabled", nil) - stateMonitor:SetFrameRef("partyHeader", headerFrame) - stateMonitor:WrapScript(stateMonitor, "OnAttributeChanged", [[ + stateMonitor.party = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") + stateMonitor.party:SetAttribute("partyDisabled", nil) + stateMonitor.party:SetFrameRef("partyHeader", headerFrame) + stateMonitor.party:WrapScript(stateMonitor.party, "OnAttributeChanged", [[ if( name ~= "state-raidmonitor" and name ~= "partydisabled" and name ~= "hideanyraid" and name ~= "hidesemiraid" ) then return end if( self:GetAttribute("partyDisabled") ) then return end @@ -995,7 +1006,23 @@ function Units:LoadGroupHeader(type) self:GetFrameRef("partyHeader"):Show() end ]]) - RegisterStateDriver(stateMonitor, "raidmonitor", "[target=raid6, exists] raid6; [target=raid1, exists] raid1; none") + RegisterStateDriver(stateMonitor.party, "raidmonitor", "[target=raid6, exists] raid6; [target=raid1, exists] raid1; none") + elseif( type == "raid" ) then + stateMonitor.raid = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") + stateMonitor.raid:SetAttribute("raidDisabled", nil) + stateMonitor.raid:SetFrameRef("raidHeader", headerFrame) + stateMonitor.raid:WrapScript(stateMonitor.raid, "OnAttributeChanged", [[ + if( name ~= "state-raidmonitor" and name ~= "raiddisabled" and name ~= "hidesemiraid" ) then return end + if( self:GetAttribute("partyDisabled") ) then return end + + if( self:GetAttribute("hideSemiRaid") and self:GetAttribute("state-raidmonitor") ~= "raid6" ) then + self:GetFrameRef("raidHeader"):Hide() + else + self:GetFrameRef("raidHeader"):Show() + end + ]]) + + RegisterStateDriver(stateMonitor.raid, "raidmonitor", "[target=raid6, exists] raid6; [target=raid1, exists] raid1; none") else headerFrame:Show() end @@ -1125,8 +1152,11 @@ end -- Uninitialize units function Units:UninitializeFrame(type) -- Disables showing party in raid automatically if raid frames are disabled - if( type == "party" ) then - stateMonitor:SetAttribute("partyDisabled", true) + if( type == "party" and stateMonitor.party ) then + stateMonitor.party:SetAttribute("partyDisabled", true) + end + if( type == "raid" and stateMonitor.raid ) then + stateMonitor.raid:SetAttribute("raidDisabled", true) end if( type == "party" or type == "raid" ) then self:CheckGroupVisibility() diff --git a/options/config.lua b/options/config.lua index 1ebf08d5..ff585fd6 100644 --- a/options/config.lua +++ b/options/config.lua @@ -2804,10 +2804,10 @@ local function loadUnitOptions() hidden = function(info) return info[2] ~= "party" end, arg = "showPlayer", }, - hideSemiRaid = { + hideSemiRaidParty = { order = 1, type = "toggle", - name = L["Hide in 6-man raid"], + name = L["Hide in >5-man raids"], desc = L["Party frames are hidden while in a raid group with more than 5 people inside."], hidden = function(info) return info[2] ~= "party" end, set = function(info, value) @@ -2844,6 +2844,18 @@ local function loadUnitOptions() hidden = function(info) return info[2] ~= "raid" end, arg = "frameSplit", }, + hideSemiRaidRaid = { + order = 3.5, + type = "toggle", + name = L["Hide in <=5-man raids"], + desc = L["Raid frames are hidden while in a raid group with 5 or less people inside."], + hidden = function(info) return info[2] ~= "raid" end, + set = function(info, value) + setVariable(info[2], nil, nil, "hideSemiRaid", value) + ShadowUF.Units:ReloadHeader(info[#(info) - 3]) + end, + arg = "hideSemiRaid" + }, showInRaid = { order = 4, type = "toggle", From b20212ab3a65b7bafb8dde78e02b3534276f04df Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 25 Sep 2011 20:48:19 -0700 Subject: [PATCH 107/794] Small syntax changes --- ShadowedUnitFrames.lua | 2 +- modules/eclipse.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 985e9a6a..a2f34d33 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -522,7 +522,7 @@ function ShadowUF:HideBlizzardFrames() -- and the fix is simple enough hooksecurefunc(LFDQueueFrameCooldownFrame, "SetFrameLevel", function(frame, value) local parentLevel = LFDParentFrame:GetFrameLevel() + 5 - if value < parentLevel then + if( value < parentLevel ) then frame:SetFrameLevel(parentLevel + 10) end end) diff --git a/modules/eclipse.lua b/modules/eclipse.lua index e90d82a0..6d84ccc2 100644 --- a/modules/eclipse.lua +++ b/modules/eclipse.lua @@ -62,15 +62,15 @@ end function Eclipse:UpdateDirection(frame) local direction = GetEclipseDirection() - if direction then + if( direction ) then frame.eclipseBar.marker.texture:SetTexCoord(unpack(ECLIPSE_MARKER_COORDS[direction])) end end function Eclipse:Update(frame, event, unit, id) - if (id == "ECLIPSE") then + if( id == "ECLIPSE" ) then local power = UnitPower("player", SPELL_POWER_ECLIPSE) - local xpos = (frame.eclipseBar:GetWidth()/2) * (power/100) + local xpos = (frame.eclipseBar:GetWidth() / 2) * (power / 100) frame.eclipseBar.marker:SetPoint("CENTER", frame.eclipseBar, "CENTER", xpos, 0) end end From ba035eb813da42d44aff12e35e7706693bbd9415 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 25 Sep 2011 20:52:55 -0700 Subject: [PATCH 108/794] Small syntax changes --- modules/altpower.lua | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index c9aa4054..d8c40a56 100644 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -1,8 +1,6 @@ local AltPower = {} ShadowUF:RegisterModule(AltPower, "altPowerBar", ShadowUF.L["Alt. Power bar"], true) -local ALTERNATE_POWER_INDEX = ALTERNATE_POWER_INDEX - function AltPower:OnEnable(frame) frame.altPowerBar = frame.altPowerBar or ShadowUF.Units:CreateBar(frame) @@ -27,17 +25,14 @@ end function AltPower:UpdateVisibility(frame) local barType, minPower, _, _, _, hideFromOthers = UnitAlternatePowerInfo(frame.unit) - local visible = barType and (frame.unit == "player" or not hideFromOthers) + local visible = barType and ( frame.unit == "player" or not hideFromOthers ) ShadowUF.Layout:SetBarVisibility(frame, "altPowerBar", visible) AltPower:Update(frame, nil, nil, "ALTERNATE") end function AltPower:Update(frame, event, unit, type) if( type ~= "ALTERNATE" ) then return end - local cur = UnitPower(frame.unit, ALTERNATE_POWER_INDEX) - local max = UnitPowerMax(frame.unit, ALTERNATE_POWER_INDEX) - local barType, min = UnitAlternatePowerInfo(frame.unit) - frame.altPowerBar.currentPower = cur - frame.altPowerBar:SetMinMaxValues(min or 0, max or 0) - frame.altPowerBar:SetValue(cur or 0) + + frame.altPowerBar:SetMinMaxValues(select(2, UnitAlternatePowerInfo(frame.unit)) or 0, UnitPowerMax(frame.unit, ALTERNATE_POWER_INDEX) or 0) + frame.altPowerBar:SetValue(UnitPower(frame.unit, ALTERNATE_POWER_INDEX) or 0) end \ No newline at end of file From 5ee27a5e2a5a50f48484e072ae8e648f8f1007e2 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 25 Sep 2011 21:26:14 -0700 Subject: [PATCH 109/794] Added [hpower] and [sshards] tags for holy power and soul shards tags --- localcheck.lua | 2 ++ modules/tags.lua | 24 ++++++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/localcheck.lua b/localcheck.lua index cb26fdea..31e78d5d 100755 --- a/localcheck.lua +++ b/localcheck.lua @@ -201,6 +201,8 @@ local addonData = { ["text"] = localization, } +print(localization) + -- Send it off local boundary = string.format("-------%s", os.time()) local source = {} diff --git a/modules/tags.lua b/modules/tags.lua index 62eddf27..b913d68f 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -674,6 +674,14 @@ Tags.defaultTags = { return ShadowUF.L["Offline"] end end]], + ["sshards"] = [[function(unit, unitOwner) + local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_SOUL_SHARDS) + return points and points > 0 and points + end]], + ["hpower"] = [[function(unit, unitOwner) + local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_HOLY_POWER) + return points and points > 0 and points + end]], ["cpoints"] = [[function(unit, unitOwner) local points = GetComboPoints(ShadowUF.playerUnit) if( points == 0 ) then @@ -829,10 +837,12 @@ Tags.defaultEvents = { ["curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", ["absolutepp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", ["smart:curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["druid:curpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", - ["druid:abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", - ["druid:curmaxpp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["druid:absolutepp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["druid:curpp"] = "UNIT_POWER:MANA UNIT_DISPLAYPOWER", + ["druid:abscurpp"] = "UNIT_POWER:MANA UNIT_DISPLAYPOWER", + ["druid:curmaxpp"] = "UNIT_POWER:MANA UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["druid:absolutepp"] = "UNIT_POWER:MANA UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["sshards"] = "UNIT_POWER", + ["hpower"] = "UNIT_POWER", ["level"] = "UNIT_LEVEL PLAYER_LEVEL_UP", ["levelcolor"] = "UNIT_LEVEL PLAYER_LEVEL_UP", ["maxhp"] = "UNIT_MAXHEALTH", @@ -942,6 +952,8 @@ Tags.defaultCategories = { ["druid:abscurpp"] = "power", ["druid:curmaxpp"] = "power", ["druid:absolutepp"] = "power", + ["sshards"] = "misc", + ["hpower"] = "misc", ["situation"] = "playerthreat", ["color:sit"] = "playerthreat", ["scaled:threat"] = "playerthreat", @@ -972,6 +984,8 @@ Tags.defaultHelp = { ["status:time"] = L["Shows how long an unit has been offline."], ["afk"] = L["Shows AFK, DND or nothing depending on the units away status."], ["cpoints"] = L["Total number of combo points you have on your target."], + ["hpower"] = L["Total number of active holy power."], + ["sshards"] = L["Total number of active soul shards."], ["smartlevel"] = L["Smart level, returns Boss for bosses, +50 for a level 50 elite mob, or just 80 for a level 80."], ["classification"] = L["Units classification, Rare, Rare Elite, Elite, Boss, nothing is shown if they aren't any of those."], ["shortclassification"] = L["Short classifications, R for Rare, R+ for Rare Elite, + for Elite, B for boss, nothing is shown if they aren't any of those."], @@ -1050,6 +1064,8 @@ Tags.defaultNames = { ["status:time"] = L["Offline timer"], ["afk"] = L["AFK status"], ["cpoints"] = L["Combo points"], + ["hpower"] = L["Holy power"], + ["sshards"] = L["Soul shards"], ["smartlevel"] = L["Smart level"], ["classification"] = L["Classificaiton"], ["shortclassification"] = L["Short classification"], From ed3bffaf50000ea79bea66a96e1e7e08e964094b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 26 Sep 2011 08:09:56 -0700 Subject: [PATCH 110/794] Make sure to reset partyDisabled on frame enable --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 07366873..85292c4e 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -944,7 +944,7 @@ function Units:LoadGroupHeader(type) headerFrames[type]:Show() if( type == "party" and stateMonitor.party ) then - stateMonitor:SetAttribute("partyDisabled", nil) + stateMonitor.party:SetAttribute("partyDisabled", nil) end if( type == "raid" and stateMonitor.raid ) then From 1eaee3b07a020d9c0c8673659aacdae30fcdcdd5 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 26 Sep 2011 11:05:38 -0700 Subject: [PATCH 111/794] Oops, added description for Druid mushroom bars --- options/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index ff585fd6..10829fc1 100644 --- a/options/config.lua +++ b/options/config.lua @@ -3299,7 +3299,7 @@ local function loadUnitOptions() type = "toggle", name = string.format(L["Enable %s"], ShadowUF.modules.totemBar.moduleName), desc = function(info) - return select(2, UnitClass("player")) == "SHAMAN" and L["Adds totem bars with timers before they expire to the player frame."] or L["Adds a bar indicating how much time is left on your ghoul timer, only used if you do not have a permanent ghoul."] + return select(2, UnitClass("player")) == "SHAMAN" and L["Adds totem bars with timers before they expire to the player frame."] or select(2, UnitClass("player")) == "DEATHKNIGHT" and L["Adds a bar indicating how much time is left on your ghoul timer, only used if you do not have a permanent ghoul."] or L["Adds a bar indicating how much time is left on your mushrooms."] end, hidden = hideRestrictedOption, arg = "totemBar.enabled", From bd750dc41be2687c89021459745d7f24d0fb2be1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 26 Sep 2011 19:48:58 -0700 Subject: [PATCH 112/794] Fixed positioning of question mark portrait --- modules/portrait.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/portrait.lua b/modules/portrait.lua index 1e06f070..226eb1b9 100755 --- a/modules/portrait.lua +++ b/modules/portrait.lua @@ -80,10 +80,10 @@ function Portrait:Update(frame, event) elseif( type == "2D" ) then frame.portrait:SetTexCoord(0.10, 0.90, 0.10, 0.90) SetPortraitTexture(frame.portrait, frame.unitOwner) - -- Using 3D portrait, but the players not in range so swap to 2D + -- Using 3D portrait, but the players not in range so swap to question mark elseif( not UnitIsVisible(frame.unitOwner) or not UnitIsConnected(frame.unitOwner) ) then frame.portrait:SetModelScale(4.25) - frame.portrait:SetPosition(0, 0, -1.5) + frame.portrait:SetPosition(0, 0, -0.4) frame.portrait:SetModel("Interface\\Buttons\\talktomequestionmark.mdx") -- Use animated 3D portrait else From faf894f2144cc54232e6d8f3cb841d8bb5d2bfee Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 26 Sep 2011 19:56:49 -0700 Subject: [PATCH 113/794] Fixed hide raids in <= 5 man raids option Fixed parties not being hidden properly --- modules/units.lua | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 85292c4e..56eef0e4 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -837,18 +837,17 @@ function Units:SetHeaderAttributes(frame, type) frame:SetAttribute("unitsPerColumn", config.unitsPerColumn) frame:SetAttribute("columnSpacing", config.columnSpacing) frame:SetAttribute("columnAnchorPoint", config.attribAnchorPoint) - end - - -- Update the raid frames to if they should be showing raid or party - if( type == "party" or type == "raid" ) then + self:CheckGroupVisibility() - - -- Need to update our flags on the state monitor so it knows what to do if( stateMonitor.party ) then stateMonitor.party:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.party.hideSemiRaid) stateMonitor.party:SetAttribute("hideAnyRaid", ShadowUF.db.profile.units.party.hideAnyRaid) end - + end + + if( type == "raid" ) then + self:CheckGroupVisibility() + if( stateMonitor.raid ) then stateMonitor.raid:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) end @@ -994,6 +993,8 @@ function Units:LoadGroupHeader(type) stateMonitor.party = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") stateMonitor.party:SetAttribute("partyDisabled", nil) stateMonitor.party:SetFrameRef("partyHeader", headerFrame) + stateMonitor.party:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.party.hideSemiRaid) + stateMonitor.party:SetAttribute("hideAnyRaid", ShadowUF.db.profile.units.party.hideAnyRaid) stateMonitor.party:WrapScript(stateMonitor.party, "OnAttributeChanged", [[ if( name ~= "state-raidmonitor" and name ~= "partydisabled" and name ~= "hideanyraid" and name ~= "hidesemiraid" ) then return end if( self:GetAttribute("partyDisabled") ) then return end @@ -1011,18 +1012,19 @@ function Units:LoadGroupHeader(type) stateMonitor.raid = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") stateMonitor.raid:SetAttribute("raidDisabled", nil) stateMonitor.raid:SetFrameRef("raidHeader", headerFrame) + stateMonitor.raid:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) stateMonitor.raid:WrapScript(stateMonitor.raid, "OnAttributeChanged", [[ if( name ~= "state-raidmonitor" and name ~= "raiddisabled" and name ~= "hidesemiraid" ) then return end - if( self:GetAttribute("partyDisabled") ) then return end + if( self:GetAttribute("raidDisabled") ) then return end - if( self:GetAttribute("hideSemiRaid") and self:GetAttribute("state-raidmonitor") ~= "raid6" ) then + if( self:GetAttribute("hideSemiRaid") and self:GetAttribute("state-raidmonitor") ~= "raid5" ) then self:GetFrameRef("raidHeader"):Hide() else self:GetFrameRef("raidHeader"):Show() end ]]) - RegisterStateDriver(stateMonitor.raid, "raidmonitor", "[target=raid6, exists] raid6; [target=raid1, exists] raid1; none") + RegisterStateDriver(stateMonitor.raid, "raidmonitor", "[target=raid5, exists] raid5; none") else headerFrame:Show() end From d124d919073fafb6e3f00d8c1e2199d62eaf79db Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 28 Sep 2011 11:13:01 -0700 Subject: [PATCH 114/794] Fix possible cases of divide by zeroes to not occur anymore due to PTR changes --- modules/health.lua | 3 ++- modules/incheal.lua | 4 ++-- modules/tags.lua | 9 ++++++++- modules/xp.lua | 6 +++--- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/modules/health.lua b/modules/health.lua index a2d703bc..a10ff965 100644 --- a/modules/health.lua +++ b/modules/health.lua @@ -2,7 +2,8 @@ local Health = {} ShadowUF:RegisterModule(Health, "healthBar", ShadowUF.L["Health bar"], true) local function getGradientColor(unit) - local percent = UnitHealth(unit) / UnitHealthMax(unit) + local maxHealth = UnitHealthMax(unit) + local percent = maxHealth > 0 and UnitHealth(unit) / maxHealth or 0 if( percent >= 1 ) then return ShadowUF.db.profile.healthColors.green.r, ShadowUF.db.profile.healthColors.green.g, ShadowUF.db.profile.healthColors.green.b end if( percent == 0 ) then return ShadowUF.db.profile.healthColors.red.r, ShadowUF.db.profile.healthColors.red.g, ShadowUF.db.profile.healthColors.red.b end diff --git a/modules/incheal.lua b/modules/incheal.lua index 6029461e..51abc8bb 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -105,8 +105,8 @@ function IncHeal:UpdateFrame(frame) frame.incHeal:SetValue(frame.incHeal.total) else local health, maxHealth = UnitHealth(frame.unit), UnitHealthMax(frame.unit) - local healthWidth = frame.incHeal.healthWidth * (health / maxHealth) - local incWidth = frame.healthBar:GetWidth() * (healed / health) + local healthWidth = frame.incHeal.healthWidth * (maxHealth > 0 and health / maxHealth or 0) + local incWidth = frame.healthBar:GetWidth() * (health > 0 and healed / health or 0) if( (healthWidth + incWidth) > frame.incHeal.maxWidth ) then incWidth = frame.incHeal.cappedWidth end diff --git a/modules/tags.lua b/modules/tags.lua index b913d68f..cfbfde47 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -704,7 +704,14 @@ Tags.defaultTags = { end end end]], - ["dechp"] = [[function(unit, unitOwner) return string.format("%.1f%%", (UnitHealth(unit) / UnitHealthMax(unit)) * 100) end]], + ["dechp"] = [[function(unit, unitOwner) + local maxHealth = UnitHealthMax(unit) + if( maxHealth <= 0 ) then + return "0.0%" + end + + return string.format("%.1f%%", (UnitHealth(unit) / maxHealth) * 100) + end]], ["classification"] = [[function(unit, unitOwner) local classif = UnitClassification(unit) if( classif == "rare" ) then diff --git a/modules/xp.lua b/modules/xp.lua index 6f2c28fd..946c6e76 100755 --- a/modules/xp.lua +++ b/modules/xp.lua @@ -99,7 +99,7 @@ function XP:UpdateRep(frame) local color = FACTION_BAR_COLORS[reaction] frame.xpBar.rep:SetMinMaxValues(0, max) frame.xpBar.rep:SetValue(reaction == 8 and max or current) - frame.xpBar.rep.tooltip = string.format(L["%s (%s): %s/%s (%.2f%% done)"], name, GetText("FACTION_STANDING_LABEL" .. reaction, UnitSex("player")), formatNumber(current), formatNumber(max), reaction == 8 and 100 or (current / max) * 100) + frame.xpBar.rep.tooltip = string.format(L["%s (%s): %s/%s (%.2f%% done)"], name, GetText("FACTION_STANDING_LABEL" .. reaction, UnitSex("player")), formatNumber(current), formatNumber(max), reaction == 8 and 100 or (max > 0 and current / max or 0) * 100) frame.xpBar.rep:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) frame.xpBar.rep.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) frame.xpBar.rep:Show() @@ -128,10 +128,10 @@ function XP:UpdateXP(frame) frame.xpBar.rested:SetMinMaxValues(min, max) frame.xpBar.rested:SetValue(math.min(current + GetXPExhaustion(), max)) frame.xpBar.rested:Show() - frame.xpBar.xp.tooltip = string.format(L["Level %s - %s: %s/%s (%.2f%% done), %s rested."], UnitLevel(frame.unitOwner), UnitLevel(frame.unitOwner) + 1, formatNumber(current), formatNumber(max), (current / max) * 100, formatNumber(GetXPExhaustion())) + frame.xpBar.xp.tooltip = string.format(L["Level %s - %s: %s/%s (%.2f%% done), %s rested."], UnitLevel(frame.unitOwner), UnitLevel(frame.unitOwner) + 1, formatNumber(current), formatNumber(max), (max > 0 and current / max or 0) * 100, formatNumber(GetXPExhaustion())) else frame.xpBar.rested:Hide() - frame.xpBar.xp.tooltip = string.format(L["Level %s - %s: %s/%s (%.2f%% done)"], UnitLevel(frame.unitOwner), UnitLevel(frame.unitOwner) + 1, formatNumber(current), formatNumber(max), (current / max) * 100) + frame.xpBar.xp.tooltip = string.format(L["Level %s - %s: %s/%s (%.2f%% done)"], UnitLevel(frame.unitOwner), UnitLevel(frame.unitOwner) + 1, formatNumber(current), formatNumber(max), (max > 0 and current / max or 0) * 100) end end From a5b933b43bfa8be77dfbb6199a45f5b228f0478c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 28 Sep 2011 11:14:16 -0700 Subject: [PATCH 115/794] Don't hide raid frames if zoning in combat --- ShadowedUnitFrames.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index a2f34d33..3ca9e708 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -413,14 +413,14 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.raid ) then local function hide_raid() - CompactRaidFrameManager:UnregisterEvent("RAID_ROSTER_UPDATE") - CompactRaidFrameManager:UnregisterEvent("PLAYER_ENTERING_WORLD") - CompactRaidFrameManager:Hide() - - local shown = CompactRaidFrameManager_GetSetting("IsShown") - if( shown and shown ~= "0" ) then - CompactRaidFrameManager_SetSetting("IsShown", "0") - end + CompactRaidFrameManager:UnregisterEvent("RAID_ROSTER_UPDATE") + CompactRaidFrameManager:UnregisterEvent("PLAYER_ENTERING_WORLD") + if( not InCombatLockdown() ) then CompactRaidFrameManager:Hide() end + + local shown = CompactRaidFrameManager_GetSetting("IsShown") + if( shown and shown ~= "0" ) then + CompactRaidFrameManager_SetSetting("IsShown", "0") + end end hooksecurefunc("CompactRaidFrameManager_UpdateShown", function() @@ -429,7 +429,7 @@ function ShadowUF:HideBlizzardFrames() end end) - hide_raid(); + hide_raid(); end if( ShadowUF.db.profile.hidden.buffs ) then From 66437043c7a0e1a7768398aaae2f6029b88df6f1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 28 Sep 2011 13:01:07 -0700 Subject: [PATCH 116/794] Unregister... all the events --- ShadowedUnitFrames.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 3ca9e708..c08fc93e 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -413,8 +413,7 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.raid ) then local function hide_raid() - CompactRaidFrameManager:UnregisterEvent("RAID_ROSTER_UPDATE") - CompactRaidFrameManager:UnregisterEvent("PLAYER_ENTERING_WORLD") + CompactRaidFrameManager:UnregisterAllEvents() if( not InCombatLockdown() ) then CompactRaidFrameManager:Hide() end local shown = CompactRaidFrameManager_GetSetting("IsShown") From 2e1395112e6532df2044ab41826598447b055c51 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 28 Sep 2011 20:24:27 -0700 Subject: [PATCH 117/794] Syntax cleanup --- ShadowedUnitFrames.lua | 46 +++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index c08fc93e..a28588a1 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -357,28 +357,12 @@ function ShadowUF:ProfilesChanged() self.modules.movers:Update() end -local function hideCompactParty() - CompactPartyFrame:UnregisterAllEvents() - CompactPartyFrame.Show = ShadowUF.noop - CompactPartyFrame:Hide() - - for i=1, MEMBERS_PER_RAID_GROUP do - local name = "CompactPartyFrameMember" .. i - local frame = _G[name] - frame:UnregisterAllEvents() - end -end - --- Stolen from haste ShadowUF.noop = function() end function ShadowUF:HideBlizzardFrames() - local _, class = UnitClass("player") - if( ShadowUF.db.profile.hidden.runes or class ~= "DEATHKNIGHT" ) then + if( ShadowUF.db.profile.hidden.runes ) then RuneFrame.Show = self.noop RuneFrame:Hide() RuneFrame:UnregisterAllEvents() - elseif( class == "DEATHKNIGHT" ) then - RuneFrame:Show() end if( ShadowUF.db.profile.hidden.cast ) then @@ -399,6 +383,16 @@ function ShadowUF:HideBlizzardFrames() _G[name .. "ManaBar"]:UnregisterAllEvents() end + local function hideCompactParty() + CompactPartyFrame:UnregisterAllEvents() + CompactPartyFrame.Show = ShadowUF.noop + CompactPartyFrame:Hide() + + for i=1, MEMBERS_PER_RAID_GROUP do + _G["CompactPartyFrameMember" .. i]:UnregisterAllEvents() + end + end + if( CompactPartyFrame ) then hideCompactParty() elseif( CompactPartyFrame_Generate ) then @@ -406,13 +400,8 @@ function ShadowUF:HideBlizzardFrames() end end - -- this doesn't really belong here, but oh well! - if( CompactRaidFrameManager ) then - CompactRaidFrameManager:SetFrameStrata("DIALOG") - end - if( ShadowUF.db.profile.hidden.raid ) then - local function hide_raid() + local function hideRaid() CompactRaidFrameManager:UnregisterAllEvents() if( not InCombatLockdown() ) then CompactRaidFrameManager:Hide() end @@ -421,14 +410,16 @@ function ShadowUF:HideBlizzardFrames() CompactRaidFrameManager_SetSetting("IsShown", "0") end end - + hooksecurefunc("CompactRaidFrameManager_UpdateShown", function() if( ShadowUF.db.profile.hidden.raid ) then - hide_raid(); + hideRaid(); end end) - hide_raid(); + hideRaid(); + else + CompactRaidFrameManager:SetFrameStrata("DIALOG") end if( ShadowUF.db.profile.hidden.buffs ) then @@ -445,7 +436,8 @@ function ShadowUF:HideBlizzardFrames() PlayerFrame:UnregisterAllEvents() PlayerFrame.Show = self.noop PlayerFrame:Hide() - + + -- We keep these in case someone is still using the default auras, otherwise it messes up vehicle stuff PlayerFrame:RegisterEvent("UNIT_ENTERING_VEHICLE") PlayerFrame:RegisterEvent("UNIT_ENTERED_VEHICLE") PlayerFrame:RegisterEvent("UNIT_EXITING_VEHICLE") From 8c71d865b7573bc55dff1ec763c3b1053498667c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 28 Sep 2011 22:12:10 -0700 Subject: [PATCH 118/794] Power/quick power/alt power now have their own category in the config, the other misc power bars are split off into a class/misc bars category --- options/config.lua | 72 ++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/options/config.lua b/options/config.lua index 10829fc1..9706b7e6 100644 --- a/options/config.lua +++ b/options/config.lua @@ -3263,12 +3263,49 @@ local function loadUnitOptions() set = setUnit, get = getUnit, args = { - bar = { + powerbar = { order = 1, type = "group", inline = true, - name = L["General"], + name = L["Power bar"], hidden = false, + args = { + powerBar = { + order = 1, + type = "toggle", + name = string.format(L["Enable %s"], L["Power bar"]), + arg = "powerBar.enabled", + }, + altPowerBar = { + order = 2, + type = "toggle", + name = string.format(L["Enable %s"], L["Alt. Power bar"]), + desc = L["Shows a bar for alternate power info (used in some encounters)"], + hidden = hideRestrictedOption, + arg = "altPowerBar.enabled", + }, + predictPower = { + order = 3, + type = "toggle", + name = L["Enable quick power"], + desc = L["Turns fast updating of the power bar on giving you more up to date power information than normal."], + arg = "powerBar.predicted", + }, + }, + }, + classmiscbars = { + order = 2, + type = "group", + inline = true, + name = L["Class/misc bars"], + hidden = function(info) + local unit = info[2] + if( unit == "global" ) then + return not globalConfig.runeBar and not globalConfig.eclipseBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.xpBar + else + return unit ~= "player" + end + end, args = { runeBar = { order = 1, @@ -3286,14 +3323,6 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "eclipseBar.enabled", }, - altPowerBar = { - order = 1.4, - type = "toggle", - name = string.format(L["Enable %s"], L["Alt. Power bar"]), - desc = L["Shows a bar for alternate power info (used in some encounters)"], - hidden = hideRestrictedOption, - arg = "altPowerBar.enabled", - }, totemBar = { order = 1.5, type = "toggle", @@ -3305,7 +3334,7 @@ local function loadUnitOptions() arg = "totemBar.enabled", }, druidBar = { - order = 1, + order = 3, type = "toggle", name = string.format(L["Enable %s"], L["Druid mana bar"]), desc = L["Adds another mana bar to the player frame when you are in Bear or Cat form showing you how much mana you have."], @@ -3313,32 +3342,13 @@ local function loadUnitOptions() arg = "druidBar.enabled", }, xpBar = { - order = 2, + order = 4, type = "toggle", name = string.format(L["Enable %s"], L["XP/Rep bar"]), desc = L["This bar will automatically hide when you are at the level cap, or you do not have any reputations tracked."], hidden = hideRestrictedOption, arg = "xpBar.enabled", }, - sep = { - order = 3, - type = "description", - name = "", - hidden = function(info) return playerClass ~= "DRUID" and playerClass ~= "SHAMAN" and playerClass ~= "DEATHKNIGHT" and info[2] ~= "player" end, - }, - powerBar = { - order = 4, - type = "toggle", - name = string.format(L["Enable %s"], L["Power bar"]), - arg = "powerBar.enabled", - }, - predictPower = { - order = 5, - type = "toggle", - name = L["Enable quick power"], - desc = L["Turns fast updating of the power bar on giving you more up to date power information than normal."], - arg = "powerBar.predicted", - }, }, }, healthBar = { From 1762720dfb755b49125ec7e354841c5ffa12c27f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 29 Sep 2011 09:04:44 -0700 Subject: [PATCH 119/794] Added support for ranged temporary enchants (4.3) - Changed stealable support to be based on stealable or purgable depending on class, will use a different border color if it can be removed. This can also be set in Advanced -> Colors -> Stealable or Removable in options (4.3) --- ShadowedUnitFrames.lua | 6 +++++- modules/auras.lua | 19 +++++++++++++------ modules/defaultlayout.lua | 4 ++++ options/config.lua | 24 +++++++++++++++++++++--- 4 files changed, 43 insertions(+), 10 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index a28588a1..407f3619 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 7 +ShadowUF.dbRevision = 8 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -84,6 +84,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + if( revision <= 7 ) then + self.db.profile.auraColors = {removable = {r = 1, g = 1, b = 1}} + end + if( revision <= 6 ) then for _, unit in pairs({"player", "focus", "target", "raid", "party", "mainassist", "maintank"}) do local db = self.db.profile.units[unit] diff --git a/modules/auras.lua b/modules/auras.lua index f5f02b7f..f238d4d7 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -1,7 +1,7 @@ local Auras = {} local stealableColor = {r = 1, g = 1, b = 1} local playerUnits = {player = true, vehicle = true, pet = true} -local mainHand, offHand, tempEnchantScan = {time = 0}, {time = 0} +local mainHand, offHand, ranged, tempEnchantScan = {time = 0}, {time = 0}, {time = 0} local canCure = ShadowUF.Units.canCure ShadowUF:RegisterModule(Auras, "auras", ShadowUF.L["Auras"]) @@ -421,7 +421,7 @@ tempEnchantScan = function(self, elapsed) if( timeElapsed < 0.50 ) then return end timeElapsed = timeElapsed - 0.50 - local hasMain, mainTimeLeft, mainCharges, hasOff, offTimeLeft, offCharges = GetWeaponEnchantInfo() + local hasMain, mainTimeLeft, mainCharges, hasOff, offTimeLeft, offCharges, hasRanged, rangedTimeLeft, rangedCharges = GetWeaponEnchantInfo() self.temporaryEnchants = 0 if( hasMain ) then @@ -440,6 +440,13 @@ tempEnchantScan = function(self, elapsed) offHand.has = hasOff + if( hasRanged and self.temporaryEnchants < self.maxAuras ) then + self.temporaryEcnhants = self.temporaryEnchants + 1 + updateTemporaryEnchant(self, 18, ranged, hasRanged, rangedTimeLeft or 0, rangedCharges) + end + + ranged.has = hasRanged + -- Update if totals changed if( self.lastTemporary ~= self.temporaryEnchants ) then self.lastTemporary = self.temporaryEnchants @@ -471,7 +478,7 @@ local function scan(parent, frame, type, config, filter) local index = 0 while( true ) do index = index + 1 - local name, rank, texture, count, auraType, duration, endTime, caster, isStealable = UnitAura(frame.parent.unit, index, filter) + local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable = UnitAura(frame.parent.unit, index, filter) if( not name ) then break end if( ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and parent.whitelist[name] or parent.blacklist[type] and not parent.blacklist[name] ) and ( not curable or canCure[auraType] ) ) then @@ -483,8 +490,8 @@ local function scan(parent, frame, type, config, filter) -- Show debuff border, or a special colored border if it's stealable local button = frame.buttons[frame.totalAuras] - if( isStealable and not isFriendly and not ShadowUF.db.profile.auras.disableColor ) then - button.border:SetVertexColor(stealableColor.r, stealableColor.g, stealableColor.b) + if( isRemovable and not isFriendly and not ShadowUF.db.profile.auras.disableColor ) then + button.border:SetVertexColor(ShadowUF.db.profile.auraColors.removable.r, ShadowUF.db.profile.auraColors.removable.g, ShadowUF.db.profile.auraColors.removable.b) elseif( ( not isFriendly or type == "debuffs" ) and not ShadowUF.db.profile.auras.disableColor ) then local color = auraType and DebuffTypeColor[auraType] or DebuffTypeColor.none button.border:SetVertexColor(color.r, color.g, color.b) @@ -501,7 +508,7 @@ local function scan(parent, frame, type, config, filter) end -- Enlarge our own auras - if( config.enlargeSelf and playerUnits[caster] or ( isStealable and not isFriendly and config.enlargeStealable ) ) then + if( config.enlargeSelf and playerUnits[caster] or ( isRemovable and not isFriendly and config.enlargeStealable ) ) then button.isSelfScaled = true button:SetScale(config.selfScale) else diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 2120a9d6..6dd15fd8 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -120,6 +120,10 @@ function ShadowUF:LoadDefaultLayout(useMerge) config.font.name = SML.DefaultMedia.font end + config.auraColors = { + removable = {r = 1, g = 1, b = 1} + } + config.classColors = { HUNTER = {r = 0.67, g = 0.83, b = 0.45}, WARLOCK = {r = 0.58, g = 0.51, b = 0.79}, diff --git a/options/config.lua b/options/config.lua index 9706b7e6..6f03f60c 100644 --- a/options/config.lua +++ b/options/config.lua @@ -1029,7 +1029,7 @@ local function loadGeneralOptions() desc = L["Health bar color to use for hostile units who you cannot attack, used for reaction coloring."], hidden = hideAdvancedOption, arg = "healthColors.enemyUnattack", - }, + } }, }, power = { @@ -1192,6 +1192,24 @@ local function loadGeneralOptions() }, }, }, + auras = { + order = 3.5, + type = "group", + inline = true, + name = L["Aura borders"], + set = setColor, + get = getColor, + hidden = hideAdvancedOption, + args = { + removableColor = { + order = 0, + type = "color", + name = L["Stealable or Removable"], + desc = L["Border coloring of stealable or removable auras."], + arg = "auraColors.removable", + } + } + }, classColors = { order = 4, type = "group", @@ -1880,8 +1898,8 @@ local function loadUnitOptions() enlargeStealable = { order = 6.5, type = "toggle", - name = L["Enlarge stealable auras"], - desc = L["If you can Spellsteal an aura, then it will be shown scaled using the scaled aura size option."], + name = L["Enlarge removable auras"], + desc = L["If you can Spellsteal or remove an aura, then it will be shown scaled using the scaled aura size option."], arg = "auras.$parent.enlargeStealable", hidden = hideStealable, }, From 4baa869f9b22d91207a2365fa1e4b2fe084d0f10 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 2 Oct 2011 14:24:54 -0700 Subject: [PATCH 120/794] Fixed raid hiding, actually hides in <= 5 raids, not < 5 raids --- modules/tags.lua | 8 ++++---- modules/units.lua | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index cfbfde47..13a4f997 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -780,16 +780,16 @@ Tags.defaultTags = { return UnitPower(unit, 0) end]], ["abs:incheal"] = [[function(unit, unitOwner, fontString) - local heal = UnitGetIncomingHeals(unit) - return heal and string.format("%d", heal) + local heal = UnitGetIncomingHeals(unit) + return heal and heal > 0 and string.format("%d", heal) end]], ["incheal"] = [[function(unit, unitOwner, fontString) local heal = UnitGetIncomingHeals(unit) - return heal and ShadowUF:FormatLargeNumber(heal) + return heal and heal > 0 and ShadowUF:FormatLargeNumber(heal) end]], ["incheal:name"] = [[function(unit, unitOwner, fontString) local heal = UnitGetIncomingHeals(unit) - return heal and string.format("+%d", heal) or ShadowUF.tagFunc.name(unit, unitOwner) + return heal and heal > 0 and string.format("+%d", heal) or ShadowUF.tagFunc.name(unit, unitOwner) end]], ["unit:raid:targeting"] = [[function(unit, unitOwner, fontString) if( GetNumRaidMembers() == 0 ) then return nil end diff --git a/modules/units.lua b/modules/units.lua index 56eef0e4..3b448a66 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -1017,14 +1017,14 @@ function Units:LoadGroupHeader(type) if( name ~= "state-raidmonitor" and name ~= "raiddisabled" and name ~= "hidesemiraid" ) then return end if( self:GetAttribute("raidDisabled") ) then return end - if( self:GetAttribute("hideSemiRaid") and self:GetAttribute("state-raidmonitor") ~= "raid5" ) then + if( self:GetAttribute("hideSemiRaid") and self:GetAttribute("state-raidmonitor") ~= "raid6" ) then self:GetFrameRef("raidHeader"):Hide() else self:GetFrameRef("raidHeader"):Show() end ]]) - RegisterStateDriver(stateMonitor.raid, "raidmonitor", "[target=raid5, exists] raid5; none") + RegisterStateDriver(stateMonitor.raid, "raidmonitor", "[target=raid6, exists] raid6; none") else headerFrame:Show() end From 70c373838f6c3285f1d7cc8e7f71af53405d337a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 2 Oct 2011 20:48:52 -0700 Subject: [PATCH 121/794] Fixed color by reaction type on empty bar --- modules/empty.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/empty.lua b/modules/empty.lua index b8d07bb4..f3fc9d3e 100644 --- a/modules/empty.lua +++ b/modules/empty.lua @@ -19,7 +19,7 @@ function Empty:OnLayoutApplied(frame) local color = frame.emptyBar.background.overrideColor or fallbackColor frame.emptyBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) - if( ShadowUF.db.profile.units[frame.unitType].emptyBar.reaction or ShadowUF.db.profile.units[frame.unitType].emptyBar.class ) then + if( ShadowUF.db.profile.units[frame.unitType].emptyBar.reactionType or ShadowUF.db.profile.units[frame.unitType].emptyBar.class ) then frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdateColor") frame:RegisterUpdateFunc(self, "UpdateColor") else From 8887bc72f0769cc238735d308579103067db8a83 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 2 Oct 2011 20:49:07 -0700 Subject: [PATCH 122/794] Removed a lonely comma and replaced it with a period. --- options/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index 6f03f60c..8fa59eca 100644 --- a/options/config.lua +++ b/options/config.lua @@ -3475,7 +3475,7 @@ local function loadUnitOptions() order = 3, type = "toggle", name = L["Color by class"], - desc = L["Players will be colored by class, "], + desc = L["Players will be colored by class."], arg = "emptyBar.class", }, overrideColor = { From aaf18c1747392631164dd7e58dcad944f181536b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 2 Oct 2011 20:52:26 -0700 Subject: [PATCH 123/794] Removed some old debug code --- modules/portrait.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/portrait.lua b/modules/portrait.lua index 226eb1b9..ce4a8280 100755 --- a/modules/portrait.lua +++ b/modules/portrait.lua @@ -14,11 +14,6 @@ function Portrait:OnEnable(frame) frame:RegisterUnitEvent("UNIT_PORTRAIT_UPDATE", self, "UpdateFunc") frame:RegisterUnitEvent("UNIT_MODEL_CHANGED", self, "Update") - if( frame.unitRealType == "party" ) then - -- frame:RegisterNormalEvent("PARTY_MEMBER_ENABLE", self, "Update") - -- frame:RegisterNormalEvent("PARTY_MEMBER_DISABLE", self, "Update") - end - frame:RegisterUpdateFunc(self, "UpdateFunc") end From 5991bd0df96f549480aa57dcb6c17e695fda3844 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 2 Oct 2011 21:16:24 -0700 Subject: [PATCH 124/794] Some more old code removed --- modules/units.lua | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 3b448a66..d1f936e0 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -299,18 +299,6 @@ function Units:CheckVehicleStatus(frame, event, unit) frame.unitGUID = UnitGUID(frame.unit) frame:FullUpdate() end - - -- Keep track of the actual players unit so we can quickly see what unit to scan - --[[ - if( frame.unitOwner == "player" and ShadowUF.playerUnit ~= frame.unit ) then - ShadowUF.playerUnit = frame.unit - - if( not ShadowUF.db.profile.hidden.buffs and ShadowUF.db.profile.units.player.enabled and BuffFrame:IsVisible() ) then - PlayerFrame.unit = frame.unit - BuffFrame_Update() - end - end - ]] end -- Handles checking for GUID changes for doing a full update, this fixes frames sometimes showing the wrong unit when they change From 53f721b6798571b9de1f235b097f8156bd2e889a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 2 Oct 2011 23:25:48 -0700 Subject: [PATCH 125/794] Added the ability to right click cancel your own auras while out of combat back, since Blizzard loosened their restrictions --- modules/auras.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/auras.lua b/modules/auras.lua index f238d4d7..ec4a23e8 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -198,6 +198,14 @@ local function hideTooltip(self) GameTooltip:Hide() end +local function cancelAura(self, mouse) + if( mouse ~= "RightButton" or not UnitIsPlayer(self.parent.unit) or InCombatLockdown() or self.filter == "TEMP" ) then + return + end + + CancelUnitBuff("player", self.auraID, self.filter) +end + local function updateButton(id, group, config) local button = group.buttons[id] if( not button ) then @@ -250,6 +258,8 @@ local function updateButton(id, group, config) button:SetWidth(config.size) button.border:SetHeight(config.size + 1) button.border:SetWidth(config.size + 1) + button:SetScript("OnClick", cancelAura) + button.parent = group.parent button:ClearAllPoints() button:Hide() From 3652ad89d499060dcf300de456ebd26cbaf9a0c1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 4 Oct 2011 08:43:35 -0700 Subject: [PATCH 126/794] Small performance improvement, when using predicted health updates, only update on _FREQUENT rather than UNIT_HEALTH as well --- modules/health.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/health.lua b/modules/health.lua index a10ff965..1639440b 100644 --- a/modules/health.lua +++ b/modules/health.lua @@ -30,7 +30,6 @@ function Health:OnEnable(frame) frame.healthBar = ShadowUF.Units:CreateBar(frame) end - frame:RegisterUnitEvent("UNIT_HEALTH", self, "Update") frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "Update") frame:RegisterUnitEvent("UNIT_CONNECTION", self, "Update") frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdateColor") @@ -49,8 +48,10 @@ function Health:OnLayoutApplied(frame) if( ShadowUF.db.profile.units[frame.unitType].healthBar.predicted ) then frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "UpdateFrequent") + frame:UnregisterEvent("UNIT_HEALTH", self) else frame:UnregisterEvent("UNIT_HEALTH_FREQUENT", self) + frame:RegisterUnitEvent("UNIT_HEALTH", self, "Update") end end @@ -110,8 +111,7 @@ function Health:UpdateColor(frame) end function Health:UpdateFrequent(frame) - frame.healthBar.currentHealth = UnitHealth(frame.unit) - frame.healthBar:SetValue(frame.healthBar.currentHealth) + self:Update(frame) -- As much as I would rather not have to do this in an OnUpdate, I don't have much choice large health changes in a single update will make them very clearly be lagging behind for _, fontString in pairs(frame.fontStrings) do From d7c08a7b343857b014e900d6bd212798a6b196aa Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 11 Oct 2011 20:35:35 -0700 Subject: [PATCH 127/794] Slightly increase the config frame height - Added a 'currently modifying' box above global options to make it explicit what units you will modify when using global config' --- options/config.lua | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/options/config.lua b/options/config.lua index 8fa59eca..c76a3612 100644 --- a/options/config.lua +++ b/options/config.lua @@ -3900,6 +3900,10 @@ local function loadUnitOptions() }, } + local sort_units = function(a, b) + return a < b + end + options.args.units = { type = "group", name = L["Unit configuration"], @@ -3925,9 +3929,36 @@ local function loadUnitOptions() order = 0, name = L["Global"], args = { - units = { + test = { order = 0, type = "group", + name = L["Currently modifying"], + inline = true, + hidden = function() + for k in pairs(modifyUnits) do return false end + return true + end, + args = { + info = { + order = 0, + type = "description", + name = function() + local units = {}; + for unit, enabled in pairs(modifyUnits) do + if( enabled ) then + table.insert(units, L.units[unit]) + end + end + + table.sort(units, sort_units) + return table.concat(units, ", ") + end, + } + } + }, + units = { + order = 1, + type = "group", name = L["Units"], set = function(info, value) local unit = info[#(info)] @@ -5446,7 +5477,7 @@ function Config:Open() loadOptions() LibStub("AceConfig-3.0"):RegisterOptionsTable("ShadowedUF", options) - AceDialog:SetDefaultSize("ShadowedUF", 835, 525) + AceDialog:SetDefaultSize("ShadowedUF", 835, 550) registered = true end From e73fefadb98810519d233d91e983648f969c1def Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 17 Oct 2011 19:29:49 -0700 Subject: [PATCH 128/794] Flagged Mages as being able to cure Curses --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index d1f936e0..ec511d3d 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -5,7 +5,7 @@ Units.zoneUnits = {["arena"] = "arena", ["boss"] = "raid"} local stateMonitor = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") local playerClass = select(2, UnitClass("player")) local unitFrames, headerFrames, frameList, unitEvents, childUnits, queuedCombat, canCure = Units.unitFrames, Units.headerFrames, Units.frameList, Units.unitEvents, Units.childUnits, {}, Units.canCure -local curableData = {["PRIEST"] = {["Magic"] = true, ["Disease"] = true}, ["DRUID"] = {["Curse"] = true, ["Poison"] = true, ["Magic"] = GetSpellInfo(88423)}, ["SHAMAN"] = {["Curse"] = true, ["Magic"] = GetSpellInfo(77130)}, ["PALADIN"] = {["Poison"] = true, ["Disease"] = true, ["Magic"] = GetSpellInfo(53551)}} +local curableData = {["PRIEST"] = {["Magic"] = true, ["Disease"] = true}, ["DRUID"] = {["Curse"] = true, ["Poison"] = true, ["Magic"] = GetSpellInfo(88423)}, ["SHAMAN"] = {["Curse"] = true, ["Magic"] = GetSpellInfo(77130)}, ["PALADIN"] = {["Poison"] = true, ["Disease"] = true, ["Magic"] = GetSpellInfo(53551)}, ["MAGE"] = {["Curse"] = true}} local _G = getfenv(0) ShadowUF.Units = Units From 07e11b7d9dfae0b6fca068846162fcb4d58a0752 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 17 Oct 2011 22:28:45 -0700 Subject: [PATCH 129/794] Fixed ordering of predicted power setting --- options/config.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/options/config.lua b/options/config.lua index c76a3612..530e0f9c 100644 --- a/options/config.lua +++ b/options/config.lua @@ -36,17 +36,17 @@ local PAGE_DESC = { ["tags"] = L["Advanced tag management, allows you to add your own custom tags."], ["filter"] = L["Simple aura filtering by whitelists and blacklists."], } -local INDICATOR_NAMES = {["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon role"], ["masterLoot"] = L["Master looter"], ["pvp"] = L["PvP Flag"],["raidTarget"] = L["Raid target"], ["ready"] = L["Ready status"], ["role"] = L["Raid role"], ["status"] = L["Combat status"], ["class"] = L["Class icon"], ["resurrect"] = L["Resurrect status"], ["phase"] = L["Phase status"]} -local AREA_NAMES = {["arena"] = L["Arenas"],["none"] = L["Everywhere else"], ["party"] = L["Party instances"], ["pvp"] = L["Battlegrounds"], ["raid"] = L["Raid instances"],} +local INDICATOR_NAMES = {["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon role"], ["masterLoot"] = L["Master looter"], ["pvp"] = L["PvP Flag"], ["raidTarget"] = L["Raid target"], ["ready"] = L["Ready status"], ["role"] = L["Raid role"], ["status"] = L["Combat status"], ["class"] = L["Class icon"], ["resurrect"] = L["Resurrect status"], ["phase"] = L["Phase status"]} +local AREA_NAMES = {["arena"] = L["Arenas"],["none"] = L["Everywhere else"], ["party"] = L["Party instances"], ["pvp"] = L["Battlegrounds"], ["raid"] = L["Raid instances"]} local INDICATOR_DESC = { ["leader"] = L["Crown indicator for group leaders."], ["lfdRole"] = L["Role the unit is playing in dungeons formed through the Looking For Dungeon system."], ["masterLoot"] = L["Bag indicator for master looters."], ["pvp"] = L["PVP flag indicator, Horde for Horde flagged pvpers and Alliance for Alliance flagged pvpers."], ["raidTarget"] = L["Raid target indicator."], ["ready"] = L["Ready status of group members."], ["role"] = L["Raid role indicator, adds a shield indicator for main tanks and a sword icon for main assists."], ["status"] = L["Status indicator, shows if the unit is currently in combat. For the player it will also show if you are rested."], ["class"] = L["Class icon for players."]} -local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"],} +local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"]} local pointPositions = {["BOTTOM"] = L["Bottom"], ["TOP"] = L["Top"], ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["TOPLEFT"] = L["Top Left"], ["TOPRIGHT"] = L["Top Right"], ["BOTTOMLEFT"] = L["Bottom Left"], ["BOTTOMRIGHT"] = L["Bottom Right"], ["CENTER"] = L["Center"]} -local positionList = {["C"] = L["Center"], ["RT"] = L["Right Top"], ["RC"] = L["Right Center"], ["RB"] = L["Right Bottom"], ["LT"] = L["Left Top"], ["LC"] = L["Left Center"], ["LB"] = L["Left Bottom"], ["BL"] = L["Bottom Left"], ["BC"] = L["Bottom Center"], ["BR"] = L["Bottom Right"], ["TR"] = L["Top Right"], ["TC"] = L["Top Center"], ["TL"] = L["Top Left"] } +local positionList = {["C"] = L["Center"], ["RT"] = L["Right Top"], ["RC"] = L["Right Center"], ["RB"] = L["Right Bottom"], ["LT"] = L["Left Top"], ["LC"] = L["Left Center"], ["LB"] = L["Left Bottom"], ["BL"] = L["Bottom Left"], ["BC"] = L["Bottom Center"], ["BR"] = L["Bottom Right"], ["TR"] = L["Top Right"], ["TC"] = L["Top Center"], ["TL"] = L["Top Left"]} local unitOrder = {} for order, unit in pairs(ShadowUF.unitList) do unitOrder[unit] = order end @@ -3294,21 +3294,21 @@ local function loadUnitOptions() name = string.format(L["Enable %s"], L["Power bar"]), arg = "powerBar.enabled", }, - altPowerBar = { + predictPower = { order = 2, type = "toggle", + name = L["Enable quick power"], + desc = L["Turns fast updating of the power bar on giving you more up to date power information than normal."], + arg = "powerBar.predicted", + }, + altPowerBar = { + order = 3, + type = "toggle", name = string.format(L["Enable %s"], L["Alt. Power bar"]), desc = L["Shows a bar for alternate power info (used in some encounters)"], hidden = hideRestrictedOption, arg = "altPowerBar.enabled", }, - predictPower = { - order = 3, - type = "toggle", - name = L["Enable quick power"], - desc = L["Turns fast updating of the power bar on giving you more up to date power information than normal."], - arg = "powerBar.predicted", - }, }, }, classmiscbars = { From 3d7a0fa9fb8e7efa2373e454e433455ae39762a7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 18 Oct 2011 18:43:56 -0700 Subject: [PATCH 130/794] Remove really really old LibHealComm code in the incheal module --- modules/incheal.lua | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index 51abc8bb..6d371213 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -1,7 +1,6 @@ local IncHeal = {} local frames = {} ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) -ShadowUF.Tags.customEvents["HEALCOMM"] = IncHeal function IncHeal:OnEnable(frame) frames[frame] = true @@ -16,10 +15,6 @@ end function IncHeal:OnDisable(frame) frame:UnregisterAll(self) frame.incHeal:Hide() - - if( not frame.hasHCTag ) then - frames[frame] = nil - end end function IncHeal:OnLayoutApplied(frame) @@ -58,40 +53,10 @@ function IncHeal:OnLayoutApplied(frame) end end --- Since I don't want a more complicated system where both incheal.lua and tags.lua are watching the same events --- I'll update the HC tags through here instead -function IncHeal:EnableTag(frame) - frames[frame] = true - frame.hasHCTag = true -end - -function IncHeal:DisableTag(frame) - frame.hasHCTag = nil - - if( not frame.visibility.incHeal ) then - frames[frame] = nil - end -end - --- Update any tags using HC -function IncHeal:UpdateTags(frame, amount) - if( not frame.fontStrings or not frame.hasHCTag ) then return end - - for _, fontString in pairs(frame.fontStrings) do - if( fontString.HEALCOMM ) then - fontString.incoming = amount > 0 and amount or nil - fontString:UpdateTags() - end - end -end - function IncHeal:UpdateFrame(frame) -- This makes sure that when a heal like Tranquility is cast, it won't show the entire cast but cap it at 4 seconds into the future local healed = UnitGetIncomingHeals(frame.unit) or 0 - - -- Update any tags that are using HC data - IncHeal:UpdateTags(frame, healed) - + -- Bar is also supposed to be enabled, lets update that too if( frame.visibility.incHeal and frame.visibility.healthBar ) then if( healed > 0 ) then From 997497648f36fe7b601afee021450603d426e03d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 18 Oct 2011 18:47:15 -0700 Subject: [PATCH 131/794] Missed two variables --- modules/incheal.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index 6d371213..87236f58 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -1,14 +1,13 @@ local IncHeal = {} -local frames = {} ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) function IncHeal:OnEnable(frame) - frames[frame] = true frame.incHeal = frame.incHeal or ShadowUF.Units:CreateBar(frame) frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") + frame:RegisterUpdateFunc(self, "UpdateFrame") end From fc35182f829f6b39b4e288abdd76c2e4b7ed9ab8 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 24 Oct 2011 23:15:19 -0700 Subject: [PATCH 132/794] Phase indicators should only be shown for party units, removed the old ones. Also fixed a bug with phase indicators showing inappropriately --- ShadowedUnitFrames.lua | 18 +++++++++++++- modules/defaultlayout.lua | 6 ----- modules/incheal.lua | 21 +++++++++++++--- modules/indicators.lua | 2 +- options/config.lua | 52 +++++++++++++++++++++++++++------------ 5 files changed, 71 insertions(+), 28 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 407f3619..8d9393d1 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 8 +ShadowUF.dbRevision = 10 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -84,6 +84,22 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + if( revision <= 9 ) then + for unit, config in pairs(self.db.profile.units) do + if( unit ~= "party" and config.indicators and config.indicators.phase ) then + config.indicators.phase = nil + end + end + end + + if( revision <= 8 ) then + for unit, config in pairs(self.db.profile.units) do + if( config.incHeal ) then + config.incHeal.heals = config.incHeal.enabled + end + end + end + if( revision <= 7 ) then self.db.profile.auraColors = {removable = {r = 1, g = 1, b = 1}} end diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 6dd15fd8..6a7961b5 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -263,7 +263,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) role = {enabled = false, anchorTo = "$parent", anchorPoint = "BR", size = 14, x = 0, y = 14}, ready = {anchorTo = "$parent", anchorPoint = "LC", size = 24, x = 25, y = 0}, resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, - phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, text = { {text = "[(()afk() )][name]"}, @@ -317,7 +316,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, - phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, auras = { buffs = {enabled = false, maxRows = 1, temporary = playerClass == "ROGUE" or playerClass == "SHAMAN"}, @@ -457,7 +455,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) castBar = {order = 60}, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, - phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, auras = { buffs = {enabled = false}, @@ -502,7 +499,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) castBar = {order = 60}, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, - phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, auras = { buffs = {enabled = false}, @@ -571,7 +567,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) indicators = { lfdRole = {enabled = false}, resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, - phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, auras = { buffs = {enabled = true}, @@ -626,7 +621,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) indicators = { lfdRole = {enabled = false}, resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, - phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, text = { {text = "[(()afk() )][name]"}, diff --git a/modules/incheal.lua b/modules/incheal.lua index 87236f58..9dbecd29 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -4,11 +4,19 @@ ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) function IncHeal:OnEnable(frame) frame.incHeal = frame.incHeal or ShadowUF.Units:CreateBar(frame) - frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") - frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") - frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") + if( ShadowUF.db.profile.units[frame.unitType].incHeal.heals ) then + frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") + end - frame:RegisterUpdateFunc(self, "UpdateFrame") + if( ShadowUF.db.profile.units[frame.unitType].incHeal.absorbs ) then + frame:RegisterUnitEvent("UNIT_AURA", self, "CalculateAbsorb") + frame:RegisterUpdateFunc(self, "CalculateAbsorb") + -- Since CalculateAbsorb already calls UpdateFrame, we don't need to explicitly do it + else + frame:RegisterUpdateFunc(self, "UpdateFrame") + end end function IncHeal:OnDisable(frame) @@ -52,6 +60,11 @@ function IncHeal:OnLayoutApplied(frame) end end +function IncHeal:CalculateAbsorb(frame) + + self:UpdateFrame(frame) +end + function IncHeal:UpdateFrame(frame) -- This makes sure that when a heal like Tranquility is cast, it won't show the entire cast but cap it at 4 seconds into the future local healed = UnitGetIncomingHeals(frame.unit) or 0 diff --git a/modules/indicators.lua b/modules/indicators.lua index 8244a31f..59021a29 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -20,7 +20,7 @@ end function Indicators:UpdatePhase(frame) if( not frame.indicators.phase or not frame.indicators.phase.enabled ) then return end - if( UnitIsPlayer(frame.unit) and not UnitInPhase(frame.unit) ) then + if( UnitExists(frame.unit) and UnitIsPlayer(frame.unit) and not UnitInPhase(frame.unit) ) then frame.indicators.phase:Show() else frame.indicators.phase:Hide() diff --git a/options/config.lua b/options/config.lua index 530e0f9c..e56b3b42 100644 --- a/options/config.lua +++ b/options/config.lua @@ -219,16 +219,7 @@ local function specialRestricted(unit, moduleKey, moduleSubKey, key) end end -local function setUnit(info, value) - local unit = info[2] - -- auras, buffs, enabled / text, 1, text / portrait, enabled - local moduleKey, moduleSubKey, key = string.split(".", info.arg) - if( not moduleSubKey ) then key = moduleKey moduleKey = nil end - if( moduleSubKey and not key ) then key = moduleSubKey moduleSubKey = nil end - if( moduleSubKey == "$parent" ) then moduleSubKey = info[#(info) - 1] end - if( moduleKey == "$parent" ) then moduleKey = info[#(info) - 1] end - if( tonumber(moduleSubKey) ) then moduleSubKey = tonumber(moduleSubKey) end - +local function setDirectUnit(unit, moduleKey, moduleSubKey, key, value) if( unit == "global" ) then for unit in pairs(modifyUnits) do if( not specialRestricted(unit, moduleKey, moduleSubKey, key) ) then @@ -242,6 +233,19 @@ local function setUnit(info, value) end end +local function setUnit(info, value) + local unit = info[2] + -- auras, buffs, enabled / text, 1, text / portrait, enabled + local moduleKey, moduleSubKey, key = string.split(".", info.arg) + if( not moduleSubKey ) then key = moduleKey moduleKey = nil end + if( moduleSubKey and not key ) then key = moduleSubKey moduleSubKey = nil end + if( moduleSubKey == "$parent" ) then moduleSubKey = info[#(info) - 1] end + if( moduleKey == "$parent" ) then moduleKey = info[#(info) - 1] end + if( tonumber(moduleSubKey) ) then moduleSubKey = tonumber(moduleSubKey) end + + setDirectUnit(unit, moduleKey, moduleSubKey, key, value) +end + local function getVariable(unit, moduleKey, moduleSubKey, key) local configTbl = unit == "global" and globalConfig or ShadowUF.db.profile.units[unit] if( moduleKey and moduleSubKey ) then @@ -3425,20 +3429,36 @@ local function loadUnitOptions() order = 3, type = "group", inline = true, - name = L["Incoming heals"], + name = L["Incoming heals and absorbs"], hidden = hideRestrictedOption, disabled = function(info) return not getVariable(info[2], "healthBar", nil, "enabled") end, args = { - enabled = { + heals = { order = 1, type = "toggle", - name = string.format(L["Enable %s"], L["Incoming heals"]), - desc = L["Adds a bar inside the health bar indicating how much healing someone is estimated to be receiving."], - arg = "incHeal.enabled", + name = L["Show incoming heals"], + desc = L["Adds a bar inside the health bar indicating how much healing someone will receive."], + arg = "incHeal.heals", hidden = false, + set = function(info, value) + setUnit(info, value) + setDirectUnit(info[2], "incHeal", nil, "enabled", getVariable(info[2], "incHeal", nil, "absorbs") or getVariable(info[2], "incHeal", nil, "heals")) + end }, - cap = { + absorbs = { order = 2, + type = "toggle", + name = L["Show current absorbs"], + desc = L["Adds a bar inside the health bar indicating how much damage absorbed they have."], + arg = "incHeal.absorbs", + hidden = false, + set = function(info, value) + setUnit(info, value) + setDirectUnit(info[2], "incHeal", nil, "enabled", getVariable(info[2], "incHeal", nil, "absorbs") or getVariable(info[2], "incHeal", nil, "heals")) + end + }, + cap = { + order = 3, type = "range", name = L["Outside bar limit"], desc = L["Percentage value of how far outside the unit frame the incoming heal bar can go. 130% means it will go 30% outside the frame, 100% means it will not go outside."], From dd5f18f9859cf37f1b92b50b440a4e53aabfd6e4 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 25 Oct 2011 15:57:37 -0700 Subject: [PATCH 133/794] Dummy commit to force a relocalization package --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 4721b414..c3356b59 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -52,4 +52,4 @@ modules\holypower.lua modules\altpower.lua #@do-not-package@ options\config.lua -#@end-do-not-package@ \ No newline at end of file +#@end-do-not-package@ From ba1a4b6c278764a525da2c1a61437bb40f30a57b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 26 Oct 2011 22:29:00 -0700 Subject: [PATCH 134/794] Comment out all of the current absorb code for the time being since Blizzards implementation makes it infeasible --- modules/incheal.lua | 81 +++++++++++++++++++++++++++++++++++++++------ modules/tags.lua | 28 ++++++++++++++-- options/config.lua | 29 ++++++++-------- 3 files changed, 112 insertions(+), 26 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index 9dbecd29..bb029b4d 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -1,5 +1,7 @@ local IncHeal = {} +local frames = {} ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) +-- ShadowUF.Tags.customEvents["CRTABS"] = IncHeal function IncHeal:OnEnable(frame) frame.incHeal = frame.incHeal or ShadowUF.Units:CreateBar(frame) @@ -10,13 +12,13 @@ function IncHeal:OnEnable(frame) frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") end - if( ShadowUF.db.profile.units[frame.unitType].incHeal.absorbs ) then - frame:RegisterUnitEvent("UNIT_AURA", self, "CalculateAbsorb") - frame:RegisterUpdateFunc(self, "CalculateAbsorb") - -- Since CalculateAbsorb already calls UpdateFrame, we don't need to explicitly do it - else + -- if( ShadowUF.db.profile.units[frame.unitType].incHeal.absorbs ) then + -- frame:RegisterUnitEvent("UNIT_AURA", self, "CalculateAbsorb") + -- frame:RegisterUpdateFunc(self, "CalculateAbsorb") + -- -- Since CalculateAbsorb already calls UpdateFrame, we don't need to explicitly do it + -- else frame:RegisterUpdateFunc(self, "UpdateFrame") - end + -- end end function IncHeal:OnDisable(frame) @@ -60,10 +62,69 @@ function IncHeal:OnLayoutApplied(frame) end end -function IncHeal:CalculateAbsorb(frame) - - self:UpdateFrame(frame) -end +-- function IncHeal:EnableTag(frame, fontString) +-- if( not frames[frame] ) then frames[frame] = {} end +-- +-- frames[frame][fontString] = true +-- +-- -- Need to register the events since we're not watching them by default +-- if( not frame.tagEnabled and not ShadowUF.db.profile.units[frame.unitType].incHeal.absorbs ) then +-- frame:RegisterUnitEvent("UNIT_AURA", self, "CalculateAbsorb") +-- frame:RegisterUpdateFunc(self, "CalculateAbsorb") +-- +-- -- And unregister the default updater since it's used by default +-- if( ShadowUF.db.profileunits[frame.unitType].incHeal.heals ) then +-- frame:UnregisterUpdateFunc(self, "UpdateFrame") +-- end +-- end +-- +-- frame.tagEnabled = true; +-- end +-- +-- function IncHeal:DisableTag(frame, fontString) +-- if( not frames[frame] or not frames[frame][fontString] ) then return end +-- +-- frames[frame][fontString] = nil +-- frame.tagEnabled = nil +-- for _, _ in pairs(frames[frame]) do +-- frame.tagEnabled = true +-- break +-- end +-- +-- if( frame.tagEnabled ) then return end +-- +-- -- Need to unrregister the events since we're not watching them by default +-- if( not ShadowUF.db.profile.units[frame.unitType].incHeal.absorbs ) then +-- frame:UnregisterUnitEvent("UNIT_AURA", self, "CalculateAbsorb") +-- frame:UnregisterUpdateFunc(self, "CalculateAbsorb") +-- +-- -- Also register the default updater since we used it by default +-- if( ShadowUF.db.profileunits[frame.unitType].incHeal.heals ) then +-- frame:RegisterUpdateFunc(self, "UpdateFrame") +-- end +-- end +-- end +-- +-- function IncHeal:CalculateAbsorb(frame) +-- frame.absorb = 0 +-- +-- local index = 0 +-- while( true ) do +-- index = index + 1 +-- local name, _, _, _, _, _, _, _, _, _, _, _, _, absorbAmount = UnitAura(frame.unit, index, "HELPFUL")) +-- if( not name ) then break end +-- +-- +-- end +-- +-- if( frame.tagEnabled ) then +-- for fontString, _ in pairs(frames[frame]) do +-- fontString:UpdateTags() +-- end +-- end +-- +-- self:UpdateFrame(frame) +-- end function IncHeal:UpdateFrame(frame) -- This makes sure that when a heal like Tranquility is cast, it won't show the entire cast but cap it at 4 seconds into the future diff --git a/modules/tags.lua b/modules/tags.lua index 13a4f997..f124f726 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -779,6 +779,18 @@ Tags.defaultTags = { if( powerType ~= 1 and powerType ~= 3 ) then return nil end return UnitPower(unit, 0) end]], + -- ["abs:crtabs"] = [[function(unit, unitOwner, fontString) + -- local absorb = fontString.parent.absorb + -- return absorb > 0 and string.format("%d", absorb) + -- ]], + -- ["crtabs"] = [[function(unit, unitOwner, fontString) + -- local absorb = fontString.parent.absorb + -- return absorb > 0 and ShadowUF:FormatLargeNumber(absorb) + -- ]], + -- ["crtabs:name"] = [[function(unit, unitOwner, fontString) + -- local absorb = fontString.parent.absorb + -- return absorb > 0 and string.format("+%d", heal) or ShadowUF.tagFunc.name(unit, unitOwner, fontString) + -- ]], ["abs:incheal"] = [[function(unit, unitOwner, fontString) local heal = UnitGetIncomingHeals(unit) return heal and heal > 0 and string.format("%d", heal) @@ -789,7 +801,7 @@ Tags.defaultTags = { end]], ["incheal:name"] = [[function(unit, unitOwner, fontString) local heal = UnitGetIncomingHeals(unit) - return heal and heal > 0 and string.format("+%d", heal) or ShadowUF.tagFunc.name(unit, unitOwner) + return heal and heal > 0 and string.format("+%d", heal) or ShadowUF.tagFunc.name(unit, unitOwner, fontString) end]], ["unit:raid:targeting"] = [[function(unit, unitOwner, fontString) if( GetNumRaidMembers() == 0 ) then return nil end @@ -826,10 +838,13 @@ Tags.defaultEvents = { ["hp:color"] = "UNIT_HEALTH UNIT_MAXHEALTH", ["short:druidform"] = "UNIT_AURA", ["druidform"] = "UNIT_AURA", - ["guild"] = "UNIT_NAME_UPDATE", -- Not sure when this data is available, guessing + ["guild"] = "UNIT_NAME_UPDATE", ["abs:incheal"] = "UNIT_HEAL_PREDICTION", ["incheal:name"] = "UNIT_HEAL_PREDICTION", ["incheal"] = "UNIT_HEAL_PREDICTION", + -- ["crtabs"] = "CRTABS", + -- ["abs:crtabs"] = "CRTABS", + -- ["crtabs:name"] = "CRTABS", ["afk"] = "PLAYER_FLAGS_CHANGED", -- Yes, I know it's called PLAYER_FLAGS_CHANGED, but arg1 is the unit including non-players. ["afk:time"] = "PLAYER_FLAGS_CHANGED UNIT_CONNECTION", ["status:time"] = "UNIT_POWER UNIT_CONNECTION", @@ -900,6 +915,9 @@ Tags.defaultFrequents = { -- Default tag categories Tags.defaultCategories = { + -- ["crtabs"] = "absorb", + -- ["crtabs:name"] = "absorb", + -- ["abs:crtabs"] = "absorb", ["hp:color"] = "health", ["abs:incheal"] = "health", ["incheal"] = "health", @@ -981,6 +999,9 @@ Tags.defaultHelp = { ["guild"] = L["Show's the units guild name if they are in a guild."], ["short:druidform"] = L["Short version of [druidform], C = Cat, B = Bear, F = Flight and so on."], ["druidform"] = L["Returns the units current form if they are a druid, Cat for Cat Form, Moonkin for Moonkin and so on."], + -- ["crtabs"] = L["Shorten current absorb value, if 13,000 absorb is on a target it will show 13k."], + -- ["abs:crtabs"] = L["Absolute current absorb value, if 15,000 absorb is on a target it will show 15,000."], + -- ["crtabs:name"] = L["If the unit has absorbs on them, it will show the absolute absorb value, otherwise it will show the units name."], ["abs:incheal"] = L["Absolute incoming heal value, if 10,000 healing is incoming it will show 10,000."], ["incheal"] = L["Shorten incoming heal value, if 13,000 healing is incoming it will show 13k."], ["incheal:name"] = L["If the unit has heals incoming, it will show the absolute incoming heal value, otherwise it will show the units name."], @@ -1061,6 +1082,9 @@ Tags.defaultNames = { ["guild"] = L["Guild name"], ["druidform"] = L["Druid form"], ["short:druidform"] = L["Druid form (Short)"], + -- ["abs:crtabs"] = L["Current absorb (Absolute)"], + -- ["crtabs"] = L["Current absorb (Short)"], + -- ["crtabs:name"] = L["Current absorb/Name"], ["abs:incheal"] = L["Incoming heal (Absolute)"], ["incheal"] = L["Incoming heal (Short)"], ["abbrev:name"] = L["Name (Abbreviated)"], diff --git a/options/config.lua b/options/config.lua index e56b3b42..b4aa3eb8 100644 --- a/options/config.lua +++ b/options/config.lua @@ -43,7 +43,7 @@ local INDICATOR_DESC = { ["masterLoot"] = L["Bag indicator for master looters."], ["pvp"] = L["PVP flag indicator, Horde for Horde flagged pvpers and Alliance for Alliance flagged pvpers."], ["raidTarget"] = L["Raid target indicator."], ["ready"] = L["Ready status of group members."], ["role"] = L["Raid role indicator, adds a shield indicator for main tanks and a sword icon for main assists."], ["status"] = L["Status indicator, shows if the unit is currently in combat. For the player it will also show if you are rested."], ["class"] = L["Class icon for players."]} -local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"]} +local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"], ["absorb"] = L["Absorb"]} local pointPositions = {["BOTTOM"] = L["Bottom"], ["TOP"] = L["Top"], ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["TOPLEFT"] = L["Top Left"], ["TOPRIGHT"] = L["Top Right"], ["BOTTOMLEFT"] = L["Bottom Left"], ["BOTTOMRIGHT"] = L["Bottom Right"], ["CENTER"] = L["Center"]} local positionList = {["C"] = L["Center"], ["RT"] = L["Right Top"], ["RC"] = L["Right Center"], ["RB"] = L["Right Bottom"], ["LT"] = L["Left Top"], ["LC"] = L["Left Center"], ["LB"] = L["Left Bottom"], ["BL"] = L["Bottom Left"], ["BC"] = L["Bottom Center"], ["BR"] = L["Bottom Right"], ["TR"] = L["Top Right"], ["TC"] = L["Top Center"], ["TL"] = L["Top Left"]} @@ -3429,7 +3429,8 @@ local function loadUnitOptions() order = 3, type = "group", inline = true, - name = L["Incoming heals and absorbs"], + -- name = L["Incoming heals and absorbs"], + name = L["Incoming heals"], hidden = hideRestrictedOption, disabled = function(info) return not getVariable(info[2], "healthBar", nil, "enabled") end, args = { @@ -3445,18 +3446,18 @@ local function loadUnitOptions() setDirectUnit(info[2], "incHeal", nil, "enabled", getVariable(info[2], "incHeal", nil, "absorbs") or getVariable(info[2], "incHeal", nil, "heals")) end }, - absorbs = { - order = 2, - type = "toggle", - name = L["Show current absorbs"], - desc = L["Adds a bar inside the health bar indicating how much damage absorbed they have."], - arg = "incHeal.absorbs", - hidden = false, - set = function(info, value) - setUnit(info, value) - setDirectUnit(info[2], "incHeal", nil, "enabled", getVariable(info[2], "incHeal", nil, "absorbs") or getVariable(info[2], "incHeal", nil, "heals")) - end - }, + -- absorbs = { + -- order = 2, + -- type = "toggle", + -- name = L["Show current absorbs"], + -- desc = L["Adds a bar inside the health bar indicating how much damage absorbed they have."], + -- arg = "incHeal.absorbs", + -- hidden = false, + -- set = function(info, value) + -- setUnit(info, value) + -- setDirectUnit(info[2], "incHeal", nil, "enabled", getVariable(info[2], "incHeal", nil, "absorbs") or getVariable(info[2], "incHeal", nil, "heals")) + -- end + -- }, cap = { order = 3, type = "range", From 1475158d0102d26518111d53f9671b84a7013e74 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 1 Nov 2011 20:33:07 -0700 Subject: [PATCH 135/794] Load talents on PLAYER_LOGIN initially, then use ACTIVE_TALENT_GROUP_CHANGED and PLAYER_TALENT_UPDATE to reload them --- modules/units.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index ec511d3d..d21b9b89 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -1264,11 +1264,11 @@ function Units:SetCurable() if( list ) then for magic, spell in pairs(list) do if( spell == true ) then - canCure[magic] = true + canCure[magic] = true -- Need some specific talents for this else for tab=1, GetNumTalentTabs() do - for talent=1, GetNumTalents(tab) do + for talent=1, GetNumTalents(tab) do local name, _, _, _, currentRank = GetTalentInfo(tab, talent) if( name == spell and currentRank > 0 ) then canCure[magic] = true @@ -1295,6 +1295,7 @@ centralFrame:RegisterEvent("PLAYER_REGEN_ENABLED") centralFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") centralFrame:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") centralFrame:RegisterEvent("PLAYER_TALENT_UPDATE") +centralFrame:RegisterEvent("PLAYER_LOGIN") centralFrame:SetScript("OnEvent", function(self, event, unit) -- Check if the player changed zone types and we need to change module status, while they are dead -- we won't change their zone type as releasing from an instance will change the zone type without them @@ -1310,11 +1311,11 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) elseif( event == "PLAYER_UNGHOST" ) then Units:CheckPlayerZone() -- Monitor talent changes - elseif( event == "ACTIVE_TALENT_GROUP_CHANGED" ) then + elseif( event == "ACTIVE_TALENT_GROUP_CHANGED" or event == "PLAYER_TALENT_UPDATE" ) then Units:SetCurable() - elseif( event == "PLAYER_TALENT_UPDATE" ) then - self:UnregisterEvent(event) + elseif( event == "PLAYER_LOGIN" ) then Units:SetCurable() + self:RegisterEvent("PLAYER_TALENT_UPDATE") -- This is slightly hackish, but it suits the purpose just fine for somthing thats rarely called. elseif( event == "PLAYER_REGEN_ENABLED" ) then -- Now do all of the creation for child wrapping From d137b1f2792635bda5f68dba54456019cca1dcef Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 4 Nov 2011 09:58:24 -0700 Subject: [PATCH 136/794] Added [per:incheal], will show the incoming health as a percentage of the players total health --- modules/tags.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/tags.lua b/modules/tags.lua index f124f726..674fbf22 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -791,6 +791,11 @@ Tags.defaultTags = { -- local absorb = fontString.parent.absorb -- return absorb > 0 and string.format("+%d", heal) or ShadowUF.tagFunc.name(unit, unitOwner, fontString) -- ]], + ["per:incheal"] = [[function(unit, unitOwner, fontString) + local heal = UnitGetIncomingHeals(unit) + local maxHealth = UnitHealthMax(unit) + return heal and heal > 0 and maxHealth > 0 and string.format("%d%%", (heal / maxHealth)) + end]], ["abs:incheal"] = [[function(unit, unitOwner, fontString) local heal = UnitGetIncomingHeals(unit) return heal and heal > 0 and string.format("%d", heal) @@ -839,6 +844,7 @@ Tags.defaultEvents = { ["short:druidform"] = "UNIT_AURA", ["druidform"] = "UNIT_AURA", ["guild"] = "UNIT_NAME_UPDATE", + ["per:incheal"] = "UNIT_HEAL_PREDICTION", ["abs:incheal"] = "UNIT_HEAL_PREDICTION", ["incheal:name"] = "UNIT_HEAL_PREDICTION", ["incheal"] = "UNIT_HEAL_PREDICTION", @@ -919,6 +925,7 @@ Tags.defaultCategories = { -- ["crtabs:name"] = "absorb", -- ["abs:crtabs"] = "absorb", ["hp:color"] = "health", + ["per:incheal"] = "health", ["abs:incheal"] = "health", ["incheal"] = "health", ["incheal:name"] = "health", @@ -1002,6 +1009,7 @@ Tags.defaultHelp = { -- ["crtabs"] = L["Shorten current absorb value, if 13,000 absorb is on a target it will show 13k."], -- ["abs:crtabs"] = L["Absolute current absorb value, if 15,000 absorb is on a target it will show 15,000."], -- ["crtabs:name"] = L["If the unit has absorbs on them, it will show the absolute absorb value, otherwise it will show the units name."], + ["per:incheal"] = L["Percent of the players current health that's being healed, if they have 100,000 total health and 15,000 is incoming then 15% is shown."] ["abs:incheal"] = L["Absolute incoming heal value, if 10,000 healing is incoming it will show 10,000."], ["incheal"] = L["Shorten incoming heal value, if 13,000 healing is incoming it will show 13k."], ["incheal:name"] = L["If the unit has heals incoming, it will show the absolute incoming heal value, otherwise it will show the units name."], @@ -1074,6 +1082,7 @@ Tags.defaultHelp = { } Tags.defaultNames = { + ["per:incheal"] = L["Incoming heal (Percent)"], ["incheal:name"] = L["Incoming heal/Name"], ["unit:scaled:threat"] = L["Unit scaled threat"], ["unit:color:sit"] = L["Unit colored situation"], From 1035f00281d89ddc6d480bf4f6853c4b1fb7adce Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 4 Nov 2011 22:01:55 +0100 Subject: [PATCH 137/794] Fix syntax error. --- modules/tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tags.lua b/modules/tags.lua index 674fbf22..c1606f9d 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1009,7 +1009,7 @@ Tags.defaultHelp = { -- ["crtabs"] = L["Shorten current absorb value, if 13,000 absorb is on a target it will show 13k."], -- ["abs:crtabs"] = L["Absolute current absorb value, if 15,000 absorb is on a target it will show 15,000."], -- ["crtabs:name"] = L["If the unit has absorbs on them, it will show the absolute absorb value, otherwise it will show the units name."], - ["per:incheal"] = L["Percent of the players current health that's being healed, if they have 100,000 total health and 15,000 is incoming then 15% is shown."] + ["per:incheal"] = L["Percent of the players current health that's being healed, if they have 100,000 total health and 15,000 is incoming then 15% is shown."], ["abs:incheal"] = L["Absolute incoming heal value, if 10,000 healing is incoming it will show 10,000."], ["incheal"] = L["Shorten incoming heal value, if 13,000 healing is incoming it will show 13k."], ["incheal:name"] = L["If the unit has heals incoming, it will show the absolute incoming heal value, otherwise it will show the units name."], From b23a1340a311e3dcd2c9418c29e7ff74c55ff80b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 4 Nov 2011 21:59:24 -0700 Subject: [PATCH 138/794] Fixed a typo --- modules/tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tags.lua b/modules/tags.lua index 674fbf22..c1606f9d 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1009,7 +1009,7 @@ Tags.defaultHelp = { -- ["crtabs"] = L["Shorten current absorb value, if 13,000 absorb is on a target it will show 13k."], -- ["abs:crtabs"] = L["Absolute current absorb value, if 15,000 absorb is on a target it will show 15,000."], -- ["crtabs:name"] = L["If the unit has absorbs on them, it will show the absolute absorb value, otherwise it will show the units name."], - ["per:incheal"] = L["Percent of the players current health that's being healed, if they have 100,000 total health and 15,000 is incoming then 15% is shown."] + ["per:incheal"] = L["Percent of the players current health that's being healed, if they have 100,000 total health and 15,000 is incoming then 15% is shown."], ["abs:incheal"] = L["Absolute incoming heal value, if 10,000 healing is incoming it will show 10,000."], ["incheal"] = L["Shorten incoming heal value, if 13,000 healing is incoming it will show 13k."], ["incheal:name"] = L["If the unit has heals incoming, it will show the absolute incoming heal value, otherwise it will show the units name."], From 76431ce3b78f8e22a5efdc967b0dced7189bd50a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 4 Nov 2011 22:04:45 -0700 Subject: [PATCH 139/794] Show total reputation points even when someone has hit exalted --- modules/xp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/xp.lua b/modules/xp.lua index 946c6e76..cbd062bb 100755 --- a/modules/xp.lua +++ b/modules/xp.lua @@ -98,8 +98,8 @@ function XP:UpdateRep(frame) local color = FACTION_BAR_COLORS[reaction] frame.xpBar.rep:SetMinMaxValues(0, max) - frame.xpBar.rep:SetValue(reaction == 8 and max or current) - frame.xpBar.rep.tooltip = string.format(L["%s (%s): %s/%s (%.2f%% done)"], name, GetText("FACTION_STANDING_LABEL" .. reaction, UnitSex("player")), formatNumber(current), formatNumber(max), reaction == 8 and 100 or (max > 0 and current / max or 0) * 100) + frame.xpBar.rep:SetValue(current) + frame.xpBar.rep.tooltip = string.format(L["%s (%s): %s/%s (%.2f%% done)"], name, GetText("FACTION_STANDING_LABEL" .. reaction, UnitSex("player")), formatNumber(current), formatNumber(max), (max > 0 and current / max or 0) * 100) frame.xpBar.rep:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) frame.xpBar.rep.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) frame.xpBar.rep:Show() From 766c859c89ac552b7c62c1e2199d92acc8b6439b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 5 Nov 2011 10:21:10 -0700 Subject: [PATCH 140/794] Check both spellID and spell name in blacklist/whitelist for auras --- modules/auras.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index ec4a23e8..e0a7a800 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -488,10 +488,10 @@ local function scan(parent, frame, type, config, filter) local index = 0 while( true ) do index = index + 1 - local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable = UnitAura(frame.parent.unit, index, filter) + local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID = UnitAura(frame.parent.unit, index, filter) if( not name ) then break end - if( ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and parent.whitelist[name] or parent.blacklist[type] and not parent.blacklist[name] ) and ( not curable or canCure[auraType] ) ) then + if( ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and ( parent.whitelist[name] or parent.whitelist[spellID] ) or parent.blacklist[type] and ( not parent.blacklist[name] and not parent.blacklist[spellID] ) ) and ( not curable or canCure[auraType] ) ) then -- Create any buttons we need frame.totalAuras = frame.totalAuras + 1 if( #(frame.buttons) < frame.totalAuras ) then From 4b7553f162186d005d6ac8a38589c2e946af2fec Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 6 Nov 2011 08:36:23 -0800 Subject: [PATCH 141/794] Added first class support for Enrage debuffs. Druids, Rogues and Hunters are considered to be able to cure them. --- modules/auras.lua | 3 +++ modules/highlight.lua | 3 ++- modules/units.lua | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index e0a7a800..47f49f45 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -491,6 +491,9 @@ local function scan(parent, frame, type, config, filter) local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID = UnitAura(frame.parent.unit, index, filter) if( not name ) then break end + -- Blizzard bug, Enrage is an empty string. + cureType = auraType == "" and "Enrage" or auraType + if( ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and ( parent.whitelist[name] or parent.whitelist[spellID] ) or parent.blacklist[type] and ( not parent.blacklist[name] and not parent.blacklist[spellID] ) ) and ( not curable or canCure[auraType] ) ) then -- Create any buttons we need frame.totalAuras = frame.totalAuras + 1 diff --git a/modules/highlight.lua b/modules/highlight.lua index 682742ed..597cc36c 100644 --- a/modules/highlight.lua +++ b/modules/highlight.lua @@ -127,7 +127,7 @@ end function Highlight:Update(frame) local color if( frame.highlight.hasDebuff ) then - color = DebuffTypeColor[frame.highlight.hasDebuff] + color = DebuffTypeColor[frame.highlight.hasDebuff] or DebuffTypeColor[""] elseif( frame.highlight.hasThreat ) then color = ShadowUF.db.profile.healthColors.hostile elseif( frame.highlight.hasAttention ) then @@ -165,6 +165,7 @@ function Highlight:UpdateAura(frame) id = id + 1 local name, _, _, _, auraType = UnitDebuff(frame.unit, id) if( not name ) then break end + if( auraType == "" ) then auraType = "Enrage" end if( canCure[auraType] ) then frame.highlight.hasDebuff = auraType diff --git a/modules/units.lua b/modules/units.lua index d21b9b89..b0a883d6 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -5,12 +5,12 @@ Units.zoneUnits = {["arena"] = "arena", ["boss"] = "raid"} local stateMonitor = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") local playerClass = select(2, UnitClass("player")) local unitFrames, headerFrames, frameList, unitEvents, childUnits, queuedCombat, canCure = Units.unitFrames, Units.headerFrames, Units.frameList, Units.unitEvents, Units.childUnits, {}, Units.canCure -local curableData = {["PRIEST"] = {["Magic"] = true, ["Disease"] = true}, ["DRUID"] = {["Curse"] = true, ["Poison"] = true, ["Magic"] = GetSpellInfo(88423)}, ["SHAMAN"] = {["Curse"] = true, ["Magic"] = GetSpellInfo(77130)}, ["PALADIN"] = {["Poison"] = true, ["Disease"] = true, ["Magic"] = GetSpellInfo(53551)}, ["MAGE"] = {["Curse"] = true}} +local curableData = {["PRIEST"] = {["Magic"] = true, ["Disease"] = true}, ["DRUID"] = {["Curse"] = true, ["Poison"] = true, ["Magic"] = GetSpellInfo(88423), ["Enrage"] = true}, ["SHAMAN"] = {["Curse"] = true, ["Magic"] = GetSpellInfo(77130)}, ["PALADIN"] = {["Poison"] = true, ["Disease"] = true, ["Magic"] = GetSpellInfo(53551)}, ["MAGE"] = {["Curse"] = true}, ["HUNTER"] = {["Enrage"] = true}, ["ROGUE"] = {["Enrage"] = true}} local _G = getfenv(0) ShadowUF.Units = Units ShadowUF:RegisterModule(Units, "units") - + -- Frame shown, do a full update local function FullUpdate(self) for i=1, #(self.fullUpdates), 2 do From 381fa9f2190735362137b38d3e0653ff4fb29c35 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 20 Nov 2011 00:40:42 -0800 Subject: [PATCH 142/794] Fixed leaked global --- modules/auras.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/auras.lua b/modules/auras.lua index 47f49f45..64a7870d 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -486,6 +486,7 @@ local function scan(parent, frame, type, config, filter) local isFriendly = UnitIsFriend(frame.parent.unit, "player") local curable = (isFriendly and type == "debuffs" and config.raid) local index = 0 + local cureType while( true ) do index = index + 1 local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID = UnitAura(frame.parent.unit, index, filter) From 6b12ad209e953d90567c07a7130b8047bc86ff2f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 20 Nov 2011 00:44:38 -0800 Subject: [PATCH 143/794] Enabling quick health updates will force the predictedHealth CVar on --- options/config.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/options/config.lua b/options/config.lua index b4aa3eb8..0352e60c 100644 --- a/options/config.lua +++ b/options/config.lua @@ -3392,6 +3392,21 @@ local function loadUnitOptions() name = L["Enable quick health"], desc = L["Turns on fast updating of health bars giving you more up to date health info."], arg = "healthBar.predicted", + set = function(info, value) + setUnit(info, value) + + local hasQuick = false + for _, config in pairs(ShadowUF.db.profile.units) do + if( config.healthBar and config.healthBar.enabled and config.healthBar.predicted ) then + hasQuick = true + break + end + end + + if( hasQuick and GetCVar("predictedHealth") ~= "1" ) then + SetCVar("predictedHealth", "1") + end + end, }, sep = { order = 3.5, From 445b637e5b2cc51f91a87a401ed4a413ce562fc1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 21 Nov 2011 10:40:00 -0800 Subject: [PATCH 144/794] Fix the DB upgrade to not add phase indicators for non-paty units, restrip any non-party phase configs. - Disable phase indicators by default. --- ShadowedUnitFrames.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 8d9393d1..3184b294 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 10 +ShadowUF.dbRevision = 11 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -84,7 +84,13 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 - if( revision <= 9 ) then + if( revision <= 10 ) then + for unit, config in pairs(self.db.profile.units) do + if( config.healthBar ) then + config.healthBar.predicted = nil + end + end + for unit, config in pairs(self.db.profile.units) do if( unit ~= "party" and config.indicators and config.indicators.phase ) then config.indicators.phase = nil @@ -111,8 +117,8 @@ function ShadowUF:CheckUpgrade() db.indicators.resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"} end - if( not db.indicators.phase ) then - db.indicators.phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} + if( unit == "party" and not db.indicators.phase ) then + db.indicators.phase = {enabled = false, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} end end end From 443a6cbbaea44241d2e549388541d3f35b17e1d6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 21 Nov 2011 10:40:16 -0800 Subject: [PATCH 145/794] Disable phase indicators by default --- modules/defaultlayout.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 6a7961b5..5464e027 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -342,7 +342,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) offset = 23, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, - phase = {enabled = true, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} + phase = {enabled = false, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} }, auras = { buffs = {enabled = true, maxRows = 1}, From 5364405537f58386728263a799d7b3b71ad80bb2 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 21 Nov 2011 10:41:04 -0800 Subject: [PATCH 146/794] Given that predicted health no longer requires an inefficient OnUpdate to monitor, removing the option for it and making it enabled by default --- modules/health.lua | 35 ++--------------------------------- modules/tags.lua | 31 ++++++++++++++++--------------- options/config.lua | 22 ---------------------- 3 files changed, 18 insertions(+), 70 deletions(-) diff --git a/modules/health.lua b/modules/health.lua index 1639440b..bcd02fca 100644 --- a/modules/health.lua +++ b/modules/health.lua @@ -30,10 +30,12 @@ function Health:OnEnable(frame) frame.healthBar = ShadowUF.Units:CreateBar(frame) end + frame:RegisterUnitEvent("UNIT_HEALTH", self, "Update") frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "Update") frame:RegisterUnitEvent("UNIT_CONNECTION", self, "Update") frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdateColor") frame:RegisterUnitEvent("UNIT_THREAT_SITUATION_UPDATE", self, "UpdateColor") + frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "Update") if( frame.unit == "pet" ) then frame:RegisterUnitEvent("UNIT_POWER", self, "UpdateColor") @@ -43,18 +45,6 @@ function Health:OnEnable(frame) frame:RegisterUpdateFunc(self, "Update") end -function Health:OnLayoutApplied(frame) - if( not frame.visibility.healthBar ) then return end - - if( ShadowUF.db.profile.units[frame.unitType].healthBar.predicted ) then - frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "UpdateFrequent") - frame:UnregisterEvent("UNIT_HEALTH", self) - else - frame:UnregisterEvent("UNIT_HEALTH_FREQUENT", self) - frame:RegisterUnitEvent("UNIT_HEALTH", self, "Update") - end -end - function Health:OnDisable(frame) frame:UnregisterAll(self) end @@ -110,27 +100,6 @@ function Health:UpdateColor(frame) end end -function Health:UpdateFrequent(frame) - self:Update(frame) - - -- As much as I would rather not have to do this in an OnUpdate, I don't have much choice large health changes in a single update will make them very clearly be lagging behind - for _, fontString in pairs(frame.fontStrings) do - if( fontString.fastHealth ) then - fontString:UpdateTags() - end - end - - -- Update incoming heal number - if( frame.incHeal and frame.incHeal.healed ) then - frame.incHeal:SetValue(frame.healthBar.currentHealth + frame.incHeal.healed) - end - - -- The target is not offline, and we have a health percentage so update the gradient - if( not frame.healthBar.wasOffline and frame.healthBar.hasPercent ) then - frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, getGradientColor(frame.unit)) - end -end - function Health:Update(frame) local isOffline = not UnitIsConnected(frame.unit) frame.isDead = UnitIsDeadOrGhost(frame.unit) diff --git a/modules/tags.lua b/modules/tags.lua index c1606f9d..1314c7a9 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -840,7 +840,7 @@ Tags.defaultTags = { -- Default tag events Tags.defaultEvents = { - ["hp:color"] = "UNIT_HEALTH UNIT_MAXHEALTH", + ["hp:color"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH", ["short:druidform"] = "UNIT_AURA", ["druidform"] = "UNIT_AURA", ["guild"] = "UNIT_NAME_UPDATE", @@ -855,11 +855,11 @@ Tags.defaultEvents = { ["afk:time"] = "PLAYER_FLAGS_CHANGED UNIT_CONNECTION", ["status:time"] = "UNIT_POWER UNIT_CONNECTION", ["pvp:time"] = "PLAYER_FLAGS_CHANGED", - ["curhp"] = "UNIT_HEALTH UNIT_CONNECTION", - ["abscurhp"] = "UNIT_HEALTH UNIT_CONNECTION", - ["curmaxhp"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION", - ["absolutehp"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION", - ["smart:curmaxhp"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION", + ["curhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_CONNECTION", + ["abscurhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_CONNECTION", + ["curmaxhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", + ["absolutehp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", + ["smart:curmaxhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", ["curpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", ["abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", ["curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", @@ -874,25 +874,25 @@ Tags.defaultEvents = { ["level"] = "UNIT_LEVEL PLAYER_LEVEL_UP", ["levelcolor"] = "UNIT_LEVEL PLAYER_LEVEL_UP", ["maxhp"] = "UNIT_MAXHEALTH", - ["def:name"] = "UNIT_NAME_UPDATE UNIT_MAXHEALTH UNIT_HEALTH", + ["def:name"] = "UNIT_NAME_UPDATE UNIT_MAXHEALTH UNIT_HEALTH UNIT_HEALTH_FREQUENT", ["absmaxhp"] = "UNIT_MAXHEALTH", ["maxpp"] = "UNIT_MAXPOWER", ["absmaxpp"] = "UNIT_MAXPOWER", - ["missinghp"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION", + ["missinghp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", ["missingpp"] = "UNIT_POWER UNIT_MAXPOWER", ["name"] = "UNIT_NAME_UPDATE", ["abbrev:name"] = "UNIT_NAME_UPDATE", ["server"] = "UNIT_NAME_UPDATE", ["colorname"] = "UNIT_NAME_UPDATE", - ["perhp"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION", + ["perhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", ["perpp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_CONNECTION", - ["status"] = "UNIT_HEALTH PLAYER_UPDATE_RESTING UNIT_CONNECTION", + ["status"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT PLAYER_UPDATE_RESTING UNIT_CONNECTION", ["smartlevel"] = "UNIT_LEVEL PLAYER_LEVEL_UP UNIT_CLASSIFICATION_CHANGED", ["cpoints"] = "UNIT_COMBO_POINTS PLAYER_TARGET_CHANGED", ["rare"] = "UNIT_CLASSIFICATION_CHANGED", ["classification"] = "UNIT_CLASSIFICATION_CHANGED", ["shortclassification"] = "UNIT_CLASSIFICATION_CHANGED", - ["dechp"] = "UNIT_HEALTH UNIT_MAXHEALTH", + ["dechp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH", ["group"] = "RAID_ROSTER_UPDATE", ["unit:color:aggro"] = "UNIT_THREAT_SITUATION_UPDATE", ["color:aggro"] = "UNIT_THREAT_SITUATION_UPDATE", @@ -1165,6 +1165,7 @@ Tags.defaultNames = { Tags.eventType = { ["UNIT_POWER"] = "power", ["UNIT_MAXPOWER"] = "power", + ["UNIT_HEALTH_FREQUENT"] = "health", ["UNIT_HEALTH"] = "health", ["UNIT_MAXHEALTH"] = "health", ["RAID_ROSTER_UPDATE"] = "unitless", @@ -1200,14 +1201,14 @@ local function loadAPIEvents() ["UnitName"] = "UNIT_NAME_UPDATE", ["UnitClassification"] = "UNIT_CLASSIFICATION_CHANGED", ["UnitFactionGroup"] = "UNIT_FACTION PLAYER_FLAGS_CHANGED", - ["UnitHealth%("] = "UNIT_HEALTH", + ["UnitHealth%("] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT", ["UnitHealthMax"] = "UNIT_MAXHEALTH", ["UnitPower%("] = "UNIT_POWER", ["UnitPowerMax"] = "UNIT_MAXPOWER", ["UnitPowerType"] = "UNIT_DISPLAYPOWER", - ["UnitIsDead"] = "UNIT_HEALTH", - ["UnitIsGhost"] = "UNIT_HEALTH", - ["UnitIsConnected"] = "UNIT_HEALTH UNIT_CONNECTION", + ["UnitIsDead"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT", + ["UnitIsGhost"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT", + ["UnitIsConnected"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_CONNECTION", ["UnitIsAFK"] = "PLAYER_FLAGS_CHANGED", ["UnitIsDND"] = "PLAYER_FLAGS_CHANGED", ["UnitIsPVP"] = "PLAYER_FLAGS_CHANGED UNIT_FACTION", diff --git a/options/config.lua b/options/config.lua index 0352e60c..d51b0cb4 100644 --- a/options/config.lua +++ b/options/config.lua @@ -3386,28 +3386,6 @@ local function loadUnitOptions() name = string.format(L["Enable %s"], L["Health bar"]), arg = "healthBar.enabled", }, - predictedHealth = { - order = 3, - type = "toggle", - name = L["Enable quick health"], - desc = L["Turns on fast updating of health bars giving you more up to date health info."], - arg = "healthBar.predicted", - set = function(info, value) - setUnit(info, value) - - local hasQuick = false - for _, config in pairs(ShadowUF.db.profile.units) do - if( config.healthBar and config.healthBar.enabled and config.healthBar.predicted ) then - hasQuick = true - break - end - end - - if( hasQuick and GetCVar("predictedHealth") ~= "1" ) then - SetCVar("predictedHealth", "1") - end - end, - }, sep = { order = 3.5, type = "description", From 4326a8f4add9f941595ceea10f5dd98870c4cc28 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 21 Nov 2011 23:09:50 -0800 Subject: [PATCH 147/794] Slightly increase config width by 10 --- options/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index d51b0cb4..9d7428d4 100644 --- a/options/config.lua +++ b/options/config.lua @@ -5491,7 +5491,7 @@ function Config:Open() loadOptions() LibStub("AceConfig-3.0"):RegisterOptionsTable("ShadowedUF", options) - AceDialog:SetDefaultSize("ShadowedUF", 835, 550) + AceDialog:SetDefaultSize("ShadowedUF", 845, 550) registered = true end From ead6e6fbcc6a3f12487ea22511e5ceffe7e24b2c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 23 Nov 2011 12:59:21 -0800 Subject: [PATCH 148/794] Added blank ptBR locale file --- localization/ptBR.lua | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 localization/ptBR.lua diff --git a/localization/ptBR.lua b/localization/ptBR.lua new file mode 100644 index 00000000..4a3353b4 --- /dev/null +++ b/localization/ptBR.lua @@ -0,0 +1,5 @@ +if( GetLocale() ~= "ptBR" ) then return end +local L = {} +--@localization(locale="ptBR", format="lua_additive_table", handle-unlocalized="ignore")@ +local ShadowUF = select(2, ...) +ShadowUF.L = setmetatable(L, {__index = ShadowUF.L}) From f7408226c053f82063655c9c4a8dad12115ca6aa Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 28 Nov 2011 19:20:22 -0800 Subject: [PATCH 149/794] Fixed resurrection indicator for targets --- ShadowedUnitFrames.lua | 8 ++++++-- modules/defaultlayout.lua | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 3184b294..aca82393 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -114,8 +114,12 @@ function ShadowUF:CheckUpgrade() for _, unit in pairs({"player", "focus", "target", "raid", "party", "mainassist", "maintank"}) do local db = self.db.profile.units[unit] if( not db.indicators.resurrect ) then - db.indicators.resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"} - end + if( unit == "target" ) then + db.indicators.resurrect = {enabled = true, anchorPoint = "RC", size = 28, x = -39, y = -1, anchorTo = "$parent"} + else + db.indicators.resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"} + end + end if( unit == "party" and not db.indicators.phase ) then db.indicators.phase = {enabled = false, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 5464e027..98d844ee 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -566,7 +566,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, indicators = { lfdRole = {enabled = false}, - resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, + resurrect = {enabled = true, anchorPoint = "RC", size = 28, x = -39, y = -1, anchorTo = "$parent"}, }, auras = { buffs = {enabled = true}, From de0ba9d04e1de226486c5f93349d3d091e6c65a5 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 28 Nov 2011 20:17:15 -0800 Subject: [PATCH 150/794] TOC Bump to 40300 --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index c3356b59..fe848e19 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,4 +1,4 @@ -## Interface: 40200 +## Interface: 40300 ## Title: Shadowed Unit Frames ## Notes: This update sponsored by The Book of the New Sun. ## Author: Shadowed From 350a3ef6641ce98332393a541b72c61ed05e8f78 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 30 Nov 2011 09:29:11 -0800 Subject: [PATCH 151/794] Bump options TOC --- options/ShadowedUF_Options.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index db41ba72..d69a5d0b 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 40200 +## Interface: 40300 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From ece8c65f9ee107594d9ed5c13019dec87b154070 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 30 Nov 2011 17:05:54 -0800 Subject: [PATCH 152/794] Added ability to color power bar by class, added a warning to disable ShadowedUF_ClassPower so people stop posting about it --- ShadowedUnitFrames.lua | 16 ++++++++++++---- modules/defaultlayout.lua | 2 +- modules/power.lua | 10 +++++++++- options/config.lua | 15 +++++++++++++++ 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index aca82393..5c276b82 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 11 +ShadowUF.dbRevision = 12 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -84,6 +84,14 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + if( revision <= 11 ) then + for unit, config in pairs(self.db.profile.units) do + if( config.powerBar ) then + config.powerBar.colorType = "class" + end + end + end + if( revision <= 10 ) then for unit, config in pairs(self.db.profile.units) do if( config.healthBar ) then @@ -323,9 +331,9 @@ end -- Module APIs function ShadowUF:RegisterModule(module, key, name, isBar, class) - -- December 16th - if( module.OnDefaultsSet ) then - DEFAULT_CHAT_FRAME:AddMessage(string.format("[WARNING!] You are running an outdated version of %s, you need to update it to the latest available for it to work with SUF.", name or key or "unknown")) + -- November 30th + if( key == "ClassColoredPowerBar" ) then + DEFAULT_CHAT_FRAME:AddMessage("[WARNING!] ShadowedUF_ClassPower is broken and built in by default now. You do not need it anymore") return end diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 98d844ee..9a6fecb2 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -235,7 +235,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) combatText = {anchorTo = "$parent", anchorPoint = "C", x = 0, y = 0}, emptyBar = {background = true, height = 1, reactionType = "none", order = 0}, healthBar = {background = true, colorType = "class", reactionType = "npc", height = 1.20, order = 10}, - powerBar = {background = true, height = 1.0, order = 20}, + powerBar = {background = true, height = 1.0, order = 20, colorType = "type"}, xpBar = {background = true, height = 0.25, order = 55}, castBar = {background = true, height = 0.60, order = 40, icon = "HIDE", name = {enabled = true, size = 0, anchorTo = "$parent", rank = true, anchorPoint = "CLI", x = 1, y = 0}, time = {enabled = true, size = 0, anchorTo = "$parent", anchorPoint = "CRI", x = -1, y = 0}}, altPowerBar = {background = true, height = 0.40, order = 100}, diff --git a/modules/power.lua b/modules/power.lua index e45fd23f..2636e807 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -44,7 +44,15 @@ function Power:OnDisable(frame) end function Power:UpdateColor(frame) - local color = ShadowUF.db.profile.powerColors[select(2, UnitPowerType(frame.unit))] or ShadowUF.db.profile.powerColors.MANA + local color + if( ShadowUF.db.profile.units[frame.unitType].powerBar.colorType == "class" and UnitIsPlayer(frame.unit) ) then + local class = select(2, UnitClass(frame.unit)) + color = class and ShadowUF.db.profile.classColors[class] + end + + if( not color ) then + color = ShadowUF.db.profile.powerColors[select(2, UnitPowerType(frame.unit))] or ShadowUF.db.profile.powerColors.MANA + end if( not ShadowUF.db.profile.units[frame.unitType].powerBar.invert ) then frame.powerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) diff --git a/options/config.lua b/options/config.lua index 9d7428d4..a3d196e0 100644 --- a/options/config.lua +++ b/options/config.lua @@ -3313,6 +3313,21 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "altPowerBar.enabled", }, + sep = { + order = 4, + type = "description", + name = "", + width = "full", + hidden = false, + }, + colorType = { + order = 5, + type = "select", + name = L["Color power by"], + desc = L["Primary means of coloring the power bar. Coloring by class only applies to players, for non-players it will default to the power type."], + values = {["class"] = L["Class"], ["type"] = L["Power Type"]}, + arg = "powerBar.colorType", + } }, }, classmiscbars = { From 3fdc9da7e84ba0c3ea15e5b1e1bc2ecf7901fbff Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 30 Nov 2011 17:20:04 -0800 Subject: [PATCH 153/794] Fixed a typo causing temporary enchants to error when using ranged enchants --- modules/auras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index 64a7870d..d3a4012d 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -451,7 +451,7 @@ tempEnchantScan = function(self, elapsed) offHand.has = hasOff if( hasRanged and self.temporaryEnchants < self.maxAuras ) then - self.temporaryEcnhants = self.temporaryEnchants + 1 + self.temporaryEnchants = self.temporaryEnchants + 1 updateTemporaryEnchant(self, 18, ranged, hasRanged, rangedTimeLeft or 0, rangedCharges) end From 0c01662157816d6158c4a3eeb98854186c00b2f7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 30 Nov 2011 17:23:04 -0800 Subject: [PATCH 154/794] Oops, default power color should be by type not class --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 5c276b82..65650edd 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -87,7 +87,7 @@ function ShadowUF:CheckUpgrade() if( revision <= 11 ) then for unit, config in pairs(self.db.profile.units) do if( config.powerBar ) then - config.powerBar.colorType = "class" + config.powerBar.colorType = "type" end end end From c4eeaac3075de97c59e8bb5c7719177d68782f31 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 30 Nov 2011 17:41:57 -0800 Subject: [PATCH 155/794] Need to reset ranged.time when updating the group too --- modules/auras.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index d3a4012d..dff7c25d 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -294,6 +294,7 @@ local function updateGroup(self, type, config, reverseConfig) if( self.unit == "player" ) then mainHand.time = 0 offHand.time = 0 + ranged.time = 0 group:SetScript("OnUpdate", config.temporary and tempEnchantScan or nil) else @@ -551,7 +552,7 @@ local function scan(parent, frame, type, config, filter) if( frame.totalAuras >= frame.maxAuras ) then break end end end - + for i=frame.totalAuras + 1, #(frame.buttons) do frame.buttons[i]:Hide() end -- The default 1.30 scale doesn't need special handling, after that it does From 2d4e635b39c3d74de886c4c6e1c45b62c605d0b4 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 30 Nov 2011 17:53:46 -0800 Subject: [PATCH 156/794] Fixed a bug where using the enlarge self auras and anchoring buffs and debuffs to themselves would cause too many auras to be shown, or aura positioning to get messed up --- modules/auras.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index dff7c25d..887ca82b 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -124,7 +124,7 @@ local function positionAllButtons(group, config) columnsHaveScale[columnID] = columnsHaveScale[columnID] and math.max(size, columnsHaveScale[columnID]) or size end end - + local columnID = 1 for id, button in pairs(group.buttons) do if( id > 1 ) then @@ -481,7 +481,7 @@ function Auras:UpdateFilter(frame) end -- Scan for auras -local function scan(parent, frame, type, config, filter) +local function scan(parent, frame, type, config, displayConfig, filter) if( frame.totalAuras >= frame.maxAuras or not config.enabled ) then return end local isFriendly = UnitIsFriend(frame.parent.unit, "player") @@ -557,7 +557,7 @@ local function scan(parent, frame, type, config, filter) -- The default 1.30 scale doesn't need special handling, after that it does if( config.enlargeSelf ) then - positionAllButtons(frame, config) + positionAllButtons(frame, displayConfig) end end @@ -600,17 +600,17 @@ function Auras:Update(frame) if( frame.auras.anchor ) then frame.auras.anchor.totalAuras = frame.auras.anchor.temporaryEnchants - scan(frame.auras, frame.auras.anchor, frame.auras.primary, config[frame.auras.primary], frame.auras[frame.auras.primary].filter) - scan(frame.auras, frame.auras.anchor, frame.auras.secondary, config[frame.auras.secondary], frame.auras[frame.auras.secondary].filter) + scan(frame.auras, frame.auras.anchor, frame.auras.primary, config[frame.auras.primary], config[frame.auras.primary], frame.auras[frame.auras.primary].filter) + scan(frame.auras, frame.auras.anchor, frame.auras.secondary, config[frame.auras.secondary], config[frame.auras.primary], frame.auras[frame.auras.secondary].filter) else if( config.buffs.enabled ) then frame.auras.buffs.totalAuras = frame.auras.buffs.temporaryEnchants - scan(frame.auras, frame.auras.buffs, "buffs", config.buffs, frame.auras.buffs.filter) + scan(frame.auras, frame.auras.buffs, "buffs", config.buffs, config.buffs, frame.auras.buffs.filter) end if( config.debuffs.enabled ) then frame.auras.debuffs.totalAuras = 0 - scan(frame.auras, frame.auras.debuffs, "debuffs", config.debuffs, frame.auras.debuffs.filter) + scan(frame.auras, frame.auras.debuffs, "debuffs", config.debuffs, config.debuffs, frame.auras.debuffs.filter) end if( frame.auras.anchorAurasOn ) then From d53238ba00a034bb1d5fc59e345a166e7923da5a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 1 Jul 2012 13:33:26 -0700 Subject: [PATCH 157/794] Initial for MoP, should solve all startup errors and green border. Any power changes for non-Druid classes are not in yet. --- ShadowedUnitFrames.toc | 4 ++-- modules/combopoints.lua | 2 +- modules/eclipse.lua | 2 +- modules/highlight.lua | 14 +---------- modules/holypower.lua | 10 +++++++- modules/indicators.lua | 6 ++--- modules/layout.lua | 2 +- modules/movers.lua | 2 +- modules/tags.lua | 25 ++++++++++---------- modules/units.lua | 51 ++++++++++------------------------------- 10 files changed, 43 insertions(+), 75 deletions(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index fe848e19..2cf3ff62 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ -## Interface: 40300 +## Interface: 50001 ## Title: Shadowed Unit Frames -## Notes: This update sponsored by The Book of the New Sun. +## Notes: This is a note, I don't know why you're reading this because it's not telling you anything useful. ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB diff --git a/modules/combopoints.lua b/modules/combopoints.lua index fb71a9b7..dbd6ad26 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -7,7 +7,7 @@ function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) frame.comboPoints.config = cpConfig frame.comboPointType = cpConfig.key - frame:RegisterNormalEvent("UNIT_COMBO_POINTS", self, "Update") + frame:RegisterUnitEvent("UNIT_COMBO_POINTS", self, "Update") frame:RegisterUpdateFunc(self, "Update") end diff --git a/modules/eclipse.lua b/modules/eclipse.lua index 6d84ccc2..2d9e9ded 100644 --- a/modules/eclipse.lua +++ b/modules/eclipse.lua @@ -55,7 +55,7 @@ end function Eclipse:UpdateVisibility(frame) local form = GetShapeshiftFormID() - ShadowUF.Layout:SetBarVisibility(frame, "eclipseBar", (form == MOONKIN_FORM or not form) and GetPrimaryTalentTree() == 1) + ShadowUF.Layout:SetBarVisibility(frame, "eclipseBar", (form == MOONKIN_FORM or not form) and GetSpecialization() == 1) Eclipse:UpdateDirection(frame) Eclipse:Update(frame, nil, nil, "ECLIPSE") end diff --git a/modules/highlight.lua b/modules/highlight.lua index 597cc36c..fd94b707 100644 --- a/modules/highlight.lua +++ b/modules/highlight.lua @@ -1,6 +1,5 @@ local Highlight = {} local goldColor, mouseColor = {r = 0.75, g = 0.75, b = 0.35}, {r = 0.75, g = 0.75, b = 0.50} -local canCure = ShadowUF.Units.canCure ShadowUF:RegisterModule(Highlight, "highlight", ShadowUF.L["Highlight"]) -- Might seem odd to hook my code in the core manually, but HookScript is ~40% slower due to it being a secure hook @@ -160,18 +159,7 @@ end function Highlight:UpdateAura(frame) frame.highlight.hasDebuff = nil if( UnitIsFriend(frame.unit, "player") ) then - local id = 0 - while( true ) do - id = id + 1 - local name, _, _, _, auraType = UnitDebuff(frame.unit, id) - if( not name ) then break end - if( auraType == "" ) then auraType = "Enrage" end - - if( canCure[auraType] ) then - frame.highlight.hasDebuff = auraType - break - end - end + frame.highlight.hasDebuff = not not UnitDebuff(frame.unit, 1); end self:Update(frame) diff --git a/modules/holypower.lua b/modules/holypower.lua index 1393ea68..c351cb73 100644 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -1,6 +1,6 @@ local HolyPower = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN") -local holyConfig = {max = MAX_HOLY_POWER, key = "holyPower", colorKey = "HOLYPOWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local holyConfig = {max = HOLY_POWER_FULL, key = "holyPower", colorKey = "HOLYPOWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function HolyPower:OnEnable(frame) frame.holyPower = frame.holyPower or CreateFrame("Frame", nil, frame) @@ -8,6 +8,7 @@ function HolyPower:OnEnable(frame) frame.comboPointType = holyConfig.key frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateMax") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") frame:RegisterUpdateFunc(self, "Update") end @@ -16,6 +17,13 @@ function HolyPower:OnDisable(frame) frame:UnregisterAll(self) end +function HolyPower:Update(frame, event, unit, powerType) + if( powerType ~= "HOLY_POWER" ) then return end + + + +end + function HolyPower:Update(frame, event, unit, powerType) if( event == "UNIT_POWER" and powerType ~= "HOLY_POWER" ) then return end diff --git a/modules/indicators.lua b/modules/indicators.lua index 59021a29..1d21acd5 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -101,7 +101,7 @@ function Indicators:UpdateLeader(frame) self:UpdateLFDRole(frame) if( not frame.indicators.leader or not frame.indicators.leader.enabled ) then return end - if( UnitIsPartyLeader(frame.unit) ) then + if( UnitIsGroupLeader(frame.unit) ) then frame.indicators.leader:Show() else frame.indicators.leader:Hide() @@ -300,7 +300,7 @@ function Indicators:OnEnable(frame) if( config.indicators.masterLoot and config.indicators.masterLoot.enabled ) then frame:RegisterNormalEvent("PARTY_LOOT_METHOD_CHANGED", self, "UpdateMasterLoot") - frame:RegisterNormalEvent("RAID_ROSTER_UPDATE", self, "UpdateMasterLoot") + frame:RegisterNormalEvent("GROUP_ROSTER_UPDATE", self, "UpdateMasterLoot") frame:RegisterUpdateFunc(self, "UpdateMasterLoot") frame.indicators.masterLoot = frame.indicators.masterLoot or frame.indicators:CreateTexture(nil, "OVERLAY") @@ -362,7 +362,7 @@ function Indicators:OnEnable(frame) -- As they all share the function, register it as long as one is active if( frame.indicators.leader or frame.indicators.masterLoot or frame.indicators.role or ( frame.unit ~= "player" and frame.indicators.lfdRole ) ) then - frame:RegisterNormalEvent("PARTY_MEMBERS_CHANGED", self, "UpdateLeader") + frame:RegisterNormalEvent("GROUP_ROSTER_UPDATE", self, "UpdateLeader") end end diff --git a/modules/layout.lua b/modules/layout.lua index f2ab55e5..2ceb5a6f 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -34,7 +34,7 @@ local function updateBackdrop() -- Update the backdrop table local backdrop = ShadowUF.db.profile.backdrop backdropTbl.bgFile = mediaPath.background - backdropTbl.edgeFile = mediaPath.border + if( mediaPath.border ~= "Interface\\None" ) then backdropTbl.edgeFile = mediaPath.border end backdropTbl.tile = backdrop.tileSize > 0 and true or false backdropTbl.edgeSize = backdrop.edgeSize backdropTbl.tileSize = backdrop.tileSize diff --git a/modules/movers.lua b/modules/movers.lua index 25f34563..7a6148d5 100644 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -41,7 +41,7 @@ local function createConfigEnv() UnitInPhase = function(unit) return true end, UnitExists = function(unit) return true end, UnitPowerMax = function(unit) return 50000 end, - UnitIsPartyLeader = function() return true end, + UnitIsGroupLeader = function() return true end, UnitIsPVP = function(unit) return true end, UnitIsDND = function(unit) return false end, UnitIsAFK = function(unit) return false end, diff --git a/modules/tags.lua b/modules/tags.lua index 1314c7a9..62bd6eaa 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -731,13 +731,13 @@ Tags.defaultTags = { return classif == "rare" and "R" or classif == "rareelite" and "R+" or classif == "elite" and "+" or classif == "worldboss" and "B" end]], ["group"] = [[function(unit, unitOwner) - if( GetNumRaidMembers() == 0 ) then return nil end + if( GetNumGroupMembers() == 0 ) then return nil end local name, server = UnitName(unitOwner) if( server and server ~= "" ) then name = string.format("%s-%s", name, server) end - for i=1, GetNumRaidMembers() do + for i=1, GetNumGroupMembers() do local raidName, _, group = GetRaidRosterInfo(i) if( raidName == name ) then return group @@ -809,12 +809,12 @@ Tags.defaultTags = { return heal and heal > 0 and string.format("+%d", heal) or ShadowUF.tagFunc.name(unit, unitOwner, fontString) end]], ["unit:raid:targeting"] = [[function(unit, unitOwner, fontString) - if( GetNumRaidMembers() == 0 ) then return nil end + if( GetNumGroupMembers() == 0 ) then return nil end local guid = UnitGUID(unit) if( not guid ) then return "0" end local total = 0 - for i=1, GetNumRaidMembers() do + for i=1, GetNumGroupMembers() do local unit = ShadowUF.raidUnits[i] if( UnitGUID(ShadowUF.unitTarget[unit]) == guid ) then total = total + 1 @@ -823,12 +823,12 @@ Tags.defaultTags = { return total end]], ["unit:raid:assist"] = [[function(unit, unitOwner, fontString) - if( GetNumRaidMembers() == 0 ) then return nil end + if( GetNumGroupMembers() == 0 ) then return nil end local guid = UnitGUID(ShadowUF.unitTarget[unit]) if( not guid ) then return "--" end local total = 0 - for i=1, GetNumRaidMembers() do + for i=1, GetNumGroupMembers() do local unit = ShadowUF.raidUnits[i] if( UnitGUID(ShadowUF.unitTarget[unit]) == guid ) then total = total + 1 @@ -893,7 +893,7 @@ Tags.defaultEvents = { ["classification"] = "UNIT_CLASSIFICATION_CHANGED", ["shortclassification"] = "UNIT_CLASSIFICATION_CHANGED", ["dechp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH", - ["group"] = "RAID_ROSTER_UPDATE", + ["group"] = "GROUP_ROSTER_UPDATE", ["unit:color:aggro"] = "UNIT_THREAT_SITUATION_UPDATE", ["color:aggro"] = "UNIT_THREAT_SITUATION_UPDATE", ["situation"] = "UNIT_THREAT_SITUATION_UPDATE", @@ -1168,10 +1168,9 @@ Tags.eventType = { ["UNIT_HEALTH_FREQUENT"] = "health", ["UNIT_HEALTH"] = "health", ["UNIT_MAXHEALTH"] = "health", - ["RAID_ROSTER_UPDATE"] = "unitless", + ["GROUP_ROSTER_UPDATE"] = "unitless", ["RAID_TARGET_UPDATE"] = "unitless", ["PLAYER_TARGET_CHANGED"] = "unitless", - ["PARTY_MEMBERS_CHANGED"] = "unitless", ["PARTY_LEADER_CHANGED"] = "unitless", ["PLAYER_ENTERING_WORLD"] = "unitless", ["PLAYER_XP_UPDATE"] = "unitless", @@ -1212,7 +1211,7 @@ local function loadAPIEvents() ["UnitIsAFK"] = "PLAYER_FLAGS_CHANGED", ["UnitIsDND"] = "PLAYER_FLAGS_CHANGED", ["UnitIsPVP"] = "PLAYER_FLAGS_CHANGED UNIT_FACTION", - ["UnitIsPartyLeader"] = "PARTY_LEADER_CHANGED PARTY_MEMBERS_CHANGED", + ["UnitIsGroupLeader"] = "PARTY_LEADER_CHANGED GROUP_ROSTER_UPDATE", ["UnitIsPVPFreeForAll"] = "PLAYER_FLAGS_CHANGED UNIT_FACTION", ["UnitCastingInfo"] = "UNIT_SPELLCAST_START UNIT_SPELLCAST_STOP UNIT_SPELLCAST_FAILED UNIT_SPELLCAST_INTERRUPTED UNIT_SPELLCAST_DELAYED", ["UnitChannelInfo"] = "UNIT_SPELLCAST_CHANNEL_START UNIT_SPELLCAST_CHANNEL_STOP UNIT_SPELLCAST_CHANNEL_INTERRUPTED UNIT_SPELLCAST_CHANNEL_UPDATE", @@ -1228,9 +1227,9 @@ local function loadAPIEvents() ["GetRuneType"] = "RUNE_TYPE_UPDATE", ["GetRaidTargetIndex"] = "RAID_TARGET_UPDATE", ["GetComboPoints"] = "UNIT_COMBO_POINTS", - ["GetNumPartyMembers"] = "PARTY_MEMBERS_CHANGED", - ["GetNumRaidMembers"] = "RAID_ROSTER_UPDATE", - ["GetRaidRosterInfo"] = "RAID_ROSTER_UPDATE", + ["GetNumSubgroupMembers"] = "GROUP_ROSTER_UPDATE", + ["GetNumGroupMembers"] = "GROUP_ROSTER_UPDATE", + ["GetRaidRosterInfo"] = "GROUP_ROSTER_UPDATE", ["GetReadyCheckStatus"] = "READY_CHECK READY_CHECK_CONFIRM READY_CHECK_FINISHED", ["GetLootMethod"] = "PARTY_LOOT_METHOD_CHANGED", ["GetThreatStatusColor"] = "UNIT_THREAT_SITUATION_UPDATE", diff --git a/modules/units.lua b/modules/units.lua index b0a883d6..a8ca5eae 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -5,7 +5,6 @@ Units.zoneUnits = {["arena"] = "arena", ["boss"] = "raid"} local stateMonitor = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") local playerClass = select(2, UnitClass("player")) local unitFrames, headerFrames, frameList, unitEvents, childUnits, queuedCombat, canCure = Units.unitFrames, Units.headerFrames, Units.frameList, Units.unitEvents, Units.childUnits, {}, Units.canCure -local curableData = {["PRIEST"] = {["Magic"] = true, ["Disease"] = true}, ["DRUID"] = {["Curse"] = true, ["Poison"] = true, ["Magic"] = GetSpellInfo(88423), ["Enrage"] = true}, ["SHAMAN"] = {["Curse"] = true, ["Magic"] = GetSpellInfo(77130)}, ["PALADIN"] = {["Poison"] = true, ["Disease"] = true, ["Magic"] = GetSpellInfo(53551)}, ["MAGE"] = {["Curse"] = true}, ["HUNTER"] = {["Enrage"] = true}, ["ROGUE"] = {["Enrage"] = true}} local _G = getfenv(0) ShadowUF.Units = Units @@ -506,12 +505,12 @@ OnAttributeChanged = function(self, name, unit) -- Check for a unit guid to do a full update elseif( self.unitRealType == "raid" ) then - self:RegisterNormalEvent("RAID_ROSTER_UPDATE", Units, "CheckGroupedUnitStatus") + self:RegisterNormalEvent("GROUP_ROSTER_UPDATE", Units, "CheckGroupedUnitStatus") self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") -- Party members need to watch for changes elseif( self.unitRealType == "party" ) then - self:RegisterNormalEvent("PARTY_MEMBERS_CHANGED", Units, "CheckGroupedUnitStatus") + self:RegisterNormalEvent("GROUP_ROSTER_UPDATE", Units, "CheckGroupedUnitStatus") self:RegisterNormalEvent("PARTY_MEMBER_ENABLE", Units, "CheckGroupedUnitStatus") self:RegisterNormalEvent("PARTY_MEMBER_DISABLE", Units, "CheckGroupedUnitStatus") self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") @@ -1256,40 +1255,6 @@ function Units:CheckPlayerZone(force) end end --- Monitor talents to figure out what the user can currently cure -function Units:SetCurable() - table.wipe(canCure) - - local list = curableData[select(2, UnitClass("player"))] - if( list ) then - for magic, spell in pairs(list) do - if( spell == true ) then - canCure[magic] = true - -- Need some specific talents for this - else - for tab=1, GetNumTalentTabs() do - for talent=1, GetNumTalents(tab) do - local name, _, _, _, currentRank = GetTalentInfo(tab, talent) - if( name == spell and currentRank > 0 ) then - canCure[magic] = true - end - end - end - end - end - end - - -- Reload frames - for frame in pairs(ShadowUF.Units.frameList) do - if( frame.unit and frame:IsVisible() and UnitIsFriend(frame.unit, "player") ) then - local config = ShadowUF.db.profile.units[frame.unitType]; - if( ( config.auras and config.auras.debuffs and config.auras.debuffs.raid ) or ( config.highlight and config.highlight.hasDebuff ) ) then - frame:FullUpdate() - end - end - end -end - local centralFrame = CreateFrame("Frame") centralFrame:RegisterEvent("PLAYER_REGEN_ENABLED") centralFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") @@ -1312,10 +1277,18 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) Units:CheckPlayerZone() -- Monitor talent changes elseif( event == "ACTIVE_TALENT_GROUP_CHANGED" or event == "PLAYER_TALENT_UPDATE" ) then - Units:SetCurable() + for frame in pairs(ShadowUF.Units.frameList) do + if( frame.unit and frame:IsVisible() and UnitIsFriend(frame.unit, "player") ) then + local config = ShadowUF.db.profile.units[frame.unitType]; + if( ( config.auras and config.auras.debuffs and config.auras.debuffs.raid ) or ( config.highlight and config.highlight.hasDebuff ) ) then + frame:FullUpdate() + end + end + end + elseif( event == "PLAYER_LOGIN" ) then - Units:SetCurable() self:RegisterEvent("PLAYER_TALENT_UPDATE") + -- This is slightly hackish, but it suits the purpose just fine for somthing thats rarely called. elseif( event == "PLAYER_REGEN_ENABLED" ) then -- Now do all of the creation for child wrapping From 52780ddf936c976e14ef4bcfcac0674fd41a682e Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 1 Jul 2012 16:04:53 -0700 Subject: [PATCH 158/794] Added upgrade for Monk colors --- ShadowedUnitFrames.lua | 68 +++++++++++++++++++++------------------ modules/defaultlayout.lua | 1 + 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 65650edd..751f536b 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 12 +ShadowUF.dbRevision = 13 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -83,7 +83,11 @@ function ShadowUF:OnInitialize() end function ShadowUF:CheckUpgrade() - local revision = self.db.profile.revision or 1 + local revision = self.db.profile.revision or 1 + if( revision <= 12 ) then + self.db.profile.classColors["MONK"] = {r = 0.0, g = 1.00 , b = 0.59} + end + if( revision <= 11 ) then for unit, config in pairs(self.db.profile.units) do if( config.powerBar ) then @@ -118,22 +122,22 @@ function ShadowUF:CheckUpgrade() self.db.profile.auraColors = {removable = {r = 1, g = 1, b = 1}} end - if( revision <= 6 ) then - for _, unit in pairs({"player", "focus", "target", "raid", "party", "mainassist", "maintank"}) do - local db = self.db.profile.units[unit] - if( not db.indicators.resurrect ) then + if( revision <= 6 ) then + for _, unit in pairs({"player", "focus", "target", "raid", "party", "mainassist", "maintank"}) do + local db = self.db.profile.units[unit] + if( not db.indicators.resurrect ) then if( unit == "target" ) then - db.indicators.resurrect = {enabled = true, anchorPoint = "RC", size = 28, x = -39, y = -1, anchorTo = "$parent"} - else - db.indicators.resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"} + db.indicators.resurrect = {enabled = true, anchorPoint = "RC", size = 28, x = -39, y = -1, anchorTo = "$parent"} + else + db.indicators.resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"} end end - - if( unit == "party" and not db.indicators.phase ) then - db.indicators.phase = {enabled = false, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} - end - end - end + + if( unit == "party" and not db.indicators.phase ) then + db.indicators.phase = {enabled = false, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} + end + end + end end function ShadowUF:LoadUnits() @@ -427,34 +431,34 @@ function ShadowUF:HideBlizzardFrames() CompactPartyFrame:Hide() for i=1, MEMBERS_PER_RAID_GROUP do - _G["CompactPartyFrameMember" .. i]:UnregisterAllEvents() + _G["CompactPartyFrameMember" .. i]:UnregisterAllEvents() end end if( CompactPartyFrame ) then hideCompactParty() elseif( CompactPartyFrame_Generate ) then - hooksecurefunc("CompactPartyFrame_Generate", hideCompactParty) + hooksecurefunc("CompactPartyFrame_Generate", hideCompactParty) end end if( ShadowUF.db.profile.hidden.raid ) then - local function hideRaid() - CompactRaidFrameManager:UnregisterAllEvents() - if( not InCombatLockdown() ) then CompactRaidFrameManager:Hide() end - - local shown = CompactRaidFrameManager_GetSetting("IsShown") - if( shown and shown ~= "0" ) then - CompactRaidFrameManager_SetSetting("IsShown", "0") - end - end + local function hideRaid() + CompactRaidFrameManager:UnregisterAllEvents() + if( not InCombatLockdown() ) then CompactRaidFrameManager:Hide() end + + local shown = CompactRaidFrameManager_GetSetting("IsShown") + if( shown and shown ~= "0" ) then + CompactRaidFrameManager_SetSetting("IsShown", "0") + end + end + + hooksecurefunc("CompactRaidFrameManager_UpdateShown", function() + if( ShadowUF.db.profile.hidden.raid ) then + hideRaid(); + end + end) - hooksecurefunc("CompactRaidFrameManager_UpdateShown", function() - if( ShadowUF.db.profile.hidden.raid ) then - hideRaid(); - end - end) - hideRaid(); else CompactRaidFrameManager:SetFrameStrata("DIALOG") diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 9a6fecb2..5fcfe155 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -135,6 +135,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) SHAMAN = {r = 0.14, g = 0.35, b = 1.0}, WARRIOR = {r = 0.78, g = 0.61, b = 0.43}, DEATHKNIGHT = {r = 0.77, g = 0.12 , b = 0.23}, + MONK = {r = 0.0, g = 1.00 , b = 0.59}, PET = {r = 0.20, g = 0.90, b = 0.20}, VEHICLE = {r = 0.23, g = 0.41, b = 0.23}, } From 9dfbd742fd141b44d511e3f9f2ff4d59a7c2e7a8 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 2 Jul 2012 00:17:59 -0700 Subject: [PATCH 159/794] Fixed a bug with the alpha for Holy Power blocks not being set Updated Holy Power support for MoP, added a banked holy power color setting to configure a special color for pips/blocks that are banked Holy Power --- ShadowedUnitFrames.lua | 6 +++++- modules/combopoints.lua | 32 ++++++++++++++++++++++++++++++-- modules/holypower.lua | 32 +++++++++++++++++++++++++++----- options/config.lua | 10 +++++++++- 4 files changed, 71 insertions(+), 9 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 751f536b..0503e3a8 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 13 +ShadowUF.dbRevision = 14 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -84,6 +84,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + if( revision <= 13 ) then + self.db.profile.powerColors["BANKEDHOLYPOWER"] = CopyTable(self.db.profile.powerColors["HOLYPOWER"]) + end + if( revision <= 12 ) then self.db.profile.classColors["MONK"] = {r = 0.0, g = 1.00 , b = 0.59} end diff --git a/modules/combopoints.lua b/modules/combopoints.lua index dbd6ad26..78eabec7 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -14,7 +14,7 @@ end function Combo:OnLayoutApplied(frame, config) local key = frame.comboPointType local pointsFrame = frame[key] - if not pointsFrame then return end + if( not pointsFrame ) then return end pointsFrame:SetFrameLevel(frame.topFrameLevel + 1) @@ -38,6 +38,8 @@ function Combo:OnLayoutApplied(frame, config) if( config.isBar ) then pointsFrame.blocks = pointsFrame.blocks or {} pointsFrame.points = pointsFrame.blocks + + pointsFrame.visibleBlocks = pointsConfig.max -- Position bars, the 5 accounts for borders local blockWidth = (pointsFrame:GetWidth() - (pointsConfig.max - 1)) / pointsConfig.max @@ -45,7 +47,7 @@ function Combo:OnLayoutApplied(frame, config) pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.blocks[id] local color = ShadowUF.db.profile.powerColors[pointsConfig.colorKey or "COMBOPOINTS"] - texture:SetVertexColor(color.r, color.g, color.b) + texture:SetVertexColor(color.r, color.g, color.b, color.a) texture:SetHorizTile(false) texture:SetTexture(ShadowUF.Layout.mediaPath.statusbar) texture:SetHeight(pointsFrame:GetHeight()) @@ -112,6 +114,32 @@ function Combo:OnLayoutApplied(frame, config) end end +function Combo:UpdateBarBlocks(frame, event, unit, powerType) + local pointsFrame = frame[frame.comboPointType] + if( not pointsFrame or not pointsFrame.config.eventType ) then return end + if( event and powerType ~= pointsFrame.config.eventType ) then return end + + if( not ShadowUF.db.profile.units[frame.unitType][frame.comboPointType].isBar ) then + return + end + + local max = UnitPowerMax("player", pointsFrame.config.powerType) + if( pointsFrame.visibleBlocks == max ) then return end + + local blockWidth = (pointsFrame:GetWidth() - (max - 1)) / max + for id=1, max do + print(id, pointsFrame.blocks[id]) + pointsFrame.blocks[id]:SetWidth(blockWidth) + pointsFrame.blocks[id]:Show() + end + + for id=max+1, max do + pointsFrame.blocks[id]:Hide() + end + + pointsFrame.visibleBlocks = max +end + function Combo:OnDisable(frame) frame:UnregisterAll(self) end diff --git a/modules/holypower.lua b/modules/holypower.lua index c351cb73..e82d80c9 100644 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -1,6 +1,6 @@ local HolyPower = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN") -local holyConfig = {max = HOLY_POWER_FULL, key = "holyPower", colorKey = "HOLYPOWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local holyConfig = {max = HOLY_POWER_FULL, key = "holyPower", colorKey = "HOLYPOWER", powerType = SPELL_POWER_HOLY_POWER, eventType = "HOLY_POWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function HolyPower:OnEnable(frame) frame.holyPower = frame.holyPower or CreateFrame("Frame", nil, frame) @@ -8,20 +8,42 @@ function HolyPower:OnEnable(frame) frame.comboPointType = holyConfig.key frame:RegisterUnitEvent("UNIT_POWER", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateMax") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") frame:RegisterUpdateFunc(self, "Update") + + holyConfig.max = UnitPowerMax("player", holyConfig.powerType); end function HolyPower:OnDisable(frame) frame:UnregisterAll(self) end -function HolyPower:Update(frame, event, unit, powerType) - if( powerType ~= "HOLY_POWER" ) then return end +function HolyPower:OnLayoutApplied(frame, config) + ShadowUF.ComboPoints:OnLayoutApplied(frame, config) + self:UpdateBarBlocks(frame) +end - +function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) + local pointsFrame = frame[frame.comboPointType] + if( not pointsFrame or frame.comboPointType ~= holyConfig.key ) then return end + if( event and powerType ~= holyConfig.eventType ) then return end + ShadowUF.ComboPoints:UpdateBarBlocks(frame); + + local config = ShadowUF.db.profile.units[frame.unitType].holyPower + local color = ShadowUF.db.profile.powerColors["BANKEDHOLYPOWER"] + + local max = UnitPowerMax("player", holyConfig.powerType) + if( max > HOLY_POWER_FULL ) then + for id=HOLY_POWER_FULL+1, max do + if( config.isBar ) then + pointsFrame.blocks[id]:SetVertexColor(color.r, color.g, color.b, color.a) + else + pointsFrame.icons[id]:SetVertexColor(color.r, color.g, color.b, color.a) + end + end + end end function HolyPower:Update(frame, event, unit, powerType) diff --git a/options/config.lua b/options/config.lua index a3d196e0..28b19b1a 100644 --- a/options/config.lua +++ b/options/config.lua @@ -1132,9 +1132,17 @@ local function loadGeneralOptions() arg = "powerColors.HOLYPOWER", hidden = function(info) return select(2, UnitClass("player")) ~= "PALADIN" end, }, - SOULSHARDS = { + BANKEDHOLYPOWER = { order = 13, type = "color", + name = L["Banked Holy Power"], + hasAlpha = true, + arg = "powerColors.BANKEDHOLYPOWER", + hidden = function(info) return select(2, UnitClass("player")) ~= "PALADIN" end, + }, + SOULSHARDS = { + order = 14, + type = "color", name = L["Soul Shards"], hasAlpha = true, arg = "powerColors.SOULSHARDS", From 8edb9d54f7c7e5911f3dd8285b34c7aabfb9d314 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 2 Jul 2012 19:01:10 -0700 Subject: [PATCH 160/794] Stripped unneeded semi colons - Added Monk Chi support - Fixed a bug with holyPower in global config --- ShadowedUnitFrames.lua | 12 +++- ShadowedUnitFrames.toc | 1 + modules/chi.lua | 41 +++++++++++++ modules/combopoints.lua | 1 - modules/defaultlayout.lua | 3 + modules/highlight.lua | 2 +- modules/holypower.lua | 8 +-- modules/incheal.lua | 2 +- modules/units.lua | 2 +- options/config.lua | 120 +++++++++++++++++++++++++++++++++++++- 10 files changed, 179 insertions(+), 13 deletions(-) create mode 100644 modules/chi.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 0503e3a8..1cf5ae1b 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 14 +ShadowUF.dbRevision = 15 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -84,6 +84,11 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + if( revision <= 14 ) then + self.db.profile.powerColors["CHI"] = {r = 0.0, g = 1.0, b = 0.59} + self.db.profile.units.player.chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true} + end + if( revision <= 13 ) then self.db.profile.powerColors["BANKEDHOLYPOWER"] = CopyTable(self.db.profile.powerColors["HOLYPOWER"]) end @@ -247,6 +252,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.soulShards = {enabled = true, isBar = true} self.defaults.profile.units.player.eclipseBar = {enabled = true} self.defaults.profile.units.player.holyPower = {enabled = true, isBar = true} + self.defaults.profile.units.player.chi = {enabled = true, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} -- PET self.defaults.profile.units.pet.enabled = true @@ -459,11 +465,11 @@ function ShadowUF:HideBlizzardFrames() hooksecurefunc("CompactRaidFrameManager_UpdateShown", function() if( ShadowUF.db.profile.hidden.raid ) then - hideRaid(); + hideRaid() end end) - hideRaid(); + hideRaid() else CompactRaidFrameManager:SetFrameStrata("DIALOG") end diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 2cf3ff62..3e52d0e9 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -49,6 +49,7 @@ modules\druid.lua modules\eclipse.lua modules\soulshards.lua modules\holypower.lua +modules\chi.lua modules\altpower.lua #@do-not-package@ options\config.lua diff --git a/modules/chi.lua b/modules/chi.lua new file mode 100644 index 00000000..22ea3fc0 --- /dev/null +++ b/modules/chi.lua @@ -0,0 +1,41 @@ +local Chi = setmetatable({}, {__index = ShadowUF.ComboPoints}) +ShadowUF:RegisterModule(Chi, "chi", ShadowUF.L["Chi"], nil, "MONK") +local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = SPELL_POWER_LIGHT_FORCE, eventType = "LIGHT_FORCE", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} + +function Chi:OnEnable(frame) + frame.chi = frame.chi or CreateFrame("Frame", nil, frame) + frame.chi.config = chiConfig + frame.comboPointType = chiConfig.key + + frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") + frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") + frame:RegisterUpdateFunc(self, "Update") +end + +function Chi:OnDisable(frame) + frame:UnregisterAll(self) +end + +function Chi:OnLayoutApplied(frame, config) + ShadowUF.ComboPoints:OnLayoutApplied(frame, config) + self:UpdateBarBlocks(frame) +end + +function Chi:Update(frame, event, unit, powerType) + if( event == "UNIT_POWER" and powerType ~= chiConfig.eventType ) then return end + + local points = UnitPower("player", chiConfig.powerType) + -- Bar display, hide it if we don't have any combo points + if( ShadowUF.db.profile.units[frame.unitType].chi.isBar ) then + ShadowUF.Layout:SetBarVisibility(frame, "chi", ShadowUF.db.profile.units[frame.unitType].chi.showAlways or (points and points > 0)) + end + + for id, pointTexture in pairs(frame.chi.points) do + if( id <= points ) then + pointTexture:Show() + else + pointTexture:Hide() + end + end +end diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 78eabec7..08533018 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -128,7 +128,6 @@ function Combo:UpdateBarBlocks(frame, event, unit, powerType) local blockWidth = (pointsFrame:GetWidth() - (max - 1)) / max for id=1, max do - print(id, pointsFrame.blocks[id]) pointsFrame.blocks[id]:SetWidth(blockWidth) pointsFrame.blocks[id]:Show() end diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 5fcfe155..e9e3d62f 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -152,8 +152,10 @@ function ShadowUF:LoadDefaultLayout(useMerge) FUEL = {r = 0.85, g = 0.47, b = 0.36}, COMBOPOINTS = {r = 1.0, g = 0.80, b = 0.0}, HOLYPOWER = {r = 0.96, g = 0.55, b = 0.73}, + BANKEDHOLYPOWER = {r = 0.96, g = 0.55, b = 0.73}, SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, ALTERNATE = {r = 0.71, g = 0.0, b = 1.0}, + CHI = {r = 0.0, g = 1.0, b = 0.59}, } config.healthColors = { tapped = {r = 0.5, g = 0.5, b = 0.5}, @@ -315,6 +317,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) eclipseBar = {enabled = true, background = true, order = 70, height = 0.40}, soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, + chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, }, diff --git a/modules/highlight.lua b/modules/highlight.lua index fd94b707..4e17c151 100644 --- a/modules/highlight.lua +++ b/modules/highlight.lua @@ -159,7 +159,7 @@ end function Highlight:UpdateAura(frame) frame.highlight.hasDebuff = nil if( UnitIsFriend(frame.unit, "player") ) then - frame.highlight.hasDebuff = not not UnitDebuff(frame.unit, 1); + frame.highlight.hasDebuff = not not UnitDebuff(frame.unit, 1) end self:Update(frame) diff --git a/modules/holypower.lua b/modules/holypower.lua index e82d80c9..456dc281 100644 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -11,8 +11,6 @@ function HolyPower:OnEnable(frame) frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") frame:RegisterUpdateFunc(self, "Update") - - holyConfig.max = UnitPowerMax("player", holyConfig.powerType); end function HolyPower:OnDisable(frame) @@ -29,7 +27,7 @@ function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) if( not pointsFrame or frame.comboPointType ~= holyConfig.key ) then return end if( event and powerType ~= holyConfig.eventType ) then return end - ShadowUF.ComboPoints:UpdateBarBlocks(frame); + ShadowUF.ComboPoints:UpdateBarBlocks(frame) local config = ShadowUF.db.profile.units[frame.unitType].holyPower local color = ShadowUF.db.profile.powerColors["BANKEDHOLYPOWER"] @@ -47,9 +45,9 @@ function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) end function HolyPower:Update(frame, event, unit, powerType) - if( event == "UNIT_POWER" and powerType ~= "HOLY_POWER" ) then return end + if( event == "UNIT_POWER" and powerType ~= holyConfig.eventType ) then return end - local points = UnitPower("player", SPELL_POWER_HOLY_POWER) + local points = UnitPower("player", holyConfig.powerType) -- Bar display, hide it if we don't have any combo points if( ShadowUF.db.profile.units[frame.unitType].holyPower.isBar ) then ShadowUF.Layout:SetBarVisibility(frame, "holyPower", ShadowUF.db.profile.units[frame.unitType].holyPower.showAlways or (points and points > 0)) diff --git a/modules/incheal.lua b/modules/incheal.lua index bb029b4d..f3ed3c00 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -78,7 +78,7 @@ end -- end -- end -- --- frame.tagEnabled = true; +-- frame.tagEnabled = true -- end -- -- function IncHeal:DisableTag(frame, fontString) diff --git a/modules/units.lua b/modules/units.lua index a8ca5eae..7b9beedf 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -1279,7 +1279,7 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) elseif( event == "ACTIVE_TALENT_GROUP_CHANGED" or event == "PLAYER_TALENT_UPDATE" ) then for frame in pairs(ShadowUF.Units.frameList) do if( frame.unit and frame:IsVisible() and UnitIsFriend(frame.unit, "player") ) then - local config = ShadowUF.db.profile.units[frame.unitType]; + local config = ShadowUF.db.profile.units[frame.unitType] if( ( config.auras and config.auras.debuffs and config.auras.debuffs.raid ) or ( config.highlight and config.highlight.hasDebuff ) ) then frame:FullUpdate() end diff --git a/options/config.lua b/options/config.lua index 28b19b1a..96f8dd60 100644 --- a/options/config.lua +++ b/options/config.lua @@ -1148,6 +1148,14 @@ local function loadGeneralOptions() arg = "powerColors.SOULSHARDS", hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, }, + CHI = { + order = 14, + type = "color", + name = L["Chi"], + hasAlpha = true, + arg = "powerColors.CHI", + hidden = function(info) return select(2, UnitClass("player")) ~= "MONK" end, + }, }, }, cast = { @@ -2539,7 +2547,7 @@ local function loadUnitOptions() type = "group", inline = true, name = L["Holy Power"], - hidden = function(info) return playerClass ~= "PALADIN" or not getVariable(info[2], "soulShards", nil, "isBar") or not getVariable(info[2], nil, nil, "soulShards") end, + hidden = function(info) return playerClass ~= "PALADIN" or not getVariable(info[2], "holyPower", nil, "isBar") or not getVariable(info[2], nil, nil, "holyPower") end, args = { enabled = { order = 1, @@ -2643,6 +2651,116 @@ local function loadUnitOptions() }, }, }, + -- Chi + barChi = { + order = 4, + type = "group", + inline = true, + name = L["Chi"], + hidden = function(info) return playerClass ~= "MONK" or not getVariable(info[2], "chi", nil, "isBar") or not getVariable(info[2], nil, nil, "chi") end, + args = { + enabled = { + order = 1, + type = "toggle", + name = string.format(L["Enable %s"], L["Chi"]), + hidden = false, + arg = "chi.enabled", + }, + growth = { + order = 2, + type = "select", + name = L["Growth"], + values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"]}, + hidden = false, + arg = "chi.growth", + }, + showAlways = { + order = 3, + type = "toggle", + name = L["Don't hide when empty"], + hidden = false, + arg = "chi.showAlways", + }, + }, + }, + chi = { + order = 4, + type = "group", + inline = true, + name = L["Chi"], + hidden = function(info) if( info[2] == "global" or getVariable(info[2], "chi", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, + args = { + enabled = { + order = 0, + type = "toggle", + name = string.format(L["Enable %s"], L["Chi"]), + hidden = false, + arg = "chi.enabled", + }, + sep1 = { + order = 1, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, + growth = { + order = 2, + type = "select", + name = L["Growth"], + values = {["UP"] = L["Up"], ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["DOWN"] = L["Down"]}, + hidden = false, + arg = "chi.growth", + }, + size = { + order = 2, + type = "range", + name = L["Size"], + min = 0, max = 50, step = 1, softMin = 0, softMax = 20, + hidden = hideAdvancedOption, + arg = "chi.size", + }, + spacing = { + order = 3, + type = "range", + name = L["Spacing"], + min = -30, max = 30, step = 1, softMin = -15, softMax = 15, + hidden = hideAdvancedOption, + arg = "chi.spacing", + }, + sep2 = { + order = 4, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, + anchorPoint = { + order = 5, + type = "select", + name = L["Anchor point"], + values = positionList, + hidden = false, + arg = "chi.anchorPoint", + }, + x = { + order = 6, + type = "range", + name = L["X Offset"], + min = -30, max = 30, step = 1, + hidden = false, + arg = "chi.x", + }, + y = { + order = 7, + type = "range", + name = L["Y Offset"], + min = -30, max = 30, step = 1, + hidden = false, + arg = "chi.y", + }, + }, + }, -- COMBO POINTS barComboPoints = { order = 4, From dc6ce80414c160672d0e9186e48ec1557ef54612 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 2 Jul 2012 20:41:12 -0700 Subject: [PATCH 161/794] Added Burning Embers, Demonic Fury and Soul Shard bars for Warlocks - Added the ability for modules to be registered to a specific spec - Changed Eclipse to only load for Balance Druids --- ShadowedUnitFrames.lua | 17 +++--- ShadowedUnitFrames.toc | 2 + modules/burningembers.lua | 118 ++++++++++++++++++++++++++++++++++++++ modules/combopoints.lua | 8 ++- modules/defaultlayout.lua | 5 ++ modules/demonicfury.lua | 36 ++++++++++++ modules/eclipse.lua | 7 +-- modules/holypower.lua | 5 +- modules/soulshards.lua | 20 +++++-- modules/units.lua | 18 ++++-- options/config.lua | 48 ++++++++++++++-- 11 files changed, 252 insertions(+), 32 deletions(-) create mode 100644 modules/burningembers.lua create mode 100644 modules/demonicfury.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 1cf5ae1b..957060f3 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -86,7 +86,13 @@ function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 if( revision <= 14 ) then self.db.profile.powerColors["CHI"] = {r = 0.0, g = 1.0, b = 0.59} + self.db.profile.powerColors["DEMONICFURY"] = {r = 0.58, g = 0.51, b = 0.79} + self.db.profile.powerColors["BURNINGEMBERS"] = {r = 0.58, g = 0.51, b = 0.79} + self.db.profile.powerColors["FULLBURNINGEMBER"] = {r = 0, g = 1, b = 0} + self.db.profile.units.player.chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true} + self.db.profile.units.player.burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70} + self.db.profile.units.player.demonicFuryBar = {enabled = true, background = false, height = 0.40, order = 70} end if( revision <= 13 ) then @@ -250,6 +256,8 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.xpBar = {enabled = false} self.defaults.profile.units.player.fader = {enabled = false} self.defaults.profile.units.player.soulShards = {enabled = true, isBar = true} + self.defaults.profile.units.player.demonicFuryBar = {enabled = true} + self.defaults.profile.units.player.burningEmbersBar = {enabled = true} self.defaults.profile.units.player.eclipseBar = {enabled = true} self.defaults.profile.units.player.holyPower = {enabled = true, isBar = true} self.defaults.profile.units.player.chi = {enabled = true, isBar = true} @@ -344,19 +352,14 @@ function ShadowUF:LoadUnitDefaults() end -- Module APIs -function ShadowUF:RegisterModule(module, key, name, isBar, class) - -- November 30th - if( key == "ClassColoredPowerBar" ) then - DEFAULT_CHAT_FRAME:AddMessage("[WARNING!] ShadowedUF_ClassPower is broken and built in by default now. You do not need it anymore") - return - end - +function ShadowUF:RegisterModule(module, key, name, isBar, class, spec) self.modules[key] = module module.moduleKey = key module.moduleHasBar = isBar module.moduleName = name module.moduleClass = class + module.moduleSpec = spec table.insert(self.moduleOrder, module) end diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 3e52d0e9..2c467e70 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -50,6 +50,8 @@ modules\eclipse.lua modules\soulshards.lua modules\holypower.lua modules\chi.lua +modules\demonicfury.lua +modules\burningembers.lua modules\altpower.lua #@do-not-package@ options\config.lua diff --git a/modules/burningembers.lua b/modules/burningembers.lua new file mode 100644 index 00000000..979f2a3e --- /dev/null +++ b/modules/burningembers.lua @@ -0,0 +1,118 @@ +local Embers = {} +ShadowUF:RegisterModule(Embers, "burningEmbersBar", ShadowUF.L["Burning Embers bar"], true, "WARLOCK", SPEC_WARLOCK_DESTRUCTION) + +-- This is a local in ShardBar.lua so we can't access it right now +local MAX_POWER_PER_EMBER = MAX_POWER_PER_EMBER or 10 + +function Embers:OnEnable(frame) + if( not frame.burningEmbersBar ) then + frame.burningEmbersBar = CreateFrame("StatusBar", nil, frame) + frame.burningEmbersBar:SetMinMaxValues(0, 1) + frame.burningEmbersBar:SetValue(0) + frame.burningEmbersBar.embers = {} + + for id=1, 4 do + local ember = ShadowUF.Units:CreateBar(frame) + ember:SetFrameLevel(1) + + if( id > 1 ) then + ember:SetPoint("TOPLEFT", frame.burningEmbersBar.embers[id - 1], "TOPRIGHT", 1, 0) + else + ember:SetPoint("TOPLEFT", frame.burningEmbersBar, "TOPLEFT", 0, 0) + end + + frame.burningEmbersBar.embers[id] = ember + end + end + + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") + frame:RegisterUpdateFunc(self, "Update") + frame:RegisterUpdateFunc(self, "UpdateBarBlocks") +end + +function Embers:OnDisable(frame) + frame:UnregisterAll(self) + + for id, ember in pairs(frame.burningEmbersBar.embers) do + ember.background:Hide() + end +end + +function Embers:OnLayoutApplied(frame) + if( not frame.visibility.burningEmbersBar ) then return end + + for id, ember in pairs(frame.burningEmbersBar.embers) do + if( ShadowUF.db.profile.units[frame.unitType].burningEmbersBar.background ) then + ember.background:Show() + else + ember.background:Hide() + end + + ember.background:SetTexture(ShadowUF.Layout.mediaPath.statusbar) + ember.background:SetHorizTile(false) + ember:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) + ember:GetStatusBarTexture():SetHorizTile(false) + ember:SetHeight(frame.burningEmbersBar:GetHeight()) + ember:SetMinMaxValues(0, MAX_POWER_PER_EMBER) + ember.setColor = nil + end + + self:UpdateBarBlocks(frame) +end + +function Embers:UpdateBarBlocks(frame, event, unit, powerType) + if( not frame.visibility.burningEmbersBar ) then return end + if( event and powerType ~= "BURNING_EMBERS" ) then return end + + local max = UnitPowerMax("player", SPELL_POWER_BURNING_EMBERS, true) + max = floor(max / MAX_POWER_PER_EMBER) + + if( frame.burningEmbersBar.visibleBlocks == max ) then return end + + local blockWidth = (frame.burningEmbersBar:GetWidth() - (max - 1)) / max + for id=1, max do + local ember = frame.burningEmbersBar.embers[id] + ember:SetWidth(blockWidth) + ember.background:Show() + ember:Show() + end + + for id=max+1, max do + frame.burningEmbersBar.embers[id]:Hide() + end + + frame.burningEmbersBar.visibleBlocks = max +end + +function Embers:Update(frame, event, unit, powerType) + if( event and powerType ~= "BURNING_EMBERS" ) then return end + + local power = UnitPower("player", SPELL_POWER_BURNING_EMBERS, true) + for id=1, frame.burningEmbersBar.visibleBlocks do + local ember = frame.burningEmbersBar.embers[id] + + local color + if( power >= MAX_POWER_PER_EMBER ) then + color = "FULLBURNINGEMBER" + ember:SetValue(MAX_POWER_PER_EMBER) + elseif( power > 0 ) then + color = "BURNINGEMBERS" + ember:SetValue(power) + else + color = "BURNINGEMBERS" + ember:SetValue(0) + end + + if( ember.setColor ~= color ) then + ember.setColor = color + + ember:SetStatusBarColor(ShadowUF.db.profile.powerColors[color].r, ShadowUF.db.profile.powerColors[color].g, ShadowUF.db.profile.powerColors[color].b) + + color = ShadowUF.db.profile.bars.backgroundColor or ShadowUF.db.profile.units[frame.unitType].runeBar.backgroundColor or ShadowUF.db.profile.powerColors[color] + ember.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) + end + + power = power - MAX_POWER_PER_EMBER + end +end diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 08533018..82a8763a 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -114,6 +114,11 @@ function Combo:OnLayoutApplied(frame, config) end end +function Combo:OnDisable(frame) + frame:UnregisterAll(self) +end + + function Combo:UpdateBarBlocks(frame, event, unit, powerType) local pointsFrame = frame[frame.comboPointType] if( not pointsFrame or not pointsFrame.config.eventType ) then return end @@ -139,9 +144,6 @@ function Combo:UpdateBarBlocks(frame, event, unit, powerType) pointsFrame.visibleBlocks = max end -function Combo:OnDisable(frame) - frame:UnregisterAll(self) -end function Combo:Update(frame) -- For Malygos dragons, they also self cast their CP on themselves, which is why we check CP on ourself! diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index e9e3d62f..6114e311 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -154,6 +154,9 @@ function ShadowUF:LoadDefaultLayout(useMerge) HOLYPOWER = {r = 0.96, g = 0.55, b = 0.73}, BANKEDHOLYPOWER = {r = 0.96, g = 0.55, b = 0.73}, SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, + DEMONICFURY = {r = 0.58, g = 0.51, b = 0.79}, + BURNINGEMBERS = {r = 0.58, g = 0.51, b = 0.79}, + FULLBURNINGEMBER = {r = 0, g = 1, b = 0}, ALTERNATE = {r = 0.71, g = 0.0, b = 1.0}, CHI = {r = 0.0, g = 1.0, b = 0.59}, } @@ -315,6 +318,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, eclipseBar = {enabled = true, background = true, order = 70, height = 0.40}, + demonicFuryBar = {enabled = true, background = false, height = 0.40, order = 70}, + burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70}, soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, diff --git a/modules/demonicfury.lua b/modules/demonicfury.lua new file mode 100644 index 00000000..c7868911 --- /dev/null +++ b/modules/demonicfury.lua @@ -0,0 +1,36 @@ +local DemonicFury = {} +ShadowUF:RegisterModule(DemonicFury, "demonicFuryBar", ShadowUF.L["Demonic Fury"], true, "WARLOCK", SPEC_WARLOCK_DEMONOLOGY) + +function DemonicFury:OnEnable(frame) + frame.demonicFuryBar = frame.demonicFuryBar or ShadowUF.Units:CreateBar(frame) + + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateMax") + + frame:RegisterUpdateFunc(self, "Update") + frame:RegisterUpdateFunc(self, "UpdateMax") +end + +function DemonicFury:OnLayoutApplied(frame) + if( frame.visibility.demonicFuryBar ) then + local color = ShadowUF.db.profile.powerColors.DEMONICFURY + frame.demonicFuryBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) + end +end + +function DemonicFury:OnDisable(frame) + frame:UnregisterAll(self) +end + +function DemonicFury:UpdateMax(frame, event, unit, powerType) + if( event and powerType ~= "DEMONIC_FURY" ) then return end + + frame.demonicFuryBar:SetMinMaxValues(0, UnitPowerMax("player", SPELL_POWER_DEMONIC_FURY) or 0) + frame.demonicFuryBar:SetValue(UnitPower("player", SPELL_POWER_DEMONIC_FURY) or 0) +end + +function DemonicFury:Update(frame, event, unit, powerType) + if( event and powerType ~= "DEMONIC_FURY" ) then return end + + frame.demonicFuryBar:SetValue(UnitPower("player", SPELL_POWER_DEMONIC_FURY) or 0) +end \ No newline at end of file diff --git a/modules/eclipse.lua b/modules/eclipse.lua index 2d9e9ded..03a6c86b 100644 --- a/modules/eclipse.lua +++ b/modules/eclipse.lua @@ -1,8 +1,9 @@ -- Moon on left, Sun on right -- Cast Arcane -> Move to Sun (Buff Nature) -- Cast Nature -> Move to Moon (Buff Arcane) +-- 1 = Balance spec local Eclipse = {types = {"sun", "moon"}} -ShadowUF:RegisterModule(Eclipse, "eclipseBar", ShadowUF.L["Eclipse bar"], true, "DRUID") +ShadowUF:RegisterModule(Eclipse, "eclipseBar", ShadowUF.L["Eclipse bar"], true, "DRUID", 1) function Eclipse:OnEnable(frame) if( not frame.eclipseBar ) then @@ -30,8 +31,6 @@ function Eclipse:OnEnable(frame) frame:RegisterNormalEvent("UNIT_MAXPOWER", self, "Update") frame:RegisterNormalEvent("ECLIPSE_DIRECTION_CHANGE", self, "UpdateDirection") frame:RegisterNormalEvent("UPDATE_SHAPESHIFT_FORM", self, "UpdateVisibility") - frame:RegisterNormalEvent("PLAYER_TALENT_UPDATE", self, "UpdateVisibility") - frame:RegisterNormalEvent("MASTERY_UPDATE", self, "UpdateVisibility") frame:RegisterUpdateFunc(self, "UpdateVisibility") end @@ -55,7 +54,7 @@ end function Eclipse:UpdateVisibility(frame) local form = GetShapeshiftFormID() - ShadowUF.Layout:SetBarVisibility(frame, "eclipseBar", (form == MOONKIN_FORM or not form) and GetSpecialization() == 1) + ShadowUF.Layout:SetBarVisibility(frame, "eclipseBar", (form == MOONKIN_FORM or not form)) Eclipse:UpdateDirection(frame) Eclipse:Update(frame, nil, nil, "ECLIPSE") end diff --git a/modules/holypower.lua b/modules/holypower.lua index 456dc281..bc8f54a4 100644 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -11,6 +11,7 @@ function HolyPower:OnEnable(frame) frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") frame:RegisterUpdateFunc(self, "Update") + frame:RegisterUpdateFunc(self, "UpdateBarBlocks") end function HolyPower:OnDisable(frame) @@ -36,9 +37,9 @@ function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) if( max > HOLY_POWER_FULL ) then for id=HOLY_POWER_FULL+1, max do if( config.isBar ) then - pointsFrame.blocks[id]:SetVertexColor(color.r, color.g, color.b, color.a) + pointsFrame.blocks[id]:SetVertexColor(color.r, color.g, color.b) else - pointsFrame.icons[id]:SetVertexColor(color.r, color.g, color.b, color.a) + pointsFrame.icons[id]:SetVertexColor(color.r, color.g, color.b) end end end diff --git a/modules/soulshards.lua b/modules/soulshards.lua index 9c64acee..15a26e42 100644 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -1,25 +1,33 @@ local Souls = setmetatable({}, {__index = ShadowUF.ComboPoints}) -ShadowUF:RegisterModule(Souls, "soulShards", ShadowUF.L["Soul Shards"], nil, "WARLOCK") -local soulsConfig = {max = SHARD_BAR_NUM_SHARDS, key = "soulShards", colorKey = "SOULSHARDS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\shard"} +ShadowUF:RegisterModule(Souls, "soulShards", ShadowUF.L["Soul Shards"], nil, "WARLOCK", SPEC_WARLOCK_AFFLICTION) +local soulsConfig = {max = 4, key = "soulShards", colorKey = "SOULSHARDS", powerType = SPELL_POWER_SOUL_SHARDS, eventType = "SOUL_SHARDS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\shard"} function Souls:OnEnable(frame) frame.soulShards = frame.soulShards or CreateFrame("Frame", nil, frame) frame.soulShards.config = soulsConfig frame.comboPointType = soulsConfig.key - frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") + frame:RegisterUpdateFunc(self, "Update") + frame:RegisterUpdateFunc(self, "UpdateBarBlocks") end function Souls:OnDisable(frame) frame:UnregisterAll(self) end +function Souls:OnLayoutApplied(frame, config) + ShadowUF.ComboPoints:OnLayoutApplied(frame, config) + self:UpdateBarBlocks(frame) +end + function Souls:Update(frame, event, unit, powerType) - if( event == "UNIT_POWER" and powerType ~= "SOUL_SHARDS" ) then return end - - local points = UnitPower("player", SPELL_POWER_SOUL_SHARDS) + if( event == "UNIT_POWER" and powerType ~= soulsConfig.eventType ) then return end + + local points = UnitPower("player", soulsConfig.powerType) -- Bar display, hide it if we don't have any soul shards if( ShadowUF.db.profile.units[frame.unitType].soulShards.isBar ) then ShadowUF.Layout:SetBarVisibility(frame, "soulShards", ShadowUF.db.profile.units[frame.unitType].soulShards.showAlways or (points and points > 0)) diff --git a/modules/units.lua b/modules/units.lua index 7b9beedf..211d92bb 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -192,6 +192,7 @@ end local function SetVisibility(self) local layoutUpdate local instanceType = select(2, IsInInstance()) + local playerSpec = GetSpecialization() -- Selectively disable modules for _, module in pairs(ShadowUF.moduleOrder) do @@ -223,7 +224,11 @@ local function SetVisibility(self) if( module.moduleClass and module.moduleClass ~= playerClass ) then enabled = nil end - + + if( module.moduleSpec and module.moduleSpec ~= playerSpec ) then + enabled = nil + end + -- Module isn't enabled all the time, only in this zone so we need to force it to be enabled if( not self.visibility[key] and enabled ) then module:OnEnable(self) @@ -1276,18 +1281,19 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) elseif( event == "PLAYER_UNGHOST" ) then Units:CheckPlayerZone() -- Monitor talent changes - elseif( event == "ACTIVE_TALENT_GROUP_CHANGED" or event == "PLAYER_TALENT_UPDATE" ) then + elseif( event == "PLAYER_SPECIALIZATION_CHANGED" ) then for frame in pairs(ShadowUF.Units.frameList) do - if( frame.unit and frame:IsVisible() and UnitIsFriend(frame.unit, "player") ) then - local config = ShadowUF.db.profile.units[frame.unitType] - if( ( config.auras and config.auras.debuffs and config.auras.debuffs.raid ) or ( config.highlight and config.highlight.hasDebuff ) ) then + if( frame.unit ) then + frame:SetVisibility() + + if( frame:IsVisible() ) then frame:FullUpdate() end end end elseif( event == "PLAYER_LOGIN" ) then - self:RegisterEvent("PLAYER_TALENT_UPDATE") + self:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED") -- This is slightly hackish, but it suits the purpose just fine for somthing thats rarely called. elseif( event == "PLAYER_REGEN_ENABLED" ) then diff --git a/options/config.lua b/options/config.lua index 96f8dd60..c3340b65 100644 --- a/options/config.lua +++ b/options/config.lua @@ -569,7 +569,7 @@ local function loadGeneralOptions() -- Strip module settings that aren't with SUF by default if( not layoutData.modules ) then - local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true} + local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true, ["demonicFuryBar"] = true, ["burningEmbersBar"] = true, ["chi"] = true} for _, unitData in pairs(layout.units) do for key, data in pairs(unitData) do if( type(data) == "table" and not validModules[key] and ShadowUF.modules[key] ) then @@ -1148,8 +1148,32 @@ local function loadGeneralOptions() arg = "powerColors.SOULSHARDS", hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, }, + DEMONICFURY = { + order = 15, + type = "color", + name = L["Demonic Fury"], + hasAlpha = true, + arg = "powerColors.DEMONICFURY", + hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, + }, + BURNINGEMBERS = { + order = 16, + type = "color", + name = L["Burning Embers"], + hasAlpha = true, + arg = "powerColors.BURNINGEMBERS", + hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, + }, + FULLBURNINGEMBER = { + order = 16, + type = "color", + name = L["Full Burning Ember"], + hasAlpha = true, + arg = "powerColors.FULLBURNINGEMBER", + hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, + }, CHI = { - order = 14, + order = 17, type = "color", name = L["Chi"], hasAlpha = true, @@ -3464,7 +3488,7 @@ local function loadUnitOptions() hidden = function(info) local unit = info[2] if( unit == "global" ) then - return not globalConfig.runeBar and not globalConfig.eclipseBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.xpBar + return not globalConfig.runeBar and not globalConfig.eclipseBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.xpBar and not globalConfig.demonicFuryBar and not globalConfig.burningEmbersBar else return unit ~= "player" end @@ -3482,10 +3506,26 @@ local function loadUnitOptions() order = 1.25, type = "toggle", name = string.format(L["Enable %s"], L["Eclipse bar"]), - desc = L["Adds eclipse bars and how far into sun or moon eclipse is.."], + desc = L["Adds eclipse bars and how far into sun or moon eclipse is."], hidden = hideRestrictedOption, arg = "eclipseBar.enabled", }, + demonicFuryBar = { + order = 1.25, + type = "toggle", + name = string.format(L["Enable %s"], L["Demonic Fury bar"]), + desc = L["Adds a Demonic Fury bar for Demonology Warlocks."], + hidden = hideRestrictedOption, + arg = "demonicFuryBar.enabled", + }, + burningEmbersBar = { + order = 1.25, + type = "toggle", + name = string.format(L["Enable %s"], L["Burning Embers bar"]), + desc = L["Adds a Burning Embers bar for Destruction Warlocks."], + hidden = hideRestrictedOption, + arg = "burningEmbersBar.enabled", + }, totemBar = { order = 1.5, type = "toggle", From 8a402ac2ec46483201f895b7cced97322b201d0d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 2 Jul 2012 20:56:48 -0700 Subject: [PATCH 162/794] Added Shadow Orbs --- ShadowedUnitFrames.lua | 3 + ShadowedUnitFrames.toc | 1 + modules/defaultlayout.lua | 2 + modules/shadoworbs.lua | 42 +++++++++++++ options/config.lua | 120 +++++++++++++++++++++++++++++++++++++- 5 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 modules/shadoworbs.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 957060f3..3c693a56 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -89,8 +89,10 @@ function ShadowUF:CheckUpgrade() self.db.profile.powerColors["DEMONICFURY"] = {r = 0.58, g = 0.51, b = 0.79} self.db.profile.powerColors["BURNINGEMBERS"] = {r = 0.58, g = 0.51, b = 0.79} self.db.profile.powerColors["FULLBURNINGEMBER"] = {r = 0, g = 1, b = 0} + self.db.profile.powerColors["SHADOWORBS"] = {r = 0.58, g = 0.51, b = 0.79} self.db.profile.units.player.chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true} + self.db.profile.units.player.shadowOrbs = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true} self.db.profile.units.player.burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70} self.db.profile.units.player.demonicFuryBar = {enabled = true, background = false, height = 0.40, order = 70} end @@ -260,6 +262,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.burningEmbersBar = {enabled = true} self.defaults.profile.units.player.eclipseBar = {enabled = true} self.defaults.profile.units.player.holyPower = {enabled = true, isBar = true} + self.defaults.profile.units.player.shadowOrbs = {enabled = true, isBar = true} self.defaults.profile.units.player.chi = {enabled = true, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} -- PET diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 2c467e70..dd722ed4 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -53,6 +53,7 @@ modules\chi.lua modules\demonicfury.lua modules\burningembers.lua modules\altpower.lua +modules\shadoworbs.lua #@do-not-package@ options\config.lua #@end-do-not-package@ diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 6114e311..79a65e83 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -157,6 +157,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) DEMONICFURY = {r = 0.58, g = 0.51, b = 0.79}, BURNINGEMBERS = {r = 0.58, g = 0.51, b = 0.79}, FULLBURNINGEMBER = {r = 0, g = 1, b = 0}, + SHADOWORBS = {r = 0.58, g = 0.51, b = 0.79}, ALTERNATE = {r = 0.71, g = 0.0, b = 1.0}, CHI = {r = 0.0, g = 1.0, b = 0.59}, } @@ -323,6 +324,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, + shadowOrbs = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, }, diff --git a/modules/shadoworbs.lua b/modules/shadoworbs.lua new file mode 100644 index 00000000..aefe9019 --- /dev/null +++ b/modules/shadoworbs.lua @@ -0,0 +1,42 @@ +local ShadowOrbs = setmetatable({}, {__index = ShadowUF.ComboPoints}) +ShadowUF:RegisterModule(ShadowOrbs, "shadowOrbs", ShadowUF.L["Shadow Orbs"], nil, "PRIEST", SPEC_PRIEST_SHADOW) +local shadowConfig = {max = PRIEST_BAR_NUM_ORBS, key = "shadowOrbs", colorKey = "SHADOWORBS", powerType = SPELL_POWER_SHADOW_ORBS, eventType = "SHADOW_ORBS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} + +function ShadowOrbs:OnEnable(frame) + frame.shadowOrbs = frame.shadowOrbs or CreateFrame("Frame", nil, frame) + frame.shadowOrbs.config = shadowConfig + frame.comboPointType = shadowConfig.key + + frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") + frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") + frame:RegisterUpdateFunc(self, "Update") + frame:RegisterUpdateFunc(self, "UpdateBarBlocks") +end + +function ShadowOrbs:OnDisable(frame) + frame:UnregisterAll(self) +end + +function ShadowOrbs:OnLayoutApplied(frame, config) + ShadowUF.ComboPoints:OnLayoutApplied(frame, config) + self:UpdateBarBlocks(frame) +end + +function ShadowOrbs:Update(frame, event, unit, powerType) + if( event == "UNIT_POWER" and powerType ~= shadowConfig.eventType ) then return end + + local points = UnitPower("player", shadowConfig.powerType) + -- Bar display, hide it if we don't have any combo points + if( ShadowUF.db.profile.units[frame.unitType].shadowOrbs.isBar ) then + ShadowUF.Layout:SetBarVisibility(frame, "shadowOrbs", ShadowUF.db.profile.units[frame.unitType].shadowOrbs.showAlways or (points and points > 0)) + end + + for id, pointTexture in pairs(frame.shadowOrbs.points) do + if( id <= points ) then + pointTexture:Show() + else + pointTexture:Hide() + end + end +end diff --git a/options/config.lua b/options/config.lua index c3340b65..cabee6b1 100644 --- a/options/config.lua +++ b/options/config.lua @@ -569,7 +569,7 @@ local function loadGeneralOptions() -- Strip module settings that aren't with SUF by default if( not layoutData.modules ) then - local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true, ["demonicFuryBar"] = true, ["burningEmbersBar"] = true, ["chi"] = true} + local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true, ["demonicFuryBar"] = true, ["burningEmbersBar"] = true, ["chi"] = true, ["shadowOrbs"] = true} for _, unitData in pairs(layout.units) do for key, data in pairs(unitData) do if( type(data) == "table" and not validModules[key] and ShadowUF.modules[key] ) then @@ -1124,6 +1124,14 @@ local function loadGeneralOptions() hasAlpha = true, arg = "powerColors.COMBOPOINTS", }, + SHADOWORBS = { + order = 12, + type = "color", + name = L["Shadow Orbs"], + hasAlpha = true, + arg = "powerColors.SHADOWORBS", + hidden = function(info) return select(2, UnitClass("player")) ~= "PRIEST" end, + }, HOLYPOWER = { order = 12, type = "color", @@ -2675,6 +2683,116 @@ local function loadUnitOptions() }, }, }, + -- SHADOW ORBS + barShadowOrbs = { + order = 4, + type = "group", + inline = true, + name = L["Shadow Orbs"], + hidden = function(info) return playerClass ~= "PRIEST" or not getVariable(info[2], "shadowOrbs", nil, "isBar") or not getVariable(info[2], nil, nil, "shadowOrbs") end, + args = { + enabled = { + order = 1, + type = "toggle", + name = string.format(L["Enable %s"], L["Shadow Orbs"]), + hidden = false, + arg = "shadowOrbs.enabled", + }, + growth = { + order = 2, + type = "select", + name = L["Growth"], + values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"]}, + hidden = false, + arg = "shadowOrbs.growth", + }, + showAlways = { + order = 3, + type = "toggle", + name = L["Don't hide when empty"], + hidden = false, + arg = "shadowOrbs.showAlways", + }, + }, + }, + shadowOrbs = { + order = 4, + type = "group", + inline = true, + name = L["Holy Power"], + hidden = function(info) if( info[2] == "global" or getVariable(info[2], "shadowOrbs", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, + args = { + enabled = { + order = 0, + type = "toggle", + name = string.format(L["Enable %s"], L["Shadow Orbs"]), + hidden = false, + arg = "shadowOrbs.enabled", + }, + sep1 = { + order = 1, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, + growth = { + order = 2, + type = "select", + name = L["Growth"], + values = {["UP"] = L["Up"], ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["DOWN"] = L["Down"]}, + hidden = false, + arg = "shadowOrbs.growth", + }, + size = { + order = 2, + type = "range", + name = L["Size"], + min = 0, max = 50, step = 1, softMin = 0, softMax = 20, + hidden = hideAdvancedOption, + arg = "shadowOrbs.size", + }, + spacing = { + order = 3, + type = "range", + name = L["Spacing"], + min = -30, max = 30, step = 1, softMin = -15, softMax = 15, + hidden = hideAdvancedOption, + arg = "shadowOrbs.spacing", + }, + sep2 = { + order = 4, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, + anchorPoint = { + order = 5, + type = "select", + name = L["Anchor point"], + values = positionList, + hidden = false, + arg = "shadowOrbs.anchorPoint", + }, + x = { + order = 6, + type = "range", + name = L["X Offset"], + min = -30, max = 30, step = 1, + hidden = false, + arg = "shadowOrbs.x", + }, + y = { + order = 7, + type = "range", + name = L["Y Offset"], + min = -30, max = 30, step = 1, + hidden = false, + arg = "shadowOrbs.y", + }, + }, + }, -- Chi barChi = { order = 4, From 9daffa8b0496ca5aa4db3bcb869a62ff14f5afdb Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 2 Jul 2012 20:57:38 -0700 Subject: [PATCH 163/794] Bump DB revision --- ShadowedUnitFrames.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 3c693a56..91eb87aa 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 15 +ShadowUF.dbRevision = 16 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -84,19 +84,23 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 - if( revision <= 14 ) then - self.db.profile.powerColors["CHI"] = {r = 0.0, g = 1.0, b = 0.59} + if( revision <= 15 ) then self.db.profile.powerColors["DEMONICFURY"] = {r = 0.58, g = 0.51, b = 0.79} self.db.profile.powerColors["BURNINGEMBERS"] = {r = 0.58, g = 0.51, b = 0.79} self.db.profile.powerColors["FULLBURNINGEMBER"] = {r = 0, g = 1, b = 0} self.db.profile.powerColors["SHADOWORBS"] = {r = 0.58, g = 0.51, b = 0.79} - self.db.profile.units.player.chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true} self.db.profile.units.player.shadowOrbs = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true} self.db.profile.units.player.burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70} self.db.profile.units.player.demonicFuryBar = {enabled = true, background = false, height = 0.40, order = 70} end + if( revision <= 14 ) then + self.db.profile.powerColors["CHI"] = {r = 0.0, g = 1.0, b = 0.59} + + self.db.profile.units.player.chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true} + end + if( revision <= 13 ) then self.db.profile.powerColors["BANKEDHOLYPOWER"] = CopyTable(self.db.profile.powerColors["HOLYPOWER"]) end From d6db09d60c15c5bc317afbeb45e205e477b32d39 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 2 Jul 2012 21:00:34 -0700 Subject: [PATCH 164/794] Set a more realistic full burning ember color --- ShadowedUnitFrames.lua | 2 +- modules/defaultlayout.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 91eb87aa..e699ca25 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -87,7 +87,7 @@ function ShadowUF:CheckUpgrade() if( revision <= 15 ) then self.db.profile.powerColors["DEMONICFURY"] = {r = 0.58, g = 0.51, b = 0.79} self.db.profile.powerColors["BURNINGEMBERS"] = {r = 0.58, g = 0.51, b = 0.79} - self.db.profile.powerColors["FULLBURNINGEMBER"] = {r = 0, g = 1, b = 0} + self.db.profile.powerColors["FULLBURNINGEMBER"] = {r = 0.23, g = 0.039, b = 0.49} self.db.profile.powerColors["SHADOWORBS"] = {r = 0.58, g = 0.51, b = 0.79} self.db.profile.units.player.shadowOrbs = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true} diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 79a65e83..29a57c19 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -156,7 +156,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, DEMONICFURY = {r = 0.58, g = 0.51, b = 0.79}, BURNINGEMBERS = {r = 0.58, g = 0.51, b = 0.79}, - FULLBURNINGEMBER = {r = 0, g = 1, b = 0}, + FULLBURNINGEMBER = {r = 0.23, g = 0.039, b = 0.49}, SHADOWORBS = {r = 0.58, g = 0.51, b = 0.79}, ALTERNATE = {r = 0.71, g = 0.0, b = 1.0}, CHI = {r = 0.0, g = 1.0, b = 0.59}, From e8022b33b73e1b8061c291d5612e4f5fab939134 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 2 Jul 2012 21:05:07 -0700 Subject: [PATCH 165/794] Fixed login errors with holy power and pips --- modules/combopoints.lua | 2 +- modules/holypower.lua | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 82a8763a..d22aba54 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -91,7 +91,7 @@ function Combo:OnLayoutApplied(frame, config) pointsFrame.icons = pointsFrame.icons or {} pointsFrame.points = pointsFrame.icons - + for id=1, pointsConfig.max do pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.icons[id] diff --git a/modules/holypower.lua b/modules/holypower.lua index bc8f54a4..d6661dd0 100644 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -12,6 +12,8 @@ function HolyPower:OnEnable(frame) frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") frame:RegisterUpdateFunc(self, "Update") frame:RegisterUpdateFunc(self, "UpdateBarBlocks") + + holyConfig.max = UnitPowerMax("player", holyConfig.powerType) end function HolyPower:OnDisable(frame) @@ -36,11 +38,7 @@ function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) local max = UnitPowerMax("player", holyConfig.powerType) if( max > HOLY_POWER_FULL ) then for id=HOLY_POWER_FULL+1, max do - if( config.isBar ) then - pointsFrame.blocks[id]:SetVertexColor(color.r, color.g, color.b) - else - pointsFrame.icons[id]:SetVertexColor(color.r, color.g, color.b) - end + pointsFrame.points[id]:SetVertexColor(color.r, color.g, color.b) end end end From 49c0f98b29737b96e94e4f0eadc72f48c48b5041 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 2 Jul 2012 21:09:48 -0700 Subject: [PATCH 166/794] Set a better default banked Holy Power color - Fixed an error with Holy Power bars --- ShadowedUnitFrames.lua | 2 +- modules/defaultlayout.lua | 2 +- modules/holypower.lua | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index e699ca25..051dd47f 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -102,7 +102,7 @@ function ShadowUF:CheckUpgrade() end if( revision <= 13 ) then - self.db.profile.powerColors["BANKEDHOLYPOWER"] = CopyTable(self.db.profile.powerColors["HOLYPOWER"]) + self.db.profile.powerColors["BANKEDHOLYPOWER"] = {r = 0.96, g = 0.61, b = 0.84} end if( revision <= 12 ) then diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 29a57c19..d2eb7f08 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -152,7 +152,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) FUEL = {r = 0.85, g = 0.47, b = 0.36}, COMBOPOINTS = {r = 1.0, g = 0.80, b = 0.0}, HOLYPOWER = {r = 0.96, g = 0.55, b = 0.73}, - BANKEDHOLYPOWER = {r = 0.96, g = 0.55, b = 0.73}, + BANKEDHOLYPOWER = {r = 0.96, g = 0.61, b = 0.84}, SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, DEMONICFURY = {r = 0.58, g = 0.51, b = 0.79}, BURNINGEMBERS = {r = 0.58, g = 0.51, b = 0.79}, diff --git a/modules/holypower.lua b/modules/holypower.lua index d6661dd0..30222fe1 100644 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -38,7 +38,11 @@ function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) local max = UnitPowerMax("player", holyConfig.powerType) if( max > HOLY_POWER_FULL ) then for id=HOLY_POWER_FULL+1, max do - pointsFrame.points[id]:SetVertexColor(color.r, color.g, color.b) + if( config.isBar ) then + pointsFrame.blocks[id]:SetVertexColor(color.r, color.g, color.b) + else + pointsFrame.icons[id]:SetVertexColor(color.r, color.g, color.b) + end end end end From eb74cd015dba3320153b32c423ba724df1bd878a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 6 Jul 2012 16:55:39 -0700 Subject: [PATCH 167/794] Add a giant warning on login if someone logs in with this version of SUF on <5.0.1 as people don't read changelogs --- ShadowedUnitFrames.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 051dd47f..312da92d 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -2,6 +2,41 @@ Shadowed Unit Frames, Shadow of Mal'Ganis (US) PvP ]] +if( select(4, GetBuildInfo()) < 50001 ) then + local frame = CreateFrame("Frame", nil, UIParent) + frame:SetClampedToScreen(true) + frame:SetFrameStrata("TOOLTIP") + frame:SetWidth(400) + frame:SetHeight(100) + frame:SetBackdrop({ + bgFile = "Interface\\ChatFrame\\ChatFrameBackground", + edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", + edgeSize = 26, + insets = {left = 9, right = 9, top = 9, bottom = 9}, + }) + frame:SetBackdropColor(0, 0, 0, 0.85) + frame:SetPoint("CENTER", UIParent, "CENTER", 0, 0) + + frame.titleBar = frame:CreateTexture(nil, "ARTWORK") + frame.titleBar:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header") + frame.titleBar:SetPoint("TOP", 0, 8) + frame.titleBar:SetWidth(350) + frame.titleBar:SetHeight(45) + + frame.title = frame:CreateFontString(nil, "ARTWORK", "GameFontNormal") + frame.title:SetPoint("TOP", 0, 0) + frame.title:SetText("Shadowed Unit Frames") + + frame.text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") + frame.text:SetText(select(2, ...).L["This version of Shadowed Unit Frames is ONLY for 5.0.1 and higher.|n|nIf you are auto downloading alpha releases, stop that.|n|nYou are not missing out, the next stable release of SUF will be with 5.0.1/MoP."]) + frame.text:SetPoint("TOPLEFT", 12, -22) + frame.text:SetWidth(frame:GetWidth() - 20) + frame.text:SetJustifyH("LEFT") + + frame:SetScale(2) + return +end + ShadowUF = select(2, ...) local L = ShadowUF.L ShadowUF.dbRevision = 16 From 321fd5daf50a26f6e41b0b35e709302b1c2c5402 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 6 Jul 2012 17:17:49 -0700 Subject: [PATCH 168/794] Changed full burning ember to a red to be more distinct --- ShadowedUnitFrames.lua | 2 +- modules/defaultlayout.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 312da92d..8fe4ff67 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -122,7 +122,7 @@ function ShadowUF:CheckUpgrade() if( revision <= 15 ) then self.db.profile.powerColors["DEMONICFURY"] = {r = 0.58, g = 0.51, b = 0.79} self.db.profile.powerColors["BURNINGEMBERS"] = {r = 0.58, g = 0.51, b = 0.79} - self.db.profile.powerColors["FULLBURNINGEMBER"] = {r = 0.23, g = 0.039, b = 0.49} + self.db.profile.powerColors["FULLBURNINGEMBER"] = {r = 0.88, g = 0.09, b = 0.062} self.db.profile.powerColors["SHADOWORBS"] = {r = 0.58, g = 0.51, b = 0.79} self.db.profile.units.player.shadowOrbs = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true} diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index d2eb7f08..b3295d8b 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -156,7 +156,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, DEMONICFURY = {r = 0.58, g = 0.51, b = 0.79}, BURNINGEMBERS = {r = 0.58, g = 0.51, b = 0.79}, - FULLBURNINGEMBER = {r = 0.23, g = 0.039, b = 0.49}, + FULLBURNINGEMBER = {r = 0.88, g = 0.09, b = 0.062}, SHADOWORBS = {r = 0.58, g = 0.51, b = 0.79}, ALTERNATE = {r = 0.71, g = 0.0, b = 1.0}, CHI = {r = 0.0, g = 1.0, b = 0.59}, From 0422a5c9622b761d0699663b0da49ca5f33a9e4c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 6 Jul 2012 17:33:56 -0700 Subject: [PATCH 169/794] Typo --- modules/burningembers.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/burningembers.lua b/modules/burningembers.lua index 979f2a3e..18cb5abe 100644 --- a/modules/burningembers.lua +++ b/modules/burningembers.lua @@ -14,6 +14,7 @@ function Embers:OnEnable(frame) for id=1, 4 do local ember = ShadowUF.Units:CreateBar(frame) ember:SetFrameLevel(1) + if( id > 1 ) then ember:SetPoint("TOPLEFT", frame.burningEmbersBar.embers[id - 1], "TOPRIGHT", 1, 0) @@ -109,7 +110,7 @@ function Embers:Update(frame, event, unit, powerType) ember:SetStatusBarColor(ShadowUF.db.profile.powerColors[color].r, ShadowUF.db.profile.powerColors[color].g, ShadowUF.db.profile.powerColors[color].b) - color = ShadowUF.db.profile.bars.backgroundColor or ShadowUF.db.profile.units[frame.unitType].runeBar.backgroundColor or ShadowUF.db.profile.powerColors[color] + color = ShadowUF.db.profile.bars.backgroundColor or ShadowUF.db.profile.units[frame.unitType].burningEmbersBar.backgroundColor or ShadowUF.db.profile.powerColors[color] ember.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) end From d99cff9f6b25223a8e8a5eb00c941384c28a8d1d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 6 Jul 2012 17:54:29 -0700 Subject: [PATCH 170/794] Added a special case for Warlock Burning Embers that allows them to override the background color to let them have a distinct color that makes it clear how much is left until full --- modules/burningembers.lua | 8 +++++-- modules/units.lua | 2 +- options/config.lua | 46 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/modules/burningembers.lua b/modules/burningembers.lua index 18cb5abe..bb29de39 100644 --- a/modules/burningembers.lua +++ b/modules/burningembers.lua @@ -75,7 +75,11 @@ function Embers:UpdateBarBlocks(frame, event, unit, powerType) for id=1, max do local ember = frame.burningEmbersBar.embers[id] ember:SetWidth(blockWidth) - ember.background:Show() + + if( ShadowUF.db.profile.units[frame.unitType].burningEmbersBar.background ) then + ember.background:Show() + end + ember:Show() end @@ -111,7 +115,7 @@ function Embers:Update(frame, event, unit, powerType) ember:SetStatusBarColor(ShadowUF.db.profile.powerColors[color].r, ShadowUF.db.profile.powerColors[color].g, ShadowUF.db.profile.powerColors[color].b) color = ShadowUF.db.profile.bars.backgroundColor or ShadowUF.db.profile.units[frame.unitType].burningEmbersBar.backgroundColor or ShadowUF.db.profile.powerColors[color] - ember.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) + ember.background:SetVertexColor(color.r, color.g, color.b, color.a or ShadowUF.db.profile.bars.backgroundAlpha) end power = power - MAX_POWER_PER_EMBER diff --git a/modules/units.lua b/modules/units.lua index 211d92bb..800e1f72 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -280,7 +280,7 @@ end -- Check if a unit entered a vehicle function Units:CheckVehicleStatus(frame, event, unit) if( event and frame.unitOwner ~= unit ) then return end - + -- Not in a vehicle yet, and they entered one that has a UI or they were in a vehicle but the GUID changed (vehicle -> vehicle) if( ( not frame.inVehicle or frame.unitGUID ~= UnitGUID(frame.vehicleUnit) ) and UnitHasVehicleUI(frame.unitOwner) and not ShadowUF.db.profile.units[frame.unitType].disableVehicle ) then diff --git a/options/config.lua b/options/config.lua index cabee6b1..d7912693 100644 --- a/options/config.lua +++ b/options/config.lua @@ -2157,9 +2157,53 @@ local function loadUnitOptions() hidden = hideBarOption, arg = "$parent.background", }, + overrideBackground = { + order = 1.6, + type = "toggle", + name = L["Override background"], + desc = L["Show a background behind the bars with the same texture/color but faded out."], + disabled = function(info) return not getVariable(info[2], info[#(info) - 1], nil, "background") end, + hidden = function(info) return info[#(info) - 1] ~= "burningEmbersBar" end, + set = function(info, toggle) + if( toggle ) then + setVariable(info[2], info[#(info) - 1], nil, "backgroundColor", {r = 0, g = 0, b = 0, a = 0.70}) + else + setVariable(info[2], info[#(info) - 1], nil, "backgroundColor", nil) + end + end, + get = function(info) + return not not getVariable(info[2], info[#(info) - 1], nil, "backgroundColor") + end + }, + overrideColor = { + order = 1.65, + type = "color", + hasAlpha = true, + name = L["Background color"], + hidden = function(info) return info[#(info) - 1] ~= "burningEmbersBar" or not getVariable(info[2], info[#(info) - 1], nil, "backgroundColor") or not getVariable(info[2], info[#(info) - 1], nil, "background") end, + set = function(info, r, g, b, a) + local color = getUnit(info) or {} + color.r = r + color.g = g + color.b = b + color.a = a + + setUnit(info, color) + end, + get = function(info) + local color = getUnit(info) + if( not color ) then + return 0, 0, 0, 1 + end + + return color.r, color.g, color.b, color.a + + end, + arg = "$parent.backgroundColor", + }, sep2 = {order = 1.75, type = "description", name = "", hidden = function(info) local moduleKey = info[#(info) - 1] - return ( moduleKey ~= "healthBar" and moduleKey ~= "powerBar" and moduleKey ~= "druidBar" ) or not ShadowUF.db.profile.advanced + return ( moduleKey ~= "healthBar" and moduleKey ~= "powerBar" and moduleKey ~= "druidBar" and moduleKey ~= "burningEmbersBar" ) or not ShadowUF.db.profile.advanced end}, invert = { order = 2, From 1e52f61b43f1212fa1592cf68b1b0058137e3bc1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 6 Jul 2012 18:16:34 -0700 Subject: [PATCH 171/794] Added tags for Shadow Orbs, Chi and Demonic Fury --- modules/tags.lua | 624 +++++++++++++++++++++++++-------------------- options/config.lua | 2 +- 2 files changed, 342 insertions(+), 284 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 62bd6eaa..1520f558 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -682,6 +682,44 @@ Tags.defaultTags = { local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_HOLY_POWER) return points and points > 0 and points end]], + ["priest:shadoworbs"] = [[function(unit, unitOwner) + local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_SHADOW_ORBS) + return points and points > 0 and points + end]], + ["monk:chipoints"] = [[function(unit, unitOwner) + local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_LIGHT_FORCE) + return points and points > 0 and points + end]], + ["warlock:demonic:perpp"] = [[function(unit, unitOwner) + local maxPower = UnitPowerMax(unit, SPELL_POWER_DEMONIC_FURY) + if( maxPower <= 0 ) then + return nil + elseif( UnitIsDeadOrGhost(unit) or not UnitIsConnected(unit) ) then + return "0%" + end + + return string.format("%d%%", math.floor(UnitPower(unit, SPELL_POWER_DEMONIC_FURY) / maxPower * 100 + 0.5)) + end]], + ["warlock:demonic:maxpp"] = [[function(unit, unitOwner) + local power = UnitPowerMax(unit, SPELL_POWER_DEMONIC_FURY) + if( power <= 0 ) then + return nil + elseif( UnitIsDeadOrGhost(unit) ) then + return 0 + end + + return ShadowUF:FormatLargeNumber(power) + end]], + ["warlock:demonic:curpp"] = [[function(unit, unitOwner) + local power = UnitPower(unit, SPELL_POWER_DEMONIC_FURY) + if( power <= 0 ) then + return nil + elseif( UnitIsDeadOrGhost(unit) ) then + return 0 + end + + return ShadowUF:FormatLargeNumber(power) + end]], ["cpoints"] = [[function(unit, unitOwner) local points = GetComboPoints(ShadowUF.playerUnit) if( points == 0 ) then @@ -840,70 +878,75 @@ Tags.defaultTags = { -- Default tag events Tags.defaultEvents = { - ["hp:color"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH", - ["short:druidform"] = "UNIT_AURA", - ["druidform"] = "UNIT_AURA", - ["guild"] = "UNIT_NAME_UPDATE", - ["per:incheal"] = "UNIT_HEAL_PREDICTION", - ["abs:incheal"] = "UNIT_HEAL_PREDICTION", - ["incheal:name"] = "UNIT_HEAL_PREDICTION", - ["incheal"] = "UNIT_HEAL_PREDICTION", + ["hp:color"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH", + ["short:druidform"] = "UNIT_AURA", + ["druidform"] = "UNIT_AURA", + ["guild"] = "UNIT_NAME_UPDATE", + ["per:incheal"] = "UNIT_HEAL_PREDICTION", + ["abs:incheal"] = "UNIT_HEAL_PREDICTION", + ["incheal:name"] = "UNIT_HEAL_PREDICTION", + ["incheal"] = "UNIT_HEAL_PREDICTION", -- ["crtabs"] = "CRTABS", -- ["abs:crtabs"] = "CRTABS", -- ["crtabs:name"] = "CRTABS", - ["afk"] = "PLAYER_FLAGS_CHANGED", -- Yes, I know it's called PLAYER_FLAGS_CHANGED, but arg1 is the unit including non-players. - ["afk:time"] = "PLAYER_FLAGS_CHANGED UNIT_CONNECTION", - ["status:time"] = "UNIT_POWER UNIT_CONNECTION", - ["pvp:time"] = "PLAYER_FLAGS_CHANGED", - ["curhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_CONNECTION", - ["abscurhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_CONNECTION", - ["curmaxhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", - ["absolutehp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", - ["smart:curmaxhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", - ["curpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", - ["abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["absolutepp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["smart:curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["druid:curpp"] = "UNIT_POWER:MANA UNIT_DISPLAYPOWER", - ["druid:abscurpp"] = "UNIT_POWER:MANA UNIT_DISPLAYPOWER", - ["druid:curmaxpp"] = "UNIT_POWER:MANA UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["druid:absolutepp"] = "UNIT_POWER:MANA UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["sshards"] = "UNIT_POWER", - ["hpower"] = "UNIT_POWER", - ["level"] = "UNIT_LEVEL PLAYER_LEVEL_UP", - ["levelcolor"] = "UNIT_LEVEL PLAYER_LEVEL_UP", - ["maxhp"] = "UNIT_MAXHEALTH", - ["def:name"] = "UNIT_NAME_UPDATE UNIT_MAXHEALTH UNIT_HEALTH UNIT_HEALTH_FREQUENT", - ["absmaxhp"] = "UNIT_MAXHEALTH", - ["maxpp"] = "UNIT_MAXPOWER", - ["absmaxpp"] = "UNIT_MAXPOWER", - ["missinghp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", - ["missingpp"] = "UNIT_POWER UNIT_MAXPOWER", - ["name"] = "UNIT_NAME_UPDATE", - ["abbrev:name"] = "UNIT_NAME_UPDATE", - ["server"] = "UNIT_NAME_UPDATE", - ["colorname"] = "UNIT_NAME_UPDATE", - ["perhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", - ["perpp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_CONNECTION", - ["status"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT PLAYER_UPDATE_RESTING UNIT_CONNECTION", - ["smartlevel"] = "UNIT_LEVEL PLAYER_LEVEL_UP UNIT_CLASSIFICATION_CHANGED", - ["cpoints"] = "UNIT_COMBO_POINTS PLAYER_TARGET_CHANGED", - ["rare"] = "UNIT_CLASSIFICATION_CHANGED", - ["classification"] = "UNIT_CLASSIFICATION_CHANGED", - ["shortclassification"] = "UNIT_CLASSIFICATION_CHANGED", - ["dechp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH", - ["group"] = "GROUP_ROSTER_UPDATE", - ["unit:color:aggro"] = "UNIT_THREAT_SITUATION_UPDATE", - ["color:aggro"] = "UNIT_THREAT_SITUATION_UPDATE", - ["situation"] = "UNIT_THREAT_SITUATION_UPDATE", - ["color:sit"] = "UNIT_THREAT_SITUATION_UPDATE", - ["scaled:threat"] = "UNIT_THREAT_SITUATION_UPDATE", - ["general:sit"] = "UNIT_THREAT_SITUATION_UPDATE", - ["color:gensit"] = "UNIT_THREAT_SITUATION_UPDATE", - ["unit:scaled:threat"] = "UNIT_THREAT_SITUATION_UPDATE", - ["unit:color:sit"] = "UNIT_THREAT_SITUATION_UPDATE", - ["unit:situation"] = "UNIT_THREAT_SITUATION_UPDATE", + ["afk"] = "PLAYER_FLAGS_CHANGED", -- Yes, I know it's called PLAYER_FLAGS_CHANGED, but arg1 is the unit including non-players. + ["afk:time"] = "PLAYER_FLAGS_CHANGED UNIT_CONNECTION", + ["status:time"] = "UNIT_POWER UNIT_CONNECTION", + ["pvp:time"] = "PLAYER_FLAGS_CHANGED", + ["curhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_CONNECTION", + ["abscurhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_CONNECTION", + ["curmaxhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", + ["absolutehp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", + ["smart:curmaxhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", + ["curpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", + ["abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["absolutepp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["smart:curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["druid:curpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", + ["druid:abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", + ["druid:curmaxpp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["druid:absolutepp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["sshards"] = "UNIT_POWER", + ["hpower"] = "UNIT_POWER", + ["level"] = "UNIT_LEVEL PLAYER_LEVEL_UP", + ["levelcolor"] = "UNIT_LEVEL PLAYER_LEVEL_UP", + ["maxhp"] = "UNIT_MAXHEALTH", + ["def:name"] = "UNIT_NAME_UPDATE UNIT_MAXHEALTH UNIT_HEALTH UNIT_HEALTH_FREQUENT", + ["absmaxhp"] = "UNIT_MAXHEALTH", + ["maxpp"] = "UNIT_MAXPOWER", + ["absmaxpp"] = "UNIT_MAXPOWER", + ["missinghp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", + ["missingpp"] = "UNIT_POWER UNIT_MAXPOWER", + ["name"] = "UNIT_NAME_UPDATE", + ["abbrev:name"] = "UNIT_NAME_UPDATE", + ["server"] = "UNIT_NAME_UPDATE", + ["colorname"] = "UNIT_NAME_UPDATE", + ["perhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", + ["perpp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_CONNECTION", + ["status"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT PLAYER_UPDATE_RESTING UNIT_CONNECTION", + ["smartlevel"] = "UNIT_LEVEL PLAYER_LEVEL_UP UNIT_CLASSIFICATION_CHANGED", + ["cpoints"] = "UNIT_COMBO_POINTS PLAYER_TARGET_CHANGED", + ["rare"] = "UNIT_CLASSIFICATION_CHANGED", + ["classification"] = "UNIT_CLASSIFICATION_CHANGED", + ["shortclassification"] = "UNIT_CLASSIFICATION_CHANGED", + ["dechp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH", + ["group"] = "GROUP_ROSTER_UPDATE", + ["unit:color:aggro"] = "UNIT_THREAT_SITUATION_UPDATE", + ["color:aggro"] = "UNIT_THREAT_SITUATION_UPDATE", + ["situation"] = "UNIT_THREAT_SITUATION_UPDATE", + ["color:sit"] = "UNIT_THREAT_SITUATION_UPDATE", + ["scaled:threat"] = "UNIT_THREAT_SITUATION_UPDATE", + ["general:sit"] = "UNIT_THREAT_SITUATION_UPDATE", + ["color:gensit"] = "UNIT_THREAT_SITUATION_UPDATE", + ["unit:scaled:threat"] = "UNIT_THREAT_SITUATION_UPDATE", + ["unit:color:sit"] = "UNIT_THREAT_SITUATION_UPDATE", + ["unit:situation"] = "UNIT_THREAT_SITUATION_UPDATE", + ["warlock:demonic:curpp"] = "UNIT_POWER", + ["warlock:demonic:maxpp"] = "UNIT_MAXPOWER", + ["warlock:demonic:perpp"] = "UNIT_POWER UNIT_POWER_MAX", + ["monk:chipoints"] = "UNIT_POWER", + ["priest:shadoworbs"] = "UNIT_POWER", } -- Default update frequencies for tag updating, used if it's needed to override the update speed @@ -924,241 +967,256 @@ Tags.defaultCategories = { -- ["crtabs"] = "absorb", -- ["crtabs:name"] = "absorb", -- ["abs:crtabs"] = "absorb", - ["hp:color"] = "health", - ["per:incheal"] = "health", - ["abs:incheal"] = "health", - ["incheal"] = "health", - ["incheal:name"] = "health", - ["smart:curmaxhp"] = "health", - ["smart:curmaxpp"] = "health", - ["afk"] = "status", - ["afk:time"] = "status", - ["status:time"] = "status", - ["pvp:time"] = "status", - ["cpoints"] = "misc", - ["smartlevel"] = "classification", - ["classification"] = "classification", - ["shortclassification"] = "classification", - ["rare"] = "classification", - ["plus"] = "classification", - ["sex"] = "misc", - ["smartclass"] = "classification", - ["smartrace"] = "classification", - ["status"] = "status", - ["race"] = "classification", - ["level"] = "classification", - ["maxhp"] = "health", - ["maxpp"] = "power", - ["missinghp"] = "health", - ["missingpp"] = "power", - ["name"] = "misc", - ["abbrev:name"] = "misc", - ["server"] = "misc", - ["perhp"] = "health", - ["perpp"] = "power", - ["class"] = "classification", - ["classcolor"] = "classification", - ["creature"] = "classification", - ["short:druidform"] = "classification", - ["druidform"] = "classification", - ["curhp"] = "health", - ["curpp"] = "power", - ["curmaxhp"] = "health", - ["curmaxpp"] = "power", - ["levelcolor"] = "classification", - ["def:name"] = "health", - ["faction"] = "classification", - ["colorname"] = "misc", - ["guild"] = "misc", - ["absolutepp"] = "power", - ["absolutehp"] = "health", - ["absmaxhp"] = "health", - ["abscurhp"] = "health", - ["absmaxpp"] = "power", - ["abscurpp"] = "power", - ["reactcolor"] = "classification", - ["dechp"] = "health", - ["group"] = "misc", - ["close"] = "misc", - ["druid:curpp"] = "power", - ["druid:abscurpp"] = "power", - ["druid:curmaxpp"] = "power", - ["druid:absolutepp"] = "power", - ["sshards"] = "misc", - ["hpower"] = "misc", - ["situation"] = "playerthreat", - ["color:sit"] = "playerthreat", - ["scaled:threat"] = "playerthreat", - ["general:sit"] = "playerthreat", - ["color:gensit"] = "playerthreat", - ["color:aggro"] = "playerthreat", - ["unit:scaled:threat"] = "threat", - ["unit:color:sit"] = "threat", - ["unit:situation"] = "threat", - ["unit:color:aggro"] = "threat", - ["unit:raid:assist"] = "raid", - ["unit:raid:targeting"] = "raid", + ["hp:color"] = "health", + ["per:incheal"] = "health", + ["abs:incheal"] = "health", + ["incheal"] = "health", + ["incheal:name"] = "health", + ["smart:curmaxhp"] = "health", + ["smart:curmaxpp"] = "health", + ["afk"] = "status", + ["afk:time"] = "status", + ["status:time"] = "status", + ["pvp:time"] = "status", + ["cpoints"] = "classspec", + ["smartlevel"] = "classification", + ["classification"] = "classification", + ["shortclassification"] = "classification", + ["rare"] = "classification", + ["plus"] = "classification", + ["sex"] = "misc", + ["smartclass"] = "classification", + ["smartrace"] = "classification", + ["status"] = "status", + ["race"] = "classification", + ["level"] = "classification", + ["maxhp"] = "health", + ["maxpp"] = "power", + ["missinghp"] = "health", + ["missingpp"] = "power", + ["name"] = "misc", + ["abbrev:name"] = "misc", + ["server"] = "misc", + ["perhp"] = "health", + ["perpp"] = "power", + ["class"] = "classification", + ["classcolor"] = "classification", + ["creature"] = "classification", + ["short:druidform"] = "classification", + ["druidform"] = "classification", + ["curhp"] = "health", + ["curpp"] = "power", + ["curmaxhp"] = "health", + ["curmaxpp"] = "power", + ["levelcolor"] = "classification", + ["def:name"] = "health", + ["faction"] = "classification", + ["colorname"] = "misc", + ["guild"] = "misc", + ["absolutepp"] = "power", + ["absolutehp"] = "health", + ["absmaxhp"] = "health", + ["abscurhp"] = "health", + ["absmaxpp"] = "power", + ["abscurpp"] = "power", + ["reactcolor"] = "classification", + ["dechp"] = "health", + ["group"] = "misc", + ["close"] = "misc", + ["druid:curpp"] = "classspec", + ["druid:abscurpp"] = "classspec", + ["druid:curmaxpp"] = "classspec", + ["druid:absolutepp"] = "classspec", + ["sshards"] = "classspec", + ["hpower"] = "classspec", + ["situation"] = "playerthreat", + ["color:sit"] = "playerthreat", + ["scaled:threat"] = "playerthreat", + ["general:sit"] = "playerthreat", + ["color:gensit"] = "playerthreat", + ["color:aggro"] = "playerthreat", + ["unit:scaled:threat"] = "threat", + ["unit:color:sit"] = "threat", + ["unit:situation"] = "threat", + ["unit:color:aggro"] = "threat", + ["unit:raid:assist"] = "raid", + ["unit:raid:targeting"] = "raid", + ["warlock:demonic:curpp"] = "classspec", + ["warlock:demonic:maxpp"] = "classspec", + ["warlock:demonic:perpp"] = "classspec", + ["monk:chipoints"] = "classspec", + ["priest:shadoworbs"] = "classspec", } -- Default tag help Tags.defaultHelp = { - ["hp:color"] = L["Color code based on percentage of HP left on the unit, this works the same way as the color by health option. But for text instead of the entire bar."], - ["guild"] = L["Show's the units guild name if they are in a guild."], - ["short:druidform"] = L["Short version of [druidform], C = Cat, B = Bear, F = Flight and so on."], - ["druidform"] = L["Returns the units current form if they are a druid, Cat for Cat Form, Moonkin for Moonkin and so on."], + ["hp:color"] = L["Color code based on percentage of HP left on the unit, this works the same way as the color by health option. But for text instead of the entire bar."], + ["guild"] = L["Show's the units guild name if they are in a guild."], + ["short:druidform"] = L["Short version of [druidform], C = Cat, B = Bear, F = Flight and so on."], + ["druidform"] = L["Returns the units current form if they are a druid, Cat for Cat Form, Moonkin for Moonkin and so on."], -- ["crtabs"] = L["Shorten current absorb value, if 13,000 absorb is on a target it will show 13k."], -- ["abs:crtabs"] = L["Absolute current absorb value, if 15,000 absorb is on a target it will show 15,000."], -- ["crtabs:name"] = L["If the unit has absorbs on them, it will show the absolute absorb value, otherwise it will show the units name."], - ["per:incheal"] = L["Percent of the players current health that's being healed, if they have 100,000 total health and 15,000 is incoming then 15% is shown."], - ["abs:incheal"] = L["Absolute incoming heal value, if 10,000 healing is incoming it will show 10,000."], - ["incheal"] = L["Shorten incoming heal value, if 13,000 healing is incoming it will show 13k."], - ["incheal:name"] = L["If the unit has heals incoming, it will show the absolute incoming heal value, otherwise it will show the units name."], - ["smart:curmaxhp"] = L["Smart number formating for [curmaxhp], numbers below 1,000,000 are left as is, numbers above 1,000,000 will use the short version such as 1m."], - ["smart:curmaxpp"] = L["Smart number formating for [curmaxpp], numbers below 1,000,000 are left as is, numbers above 1,000,000 will use the short version such as 1m."], - ["pvp:time"] = L["Shows how long until your PVP flag drops, will not show if the flag is manually on or you are in a hostile zone.|n|nThis will only work for yourself, you cannot use it to see the time left on your party or raid."], - ["afk:time"] = L["Shows how long an unit has been AFK or DND."], - ["status:time"] = L["Shows how long an unit has been offline."], - ["afk"] = L["Shows AFK, DND or nothing depending on the units away status."], - ["cpoints"] = L["Total number of combo points you have on your target."], - ["hpower"] = L["Total number of active holy power."], - ["sshards"] = L["Total number of active soul shards."], - ["smartlevel"] = L["Smart level, returns Boss for bosses, +50 for a level 50 elite mob, or just 80 for a level 80."], - ["classification"] = L["Units classification, Rare, Rare Elite, Elite, Boss, nothing is shown if they aren't any of those."], - ["shortclassification"] = L["Short classifications, R for Rare, R+ for Rare Elite, + for Elite, B for boss, nothing is shown if they aren't any of those."], - ["rare"] = L["Returns Rare if the unit is a rare or rare elite mob."], - ["plus"] = L["Returns + if the unit is an elite or rare elite mob."], - ["sex"] = L["Returns the units sex."], - ["smartclass"] = L["If the unit is a player then class is returned, if it's a NPC then the creature type."], - ["smartrace"] = L["If the unit is a player then race is returned, if it's a NPC then the creature type."], - ["status"] = L["Shows Offline, Dead, Ghost or nothing depending on the units current status."], - ["race"] = L["Units race, Blood Elf, Tauren, Troll (unfortunately) and so on."], - ["level"] = L["Level without any coloring."], - ["maxhp"] = L["Max health, uses a short format, 17750 is formatted as 17.7k, values below 10000 are formatted as is."], - ["maxpp"] = L["Max power, uses a short format, 16000 is formatted as 16k, values below 10000 are formatted as is."], - ["missinghp"] = L["Amount of health missing, if none is missing nothing is shown. Uses a short format, -18500 is shown as -18.5k, values below 10000 are formatted as is."], - ["missingpp"] = L["Amount of power missing, if none is missing nothing is shown. Uses a short format, -13850 is shown as 13.8k, values below 10000 are formatted as is."], - ["name"] = L["Unit name"], - ["server"] = L["Unit server, if they are from your server then nothing is shown."], - ["perhp"] = L["Returns current health as a percentage, if the unit is dead or offline than that is shown instead."], - ["perpp"] = L["Returns current power as a percentage."], - ["class"] = L["Class name without coloring, use [classcolor][class][close] if you want the class name to be colored by class."], - ["classcolor"] = L["Color code for the class, use [classcolor][class][close] if you want the class text to be colored by class"], - ["creature"] = L["Creature type, returns Felguard if the unit is a Felguard, Wolf if it's a Wolf and so on."], - ["curhp"] = L["Current health, uses a short format, 11500 is formatted as 11.5k, values below 10000 are formatted as is."], - ["curpp"] = L["Current power, uses a short format, 12750 is formatted as 12.7k, values below 10000 are formatted as is."], - ["curmaxhp"] = L["Current and maximum health, formatted as [curhp]/[maxhp], if the unit is dead or offline then that is shown instead."], - ["curmaxpp"] = L["Current and maximum power, formatted as [curpp]/[maxpp]."], - ["levelcolor"] = L["Returns the color code based off of the units level compared to yours. If you cannot attack them then no color is returned."], - ["def:name"] = L["When the unit is mising health, the [missinghp] tag is shown, when they are at full health then the [name] tag is shown. This lets you see -1000 when they are missing 1000 HP, but their name when they are not missing any."], - ["faction"] = L["Units alignment, Thrall will return Horde, Magni Bronzebeard will return Alliance."], - ["colorname"] = L["Unit name colored by class."], - ["absolutepp"] = L["Shows current and maximum power in absolute form, 18000 power will be showed as 18000 power."], - ["absolutehp"] = L["Shows current and maximum health in absolute form, 17500 health will be showed as 17500 health."], - ["absmaxhp"] = L["Shows maximum health in absolute form, 14000 health is showed as 14000 health."], - ["abscurhp"] = L["Shows current health value in absolute form meaning 15000 health is shown as 15000."], - ["absmaxpp"] = L["Shows maximum power in absolute form, 13000 power is showed as 13000 power."], - ["abscurpp"] = L["Shows current power value in absolute form, 15000 power will be displayed as 1500 still."], - ["reactcolor"] = L["Reaction color code, use [reactcolor][name][close] to color the units name by their reaction."], - ["dechp"] = L["Shows the units health as a percentage rounded to the first decimal, meaning 61 out of 110 health is shown as 55.4%."], - ["abbrev:name"] = L["Abbreviates unit names above 10 characters, \"Dark Rune Champion\" becomes \"D.R.Champion\" and \"Dark Rune Commoner\" becomes \"D.R.Commoner\"."], - ["group"] = L["Shows current group number of the unit."], - ["close"] = L["Closes a color code, prevents colors from showing up on text that you do not want it to."], - ["druid:curpp"] = string.format(L["Works the same as %s, but this is only shown if the unit is in Cat or Bear form."], "currpp"), - ["druid:abscurpp"] = string.format(L["Works the same as %s, but this is only shown if the unit is in Cat or Bear form."], "abscurpp"), - ["druid:curmaxpp"] = string.format(L["Works the same as %s, but this is only shown if the unit is in Cat or Bear form."], "curmaxpp"), - ["druid:absolutepp"] = string.format(L["Works the same as %s, but this is only shown if the unit is in Cat or Bear form."], "absolutepp"), - ["situation"] = L["Returns text based on your threat situation with your target: Aggro for Aggro, High for being close to taking aggro, and Medium as a general warning to be wary."], - ["color:sit"] = L["Returns a color code of the threat situation with your target: Red for Aggro, Orange for High threat and Yellow to be careful."], - ["scaled:threat"] = L["Returns a scaled threat percent of your aggro on your current target, always 0 - 100%."], - ["general:sit"] = L["Returns text based on your general threat situation on all units: Aggro for Aggro, High for being near to pulling aggro and Medium as a general warning."], - ["color:gensit"] = L["Returns a color code of your general threat situation on all units: Red for Aggro, Orange for High threat and Yellow to watch out."], - ["unit:scaled:threat"] = L["Returns the scaled threat percentage for the unit, if you put this on a party member you would see the percentage of how close they are to getting any from any hostile mobs. Always 0 - 100%.|nThis cannot be used on target of target or focus target types of units."], - ["unit:color:sit"] = L["Returns the color code for the units threat situation in general: Red for Aggro, Orange for High threat and Yellow to watch out.|nThis cannot be used on target of target or focus target types of units."], - ["unit:situation"] = L["Returns text based on the units general threat situation: Aggro for Aggro, High for being close to taking aggro, and Medium as a warning to be wary.|nThis cannot be used on target of target or focus target types of units."], - ["unit:color:aggro"] = L["Same as [unit:color:sit] except it only returns red if the unit has aggro, rather than transiting from yellow -> orange -> red."], - ["color:aggro"] = L["Same as [color:sit] except it only returns red if you have aggro, rather than transiting from yellow -> orange -> red."], - ["unit:raid:targeting"] = L["How many people in your raid are targeting the unit, for example if you put this on yourself it will show how many people are targeting you. This includes you in the count!"], - ["unit:raid:assist"] = L["How many people are assisting the unit, for example if you put this on yourself it will show how many people are targeting your target. This includes you in the count!"], + ["per:incheal"] = L["Percent of the players current health that's being healed, if they have 100,000 total health and 15,000 is incoming then 15% is shown."], + ["abs:incheal"] = L["Absolute incoming heal value, if 10,000 healing is incoming it will show 10,000."], + ["incheal"] = L["Shorten incoming heal value, if 13,000 healing is incoming it will show 13k."], + ["incheal:name"] = L["If the unit has heals incoming, it will show the absolute incoming heal value, otherwise it will show the units name."], + ["smart:curmaxhp"] = L["Smart number formating for [curmaxhp], numbers below 1,000,000 are left as is, numbers above 1,000,000 will use the short version such as 1m."], + ["smart:curmaxpp"] = L["Smart number formating for [curmaxpp], numbers below 1,000,000 are left as is, numbers above 1,000,000 will use the short version such as 1m."], + ["pvp:time"] = L["Shows how long until your PVP flag drops, will not show if the flag is manually on or you are in a hostile zone.|n|nThis will only work for yourself, you cannot use it to see the time left on your party or raid."], + ["afk:time"] = L["Shows how long an unit has been AFK or DND."], + ["status:time"] = L["Shows how long an unit has been offline."], + ["afk"] = L["Shows AFK, DND or nothing depending on the units away status."], + ["cpoints"] = L["Total number of combo points you have on your target."], + ["hpower"] = L["Total number of active holy power."], + ["sshards"] = L["Total number of active soul shards."], + ["smartlevel"] = L["Smart level, returns Boss for bosses, +50 for a level 50 elite mob, or just 80 for a level 80."], + ["classification"] = L["Units classification, Rare, Rare Elite, Elite, Boss, nothing is shown if they aren't any of those."], + ["shortclassification"] = L["Short classifications, R for Rare, R+ for Rare Elite, + for Elite, B for boss, nothing is shown if they aren't any of those."], + ["rare"] = L["Returns Rare if the unit is a rare or rare elite mob."], + ["plus"] = L["Returns + if the unit is an elite or rare elite mob."], + ["sex"] = L["Returns the units sex."], + ["smartclass"] = L["If the unit is a player then class is returned, if it's a NPC then the creature type."], + ["smartrace"] = L["If the unit is a player then race is returned, if it's a NPC then the creature type."], + ["status"] = L["Shows Offline, Dead, Ghost or nothing depending on the units current status."], + ["race"] = L["Units race, Blood Elf, Tauren, Troll (unfortunately) and so on."], + ["level"] = L["Level without any coloring."], + ["maxhp"] = L["Max health, uses a short format, 17750 is formatted as 17.7k, values below 10000 are formatted as is."], + ["maxpp"] = L["Max power, uses a short format, 16000 is formatted as 16k, values below 10000 are formatted as is."], + ["missinghp"] = L["Amount of health missing, if none is missing nothing is shown. Uses a short format, -18500 is shown as -18.5k, values below 10000 are formatted as is."], + ["missingpp"] = L["Amount of power missing, if none is missing nothing is shown. Uses a short format, -13850 is shown as 13.8k, values below 10000 are formatted as is."], + ["name"] = L["Unit name"], + ["server"] = L["Unit server, if they are from your server then nothing is shown."], + ["perhp"] = L["Returns current health as a percentage, if the unit is dead or offline than that is shown instead."], + ["perpp"] = L["Returns current power as a percentage."], + ["class"] = L["Class name without coloring, use [classcolor][class][close] if you want the class name to be colored by class."], + ["classcolor"] = L["Color code for the class, use [classcolor][class][close] if you want the class text to be colored by class"], + ["creature"] = L["Creature type, returns Felguard if the unit is a Felguard, Wolf if it's a Wolf and so on."], + ["curhp"] = L["Current health, uses a short format, 11500 is formatted as 11.5k, values below 10000 are formatted as is."], + ["curpp"] = L["Current power, uses a short format, 12750 is formatted as 12.7k, values below 10000 are formatted as is."], + ["curmaxhp"] = L["Current and maximum health, formatted as [curhp]/[maxhp], if the unit is dead or offline then that is shown instead."], + ["curmaxpp"] = L["Current and maximum power, formatted as [curpp]/[maxpp]."], + ["levelcolor"] = L["Returns the color code based off of the units level compared to yours. If you cannot attack them then no color is returned."], + ["def:name"] = L["When the unit is mising health, the [missinghp] tag is shown, when they are at full health then the [name] tag is shown. This lets you see -1000 when they are missing 1000 HP, but their name when they are not missing any."], + ["faction"] = L["Units alignment, Thrall will return Horde, Magni Bronzebeard will return Alliance."], + ["colorname"] = L["Unit name colored by class."], + ["absolutepp"] = L["Shows current and maximum power in absolute form, 18000 power will be showed as 18000 power."], + ["absolutehp"] = L["Shows current and maximum health in absolute form, 17500 health will be showed as 17500 health."], + ["absmaxhp"] = L["Shows maximum health in absolute form, 14000 health is showed as 14000 health."], + ["abscurhp"] = L["Shows current health value in absolute form meaning 15000 health is shown as 15000."], + ["absmaxpp"] = L["Shows maximum power in absolute form, 13000 power is showed as 13000 power."], + ["abscurpp"] = L["Shows current power value in absolute form, 15000 power will be displayed as 1500 still."], + ["reactcolor"] = L["Reaction color code, use [reactcolor][name][close] to color the units name by their reaction."], + ["dechp"] = L["Shows the units health as a percentage rounded to the first decimal, meaning 61 out of 110 health is shown as 55.4%."], + ["abbrev:name"] = L["Abbreviates unit names above 10 characters, \"Dark Rune Champion\" becomes \"D.R.Champion\" and \"Dark Rune Commoner\" becomes \"D.R.Commoner\"."], + ["group"] = L["Shows current group number of the unit."], + ["close"] = L["Closes a color code, prevents colors from showing up on text that you do not want it to."], + ["druid:curpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "currpp"), + ["druid:abscurpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "abscurpp"), + ["druid:curmaxpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "curmaxpp"), + ["druid:absolutepp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "absolutepp"), + ["situation"] = L["Returns text based on your threat situation with your target: Aggro for Aggro, High for being close to taking aggro, and Medium as a general warning to be wary."], + ["color:sit"] = L["Returns a color code of the threat situation with your target: Red for Aggro, Orange for High threat and Yellow to be careful."], + ["scaled:threat"] = L["Returns a scaled threat percent of your aggro on your current target, always 0 - 100%."], + ["general:sit"] = L["Returns text based on your general threat situation on all units: Aggro for Aggro, High for being near to pulling aggro and Medium as a general warning."], + ["color:gensit"] = L["Returns a color code of your general threat situation on all units: Red for Aggro, Orange for High threat and Yellow to watch out."], + ["unit:scaled:threat"] = L["Returns the scaled threat percentage for the unit, if you put this on a party member you would see the percentage of how close they are to getting any from any hostile mobs. Always 0 - 100%.|nThis cannot be used on target of target or focus target types of units."], + ["unit:color:sit"] = L["Returns the color code for the units threat situation in general: Red for Aggro, Orange for High threat and Yellow to watch out.|nThis cannot be used on target of target or focus target types of units."], + ["unit:situation"] = L["Returns text based on the units general threat situation: Aggro for Aggro, High for being close to taking aggro, and Medium as a warning to be wary.|nThis cannot be used on target of target or focus target types of units."], + ["unit:color:aggro"] = L["Same as [unit:color:sit] except it only returns red if the unit has aggro, rather than transiting from yellow -> orange -> red."], + ["color:aggro"] = L["Same as [color:sit] except it only returns red if you have aggro, rather than transiting from yellow -> orange -> red."], + ["unit:raid:targeting"] = L["How many people in your raid are targeting the unit, for example if you put this on yourself it will show how many people are targeting you. This includes you in the count!"], + ["unit:raid:assist"] = L["How many people are assisting the unit, for example if you put this on yourself it will show how many people are targeting your target. This includes you in the count!"], + ["warlock:demonic:curpp"] = string.format(L["Works the same as [%s], but this is usedd to show Demonic Fury power for Demonology Warlocks."], "curpp"), + ["warlock:demonic:maxpp"] = string.format(L["Works the same as [%s], but this is usedd to show Demonic Fury power for Demonology Warlocks."], "maxpp"), + ["warlock:demonic:perpp"] = string.format(L["Works the same as [%s], but this is usedd to show Demonic Fury power for Demonology Warlocks."], "perpp"), + ["monk:chipoints"] = L["How many Chi points you currently have."], + ["priest:shadoworbs"] = L["How many Shadow Orbs you have if you're Shadow"], } Tags.defaultNames = { - ["per:incheal"] = L["Incoming heal (Percent)"], - ["incheal:name"] = L["Incoming heal/Name"], - ["unit:scaled:threat"] = L["Unit scaled threat"], - ["unit:color:sit"] = L["Unit colored situation"], - ["unit:situation"] = L["Unit situation name"], - ["hp:color"] = L["Health color"], - ["guild"] = L["Guild name"], - ["druidform"] = L["Druid form"], - ["short:druidform"] = L["Druid form (Short)"], + ["per:incheal"] = L["Incoming heal (Percent)"], + ["incheal:name"] = L["Incoming heal/Name"], + ["unit:scaled:threat"] = L["Unit scaled threat"], + ["unit:color:sit"] = L["Unit colored situation"], + ["unit:situation"] = L["Unit situation name"], + ["hp:color"] = L["Health color"], + ["guild"] = L["Guild name"], + ["druidform"] = L["Druid form"], + ["short:druidform"] = L["Druid form (Short)"], -- ["abs:crtabs"] = L["Current absorb (Absolute)"], -- ["crtabs"] = L["Current absorb (Short)"], -- ["crtabs:name"] = L["Current absorb/Name"], - ["abs:incheal"] = L["Incoming heal (Absolute)"], - ["incheal"] = L["Incoming heal (Short)"], - ["abbrev:name"] = L["Name (Abbreviated)"], - ["smart:curmaxhp"] = L["Cur/Max HP (Smart)"], - ["smart:curmaxpp"] = L["Cur/Max PP (Smart)"], - ["pvp:time"] = L["PVP timer"], - ["afk:time"] = L["AFK timer"], - ["status:time"] = L["Offline timer"], - ["afk"] = L["AFK status"], - ["cpoints"] = L["Combo points"], - ["hpower"] = L["Holy power"], - ["sshards"] = L["Soul shards"], - ["smartlevel"] = L["Smart level"], - ["classification"] = L["Classificaiton"], - ["shortclassification"] = L["Short classification"], - ["rare"] = L["Rare indicator"], - ["plus"] = L["Short elite indicator"], - ["sex"] = L["Sex"], - ["smartclass"] = L["Class (Smart)"], - ["smartrace"] = L["Race (Smart)"], - ["status"] = L["Status"], - ["race"] = L["Race"], - ["level"] = L["Level"], - ["maxhp"] = L["Max HP (Short)"], - ["maxpp"] = L["Max power (Short)"], - ["missinghp"] = L["Missing HP (Short)"], - ["missingpp"] = L["Missing power (Short)"], - ["name"] = L["Unit name"], - ["server"] = L["Unit server"], - ["perhp"] = L["Percent HP"], - ["perpp"] = L["Percent power"], - ["class"] = L["Class"], - ["classcolor"] = L["Class color tag"], - ["creature"] = L["Creature type"], - ["curhp"] = L["Current HP (Short)"], - ["curpp"] = L["Current Power (Short)"], - ["curmaxhp"] = L["Cur/Max HP (Short)"], - ["curmaxpp"] = L["Cur/Max Power (Short)"], - ["levelcolor"] = L["Level (Colored)"], - ["def:name"] = L["Deficit/Unit Name"], - ["faction"] = L["Unit faction"], - ["colorname"] = L["Unit name (Class colored)"], - ["absolutepp"] = L["Cur/Max power (Absolute)"], - ["absolutehp"] = L["Cur/Max HP (Absolute)"], - ["absmaxhp"] = L["Max HP (Absolute)"], - ["abscurhp"] = L["Current HP (Absolute)"], - ["absmaxpp"] = L["Max power (Absolute)"], - ["abscurpp"] = L["Current power (Absolute)"], - ["reactcolor"] = L["Reaction color tag"], - ["dechp"] = L["Decimal percent HP"], - ["group"] = L["Group number"], - ["close"] = L["Close color"], - ["druid:curpp"] = L["Current power (Druid)"], - ["druid:abscurpp"] = L["Current power (Druid/Absolute)"], - ["druid:curmaxpp"] = L["Cur/Max power (Druid)"], - ["druid:absolutepp"] = L["Current health (Druid/Absolute)"], - ["situation"] = L["Threat situation"], - ["color:sit"] = L["Color code for situation"], - ["scaled:threat"] = L["Scaled threat percent"], - ["general:sit"] = L["General threat situation"], - ["color:gensit"] = L["Color code for general situation"], - ["color:aggro"] = L["Color code on aggro"], - ["unit:color:aggro"] = L["Unit color code on aggro"], - ["unit:raid:targeting"] = L["Raid targeting unit"], - ["unit:raid:assist"] = L["Raid assisting unit"], + ["abs:incheal"] = L["Incoming heal (Absolute)"], + ["incheal"] = L["Incoming heal (Short)"], + ["abbrev:name"] = L["Name (Abbreviated)"], + ["smart:curmaxhp"] = L["Cur/Max HP (Smart)"], + ["smart:curmaxpp"] = L["Cur/Max PP (Smart)"], + ["pvp:time"] = L["PVP timer"], + ["afk:time"] = L["AFK timer"], + ["status:time"] = L["Offline timer"], + ["afk"] = L["AFK status"], + ["cpoints"] = L["Combo points"], + ["hpower"] = L["Holy power"], + ["sshards"] = L["Soul shards"], + ["smartlevel"] = L["Smart level"], + ["classification"] = L["Classificaiton"], + ["shortclassification"] = L["Short classification"], + ["rare"] = L["Rare indicator"], + ["plus"] = L["Short elite indicator"], + ["sex"] = L["Sex"], + ["smartclass"] = L["Class (Smart)"], + ["smartrace"] = L["Race (Smart)"], + ["status"] = L["Status"], + ["race"] = L["Race"], + ["level"] = L["Level"], + ["maxhp"] = L["Max HP (Short)"], + ["maxpp"] = L["Max power (Short)"], + ["missinghp"] = L["Missing HP (Short)"], + ["missingpp"] = L["Missing power (Short)"], + ["name"] = L["Unit name"], + ["server"] = L["Unit server"], + ["perhp"] = L["Percent HP"], + ["perpp"] = L["Percent power"], + ["class"] = L["Class"], + ["classcolor"] = L["Class color tag"], + ["creature"] = L["Creature type"], + ["curhp"] = L["Current HP (Short)"], + ["curpp"] = L["Current Power (Short)"], + ["curmaxhp"] = L["Cur/Max HP (Short)"], + ["curmaxpp"] = L["Cur/Max Power (Short)"], + ["levelcolor"] = L["Level (Colored)"], + ["def:name"] = L["Deficit/Unit Name"], + ["faction"] = L["Unit faction"], + ["colorname"] = L["Unit name (Class colored)"], + ["absolutepp"] = L["Cur/Max power (Absolute)"], + ["absolutehp"] = L["Cur/Max HP (Absolute)"], + ["absmaxhp"] = L["Max HP (Absolute)"], + ["abscurhp"] = L["Current HP (Absolute)"], + ["absmaxpp"] = L["Max power (Absolute)"], + ["abscurpp"] = L["Current power (Absolute)"], + ["reactcolor"] = L["Reaction color tag"], + ["dechp"] = L["Decimal percent HP"], + ["group"] = L["Group number"], + ["close"] = L["Close color"], + ["druid:curpp"] = L["Current power (Druid)"], + ["druid:abscurpp"] = L["Current power (Druid/Absolute)"], + ["druid:curmaxpp"] = L["Cur/Max power (Druid)"], + ["druid:absolutepp"] = L["Current health (Druid/Absolute)"], + ["situation"] = L["Threat situation"], + ["color:sit"] = L["Color code for situation"], + ["scaled:threat"] = L["Scaled threat percent"], + ["general:sit"] = L["General threat situation"], + ["color:gensit"] = L["Color code for general situation"], + ["color:aggro"] = L["Color code on aggro"], + ["unit:color:aggro"] = L["Unit color code on aggro"], + ["unit:raid:targeting"] = L["Raid targeting unit"], + ["unit:raid:assist"] = L["Raid assisting unit"], + ["warlock:demonic:curpp"] = L["Current Demonic Fury (Short)"], + ["warlock:demonic:maxpp"] = L["Max Demonic Fury (Short)"], + ["warlock:demonic:perpp"] = L["Percent Demonic Fury"], + ["monk:chipoints"] = L["Chi Points"], + ["priest:shadoworbs"] = L["Shadow Orbs"] } -- List of event types diff --git a/options/config.lua b/options/config.lua index d7912693..4831cf8c 100644 --- a/options/config.lua +++ b/options/config.lua @@ -43,7 +43,7 @@ local INDICATOR_DESC = { ["masterLoot"] = L["Bag indicator for master looters."], ["pvp"] = L["PVP flag indicator, Horde for Horde flagged pvpers and Alliance for Alliance flagged pvpers."], ["raidTarget"] = L["Raid target indicator."], ["ready"] = L["Ready status of group members."], ["role"] = L["Raid role indicator, adds a shield indicator for main tanks and a sword icon for main assists."], ["status"] = L["Status indicator, shows if the unit is currently in combat. For the player it will also show if you are rested."], ["class"] = L["Class icon for players."]} -local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"], ["absorb"] = L["Absorb"]} +local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"], ["absorb"] = L["Absorb"], ["classspec"] = L["Class Specific"]} local pointPositions = {["BOTTOM"] = L["Bottom"], ["TOP"] = L["Top"], ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["TOPLEFT"] = L["Top Left"], ["TOPRIGHT"] = L["Top Right"], ["BOTTOMLEFT"] = L["Bottom Left"], ["BOTTOMRIGHT"] = L["Bottom Right"], ["CENTER"] = L["Center"]} local positionList = {["C"] = L["Center"], ["RT"] = L["Right Top"], ["RC"] = L["Right Center"], ["RB"] = L["Right Bottom"], ["LT"] = L["Left Top"], ["LC"] = L["Left Center"], ["LB"] = L["Left Bottom"], ["BL"] = L["Bottom Left"], ["BC"] = L["Bottom Center"], ["BR"] = L["Bottom Right"], ["TR"] = L["Top Right"], ["TC"] = L["Top Center"], ["TL"] = L["Top Left"]} From 06601774a38bd35d7332af6ad7c029fafce9716d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 7 Jul 2012 10:31:45 -0700 Subject: [PATCH 172/794] Fixed divide by zero error in burning embers --- modules/burningembers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/burningembers.lua b/modules/burningembers.lua index bb29de39..08f6b232 100644 --- a/modules/burningembers.lua +++ b/modules/burningembers.lua @@ -69,7 +69,7 @@ function Embers:UpdateBarBlocks(frame, event, unit, powerType) local max = UnitPowerMax("player", SPELL_POWER_BURNING_EMBERS, true) max = floor(max / MAX_POWER_PER_EMBER) - if( frame.burningEmbersBar.visibleBlocks == max ) then return end + if( max == 0 or frame.burningEmbersBar.visibleBlocks == max ) then return end local blockWidth = (frame.burningEmbersBar:GetWidth() - (max - 1)) / max for id=1, max do From 5e17c8198e6f872c6c974ff627f4b7201dd88c02 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 7 Jul 2012 14:21:42 -0700 Subject: [PATCH 173/794] IsInInstance can now return true but nil, looks like these are mini instances that can be ignored for now for zone handling --- ShadowedUnitFrames.lua | 1 + modules/auras.lua | 2 +- modules/units.lua | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 8fe4ff67..dd3087a8 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -199,6 +199,7 @@ end function ShadowUF:LoadUnits() -- CanHearthAndResurrectFromArea() returns true for world pvp areas, according to BattlefieldFrame.lua local instanceType = CanHearthAndResurrectFromArea() and "pvp" or select(2, IsInInstance()) + if( not instanceType ) then instanceType = "none" end for _, type in pairs(self.unitList) do local enabled = self.db.profile.units[type].enabled diff --git a/modules/auras.lua b/modules/auras.lua index 887ca82b..9ec4f5c5 100644 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -471,7 +471,7 @@ end -- This isn't actually filled with data, it's just to stop any errors from triggering if no filter is added local filterDefault = {} function Auras:UpdateFilter(frame) - local zone = select(2, IsInInstance()) + local zone = select(2, IsInInstance()) or "none" local id = zone .. frame.unitType local white = ShadowUF.db.profile.filters.zonewhite[zone .. frame.unitType] diff --git a/modules/units.lua b/modules/units.lua index 800e1f72..569939f8 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -191,7 +191,7 @@ end -- Deal with enabling modules inside a zone local function SetVisibility(self) local layoutUpdate - local instanceType = select(2, IsInInstance()) + local instanceType = select(2, IsInInstance()) or "none" local playerSpec = GetSpecialization() -- Selectively disable modules @@ -1239,7 +1239,7 @@ function Units:CheckPlayerZone(force) end -- CanHearthAndResurrectFromArea() returns true for world pvp areas, according to BattlefieldFrame.lua - local instance = CanHearthAndResurrectFromArea() and "pvp" or select(2, IsInInstance()) + local instance = CanHearthAndResurrectFromArea() and "pvp" or select(2, IsInInstance()) or "none" if( instance == instanceType and not force ) then return end instanceType = instance @@ -1309,4 +1309,4 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) queueZoneCheck = nil end end -end) \ No newline at end of file +end) From 9a83d8fe0e6caac3971a7fc0c2b8220c1f16961c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 7 Jul 2012 14:47:57 -0700 Subject: [PATCH 174/794] Added 0 power checks as zoning seems to 0 out all stats --- modules/combopoints.lua | 2 +- modules/holypower.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index d22aba54..bf3c1085 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -129,7 +129,7 @@ function Combo:UpdateBarBlocks(frame, event, unit, powerType) end local max = UnitPowerMax("player", pointsFrame.config.powerType) - if( pointsFrame.visibleBlocks == max ) then return end + if( max == 0 or pointsFrame.visibleBlocks == max ) then return end local blockWidth = (pointsFrame:GetWidth() - (max - 1)) / max for id=1, max do diff --git a/modules/holypower.lua b/modules/holypower.lua index 30222fe1..ff5fa24e 100644 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -36,7 +36,7 @@ function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) local color = ShadowUF.db.profile.powerColors["BANKEDHOLYPOWER"] local max = UnitPowerMax("player", holyConfig.powerType) - if( max > HOLY_POWER_FULL ) then + if( max > 0 and max > HOLY_POWER_FULL ) then for id=HOLY_POWER_FULL+1, max do if( config.isBar ) then pointsFrame.blocks[id]:SetVertexColor(color.r, color.g, color.b) From 5b71865cdf5df85e96c82f8c2360149499c1fd52 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 17 Jul 2012 12:38:09 -0700 Subject: [PATCH 175/794] Fixed highlight curable debuff option --- modules/highlight.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/highlight.lua b/modules/highlight.lua index 4e17c151..7e732814 100644 --- a/modules/highlight.lua +++ b/modules/highlight.lua @@ -159,7 +159,7 @@ end function Highlight:UpdateAura(frame) frame.highlight.hasDebuff = nil if( UnitIsFriend(frame.unit, "player") ) then - frame.highlight.hasDebuff = not not UnitDebuff(frame.unit, 1) + frame.highlight.hasDebuff = select(5, UnitDebuff(frame.unit, 1, "RAID")) end self:Update(frame) From c68110f4706da6206a892dc6b16c21d0265a2b5d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 17 Jul 2012 22:42:53 -0700 Subject: [PATCH 176/794] Fixed combat text scale error --- modules/combattext.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/combattext.lua b/modules/combattext.lua index 828c6685..48a29948 100755 --- a/modules/combattext.lua +++ b/modules/combattext.lua @@ -41,6 +41,9 @@ function Combat:Update(frame, event, unit, type, ...) end -- Increasing the font size will make the text look pixelated, however scaling it up will make it look smooth and awesome - frame.combatText:SetScale(frame.combatText.feedbackText:GetStringHeight() / ShadowUF.db.profile.font.size) - frame.combatText.feedbackText:SetFont(frame.combatText.fontPath, ShadowUF.db.profile.font.size, "OUTLINE") + local scale = frame.combatText.feedbackText:GetStringHeight() / ShadowUF.db.profile.font.size; + if( scale > 0 ) then + frame.combatText:SetScale(scale) + frame.combatText.feedbackText:SetFont(frame.combatText.fontPath, ShadowUF.db.profile.font.size, "OUTLINE") + end end From c6876c53486009e478fc1bb93d2369ef5277439b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 17 Jul 2012 22:54:19 -0700 Subject: [PATCH 177/794] Removed a semicolon --- modules/combattext.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/combattext.lua b/modules/combattext.lua index 48a29948..da37a0d3 100755 --- a/modules/combattext.lua +++ b/modules/combattext.lua @@ -41,7 +41,7 @@ function Combat:Update(frame, event, unit, type, ...) end -- Increasing the font size will make the text look pixelated, however scaling it up will make it look smooth and awesome - local scale = frame.combatText.feedbackText:GetStringHeight() / ShadowUF.db.profile.font.size; + local scale = frame.combatText.feedbackText:GetStringHeight() / ShadowUF.db.profile.font.size if( scale > 0 ) then frame.combatText:SetScale(scale) frame.combatText.feedbackText:SetFont(frame.combatText.fontPath, ShadowUF.db.profile.font.size, "OUTLINE") From ff59504a218e9f0ecb4da0f9ae2b757677ee3b15 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 17 Jul 2012 22:55:13 -0700 Subject: [PATCH 178/794] Fixed combo points not showing up --- modules/combopoints.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index bf3c1085..d62073b5 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -7,7 +7,7 @@ function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) frame.comboPoints.config = cpConfig frame.comboPointType = cpConfig.key - frame:RegisterUnitEvent("UNIT_COMBO_POINTS", self, "Update") + frame:RegisterNormalEvent("UNIT_COMBO_POINTS", self, "Update") frame:RegisterUpdateFunc(self, "Update") end @@ -145,7 +145,10 @@ function Combo:UpdateBarBlocks(frame, event, unit, powerType) end -function Combo:Update(frame) +function Combo:Update(frame, event, unit) + -- MoP changed UNIT_COMBO_POINTS so that unit is now player even if it's done on the target + if( event and unit ~= "player" ) then return end + -- For Malygos dragons, they also self cast their CP on themselves, which is why we check CP on ourself! local playerUnit = UnitHasVehicleUI("player") and "vehicle" or "player" local points = GetComboPoints(playerUnit) From e2d3d6dc441242ca7067877c127f7014985d95dd Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 19 Jul 2012 08:57:58 -0700 Subject: [PATCH 179/794] Try and hookin to the existing pet battle frame hiding system, this might horribly break things so someone should test this --- modules/units.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 569939f8..380f1fb0 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -440,6 +440,7 @@ OnAttributeChanged = function(self, name, unit) -- Add to Clique if( not self:GetAttribute("isHeaderDriven") ) then + FRAMELOCK_STATES["PETBATTLES"][self:GetName()] = true ClickCastFrames = ClickCastFrames or {} ClickCastFrames[self] = true end @@ -895,7 +896,7 @@ function Units:LoadSplitGroupHeader(type) frame:SetAttribute("style-width", config.width) frame:SetAttribute("style-scale", config.scale) - if ClickCastHeader then + if( ClickCastHeader ) then -- the OnLoad adds the functions like SetFrameRef to the header SecureHandler_OnLoad(frame) frame:SetFrameRef("clickcast_header", ClickCastHeader) @@ -950,6 +951,7 @@ function Units:LoadGroupHeader(type) local headerFrame = CreateFrame("Frame", "SUFHeader" .. type, UIParent, type == "raidpet" and "SecureGroupPetHeaderTemplate" or "SecureGroupHeaderTemplate") headerFrames[type] = headerFrame + FRAMELOCK_STATES["PETBATTLES"][headerFrame:GetName()] = true self:SetHeaderAttributes(headerFrame, type) @@ -1037,6 +1039,7 @@ function Units:LoadZoneHeader(type) headerFrame:SetHeight(0.1) headerFrame.children = {} headerFrames[type] = headerFrame + FRAMELOCK_STATES["PETBATTLES"][self:GetName()] = true if( type == "arena" ) then headerFrame:SetScript("OnAttributeChanged", function(self, key, value) From 39b8735931bccfe70b6dea88c3160662cbf628cb Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 19 Jul 2012 11:01:54 -0700 Subject: [PATCH 180/794] Typo --- modules/units.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 380f1fb0..9ea09c11 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -440,7 +440,7 @@ OnAttributeChanged = function(self, name, unit) -- Add to Clique if( not self:GetAttribute("isHeaderDriven") ) then - FRAMELOCK_STATES["PETBATTLES"][self:GetName()] = true + FRAMELOCK_STATES["PETBATTLES"][self:GetName()] = "hidden" ClickCastFrames = ClickCastFrames or {} ClickCastFrames[self] = true end @@ -951,7 +951,7 @@ function Units:LoadGroupHeader(type) local headerFrame = CreateFrame("Frame", "SUFHeader" .. type, UIParent, type == "raidpet" and "SecureGroupPetHeaderTemplate" or "SecureGroupHeaderTemplate") headerFrames[type] = headerFrame - FRAMELOCK_STATES["PETBATTLES"][headerFrame:GetName()] = true + FRAMELOCK_STATES["PETBATTLES"][headerFrame:GetName()] = "hidden" self:SetHeaderAttributes(headerFrame, type) @@ -1039,7 +1039,7 @@ function Units:LoadZoneHeader(type) headerFrame:SetHeight(0.1) headerFrame.children = {} headerFrames[type] = headerFrame - FRAMELOCK_STATES["PETBATTLES"][self:GetName()] = true + FRAMELOCK_STATES["PETBATTLES"][self:GetName()] = "hidden" if( type == "arena" ) then headerFrame:SetScript("OnAttributeChanged", function(self, key, value) From 0373df2900fb7ab190e6d453f0426a2789b85a94 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 21 Jul 2012 09:23:42 -0700 Subject: [PATCH 181/794] Added support for community mobs (UnitIsTappedByAllThreatList) to health tapped list --- modules/health.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/health.lua b/modules/health.lua index bcd02fca..18289b07 100644 --- a/modules/health.lua +++ b/modules/health.lua @@ -66,7 +66,7 @@ function Health:UpdateColor(frame) return elseif( frame.inVehicle ) then color = ShadowUF.db.profile.classColors.VEHICLE - elseif( not UnitIsTappedByPlayer(unit) and UnitIsTapped(unit) and UnitCanAttack("player", unit) ) then + elseif( not UnitIsTappedByAllThreatList(unit) and not UnitIsTappedByPlayer(unit) and UnitIsTapped(unit) and UnitCanAttack("player", unit) ) then color = ShadowUF.db.profile.healthColors.tapped elseif( not UnitPlayerOrPetInRaid(unit) and not UnitPlayerOrPetInParty(unit) and ( ( ( reactionType == "player" or reactionType == "both" ) and UnitIsPlayer(unit) and not UnitIsFriend(unit, "player") ) or ( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(unit) ) ) ) then if( not UnitIsFriend(unit, "player") and UnitPlayerControlled(unit) ) then @@ -120,4 +120,4 @@ function Health:Update(frame) elseif( frame.healthBar.hasPercent ) then frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, getGradientColor(frame.unit)) end -end \ No newline at end of file +end From f1fed19a584d3a2ea730c5ad1907632f5d357128 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 26 Jul 2012 13:36:55 -0700 Subject: [PATCH 182/794] Added support for securely hiding frames while in a petbattle (This will give macro errors until the next beta build) --- modules/units.lua | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 9ea09c11..9dac9000 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -10,6 +10,20 @@ local _G = getfenv(0) ShadowUF.Units = Units ShadowUF:RegisterModule(Units, "units") +-- This is the wrapper frame that everything parents to so we can just hide it when we need to deal with pet battles +local petBattleFrame = CreateFrame("Frame", "SUFWrapperFrame", UIParent, "SecureHandlerBaseTemplate") +petBattleFrame:SetAllPoints(UIParent) +petBattleFrame:WrapScript(petBattleFrame, "OnAttributeChanged", [[ + if( name ~= "state-petbattle" ) then return end + if( value == "active" ) then + self:Hide() + else + self:Show() + end +]]) + +RegisterStateDriver(petBattleFrame, "petbattle", "[petbattle] active; none") + -- Frame shown, do a full update local function FullUpdate(self) for i=1, #(self.fullUpdates), 2 do @@ -440,7 +454,6 @@ OnAttributeChanged = function(self, name, unit) -- Add to Clique if( not self:GetAttribute("isHeaderDriven") ) then - FRAMELOCK_STATES["PETBATTLES"][self:GetName()] = "hidden" ClickCastFrames = ClickCastFrames or {} ClickCastFrames[self] = true end @@ -859,7 +872,7 @@ function Units:LoadUnit(unit) return end - local frame = self:CreateUnit("Button", "SUFUnit" .. unit, UIParent, "SecureUnitButtonTemplate") + local frame = self:CreateUnit("Button", "SUFUnit" .. unit, petBattleFrame, "SecureUnitButtonTemplate") frame:SetAttribute("unit", unit) frame.hasStateWatch = unit == "pet" @@ -876,7 +889,7 @@ function Units:LoadSplitGroupHeader(type) local frame = headerFrames["raid" .. id] if( enabled ) then if( not frame ) then - frame = CreateFrame("Frame", "SUFHeader" .. type .. id, UIParent, "SecureGroupHeaderTemplate") + frame = CreateFrame("Frame", "SUFHeader" .. type .. id, petBattleFrame, "SecureGroupHeaderTemplate") frame:SetAttribute("template", unitButtonTemplate) frame:SetAttribute("initial-unitWatch", true) frame:SetAttribute("showRaid", true) @@ -949,9 +962,8 @@ function Units:LoadGroupHeader(type) return end - local headerFrame = CreateFrame("Frame", "SUFHeader" .. type, UIParent, type == "raidpet" and "SecureGroupPetHeaderTemplate" or "SecureGroupHeaderTemplate") + local headerFrame = CreateFrame("Frame", "SUFHeader" .. type, petBattleFrame, type == "raidpet" and "SecureGroupPetHeaderTemplate" or "SecureGroupHeaderTemplate") headerFrames[type] = headerFrame - FRAMELOCK_STATES["PETBATTLES"][headerFrame:GetName()] = "hidden" self:SetHeaderAttributes(headerFrame, type) @@ -1002,6 +1014,7 @@ function Units:LoadGroupHeader(type) end ]]) RegisterStateDriver(stateMonitor.party, "raidmonitor", "[target=raid6, exists] raid6; [target=raid1, exists] raid1; none") + elseif( type == "raid" ) then stateMonitor.raid = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") stateMonitor.raid:SetAttribute("raidDisabled", nil) @@ -1031,7 +1044,7 @@ function Units:LoadZoneHeader(type) return end - local headerFrame = CreateFrame("Frame", "SUFHeader" .. type, UIParent) + local headerFrame = CreateFrame("Frame", "SUFHeader" .. type, petBattleFrame) headerFrame.isHeaderFrame = true headerFrame.unitType = type headerFrame:SetClampedToScreen(true) @@ -1039,7 +1052,6 @@ function Units:LoadZoneHeader(type) headerFrame:SetHeight(0.1) headerFrame.children = {} headerFrames[type] = headerFrame - FRAMELOCK_STATES["PETBATTLES"][self:GetName()] = "hidden" if( type == "arena" ) then headerFrame:SetScript("OnAttributeChanged", function(self, key, value) From ed4f66498ce92af48737c02437a854f9ae16e324 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 26 Jul 2012 13:38:27 -0700 Subject: [PATCH 183/794] Switch Chi, Eclipse, Holy Power and Shadow Orbs to UNIT_POWER_FREQUENT to experiment if they are worthwhile for these --- modules/chi.lua | 2 +- modules/eclipse.lua | 2 +- modules/holypower.lua | 2 +- modules/shadoworbs.lua | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/chi.lua b/modules/chi.lua index 22ea3fc0..1c54836e 100644 --- a/modules/chi.lua +++ b/modules/chi.lua @@ -7,7 +7,7 @@ function Chi:OnEnable(frame) frame.chi.config = chiConfig frame.comboPointType = chiConfig.key - frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") frame:RegisterUpdateFunc(self, "Update") diff --git a/modules/eclipse.lua b/modules/eclipse.lua index 03a6c86b..a4de9802 100644 --- a/modules/eclipse.lua +++ b/modules/eclipse.lua @@ -27,7 +27,7 @@ function Eclipse:OnEnable(frame) frame.eclipseBar.sun:SetPoint("BOTTOMLEFT", frame.eclipseBar, "BOTTOM") end - frame:RegisterNormalEvent("UNIT_POWER", self, "Update") + frame:RegisterNormalEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterNormalEvent("UNIT_MAXPOWER", self, "Update") frame:RegisterNormalEvent("ECLIPSE_DIRECTION_CHANGE", self, "UpdateDirection") frame:RegisterNormalEvent("UPDATE_SHAPESHIFT_FORM", self, "UpdateVisibility") diff --git a/modules/holypower.lua b/modules/holypower.lua index ff5fa24e..9fea6c94 100644 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -7,7 +7,7 @@ function HolyPower:OnEnable(frame) frame.holyPower.config = holyConfig frame.comboPointType = holyConfig.key - frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") frame:RegisterUpdateFunc(self, "Update") diff --git a/modules/shadoworbs.lua b/modules/shadoworbs.lua index aefe9019..f41c02ca 100644 --- a/modules/shadoworbs.lua +++ b/modules/shadoworbs.lua @@ -7,7 +7,7 @@ function ShadowOrbs:OnEnable(frame) frame.shadowOrbs.config = shadowConfig frame.comboPointType = shadowConfig.key - frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") frame:RegisterUpdateFunc(self, "Update") From 9a2910d6516f8ff0b728470d0359773f95f11ed3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 26 Jul 2012 13:42:11 -0700 Subject: [PATCH 184/794] Comment out the conditional --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 9dac9000..539062da 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -22,7 +22,7 @@ petBattleFrame:WrapScript(petBattleFrame, "OnAttributeChanged", [[ end ]]) -RegisterStateDriver(petBattleFrame, "petbattle", "[petbattle] active; none") +-- RegisterStateDriver(petBattleFrame, "petbattle", "[petbattle] active; none") -- Frame shown, do a full update local function FullUpdate(self) From 43675c7624d555e29ceb6b93302309c44b548440 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 29 Jul 2012 12:43:03 -0700 Subject: [PATCH 185/794] Enabled UF hiding while in pet battles. Secure solution so if you're attacked while in a pet battle, your frames will work fine. --- ShadowedUnitFrames.toc | 2 +- modules/units.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index dd722ed4..63fc79eb 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ ## Interface: 50001 ## Title: Shadowed Unit Frames -## Notes: This is a note, I don't know why you're reading this because it's not telling you anything useful. +## Notes: As with every other SUF note, this isn't telling you something useful. You should probably not be reading it still. ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB diff --git a/modules/units.lua b/modules/units.lua index 539062da..9dac9000 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -22,7 +22,7 @@ petBattleFrame:WrapScript(petBattleFrame, "OnAttributeChanged", [[ end ]]) --- RegisterStateDriver(petBattleFrame, "petbattle", "[petbattle] active; none") +RegisterStateDriver(petBattleFrame, "petbattle", "[petbattle] active; none") -- Frame shown, do a full update local function FullUpdate(self) From b1e5733933625932c3c0b0a17ee5f3189193ad18 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 5 Aug 2012 09:07:37 -0700 Subject: [PATCH 186/794] Fixed mover frame errors --- modules/movers.lua | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/modules/movers.lua b/modules/movers.lua index 7a6148d5..9c09792e 100644 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -32,15 +32,38 @@ local function createConfigEnv() UnitHealth = function(unit) return getValue("UnitHealth", unit, math.random(20000, 50000)) end, UnitHealthMax = function(unit) return 50000 end, UnitPower = function(unit, powerType) - if powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS then + if( powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS ) then return 3 + elseif( powerType == SPELL_POWER_LIGHT_FORCE ) then + return 4 + elseif( powerType == SPELL_POWER_SHADOW_ORBS ) then + return PRIEST_BAR_NUM_ORBS + elseif( powerType == SPELL_POWER_BURNING_EMBERS ) then + return math.floor(MAX_POWER_PER_EMBER + (MAX_POWER_PER_EMBER / 2)) + elseif( powerType == SPELL_POWER_DEMONIC_FURY ) then + return 100 end + return getValue("UnitPower", unit, math.random(20000, 50000)) end, + UnitPowerMax = function(unit, powerType) + if( powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS ) then + return 3 + elseif( powerType == SPELL_POWER_LIGHT_FORCE ) then + return 4 + elseif( powerType == SPELL_POWER_SHADOW_ORBS ) then + return PRIEST_BAR_NUM_ORBS + elseif( powerType == SPELL_POWER_BURNING_EMBERS ) then + return MAX_POWER_PER_EMBER * 3 + elseif( powerType == SPELL_POWER_DEMONIC_FURY ) then + return 100 + end + + return 50000 + end, UnitHasIncomingResurrection = function(unit) return true end, UnitInPhase = function(unit) return true end, UnitExists = function(unit) return true end, - UnitPowerMax = function(unit) return 50000 end, UnitIsGroupLeader = function() return true end, UnitIsPVP = function(unit) return true end, UnitIsDND = function(unit) return false end, From c08b5b154f6b7467d5a8ec8b35f709fa4ce7d059 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 5 Aug 2012 09:55:04 -0700 Subject: [PATCH 187/794] Added support for the quest boss indicator on target (enabled by default) and focus (disabled by default) --- ShadowedUnitFrames.lua | 7 ++++++- modules/defaultlayout.lua | 2 ++ modules/indicators.lua | 20 +++++++++++++++++++- modules/movers.lua | 1 + options/config.lua | 3 ++- 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index dd3087a8..f9cdaca3 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -39,7 +39,7 @@ end ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 16 +ShadowUF.dbRevision = 17 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -119,6 +119,11 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + if( revision <= 16 ) then + self.db.profile.units.target.indicators.questBoss = {enabled = true, anchorPoint = "BR", size = 22, x = 9, y = 24, anchorTo = "$parent"} + self.db.profile.units.focus.indicators.questBoss = {enabled = false, anchorPoint = "BR", size = 22, x = 7, y = 14, anchorTo = "$parent"} + end + if( revision <= 15 ) then self.db.profile.powerColors["DEMONICFURY"] = {r = 0.58, g = 0.51, b = 0.79} self.db.profile.powerColors["BURNINGEMBERS"] = {r = 0.58, g = 0.51, b = 0.79} diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index b3295d8b..faf77eee 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -578,6 +578,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) indicators = { lfdRole = {enabled = false}, resurrect = {enabled = true, anchorPoint = "RC", size = 28, x = -39, y = -1, anchorTo = "$parent"}, + questBoss = {enabled = true, anchorPoint = "BR", size = 22, x = 9, y = 24, anchorTo = "$parent"}, }, auras = { buffs = {enabled = true}, @@ -632,6 +633,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) indicators = { lfdRole = {enabled = false}, resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, + questBoss = {enabled = false, anchorPoint = "BR", size = 22, x = 7, y = 14, anchorTo = "$parent"}, }, text = { {text = "[(()afk() )][name]"}, diff --git a/modules/indicators.lua b/modules/indicators.lua index 1d21acd5..01a2183a 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -1,4 +1,4 @@ -local Indicators = {list = {"status", "pvp", "leader", "resurrect", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class", "phase"}} +local Indicators = {list = {"status", "pvp", "leader", "resurrect", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class", "phase", "questBoss"}} local leavingWorld ShadowUF:RegisterModule(Indicators, "indicators", ShadowUF.L["Indicators"]) @@ -61,6 +61,16 @@ function Indicators:UpdateRaidTarget(frame) end end +function Indicators:UpdateQuestBoss(frame) + if( not frame.indicators.questBoss or not frame.indicators.questBoss.enabled ) then return end + + if( UnitIsQuestBoss(frame.unit) ) then + frame.indicators.questBoss:Show() + else + frame.indicators.questBoss:Hide() + end +end + function Indicators:UpdateLFDRole(frame, event) if( not frame.indicators.lfdRole or not frame.indicators.lfdRole.enabled ) then return end @@ -360,6 +370,14 @@ function Indicators:OnEnable(frame) frame.indicators.lfdRole:SetTexture("Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES") end + if( config.indicators.questBoss and config.indicators.questBoss.enabled ) then + frame:RegisterUnitEvent("UNIT_CLASSIFICATION_CHANGED", self, "UpdateQuestBoss") + frame:RegisterUpdateFunc(self, "UpdateQuestBoss") + + frame.indicators.questBoss = frame.indicators.questBoss or frame.indicators:CreateTexture(nil, "OVERLAY") + frame.indicators.questBoss:SetTexture("Interface\\TargetingFrame\\PortraitQuestBadge") + end + -- As they all share the function, register it as long as one is active if( frame.indicators.leader or frame.indicators.masterLoot or frame.indicators.role or ( frame.unit ~= "player" and frame.indicators.lfdRole ) ) then frame:RegisterNormalEvent("GROUP_ROSTER_UPDATE", self, "UpdateLeader") diff --git a/modules/movers.lua b/modules/movers.lua index 9c09792e..6609332b 100644 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -30,6 +30,7 @@ local function createConfigEnv() UnitLevel = function(unit) return MAX_PLAYER_LEVEL end, UnitIsPlayer = function(unit) return unit ~= "boss" and unit ~= "pet" and not string.match(unit, "(%w+)pet") end, UnitHealth = function(unit) return getValue("UnitHealth", unit, math.random(20000, 50000)) end, + UnitIsQuestBoss = function(unit) return unit == "target" or unit == "focus" end, UnitHealthMax = function(unit) return 50000 end, UnitPower = function(unit, powerType) if( powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS ) then diff --git a/options/config.lua b/options/config.lua index 4831cf8c..1992e857 100644 --- a/options/config.lua +++ b/options/config.lua @@ -36,12 +36,13 @@ local PAGE_DESC = { ["tags"] = L["Advanced tag management, allows you to add your own custom tags."], ["filter"] = L["Simple aura filtering by whitelists and blacklists."], } -local INDICATOR_NAMES = {["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon role"], ["masterLoot"] = L["Master looter"], ["pvp"] = L["PvP Flag"], ["raidTarget"] = L["Raid target"], ["ready"] = L["Ready status"], ["role"] = L["Raid role"], ["status"] = L["Combat status"], ["class"] = L["Class icon"], ["resurrect"] = L["Resurrect status"], ["phase"] = L["Phase status"]} +local INDICATOR_NAMES = {["questBoss"] = L["Quest Boss"], ["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon role"], ["masterLoot"] = L["Master looter"], ["pvp"] = L["PvP Flag"], ["raidTarget"] = L["Raid target"], ["ready"] = L["Ready status"], ["role"] = L["Raid role"], ["status"] = L["Combat status"], ["class"] = L["Class icon"], ["resurrect"] = L["Resurrect status"], ["phase"] = L["Phase status"]} local AREA_NAMES = {["arena"] = L["Arenas"],["none"] = L["Everywhere else"], ["party"] = L["Party instances"], ["pvp"] = L["Battlegrounds"], ["raid"] = L["Raid instances"]} local INDICATOR_DESC = { ["leader"] = L["Crown indicator for group leaders."], ["lfdRole"] = L["Role the unit is playing in dungeons formed through the Looking For Dungeon system."], ["masterLoot"] = L["Bag indicator for master looters."], ["pvp"] = L["PVP flag indicator, Horde for Horde flagged pvpers and Alliance for Alliance flagged pvpers."], ["raidTarget"] = L["Raid target indicator."], ["ready"] = L["Ready status of group members."], + ["questBoss"] = L["Shows that a NPC is a boss for a quest."], ["role"] = L["Raid role indicator, adds a shield indicator for main tanks and a sword icon for main assists."], ["status"] = L["Status indicator, shows if the unit is currently in combat. For the player it will also show if you are rested."], ["class"] = L["Class icon for players."]} local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"], ["absorb"] = L["Absorb"], ["classspec"] = L["Class Specific"]} From 5a3b7451d4a0f25d5f9580b7911b6d4434dc16b6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 7 Aug 2012 00:11:08 -0700 Subject: [PATCH 188/794] Added missing shard icon --- media/textures/shard.tga | Bin 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 media/textures/shard.tga diff --git a/media/textures/shard.tga b/media/textures/shard.tga old mode 100644 new mode 100755 From 8717a42d9ab8e517398a1d2c929797a3a6a96e9e Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 7 Aug 2012 00:11:37 -0700 Subject: [PATCH 189/794] Added support for RegisterUnitEvent, should improve performance a little - Added a few new party and target events that will improve general frame update speed --- modules/units.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 9dac9000..18e6efb4 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -40,7 +40,12 @@ local function RegisterNormalEvent(self, event, handler, func) return end - self:RegisterEvent(event) + if( unitEvents[event] and not ShadowUF.fakeUnits[self.unitRealType] ) then + self:BlizzRegisterUnitEvent(event, self.unitOwner, self.vehicleUnit) + else + self:RegisterEvent(event) + end + self.registeredEvents[event] = self.registeredEvents[event] or {} -- Each handler can only register an event once per a frame. @@ -467,7 +472,7 @@ OnAttributeChanged = function(self, name, unit) -- Phase change, do a full update on it self:RegisterUnitEvent("UNIT_PHASE", self, "FullUpdate") - + -- Pet changed, going from pet -> vehicle for one if( self.unit == "pet" or self.unitType == "partypet" ) then self.unitRealOwner = self.unit == "pet" and "player" or ShadowUF.partyUnits[self.unitID] @@ -504,11 +509,13 @@ OnAttributeChanged = function(self, name, unit) elseif( self.unit == "target" ) then self.isUnitVolatile = true self:RegisterNormalEvent("PLAYER_TARGET_CHANGED", Units, "CheckUnitStatus") + self:RegisterUnitEvent("UNIT_TARGETABLE_CHANGED", self, "FullUpdate") -- Automatically do a full update on focus change elseif( self.unit == "focus" ) then self.isUnitVolatile = true self:RegisterNormalEvent("PLAYER_FOCUS_CHANGED", Units, "CheckUnitStatus") + self:RegisterUnitEvent("UNIT_TARGETABLE_CHANGED", self, "FullUpdate") elseif( self.unit == "player" ) then self:SetAttribute("toggleForVehicle", true) @@ -521,7 +528,7 @@ OnAttributeChanged = function(self, name, unit) self.timeElapsed = 0 self:SetScript("OnUpdate", TargetUnitUpdate) self:RegisterNormalEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", self, "FullUpdate") - + -- Check for a unit guid to do a full update elseif( self.unitRealType == "raid" ) then self:RegisterNormalEvent("GROUP_ROSTER_UPDATE", Units, "CheckGroupedUnitStatus") @@ -533,6 +540,7 @@ OnAttributeChanged = function(self, name, unit) self:RegisterNormalEvent("PARTY_MEMBER_ENABLE", Units, "CheckGroupedUnitStatus") self:RegisterNormalEvent("PARTY_MEMBER_DISABLE", Units, "CheckGroupedUnitStatus") self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") + self:RegisterUnitEvent("UNIT_OTHER_PARTY_CHANGED", self, "FullUpdate") -- *target units are not real units, thus they do not receive events and must be polled for data elseif( ShadowUF.fakeUnits[self.unitRealType] ) then @@ -641,6 +649,7 @@ function Units:CreateUnit(...) frame.fullUpdates = {} frame.registeredEvents = {} frame.visibility = {} + frame.BlizzRegisterUnitEvent = frame.RegisterUnitEvent frame.RegisterNormalEvent = RegisterNormalEvent frame.RegisterUnitEvent = RegisterUnitEvent frame.RegisterUpdateFunc = RegisterUpdateFunc From 62630cc680e5a0e224274405591ba572b4681736 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 7 Aug 2012 00:12:19 -0700 Subject: [PATCH 190/794] Added pet type for pet battles - Readapted the phase indicator to also show if a party member is in another party (such as LFG) --- ShadowedUnitFrames.lua | 9 ++++++++- modules/defaultlayout.lua | 4 +++- modules/indicators.lua | 27 ++++++++++++++++++++++----- modules/movers.lua | 7 +++++++ options/config.lua | 6 +++--- 5 files changed, 43 insertions(+), 10 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index f9cdaca3..6d7aaf62 100644 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -39,7 +39,7 @@ end ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 17 +ShadowUF.dbRevision = 18 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -119,6 +119,13 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + + if( revision <= 17 ) then + self.db.profile.units.target.indicators.petBattle = {enabled = true, anchorPoint = "BL", size = 18, x = -6, y = 14, anchorTo = "$parent"} + self.db.profile.units.focus.indicators.petBattle = {enabled = false, anchorPoint = "BL", size = 18, x = -6, y = 12, anchorTo = "$parent"} + self.db.profile.units.party.indicators.phase = {enabled = true} + end + if( revision <= 16 ) then self.db.profile.units.target.indicators.questBoss = {enabled = true, anchorPoint = "BR", size = 22, x = 9, y = 24, anchorTo = "$parent"} self.db.profile.units.focus.indicators.questBoss = {enabled = false, anchorPoint = "BR", size = 22, x = 7, y = 14, anchorTo = "$parent"} diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index faf77eee..ce5ed6b1 100644 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -353,7 +353,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) offset = 23, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, - phase = {enabled = false, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} + phase = {enabled = true, anchorPoint = "RC", size = 26, x = -17, y = 0, anchorTo = "$parent"} }, auras = { buffs = {enabled = true, maxRows = 1}, @@ -579,6 +579,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) lfdRole = {enabled = false}, resurrect = {enabled = true, anchorPoint = "RC", size = 28, x = -39, y = -1, anchorTo = "$parent"}, questBoss = {enabled = true, anchorPoint = "BR", size = 22, x = 9, y = 24, anchorTo = "$parent"}, + petBattle = {enabled = true, anchorPoint = "BL", size = 18, x = -6, y = 14, anchorTo = "$parent"} }, auras = { buffs = {enabled = true}, @@ -634,6 +635,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) lfdRole = {enabled = false}, resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, questBoss = {enabled = false, anchorPoint = "BR", size = 22, x = 7, y = 14, anchorTo = "$parent"}, + petBattle = {enabled = false, anchorPoint = "BL", size = 18, x = -6, y = 12, anchorTo = "$parent"} }, text = { {text = "[(()afk() )][name]"}, diff --git a/modules/indicators.lua b/modules/indicators.lua index 01a2183a..7b54b254 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -1,4 +1,4 @@ -local Indicators = {list = {"status", "pvp", "leader", "resurrect", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class", "phase", "questBoss"}} +local Indicators = {list = {"status", "pvp", "leader", "resurrect", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class", "phase", "questBoss", "petBattle"}} local leavingWorld ShadowUF:RegisterModule(Indicators, "indicators", ShadowUF.L["Indicators"]) @@ -19,8 +19,12 @@ end function Indicators:UpdatePhase(frame) if( not frame.indicators.phase or not frame.indicators.phase.enabled ) then return end - - if( UnitExists(frame.unit) and UnitIsPlayer(frame.unit) and not UnitInPhase(frame.unit) ) then + + if( UnitInOtherParty(frame.unit) ) then + frame.indicators.phase:SetTexture("Interface\\PlayerFrame\\whisper-only") + frame.indicators.phase:Show() + elseif( not UnitExists(frame.unit) and UnitInPhase(frame.unit) ) then + frame.indicators.phase:SetTexture("Interface\\TargetingFrame\\UI-PhasingIcon") frame.indicators.phase:Show() else frame.indicators.phase:Hide() @@ -132,6 +136,16 @@ function Indicators:UpdatePVPFlag(frame) end end +function Indicators:UpdatePetBattle(frame) + if( UnitIsWildBattlePet(frame.unit) or UnitIsBattlePetCompanion(frame.unit) ) then + local petType = UnitBattlePetType(frame.unit) + frame.indicators.petBattle:SetTexture(string.format("Interface\\TargetingFrame\\PetBadge-%s", PET_TYPE_SUFFIX[petType])) + frame.indicators.petBattle:Show() + else + frame.indicators.petBattle:Hide() + end +end + -- Non-player units do not give events when they enter or leave combat, so polling is necessary local function combatMonitor(self, elapsed) self.timeElapsed = self.timeElapsed + elapsed @@ -274,9 +288,7 @@ function Indicators:OnEnable(frame) if( config.indicators.phase and config.indicators.phase.enabled ) then frame:RegisterUpdateFunc(self, "UpdatePhase") - frame.indicators.phase = frame.indicators.phase or frame.indicators:CreateTexture(nil, "OVERLAY") - frame.indicators.phase:SetTexture("Interface\\TargetingFrame\\UI-PhasingIcon") end if( config.indicators.resurrect and config.indicators.resurrect.enabled ) then @@ -378,6 +390,11 @@ function Indicators:OnEnable(frame) frame.indicators.questBoss:SetTexture("Interface\\TargetingFrame\\PortraitQuestBadge") end + if( config.indicators.petBattle and config.indicators.petBattle.enabled ) then + frame:RegisterUpdateFunc(self, "UpdatePetBattle") + frame.indicators.petBattle = frame.indicators.petBattle or frame.indicators:CreateTexture(nil, "OVERLAY") + end + -- As they all share the function, register it as long as one is active if( frame.indicators.leader or frame.indicators.masterLoot or frame.indicators.role or ( frame.unit ~= "player" and frame.indicators.lfdRole ) ) then frame:RegisterNormalEvent("GROUP_ROSTER_UPDATE", self, "UpdateLeader") diff --git a/modules/movers.lua b/modules/movers.lua index 6609332b..9acd8236 100644 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -31,6 +31,12 @@ local function createConfigEnv() UnitIsPlayer = function(unit) return unit ~= "boss" and unit ~= "pet" and not string.match(unit, "(%w+)pet") end, UnitHealth = function(unit) return getValue("UnitHealth", unit, math.random(20000, 50000)) end, UnitIsQuestBoss = function(unit) return unit == "target" or unit == "focus" end, + UnitIsWildBattlePet = function(unit) return unit == "target" or unit == "focus" end, + UnitBattlePetType = function(unit) + if( unit == "target" or unit == "focus" ) then + return getValue("UnitBattlePetType", unit, random(#(PET_TYPE_SUFFIX))) + end + end, UnitHealthMax = function(unit) return 50000 end, UnitPower = function(unit, powerType) if( powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS ) then @@ -63,6 +69,7 @@ local function createConfigEnv() return 50000 end, UnitHasIncomingResurrection = function(unit) return true end, + UnitInOtherParty = function(unit) return true end, UnitInPhase = function(unit) return true end, UnitExists = function(unit) return true end, UnitIsGroupLeader = function() return true end, diff --git a/options/config.lua b/options/config.lua index 1992e857..dd419566 100644 --- a/options/config.lua +++ b/options/config.lua @@ -36,13 +36,13 @@ local PAGE_DESC = { ["tags"] = L["Advanced tag management, allows you to add your own custom tags."], ["filter"] = L["Simple aura filtering by whitelists and blacklists."], } -local INDICATOR_NAMES = {["questBoss"] = L["Quest Boss"], ["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon role"], ["masterLoot"] = L["Master looter"], ["pvp"] = L["PvP Flag"], ["raidTarget"] = L["Raid target"], ["ready"] = L["Ready status"], ["role"] = L["Raid role"], ["status"] = L["Combat status"], ["class"] = L["Class icon"], ["resurrect"] = L["Resurrect status"], ["phase"] = L["Phase status"]} +local INDICATOR_NAMES = {["questBoss"] = L["Quest Boss"], ["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon Role"], ["masterLoot"] = L["Master Looter"], ["pvp"] = L["PvP Flag"], ["raidTarget"] = L["Raid Target"], ["ready"] = L["Ready Status"], ["role"] = L["Raid Role"], ["status"] = L["Combat Status"], ["class"] = L["Class Icon"], ["resurrect"] = L["Resurrect Status"], ["phase"] = L["Other Party/Phase Status"], ["petBattle"] = L["Pet Battle"]} local AREA_NAMES = {["arena"] = L["Arenas"],["none"] = L["Everywhere else"], ["party"] = L["Party instances"], ["pvp"] = L["Battlegrounds"], ["raid"] = L["Raid instances"]} local INDICATOR_DESC = { ["leader"] = L["Crown indicator for group leaders."], ["lfdRole"] = L["Role the unit is playing in dungeons formed through the Looking For Dungeon system."], ["masterLoot"] = L["Bag indicator for master looters."], ["pvp"] = L["PVP flag indicator, Horde for Horde flagged pvpers and Alliance for Alliance flagged pvpers."], - ["raidTarget"] = L["Raid target indicator."], ["ready"] = L["Ready status of group members."], - ["questBoss"] = L["Shows that a NPC is a boss for a quest."], + ["raidTarget"] = L["Raid target indicator."], ["ready"] = L["Ready status of group members."], ["phase"] = L["Shows when a party member is in a different phase or another group."], + ["questBoss"] = L["Shows that a NPC is a boss for a quest."], ["petBattle"] = L["Shows what kind of pet the unit is for pet battles."], ["role"] = L["Raid role indicator, adds a shield indicator for main tanks and a sword icon for main assists."], ["status"] = L["Status indicator, shows if the unit is currently in combat. For the player it will also show if you are rested."], ["class"] = L["Class icon for players."]} local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"], ["absorb"] = L["Absorb"], ["classspec"] = L["Class Specific"]} From 8449f12a43a5ca3bbbcaed2f54051b6c2e4183da Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 7 Aug 2012 00:25:18 -0700 Subject: [PATCH 191/794] Make sure faction isn't Neutral for the faction indicator --- modules/indicators.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 7b54b254..f55046af 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -125,12 +125,13 @@ end function Indicators:UpdatePVPFlag(frame) if( not frame.indicators.pvp or not frame.indicators.pvp.enabled ) then return end - if( UnitIsPVP(frame.unit) and UnitFactionGroup(frame.unit) ) then - frame.indicators.pvp:SetTexture(string.format("Interface\\TargetingFrame\\UI-PVP-%s", UnitFactionGroup(frame.unit))) - frame.indicators.pvp:Show() - elseif( UnitIsPVPFreeForAll(frame.unit) ) then + local faction = UnitFactionGroup(frame.unit) + if( UnitIsPVPFreeForAll(frame.unit) ) then frame.indicators.pvp:SetTexture("Interface\\TargetingFrame\\UI-PVP-FFA") frame.indicators.pvp:Show() + elseif( faction and faction ~= "Neutral" and UnitIsPVP(frame.unit) ) then + frame.indicators.pvp:SetTexture(string.format("Interface\\TargetingFrame\\UI-PVP-%s", faction)) + frame.indicators.pvp:Show() else frame.indicators.pvp:Hide() end From ac9623f60a2668a4e4a4807dca49c1da99ca0c9c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 7 Aug 2012 00:25:36 -0700 Subject: [PATCH 192/794] Added support for pet battle levels to the [level] and [levelcolor] tags --- modules/tags.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 1520f558..0c6bd545 100644 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -576,6 +576,10 @@ Tags.defaultTags = { return string.format("%s/%s", ShadowUF:SmartFormatNumber(power), ShadowUF:SmartFormatNumber(maxPower)) end]], ["levelcolor"] = [[function(unit, unitOwner) + if( UnitIsWildBattlePet(unit) or UnitIsBattlePetCompanion(unit) ) then + return nil + end + local level = UnitLevel(unit) if( level < 0 and UnitClassification(unit) == "worldboss" ) then return nil @@ -594,6 +598,10 @@ Tags.defaultTags = { end]], ["faction"] = [[function(unit, unitOwner) return UnitFactionGroup(unitOwner) end]], ["level"] = [[function(unit, unitOwner) + if( UnitIsWildBattlePet(unit) or UnitIsBattlePetCompanion(unit) ) then + return UnitBattlePetLevel(unit) + end + local level = UnitLevel(unit) return level > 0 and level or UnitClassification(unit) ~= "worldboss" and "??" or nil end]], @@ -909,8 +917,8 @@ Tags.defaultEvents = { ["druid:absolutepp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", ["sshards"] = "UNIT_POWER", ["hpower"] = "UNIT_POWER", - ["level"] = "UNIT_LEVEL PLAYER_LEVEL_UP", - ["levelcolor"] = "UNIT_LEVEL PLAYER_LEVEL_UP", + ["level"] = "UNIT_LEVEL UNIT_FACTION PLAYER_LEVEL_UP", + ["levelcolor"] = "UNIT_LEVEL UNIT_FACTION PLAYER_LEVEL_UP", ["maxhp"] = "UNIT_MAXHEALTH", ["def:name"] = "UNIT_NAME_UPDATE UNIT_MAXHEALTH UNIT_HEALTH UNIT_HEALTH_FREQUENT", ["absmaxhp"] = "UNIT_MAXHEALTH", @@ -1254,7 +1262,8 @@ local function loadAPIEvents() if( Tags.APIEvents ) then return end Tags.APIEvents = { ["InCombatLockdown"] = "PLAYER_REGEN_ENABLED PLAYER_REGEN_DISABLED", - ["UnitLevel"] = "UNIT_LEVEL", + ["UnitLevel"] = "UNIT_LEVEL UNIT_FACTION", + ["UnitBattlePetLevel"] = "UNIT_LEVEL UNIT_FACTION", ["UnitName"] = "UNIT_NAME_UPDATE", ["UnitClassification"] = "UNIT_CLASSIFICATION_CHANGED", ["UnitFactionGroup"] = "UNIT_FACTION PLAYER_FLAGS_CHANGED", From fa0731435cd769ae077c63e80f276994b959b6d7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 7 Aug 2012 00:27:03 -0700 Subject: [PATCH 193/794] Just hardcode the global checker for OSX --- globalcheck.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/globalcheck.lua b/globalcheck.lua index 1936bc7b..eac96f92 100755 --- a/globalcheck.lua +++ b/globalcheck.lua @@ -1,4 +1,4 @@ -local isOSX = os.getenv("MANPATH") and true or false +local isOSX = true local leaks = {} local results = "" local function output(msg) From 1edd0ce1e352bdcb030e892c58cd287fb691e5a6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 7 Aug 2012 00:31:22 -0700 Subject: [PATCH 194/794] Added Monk to raid frame grouping order --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 18e6efb4..96de115b 100644 --- a/modules/units.lua +++ b/modules/units.lua @@ -834,7 +834,7 @@ function Units:SetHeaderAttributes(frame, type) frame:SetAttribute("groupFilter", filter or "1,2,3,4,5,6,7,8") if( config.groupBy == "CLASS" ) then - frame:SetAttribute("groupingOrder", "DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,ROGUE,SHAMAN,WARLOCK,WARRIOR") + frame:SetAttribute("groupingOrder", "DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,ROGUE,SHAMAN,WARLOCK,WARRIOR,MONK") frame:SetAttribute("groupBy", "CLASS") else frame:SetAttribute("groupingOrder", "1,2,3,4,5,6,7,8") From 48adfc8af25dd0890d2c2c8bd92820051ee5863a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 7 Aug 2012 00:35:00 -0700 Subject: [PATCH 195/794] Swap to SetPortraitZoom which should fix male Worgan and other zoom issues with 3D portraits --- modules/portrait.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/portrait.lua b/modules/portrait.lua index ce4a8280..5512d21e 100755 --- a/modules/portrait.lua +++ b/modules/portrait.lua @@ -3,7 +3,7 @@ ShadowUF:RegisterModule(Portrait, "portrait", ShadowUF.L["Portrait"]) -- If the camera isn't reset OnShow, it'll show the entire character instead of just the head, odd I know local function resetCamera(self) - self:SetCamera(0) + self:SetPortraitZoom(1) end local function resetGUID(self) @@ -83,7 +83,7 @@ function Portrait:Update(frame, event) -- Use animated 3D portrait else frame.portrait:SetUnit(frame.unitOwner) - frame.portrait:SetCamera(0) + frame.portrait:SetPortraitZoom(1) frame.portrait:Show() end end From b831cf2958d17fbd53733938573ce9918e2244e3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 7 Aug 2012 00:37:44 -0700 Subject: [PATCH 196/794] Added Detox as a Monk friendly range ability --- modules/range.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/range.lua b/modules/range.lua index 1023e1db..d3d025b8 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -1,5 +1,5 @@ local Range = { - friendly = {["PRIEST"] = GetSpellInfo(2061), ["DRUID"] = GetSpellInfo(774), ["PALADIN"] = GetSpellInfo(635), ["SHAMAN"] = GetSpellInfo(331)}, + friendly = {["PRIEST"] = GetSpellInfo(2061), ["DRUID"] = GetSpellInfo(774), ["PALADIN"] = GetSpellInfo(635), ["SHAMAN"] = GetSpellInfo(331), ["MONK"] = GetSpellInfo(115450)}, hostile = {["PRIEST"] = GetSpellInfo(585), ["DRUID"] = GetSpellInfo(5176), ["PALADIN"] = GetSpellInfo(62124), ["HUNTER"] = GetSpellInfo(75), ["WARLOCK"] = GetSpellInfo(686), ["SHAMAN"] = GetSpellInfo(403), ["MAGE"] = GetSpellInfo(133), ["DEATHKNIGHT"] = GetSpellInfo(49576)}, } ShadowUF:RegisterModule(Range, "range", ShadowUF.L["Range indicator"]) From c0263227903e89192bbe3fea50237eb94535e928 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 7 Aug 2012 15:06:36 -0700 Subject: [PATCH 197/794] Logic fix --- modules/indicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index f55046af..a6b10019 100644 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -23,7 +23,7 @@ function Indicators:UpdatePhase(frame) if( UnitInOtherParty(frame.unit) ) then frame.indicators.phase:SetTexture("Interface\\PlayerFrame\\whisper-only") frame.indicators.phase:Show() - elseif( not UnitExists(frame.unit) and UnitInPhase(frame.unit) ) then + elseif( UnitExists(frame.unit) and not UnitInPhase(frame.unit) ) then frame.indicators.phase:SetTexture("Interface\\TargetingFrame\\UI-PhasingIcon") frame.indicators.phase:Show() else From 7114c5ba2a7ed8e68a3def3aae3e4c89733f5e6b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 11 Aug 2012 10:48:30 -0700 Subject: [PATCH 198/794] Fixed the alt power bar not always showing on the player unit --- modules/altpower.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 modules/altpower.lua diff --git a/modules/altpower.lua b/modules/altpower.lua old mode 100644 new mode 100755 index d8c40a56..c72a016b --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -25,7 +25,7 @@ end function AltPower:UpdateVisibility(frame) local barType, minPower, _, _, _, hideFromOthers = UnitAlternatePowerInfo(frame.unit) - local visible = barType and ( frame.unit == "player" or not hideFromOthers ) + local visible = barType and ( frame.unitType == "player" or not hideFromOthers ) ShadowUF.Layout:SetBarVisibility(frame, "altPowerBar", visible) AltPower:Update(frame, nil, nil, "ALTERNATE") end @@ -35,4 +35,4 @@ function AltPower:Update(frame, event, unit, type) frame.altPowerBar:SetMinMaxValues(select(2, UnitAlternatePowerInfo(frame.unit)) or 0, UnitPowerMax(frame.unit, ALTERNATE_POWER_INDEX) or 0) frame.altPowerBar:SetValue(UnitPower(frame.unit, ALTERNATE_POWER_INDEX) or 0) -end \ No newline at end of file +end From 1e622a0f726ee768ff08c2473dae4874fb9c60f9 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 11 Aug 2012 10:48:39 -0700 Subject: [PATCH 199/794] Mode fix so git stops complaining --- .gitignore | 0 .pkgmeta | 0 ShadowedUnitFrames.lua | 0 localization/deDE.lua | 0 localization/enUS.lua | 0 localization/esES.lua | 0 localization/esMX.lua | 0 localization/frFR.lua | 0 localization/koKR.lua | 0 localization/ptBR.lua | 0 localization/ruRU.lua | 0 localization/zhCN.lua | 0 localization/zhTW.lua | 0 modules/auras.lua | 0 modules/burningembers.lua | 0 modules/chi.lua | 0 modules/defaultlayout.lua | 0 modules/demonicfury.lua | 0 modules/eclipse.lua | 0 modules/empty.lua | 0 modules/health.lua | 0 modules/highlight.lua | 0 modules/holypower.lua | 0 modules/indicators.lua | 0 modules/movers.lua | 0 modules/shadoworbs.lua | 0 modules/soulshards.lua | 0 modules/tags.lua | 0 modules/units.lua | 0 options/config.lua | 0 30 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 .pkgmeta mode change 100644 => 100755 ShadowedUnitFrames.lua mode change 100644 => 100755 localization/deDE.lua mode change 100644 => 100755 localization/enUS.lua mode change 100644 => 100755 localization/esES.lua mode change 100644 => 100755 localization/esMX.lua mode change 100644 => 100755 localization/frFR.lua mode change 100644 => 100755 localization/koKR.lua mode change 100644 => 100755 localization/ptBR.lua mode change 100644 => 100755 localization/ruRU.lua mode change 100644 => 100755 localization/zhCN.lua mode change 100644 => 100755 localization/zhTW.lua mode change 100644 => 100755 modules/auras.lua mode change 100644 => 100755 modules/burningembers.lua mode change 100644 => 100755 modules/chi.lua mode change 100644 => 100755 modules/defaultlayout.lua mode change 100644 => 100755 modules/demonicfury.lua mode change 100644 => 100755 modules/eclipse.lua mode change 100644 => 100755 modules/empty.lua mode change 100644 => 100755 modules/health.lua mode change 100644 => 100755 modules/highlight.lua mode change 100644 => 100755 modules/holypower.lua mode change 100644 => 100755 modules/indicators.lua mode change 100644 => 100755 modules/movers.lua mode change 100644 => 100755 modules/shadoworbs.lua mode change 100644 => 100755 modules/soulshards.lua mode change 100644 => 100755 modules/tags.lua mode change 100644 => 100755 modules/units.lua mode change 100644 => 100755 options/config.lua diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.pkgmeta b/.pkgmeta old mode 100644 new mode 100755 diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua old mode 100644 new mode 100755 diff --git a/localization/deDE.lua b/localization/deDE.lua old mode 100644 new mode 100755 diff --git a/localization/enUS.lua b/localization/enUS.lua old mode 100644 new mode 100755 diff --git a/localization/esES.lua b/localization/esES.lua old mode 100644 new mode 100755 diff --git a/localization/esMX.lua b/localization/esMX.lua old mode 100644 new mode 100755 diff --git a/localization/frFR.lua b/localization/frFR.lua old mode 100644 new mode 100755 diff --git a/localization/koKR.lua b/localization/koKR.lua old mode 100644 new mode 100755 diff --git a/localization/ptBR.lua b/localization/ptBR.lua old mode 100644 new mode 100755 diff --git a/localization/ruRU.lua b/localization/ruRU.lua old mode 100644 new mode 100755 diff --git a/localization/zhCN.lua b/localization/zhCN.lua old mode 100644 new mode 100755 diff --git a/localization/zhTW.lua b/localization/zhTW.lua old mode 100644 new mode 100755 diff --git a/modules/auras.lua b/modules/auras.lua old mode 100644 new mode 100755 diff --git a/modules/burningembers.lua b/modules/burningembers.lua old mode 100644 new mode 100755 diff --git a/modules/chi.lua b/modules/chi.lua old mode 100644 new mode 100755 diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua old mode 100644 new mode 100755 diff --git a/modules/demonicfury.lua b/modules/demonicfury.lua old mode 100644 new mode 100755 diff --git a/modules/eclipse.lua b/modules/eclipse.lua old mode 100644 new mode 100755 diff --git a/modules/empty.lua b/modules/empty.lua old mode 100644 new mode 100755 diff --git a/modules/health.lua b/modules/health.lua old mode 100644 new mode 100755 diff --git a/modules/highlight.lua b/modules/highlight.lua old mode 100644 new mode 100755 diff --git a/modules/holypower.lua b/modules/holypower.lua old mode 100644 new mode 100755 diff --git a/modules/indicators.lua b/modules/indicators.lua old mode 100644 new mode 100755 diff --git a/modules/movers.lua b/modules/movers.lua old mode 100644 new mode 100755 diff --git a/modules/shadoworbs.lua b/modules/shadoworbs.lua old mode 100644 new mode 100755 diff --git a/modules/soulshards.lua b/modules/soulshards.lua old mode 100644 new mode 100755 diff --git a/modules/tags.lua b/modules/tags.lua old mode 100644 new mode 100755 diff --git a/modules/units.lua b/modules/units.lua old mode 100644 new mode 100755 diff --git a/options/config.lua b/options/config.lua old mode 100644 new mode 100755 From 933473891e8e459b5bbe25574ac8285cb33f899d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 20 Aug 2012 18:01:17 -0700 Subject: [PATCH 200/794] Fixed Blizzard frames being hidden multiple times causing multiple secure hooks and redundant hiding calls --- ShadowedUnitFrames.lua | 68 ++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 26 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 6d7aaf62..99f8d067 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -468,19 +468,21 @@ function ShadowUF:ProfilesChanged() end ShadowUF.noop = function() end + +local active_hiddens = {} function ShadowUF:HideBlizzardFrames() - if( ShadowUF.db.profile.hidden.runes ) then + if( ShadowUF.db.profile.hidden.runes and not active_hiddens.runes ) then RuneFrame.Show = self.noop RuneFrame:Hide() RuneFrame:UnregisterAllEvents() end - if( ShadowUF.db.profile.hidden.cast ) then + if( ShadowUF.db.profile.hidden.cast and not active_hiddens.cast ) then CastingBarFrame:UnregisterAllEvents() PetCastingBarFrame:UnregisterAllEvents() end - if( ShadowUF.db.profile.hidden.party ) then + if( ShadowUF.db.profile.hidden.party and not active_hiddens.party ) then for i=1, MAX_PARTY_MEMBERS do local name = "PartyMemberFrame" .. i local frame = _G[name] @@ -510,7 +512,7 @@ function ShadowUF:HideBlizzardFrames() end end - if( ShadowUF.db.profile.hidden.raid ) then + if( ShadowUF.db.profile.hidden.raid and not active_hiddens.raid ) then local function hideRaid() CompactRaidFrameManager:UnregisterAllEvents() if( not InCombatLockdown() ) then CompactRaidFrameManager:Hide() end @@ -528,11 +530,11 @@ function ShadowUF:HideBlizzardFrames() end) hideRaid() - else + elseif( not ShadowUF.db.profile.hidden.raid ) then CompactRaidFrameManager:SetFrameStrata("DIALOG") end - if( ShadowUF.db.profile.hidden.buffs ) then + if( ShadowUF.db.profile.hidden.buffs and not active_hiddens.buffs ) then BuffFrame:UnregisterAllEvents() BuffFrame.Show = self.noop BuffFrame:Hide() @@ -542,7 +544,7 @@ function ShadowUF:HideBlizzardFrames() TemporaryEnchantFrame:Hide() end - if( ShadowUF.db.profile.hidden.player ) then + if( ShadowUF.db.profile.hidden.player and not active_hiddens.player ) then PlayerFrame:UnregisterAllEvents() PlayerFrame.Show = self.noop PlayerFrame:Hide() @@ -560,7 +562,7 @@ function ShadowUF:HideBlizzardFrames() ShardBarFrame:UnregisterAllEvents() end - if( ShadowUF.db.profile.hidden.pet ) then + if( ShadowUF.db.profile.hidden.pet and not active_hiddens.pet ) then PetFrame:UnregisterAllEvents() PetFrame.Show = self.noop PetFrame:Hide() @@ -569,7 +571,7 @@ function ShadowUF:HideBlizzardFrames() PetFrameManaBar:UnregisterAllEvents() end - if( ShadowUF.db.profile.hidden.target ) then + if( ShadowUF.db.profile.hidden.target and not active_hiddens.target ) then TargetFrame:UnregisterAllEvents() TargetFrame.Show = self.noop TargetFrame:Hide() @@ -583,7 +585,7 @@ function ShadowUF:HideBlizzardFrames() ComboFrame:Hide() end - if( ShadowUF.db.profile.hidden.focus ) then + if( ShadowUF.db.profile.hidden.focus and not active_hiddens.focus ) then FocusFrame:UnregisterAllEvents() FocusFrame.Show = self.noop FocusFrame:Hide() @@ -593,7 +595,7 @@ function ShadowUF:HideBlizzardFrames() FocusFrameSpellBar:UnregisterAllEvents() end - if( ShadowUF.db.profile.hidden.boss ) then + if( ShadowUF.db.profile.hidden.boss and not active_hiddens.boss ) then for i=1, MAX_BOSS_FRAMES do local name = "Boss" .. i .. "TargetFrame" local frame = _G[name] @@ -607,11 +609,12 @@ function ShadowUF:HideBlizzardFrames() end end - if( ShadowUF.db.profile.hidden.arena ) then - Arena_LoadUI = self.noop + if( ShadowUF.db.profile.hidden.arena and not active_hiddens.arena and IsAddOnLoaded("Blizzard_ArenaUI") ) then + ArenaEnemyFrames.show = false + ArenaEnemyFrames:UnregisterAllEvents() end - if( ShadowUF.db.profile.hidden.playerAltPower ) then + if( ShadowUF.db.profile.hidden.playerAltPower and not active_hiddens.playerAltPower ) then PlayerPowerBarAlt:UnregisterEvent("UNIT_POWER_BAR_SHOW") PlayerPowerBarAlt:UnregisterEvent("UNIT_POWER_BAR_HIDE") PlayerPowerBarAlt:UnregisterEvent("PLAYER_ENTERING_WORLD") @@ -621,23 +624,36 @@ function ShadowUF:HideBlizzardFrames() -- fix LFD Cooldown Frame -- this is technically not our problem, but due to having the frames on the same strata, it looks like this to the users -- and the fix is simple enough - hooksecurefunc(LFDQueueFrameCooldownFrame, "SetFrameLevel", function(frame, value) - local parentLevel = LFDParentFrame:GetFrameLevel() + 5 - if( value < parentLevel ) then - frame:SetFrameLevel(parentLevel + 10) - end - end) + if( not active_hiddens.lfd ) then + active_hiddens.lfd = true + hooksecurefunc(LFDQueueFrameCooldownFrame, "SetFrameLevel", function(frame, value) + local parentLevel = LFDParentFrame:GetFrameLevel() + 5 + if( value < parentLevel ) then + frame:SetFrameLevel(parentLevel + 10) + end + end) + end -- Don't modify the raid menu because that will taint the MA/MT stuff and it'll break and that's bad - for key, list in pairs(UnitPopupMenus) do - if( key ~= "RAID" ) then - for i=#(list), 1, -1 do - if( list[i] == "SET_FOCUS" or list[i] == "CLEAR_FOCUS" or list[i] == "LOCK_FOCUS_FRAME" or list[i] == "UNLOCK_FOCUS_FRAME" ) then - table.remove(list, i) + if( not active_hiddens.popup ) then + active_hiddens.popup = true + for key, list in pairs(UnitPopupMenus) do + if( key ~= "RAID" ) then + for i=#(list), 1, -1 do + if( list[i] == "SET_FOCUS" or list[i] == "CLEAR_FOCUS" or list[i] == "LOCK_FOCUS_FRAME" or list[i] == "UNLOCK_FOCUS_FRAME" ) then + table.remove(list, i) + end end end end end + + -- As a reload is required to reset the hidden hooks, we can just set this to true if anything is true + for type, flag in pairs(ShadowUF.db.profile.hidden) do + if( flag ) then + active_hiddens[type] = true + end + end end function ShadowUF:Print(msg) @@ -693,7 +709,7 @@ frame:SetScript("OnEvent", function(self, event, addon) if( event == "PLAYER_LOGIN" ) then ShadowUF:OnInitialize() self:UnregisterEvent("PLAYER_LOGIN") - elseif event == "ADDON_LOADED" and addon == "Blizzard_CompactRaidFrames" then + elseif( event == "ADDON_LOADED" and ( addon == "Blizzard_ArenaUI" or addon == "Blizzard_CompactRaidFrames" ) ) then ShadowUF:HideBlizzardFrames() end end) From c1436dce4d7d6e804f29fd5bb3782fb7fa1f0369 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 20 Aug 2012 18:09:59 -0700 Subject: [PATCH 201/794] Don't block the arena UI from loading, but block the frames, this is likely irrelevant as the separate prep frames seem to be parented to it though --- modules/units.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/units.lua b/modules/units.lua index 96de115b..d99b56b8 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1082,6 +1082,7 @@ function Units:LoadZoneHeader(type) -- stealths the frame will hide which looks bad. Instead force it to stay open and it has to be manually hidden when the player leaves an arena. if( type == "arena" ) then frame:SetAttribute("unitID", id) + frame:SetFrameRef("prepframe", _G["ArenaPrepFrame" .. id]) frame.hasStateWatch = true stateMonitor:WrapScript(frame, "OnAttributeChanged", [[ @@ -1095,6 +1096,7 @@ function Units:LoadZoneHeader(type) end if( value ) then + self:GetFrameRef("prepframe"):Hide() self:Show() end end From 45c67a70eb3bbb691940339e036e2b6e05bd6881 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Aug 2012 17:45:04 -0700 Subject: [PATCH 202/794] Updated the range spell list to fill in missing classes --- modules/range.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index d3d025b8..e36bb5a2 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -1,6 +1,6 @@ local Range = { - friendly = {["PRIEST"] = GetSpellInfo(2061), ["DRUID"] = GetSpellInfo(774), ["PALADIN"] = GetSpellInfo(635), ["SHAMAN"] = GetSpellInfo(331), ["MONK"] = GetSpellInfo(115450)}, - hostile = {["PRIEST"] = GetSpellInfo(585), ["DRUID"] = GetSpellInfo(5176), ["PALADIN"] = GetSpellInfo(62124), ["HUNTER"] = GetSpellInfo(75), ["WARLOCK"] = GetSpellInfo(686), ["SHAMAN"] = GetSpellInfo(403), ["MAGE"] = GetSpellInfo(133), ["DEATHKNIGHT"] = GetSpellInfo(49576)}, + friendly = {["WARRIOR"] = GetSpellInfo(3411), ["PRIEST"] = GetSpellInfo(2061), ["DRUID"] = GetSpellInfo(774), ["PALADIN"] = GetSpellInfo(635), ["SHAMAN"] = GetSpellInfo(331), ["WARLOCK"] = GetSpellInfo(5697), ["DEATHKNIGHT"] = GetSpellInfo(49016), ["MAGE"] = GetSpellInfo(475), ["ROGUE"] = GetSpellInfo(57934), ["MONK"] = GetSpellInfo(115450)}, + hostile = {["WARRIOR"] = GetSpellInfo(100), ["PRIEST"] = GetSpellInfo(585), ["DRUID"] = GetSpellInfo(5176), ["PALADIN"] = GetSpellInfo(62124), ["SHAMAN"] = GetSpellInfo(403), ["HUNTER"] = GetSpellInfo(75), ["WARLOCK"] = GetSpellInfo(686), ["DEATHKNIGHT"] = GetSpellInfo(49576), ["MAGE"] = GetSpellInfo(133), ["ROGUE"] = GetSpellInfo(2094), ["MONK"] = GetSpellInfo(115546)}, } ShadowUF:RegisterModule(Range, "range", ShadowUF.L["Range indicator"]) From 3ba558feba89dddf0d4b99d0e493f90534059eac Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Aug 2012 17:56:13 -0700 Subject: [PATCH 203/794] Totem bar will now show for Monk (used for statues) - Added the ability to set the bar coloring for Monk statues and Druid Mushrooms --- modules/defaultlayout.lua | 2 ++ modules/totems.lua | 16 ++++++++++++---- options/config.lua | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index ce5ed6b1..a30606e4 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -160,6 +160,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) SHADOWORBS = {r = 0.58, g = 0.51, b = 0.79}, ALTERNATE = {r = 0.71, g = 0.0, b = 1.0}, CHI = {r = 0.0, g = 1.0, b = 0.59}, + STATUE = {r = 0.35, g = 0.45, b = 0.60}, + MUSHROOMS = {r = 0.20, g = 0.90, b = 0.20} } config.healthColors = { tapped = {r = 0.5, g = 0.5, b = 0.5}, diff --git a/modules/totems.lua b/modules/totems.lua index efc71b79..567e79ca 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -3,12 +3,16 @@ local totemColors = {} local MAX_TOTEMS = MAX_TOTEMS -- Death Knights untalented ghouls are guardians and are considered totems........... so set it up for them -if( select(2, UnitClass("player")) == "DEATHKNIGHT" ) then +local playerClass = select(2, UnitClass("player")) +if( playerClass == "DEATHKNIGHT" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Guardian bar"], true, "DEATHKNIGHT") -elseif( select(2, UnitClass("player")) == "DRUID" ) then +elseif( playerClass == "DRUID" ) then MAX_TOTEMS = 3 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Mushroom bar"], true, "DRUID") +elseif( playerClass == "MONK" ) then + MAX_TOTEMS = 1 + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Statue bar"], true, "MONK") else ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Totem bar"], true, "SHAMAN") end @@ -35,9 +39,13 @@ function Totems:OnEnable(frame) table.insert(frame.totemBar.totems, totem) end - - if( MAX_TOTEMS == 1 ) then + + if( playerClass == "DRUID" ) then + totemColors[1] = totemColors[2] = totemColors[3] = ShadowUF.db.profile.powerColors.MUSHROOMS + elseif( playerClass == "DEATHKNIGHT" ) then totemColors[1] = ShadowUF.db.profile.classColors.PET + elseif( playerClass == "MONK" ) then + totemColors[1] = ShadowUF.db.profile.powerColors.STATUE else totemColors[1] = {r = 1, g = 0, b = 0.4} totemColors[2] = {r = 0, g = 1, b = 0.4} diff --git a/options/config.lua b/options/config.lua index dd419566..dc3e6210 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1189,6 +1189,22 @@ local function loadGeneralOptions() arg = "powerColors.CHI", hidden = function(info) return select(2, UnitClass("player")) ~= "MONK" end, }, + MUSHROOMS = { + order = 17, + type = "color", + name = L["Mushrooms"], + hasAlpha = true, + arg = "powerColors.MUSHROOMS", + hidden = function(info) return select(2, UnitClass("player")) ~= "DRUID" end, + }, + STATUE = { + order = 17, + type = "color", + name = L["Statue"], + hasAlpha = true, + arg = "powerColors.STATUE", + hidden = function(info) return select(2, UnitClass("player")) ~= "MONK" end, + }, }, }, cast = { From ef1cfb5301cad4fbeec9f4d7c70c5005b55c6a4e Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Aug 2012 18:16:16 -0700 Subject: [PATCH 204/794] Typo --- modules/totems.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/totems.lua b/modules/totems.lua index 567e79ca..97c24070 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -41,7 +41,7 @@ function Totems:OnEnable(frame) end if( playerClass == "DRUID" ) then - totemColors[1] = totemColors[2] = totemColors[3] = ShadowUF.db.profile.powerColors.MUSHROOMS + totemColors[1], totemColors[2], totemColors[3] = ShadowUF.db.profile.powerColors.MUSHROOMS, ShadowUF.db.profile.powerColors.MUSHROOMS, ShadowUF.db.profile.powerColors.MUSHROOMS elseif( playerClass == "DEATHKNIGHT" ) then totemColors[1] = ShadowUF.db.profile.classColors.PET elseif( playerClass == "MONK" ) then From c15f1fd8f999d41adc830382a57190bcc10aafb6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Aug 2012 18:17:30 -0700 Subject: [PATCH 205/794] Added a Mistweaver Monk specific bar to show mana, just like the Druid one --- ShadowedUnitFrames.lua | 10 +++++++++- ShadowedUnitFrames.toc | 1 + modules/monk.lua | 39 +++++++++++++++++++++++++++++++++++++++ modules/units.lua | 5 ++--- options/config.lua | 14 +++++++++++--- 5 files changed, 62 insertions(+), 7 deletions(-) create mode 100755 modules/monk.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 99f8d067..8180a216 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -414,7 +414,15 @@ function ShadowUF:RegisterModule(module, key, name, isBar, class, spec) module.moduleHasBar = isBar module.moduleName = name module.moduleClass = class - module.moduleSpec = spec + + if( type(spec) == "number" ) then + module.moduleSpec = {spec = true} + else + module.moduleSpec = {} + for _, id in pairs(spec) do + module.moduleSpec[id] = true + end + end table.insert(self.moduleOrder, module) end diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 63fc79eb..ae8c8d93 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -54,6 +54,7 @@ modules\demonicfury.lua modules\burningembers.lua modules\altpower.lua modules\shadoworbs.lua +modules\monk.lua #@do-not-package@ options\config.lua #@end-do-not-package@ diff --git a/modules/monk.lua b/modules/monk.lua new file mode 100755 index 00000000..abb5c84f --- /dev/null +++ b/modules/monk.lua @@ -0,0 +1,39 @@ +local Monk = {} +ShadowUF:RegisterModule(Monk, "monkBar", ShadowUF.L["Monk mana bar"], true, "MONK", SPEC_MONK_MISTWEAVER) + +function Monk:OnEnable(frame) + frame.monkBar = frame.monkBar or ShadowUF.Units:CreateBar(frame) + + frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") + + frame:RegisterUpdateFunc(self, "Update") +end + +function Monk:OnDisable(frame) + frame:UnregisterAll(self) +end + +function Monk:OnLayoutApplied(frame) + if( frame.visibility.monkBar ) then + local color = ShadowUF.db.profile.powerColors.MANA + + if( not ShadowUF.db.profile.units[frame.unitType].monkBar.invert ) then + frame.monkBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) + if( not frame.monkBar.background.overrideColor ) then + frame.monkBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) + end + else + frame.monkBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) + + color = frame.monkBar.background.overrideColor or color + frame.monkBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) + end + end +end + +function Monk:Update(frame, event, unit, powerType) + if( powerType ~= "MANA" ) then return end + frame.monkBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, SPELL_POWER_MANA)) + frame.monkBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, SPELL_POWER_MANA)) +end diff --git a/modules/units.lua b/modules/units.lua index d99b56b8..ee9da20f 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -242,9 +242,8 @@ local function SetVisibility(self) -- Force disable modules for people who aren't the appropriate class if( module.moduleClass and module.moduleClass ~= playerClass ) then enabled = nil - end - - if( module.moduleSpec and module.moduleSpec ~= playerSpec ) then + -- Force disable if they aren't the appropriate spec + elseif( module.moduleSpec and module.moduleSpec[playerSpec] ~= true ) then enabled = nil end diff --git a/options/config.lua b/options/config.lua index dc3e6210..887b87be 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2220,14 +2220,14 @@ local function loadUnitOptions() }, sep2 = {order = 1.75, type = "description", name = "", hidden = function(info) local moduleKey = info[#(info) - 1] - return ( moduleKey ~= "healthBar" and moduleKey ~= "powerBar" and moduleKey ~= "druidBar" and moduleKey ~= "burningEmbersBar" ) or not ShadowUF.db.profile.advanced + return ( moduleKey ~= "healthBar" and moduleKey ~= "powerBar" and moduleKey ~= "druidBar" and moduleKey ~= "monkBar" and moduleKey ~= "burningEmbersBar" ) or not ShadowUF.db.profile.advanced end}, invert = { order = 2, type = "toggle", name = L["Invert colors"], desc = L["Flips coloring so the bar color is shown as the background color and the background as the bar"], - hidden = function(info) return ( info[#(info) - 1] ~= "healthBar" and info[#(info) - 1] ~= "powerBar" and info[#(info) - 1] ~= "druidBar" ) or not ShadowUF.db.profile.advanced end, + hidden = function(info) return ( info[#(info) - 1] ~= "healthBar" and info[#(info) - 1] ~= "powerBar" and info[#(info) - 1] ~= "druidBar" and info[#(info) - 1] ~= "monkBar" ) or not ShadowUF.db.profile.advanced end, arg = "$parent.invert", }, order = { @@ -3667,7 +3667,7 @@ local function loadUnitOptions() hidden = function(info) local unit = info[2] if( unit == "global" ) then - return not globalConfig.runeBar and not globalConfig.eclipseBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.xpBar and not globalConfig.demonicFuryBar and not globalConfig.burningEmbersBar + return not globalConfig.runeBar and not globalConfig.eclipseBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.monkBar and not globalConfig.xpBar and not globalConfig.demonicFuryBar and not globalConfig.burningEmbersBar else return unit ~= "player" end @@ -3723,6 +3723,14 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "druidBar.enabled", }, + monkBar = { + order = 3, + type = "toggle", + name = string.format(L["Enable %s"], L["Monk mana bar"]), + desc = L["Shows the mana power bar for Mistweaver Monks."], + hidden = hideRestrictedOption, + arg = "monkBar.enabled", + }, xpBar = { order = 4, type = "toggle", From 9e08f487d5d2944f7d0ae819841cb7f2706bf172 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Aug 2012 18:32:51 -0700 Subject: [PATCH 206/794] Disable modules if someone is not the right spec or is too low to use them --- ShadowedUnitFrames.lua | 5 +++-- modules/holypower.lua | 2 +- modules/shadoworbs.lua | 3 ++- modules/totems.lua | 6 +++--- modules/units.lua | 19 +++++++++++++++++++ 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 8180a216..3a9d16b7 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -407,17 +407,18 @@ function ShadowUF:LoadUnitDefaults() end -- Module APIs -function ShadowUF:RegisterModule(module, key, name, isBar, class, spec) +function ShadowUF:RegisterModule(module, key, name, isBar, class, spec, level) self.modules[key] = module module.moduleKey = key module.moduleHasBar = isBar module.moduleName = name module.moduleClass = class + module.moduleLevel = level if( type(spec) == "number" ) then module.moduleSpec = {spec = true} - else + elseif( type(spec) == "table" ) then module.moduleSpec = {} for _, id in pairs(spec) do module.moduleSpec[id] = true diff --git a/modules/holypower.lua b/modules/holypower.lua index 9fea6c94..84e5f00e 100755 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -1,5 +1,5 @@ local HolyPower = setmetatable({}, {__index = ShadowUF.ComboPoints}) -ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN") +ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN", nil, PALADINPOWERBAR_SHOW_LEVEL) local holyConfig = {max = HOLY_POWER_FULL, key = "holyPower", colorKey = "HOLYPOWER", powerType = SPELL_POWER_HOLY_POWER, eventType = "HOLY_POWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function HolyPower:OnEnable(frame) diff --git a/modules/shadoworbs.lua b/modules/shadoworbs.lua index f41c02ca..d40fc242 100755 --- a/modules/shadoworbs.lua +++ b/modules/shadoworbs.lua @@ -1,5 +1,5 @@ local ShadowOrbs = setmetatable({}, {__index = ShadowUF.ComboPoints}) -ShadowUF:RegisterModule(ShadowOrbs, "shadowOrbs", ShadowUF.L["Shadow Orbs"], nil, "PRIEST", SPEC_PRIEST_SHADOW) +ShadowUF:RegisterModule(ShadowOrbs, "shadowOrbs", ShadowUF.L["Shadow Orbs"], nil, "PRIEST", SPEC_PRIEST_SHADOW, SHADOW_ORBS_SHOW_LEVEL) local shadowConfig = {max = PRIEST_BAR_NUM_ORBS, key = "shadowOrbs", colorKey = "SHADOWORBS", powerType = SPELL_POWER_SHADOW_ORBS, eventType = "SHADOW_ORBS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function ShadowOrbs:OnEnable(frame) @@ -10,6 +10,7 @@ function ShadowOrbs:OnEnable(frame) frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") + frame:RegisterUpdateFunc(self, "Update") frame:RegisterUpdateFunc(self, "UpdateBarBlocks") end diff --git a/modules/totems.lua b/modules/totems.lua index 97c24070..0dad0922 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -6,13 +6,13 @@ local MAX_TOTEMS = MAX_TOTEMS local playerClass = select(2, UnitClass("player")) if( playerClass == "DEATHKNIGHT" ) then MAX_TOTEMS = 1 - ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Guardian bar"], true, "DEATHKNIGHT") + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Guardian bar"], true, "DEATHKNIGHT", {1, 2}, 55) elseif( playerClass == "DRUID" ) then MAX_TOTEMS = 3 - ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Mushroom bar"], true, "DRUID") + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Mushroom bar"], true, "DRUID", {1}, 84) elseif( playerClass == "MONK" ) then MAX_TOTEMS = 1 - ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Statue bar"], true, "MONK") + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Statue bar"], true, "MONK", {1, 2}, 70) else ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Totem bar"], true, "SHAMAN") end diff --git a/modules/units.lua b/modules/units.lua index ee9da20f..6a3f09e2 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -247,6 +247,14 @@ local function SetVisibility(self) enabled = nil end + -- Restrict by level + if( module.moduleLevel and enabled and self.unitType == "player" ) then + if( UnitLevel("player") > module.moduleLevel ) then + enabled = nil + end + end + + -- Module isn't enabled all the time, only in this zone so we need to force it to be enabled if( not self.visibility[key] and enabled ) then module:OnEnable(self) @@ -1291,6 +1299,8 @@ centralFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") centralFrame:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") centralFrame:RegisterEvent("PLAYER_TALENT_UPDATE") centralFrame:RegisterEvent("PLAYER_LOGIN") +centralFrame:RegisterEvent("PLAYER_LEVEL_UP") + centralFrame:SetScript("OnEvent", function(self, event, unit) -- Check if the player changed zone types and we need to change module status, while they are dead -- we won't change their zone type as releasing from an instance will change the zone type without them @@ -1302,9 +1312,18 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) self:UnregisterEvent("PLAYER_UNGHOST") Units:CheckPlayerZone() end + -- They're alive again so they "officially" changed zone types now elseif( event == "PLAYER_UNGHOST" ) then Units:CheckPlayerZone() + + -- Monitor level up + elseif( event == "PLAYER_LEVEL_UP" ) then + if( ShadowUF.Units.unitFrames.player ) then + ShadowUF.Units.unitFrames.player:SetVisibility() + ShadowUF.Units.unitFrames.player:FullUpdate() + end + -- Monitor talent changes elseif( event == "PLAYER_SPECIALIZATION_CHANGED" ) then for frame in pairs(ShadowUF.Units.frameList) do From e0f2ddeee6f48070f9a3e69adbcd717867c3cd05 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Aug 2012 18:38:37 -0700 Subject: [PATCH 207/794] Added curpp/abscurpp/curmaxpp/absolutepp tags for Mistweaver Monks --- modules/tags.lua | 62 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 0c6bd545..0d09aef2 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -796,21 +796,21 @@ Tags.defaultTags = { if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local powerType = UnitPowerType(unit) if( powerType ~= 1 and powerType ~= 3 ) then return nil end - return ShadowUF:FormatLargeNumber(UnitPower(unit, 0)) + return ShadowUF:FormatLargeNumber(UnitPower(unit, SPELL_POWER_MANA)) end]], ["druid:abscurpp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local powerType = UnitPowerType(unit) if( powerType ~= 1 and powerType ~= 3 ) then return nil end - return UnitPower(unit, 0) + return UnitPower(unit, SPELL_POWER_MANA) end]], ["druid:curmaxpp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local powerType = UnitPowerType(unit) if( powerType ~= 1 and powerType ~= 3 ) then return nil end - local maxPower = UnitPowerMax(unit, 0) - local power = UnitPower(unit, 0) + local maxPower = UnitPowerMax(unit, SPELL_POWER_MANA) + local power = UnitPower(unit, SPELL_POWER_MANA) if( UnitIsDeadOrGhost(unit) ) then return string.format("0/%s", ShadowUF:FormatLargeNumber(maxPower)) elseif( maxPower == 0 and power == 0 ) then @@ -821,9 +821,41 @@ Tags.defaultTags = { end]], ["druid:absolutepp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end - local powerType = UnitPowerType(unit) - if( powerType ~= 1 and powerType ~= 3 ) then return nil end - return UnitPower(unit, 0) + if( GetSpecialization() ~= SPEC_MONK_MISTWEAVER ) then return nil end + + return UnitPower(unit, SPELL_POWER_MANA) + end]], + ["monk:curpp"] = [[function(unit, unitOwner) + if( select(2, UnitClass(unit)) ~= "MONK" ) then return nil end + if( GetSpecialization() ~= SPEC_MONK_MISTWEAVER ) then return nil end + + return ShadowUF:FormatLargeNumber(UnitPower(unit, SPELL_POWER_MANA)) + end]], + ["monk:abscurpp"] = [[function(unit, unitOwner) + if( select(2, UnitClass(unit)) ~= "MONK" ) then return nil end + if( GetSpecialization() ~= SPEC_MONK_MISTWEAVER ) then return nil end + + return UnitPower(unit, SPELL_POWER_MANA) + end]], + ["monk:curmaxpp"] = [[function(unit, unitOwner) + if( select(2, UnitClass(unit)) ~= "MONK" ) then return nil end + if( GetSpecialization() ~= SPEC_MONK_MISTWEAVER ) then return nil end + + local maxPower = UnitPowerMax(unit, SPELL_POWER_MANA) + local power = UnitPower(unit, SPELL_POWER_MANA) + if( UnitIsDeadOrGhost(unit) ) then + return string.format("0/%s", ShadowUF:FormatLargeNumber(maxPower)) + elseif( maxPower == 0 and power == 0 ) then + return nil + end + + return string.format("%s/%s", ShadowUF:FormatLargeNumber(power), ShadowUF:FormatLargeNumber(maxPower)) + end]], + ["monk:absolutepp"] = [[function(unit, unitOwner) + if( select(2, UnitClass(unit)) ~= "MONK" ) then return nil end + if( GetSpecialization() ~= SPEC_MONK_MISTWEAVER ) then return nil end + + return UnitPower(unit, SPELL_POWER_MANA) end]], -- ["abs:crtabs"] = [[function(unit, unitOwner, fontString) -- local absorb = fontString.parent.absorb @@ -915,6 +947,10 @@ Tags.defaultEvents = { ["druid:abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", ["druid:curmaxpp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", ["druid:absolutepp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["monk:curpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", + ["monk:abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", + ["monk:curmaxpp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["monk:absolutepp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", ["sshards"] = "UNIT_POWER", ["hpower"] = "UNIT_POWER", ["level"] = "UNIT_LEVEL UNIT_FACTION PLAYER_LEVEL_UP", @@ -1035,6 +1071,10 @@ Tags.defaultCategories = { ["druid:abscurpp"] = "classspec", ["druid:curmaxpp"] = "classspec", ["druid:absolutepp"] = "classspec", + ["monk:curpp"] = "classspec", + ["monk:abscurpp"] = "classspec", + ["monk:curmaxpp"] = "classspec", + ["monk:absolutepp"] = "classspec", ["sshards"] = "classspec", ["hpower"] = "classspec", ["situation"] = "playerthreat", @@ -1123,6 +1163,10 @@ Tags.defaultHelp = { ["druid:abscurpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "abscurpp"), ["druid:curmaxpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "curmaxpp"), ["druid:absolutepp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "absolutepp"), + ["monk:curpp"] = string.format(L["Works the same as [%s], but this is only shown if you are a Mistweaver Monk."], "currpp"), + ["monk:abscurpp"] = string.format(L["Works the same as [%s], but this is only shown if you are a Mistweaver Monk."], "abscurpp"), + ["monk:curmaxpp"] = string.format(L["Works the same as [%s], but this is only shown if you are a Mistweaver Monk."], "curmaxpp"), + ["monk:absolutepp"] = string.format(L["Works the same as [%s], but this is only shown if you are a Mistweaver Monk."], "absolutepp"), ["situation"] = L["Returns text based on your threat situation with your target: Aggro for Aggro, High for being close to taking aggro, and Medium as a general warning to be wary."], ["color:sit"] = L["Returns a color code of the threat situation with your target: Red for Aggro, Orange for High threat and Yellow to be careful."], ["scaled:threat"] = L["Returns a scaled threat percent of your aggro on your current target, always 0 - 100%."], @@ -1211,6 +1255,10 @@ Tags.defaultNames = { ["druid:abscurpp"] = L["Current power (Druid/Absolute)"], ["druid:curmaxpp"] = L["Cur/Max power (Druid)"], ["druid:absolutepp"] = L["Current health (Druid/Absolute)"], + ["monk:curpp"] = L["Current power (Monk)"], + ["monk:abscurpp"] = L["Current power (Monk/Absolute)"], + ["monk:curmaxpp"] = L["Cur/Max power (Monk)"], + ["monk:absolutepp"] = L["Current health (Monk/Absolute)"], ["situation"] = L["Threat situation"], ["color:sit"] = L["Color code for situation"], ["scaled:threat"] = L["Scaled threat percent"], From 2b9afd8908f0d6f3b96e3bd07250a55cb28b7224 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Aug 2012 18:42:21 -0700 Subject: [PATCH 208/794] Added missing upgrade code for powerColors --- ShadowedUnitFrames.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 3a9d16b7..751ea3fd 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -39,7 +39,7 @@ end ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 18 +ShadowUF.dbRevision = 19 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -120,6 +120,11 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + if( revision <= 18 ) then + self.db.profile.powerColors["MUSHROOMS"] = {r = 0.20, g = 0.90, b = 0.20} + self.db.profile.powerColors["STATUE"] = {r = 0.35, g = 0.45, b = 0.60} + end + if( revision <= 17 ) then self.db.profile.units.target.indicators.petBattle = {enabled = true, anchorPoint = "BL", size = 18, x = -6, y = 14, anchorTo = "$parent"} self.db.profile.units.focus.indicators.petBattle = {enabled = false, anchorPoint = "BL", size = 18, x = -6, y = 12, anchorTo = "$parent"} From 84c2593c079dd171bf3b952c68224e9c47f20d77 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Aug 2012 18:45:08 -0700 Subject: [PATCH 209/794] Synced some colors with the default Blizzard ones --- ShadowedUnitFrames.lua | 5 +++-- modules/defaultlayout.lua | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 751ea3fd..c2046c54 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -148,7 +148,7 @@ function ShadowUF:CheckUpgrade() end if( revision <= 14 ) then - self.db.profile.powerColors["CHI"] = {r = 0.0, g = 1.0, b = 0.59} + self.db.profile.powerColors["CHI"] = {r = 0.71, g = 1.0, b = 0.92} self.db.profile.units.player.chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true} end @@ -158,7 +158,7 @@ function ShadowUF:CheckUpgrade() end if( revision <= 12 ) then - self.db.profile.classColors["MONK"] = {r = 0.0, g = 1.00 , b = 0.59} + self.db.profile.classColors["MONK"] = {r = 0.0, g = 1.00, b = 0.59} end if( revision <= 11 ) then @@ -312,6 +312,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.runeBar = {enabled = false} self.defaults.profile.units.player.totemBar = {enabled = false} self.defaults.profile.units.player.druidBar = {enabled = false} + self.defaults.profile.units.player.monkBar = {enabled = false} self.defaults.profile.units.player.xpBar = {enabled = false} self.defaults.profile.units.player.fader = {enabled = false} self.defaults.profile.units.player.soulShards = {enabled = true, isBar = true} diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index a30606e4..c25d6b4c 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -151,7 +151,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) AMMOSLOT = {r = 0.85, g = 0.60, b = 0.55}, FUEL = {r = 0.85, g = 0.47, b = 0.36}, COMBOPOINTS = {r = 1.0, g = 0.80, b = 0.0}, - HOLYPOWER = {r = 0.96, g = 0.55, b = 0.73}, + HOLYPOWER = {r = 0.95, g = 0.90, b = 0.60}, BANKEDHOLYPOWER = {r = 0.96, g = 0.61, b = 0.84}, SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, DEMONICFURY = {r = 0.58, g = 0.51, b = 0.79}, @@ -159,7 +159,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) FULLBURNINGEMBER = {r = 0.88, g = 0.09, b = 0.062}, SHADOWORBS = {r = 0.58, g = 0.51, b = 0.79}, ALTERNATE = {r = 0.71, g = 0.0, b = 1.0}, - CHI = {r = 0.0, g = 1.0, b = 0.59}, + CHI = {r = 0.71, g = 1.0, b = 0.92}, STATUE = {r = 0.35, g = 0.45, b = 0.60}, MUSHROOMS = {r = 0.20, g = 0.90, b = 0.20} } From 388094ab069977358e8d21677adf83fa54af1110 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Aug 2012 18:47:52 -0700 Subject: [PATCH 210/794] Strip out all the absorb code as it will never be used --- modules/incheal.lua | 72 +-------------------------------------------- modules/tags.lua | 21 ------------- options/config.lua | 17 ++--------- 3 files changed, 3 insertions(+), 107 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index f3ed3c00..affff276 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -12,13 +12,7 @@ function IncHeal:OnEnable(frame) frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") end - -- if( ShadowUF.db.profile.units[frame.unitType].incHeal.absorbs ) then - -- frame:RegisterUnitEvent("UNIT_AURA", self, "CalculateAbsorb") - -- frame:RegisterUpdateFunc(self, "CalculateAbsorb") - -- -- Since CalculateAbsorb already calls UpdateFrame, we don't need to explicitly do it - -- else - frame:RegisterUpdateFunc(self, "UpdateFrame") - -- end + frame:RegisterUpdateFunc(self, "UpdateFrame") end function IncHeal:OnDisable(frame) @@ -62,70 +56,6 @@ function IncHeal:OnLayoutApplied(frame) end end --- function IncHeal:EnableTag(frame, fontString) --- if( not frames[frame] ) then frames[frame] = {} end --- --- frames[frame][fontString] = true --- --- -- Need to register the events since we're not watching them by default --- if( not frame.tagEnabled and not ShadowUF.db.profile.units[frame.unitType].incHeal.absorbs ) then --- frame:RegisterUnitEvent("UNIT_AURA", self, "CalculateAbsorb") --- frame:RegisterUpdateFunc(self, "CalculateAbsorb") --- --- -- And unregister the default updater since it's used by default --- if( ShadowUF.db.profileunits[frame.unitType].incHeal.heals ) then --- frame:UnregisterUpdateFunc(self, "UpdateFrame") --- end --- end --- --- frame.tagEnabled = true --- end --- --- function IncHeal:DisableTag(frame, fontString) --- if( not frames[frame] or not frames[frame][fontString] ) then return end --- --- frames[frame][fontString] = nil --- frame.tagEnabled = nil --- for _, _ in pairs(frames[frame]) do --- frame.tagEnabled = true --- break --- end --- --- if( frame.tagEnabled ) then return end --- --- -- Need to unrregister the events since we're not watching them by default --- if( not ShadowUF.db.profile.units[frame.unitType].incHeal.absorbs ) then --- frame:UnregisterUnitEvent("UNIT_AURA", self, "CalculateAbsorb") --- frame:UnregisterUpdateFunc(self, "CalculateAbsorb") --- --- -- Also register the default updater since we used it by default --- if( ShadowUF.db.profileunits[frame.unitType].incHeal.heals ) then --- frame:RegisterUpdateFunc(self, "UpdateFrame") --- end --- end --- end --- --- function IncHeal:CalculateAbsorb(frame) --- frame.absorb = 0 --- --- local index = 0 --- while( true ) do --- index = index + 1 --- local name, _, _, _, _, _, _, _, _, _, _, _, _, absorbAmount = UnitAura(frame.unit, index, "HELPFUL")) --- if( not name ) then break end --- --- --- end --- --- if( frame.tagEnabled ) then --- for fontString, _ in pairs(frames[frame]) do --- fontString:UpdateTags() --- end --- end --- --- self:UpdateFrame(frame) --- end - function IncHeal:UpdateFrame(frame) -- This makes sure that when a heal like Tranquility is cast, it won't show the entire cast but cap it at 4 seconds into the future local healed = UnitGetIncomingHeals(frame.unit) or 0 diff --git a/modules/tags.lua b/modules/tags.lua index 0d09aef2..2700fe07 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -857,18 +857,6 @@ Tags.defaultTags = { return UnitPower(unit, SPELL_POWER_MANA) end]], - -- ["abs:crtabs"] = [[function(unit, unitOwner, fontString) - -- local absorb = fontString.parent.absorb - -- return absorb > 0 and string.format("%d", absorb) - -- ]], - -- ["crtabs"] = [[function(unit, unitOwner, fontString) - -- local absorb = fontString.parent.absorb - -- return absorb > 0 and ShadowUF:FormatLargeNumber(absorb) - -- ]], - -- ["crtabs:name"] = [[function(unit, unitOwner, fontString) - -- local absorb = fontString.parent.absorb - -- return absorb > 0 and string.format("+%d", heal) or ShadowUF.tagFunc.name(unit, unitOwner, fontString) - -- ]], ["per:incheal"] = [[function(unit, unitOwner, fontString) local heal = UnitGetIncomingHeals(unit) local maxHealth = UnitHealthMax(unit) @@ -1008,9 +996,6 @@ Tags.defaultFrequents = { -- Default tag categories Tags.defaultCategories = { - -- ["crtabs"] = "absorb", - -- ["crtabs:name"] = "absorb", - -- ["abs:crtabs"] = "absorb", ["hp:color"] = "health", ["per:incheal"] = "health", ["abs:incheal"] = "health", @@ -1102,9 +1087,6 @@ Tags.defaultHelp = { ["guild"] = L["Show's the units guild name if they are in a guild."], ["short:druidform"] = L["Short version of [druidform], C = Cat, B = Bear, F = Flight and so on."], ["druidform"] = L["Returns the units current form if they are a druid, Cat for Cat Form, Moonkin for Moonkin and so on."], - -- ["crtabs"] = L["Shorten current absorb value, if 13,000 absorb is on a target it will show 13k."], - -- ["abs:crtabs"] = L["Absolute current absorb value, if 15,000 absorb is on a target it will show 15,000."], - -- ["crtabs:name"] = L["If the unit has absorbs on them, it will show the absolute absorb value, otherwise it will show the units name."], ["per:incheal"] = L["Percent of the players current health that's being healed, if they have 100,000 total health and 15,000 is incoming then 15% is shown."], ["abs:incheal"] = L["Absolute incoming heal value, if 10,000 healing is incoming it will show 10,000."], ["incheal"] = L["Shorten incoming heal value, if 13,000 healing is incoming it will show 13k."], @@ -1196,9 +1178,6 @@ Tags.defaultNames = { ["guild"] = L["Guild name"], ["druidform"] = L["Druid form"], ["short:druidform"] = L["Druid form (Short)"], - -- ["abs:crtabs"] = L["Current absorb (Absolute)"], - -- ["crtabs"] = L["Current absorb (Short)"], - -- ["crtabs:name"] = L["Current absorb/Name"], ["abs:incheal"] = L["Incoming heal (Absolute)"], ["incheal"] = L["Incoming heal (Short)"], ["abbrev:name"] = L["Name (Abbreviated)"], diff --git a/options/config.lua b/options/config.lua index 887b87be..5935e2ec 100755 --- a/options/config.lua +++ b/options/config.lua @@ -44,7 +44,7 @@ local INDICATOR_DESC = { ["raidTarget"] = L["Raid target indicator."], ["ready"] = L["Ready status of group members."], ["phase"] = L["Shows when a party member is in a different phase or another group."], ["questBoss"] = L["Shows that a NPC is a boss for a quest."], ["petBattle"] = L["Shows what kind of pet the unit is for pet battles."], ["role"] = L["Raid role indicator, adds a shield indicator for main tanks and a sword icon for main assists."], ["status"] = L["Status indicator, shows if the unit is currently in combat. For the player it will also show if you are rested."], ["class"] = L["Class icon for players."]} -local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"], ["absorb"] = L["Absorb"], ["classspec"] = L["Class Specific"]} +local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"], ["classspec"] = L["Class Specific"]} local pointPositions = {["BOTTOM"] = L["Bottom"], ["TOP"] = L["Top"], ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["TOPLEFT"] = L["Top Left"], ["TOPRIGHT"] = L["Top Right"], ["BOTTOMLEFT"] = L["Bottom Left"], ["BOTTOMRIGHT"] = L["Bottom Right"], ["CENTER"] = L["Center"]} local positionList = {["C"] = L["Center"], ["RT"] = L["Right Top"], ["RC"] = L["Right Center"], ["RB"] = L["Right Bottom"], ["LT"] = L["Left Top"], ["LC"] = L["Left Center"], ["LB"] = L["Left Bottom"], ["BL"] = L["Bottom Left"], ["BC"] = L["Bottom Center"], ["BR"] = L["Bottom Right"], ["TR"] = L["Top Right"], ["TC"] = L["Top Center"], ["TL"] = L["Top Left"]} @@ -3790,7 +3790,6 @@ local function loadUnitOptions() order = 3, type = "group", inline = true, - -- name = L["Incoming heals and absorbs"], name = L["Incoming heals"], hidden = hideRestrictedOption, disabled = function(info) return not getVariable(info[2], "healthBar", nil, "enabled") end, @@ -3804,21 +3803,9 @@ local function loadUnitOptions() hidden = false, set = function(info, value) setUnit(info, value) - setDirectUnit(info[2], "incHeal", nil, "enabled", getVariable(info[2], "incHeal", nil, "absorbs") or getVariable(info[2], "incHeal", nil, "heals")) + setDirectUnit(info[2], "incHeal", nil, "enabled", getVariable(info[2], "incHeal", nil, "heals")) end }, - -- absorbs = { - -- order = 2, - -- type = "toggle", - -- name = L["Show current absorbs"], - -- desc = L["Adds a bar inside the health bar indicating how much damage absorbed they have."], - -- arg = "incHeal.absorbs", - -- hidden = false, - -- set = function(info, value) - -- setUnit(info, value) - -- setDirectUnit(info[2], "incHeal", nil, "enabled", getVariable(info[2], "incHeal", nil, "absorbs") or getVariable(info[2], "incHeal", nil, "heals")) - -- end - -- }, cap = { order = 3, type = "range", From 1561832f5b468c0774157c0498ea670f82b2538d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Aug 2012 19:04:38 -0700 Subject: [PATCH 211/794] Redo hiding of compact party frames - Removed all of the noop calls on :Show() for hiding Blizzard frames to see if it's necessary, and if it reduces taint issues --- ShadowedUnitFrames.lua | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index c2046c54..9e464604 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -487,7 +487,6 @@ ShadowUF.noop = function() end local active_hiddens = {} function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.runes and not active_hiddens.runes ) then - RuneFrame.Show = self.noop RuneFrame:Hide() RuneFrame:UnregisterAllEvents() end @@ -503,27 +502,19 @@ function ShadowUF:HideBlizzardFrames() local frame = _G[name] frame:UnregisterAllEvents() - frame.Show = self.noop frame:Hide() _G[name .. "HealthBar"]:UnregisterAllEvents() _G[name .. "ManaBar"]:UnregisterAllEvents() end - local function hideCompactParty() - CompactPartyFrame:UnregisterAllEvents() - CompactPartyFrame.Show = ShadowUF.noop - CompactPartyFrame:Hide() - - for i=1, MEMBERS_PER_RAID_GROUP do - _G["CompactPartyFrameMember" .. i]:UnregisterAllEvents() - end - end + -- This stops the compact party frame from being shown + UIParent:UnregisterEvent("GROUP_ROSTER_UPDATE") + -- This just makes sure if( CompactPartyFrame ) then - hideCompactParty() - elseif( CompactPartyFrame_Generate ) then - hooksecurefunc("CompactPartyFrame_Generate", hideCompactParty) + CompactPartyFrame:UnregisterAllEvents() + CompactPartyFrame:Hide() end end @@ -551,17 +542,13 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.buffs and not active_hiddens.buffs ) then BuffFrame:UnregisterAllEvents() - BuffFrame.Show = self.noop BuffFrame:Hide() - ConsolidatedBuffs.Show = self.noop - ConsolidatedBuffs:Hide() - TemporaryEnchantFrame.Show = self.noop TemporaryEnchantFrame:Hide() + ConsolidatedBuffs:Hide() end if( ShadowUF.db.profile.hidden.player and not active_hiddens.player ) then PlayerFrame:UnregisterAllEvents() - PlayerFrame.Show = self.noop PlayerFrame:Hide() -- We keep these in case someone is still using the default auras, otherwise it messes up vehicle stuff @@ -579,7 +566,6 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.pet and not active_hiddens.pet ) then PetFrame:UnregisterAllEvents() - PetFrame.Show = self.noop PetFrame:Hide() PetFrameHealthBar:UnregisterAllEvents() @@ -588,7 +574,6 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.target and not active_hiddens.target ) then TargetFrame:UnregisterAllEvents() - TargetFrame.Show = self.noop TargetFrame:Hide() TargetFrameHealthBar:UnregisterAllEvents() @@ -596,13 +581,11 @@ function ShadowUF:HideBlizzardFrames() TargetFrameSpellBar:UnregisterAllEvents() ComboFrame:UnregisterAllEvents() - ComboFrame.Show = self.noop ComboFrame:Hide() end if( ShadowUF.db.profile.hidden.focus and not active_hiddens.focus ) then FocusFrame:UnregisterAllEvents() - FocusFrame.Show = self.noop FocusFrame:Hide() FocusFrameHealthBar:UnregisterAllEvents() @@ -616,7 +599,6 @@ function ShadowUF:HideBlizzardFrames() local frame = _G[name] frame:UnregisterAllEvents() - frame.Show = self.noop frame:Hide() _G[name .. "HealthBar"]:UnregisterAllEvents() From f3716255a8cdb2493e754cea4bec037a0a187d4f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Aug 2012 19:15:37 -0700 Subject: [PATCH 212/794] Enable Mushroom bar for Resto spec too --- modules/totems.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/totems.lua b/modules/totems.lua index 0dad0922..341b97f5 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -9,7 +9,7 @@ if( playerClass == "DEATHKNIGHT" ) then ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Guardian bar"], true, "DEATHKNIGHT", {1, 2}, 55) elseif( playerClass == "DRUID" ) then MAX_TOTEMS = 3 - ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Mushroom bar"], true, "DRUID", {1}, 84) + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Mushroom bar"], true, "DRUID", {1, 4}, 84) elseif( playerClass == "MONK" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Statue bar"], true, "MONK", {1, 2}, 70) From e4fbfbde58152588cb194707ce968847bb4bd70f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Aug 2012 19:20:12 -0700 Subject: [PATCH 213/794] Fixed enable logic being flipped --- modules/units.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 6a3f09e2..42c68a89 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -249,12 +249,11 @@ local function SetVisibility(self) -- Restrict by level if( module.moduleLevel and enabled and self.unitType == "player" ) then - if( UnitLevel("player") > module.moduleLevel ) then + if( UnitLevel("player") < module.moduleLevel ) then enabled = nil end end - - + -- Module isn't enabled all the time, only in this zone so we need to force it to be enabled if( not self.visibility[key] and enabled ) then module:OnEnable(self) From 6c8a591fa2be86efaf2b09ecbf90274a67abce32 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 22 Aug 2012 11:30:07 -0700 Subject: [PATCH 214/794] Fixed spec disabling not working for modules that are on a single spec --- ShadowedUnitFrames.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 9e464604..03466c82 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -423,7 +423,8 @@ function ShadowUF:RegisterModule(module, key, name, isBar, class, spec, level) module.moduleLevel = level if( type(spec) == "number" ) then - module.moduleSpec = {spec = true} + module.moduleSpec = {} + module.moduleSpec[spec] = true elseif( type(spec) == "table" ) then module.moduleSpec = {} for _, id in pairs(spec) do From 0ce7d106451231934f0f07ff1cc5396d27657532 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 23 Aug 2012 09:04:02 -0700 Subject: [PATCH 215/794] Fixed block layering for burning embers and rune bars, and fixed a mystery ember showing up if you swapped between 3/4 embers --- modules/burningembers.lua | 6 ++---- modules/runes.lua | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/burningembers.lua b/modules/burningembers.lua index 08f6b232..68763968 100755 --- a/modules/burningembers.lua +++ b/modules/burningembers.lua @@ -12,9 +12,7 @@ function Embers:OnEnable(frame) frame.burningEmbersBar.embers = {} for id=1, 4 do - local ember = ShadowUF.Units:CreateBar(frame) - ember:SetFrameLevel(1) - + local ember = ShadowUF.Units:CreateBar(frame.burningEmbersBar) if( id > 1 ) then ember:SetPoint("TOPLEFT", frame.burningEmbersBar.embers[id - 1], "TOPRIGHT", 1, 0) @@ -83,7 +81,7 @@ function Embers:UpdateBarBlocks(frame, event, unit, powerType) ember:Show() end - for id=max+1, max do + for id=max+1, #(frame.burningEmbersBar.embers) do frame.burningEmbersBar.embers[id]:Hide() end diff --git a/modules/runes.lua b/modules/runes.lua index d7c9dbda..2b911342 100755 --- a/modules/runes.lua +++ b/modules/runes.lua @@ -11,8 +11,7 @@ function Runes:OnEnable(frame) frame.runeBar.runes = {} for id=1, 6 do - local rune = ShadowUF.Units:CreateBar(frame) - rune:SetFrameLevel(1) + local rune = ShadowUF.Units:CreateBar(frame.runeBar) if( id > 1 ) then rune:SetPoint("TOPLEFT", frame.runeBar.runes[RUNE_MAP[id - 1]], "TOPRIGHT", 1, 0) From d4d6b81a48ff96ade9615c70ada9233d0f4b5e90 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 27 Aug 2012 08:49:16 -0700 Subject: [PATCH 216/794] Remove the not-on-5.0.1 warning dialog --- ShadowedUnitFrames.lua | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 03466c82..4949559a 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -2,41 +2,6 @@ Shadowed Unit Frames, Shadow of Mal'Ganis (US) PvP ]] -if( select(4, GetBuildInfo()) < 50001 ) then - local frame = CreateFrame("Frame", nil, UIParent) - frame:SetClampedToScreen(true) - frame:SetFrameStrata("TOOLTIP") - frame:SetWidth(400) - frame:SetHeight(100) - frame:SetBackdrop({ - bgFile = "Interface\\ChatFrame\\ChatFrameBackground", - edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", - edgeSize = 26, - insets = {left = 9, right = 9, top = 9, bottom = 9}, - }) - frame:SetBackdropColor(0, 0, 0, 0.85) - frame:SetPoint("CENTER", UIParent, "CENTER", 0, 0) - - frame.titleBar = frame:CreateTexture(nil, "ARTWORK") - frame.titleBar:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header") - frame.titleBar:SetPoint("TOP", 0, 8) - frame.titleBar:SetWidth(350) - frame.titleBar:SetHeight(45) - - frame.title = frame:CreateFontString(nil, "ARTWORK", "GameFontNormal") - frame.title:SetPoint("TOP", 0, 0) - frame.title:SetText("Shadowed Unit Frames") - - frame.text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") - frame.text:SetText(select(2, ...).L["This version of Shadowed Unit Frames is ONLY for 5.0.1 and higher.|n|nIf you are auto downloading alpha releases, stop that.|n|nYou are not missing out, the next stable release of SUF will be with 5.0.1/MoP."]) - frame.text:SetPoint("TOPLEFT", 12, -22) - frame.text:SetWidth(frame:GetWidth() - 20) - frame.text:SetJustifyH("LEFT") - - frame:SetScale(2) - return -end - ShadowUF = select(2, ...) local L = ShadowUF.L ShadowUF.dbRevision = 19 From cee77fc23addb50acda70d0d7686996163008513 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 27 Aug 2012 10:30:37 -0700 Subject: [PATCH 217/794] Enable altPowerBar by default for vehicles --- ShadowedUnitFrames.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 4949559a..afabf674 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -288,7 +288,9 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.shadowOrbs = {enabled = true, isBar = true} self.defaults.profile.units.player.chi = {enabled = true, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} - -- PET + -- VEHICLE + self.defaults.profile.units.vehicle.altPowerBar.enabled = true + -- PET self.defaults.profile.units.pet.enabled = true self.defaults.profile.units.pet.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} self.defaults.profile.units.pet.xpBar = {enabled = false} From 09d41669207d79bf4100e9c3b9564034e6173253 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 27 Aug 2012 10:33:00 -0700 Subject: [PATCH 218/794] Pets not vehnicle actually: --- ShadowedUnitFrames.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index afabf674..5ae32ac4 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -288,13 +288,12 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.shadowOrbs = {enabled = true, isBar = true} self.defaults.profile.units.player.chi = {enabled = true, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} - -- VEHICLE - self.defaults.profile.units.vehicle.altPowerBar.enabled = true -- PET self.defaults.profile.units.pet.enabled = true self.defaults.profile.units.pet.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} self.defaults.profile.units.pet.xpBar = {enabled = false} - -- FOCUS + self.defaults.profiel.units.pet.altPowerBar.enabled = true + -- FOCUS self.defaults.profile.units.focus.enabled = true self.defaults.profile.units.focus.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} self.defaults.profile.units.focus.indicators.lfdRole = {enabled = false, size = 0, x = 0, y = 0} From b3572d531ca3f46955b8b1b0cfe0ecf064b9e1a3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 27 Aug 2012 10:33:24 -0700 Subject: [PATCH 219/794] Typos bad --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 5ae32ac4..f9f8237e 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -292,7 +292,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.pet.enabled = true self.defaults.profile.units.pet.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} self.defaults.profile.units.pet.xpBar = {enabled = false} - self.defaults.profiel.units.pet.altPowerBar.enabled = true + self.defaults.profile.units.pet.altPowerBar.enabled = true -- FOCUS self.defaults.profile.units.focus.enabled = true self.defaults.profile.units.focus.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} From f7fa4a9bbbc44468010ccf7bf207b89fb794d2b1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 28 Aug 2012 08:18:09 -0700 Subject: [PATCH 220/794] One of these days I'll remember to bump the TOC for options --- options/ShadowedUF_Options.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index d69a5d0b..92ece87a 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 40300 +## Interface: 50001 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From 92e36df57e6d366a40ab7d1dc6b54a69b7068dbe Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 28 Aug 2012 21:40:07 -0700 Subject: [PATCH 221/794] Disable prep frame hider --- modules/units.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 42c68a89..fd7455c8 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1088,7 +1088,7 @@ function Units:LoadZoneHeader(type) -- stealths the frame will hide which looks bad. Instead force it to stay open and it has to be manually hidden when the player leaves an arena. if( type == "arena" ) then frame:SetAttribute("unitID", id) - frame:SetFrameRef("prepframe", _G["ArenaPrepFrame" .. id]) + -- frame:SetFrameRef("prepframe", _G["ArenaPrepFrame" .. id]) frame.hasStateWatch = true stateMonitor:WrapScript(frame, "OnAttributeChanged", [[ @@ -1102,7 +1102,7 @@ function Units:LoadZoneHeader(type) end if( value ) then - self:GetFrameRef("prepframe"):Hide() + -- self:GetFrameRef("prepframe"):Hide() self:Show() end end From 0583d454492126cac8788ac21a58aa8b5c612c78 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 29 Aug 2012 09:02:03 -0700 Subject: [PATCH 222/794] Fallback on our default unit filtering for events for header units, as it's not sanely possible to use them right now --- modules/units.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index fd7455c8..7f855f89 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1,10 +1,11 @@ -local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}, canCure = {}} +local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}} Units.childUnits = {["partytarget"] = "party", ["partypet"] = "party", ["maintanktarget"] = "maintank", ["mainassisttarget"] = "mainassist", ["bosstarget"] = "boss", ["arenatarget"] = "arena", ["arenapet"] = "arena"} Units.zoneUnits = {["arena"] = "arena", ["boss"] = "raid"} +Units.headerUnits = {["raid"] = true, ["party"] = true, ["maintank"] = true, ["mainassist"] = true, ["raidpet"] = true, ["partypet"] = true} local stateMonitor = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") local playerClass = select(2, UnitClass("player")) -local unitFrames, headerFrames, frameList, unitEvents, childUnits, queuedCombat, canCure = Units.unitFrames, Units.headerFrames, Units.frameList, Units.unitEvents, Units.childUnits, {}, Units.canCure +local unitFrames, headerFrames, frameList, unitEvents, childUnits, headerUnits, queuedCombat = Units.unitFrames, Units.headerFrames, Units.frameList, Units.unitEvents, Units.childUnits, Units.headerUnits, {} local _G = getfenv(0) ShadowUF.Units = Units @@ -40,7 +41,7 @@ local function RegisterNormalEvent(self, event, handler, func) return end - if( unitEvents[event] and not ShadowUF.fakeUnits[self.unitRealType] ) then + if( unitEvents[event] and not ShadowUF.fakeUnits[self.unitRealType] and not headerUnits[self.unitRealType] ) then self:BlizzRegisterUnitEvent(event, self.unitOwner, self.vehicleUnit) else self:RegisterEvent(event) From b825985eecb54b5270d81619ec58db75ee3c1d00 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 29 Aug 2012 10:43:41 -0700 Subject: [PATCH 223/794] Remove the last bit of the canCure setup and enable the filter again --- modules/auras.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 9ec4f5c5..95cc29fe 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -2,7 +2,6 @@ local Auras = {} local stealableColor = {r = 1, g = 1, b = 1} local playerUnits = {player = true, vehicle = true, pet = true} local mainHand, offHand, ranged, tempEnchantScan = {time = 0}, {time = 0}, {time = 0} -local canCure = ShadowUF.Units.canCure ShadowUF:RegisterModule(Auras, "auras", ShadowUF.L["Auras"]) function Auras:OnEnable(frame) @@ -306,7 +305,7 @@ local function updateGroup(self, type, config, reverseConfig) -- This is a bit of an odd filter, when used with a HELPFUL filter, it will only return buffs you can cast on group members -- When used with HARMFUL it will only return debuffs you can cure - if( config.raid and group.type == "buffs" ) then + if( config.raid ) then group.filter = group.filter .. "|RAID" end @@ -485,7 +484,6 @@ local function scan(parent, frame, type, config, displayConfig, filter) if( frame.totalAuras >= frame.maxAuras or not config.enabled ) then return end local isFriendly = UnitIsFriend(frame.parent.unit, "player") - local curable = (isFriendly and type == "debuffs" and config.raid) local index = 0 local cureType while( true ) do @@ -496,7 +494,7 @@ local function scan(parent, frame, type, config, displayConfig, filter) -- Blizzard bug, Enrage is an empty string. cureType = auraType == "" and "Enrage" or auraType - if( ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and ( parent.whitelist[name] or parent.whitelist[spellID] ) or parent.blacklist[type] and ( not parent.blacklist[name] and not parent.blacklist[spellID] ) ) and ( not curable or canCure[auraType] ) ) then + if( ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and ( parent.whitelist[name] or parent.whitelist[spellID] ) or parent.blacklist[type] and ( not parent.blacklist[name] and not parent.blacklist[spellID] ) ) ) then -- Create any buttons we need frame.totalAuras = frame.totalAuras + 1 if( #(frame.buttons) < frame.totalAuras ) then From dd592bcd84c761875bcc1bf7616956c117723c08 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 29 Aug 2012 12:39:25 -0700 Subject: [PATCH 224/794] Increased the height of the default demonic power bar slightly Added a new domnic power text since it's important enough to need it Force enable altPowerBar for pets --- ShadowedUnitFrames.lua | 9 +++++++-- modules/defaultlayout.lua | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index f9f8237e..e35442c4 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 19 +ShadowUF.dbRevision = 20 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -85,6 +85,11 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + if( revision <= 19 ) then + self.db.profile.units.pet.altPowerBar.enabled = true + table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[warlock:demonic:curpp]", anchorTo = "$demonicFuryBar", anchorPoint = "C", size = -1, x = 0, y = 0}) + end + if( revision <= 18 ) then self.db.profile.powerColors["MUSHROOMS"] = {r = 0.20, g = 0.90, b = 0.20} self.db.profile.powerColors["STATUE"] = {r = 0.35, g = 0.45, b = 0.60} @@ -227,7 +232,7 @@ function ShadowUF:LoadUnitDefaults() {enabled = true, name = L["Right text"], text = "[curmaxhp]", anchorPoint = "C", anchorTo = "$healthBar", size = 0}, {enabled = true, name = L["Left text"], text = "[level] [race]", anchorPoint = "C", anchorTo = "$powerBar", size = 0}, {enabled = true, name = L["Right text"], text = "[curmaxpp]", anchorPoint = "C", anchorTo = "$powerBar", size = 0}, - {enabled = true, name = L["Text"], text = "", anchorTo = "$emptyBar", anchorPoint = "C", size = 0, x = 0, y = 0}, + {enabled = true, name = L["Text"], text = "", anchorTo = "$emptyBar", anchorPoint = "C", size = 0, x = 0, y = 0} }, indicators = {raidTarget = {enabled = true, size = 0}}, highlight = {}, diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index c25d6b4c..4a6d1dee 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -228,6 +228,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) {width = 0.60, name = L["Right text"], anchorTo = "$powerBar", anchorPoint = "CRI", x = -3, y = 0, size = 0}, {width = 1, name = L["Text"], anchorTo = "$emptyBar", anchorPoint = "CLI", x = 3, y = 0, size = 0}, + + {enabled = true, width = 1, name = L["Text"], anchorTo = "$demonicFuryBar", anchorPoint = "C", x = 3, y = 0, size = -1}, }, indicators = { raidTarget = {anchorTo = "$parent", anchorPoint = "C", size = 20, x = 0, y = 0}, @@ -321,7 +323,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, eclipseBar = {enabled = true, background = true, order = 70, height = 0.40}, - demonicFuryBar = {enabled = true, background = false, height = 0.40, order = 70}, + demonicFuryBar = {enabled = true, background = false, height = 0.50, order = 70}, burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70}, soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, From 957064fd5328ce733f61066afd79dd52da48bed9 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 29 Aug 2012 16:24:08 -0700 Subject: [PATCH 225/794] Reset portrait positioning --- modules/portrait.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/portrait.lua b/modules/portrait.lua index 5512d21e..c30b533a 100755 --- a/modules/portrait.lua +++ b/modules/portrait.lua @@ -84,6 +84,7 @@ function Portrait:Update(frame, event) else frame.portrait:SetUnit(frame.unitOwner) frame.portrait:SetPortraitZoom(1) + frame.portrait:SetPosition(0, 0, 0) frame.portrait:Show() end end From cdcff780a299d4616376b0faf55adcffa3262a83 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 30 Aug 2012 07:29:24 -0700 Subject: [PATCH 226/794] Verify that a player has a spell before using it, if they don't, fall back on the normal setup --- modules/range.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/range.lua b/modules/range.lua index e36bb5a2..1c4cf1ae 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -50,7 +50,10 @@ end function Range:OnLayoutApplied(frame) hostileSpell = ShadowUF.db.profile.range["hostile" .. playerClass] or self.hostile[playerClass] - friendlySpell = ShadowUF.db.profile.range["friendly" .. playerClass] or self.friendly[playerClass] + if( not GetSpellInfo(hostileSpell) ) then hostileSpell = nil end + + friendlySpell = ShadowUF.db.profile.range["friendly" .. playerClass] or self.friendly[playerClass] + if( not GetSpellInfo(friendlySpell) ) then friendlySpell = nil end end function Range:OnDisable(frame) From f470f119eabf8d25bc66717294083fe2e2199765 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 30 Aug 2012 08:27:59 -0700 Subject: [PATCH 227/794] Alt power bars are now enabled by default on all units, also redid the alt power checks to be more inline with how Blizzards function (and color) --- ShadowedUnitFrames.lua | 20 +++++++++++++++----- modules/altpower.lua | 38 +++++++++++++++++++++++++++++--------- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index e35442c4..e223808b 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 20 +ShadowUF.dbRevision = 21 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -84,7 +84,18 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 - + + if( revision <= 20 ) then + self.db.profile.powerColors["ALTERNATE"] = {r = 0.71, g = 0.0, b = 1.0} + + for _, unit in pairs(self.unitList) do + self.db.profile.units[unit].altPowerBar.enabled = true + self.db.profile.units[unit].altPowerBar.background = true + self.db.profile.units[unit].altPowerBar.height = 0.40 + self.db.profile.units[unit].altPowerBar.order = 100 + end + end + if( revision <= 19 ) then self.db.profile.units.pet.altPowerBar.enabled = true table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[warlock:demonic:curpp]", anchorTo = "$demonicFuryBar", anchorPoint = "C", size = -1, x = 0, y = 0}) @@ -186,7 +197,7 @@ end function ShadowUF:LoadUnits() -- CanHearthAndResurrectFromArea() returns true for world pvp areas, according to BattlefieldFrame.lua local instanceType = CanHearthAndResurrectFromArea() and "pvp" or select(2, IsInInstance()) - if( not instanceType ) then instanceType = "none" end + if( not instanceType ) then instanceType = "none" end for _, type in pairs(self.unitList) do local enabled = self.db.profile.units[type].enabled @@ -271,7 +282,7 @@ function ShadowUF:LoadUnitDefaults() end end - self.defaults.profile.units[unit].altPowerBar = {enabled = false} + self.defaults.profile.units[unit].altPowerBar = {enabled = true} end -- PLAYER @@ -297,7 +308,6 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.pet.enabled = true self.defaults.profile.units.pet.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} self.defaults.profile.units.pet.xpBar = {enabled = false} - self.defaults.profile.units.pet.altPowerBar.enabled = true -- FOCUS self.defaults.profile.units.focus.enabled = true self.defaults.profile.units.focus.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} diff --git a/modules/altpower.lua b/modules/altpower.lua index c72a016b..e98edbaa 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -8,25 +8,45 @@ function AltPower:OnEnable(frame) frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", self, "UpdateVisibility") frame:RegisterUnitEvent("UNIT_POWER_BAR_HIDE", self, "UpdateVisibility") + frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdateVisibility") frame:RegisterUpdateFunc(self, "UpdateVisibility") end -function AltPower:OnLayoutApplied(frame) - if( frame.visibility.altPowerBar ) then - local color = ShadowUF.db.profile.powerColors.ALTERNATE - frame.altPowerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) - end -end - function AltPower:OnDisable(frame) frame:UnregisterAll(self) end +local altColor = {} function AltPower:UpdateVisibility(frame) - local barType, minPower, _, _, _, hideFromOthers = UnitAlternatePowerInfo(frame.unit) - local visible = barType and ( frame.unitType == "player" or not hideFromOthers ) + local barType, minPower, _, _, _, hideFromOthers, showOnRaid = UnitAlternatePowerInfo(frame.unit) + local visible = false + if( barType ) then + if( ( frame.unitType == "player" or frame.unitType == "pet" ) or not hideFromOthers ) then + visible = true + elseif( showOnRaid and ( UnitInRaid(frame.unit) or UnitInParty(frame.unit) ) ) then + visible = true + end + end + ShadowUF.Layout:SetBarVisibility(frame, "altPowerBar", visible) + + local color = ShadowUF.db.profile.powerColors.ALTERNATE + if( not showOnRaid ) then + local powerType, powerToken, altR, altG, altB = UnitPowerType(frame.unit) + if( ShadowUF.db.profile.powerColors[powerToken] ) then + color = ShadowUF.db.profile.powerColors[powerToken] + elseif( altR ) then + altColor.r, altColor.g, altColor.b = altR, altG, altB + color = altColor + else + color = ShadowUF.db.profile.colors.MANA + end + end + + frame.altPowerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) + + AltPower:Update(frame, nil, nil, "ALTERNATE") end From 375da76b6d0588bc96f007d563699460f8f8f73b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 30 Aug 2012 08:32:58 -0700 Subject: [PATCH 228/794] Typo in colors --- modules/altpower.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index e98edbaa..65198be6 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -30,6 +30,8 @@ function AltPower:UpdateVisibility(frame) end ShadowUF.Layout:SetBarVisibility(frame, "altPowerBar", visible) + + if( not visible ) then return end local color = ShadowUF.db.profile.powerColors.ALTERNATE if( not showOnRaid ) then @@ -40,7 +42,7 @@ function AltPower:UpdateVisibility(frame) altColor.r, altColor.g, altColor.b = altR, altG, altB color = altColor else - color = ShadowUF.db.profile.colors.MANA + color = ShadowUF.db.profile.powerColors.MANA end end From d0a0dbecf1e3103064fe347d0797ed4e3c50da61 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 30 Aug 2012 08:47:13 -0700 Subject: [PATCH 229/794] MoP change for UNIT_COMBO_POINTS only returning on player unit was reverted apparently, so revert the change for that --- modules/combopoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index d62073b5..68699b43 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -147,7 +147,7 @@ end function Combo:Update(frame, event, unit) -- MoP changed UNIT_COMBO_POINTS so that unit is now player even if it's done on the target - if( event and unit ~= "player" ) then return end + --if( event and unit ~= "player" ) then return end -- For Malygos dragons, they also self cast their CP on themselves, which is why we check CP on ourself! local playerUnit = UnitHasVehicleUI("player") and "vehicle" or "player" From e262a27e9f47b3eeaf9c86875d810c2a13ab4a2b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 30 Aug 2012 11:06:14 -0700 Subject: [PATCH 230/794] Unregister events from CompactRaidFrameContainer when hiding raid frame --- ShadowedUnitFrames.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index e223808b..42a91dd9 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -503,6 +503,7 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.raid and not active_hiddens.raid ) then local function hideRaid() CompactRaidFrameManager:UnregisterAllEvents() + CompactRaidFrameContainer:UnregisterAllEvents() if( not InCombatLockdown() ) then CompactRaidFrameManager:Hide() end local shown = CompactRaidFrameManager_GetSetting("IsShown") From e5d34c6914409fe8c2ffd98b9b1ad093aea440f1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 30 Aug 2012 11:10:33 -0700 Subject: [PATCH 231/794] Fix range indicators for players --- modules/range.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/range.lua b/modules/range.lua index 1c4cf1ae..4c967c02 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -12,6 +12,11 @@ local function checkRange(self, elapsed) self.timeElapsed = self.timeElapsed + elapsed if( self.timeElapsed <= 0.50 ) then return end self.timeElapsed = 0 + + -- Bypass any checks if it's the player + if( UnitIsPlayer(frame.unit) ) then + return self.parent:SetRangeAlpha(ShadowUF.db.profile.units[frame.unitType].range.inAlpha) + end local frame = self.parent local spell From 1778770e4e71b68b4786624d44b45f42a650814e Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 30 Aug 2012 11:19:12 -0700 Subject: [PATCH 232/794] Typo --- modules/range.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index 4c967c02..998de091 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -14,8 +14,8 @@ local function checkRange(self, elapsed) self.timeElapsed = 0 -- Bypass any checks if it's the player - if( UnitIsPlayer(frame.unit) ) then - return self.parent:SetRangeAlpha(ShadowUF.db.profile.units[frame.unitType].range.inAlpha) + if( UnitIsPlayer(self.parent.unit) ) then + return self.parent:SetRangeAlpha(ShadowUF.db.profile.units[self.parent.unitType].range.inAlpha) end local frame = self.parent From efdb9778ac3d46e1459513566a72306e2a7e8896 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 30 Aug 2012 11:50:36 -0700 Subject: [PATCH 233/794] Wrong method --- modules/range.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/range.lua b/modules/range.lua index 998de091..7dd6025c 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -14,7 +14,7 @@ local function checkRange(self, elapsed) self.timeElapsed = 0 -- Bypass any checks if it's the player - if( UnitIsPlayer(self.parent.unit) ) then + if( UnitIsUnit(self.parent.unit, "player") ) then return self.parent:SetRangeAlpha(ShadowUF.db.profile.units[self.parent.unitType].range.inAlpha) end From f4b683ff5f4e45d356069fc08712c8c4a31672fa Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 30 Aug 2012 14:30:45 -0700 Subject: [PATCH 234/794] Go back to the destructive hook on the party frames to keep them hidden --- ShadowedUnitFrames.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 42a91dd9..eb87628e 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -484,6 +484,7 @@ function ShadowUF:HideBlizzardFrames() local frame = _G[name] frame:UnregisterAllEvents() + frame.Show = self.noop frame:Hide() _G[name .. "HealthBar"]:UnregisterAllEvents() From 8313793e04e317d421d6f927261f7ebe633aa98a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 30 Aug 2012 16:49:09 -0700 Subject: [PATCH 235/794] Fixed frame level issue with totems --- modules/totems.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/totems.lua b/modules/totems.lua index 341b97f5..012aabc6 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -26,7 +26,6 @@ function Totems:OnEnable(frame) for id=1, MAX_TOTEMS do local totem = ShadowUF.Units:CreateBar(frame) - totem:SetFrameLevel(1) totem:SetMinMaxValues(0, 1) totem:SetValue(0) totem.id = MAX_TOTEMS == 1 and 1 or priorities[id] From e2b40e2dc4bc6c0c8d915393ea47b8621073dd02 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 31 Aug 2012 09:09:59 -0700 Subject: [PATCH 236/794] Check against the primary unit type and not the real type --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 7f855f89..63045345 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -41,7 +41,7 @@ local function RegisterNormalEvent(self, event, handler, func) return end - if( unitEvents[event] and not ShadowUF.fakeUnits[self.unitRealType] and not headerUnits[self.unitRealType] ) then + if( unitEvents[event] and not ShadowUF.fakeUnits[self.unitRealType] and not headerUnits[self.unitType] ) then self:BlizzRegisterUnitEvent(event, self.unitOwner, self.vehicleUnit) else self:RegisterEvent(event) From fb7e65b4352e7f127ea20f40322deff9c8c1e43e Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 3 Sep 2012 10:45:58 -0700 Subject: [PATCH 237/794] Remove the ability to hide the rune bar, and change it to a generic system that hides Eclipse/Shard/Rune/Totme/Paladin/Monk/Priest/Warlock bars --- ShadowedUnitFrames.lua | 20 +++++++++++--------- options/config.lua | 4 ++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index eb87628e..5cd65e9f 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -37,7 +37,7 @@ function ShadowUF:OnInitialize() range = {}, filters = {zonewhite = {}, zoneblack = {}, whitelists = {}, blacklists = {}}, visibility = {arena = {}, pvp = {}, party = {}, raid = {}}, - hidden = {cast = false, runes = true, buffs = false, party = true, raid = false, player = true, pet = true, target = true, focus = true, boss = true, arena = true, playerAltPower = false}, + hidden = {cast = false, playerPower = true, buffs = false, party = true, raid = false, player = true, pet = true, target = true, focus = true, boss = true, arena = true, playerAltPower = false}, }, } @@ -468,11 +468,6 @@ ShadowUF.noop = function() end local active_hiddens = {} function ShadowUF:HideBlizzardFrames() - if( ShadowUF.db.profile.hidden.runes and not active_hiddens.runes ) then - RuneFrame:Hide() - RuneFrame:UnregisterAllEvents() - end - if( ShadowUF.db.profile.hidden.cast and not active_hiddens.cast ) then CastingBarFrame:UnregisterAllEvents() PetCastingBarFrame:UnregisterAllEvents() @@ -544,10 +539,17 @@ function ShadowUF:HideBlizzardFrames() PlayerFrameHealthBar:UnregisterAllEvents() PlayerFrameManaBar:UnregisterAllEvents() PlayerFrameAlternateManaBar:UnregisterAllEvents() - EclipseBarFrame:UnregisterAllEvents() - ShardBarFrame:UnregisterAllEvents() end - + + + if( ShadowUF.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then + for _, frame in pairs({EclipseBarFrame, ShardBarFrame, RuneFrame, TotemFrame, PaladinPowerBar, MonkHarmonyBar, PriestBarFrame, WarlockPowerFrame}) do + frame:UnregisterAllEvents() + frame:Hide() + frame.Hide = self.noop + end + end + if( ShadowUF.db.profile.hidden.pet and not active_hiddens.pet ) then PetFrame:UnregisterAllEvents() PetFrame:Hide() diff --git a/options/config.lua b/options/config.lua index 5935e2ec..37436ef4 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1411,7 +1411,7 @@ local function loadHideOptions() type = "toggle", name = function(info) local key = info[#(info)] - return L.units[key] and string.format(L["Hide %s frames"], string.lower(L.units[key])) or string.format(L["Hide %s"], key == "cast" and L["player cast bar"] or key == "runes" and L["rune bar"] or key == "buffs" and L["buff frames"] or key == "playerAltPower" and L["player alt. power"]) + return L.units[key] and string.format(L["Hide %s frames"], string.lower(L.units[key])) or string.format(L["Hide %s"], key == "cast" and L["player cast bar"] or key == "playerPower" and L["player power frames"] or key == "buffs" and L["buff frames"] or key == "playerAltPower" and L["player alt. power"]) end, set = function(info, value) set(info, value) @@ -1448,7 +1448,7 @@ local function loadHideOptions() args = { buffs = Config.hideTable, cast = Config.hideTable, - runes = Config.hideTable, + playerPower = Config.hideTable, party = Config.hideTable, raid = Config.hideTable, player = Config.hideTable, From 9980a6bf85d5e5336f2f3907cd6563b1ccc26cb4 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 3 Sep 2012 11:07:00 -0700 Subject: [PATCH 238/794] Only register the power events for alt power when visible --- modules/altpower.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index 65198be6..cb2a66c2 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -4,11 +4,8 @@ ShadowUF:RegisterModule(AltPower, "altPowerBar", ShadowUF.L["Alt. Power bar"], t function AltPower:OnEnable(frame) frame.altPowerBar = frame.altPowerBar or ShadowUF.Units:CreateBar(frame) - frame:RegisterUnitEvent("UNIT_POWER", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", self, "UpdateVisibility") frame:RegisterUnitEvent("UNIT_POWER_BAR_HIDE", self, "UpdateVisibility") - frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdateVisibility") frame:RegisterUpdateFunc(self, "UpdateVisibility") end @@ -30,9 +27,15 @@ function AltPower:UpdateVisibility(frame) end ShadowUF.Layout:SetBarVisibility(frame, "altPowerBar", visible) - + + -- Register or unregister events based on if it's visible + local type = visible and "RegisterUnitEvent" or "UnregisterEvent" + frame[type](frame, "UNIT_POWER", self, "Update") + frame[type](frame, "UNIT_MAXPOWER", self, "Update") + frame[type](frame, "UNIT_DISPLAYPOWER", self, "UpdateVisibility") if( not visible ) then return end + local color = ShadowUF.db.profile.powerColors.ALTERNATE if( not showOnRaid ) then local powerType, powerToken, altR, altG, altB = UnitPowerType(frame.unit) From 3000b4ab62f85348b42ae59e764748991ff511b5 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 5 Sep 2012 12:28:57 -0700 Subject: [PATCH 239/794] Call ClearAllPoints on header frame children after changing them to fix them getting stuck --- modules/units.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 63045345..6053b9b6 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -874,10 +874,23 @@ function Units:SetHeaderAttributes(frame, type) stateMonitor.raid:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) end end + -- calling :Show basically resets the header - if frame:IsShown() then + if( frame:IsShown() ) then frame:Show() end + + if( headerUnits[type] and not InCombatLockdown() ) then + local name = frame:GetName() .. "UnitButton" + local index = 1 + local child = _G[name .. index] + while( child ) do + child:ClearAllPoints() + + index = index + 1 + child = _G[name .. index] + end + end end -- Load a single unit such as player, target, pet, etc From 2c85e8abd323595168e07dbe286cf41acd49a33c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 07:03:23 -0700 Subject: [PATCH 240/794] Make sure CompactRaidFrameManager exists and noop Show not Hide --- ShadowedUnitFrames.lua | 43 ++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 5cd65e9f..0b307777 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -496,27 +496,29 @@ function ShadowUF:HideBlizzardFrames() end end - if( ShadowUF.db.profile.hidden.raid and not active_hiddens.raid ) then - local function hideRaid() - CompactRaidFrameManager:UnregisterAllEvents() - CompactRaidFrameContainer:UnregisterAllEvents() - if( not InCombatLockdown() ) then CompactRaidFrameManager:Hide() end - - local shown = CompactRaidFrameManager_GetSetting("IsShown") - if( shown and shown ~= "0" ) then - CompactRaidFrameManager_SetSetting("IsShown", "0") - end - end + if( CompactRaidFrameManager ) then + if( ShadowUF.db.profile.hidden.raid and not active_hiddens.raid ) then + local function hideRaid() + CompactRaidFrameManager:UnregisterAllEvents() + CompactRaidFrameContainer:UnregisterAllEvents() + if( not InCombatLockdown() ) then CompactRaidFrameManager:Hide() end - hooksecurefunc("CompactRaidFrameManager_UpdateShown", function() - if( ShadowUF.db.profile.hidden.raid ) then - hideRaid() + local shown = CompactRaidFrameManager_GetSetting("IsShown") + if( shown and shown ~= "0" ) then + CompactRaidFrameManager_SetSetting("IsShown", "0") + end end - end) - - hideRaid() - elseif( not ShadowUF.db.profile.hidden.raid ) then - CompactRaidFrameManager:SetFrameStrata("DIALOG") + + hooksecurefunc("CompactRaidFrameManager_UpdateShown", function() + if( ShadowUF.db.profile.hidden.raid ) then + hideRaid() + end + end) + + hideRaid() + elseif( not ShadowUF.db.profile.hidden.raid ) then + CompactRaidFrameManager:SetFrameStrata("DIALOG") + end end if( ShadowUF.db.profile.hidden.buffs and not active_hiddens.buffs ) then @@ -544,9 +546,10 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then for _, frame in pairs({EclipseBarFrame, ShardBarFrame, RuneFrame, TotemFrame, PaladinPowerBar, MonkHarmonyBar, PriestBarFrame, WarlockPowerFrame}) do + print("Hiding", frame:GetName()) frame:UnregisterAllEvents() frame:Hide() - frame.Hide = self.noop + frame.Show = self.noop end end From 9530f57408378efbba56147fec5f242265e65fe3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 12:10:11 -0700 Subject: [PATCH 241/794] Remove debug --- ShadowedUnitFrames.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 0b307777..e25ce317 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -546,7 +546,6 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then for _, frame in pairs({EclipseBarFrame, ShardBarFrame, RuneFrame, TotemFrame, PaladinPowerBar, MonkHarmonyBar, PriestBarFrame, WarlockPowerFrame}) do - print("Hiding", frame:GetName()) frame:UnregisterAllEvents() frame:Hide() frame.Show = self.noop From 94882631d5be733e538534cf7e3797e90204715c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 12:19:11 -0700 Subject: [PATCH 242/794] Try using UNIT_POWER_FREQUENT instead of OnUpdate --- modules/power.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/power.lua b/modules/power.lua index 2636e807..d5a84d31 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -17,7 +17,7 @@ end function Power:OnEnable(frame) frame.powerBar = frame.powerBar or ShadowUF.Units:CreateBar(frame) - frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") frame:RegisterUnitEvent("UNIT_CONNECTION", self, "Update") frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", self, "Update") @@ -30,13 +30,13 @@ end function Power:OnLayoutApplied(frame) -- Enable predicted updates which requires polling in an OnUpdate to get more up to date values - if( frame.visibility.powerBar ) then - if( ShadowUF.db.profile.units[frame.unitType].powerBar.predicted ) then - frame.powerBar:SetScript("OnUpdate", updatePower) - else - frame.powerBar:SetScript("OnUpdate", nil) - end - end + --if( frame.visibility.powerBar ) then + -- if( ShadowUF.db.profile.units[frame.unitType].powerBar.predicted ) then + -- frame.powerBar:SetScript("OnUpdate", updatePower) + -- else + -- frame.powerBar:SetScript("OnUpdate", nil) + -- end + --end end function Power:OnDisable(frame) From 3be23d724804488e01e59e9116b4e3a1fafeb561 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 16:49:01 -0700 Subject: [PATCH 243/794] Switch power events to use the frequent ones for tags --- modules/tags.lua | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 2700fe07..10091fe4 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -919,28 +919,28 @@ Tags.defaultEvents = { -- ["crtabs:name"] = "CRTABS", ["afk"] = "PLAYER_FLAGS_CHANGED", -- Yes, I know it's called PLAYER_FLAGS_CHANGED, but arg1 is the unit including non-players. ["afk:time"] = "PLAYER_FLAGS_CHANGED UNIT_CONNECTION", - ["status:time"] = "UNIT_POWER UNIT_CONNECTION", + ["status:time"] = "UNIT_POWER_FREQUENT UNIT_CONNECTION", ["pvp:time"] = "PLAYER_FLAGS_CHANGED", ["curhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_CONNECTION", ["abscurhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_CONNECTION", ["curmaxhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", ["absolutehp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", ["smart:curmaxhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", - ["curpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", - ["abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["absolutepp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["smart:curmaxpp"] = "UNIT_POWER UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["druid:curpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", - ["druid:abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", - ["druid:curmaxpp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["druid:absolutepp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["monk:curpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", - ["monk:abscurpp"] = "UNIT_POWER UNIT_DISPLAYPOWER", - ["monk:curmaxpp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["monk:absolutepp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["sshards"] = "UNIT_POWER", - ["hpower"] = "UNIT_POWER", + ["curpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["abscurpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["curmaxpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["absolutepp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["smart:curmaxpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["druid:curpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["druid:abscurpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["druid:curmaxpp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["druid:absolutepp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["monk:curpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["monk:abscurpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["monk:curmaxpp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["monk:absolutepp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["sshards"] = "UNIT_POWER_FREQUENT", + ["hpower"] = "UNIT_POWER_FREQUENT", ["level"] = "UNIT_LEVEL UNIT_FACTION PLAYER_LEVEL_UP", ["levelcolor"] = "UNIT_LEVEL UNIT_FACTION PLAYER_LEVEL_UP", ["maxhp"] = "UNIT_MAXHEALTH", @@ -949,13 +949,13 @@ Tags.defaultEvents = { ["maxpp"] = "UNIT_MAXPOWER", ["absmaxpp"] = "UNIT_MAXPOWER", ["missinghp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", - ["missingpp"] = "UNIT_POWER UNIT_MAXPOWER", + ["missingpp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["name"] = "UNIT_NAME_UPDATE", ["abbrev:name"] = "UNIT_NAME_UPDATE", ["server"] = "UNIT_NAME_UPDATE", ["colorname"] = "UNIT_NAME_UPDATE", ["perhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", - ["perpp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_CONNECTION", + ["perpp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_CONNECTION", ["status"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT PLAYER_UPDATE_RESTING UNIT_CONNECTION", ["smartlevel"] = "UNIT_LEVEL PLAYER_LEVEL_UP UNIT_CLASSIFICATION_CHANGED", ["cpoints"] = "UNIT_COMBO_POINTS PLAYER_TARGET_CHANGED", @@ -974,11 +974,11 @@ Tags.defaultEvents = { ["unit:scaled:threat"] = "UNIT_THREAT_SITUATION_UPDATE", ["unit:color:sit"] = "UNIT_THREAT_SITUATION_UPDATE", ["unit:situation"] = "UNIT_THREAT_SITUATION_UPDATE", - ["warlock:demonic:curpp"] = "UNIT_POWER", + ["warlock:demonic:curpp"] = "UNIT_POWER_FREQUENT", ["warlock:demonic:maxpp"] = "UNIT_MAXPOWER", - ["warlock:demonic:perpp"] = "UNIT_POWER UNIT_POWER_MAX", - ["monk:chipoints"] = "UNIT_POWER", - ["priest:shadoworbs"] = "UNIT_POWER", + ["warlock:demonic:perpp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER", + ["monk:chipoints"] = "UNIT_POWER_FREQUENT", + ["priest:shadoworbs"] = "UNIT_POWER_FREQUENT", } -- Default update frequencies for tag updating, used if it's needed to override the update speed @@ -1256,7 +1256,7 @@ Tags.defaultNames = { -- List of event types Tags.eventType = { - ["UNIT_POWER"] = "power", + ["UNIT_POWER_FREQUENT"] = "power", ["UNIT_MAXPOWER"] = "power", ["UNIT_HEALTH_FREQUENT"] = "health", ["UNIT_HEALTH"] = "health", @@ -1296,7 +1296,7 @@ local function loadAPIEvents() ["UnitFactionGroup"] = "UNIT_FACTION PLAYER_FLAGS_CHANGED", ["UnitHealth%("] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT", ["UnitHealthMax"] = "UNIT_MAXHEALTH", - ["UnitPower%("] = "UNIT_POWER", + ["UnitPower%("] = "UNIT_POWER_FREQUENT", ["UnitPowerMax"] = "UNIT_MAXPOWER", ["UnitPowerType"] = "UNIT_DISPLAYPOWER", ["UnitIsDead"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT", From ddf29899d3c0b3300e7c62a10062ab985357dfd8 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 17:12:36 -0700 Subject: [PATCH 244/794] Optimize event unregistering to only check if we need to unregister if a handler is present --- modules/units.lua | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 6053b9b6..1c11f5c0 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -53,13 +53,13 @@ local function RegisterNormalEvent(self, event, handler, func) if( self.registeredEvents[event][handler] ) then return end - + self.registeredEvents[event][handler] = func end -- Unregister an event local function UnregisterEvent(self, event, handler) - if( self.registeredEvents[event] ) then + if( self.registeredEvents[event] and self.registeredEvents[event][handler] ) then self.registeredEvents[event][handler] = nil local hasHandler @@ -117,16 +117,18 @@ local function UnregisterAll(self, handler) end for event, list in pairs(self.registeredEvents) do - list[handler] = nil - - local hasRegister - for handler in pairs(list) do - hasRegister = true - break - end - - if( not hasRegister ) then - self:UnregisterEvent(event) + if( list[handler] ) then + list[handler] = nil + + local hasRegister + for handler in pairs(list) do + hasRegister = true + break + end + + if( not hasRegister ) then + self:UnregisterEvent(event) + end end end end From 626132ef63cc3c3cfb05004d462205cbff1c8936 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 17:13:14 -0700 Subject: [PATCH 245/794] Throttle power updating --- modules/power.lua | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/modules/power.lua b/modules/power.lua index d5a84d31..f8890fc3 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -1,22 +1,9 @@ local Power = {} ShadowUF:RegisterModule(Power, "powerBar", ShadowUF.L["Power bar"], true) -local function updatePower(self, elapsed) - local currentPower = UnitPower(self.parent.unit) - if( currentPower == self.currentPower ) then return end - self.currentPower = currentPower - - self:SetValue(currentPower) - for _, fontString in pairs(self.parent.fontStrings) do - if( fontString.fastPower ) then - fontString:UpdateTags() - end - end -end - function Power:OnEnable(frame) frame.powerBar = frame.powerBar or ShadowUF.Units:CreateBar(frame) - + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") frame:RegisterUnitEvent("UNIT_CONNECTION", self, "Update") @@ -28,22 +15,13 @@ function Power:OnEnable(frame) frame:RegisterUpdateFunc(self, "Update") end -function Power:OnLayoutApplied(frame) - -- Enable predicted updates which requires polling in an OnUpdate to get more up to date values - --if( frame.visibility.powerBar ) then - -- if( ShadowUF.db.profile.units[frame.unitType].powerBar.predicted ) then - -- frame.powerBar:SetScript("OnUpdate", updatePower) - -- else - -- frame.powerBar:SetScript("OnUpdate", nil) - -- end - --end -end - function Power:OnDisable(frame) frame:UnregisterAll(self) end function Power:UpdateColor(frame) + frame.powerBar.currentType = select(2, UnitPowerType(frame.unit)) + local color if( ShadowUF.db.profile.units[frame.unitType].powerBar.colorType == "class" and UnitIsPlayer(frame.unit) ) then local class = select(2, UnitClass(frame.unit)) @@ -51,7 +29,7 @@ function Power:UpdateColor(frame) end if( not color ) then - color = ShadowUF.db.profile.powerColors[select(2, UnitPowerType(frame.unit))] or ShadowUF.db.profile.powerColors.MANA + color = ShadowUF.db.profile.powerColors[frame.powerBar.currentType] or ShadowUF.db.profile.powerColors.MANA end if( not ShadowUF.db.profile.units[frame.unitType].powerBar.invert ) then @@ -71,7 +49,9 @@ function Power:UpdateColor(frame) end end -function Power:Update(frame) +function Power:Update(frame, event, unit, powerType) + if( event and powerType ~= frame.powerBar.currentType ) then return end + frame.powerBar.currentPower = UnitPower(frame.unit) frame.powerBar:SetMinMaxValues(0, UnitPowerMax(frame.unit)) frame.powerBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or frame.powerBar.currentPower) From 8ce56f148ba3e091e31274b2a895da407290db2c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 17:20:13 -0700 Subject: [PATCH 246/794] Fixed altPower unregistering events it shouldn't have been --- modules/altpower.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index cb2a66c2..dbbdac77 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -29,8 +29,8 @@ function AltPower:UpdateVisibility(frame) ShadowUF.Layout:SetBarVisibility(frame, "altPowerBar", visible) -- Register or unregister events based on if it's visible - local type = visible and "RegisterUnitEvent" or "UnregisterEvent" - frame[type](frame, "UNIT_POWER", self, "Update") + local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent" + frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") frame[type](frame, "UNIT_MAXPOWER", self, "Update") frame[type](frame, "UNIT_DISPLAYPOWER", self, "UpdateVisibility") if( not visible ) then return end From 2d1c2be6d20467a7ffa9354df4030b69ff5828e7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 17:22:08 -0700 Subject: [PATCH 247/794] Only do the power filtering if powerType is set --- modules/power.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/power.lua b/modules/power.lua index f8890fc3..2a652878 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -50,7 +50,7 @@ function Power:UpdateColor(frame) end function Power:Update(frame, event, unit, powerType) - if( event and powerType ~= frame.powerBar.currentType ) then return end + if( event and powerType and powerType ~= frame.powerBar.currentType ) then return end frame.powerBar.currentPower = UnitPower(frame.unit) frame.powerBar:SetMinMaxValues(0, UnitPowerMax(frame.unit)) From 3419ed00fdd5aa6cf6387f1f44d7eea4b1224797 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 17:30:06 -0700 Subject: [PATCH 248/794] Force a power update immediately after display power changes --- modules/power.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/power.lua b/modules/power.lua index 2a652878..1791c750 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -47,6 +47,8 @@ function Power:UpdateColor(frame) frame.powerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) end end + + self:Update(frame) end function Power:Update(frame, event, unit, powerType) From 1547439379cc570d014090fdb31931cc24ab512d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 17:30:48 -0700 Subject: [PATCH 249/794] Experiment with using RegisterUnitEvent again for headers, will now unregister/register with the new unit when it changes for headers. Should improve performance --- modules/units.lua | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 1c11f5c0..6f74082f 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -33,6 +33,27 @@ local function FullUpdate(self) end end +-- Re-registers events when unit changes +local function ReregisterUnitEvents(self) + -- Not an unit event + if( ShadowUF.fakeUnits[self.unitRealType] or not headerUnits[self.unitType] ) then return end + + for event, list in pairs(self.registeredEvents) do + if( unitEvents[event] ) then + local hasHandler + for handler in pairs(list) do + hasHandler = true + break + end + + if( hasHandler ) then + self:UnregisterEvent(event) + self:BlizzRegisterUnitEvent(event, self.unitOwner, self.vehicleUnit) + end + end + end +end + -- Register an event that should always call the frame local function RegisterNormalEvent(self, event, handler, func) -- Make sure the handler/func exists @@ -41,7 +62,7 @@ local function RegisterNormalEvent(self, event, handler, func) return end - if( unitEvents[event] and not ShadowUF.fakeUnits[self.unitRealType] and not headerUnits[self.unitType] ) then + if( unitEvents[event] and not ShadowUF.fakeUnits[self.unitRealType] ) then self:BlizzRegisterUnitEvent(event, self.unitOwner, self.vehicleUnit) else self:RegisterEvent(event) @@ -131,6 +152,8 @@ local function UnregisterAll(self, handler) end end end + + end -- Handles setting alphas in a way so combat fader and range checker don't override each other @@ -460,6 +483,7 @@ OnAttributeChanged = function(self, name, unit) -- Don't need to recheck the unitType and force a full update, because a raid frame can never become -- a party frame, or a player frame and so on if( self.unitInitialized ) then + self:ReregisterUnitEvents() self:FullUpdate() return end @@ -667,6 +691,7 @@ function Units:CreateUnit(...) frame.SetRangeAlpha = SetRangeAlpha frame.DisableRangeAlpha = DisableRangeAlpha frame.UnregisterUpdateFunc = UnregisterUpdateFunc + frame.ReregisterUnitEvents = ReregisterUnitEvents frame.SetBarColor = SetBarColor frame.FullUpdate = FullUpdate frame.SetVisibility = SetVisibility From c90df8bcd6ebb9bd7114bfcf60ba2f665c77f182 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 17:33:22 -0700 Subject: [PATCH 250/794] Shift druid bar to frequent updating --- modules/druid.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/druid.lua b/modules/druid.lua index d39c106d..36277211 100755 --- a/modules/druid.lua +++ b/modules/druid.lua @@ -35,11 +35,11 @@ end function Druid:PowerChanged(frame) local form = GetShapeshiftFormID() if( form == CAT_FORM or form == BEAR_FORM ) then - frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") ShadowUF.Layout:SetBarVisibility(frame, "druidBar", true) else - frame:UnregisterSingleEvent("UNIT_POWER", self) + frame:UnregisterSingleEvent("UNIT_POWER_FREQUENT", self) frame:UnregisterSingleEvent("UNIT_MAXPOWER", self) ShadowUF.Layout:SetBarVisibility(frame, "druidBar", nil) end From 46080b5b6e95619e7f6d7c225f28c7fb7c4c23b4 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 17:40:08 -0700 Subject: [PATCH 251/794] Redid the druid power bar, it will no longer flicker on/off when swapping bear <-> cat, but will still hide when you shift back into caster. Should be less annoying now --- modules/druid.lua | 48 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/modules/druid.lua b/modules/druid.lua index 36277211..22a768ce 100755 --- a/modules/druid.lua +++ b/modules/druid.lua @@ -4,7 +4,7 @@ ShadowUF:RegisterModule(Druid, "druidBar", ShadowUF.L["Druid mana bar"], true, " function Druid:OnEnable(frame) frame.druidBar = frame.druidBar or ShadowUF.Units:CreateBar(frame) - frame:RegisterNormalEvent("UPDATE_SHAPESHIFT_FORM", self, "PowerChanged") + frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "PowerChanged") frame:RegisterUpdateFunc(self, "PowerChanged") frame:RegisterUpdateFunc(self, "Update") @@ -15,38 +15,36 @@ function Druid:OnDisable(frame) end function Druid:OnLayoutApplied(frame) - if( frame.visibility.druidBar ) then - local color = ShadowUF.db.profile.powerColors.MANA - - if( not ShadowUF.db.profile.units[frame.unitType].druidBar.invert ) then - frame.druidBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) - if( not frame.druidBar.background.overrideColor ) then - frame.druidBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) - end - else - frame.druidBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) - - color = frame.druidBar.background.overrideColor or color - frame.druidBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) + if( not frame.visibility.druidBar ) then return end + + local color = ShadowUF.db.profile.powerColors.MANA + + if( not ShadowUF.db.profile.units[frame.unitType].druidBar.invert ) then + frame.druidBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) + if( not frame.druidBar.background.overrideColor ) then + frame.druidBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) end + else + frame.druidBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) + + color = frame.druidBar.background.overrideColor or color + frame.druidBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) end end function Druid:PowerChanged(frame) - local form = GetShapeshiftFormID() - if( form == CAT_FORM or form == BEAR_FORM ) then - frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") - ShadowUF.Layout:SetBarVisibility(frame, "druidBar", true) - else - frame:UnregisterSingleEvent("UNIT_POWER_FREQUENT", self) - frame:UnregisterSingleEvent("UNIT_MAXPOWER", self) - ShadowUF.Layout:SetBarVisibility(frame, "druidBar", nil) - end + local visible = UnitPowerType(frame.unit) ~= ADDITIONAL_POWER_BAR_INDEX + local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent" + + frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") + frame[type](frame, "UNIT_POWERMAX", self, "Update") + ShadowUF.Layout:SetBarVisibility(frame, "druidBar", visible) + + if( visible ) then self:Update(frame) end end function Druid:Update(frame, event, unit, powerType) - if( powerType ~= "MANA" ) then return end + if( powerType and powerType ~= "MANA" ) then return end frame.druidBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, SPELL_POWER_MANA)) frame.druidBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, SPELL_POWER_MANA)) end From 4f53a5fe5c3b8b23c010f75bd9db52ba3172c0f3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 17:41:55 -0700 Subject: [PATCH 252/794] Fixed chi throttler --- modules/chi.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/chi.lua b/modules/chi.lua index 1c54836e..b9efe81b 100755 --- a/modules/chi.lua +++ b/modules/chi.lua @@ -23,7 +23,7 @@ function Chi:OnLayoutApplied(frame, config) end function Chi:Update(frame, event, unit, powerType) - if( event == "UNIT_POWER" and powerType ~= chiConfig.eventType ) then return end + if( powerType and powerType ~= chiConfig.eventType ) then return end local points = UnitPower("player", chiConfig.powerType) -- Bar display, hide it if we don't have any combo points From f8942ef88b0a02e8ee4859a37b1b036064305862 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 17:43:15 -0700 Subject: [PATCH 253/794] Fixed power throttle checker --- modules/holypower.lua | 2 +- modules/shadoworbs.lua | 2 +- modules/soulshards.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/holypower.lua b/modules/holypower.lua index 84e5f00e..0beac9e9 100755 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -48,7 +48,7 @@ function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) end function HolyPower:Update(frame, event, unit, powerType) - if( event == "UNIT_POWER" and powerType ~= holyConfig.eventType ) then return end + if( powerType and powerType ~= holyConfig.eventType ) then return end local points = UnitPower("player", holyConfig.powerType) -- Bar display, hide it if we don't have any combo points diff --git a/modules/shadoworbs.lua b/modules/shadoworbs.lua index d40fc242..0cd1301d 100755 --- a/modules/shadoworbs.lua +++ b/modules/shadoworbs.lua @@ -25,7 +25,7 @@ function ShadowOrbs:OnLayoutApplied(frame, config) end function ShadowOrbs:Update(frame, event, unit, powerType) - if( event == "UNIT_POWER" and powerType ~= shadowConfig.eventType ) then return end + if( powerType and powerType ~= shadowConfig.eventType ) then return end local points = UnitPower("player", shadowConfig.powerType) -- Bar display, hide it if we don't have any combo points diff --git a/modules/soulshards.lua b/modules/soulshards.lua index 15a26e42..f09588d5 100755 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -25,7 +25,7 @@ function Souls:OnLayoutApplied(frame, config) end function Souls:Update(frame, event, unit, powerType) - if( event == "UNIT_POWER" and powerType ~= soulsConfig.eventType ) then return end + if( powerType and powerType ~= soulsConfig.eventType ) then return end local points = UnitPower("player", soulsConfig.powerType) -- Bar display, hide it if we don't have any soul shards From 0297bec6273078cff6f06e1706b8fab8e60c6143 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 17:44:09 -0700 Subject: [PATCH 254/794] Fader will fade based on frequent power updates now --- modules/fader.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/fader.lua b/modules/fader.lua index 2cb485e1..0361ff06 100755 --- a/modules/fader.lua +++ b/modules/fader.lua @@ -82,7 +82,7 @@ function Fader:PLAYER_REGEN_ENABLED(frame, event) frame:RegisterNormalEvent("UNIT_SPELLCAST_STOP", self, "CastStop") frame:RegisterUnitEvent("UNIT_HEALTH", self, "Update") frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "Update") - frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") end @@ -94,7 +94,7 @@ function Fader:PLAYER_REGEN_DISABLED(frame, event) frame:UnregisterSingleEvent("UNIT_SPELLCAST_START", self) frame:UnregisterSingleEvent("UNIT_SPELLCAST_STOP", self) frame:UnregisterSingleEvent("UNIT_HEALTH", self) - frame:UnregisterSingleEvent("UNIT_POWER", self) + frame:UnregisterSingleEvent("UNIT_POWER_FREQUENT", self) frame:UnregisterSingleEvent("UNIT_MAXHEALTH", self) frame:UnregisterSingleEvent("UNIT_MAXPOWER", self) end From d5b16f33fd37da62e1845646779240588ddd882a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 17:44:19 -0700 Subject: [PATCH 255/794] Switch monk updater to use frequent power updates --- modules/monk.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monk.lua b/modules/monk.lua index abb5c84f..057c9683 100755 --- a/modules/monk.lua +++ b/modules/monk.lua @@ -4,7 +4,7 @@ ShadowUF:RegisterModule(Monk, "monkBar", ShadowUF.L["Monk mana bar"], true, "MON function Monk:OnEnable(frame) frame.monkBar = frame.monkBar or ShadowUF.Units:CreateBar(frame) - frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") frame:RegisterUpdateFunc(self, "Update") From 0b120cd6fb422f7d404212adb6f4358c33fabb3d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 18:12:13 -0700 Subject: [PATCH 256/794] Experimenting with a new way of throttling tag updates for power so a mana tag won't trigger an update on a rage tag and so on --- modules/tags.lua | 89 ++++++++++++++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 33 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 10091fe4..ac50952f 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -5,6 +5,14 @@ local L = ShadowUF.L ShadowUF.Tags = Tags +-- Avoid having to do string.match on every event +local powerFilters = {["SUF_POWERTYPE:CURRENT"] = "CURRENT"} +for powerType in pairs(PowerBarColor) do + if( type(powerType) == "string" ) then + powerFilters["SUF_POWERTYPE:" .. powerType] = powerType + end +end + -- Register the associated events with all the tags function Tags:RegisterEvents(parent, fontString, tags) -- Strip parantheses and anything inside them @@ -20,18 +28,22 @@ function Tags:RegisterEvents(parent, fontString, tags) local tagEvents = Tags.defaultEvents[tag] or ShadowUF.db.profile.tags[tag] and ShadowUF.db.profile.tags[tag].events if( tagEvents ) then for event in string.gmatch(tagEvents, "%S+") do - if( self.customEvents[event] ) then + -- Power filter event, store it instead + if( powerFilters[event] ) then + fontString.powerFilters = fontString.powerFilters or {} + fontString.powerFilters[powerFilters[event]] = true + fontString.powerType = fontString.powerType or select(2, UnitPowerType(parent.unit)) + -- Custom event registered by another module + elseif( self.customEvents[event] ) then self.customEvents[event]:EnableTag(parent, fontString) fontString[event] = true + -- Unit event elseif( Tags.eventType[event] ~= "unitless" or ShadowUF.Units.unitEvents[event] ) then parent:RegisterUnitEvent(event, fontString, "UpdateTags") + -- Everything else else parent:RegisterNormalEvent(event, fontString, "UpdateTags") end - - -- The power and health bars will handle updating tags with this flag set - fontString.fastPower = fontString.fastPower or Tags.eventType[event] == "power" - fontString.fastHealth = fontString.fastHealth or Tags.eventType[event] == "health" end end end @@ -152,7 +164,20 @@ function Tags:Register(parent, fontString, tags, resetCache) end -- Create our update function now - updateFunc = function(fontString) + updateFunc = function(fontString, frame, event, unit, powerType) + if( event ) then + -- Keep track of what the current power type is if we're doing current filtering + if( event == "UNIT_DISPLAYPOWER" and fontString.powerFilters.CURRENT ) then + fontString.powerType = select(2, UnitPowerType(unit)) + + -- Check if we can filter out the update + elseif( event == "UNIT_POWER" or event == "UNIT_POWER_FREQUENT" or event == "UNIT_MAXPOWER" ) then + if( powerType and not fontString.powerFilters[powerType] and ( not fontString.powerFilters.CURRENT or fontString.powerType ~= powerType ) ) then + return + end + end + end + for id, func in pairs(args) do temp[id] = func(fontString.parent.unit, fontString.parent.unitOwner, fontString) or "" end @@ -195,8 +220,6 @@ function Tags:Unregister(fontString) -- Kill any tag data fontString.parent:UnregisterAll(fontString) - fontString.fastPower = nil - fontString.fastHealth = nil fontString.frequentStart = nil fontString.UpdateTags = nil fontString:SetText("") @@ -926,36 +949,36 @@ Tags.defaultEvents = { ["curmaxhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", ["absolutehp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", ["smart:curmaxhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", - ["curpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", - ["abscurpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["curmaxpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["absolutepp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["smart:curmaxpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["druid:curpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", - ["druid:abscurpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", - ["druid:curmaxpp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["druid:absolutepp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["monk:curpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", - ["monk:abscurpp"] = "UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", - ["monk:curmaxpp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["monk:absolutepp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["sshards"] = "UNIT_POWER_FREQUENT", - ["hpower"] = "UNIT_POWER_FREQUENT", + ["curpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["abscurpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["absolutepp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["smart:curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["druid:curpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["druid:abscurpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["druid:curmaxpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["druid:absolutepp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["monk:curpp"] = "SUF_POWERTYPE:LIGHT_FORCE UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["monk:abscurpp"] = "SUF_POWERTYPE:LIGHT_FORCE UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["monk:curmaxpp"] = "SUF_POWERTYPE:LIGHT_FORCE UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["monk:absolutepp"] = "SUF_POWERTYPE:LIGHT_FORCE UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["sshards"] = "SUF_POWERTYPE:SOUL_SHARDS UNIT_POWER_FREQUENT", + ["hpower"] = "SUF_POWERTYPE:HOLY_POWER UNIT_POWER_FREQUENT", ["level"] = "UNIT_LEVEL UNIT_FACTION PLAYER_LEVEL_UP", ["levelcolor"] = "UNIT_LEVEL UNIT_FACTION PLAYER_LEVEL_UP", ["maxhp"] = "UNIT_MAXHEALTH", ["def:name"] = "UNIT_NAME_UPDATE UNIT_MAXHEALTH UNIT_HEALTH UNIT_HEALTH_FREQUENT", ["absmaxhp"] = "UNIT_MAXHEALTH", - ["maxpp"] = "UNIT_MAXPOWER", - ["absmaxpp"] = "UNIT_MAXPOWER", + ["maxpp"] = "SUF_POWERTYPE:CURRENT UNIT_MAXPOWER", + ["absmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_MAXPOWER", ["missinghp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", - ["missingpp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER", + ["missingpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["name"] = "UNIT_NAME_UPDATE", ["abbrev:name"] = "UNIT_NAME_UPDATE", ["server"] = "UNIT_NAME_UPDATE", ["colorname"] = "UNIT_NAME_UPDATE", ["perhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", - ["perpp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_CONNECTION", + ["perpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_CONNECTION", ["status"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT PLAYER_UPDATE_RESTING UNIT_CONNECTION", ["smartlevel"] = "UNIT_LEVEL PLAYER_LEVEL_UP UNIT_CLASSIFICATION_CHANGED", ["cpoints"] = "UNIT_COMBO_POINTS PLAYER_TARGET_CHANGED", @@ -974,11 +997,11 @@ Tags.defaultEvents = { ["unit:scaled:threat"] = "UNIT_THREAT_SITUATION_UPDATE", ["unit:color:sit"] = "UNIT_THREAT_SITUATION_UPDATE", ["unit:situation"] = "UNIT_THREAT_SITUATION_UPDATE", - ["warlock:demonic:curpp"] = "UNIT_POWER_FREQUENT", - ["warlock:demonic:maxpp"] = "UNIT_MAXPOWER", - ["warlock:demonic:perpp"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER", - ["monk:chipoints"] = "UNIT_POWER_FREQUENT", - ["priest:shadoworbs"] = "UNIT_POWER_FREQUENT", + ["warlock:demonic:curpp"] = "SUF_POWERTYPE:DEMONIC_FURY UNIT_POWER_FREQUENT", + ["warlock:demonic:maxpp"] = "SUF_POWERTYPE:DEMONIC_FURY UNIT_MAXPOWER", + ["warlock:demonic:perpp"] = "SUF_POWERTYPE:DEMONIC_FURY UNIT_POWER_FREQUENT UNIT_MAXPOWER", + ["monk:chipoints"] = "SUF_POWERTYPE:LIGHT_FORCE UNIT_POWER_FREQUENT", + ["priest:shadoworbs"] = "SUF_POWERTYPE:SHADOW_ORBS UNIT_POWER_FREQUENT", } -- Default update frequencies for tag updating, used if it's needed to override the update speed @@ -1191,7 +1214,7 @@ Tags.defaultNames = { ["hpower"] = L["Holy power"], ["sshards"] = L["Soul shards"], ["smartlevel"] = L["Smart level"], - ["classification"] = L["Classificaiton"], + ["classification"] = L["Classification"], ["shortclassification"] = L["Short classification"], ["rare"] = L["Rare indicator"], ["plus"] = L["Short elite indicator"], From f0eeed5beb8a04daaf1508d581750c5be455731e Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Sep 2012 18:35:48 -0700 Subject: [PATCH 257/794] More performance optimizations, when a bar is hidden for a tag it will stop updating that tag until the bar is shown again - Fixed fontstrings showing up for bars that were hidden --- modules/layout.lua | 8 ++++++++ modules/tags.lua | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/modules/layout.lua b/modules/layout.lua index 2ceb5a6f..a630397b 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -74,10 +74,17 @@ function Layout:ToggleVisibility(frame, visible) end function Layout:SetBarVisibility(frame, key, status) + -- Show the bar if it wasn't already if( status and not frame[key]:IsVisible() ) then + ShadowUF.Tags:FastRegister(frame, frame[key]) + frame[key]:Show() ShadowUF.Layout:PositionWidgets(frame, ShadowUF.db.profile.units[frame.unitType]) + + -- Hide the bar if it wasn't already elseif( not status and frame[key]:IsVisible() ) then + ShadowUF.Tags:FastUnregister(frame, frame[key]) + frame[key]:Hide() ShadowUF.Layout:PositionWidgets(frame, ShadowUF.db.profile.units[frame.unitType]) end @@ -408,6 +415,7 @@ function Layout:SetupText(frame, config) local anchorPoint = columnDirection[row.anchorPoint] if( string.len(row.anchorPoint) == 3 ) then anchorPoint = anchorPoint .. "I" end + fontString.parentBar = parent fontString.availableWidth = parent:GetWidth() - row.x fontString.widthID = row.anchorTo .. anchorPoint .. row.y totalWeight[fontString.widthID] = (totalWeight[fontString.widthID] or 0) + row.width diff --git a/modules/tags.lua b/modules/tags.lua index ac50952f..c2e4802c 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -79,6 +79,28 @@ freqFrame:SetScript("OnUpdate", function(self, elapsed) end) freqFrame:Hide() +-- This is for bars that can be shown or hidden often, like druid power +function Tags:FastRegister(frame, parent) + for _, fontString in pairs(frame.fontStrings) do + -- Re-register anything that was already registered and is part of the parent + if( regFontStrings[fontString] and fontString.parentBar == parent ) then + fontString.UpdateTags = tagPool[regFontStrings[fontString]] + fontString:Show() + end + end +end + +function Tags:FastUnregister(frame, parent) + for _, fontString in pairs(frame.fontStrings) do + -- Redirect the updates to not do anything and hide it + if( regFontStrings[fontString] and fontString.parentBar == parent ) then + fontString.UpdateTags = ShadowUF.noop + fontString:Hide() + end + end +end + + -- Register a font string with the tag system function Tags:Register(parent, fontString, tags, resetCache) -- Unregister the font string first if we did register it already From 8088ca09194d70bcd679bf8ce831bd4663042f8b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 7 Sep 2012 09:26:03 -0700 Subject: [PATCH 258/794] Try escaping | in tags --- modules/tags.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/tags.lua b/modules/tags.lua index c2e4802c..09b5a4c2 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -124,6 +124,8 @@ function Tags:Register(parent, fontString, tags, resetCache) if( not updateFunc ) then -- Using .- prevents supporting tags such as [foo ([)]. Supporting that and having a single pattern local formattedText = string.gsub(string.gsub(tags, "%%", "%%%%"), "[[].-[]]", "%%s") + formattedText = string.gsub(formattedText, "|", "\124") + local args = {} for tag in string.gmatch(tags, "%[(.-)%]") do From d06e66595059dd4464459afc22e4bbbd7e8b78ff Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 7 Sep 2012 11:45:35 -0700 Subject: [PATCH 259/794] Replace | with || to prevent potential crashes due to a WoW change --- modules/tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tags.lua b/modules/tags.lua index 09b5a4c2..8870aa67 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -124,7 +124,7 @@ function Tags:Register(parent, fontString, tags, resetCache) if( not updateFunc ) then -- Using .- prevents supporting tags such as [foo ([)]. Supporting that and having a single pattern local formattedText = string.gsub(string.gsub(tags, "%%", "%%%%"), "[[].-[]]", "%%s") - formattedText = string.gsub(formattedText, "|", "\124") + formattedText = string.gsub(formattedText, "|", "||") local args = {} From be4b46e6989a02e87ea3df5aac9b527503d5fab9 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 7 Sep 2012 13:39:21 -0700 Subject: [PATCH 260/794] Make sure powerFilters is set --- modules/tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tags.lua b/modules/tags.lua index 8870aa67..250f35ed 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -189,7 +189,7 @@ function Tags:Register(parent, fontString, tags, resetCache) -- Create our update function now updateFunc = function(fontString, frame, event, unit, powerType) - if( event ) then + if( event and fontString.powerFilters ) then -- Keep track of what the current power type is if we're doing current filtering if( event == "UNIT_DISPLAYPOWER" and fontString.powerFilters.CURRENT ) then fontString.powerType = select(2, UnitPowerType(unit)) From 04049d38df429673bbf44275104d32ea92fd10e7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 10 Sep 2012 11:33:43 -0700 Subject: [PATCH 261/794] Remove the predicted power option as it's unnecessary now --- options/config.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/options/config.lua b/options/config.lua index 37436ef4..d1011040 100755 --- a/options/config.lua +++ b/options/config.lua @@ -3627,13 +3627,13 @@ local function loadUnitOptions() name = string.format(L["Enable %s"], L["Power bar"]), arg = "powerBar.enabled", }, - predictPower = { - order = 2, - type = "toggle", - name = L["Enable quick power"], - desc = L["Turns fast updating of the power bar on giving you more up to date power information than normal."], - arg = "powerBar.predicted", - }, + --predictPower = { + -- order = 2, + -- type = "toggle", + -- name = L["Enable quick power"], + -- desc = L["Turns fast updating of the power bar on giving you more up to date power information than normal."], + -- arg = "powerBar.predicted", + --}, altPowerBar = { order = 3, type = "toggle", @@ -5851,4 +5851,4 @@ function Config:Open() end AceDialog:Open("ShadowedUF") -end \ No newline at end of file +end From 93501466069f01b750bc38a96aee26a93e0a244e Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 10 Sep 2012 11:33:53 -0700 Subject: [PATCH 262/794] Optimize and fix tag updating for display power --- modules/tags.lua | 59 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 250f35ed..f2762846 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -15,6 +15,7 @@ end -- Register the associated events with all the tags function Tags:RegisterEvents(parent, fontString, tags) + local hasPowerFilters; -- Strip parantheses and anything inside them for tag in string.gmatch(tags, "%[(.-)%]") do -- The reason the original %b() match won't work, with [( ()group())] (or any sort of tag with ( or ) @@ -32,7 +33,16 @@ function Tags:RegisterEvents(parent, fontString, tags) if( powerFilters[event] ) then fontString.powerFilters = fontString.powerFilters or {} fontString.powerFilters[powerFilters[event]] = true - fontString.powerType = fontString.powerType or select(2, UnitPowerType(parent.unit)) + + if( powerFilters[event] == "CURRENT" ) then + if( not hasPowerFilters ) then + parent:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdatePowerType") + parent:RegisterUpdateFunc(self, "UpdatePowerType") + end + + hasPowerFilters = true + end + -- Custom event registered by another module elseif( self.customEvents[event] ) then self.customEvents[event]:EnableTag(parent, fontString) @@ -49,6 +59,15 @@ function Tags:RegisterEvents(parent, fontString, tags) end end +-- Update the cached power type +function Tags:UpdatePowerType(frame) + local powerType = select(2, UnitPowerType(frame.unit)) + for _, fontString in pairs(frame.fontStrings) do + fontString.powerType = powerType + fontString:UpdateTags() + end +end + -- This pretty much means a tag was updated in some way (or deleted) so we have to do a full update to get the new values shown function Tags:Reload() -- Kill cached functions, ugly I know but it ensures its fully updated with the new data @@ -189,14 +208,10 @@ function Tags:Register(parent, fontString, tags, resetCache) -- Create our update function now updateFunc = function(fontString, frame, event, unit, powerType) - if( event and fontString.powerFilters ) then - -- Keep track of what the current power type is if we're doing current filtering - if( event == "UNIT_DISPLAYPOWER" and fontString.powerFilters.CURRENT ) then - fontString.powerType = select(2, UnitPowerType(unit)) - + if( event and powerType and fontString.powerFilters ) then -- Check if we can filter out the update - elseif( event == "UNIT_POWER" or event == "UNIT_POWER_FREQUENT" or event == "UNIT_MAXPOWER" ) then - if( powerType and not fontString.powerFilters[powerType] and ( not fontString.powerFilters.CURRENT or fontString.powerType ~= powerType ) ) then + if( event == "UNIT_POWER" or event == "UNIT_POWER_FREQUENT" or event == "UNIT_MAXPOWER" ) then + if( not fontString.powerFilters[powerType] and ( not fontString.powerFilters.CURRENT or fontString.powerType ~= powerType ) ) then return end end @@ -241,12 +256,28 @@ function Tags:Unregister(fontString) module:DisableTag(fontString.parent, fontString) end end - + -- Kill any tag data fontString.parent:UnregisterAll(fontString) + fontString.powerFilters = nil fontString.frequentStart = nil fontString.UpdateTags = nil fontString:SetText("") + + -- See if we need to unregister events + local parent = fontString.parent + local hasPowerFilter + for _, fontString in pairs(parent.fontStrings) do + if( fontString.powerFilters and fontString.powerFilters.CURRENT ) then + hasPowerFilter = true + break + end + end + + if( not hasPowerFilter ) then + parent:UnregisterSingleEvent("UNIT_DISPLAYPOWER", self) + parent:UnregisterUpdateFunc(self, "UpdatePowerType") + end end -- Helper functions for tags, the reason I store it in ShadowUF is it's easier to type ShadowUF than ShadowUF.modules.Tags, and simpler for users who want to implement it. @@ -973,11 +1004,11 @@ Tags.defaultEvents = { ["curmaxhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", ["absolutehp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", ["smart:curmaxhp"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION", - ["curpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", - ["abscurpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["absolutepp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", - ["smart:curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER UNIT_MAXPOWER", + ["curpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT", + ["abscurpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", + ["curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", + ["absolutepp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", + ["smart:curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["druid:curpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", ["druid:abscurpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", ["druid:curmaxpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", From aa3dc1554ab75e4b547f673d3c3c207f84a3e6b5 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 10 Sep 2012 11:39:43 -0700 Subject: [PATCH 263/794] Unescape |c and |r tags to fix coloring --- modules/tags.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/tags.lua b/modules/tags.lua index f2762846..a6972f8c 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -144,6 +144,8 @@ function Tags:Register(parent, fontString, tags, resetCache) -- Using .- prevents supporting tags such as [foo ([)]. Supporting that and having a single pattern local formattedText = string.gsub(string.gsub(tags, "%%", "%%%%"), "[[].-[]]", "%%s") formattedText = string.gsub(formattedText, "|", "||") + formattedText = string.gsub(formattedText, "||c", "|c") + formattedText = string.gsub(formattedText, "||r", "|r") local args = {} From e693eadff57205cf4033a63b4793c6c48bb92763 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 10 Sep 2012 11:40:41 -0700 Subject: [PATCH 264/794] Remove the seperator for power as it's unneeded now --- options/config.lua | 7 ------- 1 file changed, 7 deletions(-) diff --git a/options/config.lua b/options/config.lua index d1011040..a21018fd 100755 --- a/options/config.lua +++ b/options/config.lua @@ -3642,13 +3642,6 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "altPowerBar.enabled", }, - sep = { - order = 4, - type = "description", - name = "", - width = "full", - hidden = false, - }, colorType = { order = 5, type = "select", From a4acea9e18500d29c6d74e34d58137d28bfa0645 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 10 Sep 2012 12:30:52 -0700 Subject: [PATCH 265/794] Redo the frequent updater, only loops over strings every 1 - 2 seconds now, rather than # FPS. They are also now throttled by event triggers to delay it, should greatly decrease tag updates --- modules/tags.lua | 53 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index a6972f8c..b26e2e57 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -85,12 +85,16 @@ end -- Frequent updates local freqFrame = CreateFrame("Frame") +freqFrame.timeToUpdate = 0 freqFrame:SetScript("OnUpdate", function(self, elapsed) + freqFrame.timeToUpdate = freqFrame.timeToUpdate - elapsed + if( freqFrame.timeToUpdate > 0 ) then return end + freqFrame.timeToUpdate = freqFrame.timeToUpdate + freqFrame.minInterval + for fontString, timeLeft in pairs(frequentUpdates) do if( fontString.parent:IsVisible() ) then - frequentUpdates[fontString] = timeLeft - elapsed + frequentUpdates[fontString] = timeLeft - freqFrame.minInterval if( frequentUpdates[fontString] <= 0 ) then - frequentUpdates[fontString] = fontString.frequentStart fontString:UpdateTags() end end @@ -98,6 +102,24 @@ freqFrame:SetScript("OnUpdate", function(self, elapsed) end) freqFrame:Hide() +local function updateMinimumFrequency() + local min + for fontString, pollTime in pairs(frequentUpdates) do + if( not min or min > pollTime ) then + min = pollTime + end + end + + if( not min ) then + freqFrame:Hide() + return + end + + freqFrame.timeToUpdate = min + freqFrame.minInterval = min + freqFrame:Show() +end + -- This is for bars that can be shown or hidden often, like druid power function Tags:FastRegister(frame, parent) for _, fontString in pairs(frame.fontStrings) do @@ -136,7 +158,8 @@ function Tags:Register(parent, fontString, tags, resetCache) if( pollTime ) then frequentUpdates[fontString] = pollTime fontString.frequentStart = pollTime - freqFrame:Show() + + updateMinimumFrequency() end local updateFunc = not resetCache and tagPool[tags] @@ -196,7 +219,7 @@ function Tags:Register(parent, fontString, tags, resetCache) frequencyCache[tags] = pollTime frequentUpdates[fontString] = pollTime fontString.frequentStart = pollTime - freqFrame:Show() + updateMinimumFrequency() end -- It's an invalid tag, simply return the tag itself wrapped in brackets @@ -219,6 +242,10 @@ function Tags:Register(parent, fontString, tags, resetCache) end end + if( frequentUpdates[fontString] ) then + frequentUpdates[fontString] = fontString.frequentStart + 0.01 + end + for id, func in pairs(args) do temp[id] = func(fontString.parent.unit, fontString.parent.unitOwner, fontString) or "" end @@ -239,17 +266,7 @@ end function Tags:Unregister(fontString) regFontStrings[fontString] = nil frequentUpdates[fontString] = nil - - -- Kill frequent updates if they aren't needed anymore - local hasFrequent - for k in pairs(frequentUpdates) do - hasFrequent = true - break - end - - if( not hasFrequent ) then - freqFrame:Hide() - end + updateMinimumFrequency() -- Unregister it as using HC for key, module in pairs(self.customEvents) do @@ -1136,10 +1153,10 @@ Tags.defaultCategories = { ["druid:abscurpp"] = "classspec", ["druid:curmaxpp"] = "classspec", ["druid:absolutepp"] = "classspec", - ["monk:curpp"] = "classspec", - ["monk:abscurpp"] = "classspec", + ["monk:curpp"] = "classspec", + ["monk:abscurpp"] = "classspec", ["monk:curmaxpp"] = "classspec", - ["monk:absolutepp"] = "classspec", + ["monk:absolutepp"] = "classspec", ["sshards"] = "classspec", ["hpower"] = "classspec", ["situation"] = "playerthreat", From 7e141b771da2991f86d48941621c1c10316aaa81 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 11 Sep 2012 09:28:25 -0700 Subject: [PATCH 266/794] Check that UpdateTags is set before calling it --- modules/tags.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index b26e2e57..2347d0e8 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -63,8 +63,10 @@ end function Tags:UpdatePowerType(frame) local powerType = select(2, UnitPowerType(frame.unit)) for _, fontString in pairs(frame.fontStrings) do - fontString.powerType = powerType - fontString:UpdateTags() + if( fontString.UpdateTags ) then + fontString.powerType = powerType + fontString:UpdateTags() + end end end From e5ea0e709c39b3e8375a51c9e5ce90958b65b8f0 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 12 Sep 2012 17:51:08 -0700 Subject: [PATCH 267/794] Update to force the packager to rerun --- ShadowedUnitFrames.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index e25ce317..30f34c8b 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -13,7 +13,6 @@ ShadowUF.unitList = {"player", "pet", "pettarget", "target", "targettarget", "ta ShadowUF.fakeUnits = {["targettarget"] = true, ["targettargettarget"] = true, ["pettarget"] = true, ["arenatarget"] = true, ["focustarget"] = true, ["focustargettarget"] = true, ["partytarget"] = true, ["raidtarget"] = true, ["bosstarget"] = true, ["maintanktarget"] = true, ["mainassisttarget"] = true} L.units = {["raidpet"] = L["Raid pet"], ["PET"] = L["Pet"], ["VEHICLE"] = L["Vehicle"], ["arena"] = L["Arena"], ["arenapet"] = L["Arena Pet"], ["arenatarget"] = L["Arena Target"], ["boss"] = L["Boss"], ["bosstarget"] = L["Boss Target"], ["focus"] = L["Focus"], ["focustarget"] = L["Focus Target"], ["mainassist"] = L["Main Assist"], ["mainassisttarget"] = L["Main Assist Target"], ["maintank"] = L["Main Tank"], ["maintanktarget"] = L["Main Tank Target"], ["party"] = L["Party"], ["partypet"] = L["Party Pet"], ["partytarget"] = L["Party Target"], ["pet"] = L["Pet"], ["pettarget"] = L["Pet Target"], ["player"] = L["Player"],["raid"] = L["Raid"], ["target"] = L["Target"], ["targettarget"] = L["Target of Target"], ["targettargettarget"] = L["Target of Target of Target"]} - -- Cache the units so we don't have to concat every time it updates ShadowUF.unitTarget = setmetatable({}, {__index = function(tbl, unit) rawset(tbl, unit, unit .. "target"); return unit .. "target" end}) ShadowUF.partyUnits, ShadowUF.raidUnits, ShadowUF.raidPetUnits, ShadowUF.bossUnits, ShadowUF.arenaUnits = {}, {}, {}, {}, {} From 8e6d60766d616ceb74358369fe831ef51036136a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 14 Sep 2012 09:03:55 -0700 Subject: [PATCH 268/794] Fixed power updating for Warlock pets --- modules/tags.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/tags.lua b/modules/tags.lua index 2347d0e8..32d4c8ef 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -62,6 +62,8 @@ end -- Update the cached power type function Tags:UpdatePowerType(frame) local powerType = select(2, UnitPowerType(frame.unit)) + if( powerType ) then powerType = string.gsub(powerType, "POWER_TYPE_FEL_", "") end + for _, fontString in pairs(frame.fontStrings) do if( fontString.UpdateTags ) then fontString.powerType = powerType From 1294b366464cb6dcc8fa8623a73628272e9591ac Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 14 Sep 2012 09:17:55 -0700 Subject: [PATCH 269/794] Bump the frame level of the queue status frame to try and force it to be on top --- ShadowedUnitFrames.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 30f34c8b..c88e4b3a 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -610,12 +610,18 @@ function ShadowUF:HideBlizzardFrames() -- and the fix is simple enough if( not active_hiddens.lfd ) then active_hiddens.lfd = true - hooksecurefunc(LFDQueueFrameCooldownFrame, "SetFrameLevel", function(frame, value) - local parentLevel = LFDParentFrame:GetFrameLevel() + 5 - if( value < parentLevel ) then - frame:SetFrameLevel(parentLevel + 10) + + + for _, frame in pairs({QueueStatusFrame, LFDQueueFrameCooldownFrame}) do + if( frame ) then + hooksecurefunc(frame, "SetFrameLevel", function(frame, value) + local parentLevel = frame:GetFrameLevel() + 5 + if( value < parentLevel ) then + frame:SetFrameLevel(parentLevel + 10) + end + end) end - end) + end end -- Don't modify the raid menu because that will taint the MA/MT stuff and it'll break and that's bad From c982788dc883581be0142e2b81f55ce6fdada225 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 14 Sep 2012 09:24:03 -0700 Subject: [PATCH 270/794] Will now default power color to the alt colors if we can't find a configured value, and if that doesn't exist, we default to mana --- modules/power.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/power.lua b/modules/power.lua index 1791c750..1c78cb99 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -19,8 +19,10 @@ function Power:OnDisable(frame) frame:UnregisterAll(self) end +local altColor = {} function Power:UpdateColor(frame) - frame.powerBar.currentType = select(2, UnitPowerType(frame.unit)) + local currentType, altR, altG, altB = select(2, UnitPowerType(frame.unit)) + frame.powerBar.currentType = currentType local color if( ShadowUF.db.profile.units[frame.unitType].powerBar.colorType == "class" and UnitIsPlayer(frame.unit) ) then @@ -29,7 +31,15 @@ function Power:UpdateColor(frame) end if( not color ) then - color = ShadowUF.db.profile.powerColors[frame.powerBar.currentType] or ShadowUF.db.profile.powerColors.MANA + color = ShadowUF.db.profile.powerColors[frame.powerBar.currentType] + if( not color ) then + if( altR ) then + altColor.r, altColor.g, altColor.b = altR, altG, altB + color = altColor + else + color = ShadowUF.db.profile.powerColors.MANA + end + end end if( not ShadowUF.db.profile.units[frame.unitType].powerBar.invert ) then From 14f1b59731d4bc36284e9bea99af494b2c02629a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 14 Sep 2012 09:38:01 -0700 Subject: [PATCH 271/794] Default state of altPower is now hidden so it won't show up temporarily and then hide itself --- modules/altpower.lua | 1 + modules/layout.lua | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index dbbdac77..6ee979d4 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -1,4 +1,5 @@ local AltPower = {} +AltPower.defaultVisibility = false ShadowUF:RegisterModule(AltPower, "altPowerBar", ShadowUF.L["Alt. Power bar"], true) function AltPower:OnEnable(frame) diff --git a/modules/layout.lua b/modules/layout.lua index a630397b..225c020a 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -347,7 +347,12 @@ function Layout:SetupBars(frame, config) local key = module.moduleKey local widget = frame[key] if( widget and ( module.moduleHasBar or config[key] and config[key].isBar ) ) then - self:ToggleVisibility(widget, frame.visibility[key]) + if( frame.visibility[key] and not frame[key].defaultHidden and module.defaultVisibility == false ) then + frame[key].defaultHidden = true + self:ToggleVisibility(widget, false) + else + self:ToggleVisibility(widget, frame.visibility[key]) + end if( widget:IsShown() and widget.SetStatusBarTexture ) then widget:SetStatusBarTexture(mediaPath.statusbar) From 4d0a240783f169c3f178a0a5c721895ac49cdb7c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 14 Sep 2012 09:54:54 -0700 Subject: [PATCH 272/794] Add configuration for Fel Energy too with its wacky key --- ShadowedUnitFrames.lua | 6 +++++- modules/defaultlayout.lua | 3 ++- options/config.lua | 8 ++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index c88e4b3a..e647cd8d 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 21 +ShadowUF.dbRevision = 22 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -83,6 +83,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + + if( revision <= 21 ) then + self.db.profile.powerColors["POWER_TYPE_FEL_ENERGY"] = {r = 0.878, g = 0.980, b = 0} + end if( revision <= 20 ) then self.db.profile.powerColors["ALTERNATE"] = {r = 0.71, g = 0.0, b = 1.0} diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 4a6d1dee..9eeb6afa 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -161,7 +161,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) ALTERNATE = {r = 0.71, g = 0.0, b = 1.0}, CHI = {r = 0.71, g = 1.0, b = 0.92}, STATUE = {r = 0.35, g = 0.45, b = 0.60}, - MUSHROOMS = {r = 0.20, g = 0.90, b = 0.20} + MUSHROOMS = {r = 0.20, g = 0.90, b = 0.20}, + POWER_TYPE_FEL_ENERGY = {r = 0.878, g = 0.980, b = 0} } config.healthColors = { tapped = {r = 0.5, g = 0.5, b = 0.5}, diff --git a/options/config.lua b/options/config.lua index a21018fd..54a91764 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1205,6 +1205,14 @@ local function loadGeneralOptions() arg = "powerColors.STATUE", hidden = function(info) return select(2, UnitClass("player")) ~= "MONK" end, }, + POWER_TYPE_FEL_ENERGY = { + order = 18, + type = "color", + name = L["Fel Energy"], + hasAlpha = true, + arg = "powerColors.POWER_TYPE_FEL_ENERGY", + hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, + }, }, }, cast = { From 92c7cccc6e31b2a962ad56f2f06cc7f770078d38 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 14 Sep 2012 10:37:49 -0700 Subject: [PATCH 273/794] Do a one time frame strata/level bump instead --- ShadowedUnitFrames.lua | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index e647cd8d..11081881 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -615,17 +615,11 @@ function ShadowUF:HideBlizzardFrames() if( not active_hiddens.lfd ) then active_hiddens.lfd = true - - for _, frame in pairs({QueueStatusFrame, LFDQueueFrameCooldownFrame}) do - if( frame ) then - hooksecurefunc(frame, "SetFrameLevel", function(frame, value) - local parentLevel = frame:GetFrameLevel() + 5 - if( value < parentLevel ) then - frame:SetFrameLevel(parentLevel + 10) - end - end) - end - end + LFDQueueFrameCooldownFrame:SetFrameLevel(QueueStatusFrame:GetFrameLevel() + 20) + LFDQueueFrameCooldownFrame:SetFrameStrata("TOOLTIP") + + QueueStatusFrame:SetFrameLevel(QueueStatusFrame:GetFrameLevel() + 20) + QueueStatusFrame:SetFrameStrata("TOOLTIP") end -- Don't modify the raid menu because that will taint the MA/MT stuff and it'll break and that's bad From ade28582d877da69b3fd45693ed6b163d1baa95f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 16 Sep 2012 09:11:38 -0700 Subject: [PATCH 274/794] Fixed power bar updating for Warlock pets --- modules/power.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/power.lua b/modules/power.lua index 1c78cb99..4a52d270 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -58,6 +58,7 @@ function Power:UpdateColor(frame) end end + frame.powerBar.currentType = string.gsub(frame.powerBar.currentType, "POWER_TYPE_FEL_", "") self:Update(frame) end @@ -67,4 +68,4 @@ function Power:Update(frame, event, unit, powerType) frame.powerBar.currentPower = UnitPower(frame.unit) frame.powerBar:SetMinMaxValues(0, UnitPowerMax(frame.unit)) frame.powerBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or frame.powerBar.currentPower) -end \ No newline at end of file +end From d305e956ea5ed527a66c0c5b107c8f519c0c15be Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 16 Sep 2012 13:36:54 -0700 Subject: [PATCH 275/794] Cleanup --- modules/incheal.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index affff276..10c49279 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -1,7 +1,5 @@ local IncHeal = {} -local frames = {} ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) --- ShadowUF.Tags.customEvents["CRTABS"] = IncHeal function IncHeal:OnEnable(frame) frame.incHeal = frame.incHeal or ShadowUF.Units:CreateBar(frame) From fc408363e6ef0c37425906eb346bc7add7425247 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 16 Sep 2012 13:40:46 -0700 Subject: [PATCH 276/794] Inc heal is now shown when unlocked --- modules/movers.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/movers.lua b/modules/movers.lua index 9acd8236..afc4868e 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -53,6 +53,9 @@ local function createConfigEnv() return getValue("UnitPower", unit, math.random(20000, 50000)) end, + UnitGetIncomingHeals = function(unit) + return getValue("UnitGetIncomingHeals", unit, math.random(5000, 10000)) + end, UnitPowerMax = function(unit, powerType) if( powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS ) then return 3 From b5e3e3b8c42e0117971d06fa95fa79ff8215f715 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 16 Sep 2012 13:41:05 -0700 Subject: [PATCH 277/794] Fix frame level of incoming heal bars --- modules/incheal.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index 10c49279..10bc3e0e 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -3,7 +3,7 @@ ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) function IncHeal:OnEnable(frame) frame.incHeal = frame.incHeal or ShadowUF.Units:CreateBar(frame) - + if( ShadowUF.db.profile.units[frame.unitType].incHeal.heals ) then frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") @@ -31,7 +31,7 @@ function IncHeal:OnLayoutApplied(frame) if( ( ShadowUF.db.profile.units[frame.unitType].healthBar.invert and ShadowUF.db.profile.bars.backgroundAlpha == 0 ) or ( not ShadowUF.db.profile.units[frame.unitType].healthBar.invert and ShadowUF.db.profile.bars.alpha == 1 ) ) then frame.incHeal.simple = true frame.incHeal:SetWidth(frame.healthBar:GetWidth() * ShadowUF.db.profile.units[frame.unitType].incHeal.cap) - frame.incHeal:SetFrameLevel(frame.topFrameLevel - 3) + frame.incHeal:SetFrameLevel(frame.topFrameLevel - 1) frame.incHeal:ClearAllPoints() frame.incHeal:SetPoint("TOPLEFT", frame.healthBar) From b845398bf1e66fc5328527abe56fba153071690a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 16 Sep 2012 13:45:50 -0700 Subject: [PATCH 278/794] Indentation --- modules/range.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index 7dd6025c..1c0489c6 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -57,8 +57,8 @@ function Range:OnLayoutApplied(frame) hostileSpell = ShadowUF.db.profile.range["hostile" .. playerClass] or self.hostile[playerClass] if( not GetSpellInfo(hostileSpell) ) then hostileSpell = nil end - friendlySpell = ShadowUF.db.profile.range["friendly" .. playerClass] or self.friendly[playerClass] - if( not GetSpellInfo(friendlySpell) ) then friendlySpell = nil end + friendlySpell = ShadowUF.db.profile.range["friendly" .. playerClass] or self.friendly[playerClass] + if( not GetSpellInfo(friendlySpell) ) then friendlySpell = nil end end function Range:OnDisable(frame) From 2fa3ba220b9816eaecc4f30576aea82f9b3c02c7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 16 Sep 2012 13:48:54 -0700 Subject: [PATCH 279/794] Fixed range checker not being re-enabled if it was disabled then enabled again --- modules/range.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index 1c0489c6..fbd5c732 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -13,11 +13,6 @@ local function checkRange(self, elapsed) if( self.timeElapsed <= 0.50 ) then return end self.timeElapsed = 0 - -- Bypass any checks if it's the player - if( UnitIsUnit(self.parent.unit, "player") ) then - return self.parent:SetRangeAlpha(ShadowUF.db.profile.units[self.parent.unitType].range.inAlpha) - end - local frame = self.parent local spell -- check which spell to use @@ -39,7 +34,13 @@ local function checkRange(self, elapsed) end function Range:ForceUpdate(frame) - checkRange(frame.range, 1) + if( UnitIsUnit(self.parent.unit, "player") ) then + frame:SetRangeAlpha(ShadowUF.db.profile.units[frame.unitType].range.inAlpha) + frame.range:Hide() + else + frame.range:Show() + checkRange(frame.range, 1) + end end function Range:OnEnable(frame) @@ -48,8 +49,10 @@ function Range:OnEnable(frame) frame.range:SetScript("OnUpdate", checkRange) frame.range.timeElapsed = 0 frame.range.parent = frame - frame.range:Show() end + + frame.range:Show() + frame:RegisterUpdateFunc(self, "ForceUpdate") end From 0fdc1c94102b60c2e54b5cbea9b9ffcf56ee2db2 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 16 Sep 2012 13:50:50 -0700 Subject: [PATCH 280/794] Optimize the range checker. If the unit is a player, disable the updater completely, otherwise keep running it as normal --- modules/range.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index fbd5c732..4b6322b2 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -15,10 +15,11 @@ local function checkRange(self, elapsed) local frame = self.parent local spell - -- check which spell to use - if UnitIsFriend("player", frame.unit) then + + -- Check which spell to use + if( UnitIsFriend("player", frame.unit) ) then spell = friendlySpell - elseif UnitCanAttack("player", frame.unit) then + elseif( UnitCanAttack("player", frame.unit) ) then spell = hostileSpell end @@ -34,7 +35,7 @@ local function checkRange(self, elapsed) end function Range:ForceUpdate(frame) - if( UnitIsUnit(self.parent.unit, "player") ) then + if( UnitIsUnit(frame.unit, "player") ) then frame:SetRangeAlpha(ShadowUF.db.profile.units[frame.unitType].range.inAlpha) frame.range:Hide() else From 0260a1a89b21db26b9be4864bee2efe698a2efa3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 16 Sep 2012 13:51:45 -0700 Subject: [PATCH 281/794] Syntax cleanup --- modules/range.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index 4b6322b2..d8726d11 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -24,13 +24,13 @@ local function checkRange(self, elapsed) end if( spell ) then - self.parent:SetRangeAlpha(IsSpellInRange(spell, frame.unit) == 1 and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) + frame:SetRangeAlpha(IsSpellInRange(spell, frame.unit) == 1 and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) -- That didn't work, but they are grouped lets try the actual API for this, it's a bit flaky though and not that useful generally elseif( UnitInRaid(frame.unit) or UnitInParty(frame.unit) ) then - self.parent:SetRangeAlpha(UnitInRange(frame.unit, "player") and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) + frame:SetRangeAlpha(UnitInRange(frame.unit, "player") and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) -- Nope, fall back to interaction :( else - self.parent:SetRangeAlpha(CheckInteractDistance(frame.unit, 4) and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) + frame:SetRangeAlpha(CheckInteractDistance(frame.unit, 4) and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) end end From 785cf79c0e43beca327608499148bab69f357f2d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 17 Sep 2012 15:59:54 -0700 Subject: [PATCH 282/794] Support for top -> bottom, bottom -> top and right -> left bar growths have been added under widget size when advanced settings are enabled --- modules/burningembers.lua | 2 ++ modules/combopoints.lua | 2 +- modules/layout.lua | 3 +++ modules/totems.lua | 4 +++- options/config.lua | 19 ++++++++++++++++++- 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/modules/burningembers.lua b/modules/burningembers.lua index 68763968..4674ddc4 100755 --- a/modules/burningembers.lua +++ b/modules/burningembers.lua @@ -54,6 +54,8 @@ function Embers:OnLayoutApplied(frame) ember:GetStatusBarTexture():SetHorizTile(false) ember:SetHeight(frame.burningEmbersBar:GetHeight()) ember:SetMinMaxValues(0, MAX_POWER_PER_EMBER) + ember:SetOrientation(ShadowUF.db.profile.units[frame.unitType].burningEmbersBar.vertical and "VERTICAL" or "HORIZONTAL") + ember:SetReverseFill(ShadowUF.db.profile.units[frame.unitType].burningEmbersBar.reverse and true or false) ember.setColor = nil end diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 68699b43..7543d8a8 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -1,4 +1,4 @@ -local Combo = {} +local Combo = {isComboPoints = true} ShadowUF:RegisterModule(Combo, "comboPoints", ShadowUF.L["Combo points"]) ShadowUF.ComboPoints = Combo local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBOPOINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} diff --git a/modules/layout.lua b/modules/layout.lua index 225c020a..302ff724 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -357,6 +357,9 @@ function Layout:SetupBars(frame, config) if( widget:IsShown() and widget.SetStatusBarTexture ) then widget:SetStatusBarTexture(mediaPath.statusbar) widget:GetStatusBarTexture():SetHorizTile(false) + + widget:SetOrientation(config[key].vertical and "VERTICAL" or "HORIZONTAL") + widget:SetReverseFill(config[key].reverse and true or false) end if( widget.background ) then diff --git a/modules/totems.lua b/modules/totems.lua index 012aabc6..9497b709 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -79,9 +79,11 @@ function Totems:OnLayoutApplied(frame) else totem.background:Hide() end - + totem:SetHeight(frame.totemBar:GetHeight()) totem:SetWidth(barWidth) + totem:SetOrientation(ShadowUF.db.profile.units[frame.unitType].totemBar.vertical and "VERTICAL" or "HORIZONTAL") + totem:SetReverseFill(ShadowUF.db.profile.units[frame.unitType].totemBar.reverse and true or false) totem:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) totem:SetStatusBarColor(totemColors[totem.id].r, totemColors[totem.id].g, totemColors[totem.id].b, ShadowUF.db.profile.bars.alpha) totem:GetStatusBarTexture():SetHorizTile(false) diff --git a/options/config.lua b/options/config.lua index 54a91764..5d429463 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2226,6 +2226,23 @@ local function loadUnitOptions() end, arg = "$parent.backgroundColor", }, + sep3 = {order = 1.66, type = "description", name = "", hidden = function(info) return info[#(info) - 1] ~= "burningEmbersBar" or not ShadowUF.db.profile.advanced end}, + vertical = { + order = 1.70, + type = "toggle", + name = L["Vertical growth"], + desc = L["Rather than bars filling from left -> right, they will fill from bottom -> top."], + arg = "$parent.vertical", + hidden = function(info) return not ShadowUF.db.profile.advanced or ShadowUF.modules[info[#(info) - 1]].isComboPoints end, + }, + reverse = { + order = 1.71, + type = "toggle", + name = L["Reverse fill"], + desc = L["Will fill right -> left when using horizontal growth, or top -> bottom when using vertical growth."], + arg = "$parent.reverse", + hidden = function(info) return not ShadowUF.db.profile.advanced or ShadowUF.modules[info[#(info) - 1]].isComboPoints end, + }, sep2 = {order = 1.75, type = "description", name = "", hidden = function(info) local moduleKey = info[#(info) - 1] return ( moduleKey ~= "healthBar" and moduleKey ~= "powerBar" and moduleKey ~= "druidBar" and moduleKey ~= "monkBar" and moduleKey ~= "burningEmbersBar" ) or not ShadowUF.db.profile.advanced @@ -2254,7 +2271,7 @@ local function loadUnitOptions() min = 0, max = 10, step = 0.1, hidden = hideBarOption, arg = "$parent.height", - }, + } }, } From da78c6d66d7f5dc7d59f416a57907a24b485b377 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 17 Sep 2012 17:06:49 -0700 Subject: [PATCH 283/794] Loading SUF Bars will print a deprecated warning and disable it --- ShadowedUnitFrames.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 11081881..7449e055 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -398,6 +398,13 @@ end -- Module APIs function ShadowUF:RegisterModule(module, key, name, isBar, class, spec, level) + -- September 17th, 2012 + if( key == "impbars" ) then + ShadowUF:Print("WARNING: ShadowedUF_Bars is no longer supported and is now built in under advanced options.") + DisableAddOn("ShadowedUF_Bars") + return + end + self.modules[key] = module module.moduleKey = key From 34abb72eff16f3d8e509656bd988e5299298b4f3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 19 Sep 2012 16:13:01 -0700 Subject: [PATCH 284/794] Disable current power filtering for tags for the time being while I sort out inconsistency issues on Blizzards side --- modules/tags.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 32d4c8ef..137df31f 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -31,16 +31,18 @@ function Tags:RegisterEvents(parent, fontString, tags) for event in string.gmatch(tagEvents, "%S+") do -- Power filter event, store it instead if( powerFilters[event] ) then - fontString.powerFilters = fontString.powerFilters or {} - fontString.powerFilters[powerFilters[event]] = true - - if( powerFilters[event] == "CURRENT" ) then - if( not hasPowerFilters ) then - parent:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdatePowerType") - parent:RegisterUpdateFunc(self, "UpdatePowerType") - end + if( powerFilters[event] ~= "CURRENT" ) then + fontString.powerFilters = fontString.powerFilters or {} + fontString.powerFilters[powerFilters[event]] = true + + if( powerFilters[event] == "CURRENT" ) then + if( not hasPowerFilters ) then + parent:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdatePowerType") + parent:RegisterUpdateFunc(self, "UpdatePowerType") + end - hasPowerFilters = true + hasPowerFilters = true + end end -- Custom event registered by another module From 07c545c363a3d7ca8a79cddf451576384b6b6b80 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 20 Sep 2012 23:14:00 -0700 Subject: [PATCH 285/794] Fixed throttled power updates for custom power types like Warlock pets or Ulduar vehicles --- modules/power.lua | 11 +++++++++-- modules/tags.lua | 43 ++++++++++++++++++++++++++++--------------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/modules/power.lua b/modules/power.lua index 4a52d270..0ad3efa3 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -1,4 +1,5 @@ local Power = {} +local powerMap = ShadowUF.Tags.powerMap ShadowUF:RegisterModule(Power, "powerBar", ShadowUF.L["Power bar"], true) function Power:OnEnable(frame) @@ -21,7 +22,7 @@ end local altColor = {} function Power:UpdateColor(frame) - local currentType, altR, altG, altB = select(2, UnitPowerType(frame.unit)) + local powerID, currentType, altR, altG, altB = UnitPowerType(frame.unit) frame.powerBar.currentType = currentType local color @@ -58,11 +59,17 @@ function Power:UpdateColor(frame) end end - frame.powerBar.currentType = string.gsub(frame.powerBar.currentType, "POWER_TYPE_FEL_", "") + -- Overridden power types like Warlock pets, or Ulduar vehicles use "POWER_TYPE_#####" but triggers power events with "ENERGY", so this fixes that + -- by using the powerID to figure out the event type + if( not powerMap[currentType] ) then + frame.powerBar.currentType = powerMap[powerID] or "ENERGY" + end + self:Update(frame) end function Power:Update(frame, event, unit, powerType) + print(unit, powerType, frame.powerBar.currentType) if( event and powerType and powerType ~= frame.powerBar.currentType ) then return end frame.powerBar.currentPower = UnitPower(frame.unit) diff --git a/modules/tags.lua b/modules/tags.lua index 137df31f..09ccac18 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1,10 +1,25 @@ -- Thanks to haste for the original tagging code, which I then mostly ripped apart and stole! -local Tags = {afkStatus = {}, offlineStatus = {}, customEvents = {}} -local tagPool, functionPool, temp, regFontStrings, frequentUpdates, frequencyCache = {}, {}, {}, {}, {}, {} +local Tags = {afkStatus = {}, offlineStatus = {}, customEvents = {}, powerMap = {}} +local tagPool, functionPool, temp, regFontStrings, frequentUpdates, frequencyCache, powerMap = {}, {}, {}, {}, {}, {}, {} local L = ShadowUF.L ShadowUF.Tags = Tags +-- Map the numeric index to the string +local numerics = {} +for id, color in pairs(PowerBarColor) do + if( type(id) == "number" ) then + numerics[color] = id + end +end + +for id, color in pairs(PowerBarColor) do + if( type(id) == "string" and numerics[color] ) then + powerMap[numerics[color]] = id + powerMap[id] = true + end +end + -- Avoid having to do string.match on every event local powerFilters = {["SUF_POWERTYPE:CURRENT"] = "CURRENT"} for powerType in pairs(PowerBarColor) do @@ -31,18 +46,16 @@ function Tags:RegisterEvents(parent, fontString, tags) for event in string.gmatch(tagEvents, "%S+") do -- Power filter event, store it instead if( powerFilters[event] ) then - if( powerFilters[event] ~= "CURRENT" ) then - fontString.powerFilters = fontString.powerFilters or {} - fontString.powerFilters[powerFilters[event]] = true - - if( powerFilters[event] == "CURRENT" ) then - if( not hasPowerFilters ) then - parent:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdatePowerType") - parent:RegisterUpdateFunc(self, "UpdatePowerType") - end - - hasPowerFilters = true + fontString.powerFilters = fontString.powerFilters or {} + fontString.powerFilters[powerFilters[event]] = true + + if( powerFilters[event] == "CURRENT" ) then + if( not hasPowerFilters ) then + parent:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdatePowerType") + parent:RegisterUpdateFunc(self, "UpdatePowerType") end + + hasPowerFilters = true end -- Custom event registered by another module @@ -63,8 +76,8 @@ end -- Update the cached power type function Tags:UpdatePowerType(frame) - local powerType = select(2, UnitPowerType(frame.unit)) - if( powerType ) then powerType = string.gsub(powerType, "POWER_TYPE_FEL_", "") end + local powerID, powerType = UnitPowerType(frame.unit) + if( not powerMap[powerType] ) then powerType = powerMap[powerID] or "ENERGY" end for _, fontString in pairs(frame.fontStrings) do if( fontString.UpdateTags ) then From 1b6bde39eb1213e9fea84f1cf08175a591740b26 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 20 Sep 2012 23:15:57 -0700 Subject: [PATCH 286/794] Removed debug --- modules/power.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/power.lua b/modules/power.lua index 0ad3efa3..07be7462 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -69,7 +69,6 @@ function Power:UpdateColor(frame) end function Power:Update(frame, event, unit, powerType) - print(unit, powerType, frame.powerBar.currentType) if( event and powerType and powerType ~= frame.powerBar.currentType ) then return end frame.powerBar.currentPower = UnitPower(frame.unit) From cb67af25da0ffa99d6517901fd6d32e26904e50c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 20 Sep 2012 23:17:13 -0700 Subject: [PATCH 287/794] Druid mana bar will no longer show while in a vehicle --- modules/druid.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/druid.lua b/modules/druid.lua index 22a768ce..0124b097 100755 --- a/modules/druid.lua +++ b/modules/druid.lua @@ -33,7 +33,7 @@ function Druid:OnLayoutApplied(frame) end function Druid:PowerChanged(frame) - local visible = UnitPowerType(frame.unit) ~= ADDITIONAL_POWER_BAR_INDEX + local visible = UnitPowerType(frame.unit) ~= ADDITIONAL_POWER_BAR_INDEX and not frame.inVehicle local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent" frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") From fd9ec797a03e03b1b7574f399dc157f1e468c321 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 20 Sep 2012 23:17:13 -0700 Subject: [PATCH 288/794] Druid mana bar will no longer show while in a vehicle --- modules/druid.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/druid.lua b/modules/druid.lua index 22a768ce..0124b097 100755 --- a/modules/druid.lua +++ b/modules/druid.lua @@ -33,7 +33,7 @@ function Druid:OnLayoutApplied(frame) end function Druid:PowerChanged(frame) - local visible = UnitPowerType(frame.unit) ~= ADDITIONAL_POWER_BAR_INDEX + local visible = UnitPowerType(frame.unit) ~= ADDITIONAL_POWER_BAR_INDEX and not frame.inVehicle local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent" frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") From bb5cce15f9d4ce913ae4c380e3b4126f1170bfae Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 20 Sep 2012 23:30:45 -0700 Subject: [PATCH 289/794] Oops, wrong one --- modules/tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tags.lua b/modules/tags.lua index 09ccac18..87efb56d 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1,6 +1,6 @@ -- Thanks to haste for the original tagging code, which I then mostly ripped apart and stole! local Tags = {afkStatus = {}, offlineStatus = {}, customEvents = {}, powerMap = {}} -local tagPool, functionPool, temp, regFontStrings, frequentUpdates, frequencyCache, powerMap = {}, {}, {}, {}, {}, {}, {} +local tagPool, functionPool, temp, regFontStrings, frequentUpdates, frequencyCache, powerMap = {}, {}, {}, {}, {}, {}, Tags.powerMap local L = ShadowUF.L ShadowUF.Tags = Tags From beb74f6604a7f1d295f67b7e5feb01a9bbdca129 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 21 Sep 2012 19:04:57 -0700 Subject: [PATCH 290/794] Initial work to implement 'battleground' units --- ShadowedUnitFrames.lua | 10 ++++--- modules/defaultlayout.lua | 55 ++++++++++++++++++++++++++++++++++++++- modules/units.lua | 6 +++-- options/config.lua | 42 ++++++++++++++++++++---------- 4 files changed, 93 insertions(+), 20 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 7449e055..fd91397f 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,14 +4,14 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 22 +ShadowUF.dbRevision = 23 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} ShadowUF.moduleOrder = {} -ShadowUF.unitList = {"player", "pet", "pettarget", "target", "targettarget", "targettargettarget", "focus", "focustarget", "party", "partypet", "partytarget", "raid", "raidpet", "boss", "bosstarget", "maintank", "maintanktarget", "mainassist", "mainassisttarget", "arena", "arenatarget", "arenapet"} +ShadowUF.unitList = {"player", "pet", "pettarget", "target", "targettarget", "targettargettarget", "focus", "focustarget", "party", "partypet", "partytarget", "raid", "raidpet", "boss", "bosstarget", "maintank", "maintanktarget", "mainassist", "mainassisttarget", "arena", "arenatarget", "arenapet", "battleground", "battlegroundtarget", "battlegroundpet"} ShadowUF.fakeUnits = {["targettarget"] = true, ["targettargettarget"] = true, ["pettarget"] = true, ["arenatarget"] = true, ["focustarget"] = true, ["focustargettarget"] = true, ["partytarget"] = true, ["raidtarget"] = true, ["bosstarget"] = true, ["maintanktarget"] = true, ["mainassisttarget"] = true} -L.units = {["raidpet"] = L["Raid pet"], ["PET"] = L["Pet"], ["VEHICLE"] = L["Vehicle"], ["arena"] = L["Arena"], ["arenapet"] = L["Arena Pet"], ["arenatarget"] = L["Arena Target"], ["boss"] = L["Boss"], ["bosstarget"] = L["Boss Target"], ["focus"] = L["Focus"], ["focustarget"] = L["Focus Target"], ["mainassist"] = L["Main Assist"], ["mainassisttarget"] = L["Main Assist Target"], ["maintank"] = L["Main Tank"], ["maintanktarget"] = L["Main Tank Target"], ["party"] = L["Party"], ["partypet"] = L["Party Pet"], ["partytarget"] = L["Party Target"], ["pet"] = L["Pet"], ["pettarget"] = L["Pet Target"], ["player"] = L["Player"],["raid"] = L["Raid"], ["target"] = L["Target"], ["targettarget"] = L["Target of Target"], ["targettargettarget"] = L["Target of Target of Target"]} +L.units = {["raidpet"] = L["Raid pet"], ["PET"] = L["Pet"], ["VEHICLE"] = L["Vehicle"], ["arena"] = L["Arena"], ["arenapet"] = L["Arena Pet"], ["arenatarget"] = L["Arena Target"], ["boss"] = L["Boss"], ["bosstarget"] = L["Boss Target"], ["focus"] = L["Focus"], ["focustarget"] = L["Focus Target"], ["mainassist"] = L["Main Assist"], ["mainassisttarget"] = L["Main Assist Target"], ["maintank"] = L["Main Tank"], ["maintanktarget"] = L["Main Tank Target"], ["party"] = L["Party"], ["partypet"] = L["Party Pet"], ["partytarget"] = L["Party Target"], ["pet"] = L["Pet"], ["pettarget"] = L["Pet Target"], ["player"] = L["Player"],["raid"] = L["Raid"], ["target"] = L["Target"], ["targettarget"] = L["Target of Target"], ["targettargettarget"] = L["Target of Target of Target"], ["battleground"] = L["Battleground"], ["battlegroundpet"] = L["Battleground Pet"], ["battlegroundtarget"] = L["Battleground Target"]} -- Cache the units so we don't have to concat every time it updates ShadowUF.unitTarget = setmetatable({}, {__index = function(tbl, unit) rawset(tbl, unit, unit .. "target"); return unit .. "target" end}) @@ -84,6 +84,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + if( revision <= 22 ) then + self:LoadDefaultLayout(true) + end + if( revision <= 21 ) then self.db.profile.powerColors["POWER_TYPE_FEL_ENERGY"] = {r = 0.878, g = 0.980, b = 0} end diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 9eeb6afa..3c6ba8a0 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -102,7 +102,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) borderColor = {r = 0.30, g = 0.30, b = 0.50, a = 1}, } config.hidden = { - cast = false, runes = true, buffs = false, party = true, player = true, pet = true, target = true, focus = true, boss = true, arena = true + cast = false, buffs = false, party = true, player = true, pet = true, target = true, focus = true, boss = true, arena = true, playerAltPower = true, playerPower = true } config.font = { name = "Myriad Condensed Web", @@ -210,6 +210,9 @@ function ShadowUF:LoadDefaultLayout(useMerge) arena = {anchorPoint = "C", anchorTo = "UIParent", point = "", relativePoint = "", x = 0, y = 0}, arenapet = {anchorPoint = "RB", anchorTo = "$parent", x = 0, y = 0}, arenatarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, + battleground = {anchorPoint = "C", anchorTo = "UIParent", point = "", relativePoint = "", x = 0, y = 0}, + battlegroundpet = {anchorPoint = "RB", anchorTo = "$parent", x = 0, y = 0}, + battlegroundtarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, boss = {anchorPoint = "C", anchorTo = "UIParent", point = "", relativePoint = "", x = 0, y = 0}, bosstarget = {anchorPoint = "RB", anchorTo = "$parent", x = 0, y = 0}, } @@ -456,6 +459,56 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[name]"}, }, }, + battleground = { + width = 170, + height = 45, + scale = 1.0, + attribPoint = "TOP", + attribAnchorPoint = "LEFT", + portrait = {enabled = false, fullAfter = 50}, + castBar = {order = 60}, + offset = 25, + auras = { + buffs = {enabled = false, maxRows = 1, perRow = 9}, + debuffs = {enabled = false, maxRows = 1, perRow = 9}, + }, + text = { + {text = "[name]"}, + {text = "[curmaxhp]"}, + {text = "[perpp]"}, + {text = "[curmaxpp]"}, + {text = "[name]"}, + }, + }, + battlegroundpet = { + width = 90, + height = 25, + scale = 1.0, + powerBar = {height = 0.60}, + text = { + {text = "[name]"}, + {text = "[curhp]"}, + {text = ""}, + {text = ""}, + {text = "[name]"}, + }, + }, + battlegroundtarget = { + width = 90, + height = 25, + scale = 1.0, + powerBar = {height = 0.60}, + indicators = { + pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, + }, + text = { + {text = "[name]"}, + {text = "[curhp]"}, + {text = ""}, + {text = ""}, + {text = "[name]"}, + }, + }, maintank = { width = 150, height = 40, diff --git a/modules/units.lua b/modules/units.lua index 6f74082f..efd5f488 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1,11 +1,13 @@ -local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}} +local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}, remappedUnits = {}} Units.childUnits = {["partytarget"] = "party", ["partypet"] = "party", ["maintanktarget"] = "maintank", ["mainassisttarget"] = "mainassist", ["bosstarget"] = "boss", ["arenatarget"] = "arena", ["arenapet"] = "arena"} -Units.zoneUnits = {["arena"] = "arena", ["boss"] = "raid"} +Units.zoneUnits = {["arena"] = "arena", ["boss"] = "raid", ["battleground"] = "arena"} +Units.remappedUnits = {["battleground"] = "arena", ["battlegroundpet"] = "arenapet", ["battlegroundtarget"] = "arenatarget"} Units.headerUnits = {["raid"] = true, ["party"] = true, ["maintank"] = true, ["mainassist"] = true, ["raidpet"] = true, ["partypet"] = true} local stateMonitor = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") local playerClass = select(2, UnitClass("player")) local unitFrames, headerFrames, frameList, unitEvents, childUnits, headerUnits, queuedCombat = Units.unitFrames, Units.headerFrames, Units.frameList, Units.unitEvents, Units.childUnits, Units.headerUnits, {} +local remappedUnits = Units.remappedUnits local _G = getfenv(0) ShadowUF.Units = Units diff --git a/options/config.lua b/options/config.lua index 5d429463..196cd6ce 100755 --- a/options/config.lua +++ b/options/config.lua @@ -19,12 +19,17 @@ local unitCategories = { general = {"target", "targettarget", "targettargettarget", "focus", "focustarget", "pettarget"}, party = {"party", "partypet", "partytarget"}, raid = {"raid", "raidpet", "boss", "bosstarget", "maintank", "maintanktarget", "mainassist", "mainassisttarget"}, - arena = {"arena", "arenapet", "arenatarget"}} + arena = {"arena", "arenapet", "arenatarget"}, + battleground = {"battleground", "battlegroundpet", "battlegroundtarget"} +} local UNIT_DESC = { ["boss"] = L["Boss units are for only certain fights, such as Blood Princes or the Gunship battle, you will not see them for every boss fight."], ["mainassist"] = L["Main Assists's are set by the Blizzard Main Assist system or mods that use them such as oRA3."], ["maintank"] = L["Main Tank's are set by the Blizzard Main Tank system or mods that use them such as oRA3."], + ["battleground"] = L["Currently used in battlegrounds for showing flag carriers."], + ["battlegroundpet"] = L["Current pet used by a battleground unit"], + ["battlegroundtarget"] = L["Current target of a battleground unit"] } local PAGE_DESC = { @@ -37,7 +42,7 @@ local PAGE_DESC = { ["filter"] = L["Simple aura filtering by whitelists and blacklists."], } local INDICATOR_NAMES = {["questBoss"] = L["Quest Boss"], ["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon Role"], ["masterLoot"] = L["Master Looter"], ["pvp"] = L["PvP Flag"], ["raidTarget"] = L["Raid Target"], ["ready"] = L["Ready Status"], ["role"] = L["Raid Role"], ["status"] = L["Combat Status"], ["class"] = L["Class Icon"], ["resurrect"] = L["Resurrect Status"], ["phase"] = L["Other Party/Phase Status"], ["petBattle"] = L["Pet Battle"]} -local AREA_NAMES = {["arena"] = L["Arenas"],["none"] = L["Everywhere else"], ["party"] = L["Party instances"], ["pvp"] = L["Battlegrounds"], ["raid"] = L["Raid instances"]} +local AREA_NAMES = {["arena"] = L["Arenas"],["none"] = L["Everywhere else"], ["party"] = L["Party instances"], ["pvp"] = L["Battleground"], ["raid"] = L["Raid instances"]} local INDICATOR_DESC = { ["leader"] = L["Crown indicator for group leaders."], ["lfdRole"] = L["Role the unit is playing in dungeons formed through the Looking For Dungeon system."], ["masterLoot"] = L["Bag indicator for master looters."], ["pvp"] = L["PVP flag indicator, Horde for Horde flagged pvpers and Alliance for Alliance flagged pvpers."], @@ -1419,6 +1424,7 @@ local function loadHideOptions() type = "toggle", name = function(info) local key = info[#(info)] + if( key == "arena" ) then return string.format(L["Hide %s frames"], "arena/battleground") end return L.units[key] and string.format(L["Hide %s frames"], string.lower(L.units[key])) or string.format(L["Hide %s"], key == "cast" and L["player cast bar"] or key == "playerPower" and L["player power frames"] or key == "buffs" and L["buff frames"] or key == "playerAltPower" and L["player alt. power"]) end, set = function(info, value) @@ -2520,7 +2526,7 @@ local function loadUnitOptions() name = L["On aggro"], desc = L["Highlight units that have aggro on any mob."], arg = "highlight.aggro", - hidden = function(info) return info[2] == "arena" or info[2] == "arenapet" or ShadowUF.fakeUnits[info[2]] end, + hidden = function(info) return ShadowUF.Units.zoneUnits[info[2]] or info[2] == "battlegroundpet" or info[2] == "arenapet" or ShadowUF.fakeUnits[info[2]] end, }, debuff = { order = 6, @@ -2528,7 +2534,14 @@ local function loadUnitOptions() name = L["On curable debuff"], desc = L["Highlight units that are debuffed with something you can cure."], arg = "highlight.debuff", - hidden = function(info) return string.match(info[2], "^arena") or string.match(info[2], "^boss") end, + hidden = function(info) return ShadowUF.Units.zoneUnits[info[2]] or info[2] == "battlegroundpet" or info[2] == "arenapet" end, + }, + sep = { + order = 6.5, + type = "description", + name = "", + width = "full", + hidden = function(info) return not (ShadowUF.Units.zoneUnits[info[2]] or info[2] == "battlegroundpet" or info[2] == "arenapet" or ShadowUF.fakeUnits[info[2]]) end, }, alpha = { order = 7, @@ -3155,7 +3168,7 @@ local function loadUnitOptions() name = function(info) return L.units[info[#(info) - 1]] end, hidden = function(info) local unit = info[#(info) - 1] - return unit ~= "raid" and unit ~= "raidpet" and unit ~= "party" and unit ~= "mainassist" and unit ~= "maintank" and unit ~= "boss" and unit ~= "arena" + return unit ~= "raid" and unit ~= "raidpet" and unit ~= "party" and unit ~= "mainassist" and unit ~= "maintank" and not ShadowUF.Units.zoneUnits[unit] end, set = function(info, value) setUnit(info, value) @@ -3348,7 +3361,7 @@ local function loadUnitOptions() name = L["Max columns"], min = 1, max = 20, step = 1, arg = "maxColumns", - hidden = function(info) return info[2] == "boss" or info[2] == "arena" or hideSplitOrRaidOption(info) end, + hidden = function(info) return ShadowUF.Units.zoneUnits[info[2]] or hideSplitOrRaidOption(info) end, }, unitsPerColumn = { order = 8, @@ -3356,7 +3369,7 @@ local function loadUnitOptions() name = L["Units per column"], min = 1, max = 40, step = 1, arg = "unitsPerColumn", - hidden = function(info) return info[2] == "boss" or info[2] == "arena" or hideSplitOrRaidOption(info) end, + hidden = function(info) return ShadowUF.Units.zoneUnits[info[2]] or hideSplitOrRaidOption(info) end, }, partyPerColumn = { order = 9, @@ -3391,7 +3404,7 @@ local function loadUnitOptions() type = "group", inline = true, name = L["Sorting"], - hidden = function(info) return info[2] == "boss" or info[2] == "arena" or ( info[2] ~= "raid" and not ShadowUF.db.profile.advanced ) end, + hidden = function(info) return ShadowUF.Units.zoneUnits[info[2]] or ( info[2] ~= "raid" and not ShadowUF.db.profile.advanced ) end, args = { sortMethod = { order = 2, @@ -3664,7 +3677,7 @@ local function loadUnitOptions() type = "toggle", name = string.format(L["Enable %s"], L["Alt. Power bar"]), desc = L["Shows a bar for alternate power info (used in some encounters)"], - hidden = hideRestrictedOption, + hidden = function(info) return ShadowUF.Units.fakeUnits[info[2]] or hideRestrictedOption(info) end, arg = "altPowerBar.enabled", }, colorType = { @@ -3809,7 +3822,7 @@ local function loadUnitOptions() type = "group", inline = true, name = L["Incoming heals"], - hidden = hideRestrictedOption, + hidden = function(info) return ShadowUF.Units.zoneUnits[info[2]] or hideRestrictedOption(info) end, disabled = function(info) return not getVariable(info[2], "healthBar", nil, "enabled") end, args = { heals = { @@ -4494,12 +4507,12 @@ local function loadUnitOptions() local unitCategory = { order = function(info) local cat = info[#(info)] - return cat == "playercat" and 50 or cat == "generalcat" and 100 or cat == "partycat" and 200 or cat == "raidcat" and 300 or 400 + return cat == "playercat" and 50 or cat == "generalcat" and 100 or cat == "partycat" and 200 or cat == "raidcat" and 300 or cat == "arenacat" and 400 or 500 end, type = "header", name = function(info) local cat = info[#(info)] - return cat == "playercat" and L["Player"] or cat == "generalcat" and L["General"] or cat == "raidcat" and L["Raid"] or cat == "partycat" and L["Party"] or cat == "arenacat" and L["Arena"] + return cat == "playercat" and L["Player"] or cat == "generalcat" and L["General"] or cat == "raidcat" and L["Raid"] or cat == "partycat" and L["Party"] or cat == "arenacat" and L["Arena"] or cat == "battlegroundcat" and L["Battlegrounds"] end, width = "full", } @@ -4508,7 +4521,7 @@ local function loadUnitOptions() options.args.enableUnits.args.enabled.args[cat .. "cat"] = unitCategory for _, unit in pairs(list) do - unitCatOrder[unit] = cat == "player" and 50 or cat == "general" and 100 or cat == "party" and 200 or cat == "raid" and 300 or 400 + unitCatOrder[unit] = cat == "player" and 50 or cat == "general" and 100 or cat == "party" and 200 or cat == "raid" and 300 or cat == "arena" and 400 or 500 end end @@ -4953,6 +4966,7 @@ local function loadFilterOptions() none = filterTable, pvp = filterTable, arena = filterTable, + battleground = filterTable, party = filterTable, raid = filterTable, } @@ -5864,7 +5878,7 @@ function Config:Open() loadOptions() LibStub("AceConfig-3.0"):RegisterOptionsTable("ShadowedUF", options) - AceDialog:SetDefaultSize("ShadowedUF", 845, 550) + AceDialog:SetDefaultSize("ShadowedUF", 880, 550) registered = true end From f63cd79c3d9a9cc6141e7396985b52796e5e00ef Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 21 Sep 2012 19:07:34 -0700 Subject: [PATCH 291/794] More initial work that was missed --- ShadowedUnitFrames.lua | 11 +++++++++-- modules/units.lua | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index fd91397f..550d5af2 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -10,7 +10,7 @@ ShadowUF.enabledUnits = {} ShadowUF.modules = {} ShadowUF.moduleOrder = {} ShadowUF.unitList = {"player", "pet", "pettarget", "target", "targettarget", "targettargettarget", "focus", "focustarget", "party", "partypet", "partytarget", "raid", "raidpet", "boss", "bosstarget", "maintank", "maintanktarget", "mainassist", "mainassisttarget", "arena", "arenatarget", "arenapet", "battleground", "battlegroundtarget", "battlegroundpet"} -ShadowUF.fakeUnits = {["targettarget"] = true, ["targettargettarget"] = true, ["pettarget"] = true, ["arenatarget"] = true, ["focustarget"] = true, ["focustargettarget"] = true, ["partytarget"] = true, ["raidtarget"] = true, ["bosstarget"] = true, ["maintanktarget"] = true, ["mainassisttarget"] = true} +ShadowUF.fakeUnits = {["targettarget"] = true, ["targettargettarget"] = true, ["pettarget"] = true, ["arenatarget"] = true, ["focustarget"] = true, ["focustargettarget"] = true, ["partytarget"] = true, ["raidtarget"] = true, ["bosstarget"] = true, ["maintanktarget"] = true, ["mainassisttarget"] = true, ["battlegroundtarget"] = true} L.units = {["raidpet"] = L["Raid pet"], ["PET"] = L["Pet"], ["VEHICLE"] = L["Vehicle"], ["arena"] = L["Arena"], ["arenapet"] = L["Arena Pet"], ["arenatarget"] = L["Arena Target"], ["boss"] = L["Boss"], ["bosstarget"] = L["Boss Target"], ["focus"] = L["Focus"], ["focustarget"] = L["Focus Target"], ["mainassist"] = L["Main Assist"], ["mainassisttarget"] = L["Main Assist Target"], ["maintank"] = L["Main Tank"], ["maintanktarget"] = L["Main Tank Target"], ["party"] = L["Party"], ["partypet"] = L["Party Pet"], ["partytarget"] = L["Party Target"], ["pet"] = L["Pet"], ["pettarget"] = L["Pet Target"], ["player"] = L["Player"],["raid"] = L["Raid"], ["target"] = L["Target"], ["targettarget"] = L["Target of Target"], ["targettargettarget"] = L["Target of Target of Target"], ["battleground"] = L["Battleground"], ["battlegroundpet"] = L["Battleground Pet"], ["battlegroundtarget"] = L["Battleground Target"]} -- Cache the units so we don't have to concat every time it updates @@ -263,7 +263,7 @@ function ShadowUF:LoadUnitDefaults() if( not self.fakeUnits[unit] ) then self.defaults.profile.units[unit].combatText = {enabled = true, anchorTo = "$parent", anchorPoint = "C", x = 0, y = 0} - if( unit ~= "arena" and unit ~= "arenapet" ) then + if( unit ~= "battleground" and unit ~= "battlegroundpet" and unit ~= "arena" and unit ~= "arenapet" ) then self.defaults.profile.units[unit].incHeal = {enabled = false, cap = 1.30} end end @@ -343,6 +343,13 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.arena.auras.debuffs.maxRows = 1 self.defaults.profile.units.arena.auras.buffs.maxRows = 1 self.defaults.profile.units.arena.offset = 0 + -- BATTLEGROUND + self.defaults.profile.units.battleground.enabled = false + self.defaults.profile.units.battleground.attribPoint = "TOP" + self.defaults.profile.units.battleground.attribAnchorPoint = "LEFT" + self.defaults.profile.units.battleground.auras.debuffs.maxRows = 1 + self.defaults.profile.units.battleground.auras.buffs.maxRows = 1 + self.defaults.profile.units.battleground.offset = 0 -- BOSS self.defaults.profile.units.boss.enabled = false self.defaults.profile.units.boss.attribPoint = "TOP" diff --git a/modules/units.lua b/modules/units.lua index efd5f488..ec5d8fcc 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1,6 +1,6 @@ local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}, remappedUnits = {}} Units.childUnits = {["partytarget"] = "party", ["partypet"] = "party", ["maintanktarget"] = "maintank", ["mainassisttarget"] = "mainassist", ["bosstarget"] = "boss", ["arenatarget"] = "arena", ["arenapet"] = "arena"} -Units.zoneUnits = {["arena"] = "arena", ["boss"] = "raid", ["battleground"] = "arena"} +Units.zoneUnits = {["arena"] = "arena", ["boss"] = "raid", ["battleground"] = "pvp"} Units.remappedUnits = {["battleground"] = "arena", ["battlegroundpet"] = "arenapet", ["battlegroundtarget"] = "arenatarget"} Units.headerUnits = {["raid"] = true, ["party"] = true, ["maintank"] = true, ["mainassist"] = true, ["raidpet"] = true, ["partypet"] = true} From c39767f6b8c7a44b0e0e6237067802742d8cd546 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 21 Sep 2012 19:09:48 -0700 Subject: [PATCH 292/794] Added missing arenapet/arenatarget/bosstarget units to the zoneUnits table so they are disabled outside their relevant zones --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index ec5d8fcc..ae5a97a3 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1,6 +1,6 @@ local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}, remappedUnits = {}} Units.childUnits = {["partytarget"] = "party", ["partypet"] = "party", ["maintanktarget"] = "maintank", ["mainassisttarget"] = "mainassist", ["bosstarget"] = "boss", ["arenatarget"] = "arena", ["arenapet"] = "arena"} -Units.zoneUnits = {["arena"] = "arena", ["boss"] = "raid", ["battleground"] = "pvp"} +Units.zoneUnits = {["arena"] = "arena", ["arenapet"] = "arena", ["arenatarget"] = "arena", ["boss"] = "raid", ["bosstarget"] = "raid", ["battleground"] = "pvp", ["battlegroundtarget"] = "pvp", ["battlegroundpet"] = "pvp"} Units.remappedUnits = {["battleground"] = "arena", ["battlegroundpet"] = "arenapet", ["battlegroundtarget"] = "arenatarget"} Units.headerUnits = {["raid"] = true, ["party"] = true, ["maintank"] = true, ["mainassist"] = true, ["raidpet"] = true, ["partypet"] = true} From 339453eddbfe1a20db26bc7604d9bf26f12fea85 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Sep 2012 12:44:52 -0700 Subject: [PATCH 293/794] Should be the last of the work needed for battleground units. NOTE: This is experimental, not that anyone reads this when auto updating off of alphas --- ShadowedUnitFrames.lua | 3 ++- modules/movers.lua | 6 +++--- modules/tags.lua | 2 +- modules/units.lua | 33 ++++++++++++++++++++------------- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 550d5af2..34c27d9e 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -15,13 +15,14 @@ L.units = {["raidpet"] = L["Raid pet"], ["PET"] = L["Pet"], ["VEHICLE"] = L["Veh -- Cache the units so we don't have to concat every time it updates ShadowUF.unitTarget = setmetatable({}, {__index = function(tbl, unit) rawset(tbl, unit, unit .. "target"); return unit .. "target" end}) -ShadowUF.partyUnits, ShadowUF.raidUnits, ShadowUF.raidPetUnits, ShadowUF.bossUnits, ShadowUF.arenaUnits = {}, {}, {}, {}, {} +ShadowUF.partyUnits, ShadowUF.raidUnits, ShadowUF.raidPetUnits, ShadowUF.bossUnits, ShadowUF.arenaUnits, ShadowUF.battlegroundUnits = {}, {}, {}, {}, {}, {} ShadowUF.maintankUnits, ShadowUF.mainassistUnits, ShadowUF.raidpetUnits = ShadowUF.raidUnits, ShadowUF.raidUnits, ShadowUF.raidPetUnits for i=1, MAX_PARTY_MEMBERS do ShadowUF.partyUnits[i] = "party" .. i end for i=1, MAX_RAID_MEMBERS do ShadowUF.raidUnits[i] = "raid" .. i end for i=1, MAX_RAID_MEMBERS do ShadowUF.raidPetUnits[i] = "raidpet" .. i end for i=1, MAX_BOSS_FRAMES do ShadowUF.bossUnits[i] = "boss" .. i end for i=1, 5 do ShadowUF.arenaUnits[i] = "arena" .. i end +for i=1, 2 do ShadowUF.battlegroundUnits[i] = "arena" .. i end function ShadowUF:OnInitialize() self.defaults = { diff --git a/modules/movers.lua b/modules/movers.lua index afc4868e..2f3f5046 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -154,7 +154,7 @@ local function prepareChildUnits(header, ...) if( frame.unitType and not frame.configUnitID ) then ShadowUF.Units.frameList[frame] = true frame.configUnitID = header.groupID and (header.groupID * 5) - 5 + i or i - frame:SetAttribute("unit", ShadowUF[header.unitType .. "Units"][frame.configUnitID]) + frame:SetAttribute("unit", ShadowUF[header.unitMappedType .. "Units"][frame.configUnitID]) end end end @@ -264,7 +264,7 @@ function Movers:Enable() header:SetMovable(true) prepareChildUnits(header, header:GetChildren()) end - + -- Setup the test env if( not self.isEnabled ) then for _, func in pairs(ShadowUF.tagFunc) do @@ -290,7 +290,7 @@ function Movers:Enable() -- so the first call gets all the parent units, the second call gets the child units setupUnits() setupUnits(true) - + -- Don't show the dialog if the configuration is opened through the configmode spec if( not self.isConfigModeSpec ) then self:CreateInfoFrame() diff --git a/modules/tags.lua b/modules/tags.lua index 87efb56d..376f1f58 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -268,7 +268,7 @@ function Tags:Register(parent, fontString, tags, resetCache) for id, func in pairs(args) do temp[id] = func(fontString.parent.unit, fontString.parent.unitOwner, fontString) or "" end - + fontString:SetFormattedText(formattedText, unpack(temp)) end diff --git a/modules/units.lua b/modules/units.lua index ae5a97a3..78b3032c 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1,5 +1,5 @@ local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}, remappedUnits = {}} -Units.childUnits = {["partytarget"] = "party", ["partypet"] = "party", ["maintanktarget"] = "maintank", ["mainassisttarget"] = "mainassist", ["bosstarget"] = "boss", ["arenatarget"] = "arena", ["arenapet"] = "arena"} +Units.childUnits = {["partytarget"] = "party", ["partypet"] = "party", ["maintanktarget"] = "maintank", ["mainassisttarget"] = "mainassist", ["bosstarget"] = "boss", ["arenatarget"] = "arena", ["arenapet"] = "arena", ["battlegroundpet"] = "battleground", ["battlegroundtarget"] = "battleground"} Units.zoneUnits = {["arena"] = "arena", ["arenapet"] = "arena", ["arenatarget"] = "arena", ["boss"] = "raid", ["bosstarget"] = "raid", ["battleground"] = "pvp", ["battlegroundtarget"] = "pvp", ["battlegroundpet"] = "pvp"} Units.remappedUnits = {["battleground"] = "arena", ["battlegroundpet"] = "arenapet", ["battlegroundtarget"] = "arenatarget"} Units.headerUnits = {["raid"] = true, ["party"] = true, ["maintank"] = true, ["mainassist"] = true, ["raidpet"] = true, ["partypet"] = true} @@ -194,7 +194,7 @@ end -- Event handling local function OnEvent(self, event, unit, ...) - if( not unitEvents[event] or self.unit == unit ) then + if( not unitEvents[event] or self.event == unit ) then for handler, func in pairs(self.registeredEvents[event]) do handler[func](handler, self, event, unit, ...) end @@ -453,23 +453,25 @@ end -- vehicleUnit = Unit to use when the unitOwner is in a vehicle OnAttributeChanged = function(self, name, unit) if( name ~= "unit" or not unit or unit == self.unitOwner ) then return end + -- Nullify the previous entry if it had one - if( self.unit and unitFrames[self.unit] == self ) then unitFrames[self.unit] = nil end + local configUnit = self.unitUnmapped or unit + if( self.configUnit and unitFrames[self.configUnit] == self ) then unitFrames[self.configUnit] = nil end -- Setup identification data self.unit = unit self.unitID = tonumber(string.match(unit, "([0-9]+)")) self.unitRealType = string.gsub(unit, "([0-9]+)", "") - self.unitType = self.unitType or self.unitRealType + self.unitType = self.unitUnmapped and string.gsub(self.unitUnmapped, "([0-9]+)", "") or self.unitType or self.unitRealType self.unitOwner = unit self.vehicleUnit = self.unitOwner == "player" and "vehicle" or self.unitRealType == "party" and "partypet" .. self.unitID or self.unitRealType == "raid" and "raidpet" .. self.unitID or nil self.inVehicle = nil - + -- Split everything into two maps, this is the simple parentUnit -> frame map -- This is for things like finding a party parent for party target/pet, the main map for doing full updates is -- an indexed frame that is updated once and won't have unit conflicts. if( self.unitRealType == self.unitType ) then - unitFrames[unit] = self + unitFrames[configUnit] = self end frameList[self] = true @@ -878,7 +880,7 @@ function Units:SetHeaderAttributes(frame, type) end -- Need to position the fake units - elseif( type == "boss" or type == "arena" ) then + elseif( type == "boss" or type == "arena" or type == "battleground" ) then frame:SetWidth(config.width) self:PositionHeaderChildren(frame) @@ -957,6 +959,7 @@ function Units:LoadSplitGroupHeader(type) frame.initialConfigFunction = initializeUnit frame.isHeaderFrame = true frame.unitType = type + frame.unitMappedType = type frame.splitParent = type frame.groupID = id --frame:SetBackdrop({bgFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = 1}) @@ -1031,18 +1034,20 @@ function Units:LoadGroupHeader(type) headerFrame.initialConfigFunction = initializeUnit headerFrame.isHeaderFrame = true headerFrame.unitType = type + headerFrame.unitMappedType = type headerFrame:UnregisterEvent("UNIT_NAME_UPDATE") - -- set style + + -- For securely managely the display local config = ShadowUF.db.profile.units[type] headerFrame:SetAttribute("style-height", config.height) headerFrame:SetAttribute("style-width", config.width) headerFrame:SetAttribute("style-scale", config.scale) - if type == "raidpet" then + if( type == "raidpet" ) then headerFrame:SetAttribute("filterOnPet", true) end - if ClickCastHeader then + if( ClickCastHeader ) then -- the OnLoad adds the functions like SetFrameRef to the header SecureHandler_OnLoad(headerFrame) headerFrame:SetFrameRef("clickcast_header", ClickCastHeader) @@ -1105,6 +1110,7 @@ function Units:LoadZoneHeader(type) local headerFrame = CreateFrame("Frame", "SUFHeader" .. type, petBattleFrame) headerFrame.isHeaderFrame = true headerFrame.unitType = type + headerFrame.unitMappedType = remappedUnits[type] or type headerFrame:SetClampedToScreen(true) headerFrame:SetMovable(true) headerFrame:SetHeight(0.1) @@ -1118,10 +1124,11 @@ function Units:LoadZoneHeader(type) end end) end - + for id, unit in pairs(ShadowUF[type .. "Units"]) do local frame = self:CreateUnit("Button", "SUFHeader" .. type .. "UnitButton" .. id, headerFrame, "SecureUnitButtonTemplate") frame.ignoreAnchor = true + frame.unitUnmapped = type .. id frame:SetAttribute("unit", unit) frame:Hide() @@ -1205,14 +1212,14 @@ function Units:InitializeFrame(type) self:LoadSplitGroupHeader(type) elseif( type == "party" or type == "raid" or type == "maintank" or type == "mainassist" or type == "raidpet" ) then self:LoadGroupHeader(type) - elseif( self.zoneUnits[type] ) then - self:LoadZoneHeader(type) elseif( self.childUnits[type] ) then for frame in pairs(frameList) do if( frame.unitType == self.childUnits[type] and ShadowUF.db.profile.units[frame.unitType] and frame.unitID ) then self:LoadChildUnit(frame, type, frame.unitID) end end + elseif( self.zoneUnits[type] ) then + self:LoadZoneHeader(type) else self:LoadUnit(type) end From b1fbe6612fe666f5acb03393e817c6aed270e6ad Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Sep 2012 12:49:31 -0700 Subject: [PATCH 294/794] Make sure to hide the arena frames too --- ShadowedUnitFrames.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 34c27d9e..bb831b2e 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -619,6 +619,7 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.arena and not active_hiddens.arena and IsAddOnLoaded("Blizzard_ArenaUI") ) then ArenaEnemyFrames.show = false ArenaEnemyFrames:UnregisterAllEvents() + ArenaEnemyFrames:Hide() end if( ShadowUF.db.profile.hidden.playerAltPower and not active_hiddens.playerAltPower ) then From 75155f8aba29dd63b2dab6811820297b08f9f577 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Sep 2012 13:00:47 -0700 Subject: [PATCH 295/794] Dispatch typo --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 78b3032c..0a01920f 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -194,7 +194,7 @@ end -- Event handling local function OnEvent(self, event, unit, ...) - if( not unitEvents[event] or self.event == unit ) then + if( not unitEvents[event] or self.unit == unit ) then for handler, func in pairs(self.registeredEvents[event]) do handler[func](handler, self, event, unit, ...) end From eca638469e7afba07e6172bff9ddfc43e80ea070 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Sep 2012 13:30:50 -0700 Subject: [PATCH 296/794] Last bit of layout tweaking for battleground units --- ShadowedUnitFrames.lua | 8 +++++++- modules/defaultlayout.lua | 25 ++++++++++++++++++------- options/config.lua | 9 ++++++--- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index bb831b2e..c277df3d 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -12,6 +12,7 @@ ShadowUF.moduleOrder = {} ShadowUF.unitList = {"player", "pet", "pettarget", "target", "targettarget", "targettargettarget", "focus", "focustarget", "party", "partypet", "partytarget", "raid", "raidpet", "boss", "bosstarget", "maintank", "maintanktarget", "mainassist", "mainassisttarget", "arena", "arenatarget", "arenapet", "battleground", "battlegroundtarget", "battlegroundpet"} ShadowUF.fakeUnits = {["targettarget"] = true, ["targettargettarget"] = true, ["pettarget"] = true, ["arenatarget"] = true, ["focustarget"] = true, ["focustargettarget"] = true, ["partytarget"] = true, ["raidtarget"] = true, ["bosstarget"] = true, ["maintanktarget"] = true, ["mainassisttarget"] = true, ["battlegroundtarget"] = true} L.units = {["raidpet"] = L["Raid pet"], ["PET"] = L["Pet"], ["VEHICLE"] = L["Vehicle"], ["arena"] = L["Arena"], ["arenapet"] = L["Arena Pet"], ["arenatarget"] = L["Arena Target"], ["boss"] = L["Boss"], ["bosstarget"] = L["Boss Target"], ["focus"] = L["Focus"], ["focustarget"] = L["Focus Target"], ["mainassist"] = L["Main Assist"], ["mainassisttarget"] = L["Main Assist Target"], ["maintank"] = L["Main Tank"], ["maintanktarget"] = L["Main Tank Target"], ["party"] = L["Party"], ["partypet"] = L["Party Pet"], ["partytarget"] = L["Party Target"], ["pet"] = L["Pet"], ["pettarget"] = L["Pet Target"], ["player"] = L["Player"],["raid"] = L["Raid"], ["target"] = L["Target"], ["targettarget"] = L["Target of Target"], ["targettargettarget"] = L["Target of Target of Target"], ["battleground"] = L["Battleground"], ["battlegroundpet"] = L["Battleground Pet"], ["battlegroundtarget"] = L["Battleground Target"]} +L.shortUnits = {["battleground"] = L["BG"], ["battlegroundtarget"] = L["BG Target"], ["battlegroundpet"] = L["BG Pet"]} -- Cache the units so we don't have to concat every time it updates ShadowUF.unitTarget = setmetatable({}, {__index = function(tbl, unit) rawset(tbl, unit, unit .. "target"); return unit .. "target" end}) @@ -290,7 +291,11 @@ function ShadowUF:LoadUnitDefaults() end end - self.defaults.profile.units[unit].altPowerBar = {enabled = true} + if( unit == "battleground" ) then + self.defaults.profile.units[unit].indicators.pvp = {enabled = true, size = 0} + end + + self.defaults.profile.units[unit].altPowerBar = {enabled = not ShadowUF.fakeUnits[unit]} end -- PLAYER @@ -618,6 +623,7 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.arena and not active_hiddens.arena and IsAddOnLoaded("Blizzard_ArenaUI") ) then ArenaEnemyFrames.show = false + ArenaEnemyFrames.Show = ShadowUF.noop ArenaEnemyFrames:UnregisterAllEvents() ArenaEnemyFrames:Hide() end diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 3c6ba8a0..7f93f8ff 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -383,6 +383,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) attribPoint = "TOP", attribAnchorPoint = "LEFT", offset = 20, + altPower = {enabled = false}, auras = { buffs = {enabled = true, maxRows = 1, perRow = 8}, debuffs = {enabled = true, maxRows = 1, perRow = 8}, @@ -415,7 +416,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) scale = 1.0, attribPoint = "TOP", attribAnchorPoint = "LEFT", - portrait = {enabled = false, fullAfter = 50}, + portrait = {enabled = true, type = "class", fullAfter = 50}, + altPower = {enabled = false}, castBar = {order = 60}, offset = 25, auras = { @@ -435,6 +437,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) height = 25, scale = 1.0, powerBar = {height = 0.60}, + altPower = {enabled = false}, text = { {text = "[name]"}, {text = "[curhp]"}, @@ -448,6 +451,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) height = 25, scale = 1.0, powerBar = {height = 0.60}, + altPower = {enabled = false}, indicators = { pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, }, @@ -460,23 +464,28 @@ function ShadowUF:LoadDefaultLayout(useMerge) }, }, battleground = { - width = 170, - height = 45, + width = 140, + height = 35, scale = 1.0, attribPoint = "TOP", attribAnchorPoint = "LEFT", - portrait = {enabled = false, fullAfter = 50}, + portrait = {enabled = false, type = "class", fullAfter = 50}, + powerBar = {height = 0.5}, + altPower = {enabled = false}, castBar = {order = 60}, - offset = 25, + offset = 0, auras = { buffs = {enabled = false, maxRows = 1, perRow = 9}, debuffs = {enabled = false, maxRows = 1, perRow = 9}, }, + indicators = { + pvp = {enabled = true, anchorTo = "$parent", anchorPoint = "LC", size = 40, x = 16, y = -8}, + }, text = { {text = "[name]"}, {text = "[curmaxhp]"}, - {text = "[perpp]"}, - {text = "[curmaxpp]"}, + {text = ""}, + {text = ""}, {text = "[name]"}, }, }, @@ -485,6 +494,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) height = 25, scale = 1.0, powerBar = {height = 0.60}, + altPower = {enabled = false}, text = { {text = "[name]"}, {text = "[curhp]"}, @@ -498,6 +508,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) height = 25, scale = 1.0, powerBar = {height = 0.60}, + altPower = {enabled = false}, indicators = { pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, }, diff --git a/options/config.lua b/options/config.lua index 196cd6ce..2315cf10 100755 --- a/options/config.lua +++ b/options/config.lua @@ -302,6 +302,7 @@ local function hideRestrictedOption(info) return string.match(unit, "%w+target" ) -- Fall back for indicators, no variable table so it shouldn't be shown elseif( info[#(info) - 1] == "indicators" ) then + print(unit, ShadowUF.db.pr) if( ( unit == "global" and not globalConfig.indicators[key] ) or ( unit ~= "global" and not ShadowUF.db.profile.units[unit].indicators[key] ) ) then return true end @@ -3165,7 +3166,9 @@ local function loadUnitOptions() attributes = { order = 1.5, type = "group", - name = function(info) return L.units[info[#(info) - 1]] end, + name = function(info) + return L.shortUnits[info[#(info) - 1]] or L.units[info[#(info) - 1]] + end, hidden = function(info) local unit = info[#(info) - 1] return unit ~= "raid" and unit ~= "raidpet" and unit ~= "party" and unit ~= "mainassist" and unit ~= "maintank" and not ShadowUF.Units.zoneUnits[unit] @@ -3677,7 +3680,7 @@ local function loadUnitOptions() type = "toggle", name = string.format(L["Enable %s"], L["Alt. Power bar"]), desc = L["Shows a bar for alternate power info (used in some encounters)"], - hidden = function(info) return ShadowUF.Units.fakeUnits[info[2]] or hideRestrictedOption(info) end, + hidden = function(info) return ShadowUF.fakeUnits[info[2]] or hideRestrictedOption(info) end, arg = "altPowerBar.enabled", }, colorType = { @@ -5878,7 +5881,7 @@ function Config:Open() loadOptions() LibStub("AceConfig-3.0"):RegisterOptionsTable("ShadowedUF", options) - AceDialog:SetDefaultSize("ShadowedUF", 880, 550) + AceDialog:SetDefaultSize("ShadowedUF", 865, 550) registered = true end From c018665b607dcae7a5829c98e6b252ed9206b987 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Sep 2012 13:31:05 -0700 Subject: [PATCH 297/794] Fixed hiding arena frames --- ShadowedUnitFrames.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index c277df3d..962c6e1f 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -621,9 +621,10 @@ function ShadowUF:HideBlizzardFrames() end end - if( ShadowUF.db.profile.hidden.arena and not active_hiddens.arena and IsAddOnLoaded("Blizzard_ArenaUI") ) then + if( ShadowUF.db.profile.hidden.arena and not active_hiddens.arenaTriggered and IsAddOnLoaded("Blizzard_ArenaUI") ) then + active_hiddens.arenaTriggered = true + ArenaEnemyFrames.show = false - ArenaEnemyFrames.Show = ShadowUF.noop ArenaEnemyFrames:UnregisterAllEvents() ArenaEnemyFrames:Hide() end From 20da971b0af882ea8bc2975c07e7946e091da6ab Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Sep 2012 13:32:45 -0700 Subject: [PATCH 298/794] Properly hide raid frames on the trigger even if they are loaded later --- ShadowedUnitFrames.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 962c6e1f..df60e285 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -524,7 +524,9 @@ function ShadowUF:HideBlizzardFrames() end if( CompactRaidFrameManager ) then - if( ShadowUF.db.profile.hidden.raid and not active_hiddens.raid ) then + if( ShadowUF.db.profile.hidden.raid and not active_hiddens.raidTriggered ) then + active_hiddens.raidTriggered = true + local function hideRaid() CompactRaidFrameManager:UnregisterAllEvents() CompactRaidFrameContainer:UnregisterAllEvents() From b1011b8fe894161f215dbb8078895ee75570853d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Sep 2012 13:35:24 -0700 Subject: [PATCH 299/794] Disable altPowerBar for fake units --- ShadowedUnitFrames.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index df60e285..8981f6b7 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -88,6 +88,12 @@ function ShadowUF:CheckUpgrade() if( revision <= 22 ) then self:LoadDefaultLayout(true) + + for _, unit in pairs(self.unitList) do + if( ShadowUF.fakeUnits[unit] ) then + self.db.profile.units[unit].altPowerBar.enabled = false + end + end end if( revision <= 21 ) then From e2bc9ead28eef571aa86911d882b181d106d0a19 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 25 Sep 2012 13:15:45 -0700 Subject: [PATCH 300/794] Removed debug print --- options/config.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index 2315cf10..1496eb27 100755 --- a/options/config.lua +++ b/options/config.lua @@ -302,7 +302,6 @@ local function hideRestrictedOption(info) return string.match(unit, "%w+target" ) -- Fall back for indicators, no variable table so it shouldn't be shown elseif( info[#(info) - 1] == "indicators" ) then - print(unit, ShadowUF.db.pr) if( ( unit == "global" and not globalConfig.indicators[key] ) or ( unit ~= "global" and not ShadowUF.db.profile.units[unit].indicators[key] ) ) then return true end From 3ef4016b15df9961314821f729d6268e2d5f30e6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 25 Sep 2012 13:19:04 -0700 Subject: [PATCH 301/794] Apparently someone else broke the hiding of the misc bar options for pet, fixed pet XP not being an changeable option --- options/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index 1496eb27..3713226b 100755 --- a/options/config.lua +++ b/options/config.lua @@ -3702,7 +3702,7 @@ local function loadUnitOptions() if( unit == "global" ) then return not globalConfig.runeBar and not globalConfig.eclipseBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.monkBar and not globalConfig.xpBar and not globalConfig.demonicFuryBar and not globalConfig.burningEmbersBar else - return unit ~= "player" + return unit ~= "player" and unit ~= "pet" end end, args = { From 9a7588ab678dbcde9c6c1498b6d733bac08a02ae Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 26 Sep 2012 10:29:36 -0700 Subject: [PATCH 302/794] Check alt power on PLAYER_ENTERING_WORLD --- modules/altpower.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/altpower.lua b/modules/altpower.lua index 6ee979d4..ac9d64dc 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -7,6 +7,7 @@ function AltPower:OnEnable(frame) frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", self, "UpdateVisibility") frame:RegisterUnitEvent("UNIT_POWER_BAR_HIDE", self, "UpdateVisibility") + frame:RegisterNormalEvent("PLAYER_ENTERING_WORLD", self, "UpdateVisibility") frame:RegisterUpdateFunc(self, "UpdateVisibility") end From 8dbad67acec3a2eb751bb349461d0791b4091a21 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 27 Sep 2012 17:52:45 -0700 Subject: [PATCH 303/794] Update alt power bar to handle inverting/overrides and function like a normal bar --- modules/altpower.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index ac9d64dc..ec0f3744 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -51,8 +51,21 @@ function AltPower:UpdateVisibility(frame) end end - frame.altPowerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) + if( not ShadowUF.db.profile.units[frame.unitType].powerBar.invert ) then + frame.altPowerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) + if( not frame.altPowerBar.background.overrideColor ) then + frame.altPowerBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) + end + else + frame.altPowerBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) + color = frame.altPowerBar.background.overrideColor + if( not color ) then + frame.altPowerBar:SetStatusBarColor(0, 0, 0, 1 - ShadowUF.db.profile.bars.backgroundAlpha) + else + frame.altPowerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) + end + end AltPower:Update(frame, nil, nil, "ALTERNATE") end From a7074727b9435255794dc6cb68a8a80844827145 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 27 Sep 2012 17:53:19 -0700 Subject: [PATCH 304/794] Switch alt power to use non-frequent and frequent updates for the time being --- modules/altpower.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/altpower.lua b/modules/altpower.lua index ec0f3744..a663764a 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -32,6 +32,7 @@ function AltPower:UpdateVisibility(frame) -- Register or unregister events based on if it's visible local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent" + frame[type](frame, "UNIT_POWER", self, "Update") frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") frame[type](frame, "UNIT_MAXPOWER", self, "Update") frame[type](frame, "UNIT_DISPLAYPOWER", self, "UpdateVisibility") From ea326ec78e75ecbeaccd01fb87faf832c5be86b0 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 27 Sep 2012 17:53:51 -0700 Subject: [PATCH 305/794] Do a display check on alt power when UNIT_DISPLAYPOWER triggers --- modules/altpower.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index a663764a..f6353e3e 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -7,6 +7,7 @@ function AltPower:OnEnable(frame) frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", self, "UpdateVisibility") frame:RegisterUnitEvent("UNIT_POWER_BAR_HIDE", self, "UpdateVisibility") + frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdateVisibility") frame:RegisterNormalEvent("PLAYER_ENTERING_WORLD", self, "UpdateVisibility") frame:RegisterUpdateFunc(self, "UpdateVisibility") @@ -35,7 +36,6 @@ function AltPower:UpdateVisibility(frame) frame[type](frame, "UNIT_POWER", self, "Update") frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") frame[type](frame, "UNIT_MAXPOWER", self, "Update") - frame[type](frame, "UNIT_DISPLAYPOWER", self, "UpdateVisibility") if( not visible ) then return end From 3047f55b367eef836af659f37e3016f1f376b89f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 27 Sep 2012 17:54:50 -0700 Subject: [PATCH 306/794] Only do alt power checks on player units --- modules/altpower.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index f6353e3e..b0174e55 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -19,13 +19,15 @@ end local altColor = {} function AltPower:UpdateVisibility(frame) - local barType, minPower, _, _, _, hideFromOthers, showOnRaid = UnitAlternatePowerInfo(frame.unit) local visible = false - if( barType ) then - if( ( frame.unitType == "player" or frame.unitType == "pet" ) or not hideFromOthers ) then - visible = true - elseif( showOnRaid and ( UnitInRaid(frame.unit) or UnitInParty(frame.unit) ) ) then - visible = true + if( UnitIsPlayer(frame.unit) ) then + local barType, minPower, _, _, _, hideFromOthers, showOnRaid = UnitAlternatePowerInfo(frame.unit) + if( barType ) then + if( ( frame.unitType == "player" or frame.unitType == "pet" ) or not hideFromOthers ) then + visible = true + elseif( showOnRaid and ( UnitInRaid(frame.unit) or UnitInParty(frame.unit) ) ) then + visible = true + end end end From 204726c54c277a99aa31011e9e972e4771d170d7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 27 Sep 2012 17:55:09 -0700 Subject: [PATCH 307/794] Actually revert that --- modules/altpower.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index b0174e55..f6353e3e 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -19,15 +19,13 @@ end local altColor = {} function AltPower:UpdateVisibility(frame) + local barType, minPower, _, _, _, hideFromOthers, showOnRaid = UnitAlternatePowerInfo(frame.unit) local visible = false - if( UnitIsPlayer(frame.unit) ) then - local barType, minPower, _, _, _, hideFromOthers, showOnRaid = UnitAlternatePowerInfo(frame.unit) - if( barType ) then - if( ( frame.unitType == "player" or frame.unitType == "pet" ) or not hideFromOthers ) then - visible = true - elseif( showOnRaid and ( UnitInRaid(frame.unit) or UnitInParty(frame.unit) ) ) then - visible = true - end + if( barType ) then + if( ( frame.unitType == "player" or frame.unitType == "pet" ) or not hideFromOthers ) then + visible = true + elseif( showOnRaid and ( UnitInRaid(frame.unit) or UnitInParty(frame.unit) ) ) then + visible = true end end From 3ea928de8a0d4fb38a87a6636aa0327fcb63760f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 27 Sep 2012 17:56:41 -0700 Subject: [PATCH 308/794] Only do the type check if an event is passed --- modules/altpower.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index f6353e3e..505c48af 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -38,7 +38,6 @@ function AltPower:UpdateVisibility(frame) frame[type](frame, "UNIT_MAXPOWER", self, "Update") if( not visible ) then return end - local color = ShadowUF.db.profile.powerColors.ALTERNATE if( not showOnRaid ) then local powerType, powerToken, altR, altG, altB = UnitPowerType(frame.unit) @@ -68,11 +67,11 @@ function AltPower:UpdateVisibility(frame) end end - AltPower:Update(frame, nil, nil, "ALTERNATE") + AltPower:Update(frame) end function AltPower:Update(frame, event, unit, type) - if( type ~= "ALTERNATE" ) then return end + if( event and type ~= "ALTERNATE" ) then return end frame.altPowerBar:SetMinMaxValues(select(2, UnitAlternatePowerInfo(frame.unit)) or 0, UnitPowerMax(frame.unit, ALTERNATE_POWER_INDEX) or 0) frame.altPowerBar:SetValue(UnitPower(frame.unit, ALTERNATE_POWER_INDEX) or 0) From f0e49f95536719317bab18646780acdb9ef47395 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 27 Sep 2012 17:59:11 -0700 Subject: [PATCH 309/794] Tweak the visibility manager for default state to not let default hidden bars show up randomly --- modules/layout.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/layout.lua b/modules/layout.lua index 302ff724..b1446e56 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -78,6 +78,7 @@ function Layout:SetBarVisibility(frame, key, status) if( status and not frame[key]:IsVisible() ) then ShadowUF.Tags:FastRegister(frame, frame[key]) + frame[key].visibilityManaged = true frame[key]:Show() ShadowUF.Layout:PositionWidgets(frame, ShadowUF.db.profile.units[frame.unitType]) @@ -85,6 +86,7 @@ function Layout:SetBarVisibility(frame, key, status) elseif( not status and frame[key]:IsVisible() ) then ShadowUF.Tags:FastUnregister(frame, frame[key]) + frame[key].visibilityManaged = nil frame[key]:Hide() ShadowUF.Layout:PositionWidgets(frame, ShadowUF.db.profile.units[frame.unitType]) end @@ -347,8 +349,7 @@ function Layout:SetupBars(frame, config) local key = module.moduleKey local widget = frame[key] if( widget and ( module.moduleHasBar or config[key] and config[key].isBar ) ) then - if( frame.visibility[key] and not frame[key].defaultHidden and module.defaultVisibility == false ) then - frame[key].defaultHidden = true + if( frame.visibility[key] and not frame[key].visibilityManaged and module.defaultVisibility == false ) then self:ToggleVisibility(widget, false) else self:ToggleVisibility(widget, frame.visibility[key]) From 398a7b54d7b1f82d127b241fb7bc885623b76d3c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 28 Sep 2012 18:12:58 -0700 Subject: [PATCH 310/794] Player alt power should be enabled by default, fixed a conflict between DB defaults and layout defaults --- modules/defaultlayout.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 7f93f8ff..d9513265 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -102,7 +102,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) borderColor = {r = 0.30, g = 0.30, b = 0.50, a = 1}, } config.hidden = { - cast = false, buffs = false, party = true, player = true, pet = true, target = true, focus = true, boss = true, arena = true, playerAltPower = true, playerPower = true + cast = false, buffs = false, party = true, player = true, pet = true, target = true, focus = true, boss = true, arena = true, playerAltPower = false, playerPower = true } config.font = { name = "Myriad Condensed Web", From 2dd8f20c6d740b08908e26ce8d7f6179619eeefe Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 28 Sep 2012 18:13:27 -0700 Subject: [PATCH 311/794] Force enable the alt power bar for everyone due to issues with the player one sometimes not working due to *mysteries*. Disable it under Hide Blizzard if you really want it hidden still. --- ShadowedUnitFrames.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 8981f6b7..d8949817 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 23 +ShadowUF.dbRevision = 24 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -86,6 +86,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + if( revision <= 23 ) then + self.db.profile.hidden.playerAltPower = false + end + if( revision <= 22 ) then self:LoadDefaultLayout(true) From 1b7e00a17573b872248d790dc08ede19d9ae27b7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 28 Sep 2012 19:10:39 -0700 Subject: [PATCH 312/794] Fixed vehicle frames swapping when unneeded due to Blizzards alt power vehicle insanity --- modules/combopoints.lua | 2 +- modules/units.lua | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 7543d8a8..93c2850c 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -150,7 +150,7 @@ function Combo:Update(frame, event, unit) --if( event and unit ~= "player" ) then return end -- For Malygos dragons, they also self cast their CP on themselves, which is why we check CP on ourself! - local playerUnit = UnitHasVehicleUI("player") and "vehicle" or "player" + local playerUnit = UnitHasVehiclePlayerFrameUI("player") and "vehicle" or "player" local points = GetComboPoints(playerUnit) if( points == 0 ) then points = GetComboPoints(playerUnit, playerUnit) diff --git a/modules/units.lua b/modules/units.lua index 0a01920f..6bdb0802 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -309,7 +309,7 @@ local function checkVehicleData(self, elapsed) self.dataAttempts = self.dataAttempts + 1 -- Took too long to get vehicle data, or they are no longer in a vehicle - if( self.dataAttempts >= 6 or not UnitHasVehicleUI(self.unitOwner) ) then + if( self.dataAttempts >= 6 or not UnitHasVehiclePlayerFrameUI(self.unitOwner) ) then self.timeElapsed = nil self.dataAttempts = nil self:SetScript("OnUpdate", nil) @@ -335,7 +335,7 @@ function Units:CheckVehicleStatus(frame, event, unit) if( event and frame.unitOwner ~= unit ) then return end -- Not in a vehicle yet, and they entered one that has a UI or they were in a vehicle but the GUID changed (vehicle -> vehicle) - if( ( not frame.inVehicle or frame.unitGUID ~= UnitGUID(frame.vehicleUnit) ) and UnitHasVehicleUI(frame.unitOwner) and not ShadowUF.db.profile.units[frame.unitType].disableVehicle ) then + if( ( not frame.inVehicle or frame.unitGUID ~= UnitGUID(frame.vehicleUnit) ) and UnitHasVehiclePlayerFrameUI(frame.unitOwner) and not ShadowUF.db.profile.units[frame.unitType].disableVehicle ) then frame.inVehicle = true frame.unit = frame.vehicleUnit @@ -350,7 +350,7 @@ function Units:CheckVehicleStatus(frame, event, unit) end -- Was in a vehicle, no longer has a UI - elseif( frame.inVehicle and ( not UnitHasVehicleUI(frame.unitOwner) or ShadowUF.db.profile.units[frame.unitType].disableVehicle ) ) then + elseif( frame.inVehicle and ( not UnitHasVehiclePlayerFrameUI(frame.unitOwner) or ShadowUF.db.profile.units[frame.unitType].disableVehicle ) ) then frame.inVehicle = false frame.unit = frame.unitOwner frame.unitGUID = UnitGUID(frame.unit) @@ -522,7 +522,7 @@ OnAttributeChanged = function(self, name, unit) end -- Logged out in a vehicle - if( UnitHasVehicleUI(self.unitRealOwner) ) then + if( UnitHasVehiclePlayerFrameUI(self.unitRealOwner) ) then self:SetAttribute("unitIsVehicle", true) end From 588ca2e4e700774bf1594da8762864c89b5d2d63 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 28 Sep 2012 19:11:07 -0700 Subject: [PATCH 313/794] Fixed bars that are hidden by default (alt power) not working due to not being initialized --- modules/altpower.lua | 14 +------------- modules/layout.lua | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index 505c48af..654b5e11 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -33,24 +33,12 @@ function AltPower:UpdateVisibility(frame) -- Register or unregister events based on if it's visible local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent" - frame[type](frame, "UNIT_POWER", self, "Update") frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") frame[type](frame, "UNIT_MAXPOWER", self, "Update") if( not visible ) then return end local color = ShadowUF.db.profile.powerColors.ALTERNATE - if( not showOnRaid ) then - local powerType, powerToken, altR, altG, altB = UnitPowerType(frame.unit) - if( ShadowUF.db.profile.powerColors[powerToken] ) then - color = ShadowUF.db.profile.powerColors[powerToken] - elseif( altR ) then - altColor.r, altColor.g, altColor.b = altR, altG, altB - color = altColor - else - color = ShadowUF.db.profile.powerColors.MANA - end - end - + if( not ShadowUF.db.profile.units[frame.unitType].powerBar.invert ) then frame.altPowerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) if( not frame.altPowerBar.background.overrideColor ) then diff --git a/modules/layout.lua b/modules/layout.lua index b1446e56..338c7506 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -355,7 +355,7 @@ function Layout:SetupBars(frame, config) self:ToggleVisibility(widget, frame.visibility[key]) end - if( widget:IsShown() and widget.SetStatusBarTexture ) then + if( ( widget:IsShown() or ( not frame[key].visibilityManaged and module.defaultVisibility == false ) ) and widget.SetStatusBarTexture ) then widget:SetStatusBarTexture(mediaPath.statusbar) widget:GetStatusBarTexture():SetHorizTile(false) From 139838d226e3429a50561a07fb71d9ac7a8f1368 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 28 Sep 2012 19:13:02 -0700 Subject: [PATCH 314/794] Don't let alpha be set on power colors, it never actually did anything, I'm just removing it so it's clearer --- options/config.lua | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/options/config.lua b/options/config.lua index 3713226b..198efbad 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1054,7 +1054,6 @@ local function loadGeneralOptions() order = 0, type = "color", name = L["Mana"], - hasAlpha = true, width = "half", arg = "powerColors.MANA", }, @@ -1062,7 +1061,6 @@ local function loadGeneralOptions() order = 1, type = "color", name = L["Rage"], - hasAlpha = true, width = "half", arg = "powerColors.RAGE", }, @@ -1070,7 +1068,6 @@ local function loadGeneralOptions() order = 2, type = "color", name = L["Focus"], - hasAlpha = true, arg = "powerColors.FOCUS", width = "half", }, @@ -1078,7 +1075,6 @@ local function loadGeneralOptions() order = 3, type = "color", name = L["Energy"], - hasAlpha = true, arg = "powerColors.ENERGY", width = "half", }, @@ -1086,7 +1082,6 @@ local function loadGeneralOptions() order = 6, type = "color", name = L["Runic Power"], - hasAlpha = true, arg = "powerColors.RUNIC_POWER", }, ECLIPSE_MOON = { @@ -1095,7 +1090,6 @@ local function loadGeneralOptions() name = L["Eclipse (Moon)"], desc = L["Bar coloring for the moon portion of the eclipse bar."], hidden = function(info) return select(2, UnitClass("player")) ~= "DRUID" end, - hasAlpha = true, arg = "powerColors.ECLIPSE_MOON", }, ECLIPSE_SUN = { @@ -1104,14 +1098,12 @@ local function loadGeneralOptions() name = L["Eclipse (Sun)"], desc = L["Bar coloring for the moon portion of the eclipse bar."], hidden = function(info) return select(2, UnitClass("player")) ~= "DRUID" end, - hasAlpha = true, arg = "powerColors.ECLIPSE_SUN", }, AMMOSLOT = { order = 9, type = "color", name = L["Ammo"], - hasAlpha = true, arg = "powerColors.AMMOSLOT", hidden = hideAdvancedOption, }, @@ -1119,7 +1111,6 @@ local function loadGeneralOptions() order = 10, type = "color", name = L["Fuel"], - hasAlpha = true, arg = "powerColors.FUEL", hidden = hideAdvancedOption, }, @@ -1127,14 +1118,12 @@ local function loadGeneralOptions() order = 11, type = "color", name = L["Combo points"], - hasAlpha = true, arg = "powerColors.COMBOPOINTS", }, SHADOWORBS = { order = 12, type = "color", name = L["Shadow Orbs"], - hasAlpha = true, arg = "powerColors.SHADOWORBS", hidden = function(info) return select(2, UnitClass("player")) ~= "PRIEST" end, }, @@ -1142,7 +1131,6 @@ local function loadGeneralOptions() order = 12, type = "color", name = L["Holy Power"], - hasAlpha = true, arg = "powerColors.HOLYPOWER", hidden = function(info) return select(2, UnitClass("player")) ~= "PALADIN" end, }, @@ -1166,7 +1154,6 @@ local function loadGeneralOptions() order = 15, type = "color", name = L["Demonic Fury"], - hasAlpha = true, arg = "powerColors.DEMONICFURY", hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, }, @@ -1174,7 +1161,6 @@ local function loadGeneralOptions() order = 16, type = "color", name = L["Burning Embers"], - hasAlpha = true, arg = "powerColors.BURNINGEMBERS", hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, }, @@ -1182,7 +1168,6 @@ local function loadGeneralOptions() order = 16, type = "color", name = L["Full Burning Ember"], - hasAlpha = true, arg = "powerColors.FULLBURNINGEMBER", hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, }, @@ -1190,7 +1175,6 @@ local function loadGeneralOptions() order = 17, type = "color", name = L["Chi"], - hasAlpha = true, arg = "powerColors.CHI", hidden = function(info) return select(2, UnitClass("player")) ~= "MONK" end, }, @@ -1198,7 +1182,6 @@ local function loadGeneralOptions() order = 17, type = "color", name = L["Mushrooms"], - hasAlpha = true, arg = "powerColors.MUSHROOMS", hidden = function(info) return select(2, UnitClass("player")) ~= "DRUID" end, }, @@ -1206,7 +1189,6 @@ local function loadGeneralOptions() order = 17, type = "color", name = L["Statue"], - hasAlpha = true, arg = "powerColors.STATUE", hidden = function(info) return select(2, UnitClass("player")) ~= "MONK" end, }, @@ -1214,10 +1196,14 @@ local function loadGeneralOptions() order = 18, type = "color", name = L["Fel Energy"], - hasAlpha = true, arg = "powerColors.POWER_TYPE_FEL_ENERGY", hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, }, + ALTERNATE = { + order = 19, + type = "color" + name = L["Alt. Power"], + } }, }, cast = { From 8bc6d7cbd95da842c07feb4682cd873615daf926 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 28 Sep 2012 19:18:07 -0700 Subject: [PATCH 315/794] Improve the alt power color to be more distinctive --- ShadowedUnitFrames.lua | 1 + modules/defaultlayout.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index d8949817..fe64f24d 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -88,6 +88,7 @@ function ShadowUF:CheckUpgrade() if( revision <= 23 ) then self.db.profile.hidden.playerAltPower = false + self.db.profile.powerColors.ALTERNATE = {r = 0.815, g = 0.941, b = 1} end if( revision <= 22 ) then diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index d9513265..ac2aa570 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -158,7 +158,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) BURNINGEMBERS = {r = 0.58, g = 0.51, b = 0.79}, FULLBURNINGEMBER = {r = 0.88, g = 0.09, b = 0.062}, SHADOWORBS = {r = 0.58, g = 0.51, b = 0.79}, - ALTERNATE = {r = 0.71, g = 0.0, b = 1.0}, + ALTERNATE = {r = 0.815, g = 0.941, b = 1}, CHI = {r = 0.71, g = 1.0, b = 0.92}, STATUE = {r = 0.35, g = 0.45, b = 0.60}, MUSHROOMS = {r = 0.20, g = 0.90, b = 0.20}, From 171c49969172b6d3319908daf8ce33397969a014 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 28 Sep 2012 19:18:18 -0700 Subject: [PATCH 316/794] Added configuration of the alt power bar --- options/config.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/options/config.lua b/options/config.lua index 198efbad..6cf70d0c 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1201,9 +1201,11 @@ local function loadGeneralOptions() }, ALTERNATE = { order = 19, - type = "color" + type = "color", name = L["Alt. Power"], - } + desc = L["Alternate power is used for things like quests and dungeons."], + arg = "powerColors.ALTERNATE", + }, }, }, cast = { From 8ff523107c46d4d8560e8b929782213911964734 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 28 Sep 2012 19:45:55 -0700 Subject: [PATCH 317/794] Drop UNIT_DISPLAYPOWER to do an Update not a visibility update for alt power --- modules/altpower.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index 654b5e11..14db8565 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -7,7 +7,6 @@ function AltPower:OnEnable(frame) frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", self, "UpdateVisibility") frame:RegisterUnitEvent("UNIT_POWER_BAR_HIDE", self, "UpdateVisibility") - frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdateVisibility") frame:RegisterNormalEvent("PLAYER_ENTERING_WORLD", self, "UpdateVisibility") frame:RegisterUpdateFunc(self, "UpdateVisibility") @@ -35,6 +34,7 @@ function AltPower:UpdateVisibility(frame) local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent" frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") frame[type](frame, "UNIT_MAXPOWER", self, "Update") + frame[type](frame, "UNIT_DISPLAYPOWER", self, "Update") if( not visible ) then return end local color = ShadowUF.db.profile.powerColors.ALTERNATE From a0794eb0282048160937a642dd2298da72d575cc Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 30 Sep 2012 13:40:51 -0700 Subject: [PATCH 318/794] Fixed group # tag showing up while in a party --- modules/tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tags.lua b/modules/tags.lua index 376f1f58..93a5413a 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -893,7 +893,7 @@ Tags.defaultTags = { return classif == "rare" and "R" or classif == "rareelite" and "R+" or classif == "elite" and "+" or classif == "worldboss" and "B" end]], ["group"] = [[function(unit, unitOwner) - if( GetNumGroupMembers() == 0 ) then return nil end + if( not UnitInRaid(unitOwner) ) then return nil end local name, server = UnitName(unitOwner) if( server and server ~= "" ) then name = string.format("%s-%s", name, server) From c536332255291e6f2b8038de1e4320dd807d9f61 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 30 Sep 2012 14:00:42 -0700 Subject: [PATCH 319/794] Do a full update of the player frames when a cinematic ends to prevent any weird issues that popup from Blizzard messing with things --- modules/units.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 6bdb0802..96235f30 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1349,6 +1349,7 @@ centralFrame:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") centralFrame:RegisterEvent("PLAYER_TALENT_UPDATE") centralFrame:RegisterEvent("PLAYER_LOGIN") centralFrame:RegisterEvent("PLAYER_LEVEL_UP") +centralFrame:RegisterEvent("CINEMATIC_STOP") centralFrame:SetScript("OnEvent", function(self, event, unit) -- Check if the player changed zone types and we need to change module status, while they are dead @@ -1367,10 +1368,10 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) Units:CheckPlayerZone() -- Monitor level up - elseif( event == "PLAYER_LEVEL_UP" ) then - if( ShadowUF.Units.unitFrames.player ) then - ShadowUF.Units.unitFrames.player:SetVisibility() - ShadowUF.Units.unitFrames.player:FullUpdate() + elseif( event == "PLAYER_LEVEL_UP" or event == "CINEMATIC_STOP" ) then + if( unitFrames.player ) then + unitFrames.player:SetVisibility() + unitFrames.player:FullUpdate() end -- Monitor talent changes From d796c356243e5263ca49a2dd33653ef535327eea Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 30 Sep 2012 14:01:18 -0700 Subject: [PATCH 320/794] Removed events from registration that we don't actually use --- modules/units.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 96235f30..793727c4 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1345,8 +1345,6 @@ end local centralFrame = CreateFrame("Frame") centralFrame:RegisterEvent("PLAYER_REGEN_ENABLED") centralFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") -centralFrame:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") -centralFrame:RegisterEvent("PLAYER_TALENT_UPDATE") centralFrame:RegisterEvent("PLAYER_LOGIN") centralFrame:RegisterEvent("PLAYER_LEVEL_UP") centralFrame:RegisterEvent("CINEMATIC_STOP") From 34c0e1e914c72243c27457eac7c959d5cece1ed5 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 30 Sep 2012 14:12:11 -0700 Subject: [PATCH 321/794] Fixed event registration for GROUP_ROSTER_UPDATE in indicators and optimized/cleaned it up slightly --- modules/aurapoints.lua | 171 +++++++++++++++++++++++++++++++++++++++++ modules/indicators.lua | 14 ++-- 2 files changed, 180 insertions(+), 5 deletions(-) create mode 100755 modules/aurapoints.lua diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua new file mode 100755 index 00000000..8dbe3c65 --- /dev/null +++ b/modules/aurapoints.lua @@ -0,0 +1,171 @@ +local Combo = {isComboPoints = true} +ShadowUF:RegisterModule(Combo, "auraPoints", ShadowUF.L["Aura Combo Points"]) +ShadowUF.ComboPoints = Combo +local cpConfig = {max = MAX_COMBO_POINTS, key = "auraPoints", colorKey = "COMBOPOINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} + +function AuraPointsOnEnable(frame) + frame.auraPoints = frame.auraPoints or CreateFrame("Frame", nil, frame) + frame.auraPoints.config = cpConfig + frame.comboPointType = cpConfig.key + frame:RegisterNormalEvent("UNIT_COMBO_POINTS", self, "Update") + frame:RegisterUpdateFunc(self, "Update") +end + +function AuraPointsOnLayoutApplied(frame, config) + local key = frame.comboPointType + local pointsFrame = frame[key] + if( not pointsFrame ) then return end + + pointsFrame:SetFrameLevel(frame.topFrameLevel + 1) + + local pointsConfig = pointsFrame.config + config = config[key] + -- Not a bar so set the containers frame configuration + if( config and not config.isBar ) then + ShadowUF.Layout:ToggleVisibility(pointsFrame, frame.visibility[key]) + end + + if( not frame.visibility[key] ) then return end + + -- Hide the active combo points + if( pointsFrame.points ) then + for _, texture in pairs(pointsFrame.points) do + texture:Hide() + end + end + + -- Setup for bar display! + if( config.isBar ) then + pointsFrame.blocks = pointsFrame.blocks or {} + pointsFrame.points = pointsFrame.blocks + + pointsFrame.visibleBlocks = pointsConfig.max + + -- Position bars, the 5 accounts for borders + local blockWidth = (pointsFrame:GetWidth() - (pointsConfig.max - 1)) / pointsConfig.max + for id=1, pointsConfig.max do + pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") + local texture = pointsFrame.blocks[id] + local color = ShadowUF.db.profile.powerColors[pointsConfig.colorKey or "COMBOPOINTS"] + texture:SetVertexColor(color.r, color.g, color.b, color.a) + texture:SetHorizTile(false) + texture:SetTexture(ShadowUF.Layout.mediaPath.statusbar) + texture:SetHeight(pointsFrame:GetHeight()) + texture:SetWidth(blockWidth) + texture:ClearAllPoints() + + if( config.growth == "LEFT" ) then + if( id > 1 ) then + texture:SetPoint("TOPRIGHT", pointsFrame.blocks[id - 1], "TOPLEFT", -1, 0) + else + texture:SetPoint("TOPRIGHT", pointsFrame, "TOPRIGHT", 0, 0) + end + else + if( id > 1 ) then + texture:SetPoint("TOPLEFT", pointsFrame.blocks[id - 1], "TOPRIGHT", 1, 0) + else + texture:SetPoint("TOPLEFT", pointsFrame, "TOPLEFT", 0, 0) + end + end + end + + -- guess not, will have to do icons :( + else + local point, relativePoint + local x, y = 0, 0 + + if( config.growth == "LEFT" ) then + point, relativePoint = "BOTTOMRIGHT", "BOTTOMLEFT" + x = config.spacing + elseif( config.growth == "RIGHT" ) then + point, relativePoint = "BOTTOMLEFT", "BOTTOMRIGHT" + x = config.spacing + elseif( config.growth == "UP" ) then + point, relativePoint = "BOTTOMLEFT", "TOPLEFT" + y = config.spacing + elseif( config.growth == "DOWN" ) then + point, relativePoint = "TOPLEFT", "BOTTOMLEFT" + y = config.spacing + end + + + pointsFrame.icons = pointsFrame.icons or {} + pointsFrame.points = pointsFrame.icons + + for id=1, pointsConfig.max do + pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") + local texture = pointsFrame.icons[id] + texture:SetTexture(pointsConfig.icon) + texture:SetSize(config.size, config.size) + + if( id > 1 ) then + texture:ClearAllPoints() + texture:SetPoint(point, pointsFrame.icons[id - 1], relativePoint, x, y) + else + texture:ClearAllPoints() + texture:SetPoint("CENTER", pointsFrame, "CENTER", 0, 0) + end + end + + -- Position the main frame + pointsFrame:SetSize(0.1, 0.1) + + ShadowUF.Layout:AnchorFrame(frame, pointsFrame, config) + end +end + +function AuraPointsOnDisable(frame) + frame:UnregisterAll(self) +end + + +function AuraPointsUpdateBarBlocks(frame, event, unit, powerType) + local pointsFrame = frame[frame.comboPointType] + if( not pointsFrame or not pointsFrame.config.eventType ) then return end + if( event and powerType ~= pointsFrame.config.eventType ) then return end + + if( not ShadowUF.db.profile.units[frame.unitType][frame.comboPointType].isBar ) then + return + end + + local max = UnitPowerMax("player", pointsFrame.config.powerType) + if( max == 0 or pointsFrame.visibleBlocks == max ) then return end + + local blockWidth = (pointsFrame:GetWidth() - (max - 1)) / max + for id=1, max do + pointsFrame.blocks[id]:SetWidth(blockWidth) + pointsFrame.blocks[id]:Show() + end + + for id=max+1, max do + pointsFrame.blocks[id]:Hide() + end + + pointsFrame.visibleBlocks = max +end + + +function AuraPointsUpdate(frame, event, unit) + -- MoP changed UNIT_COMBO_POINTS so that unit is now player even if it's done on the target + --if( event and unit ~= "player" ) then return end + + -- For Malygos dragons, they also self cast their CP on themselves, which is why we check CP on ourself! + local playerUnit = UnitHasVehiclePlayerFrameUI("player") and "vehicle" or "player" + local points = GetComboPoints(playerUnit) + if( points == 0 ) then + points = GetComboPoints(playerUnit, playerUnit) + end + + -- Bar display, hide it if we don't have any combo points + if( ShadowUF.db.profile.units[frame.unitType].auraPoints.isBar ) then + ShadowUF.Layout:SetBarVisibility(frame, "auraPoints", ShadowUF.db.profile.units[frame.unitType].auraPoints.showAlways or (points and points > 0)) + end + + for id, pointTexture in pairs(frame.auraPoints.points) do + if( id <= points ) then + pointTexture:Show() + else + pointTexture:Hide() + end + end +end diff --git a/modules/indicators.lua b/modules/indicators.lua index a6b10019..a7f893a6 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -110,9 +110,6 @@ function Indicators:UpdateRole(frame, event) end function Indicators:UpdateLeader(frame) - self:UpdateMasterLoot(frame) - self:UpdateRole(frame) - self:UpdateLFDRole(frame) if( not frame.indicators.leader or not frame.indicators.leader.enabled ) then return end if( UnitIsGroupLeader(frame.unit) ) then @@ -122,6 +119,14 @@ function Indicators:UpdateLeader(frame) end end +function Indicators:GroupRosterUpdate(frame) + self:UpdateAssist(frame) + self:UpdateMasterLoot(frame) + self:UpdateRole(frame) + self:UpdateLFDRole(frame) + self:UpdateLeader(frame) +end + function Indicators:UpdatePVPFlag(frame) if( not frame.indicators.pvp or not frame.indicators.pvp.enabled ) then return end @@ -323,7 +328,6 @@ function Indicators:OnEnable(frame) if( config.indicators.masterLoot and config.indicators.masterLoot.enabled ) then frame:RegisterNormalEvent("PARTY_LOOT_METHOD_CHANGED", self, "UpdateMasterLoot") - frame:RegisterNormalEvent("GROUP_ROSTER_UPDATE", self, "UpdateMasterLoot") frame:RegisterUpdateFunc(self, "UpdateMasterLoot") frame.indicators.masterLoot = frame.indicators.masterLoot or frame.indicators:CreateTexture(nil, "OVERLAY") @@ -398,7 +402,7 @@ function Indicators:OnEnable(frame) -- As they all share the function, register it as long as one is active if( frame.indicators.leader or frame.indicators.masterLoot or frame.indicators.role or ( frame.unit ~= "player" and frame.indicators.lfdRole ) ) then - frame:RegisterNormalEvent("GROUP_ROSTER_UPDATE", self, "UpdateLeader") + frame:RegisterNormalEvent("GROUP_ROSTER_UPDATE", self, "GroupRosterUpdate") end end From bf6326c49d2c2b74c6e92a740f5d1b1ffd7a20a6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 30 Sep 2012 14:12:30 -0700 Subject: [PATCH 322/794] Removed a work around for a Blizzard issue from like, 2010 --- modules/indicators.lua | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index a7f893a6..512a7fc0 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -339,26 +339,6 @@ function Indicators:OnEnable(frame) frame.indicators.role = frame.indicators.role or frame.indicators:CreateTexture(nil, "OVERLAY") frame.indicators.role:SetTexture("Interface\\GroupFrame\\UI-Group-MainAssistIcon") - - -- Silly hack to fix the fact that Blizzard bugged an API and causes " is not in your party" errors - if( not self.leavingFrame ) then - self.leavingFrame = CreateFrame("Frame") - self.leavingFrame:RegisterEvent("PLAYER_ENTERING_WORLD") - self.leavingFrame:RegisterEvent("PLAYER_LEAVING_WORLD") - self.leavingFrame:SetScript("OnEvent", function(self, event) - if( event == "PLAYER_LEAVING_WORLD" ) then - leavingWorld = true - else - leavingWorld = nil - - for frame in pairs(ShadowUF.Units.frameList) do - if( frame:IsVisible() and frame.indicators and frame.indicators.role and frame.indicators.role.enabled ) then - Indicators:UpdateRole(frame) - end - end - end - end) - end end if( config.indicators.raidTarget and config.indicators.raidTarget.enabled ) then From 9567b58566f35cf3b02ebe186c35e6a0e6869706 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 30 Sep 2012 14:13:20 -0700 Subject: [PATCH 323/794] This should be commented out still --- modules/aurapoints.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index 8dbe3c65..1f3a59e4 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -1,3 +1,4 @@ +[[ local Combo = {isComboPoints = true} ShadowUF:RegisterModule(Combo, "auraPoints", ShadowUF.L["Aura Combo Points"]) ShadowUF.ComboPoints = Combo @@ -169,3 +170,4 @@ function AuraPointsUpdate(frame, event, unit) end end end +]] \ No newline at end of file From 5e8dbd9cd51e8f827fb3d3db95b32f3ec131e0da Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 30 Sep 2012 16:15:14 -0700 Subject: [PATCH 324/794] Removed method call that didn't exist --- modules/indicators.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 512a7fc0..2b6846e0 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -120,7 +120,6 @@ function Indicators:UpdateLeader(frame) end function Indicators:GroupRosterUpdate(frame) - self:UpdateAssist(frame) self:UpdateMasterLoot(frame) self:UpdateRole(frame) self:UpdateLFDRole(frame) From 6286630f2b262f1268da4d2822decd169a9a338b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 30 Sep 2012 17:35:12 -0700 Subject: [PATCH 325/794] Added an aura points option that duplicates combo point setups for auras. Such as Mages Arcane Charge. Disabled by default, and you cannot configure the spells it uses, currently just has Arcane Charge. Post a comment with spell suggestions. --- ShadowedUnitFrames.lua | 12 +++- ShadowedUnitFrames.toc | 1 + modules/aurapoints.lua | 116 +++++++++++++----------------------- modules/defaultlayout.lua | 4 +- options/config.lua | 122 +++++++++++++++++++++++++++++++++++++- 5 files changed, 175 insertions(+), 80 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index fe64f24d..04991b1d 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 24 +ShadowUF.dbRevision = 25 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -86,6 +86,11 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or 1 + if( revision <= 24 ) then + self.db.profile.powerColors.AURAPOINTS = {r = 1.0, g = 0.80, b = 0} + self.db.profile.units.player.auraPoints = {enabled = false, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40} + end + if( revision <= 23 ) then self.db.profile.hidden.playerAltPower = false self.db.profile.powerColors.ALTERNATE = {r = 0.815, g = 0.941, b = 1} @@ -328,11 +333,12 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.shadowOrbs = {enabled = true, isBar = true} self.defaults.profile.units.player.chi = {enabled = true, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} - -- PET + self.defaults.profile.units.player.auraPoints = {enabled = false, isBar = true} + -- PET self.defaults.profile.units.pet.enabled = true self.defaults.profile.units.pet.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} self.defaults.profile.units.pet.xpBar = {enabled = false} - -- FOCUS + -- FOCUS self.defaults.profile.units.focus.enabled = true self.defaults.profile.units.focus.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} self.defaults.profile.units.focus.indicators.lfdRole = {enabled = false, size = 0, x = 0, y = 0} diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index ae8c8d93..1958e9cf 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -55,6 +55,7 @@ modules\burningembers.lua modules\altpower.lua modules\shadoworbs.lua modules\monk.lua +modules\aurapoints.lua #@do-not-package@ options\config.lua #@end-do-not-package@ diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index 1f3a59e4..4fa1d989 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -1,32 +1,33 @@ -[[ -local Combo = {isComboPoints = true} -ShadowUF:RegisterModule(Combo, "auraPoints", ShadowUF.L["Aura Combo Points"]) -ShadowUF.ComboPoints = Combo -local cpConfig = {max = MAX_COMBO_POINTS, key = "auraPoints", colorKey = "COMBOPOINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local AuraPoints = { + isComboPoints = true, + spells = { + ["MAGE"] = {max = 6, name = GetSpellInfo(36032)}, + } +} -function AuraPointsOnEnable(frame) +AuraPoints.trackSpell = AuraPoints.spells[select(2, UnitClass("player"))] + +if( not AuraPoints.trackSpell ) then return end +ShadowUF:RegisterModule(AuraPoints, "auraPoints", ShadowUF.L["Aura Combo Points"]) + +function AuraPoints:OnEnable(frame) frame.auraPoints = frame.auraPoints or CreateFrame("Frame", nil, frame) - frame.auraPoints.config = cpConfig - frame.comboPointType = cpConfig.key - frame:RegisterNormalEvent("UNIT_COMBO_POINTS", self, "Update") + frame:RegisterUnitEvent("UNIT_AURA", self, "Update") frame:RegisterUpdateFunc(self, "Update") end -function AuraPointsOnLayoutApplied(frame, config) - local key = frame.comboPointType - local pointsFrame = frame[key] +function AuraPoints:OnLayoutApplied(frame, config) + local pointsFrame = frame.auraPoints if( not pointsFrame ) then return end - + pointsFrame:SetFrameLevel(frame.topFrameLevel + 1) - local pointsConfig = pointsFrame.config - config = config[key] -- Not a bar so set the containers frame configuration - if( config and not config.isBar ) then + if( not config.auraPoints.isBar ) then ShadowUF.Layout:ToggleVisibility(pointsFrame, frame.visibility[key]) end - if( not frame.visibility[key] ) then return end + if( not frame.visibility.auraPoints ) then return end -- Hide the active combo points if( pointsFrame.points ) then @@ -36,18 +37,19 @@ function AuraPointsOnLayoutApplied(frame, config) end -- Setup for bar display! - if( config.isBar ) then + if( config.auraPoints.isBar ) then pointsFrame.blocks = pointsFrame.blocks or {} pointsFrame.points = pointsFrame.blocks - pointsFrame.visibleBlocks = pointsConfig.max + pointsFrame.visibleBlocks = AuraPoints.trackSpell.max -- Position bars, the 5 accounts for borders - local blockWidth = (pointsFrame:GetWidth() - (pointsConfig.max - 1)) / pointsConfig.max - for id=1, pointsConfig.max do + local blockWidth = (pointsFrame:GetWidth() - (AuraPoints.trackSpell.max - 1)) / AuraPoints.trackSpell.max + for id=1, AuraPoints.trackSpell.max do pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") + local texture = pointsFrame.blocks[id] - local color = ShadowUF.db.profile.powerColors[pointsConfig.colorKey or "COMBOPOINTS"] + local color = ShadowUF.db.profile.powerColors.AURAPOINTS texture:SetVertexColor(color.r, color.g, color.b, color.a) texture:SetHorizTile(false) texture:SetTexture(ShadowUF.Layout.mediaPath.statusbar) @@ -75,29 +77,29 @@ function AuraPointsOnLayoutApplied(frame, config) local point, relativePoint local x, y = 0, 0 - if( config.growth == "LEFT" ) then + if( config.auraPoints.growth == "LEFT" ) then point, relativePoint = "BOTTOMRIGHT", "BOTTOMLEFT" - x = config.spacing - elseif( config.growth == "RIGHT" ) then + x = config.auraPoints.spacing + elseif( config.auraPoints.growth == "RIGHT" ) then point, relativePoint = "BOTTOMLEFT", "BOTTOMRIGHT" - x = config.spacing - elseif( config.growth == "UP" ) then + x = config.auraPoints.spacing + elseif( config.auraPoints.growth == "UP" ) then point, relativePoint = "BOTTOMLEFT", "TOPLEFT" - y = config.spacing - elseif( config.growth == "DOWN" ) then + y = config.auraPoints.spacing + elseif( config.auraPoints.growth == "DOWN" ) then point, relativePoint = "TOPLEFT", "BOTTOMLEFT" - y = config.spacing + y = config.auraPoints.spacing end pointsFrame.icons = pointsFrame.icons or {} pointsFrame.points = pointsFrame.icons - for id=1, pointsConfig.max do + for id=1, AuraPoints.trackSpell.max do pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.icons[id] - texture:SetTexture(pointsConfig.icon) - texture:SetSize(config.size, config.size) + texture:SetTexture("Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo") + texture:SetSize(config.auraPoints.size, config.auraPoints.size) if( id > 1 ) then texture:ClearAllPoints() @@ -110,52 +112,19 @@ function AuraPointsOnLayoutApplied(frame, config) -- Position the main frame pointsFrame:SetSize(0.1, 0.1) - - ShadowUF.Layout:AnchorFrame(frame, pointsFrame, config) + pointsFrame:Show() + + ShadowUF.Layout:AnchorFrame(frame, pointsFrame, config.auraPoints) end end -function AuraPointsOnDisable(frame) +function AuraPoints:OnDisable(frame) frame:UnregisterAll(self) end -function AuraPointsUpdateBarBlocks(frame, event, unit, powerType) - local pointsFrame = frame[frame.comboPointType] - if( not pointsFrame or not pointsFrame.config.eventType ) then return end - if( event and powerType ~= pointsFrame.config.eventType ) then return end - - if( not ShadowUF.db.profile.units[frame.unitType][frame.comboPointType].isBar ) then - return - end - - local max = UnitPowerMax("player", pointsFrame.config.powerType) - if( max == 0 or pointsFrame.visibleBlocks == max ) then return end - - local blockWidth = (pointsFrame:GetWidth() - (max - 1)) / max - for id=1, max do - pointsFrame.blocks[id]:SetWidth(blockWidth) - pointsFrame.blocks[id]:Show() - end - - for id=max+1, max do - pointsFrame.blocks[id]:Hide() - end - - pointsFrame.visibleBlocks = max -end - - -function AuraPointsUpdate(frame, event, unit) - -- MoP changed UNIT_COMBO_POINTS so that unit is now player even if it's done on the target - --if( event and unit ~= "player" ) then return end - - -- For Malygos dragons, they also self cast their CP on themselves, which is why we check CP on ourself! - local playerUnit = UnitHasVehiclePlayerFrameUI("player") and "vehicle" or "player" - local points = GetComboPoints(playerUnit) - if( points == 0 ) then - points = GetComboPoints(playerUnit, playerUnit) - end +function AuraPoints:Update(frame, event, unit) + local points = select(4, UnitAura("player", AuraPoints.trackSpell.name)) or 0 -- Bar display, hide it if we don't have any combo points if( ShadowUF.db.profile.units[frame.unitType].auraPoints.isBar ) then @@ -169,5 +138,4 @@ function AuraPointsUpdate(frame, event, unit) pointTexture:Hide() end end -end -]] \ No newline at end of file +end \ No newline at end of file diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index ac2aa570..9c151f8e 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -162,7 +162,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) CHI = {r = 0.71, g = 1.0, b = 0.92}, STATUE = {r = 0.35, g = 0.45, b = 0.60}, MUSHROOMS = {r = 0.20, g = 0.90, b = 0.20}, - POWER_TYPE_FEL_ENERGY = {r = 0.878, g = 0.980, b = 0} + POWER_TYPE_FEL_ENERGY = {r = 0.878, g = 0.980, b = 0}, + AURAPOINTS = {r = 1.0, g = 0.80, b = 0.0}, } config.healthColors = { tapped = {r = 0.5, g = 0.5, b = 0.5}, @@ -327,6 +328,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, eclipseBar = {enabled = true, background = true, order = 70, height = 0.40}, + auraPoints = {enabled = false, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, demonicFuryBar = {enabled = true, background = false, height = 0.50, order = 70}, burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70}, soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, diff --git a/options/config.lua b/options/config.lua index 6cf70d0c..83c17eed 100755 --- a/options/config.lua +++ b/options/config.lua @@ -575,7 +575,7 @@ local function loadGeneralOptions() -- Strip module settings that aren't with SUF by default if( not layoutData.modules ) then - local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true, ["demonicFuryBar"] = true, ["burningEmbersBar"] = true, ["chi"] = true, ["shadowOrbs"] = true} + local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true, ["demonicFuryBar"] = true, ["burningEmbersBar"] = true, ["chi"] = true, ["shadowOrbs"] = true, ["auraPoints"] = true} for _, unitData in pairs(layout.units) do for key, data in pairs(unitData) do if( type(data) == "table" and not validModules[key] and ShadowUF.modules[key] ) then @@ -1117,9 +1117,16 @@ local function loadGeneralOptions() COMBOPOINTS = { order = 11, type = "color", - name = L["Combo points"], + name = L["Combo Points"], arg = "powerColors.COMBOPOINTS", }, + AURAPOINTS = { + order = 11.5, + type = "color", + name = L["Aura Combo Points"], + arg = "powerColors.AURAPOINTS", + hidden = function() return not ShadowUF.modules.auraPoints end + }, SHADOWORBS = { order = 12, type = "color", @@ -3100,6 +3107,116 @@ local function loadUnitOptions() }, }, }, + -- COMBO POINTS + barAuraPoints = { + order = 4, + type = "group", + inline = true, + name = L["Aura Combo Points"], + hidden = function(info) return not ShadowUF.modules.auraPoints or not getVariable(info[2], "auraPoints", nil, "isBar") or not getVariable(info[2], nil, nil, "auraPoints") end, + args = { + enabled = { + order = 1, + type = "toggle", + name = string.format(L["Enable %s"], L["Aura Combo Points"]), + hidden = false, + arg = "auraPoints.enabled", + }, + growth = { + order = 2, + type = "select", + name = L["Growth"], + values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"]}, + hidden = false, + arg = "auraPoints.growth", + }, + showAlways = { + order = 3, + type = "toggle", + name = L["Don't hide when empty"], + hidden = false, + arg = "auraPoints.showAlways", + }, + }, + }, + auraPoints = { + order = 4, + type = "group", + inline = true, + name = L["Aura Combo Points"], + hidden = function(info) if( info[2] == "global" or getVariable(info[2], "auraPoints", nil, "isBar") ) then return true end return not ShadowUF.modules.auraPoints or hideRestrictedOption(info) end, + args = { + enabled = { + order = 0, + type = "toggle", + name = string.format(L["Enable %s"], L["Aura Combo Points"]), + hidden = false, + arg = "auraPoints.enabled", + }, + sep1 = { + order = 1, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, + growth = { + order = 2, + type = "select", + name = L["Growth"], + values = {["UP"] = L["Up"], ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["DOWN"] = L["Down"]}, + hidden = false, + arg = "auraPoints.growth", + }, + size = { + order = 2, + type = "range", + name = L["Size"], + min = 0, max = 50, step = 1, softMin = 0, softMax = 20, + hidden = hideAdvancedOption, + arg = "auraPoints.size", + }, + spacing = { + order = 3, + type = "range", + name = L["Spacing"], + min = -30, max = 30, step = 1, softMin = -15, softMax = 15, + hidden = hideAdvancedOption, + arg = "auraPoints.spacing", + }, + sep2 = { + order = 4, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, + anchorPoint = { + order = 5, + type = "select", + name = L["Anchor point"], + values = positionList, + hidden = false, + arg = "auraPoints.anchorPoint", + }, + x = { + order = 6, + type = "range", + name = L["X Offset"], + min = -30, max = 30, step = 1, + hidden = false, + arg = "auraPoints.x", + }, + y = { + order = 7, + type = "range", + name = L["Y Offset"], + min = -30, max = 30, step = 1, + hidden = false, + arg = "auraPoints.y", + }, + }, + }, combatText = { order = 5, type = "group", @@ -4414,6 +4531,7 @@ local function loadUnitOptions() for _, data in pairs(ShadowUF.defaults.profile.units) do if( data[key] and data[key].isBar ~= nil ) then canHaveBar = true + break end end From 766656706eafe0f0654db62ac77c6d0aa42df745 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 30 Sep 2012 18:23:58 -0700 Subject: [PATCH 326/794] For consistency, all status bars (burning ember, demonic fury, totems, runes, etc) are now more consistent in how they handle inverting and background colors. You can now also invert the colors for all of those bars. Configuration for widget size has been tweaked and should be easier to use now since there are quite a lot more bar options than at release. --- modules/altpower.lua | 17 +---------------- modules/burningembers.lua | 6 +----- modules/demonicfury.lua | 4 +--- modules/druid.lua | 13 +------------ modules/health.lua | 12 ++++++------ modules/layout.lua | 2 +- modules/monk.lua | 13 +------------ modules/power.lua | 16 +--------------- modules/runes.lua | 20 +++++++++----------- modules/totems.lua | 20 ++++++++++---------- modules/units.lua | 19 +++++++++++++------ options/config.lua | 15 ++++++--------- 12 files changed, 51 insertions(+), 106 deletions(-) diff --git a/modules/altpower.lua b/modules/altpower.lua index 14db8565..5962677b 100755 --- a/modules/altpower.lua +++ b/modules/altpower.lua @@ -38,22 +38,7 @@ function AltPower:UpdateVisibility(frame) if( not visible ) then return end local color = ShadowUF.db.profile.powerColors.ALTERNATE - - if( not ShadowUF.db.profile.units[frame.unitType].powerBar.invert ) then - frame.altPowerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) - if( not frame.altPowerBar.background.overrideColor ) then - frame.altPowerBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) - end - else - frame.altPowerBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) - - color = frame.altPowerBar.background.overrideColor - if( not color ) then - frame.altPowerBar:SetStatusBarColor(0, 0, 0, 1 - ShadowUF.db.profile.bars.backgroundAlpha) - else - frame.altPowerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) - end - end + frame:SetBarColor("altPowerBar", color.r, color.g, color.b) AltPower:Update(frame) end diff --git a/modules/burningembers.lua b/modules/burningembers.lua index 4674ddc4..5188a8d5 100755 --- a/modules/burningembers.lua +++ b/modules/burningembers.lua @@ -111,11 +111,7 @@ function Embers:Update(frame, event, unit, powerType) if( ember.setColor ~= color ) then ember.setColor = color - - ember:SetStatusBarColor(ShadowUF.db.profile.powerColors[color].r, ShadowUF.db.profile.powerColors[color].g, ShadowUF.db.profile.powerColors[color].b) - - color = ShadowUF.db.profile.bars.backgroundColor or ShadowUF.db.profile.units[frame.unitType].burningEmbersBar.backgroundColor or ShadowUF.db.profile.powerColors[color] - ember.background:SetVertexColor(color.r, color.g, color.b, color.a or ShadowUF.db.profile.bars.backgroundAlpha) + frame:SetBlockColor(ember, "burningEmbersBar", ShadowUF.db.profile.powerColors[color].r, ShadowUF.db.profile.powerColors[color].g, ShadowUF.db.profile.powerColors[color].b) end power = power - MAX_POWER_PER_EMBER diff --git a/modules/demonicfury.lua b/modules/demonicfury.lua index c7868911..197dd153 100755 --- a/modules/demonicfury.lua +++ b/modules/demonicfury.lua @@ -14,7 +14,7 @@ end function DemonicFury:OnLayoutApplied(frame) if( frame.visibility.demonicFuryBar ) then local color = ShadowUF.db.profile.powerColors.DEMONICFURY - frame.demonicFuryBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) + frame:SetBarColor("demonicFuryBar", color.r, color.g, color.b) end end @@ -24,9 +24,7 @@ end function DemonicFury:UpdateMax(frame, event, unit, powerType) if( event and powerType ~= "DEMONIC_FURY" ) then return end - frame.demonicFuryBar:SetMinMaxValues(0, UnitPowerMax("player", SPELL_POWER_DEMONIC_FURY) or 0) - frame.demonicFuryBar:SetValue(UnitPower("player", SPELL_POWER_DEMONIC_FURY) or 0) end function DemonicFury:Update(frame, event, unit, powerType) diff --git a/modules/druid.lua b/modules/druid.lua index 0124b097..481638d8 100755 --- a/modules/druid.lua +++ b/modules/druid.lua @@ -18,18 +18,7 @@ function Druid:OnLayoutApplied(frame) if( not frame.visibility.druidBar ) then return end local color = ShadowUF.db.profile.powerColors.MANA - - if( not ShadowUF.db.profile.units[frame.unitType].druidBar.invert ) then - frame.druidBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) - if( not frame.druidBar.background.overrideColor ) then - frame.druidBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) - end - else - frame.druidBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) - - color = frame.druidBar.background.overrideColor or color - frame.druidBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) - end + frame:SetBarColor("druidBar", color.r, color.g, color.b) end function Druid:PowerChanged(frame) diff --git a/modules/health.lua b/modules/health.lua index 18289b07..abba2c3b 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -59,10 +59,10 @@ function Health:UpdateColor(frame) local reactionType = ShadowUF.db.profile.units[frame.unitType].healthBar.reactionType if( not UnitIsConnected(unit) ) then frame.healthBar.wasOffline = true - frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, ShadowUF.db.profile.healthColors.offline.r, ShadowUF.db.profile.healthColors.offline.g, ShadowUF.db.profile.healthColors.offline.b) + frame:SetBarColor("healthBar", ShadowUF.db.profile.healthColors.offline.r, ShadowUF.db.profile.healthColors.offline.g, ShadowUF.db.profile.healthColors.offline.b) return elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorAggro and UnitThreatSituation(frame.unit) == 3 ) then - frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, ShadowUF.db.profile.healthColors.hostile.r, ShadowUF.db.profile.healthColors.hostile.g, ShadowUF.db.profile.healthColors.hostile.b) + frame:SetBarColor("healthBar", ShadowUF.db.profile.healthColors.hostile.r, ShadowUF.db.profile.healthColors.hostile.g, ShadowUF.db.profile.healthColors.hostile.b) return elseif( frame.inVehicle ) then color = ShadowUF.db.profile.classColors.VEHICLE @@ -93,10 +93,10 @@ function Health:UpdateColor(frame) end if( color ) then - frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, color.r, color.g, color.b) + frame:SetBarColor("healthBar", color.r, color.g, color.b) else frame.healthBar.hasPercent = true - frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, getGradientColor(unit)) + frame:SetBarColor("healthBar", getGradientColor(unit)) end end @@ -111,13 +111,13 @@ function Health:Update(frame) if( isOffline ) then frame.healthBar.wasOffline = true frame.unitIsOnline = nil - frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, ShadowUF.db.profile.healthColors.offline.r, ShadowUF.db.profile.healthColors.offline.g, ShadowUF.db.profile.healthColors.offline.b) + frame:SetBarColor("healthBar", ShadowUF.db.profile.healthColors.offline.r, ShadowUF.db.profile.healthColors.offline.g, ShadowUF.db.profile.healthColors.offline.b) -- The unit was offline, but they no longer are so we need to do a forced color update elseif( frame.healthBar.wasOffline ) then frame.healthBar.wasOffline = nil self:UpdateColor(frame) -- Color health by percentage elseif( frame.healthBar.hasPercent ) then - frame:SetBarColor("healthBar", ShadowUF.db.profile.units[frame.unitType].healthBar.invert, getGradientColor(frame.unit)) + frame:SetBarColor("healthBar", getGradientColor(frame.unit)) end end diff --git a/modules/layout.lua b/modules/layout.lua index 338c7506..287c32b5 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -364,7 +364,7 @@ function Layout:SetupBars(frame, config) end if( widget.background ) then - if( config[key].background ) then + if( config[key].background or config[key].invert ) then widget.background:SetTexture(mediaPath.statusbar) widget.background:SetHorizTile(false) widget.background:Show() diff --git a/modules/monk.lua b/modules/monk.lua index 057c9683..2cb874bd 100755 --- a/modules/monk.lua +++ b/modules/monk.lua @@ -17,18 +17,7 @@ end function Monk:OnLayoutApplied(frame) if( frame.visibility.monkBar ) then local color = ShadowUF.db.profile.powerColors.MANA - - if( not ShadowUF.db.profile.units[frame.unitType].monkBar.invert ) then - frame.monkBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) - if( not frame.monkBar.background.overrideColor ) then - frame.monkBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) - end - else - frame.monkBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) - - color = frame.monkBar.background.overrideColor or color - frame.monkBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) - end + frame:SetBarColor("monkBar", color.r, color.g, color.b) end end diff --git a/modules/power.lua b/modules/power.lua index 07be7462..843b9919 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -42,22 +42,8 @@ function Power:UpdateColor(frame) end end end - - if( not ShadowUF.db.profile.units[frame.unitType].powerBar.invert ) then - frame.powerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) - if( not frame.powerBar.background.overrideColor ) then - frame.powerBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) - end - else - frame.powerBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha) - color = frame.powerBar.background.overrideColor - if( not color ) then - frame.powerBar:SetStatusBarColor(0, 0, 0, 1 - ShadowUF.db.profile.bars.backgroundAlpha) - else - frame.powerBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) - end - end + frame:SetBarColor("powerBar", color.r, color.g, color.b) -- Overridden power types like Warlock pets, or Ulduar vehicles use "POWER_TYPE_#####" but triggers power events with "ENERGY", so this fixes that -- by using the powerID to figure out the event type diff --git a/modules/runes.lua b/modules/runes.lua index 2b911342..e6942d5c 100755 --- a/modules/runes.lua +++ b/modules/runes.lua @@ -92,23 +92,21 @@ end function Runes:UpdateColors(frame) for id, rune in pairs(frame.runeBar.runes) do - local color = runeColors[GetRuneType(id)] - if( color ) then - rune:SetStatusBarColor(color.r, color.g, color.b) - - color = ShadowUF.db.profile.bars.backgroundColor or ShadowUF.db.profile.units[frame.unitType].runeBar.backgroundColor or color - rune.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) + local colorType = GetRuneType(id) + if( frame.runeBar.runes[id].colorType ~= colorType ) then + local color = runeColors[colorType] + frame:SetBlockColor(frame.runeBar.runes[id], "runeBar", color.r, color.g, color.b) end end end -- No rune is passed for full update (Login), a single rune is passed when a single rune type changes, such as Blood Tap function Runes:Update(frame, event, id) - if( id ) then - local color = runeColors[GetRuneType(id)] - frame.runeBar.runes[id]:SetStatusBarColor(color.r, color.g, color.b) + if( not id ) then return end - color = ShadowUF.db.profile.bars.backgroundColor or ShadowUF.db.profile.units[frame.unitType].runeBar.backgroundColor or color - frame.runeBar.runes[id].background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) + local colorType = GetRuneType(id) + if( frame.runeBar.runes[id].colorType ~= colorType ) then + local color = runeColors[colorType] + frame:SetBlockColor(frame.runeBar.runes[id], "runeBar", color.r, color.g, color.b) end end diff --git a/modules/totems.lua b/modules/totems.lua index 9497b709..9385e0f9 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -71,22 +71,22 @@ function Totems:OnLayoutApplied(frame) local barWidth = (frame.totemBar:GetWidth() - (MAX_TOTEMS - 1)) / MAX_TOTEMS for _, totem in pairs(frame.totemBar.totems) do - if( ShadowUF.db.profile.units[frame.unitType].totemBar.background ) then - local color = ShadowUF.db.profile.bars.backgroundColor or ShadowUF.db.profile.units[frame.unitType].totemBar.backgroundColor or totemColors[totem.id] - totem.background:SetTexture(ShadowUF.Layout.mediaPath.statusbar) - totem.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) - totem.background:Show() - else - totem.background:Hide() - end - totem:SetHeight(frame.totemBar:GetHeight()) totem:SetWidth(barWidth) totem:SetOrientation(ShadowUF.db.profile.units[frame.unitType].totemBar.vertical and "VERTICAL" or "HORIZONTAL") totem:SetReverseFill(ShadowUF.db.profile.units[frame.unitType].totemBar.reverse and true or false) totem:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) - totem:SetStatusBarColor(totemColors[totem.id].r, totemColors[totem.id].g, totemColors[totem.id].b, ShadowUF.db.profile.bars.alpha) totem:GetStatusBarTexture():SetHorizTile(false) + + totem.background:SetTexture(ShadowUF.Layout.mediaPath.statusbar) + + if( ShadowUF.db.profile.units[frame.unitType].totemBar.background or ShadowUF.db.profile.units[frame.unitType].totemBar.invert ) then + totem.background:Show() + else + totem.background:Hide() + end + + frame:SetBlockColor(totem, "totemBar", totemColors[totem.id].r, totemColors[totem.id].g, totemColors[totem.id].b) end end end diff --git a/modules/units.lua b/modules/units.lua index 793727c4..24e45365 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -175,19 +175,25 @@ local function SetRangeAlpha(self, alpha) end end -local function SetBarColor(self, key, invert, r, g, b) - local bar = self[key] - if( not invert ) then +local function SetBarColor(self, key, r, g, b) + self:SetBlockColor(self[key], key, r, g, b) +end + +local function SetBlockColor(self, bar, key, r, g, b) + local bgColor = bar.background.overrideColor or bar.background.backgroundColor + if( not ShadowUF.db.profile.units[self.unitType][key].invert ) then bar:SetStatusBarColor(r, g, b, ShadowUF.db.profile.bars.alpha) - if( not bar.background.overrideColor ) then + if( not bgColor ) then bar.background:SetVertexColor(r, g, b, ShadowUF.db.profile.bars.backgroundAlpha) + else + bar.background:SetVertexColor(bgColor.r, bgColor.g, bgColor.b, ShadowUF.db.profile.bars.backgroundAlpha) end else bar.background:SetVertexColor(r, g, b, ShadowUF.db.profile.bars.alpha) - if( not bar.background.overrideColor ) then + if( not bgColor ) then bar:SetStatusBarColor(0, 0, 0, 1 - ShadowUF.db.profile.bars.backgroundAlpha) else - bar:SetStatusBarColor(bar.background.overrideColor.r, bar.background.overrideColor.g, bar.background.overrideColor.b, 1 - ShadowUF.db.profile.bars.backgroundAlpha) + bar:SetStatusBarColor(bgColor.r, bgColor.g, bgColor.b, 1 - ShadowUF.db.profile.bars.backgroundAlpha) end end end @@ -697,6 +703,7 @@ function Units:CreateUnit(...) frame.UnregisterUpdateFunc = UnregisterUpdateFunc frame.ReregisterUnitEvents = ReregisterUnitEvents frame.SetBarColor = SetBarColor + frame.SetBlockColor = SetBlockColor frame.FullUpdate = FullUpdate frame.SetVisibility = SetVisibility frame.topFrameLevel = 5 diff --git a/options/config.lua b/options/config.lua index 83c17eed..9bf3e6e9 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2163,7 +2163,7 @@ local function loadUnitOptions() order = getModuleOrder, name = getName, type = "group", - inline = true, + inline = false, hidden = function(info) return hideRestrictedOption(info) or not getVariable(info[2], info[#(info)], nil, "enabled") end, args = { enableBar = { @@ -2173,8 +2173,8 @@ local function loadUnitOptions() desc = L["Turns this widget into a bar that can be resized and ordered just like health and power bars."], hidden = function(info) return ShadowUF.modules[info[#(info) - 1]].moduleHasBar end, arg = "$parent.isBar", - width = "full", }, + sep1 = {order = 1.25, type = "description", name = "", hidden = function(info) return (info[#(info) - 1] ~= "burningEmbersBar" or not getVariable(info[2], info[#(info) - 1], nil, "backgroundColor") or not getVariable(info[2], info[#(info) - 1], nil, "background")) end}, background = { order = 1.5, type = "toggle", @@ -2183,6 +2183,7 @@ local function loadUnitOptions() hidden = hideBarOption, arg = "$parent.background", }, + sep2 = {order = 1.55, type = "description", name = "", hidden = function(info) return not (not ShadowUF.modules[info[#(info) - 1]] or info[#(info) - 1] == "eclipseBar" or not ShadowUF.db.profile.advanced or ShadowUF.modules[info[#(info) - 1]].isComboPoints) end}, overrideBackground = { order = 1.6, type = "toggle", @@ -2227,7 +2228,6 @@ local function loadUnitOptions() end, arg = "$parent.backgroundColor", }, - sep3 = {order = 1.66, type = "description", name = "", hidden = function(info) return info[#(info) - 1] ~= "burningEmbersBar" or not ShadowUF.db.profile.advanced end}, vertical = { order = 1.70, type = "toggle", @@ -2244,18 +2244,15 @@ local function loadUnitOptions() arg = "$parent.reverse", hidden = function(info) return not ShadowUF.db.profile.advanced or ShadowUF.modules[info[#(info) - 1]].isComboPoints end, }, - sep2 = {order = 1.75, type = "description", name = "", hidden = function(info) - local moduleKey = info[#(info) - 1] - return ( moduleKey ~= "healthBar" and moduleKey ~= "powerBar" and moduleKey ~= "druidBar" and moduleKey ~= "monkBar" and moduleKey ~= "burningEmbersBar" ) or not ShadowUF.db.profile.advanced - end}, invert = { order = 2, type = "toggle", name = L["Invert colors"], desc = L["Flips coloring so the bar color is shown as the background color and the background as the bar"], - hidden = function(info) return ( info[#(info) - 1] ~= "healthBar" and info[#(info) - 1] ~= "powerBar" and info[#(info) - 1] ~= "druidBar" and info[#(info) - 1] ~= "monkBar" ) or not ShadowUF.db.profile.advanced end, + hidden = function(info) return not ShadowUF.modules[info[#(info) - 1]] or info[#(info) - 1] == "eclipseBar" or not ShadowUF.db.profile.advanced or ShadowUF.modules[info[#(info) - 1]].isComboPoints end, arg = "$parent.invert", }, + sep3 = {order = 3, type = "description", name = "", hidden = function(info) return not ShadowUF.modules[info[#(info) - 1]] or info[#(info) - 1] == "eclipseBar" or not ShadowUF.db.profile.advanced or ShadowUF.modules[info[#(info) - 1]].isComboPoints end,}, order = { order = 4, type = "range", @@ -4193,7 +4190,7 @@ local function loadUnitOptions() order = 0.5, type = "group", name = L["Portrait"], - inline = true, + inline = false, hidden = false, args = { enableBar = { From da091d972b99e48f942ba73f43be0ca562ab1488 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 30 Sep 2012 18:28:50 -0700 Subject: [PATCH 327/794] Aura points should default to show always --- ShadowedUnitFrames.lua | 2 +- modules/defaultlayout.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 04991b1d..a6b14c40 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -88,7 +88,7 @@ function ShadowUF:CheckUpgrade() if( revision <= 24 ) then self.db.profile.powerColors.AURAPOINTS = {r = 1.0, g = 0.80, b = 0} - self.db.profile.units.player.auraPoints = {enabled = false, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40} + self.db.profile.units.player.auraPoints = {enabled = false, showAlways = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40} end if( revision <= 23 ) then diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 9c151f8e..fa9ebd40 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -328,7 +328,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, eclipseBar = {enabled = true, background = true, order = 70, height = 0.40}, - auraPoints = {enabled = false, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, + auraPoints = {enabled = false, showAlways = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, demonicFuryBar = {enabled = true, background = false, height = 0.50, order = 70}, burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70}, soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, From f30614aba988a4c158ae778dd614854a82e12844 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 1 Oct 2012 10:42:32 -0700 Subject: [PATCH 328/794] Up possible battleground units to 4 for Temple of Kotmogu --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index a6b14c40..78c38b75 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -23,7 +23,7 @@ for i=1, MAX_RAID_MEMBERS do ShadowUF.raidUnits[i] = "raid" .. i end for i=1, MAX_RAID_MEMBERS do ShadowUF.raidPetUnits[i] = "raidpet" .. i end for i=1, MAX_BOSS_FRAMES do ShadowUF.bossUnits[i] = "boss" .. i end for i=1, 5 do ShadowUF.arenaUnits[i] = "arena" .. i end -for i=1, 2 do ShadowUF.battlegroundUnits[i] = "arena" .. i end +for i=1, 4 do ShadowUF.battlegroundUnits[i] = "arena" .. i end function ShadowUF:OnInitialize() self.defaults = { From c5202d633d2fc23482a60963e212db4e4e82a759 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 1 Oct 2012 17:24:06 -0700 Subject: [PATCH 329/794] Added support for minus mobs (No power) will show an empty mana bar with a grey background. Also added to [classification] and [shortclassification] tags --- modules/health.lua | 2 +- modules/power.lua | 27 ++++++++++++++++++++++++++- modules/tags.lua | 8 +++++--- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/modules/health.lua b/modules/health.lua index abba2c3b..59b5dc2d 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -35,7 +35,7 @@ function Health:OnEnable(frame) frame:RegisterUnitEvent("UNIT_CONNECTION", self, "Update") frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdateColor") frame:RegisterUnitEvent("UNIT_THREAT_SITUATION_UPDATE", self, "UpdateColor") - frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "Update") + frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "Update") if( frame.unit == "pet" ) then frame:RegisterUnitEvent("UNIT_POWER", self, "UpdateColor") diff --git a/modules/power.lua b/modules/power.lua index 843b9919..9c488d12 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -11,7 +11,9 @@ function Power:OnEnable(frame) frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", self, "Update") frame:RegisterUnitEvent("UNIT_POWER_BAR_HIDE", self, "Update") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdateColor") + frame:RegisterUnitEvent("UNIT_CLASSIFICATION_CHANGED", self, "UpdateClassification") + frame:RegisterUpdateFunc(self, "UpdateClassification") frame:RegisterUpdateFunc(self, "UpdateColor") frame:RegisterUpdateFunc(self, "Update") end @@ -26,7 +28,9 @@ function Power:UpdateColor(frame) frame.powerBar.currentType = currentType local color - if( ShadowUF.db.profile.units[frame.unitType].powerBar.colorType == "class" and UnitIsPlayer(frame.unit) ) then + if( frame.powerBar.minusMob ) then + color = ShadowUF.db.profile.healthColors.offline + elseif( ShadowUF.db.profile.units[frame.unitType].powerBar.colorType == "class" and UnitIsPlayer(frame.unit) ) then local class = select(2, UnitClass(frame.unit)) color = class and ShadowUF.db.profile.classColors[class] end @@ -54,8 +58,29 @@ function Power:UpdateColor(frame) self:Update(frame) end +function Power:UpdateClassification(frame, event, unit) + local classif = UnitClassification(frame.unit) + local minus = nil + if( classif == "minus" ) then + minus = true + + frame.powerBar:SetMinMaxValue(0, 1) + frame.powerBar:SetValue(0) + end + + if( minus ~= frame.powerBar.minusMob ) then + frame.powerBar.minusMob = minus + + -- Only need to force an update if it was event driven, otherwise the update func will hit color/etc next + if( event ) then + self:UpdateColor(frame) + end + end +end + function Power:Update(frame, event, unit, powerType) if( event and powerType and powerType ~= frame.powerBar.currentType ) then return end + if( frame.powerBar.minusMob ) then return end frame.powerBar.currentPower = UnitPower(frame.unit) frame.powerBar:SetMinMaxValues(0, UnitPowerMax(frame.unit)) diff --git a/modules/tags.lua b/modules/tags.lua index 93a5413a..c01fb91b 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -884,13 +884,15 @@ Tags.defaultTags = { return ShadowUF.L["Elite"] elseif( classif == "worldboss" ) then return ShadowUF.L["Boss"] + elseif( classif == "minus" ) then + return ShadowUF.L["Minion"] end return nil end]], ["shortclassification"] = [[function(unit, unitOwner) local classif = UnitClassification(unit) - return classif == "rare" and "R" or classif == "rareelite" and "R+" or classif == "elite" and "+" or classif == "worldboss" and "B" + return classif == "rare" and "R" or classif == "rareelite" and "R+" or classif == "elite" and "+" or classif == "worldboss" and "B" or classif = "minus" and "M" end]], ["group"] = [[function(unit, unitOwner) if( not UnitInRaid(unitOwner) ) then return nil end @@ -1217,8 +1219,8 @@ Tags.defaultHelp = { ["hpower"] = L["Total number of active holy power."], ["sshards"] = L["Total number of active soul shards."], ["smartlevel"] = L["Smart level, returns Boss for bosses, +50 for a level 50 elite mob, or just 80 for a level 80."], - ["classification"] = L["Units classification, Rare, Rare Elite, Elite, Boss, nothing is shown if they aren't any of those."], - ["shortclassification"] = L["Short classifications, R for Rare, R+ for Rare Elite, + for Elite, B for boss, nothing is shown if they aren't any of those."], + ["classification"] = L["Units classification, Rare, Rare Elite, Elite, Boss or Minion nothing is shown if they aren't any of those."], + ["shortclassification"] = L["Short classifications, R for Rare, R+ for Rare Elite, + for Elite, B for Boss or M for Minion nothing is shown if they aren't any of those."], ["rare"] = L["Returns Rare if the unit is a rare or rare elite mob."], ["plus"] = L["Returns + if the unit is an elite or rare elite mob."], ["sex"] = L["Returns the units sex."], From 71dd12d4b08178178168e9c8b7886d5598bfe004 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 1 Oct 2012 17:33:31 -0700 Subject: [PATCH 330/794] Typo --- modules/tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tags.lua b/modules/tags.lua index c01fb91b..8fe618d9 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -892,7 +892,7 @@ Tags.defaultTags = { end]], ["shortclassification"] = [[function(unit, unitOwner) local classif = UnitClassification(unit) - return classif == "rare" and "R" or classif == "rareelite" and "R+" or classif == "elite" and "+" or classif == "worldboss" and "B" or classif = "minus" and "M" + return classif == "rare" and "R" or classif == "rareelite" and "R+" or classif == "elite" and "+" or classif == "worldboss" and "B" or classif == "minus" and "M" end]], ["group"] = [[function(unit, unitOwner) if( not UnitInRaid(unitOwner) ) then return nil end From 813543118282034c39bc3dac278e8e78fb8b010d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 1 Oct 2012 21:27:20 -0700 Subject: [PATCH 331/794] Typo --- modules/power.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/power.lua b/modules/power.lua index 9c488d12..beb48209 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -64,7 +64,7 @@ function Power:UpdateClassification(frame, event, unit) if( classif == "minus" ) then minus = true - frame.powerBar:SetMinMaxValue(0, 1) + frame.powerBar:SetMinMaxValues(0, 1) frame.powerBar:SetValue(0) end From df08565499dc14b72de0773e6cc98ef703f2c74c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 1 Oct 2012 21:27:29 -0700 Subject: [PATCH 332/794] Code cleanup and fixed events that weren't unit filtered --- modules/eclipse.lua | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/eclipse.lua b/modules/eclipse.lua index a4de9802..5ef81228 100755 --- a/modules/eclipse.lua +++ b/modules/eclipse.lua @@ -27,8 +27,8 @@ function Eclipse:OnEnable(frame) frame.eclipseBar.sun:SetPoint("BOTTOMLEFT", frame.eclipseBar, "BOTTOM") end - frame:RegisterNormalEvent("UNIT_POWER_FREQUENT", self, "Update") - frame:RegisterNormalEvent("UNIT_MAXPOWER", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") frame:RegisterNormalEvent("ECLIPSE_DIRECTION_CHANGE", self, "UpdateDirection") frame:RegisterNormalEvent("UPDATE_SHAPESHIFT_FORM", self, "UpdateVisibility") @@ -49,14 +49,15 @@ function Eclipse:OnLayoutApplied(frame) frame.eclipseBar[type]:SetHorizTile(false) end frame.eclipseBar.marker:SetSize(frame.eclipseBar:GetHeight() * 2, frame.eclipseBar:GetHeight() * 2) - Eclipse:UpdateVisibility(frame) + + self:UpdateVisibility(frame) end function Eclipse:UpdateVisibility(frame) local form = GetShapeshiftFormID() ShadowUF.Layout:SetBarVisibility(frame, "eclipseBar", (form == MOONKIN_FORM or not form)) - Eclipse:UpdateDirection(frame) - Eclipse:Update(frame, nil, nil, "ECLIPSE") + self:UpdateDirection(frame) + self:Update(frame, nil, nil, "ECLIPSE") end function Eclipse:UpdateDirection(frame) @@ -66,10 +67,10 @@ function Eclipse:UpdateDirection(frame) end end -function Eclipse:Update(frame, event, unit, id) - if( id == "ECLIPSE" ) then - local power = UnitPower("player", SPELL_POWER_ECLIPSE) - local xpos = (frame.eclipseBar:GetWidth() / 2) * (power / 100) - frame.eclipseBar.marker:SetPoint("CENTER", frame.eclipseBar, "CENTER", xpos, 0) - end +function Eclipse:Update(frame, event, unit, powerType) + if( event and powerType ~= "ECLIPSE" ) then return end + + local power = UnitPower("player", SPELL_POWER_ECLIPSE) + local xpos = (frame.eclipseBar:GetWidth() / 2) * (power / 100) + frame.eclipseBar.marker:SetPoint("CENTER", frame.eclipseBar, "CENTER", xpos, 0) end From b9ca0ff09d0c2023d33ee53c9c7c50cf86dcaecb Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 1 Oct 2012 21:27:55 -0700 Subject: [PATCH 333/794] Added a [druid:eclipse] tag to show the current eclipse value from -100 to 100w --- modules/tags.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/tags.lua b/modules/tags.lua index 8fe618d9..06b4c785 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -937,6 +937,11 @@ Tags.defaultTags = { return string.format("%s/%s", ShadowUF:FormatLargeNumber(power), ShadowUF:FormatLargeNumber(maxPower)) end]], + ["druid:eclipse"] = [[function(unit, unitOwner) + if( GetSpecialization() ~= 1 ) then return nil end + + return UnitPower(unitOwner, SPELL_POWER_ECLIPSE) + end]], ["druid:absolutepp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end if( GetSpecialization() ~= SPEC_MONK_MISTWEAVER ) then return nil end @@ -1049,6 +1054,7 @@ Tags.defaultEvents = { ["curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["absolutepp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["smart:curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", + ["druid:eclipse"] = "SUF_POWERTYPE:ECLIPSE UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["druid:curpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", ["druid:abscurpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", ["druid:curmaxpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", @@ -1174,6 +1180,7 @@ Tags.defaultCategories = { ["druid:abscurpp"] = "classspec", ["druid:curmaxpp"] = "classspec", ["druid:absolutepp"] = "classspec", + ["druid:eclipse"] = "classspec", ["monk:curpp"] = "classspec", ["monk:abscurpp"] = "classspec", ["monk:curmaxpp"] = "classspec", @@ -1259,6 +1266,7 @@ Tags.defaultHelp = { ["abbrev:name"] = L["Abbreviates unit names above 10 characters, \"Dark Rune Champion\" becomes \"D.R.Champion\" and \"Dark Rune Commoner\" becomes \"D.R.Commoner\"."], ["group"] = L["Shows current group number of the unit."], ["close"] = L["Closes a color code, prevents colors from showing up on text that you do not want it to."], + ["druid:eclipse"] = L["Current Eclipse, <0 is Lunar Energy and >0 is Solar Energy."], ["druid:curpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "currpp"), ["druid:abscurpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "abscurpp"), ["druid:curmaxpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "curmaxpp"), @@ -1348,6 +1356,7 @@ Tags.defaultNames = { ["dechp"] = L["Decimal percent HP"], ["group"] = L["Group number"], ["close"] = L["Close color"], + ["druid:eclipse"] = L["Eclipse (Druid)"], ["druid:curpp"] = L["Current power (Druid)"], ["druid:abscurpp"] = L["Current power (Druid/Absolute)"], ["druid:curmaxpp"] = L["Cur/Max power (Druid)"], From c5e18806335316452ad3ed17584d294d26db987a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 1 Oct 2012 21:39:11 -0700 Subject: [PATCH 334/794] Add Eclipse support to the movers --- modules/movers.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/movers.lua b/modules/movers.lua index 2f3f5046..16cf4814 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -41,6 +41,8 @@ local function createConfigEnv() UnitPower = function(unit, powerType) if( powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS ) then return 3 + elseif( powerType == SPELL_POWER_ECLIPSE ) then + return getValue("UnitPower", unit, math.random(-100, 100)) elseif( powerType == SPELL_POWER_LIGHT_FORCE ) then return 4 elseif( powerType == SPELL_POWER_SHADOW_ORBS ) then @@ -59,6 +61,8 @@ local function createConfigEnv() UnitPowerMax = function(unit, powerType) if( powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS ) then return 3 + elseif( powerType == SPELL_POWER_ECLIPSE ) then + return 100 elseif( powerType == SPELL_POWER_LIGHT_FORCE ) then return 4 elseif( powerType == SPELL_POWER_SHADOW_ORBS ) then From 97ea4a8faf337027b1d89ee43270a666eed9997f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 1 Oct 2012 21:39:15 -0700 Subject: [PATCH 335/794] Fixed upgrades being ran when a new DB is loaded. Also fixed the default text tags for demonic fury not showing, and added one for the eclipse bar --- ShadowedUnitFrames.lua | 11 +++++++++-- modules/defaultlayout.lua | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 78c38b75..46002c70 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 25 +ShadowUF.dbRevision = 26 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -84,7 +84,11 @@ function ShadowUF:OnInitialize() end function ShadowUF:CheckUpgrade() - local revision = self.db.profile.revision or 1 + local revision = self.db.profile.revision or self.dbRevision + + if( revision <= 25 ) then + table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = -1, x = 0, y = 0}) + end if( revision <= 24 ) then self.db.profile.powerColors.AURAPOINTS = {r = 1.0, g = 0.80, b = 0} @@ -334,6 +338,9 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.chi = {enabled = true, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} self.defaults.profile.units.player.auraPoints = {enabled = false, isBar = true} + table.insert(self.defaults.profile.units.player.text, {enabled = true}) + table.insert(self.defaults.profile.units.player.text, {enabled = true}) + -- PET self.defaults.profile.units.pet.enabled = true self.defaults.profile.units.pet.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index fa9ebd40..f2a81017 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -327,7 +327,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) runeBar = {enabled = true, background = false, height = 0.40, order = 70}, totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, - eclipseBar = {enabled = true, background = true, order = 70, height = 0.40}, + eclipseBar = {enabled = true, background = true, order = 70, height = 0.75}, auraPoints = {enabled = false, showAlways = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, demonicFuryBar = {enabled = true, background = false, height = 0.50, order = 70}, burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70}, @@ -348,6 +348,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[perpp]"}, {text = "[curmaxpp]"}, {text = "[(()afk() )][name][( ()group())]"}, + {enabled = true, width = 1, name = L["Text"], text = "[warlock:demonic:curpp]", anchorTo = "$demonicFuryBar", anchorPoint = "C", size = 0, x = 0, y = 0}, + {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = -1, x = 0, y = 0} }, }, party = { From 2090ee567e14da92ff1fcd398b0d044ef184a0bd Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 2 Oct 2012 08:00:04 -0700 Subject: [PATCH 336/794] Default layout should only add demonic fury text to the player unit --- modules/defaultlayout.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index f2a81017..09d209a0 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -233,8 +233,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) {width = 0.60, name = L["Right text"], anchorTo = "$powerBar", anchorPoint = "CRI", x = -3, y = 0, size = 0}, {width = 1, name = L["Text"], anchorTo = "$emptyBar", anchorPoint = "CLI", x = 3, y = 0, size = 0}, - - {enabled = true, width = 1, name = L["Text"], anchorTo = "$demonicFuryBar", anchorPoint = "C", x = 3, y = 0, size = -1}, }, indicators = { raidTarget = {anchorTo = "$parent", anchorPoint = "C", size = 20, x = 0, y = 0}, @@ -348,8 +346,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[perpp]"}, {text = "[curmaxpp]"}, {text = "[(()afk() )][name][( ()group())]"}, - {enabled = true, width = 1, name = L["Text"], text = "[warlock:demonic:curpp]", anchorTo = "$demonicFuryBar", anchorPoint = "C", size = 0, x = 0, y = 0}, - {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = -1, x = 0, y = 0} + {enabled = true, width = 1, name = L["Text"], text = "[warlock:demonic:curpp]", anchorTo = "$demonicFuryBar", anchorPoint = "C", x = 3, y = 0, size = -1}, + {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = 0, x = 0, y = 0} }, }, party = { From feff5d0ff6366db1491f13d44383b6e39fd522a0 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 2 Oct 2012 08:00:40 -0700 Subject: [PATCH 337/794] Fix defaults for eclipse/demonic fury text --- ShadowedUnitFrames.lua | 18 +++++++++++++++--- options/config.lua | 10 ++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 46002c70..eac8f642 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 26 +ShadowUF.dbRevision = 27 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -86,6 +86,18 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 26 ) then + for _, unit in pairs(self.unitList) do + if( unit ~= "player" ) then + for id, text in pairs(self.db.profile.units[unit].text) do + if( text.anchorTo == "$demonicFuryBar" ) then + self.db.profile.units[unit].text[id] = nil + end + end + end + end + end + if( revision <= 25 ) then table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = -1, x = 0, y = 0}) end @@ -338,8 +350,8 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.chi = {enabled = true, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} self.defaults.profile.units.player.auraPoints = {enabled = false, isBar = true} - table.insert(self.defaults.profile.units.player.text, {enabled = true}) - table.insert(self.defaults.profile.units.player.text, {enabled = true}) + table.insert(self.defaults.profile.units.player.text, {enabled = false, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0}) + table.insert(self.defaults.profile.units.player.text, {enabled = false, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0}) -- PET self.defaults.profile.units.pet.enabled = true diff --git a/options/config.lua b/options/config.lua index 9bf3e6e9..5714c56b 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1384,10 +1384,12 @@ local function loadGeneralOptions() -- Load text for id, text in pairs(ShadowUF.db.profile.units.player.text) do - addTextParent.args[id .. ":label"] = addTextLabel - addTextParent.args[tostring(id)] = addText - addTextParent.args[id .. ":sep"] = addTextSep - options.args.general.args.text.args[text.anchorTo] = addTextParent + if( text.anchorTo ~= "" ) then + addTextParent.args[id .. ":label"] = addTextLabel + addTextParent.args[tostring(id)] = addText + addTextParent.args[id .. ":sep"] = addTextSep + options.args.general.args.text.args[text.anchorTo] = addTextParent + end end From bfef036a895fc2198a3de418524150e36250fb59 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 3 Oct 2012 16:35:58 -0700 Subject: [PATCH 338/794] Fixed units showing up as offline when they entered Traveler's Tundra Mammoth and other mounts of the same type --- modules/combopoints.lua | 2 +- modules/units.lua | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 93c2850c..bd6675e4 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -150,7 +150,7 @@ function Combo:Update(frame, event, unit) --if( event and unit ~= "player" ) then return end -- For Malygos dragons, they also self cast their CP on themselves, which is why we check CP on ourself! - local playerUnit = UnitHasVehiclePlayerFrameUI("player") and "vehicle" or "player" + local playerUnit = UnitHasVehicleUI("player") and UnitHasVehiclePlayerFrameUI("player") and "vehicle" or "player" local points = GetComboPoints(playerUnit) if( points == 0 ) then points = GetComboPoints(playerUnit, playerUnit) diff --git a/modules/units.lua b/modules/units.lua index 24e45365..4b124a25 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -315,7 +315,7 @@ local function checkVehicleData(self, elapsed) self.dataAttempts = self.dataAttempts + 1 -- Took too long to get vehicle data, or they are no longer in a vehicle - if( self.dataAttempts >= 6 or not UnitHasVehiclePlayerFrameUI(self.unitOwner) ) then + if( self.dataAttempts >= 6 or not UnitHasVehicleUI(self.unitOwner) or not UnitHasVehiclePlayerFrameUI(self.unitOwner) ) then self.timeElapsed = nil self.dataAttempts = nil self:SetScript("OnUpdate", nil) @@ -341,7 +341,7 @@ function Units:CheckVehicleStatus(frame, event, unit) if( event and frame.unitOwner ~= unit ) then return end -- Not in a vehicle yet, and they entered one that has a UI or they were in a vehicle but the GUID changed (vehicle -> vehicle) - if( ( not frame.inVehicle or frame.unitGUID ~= UnitGUID(frame.vehicleUnit) ) and UnitHasVehiclePlayerFrameUI(frame.unitOwner) and not ShadowUF.db.profile.units[frame.unitType].disableVehicle ) then + if( ( not frame.inVehicle or frame.unitGUID ~= UnitGUID(frame.vehicleUnit) ) and UnitHasVehicleUI(frame.unitOwner) and UnitHasVehiclePlayerFrameUI(frame.unitOwner) and not ShadowUF.db.profile.units[frame.unitType].disableVehicle ) then frame.inVehicle = true frame.unit = frame.vehicleUnit @@ -356,7 +356,7 @@ function Units:CheckVehicleStatus(frame, event, unit) end -- Was in a vehicle, no longer has a UI - elseif( frame.inVehicle and ( not UnitHasVehiclePlayerFrameUI(frame.unitOwner) or ShadowUF.db.profile.units[frame.unitType].disableVehicle ) ) then + elseif( frame.inVehicle and ( not UnitHasVehicleUI(frame.unitOwner) or not UnitHasVehiclePlayerFrameUI(frame.unitOwner) or ShadowUF.db.profile.units[frame.unitType].disableVehicle ) ) then frame.inVehicle = false frame.unit = frame.unitOwner frame.unitGUID = UnitGUID(frame.unit) @@ -528,7 +528,7 @@ OnAttributeChanged = function(self, name, unit) end -- Logged out in a vehicle - if( UnitHasVehiclePlayerFrameUI(self.unitRealOwner) ) then + if( UnitHasVehicleUI(self.unitRealOwner) and UnitHasVehiclePlayerFrameUI(self.unitRealOwner) ) then self:SetAttribute("unitIsVehicle", true) end From 1abf14713b10ee4c698cfa16ca415bbd389be3f2 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 3 Oct 2012 16:39:58 -0700 Subject: [PATCH 339/794] Eclipse bar will hide while the player is in a vehicle --- modules/eclipse.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/eclipse.lua b/modules/eclipse.lua index 5ef81228..5c18cb0d 100755 --- a/modules/eclipse.lua +++ b/modules/eclipse.lua @@ -55,7 +55,7 @@ end function Eclipse:UpdateVisibility(frame) local form = GetShapeshiftFormID() - ShadowUF.Layout:SetBarVisibility(frame, "eclipseBar", (form == MOONKIN_FORM or not form)) + ShadowUF.Layout:SetBarVisibility(frame, "eclipseBar", form == MOONKIN_FORM or not form and not frame.inVehicle) self:UpdateDirection(frame) self:Update(frame, nil, nil, "ECLIPSE") end From 631405d681a16fb8b9f0f3fef37f0bc5db9a0aa4 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 3 Oct 2012 16:47:03 -0700 Subject: [PATCH 340/794] Hide the totem bar while in a vehicle (Not sure if I'll keep this) --- modules/totems.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/totems.lua b/modules/totems.lua index 9385e0f9..0650da4a 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -25,7 +25,7 @@ function Totems:OnEnable(frame) local priorities = (select(2, UnitClass("player")) == "SHAMAN") and SHAMAN_TOTEM_PRIORITIES or STANDARD_TOTEM_PRIORITIES for id=1, MAX_TOTEMS do - local totem = ShadowUF.Units:CreateBar(frame) + local totem = ShadowUF.Units:CreateBar(frame.totemBar) totem:SetMinMaxValues(0, 1) totem:SetValue(0) totem.id = MAX_TOTEMS == 1 and 1 or priorities[id] @@ -54,6 +54,7 @@ function Totems:OnEnable(frame) end frame:RegisterNormalEvent("PLAYER_TOTEM_UPDATE", self, "Update") + frame:RegisterUpdateFunc(self, "UpdateVisibility") frame:RegisterUpdateFunc(self, "Update") end @@ -101,6 +102,19 @@ local function totemMonitor(self, elapsed) end end +function Totems:UpdateVisibility(frame) + if( frame.totemBar.inVehicle ~= frame.inVehicle ) then + frame.totemBar.inVehicle = frame.inVehicle + + if( frame.inVehicle ) then + ShadowUF.Layout:SetBarVisibility(frame, "totemBar", false) + -- Below check on Update to only show when we have 1 totem if it's active will handle reshowing it + elseif( MAX_TOTEMS ~= 1 ) then + ShadowUF.Layout:SetBarVisibility(frame, "totemBar", true) + end + end +end + function Totems:Update(frame) local totalActive = 0 for _, indicator in pairs(frame.totemBar.totems) do @@ -124,7 +138,7 @@ function Totems:Update(frame) end -- Only guardian timers should auto hide, nothing else - if( MAX_TOTEMS == 1 ) then + if( MAX_TOTEMS == 1 and not frame.inVehicle ) then ShadowUF.Layout:SetBarVisibility(frame, "totemBar", totalActive > 0) end end From 343539a445b9dba8c4dce6952ab6708c8b6b4439 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 7 Oct 2012 15:31:44 -0700 Subject: [PATCH 341/794] Rehide Blizzard frames if they are shown while disabled without tainting them. Accounts for poorly done addons that forcibly show frames like VuhDo and HealBot --- ShadowedUnitFrames.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index eac8f642..07c4793c 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -529,6 +529,12 @@ end ShadowUF.noop = function() end +local rehideFrame = function(self) + if( not InCombatLockdown() ) then + self:Hide() + end +end + local active_hiddens = {} function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.cast and not active_hiddens.cast ) then @@ -554,6 +560,7 @@ function ShadowUF:HideBlizzardFrames() -- This just makes sure if( CompactPartyFrame ) then + CompactPartyFrame:HookScript("OnShow", rehideFrame) CompactPartyFrame:UnregisterAllEvents() CompactPartyFrame:Hide() end @@ -595,6 +602,7 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.player and not active_hiddens.player ) then PlayerFrame:UnregisterAllEvents() + PlayerFrame:HookScript("OnShow", rehideFrame) PlayerFrame:Hide() -- We keep these in case someone is still using the default auras, otherwise it messes up vehicle stuff @@ -613,12 +621,15 @@ function ShadowUF:HideBlizzardFrames() for _, frame in pairs({EclipseBarFrame, ShardBarFrame, RuneFrame, TotemFrame, PaladinPowerBar, MonkHarmonyBar, PriestBarFrame, WarlockPowerFrame}) do frame:UnregisterAllEvents() frame:Hide() + + frame.RegisterAllEvents = self.noop frame.Show = self.noop end end if( ShadowUF.db.profile.hidden.pet and not active_hiddens.pet ) then PetFrame:UnregisterAllEvents() + PetFrame:HookScript("OnShow", rehideFrame) PetFrame:Hide() PetFrameHealthBar:UnregisterAllEvents() @@ -626,6 +637,7 @@ function ShadowUF:HideBlizzardFrames() end if( ShadowUF.db.profile.hidden.target and not active_hiddens.target ) then + TargetFrame:HookScript("OnShow", rehideFrame) TargetFrame:UnregisterAllEvents() TargetFrame:Hide() @@ -638,6 +650,7 @@ function ShadowUF:HideBlizzardFrames() end if( ShadowUF.db.profile.hidden.focus and not active_hiddens.focus ) then + FocusFrame:HookScript("OnShow", rehideFrame) FocusFrame:UnregisterAllEvents() FocusFrame:Hide() @@ -652,6 +665,7 @@ function ShadowUF:HideBlizzardFrames() local frame = _G[name] frame:UnregisterAllEvents() + frame:HookScript("OnShow", rehideFrame) frame:Hide() _G[name .. "HealthBar"]:UnregisterAllEvents() From 91e9bb723451ac551c6077f4127003668a20ec05 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 7 Oct 2012 15:53:28 -0700 Subject: [PATCH 342/794] Clean up the Blizzard frame hiding code and make sure to hide Focus ToT and Target ToT --- ShadowedUnitFrames.lua | 96 ++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 65 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 07c4793c..abad615e 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -535,24 +535,30 @@ local rehideFrame = function(self) end end +local function hideBlizzardFrames(taint, ...) + for i=1, select("#", ...) do + local frame = select(i, ...) + frame:UnregisterAllEvents() + frame:Hide() + + if( taint ) then + frame.Show = ShadowUF.noop + else + frame:HookScript("OnShow", rehideFrame) + end + end +end + local active_hiddens = {} function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.cast and not active_hiddens.cast ) then - CastingBarFrame:UnregisterAllEvents() - PetCastingBarFrame:UnregisterAllEvents() + hideBlizzardFrames(true, CastingBarFrame, PetCastingBarFrame) end if( ShadowUF.db.profile.hidden.party and not active_hiddens.party ) then for i=1, MAX_PARTY_MEMBERS do local name = "PartyMemberFrame" .. i - local frame = _G[name] - - frame:UnregisterAllEvents() - frame.Show = self.noop - frame:Hide() - - _G[name .. "HealthBar"]:UnregisterAllEvents() - _G[name .. "ManaBar"]:UnregisterAllEvents() + hideBlizzardFrames(true, _G[name], _G[name .. "HealthBar"], _G[name .. "ManaBar"]) end -- This stops the compact party frame from being shown @@ -560,9 +566,7 @@ function ShadowUF:HideBlizzardFrames() -- This just makes sure if( CompactPartyFrame ) then - CompactPartyFrame:HookScript("OnShow", rehideFrame) - CompactPartyFrame:UnregisterAllEvents() - CompactPartyFrame:Hide() + hideBlizzardFrames(false, CompactPartyFrame) end end @@ -573,8 +577,9 @@ function ShadowUF:HideBlizzardFrames() local function hideRaid() CompactRaidFrameManager:UnregisterAllEvents() CompactRaidFrameContainer:UnregisterAllEvents() - if( not InCombatLockdown() ) then CompactRaidFrameManager:Hide() end + if( InCombatLockdown() ) then return end + CompactRaidFrameManager:Hide() local shown = CompactRaidFrameManager_GetSetting("IsShown") if( shown and shown ~= "0" ) then CompactRaidFrameManager_SetSetting("IsShown", "0") @@ -588,88 +593,52 @@ function ShadowUF:HideBlizzardFrames() end) hideRaid() + CompactRaidFrameContainer:SetScript("OnShow", hideRaid) + CompactRaidFrameManager:SetScript("OnShow", hideRaid) + elseif( not ShadowUF.db.profile.hidden.raid ) then CompactRaidFrameManager:SetFrameStrata("DIALOG") end end if( ShadowUF.db.profile.hidden.buffs and not active_hiddens.buffs ) then - BuffFrame:UnregisterAllEvents() - BuffFrame:Hide() - TemporaryEnchantFrame:Hide() - ConsolidatedBuffs:Hide() + hideBlizzardFrames(false, BuffFrame, TemporaryEnchantFrame, ConsolidateBuffs) end if( ShadowUF.db.profile.hidden.player and not active_hiddens.player ) then - PlayerFrame:UnregisterAllEvents() - PlayerFrame:HookScript("OnShow", rehideFrame) - PlayerFrame:Hide() + hideBlizzardFrames(false, PlayerFrame, PlayerFrameHealthBar, PlayerFrameManaBar, PlayerFrameAlternateManaBar) -- We keep these in case someone is still using the default auras, otherwise it messes up vehicle stuff PlayerFrame:RegisterEvent("UNIT_ENTERING_VEHICLE") PlayerFrame:RegisterEvent("UNIT_ENTERED_VEHICLE") PlayerFrame:RegisterEvent("UNIT_EXITING_VEHICLE") PlayerFrame:RegisterEvent("UNIT_EXITED_VEHICLE") - - PlayerFrameHealthBar:UnregisterAllEvents() - PlayerFrameManaBar:UnregisterAllEvents() - PlayerFrameAlternateManaBar:UnregisterAllEvents() end - if( ShadowUF.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then - for _, frame in pairs({EclipseBarFrame, ShardBarFrame, RuneFrame, TotemFrame, PaladinPowerBar, MonkHarmonyBar, PriestBarFrame, WarlockPowerFrame}) do - frame:UnregisterAllEvents() - frame:Hide() - - frame.RegisterAllEvents = self.noop - frame.Show = self.noop - end + hideBlizzardFrames(true, EclipseBarFrame, ShardBarFrame, RuneFrame, TotemFrame, PaladinPowerBar, MonkHarmonyBar, PriestBarFrame, WarlockPowerFrame) end if( ShadowUF.db.profile.hidden.pet and not active_hiddens.pet ) then - PetFrame:UnregisterAllEvents() - PetFrame:HookScript("OnShow", rehideFrame) - PetFrame:Hide() - - PetFrameHealthBar:UnregisterAllEvents() - PetFrameManaBar:UnregisterAllEvents() + hideBlizzardFrames(false, PetFrame, PetFrameHealthBar, PetFrameManaBar) end if( ShadowUF.db.profile.hidden.target and not active_hiddens.target ) then - TargetFrame:HookScript("OnShow", rehideFrame) - TargetFrame:UnregisterAllEvents() - TargetFrame:Hide() - - TargetFrameHealthBar:UnregisterAllEvents() - TargetFrameManaBar:UnregisterAllEvents() - TargetFrameSpellBar:UnregisterAllEvents() - - ComboFrame:UnregisterAllEvents() - ComboFrame:Hide() + hideBlizzardFrames(false, TargetFrame, TargetFrameHealthBar, TargetFrameManaBar, TargetFrameSpellBar, ComboFrame, TargetFrameToT) end if( ShadowUF.db.profile.hidden.focus and not active_hiddens.focus ) then + hideBlizzardFrames(false, FocusFrame, FocusFrameHealthBar, FocusFrameManaBar, FocusFrameSpellBar, FocusFrameToT) + FocusFrame:HookScript("OnShow", rehideFrame) FocusFrame:UnregisterAllEvents() FocusFrame:Hide() - - FocusFrameHealthBar:UnregisterAllEvents() - FocusFrameManaBar:UnregisterAllEvents() - FocusFrameSpellBar:UnregisterAllEvents() end if( ShadowUF.db.profile.hidden.boss and not active_hiddens.boss ) then for i=1, MAX_BOSS_FRAMES do local name = "Boss" .. i .. "TargetFrame" - local frame = _G[name] - - frame:UnregisterAllEvents() - frame:HookScript("OnShow", rehideFrame) - frame:Hide() - - _G[name .. "HealthBar"]:UnregisterAllEvents() - _G[name .. "ManaBar"]:UnregisterAllEvents() + hideBlizzardFrames(false, _G[name], _G[name .. "HealthBar"], _G[name .. "ManaBar"]) end end @@ -682,10 +651,7 @@ function ShadowUF:HideBlizzardFrames() end if( ShadowUF.db.profile.hidden.playerAltPower and not active_hiddens.playerAltPower ) then - PlayerPowerBarAlt:UnregisterEvent("UNIT_POWER_BAR_SHOW") - PlayerPowerBarAlt:UnregisterEvent("UNIT_POWER_BAR_HIDE") - PlayerPowerBarAlt:UnregisterEvent("PLAYER_ENTERING_WORLD") - PlayerPowerBarAlt:Hide() + hideBlizzardFrames(false, PlayerPowerBarAlt) end -- fix LFD Cooldown Frame From a1daf19d32260b236b20ba5bc9aae581024b96ac Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 7 Oct 2012 16:01:29 -0700 Subject: [PATCH 343/794] Code cleanup --- modules/incheal.lua | 54 ++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index 10bc3e0e..a7061096 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -55,35 +55,33 @@ function IncHeal:OnLayoutApplied(frame) end function IncHeal:UpdateFrame(frame) - -- This makes sure that when a heal like Tranquility is cast, it won't show the entire cast but cap it at 4 seconds into the future + if( not frame.visibility.incHeal or not frame.visibility.healthBar ) then return end + local healed = UnitGetIncomingHeals(frame.unit) or 0 - - -- Bar is also supposed to be enabled, lets update that too - if( frame.visibility.incHeal and frame.visibility.healthBar ) then - if( healed > 0 ) then - frame.incHeal.healed = healed - frame.incHeal:Show() - - -- When the primary bar has an alpha of 100%, we can cheat and do incoming heals easily. Otherwise we need to do it a more complex way to keep it looking good - if( frame.incHeal.simple ) then - frame.incHeal.total = UnitHealth(frame.unit) + healed - frame.incHeal:SetMinMaxValues(0, UnitHealthMax(frame.unit) * ShadowUF.db.profile.units[frame.unitType].incHeal.cap) - frame.incHeal:SetValue(frame.incHeal.total) - else - local health, maxHealth = UnitHealth(frame.unit), UnitHealthMax(frame.unit) - local healthWidth = frame.incHeal.healthWidth * (maxHealth > 0 and health / maxHealth or 0) - local incWidth = frame.healthBar:GetWidth() * (health > 0 and healed / health or 0) - if( (healthWidth + incWidth) > frame.incHeal.maxWidth ) then - incWidth = frame.incHeal.cappedWidth - end - - frame.incHeal:SetWidth(incWidth) - frame.incHeal:SetPoint("TOPLEFT", SUFUnitplayer, "TOPLEFT", frame.incHeal.healthX + healthWidth, frame.incHeal.healthY) - end - else - frame.incHeal.total = nil - frame.incHeal.healed = nil - frame.incHeal:Hide() + if( healed < 0 ) then + frame.incHeal.total = nil + frame.incHeal.healed = nil + frame.incHeal:Hide() + return + end + + frame.incHeal.healed = healed + frame.incHeal:Show() + + -- When the primary bar has an alpha of 100%, we can cheat and do incoming heals easily. Otherwise we need to do it a more complex way to keep it looking good + if( frame.incHeal.simple ) then + frame.incHeal.total = UnitHealth(frame.unit) + healed + frame.incHeal:SetMinMaxValues(0, UnitHealthMax(frame.unit) * ShadowUF.db.profile.units[frame.unitType].incHeal.cap) + frame.incHeal:SetValue(frame.incHeal.total) + else + local health, maxHealth = UnitHealth(frame.unit), UnitHealthMax(frame.unit) + local healthWidth = frame.incHeal.healthWidth * (maxHealth > 0 and health / maxHealth or 0) + local incWidth = frame.healthBar:GetWidth() * (health > 0 and healed / health or 0) + if( (healthWidth + incWidth) > frame.incHeal.maxWidth ) then + incWidth = frame.incHeal.cappedWidth end + + frame.incHeal:SetWidth(incWidth) + frame.incHeal:SetPoint("TOPLEFT", SUFUnitplayer, "TOPLEFT", frame.incHeal.healthX + healthWidth, frame.incHeal.healthY) end end From d9fe064ccb5dc153a0d9166c37503f015881d98a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 7 Oct 2012 16:01:45 -0700 Subject: [PATCH 344/794] Visual fix for config --- options/config.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/options/config.lua b/options/config.lua index 5714c56b..9f678d59 100755 --- a/options/config.lua +++ b/options/config.lua @@ -3895,6 +3895,7 @@ local function loadUnitOptions() order = 3.5, type = "description", name = "", + hidden = function(info) return info[2] == "player" or info[2] == "pet" end, }, healthColor = { order = 4, From e17f12e3fec1a3eca7e60d5497b0cd76b76e0230 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 7 Oct 2012 16:10:50 -0700 Subject: [PATCH 345/794] Inc heal is now enabled by default --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index abad615e..1a3051ea 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -298,7 +298,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units[unit].combatText = {enabled = true, anchorTo = "$parent", anchorPoint = "C", x = 0, y = 0} if( unit ~= "battleground" and unit ~= "battlegroundpet" and unit ~= "arena" and unit ~= "arenapet" ) then - self.defaults.profile.units[unit].incHeal = {enabled = false, cap = 1.30} + self.defaults.profile.units[unit].incHeal = {enabled = true, cap = 1.30} end end From b893ead2f148e0f6766e396a0894e4df5aca2217 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 7 Oct 2012 16:54:23 -0700 Subject: [PATCH 346/794] Rewrite the positioning code for complex inc heal bars where the health bar has an alpha attached. Will work correctly in all cases now. --- modules/incheal.lua | 100 ++++++++++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 36 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index a7061096..3c7831ef 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -19,38 +19,58 @@ function IncHeal:OnDisable(frame) end function IncHeal:OnLayoutApplied(frame) - if( frame.visibility.incHeal and frame.visibility.healthBar ) then - frame.incHeal:SetHeight(frame.healthBar:GetHeight()) - frame.incHeal:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) - frame.incHeal:SetStatusBarColor(ShadowUF.db.profile.healthColors.inc.r, ShadowUF.db.profile.healthColors.inc.g, ShadowUF.db.profile.healthColors.inc.b, ShadowUF.db.profile.bars.alpha) - frame.incHeal:GetStatusBarTexture():SetHorizTile(false) - frame.incHeal:Hide() - - -- When we can cheat and put the incoming bar right behind the health bar, we can efficiently show the incoming heal bar - -- if the main bar has a transparency set, then we need a more complicated method to stop the health bar from being darker with incoming heals up - if( ( ShadowUF.db.profile.units[frame.unitType].healthBar.invert and ShadowUF.db.profile.bars.backgroundAlpha == 0 ) or ( not ShadowUF.db.profile.units[frame.unitType].healthBar.invert and ShadowUF.db.profile.bars.alpha == 1 ) ) then - frame.incHeal.simple = true + if( not frame.visibility.incHeal or not frame.visibility.healthBar ) then return end + + + frame.incHeal:SetSize(frame.healthBar:GetSize()) + frame.incHeal:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) + frame.incHeal:SetStatusBarColor(ShadowUF.db.profile.healthColors.inc.r, ShadowUF.db.profile.healthColors.inc.g, ShadowUF.db.profile.healthColors.inc.b, ShadowUF.db.profile.bars.alpha) + frame.incHeal:GetStatusBarTexture():SetHorizTile(false) + frame.incHeal:SetOrientation(frame.healthBar:GetOrientation()) + frame.incHeal:SetReverseFill(frame.healthBar:GetReverseFill()) + frame.incHeal:Hide() + + -- When we can cheat and put the incoming bar right behind the health bar, we can efficiently show the incoming heal bar + -- if the main bar has a transparency set, then we need a more complicated method to stop the health bar from being darker with incoming heals up + if( ( ShadowUF.db.profile.units[frame.unitType].healthBar.invert and ShadowUF.db.profile.bars.backgroundAlpha == 0 ) or ( not ShadowUF.db.profile.units[frame.unitType].healthBar.invert and ShadowUF.db.profile.bars.alpha == 1 ) ) then + frame.incHeal.simple = true + frame.incHeal:SetFrameLevel(frame.topFrameLevel - 1) + + if( frame.incHeal:GetOrientation() == "HORIZONTAL" ) then frame.incHeal:SetWidth(frame.healthBar:GetWidth() * ShadowUF.db.profile.units[frame.unitType].incHeal.cap) - frame.incHeal:SetFrameLevel(frame.topFrameLevel - 1) + else + frame.incHeal:SetHeight(frame.healthBar:GetHeight() * ShadowUF.db.profile.units[frame.unitType].incHeal.cap) + end - frame.incHeal:ClearAllPoints() - frame.incHeal:SetPoint("TOPLEFT", frame.healthBar) - frame.incHeal:SetPoint("BOTTOMLEFT", frame.healthBar) + frame.incHeal:ClearAllPoints() + + local point = frame.incHeal:GetReverseFill() and "RIGHT" or "LEFT" + frame.incHeal:SetPoint("TOP" .. point, frame.healthBar) + frame.incHeal:SetPoint("BOTTOM" .. point, frame.healthBar) + else + frame.incHeal.simple = nil + frame.incHeal:SetFrameLevel(frame.topFrameLevel ) + frame.incHeal:SetWidth(1) + frame.incHeal:SetMinMaxValues(0, 1) + frame.incHeal:SetValue(1) + frame.incHeal:ClearAllPoints() + + frame.incHeal.orientation = frame.incHeal:GetOrientation() + frame.incHeal.reverseFill = frame.incHeal:GetReverseFill() + + if( frame.incHeal.orientation == "HORIZONTAL" ) then + frame.incHeal.healthSize = frame.healthBar:GetWidth() + frame.incHeal.positionPoint = frame.incHeal.reverseFill and "TOPRIGHT" or "TOPLEFT" + frame.incHeal.positionRelative = frame.incHeal.reverseFill and "BOTTOMRIGHT" or "BOTTOMLEFT" else - frame.incHeal.simple = nil - frame.incHeal:SetFrameLevel(frame.topFrameLevel) - frame.incHeal:SetWidth(1) - frame.incHeal:SetMinMaxValues(0, 1) - frame.incHeal:SetValue(1) - - local x, y = select(4, frame.healthBar:GetPoint()) - frame.incHeal:ClearAllPoints() - frame.incHeal.healthX = x - frame.incHeal.healthY = y - frame.incHeal.healthWidth = frame.healthBar:GetWidth() - frame.incHeal.maxWidth = frame.incHeal.healthWidth * ShadowUF.db.profile.units[frame.unitType].incHeal.cap - frame.incHeal.cappedWidth = frame.incHeal.healthWidth * (ShadowUF.db.profile.units[frame.unitType].incHeal.cap - 1) + frame.incHeal.healthSize = frame.healthBar:GetHeight() + frame.incHeal.positionPoint = frame.incHeal.reverseFill and "TOPLEFT" or "BOTTOMLEFT" + frame.incHeal.positionRelative = frame.incHeal.reverseFill and "TOPRIGHT" or "BOTTOMRIGHT" end + + frame.incHeal.positionMod = frame.incHeal.reverseFill and -1 or 1 + frame.incHeal.cappedSize = frame.incHeal.healthSize * (ShadowUF.db.profile.units[frame.unitType].incHeal.cap - 1) + frame.incHeal.maxSize = frame.incHeal.healthSize * ShadowUF.db.profile.units[frame.unitType].incHeal.cap end end @@ -58,7 +78,7 @@ function IncHeal:UpdateFrame(frame) if( not frame.visibility.incHeal or not frame.visibility.healthBar ) then return end local healed = UnitGetIncomingHeals(frame.unit) or 0 - if( healed < 0 ) then + if( healed <= 0 ) then frame.incHeal.total = nil frame.incHeal.healed = nil frame.incHeal:Hide() @@ -75,13 +95,21 @@ function IncHeal:UpdateFrame(frame) frame.incHeal:SetValue(frame.incHeal.total) else local health, maxHealth = UnitHealth(frame.unit), UnitHealthMax(frame.unit) - local healthWidth = frame.incHeal.healthWidth * (maxHealth > 0 and health / maxHealth or 0) - local incWidth = frame.healthBar:GetWidth() * (health > 0 and healed / health or 0) - if( (healthWidth + incWidth) > frame.incHeal.maxWidth ) then - incWidth = frame.incHeal.cappedWidth + local healthSize = frame.incHeal.healthSize * (maxHealth > 0 and health / maxHealth or 0) + local incSize = frame.incHeal.healthSize * (health > 0 and healed / health or 0) + + if( (healthSize + incSize) > frame.incHeal.maxSize ) then + incSize = frame.incHeal.cappedSize + end + + if( frame.incHeal.orientation == "HORIZONTAL" ) then + frame.incHeal:SetWidth(incSize) + frame.incHeal:SetPoint(frame.incHeal.positionPoint, frame.healthBar, frame.incHeal.positionMod * healthSize, 0) + frame.incHeal:SetPoint(frame.incHeal.positionRelative, frame.healthBar, frame.incHeal.positionMod * healthSize, 0) + else + frame.incHeal:SetHeight(incSize) + frame.incHeal:SetPoint(frame.incHeal.positionPoint, frame.healthBar, 0, frame.incHeal.positionMod * healthSize) + frame.incHeal:SetPoint(frame.incHeal.positionRelative, frame.healthBar, 0, frame.incHeal.positionMod * healthSize) end - - frame.incHeal:SetWidth(incWidth) - frame.incHeal:SetPoint("TOPLEFT", SUFUnitplayer, "TOPLEFT", frame.incHeal.healthX + healthWidth, frame.incHeal.healthY) end end From f637b3c045314c98b3928bcb4c00d9d41e007a26 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 7 Oct 2012 16:58:13 -0700 Subject: [PATCH 347/794] Should reposition the incheal bars based off of UNIT_HEALTH_FREQUENT rather than UNIT_HEALTH --- modules/health.lua | 3 +-- modules/incheal.lua | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/health.lua b/modules/health.lua index 59b5dc2d..afe06f2c 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -30,12 +30,11 @@ function Health:OnEnable(frame) frame.healthBar = ShadowUF.Units:CreateBar(frame) end - frame:RegisterUnitEvent("UNIT_HEALTH", self, "Update") frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "Update") frame:RegisterUnitEvent("UNIT_CONNECTION", self, "Update") frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdateColor") frame:RegisterUnitEvent("UNIT_THREAT_SITUATION_UPDATE", self, "UpdateColor") - frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "Update") + frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "Update") if( frame.unit == "pet" ) then frame:RegisterUnitEvent("UNIT_POWER", self, "UpdateColor") diff --git a/modules/incheal.lua b/modules/incheal.lua index 3c7831ef..43357950 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -6,7 +6,7 @@ function IncHeal:OnEnable(frame) if( ShadowUF.db.profile.units[frame.unitType].incHeal.heals ) then frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") - frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") end From 3c136efc4c9de21ae1cb05c328369e0f1e0cc72f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 7 Oct 2012 17:44:29 -0700 Subject: [PATCH 348/794] Move back to checking dispel types ourselves since Blizzard didn't fix their bug still. Also now handles Symbiosis for Paladins giving Druids Cleanse. --- modules/auras.lua | 7 +++-- modules/highlight.lua | 14 ++++++++- modules/units.lua | 72 +++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 87 insertions(+), 6 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 95cc29fe..2fe4f3a7 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -2,6 +2,7 @@ local Auras = {} local stealableColor = {r = 1, g = 1, b = 1} local playerUnits = {player = true, vehicle = true, pet = true} local mainHand, offHand, ranged, tempEnchantScan = {time = 0}, {time = 0}, {time = 0} +local canCure = ShadowUF.Units.canCure ShadowUF:RegisterModule(Auras, "auras", ShadowUF.L["Auras"]) function Auras:OnEnable(frame) @@ -305,7 +306,8 @@ local function updateGroup(self, type, config, reverseConfig) -- This is a bit of an odd filter, when used with a HELPFUL filter, it will only return buffs you can cast on group members -- When used with HARMFUL it will only return debuffs you can cure - if( config.raid ) then + -- As of 5.0.5, this is still broken and won't account for talents or symbiosis + if( config.raid and group.type == "buffs" ) then group.filter = group.filter .. "|RAID" end @@ -484,6 +486,7 @@ local function scan(parent, frame, type, config, displayConfig, filter) if( frame.totalAuras >= frame.maxAuras or not config.enabled ) then return end local isFriendly = UnitIsFriend(frame.parent.unit, "player") + local curable = (isFriendly and type == "debuffs" and config.raid) local index = 0 local cureType while( true ) do @@ -494,7 +497,7 @@ local function scan(parent, frame, type, config, displayConfig, filter) -- Blizzard bug, Enrage is an empty string. cureType = auraType == "" and "Enrage" or auraType - if( ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and ( parent.whitelist[name] or parent.whitelist[spellID] ) or parent.blacklist[type] and ( not parent.blacklist[name] and not parent.blacklist[spellID] ) ) ) then + if( ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and ( parent.whitelist[name] or parent.whitelist[spellID] ) or parent.blacklist[type] and ( not parent.blacklist[name] and not parent.blacklist[spellID] ) ) and ( not curable or canCure[auraType] ) ) then -- Create any buttons we need frame.totalAuras = frame.totalAuras + 1 if( #(frame.buttons) < frame.totalAuras ) then diff --git a/modules/highlight.lua b/modules/highlight.lua index 7e732814..597cc36c 100755 --- a/modules/highlight.lua +++ b/modules/highlight.lua @@ -1,5 +1,6 @@ local Highlight = {} local goldColor, mouseColor = {r = 0.75, g = 0.75, b = 0.35}, {r = 0.75, g = 0.75, b = 0.50} +local canCure = ShadowUF.Units.canCure ShadowUF:RegisterModule(Highlight, "highlight", ShadowUF.L["Highlight"]) -- Might seem odd to hook my code in the core manually, but HookScript is ~40% slower due to it being a secure hook @@ -159,7 +160,18 @@ end function Highlight:UpdateAura(frame) frame.highlight.hasDebuff = nil if( UnitIsFriend(frame.unit, "player") ) then - frame.highlight.hasDebuff = select(5, UnitDebuff(frame.unit, 1, "RAID")) + local id = 0 + while( true ) do + id = id + 1 + local name, _, _, _, auraType = UnitDebuff(frame.unit, id) + if( not name ) then break end + if( auraType == "" ) then auraType = "Enrage" end + + if( canCure[auraType] ) then + frame.highlight.hasDebuff = auraType + break + end + end end self:Update(frame) diff --git a/modules/units.lua b/modules/units.lua index 4b124a25..50d7663f 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1,4 +1,4 @@ -local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}, remappedUnits = {}} +local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}, remappedUnits = {}, canCure = {}} Units.childUnits = {["partytarget"] = "party", ["partypet"] = "party", ["maintanktarget"] = "maintank", ["mainassisttarget"] = "mainassist", ["bosstarget"] = "boss", ["arenatarget"] = "arena", ["arenapet"] = "arena", ["battlegroundpet"] = "battleground", ["battlegroundtarget"] = "battleground"} Units.zoneUnits = {["arena"] = "arena", ["arenapet"] = "arena", ["arenatarget"] = "arena", ["boss"] = "raid", ["bosstarget"] = "raid", ["battleground"] = "pvp", ["battlegroundtarget"] = "pvp", ["battlegroundpet"] = "pvp"} Units.remappedUnits = {["battleground"] = "arena", ["battlegroundpet"] = "arenapet", ["battlegroundtarget"] = "arenatarget"} @@ -1349,13 +1349,59 @@ function Units:CheckPlayerZone(force) end end +-- Handle figuring out what auras players can cure and also account for symbiosis which can let you cure additional ones +local curableSpells = { + ["DRUID"] = {[88423] = {"Magic", "Curse", "Poison"}, [2782] = {"Curse", "Poison"}, [2908] = {"Enrage"}}, + ["HUNTER"] = {[19801] = {"Magic", "Enrage"}}, + ["ROGUE"] = {[5938] = {"Enrage"}}, + ["PRIEST"] = {[528] = {"Magic"}, [527] = {"Magic", "Disease"}}, + ["PALADIN"] = {[122288] = {"Poison", "Disease"}}, + ["SHAMAN"] = {[77130] = {"Curse", "Magic"}}, + ["MONK"] = {[115450] = {"Poison", "Disease"}, [115451] = {"Magic"}} +} + +local symbiosisSpells = { + ["DRUID"] = {["Disease"] = 122288}, +} + +curableSpells = curableSpells[select(2, UnitClass("player"))] +symbiosisSpells = symbiosisSpells[select(2, UnitClass("player"))] + +local function checkCurableSpells() + if( not curableSpells ) then return end + + table.wipe(Units.canCure) + + for spellID, cures in pairs(curableSpells) do + if( IsPlayerSpell(spellID) ) then + for _, type in pairs(cures) do + Units.canCure[type] = true + end + end + end +end + +local function checkSymbiosisSpells() + if( not symbiosisSpells ) then return end + + local changed = false + for type, spellID in pairs(symbiosisSpells) do + local hasSpell = IsPlayerSpell(spellID) + if( ( Units.canCure[type] and not hasSpell ) or ( not Units.canCure[type] and hasSpell ) ) then + changed = true + Units.canCure[type] = hasSpell + end + end + + return changed +end + local centralFrame = CreateFrame("Frame") centralFrame:RegisterEvent("PLAYER_REGEN_ENABLED") centralFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") centralFrame:RegisterEvent("PLAYER_LOGIN") centralFrame:RegisterEvent("PLAYER_LEVEL_UP") centralFrame:RegisterEvent("CINEMATIC_STOP") - centralFrame:SetScript("OnEvent", function(self, event, unit) -- Check if the player changed zone types and we need to change module status, while they are dead -- we won't change their zone type as releasing from an instance will change the zone type without them @@ -1379,8 +1425,21 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) unitFrames.player:FullUpdate() end - -- Monitor talent changes + -- Symbiosis for curable changes + elseif( event == "SPELL_UPDATE_USABLE" ) then + local changed = checkSymbiosisSpells() + if( changed ) then + for frame in pairs(ShadowUF.Units.frameList) do + if( frame.unit and frame:IsVisible() ) then + frame:FullUpdate() + end + end + end + + -- Monitor talent changes for curable changes elseif( event == "PLAYER_SPECIALIZATION_CHANGED" ) then + checkCurableSpells() + for frame in pairs(ShadowUF.Units.frameList) do if( frame.unit ) then frame:SetVisibility() @@ -1392,8 +1451,15 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) end elseif( event == "PLAYER_LOGIN" ) then + checkCurableSpells() + checkSymbiosisSpells() + self:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED") + if( symbiosisSpells ) then + self:RegisterEvent("SPELL_UPDATE_USABLE") + end + -- This is slightly hackish, but it suits the purpose just fine for somthing thats rarely called. elseif( event == "PLAYER_REGEN_ENABLED" ) then -- Now do all of the creation for child wrapping From 1b2a76604581a23b73d778bc1eadcd4267f7b33d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 7 Oct 2012 17:53:23 -0700 Subject: [PATCH 349/794] Fix Paladin curable spells --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 50d7663f..f9aebc68 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1355,7 +1355,7 @@ local curableSpells = { ["HUNTER"] = {[19801] = {"Magic", "Enrage"}}, ["ROGUE"] = {[5938] = {"Enrage"}}, ["PRIEST"] = {[528] = {"Magic"}, [527] = {"Magic", "Disease"}}, - ["PALADIN"] = {[122288] = {"Poison", "Disease"}}, + ["PALADIN"] = {[4987] = {"Poison", "Disease"}, [53551] = {"Magic"}}, ["SHAMAN"] = {[77130] = {"Curse", "Magic"}}, ["MONK"] = {[115450] = {"Poison", "Disease"}, [115451] = {"Magic"}} } From d6e828fefd6096b81cd72145ebefcd19b4827549 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 8 Oct 2012 07:26:21 -0700 Subject: [PATCH 350/794] Fixed an error on hiding buff frames --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 1a3051ea..2add2410 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -602,7 +602,7 @@ function ShadowUF:HideBlizzardFrames() end if( ShadowUF.db.profile.hidden.buffs and not active_hiddens.buffs ) then - hideBlizzardFrames(false, BuffFrame, TemporaryEnchantFrame, ConsolidateBuffs) + hideBlizzardFrames(false, BuffFrame, TemporaryEnchantFrame, ConsolidatedBuffs) end if( ShadowUF.db.profile.hidden.player and not active_hiddens.player ) then From 974ee3894bc1856d5c0d81c587cb72d7aa07f6fc Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 8 Oct 2012 08:43:57 -0700 Subject: [PATCH 351/794] Apparnetly Blizzard hasn't fixed up their UNIT_FREQUENT_HEALTH events --- modules/health.lua | 3 ++- modules/incheal.lua | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/health.lua b/modules/health.lua index afe06f2c..fed8da08 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -30,6 +30,7 @@ function Health:OnEnable(frame) frame.healthBar = ShadowUF.Units:CreateBar(frame) end + frame:RegisterUnitEvent("UNIT_HEALTH", self, "Update") frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "Update") frame:RegisterUnitEvent("UNIT_CONNECTION", self, "Update") frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdateColor") @@ -61,7 +62,7 @@ function Health:UpdateColor(frame) frame:SetBarColor("healthBar", ShadowUF.db.profile.healthColors.offline.r, ShadowUF.db.profile.healthColors.offline.g, ShadowUF.db.profile.healthColors.offline.b) return elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorAggro and UnitThreatSituation(frame.unit) == 3 ) then - frame:SetBarColor("healthBar", ShadowUF.db.profile.healthColors.hostile.r, ShadowUF.db.profile.healthColors.hostile.g, ShadowUF.db.profile.healthColors.hostile.b) + frame:SetBarColor("healthBar", ShadowUF.db.profile.healthColors.aggro.r, ShadowUF.db.profile.healthColors.aggro.g, ShadowUF.db.profile.healthColors.aggro.b) return elseif( frame.inVehicle ) then color = ShadowUF.db.profile.classColors.VEHICLE diff --git a/modules/incheal.lua b/modules/incheal.lua index 43357950..3c7831ef 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -6,7 +6,7 @@ function IncHeal:OnEnable(frame) if( ShadowUF.db.profile.units[frame.unitType].incHeal.heals ) then frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") - frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") end From 4d0b5c020cfdbdf8e5cd9556c5a563ec64df8838 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 8 Oct 2012 08:44:09 -0700 Subject: [PATCH 352/794] Add a separate has aggro color option --- ShadowedUnitFrames.lua | 6 +++++- modules/defaultlayout.lua | 1 + options/config.lua | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 2add2410..2fca73dd 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -4,7 +4,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 27 +ShadowUF.dbRevision = 28 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -86,6 +86,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 27 ) then + self.db.profile.healthColors.aggro = CopyTable(self.db.profile.healthColors.hostile) + end + if( revision <= 26 ) then for _, unit in pairs(self.unitList) do if( unit ~= "player" ) then diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 09d209a0..f8419d8f 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -174,6 +174,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) inc = {r = 0, g = 0.35, b = 0.23}, enemyUnattack = {r = 0.60, g = 0.20, b = 0.20}, hostile = {r = 0.90, g = 0.0, b = 0.0}, + aggro = {r = 0.90, g = 0.0, b = 0.0}, friendly = {r = 0.20, g = 0.90, b = 0.20}, neutral = {r = 0.93, g = 0.93, b = 0.0}, offline = {r = 0.50, g = 0.50, b = 0.50} diff --git a/options/config.lua b/options/config.lua index 9f678d59..8e1816d8 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1018,6 +1018,13 @@ local function loadGeneralOptions() desc = L["Health bar color for hostile units."], arg = "healthColors.hostile", }, + aggro = { + order = 6.5, + type = "color", + name = L["Has Aggro"], + desc = L["Health bar color for units with aggro."], + arg = "healthColors.aggro", + }, static = { order = 7, type = "color", From cd135636992c893f5a8fdf9e64b28377a707c380 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 8 Oct 2012 09:08:42 -0700 Subject: [PATCH 353/794] Removed redundant hiding code --- ShadowedUnitFrames.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 2fca73dd..456954a9 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -633,10 +633,6 @@ function ShadowUF:HideBlizzardFrames() if( ShadowUF.db.profile.hidden.focus and not active_hiddens.focus ) then hideBlizzardFrames(false, FocusFrame, FocusFrameHealthBar, FocusFrameManaBar, FocusFrameSpellBar, FocusFrameToT) - - FocusFrame:HookScript("OnShow", rehideFrame) - FocusFrame:UnregisterAllEvents() - FocusFrame:Hide() end if( ShadowUF.db.profile.hidden.boss and not active_hiddens.boss ) then From 851eae2e7f2d9dc9bc8fd0d655b4d8b1c66754bf Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 8 Oct 2012 17:38:34 -0700 Subject: [PATCH 354/794] Fix the whisper only indicator for party members --- modules/indicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 2b6846e0..7e2b9940 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -20,7 +20,7 @@ end function Indicators:UpdatePhase(frame) if( not frame.indicators.phase or not frame.indicators.phase.enabled ) then return end - if( UnitInOtherParty(frame.unit) ) then + if( not select(2, UnitInOtherParty(frame.unit)) ) then frame.indicators.phase:SetTexture("Interface\\PlayerFrame\\whisper-only") frame.indicators.phase:Show() elseif( UnitExists(frame.unit) and not UnitInPhase(frame.unit) ) then From a4b3549733b1caedc3fe1898ec3cf12b0b2cdc3a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 8 Oct 2012 21:39:34 -0700 Subject: [PATCH 355/794] Missing code that wasn't removed --- modules/indicators.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 7e2b9940..a2b666b1 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -1,5 +1,4 @@ local Indicators = {list = {"status", "pvp", "leader", "resurrect", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class", "phase", "questBoss", "petBattle"}} -local leavingWorld ShadowUF:RegisterModule(Indicators, "indicators", ShadowUF.L["Indicators"]) @@ -96,7 +95,7 @@ end function Indicators:UpdateRole(frame, event) if( not frame.indicators.role or not frame.indicators.role.enabled ) then return end - if( leavingWorld or not UnitInRaid(frame.unit) and not UnitInParty(frame.unit) ) then + if( not UnitInRaid(frame.unit) and not UnitInParty(frame.unit) ) then frame.indicators.role:Hide() elseif( GetPartyAssignment("MAINTANK", frame.unit) ) then frame.indicators.role:SetTexture("Interface\\GroupFrame\\UI-Group-MainTankIcon") From 7c1c4051d90beda7c04868434f1effaf006fdae8 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 8 Oct 2012 21:41:29 -0700 Subject: [PATCH 356/794] Fixed LFD Role indicators not working --- modules/indicators.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index a2b666b1..385fc8fe 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -357,10 +357,9 @@ function Indicators:OnEnable(frame) end if( config.indicators.lfdRole and config.indicators.lfdRole.enabled ) then - if( frame.unit == "player" ) then - frame:RegisterNormalEvent("PLAYER_ROLES_ASSIGNED", self, "UpdateLFDRole") - end - + frame:RegisterNormalEvent("PLAYER_ROLES_ASSIGNED", self, "UpdateLFDRole") + frame:RegisterUpdateFunc(self, "UpdateLFDRole") + frame.indicators.lfdRole = frame.indicators.lfdRole or frame.indicators:CreateTexture(nil, "OVERLAY") frame.indicators.lfdRole:SetTexture("Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES") end From 8866edcd4c381c95c6cf690f02786bd69e5e1d35 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 11 Oct 2012 16:06:08 -0700 Subject: [PATCH 357/794] Drycode fixes for SUF and 5.1, only Monk changes --- ShadowedUnitFrames.lua | 2 ++ modules/chi.lua | 2 +- modules/movers.lua | 2 +- modules/tags.lua | 7 ++++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 456954a9..8282379b 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -3,6 +3,8 @@ ]] ShadowUF = select(2, ...) +ShadowUF.is501 = select(4, GetBuildInfo()) > 50001 + local L = ShadowUF.L ShadowUF.dbRevision = 28 ShadowUF.playerUnit = "player" diff --git a/modules/chi.lua b/modules/chi.lua index b9efe81b..02cd7050 100755 --- a/modules/chi.lua +++ b/modules/chi.lua @@ -1,6 +1,6 @@ local Chi = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(Chi, "chi", ShadowUF.L["Chi"], nil, "MONK") -local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = SPELL_POWER_LIGHT_FORCE, eventType = "LIGHT_FORCE", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = ShadowUF.is501 and SPELL_POWER_CHI or SPELL_POWER_LIGHT_FORCE, eventType = ShadowUF.is501 and "CHI" or "LIGHT_FORCE", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function Chi:OnEnable(frame) frame.chi = frame.chi or CreateFrame("Frame", nil, frame) diff --git a/modules/movers.lua b/modules/movers.lua index 16cf4814..5a4f061d 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -43,7 +43,7 @@ local function createConfigEnv() return 3 elseif( powerType == SPELL_POWER_ECLIPSE ) then return getValue("UnitPower", unit, math.random(-100, 100)) - elseif( powerType == SPELL_POWER_LIGHT_FORCE ) then + elseif( ( ShadowUF.is501 and powerType == SPELL_POWER_CHI ) or ( not ShadowUF.is501 and powerType == SPELL_POWER_LIGHT_FORCE ) ) then return 4 elseif( powerType == SPELL_POWER_SHADOW_ORBS ) then return PRIEST_BAR_NUM_ORBS diff --git a/modules/tags.lua b/modules/tags.lua index 06b4c785..a7b3e9e3 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -28,6 +28,11 @@ for powerType in pairs(PowerBarColor) do end end +if( ShadowUF.is501 ) then + powerFilters["SUF_POWERTYPE:LIGHT_FORCE"] = "CHI" +end + + -- Register the associated events with all the tags function Tags:RegisterEvents(parent, fontString, tags) local hasPowerFilters; @@ -811,7 +816,7 @@ Tags.defaultTags = { return points and points > 0 and points end]], ["monk:chipoints"] = [[function(unit, unitOwner) - local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_LIGHT_FORCE) + local points = UnitPower(ShadowUF.playerUnit, ShadowUF.is501 and SPELL_POWER_CHI or SPELL_POWER_LIGHT_FORCE) return points and points > 0 and points end]], ["warlock:demonic:perpp"] = [[function(unit, unitOwner) From ae108e371a365c8404de88bf9f94ac712919e74b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 14 Oct 2012 09:03:41 -0700 Subject: [PATCH 358/794] Should be HookScript not Setscript --- ShadowedUnitFrames.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 8282379b..88eca1ca 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -599,8 +599,8 @@ function ShadowUF:HideBlizzardFrames() end) hideRaid() - CompactRaidFrameContainer:SetScript("OnShow", hideRaid) - CompactRaidFrameManager:SetScript("OnShow", hideRaid) + CompactRaidFrameContainer:HookScript("OnShow", hideRaid) + CompactRaidFrameManager:HookScript("OnShow", hideRaid) elseif( not ShadowUF.db.profile.hidden.raid ) then CompactRaidFrameManager:SetFrameStrata("DIALOG") From 2fd6b07729d90f3d31046c4523861c7e136ac5c6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 15 Oct 2012 19:28:24 -0700 Subject: [PATCH 359/794] Not sure why SUF bumps the strata on CRF when we're not hiding it, but I assume I can blame nev for this --- ShadowedUnitFrames.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 88eca1ca..602fcb58 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -602,8 +602,8 @@ function ShadowUF:HideBlizzardFrames() CompactRaidFrameContainer:HookScript("OnShow", hideRaid) CompactRaidFrameManager:HookScript("OnShow", hideRaid) - elseif( not ShadowUF.db.profile.hidden.raid ) then - CompactRaidFrameManager:SetFrameStrata("DIALOG") + -- elseif( not ShadowUF.db.profile.hidden.raid ) then + -- CompactRaidFrameManager:SetFrameStrata("DIALOG") end end From 8de325428e2207726992633d901dfd9e6d776bf7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 21 Oct 2012 12:40:39 -0700 Subject: [PATCH 360/794] Fixed an aura offset bug when using top auras with self scaling --- modules/auras.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 2fe4f3a7..edc5a153 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -109,7 +109,7 @@ end local columnsHaveScale = {} local function positionAllButtons(group, config) - local position = positionData[group.forcedAnchorPoint or config.anchorPoint] + local position = positionData[group.forcedAnchorPoint or config.anchorPoint] -- Figure out which columns have scaling so we can work out positioning local columnID = 0 @@ -124,7 +124,7 @@ local function positionAllButtons(group, config) columnsHaveScale[columnID] = columnsHaveScale[columnID] and math.max(size, columnsHaveScale[columnID]) or size end end - + local columnID = 1 for id, button in pairs(group.buttons) do if( id > 1 ) then @@ -166,8 +166,14 @@ local function positionAllButtons(group, config) else offset = offset + 2 end - + + button.wasScaled = true position.initialAnchor(button, offset) + + -- If the column is no longer scaled but the button was, we need to reset the offset to 0 + elseif( button.wasScaled and not columnsHaveScale[columnID] ) then + button.wasScaled = nil + position.initialAnchor(button, 0) end end end From bba9aa16b80632543b1942dc4934b7313d104e2c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 21 Oct 2012 12:43:39 -0700 Subject: [PATCH 361/794] Added missing Remove Curse spell for Mages and Cleanse Spirit for Shamans --- modules/units.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index f9aebc68..567e2ddf 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1354,9 +1354,10 @@ local curableSpells = { ["DRUID"] = {[88423] = {"Magic", "Curse", "Poison"}, [2782] = {"Curse", "Poison"}, [2908] = {"Enrage"}}, ["HUNTER"] = {[19801] = {"Magic", "Enrage"}}, ["ROGUE"] = {[5938] = {"Enrage"}}, + ["MAGE"] = {[475] = {"Curse"}}, ["PRIEST"] = {[528] = {"Magic"}, [527] = {"Magic", "Disease"}}, ["PALADIN"] = {[4987] = {"Poison", "Disease"}, [53551] = {"Magic"}}, - ["SHAMAN"] = {[77130] = {"Curse", "Magic"}}, + ["SHAMAN"] = {[77130] = {"Curse", "Magic"}, [51886] = {"Curse"}}, ["MONK"] = {[115450] = {"Poison", "Disease"}, [115451] = {"Magic"}} } From 38a67c81782b76b3ba0bb86be718c98e1fb11074 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 25 Oct 2012 21:11:09 -0700 Subject: [PATCH 362/794] If an unit has <=0 health, will hide the inc heal frame to make sure they don't get stuck when the unit is dead --- modules/incheal.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index 3c7831ef..566c12f2 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -4,11 +4,9 @@ ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) function IncHeal:OnEnable(frame) frame.incHeal = frame.incHeal or ShadowUF.Units:CreateBar(frame) - if( ShadowUF.db.profile.units[frame.unitType].incHeal.heals ) then - frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") - frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") - frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") - end + frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") frame:RegisterUpdateFunc(self, "UpdateFrame") end @@ -78,7 +76,9 @@ function IncHeal:UpdateFrame(frame) if( not frame.visibility.incHeal or not frame.visibility.healthBar ) then return end local healed = UnitGetIncomingHeals(frame.unit) or 0 - if( healed <= 0 ) then + local health = UnitHealth(frame.unit) + + if( health <= 0 or healed <= 0 ) then frame.incHeal.total = nil frame.incHeal.healed = nil frame.incHeal:Hide() @@ -90,7 +90,7 @@ function IncHeal:UpdateFrame(frame) -- When the primary bar has an alpha of 100%, we can cheat and do incoming heals easily. Otherwise we need to do it a more complex way to keep it looking good if( frame.incHeal.simple ) then - frame.incHeal.total = UnitHealth(frame.unit) + healed + frame.incHeal.total = health + healed frame.incHeal:SetMinMaxValues(0, UnitHealthMax(frame.unit) * ShadowUF.db.profile.units[frame.unitType].incHeal.cap) frame.incHeal:SetValue(frame.incHeal.total) else From 37f0f76cc7db28f3e4220934afb5e1c3cf33e510 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 25 Oct 2012 21:25:38 -0700 Subject: [PATCH 363/794] Try something slightly more reliable for determining if the initial anchor changed --- modules/auras.lua | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index edc5a153..9d6bec7d 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -57,6 +57,7 @@ local positionData = setmetatable({}, { data.initialAnchor = load(string.format([[return function(button, offset) button:ClearAllPoints() button:SetPoint(button.point, button.anchorTo, button.relativePoint, button.xOffset%s, button.yOffset%s) + button.anchorOffset = offset end]], initialXOffset, initialYOffset)) data.column = load(string.format([[return function(button, positionTo, offset) button:ClearAllPoints() @@ -101,7 +102,7 @@ local function positionButton(id, group, config) button.xOffset = config.x + (position.xMod * ShadowUF.db.profile.backdrop.inset) button.yOffset = config.y + (position.yMod * ShadowUF.db.profile.backdrop.inset) button.anchorTo = group.anchorTo - + position.initialAnchor(button, 0) end end @@ -158,22 +159,23 @@ local function positionAllButtons(group, config) else position.aura(button, group.buttons[id - 1]) end - -- If the initial column is self scaled, but the initial anchor isn't, will have to reposition it - elseif( columnsHaveScale[columnID] ) then - local offset = math.ceil(columnsHaveScale[columnID] / 8) - if( button.isSelfScaled ) then - offset = -(offset / 2) - else - offset = offset + 2 - end + else + -- If the initial column is self scaled, but the initial anchor isn't, will have to reposition it + local offset = 0 + if( columnsHaveScale[columnID] ) then + offset = math.ceil(columnsHaveScale[columnID] / 8) + if( button.isSelfScaled ) then + offset = -(offset / 2) + else + offset = offset + 2 + end - button.wasScaled = true - position.initialAnchor(button, offset) + offset = offset + end - -- If the column is no longer scaled but the button was, we need to reset the offset to 0 - elseif( button.wasScaled and not columnsHaveScale[columnID] ) then - button.wasScaled = nil - position.initialAnchor(button, 0) + if( offset ~= button.anchorOffset ) then + position.initialAnchor(button, offset) + end end end end From e68092c3512d8fe9f1e76169d7aab90f108a3f40 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 18 Nov 2012 12:31:37 -0800 Subject: [PATCH 364/794] Check UnitCanAssist for friendly spells rather than UnitIsFriend. Should fix range checker bugs --- modules/range.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/range.lua b/modules/range.lua index d8726d11..fdb5a02e 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -17,7 +17,7 @@ local function checkRange(self, elapsed) local spell -- Check which spell to use - if( UnitIsFriend("player", frame.unit) ) then + if( UnitCanAssist("player", frame.unit) ) then spell = friendlySpell elseif( UnitCanAttack("player", frame.unit) ) then spell = hostileSpell From 234693f576ee1e1ae1d602f7f5cd9f41fe762b68 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 18 Nov 2012 12:34:06 -0800 Subject: [PATCH 365/794] is501 should be named is510 actually --- ShadowedUnitFrames.lua | 2 +- modules/chi.lua | 2 +- modules/movers.lua | 2 +- modules/tags.lua | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 602fcb58..cb4f5f3a 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -3,7 +3,7 @@ ]] ShadowUF = select(2, ...) -ShadowUF.is501 = select(4, GetBuildInfo()) > 50001 +ShadowUF.is510 = select(4, GetBuildInfo()) > 50001 local L = ShadowUF.L ShadowUF.dbRevision = 28 diff --git a/modules/chi.lua b/modules/chi.lua index 02cd7050..3ffa98d1 100755 --- a/modules/chi.lua +++ b/modules/chi.lua @@ -1,6 +1,6 @@ local Chi = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(Chi, "chi", ShadowUF.L["Chi"], nil, "MONK") -local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = ShadowUF.is501 and SPELL_POWER_CHI or SPELL_POWER_LIGHT_FORCE, eventType = ShadowUF.is501 and "CHI" or "LIGHT_FORCE", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = ShadowUF.is501 and SPELL_POWER_CHI or SPELL_POWER_LIGHT_FORCE, eventType = ShadowUF.is510 and "CHI" or "LIGHT_FORCE", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function Chi:OnEnable(frame) frame.chi = frame.chi or CreateFrame("Frame", nil, frame) diff --git a/modules/movers.lua b/modules/movers.lua index 5a4f061d..4b7003ba 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -43,7 +43,7 @@ local function createConfigEnv() return 3 elseif( powerType == SPELL_POWER_ECLIPSE ) then return getValue("UnitPower", unit, math.random(-100, 100)) - elseif( ( ShadowUF.is501 and powerType == SPELL_POWER_CHI ) or ( not ShadowUF.is501 and powerType == SPELL_POWER_LIGHT_FORCE ) ) then + elseif( ( ShadowUF.is510 and powerType == SPELL_POWER_CHI ) or ( not ShadowUF.is510 and powerType == SPELL_POWER_LIGHT_FORCE ) ) then return 4 elseif( powerType == SPELL_POWER_SHADOW_ORBS ) then return PRIEST_BAR_NUM_ORBS diff --git a/modules/tags.lua b/modules/tags.lua index a7b3e9e3..f2d1dbeb 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -28,7 +28,7 @@ for powerType in pairs(PowerBarColor) do end end -if( ShadowUF.is501 ) then +if( ShadowUF.is510 ) then powerFilters["SUF_POWERTYPE:LIGHT_FORCE"] = "CHI" end @@ -816,7 +816,7 @@ Tags.defaultTags = { return points and points > 0 and points end]], ["monk:chipoints"] = [[function(unit, unitOwner) - local points = UnitPower(ShadowUF.playerUnit, ShadowUF.is501 and SPELL_POWER_CHI or SPELL_POWER_LIGHT_FORCE) + local points = UnitPower(ShadowUF.playerUnit, ShadowUF.is510 and SPELL_POWER_CHI or SPELL_POWER_LIGHT_FORCE) return points and points > 0 and points end]], ["warlock:demonic:perpp"] = [[function(unit, unitOwner) From 91eda1f359520f517b9908af01c70cd659389c41 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 18 Nov 2012 12:38:18 -0800 Subject: [PATCH 366/794] Do a one time check on config and check or set height if it's not on relevant areas --- ShadowedUnitFrames.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index cb4f5f3a..8683d54b 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -6,7 +6,7 @@ ShadowUF = select(2, ...) ShadowUF.is510 = select(4, GetBuildInfo()) > 50001 local L = ShadowUF.L -ShadowUF.dbRevision = 28 +ShadowUF.dbRevision = 29 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -88,6 +88,16 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 28 ) then + for unit, config in pairs(self.db.profile.units) do + for key, module in pairs(ShadowUF.modules) do + if( config[key] and ( module.moduleHasBar or config[key].isBar or config[key].order ) ) then + config[key].height = config[key].height or 0.40 + end + end + end + end + if( revision <= 27 ) then self.db.profile.healthColors.aggro = CopyTable(self.db.profile.healthColors.hostile) end From 0bb52c34e303643687697e526b3f68e1ce159a6b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 18 Nov 2012 12:42:36 -0800 Subject: [PATCH 367/794] Fixed Quest boss indicators not showing up --- ShadowedUnitFrames.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 8683d54b..9ffb3cf6 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -89,9 +89,12 @@ function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision if( revision <= 28 ) then + self.db.profile.units.target.indicators.questBoss = {enabled = true, anchorPoint = "BR", size = 22, x = 9, y = 24, anchorTo = "$parent"} + self.db.profile.units.focus.indicators.questBoss = {enabled = false, anchorPoint = "BR", size = 22, x = 7, y = 14, anchorTo = "$parent"} + for unit, config in pairs(self.db.profile.units) do for key, module in pairs(ShadowUF.modules) do - if( config[key] and ( module.moduleHasBar or config[key].isBar or config[key].order ) ) then + if( config[key] and ( module.moduleHasBar or module.isComboPoints or config[key].isBar or config[key].order ) ) then config[key].height = config[key].height or 0.40 end end @@ -377,6 +380,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.focus.enabled = true self.defaults.profile.units.focus.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} self.defaults.profile.units.focus.indicators.lfdRole = {enabled = false, size = 0, x = 0, y = 0} + self.defaults.profile.units.focus.indicators.questBoss = {enabled = true, size = 0, x = 0, y = 0} -- FOCUSTARGET self.defaults.profile.units.focustarget.enabled = true self.defaults.profile.units.focustarget.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} @@ -384,6 +388,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.target.enabled = true self.defaults.profile.units.target.comboPoints = {enabled = true, isBar = true} self.defaults.profile.units.target.indicators.lfdRole = {enabled = false, size = 0, x = 0, y = 0} + self.defaults.profile.units.target.indicators.questBoss = {enabled = true, size = 0, x = 0, y = 0} -- TARGETTARGET/TARGETTARGETTARGET self.defaults.profile.units.targettarget.enabled = true self.defaults.profile.units.targettargettarget.enabled = true From be69f8c269af55eee2a4b3a05052e8d1ecc9496c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 27 Nov 2012 08:40:03 -0800 Subject: [PATCH 368/794] Bump TOC to 50100 --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 1958e9cf..65c0789f 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,4 +1,4 @@ -## Interface: 50001 +## Interface: 50100 ## Title: Shadowed Unit Frames ## Notes: As with every other SUF note, this isn't telling you something useful. You should probably not be reading it still. ## Author: Shadowed From 1aa5f0fe0d6d4c54c7c3089884e2dd7a9de97fde Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 27 Nov 2012 08:41:22 -0800 Subject: [PATCH 369/794] Typo --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 65c0789f..2d918bbf 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ ## Interface: 50100 ## Title: Shadowed Unit Frames -## Notes: As with every other SUF note, this isn't telling you something useful. You should probably not be reading it still. +## Notes: Now with 90% more shadows than the leading competitors ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB From cc176c07399100fe651002911b378f0c74ea3bdd Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 27 Nov 2012 16:50:50 -0800 Subject: [PATCH 370/794] Fixed a 5.1.0 compatibility check for Chi --- modules/chi.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/chi.lua b/modules/chi.lua index 3ffa98d1..72f8f81c 100755 --- a/modules/chi.lua +++ b/modules/chi.lua @@ -1,6 +1,6 @@ local Chi = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(Chi, "chi", ShadowUF.L["Chi"], nil, "MONK") -local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = ShadowUF.is501 and SPELL_POWER_CHI or SPELL_POWER_LIGHT_FORCE, eventType = ShadowUF.is510 and "CHI" or "LIGHT_FORCE", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = ShadowUF.is510 and SPELL_POWER_CHI or SPELL_POWER_LIGHT_FORCE, eventType = ShadowUF.is510 and "CHI" or "LIGHT_FORCE", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function Chi:OnEnable(frame) frame.chi = frame.chi or CreateFrame("Frame", nil, frame) From 6d2ee3f7c62c70d979887ccf4054703a26a582be Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 29 Nov 2012 08:09:02 -0800 Subject: [PATCH 371/794] Bump options TOC --- options/ShadowedUF_Options.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index 92ece87a..d0f725bf 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 50001 +## Interface: 50100 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From ae20d181091297995259cb2e0bce357cb337360f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 29 Nov 2012 08:14:27 -0800 Subject: [PATCH 372/794] Strip all the 5.1 compatibility checks since 5.1 is live --- ShadowedUnitFrames.lua | 1 - modules/chi.lua | 2 +- modules/movers.lua | 2 +- modules/tags.lua | 7 +------ 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 9ffb3cf6..b83fcb22 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -3,7 +3,6 @@ ]] ShadowUF = select(2, ...) -ShadowUF.is510 = select(4, GetBuildInfo()) > 50001 local L = ShadowUF.L ShadowUF.dbRevision = 29 diff --git a/modules/chi.lua b/modules/chi.lua index 72f8f81c..da198295 100755 --- a/modules/chi.lua +++ b/modules/chi.lua @@ -1,6 +1,6 @@ local Chi = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(Chi, "chi", ShadowUF.L["Chi"], nil, "MONK") -local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = ShadowUF.is510 and SPELL_POWER_CHI or SPELL_POWER_LIGHT_FORCE, eventType = ShadowUF.is510 and "CHI" or "LIGHT_FORCE", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = SPELL_POWER_CHI, eventType = "CHI", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function Chi:OnEnable(frame) frame.chi = frame.chi or CreateFrame("Frame", nil, frame) diff --git a/modules/movers.lua b/modules/movers.lua index 4b7003ba..6e2bfd17 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -43,7 +43,7 @@ local function createConfigEnv() return 3 elseif( powerType == SPELL_POWER_ECLIPSE ) then return getValue("UnitPower", unit, math.random(-100, 100)) - elseif( ( ShadowUF.is510 and powerType == SPELL_POWER_CHI ) or ( not ShadowUF.is510 and powerType == SPELL_POWER_LIGHT_FORCE ) ) then + elseif( powerType == SPELL_POWER_CHI) then return 4 elseif( powerType == SPELL_POWER_SHADOW_ORBS ) then return PRIEST_BAR_NUM_ORBS diff --git a/modules/tags.lua b/modules/tags.lua index f2d1dbeb..a03b1f34 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -28,11 +28,6 @@ for powerType in pairs(PowerBarColor) do end end -if( ShadowUF.is510 ) then - powerFilters["SUF_POWERTYPE:LIGHT_FORCE"] = "CHI" -end - - -- Register the associated events with all the tags function Tags:RegisterEvents(parent, fontString, tags) local hasPowerFilters; @@ -816,7 +811,7 @@ Tags.defaultTags = { return points and points > 0 and points end]], ["monk:chipoints"] = [[function(unit, unitOwner) - local points = UnitPower(ShadowUF.playerUnit, ShadowUF.is510 and SPELL_POWER_CHI or SPELL_POWER_LIGHT_FORCE) + local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_CHI) return points and points > 0 and points end]], ["warlock:demonic:perpp"] = [[function(unit, unitOwner) From ad623a76fa91a804165f58650ec23f3d3d365372 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 30 Nov 2012 09:17:37 -0800 Subject: [PATCH 373/794] Empty bar will be colored tapped if reaction type is both or NPC now. Not sold on this change, may revert it depending on reactions --- modules/empty.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/empty.lua b/modules/empty.lua index f3fc9d3e..2dcc358a 100755 --- a/modules/empty.lua +++ b/modules/empty.lua @@ -31,7 +31,10 @@ end function Empty:UpdateColor(frame) local color local reactionType = ShadowUF.db.profile.units[frame.unitType].emptyBar.reactionType - if( not UnitPlayerOrPetInRaid(frame.unit) and not UnitPlayerOrPetInParty(frame.unit) and ( ( ( reactionType == "player" or reactionType == "both" ) and UnitIsPlayer(frame.unit) and not UnitIsFriend(frame.unit, "player") ) or ( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(frame.unit) ) ) ) then + + if( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(frame.unit) and not UnitIsTappedByAllThreatList(unit) and not UnitIsTappedByPlayer(unit) and UnitIsTapped(unit) and UnitCanAttack("player", unit) ) then + color = ShadowUF.db.profile.healthColors.tapped + elseif( not UnitPlayerOrPetInRaid(frame.unit) and not UnitPlayerOrPetInParty(frame.unit) and ( ( ( reactionType == "player" or reactionType == "both" ) and UnitIsPlayer(frame.unit) and not UnitIsFriend(frame.unit, "player") ) or ( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(frame.unit) ) ) ) then if( not UnitIsFriend(frame.unit, "player") and UnitPlayerControlled(frame.unit) ) then if( UnitCanAttack("player", frame.unit) ) then color = ShadowUF.db.profile.healthColors.hostile From 2559468fcd774c6407185e49d3683fe08cfad4a1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 30 Nov 2012 16:26:28 -0800 Subject: [PATCH 374/794] Copy/paste typo --- modules/empty.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/empty.lua b/modules/empty.lua index 2dcc358a..a9156cb5 100755 --- a/modules/empty.lua +++ b/modules/empty.lua @@ -32,7 +32,7 @@ function Empty:UpdateColor(frame) local color local reactionType = ShadowUF.db.profile.units[frame.unitType].emptyBar.reactionType - if( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(frame.unit) and not UnitIsTappedByAllThreatList(unit) and not UnitIsTappedByPlayer(unit) and UnitIsTapped(unit) and UnitCanAttack("player", unit) ) then + if( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(frame.unit) and not UnitIsTappedByAllThreatList(frame.unit) and not UnitIsTappedByPlayer(frame.unit) and UnitIsTapped(frame.unit) and UnitCanAttack("player", frame.unit) ) then color = ShadowUF.db.profile.healthColors.tapped elseif( not UnitPlayerOrPetInRaid(frame.unit) and not UnitPlayerOrPetInParty(frame.unit) and ( ( ( reactionType == "player" or reactionType == "both" ) and UnitIsPlayer(frame.unit) and not UnitIsFriend(frame.unit, "player") ) or ( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(frame.unit) ) ) ) then if( not UnitIsFriend(frame.unit, "player") and UnitPlayerControlled(frame.unit) ) then From d5cdbb9e93796da75871165990a024df179f9376 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 6 Dec 2012 08:27:24 -0800 Subject: [PATCH 375/794] If the compact raid frames aren't hidden, bump the frame strata up on the frame manager (again) --- ShadowedUnitFrames.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index b83fcb22..949e305a 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -616,8 +616,8 @@ function ShadowUF:HideBlizzardFrames() CompactRaidFrameContainer:HookScript("OnShow", hideRaid) CompactRaidFrameManager:HookScript("OnShow", hideRaid) - -- elseif( not ShadowUF.db.profile.hidden.raid ) then - -- CompactRaidFrameManager:SetFrameStrata("DIALOG") + elseif( not ShadowUF.db.profile.hidden.raid ) then + CompactRaidFrameManager:SetFrameStrata("DIALOG") end end From 8390b55d2d10faa1f71efbc54b6d86b4eae2e343 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 7 Dec 2012 11:39:10 -0800 Subject: [PATCH 376/794] Only cancel auras if you click on an unit that is the player, not type of player (oops) --- modules/auras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index 9d6bec7d..c8e2705a 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -207,7 +207,7 @@ local function hideTooltip(self) end local function cancelAura(self, mouse) - if( mouse ~= "RightButton" or not UnitIsPlayer(self.parent.unit) or InCombatLockdown() or self.filter == "TEMP" ) then + if( mouse ~= "RightButton" or not UnitIsUnit(self.parent.unit, "player") or InCombatLockdown() or self.filter == "TEMP" ) then return end From 7bc1bfecae757bc63f9fc56b58ff171c23f2c125 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 12 Dec 2012 10:10:14 -0800 Subject: [PATCH 377/794] Added Rogue's Anticipation as an Aura Points trackable spell --- modules/aurapoints.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index 4fa1d989..522b4569 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -2,6 +2,7 @@ local AuraPoints = { isComboPoints = true, spells = { ["MAGE"] = {max = 6, name = GetSpellInfo(36032)}, + ["ROGUE"] = {max = 5, name = GetSpellInfo(115189)} } } From 254e797953baaa88814c03d983efd74a2fd84488 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 12 Dec 2012 10:24:31 -0800 Subject: [PATCH 378/794] Don't muck with CRF strata if we aren't hiding it and we are in combat --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 949e305a..89332de8 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -616,7 +616,7 @@ function ShadowUF:HideBlizzardFrames() CompactRaidFrameContainer:HookScript("OnShow", hideRaid) CompactRaidFrameManager:HookScript("OnShow", hideRaid) - elseif( not ShadowUF.db.profile.hidden.raid ) then + elseif( not ShadowUF.db.profile.hidden.raid and not InCombatLockdown() ) then CompactRaidFrameManager:SetFrameStrata("DIALOG") end end From b540b69bc33353fef4591923245a0f223bc2658b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 15 Dec 2012 18:51:13 -0800 Subject: [PATCH 379/794] Name the cooldown frames cause Tullers a jerk --- modules/auras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index c8e2705a..1534d925 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -224,7 +224,7 @@ local function updateButton(id, group, config) button:SetScript("OnLeave", hideTooltip) button:RegisterForClicks("RightButtonUp") - button.cooldown = CreateFrame("Cooldown", nil, button) + button.cooldown = CreateFrame("Cooldown", group.parent:GetName() .. "Aura" .. group.type .. id .. "Cooldown", button) button.cooldown:SetAllPoints(button) button.cooldown:SetReverse(true) button.cooldown:SetFrameLevel(7) From 5717753620c1dcf15167bb01e5d9e4de6bbe65eb Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 16 Dec 2012 16:37:46 -0800 Subject: [PATCH 380/794] Fix the logic used to force the raid frames to update, and also clear the children points before doing it --- modules/units.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 567e2ddf..951c6621 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -913,12 +913,9 @@ function Units:SetHeaderAttributes(frame, type) end end - -- calling :Show basically resets the header - if( frame:IsShown() ) then - frame:Show() - end - - if( headerUnits[type] and not InCombatLockdown() ) then + if( not InCombatLockdown() and headerUnits[type] ) then + -- Children no longer have ClearAllPoints() called on them before they are repositioned + -- this tries to stop it from bugging out by clearing it then forcing it to reposition everything local name = frame:GetName() .. "UnitButton" local index = 1 local child = _G[name .. index] @@ -928,6 +925,12 @@ function Units:SetHeaderAttributes(frame, type) index = index + 1 child = _G[name .. index] end + + -- Hiding and reshowing the header forces an update + if( frame:IsShown() ) then + frame:Hide() + frame:Show() + end end end From 6ea5f1a86e3ddaf638bc1e5ed7aca7bbc4785951 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Dec 2012 17:29:04 -0800 Subject: [PATCH 381/794] Add a config flag to hide totem bars if no totems are active --- ShadowedUnitFrames.lua | 5 ++++- modules/totems.lua | 12 +++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 89332de8..dd6d2b06 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 29 +ShadowUF.dbRevision = 30 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -86,6 +86,9 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 29 ) then + self.db.profile.units.player.totemBar.showAlways = true + end if( revision <= 28 ) then self.db.profile.units.target.indicators.questBoss = {enabled = true, anchorPoint = "BR", size = 22, x = 9, y = 24, anchorTo = "$parent"} diff --git a/modules/totems.lua b/modules/totems.lua index 0650da4a..7e18393f 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -108,9 +108,8 @@ function Totems:UpdateVisibility(frame) if( frame.inVehicle ) then ShadowUF.Layout:SetBarVisibility(frame, "totemBar", false) - -- Below check on Update to only show when we have 1 totem if it's active will handle reshowing it elseif( MAX_TOTEMS ~= 1 ) then - ShadowUF.Layout:SetBarVisibility(frame, "totemBar", true) + self:Update(frame) end end end @@ -137,8 +136,11 @@ function Totems:Update(frame) end end - -- Only guardian timers should auto hide, nothing else - if( MAX_TOTEMS == 1 and not frame.inVehicle ) then - ShadowUF.Layout:SetBarVisibility(frame, "totemBar", totalActive > 0) + if( not frame.inVehicle ) then + -- Guardian timers always auto hide + -- or if it's flagged to not always be shown + if( MAX_TOTEMS == 1 or not ShadowUF.db.profile.units[frame.unitType].totemBar.showAlways ) then + ShadowUF.Layout:SetBarVisibility(frame, "totemBar", totalActive > 0) + end end end From 3b46083521dd2057e845f3060562d6fa7a1fe24c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 2 Jan 2013 14:03:51 -0800 Subject: [PATCH 382/794] Implemented 5.2 menu system, not tested on non-5.1, but you're downloading alpha, so it's your fault if it breaks --- ShadowedUnitFrames.lua | 3 ++- ShadowedUnitFrames.toc | 2 +- modules/units.lua | 18 +++++++++++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index dd6d2b06..a055e60e 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -3,6 +3,7 @@ ]] ShadowUF = select(2, ...) +ShadowUF.is502 = select(4, GetBuildInfo()) >= 50200 local L = ShadowUF.L ShadowUF.dbRevision = 30 @@ -687,7 +688,7 @@ function ShadowUF:HideBlizzardFrames() end -- Don't modify the raid menu because that will taint the MA/MT stuff and it'll break and that's bad - if( not active_hiddens.popup ) then + if( not active_hiddens.popup and not ShadowUF.is502 ) then active_hiddens.popup = true for key, list in pairs(UnitPopupMenus) do if( key ~= "RAID" ) then diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 2d918bbf..61bc5479 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,4 +1,4 @@ -## Interface: 50100 +## Interface: 50200 ## Title: Shadowed Unit Frames ## Notes: Now with 90% more shadows than the leading competitors ## Author: Shadowed diff --git a/modules/units.lua b/modules/units.lua index 951c6621..82a47a41 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -609,7 +609,9 @@ OnAttributeChanged = function(self, name, unit) self:RegisterNormalEvent("UNIT_TARGET", Units, "CheckPetUnitUpdated") end - self.menu = ShowMenu + if( not ShadowUF.is502 ) then + self.menu = ShowMenu + end self:SetVisibility() Units:CheckUnitStatus(self) end @@ -626,7 +628,7 @@ local secureInitializeUnit = [[ self:SetAttribute("toggleForVehicle", true) self:SetAttribute("*type1", "target") - self:SetAttribute("*type2", "menu") + self:SetAttribute("*type2", "togglemenu") self:SetAttribute("isHeaderDriven", true) @@ -641,6 +643,10 @@ local secureInitializeUnit = [[ end ]] +if( not ShadowUF.is502 ) then + secureInitializeUnit = string.gsub(secureInitializeUnit, "togglemenu", "menu") +end + local unitButtonTemplate = ClickCastHeader and "ClickCastUnitTemplate,SecureUnitButtonTemplate" or "SecureUnitButtonTemplate" -- Header unit initialized @@ -719,8 +725,10 @@ function Units:CreateUnit(...) frame:HookScript("OnLeave", OnLeave) frame:SetScript("OnShow", OnShow) frame:SetScript("OnHide", OnHide) - frame:SetScript("PostClick", PostClick) - + if( not ShadowUF.is502 ) then + frame:SetScript("PostClick", PostClick) + end + frame.OnEnter = SUF_OnEnter frame.OnLeave = UnitFrame_OnLeave @@ -728,7 +736,7 @@ function Units:CreateUnit(...) -- non-header frames don't set those, so we need to do it if( not InCombatLockdown() ) then frame:SetAttribute("*type1", "target") - frame:SetAttribute("*type2", "menu") + frame:SetAttribute("*type2", ShadowUF.is502 and "togglemenu" or "menu") end return frame From 3330b6245fcfd143d028f8026b1322c20b1762cb Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 2 Jan 2013 15:13:41 -0800 Subject: [PATCH 383/794] Added assigned role sorting for 5.2 --- ShadowedUnitFrames.lua | 17 ++++++++++++++++- modules/units.lua | 13 +++++++++++++ options/config.lua | 18 +----------------- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index a055e60e..a73e4103 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -75,8 +75,9 @@ function ShadowUF:OnInitialize() self:LoadDefaultLayout() else self:CheckUpgrade() + self:CheckBuild() end - + self.db.profile.revision = self.dbRevision self:FireModuleEvent("OnInitialize") self:HideBlizzardFrames() @@ -85,6 +86,20 @@ function ShadowUF:OnInitialize() self.modules.movers:Update() end +function ShadowUF:CheckBuild() + local build = select(4, GetBuildInfo()) + if( self.db.profile.wowBuild == build ) then return end + + if( build == 50200 ) then + self:Print("NOTE! As of 5.2.0, you can now use menus to perform secure actions such as Set/Clear Focus or reporting.") + self:Print("SUF has been tested and confirmed to work with this setup. If menus do not show up, you may need to update Clique.") + self:Print("If you still get action blocked issues, it is another addons fault and you should yell at that author for doing something bad.") + end + + self.db.profile.wowBuild = build +end + + function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision if( revision <= 29 ) then diff --git a/modules/units.lua b/modules/units.lua index 82a47a41..42b49c4c 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -618,6 +618,7 @@ end Units.OnAttributeChanged = OnAttributeChanged + local secureInitializeUnit = [[ local header = self:GetParent() @@ -737,6 +738,15 @@ function Units:CreateUnit(...) if( not InCombatLockdown() ) then frame:SetAttribute("*type1", "target") frame:SetAttribute("*type2", ShadowUF.is502 and "togglemenu" or "menu") + + if( ShadowUF.is502 and ClickCastHeader and not frame.cliqueShiv ) then + frame.cliqueShiv = true + stateMonitor:WrapScript(frame, "OnAttributeChanged", [[ + if( value == "menu" ) then + self:SetAttribute(name, "togglemenu") + end + ]]) + end end return frame @@ -889,6 +899,9 @@ function Units:SetHeaderAttributes(frame, type) if( config.groupBy == "CLASS" ) then frame:SetAttribute("groupingOrder", "DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,ROGUE,SHAMAN,WARLOCK,WARRIOR,MONK") frame:SetAttribute("groupBy", "CLASS") + elseif( config.groupBy == "ASSIGNEDROLE" ) then + frame:SetAttribute("groupingOrder", "TANK,HEALER,DAMAGER,NONE") + frame:SetAttribute("groupBy", "ASSIGNEDROLE") else frame:SetAttribute("groupingOrder", "1,2,3,4,5,6,7,8") frame:SetAttribute("groupBy", "GROUP") diff --git a/options/config.lua b/options/config.lua index 8e1816d8..dd9ff53a 100755 --- a/options/config.lua +++ b/options/config.lua @@ -3548,26 +3548,10 @@ local function loadUnitOptions() order = 4, type = "select", name = L["Group by"], - values = {["GROUP"] = L["Group number"], ["CLASS"] = L["Class"]}, + values = ShadowUF.is502 and {["GROUP"] = L["Group number"], ["CLASS"] = L["Class"], ["ASSIGNEDROLE"] = L["Assigned Role (DPS/Tank/etc)"]} or {["GROUP"] = L["Group number"], ["CLASS"] = L["Class"]}, arg = "groupBy", hidden = hideSplitOrRaidOption, }, - sortMethod = { - order = 5, - type = "select", - name = L["Sort method"], - values = {["INDEX"] = L["Index"], ["NAME"] = L["Name"]}, - arg = "sortMethod", - hidden = false, - }, - sortOrder = { - order = 6, - type = "select", - name = L["Sort order"], - values = {["ASC"] = L["Ascending"], ["DESC"] = L["Descending"]}, - arg = "sortOrder", - hidden = false, - }, selectedGroups = { order = 7, type = "multiselect", From e4da1366b08f72635cb3c471da106745d02f2a74 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 1 Feb 2013 07:42:30 -0800 Subject: [PATCH 384/794] Added support for Mage's Rune of Power --- ShadowedUnitFrames.lua | 6 +++++- modules/defaultlayout.lua | 1 + modules/totems.lua | 7 +++++++ options/config.lua | 7 +++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index a73e4103..9f551316 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -6,7 +6,7 @@ ShadowUF = select(2, ...) ShadowUF.is502 = select(4, GetBuildInfo()) >= 50200 local L = ShadowUF.L -ShadowUF.dbRevision = 30 +ShadowUF.dbRevision = 31 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -102,6 +102,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 30 ) then + self.db.profile.powerColors.RUNEOFPOWER = {r = 0.35, g = 0.45, b = 0.60} + end + if( revision <= 29 ) then self.db.profile.units.player.totemBar.showAlways = true end diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index f8419d8f..139fa5f0 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -161,6 +161,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) ALTERNATE = {r = 0.815, g = 0.941, b = 1}, CHI = {r = 0.71, g = 1.0, b = 0.92}, STATUE = {r = 0.35, g = 0.45, b = 0.60}, + RUNEOFPOWER = {r = 0.35, g = 0.45, b = 0.60}, MUSHROOMS = {r = 0.20, g = 0.90, b = 0.20}, POWER_TYPE_FEL_ENERGY = {r = 0.878, g = 0.980, b = 0}, AURAPOINTS = {r = 1.0, g = 0.80, b = 0.0}, diff --git a/modules/totems.lua b/modules/totems.lua index 7e18393f..177a6788 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -13,6 +13,9 @@ elseif( playerClass == "DRUID" ) then elseif( playerClass == "MONK" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Statue bar"], true, "MONK", {1, 2}, 70) +elseif( playerClass == "MAGE" ) then + MAX_TOTEMS = 1 + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Rune of Power bar"], true, "MAGE", {1, 2, 3}, 90) else ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Totem bar"], true, "SHAMAN") end @@ -45,6 +48,8 @@ function Totems:OnEnable(frame) totemColors[1] = ShadowUF.db.profile.classColors.PET elseif( playerClass == "MONK" ) then totemColors[1] = ShadowUF.db.profile.powerColors.STATUE + elseif( playerClass == "MAGE" ) then + totemColors[1] = ShadowUF.db.profile.powerColors.RUNEOFPOWER else totemColors[1] = {r = 1, g = 0, b = 0.4} totemColors[2] = {r = 0, g = 1, b = 0.4} @@ -89,6 +94,8 @@ function Totems:OnLayoutApplied(frame) frame:SetBlockColor(totem, "totemBar", totemColors[totem.id].r, totemColors[totem.id].g, totemColors[totem.id].b) end + + self:Update(frame) end end diff --git a/options/config.lua b/options/config.lua index dd9ff53a..87359ad6 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1206,6 +1206,13 @@ local function loadGeneralOptions() arg = "powerColors.STATUE", hidden = function(info) return select(2, UnitClass("player")) ~= "MONK" end, }, + STATUE = { + order = 17.5, + type = "color", + name = L["Rune of Power"], + arg = "powerColors.RUNEOFPOWER", + hidden = function(info) return select(2, UnitClass("player")) ~= "MAGE" end, + }, POWER_TYPE_FEL_ENERGY = { order = 18, type = "color", From b8616f25c4f56658b1cd63a642a85db0b5225ff0 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 14 Feb 2013 09:47:15 -0800 Subject: [PATCH 385/794] Cleanup Blizzard frame hiding - Reparent frames we hide to reduce the chance of them showing because of other peoples incompetence - Use CVars to hide the arena frames while out of combat to reduce the chance of taint issues --- ShadowedUnitFrames.lua | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 9f551316..c1619e89 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -571,6 +571,8 @@ function ShadowUF:ProfilesChanged() end ShadowUF.noop = function() end +ShadowUF.hiddenFrame = CreateFrame("Frame") +ShadowUF.hiddenFrame:Hide() local rehideFrame = function(self) if( not InCombatLockdown() ) then @@ -581,6 +583,7 @@ end local function hideBlizzardFrames(taint, ...) for i=1, select("#", ...) do local frame = select(i, ...) + frame:SetParent(ShadowUF.hiddenFrame) frame:UnregisterAllEvents() frame:Hide() @@ -594,11 +597,11 @@ end local active_hiddens = {} function ShadowUF:HideBlizzardFrames() - if( ShadowUF.db.profile.hidden.cast and not active_hiddens.cast ) then + if( self.db.profile.hidden.cast and not active_hiddens.cast ) then hideBlizzardFrames(true, CastingBarFrame, PetCastingBarFrame) end - if( ShadowUF.db.profile.hidden.party and not active_hiddens.party ) then + if( self.db.profile.hidden.party and not active_hiddens.party ) then for i=1, MAX_PARTY_MEMBERS do local name = "PartyMemberFrame" .. i hideBlizzardFrames(true, _G[name], _G[name .. "HealthBar"], _G[name .. "ManaBar"]) @@ -614,7 +617,7 @@ function ShadowUF:HideBlizzardFrames() end if( CompactRaidFrameManager ) then - if( ShadowUF.db.profile.hidden.raid and not active_hiddens.raidTriggered ) then + if( self.db.profile.hidden.raid and not active_hiddens.raidTriggered ) then active_hiddens.raidTriggered = true local function hideRaid() @@ -630,7 +633,7 @@ function ShadowUF:HideBlizzardFrames() end hooksecurefunc("CompactRaidFrameManager_UpdateShown", function() - if( ShadowUF.db.profile.hidden.raid ) then + if( self.db.profile.hidden.raid ) then hideRaid() end end) @@ -639,16 +642,16 @@ function ShadowUF:HideBlizzardFrames() CompactRaidFrameContainer:HookScript("OnShow", hideRaid) CompactRaidFrameManager:HookScript("OnShow", hideRaid) - elseif( not ShadowUF.db.profile.hidden.raid and not InCombatLockdown() ) then + elseif( not self.db.profile.hidden.raid and not InCombatLockdown() ) then CompactRaidFrameManager:SetFrameStrata("DIALOG") end end - if( ShadowUF.db.profile.hidden.buffs and not active_hiddens.buffs ) then + if( self.db.profile.hidden.buffs and not active_hiddens.buffs ) then hideBlizzardFrames(false, BuffFrame, TemporaryEnchantFrame, ConsolidatedBuffs) end - if( ShadowUF.db.profile.hidden.player and not active_hiddens.player ) then + if( self.db.profile.hidden.player and not active_hiddens.player ) then hideBlizzardFrames(false, PlayerFrame, PlayerFrameHealthBar, PlayerFrameManaBar, PlayerFrameAlternateManaBar) -- We keep these in case someone is still using the default auras, otherwise it messes up vehicle stuff @@ -658,38 +661,38 @@ function ShadowUF:HideBlizzardFrames() PlayerFrame:RegisterEvent("UNIT_EXITED_VEHICLE") end - if( ShadowUF.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then + if( self.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then hideBlizzardFrames(true, EclipseBarFrame, ShardBarFrame, RuneFrame, TotemFrame, PaladinPowerBar, MonkHarmonyBar, PriestBarFrame, WarlockPowerFrame) end - if( ShadowUF.db.profile.hidden.pet and not active_hiddens.pet ) then + if( self.db.profile.hidden.pet and not active_hiddens.pet ) then hideBlizzardFrames(false, PetFrame, PetFrameHealthBar, PetFrameManaBar) end - if( ShadowUF.db.profile.hidden.target and not active_hiddens.target ) then + if( self.db.profile.hidden.target and not active_hiddens.target ) then hideBlizzardFrames(false, TargetFrame, TargetFrameHealthBar, TargetFrameManaBar, TargetFrameSpellBar, ComboFrame, TargetFrameToT) end - if( ShadowUF.db.profile.hidden.focus and not active_hiddens.focus ) then + if( self.db.profile.hidden.focus and not active_hiddens.focus ) then hideBlizzardFrames(false, FocusFrame, FocusFrameHealthBar, FocusFrameManaBar, FocusFrameSpellBar, FocusFrameToT) end - if( ShadowUF.db.profile.hidden.boss and not active_hiddens.boss ) then + if( self.db.profile.hidden.boss and not active_hiddens.boss ) then for i=1, MAX_BOSS_FRAMES do local name = "Boss" .. i .. "TargetFrame" hideBlizzardFrames(false, _G[name], _G[name .. "HealthBar"], _G[name .. "ManaBar"]) end end - if( ShadowUF.db.profile.hidden.arena and not active_hiddens.arenaTriggered and IsAddOnLoaded("Blizzard_ArenaUI") ) then + if( self.db.profile.hidden.arena and not active_hiddens.arenaTriggered and IsAddOnLoaded("Blizzard_ArenaUI") and not InCombatLockdown() ) then active_hiddens.arenaTriggered = true - ArenaEnemyFrames.show = false ArenaEnemyFrames:UnregisterAllEvents() - ArenaEnemyFrames:Hide() + ArenaEnemyFrames:SetParent(self.hiddenFrame) + SetCVar("showArenaEnemyFrames", 0, "SHOW_ARENA_ENEMY_FRAMES_TEXT") end - if( ShadowUF.db.profile.hidden.playerAltPower and not active_hiddens.playerAltPower ) then + if( self.db.profile.hidden.playerAltPower and not active_hiddens.playerAltPower ) then hideBlizzardFrames(false, PlayerPowerBarAlt) end @@ -707,7 +710,7 @@ function ShadowUF:HideBlizzardFrames() end -- Don't modify the raid menu because that will taint the MA/MT stuff and it'll break and that's bad - if( not active_hiddens.popup and not ShadowUF.is502 ) then + if( not active_hiddens.popup and not self.is502 ) then active_hiddens.popup = true for key, list in pairs(UnitPopupMenus) do if( key ~= "RAID" ) then @@ -721,7 +724,7 @@ function ShadowUF:HideBlizzardFrames() end -- As a reload is required to reset the hidden hooks, we can just set this to true if anything is true - for type, flag in pairs(ShadowUF.db.profile.hidden) do + for type, flag in pairs(self.db.profile.hidden) do if( flag ) then active_hiddens[type] = true end From 2132cc34dc84e17e1f0906ff6f0cdd55226008ba Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 14 Feb 2013 09:54:03 -0800 Subject: [PATCH 386/794] Removed the Clique shiv for menus as it's been fixed in latest Clique --- modules/units.lua | 9 --------- 1 file changed, 9 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 42b49c4c..af9c2c69 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -738,15 +738,6 @@ function Units:CreateUnit(...) if( not InCombatLockdown() ) then frame:SetAttribute("*type1", "target") frame:SetAttribute("*type2", ShadowUF.is502 and "togglemenu" or "menu") - - if( ShadowUF.is502 and ClickCastHeader and not frame.cliqueShiv ) then - frame.cliqueShiv = true - stateMonitor:WrapScript(frame, "OnAttributeChanged", [[ - if( value == "menu" ) then - self:SetAttribute(name, "togglemenu") - end - ]]) - end end return frame From 1ff3aaa0fb133685258543674b676141cd129507 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 14 Feb 2013 09:57:41 -0800 Subject: [PATCH 387/794] Set the size/point of the hidden frame so we don't get errors --- ShadowedUnitFrames.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index c1619e89..4474d07a 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -572,6 +572,8 @@ end ShadowUF.noop = function() end ShadowUF.hiddenFrame = CreateFrame("Frame") +ShadowUF.hiddenFrame:SetSize(1, 1) +ShadowUF.hiddenFrame:SetPoint("CENTER") ShadowUF.hiddenFrame:Hide() local rehideFrame = function(self) From 5703f4895c7075af8ff0e0230407aff14dab78d4 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 14 Feb 2013 10:03:11 -0800 Subject: [PATCH 388/794] Don't reparent as it seems to break TargetFrame no matter what --- ShadowedUnitFrames.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 4474d07a..7b35a719 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -572,8 +572,6 @@ end ShadowUF.noop = function() end ShadowUF.hiddenFrame = CreateFrame("Frame") -ShadowUF.hiddenFrame:SetSize(1, 1) -ShadowUF.hiddenFrame:SetPoint("CENTER") ShadowUF.hiddenFrame:Hide() local rehideFrame = function(self) @@ -585,7 +583,6 @@ end local function hideBlizzardFrames(taint, ...) for i=1, select("#", ...) do local frame = select(i, ...) - frame:SetParent(ShadowUF.hiddenFrame) frame:UnregisterAllEvents() frame:Hide() @@ -626,7 +623,7 @@ function ShadowUF:HideBlizzardFrames() CompactRaidFrameManager:UnregisterAllEvents() CompactRaidFrameContainer:UnregisterAllEvents() if( InCombatLockdown() ) then return end - + CompactRaidFrameManager:Hide() local shown = CompactRaidFrameManager_GetSetting("IsShown") if( shown and shown ~= "0" ) then From 1f971bd76bbd2430219c593141992b161b2162dd Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 18 Feb 2013 13:37:52 -0800 Subject: [PATCH 389/794] Refactor aura points to be completely within the combo points system to reduce potential bugs --- modules/aurapoints.lua | 136 +++-------------------------------------- 1 file changed, 10 insertions(+), 126 deletions(-) diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index 522b4569..66a1e757 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -1,142 +1,26 @@ -local AuraPoints = { +local AuraPoints = setmetatable({ isComboPoints = true, spells = { ["MAGE"] = {max = 6, name = GetSpellInfo(36032)}, ["ROGUE"] = {max = 5, name = GetSpellInfo(115189)} } -} +}, {__index = ShadowUF.ComboPoints}) -AuraPoints.trackSpell = AuraPoints.spells[select(2, UnitClass("player"))] +local trackSpell = AuraPoints.spells[select(2, UnitClass("player"))] +if( not trackSpell ) then return end -if( not AuraPoints.trackSpell ) then return end ShadowUF:RegisterModule(AuraPoints, "auraPoints", ShadowUF.L["Aura Combo Points"]) +local auraConfig = {max = trackSpell.max, key = "auraPoints", colorKey = "AURAPOINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function AuraPoints:OnEnable(frame) frame.auraPoints = frame.auraPoints or CreateFrame("Frame", nil, frame) + frame.auraPoints.config = auraConfig + frame.comboPointType = auraConfig.key + frame:RegisterUnitEvent("UNIT_AURA", self, "Update") frame:RegisterUpdateFunc(self, "Update") end -function AuraPoints:OnLayoutApplied(frame, config) - local pointsFrame = frame.auraPoints - if( not pointsFrame ) then return end - - pointsFrame:SetFrameLevel(frame.topFrameLevel + 1) - - -- Not a bar so set the containers frame configuration - if( not config.auraPoints.isBar ) then - ShadowUF.Layout:ToggleVisibility(pointsFrame, frame.visibility[key]) - end - - if( not frame.visibility.auraPoints ) then return end - - -- Hide the active combo points - if( pointsFrame.points ) then - for _, texture in pairs(pointsFrame.points) do - texture:Hide() - end - end - - -- Setup for bar display! - if( config.auraPoints.isBar ) then - pointsFrame.blocks = pointsFrame.blocks or {} - pointsFrame.points = pointsFrame.blocks - - pointsFrame.visibleBlocks = AuraPoints.trackSpell.max - - -- Position bars, the 5 accounts for borders - local blockWidth = (pointsFrame:GetWidth() - (AuraPoints.trackSpell.max - 1)) / AuraPoints.trackSpell.max - for id=1, AuraPoints.trackSpell.max do - pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") - - local texture = pointsFrame.blocks[id] - local color = ShadowUF.db.profile.powerColors.AURAPOINTS - texture:SetVertexColor(color.r, color.g, color.b, color.a) - texture:SetHorizTile(false) - texture:SetTexture(ShadowUF.Layout.mediaPath.statusbar) - texture:SetHeight(pointsFrame:GetHeight()) - texture:SetWidth(blockWidth) - texture:ClearAllPoints() - - if( config.growth == "LEFT" ) then - if( id > 1 ) then - texture:SetPoint("TOPRIGHT", pointsFrame.blocks[id - 1], "TOPLEFT", -1, 0) - else - texture:SetPoint("TOPRIGHT", pointsFrame, "TOPRIGHT", 0, 0) - end - else - if( id > 1 ) then - texture:SetPoint("TOPLEFT", pointsFrame.blocks[id - 1], "TOPRIGHT", 1, 0) - else - texture:SetPoint("TOPLEFT", pointsFrame, "TOPLEFT", 0, 0) - end - end - end - - -- guess not, will have to do icons :( - else - local point, relativePoint - local x, y = 0, 0 - - if( config.auraPoints.growth == "LEFT" ) then - point, relativePoint = "BOTTOMRIGHT", "BOTTOMLEFT" - x = config.auraPoints.spacing - elseif( config.auraPoints.growth == "RIGHT" ) then - point, relativePoint = "BOTTOMLEFT", "BOTTOMRIGHT" - x = config.auraPoints.spacing - elseif( config.auraPoints.growth == "UP" ) then - point, relativePoint = "BOTTOMLEFT", "TOPLEFT" - y = config.auraPoints.spacing - elseif( config.auraPoints.growth == "DOWN" ) then - point, relativePoint = "TOPLEFT", "BOTTOMLEFT" - y = config.auraPoints.spacing - end - - - pointsFrame.icons = pointsFrame.icons or {} - pointsFrame.points = pointsFrame.icons - - for id=1, AuraPoints.trackSpell.max do - pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") - local texture = pointsFrame.icons[id] - texture:SetTexture("Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo") - texture:SetSize(config.auraPoints.size, config.auraPoints.size) - - if( id > 1 ) then - texture:ClearAllPoints() - texture:SetPoint(point, pointsFrame.icons[id - 1], relativePoint, x, y) - else - texture:ClearAllPoints() - texture:SetPoint("CENTER", pointsFrame, "CENTER", 0, 0) - end - end - - -- Position the main frame - pointsFrame:SetSize(0.1, 0.1) - pointsFrame:Show() - - ShadowUF.Layout:AnchorFrame(frame, pointsFrame, config.auraPoints) - end -end - -function AuraPoints:OnDisable(frame) - frame:UnregisterAll(self) -end - - -function AuraPoints:Update(frame, event, unit) - local points = select(4, UnitAura("player", AuraPoints.trackSpell.name)) or 0 - - -- Bar display, hide it if we don't have any combo points - if( ShadowUF.db.profile.units[frame.unitType].auraPoints.isBar ) then - ShadowUF.Layout:SetBarVisibility(frame, "auraPoints", ShadowUF.db.profile.units[frame.unitType].auraPoints.showAlways or (points and points > 0)) - end - - for id, pointTexture in pairs(frame.auraPoints.points) do - if( id <= points ) then - pointTexture:Show() - else - pointTexture:Hide() - end - end +function AuraPoints:GetPoints(unit) + return select(4, UnitAura("player", trackSpell.name)) or 0 end \ No newline at end of file From 61db1e28f00d2c5a892d9ff24a1f4de424e2e978 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 18 Feb 2013 13:40:02 -0800 Subject: [PATCH 390/794] Refactored combo points and subset modules (holy power/shadow orbs/soul shards) to reduce duplicate code --- modules/combopoints.lua | 24 +++++++++++++++--------- modules/holypower.lua | 24 +++--------------------- modules/shadoworbs.lua | 24 +++--------------------- modules/soulshards.lua | 24 +++--------------------- 4 files changed, 24 insertions(+), 72 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index bd6675e4..4c651f15 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -144,24 +144,30 @@ function Combo:UpdateBarBlocks(frame, event, unit, powerType) pointsFrame.visibleBlocks = max end - -function Combo:Update(frame, event, unit) - -- MoP changed UNIT_COMBO_POINTS so that unit is now player even if it's done on the target - --if( event and unit ~= "player" ) then return end - - -- For Malygos dragons, they also self cast their CP on themselves, which is why we check CP on ourself! +function Combo:GetPoints(unit) + -- For Malygos dragons, they also self cast their CP on themselves, which is why we check CP on ourself local playerUnit = UnitHasVehicleUI("player") and UnitHasVehiclePlayerFrameUI("player") and "vehicle" or "player" local points = GetComboPoints(playerUnit) if( points == 0 ) then points = GetComboPoints(playerUnit, playerUnit) end + + return points +end + +function Combo:Update(frame, event, unit, powerType) + local key = frame.comboPointType + -- Anything power based will have an eventType to filter on + if( event and frame[key].config.eventType and frame[key].config.eventType ~= powerType ) then return end + + local points = self:GetPoints(unit) -- Bar display, hide it if we don't have any combo points - if( ShadowUF.db.profile.units[frame.unitType].comboPoints.isBar ) then - ShadowUF.Layout:SetBarVisibility(frame, "comboPoints", ShadowUF.db.profile.units[frame.unitType].comboPoints.showAlways or (points and points > 0)) + if( ShadowUF.db.profile.units[frame.unitType][key].isBar ) then + ShadowUF.Layout:SetBarVisibility(frame, key, ShadowUF.db.profile.units[frame.unitType][key].showAlways or (points and points > 0)) end - for id, pointTexture in pairs(frame.comboPoints.points) do + for id, pointTexture in pairs(frame[key].points) do if( id <= points ) then pointTexture:Show() else diff --git a/modules/holypower.lua b/modules/holypower.lua index 0beac9e9..0531692e 100755 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -16,10 +16,6 @@ function HolyPower:OnEnable(frame) holyConfig.max = UnitPowerMax("player", holyConfig.powerType) end -function HolyPower:OnDisable(frame) - frame:UnregisterAll(self) -end - function HolyPower:OnLayoutApplied(frame, config) ShadowUF.ComboPoints:OnLayoutApplied(frame, config) self:UpdateBarBlocks(frame) @@ -47,20 +43,6 @@ function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) end end -function HolyPower:Update(frame, event, unit, powerType) - if( powerType and powerType ~= holyConfig.eventType ) then return end - - local points = UnitPower("player", holyConfig.powerType) - -- Bar display, hide it if we don't have any combo points - if( ShadowUF.db.profile.units[frame.unitType].holyPower.isBar ) then - ShadowUF.Layout:SetBarVisibility(frame, "holyPower", ShadowUF.db.profile.units[frame.unitType].holyPower.showAlways or (points and points > 0)) - end - - for id, pointTexture in pairs(frame.holyPower.points) do - if( id <= points ) then - pointTexture:Show() - else - pointTexture:Hide() - end - end -end +function HolyPower:GetPoints(unit) + return UnitPower("player", holyConfig.powerType) +end \ No newline at end of file diff --git a/modules/shadoworbs.lua b/modules/shadoworbs.lua index 0cd1301d..e30f4efe 100755 --- a/modules/shadoworbs.lua +++ b/modules/shadoworbs.lua @@ -15,29 +15,11 @@ function ShadowOrbs:OnEnable(frame) frame:RegisterUpdateFunc(self, "UpdateBarBlocks") end -function ShadowOrbs:OnDisable(frame) - frame:UnregisterAll(self) -end - function ShadowOrbs:OnLayoutApplied(frame, config) ShadowUF.ComboPoints:OnLayoutApplied(frame, config) self:UpdateBarBlocks(frame) end -function ShadowOrbs:Update(frame, event, unit, powerType) - if( powerType and powerType ~= shadowConfig.eventType ) then return end - - local points = UnitPower("player", shadowConfig.powerType) - -- Bar display, hide it if we don't have any combo points - if( ShadowUF.db.profile.units[frame.unitType].shadowOrbs.isBar ) then - ShadowUF.Layout:SetBarVisibility(frame, "shadowOrbs", ShadowUF.db.profile.units[frame.unitType].shadowOrbs.showAlways or (points and points > 0)) - end - - for id, pointTexture in pairs(frame.shadowOrbs.points) do - if( id <= points ) then - pointTexture:Show() - else - pointTexture:Hide() - end - end -end +function ShadowOrbs:GetPoints(unit) + return UnitPower("player", shadowConfig.powerType) +end \ No newline at end of file diff --git a/modules/soulshards.lua b/modules/soulshards.lua index f09588d5..044c705b 100755 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -15,29 +15,11 @@ function Souls:OnEnable(frame) frame:RegisterUpdateFunc(self, "UpdateBarBlocks") end -function Souls:OnDisable(frame) - frame:UnregisterAll(self) -end - function Souls:OnLayoutApplied(frame, config) ShadowUF.ComboPoints:OnLayoutApplied(frame, config) self:UpdateBarBlocks(frame) end -function Souls:Update(frame, event, unit, powerType) - if( powerType and powerType ~= soulsConfig.eventType ) then return end - - local points = UnitPower("player", soulsConfig.powerType) - -- Bar display, hide it if we don't have any soul shards - if( ShadowUF.db.profile.units[frame.unitType].soulShards.isBar ) then - ShadowUF.Layout:SetBarVisibility(frame, "soulShards", ShadowUF.db.profile.units[frame.unitType].soulShards.showAlways or (points and points > 0)) - end - - for id, pointTexture in pairs(frame.soulShards.points) do - if( id <= points ) then - pointTexture:Show() - else - pointTexture:Hide() - end - end -end +function Souls:GetPoints(unit) + return UnitPower("player", soulsConfig.powerType) +end \ No newline at end of file From 1ce9c5c572731b4f8f8e9c472c32eb4c50b5d151 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 4 Mar 2013 11:52:33 -0800 Subject: [PATCH 391/794] Bars that override visibility (Alt Power) will now register their tags properly --- modules/layout.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/layout.lua b/modules/layout.lua index 287c32b5..cf043507 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -411,8 +411,9 @@ function Layout:SetupText(frame, config) -- Update the actual text, and figure out the weighting information now for id, row in pairs(config.text) do - local parent = row.anchorTo == "$parent" and frame or frame[string.sub(row.anchorTo, 2)] - if( parent and parent:IsShown() and row.enabled and row.text ~= "" ) then + local module = string.sub(row.anchorTo, 2) + local parent = row.anchorTo == "$parent" and frame or frame[module] + if( parent and ( ShadowUF.modules[module].defaultVisibility == false or parent:IsShown() ) and row.enabled and row.text ~= "" ) then local fontString = frame.fontStrings[id] or frame.highFrame:CreateFontString(nil, "ARTWORK") self:SetupFontString(fontString, row.size) fontString:SetTextColor(ShadowUF.db.profile.font.color.r, ShadowUF.db.profile.font.color.g, ShadowUF.db.profile.font.color.b, ShadowUF.db.profile.font.color.a) From eb078c7cd0a86cbb310558320a293ff6e88753fc Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 4 Mar 2013 11:54:49 -0800 Subject: [PATCH 392/794] Remembered to update the options TOC this time --- options/ShadowedUF_Options.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index d0f725bf..b62fdc44 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 50100 +## Interface: 50200 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From 67fd2398fc27a929cbfffadde1530647cceb0946 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 4 Mar 2013 18:40:53 -0800 Subject: [PATCH 393/794] Reorganize and slightly optimize the incoming module so it can be used for other incoming type bars --- modules/incheal.lua | 148 ++++++++++++++++++++++++-------------------- 1 file changed, 80 insertions(+), 68 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index 566c12f2..988f6f86 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -1,4 +1,5 @@ -local IncHeal = {} +local IncHeal = {["frameKey"] = "incHeal", ["colorKey"] = "inc", ["frameLevelMod"] = 2} +ShadowUF.IncHeal = IncHeal ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) function IncHeal:OnEnable(frame) @@ -13,103 +14,114 @@ end function IncHeal:OnDisable(frame) frame:UnregisterAll(self) - frame.incHeal:Hide() + frame[self.frameKey]:Hide() end function IncHeal:OnLayoutApplied(frame) - if( not frame.visibility.incHeal or not frame.visibility.healthBar ) then return end - - - frame.incHeal:SetSize(frame.healthBar:GetSize()) - frame.incHeal:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) - frame.incHeal:SetStatusBarColor(ShadowUF.db.profile.healthColors.inc.r, ShadowUF.db.profile.healthColors.inc.g, ShadowUF.db.profile.healthColors.inc.b, ShadowUF.db.profile.bars.alpha) - frame.incHeal:GetStatusBarTexture():SetHorizTile(false) - frame.incHeal:SetOrientation(frame.healthBar:GetOrientation()) - frame.incHeal:SetReverseFill(frame.healthBar:GetReverseFill()) - frame.incHeal:Hide() + local bar = frame[self.frameKey] + if( not frame.visibility[self.frameKey] or not frame.visibility.healthBar ) then return end + + -- Since we're hiding, reset state + bar.total = nil + + bar:SetSize(frame.healthBar:GetSize()) + bar:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) + bar:SetStatusBarColor(ShadowUF.db.profile.healthColors[self.colorKey].r, ShadowUF.db.profile.healthColors[self.colorKey].g, ShadowUF.db.profile.healthColors[self.colorKey].b, ShadowUF.db.profile.bars.alpha) + bar:GetStatusBarTexture():SetHorizTile(false) + bar:SetOrientation(frame.healthBar:GetOrientation()) + bar:SetReverseFill(frame.healthBar:GetReverseFill()) + bar:Hide() -- When we can cheat and put the incoming bar right behind the health bar, we can efficiently show the incoming heal bar -- if the main bar has a transparency set, then we need a more complicated method to stop the health bar from being darker with incoming heals up if( ( ShadowUF.db.profile.units[frame.unitType].healthBar.invert and ShadowUF.db.profile.bars.backgroundAlpha == 0 ) or ( not ShadowUF.db.profile.units[frame.unitType].healthBar.invert and ShadowUF.db.profile.bars.alpha == 1 ) ) then - frame.incHeal.simple = true - frame.incHeal:SetFrameLevel(frame.topFrameLevel - 1) + bar.simple = true + bar:SetFrameLevel(frame.topFrameLevel - 1 - self.frameLevelMod) - if( frame.incHeal:GetOrientation() == "HORIZONTAL" ) then - frame.incHeal:SetWidth(frame.healthBar:GetWidth() * ShadowUF.db.profile.units[frame.unitType].incHeal.cap) + if( bar:GetOrientation() == "HORIZONTAL" ) then + bar:SetWidth(frame.healthBar:GetWidth() * ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap) else - frame.incHeal:SetHeight(frame.healthBar:GetHeight() * ShadowUF.db.profile.units[frame.unitType].incHeal.cap) + bar:SetHeight(frame.healthBar:GetHeight() * ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap) end - frame.incHeal:ClearAllPoints() + bar:ClearAllPoints() - local point = frame.incHeal:GetReverseFill() and "RIGHT" or "LEFT" - frame.incHeal:SetPoint("TOP" .. point, frame.healthBar) - frame.incHeal:SetPoint("BOTTOM" .. point, frame.healthBar) + local point = bar:GetReverseFill() and "RIGHT" or "LEFT" + bar:SetPoint("TOP" .. point, frame.healthBar) + bar:SetPoint("BOTTOM" .. point, frame.healthBar) else - frame.incHeal.simple = nil - frame.incHeal:SetFrameLevel(frame.topFrameLevel ) - frame.incHeal:SetWidth(1) - frame.incHeal:SetMinMaxValues(0, 1) - frame.incHeal:SetValue(1) - frame.incHeal:ClearAllPoints() - - frame.incHeal.orientation = frame.incHeal:GetOrientation() - frame.incHeal.reverseFill = frame.incHeal:GetReverseFill() - - if( frame.incHeal.orientation == "HORIZONTAL" ) then - frame.incHeal.healthSize = frame.healthBar:GetWidth() - frame.incHeal.positionPoint = frame.incHeal.reverseFill and "TOPRIGHT" or "TOPLEFT" - frame.incHeal.positionRelative = frame.incHeal.reverseFill and "BOTTOMRIGHT" or "BOTTOMLEFT" + bar.simple = nil + bar:SetFrameLevel(frame.topFrameLevel - self.frameLevelMod) + bar:SetWidth(1) + bar:SetMinMaxValues(0, 1) + bar:SetValue(1) + bar:ClearAllPoints() + + bar.orientation = bar:GetOrientation() + bar.reverseFill = bar:GetReverseFill() + + if( bar.orientation == "HORIZONTAL" ) then + bar.healthSize = frame.healthBar:GetWidth() + bar.positionPoint = bar.reverseFill and "TOPRIGHT" or "TOPLEFT" + bar.positionRelative = bar.reverseFill and "BOTTOMRIGHT" or "BOTTOMLEFT" else - frame.incHeal.healthSize = frame.healthBar:GetHeight() - frame.incHeal.positionPoint = frame.incHeal.reverseFill and "TOPLEFT" or "BOTTOMLEFT" - frame.incHeal.positionRelative = frame.incHeal.reverseFill and "TOPRIGHT" or "BOTTOMRIGHT" + bar.healthSize = frame.healthBar:GetHeight() + bar.positionPoint = bar.reverseFill and "TOPLEFT" or "BOTTOMLEFT" + bar.positionRelative = bar.reverseFill and "TOPRIGHT" or "BOTTOMRIGHT" end - frame.incHeal.positionMod = frame.incHeal.reverseFill and -1 or 1 - frame.incHeal.cappedSize = frame.incHeal.healthSize * (ShadowUF.db.profile.units[frame.unitType].incHeal.cap - 1) - frame.incHeal.maxSize = frame.incHeal.healthSize * ShadowUF.db.profile.units[frame.unitType].incHeal.cap + bar.positionMod = bar.reverseFill and -1 or 1 + bar.cappedSize = bar.healthSize * (ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap - 1) + bar.maxSize = bar.healthSize * ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap end end -function IncHeal:UpdateFrame(frame) - if( not frame.visibility.incHeal or not frame.visibility.healthBar ) then return end +function IncHeal:PositionBar(frame, incAmount) + local bar = frame[self.frameKey] + -- If incoming is <= 0 ir health is <= 0 we can hide it + if( incAmount <= 0 ) then + bar.total = nil + bar:Hide() + return + end - local healed = UnitGetIncomingHeals(frame.unit) or 0 local health = UnitHealth(frame.unit) - - if( health <= 0 or healed <= 0 ) then - frame.incHeal.total = nil - frame.incHeal.healed = nil - frame.incHeal:Hide() + if( health <= 0 ) then + bar.total = nil + bar:Hide() return end - frame.incHeal.healed = healed - frame.incHeal:Show() - + if( not bar.total ) then bar:Show() end + bar.total = incAmount + -- When the primary bar has an alpha of 100%, we can cheat and do incoming heals easily. Otherwise we need to do it a more complex way to keep it looking good - if( frame.incHeal.simple ) then - frame.incHeal.total = health + healed - frame.incHeal:SetMinMaxValues(0, UnitHealthMax(frame.unit) * ShadowUF.db.profile.units[frame.unitType].incHeal.cap) - frame.incHeal:SetValue(frame.incHeal.total) + if( bar.simple ) then + bar.total = health + incAmount + bar:SetMinMaxValues(0, UnitHealthMax(frame.unit) * ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap) + bar:SetValue(bar.total) else - local health, maxHealth = UnitHealth(frame.unit), UnitHealthMax(frame.unit) - local healthSize = frame.incHeal.healthSize * (maxHealth > 0 and health / maxHealth or 0) - local incSize = frame.incHeal.healthSize * (health > 0 and healed / health or 0) + local maxHealth = UnitHealthMax(frame.unit) + local healthSize = bar.healthSize * (maxHealth > 0 and health / maxHealth or 0) + local incSize = bar.healthSize * (health > 0 and incAmount / health or 0) - if( (healthSize + incSize) > frame.incHeal.maxSize ) then - incSize = frame.incHeal.cappedSize + if( (healthSize + incSize) > bar.maxSize ) then + incSize = bar.cappedSize end - if( frame.incHeal.orientation == "HORIZONTAL" ) then - frame.incHeal:SetWidth(incSize) - frame.incHeal:SetPoint(frame.incHeal.positionPoint, frame.healthBar, frame.incHeal.positionMod * healthSize, 0) - frame.incHeal:SetPoint(frame.incHeal.positionRelative, frame.healthBar, frame.incHeal.positionMod * healthSize, 0) + if( bar.orientation == "HORIZONTAL" ) then + bar:SetWidth(incSize) + bar:SetPoint(bar.positionPoint, frame.healthBar, bar.positionMod * healthSize, 0) + bar:SetPoint(bar.positionRelative, frame.healthBar, bar.positionMod * healthSize, 0) else - frame.incHeal:SetHeight(incSize) - frame.incHeal:SetPoint(frame.incHeal.positionPoint, frame.healthBar, 0, frame.incHeal.positionMod * healthSize) - frame.incHeal:SetPoint(frame.incHeal.positionRelative, frame.healthBar, 0, frame.incHeal.positionMod * healthSize) + bar:SetHeight(incSize) + bar:SetPoint(bar.positionPoint, frame.healthBar, 0, bar.positionMod * healthSize) + bar:SetPoint(bar.positionRelative, frame.healthBar, 0, bar.positionMod * healthSize) end end end + +function IncHeal:UpdateFrame(frame) + if( not frame.visibility[self.frameKey] or not frame.visibility.healthBar ) then return end + self:PositionBar(frame, UnitGetIncomingHeals(frame.unit) or 0) +end From 3f54a7ca910767017381abc955759698ecb6a8ca Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 4 Mar 2013 18:43:41 -0800 Subject: [PATCH 394/794] Release the temporary variables the mover is disabled to GC --- modules/movers.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/movers.lua b/modules/movers.lua index 6e2bfd17..789e99ca 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -56,7 +56,10 @@ local function createConfigEnv() return getValue("UnitPower", unit, math.random(20000, 50000)) end, UnitGetIncomingHeals = function(unit) - return getValue("UnitGetIncomingHeals", unit, math.random(5000, 10000)) + return getValue("UnitGetIncomingHeals", unit, math.random(10000, 15000)) + end, + UnitGetTotalAbsorbs = function(unit) + return getValue("UnitGetTotalAbsorbs", unit, math.random(2500, 5000)) end, UnitPowerMax = function(unit, powerType) if( powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS ) then @@ -360,6 +363,9 @@ function Movers:Disable() ShadowUF.Units:CheckPlayerZone(true) ShadowUF.Layout:Reload() + -- Don't store these so everything can be GCed + unitConfig = {} + if( self.infoFrame ) then self.infoFrame:Hide() end From 464b5c61ada24d5ec0f70fedc3a67e22d507be97 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 4 Mar 2013 18:44:25 -0800 Subject: [PATCH 395/794] Added incoming absorbs to UFs, shown in front of incoming heals and can be capped like incoming heals --- ShadowedUnitFrames.lua | 17 ++++++++++-- ShadowedUnitFrames.toc | 1 + modules/defaultlayout.lua | 5 ++++ modules/incabsorb.lua | 37 +++++++++++++++++++++++++++ options/config.lua | 54 +++++++++++++++++++++++++++++++++------ 5 files changed, 104 insertions(+), 10 deletions(-) create mode 100755 modules/incabsorb.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 7b35a719..570750e1 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -6,7 +6,7 @@ ShadowUF = select(2, ...) ShadowUF.is502 = select(4, GetBuildInfo()) >= 50200 local L = ShadowUF.L -ShadowUF.dbRevision = 31 +ShadowUF.dbRevision = 32 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -102,6 +102,18 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 31 ) then + self.db.profile.healthColors.incAbsorb = {r = 0.93, g = 0.75, b = 0.09} + + for unit, config in pairs(self.db.profile.units) do + if( config.incHeal ) then + config.incHeal.enabled = config.incHeal.heals + config.incHeal.heals = nil + config.incAbsorb = {enabled = config.incHeal.enabled} + end + end + end + if( revision <= 30 ) then self.db.profile.powerColors.RUNEOFPOWER = {r = 0.35, g = 0.45, b = 0.60} end @@ -339,7 +351,8 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units[unit].combatText = {enabled = true, anchorTo = "$parent", anchorPoint = "C", x = 0, y = 0} if( unit ~= "battleground" and unit ~= "battlegroundpet" and unit ~= "arena" and unit ~= "arenapet" ) then - self.defaults.profile.units[unit].incHeal = {enabled = true, cap = 1.30} + self.defaults.profile.units[unit].incHeal = {enabled = true, cap = 1.20} + self.defaults.profile.units[unit].incAbsorb = {enabled = true, cap = 1.30} end end diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 61bc5479..7f089f47 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -43,6 +43,7 @@ modules\runes.lua modules\fader.lua modules\combopoints.lua modules\incheal.lua +modules\incabsorb.lua modules\range.lua modules\empty.lua modules\druid.lua diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 139fa5f0..834aef9e 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -173,6 +173,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) static = {r = 0.70, g = 0.20, b = 0.90}, yellow = {r = 0.93, g = 0.93, b = 0.0}, inc = {r = 0, g = 0.35, b = 0.23}, + incAbsorb = {r = 0.93, g = 0.75, b = 0.09}, enemyUnattack = {r = 0.60, g = 0.20, b = 0.20}, hostile = {r = 0.90, g = 0.0, b = 0.0}, aggro = {r = 0.90, g = 0.0, b = 0.0}, @@ -273,6 +274,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) healthBar = {reactionType = "none"}, powerBar = {height = 0.30}, incHeal = {cap = 1}, + incAbsorb = {cap = 1}, indicators = { pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, masterLoot = {anchorTo = "$parent", anchorPoint = "TR", size = 12, x = -2, y = -10}, @@ -302,6 +304,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) healthBar = {reactionType = "none"}, powerBar = {height = 0.30}, incHeal = {cap = 1}, + incAbsorb = {cap = 1}, indicators = { pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, masterLoot = {anchorTo = "$parent", anchorPoint = "TR", size = 12, x = -2, y = -10}, @@ -535,6 +538,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) maxColumns = 1, columnSpacing = 5, incHeal = {cap = 1}, + incAbsorb = {cap = 1}, portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, indicators = { @@ -579,6 +583,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) maxColumns = 1, columnSpacing = 5, incHeal = {cap = 1}, + incAbsorb = {cap = 1}, portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, indicators = { diff --git a/modules/incabsorb.lua b/modules/incabsorb.lua new file mode 100755 index 00000000..d3a8676f --- /dev/null +++ b/modules/incabsorb.lua @@ -0,0 +1,37 @@ +if( not ShadowUF.is502 ) then return end +local IncAbsorb = setmetatable({["frameKey"] = "incAbsorb", ["colorKey"] = "incAbsorb", ["frameLevelMod"] = 2}, {__index = ShadowUF.IncHeal}) +ShadowUF:RegisterModule(IncAbsorb, "incAbsorb", ShadowUF.L["Incoming absorbs"]) + +function IncAbsorb:OnEnable(frame) + frame.incAbsorb = frame.incAbsorb or ShadowUF.Units:CreateBar(frame) + + frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_ABSORB_AMOUNT_CHANGED", self, "UpdateFrame") + + frame:RegisterUpdateFunc(self, "UpdateFrame") +end + +function IncAbsorb:OnLayoutApplied(frame) + if( not frame.visibility[self.frameKey] or not frame.visibility.healthBar ) then return end + + if( frame.visibility.incHeal ) then + frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") + else + frame:UnregisterSingleEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") + end + + ShadowUF.IncHeal.OnLayoutApplied(self, frame) +end + +function IncAbsorb:UpdateFrame(frame) + if( not frame.visibility[self.frameKey] or not frame.visibility.healthBar ) then return end + + local amount = UnitGetTotalAbsorbs(frame.unit) or 0 + -- Obviously we only want to add incoming heals if we have something being absorbed + if( amount > 0 and frame.visibility.incHeal ) then + amount = amount + (UnitGetIncomingHeals(frame.unit) or 0) + end + + self:PositionBar(frame, amount) +end \ No newline at end of file diff --git a/options/config.lua b/options/config.lua index 87359ad6..aae95359 100755 --- a/options/config.lua +++ b/options/config.lua @@ -218,7 +218,7 @@ local function setVariable(unit, moduleKey, moduleSubKey, key, value) end local function specialRestricted(unit, moduleKey, moduleSubKey, key) - if( ShadowUF.fakeUnits[unit] and ( key == "colorAggro" or key == "aggro" or moduleKey == "incHeal" or moduleKey == "castBar" ) ) then + if( ShadowUF.fakeUnits[unit] and ( key == "colorAggro" or key == "aggro" or moduleKey == "incHeal" or moduleKey == "incAbsorb" or moduleKey == "castBar" ) ) then return true elseif( moduleKey == "healthBar" and unit == "player" and key == "reaction" ) then return true @@ -295,10 +295,10 @@ local function hideRestrictedOption(info) local key = info[#(info)] if( ShadowUF.modules[key] and ShadowUF.modules[key].moduleClass and ShadowUF.modules[key].moduleClass ~= playerClass ) then return true - elseif( key == "incHeal" and not ShadowUF.modules.incHeal ) then + elseif( ( key == "incHeal" and not ShadowUF.modules.incHeal ) or ( key == "incAbsorb" and not ShadowUF.modules.incAbsorb ) ) then return true -- Non-standard units do not support color by aggro or incoming heal - elseif( key == "colorAggro" or key == "incHeal" or key == "aggro" ) then + elseif( key == "colorAggro" or key == "incHeal" or key == "incAbsorb" or key == "aggro" ) then return string.match(unit, "%w+target" ) -- Fall back for indicators, no variable table so it shouldn't be shown elseif( info[#(info) - 1] == "indicators" ) then @@ -575,7 +575,7 @@ local function loadGeneralOptions() -- Strip module settings that aren't with SUF by default if( not layoutData.modules ) then - local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true, ["demonicFuryBar"] = true, ["burningEmbersBar"] = true, ["chi"] = true, ["shadowOrbs"] = true, ["auraPoints"] = true} + local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incAbsorb"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true, ["demonicFuryBar"] = true, ["burningEmbersBar"] = true, ["chi"] = true, ["shadowOrbs"] = true, ["auraPoints"] = true} for _, unitData in pairs(layout.units) do for key, data in pairs(unitData) do if( type(data) == "table" and not validModules[key] and ShadowUF.modules[key] ) then @@ -1036,12 +1036,19 @@ local function loadGeneralOptions() order = 8, type = "color", name = L["Incoming heal"], - desc = L["Health bar color to use to show how much healing someone is about to receive."], + desc = L["Bar color to use to show how much healing someone is about to receive."], arg = "healthColors.inc", }, - enemyUnattack = { + incAbsorb = { order = 9, type = "color", + name = L["Incoming absorb"], + desc = L["Color to use to show how much damage will be absorbed."], + arg = "healthColors.incAbsorb", + }, + enemyUnattack = { + order = 10, + type = "color", name = L["Unattackable hostile"], desc = L["Health bar color to use for hostile units who you cannot attack, used for reaction coloring."], hidden = hideAdvancedOption, @@ -3935,11 +3942,11 @@ local function loadUnitOptions() type = "toggle", name = L["Show incoming heals"], desc = L["Adds a bar inside the health bar indicating how much healing someone will receive."], - arg = "incHeal.heals", + arg = "incHeal.enabled", hidden = false, set = function(info, value) setUnit(info, value) - setDirectUnit(info[2], "incHeal", nil, "enabled", getVariable(info[2], "incHeal", nil, "heals")) + setDirectUnit(info[2], "incHeal", nil, "enabled", getVariable(info[2], "incHeal", nil, "enabled")) end }, cap = { @@ -3953,6 +3960,37 @@ local function loadUnitOptions() }, }, }, + incAbsorb = { + order = 3.5, + type = "group", + inline = true, + name = L["Incoming absorbs"], + hidden = function(info) return ShadowUF.Units.zoneUnits[info[2]] or hideRestrictedOption(info) end, + disabled = function(info) return not getVariable(info[2], "healthBar", nil, "enabled") end, + args = { + heals = { + order = 1, + type = "toggle", + name = L["Show incoming absorbs"], + desc = L["Adds a bar inside the health bar indicating how much damage will be absorbed."], + arg = "incAbsorb.enabled", + hidden = false, + set = function(info, value) + setUnit(info, value) + setDirectUnit(info[2], "incAbsorb", nil, "enabled", getVariable(info[2], "incAbsorb", nil, "enabled")) + end + }, + cap = { + order = 3, + type = "range", + name = L["Outside bar limit"], + desc = L["Percentage value of how far outside the unit frame the incoming absorb bar can go. 130% means it will go 30% outside the frame, 100% means it will not go outside."], + min = 1, max = 1.50, step = 0.05, isPercent = true, + arg = "incAbsorb.cap", + hidden = false, + }, + }, + }, emptyBar = { order = 4, type = "group", From dabb16a08fea49eeec31a9a84cd9040644563dbb Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 5 Mar 2013 15:51:33 -0800 Subject: [PATCH 396/794] Fixed Rune of Power description --- options/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index aae95359..f2b9bc98 100755 --- a/options/config.lua +++ b/options/config.lua @@ -3852,7 +3852,7 @@ local function loadUnitOptions() type = "toggle", name = string.format(L["Enable %s"], ShadowUF.modules.totemBar.moduleName), desc = function(info) - return select(2, UnitClass("player")) == "SHAMAN" and L["Adds totem bars with timers before they expire to the player frame."] or select(2, UnitClass("player")) == "DEATHKNIGHT" and L["Adds a bar indicating how much time is left on your ghoul timer, only used if you do not have a permanent ghoul."] or L["Adds a bar indicating how much time is left on your mushrooms."] + return select(2, UnitClass("player")) == "SHAMAN" and L["Adds totem bars with timers before they expire to the player frame."] or select(2, UnitClass("player")) == "DEATHKNIGHT" and L["Adds a bar indicating how much time is left on your ghoul timer, only used if you do not have a permanent ghoul."] or select(2, UnitClass("player")) == "MAGE" and L["Adds a bar indicating how much time is left on your Rune of Power."] or L["Adds a bar indicating how much time is left on your mushrooms."] end, hidden = hideRestrictedOption, arg = "totemBar.enabled", From 70f06cc80515407e4ec9d082cd5d1d8f1a520700 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 5 Mar 2013 15:52:17 -0800 Subject: [PATCH 397/794] Make sure a cap is set for absorb configuration --- ShadowedUnitFrames.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 570750e1..762f7d96 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -102,6 +102,14 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 32 ) then + for unit, config in pairs(self.db.profile.units) do + if( config.incAbsorb and not config.incAbsorb.cap ) then + config.incAbsorb.cap = 1.30 + end + end + end + if( revision <= 31 ) then self.db.profile.healthColors.incAbsorb = {r = 0.93, g = 0.75, b = 0.09} From abd391e99bd8b5a5206a6f870b16406c602ef4ec Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 5 Mar 2013 16:17:10 -0800 Subject: [PATCH 398/794] Make sure incHeal/incAbsorb are only set on relevant units --- ShadowedUnitFrames.lua | 24 ++++++++++++++++++++++-- modules/defaultlayout.lua | 6 ++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 762f7d96..6c4c4630 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -6,7 +6,7 @@ ShadowUF = select(2, ...) ShadowUF.is502 = select(4, GetBuildInfo()) >= 50200 local L = ShadowUF.L -ShadowUF.dbRevision = 32 +ShadowUF.dbRevision = 33 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -102,6 +102,26 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 33 ) then + for unit, config in pairs(self.db.profile.units) do + if( not self.defaults.profile.units[unit].incHeal and config.incHeal ) then + config.incHeal = nil + end + + if( not self.defaults.profile.units[unit].incAbsorb and config.incAbsorb ) then + config.incAbsorb = nil + end + + if( config.incAbsorb ) then + config.incAbsorb.cap = config.incAbsorb.cap or 1.30 + end + + if( config.incHeal ) then + config.incHeal.cap = config.incHeal.cap or 1.30 + end + end + end + if( revision <= 32 ) then for unit, config in pairs(self.db.profile.units) do if( config.incAbsorb and not config.incAbsorb.cap ) then @@ -358,7 +378,7 @@ function ShadowUF:LoadUnitDefaults() if( not self.fakeUnits[unit] ) then self.defaults.profile.units[unit].combatText = {enabled = true, anchorTo = "$parent", anchorPoint = "C", x = 0, y = 0} - if( unit ~= "battleground" and unit ~= "battlegroundpet" and unit ~= "arena" and unit ~= "arenapet" ) then + if( unit ~= "battleground" and unit ~= "battlegroundpet" and unit ~= "arena" and unit ~= "arenapet" and unit ~= "boss" ) then self.defaults.profile.units[unit].incHeal = {enabled = true, cap = 1.20} self.defaults.profile.units[unit].incAbsorb = {enabled = true, cap = 1.30} end diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 834aef9e..8481bf44 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -338,6 +338,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, shadowOrbs = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, + incHeal = {cap = 1}, + incAbsorb = {cap = 1}, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, }, @@ -366,6 +368,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) portrait = {enabled = true, fullAfter = 50}, castBar = {order = 60}, offset = 23, + incHeal = {cap = 1}, + incAbsorb = {cap = 1}, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, phase = {enabled = true, anchorPoint = "RC", size = 26, x = -17, y = 0, anchorTo = "$parent"} @@ -651,6 +655,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) height = 45, scale = 1.0, portrait = {enabled = true, alignment = "RIGHT", fullAfter = 50}, + incHeal = {cap = 1}, + incAbsorb = {cap = 1}, castBar = {order = 60}, comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, indicators = { From f5d5e838eba1098fcf1e30b1df4b42e987857099 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 5 Mar 2013 16:17:52 -0800 Subject: [PATCH 399/794] Removed the ShadowedUF_Bars deprecation warning --- ShadowedUnitFrames.lua | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 6c4c4630..e7f5e1ee 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -535,13 +535,6 @@ end -- Module APIs function ShadowUF:RegisterModule(module, key, name, isBar, class, spec, level) - -- September 17th, 2012 - if( key == "impbars" ) then - ShadowUF:Print("WARNING: ShadowedUF_Bars is no longer supported and is now built in under advanced options.") - DisableAddOn("ShadowedUF_Bars") - return - end - self.modules[key] = module module.moduleKey = key From acc591ee4477cc8dff90fdfd0547c4ddd59cc8ed Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 5 Mar 2013 16:24:39 -0800 Subject: [PATCH 400/794] Scenarios are considered a party for the purposes of zone checks --- ShadowedUnitFrames.lua | 2 ++ modules/auras.lua | 2 ++ modules/units.lua | 3 +++ 3 files changed, 7 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index e7f5e1ee..6da0be6b 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -319,6 +319,8 @@ end function ShadowUF:LoadUnits() -- CanHearthAndResurrectFromArea() returns true for world pvp areas, according to BattlefieldFrame.lua local instanceType = CanHearthAndResurrectFromArea() and "pvp" or select(2, IsInInstance()) + if( instanceType == "scenario" ) then instanceType = "party" end + if( not instanceType ) then instanceType = "none" end for _, type in pairs(self.unitList) do diff --git a/modules/auras.lua b/modules/auras.lua index 1534d925..949ffc3f 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -481,6 +481,8 @@ end local filterDefault = {} function Auras:UpdateFilter(frame) local zone = select(2, IsInInstance()) or "none" + if( zone == "scenario" ) then zone = "party" end + local id = zone .. frame.unitType local white = ShadowUF.db.profile.filters.zonewhite[zone .. frame.unitType] diff --git a/modules/units.lua b/modules/units.lua index af9c2c69..bafeeb93 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -246,6 +246,7 @@ local function SetVisibility(self) local layoutUpdate local instanceType = select(2, IsInInstance()) or "none" local playerSpec = GetSpecialization() + if( instanceType == "scenario" ) then instanceType = "party" end -- Selectively disable modules for _, module in pairs(ShadowUF.moduleOrder) do @@ -1344,6 +1345,8 @@ function Units:CheckPlayerZone(force) -- CanHearthAndResurrectFromArea() returns true for world pvp areas, according to BattlefieldFrame.lua local instance = CanHearthAndResurrectFromArea() and "pvp" or select(2, IsInInstance()) or "none" + if( instance == "scenario" ) then instance = "party" end + if( instance == instanceType and not force ) then return end instanceType = instance From 6be32e3db16741aeda5aeda52db90d220738dd1b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 6 Mar 2013 07:05:33 -0800 Subject: [PATCH 401/794] Added default checks in incheal for cap for people who have bad configurations --- modules/incheal.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index 988f6f86..53a77844 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -32,6 +32,8 @@ function IncHeal:OnLayoutApplied(frame) bar:SetReverseFill(frame.healthBar:GetReverseFill()) bar:Hide() + local cap = ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap or 1.30 + -- When we can cheat and put the incoming bar right behind the health bar, we can efficiently show the incoming heal bar -- if the main bar has a transparency set, then we need a more complicated method to stop the health bar from being darker with incoming heals up if( ( ShadowUF.db.profile.units[frame.unitType].healthBar.invert and ShadowUF.db.profile.bars.backgroundAlpha == 0 ) or ( not ShadowUF.db.profile.units[frame.unitType].healthBar.invert and ShadowUF.db.profile.bars.alpha == 1 ) ) then @@ -39,9 +41,9 @@ function IncHeal:OnLayoutApplied(frame) bar:SetFrameLevel(frame.topFrameLevel - 1 - self.frameLevelMod) if( bar:GetOrientation() == "HORIZONTAL" ) then - bar:SetWidth(frame.healthBar:GetWidth() * ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap) + bar:SetWidth(frame.healthBar:GetWidth() * cap) else - bar:SetHeight(frame.healthBar:GetHeight() * ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap) + bar:SetHeight(frame.healthBar:GetHeight() * cap) end bar:ClearAllPoints() @@ -71,8 +73,8 @@ function IncHeal:OnLayoutApplied(frame) end bar.positionMod = bar.reverseFill and -1 or 1 - bar.cappedSize = bar.healthSize * (ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap - 1) - bar.maxSize = bar.healthSize * ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap + bar.cappedSize = bar.healthSize * (cap - 1) + bar.maxSize = bar.healthSize * cap end end @@ -98,7 +100,7 @@ function IncHeal:PositionBar(frame, incAmount) -- When the primary bar has an alpha of 100%, we can cheat and do incoming heals easily. Otherwise we need to do it a more complex way to keep it looking good if( bar.simple ) then bar.total = health + incAmount - bar:SetMinMaxValues(0, UnitHealthMax(frame.unit) * ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap) + bar:SetMinMaxValues(0, UnitHealthMax(frame.unit) * (ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap or 1.30)) bar:SetValue(bar.total) else local maxHealth = UnitHealthMax(frame.unit) From f87abff0797dda7c5b68059527e5a98fba6e1f63 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 7 Mar 2013 08:54:38 -0800 Subject: [PATCH 402/794] Added support for Brewmaster Monks Stagger --- ShadowedUnitFrames.lua | 10 +++++++- ShadowedUnitFrames.toc | 1 + modules/defaultlayout.lua | 4 +++ modules/monkstagger.lua | 54 +++++++++++++++++++++++++++++++++++++++ options/config.lua | 44 +++++++++++++++++++++++++++++-- 5 files changed, 110 insertions(+), 3 deletions(-) create mode 100755 modules/monkstagger.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 6da0be6b..5ca12bb5 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -6,7 +6,7 @@ ShadowUF = select(2, ...) ShadowUF.is502 = select(4, GetBuildInfo()) >= 50200 local L = ShadowUF.L -ShadowUF.dbRevision = 33 +ShadowUF.dbRevision = 34 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -102,6 +102,13 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 34 ) then + self.db.profile.units.player.staggerBar = {enabled = true, background = false, height = 0.30, order = 70} + self.db.profile.powerColors.STAGGER_GREEN = {r = 0.52, g = 1.0, b = 0.52} + self.db.profile.powerColors.STAGGER_YELLOW = {r = 1.0, g = 0.98, b = 0.72} + self.db.profile.powerColors.STAGGER_RED = {r = 1.0, g = 0.42, b = 0.42} + end + if( revision <= 33 ) then for unit, config in pairs(self.db.profile.units) do if( not self.defaults.profile.units[unit].incHeal and config.incHeal ) then @@ -426,6 +433,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.xpBar = {enabled = false} self.defaults.profile.units.player.fader = {enabled = false} self.defaults.profile.units.player.soulShards = {enabled = true, isBar = true} + self.defaults.profile.units.player.staggerBar = {enabled = true} self.defaults.profile.units.player.demonicFuryBar = {enabled = true} self.defaults.profile.units.player.burningEmbersBar = {enabled = true} self.defaults.profile.units.player.eclipseBar = {enabled = true} diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 7f089f47..bd696932 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -56,6 +56,7 @@ modules\burningembers.lua modules\altpower.lua modules\shadoworbs.lua modules\monk.lua +modules\monkstagger.lua modules\aurapoints.lua #@do-not-package@ options\config.lua diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 8481bf44..ce9a25bd 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -165,6 +165,9 @@ function ShadowUF:LoadDefaultLayout(useMerge) MUSHROOMS = {r = 0.20, g = 0.90, b = 0.20}, POWER_TYPE_FEL_ENERGY = {r = 0.878, g = 0.980, b = 0}, AURAPOINTS = {r = 1.0, g = 0.80, b = 0.0}, + STAGGER_GREEN = {r = 0.52, g = 1.0, b = 0.52}, + STAGGER_YELLOW = {r = 1.0, g = 0.98, b = 0.72}, + STAGGER_RED = {r = 1.0, g = 0.42, b = 0.42} } config.healthColors = { tapped = {r = 0.5, g = 0.5, b = 0.5}, @@ -334,6 +337,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) auraPoints = {enabled = false, showAlways = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, demonicFuryBar = {enabled = true, background = false, height = 0.50, order = 70}, burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70}, + staggerBar = {enabled = true, background = false, height = 0.30, order = 70}, soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, diff --git a/modules/monkstagger.lua b/modules/monkstagger.lua new file mode 100755 index 00000000..436f748b --- /dev/null +++ b/modules/monkstagger.lua @@ -0,0 +1,54 @@ +local Stagger = {} +ShadowUF:RegisterModule(Stagger, "staggerBar", ShadowUF.L["Stagger bar"], true, "MONK", SPEC_MONK_BREWMASTER) + +function Stagger:OnEnable(frame) + frame.staggerBar = frame.staggerBar or ShadowUF.Units:CreateBar(frame) + frame.staggerBar.timeElapsed = 0 + frame.staggerBar:SetScript("OnUpdate", function(self, elapsed) + self.timeElapsed = self.timeElapsed + elapsed + if( self.timeElapsed < 0.50 ) then return end + self.timeElapsed = self.timeElapsed - 0.50 + + Stagger:Update(self) + end) + + frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateMinMax") + frame:RegisterUpdateFunc(self, "UpdateMinMax") +end + +function Stagger:OnDisable(frame) + frame:UnregisterAll(self) +end + +function Stagger:OnLayoutApplied(frame) + frame.staggerBar.colorState = nil +end + +function Stagger:UpdateMinMax(frame) + frame.staggerBar.maxHealth = UnitHealthMax(frame.unit) + frame.staggerBar:SetMinMaxValues(0, frame.staggerBar.maxHealth) + + self:Update(frame) +end + +function Stagger:Update(frame) + local stagger = UnitStagger(frame.unit) + if( not stagger ) then return end + + -- Figure out how screwed they are + local percent = stagger / frame.staggerBar.maxHealth + local state + if( percent < STAGGER_YELLOW_TRANSITION ) then + state = "STAGGER_GREEN" + elseif( percent < STAGGER_RED_TRANSITION ) then + state = "STAGGER_YELLOW" + else + state = "STAGGER_RED" + end + + if( state ~= frame.staggerBar.colorState ) then + frame:SetBarColor("staggerBar", ShadowUF.db.profile.powerColors[state]) + end + + frame.staggerBar:SetValue(stagger) +end \ No newline at end of file diff --git a/options/config.lua b/options/config.lua index f2b9bc98..c46c9587 100755 --- a/options/config.lua +++ b/options/config.lua @@ -575,7 +575,7 @@ local function loadGeneralOptions() -- Strip module settings that aren't with SUF by default if( not layoutData.modules ) then - local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incAbsorb"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true, ["demonicFuryBar"] = true, ["burningEmbersBar"] = true, ["chi"] = true, ["shadowOrbs"] = true, ["auraPoints"] = true} + local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incAbsorb"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true, ["demonicFuryBar"] = true, ["burningEmbersBar"] = true, ["chi"] = true, ["shadowOrbs"] = true, ["auraPoints"] = true, ["staggerBar"] = true} for _, unitData in pairs(layout.units) do for key, data in pairs(unitData) do if( type(data) == "table" and not validModules[key] and ShadowUF.modules[key] ) then @@ -1056,6 +1056,38 @@ local function loadGeneralOptions() } }, }, + stagger = { + order = 1.5, + type = "group", + inline = true, + name = L["Stagger"], + set = setColor, + get = getColor, + hidden = function() return select(2, UnitClass("player")) ~= "MONK" end, + args = { + STAGGER_GREEN = { + order = 0, + type = "color", + name = L["Green (<30% HP)"], + desc = L["Stagger bar color when the staggered amount is <30% of your HP."], + arg = "powerColors.STAGGER_GREEN" + }, + STAGGER_GREEN = { + order = 1, + type = "color", + name = L["Yellow (>30% HP)"], + desc = L["Stagger bar color when the staggered amount is >30% of your HP."], + arg = "powerColors.STAGGER_YELLOW" + }, + STAGGER_RED = { + order = 2, + type = "color", + name = L["Red (>70% HP)"], + desc = L["Stagger bar color when the staggered amount is >70% of your HP."], + arg = "powerColors.STAGGER_RED" + } + } + }, power = { order = 2, type = "group", @@ -3809,7 +3841,7 @@ local function loadUnitOptions() hidden = function(info) local unit = info[2] if( unit == "global" ) then - return not globalConfig.runeBar and not globalConfig.eclipseBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.monkBar and not globalConfig.xpBar and not globalConfig.demonicFuryBar and not globalConfig.burningEmbersBar + return not globalConfig.runeBar and not globalConfig.eclipseBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.monkBar and not globalConfig.xpBar and not globalConfig.demonicFuryBar and not globalConfig.burningEmbersBar and not globalConfig.staggerBar else return unit ~= "player" and unit ~= "pet" end @@ -3839,6 +3871,14 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "demonicFuryBar.enabled", }, + staggerBar = { + order = 1.25, + type = "toggle", + name = string.format(L["Enable %s"], L["Stagger bar"]), + desc = L["Adds a Stagger bar for Brewmaster Monks."], + hidden = hideRestrictedOption, + arg = "staggerBar.enabled", + }, burningEmbersBar = { order = 1.25, type = "toggle", From d0525f82ca9baa85dfae6d9f8395bae99e45caa0 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 7 Mar 2013 09:19:26 -0800 Subject: [PATCH 403/794] Stagger bar actually works now --- ShadowedUnitFrames.lua | 2 +- modules/defaultlayout.lua | 2 +- modules/monkstagger.lua | 12 ++++++------ modules/movers.lua | 4 ++++ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 5ca12bb5..c80dfe76 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -103,7 +103,7 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision if( revision <= 34 ) then - self.db.profile.units.player.staggerBar = {enabled = true, background = false, height = 0.30, order = 70} + self.db.profile.units.player.staggerBar = {enabled = true, background = true, height = 0.30, order = 70} self.db.profile.powerColors.STAGGER_GREEN = {r = 0.52, g = 1.0, b = 0.52} self.db.profile.powerColors.STAGGER_YELLOW = {r = 1.0, g = 0.98, b = 0.72} self.db.profile.powerColors.STAGGER_RED = {r = 1.0, g = 0.42, b = 0.42} diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index ce9a25bd..32954759 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -337,7 +337,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) auraPoints = {enabled = false, showAlways = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, demonicFuryBar = {enabled = true, background = false, height = 0.50, order = 70}, burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70}, - staggerBar = {enabled = true, background = false, height = 0.30, order = 70}, + staggerBar = {enabled = true, background = true, height = 0.30, order = 70}, soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, diff --git a/modules/monkstagger.lua b/modules/monkstagger.lua index 436f748b..4084186a 100755 --- a/modules/monkstagger.lua +++ b/modules/monkstagger.lua @@ -4,12 +4,13 @@ ShadowUF:RegisterModule(Stagger, "staggerBar", ShadowUF.L["Stagger bar"], true, function Stagger:OnEnable(frame) frame.staggerBar = frame.staggerBar or ShadowUF.Units:CreateBar(frame) frame.staggerBar.timeElapsed = 0 + frame.staggerBar.parent = frame frame.staggerBar:SetScript("OnUpdate", function(self, elapsed) self.timeElapsed = self.timeElapsed + elapsed if( self.timeElapsed < 0.50 ) then return end self.timeElapsed = self.timeElapsed - 0.50 - Stagger:Update(self) + Stagger:Update(self.parent) end) frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateMinMax") @@ -21,7 +22,9 @@ function Stagger:OnDisable(frame) end function Stagger:OnLayoutApplied(frame) - frame.staggerBar.colorState = nil + if( frame.staggerBar ) then + frame.staggerBar.colorState = nil + end end function Stagger:UpdateMinMax(frame) @@ -46,9 +49,6 @@ function Stagger:Update(frame) state = "STAGGER_RED" end - if( state ~= frame.staggerBar.colorState ) then - frame:SetBarColor("staggerBar", ShadowUF.db.profile.powerColors[state]) - end - + frame:SetBarColor("staggerBar", ShadowUF.db.profile.powerColors[state].r, ShadowUF.db.profile.powerColors[state].g, ShadowUF.db.profile.powerColors[state].b) frame.staggerBar:SetValue(stagger) end \ No newline at end of file diff --git a/modules/movers.lua b/modules/movers.lua index 789e99ca..ab623402 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -128,6 +128,10 @@ local function createConfigEnv() return powerType, powerType == 0 and "MANA" or powerType == 1 and "RAGE" or powerType == 2 and "FOCUS" or powerType == 3 and "ENERGY" or powerType == 6 and "RUNIC_POWER" end, + UnitStagger = function(unit) + if( unit ~= "player" ) then return nil end + return getValue("UnitStagger", math.random(2000, 10000)) + end, UnitAura = function(unit, id, filter) if( type(id) ~= "number" or id > 40 ) then return end From 692c488f8b3b13534f1e3c31f97de2b23c022fd8 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 7 Mar 2013 09:21:51 -0800 Subject: [PATCH 404/794] Strip 5.2.0 checks, assuming 5.2.0 now --- ShadowedUnitFrames.lua | 15 --------------- modules/incabsorb.lua | 1 - modules/units.lua | 26 +------------------------- options/config.lua | 2 +- 4 files changed, 2 insertions(+), 42 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index c80dfe76..37e93705 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -3,7 +3,6 @@ ]] ShadowUF = select(2, ...) -ShadowUF.is502 = select(4, GetBuildInfo()) >= 50200 local L = ShadowUF.L ShadowUF.dbRevision = 34 @@ -752,20 +751,6 @@ function ShadowUF:HideBlizzardFrames() QueueStatusFrame:SetFrameStrata("TOOLTIP") end - -- Don't modify the raid menu because that will taint the MA/MT stuff and it'll break and that's bad - if( not active_hiddens.popup and not self.is502 ) then - active_hiddens.popup = true - for key, list in pairs(UnitPopupMenus) do - if( key ~= "RAID" ) then - for i=#(list), 1, -1 do - if( list[i] == "SET_FOCUS" or list[i] == "CLEAR_FOCUS" or list[i] == "LOCK_FOCUS_FRAME" or list[i] == "UNLOCK_FOCUS_FRAME" ) then - table.remove(list, i) - end - end - end - end - end - -- As a reload is required to reset the hidden hooks, we can just set this to true if anything is true for type, flag in pairs(self.db.profile.hidden) do if( flag ) then diff --git a/modules/incabsorb.lua b/modules/incabsorb.lua index d3a8676f..80a2d31c 100755 --- a/modules/incabsorb.lua +++ b/modules/incabsorb.lua @@ -1,4 +1,3 @@ -if( not ShadowUF.is502 ) then return end local IncAbsorb = setmetatable({["frameKey"] = "incAbsorb", ["colorKey"] = "incAbsorb", ["frameLevelMod"] = 2}, {__index = ShadowUF.IncHeal}) ShadowUF:RegisterModule(IncAbsorb, "incAbsorb", ShadowUF.L["Incoming absorbs"]) diff --git a/modules/units.lua b/modules/units.lua index bafeeb93..64cb8c93 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -610,9 +610,6 @@ OnAttributeChanged = function(self, name, unit) self:RegisterNormalEvent("UNIT_TARGET", Units, "CheckPetUnitUpdated") end - if( not ShadowUF.is502 ) then - self.menu = ShowMenu - end self:SetVisibility() Units:CheckUnitStatus(self) end @@ -645,10 +642,6 @@ local secureInitializeUnit = [[ end ]] -if( not ShadowUF.is502 ) then - secureInitializeUnit = string.gsub(secureInitializeUnit, "togglemenu", "menu") -end - local unitButtonTemplate = ClickCastHeader and "ClickCastUnitTemplate,SecureUnitButtonTemplate" or "SecureUnitButtonTemplate" -- Header unit initialized @@ -680,20 +673,6 @@ local function SUF_OnEnter(self) end end --- Reset the fact that we clamped the dropdown to the screen to be safe -DropDownList1:HookScript("OnHide", function(self) - self:SetClampedToScreen(false) -end) - --- Reposition the dropdown -local function PostClick(self) - if( UIDROPDOWNMENU_OPEN_MENU and DropDownList1:IsShown() ) then - DropDownList1:ClearAllPoints() - DropDownList1:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, 0) - DropDownList1:SetClampedToScreen(true) - end -end - -- Create the generic things that we want in every secure frame regardless if it's a button or a header function Units:CreateUnit(...) local frame = select("#", ...) > 1 and CreateFrame(...) or select(1, ...) @@ -727,9 +706,6 @@ function Units:CreateUnit(...) frame:HookScript("OnLeave", OnLeave) frame:SetScript("OnShow", OnShow) frame:SetScript("OnHide", OnHide) - if( not ShadowUF.is502 ) then - frame:SetScript("PostClick", PostClick) - end frame.OnEnter = SUF_OnEnter frame.OnLeave = UnitFrame_OnLeave @@ -738,7 +714,7 @@ function Units:CreateUnit(...) -- non-header frames don't set those, so we need to do it if( not InCombatLockdown() ) then frame:SetAttribute("*type1", "target") - frame:SetAttribute("*type2", ShadowUF.is502 and "togglemenu" or "menu") + frame:SetAttribute("*type2", "togglemenu") end return frame diff --git a/options/config.lua b/options/config.lua index c46c9587..483f7ae8 100755 --- a/options/config.lua +++ b/options/config.lua @@ -3594,7 +3594,7 @@ local function loadUnitOptions() order = 4, type = "select", name = L["Group by"], - values = ShadowUF.is502 and {["GROUP"] = L["Group number"], ["CLASS"] = L["Class"], ["ASSIGNEDROLE"] = L["Assigned Role (DPS/Tank/etc)"]} or {["GROUP"] = L["Group number"], ["CLASS"] = L["Class"]}, + values = {["GROUP"] = L["Group number"], ["CLASS"] = L["Class"], ["ASSIGNEDROLE"] = L["Assigned Role (DPS/Tank/etc)"]}, arg = "groupBy", hidden = hideSplitOrRaidOption, }, From f8cc835c47920d2ab3af1297b7de7c3ec57802b7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 9 Mar 2013 13:34:22 -0800 Subject: [PATCH 405/794] Raid menus will now use the old method to avoid errors, as well as a Clique shiv to keep Clique working --- ShadowedUnitFrames.lua | 1 + modules/units.lua | 37 ++++++++++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 37e93705..b0057f65 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -93,6 +93,7 @@ function ShadowUF:CheckBuild() self:Print("NOTE! As of 5.2.0, you can now use menus to perform secure actions such as Set/Clear Focus or reporting.") self:Print("SUF has been tested and confirmed to work with this setup. If menus do not show up, you may need to update Clique.") self:Print("If you still get action blocked issues, it is another addons fault and you should yell at that author for doing something bad.") + self:Print("Raid dropdowns will still cause action blocked issues due to a bug with the toggle system unfortunately.") end self.db.profile.wowBuild = build diff --git a/modules/units.lua b/modules/units.lua index 64cb8c93..1a25816e 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -578,6 +578,14 @@ OnAttributeChanged = function(self, name, unit) self:RegisterNormalEvent("GROUP_ROSTER_UPDATE", Units, "CheckGroupedUnitStatus") self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") + self.menu = ShowMenu + + stateMonitor:WrapScript(self, "OnAttributeChanged", [[ + if( value == "togglemenu" and self:GetAttribute("clique-shiv") == "1" ) then + self:SetAttribute(name, "menu") + end + ]]) + -- Party members need to watch for changes elseif( self.unitRealType == "party" ) then self:RegisterNormalEvent("GROUP_ROSTER_UPDATE", Units, "CheckGroupedUnitStatus") @@ -609,14 +617,13 @@ OnAttributeChanged = function(self, name, unit) self:RegisterNormalEvent("UNIT_TARGET", Units, "CheckPetUnitUpdated") end - + self:SetVisibility() Units:CheckUnitStatus(self) end Units.OnAttributeChanged = OnAttributeChanged - local secureInitializeUnit = [[ local header = self:GetParent() @@ -636,9 +643,19 @@ local secureInitializeUnit = [[ -- Clique integration local clickHeader = header:GetFrameRef("clickcast_header") - if clickHeader then + if( clickHeader ) then clickHeader:SetAttribute("clickcast_button", self) clickHeader:RunAttribute("clickcast_register") + + -- Because we gsub togglemenu -> menu, we can do this check + -- to determine whether we're using togglemenu or not + if( "togglemenu" == "menu" ) then + self:SetAttribute("clique-shiv", "1") + if( self:GetAttribute("type2") == ("toggle" .. "menu") ) then + print("Initial force") + self:SetAttribute("type2", "menu") + end + end end ]] @@ -656,13 +673,13 @@ end -- Show tooltip local function OnEnter(self) - if self.OnEnter then + if( self.OnEnter ) then self:OnEnter() end end local function OnLeave(self) - if self.OnLeave then + if( self.OnLeave ) then self:OnLeave() end end @@ -954,7 +971,7 @@ function Units:LoadSplitGroupHeader(type) frame:SetAttribute("showRaid", true) frame:SetAttribute("groupFilter", id) frame:UnregisterEvent("UNIT_NAME_UPDATE") - frame:SetAttribute("initialConfigFunction", secureInitializeUnit) + frame:SetAttribute("initialConfigFunction", string.gsub(secureInitializeUnit, "togglemenu", "menu")) frame.initialConfigFunction = initializeUnit frame.isHeaderFrame = true frame.unitType = type @@ -1029,7 +1046,13 @@ function Units:LoadGroupHeader(type) headerFrame:SetAttribute("template", unitButtonTemplate) headerFrame:SetAttribute("initial-unitWatch", true) - headerFrame:SetAttribute("initialConfigFunction", secureInitializeUnit) + + if( type == "raid" ) then + headerFrame:SetAttribute("initialConfigFunction", string.gsub(secureInitializeUnit, "togglemenu", "menu")) + else + headerFrame:SetAttribute("initialConfigFunction", secureInitializeUnit) + end + headerFrame.initialConfigFunction = initializeUnit headerFrame.isHeaderFrame = true headerFrame.unitType = type From 416235993408c4bfc41ff214e27bfcbdbdf74be3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 10 Mar 2013 09:32:23 -0700 Subject: [PATCH 406/794] Fixed frame level bugs that showed up on the raid/party frames for incoming heals/abosrbs --- modules/incheal.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index 53a77844..5a54d333 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -1,4 +1,4 @@ -local IncHeal = {["frameKey"] = "incHeal", ["colorKey"] = "inc", ["frameLevelMod"] = 2} +local IncHeal = {["frameKey"] = "incHeal", ["colorKey"] = "inc", ["frameLevelMod"] = 1} ShadowUF.IncHeal = IncHeal ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) @@ -38,7 +38,7 @@ function IncHeal:OnLayoutApplied(frame) -- if the main bar has a transparency set, then we need a more complicated method to stop the health bar from being darker with incoming heals up if( ( ShadowUF.db.profile.units[frame.unitType].healthBar.invert and ShadowUF.db.profile.bars.backgroundAlpha == 0 ) or ( not ShadowUF.db.profile.units[frame.unitType].healthBar.invert and ShadowUF.db.profile.bars.alpha == 1 ) ) then bar.simple = true - bar:SetFrameLevel(frame.topFrameLevel - 1 - self.frameLevelMod) + bar:SetFrameLevel(frame.topFrameLevel - self.frameLevelMod) if( bar:GetOrientation() == "HORIZONTAL" ) then bar:SetWidth(frame.healthBar:GetWidth() * cap) From 41d18348085363758978affea0d28cf59f58bebf Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 10 Mar 2013 09:35:24 -0700 Subject: [PATCH 407/794] Incoming heals/absorbs now update against frequent health events and should look smoother --- modules/incabsorb.lua | 1 + modules/incheal.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/incabsorb.lua b/modules/incabsorb.lua index 80a2d31c..631f2484 100755 --- a/modules/incabsorb.lua +++ b/modules/incabsorb.lua @@ -6,6 +6,7 @@ function IncAbsorb:OnEnable(frame) frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_ABSORB_AMOUNT_CHANGED", self, "UpdateFrame") frame:RegisterUpdateFunc(self, "UpdateFrame") diff --git a/modules/incheal.lua b/modules/incheal.lua index 5a54d333..4f4b8939 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -7,6 +7,7 @@ function IncHeal:OnEnable(frame) frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") frame:RegisterUpdateFunc(self, "UpdateFrame") From 2f563b45ffe371c5d7f2e19d7ee82bdf922e302a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 10 Mar 2013 14:28:56 -0700 Subject: [PATCH 408/794] Force packager to rerun --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index bd696932..110e6202 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ ## Interface: 50200 ## Title: Shadowed Unit Frames -## Notes: Now with 90% more shadows than the leading competitors +## Notes: Now with 90% more shadows than the leading competitors. ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB From 094946f7facce229e5687232ff68559b8c8a27dd Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 11 Mar 2013 10:52:23 -0700 Subject: [PATCH 409/794] Once more to force a repackage --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 110e6202..bd696932 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ ## Interface: 50200 ## Title: Shadowed Unit Frames -## Notes: Now with 90% more shadows than the leading competitors. +## Notes: Now with 90% more shadows than the leading competitors ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB From d158a06d494cc78a747cee4b91c48f9453da6b5c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 13 Mar 2013 07:04:18 -0700 Subject: [PATCH 410/794] Removed debug --- modules/units.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 1a25816e..60bd552a 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -652,7 +652,6 @@ local secureInitializeUnit = [[ if( "togglemenu" == "menu" ) then self:SetAttribute("clique-shiv", "1") if( self:GetAttribute("type2") == ("toggle" .. "menu") ) then - print("Initial force") self:SetAttribute("type2", "menu") end end From d1f21f97fe72efe6784cbe5f96e196804bb777e7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 14 Mar 2013 08:41:56 -0700 Subject: [PATCH 411/794] Fixed Stagger bar being reset on reload --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index b0057f65..9abd4472 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 34 +ShadowUF.dbRevision = 35 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} From 4cd0cc46f8e6a7e0eaa1d36b3d17a3121aa7538d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 15 Mar 2013 15:22:44 -0700 Subject: [PATCH 412/794] Remove rune frame from power bar hider as it causes taint issues now --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 9abd4472..3dfea2ff 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -705,7 +705,7 @@ function ShadowUF:HideBlizzardFrames() end if( self.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then - hideBlizzardFrames(true, EclipseBarFrame, ShardBarFrame, RuneFrame, TotemFrame, PaladinPowerBar, MonkHarmonyBar, PriestBarFrame, WarlockPowerFrame) + hideBlizzardFrames(true, EclipseBarFrame, ShardBarFrame, TotemFrame, PaladinPowerBar, MonkHarmonyBar, PriestBarFrame, WarlockPowerFrame) end if( self.db.profile.hidden.pet and not active_hiddens.pet ) then From afc26955497c2beb0fc7d4841210886f64b9698e Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 16 Mar 2013 20:00:13 -0700 Subject: [PATCH 413/794] It seems that boss units are now real units and get events, so hopefully OnUpdate is no longer necessary --- modules/units.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 60bd552a..18f535e8 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -569,9 +569,7 @@ OnAttributeChanged = function(self, name, unit) -- Update boss elseif( self.unitType == "boss" ) then - self.timeElapsed = 0 - self:SetScript("OnUpdate", TargetUnitUpdate) - self:RegisterNormalEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", self, "FullUpdate") + self:RegisterNormalEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", self, "CheckUnitStatus") -- Check for a unit guid to do a full update elseif( self.unitRealType == "raid" ) then From f0b86b23f6865d5946ce30ccb5666dfd2584cb39 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 17 Mar 2013 08:36:14 -0700 Subject: [PATCH 414/794] Fixed boss unit typo --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 18f535e8..3097649e 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -569,7 +569,7 @@ OnAttributeChanged = function(self, name, unit) -- Update boss elseif( self.unitType == "boss" ) then - self:RegisterNormalEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", self, "CheckUnitStatus") + self:RegisterNormalEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", Units, "CheckUnitStatus") -- Check for a unit guid to do a full update elseif( self.unitRealType == "raid" ) then From d4076b5f2bc5a84f095650c0f2c35064e835f453 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 18 Mar 2013 09:58:54 -0700 Subject: [PATCH 415/794] Readd RuneFrame to the list of hidden power bars Changed power bars to not taint to hide, and also try reparenting to force them to stay hidden --- ShadowedUnitFrames.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 3dfea2ff..2029fd67 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -633,6 +633,7 @@ local function hideBlizzardFrames(taint, ...) if( taint ) then frame.Show = ShadowUF.noop else + frame:SetParent(ShadowUF.hiddenFrame) frame:HookScript("OnShow", rehideFrame) end end @@ -705,7 +706,7 @@ function ShadowUF:HideBlizzardFrames() end if( self.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then - hideBlizzardFrames(true, EclipseBarFrame, ShardBarFrame, TotemFrame, PaladinPowerBar, MonkHarmonyBar, PriestBarFrame, WarlockPowerFrame) + hideBlizzardFrames(false, EclipseBarFrame, ShardBarFrame, RuneFrame, PaladinPowerBar, MonkHarmonyBar, PriestBarFrame, WarlockPowerFrame) end if( self.db.profile.hidden.pet and not active_hiddens.pet ) then From 7b8e432b0b5bde43037d1a69b808e2c0649e66d0 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 18 Mar 2013 20:08:15 -0700 Subject: [PATCH 416/794] Removed togglemenu shiv, sent a patch to Clique as it's a better fix - Don't clear group frames on initial setup --- modules/units.lua | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 3097649e..6497ac16 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -578,12 +578,6 @@ OnAttributeChanged = function(self, name, unit) self.menu = ShowMenu - stateMonitor:WrapScript(self, "OnAttributeChanged", [[ - if( value == "togglemenu" and self:GetAttribute("clique-shiv") == "1" ) then - self:SetAttribute(name, "menu") - end - ]]) - -- Party members need to watch for changes elseif( self.unitRealType == "party" ) then self:RegisterNormalEvent("GROUP_ROSTER_UPDATE", Units, "CheckGroupedUnitStatus") @@ -633,6 +627,7 @@ local secureInitializeUnit = [[ self:SetAttribute("*type1", "target") self:SetAttribute("*type2", "togglemenu") + self:SetAttribute("type2", "togglemenu") self:SetAttribute("isHeaderDriven", true) @@ -644,15 +639,6 @@ local secureInitializeUnit = [[ if( clickHeader ) then clickHeader:SetAttribute("clickcast_button", self) clickHeader:RunAttribute("clickcast_register") - - -- Because we gsub togglemenu -> menu, we can do this check - -- to determine whether we're using togglemenu or not - if( "togglemenu" == "menu" ) then - self:SetAttribute("clique-shiv", "1") - if( self:GetAttribute("type2") == ("toggle" .. "menu") ) then - self:SetAttribute("type2", "menu") - end - end end ]] @@ -726,7 +712,7 @@ function Units:CreateUnit(...) frame:RegisterForClicks("AnyUp") -- non-header frames don't set those, so we need to do it - if( not InCombatLockdown() ) then + if( not InCombatLockdown() and not frame:GetAttribute("isHeaderDriven") ) then frame:SetAttribute("*type1", "target") frame:SetAttribute("*type2", "togglemenu") end @@ -916,7 +902,7 @@ function Units:SetHeaderAttributes(frame, type) end end - if( not InCombatLockdown() and headerUnits[type] ) then + if( not InCombatLockdown() and headerUnits[type] and frame.shouldReset ) then -- Children no longer have ClearAllPoints() called on them before they are repositioned -- this tries to stop it from bugging out by clearing it then forcing it to reposition everything local name = frame:GetName() .. "UnitButton" @@ -935,6 +921,8 @@ function Units:SetHeaderAttributes(frame, type) frame:Show() end end + + frame.shouldReset = true end -- Load a single unit such as player, target, pet, etc From 29e9dbd07f365f3d8597462b1ffe657ead94ea2a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 30 Mar 2013 15:44:10 -0700 Subject: [PATCH 417/794] Tweaks to default Blizzard UI hiding --- ShadowedUnitFrames.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 2029fd67..a33eb926 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -630,6 +630,11 @@ local function hideBlizzardFrames(taint, ...) frame:UnregisterAllEvents() frame:Hide() + if( frame.manabar ) then frame.manabar:UnregisterAllEvents() end + if( frame.healthbar ) then frame.healthbar:UnregisterAllEvents() end + if( frame.spellbar ) then frame.spellbar:UnregisterAllEvents() end + if( frame.powerBarAlt ) then frame.powerBarAlt:UnregisterAllEvents() end + if( taint ) then frame.Show = ShadowUF.noop else @@ -696,13 +701,16 @@ function ShadowUF:HideBlizzardFrames() end if( self.db.profile.hidden.player and not active_hiddens.player ) then - hideBlizzardFrames(false, PlayerFrame, PlayerFrameHealthBar, PlayerFrameManaBar, PlayerFrameAlternateManaBar) + hideBlizzardFrames(false, PlayerFrame, PlayerFrameAlternateManaBar) -- We keep these in case someone is still using the default auras, otherwise it messes up vehicle stuff + PlayerFrame:RegisterEvent("PLAYER_ENTERING_WORLD") PlayerFrame:RegisterEvent("UNIT_ENTERING_VEHICLE") PlayerFrame:RegisterEvent("UNIT_ENTERED_VEHICLE") PlayerFrame:RegisterEvent("UNIT_EXITING_VEHICLE") PlayerFrame:RegisterEvent("UNIT_EXITED_VEHICLE") + PlayerFrame:SetUserPlaced(true) + PlayerFrame:SetDontSavePosition(true) end if( self.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then @@ -710,15 +718,15 @@ function ShadowUF:HideBlizzardFrames() end if( self.db.profile.hidden.pet and not active_hiddens.pet ) then - hideBlizzardFrames(false, PetFrame, PetFrameHealthBar, PetFrameManaBar) + hideBlizzardFrames(false, PetFrame) end if( self.db.profile.hidden.target and not active_hiddens.target ) then - hideBlizzardFrames(false, TargetFrame, TargetFrameHealthBar, TargetFrameManaBar, TargetFrameSpellBar, ComboFrame, TargetFrameToT) + hideBlizzardFrames(false, TargetFrame, ComboFrame, TargetFrameToT) end if( self.db.profile.hidden.focus and not active_hiddens.focus ) then - hideBlizzardFrames(false, FocusFrame, FocusFrameHealthBar, FocusFrameManaBar, FocusFrameSpellBar, FocusFrameToT) + hideBlizzardFrames(false, FocusFrame, FocusFrameToT) end if( self.db.profile.hidden.boss and not active_hiddens.boss ) then From ba44a6bf78bc716e5b56e0f5ed1c419624bd2f0c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 7 Apr 2013 13:32:14 -0700 Subject: [PATCH 418/794] Just keep the priest bar hidden rather than reparenting it --- ShadowedUnitFrames.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index a33eb926..192dc659 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -714,7 +714,11 @@ function ShadowUF:HideBlizzardFrames() end if( self.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then - hideBlizzardFrames(false, EclipseBarFrame, ShardBarFrame, RuneFrame, PaladinPowerBar, MonkHarmonyBar, PriestBarFrame, WarlockPowerFrame) + hideBlizzardFrames(false, EclipseBarFrame, ShardBarFrame, RuneFrame, PaladinPowerBar, MonkHarmonyBar, WarlockPowerFrame) + + PriestBarFrame:UnregisterAllEvents() + PriestBarFrame:HookScript("OnShow", rehideFrame) + PriestBarFrame:Hide() end if( self.db.profile.hidden.pet and not active_hiddens.pet ) then From 7b6378536ed74636844bb3fa04b5c1d9c7808d2f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 29 Apr 2013 22:01:01 -0700 Subject: [PATCH 419/794] Don't reparent PaladinPowerBar too --- ShadowedUnitFrames.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 192dc659..5025b4f6 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -624,6 +624,15 @@ local rehideFrame = function(self) end end +local function reparentHideBlizzardFrames(...) + for i=1, select("#", ...) do + local frame = select(i, ...) + frame:UnregisterAllEvents() + frame:HookScript(rehideFrame) + frame:Hide() + end +end + local function hideBlizzardFrames(taint, ...) for i=1, select("#", ...) do local frame = select(i, ...) @@ -714,11 +723,8 @@ function ShadowUF:HideBlizzardFrames() end if( self.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then - hideBlizzardFrames(false, EclipseBarFrame, ShardBarFrame, RuneFrame, PaladinPowerBar, MonkHarmonyBar, WarlockPowerFrame) - - PriestBarFrame:UnregisterAllEvents() - PriestBarFrame:HookScript("OnShow", rehideFrame) - PriestBarFrame:Hide() + hideBlizzardFrames(false, EclipseBarFrame, ShardBarFrame, RuneFrame, MonkHarmonyBar, WarlockPowerFrame) + reparentHideBlizzardFrames(PriestBarFrame, PaladinPowerBar) end if( self.db.profile.hidden.pet and not active_hiddens.pet ) then From 6f5cd7f6605e86aac7665ab79d21596be0e82074 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 30 Apr 2013 08:52:41 -0700 Subject: [PATCH 420/794] Typo --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 5025b4f6..9beb0508 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -628,7 +628,7 @@ local function reparentHideBlizzardFrames(...) for i=1, select("#", ...) do local frame = select(i, ...) frame:UnregisterAllEvents() - frame:HookScript(rehideFrame) + frame:HookScript("OnShow", rehideFrame) frame:Hide() end end From a9b086d28bef75878cad7e48b879de96303e238d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 7 May 2013 22:06:34 -0700 Subject: [PATCH 421/794] Don't bother reparenting power bars, not worth the hassle --- ShadowedUnitFrames.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 9beb0508..ad68c084 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -624,7 +624,7 @@ local rehideFrame = function(self) end end -local function reparentHideBlizzardFrames(...) +local function basicHideBlizzardFrames(...) for i=1, select("#", ...) do local frame = select(i, ...) frame:UnregisterAllEvents() @@ -723,8 +723,7 @@ function ShadowUF:HideBlizzardFrames() end if( self.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then - hideBlizzardFrames(false, EclipseBarFrame, ShardBarFrame, RuneFrame, MonkHarmonyBar, WarlockPowerFrame) - reparentHideBlizzardFrames(PriestBarFrame, PaladinPowerBar) + basicHideBlizzardFrames(PriestBarFrame, PaladinPowerBar, EclipseBarFrame, ShardBarFrame, RuneFrame, MonkHarmonyBar, WarlockPowerFrame) end if( self.db.profile.hidden.pet and not active_hiddens.pet ) then From 20c1a469bf52fb9515a7a2da99964eb99107159c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 May 2013 09:32:41 -0400 Subject: [PATCH 422/794] TOC 50300 --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index bd696932..1e1b5bca 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,4 +1,4 @@ -## Interface: 50200 +## Interface: 50300 ## Title: Shadowed Unit Frames ## Notes: Now with 90% more shadows than the leading competitors ## Author: Shadowed From d99270ea35f265092f7660754d5732217764867c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 29 May 2013 09:44:11 -0700 Subject: [PATCH 423/794] Update health colors on UNIT_TARGETABLE_CHANGED --- modules/health.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/health.lua b/modules/health.lua index fed8da08..ac8fb602 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -36,6 +36,7 @@ function Health:OnEnable(frame) frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdateColor") frame:RegisterUnitEvent("UNIT_THREAT_SITUATION_UPDATE", self, "UpdateColor") frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "Update") + frame:RegisterUnitEvent("UNIT_TARGETABLE_CHANGED", self, "UpdateColor") if( frame.unit == "pet" ) then frame:RegisterUnitEvent("UNIT_POWER", self, "UpdateColor") From 352b3528b50274835089c6df62c4769065e93625 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 29 May 2013 09:44:51 -0700 Subject: [PATCH 424/794] Secure dropdown menus are enabled for all units again including raid --- modules/units.lua | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 6497ac16..9cd1952a 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -401,33 +401,6 @@ function Units:CheckGroupedUnitStatus(frame) end end -local function ShowMenu(self) - if( UnitIsUnit(self.unit, "player") ) then - ToggleDropDownMenu(1, nil, PlayerFrameDropDown, "cursor") - elseif( self.unit == "pet" or self.unit == "vehicle" ) then - ToggleDropDownMenu(1, nil, PetFrameDropDown, "cursor") - elseif( self.unit == "target" ) then - ToggleDropDownMenu(1, nil, TargetFrameDropDown, "cursor") - elseif( self.unitType == "boss" ) then - ToggleDropDownMenu(1, nil, _G["Boss" .. self.unitID .. "TargetFrameDropDown"], "cursor") - elseif( self.unit == "focus" ) then - ToggleDropDownMenu(1, nil, FocusFrameDropDown, "cursor") - elseif( self.unitRealType == "party" ) then - ToggleDropDownMenu(1, nil, _G["PartyMemberFrame" .. self.unitID .. "DropDown"], "cursor") - elseif( self.unitRealType == "raid" ) then - HideDropDownMenu(1) - - local menuFrame = FriendsDropDown - menuFrame.displayMode = "MENU" - menuFrame.initialize = RaidFrameDropDown_Initialize - menuFrame.userData = self.unitID - menuFrame.unit = self.unitOwner - menuFrame.name = UnitName(self.unitOwner) - menuFrame.id = self.unitID - ToggleDropDownMenu(1, nil, menuFrame, "cursor") - end -end - -- More fun with sorting, due to sorting magic we have to check if we want to create stuff when the frame changes of partys too local function createChildUnits(self) if( not self.unitID ) then return end @@ -576,8 +549,6 @@ OnAttributeChanged = function(self, name, unit) self:RegisterNormalEvent("GROUP_ROSTER_UPDATE", Units, "CheckGroupedUnitStatus") self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") - self.menu = ShowMenu - -- Party members need to watch for changes elseif( self.unitRealType == "party" ) then self:RegisterNormalEvent("GROUP_ROSTER_UPDATE", Units, "CheckGroupedUnitStatus") @@ -956,7 +927,7 @@ function Units:LoadSplitGroupHeader(type) frame:SetAttribute("showRaid", true) frame:SetAttribute("groupFilter", id) frame:UnregisterEvent("UNIT_NAME_UPDATE") - frame:SetAttribute("initialConfigFunction", string.gsub(secureInitializeUnit, "togglemenu", "menu")) + frame:SetAttribute("initialConfigFunction", secureInitializeUnit) frame.initialConfigFunction = initializeUnit frame.isHeaderFrame = true frame.unitType = type @@ -1031,12 +1002,7 @@ function Units:LoadGroupHeader(type) headerFrame:SetAttribute("template", unitButtonTemplate) headerFrame:SetAttribute("initial-unitWatch", true) - - if( type == "raid" ) then - headerFrame:SetAttribute("initialConfigFunction", string.gsub(secureInitializeUnit, "togglemenu", "menu")) - else - headerFrame:SetAttribute("initialConfigFunction", secureInitializeUnit) - end + headerFrame:SetAttribute("initialConfigFunction", secureInitializeUnit) headerFrame.initialConfigFunction = initializeUnit headerFrame.isHeaderFrame = true From 3b0fb9a97b7f291ff125893b4a593db992f96034 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 10 Sep 2013 08:34:24 -0700 Subject: [PATCH 425/794] TOC bump --- ShadowedUnitFrames.toc | 2 +- options/ShadowedUF_Options.toc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 1e1b5bca..a41c7653 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,4 +1,4 @@ -## Interface: 50300 +## Interface: 50400 ## Title: Shadowed Unit Frames ## Notes: Now with 90% more shadows than the leading competitors ## Author: Shadowed diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index b62fdc44..446f0c8f 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 50200 +## Interface: 50400 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From 519feb9572442b7d1cde61b72d4197f434145bab Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 12 Sep 2013 09:32:30 -0700 Subject: [PATCH 426/794] On curable debuff is now shown on the boss frames --- options/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index 483f7ae8..71b5a22d 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2581,7 +2581,7 @@ local function loadUnitOptions() name = L["On curable debuff"], desc = L["Highlight units that are debuffed with something you can cure."], arg = "highlight.debuff", - hidden = function(info) return ShadowUF.Units.zoneUnits[info[2]] or info[2] == "battlegroundpet" or info[2] == "arenapet" end, + hidden = function(info) return info[2] ~= "boss" and ( ShadowUF.Units.zoneUnits[info[2]] or info[2] == "battlegroundpet" or info[2] == "arenapet" ) end, }, sep = { order = 6.5, From 779130570110fe6f6a60c75fb362136ba4f6ea4c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 12 Sep 2013 09:42:33 -0700 Subject: [PATCH 427/794] Added absorb tags --- modules/tags.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/modules/tags.lua b/modules/tags.lua index a03b1f34..6fee2ee5 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -997,6 +997,18 @@ Tags.defaultTags = { local heal = UnitGetIncomingHeals(unit) return heal and heal > 0 and string.format("+%d", heal) or ShadowUF.tagFunc.name(unit, unitOwner, fontString) end]], + ["abs:incabsorb"] = [[function(unit, unitOwner, fontString) + local absorb = UnitGetTotalAbsorbs(unit) + return absorb and absorb > 0 and string.format("%d", absorb) + end]], + ["incabsorb"] = [[function(unit, unitOwner, fontString) + local absorb = UnitGetTotalAbsorbs(unit) + return absorb and absorb > 0 and ShadowUF:FormatLargeNumber(absorb) + end]], + ["incabsorb:name"] = [[function(unit, unitOwner, fontString) + local absorb = UnitGetTotalAbsorbs(unit) + return absorb and absorb > 0 and string.format("+%d", absorb) or ShadowUF.tagFunc.name(unit, unitOwner, fontString) + end]], ["unit:raid:targeting"] = [[function(unit, unitOwner, fontString) if( GetNumGroupMembers() == 0 ) then return nil end local guid = UnitGUID(unit) @@ -1037,6 +1049,9 @@ Tags.defaultEvents = { ["abs:incheal"] = "UNIT_HEAL_PREDICTION", ["incheal:name"] = "UNIT_HEAL_PREDICTION", ["incheal"] = "UNIT_HEAL_PREDICTION", + ["abs:incabsorb"] = "UNIT_ABSORB_AMOUNT_CHANGED", + ["incabsorb"] = "UNIT_ABSORB_AMOUNT_CHANGED", + ["incabsorb:name"] = "UNIT_ABSORB_AMOUNT_CHANGED", -- ["crtabs"] = "CRTABS", -- ["abs:crtabs"] = "CRTABS", -- ["crtabs:name"] = "CRTABS", @@ -1121,6 +1136,9 @@ Tags.defaultFrequents = { -- Default tag categories Tags.defaultCategories = { ["hp:color"] = "health", + ["abs:incabsorb"] = "health", + ["incabsorb"] = "health", + ["incabsorb:name"] = "health", ["per:incheal"] = "health", ["abs:incheal"] = "health", ["incheal"] = "health", @@ -1208,6 +1226,9 @@ Tags.defaultCategories = { -- Default tag help Tags.defaultHelp = { + ["abs:incabsorb"] = L["Absolute damage absorption value on the unit, if 10,000 damage will be absorbed, it will show 10,000."], + ["incabsorb"] = L["Shorten damage absorption, if 13,000 damage will e absorbed, it will show 13k."], + ["incabsorb:name"] = L["If the unit has a damage absorption shield on them, it will show the absolute absorb value, otherwise the units name."], ["hp:color"] = L["Color code based on percentage of HP left on the unit, this works the same way as the color by health option. But for text instead of the entire bar."], ["guild"] = L["Show's the units guild name if they are in a guild."], ["short:druidform"] = L["Short version of [druidform], C = Cat, B = Bear, F = Flight and so on."], @@ -1295,6 +1316,9 @@ Tags.defaultHelp = { } Tags.defaultNames = { + ["abs:incabsorb"] = L["Damage absorption (Absolute)"], + ["incabsorb"] = L["Damage absorption (Short)"], + ["incabsorb:name"] = L["Damage absorption/Name"], ["per:incheal"] = L["Incoming heal (Percent)"], ["incheal:name"] = L["Incoming heal/Name"], ["unit:scaled:threat"] = L["Unit scaled threat"], @@ -1385,6 +1409,7 @@ Tags.defaultNames = { Tags.eventType = { ["UNIT_POWER_FREQUENT"] = "power", ["UNIT_MAXPOWER"] = "power", + ["UNIT_ABSORB_AMOUNT_CHANGED"] = "health", ["UNIT_HEALTH_FREQUENT"] = "health", ["UNIT_HEALTH"] = "health", ["UNIT_MAXHEALTH"] = "health", @@ -1440,6 +1465,7 @@ local function loadAPIEvents() ["UnitBuff"] = "UNIT_AURA", ["UnitDebuff"] = "UNIT_AURA", ["UnitXPMax"] = "UNIT_PET_EXPERIENCE PLAYER_XP_UPDATE PLAYER_LEVEL_UP", + ["UnitGetTotalAbsorbs"] = "UNIT_ABSORB_AMOUNT_CHANGED", ["UnitXP%("] = "UNIT_PET_EXPERIENCE PLAYER_XP_UPDATE PLAYER_LEVEL_UP", ["GetTotemInfo"] = "PLAYER_TOTEM_UPDATE", ["GetXPExhaustion"] = "UPDATE_EXHAUSTION", From 73fe2b7ed00addf5c01a94c896dd67f342c5aabb Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 10 Nov 2013 17:56:01 -0800 Subject: [PATCH 428/794] Don't show server if the realm relationship is virtual (matches default implementation) --- modules/tags.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/tags.lua b/modules/tags.lua index 6fee2ee5..80dc775d 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -764,6 +764,10 @@ Tags.defaultTags = { ["name"] = [[function(unit, unitOwner) return UnitName(unitOwner) or UNKNOWN end]], ["server"] = [[function(unit, unitOwner) local server = select(2, UnitName(unitOwner)) + if UnitRealmRelationship(unitOwner) == LE_REALM_RELATION_VIRTUAL + return nil + end + return server ~= "" and server or nil end]], ["perhp"] = [[function(unit, unitOwner) From 776edeeb1c6bdd80f8f1bd47cd7b356ad4d3fb11 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 10 Nov 2013 17:59:09 -0800 Subject: [PATCH 429/794] Added raid assist icons --- modules/indicators.lua | 7 +++++-- options/config.lua | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 385fc8fe..97b6c50d 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -52,7 +52,7 @@ function Indicators:UpdateMasterLoot(frame) frame.indicators.masterLoot:Hide() end end - + function Indicators:UpdateRaidTarget(frame) if( not frame.indicators.raidTarget or not frame.indicators.raidTarget.enabled ) then return end @@ -112,6 +112,10 @@ function Indicators:UpdateLeader(frame) if( not frame.indicators.leader or not frame.indicators.leader.enabled ) then return end if( UnitIsGroupLeader(frame.unit) ) then + frame.indicators.leader:SetTexture("Interface\\GroupFrame\\UI-Group-LeaderIcon") + frame.indicators.leader:Show() + elseif( UnitIsGroupAssistant(frame.unit) or IsEveryoneAssistant() ) then + frame.indicators.leader:SetTexture("Interface\\GroupFrame\\UI-Group-AssistantIcon") frame.indicators.leader:Show() else frame.indicators.leader:Hide() @@ -321,7 +325,6 @@ function Indicators:OnEnable(frame) frame:RegisterUpdateFunc(self, "UpdateLeader") frame.indicators.leader = frame.indicators.leader or frame.indicators:CreateTexture(nil, "OVERLAY") - frame.indicators.leader:SetTexture("Interface\\GroupFrame\\UI-Group-LeaderIcon") end if( config.indicators.masterLoot and config.indicators.masterLoot.enabled ) then diff --git a/options/config.lua b/options/config.lua index 71b5a22d..4d422f75 100755 --- a/options/config.lua +++ b/options/config.lua @@ -41,10 +41,10 @@ local PAGE_DESC = { ["tags"] = L["Advanced tag management, allows you to add your own custom tags."], ["filter"] = L["Simple aura filtering by whitelists and blacklists."], } -local INDICATOR_NAMES = {["questBoss"] = L["Quest Boss"], ["leader"] = L["Leader"], ["lfdRole"] = L["Dungeon Role"], ["masterLoot"] = L["Master Looter"], ["pvp"] = L["PvP Flag"], ["raidTarget"] = L["Raid Target"], ["ready"] = L["Ready Status"], ["role"] = L["Raid Role"], ["status"] = L["Combat Status"], ["class"] = L["Class Icon"], ["resurrect"] = L["Resurrect Status"], ["phase"] = L["Other Party/Phase Status"], ["petBattle"] = L["Pet Battle"]} +local INDICATOR_NAMES = {["questBoss"] = L["Quest Boss"], ["leader"] = L["Leader / Assist"], ["lfdRole"] = L["Dungeon Role"], ["masterLoot"] = L["Master Looter"], ["pvp"] = L["PvP Flag"], ["raidTarget"] = L["Raid Target"], ["ready"] = L["Ready Status"], ["role"] = L["Raid Role"], ["status"] = L["Combat Status"], ["class"] = L["Class Icon"], ["resurrect"] = L["Resurrect Status"], ["phase"] = L["Other Party/Phase Status"], ["petBattle"] = L["Pet Battle"]} local AREA_NAMES = {["arena"] = L["Arenas"],["none"] = L["Everywhere else"], ["party"] = L["Party instances"], ["pvp"] = L["Battleground"], ["raid"] = L["Raid instances"]} local INDICATOR_DESC = { - ["leader"] = L["Crown indicator for group leaders."], ["lfdRole"] = L["Role the unit is playing in dungeons formed through the Looking For Dungeon system."], + ["leader"] = L["Crown indicator for group leader or assistants."], ["lfdRole"] = L["Role the unit is playing in dungeons formed through the Looking For Dungeon system."], ["masterLoot"] = L["Bag indicator for master looters."], ["pvp"] = L["PVP flag indicator, Horde for Horde flagged pvpers and Alliance for Alliance flagged pvpers."], ["raidTarget"] = L["Raid target indicator."], ["ready"] = L["Ready status of group members."], ["phase"] = L["Shows when a party member is in a different phase or another group."], ["questBoss"] = L["Shows that a NPC is a boss for a quest."], ["petBattle"] = L["Shows what kind of pet the unit is for pet battles."], From ce5ab47e5540ca84c8864d069e995bc2855c7462 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 10 Nov 2013 18:55:44 -0800 Subject: [PATCH 430/794] Added guard condition in case combo points aren't fully initialized --- modules/combopoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 4c651f15..c94cd109 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -121,7 +121,7 @@ end function Combo:UpdateBarBlocks(frame, event, unit, powerType) local pointsFrame = frame[frame.comboPointType] - if( not pointsFrame or not pointsFrame.config.eventType ) then return end + if( not pointsFrame or not pointsFrame.config.eventType or not pointsFrame.blocks ) then return end if( event and powerType ~= pointsFrame.config.eventType ) then return end if( not ShadowUF.db.profile.units[frame.unitType][frame.comboPointType].isBar ) then From 62fb664d0381a0cab4ef3ddd6e2da3c575f546d8 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 10 Nov 2013 19:13:47 -0800 Subject: [PATCH 431/794] Added Ancient Kings bar for Paladins --- modules/totems.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/totems.lua b/modules/totems.lua index 177a6788..e0a7e75f 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -7,6 +7,9 @@ local playerClass = select(2, UnitClass("player")) if( playerClass == "DEATHKNIGHT" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Guardian bar"], true, "DEATHKNIGHT", {1, 2}, 55) +elseif( playerClass == "PALADIN" ) then + MAX_TOTEMS = 1 + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Ancient Kings bar"], true, "PALADIN", 75) elseif( playerClass == "DRUID" ) then MAX_TOTEMS = 3 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Mushroom bar"], true, "DRUID", {1, 4}, 84) From 61b2cb74c112342bb0869a578919730b41964ada Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 10 Nov 2013 19:53:31 -0800 Subject: [PATCH 432/794] Fixed handling of hiding raid frames based on group status not always working or being unreliable --- modules/units.lua | 75 +++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 9cd1952a..c5fe1278 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -5,6 +5,7 @@ Units.remappedUnits = {["battleground"] = "arena", ["battlegroundpet"] = "arenap Units.headerUnits = {["raid"] = true, ["party"] = true, ["maintank"] = true, ["mainassist"] = true, ["raidpet"] = true, ["partypet"] = true} local stateMonitor = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") +stateMonitor.raids = {} local playerClass = select(2, UnitClass("player")) local unitFrames, headerFrames, frameList, unitEvents, childUnits, headerUnits, queuedCombat = Units.unitFrames, Units.headerFrames, Units.frameList, Units.unitEvents, Units.childUnits, Units.headerUnits, {} local remappedUnits = Units.remappedUnits @@ -868,8 +869,8 @@ function Units:SetHeaderAttributes(frame, type) if( type == "raid" ) then self:CheckGroupVisibility() - if( stateMonitor.raid ) then - stateMonitor.raid:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) + for id, monitor in pairs(stateMonitor.raids) do + monitor:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) end end @@ -912,10 +913,41 @@ function Units:LoadUnit(unit) RegisterUnitWatch(frame, frame.hasStateWatch) end +local function setupRaidStateMonitor(id, headerFrame) + if( stateMonitor.raids[id] ) then return end + + stateMonitor.raids[id] = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") + stateMonitor.raids[id]:SetAttribute("raidDisabled", nil) + stateMonitor.raids[id]:SetFrameRef("raidHeader", headerFrame) + stateMonitor.raids[id]:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) + stateMonitor.raids[id]:WrapScript(stateMonitor.raids[id], "OnAttributeChanged", [[ + if( name ~= "state-raidmonitor" and name ~= "raiddisabled" and name ~= "hidesemiraid" ) then return end + + local header = self:GetFrameRef("raidHeader") + if( self:GetAttribute("raidDisabled") ) then + if( header:IsVisible() ) then header:Hide() end + return + end + + if( self:GetAttribute("hideSemiRaid") and self:GetAttribute("state-raidmonitor") ~= "raid6" ) then + header:Hide() + else + header:Show() + end + ]]) + + RegisterStateDriver(stateMonitor.raids[id], "raidmonitor", "[target=raid6, exists] raid6; none") +end + function Units:LoadSplitGroupHeader(type) if( headerFrames.raid ) then headerFrames.raid:Hide() end headerFrames.raidParent = nil + for id, monitor in pairs(stateMonitor.raids) do + monitor:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) + monitor:SetAttribute("raidDisabled", id == -1 and true or nil) + end + local config = ShadowUF.db.profile.units[type] for id, enabled in pairs(ShadowUF.db.profile.units[type].filters) do local frame = headerFrames["raid" .. id] @@ -956,6 +988,8 @@ function Units:LoadSplitGroupHeader(type) if( not headerFrames.raidParent or headerFrames.raidParent.groupID > id ) then headerFrames.raidParent = frame end + + setupRaidStateMonitor(id, frame) elseif( frame ) then frame:Hide() @@ -985,8 +1019,11 @@ function Units:LoadGroupHeader(type) stateMonitor.party:SetAttribute("partyDisabled", nil) end - if( type == "raid" and stateMonitor.raid ) then - stateMonitor.raid:SetAttribute("raidDisabled", nil) + if( type == "raid" ) then + for id, monitor in pairs(stateMonitor.raids) do + monitor:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) + monitor:SetAttribute("raidDisabled", id >= 0 and true or nil) + end end if( type == "party" or type == "raid" ) then @@ -1052,22 +1089,7 @@ function Units:LoadGroupHeader(type) RegisterStateDriver(stateMonitor.party, "raidmonitor", "[target=raid6, exists] raid6; [target=raid1, exists] raid1; none") elseif( type == "raid" ) then - stateMonitor.raid = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") - stateMonitor.raid:SetAttribute("raidDisabled", nil) - stateMonitor.raid:SetFrameRef("raidHeader", headerFrame) - stateMonitor.raid:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) - stateMonitor.raid:WrapScript(stateMonitor.raid, "OnAttributeChanged", [[ - if( name ~= "state-raidmonitor" and name ~= "raiddisabled" and name ~= "hidesemiraid" ) then return end - if( self:GetAttribute("raidDisabled") ) then return end - - if( self:GetAttribute("hideSemiRaid") and self:GetAttribute("state-raidmonitor") ~= "raid6" ) then - self:GetFrameRef("raidHeader"):Hide() - else - self:GetFrameRef("raidHeader"):Show() - end - ]]) - - RegisterStateDriver(stateMonitor.raid, "raidmonitor", "[target=raid6, exists] raid6; none") + setupRaidStateMonitor(-1, headerFrame) else headerFrame:Show() end @@ -1200,15 +1222,18 @@ end -- Uninitialize units function Units:UninitializeFrame(type) + if( type == "party" or type == "raid" ) then + self:CheckGroupVisibility() + end + -- Disables showing party in raid automatically if raid frames are disabled if( type == "party" and stateMonitor.party ) then stateMonitor.party:SetAttribute("partyDisabled", true) end - if( type == "raid" and stateMonitor.raid ) then - stateMonitor.raid:SetAttribute("raidDisabled", true) - end - if( type == "party" or type == "raid" ) then - self:CheckGroupVisibility() + if( type == "raid" ) then + for _, monitor in pairs(stateMonitor.raids) do + monitor:SetAttribute("raidDisabled", true) + end end -- Disable the parent and the children will follow From a9cc3dfe23953f73cbc82a934991b7c1e3092ca5 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 10 Nov 2013 20:00:02 -0800 Subject: [PATCH 433/794] Switch to using Taunt for Warrior hostile range check --- modules/range.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/range.lua b/modules/range.lua index fdb5a02e..40643dc9 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -1,6 +1,6 @@ local Range = { friendly = {["WARRIOR"] = GetSpellInfo(3411), ["PRIEST"] = GetSpellInfo(2061), ["DRUID"] = GetSpellInfo(774), ["PALADIN"] = GetSpellInfo(635), ["SHAMAN"] = GetSpellInfo(331), ["WARLOCK"] = GetSpellInfo(5697), ["DEATHKNIGHT"] = GetSpellInfo(49016), ["MAGE"] = GetSpellInfo(475), ["ROGUE"] = GetSpellInfo(57934), ["MONK"] = GetSpellInfo(115450)}, - hostile = {["WARRIOR"] = GetSpellInfo(100), ["PRIEST"] = GetSpellInfo(585), ["DRUID"] = GetSpellInfo(5176), ["PALADIN"] = GetSpellInfo(62124), ["SHAMAN"] = GetSpellInfo(403), ["HUNTER"] = GetSpellInfo(75), ["WARLOCK"] = GetSpellInfo(686), ["DEATHKNIGHT"] = GetSpellInfo(49576), ["MAGE"] = GetSpellInfo(133), ["ROGUE"] = GetSpellInfo(2094), ["MONK"] = GetSpellInfo(115546)}, + hostile = {["WARRIOR"] = GetSpellInfo(355), ["PRIEST"] = GetSpellInfo(585), ["DRUID"] = GetSpellInfo(5176), ["PALADIN"] = GetSpellInfo(62124), ["SHAMAN"] = GetSpellInfo(403), ["HUNTER"] = GetSpellInfo(75), ["WARLOCK"] = GetSpellInfo(686), ["DEATHKNIGHT"] = GetSpellInfo(49576), ["MAGE"] = GetSpellInfo(133), ["ROGUE"] = GetSpellInfo(2094), ["MONK"] = GetSpellInfo(115546)}, } ShadowUF:RegisterModule(Range, "range", ShadowUF.L["Range indicator"]) From f4424c08e5e3a6849938e69287c927d2c6e4c234 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 10 Nov 2013 20:19:13 -0800 Subject: [PATCH 434/794] Added ability to show totem icons instead of status bar (dedicated to Raine from MW who asked me this at Blizzcon and then said to include this note) --- modules/totems.lua | 7 ++++++- options/config.lua | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/modules/totems.lua b/modules/totems.lua index e0a7e75f..1202c853 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -127,8 +127,13 @@ end function Totems:Update(frame) local totalActive = 0 for _, indicator in pairs(frame.totemBar.totems) do - local have, name, start, duration = GetTotemInfo(indicator.id) + local have, name, start, duration, icon = GetTotemInfo(indicator.id) + if( have and start > 0 ) then + if( ShadowUF.db.profile.units[frame.unitType].totemBar.icon ) then + indicator:SetStatusBarTexture(icon) + end + indicator.have = true indicator.endTime = start + duration indicator:SetMinMaxValues(0, duration) diff --git a/options/config.lua b/options/config.lua index 4d422f75..d5b7bee6 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4031,6 +4031,38 @@ local function loadUnitOptions() }, }, }, + totemBar = { + order = 3.6, + type = "group", + inline = true, + name = ShadowUF.modules.totemBar.moduleName, + hidden = function(info) + local unit = info[2] + if( unit == "global" ) then + return not globalConfig.totemBar + else + return unit ~= "player" and unit ~= "pet" + end + end, + args = { + enabled = { + order = 1, + type = "toggle", + name = string.format(L["Enable %s"], ShadowUF.modules.totemBar.moduleName), + desc = function(info) + return select(2, UnitClass("player")) == "SHAMAN" and L["Adds totem bars with timers before they expire to the player frame."] or select(2, UnitClass("player")) == "DEATHKNIGHT" and L["Adds a bar indicating how much time is left on your ghoul timer, only used if you do not have a permanent ghoul."] or select(2, UnitClass("player")) == "MAGE" and L["Adds a bar indicating how much time is left on your Rune of Power."] or L["Adds a bar indicating how much time is left on your mushrooms."] + end, + arg = "totemBar.enabled", + }, + icon = { + order = 2, + type = "toggle", + name = L["Show icon durations"], + desc = L["Uses the icon of the totem being shown instead of a status bar."], + arg = "totemBar.icon", + }, + }, + }, emptyBar = { order = 4, type = "group", From 024f98e2b9589a6b85b8ce069f3a9910c60769c4 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 10 Nov 2013 20:31:26 -0800 Subject: [PATCH 435/794] Show the LFG leader icon instead of party leader in LFG --- modules/indicators.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 97b6c50d..a25a97e9 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -112,10 +112,19 @@ function Indicators:UpdateLeader(frame) if( not frame.indicators.leader or not frame.indicators.leader.enabled ) then return end if( UnitIsGroupLeader(frame.unit) ) then - frame.indicators.leader:SetTexture("Interface\\GroupFrame\\UI-Group-LeaderIcon") + if( HasLFGRestrictions() ) then + frame.indicators.leader:SetTexture("Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES") + frame.indicators.leader:SetTexCoord(0, 0.296875, 0.015625, 0.3125) + else + frame.indicators.leader:SetTexture("Interface\\GroupFrame\\UI-Group-LeaderIcon") + frame.indicators.leader:SetTexCoord(0, 1, 0, 1) + end + frame.indicators.leader:Show() + elseif( UnitIsGroupAssistant(frame.unit) or IsEveryoneAssistant() ) then frame.indicators.leader:SetTexture("Interface\\GroupFrame\\UI-Group-AssistantIcon") + frame.indicators.leader:SetTexCoord(0, 1, 0, 1) frame.indicators.leader:Show() else frame.indicators.leader:Hide() From 0c9f5c1ccc1f7ef43555ab16bc0b5fdf83b5392b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 10 Nov 2013 20:36:13 -0800 Subject: [PATCH 436/794] Force create incAbsorb upgrade if it wasn't done --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index ad68c084..d296dfed 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -137,7 +137,7 @@ function ShadowUF:CheckUpgrade() end end - if( revision <= 31 ) then + if( revision <= 31 or not self.db.profile.healthColors.incAbsorb ) then self.db.profile.healthColors.incAbsorb = {r = 0.93, g = 0.75, b = 0.09} for unit, config in pairs(self.db.profile.units) do From ee0b8a571bf276233b2e89b9cf3381607523a1d5 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 13 Nov 2013 19:07:27 -0800 Subject: [PATCH 437/794] max totems for a Resto Druid is 1 rather than 3 --- modules/totems.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/totems.lua b/modules/totems.lua index 1202c853..7657e9c3 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -77,6 +77,10 @@ end function Totems:OnLayoutApplied(frame) if( frame.visibility.totemBar ) then + if( playerClass == "DRUID" ) then + MAX_TOTEMS = GetSpecialization() == 4 and 1 or 3 + end + local barWidth = (frame.totemBar:GetWidth() - (MAX_TOTEMS - 1)) / MAX_TOTEMS for _, totem in pairs(frame.totemBar.totems) do From 0265a03237ece71275bedb9bbfeb16f03108a1eb Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 17 Nov 2013 13:40:21 -0800 Subject: [PATCH 438/794] Fixed a typo in the server tag --- modules/tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tags.lua b/modules/tags.lua index 80dc775d..c3125ff7 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -764,7 +764,7 @@ Tags.defaultTags = { ["name"] = [[function(unit, unitOwner) return UnitName(unitOwner) or UNKNOWN end]], ["server"] = [[function(unit, unitOwner) local server = select(2, UnitName(unitOwner)) - if UnitRealmRelationship(unitOwner) == LE_REALM_RELATION_VIRTUAL + if( UnitRealmRelationship(unitOwner) == LE_REALM_RELATION_VIRTUAL ) then return nil end From 8f22826c5df1e5f209d011ecc3df7fe9bd864ace Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 17 Nov 2013 14:06:47 -0800 Subject: [PATCH 439/794] Fixed cast bar not being able to vertical/horizontal or reverse fill --- modules/cast.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/cast.lua b/modules/cast.lua index 92457eaa..ad9cc4bf 100755 --- a/modules/cast.lua +++ b/modules/cast.lua @@ -67,6 +67,7 @@ function Cast:OnEnable(frame) frame.castBar.bar = ShadowUF.Units:CreateBar(frame) frame.castBar.background = frame.castBar.bar.background frame.castBar.bar.parent = frame + frame.castBar.bar.background = frame.castBar.background frame.castBar.icon = frame.castBar.bar:CreateTexture(nil, "ARTWORK") frame.castBar.bar.name = frame.castBar.bar:CreateFontString(nil, "ARTWORK") @@ -111,6 +112,10 @@ function Cast:OnLayoutApplied(frame, config) frame.castBar.background:SetVertexColor(0, 0, 0, 0) frame.castBar.background:SetHorizTile(false) + -- Setup fill + frame.castBar.bar:SetOrientation(config.castBar.vertical and "VERTICAL" or "HORIZONTAL") + frame.castBar.bar:SetReverseFill(config.castBar.reverse and true or false) + -- Setup the main bar + icon frame.castBar.bar:ClearAllPoints() frame.castBar.bar:SetHeight(frame.castBar:GetHeight()) @@ -183,11 +188,7 @@ end -- Easy coloring local function setBarColor(self, r, g, b) - self:SetStatusBarColor(r, g, b, ShadowUF.db.profile.bars.alpha) - - if( not self.background.overrideColor ) then - self.background:SetVertexColor(r, g, b, ShadowUF.db.profile.bars.backgroundAlpha) - end + self.parent:SetBlockColor(self, "castBar", r, g, b) end -- Cast OnUpdates From 69a87f9744f2ea009d8838f5cc84e60d75177768 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 17 Nov 2013 14:59:30 -0800 Subject: [PATCH 440/794] Implemented core support needed for making cancelable buttons to extend to Totems destroying later --- modules/layout.lua | 11 ++++++++ modules/totems.lua | 63 ++++++++++++++++++++++++++++------------------ options/config.lua | 19 +++++++------- 3 files changed, 58 insertions(+), 35 deletions(-) diff --git a/modules/layout.lua b/modules/layout.lua index cf043507..432022e6 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -74,6 +74,8 @@ function Layout:ToggleVisibility(frame, visible) end function Layout:SetBarVisibility(frame, key, status) + if( frame.secureLocked ) then return end + -- Show the bar if it wasn't already if( status and not frame[key]:IsVisible() ) then ShadowUF.Tags:FastRegister(frame, frame[key]) @@ -122,6 +124,15 @@ end function Layout:Load(frame) local unitConfig = ShadowUF.db.profile.units[frame.unitType] + -- Figure out if we're secure locking + frame.secureLocked = nil + for _, module in pairs(ShadowUF.moduleOrder) do + if( frame.visibility[module.moduleKey] and ShadowUF.db.profile.units[frame.unitType][module.moduleKey].secure ) then + frame.secureLocked = true + break + end + end + -- About to set layout ShadowUF:FireModuleEvent("OnPreLayoutApply", frame, unitConfig) diff --git a/modules/totems.lua b/modules/totems.lua index 7657e9c3..1215f83e 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -27,7 +27,7 @@ function Totems:OnEnable(frame) if( not frame.totemBar ) then frame.totemBar = CreateFrame("Frame", nil, frame) frame.totemBar.totems = {} - + local priorities = (select(2, UnitClass("player")) == "SHAMAN") and SHAMAN_TOTEM_PRIORITIES or STANDARD_TOTEM_PRIORITIES for id=1, MAX_TOTEMS do @@ -76,34 +76,47 @@ function Totems:OnDisable(frame) end function Totems:OnLayoutApplied(frame) - if( frame.visibility.totemBar ) then - if( playerClass == "DRUID" ) then - MAX_TOTEMS = GetSpecialization() == 4 and 1 or 3 - end - - local barWidth = (frame.totemBar:GetWidth() - (MAX_TOTEMS - 1)) / MAX_TOTEMS - - for _, totem in pairs(frame.totemBar.totems) do - totem:SetHeight(frame.totemBar:GetHeight()) - totem:SetWidth(barWidth) - totem:SetOrientation(ShadowUF.db.profile.units[frame.unitType].totemBar.vertical and "VERTICAL" or "HORIZONTAL") - totem:SetReverseFill(ShadowUF.db.profile.units[frame.unitType].totemBar.reverse and true or false) - totem:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) - totem:GetStatusBarTexture():SetHorizTile(false) - - totem.background:SetTexture(ShadowUF.Layout.mediaPath.statusbar) - - if( ShadowUF.db.profile.units[frame.unitType].totemBar.background or ShadowUF.db.profile.units[frame.unitType].totemBar.invert ) then - totem.background:Show() - else - totem.background:Hide() - end + if( not frame.visibility.totemBar ) then return end - frame:SetBlockColor(totem, "totemBar", totemColors[totem.id].r, totemColors[totem.id].g, totemColors[totem.id].b) + if( playerClass == "DRUID" ) then + MAX_TOTEMS = GetSpecialization() == 4 and 1 or 3 + end + + local barWidth = (frame.totemBar:GetWidth() - (MAX_TOTEMS - 1)) / MAX_TOTEMS + local config = ShadowUF.db.profile.units[frame.unitType].totemBar + + for _, totem in pairs(frame.totemBar.totems) do + totem:SetHeight(frame.totemBar:GetHeight()) + totem:SetWidth(barWidth) + totem:SetOrientation(ShadowUF.db.profile.units[frame.unitType].totemBar.vertical and "VERTICAL" or "HORIZONTAL") + totem:SetReverseFill(ShadowUF.db.profile.units[frame.unitType].totemBar.reverse and true or false) + totem:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) + totem:GetStatusBarTexture():SetHorizTile(false) + + totem.background:SetTexture(ShadowUF.Layout.mediaPath.statusbar) + + if( config.background or config.invert ) then + totem.background:Show() + else + totem.background:Hide() end - self:Update(frame) + frame:SetBlockColor(totem, "totemBar", totemColors[totem.id].r, totemColors[totem.id].g, totemColors[totem.id].b) + + if( config.secure ) then + totem.secure = totem.secure or CreateFrame("Button", frame:GetName() .. "Secure" .. totem.id, totem, "SecureUnitButtonTemplate") + totem.secure:RegisterForClicks("RightButtonUp") + totem.secure:SetAllPoints(totem) + totem.secure:SetAttribute("type2", "macro") + totem.secure:SetAttribute("macrotext2", "/click TotemFrameTotem" .. totem.id .. " RightButton") + totem.secure:Show() + + elseif( totem.secure ) then + totem.secure:Hide() + end end + + self:Update(frame) end local function totemMonitor(self, elapsed) diff --git a/options/config.lua b/options/config.lua index d5b7bee6..24c1cac9 100755 --- a/options/config.lua +++ b/options/config.lua @@ -3887,16 +3887,6 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "burningEmbersBar.enabled", }, - totemBar = { - order = 1.5, - type = "toggle", - name = string.format(L["Enable %s"], ShadowUF.modules.totemBar.moduleName), - desc = function(info) - return select(2, UnitClass("player")) == "SHAMAN" and L["Adds totem bars with timers before they expire to the player frame."] or select(2, UnitClass("player")) == "DEATHKNIGHT" and L["Adds a bar indicating how much time is left on your ghoul timer, only used if you do not have a permanent ghoul."] or select(2, UnitClass("player")) == "MAGE" and L["Adds a bar indicating how much time is left on your Rune of Power."] or L["Adds a bar indicating how much time is left on your mushrooms."] - end, - hidden = hideRestrictedOption, - arg = "totemBar.enabled", - }, druidBar = { order = 3, type = "toggle", @@ -4061,6 +4051,15 @@ local function loadUnitOptions() desc = L["Uses the icon of the totem being shown instead of a status bar."], arg = "totemBar.icon", }, + --secure = { + -- order = 3, + -- type = "toggle", + -- name = L["Dismissable totems bars"], + -- desc = function(info) + -- return L["Allows you to disable the totem by right clicking it.|n|nWarning: Inner bars for this unit will not resize in combat if you enable this."] + -- end, + -- arg = "totemBar.secure", + --}, }, }, emptyBar = { From 2e8b16aa0b25a2f1d8606ecc6cddcb162bb87efc Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 17 Nov 2013 17:59:47 -0800 Subject: [PATCH 441/794] Implemented an heal absorb bar to show much healing will be absorbed --- ShadowedUnitFrames.lua | 7 +++++- ShadowedUnitFrames.toc | 1 + modules/defaultlayout.lua | 26 ++++++++++++++++++++++ modules/healabsorb.lua | 19 ++++++++++++++++ modules/incabsorb.lua | 19 +++++++++++++--- modules/incheal.lua | 18 ++++++++++++--- modules/movers.lua | 3 +++ modules/tags.lua | 14 ++++++++++++ options/config.lua | 46 +++++++++++++++++++++++++++++++++++---- 9 files changed, 142 insertions(+), 11 deletions(-) create mode 100755 modules/healabsorb.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index d296dfed..94222d15 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 35 +ShadowUF.dbRevision = 37 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -102,6 +102,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 37 ) then + self.db.profile.healthColors.healAbsorb = {r = 0.68, g = 0.47, b = 1} + end + if( revision <= 34 ) then self.db.profile.units.player.staggerBar = {enabled = true, background = true, height = 0.30, order = 70} self.db.profile.powerColors.STAGGER_GREEN = {r = 0.52, g = 1.0, b = 0.52} @@ -369,6 +373,7 @@ function ShadowUF:LoadUnitDefaults() emptyBar = {enabled = false}, portrait = {enabled = false}, castBar = {enabled = false, name = {}, time = {}}, + healAbsorb = {enabled = true, cap = 1.30}, text = { {enabled = true, name = L["Left text"], text = "[name]", anchorPoint = "C", anchorTo = "$healthBar", size = 0}, {enabled = true, name = L["Right text"], text = "[curmaxhp]", anchorPoint = "C", anchorTo = "$healthBar", size = 0}, diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index a41c7653..3b0fcb2c 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -44,6 +44,7 @@ modules\fader.lua modules\combopoints.lua modules\incheal.lua modules\incabsorb.lua +modules\healabsorb.lua modules\range.lua modules\empty.lua modules\druid.lua diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 32954759..ccdacc84 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -177,6 +177,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) yellow = {r = 0.93, g = 0.93, b = 0.0}, inc = {r = 0, g = 0.35, b = 0.23}, incAbsorb = {r = 0.93, g = 0.75, b = 0.09}, + healAbsorb = {r = 0.68, g = 0.47, b = 1}, enemyUnattack = {r = 0.60, g = 0.20, b = 0.20}, hostile = {r = 0.90, g = 0.0, b = 0.0}, aggro = {r = 0.90, g = 0.0, b = 0.0}, @@ -278,6 +279,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) powerBar = {height = 0.30}, incHeal = {cap = 1}, incAbsorb = {cap = 1}, + healAbsorb = {cap = 1}, indicators = { pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, masterLoot = {anchorTo = "$parent", anchorPoint = "TR", size = 12, x = -2, y = -10}, @@ -308,6 +310,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) powerBar = {height = 0.30}, incHeal = {cap = 1}, incAbsorb = {cap = 1}, + healAbsorb = {cap = 1}, indicators = { pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, masterLoot = {anchorTo = "$parent", anchorPoint = "TR", size = 12, x = -2, y = -10}, @@ -344,6 +347,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) shadowOrbs = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, incHeal = {cap = 1}, incAbsorb = {cap = 1}, + healAbsorb = {cap = 1}, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, }, @@ -374,6 +378,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) offset = 23, incHeal = {cap = 1}, incAbsorb = {cap = 1}, + healAbsorb = {cap = 1}, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, phase = {enabled = true, anchorPoint = "RC", size = 26, x = -17, y = 0, anchorTo = "$parent"} @@ -399,6 +404,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) attribAnchorPoint = "LEFT", offset = 20, altPower = {enabled = false}, + healAbsorb = {cap = 1}, auras = { buffs = {enabled = true, maxRows = 1, perRow = 8}, debuffs = {enabled = true, maxRows = 1, perRow = 8}, @@ -416,6 +422,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) width = 90, height = 25, scale = 1.0, + healAbsorb = {cap = 1}, powerBar = {height = 0.60}, text = { {text = "[name]"}, @@ -435,6 +442,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) altPower = {enabled = false}, castBar = {order = 60}, offset = 25, + healAbsorb = {cap = 1}, auras = { buffs = {enabled = true, maxRows = 1, perRow = 9}, debuffs = {enabled = true, maxRows = 1, perRow = 9}, @@ -453,6 +461,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) scale = 1.0, powerBar = {height = 0.60}, altPower = {enabled = false}, + healAbsorb = {cap = 1}, text = { {text = "[name]"}, {text = "[curhp]"}, @@ -467,6 +476,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) scale = 1.0, powerBar = {height = 0.60}, altPower = {enabled = false}, + healAbsorb = {cap = 1}, indicators = { pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, }, @@ -488,6 +498,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) powerBar = {height = 0.5}, altPower = {enabled = false}, castBar = {order = 60}, + healAbsorb = {cap = 1}, offset = 0, auras = { buffs = {enabled = false, maxRows = 1, perRow = 9}, @@ -510,6 +521,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) scale = 1.0, powerBar = {height = 0.60}, altPower = {enabled = false}, + healAbsorb = {cap = 1}, text = { {text = "[name]"}, {text = "[curhp]"}, @@ -524,6 +536,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) scale = 1.0, powerBar = {height = 0.60}, altPower = {enabled = false}, + healAbsorb = {cap = 1}, indicators = { pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, }, @@ -547,6 +560,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) columnSpacing = 5, incHeal = {cap = 1}, incAbsorb = {cap = 1}, + healAbsorb = {cap = 1}, portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, indicators = { @@ -592,8 +606,10 @@ function ShadowUF:LoadDefaultLayout(useMerge) columnSpacing = 5, incHeal = {cap = 1}, incAbsorb = {cap = 1}, + healAbsorb = {cap = 1}, portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, + healAbsorb = {cap = 1}, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, }, @@ -613,6 +629,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) width = 150, height = 40, scale = 1.0, + healAbsorb = {cap = 1}, auras = { buffs = {enabled = false}, debuffs = {enabled = false}, @@ -629,6 +646,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) width = 90, height = 25, scale = 1.0, + healAbsorb = {cap = 1}, powerBar = {height = 0.60}, text = { {text = "[name]"}, @@ -643,6 +661,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) height = 25, scale = 1.0, powerBar = {height = 0.60}, + healAbsorb = {cap = 1}, indicators = { pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, }, @@ -661,6 +680,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) portrait = {enabled = true, alignment = "RIGHT", fullAfter = 50}, incHeal = {cap = 1}, incAbsorb = {cap = 1}, + healAbsorb = {cap = 1}, castBar = {order = 60}, comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, indicators = { @@ -686,6 +706,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) height = 30, scale = 1.0, powerBar = {height = 0.70}, + healAbsorb = {cap = 1}, healthBar = {reactionType = "none"}, portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, @@ -701,6 +722,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) width = 190, height = 30, scale = 1.0, + healAbsorb = {cap = 1}, powerBar = {height = 0.70}, indicators = { }, @@ -717,6 +739,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) height = 28, scale = 1.0, powerBar = {height = 0.60}, + healAbsorb = {cap = 1}, portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, indicators = { @@ -738,6 +761,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) height = 25, scale = 1.0, powerBar = {height = 0.60}, + healAbsorb = {cap = 1}, portrait = {alignment = "RIGHT"}, indicators = { pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = -3, y = 11}, @@ -755,6 +779,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) height = 30, scale = 1.0, powerBar = {height = 0.6}, + healAbsorb = {cap = 1}, portrait = {alignment = "RIGHT"}, indicators = { pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = -3, y = 11}, @@ -771,6 +796,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) height = 30, scale = 1.0, powerBar = {height = 0.6}, + healAbsorb = {cap = 1}, portrait = {alignment = "RIGHT"}, indicators = { pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = -3, y = 11}, diff --git a/modules/healabsorb.lua b/modules/healabsorb.lua new file mode 100755 index 00000000..498d2aac --- /dev/null +++ b/modules/healabsorb.lua @@ -0,0 +1,19 @@ +local HealAbsorb = setmetatable({["frameKey"] = "healAbsorb", ["colorKey"] = "healAbsorb", ["frameLevelMod"] = 1}, {__index = ShadowUF.IncHeal}) +ShadowUF:RegisterModule(HealAbsorb, "healAbsorb", ShadowUF.L["Healing absorb"]) + +function HealAbsorb:OnEnable(frame) + frame.healAbsorb = frame.healAbsorb or ShadowUF.Units:CreateBar(frame) + + frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "UpdateFrame") + frame:RegisterUnitEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", self, "UpdateFrame") + + frame:RegisterUpdateFunc(self, "UpdateFrame") +end + +function HealAbsorb:UpdateFrame(frame) + if( not frame.visibility[self.frameKey] or not frame.visibility.healthBar ) then return end + + self:PositionBar(frame, UnitGetTotalHealAbsorbs(frame.unit) or 0) +end \ No newline at end of file diff --git a/modules/incabsorb.lua b/modules/incabsorb.lua index 631f2484..0c22b2fd 100755 --- a/modules/incabsorb.lua +++ b/modules/incabsorb.lua @@ -1,4 +1,4 @@ -local IncAbsorb = setmetatable({["frameKey"] = "incAbsorb", ["colorKey"] = "incAbsorb", ["frameLevelMod"] = 2}, {__index = ShadowUF.IncHeal}) +local IncAbsorb = setmetatable({["frameKey"] = "incAbsorb", ["colorKey"] = "incAbsorb", ["frameLevelMod"] = 3}, {__index = ShadowUF.IncHeal}) ShadowUF:RegisterModule(IncAbsorb, "incAbsorb", ShadowUF.L["Incoming absorbs"]) function IncAbsorb:OnEnable(frame) @@ -21,6 +21,12 @@ function IncAbsorb:OnLayoutApplied(frame) frame:UnregisterSingleEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") end + if( frame.visibility.healAbsorb ) then + frame:RegisterUnitEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", self, "UpdateFrame") + else + frame:UnregisterSingleEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", self, "UpdateFrame") + end + ShadowUF.IncHeal.OnLayoutApplied(self, frame) end @@ -28,9 +34,16 @@ function IncAbsorb:UpdateFrame(frame) if( not frame.visibility[self.frameKey] or not frame.visibility.healthBar ) then return end local amount = UnitGetTotalAbsorbs(frame.unit) or 0 + -- Obviously we only want to add incoming heals if we have something being absorbed - if( amount > 0 and frame.visibility.incHeal ) then - amount = amount + (UnitGetIncomingHeals(frame.unit) or 0) + if( amount > 0 ) then + if( frame.visibility.incHeal ) then + amount = amount + (UnitGetIncomingHeals(frame.unit) or 0) + end + + if( frame.visibility.healAbsorb ) then + amount = amount + (UnitGetTotalHealAbsorbs(frame.unit) or 0) + end end self:PositionBar(frame, amount) diff --git a/modules/incheal.lua b/modules/incheal.lua index 4f4b8939..72ae2338 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -1,4 +1,4 @@ -local IncHeal = {["frameKey"] = "incHeal", ["colorKey"] = "inc", ["frameLevelMod"] = 1} +local IncHeal = {["frameKey"] = "incHeal", ["colorKey"] = "inc", ["frameLevelMod"] = 2} ShadowUF.IncHeal = IncHeal ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) @@ -9,7 +9,7 @@ function IncHeal:OnEnable(frame) frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", self, "UpdateFrame") - + frame:RegisterUpdateFunc(self, "UpdateFrame") end @@ -22,6 +22,12 @@ function IncHeal:OnLayoutApplied(frame) local bar = frame[self.frameKey] if( not frame.visibility[self.frameKey] or not frame.visibility.healthBar ) then return end + if( frame.visibility.healAbsorb ) then + frame:RegisterUnitEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", self, "UpdateFrame") + else + frame:UnregisterSingleEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", self, "UpdateFrame") + end + -- Since we're hiding, reset state bar.total = nil @@ -126,5 +132,11 @@ end function IncHeal:UpdateFrame(frame) if( not frame.visibility[self.frameKey] or not frame.visibility.healthBar ) then return end - self:PositionBar(frame, UnitGetIncomingHeals(frame.unit) or 0) + + local amount = UnitGetIncomingHeals(frame.unit) or 0 + if( amount > 0 and frame.visibility.healAbsorb ) then + amount = amount + (UnitGetTotalHealAbsorbs(frame.unit) or 0) + end + + self:PositionBar(frame, amount) end diff --git a/modules/movers.lua b/modules/movers.lua index ab623402..daecfd8d 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -55,6 +55,9 @@ local function createConfigEnv() return getValue("UnitPower", unit, math.random(20000, 50000)) end, + UnitGetTotalHealAbsorbs = function(unit) + return getValue("UnitGetTotalHealAbsorbs", unit, math.random(5000, 10000)) + end, UnitGetIncomingHeals = function(unit) return getValue("UnitGetIncomingHeals", unit, math.random(10000, 15000)) end, diff --git a/modules/tags.lua b/modules/tags.lua index c3125ff7..0dec767a 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1013,6 +1013,14 @@ Tags.defaultTags = { local absorb = UnitGetTotalAbsorbs(unit) return absorb and absorb > 0 and string.format("+%d", absorb) or ShadowUF.tagFunc.name(unit, unitOwner, fontString) end]], + ["abs:healabsorb"] = [[function(unit, unitOwner, fontString) + local absorb = UnitGetTotalHealAbsorbs(unit) + return absorb and absorb > 0 and string.format("%d", absorb) + end]], + ["healabsorb"] = [[function(unit, unitOwner, fontString) + local absorb = UnitGetTotalHealAbsorbs(unit) + return absorb and absorb > 0 and ShadowUF:FormatLargeNumber(absorb) + end]], ["unit:raid:targeting"] = [[function(unit, unitOwner, fontString) if( GetNumGroupMembers() == 0 ) then return nil end local guid = UnitGUID(unit) @@ -1056,6 +1064,8 @@ Tags.defaultEvents = { ["abs:incabsorb"] = "UNIT_ABSORB_AMOUNT_CHANGED", ["incabsorb"] = "UNIT_ABSORB_AMOUNT_CHANGED", ["incabsorb:name"] = "UNIT_ABSORB_AMOUNT_CHANGED", + ["abs:healabsorb"] = "UNIT_HEAL_ABSORB_AMOUNT_CHANGED", + ["healabsorb"] = "UNIT_HEAL_ABSORB_AMOUNT_CHANGED", -- ["crtabs"] = "CRTABS", -- ["abs:crtabs"] = "CRTABS", -- ["crtabs:name"] = "CRTABS", @@ -1240,6 +1250,8 @@ Tags.defaultHelp = { ["per:incheal"] = L["Percent of the players current health that's being healed, if they have 100,000 total health and 15,000 is incoming then 15% is shown."], ["abs:incheal"] = L["Absolute incoming heal value, if 10,000 healing is incoming it will show 10,000."], ["incheal"] = L["Shorten incoming heal value, if 13,000 healing is incoming it will show 13k."], + ["abs:healabsorb"] = L["Absolute heal absorb value, if 16,000 healing will be absorbed, it will show 16,000."], + ["healabsorb"] = L["Shorten heal absorb value, if 17,000 healing will be absorbed, it will show 17k."], ["incheal:name"] = L["If the unit has heals incoming, it will show the absolute incoming heal value, otherwise it will show the units name."], ["smart:curmaxhp"] = L["Smart number formating for [curmaxhp], numbers below 1,000,000 are left as is, numbers above 1,000,000 will use the short version such as 1m."], ["smart:curmaxpp"] = L["Smart number formating for [curmaxpp], numbers below 1,000,000 are left as is, numbers above 1,000,000 will use the short version such as 1m."], @@ -1325,6 +1337,8 @@ Tags.defaultNames = { ["incabsorb:name"] = L["Damage absorption/Name"], ["per:incheal"] = L["Incoming heal (Percent)"], ["incheal:name"] = L["Incoming heal/Name"], + ["abs:healabsorb"] = L["Heal Absorb (Absolute)"], + ["healabsorb"] = L["Heal Absorb (Short)"], ["unit:scaled:threat"] = L["Unit scaled threat"], ["unit:color:sit"] = L["Unit colored situation"], ["unit:situation"] = L["Unit situation name"], diff --git a/options/config.lua b/options/config.lua index 24c1cac9..b80b8cd6 100755 --- a/options/config.lua +++ b/options/config.lua @@ -218,7 +218,7 @@ local function setVariable(unit, moduleKey, moduleSubKey, key, value) end local function specialRestricted(unit, moduleKey, moduleSubKey, key) - if( ShadowUF.fakeUnits[unit] and ( key == "colorAggro" or key == "aggro" or moduleKey == "incHeal" or moduleKey == "incAbsorb" or moduleKey == "castBar" ) ) then + if( ShadowUF.fakeUnits[unit] and ( key == "colorAggro" or key == "aggro" or moduleKey == "incHeal" or moduleKey == "healAbsorb" or moduleKey == "incAbsorb" or moduleKey == "castBar" ) ) then return true elseif( moduleKey == "healthBar" and unit == "player" and key == "reaction" ) then return true @@ -295,7 +295,7 @@ local function hideRestrictedOption(info) local key = info[#(info)] if( ShadowUF.modules[key] and ShadowUF.modules[key].moduleClass and ShadowUF.modules[key].moduleClass ~= playerClass ) then return true - elseif( ( key == "incHeal" and not ShadowUF.modules.incHeal ) or ( key == "incAbsorb" and not ShadowUF.modules.incAbsorb ) ) then + elseif( ( key == "incHeal" and not ShadowUF.modules.incHeal ) or ( key == "incAbsorb" and not ShadowUF.modules.incAbsorb ) or ( key == "healAbsorb" and not ShadowUF.modules.healAbsorb ) ) then return true -- Non-standard units do not support color by aggro or incoming heal elseif( key == "colorAggro" or key == "incHeal" or key == "incAbsorb" or key == "aggro" ) then @@ -575,7 +575,7 @@ local function loadGeneralOptions() -- Strip module settings that aren't with SUF by default if( not layoutData.modules ) then - local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incAbsorb"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true, ["demonicFuryBar"] = true, ["burningEmbersBar"] = true, ["chi"] = true, ["shadowOrbs"] = true, ["auraPoints"] = true, ["staggerBar"] = true} + local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incAbsorb"] = true, ["healAbsorb"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true, ["demonicFuryBar"] = true, ["burningEmbersBar"] = true, ["chi"] = true, ["shadowOrbs"] = true, ["auraPoints"] = true, ["staggerBar"] = true} for _, unitData in pairs(layout.units) do for key, data in pairs(unitData) do if( type(data) == "table" and not validModules[key] and ShadowUF.modules[key] ) then @@ -1046,9 +1046,16 @@ local function loadGeneralOptions() desc = L["Color to use to show how much damage will be absorbed."], arg = "healthColors.incAbsorb", }, - enemyUnattack = { + healAbsorb = { order = 10, type = "color", + name = L["Heal absorb"], + desc = L["Color to use to show how much healing will e absorbed."], + arg = "healthColors.healAbsorb", + }, + enemyUnattack = { + order = 11, + type = "color", name = L["Unattackable hostile"], desc = L["Health bar color to use for hostile units who you cannot attack, used for reaction coloring."], hidden = hideAdvancedOption, @@ -3959,6 +3966,37 @@ local function loadUnitOptions() }, }, }, + healAbsorb = { + order = 2.5, + type = "group", + inline = true, + name = L["Heal absorbs"], + hidden = function(info) return ShadowUF.Units.zoneUnits[info[2]] or hideRestrictedOption(info) end, + disabled = function(info) return not getVariable(info[2], "healthBar", nil, "enabled") end, + args = { + heals = { + order = 1, + type = "toggle", + name = L["Show Heal Absorbs"], + desc = L["Adds a bar inside the health bar indicating how much healing will be absorbed and not applied to the player."], + arg = "healAbsorb.enabled", + hidden = false, + set = function(info, value) + setUnit(info, value) + setDirectUnit(info[2], "healAbsorb", nil, "enabled", getVariable(info[2], "healAbsorb", nil, "enabled")) + end + }, + cap = { + order = 3, + type = "range", + name = L["Outside bar limit"], + desc = L["Percentage value of how far outside the unit frame the absorbed health bar can go. 130% means it will go 30% outside the frame, 100% means it will not go outside."], + min = 1, max = 1.50, step = 0.05, isPercent = true, + arg = "healAbsorb.cap", + hidden = false, + }, + }, + }, incHeal = { order = 3, type = "group", From 72990d4bf7b22cb40be1a87a0667fa32e1f8c362 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 19 Nov 2013 20:11:03 -0800 Subject: [PATCH 442/794] Scale stack font by 60% of aura size from now on --- modules/auras.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/auras.lua b/modules/auras.lua index 949ffc3f..22c738b4 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -266,6 +266,8 @@ local function updateButton(id, group, config) button:SetWidth(config.size) button.border:SetHeight(config.size + 1) button.border:SetWidth(config.size + 1) + button.stack:SetFont("Interface\\AddOns\\ShadowedUnitFrames\\media\\fonts\\Myriad Condensed Web.ttf", math.floor((config.size * 0.60) + 0.5), "OUTLINE") + button:SetScript("OnClick", cancelAura) button.parent = group.parent button:ClearAllPoints() From 2d2f97b1dcd5b64ffaf8d069f1ae2176f95fc07a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 26 Nov 2013 22:35:21 -0800 Subject: [PATCH 443/794] don't color totem bar icons by color when using icon display --- modules/totems.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/totems.lua b/modules/totems.lua index 1215f83e..daabdb6d 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -101,7 +101,9 @@ function Totems:OnLayoutApplied(frame) totem.background:Hide() end - frame:SetBlockColor(totem, "totemBar", totemColors[totem.id].r, totemColors[totem.id].g, totemColors[totem.id].b) + if( not ShadowUF.db.profile.units[frame.unitType].totemBar.icon ) then + frame:SetBlockColor(totem, "totemBar", totemColors[totem.id].r, totemColors[totem.id].g, totemColors[totem.id].b) + end if( config.secure ) then totem.secure = totem.secure or CreateFrame("Button", frame:GetName() .. "Secure" .. totem.id, totem, "SecureUnitButtonTemplate") From 09f96b050aa916f7dfc2c70ea9408b42848708d3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 29 Nov 2013 15:04:38 -0800 Subject: [PATCH 444/794] when everyone is a raid assist is enaled, only show the icon if the unit is in your raid --- modules/indicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index a25a97e9..952a73f0 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -122,7 +122,7 @@ function Indicators:UpdateLeader(frame) frame.indicators.leader:Show() - elseif( UnitIsGroupAssistant(frame.unit) or IsEveryoneAssistant() ) then + elseif( UnitIsGroupAssistant(frame.unit) or ( UnitInRaid(frame.unit) and IsEveryoneAssistant() ) ) then frame.indicators.leader:SetTexture("Interface\\GroupFrame\\UI-Group-AssistantIcon") frame.indicators.leader:SetTexCoord(0, 1, 0, 1) frame.indicators.leader:Show() From 1edc230db39e2aa78f774e0e48ea2b3c5e2e3412 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 30 Nov 2013 19:01:29 -0800 Subject: [PATCH 445/794] Fixed visual issues with rune/totem/etc bars when you have another bar dynamically showing and hiding - Fixed totem bars not instantly hiding when a class only has 1 totem and it hits 0 seconds - Fully disable deletion of default text tags - Added timers for totems/runes --- ShadowedUnitFrames.lua | 33 ++++++++++++------- ShadowedUnitFrames.toc | 1 + modules/defaultlayout.lua | 16 ++++++---- modules/helpers.lua | 33 +++++++++++++++++++ modules/layout.lua | 67 ++++++++++++++++++++++++++------------- modules/runes.lua | 48 +++++++++++++++++----------- modules/tags.lua | 25 ++++++++++++++- modules/totems.lua | 24 ++++++++++++-- options/config.lua | 48 ++++++++++++++++++++++++---- 9 files changed, 226 insertions(+), 69 deletions(-) create mode 100755 modules/helpers.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 94222d15..68b2d654 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 37 +ShadowUF.dbRevision = 39 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -89,19 +89,26 @@ function ShadowUF:CheckBuild() local build = select(4, GetBuildInfo()) if( self.db.profile.wowBuild == build ) then return end - if( build == 50200 ) then - self:Print("NOTE! As of 5.2.0, you can now use menus to perform secure actions such as Set/Clear Focus or reporting.") - self:Print("SUF has been tested and confirmed to work with this setup. If menus do not show up, you may need to update Clique.") - self:Print("If you still get action blocked issues, it is another addons fault and you should yell at that author for doing something bad.") - self:Print("Raid dropdowns will still cause action blocked issues due to a bug with the toggle system unfortunately.") - end + -- Nothing to add here right now self.db.profile.wowBuild = build end - function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 38 ) then + table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Timer Text"], text = "", anchorTo = "$runeBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true}) + table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Timer Text"], text = "", anchorTo = "$totemBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true}) + + for _, config in pairs(self.db.profile.units) do + for id, text in pairs(config.text) do + if( id <= 5 ) then + text.default = true + end + end + end + end + if( revision <= 37 ) then self.db.profile.healthColors.healAbsorb = {r = 0.68, g = 0.47, b = 1} end @@ -191,7 +198,7 @@ function ShadowUF:CheckUpgrade() end if( revision <= 25 ) then - table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = -1, x = 0, y = 0}) + table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = -1, x = 0, y = 0, default = true}) end if( revision <= 24 ) then @@ -231,7 +238,7 @@ function ShadowUF:CheckUpgrade() if( revision <= 19 ) then self.db.profile.units.pet.altPowerBar.enabled = true - table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[warlock:demonic:curpp]", anchorTo = "$demonicFuryBar", anchorPoint = "C", size = -1, x = 0, y = 0}) + table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[warlock:demonic:curpp]", anchorTo = "$demonicFuryBar", anchorPoint = "C", size = -1, x = 0, y = 0, default = true}) end if( revision <= 18 ) then @@ -447,8 +454,10 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.chi = {enabled = true, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} self.defaults.profile.units.player.auraPoints = {enabled = false, isBar = true} - table.insert(self.defaults.profile.units.player.text, {enabled = false, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0}) - table.insert(self.defaults.profile.units.player.text, {enabled = false, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0}) + table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) + table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) + table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) + table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) -- PET self.defaults.profile.units.pet.enabled = true diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 3b0fcb2c..61991f57 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -24,6 +24,7 @@ localization\zhCN.lua localization\zhTW.lua ShadowedUnitFrames.lua +modules\helpers.lua modules\units.lua modules\layout.lua modules\movers.lua diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index ccdacc84..b1a4ba66 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -233,13 +233,13 @@ function ShadowUF:LoadDefaultLayout(useMerge) debuffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0}, }, text = { - {width = 0.50, name = L["Left text"], anchorTo = "$healthBar", anchorPoint = "CLI", x = 3, y = 0, size = 0}, - {width = 0.60, name = L["Right text"], anchorTo = "$healthBar", anchorPoint = "CRI", x = -3, y = 0, size = 0}, + {width = 0.50, name = L["Left text"], anchorTo = "$healthBar", anchorPoint = "CLI", x = 3, y = 0, size = 0, default = true}, + {width = 0.60, name = L["Right text"], anchorTo = "$healthBar", anchorPoint = "CRI", x = -3, y = 0, size = 0, default = true}, - {width = 0.50, name = L["Left text"], anchorTo = "$powerBar", anchorPoint = "CLI", x = 3, y = 0, size = 0}, - {width = 0.60, name = L["Right text"], anchorTo = "$powerBar", anchorPoint = "CRI", x = -3, y = 0, size = 0}, + {width = 0.50, name = L["Left text"], anchorTo = "$powerBar", anchorPoint = "CLI", x = 3, y = 0, size = 0, default = true}, + {width = 0.60, name = L["Right text"], anchorTo = "$powerBar", anchorPoint = "CRI", x = -3, y = 0, size = 0, default = true}, - {width = 1, name = L["Text"], anchorTo = "$emptyBar", anchorPoint = "CLI", x = 3, y = 0, size = 0}, + {width = 1, name = L["Text"], anchorTo = "$emptyBar", anchorPoint = "CLI", x = 3, y = 0, size = 0, default = true}, }, indicators = { raidTarget = {anchorTo = "$parent", anchorPoint = "C", size = 20, x = 0, y = 0}, @@ -361,8 +361,10 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[perpp]"}, {text = "[curmaxpp]"}, {text = "[(()afk() )][name][( ()group())]"}, - {enabled = true, width = 1, name = L["Text"], text = "[warlock:demonic:curpp]", anchorTo = "$demonicFuryBar", anchorPoint = "C", x = 3, y = 0, size = -1}, - {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = 0, x = 0, y = 0} + {enabled = true, width = 1, name = L["Text"], text = "[warlock:demonic:curpp]", anchorTo = "$demonicFuryBar", anchorPoint = "C", x = 3, y = 0, size = -1, default = true}, + {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = 0, x = 0, y = 0, default = true}, + {enabled = true, width = 1, name = L["Timer Text"], text = "[totem:timer]", anchorTo = "$totemBar", anchorPoint = "C", x = 0, y = 0, size = 0, default = true, block = true}, + {enabled = true, width = 1, name = L["Timer Text"], text = "[rune:timer]", anchorTo = "$runeBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true} }, }, party = { diff --git a/modules/helpers.lua b/modules/helpers.lua new file mode 100755 index 00000000..be85304d --- /dev/null +++ b/modules/helpers.lua @@ -0,0 +1,33 @@ +-- Block Timers +local BlockTimers = {} +function BlockTimers:Inject(module, event) + ShadowUF.Tags.customEvents["SUF_" .. event] = module + module.EnableTag = BlockTimers.EnableTag + module.DisableTag = BlockTimers.DisableTag +end + +function BlockTimers:EnableTag(frame, fontString) + fontString.block.fontString = fontString +end + +function BlockTimers:DisableTag(frame, fontString) + fontString.block.fontString = nil +end + + +ShadowUF.BlockTimers = BlockTimers; + +-- Dynamic Blocks +local DynamicBlocks = {} +function DynamicBlocks:Inject(module) + module.OnLayoutWidgets = function(self, frame) + if( not frame.visibility[module.moduleKey] ) then return end + + local height = frame[module.moduleKey]:GetHeight() + for _, block in pairs(frame[module.moduleKey].blocks) do + block:SetHeight(height) + end + end +end + +ShadowUF.DynamicBlocks = DynamicBlocks \ No newline at end of file diff --git a/modules/layout.lua b/modules/layout.lua index 432022e6..5dd9c327 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -295,6 +295,10 @@ function Layout:AnchorFrame(parent, frame, config) return end end + + if( config.block ) then + anchorTo = anchorTo.blocks[frame.blockID] + end -- Figure out where it's anchored local point = config.point and config.point ~= "" and config.point or preDefPoint[config.anchorPoint] or "CENTER" @@ -410,6 +414,38 @@ function Layout:SetupFontString(fontString, extraSize) end local totalWeight = {} +function Layout:InitFontString(parent, frame, id, config, blockID) + local rowID = blockID and tonumber(id .. "." .. blockID) or id + + local fontString = frame.fontStrings[rowID] or frame.highFrame:CreateFontString(nil, "ARTWORK") + fontString.configID = id + if( blockID ) then + fontString.blockID = blockID + fontString.block = parent.blocks[blockID] + end + + self:SetupFontString(fontString, config.size) + fontString:SetTextColor(ShadowUF.db.profile.font.color.r, ShadowUF.db.profile.font.color.g, ShadowUF.db.profile.font.color.b, ShadowUF.db.profile.font.color.a) + fontString:SetText(config.text) + fontString:SetJustifyH(self:GetJustify(config)) + self:AnchorFrame(frame, fontString, config) + + -- We figure out the anchor point so we can put text in the same area with the same width requirements + local anchorPoint = columnDirection[config.anchorPoint] + if( string.len(config.anchorPoint) == 3 ) then anchorPoint = anchorPoint .. "I" end + + fontString.parentBar = parent + fontString.availableWidth = parent:GetWidth() - config.x + fontString.widthID = config.anchorTo .. anchorPoint .. config.y + totalWeight[fontString.widthID] = (totalWeight[fontString.widthID] or 0) + config.width + + ShadowUF.Tags:Register(frame, fontString, config.text) + fontString:UpdateTags() + fontString:Show() + + frame.fontStrings[rowID] = fontString +end + function Layout:SetupText(frame, config) -- Update tag text frame.fontStrings = frame.fontStrings or {} @@ -425,32 +461,19 @@ function Layout:SetupText(frame, config) local module = string.sub(row.anchorTo, 2) local parent = row.anchorTo == "$parent" and frame or frame[module] if( parent and ( ShadowUF.modules[module].defaultVisibility == false or parent:IsShown() ) and row.enabled and row.text ~= "" ) then - local fontString = frame.fontStrings[id] or frame.highFrame:CreateFontString(nil, "ARTWORK") - self:SetupFontString(fontString, row.size) - fontString:SetTextColor(ShadowUF.db.profile.font.color.r, ShadowUF.db.profile.font.color.g, ShadowUF.db.profile.font.color.b, ShadowUF.db.profile.font.color.a) - fontString:SetText(row.text) - fontString:SetJustifyH(self:GetJustify(row)) - self:AnchorFrame(frame, fontString, row) - - -- We figure out the anchor point so we can put text in the same area with the same width requirements - local anchorPoint = columnDirection[row.anchorPoint] - if( string.len(row.anchorPoint) == 3 ) then anchorPoint = anchorPoint .. "I" end - - fontString.parentBar = parent - fontString.availableWidth = parent:GetWidth() - row.x - fontString.widthID = row.anchorTo .. anchorPoint .. row.y - totalWeight[fontString.widthID] = (totalWeight[fontString.widthID] or 0) + row.width - - ShadowUF.Tags:Register(frame, fontString, row.text) - fontString:UpdateTags() - fontString:Show() - - frame.fontStrings[id] = fontString + if( not row.block ) then + self:InitFontString(parent, frame, id, row, nil) + else + for blockID, block in pairs(parent.blocks) do + self:InitFontString(parent, frame, id, row, blockID) + end + end end end -- Now set all of the width using our weightings - for id, fontString in pairs(frame.fontStrings) do + for _, fontString in pairs(frame.fontStrings) do + local id = fontString.configID if( fontString:IsShown() ) then fontString:SetWidth(fontString.availableWidth * (config.text[id].width / totalWeight[fontString.widthID])) fontString:SetHeight(ShadowUF.db.profile.font.size + 1) diff --git a/modules/runes.lua b/modules/runes.lua index e6942d5c..383c6738 100755 --- a/modules/runes.lua +++ b/modules/runes.lua @@ -2,6 +2,8 @@ local Runes = {} local RUNE_MAP = {[1] = 1, [2] = 2, [3] = 5, [4] = 6, [5] = 3, [6] = 4} local runeColors = {{r = 1, g = 0, b = 0.4}, {r = 0, g = 1, b = 0.4}, {r = 0, g = 0.4, b = 1}, {r = 0.7, g = 0.5, b = 1}} ShadowUF:RegisterModule(Runes, "runeBar", ShadowUF.L["Rune bar"], true, "DEATHKNIGHT") +ShadowUF.BlockTimers:Inject(Runes, "RUNE_TIMER") +ShadowUF.DynamicBlocks:Inject(Runes) function Runes:OnEnable(frame) if( not frame.runeBar ) then @@ -9,10 +11,12 @@ function Runes:OnEnable(frame) frame.runeBar:SetMinMaxValues(0, 1) frame.runeBar:SetValue(0) frame.runeBar.runes = {} + frame.runeBar.blocks = frame.runeBar.runes for id=1, 6 do local rune = ShadowUF.Units:CreateBar(frame.runeBar) - + rune.id = id + if( id > 1 ) then rune:SetPoint("TOPLEFT", frame.runeBar.runes[RUNE_MAP[id - 1]], "TOPRIGHT", 1, 0) else @@ -34,34 +38,37 @@ function Runes:OnDisable(frame) end function Runes:OnLayoutApplied(frame) - if( frame.visibility.runeBar ) then - local barWidth = (frame.runeBar:GetWidth() - 5) / 6 - - for id, rune in pairs(frame.runeBar.runes) do - if( ShadowUF.db.profile.units[frame.unitType].runeBar.background ) then - rune.background:Show() - else - rune.background:Hide() - end - - rune.background:SetTexture(ShadowUF.Layout.mediaPath.statusbar) - rune.background:SetHorizTile(false) - rune:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) - rune:GetStatusBarTexture():SetHorizTile(false) - rune:SetHeight(frame.runeBar:GetHeight()) - rune:SetWidth(barWidth) + if( not frame.visibility.runeBar ) then return end + + local barWidth = (frame.runeBar:GetWidth() - 5) / 6 + for id, rune in pairs(frame.runeBar.runes) do + if( ShadowUF.db.profile.units[frame.unitType].runeBar.background ) then + rune.background:Show() + else + rune.background:Hide() end + + rune.background:SetTexture(ShadowUF.Layout.mediaPath.statusbar) + rune.background:SetHorizTile(false) + rune:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) + rune:GetStatusBarTexture():SetHorizTile(false) + rune:SetWidth(barWidth) end end local function runeMonitor(self, elapsed) local time = GetTime() self:SetValue(time) - + if( time >= self.endTime ) then self:SetValue(self.endTime) self:SetAlpha(1.0) self:SetScript("OnUpdate", nil) + self.endTime = nil + end + + if( self.fontString ) then + self.fontString:UpdateTags() end end @@ -87,6 +94,11 @@ function Runes:UpdateUsable(frame, event, id, usable) rune:SetValue(1) rune:SetAlpha(1.0) rune:SetScript("OnUpdate", nil) + rune.endTime = nil + end + + if( rune.fontString ) then + rune.fontString:UpdateTags() end end diff --git a/modules/tags.lua b/modules/tags.lua index 0dec767a..e3fc1611 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -397,6 +397,14 @@ Druid.FlightForm = GetSpellInfo(33943) ShadowUF.Druid = Druid Tags.defaultTags = { + ["rune:timer"] = [[function(unit, unitOwner, fontString) + local endTime = fontString.block.endTime + return endTime and string.format("%.1f", endTime - GetTime()) or nil + end]], + ["totem:timer"] = [[function(unit, unitOwner, fontString) + local endTime = fontString.block.endTime + return endTime and string.format("%.1f", endTime - GetTime()) or nil + end]], ["hp:color"] = [[function(unit, unitOwner) return ShadowUF:Hex(ShadowUF.modules.healthBar.getGradientColor(unit)) end]], @@ -1053,6 +1061,8 @@ Tags.defaultTags = { -- Default tag events Tags.defaultEvents = { + ["totem:timer"] = "SUF_TOTEM_TIMER", + ["rune:timer"] = "SUF_RUNE_TIMER", ["hp:color"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH", ["short:druidform"] = "UNIT_AURA", ["druidform"] = "UNIT_AURA", @@ -1144,11 +1154,13 @@ Tags.defaultFrequents = { ["scaled:threat"] = 1, ["unit:scaled:threat"] = 1, ["unit:raid:targeting"] = 0.50, - ["unit:raid:assist"] = 0.50, + ["unit:raid:assist"] = 0.50 } -- Default tag categories Tags.defaultCategories = { + ["totem:timer"] = "classtimer", + ["rune:timer"] = "classtimer", ["hp:color"] = "health", ["abs:incabsorb"] = "health", ["incabsorb"] = "health", @@ -1240,6 +1252,8 @@ Tags.defaultCategories = { -- Default tag help Tags.defaultHelp = { + ["totem:timer"] = L["How many seconds a totem has left before disappearing."], + ["rune:timer"] = L["How many seconds before a rune recharges."], ["abs:incabsorb"] = L["Absolute damage absorption value on the unit, if 10,000 damage will be absorbed, it will show 10,000."], ["incabsorb"] = L["Shorten damage absorption, if 13,000 damage will e absorbed, it will show 13k."], ["incabsorb:name"] = L["If the unit has a damage absorption shield on them, it will show the absolute absorb value, otherwise the units name."], @@ -1332,6 +1346,8 @@ Tags.defaultHelp = { } Tags.defaultNames = { + ["totem:timer"] = L["Totem Timer"], + ["rune:timer"] = L["Rune Timer"], ["abs:incabsorb"] = L["Damage absorption (Absolute)"], ["incabsorb"] = L["Damage absorption (Short)"], ["incabsorb:name"] = L["Damage absorption/Name"], @@ -1452,6 +1468,13 @@ Tags.unitBlacklist = { -- Single tags that can only be used on a single unit Tags.unitRestrictions = { ["pvp:time"] = "player", + ["totem:timer"] = "player", + ["rune:timer"] = "player" +} + +Tags.anchorRestriction = { + ["totem:timer"] = "$totemBar", + ["rune:timer"] = "$runeBar" } -- Event scanner to automatically figure out what events a tag will need diff --git a/modules/totems.lua b/modules/totems.lua index daabdb6d..485ed5e5 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -23,10 +23,15 @@ else ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Totem bar"], true, "SHAMAN") end +ShadowUF.BlockTimers:Inject(Totems, "TOTEM_TIMER") +ShadowUF.DynamicBlocks:Inject(Totems) + + function Totems:OnEnable(frame) if( not frame.totemBar ) then frame.totemBar = CreateFrame("Frame", nil, frame) frame.totemBar.totems = {} + frame.totemBar.blocks = frame.totemBar.totems local priorities = (select(2, UnitClass("player")) == "SHAMAN") and SHAMAN_TOTEM_PRIORITIES or STANDARD_TOTEM_PRIORITIES @@ -35,6 +40,7 @@ function Totems:OnEnable(frame) totem:SetMinMaxValues(0, 1) totem:SetValue(0) totem.id = MAX_TOTEMS == 1 and 1 or priorities[id] + totem.parent = frame if( id > 1 ) then totem:SetPoint("TOPLEFT", frame.totemBar.totems[id - 1], "TOPRIGHT", 1, 0) @@ -128,6 +134,15 @@ local function totemMonitor(self, elapsed) if( time >= self.endTime ) then self:SetValue(0) self:SetScript("OnUpdate", nil) + self.endTime = nil + + if( not self.parent.inVehicle and MAX_TOTEMS == 1 ) then + ShadowUF.Layout:SetBarVisibility(self.parent, "totemBar", false) + end + end + + if( self.fontString ) then + self.fontString:UpdateTags() end end @@ -147,7 +162,6 @@ function Totems:Update(frame) local totalActive = 0 for _, indicator in pairs(frame.totemBar.totems) do local have, name, start, duration, icon = GetTotemInfo(indicator.id) - if( have and start > 0 ) then if( ShadowUF.db.profile.units[frame.unitType].totemBar.icon ) then indicator:SetStatusBarTexture(icon) @@ -167,12 +181,16 @@ function Totems:Update(frame) indicator:SetScript("OnUpdate", nil) indicator:SetMinMaxValues(0, 1) indicator:SetValue(0) + indicator.endTime = nil + end + + if( self.fontString ) then + self.fontString:UpdateTags() end end if( not frame.inVehicle ) then - -- Guardian timers always auto hide - -- or if it's flagged to not always be shown + -- Guardian timers always auto hide or if it's flagged to not always be shown if( MAX_TOTEMS == 1 or not ShadowUF.db.profile.units[frame.unitType].totemBar.showAlways ) then ShadowUF.Layout:SetBarVisibility(frame, "totemBar", totalActive > 0) end diff --git a/options/config.lua b/options/config.lua index b80b8cd6..a105debc 100755 --- a/options/config.lua +++ b/options/config.lua @@ -49,7 +49,7 @@ local INDICATOR_DESC = { ["raidTarget"] = L["Raid target indicator."], ["ready"] = L["Ready status of group members."], ["phase"] = L["Shows when a party member is in a different phase or another group."], ["questBoss"] = L["Shows that a NPC is a boss for a quest."], ["petBattle"] = L["Shows what kind of pet the unit is for pet battles."], ["role"] = L["Raid role indicator, adds a shield indicator for main tanks and a sword icon for main assists."], ["status"] = L["Status indicator, shows if the unit is currently in combat. For the player it will also show if you are rested."], ["class"] = L["Class icon for players."]} -local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"], ["classspec"] = L["Class Specific"]} +local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"], ["classspec"] = L["Class Specific"], ["classtimer"] = L["Class Timer"]} local pointPositions = {["BOTTOM"] = L["Bottom"], ["TOP"] = L["Top"], ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["TOPLEFT"] = L["Top Left"], ["TOPRIGHT"] = L["Top Right"], ["BOTTOMLEFT"] = L["Bottom Left"], ["BOTTOMRIGHT"] = L["Bottom Right"], ["CENTER"] = L["Center"]} local positionList = {["C"] = L["Center"], ["RT"] = L["Right Top"], ["RC"] = L["Right Center"], ["RB"] = L["Right Bottom"], ["LT"] = L["Left Top"], ["LC"] = L["Left Center"], ["LB"] = L["Left Bottom"], ["BL"] = L["Bottom Left"], ["BC"] = L["Bottom Center"], ["BR"] = L["Bottom Right"], ["TR"] = L["Top Right"], ["TC"] = L["Top Center"], ["TL"] = L["Top Left"]} @@ -419,7 +419,16 @@ local function loadGeneralOptions() if( not getVariable("player", "text", nil, id) ) then return true end return getVariable("player", "text", id, "anchorTo") ~= info[#(info) - 1] end, - disabled = function(info) return tonumber(info[#(info)]) <= 5 end, + disabled = function(info) + local id = tonumber(info[#(info)]) + for _, unit in pairs(ShadowUF.unitList) do + if( ShadowUF.db.profile.units[unit].text[id] and ShadowUF.db.profile.units[unit].text[id].default ) then + return true + end + end + + return false + end, confirmText = L["Are you sure you want to delete this text? All settings for it will be deleted."], confirm = true, func = function(info) @@ -1444,7 +1453,7 @@ local function loadGeneralOptions() -- Load text for id, text in pairs(ShadowUF.db.profile.units.player.text) do - if( text.anchorTo ~= "" ) then + if( text.anchorTo ~= "" and not text.default ) then addTextParent.args[id .. ":label"] = addTextLabel addTextParent.args[tostring(id)] = addText addTextParent.args[id .. ":sep"] = addTextSep @@ -1646,7 +1655,7 @@ local function loadUnitOptions() -- Load tag list Config.advanceTextTable = { order = 1, - name = function(info) return getVariable(info[2], "text", quickIDMap[info[#(info)]], "name") end, + name = function(info) return getVariable(info[2], "text", quickIDMap[info[#(info)]], "name") end, type = "group", inline = true, hidden = function(info) @@ -1682,7 +1691,9 @@ local function loadUnitOptions() desc = L["How much weight this should use when figuring out the total text width."], type = "range", min = 0, max = 10, step = 0.1, - hidden = false, + hidden = function(info) + return hideAdvancedOption(info) or getVariable(info[2], "text", quickIDMap[info[#(info) - 1]], "block") + end, }, size = { order = 4, @@ -1692,6 +1703,15 @@ local function loadUnitOptions() min = -20, max = 20, step = 1, softMin = -5, softMax = 5, hidden = false, }, + sep2 = { + order = 4.5, + type = "description", + name = "", + width = "full", + hidden = function(info) + return hideAdvancedOption(info) or not getVariable(info[2], "text", quickIDMap[info[#(info) - 1]], "block") + end + }, x = { order = 5, type = "range", @@ -1720,7 +1740,9 @@ local function loadUnitOptions() local function hideBlacklistedTag(info) local unit = info[2] + local id = tonumber(info[#(info) - 2]) local tag = info[#(info)] + local cat = info[#(info) - 1] if( unit == "global" ) then for unit in pairs(modifyUnits) do @@ -1729,9 +1751,16 @@ local function loadUnitOptions() end end end - + if( ShadowUF.Tags.unitRestrictions[tag] and ShadowUF.Tags.unitRestrictions[tag] ~= unit ) then return true + + elseif( ShadowUF.Tags.anchorRestriction[tag] ) then + if( ShadowUF.Tags.anchorRestriction[tag] ~= getVariable(unit, "text", id, "anchorTo") ) then + return true + else + return false + end end return false @@ -1739,7 +1768,9 @@ local function loadUnitOptions() local function hideBlacklistedGroup(info) local unit = info[2] + local id = tonumber(info[#(info) - 1]) local tagGroup = info[#(info)] + if( unit ~= "global" ) then if( ShadowUF.Tags.unitBlacklist[tagGroup] and string.match(unit, ShadowUF.Tags.unitBlacklist[tagGroup]) ) then return true @@ -1752,6 +1783,11 @@ local function loadUnitOptions() end end end + + local block = getVariable(unit, "text", id, "block") + if( ( block and tagGroup ~= "classtimer" ) or ( not block and tagGroup == "classtimer" ) ) then + return true + end return false end From eb13f402188e3263edca6ec6c2d429033b24f79e Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 30 Nov 2013 19:13:23 -0800 Subject: [PATCH 446/794] Added Monk Stagger # tag/text - Reduced the time between Stagger updates to 0.25s --- ShadowedUnitFrames.lua | 5 +++++ modules/defaultlayout.lua | 1 + modules/monkstagger.lua | 4 ++-- modules/tags.lua | 24 ++++++++++++++++++++---- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 68b2d654..0a6c68ea 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -96,6 +96,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 39 ) then + table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[monk:abs:stagger]", anchorTo = "$staggerBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) + end + if( revision <= 38 ) then table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Timer Text"], text = "", anchorTo = "$runeBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true}) table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Timer Text"], text = "", anchorTo = "$totemBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true}) @@ -458,6 +462,7 @@ function ShadowUF:LoadUnitDefaults() table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) + table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) -- PET self.defaults.profile.units.pet.enabled = true diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index b1a4ba66..95173962 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -365,6 +365,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = 0, x = 0, y = 0, default = true}, {enabled = true, width = 1, name = L["Timer Text"], text = "[totem:timer]", anchorTo = "$totemBar", anchorPoint = "C", x = 0, y = 0, size = 0, default = true, block = true}, {enabled = true, width = 1, name = L["Timer Text"], text = "[rune:timer]", anchorTo = "$runeBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true} + {enabled = true, width = 1, name = L["Text"], text = "[monk:abs:stagger]", anchorTo = "$staggerBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true} }, }, party = { diff --git a/modules/monkstagger.lua b/modules/monkstagger.lua index 4084186a..102d40a2 100755 --- a/modules/monkstagger.lua +++ b/modules/monkstagger.lua @@ -7,8 +7,8 @@ function Stagger:OnEnable(frame) frame.staggerBar.parent = frame frame.staggerBar:SetScript("OnUpdate", function(self, elapsed) self.timeElapsed = self.timeElapsed + elapsed - if( self.timeElapsed < 0.50 ) then return end - self.timeElapsed = self.timeElapsed - 0.50 + if( self.timeElapsed < 0.25 ) then return end + self.timeElapsed = self.timeElapsed - 0.25 Stagger:Update(self.parent) end) diff --git a/modules/tags.lua b/modules/tags.lua index e3fc1611..63a44a46 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1009,9 +1009,17 @@ Tags.defaultTags = { local heal = UnitGetIncomingHeals(unit) return heal and heal > 0 and string.format("+%d", heal) or ShadowUF.tagFunc.name(unit, unitOwner, fontString) end]], + ["monk:abs:stagger"] = [[function(unit, unitOwner) + local stagger = UnitStagger(unit) + return stagger and stagger > 0 and stagger + end]], + ["monk:stagger"] = [[function(unit, unitOwner) + local stagger = UnitStagger(unit) + return stagger and stagger > 0 and ShadowUF:FormatLargeNumber(stagger) + end]], ["abs:incabsorb"] = [[function(unit, unitOwner, fontString) local absorb = UnitGetTotalAbsorbs(unit) - return absorb and absorb > 0 and string.format("%d", absorb) + return absorb and absorb > 0 and absorb end]], ["incabsorb"] = [[function(unit, unitOwner, fontString) local absorb = UnitGetTotalAbsorbs(unit) @@ -1023,7 +1031,7 @@ Tags.defaultTags = { end]], ["abs:healabsorb"] = [[function(unit, unitOwner, fontString) local absorb = UnitGetTotalHealAbsorbs(unit) - return absorb and absorb > 0 and string.format("%d", absorb) + return absorb and absorb > 0 and absorb end]], ["healabsorb"] = [[function(unit, unitOwner, fontString) local absorb = UnitGetTotalHealAbsorbs(unit) @@ -1154,7 +1162,9 @@ Tags.defaultFrequents = { ["scaled:threat"] = 1, ["unit:scaled:threat"] = 1, ["unit:raid:targeting"] = 0.50, - ["unit:raid:assist"] = 0.50 + ["unit:raid:assist"] = 0.50, + ["monk:stagger"] = 0.25, + ["monk:abs:stagger"] = 0.25 } -- Default tag categories @@ -1248,6 +1258,8 @@ Tags.defaultCategories = { ["warlock:demonic:perpp"] = "classspec", ["monk:chipoints"] = "classspec", ["priest:shadoworbs"] = "classspec", + ["monk:stagger"] = "classspec", + ["monk:abs:stagger"] = "classspec" } -- Default tag help @@ -1343,6 +1355,8 @@ Tags.defaultHelp = { ["warlock:demonic:perpp"] = string.format(L["Works the same as [%s], but this is usedd to show Demonic Fury power for Demonology Warlocks."], "perpp"), ["monk:chipoints"] = L["How many Chi points you currently have."], ["priest:shadoworbs"] = L["How many Shadow Orbs you have if you're Shadow"], + ["monk:stagger"] = L["Shows the current staggered damage, if 12,000 damage is staggered, shows 12k."], + ["monk:abs:stagger"] = L["Shows the absolute staggered damage, if 16,000 damage is staggered, shows 16,000."] } Tags.defaultNames = { @@ -1436,7 +1450,9 @@ Tags.defaultNames = { ["warlock:demonic:maxpp"] = L["Max Demonic Fury (Short)"], ["warlock:demonic:perpp"] = L["Percent Demonic Fury"], ["monk:chipoints"] = L["Chi Points"], - ["priest:shadoworbs"] = L["Shadow Orbs"] + ["priest:shadoworbs"] = L["Shadow Orbs"], + ["monk:stagger"] = L["Stagger (Monk)"], + ["monk:abs:stagger"] = L["Stagger (Monk/Absolute)"] } -- List of event types From d3cb11513c165f2a34ba27f3db491f3ca2f56280 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 30 Nov 2013 19:30:18 -0800 Subject: [PATCH 447/794] Fixed a typo --- modules/defaultlayout.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 95173962..111fb83f 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -364,7 +364,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {enabled = true, width = 1, name = L["Text"], text = "[warlock:demonic:curpp]", anchorTo = "$demonicFuryBar", anchorPoint = "C", x = 3, y = 0, size = -1, default = true}, {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = 0, x = 0, y = 0, default = true}, {enabled = true, width = 1, name = L["Timer Text"], text = "[totem:timer]", anchorTo = "$totemBar", anchorPoint = "C", x = 0, y = 0, size = 0, default = true, block = true}, - {enabled = true, width = 1, name = L["Timer Text"], text = "[rune:timer]", anchorTo = "$runeBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true} + {enabled = true, width = 1, name = L["Timer Text"], text = "[rune:timer]", anchorTo = "$runeBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true}, {enabled = true, width = 1, name = L["Text"], text = "[monk:abs:stagger]", anchorTo = "$staggerBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true} }, }, From 25a5e473e5298f820e50bc2dcdbc62855f4c4b19 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 30 Nov 2013 19:34:29 -0800 Subject: [PATCH 448/794] TOC update --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 61991f57..74123123 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Title: Shadowed Unit Frames -## Notes: Now with 90% more shadows than the leading competitors +## Notes: Now with 99% more shadows than the leading competitors ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB From 9f3ffac7d19d20fbf18b92083cd7ef1d41a9d97a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 30 Nov 2013 19:36:32 -0800 Subject: [PATCH 449/794] Added note on the new text tags added --- ShadowedUnitFrames.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 0a6c68ea..873d1899 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -98,6 +98,10 @@ function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision if( revision <= 39 ) then table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[monk:abs:stagger]", anchorTo = "$staggerBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) + + self:Print("NOTE! As of this version of SUF, tags have been added to the Monk Stagger bar, as well as Rune and Totem bars.") + self:Print("If you do not want to see these text tags, go to /suf -> Unit Configuration -> Player -> Text/Tag") + self:Print("And remove the text for the Totem Bar, Rune Bar and Stagger Bar options.") end if( revision <= 38 ) then From a46e458e3f91d1e553c46cceedade585317bb13f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 30 Nov 2013 19:40:08 -0800 Subject: [PATCH 450/794] Bump DB version to 40 --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 873d1899..78f8f05e 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 39 +ShadowUF.dbRevision = 40 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} From 4a0b220553c2af3c0c6fd4f41e6fcac82e63a281 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 1 Dec 2013 14:43:09 -0800 Subject: [PATCH 451/794] Added support for Boss ToT, Main Assist ToT, Main Tank ToT, Party ToT, Battleground ToT and Arena ToT units --- ShadowedUnitFrames.lua | 93 +++++++++++++++++++++++++++++---- modules/defaultlayout.lua | 106 ++++++++++++++++++++++++++++++++++++++ modules/units.lua | 10 ++-- options/config.lua | 21 ++++---- 4 files changed, 208 insertions(+), 22 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 78f8f05e..7dd422e3 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,15 +5,15 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 40 +ShadowUF.dbRevision = 41 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} ShadowUF.moduleOrder = {} -ShadowUF.unitList = {"player", "pet", "pettarget", "target", "targettarget", "targettargettarget", "focus", "focustarget", "party", "partypet", "partytarget", "raid", "raidpet", "boss", "bosstarget", "maintank", "maintanktarget", "mainassist", "mainassisttarget", "arena", "arenatarget", "arenapet", "battleground", "battlegroundtarget", "battlegroundpet"} -ShadowUF.fakeUnits = {["targettarget"] = true, ["targettargettarget"] = true, ["pettarget"] = true, ["arenatarget"] = true, ["focustarget"] = true, ["focustargettarget"] = true, ["partytarget"] = true, ["raidtarget"] = true, ["bosstarget"] = true, ["maintanktarget"] = true, ["mainassisttarget"] = true, ["battlegroundtarget"] = true} -L.units = {["raidpet"] = L["Raid pet"], ["PET"] = L["Pet"], ["VEHICLE"] = L["Vehicle"], ["arena"] = L["Arena"], ["arenapet"] = L["Arena Pet"], ["arenatarget"] = L["Arena Target"], ["boss"] = L["Boss"], ["bosstarget"] = L["Boss Target"], ["focus"] = L["Focus"], ["focustarget"] = L["Focus Target"], ["mainassist"] = L["Main Assist"], ["mainassisttarget"] = L["Main Assist Target"], ["maintank"] = L["Main Tank"], ["maintanktarget"] = L["Main Tank Target"], ["party"] = L["Party"], ["partypet"] = L["Party Pet"], ["partytarget"] = L["Party Target"], ["pet"] = L["Pet"], ["pettarget"] = L["Pet Target"], ["player"] = L["Player"],["raid"] = L["Raid"], ["target"] = L["Target"], ["targettarget"] = L["Target of Target"], ["targettargettarget"] = L["Target of Target of Target"], ["battleground"] = L["Battleground"], ["battlegroundpet"] = L["Battleground Pet"], ["battlegroundtarget"] = L["Battleground Target"]} -L.shortUnits = {["battleground"] = L["BG"], ["battlegroundtarget"] = L["BG Target"], ["battlegroundpet"] = L["BG Pet"]} +ShadowUF.unitList = {"player", "pet", "pettarget", "target", "targettarget", "targettargettarget", "focus", "focustarget", "party", "partypet", "partytarget", "partytargettarget", "raid", "raidpet", "boss", "bosstarget", "maintank", "maintanktarget", "mainassist", "mainassisttarget", "arena", "arenatarget", "arenapet", "battleground", "battlegroundtarget", "battlegroundpet", "arenatargettarget", "battlegroundtargettarget", "maintanktargettarget", "mainassisttargettarget", "bosstargettarget"} +ShadowUF.fakeUnits = {["targettarget"] = true, ["targettargettarget"] = true, ["pettarget"] = true, ["arenatarget"] = true, ["arenatargettarget"] = true, ["focustarget"] = true, ["focustargettarget"] = true, ["partytarget"] = true, ["raidtarget"] = true, ["bosstarget"] = true, ["maintanktarget"] = true, ["mainassisttarget"] = true, ["battlegroundtarget"] = true, ["partytargettarget"] = true, ["battlegroundtargettarget"] = true, ["maintanktargettarget"] = true, ["mainassisttargettarget"] = true, ["bosstargettarget"] = true} +L.units = {["raidpet"] = L["Raid pet"], ["PET"] = L["Pet"], ["VEHICLE"] = L["Vehicle"], ["arena"] = L["Arena"], ["arenapet"] = L["Arena Pet"], ["arenatarget"] = L["Arena Target"], ["arenatargettarget"] = L["Arena Target of Target"], ["boss"] = L["Boss"], ["bosstarget"] = L["Boss Target"], ["focus"] = L["Focus"], ["focustarget"] = L["Focus Target"], ["mainassist"] = L["Main Assist"], ["mainassisttarget"] = L["Main Assist Target"], ["maintank"] = L["Main Tank"], ["maintanktarget"] = L["Main Tank Target"], ["party"] = L["Party"], ["partypet"] = L["Party Pet"], ["partytarget"] = L["Party Target"], ["pet"] = L["Pet"], ["pettarget"] = L["Pet Target"], ["player"] = L["Player"],["raid"] = L["Raid"], ["target"] = L["Target"], ["targettarget"] = L["Target of Target"], ["targettargettarget"] = L["Target of Target of Target"], ["battleground"] = L["Battleground"], ["battlegroundpet"] = L["Battleground Pet"], ["battlegroundtarget"] = L["Battleground Target"], ["partytargettarget"] = L["Party Target of Target"], ["battlegroundtargettarget"] = L["Battleground Target of Target"], ["maintanktargettarget"] = L["Main Tank Target of Target"], ["mainassisttargettarget"] = L["Main Assist Target of Target"], ["bosstargettarget"] = L["Boss Target of Target"]} +L.shortUnits = {["battleground"] = L["BG"], ["battlegroundtarget"] = L["BG Target"], ["battlegroundpet"] = L["BG Pet"], ["battlegroundtargettarget"] = L["BG ToT"], ["arenatargettarget"] = L["Arena ToT"], ["partytargettarget"] = L["Party ToT"], ["bosstargettarget"] = L["Boss ToT"], ["maintanktargettarget"] = L["MT ToT"], ["mainassisttargettarget"] = L["MA ToT"]} -- Cache the units so we don't have to concat every time it updates ShadowUF.unitTarget = setmetatable({}, {__index = function(tbl, unit) rawset(tbl, unit, unit .. "target"); return unit .. "target" end}) @@ -75,6 +75,7 @@ function ShadowUF:OnInitialize() else self:CheckUpgrade() self:CheckBuild() + self:ShowInfoPanel() end self.db.profile.revision = self.dbRevision @@ -96,12 +97,18 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 40 ) then + ShadowUF:LoadDefaultLayout(true) + + for unit, config in pairs(self.db.profile.units) do + if( config.healAbsorb and not self.defaults.profile.units[unit].healAbsorb ) then + config.healAbsorb = nil + end + end + end + if( revision <= 39 ) then table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[monk:abs:stagger]", anchorTo = "$staggerBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) - - self:Print("NOTE! As of this version of SUF, tags have been added to the Monk Stagger bar, as well as Rune and Totem bars.") - self:Print("If you do not want to see these text tags, go to /suf -> Unit Configuration -> Player -> Text/Tag") - self:Print("And remove the text for the Totem Bar, Rune Bar and Stagger Bar options.") end if( revision <= 38 ) then @@ -388,7 +395,6 @@ function ShadowUF:LoadUnitDefaults() emptyBar = {enabled = false}, portrait = {enabled = false}, castBar = {enabled = false, name = {}, time = {}}, - healAbsorb = {enabled = true, cap = 1.30}, text = { {enabled = true, name = L["Left text"], text = "[name]", anchorPoint = "C", anchorTo = "$healthBar", size = 0}, {enabled = true, name = L["Right text"], text = "[curmaxhp]", anchorPoint = "C", anchorTo = "$healthBar", size = 0}, @@ -410,6 +416,7 @@ function ShadowUF:LoadUnitDefaults() if( unit ~= "battleground" and unit ~= "battlegroundpet" and unit ~= "arena" and unit ~= "arenapet" and unit ~= "boss" ) then self.defaults.profile.units[unit].incHeal = {enabled = true, cap = 1.20} self.defaults.profile.units[unit].incAbsorb = {enabled = true, cap = 1.30} + self.defaults.profile.units[unit].healAbsorb = {enabled = true, cap = 1.30} end end @@ -564,6 +571,10 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.positions.partytarget.anchorTo = "$parent" self.defaults.profile.positions.partytarget.anchorPoint = "RT" self.defaults.profile.units.partytarget.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} + -- PARTYTARGETTARGET + self.defaults.profile.positions.partytarget.anchorTo = "$parent" + self.defaults.profile.positions.partytarget.anchorPoint = "RT" + self.defaults.profile.units.partytarget.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} end -- Module APIs @@ -801,6 +812,68 @@ function ShadowUF:HideBlizzardFrames() end end +-- Upgrade info +local infoMessages = { + { + L["As of SUF v3.9, a bunch of new features and units have been added.|n"], + L["- Totem/Rune bars now have timers indicating time to refres/expire"], + L["- Monk Stagger now shows the amount of staggered damage"], + L["- Boss ToT, Main Assist ToT, Main Tank ToT, Party ToT, Battleground ToT, Arena ToT units have been added!"], + L["- Added absorb shield tags"], + L["- Added Ancient Kings bar for Paladins"], + L["- And more! See the change log for everything that has changed."], + L["You can disable the new text for Monk Stagger, Totem and Rune timers through /suf -> Unit configuration -> Text/Tags"] + } +} + +function ShadowUF:ShowInfoPanel() + local infoID = ShadowUF.db.global.infoID or 0 + ShadowUF.db.global.infoID = #(infoMessages) + if( infoID < 0 or infoID >= #(infoMessages) ) then return end + + local frame = CreateFrame("Frame", nil, UIParent) + frame:SetClampedToScreen(true) + frame:SetFrameStrata("HIGH") + frame:SetToplevel(true) + frame:SetWidth(500) + frame:SetHeight(285) + frame:SetBackdrop({ + bgFile = "Interface\\ChatFrame\\ChatFrameBackground", + edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", + edgeSize = 26, + insets = {left = 9, right = 9, top = 9, bottom = 9}, + }) + frame:SetBackdropColor(0, 0, 0, 0.85) + frame:SetPoint("CENTER", UIParent, "CENTER", 0, 100) + + frame.titleBar = frame:CreateTexture(nil, "ARTWORK") + frame.titleBar:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header") + frame.titleBar:SetPoint("TOP", 0, 8) + frame.titleBar:SetWidth(350) + frame.titleBar:SetHeight(45) + + frame.title = frame:CreateFontString(nil, "ARTWORK", "GameFontNormal") + frame.title:SetPoint("TOP", 0, 0) + frame.title:SetText("Shadowed Unit Frames") + + frame.text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlight") + frame.text:SetText(table.concat(infoMessages[ShadowUF.db.global.infoID], "\n")) + frame.text:SetPoint("TOPLEFT", 12, -22) + frame.text:SetWidth(frame:GetWidth() - 20) + frame.text:SetJustifyH("LEFT") + frame:SetHeight(frame.text:GetHeight() + 70) + + frame.hide = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") + frame.hide:SetText(L["Ok"]) + frame.hide:SetHeight(20) + frame.hide:SetWidth(100) + frame.hide:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", 8, 8) + frame.hide:SetScript("OnClick", function(self) + self:GetParent():Hide() + end) +end + + function ShadowUF:Print(msg) DEFAULT_CHAT_FRAME:AddMessage("|cff33ff99Shadow UF|r: " .. msg) end diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 111fb83f..8a01e800 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -209,20 +209,26 @@ function ShadowUF:LoadDefaultLayout(useMerge) pettarget = {anchorPoint = "C", anchorTo = "UIParent", x = 0, y = 0}, partypet = {anchorPoint = "RB", anchorTo = "$parent", x = 0, y = 0}, partytarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, + partytargettarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, raid = {anchorPoint = "C", anchorTo = "UIParent", x = 0, y = 0}, raidpet = {anchorPoint = "C", anchorTo = "UIParent", x = 0, y = 0}, maintank = {anchorPoint = "C", anchorTo = "UIParent", x = 0, y = 0}, maintanktarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, + maintanktargettarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, mainassist = {anchorPoint = "C", anchorTo = "UIParent", x = 0, y = 0}, mainassisttarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, + mainassisttargettarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, arena = {anchorPoint = "C", anchorTo = "UIParent", point = "", relativePoint = "", x = 0, y = 0}, arenapet = {anchorPoint = "RB", anchorTo = "$parent", x = 0, y = 0}, arenatarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, + arenatargettarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, battleground = {anchorPoint = "C", anchorTo = "UIParent", point = "", relativePoint = "", x = 0, y = 0}, battlegroundpet = {anchorPoint = "RB", anchorTo = "$parent", x = 0, y = 0}, battlegroundtarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, + battlegroundtargettarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, boss = {anchorPoint = "C", anchorTo = "UIParent", point = "", relativePoint = "", x = 0, y = 0}, bosstarget = {anchorPoint = "RB", anchorTo = "$parent", x = 0, y = 0}, + bosstargettarget = {anchorPoint = "RB", anchorTo = "$parent", x = 0, y = 0}, } -- Parent unit options that all the children will inherit unless they override it @@ -435,6 +441,20 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[name]"}, }, }, + bosstargettarget = { + width = 90, + height = 25, + scale = 1.0, + healAbsorb = {cap = 1}, + powerBar = {height = 0.60}, + text = { + {text = "[name]"}, + {text = "[curhp]"}, + {text = ""}, + {text = ""}, + {text = "[name]"}, + }, + }, arena = { width = 170, height = 45, @@ -491,6 +511,24 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[name]"}, }, }, + arenatargettarget = { + width = 90, + height = 25, + scale = 1.0, + powerBar = {height = 0.60}, + altPower = {enabled = false}, + healAbsorb = {cap = 1}, + indicators = { + pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, + }, + text = { + {text = "[name]"}, + {text = "[curhp]"}, + {text = ""}, + {text = ""}, + {text = "[name]"}, + }, + }, battleground = { width = 140, height = 35, @@ -551,6 +589,24 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[name]"}, }, }, + battlegroundtargettarget = { + width = 90, + height = 25, + scale = 1.0, + powerBar = {height = 0.60}, + altPower = {enabled = false}, + healAbsorb = {cap = 1}, + indicators = { + pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, + }, + text = { + {text = "[name]"}, + {text = "[curhp]"}, + {text = ""}, + {text = ""}, + {text = "[name]"}, + }, + }, maintank = { width = 150, height = 40, @@ -597,6 +653,22 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[(()afk() )][name]"}, }, }, + maintanktargettarget = { + width = 150, + height = 40, + scale = 1.0, + auras = { + buffs = {enabled = false}, + debuffs = {enabled = false}, + }, + text = { + {text = "[(()afk() )][name]"}, + {text = "[curmaxhp]"}, + {text = "[classification( )][perpp]", width = 0.50}, + {text = "[curmaxpp]", anchorTo = "$powerBar", width = 0.60}, + {text = "[(()afk() )][name]"}, + }, + }, mainassist = { width = 150, height = 40, @@ -645,6 +717,23 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[(()afk() )][name]"}, }, }, + mainassisttargettarget = { + width = 150, + height = 40, + scale = 1.0, + healAbsorb = {cap = 1}, + auras = { + buffs = {enabled = false}, + debuffs = {enabled = false}, + }, + text = { + {text = "[(()afk() )][name]"}, + {text = "[curmaxhp]"}, + {text = "[level( )][classification( )][perpp]", width = 0.50}, + {text = "[curmaxpp]", anchorTo = "$powerBar", width = 0.60}, + {text = "[(()afk() )][name]"}, + }, + }, partypet = { width = 90, height = 25, @@ -676,6 +765,23 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[name]"}, }, }, + partytargettarget = { + width = 90, + height = 25, + scale = 1.0, + powerBar = {height = 0.60}, + healAbsorb = {cap = 1}, + indicators = { + pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, + }, + text = { + {text = "[name]"}, + {text = "[curhp]"}, + {text = ""}, + {text = ""}, + {text = "[name]"}, + }, + }, target = { width = 190, height = 45, diff --git a/modules/units.lua b/modules/units.lua index c5fe1278..bfaafe6a 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1,7 +1,7 @@ local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}, remappedUnits = {}, canCure = {}} -Units.childUnits = {["partytarget"] = "party", ["partypet"] = "party", ["maintanktarget"] = "maintank", ["mainassisttarget"] = "mainassist", ["bosstarget"] = "boss", ["arenatarget"] = "arena", ["arenapet"] = "arena", ["battlegroundpet"] = "battleground", ["battlegroundtarget"] = "battleground"} -Units.zoneUnits = {["arena"] = "arena", ["arenapet"] = "arena", ["arenatarget"] = "arena", ["boss"] = "raid", ["bosstarget"] = "raid", ["battleground"] = "pvp", ["battlegroundtarget"] = "pvp", ["battlegroundpet"] = "pvp"} -Units.remappedUnits = {["battleground"] = "arena", ["battlegroundpet"] = "arenapet", ["battlegroundtarget"] = "arenatarget"} +Units.childUnits = {["partytarget"] = "party", ["partytargettarget"] = "party", ["partypet"] = "party", ["maintanktarget"] = "maintank", ["mainassisttarget"] = "mainassist", ["bosstarget"] = "boss", ["arenatarget"] = "arena", ["arenatargettarget"] = "arena", ["arenapet"] = "arena", ["battlegroundpet"] = "battleground", ["battlegroundtarget"] = "battleground", ["battlegroundtargettarget"] = "battleground", ["maintanktargettarget"] = "maintank", ["mainassisttargettarget"] = "mainassist", ["bosstargettarget"] = "boss"} +Units.zoneUnits = {["arena"] = "arena", ["arenapet"] = "arena", ["arenatarget"] = "arena", ["arenatargettarget"] = true, ["boss"] = "raid", ["bosstarget"] = "raid", ["battleground"] = "pvp", ["battlegroundtarget"] = "pvp", ["battlegroundtargettarget"] = true, ["battlegroundpet"] = "pvp", ["bosstargettarget"] = "raid"} +Units.remappedUnits = {["battleground"] = "arena", ["battlegroundpet"] = "arenapet", ["battlegroundtarget"] = "arenatarget", ["battlegroundtargettarget"] = "arenatargettarget"} Units.headerUnits = {["raid"] = true, ["party"] = true, ["maintank"] = true, ["mainassist"] = true, ["raidpet"] = true, ["partypet"] = true} local stateMonitor = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") @@ -567,10 +567,14 @@ OnAttributeChanged = function(self, name, unit) -- then targettarget and targettargettarget are also force updated if( self.unitRealType == "partytarget" ) then self.unitRealOwner = ShadowUF.partyUnits[self.unitID] + elseif( self.unitRealType == "partytargettarget" ) then + self.unitRealOwner = ShadowUF.partyUnits[self.unitID] .. "target" elseif( self.unitRealType == "raid" ) then self.unitRealOwner = ShadowUF.raidUnits[self.unitID] elseif( self.unitRealType == "arenatarget" ) then self.unitRealOwner = ShadowUF.arenaUnits[self.unitID] + elseif( self.unitRealType == "arenatargettarget" ) then + self.unitRealOwner = ShadowUF.arenaUnits[self.unitID] .. "target" elseif( self.unit == "focustarget" ) then self.unitRealOwner = "focus" self:RegisterNormalEvent("PLAYER_FOCUS_CHANGED", Units, "CheckUnitStatus") diff --git a/options/config.lua b/options/config.lua index a105debc..4a69010b 100755 --- a/options/config.lua +++ b/options/config.lua @@ -17,10 +17,12 @@ ShadowUF.Config = Config local unitCategories = { player = {"player", "pet"}, general = {"target", "targettarget", "targettargettarget", "focus", "focustarget", "pettarget"}, - party = {"party", "partypet", "partytarget"}, - raid = {"raid", "raidpet", "boss", "bosstarget", "maintank", "maintanktarget", "mainassist", "mainassisttarget"}, - arena = {"arena", "arenapet", "arenatarget"}, - battleground = {"battleground", "battlegroundpet", "battlegroundtarget"} + party = {"party", "partypet", "partytarget", "partytargettarget", "party"}, + raid = {"raid", "raidpet"}, + raidmisc = {"maintank", "maintanktarget", "maintanktargettarget", "mainassist", "mainassisttarget", "mainassisttargettarget"}, + boss = {"boss", "bosstarget", "bosstargettarget"}, + arena = {"arena", "arenapet", "arenatarget", "arenatargettarget"}, + battleground = {"battleground", "battlegroundpet", "battlegroundtarget", "battlegroundtargettarget"} } local UNIT_DESC = { @@ -29,7 +31,8 @@ local UNIT_DESC = { ["maintank"] = L["Main Tank's are set by the Blizzard Main Tank system or mods that use them such as oRA3."], ["battleground"] = L["Currently used in battlegrounds for showing flag carriers."], ["battlegroundpet"] = L["Current pet used by a battleground unit"], - ["battlegroundtarget"] = L["Current target of a battleground unit"] + ["battlegroundtarget"] = L["Current target of a battleground unit"], + ["battlegroundtargettarget"] = L["Current target of target of a battleground unit"] } local PAGE_DESC = { @@ -4527,7 +4530,7 @@ local function loadUnitOptions() help = { order = 0, type = "description", - name = L["The check boxes below will allow you to enable or disable units."], + name = L["The check boxes below will allow you to enable or disable units.|n|n|cffff2020Warning!|r Target of Target units have a higher performance cost compared to other units. If you have performance issues, please disable those units or reduce the features enabled for those units."], }, }, }, @@ -4796,12 +4799,12 @@ local function loadUnitOptions() local unitCategory = { order = function(info) local cat = info[#(info)] - return cat == "playercat" and 50 or cat == "generalcat" and 100 or cat == "partycat" and 200 or cat == "raidcat" and 300 or cat == "arenacat" and 400 or 500 + return cat == "playercat" and 50 or cat == "generalcat" and 100 or cat == "partycat" and 200 or cat == "raidcat" and 300 or cat == "raidmisccat" and 400 or cat == "bosscat" and 500 or cat == "arenacat" and 600 or 700 end, type = "header", name = function(info) local cat = info[#(info)] - return cat == "playercat" and L["Player"] or cat == "generalcat" and L["General"] or cat == "raidcat" and L["Raid"] or cat == "partycat" and L["Party"] or cat == "arenacat" and L["Arena"] or cat == "battlegroundcat" and L["Battlegrounds"] + return cat == "playercat" and L["Player"] or cat == "generalcat" and L["General"] or cat == "raidcat" and L["Raid"] or cat == "partycat" and L["Party"] or cat == "arenacat" and L["Arena"] or cat == "battlegroundcat" and L["Battlegrounds"] or cat == "raidmisccat" and L["Raid Misc"] or cat == "bosscat" and L["Boss"] end, width = "full", } @@ -4810,7 +4813,7 @@ local function loadUnitOptions() options.args.enableUnits.args.enabled.args[cat .. "cat"] = unitCategory for _, unit in pairs(list) do - unitCatOrder[unit] = cat == "player" and 50 or cat == "general" and 100 or cat == "party" and 200 or cat == "raid" and 300 or cat == "arena" and 400 or 500 + unitCatOrder[unit] = cat == "player" and 50 or cat == "general" and 100 or cat == "party" and 200 or cat == "raid" and 300 or cat == "raidmisc" and 400 or cat == "boss" and 500 or cat == "arena" and 600 or 700 end end From 8b1c2c8414e4788f8d72010aaac39eaa4409d15f Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 1 Dec 2013 15:17:09 -0800 Subject: [PATCH 452/794] Added support for LibDualSpec to auto switch profiles on talent changes --- .pkgmeta | 4 ++++ ShadowedUnitFrames.lua | 9 ++++++--- ShadowedUnitFrames.toc | 3 ++- options/config.lua | 3 +++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.pkgmeta b/.pkgmeta index a1c3d83a..c4cad9cb 100755 --- a/.pkgmeta +++ b/.pkgmeta @@ -15,6 +15,9 @@ externals: libs/LibSharedMedia-3.0: url: svn://svn.wowace.com/wow/libsharedmedia-3-0/mainline/trunk tag: latest + libs/LibDualSpec-1.0: + url: git://git.wowace.com/wow/libdualspec-1-0/mainline.git + tag: latest options/libs/AceConfig-3.0: url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConfig-3.0 options/libs/AceDBOptions-3.0: @@ -24,6 +27,7 @@ externals: options/libs/AceGUI-3.0-SharedMediaWidgets: url: svn://svn.wowace.com/wow/ace-gui-3-0-shared-media-widgets/mainline/trunk tag: latest + ignore: - globalcheck.lua - localcheck.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 7dd422e3..728b355f 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -50,7 +50,10 @@ function ShadowUF:OnInitialize() self.db.RegisterCallback(self, "OnProfileChanged", "ProfilesChanged") self.db.RegisterCallback(self, "OnProfileCopied", "ProfilesChanged") self.db.RegisterCallback(self, "OnProfileReset", "ProfileReset") - + + local LibDualSpec = LibStub("LibDualSpec-1.0") + LibDualSpec:EnhanceDatabase(self.db, "ShadowedUnitFrames") + -- Setup tag cache self.tagFunc = setmetatable({}, { __index = function(tbl, index) @@ -818,11 +821,11 @@ local infoMessages = { L["As of SUF v3.9, a bunch of new features and units have been added.|n"], L["- Totem/Rune bars now have timers indicating time to refres/expire"], L["- Monk Stagger now shows the amount of staggered damage"], - L["- Boss ToT, Main Assist ToT, Main Tank ToT, Party ToT, Battleground ToT, Arena ToT units have been added!"], + L["- Boss ToT, Main Assist ToT, Main Tank ToT, Party ToT, Battleground ToT and Arena ToT units have been added!"], L["- Added absorb shield tags"], L["- Added Ancient Kings bar for Paladins"], L["- And more! See the change log for everything that has changed."], - L["You can disable the new text for Monk Stagger, Totem and Rune timers through /suf -> Unit configuration -> Text/Tags"] + L["|nYou can disable the new text for Monk Stagger, Totem and Rune timers through /suf -> Unit configuration -> Text/Tags"] } } diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 74123123..293725e1 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -4,13 +4,14 @@ ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB -## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, Clique +## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibDualSpec-1.0, Clique #@no-lib-strip@ libs\LibStub\LibStub.lua libs\CallbackHandler-1.0\CallbackHandler-1.0\CallbackHandler-1.0.xml libs\LibSharedMedia-3.0\lib.xml libs\AceDB-3.0\AceDB-3.0.xml +libs\LibDualSpec-1.0\LibDualSpec-1.0.lua #@end-no-lib-strip@ localization\enUS.lua diff --git a/options/config.lua b/options/config.lua index 4a69010b..46e05a80 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1482,6 +1482,9 @@ local function loadGeneralOptions() options.args.general.args.color.args.classColors.args.VEHICLE = Config.classTable options.args.general.args.profile.order = 4 + + local LibDualSpec = LibStub("LibDualSpec-1.0") + LibDualSpec:EnhanceOptions(options.args.general.args.profile, ShadowUF.db) end --------------------- From e8f3c3d91c9d3dffd5024bf61005c12dafc94c27 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 1 Dec 2013 15:56:27 -0800 Subject: [PATCH 453/794] Added highlighting by rare or elite mods --- ShadowedUnitFrames.lua | 2 ++ modules/highlight.lua | 22 +++++++++++++++++++--- options/config.lua | 18 +++++++++++++++++- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 728b355f..d36b43d2 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -822,6 +822,8 @@ local infoMessages = { L["- Totem/Rune bars now have timers indicating time to refres/expire"], L["- Monk Stagger now shows the amount of staggered damage"], L["- Boss ToT, Main Assist ToT, Main Tank ToT, Party ToT, Battleground ToT and Arena ToT units have been added!"], + L["- Auto profile switching based on dual spec is available in /suf -> Profile"], + L["- Highlight based on unit rare/elite is now available"], L["- Added absorb shield tags"], L["- Added Ancient Kings bar for Paladins"], L["- And more! See the change log for everything that has changed."], diff --git a/modules/highlight.lua b/modules/highlight.lua index 597cc36c..f024b481 100755 --- a/modules/highlight.lua +++ b/modules/highlight.lua @@ -1,5 +1,7 @@ local Highlight = {} local goldColor, mouseColor = {r = 0.75, g = 0.75, b = 0.35}, {r = 0.75, g = 0.75, b = 0.50} +local rareColor, eliteColor = {r = 0, g = 0.63, b = 1}, {r = 1, g = 0.81, b = 0} + local canCure = ShadowUF.Units.canCure ShadowUF:RegisterModule(Highlight, "highlight", ShadowUF.L["Highlight"]) @@ -88,7 +90,7 @@ function Highlight:OnEnable(frame) frame:RegisterNormalEvent("UNIT_AURA", self, "UpdateAura") frame:RegisterUpdateFunc(self, "UpdateAura") end - + if( ShadowUF.db.profile.units[frame.unitType].highlight.mouseover and not frame.highlight.OnEnter ) then frame.highlight.OnEnter = frame.OnEnter frame.highlight.OnLeave = frame.OnLeave @@ -96,6 +98,11 @@ function Highlight:OnEnable(frame) frame.OnEnter = OnEnter frame.OnLeave = OnLeave end + + if( ShadowUF.db.profile.units[frame.unitType].highlight.rareMob or ShadowUF.db.profile.units[frame.unitType].highlight.eliteMob ) then + frame:RegisterUnitEvent("UNIT_CLASSIFICATION_CHANGED", self, "UpdateClassification") + frame:RegisterUpdateFunc(self, "UpdateClassification") + end end function Highlight:OnLayoutApplied(frame) @@ -115,7 +122,7 @@ function Highlight:OnDisable(frame) frame.highlight:Hide() - if frame.highlight.OnEnter then + if( frame.highlight.OnEnter ) then frame.OnEnter = frame.highlight.OnEnter frame.OnLeave = frame.highlight.OnLeave @@ -134,8 +141,12 @@ function Highlight:Update(frame) color = goldColor elseif( frame.highlight.hasMouseover ) then color = mouseColor + elseif( ShadowUF.db.profile.units[frame.unitType].highlight.rareMob and ( frame.highlight.hasClassification == "rareelite" or frame.highlight.hasClassification == "rare" ) ) then + color = rareColor + elseif( ShadowUF.db.profile.units[frame.unitType].highlight.eliteMob and frame.highlight.hasClassification == "elite" ) then + color = eliteColor end - + if( color ) then frame.highlight.top:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.units[frame.unitType].highlight.alpha) frame.highlight.left:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.units[frame.unitType].highlight.alpha) @@ -157,6 +168,11 @@ function Highlight:UpdateAttention(frame) self:Update(frame) end +function Highlight:UpdateClassification(frame) + frame.highlight.hasClassification = UnitClassification(frame.unit) + self:Update(frame) +end + function Highlight:UpdateAura(frame) frame.highlight.hasDebuff = nil if( UnitIsFriend(frame.unit, "player") ) then diff --git a/options/config.lua b/options/config.lua index 46e05a80..3b466a11 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2632,12 +2632,28 @@ local function loadUnitOptions() arg = "highlight.debuff", hidden = function(info) return info[2] ~= "boss" and ( ShadowUF.Units.zoneUnits[info[2]] or info[2] == "battlegroundpet" or info[2] == "arenapet" ) end, }, + raremob = { + order = 6.10, + type = "toggle", + name = L["On rare mobs"], + desc = L["Highlight units that are rare."], + arg = "highlight.rareMob", + hidden = function(info) return not (info[2] == "target" or info[2] == "focus" or info[2] == "targettarget" or info[3] == "focustarget") end, + }, + elitemob = { + order = 6.15, + type = "toggle", + name = L["On elite mobs"], + desc = L["Highlight units that are "], + arg = "highlight.eliteMob", + hidden = function(info) return not (info[2] == "target" or info[2] == "focus" or info[2] == "targettarget" or info[3] == "focustarget") end, + }, sep = { order = 6.5, type = "description", name = "", width = "full", - hidden = function(info) return not (ShadowUF.Units.zoneUnits[info[2]] or info[2] == "battlegroundpet" or info[2] == "arenapet" or ShadowUF.fakeUnits[info[2]]) end, + hidden = function(info) return not (ShadowUF.Units.zoneUnits[info[2]] or info[2] == "battlegroundpet" or info[2] == "arenapet" or ShadowUF.fakeUnits[info[2]]) and not (info[2] == "target" or info[2] == "focus" or info[2] == "targettarget" or info[3] == "focustarget") end, }, alpha = { order = 7, From a0cf3722b04b8640fb31cb8503e487070cfe752b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 1 Dec 2013 19:44:17 -0800 Subject: [PATCH 454/794] Random performance tracking code that I can re-enable when wanted --- modules/tags.lua | 2 +- modules/units.lua | 86 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 85 insertions(+), 3 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 63a44a46..28676104 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1,5 +1,5 @@ -- Thanks to haste for the original tagging code, which I then mostly ripped apart and stole! -local Tags = {afkStatus = {}, offlineStatus = {}, customEvents = {}, powerMap = {}} +local Tags = {afkStatus = {}, offlineStatus = {}, customEvents = {}, powerMap = {}, moduleKey = "tags"} local tagPool, functionPool, temp, regFontStrings, frequentUpdates, frequencyCache, powerMap = {}, {}, {}, {}, {}, {}, Tags.powerMap local L = ShadowUF.L diff --git a/modules/units.lua b/modules/units.lua index bfaafe6a..bb2e52bb 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -28,11 +28,91 @@ petBattleFrame:WrapScript(petBattleFrame, "OnAttributeChanged", [[ RegisterStateDriver(petBattleFrame, "petbattle", "[petbattle] active; none") +--[[ +local perf = {} +local function logPerformance(module, func, started, unit, event) + local taken = debugprofilestop() - started + local prefix = (event and "event" or "update") .. ":" .. (module.moduleKey or "UNKNOWN") + + -- Log per module/function + local id = prefix .. ":" .. func .. ":global" + if( not perf[id] ) then perf[id] = {calls = 0, time = 0} end + perf[id].calls = perf[id].calls + 1 + perf[id].time = perf[id].time + taken + + -- Log per module/function/unit + if( unit ) then + id = prefix .. ":" .. func .. ":" .. unit + + if( not perf[id] ) then perf[id] = {calls = 0, time = 0} end + perf[id].calls = perf[id].calls + 1 + perf[id].time = perf[id].time + taken + end + + -- Log per module + if( not perf[prefix] ) then perf[prefix] = {calls = 0, time = 0} end + perf[prefix].calls = perf[prefix].calls + 1 + perf[prefix].time = perf[prefix].time + taken + + -- Log per module/unit + if( unit ) then + id = prefix .. ":" .. unit + + if( not perf[id] ) then perf[id] = {calls = 0, time = 0} end + perf[id].calls = perf[id].calls + 1 + perf[id].time = perf[id].time + taken + end +end + +function ShadowUF:DumpPerf() + local temp = {} + for id, stats in pairs(perf) do + stats.id = id + table.insert(temp, stats) + end + + table.sort(temp, function(a, b) return a.id < b.id end) + + local metrics = {} + for _, stats in pairs(temp) do + local type, module, func, unit = string.split(":", stats.id) + + local data = {} + data.id = nil + data.type = type + data.module = module + if( func ) then data.func = func end + if( unit ) then data.unit = unit end + + data.total_time = tonumber(string.format("%.4f", stats.time)) + data.calls = stats.calls + data.avg_time = tonumber((stats.calls > 0 and stats.time > 0) and string.format("%.4f", stats.time / stats.calls) or 0) + + if( data.calls > 0 and data.total_time > 0 ) then + table.insert(metrics, data) + end + end + + table.sort(metrics, function(a, b) + return a.avg_time > b.avg_time + end) + + LoadAddOn("Spew") + Spew("", metrics) + + ShadowUF.db.global.metrics = metrics +end +]] + -- Frame shown, do a full update local function FullUpdate(self) for i=1, #(self.fullUpdates), 2 do + --local start = debugprofilestop() + local handler = self.fullUpdates[i] handler[self.fullUpdates[i + 1]](handler, self) + + --logPerformance(handler, self.fullUpdates[i + 1], start, self.unitType, false) end end @@ -155,8 +235,6 @@ local function UnregisterAll(self, handler) end end end - - end -- Handles setting alphas in a way so combat fader and range checker don't override each other @@ -203,7 +281,11 @@ end local function OnEvent(self, event, unit, ...) if( not unitEvents[event] or self.unit == unit ) then for handler, func in pairs(self.registeredEvents[event]) do + --local start = debugprofilestop() + handler[func](handler, self, event, unit, ...) + + --logPerformance(handler, func, start, self.unitType, true) end end end From 153b393b4babe37e82213ff268ba5f553e54914b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 5 Dec 2013 18:10:34 -0800 Subject: [PATCH 455/794] Default color config to empty tables --- options/config.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/options/config.lua b/options/config.lua index 3b466a11..f5443ba5 100755 --- a/options/config.lua +++ b/options/config.lua @@ -191,13 +191,13 @@ local function get(info) end local function setColor(info, r, g, b, a) - local color = get(info) + local color = get(info) or {} color.r, color.g, color.b, color.a = r, g, b, a set(info, color) end local function getColor(info) - local color = get(info) + local color = get(info) or {} return color.r, color.g, color.b, color.a end From 1a2cb23b50eba7c3d8271b38ce16afabc5b721a1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Dec 2013 09:01:08 -0800 Subject: [PATCH 456/794] Fixed phase indicators --- ShadowedUnitFrames.lua | 12 +++++++++++- modules/defaultlayout.lua | 2 +- modules/indicators.lua | 8 +++++--- modules/movers.lua | 4 ++-- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index d36b43d2..42891171 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 41 +ShadowUF.dbRevision = 42 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -100,6 +100,15 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 41 ) then + local phase = self.db.profile.units.party.indicators.phase + phase.anchorPoint = phase.anchorPoint or "RC" + phase.size = phase.size or 14 + phase.x = phase.x or -11 + phase.y = phase.y or 0 + phase.anchorTo = phase.anchorTo or "$parent" + end + if( revision <= 40 ) then ShadowUF:LoadDefaultLayout(true) @@ -505,6 +514,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.party.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} self.defaults.profile.units.party.combatText.enabled = false self.defaults.profile.units.party.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} + self.defaults.profile.units.party.indicators.phase = {enabled = true, size = 0, x = 0, y = 0} -- ARENA self.defaults.profile.units.arena.enabled = false self.defaults.profile.units.arena.attribPoint = "TOP" diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 8a01e800..bfbc0c47 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -390,7 +390,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) healAbsorb = {cap = 1}, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, - phase = {enabled = true, anchorPoint = "RC", size = 26, x = -17, y = 0, anchorTo = "$parent"} + phase = {enabled = true, anchorPoint = "RC", size = 14, x = -11, y = 0, anchorTo = "$parent"} }, auras = { buffs = {enabled = true, maxRows = 1}, diff --git a/modules/indicators.lua b/modules/indicators.lua index 952a73f0..d9f819b8 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -19,11 +19,13 @@ end function Indicators:UpdatePhase(frame) if( not frame.indicators.phase or not frame.indicators.phase.enabled ) then return end - if( not select(2, UnitInOtherParty(frame.unit)) ) then - frame.indicators.phase:SetTexture("Interface\\PlayerFrame\\whisper-only") + if( not UnitInOtherParty(frame.unit) ) then + frame.indicators.phase:SetTexture("Interface\\LFGFrame\\LFG-Eye") + frame.indicators.phase:SetTexCoord(0.125, 0.25, 0.25, 0.5) frame.indicators.phase:Show() - elseif( UnitExists(frame.unit) and not UnitInPhase(frame.unit) ) then + elseif( UnitIsConnected(frame.unit) and not UnitInPhase(frame.unit) ) then frame.indicators.phase:SetTexture("Interface\\TargetingFrame\\UI-PhasingIcon") + frame.indicators.phase:SetTexCoord(0.15625, 0.84375, 0.15625, 0.84375) frame.indicators.phase:Show() else frame.indicators.phase:Hide() diff --git a/modules/movers.lua b/modules/movers.lua index daecfd8d..319af025 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -82,8 +82,8 @@ local function createConfigEnv() return 50000 end, UnitHasIncomingResurrection = function(unit) return true end, - UnitInOtherParty = function(unit) return true end, - UnitInPhase = function(unit) return true end, + UnitInOtherParty = function(unit) return getValue("UnitInOtherParty", unit, math.random(0, 1) == 1) end, + UnitInPhase = function(unit) return false end, UnitExists = function(unit) return true end, UnitIsGroupLeader = function() return true end, UnitIsPVP = function(unit) return true end, From adcf81fb15d8dec4a0854527dc547af6b83d1272 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Dec 2013 13:27:04 -0800 Subject: [PATCH 457/794] TOC change --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 293725e1..0f87f62c 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Title: Shadowed Unit Frames -## Notes: Now with 99% more shadows than the leading competitors +## Notes: Now with 200% more shadows than the leading competitors ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB From 5077d9cce290596d33bdb7ed16dd394e44cab951 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Dec 2013 14:48:27 -0800 Subject: [PATCH 458/794] Switch General/Bars config to not be inlined to make the unit config easier to use --- options/config.lua | 143 +++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 78 deletions(-) diff --git a/options/config.lua b/options/config.lua index f5443ba5..eecfe153 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2457,7 +2457,7 @@ local function loadUnitOptions() vehicle = { order = 1, type = "group", - inline = true, + inline = false, name = L["Vehicles"], hidden = function(info) return info[2] ~= "player" and info[2] ~= "party" or not ShadowUF.db.profile.advanced end, args = { @@ -2494,7 +2494,7 @@ local function loadUnitOptions() portrait = { order = 2, type = "group", - inline = true, + inline = false, hidden = false, name = L["Portrait"], args = { @@ -2503,6 +2503,7 @@ local function loadUnitOptions() type = "toggle", name = string.format(L["Enable %s"], L["Portrait"]), arg = "portrait.enabled", + width = "full" }, portraitType = { order = 1, @@ -2523,7 +2524,7 @@ local function loadUnitOptions() fader = { order = 3, type = "group", - inline = true, + inline = false, name = L["Combat fader"], hidden = hideRestrictedOption, args = { @@ -2534,6 +2535,7 @@ local function loadUnitOptions() desc = L["Combat fader will fade out all your frames while they are inactive and fade them back in once you are in combat or active."], hidden = false, arg = "fader.enabled", + width = "full" }, combatAlpha = { order = 1, @@ -2560,7 +2562,7 @@ local function loadUnitOptions() range = { order = 3, type = "group", - inline = true, + inline = false, name = L["Range indicator"], hidden = hideRestrictedOption, args = { @@ -2571,6 +2573,7 @@ local function loadUnitOptions() desc = L["Fades out the unit frames of people who are not within range of you."], arg = "range.enabled", hidden = false, + width = "full" }, inAlpha = { order = 1, @@ -2596,7 +2599,7 @@ local function loadUnitOptions() highlight = { order = 3.5, type = "group", - inline = true, + inline = false, name = L["Border highlighting"], hidden = hideRestrictedOption, args = { @@ -2678,7 +2681,7 @@ local function loadUnitOptions() barSouls = { order = 4, type = "group", - inline = true, + inline = false, name = L["Soul Shards"], hidden = function(info) return playerClass ~= "WARLOCK" or not getVariable(info[2], "soulShards", nil, "isBar") or not getVariable(info[2], nil, nil, "soulShards") end, args = { @@ -2709,7 +2712,7 @@ local function loadUnitOptions() soulShards = { order = 4, type = "group", - inline = true, + inline = false, name = L["Soul Shards"], hidden = function(info) if( info[2] == "global" or getVariable(info[2], "soulShards", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, args = { @@ -2788,7 +2791,7 @@ local function loadUnitOptions() barHolyPower = { order = 4, type = "group", - inline = true, + inline = false, name = L["Holy Power"], hidden = function(info) return playerClass ~= "PALADIN" or not getVariable(info[2], "holyPower", nil, "isBar") or not getVariable(info[2], nil, nil, "holyPower") end, args = { @@ -2819,7 +2822,7 @@ local function loadUnitOptions() holyPower = { order = 4, type = "group", - inline = true, + inline = false, name = L["Holy Power"], hidden = function(info) if( info[2] == "global" or getVariable(info[2], "holyPower", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, args = { @@ -2898,7 +2901,7 @@ local function loadUnitOptions() barShadowOrbs = { order = 4, type = "group", - inline = true, + inline = false, name = L["Shadow Orbs"], hidden = function(info) return playerClass ~= "PRIEST" or not getVariable(info[2], "shadowOrbs", nil, "isBar") or not getVariable(info[2], nil, nil, "shadowOrbs") end, args = { @@ -2929,7 +2932,7 @@ local function loadUnitOptions() shadowOrbs = { order = 4, type = "group", - inline = true, + inline = false, name = L["Holy Power"], hidden = function(info) if( info[2] == "global" or getVariable(info[2], "shadowOrbs", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, args = { @@ -3008,7 +3011,7 @@ local function loadUnitOptions() barChi = { order = 4, type = "group", - inline = true, + inline = false, name = L["Chi"], hidden = function(info) return playerClass ~= "MONK" or not getVariable(info[2], "chi", nil, "isBar") or not getVariable(info[2], nil, nil, "chi") end, args = { @@ -3039,7 +3042,7 @@ local function loadUnitOptions() chi = { order = 4, type = "group", - inline = true, + inline = false, name = L["Chi"], hidden = function(info) if( info[2] == "global" or getVariable(info[2], "chi", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, args = { @@ -3118,7 +3121,7 @@ local function loadUnitOptions() barComboPoints = { order = 4, type = "group", - inline = true, + inline = false, name = L["Combo points"], hidden = function(info) return not getVariable(info[2], "comboPoints", nil, "isBar") or not getVariable(info[2], nil, nil, "comboPoints") end, args = { @@ -3128,6 +3131,7 @@ local function loadUnitOptions() name = string.format(L["Enable %s"], L["Combo points"]), hidden = false, arg = "comboPoints.enabled", + width = "full" }, growth = { order = 2, @@ -3149,7 +3153,7 @@ local function loadUnitOptions() comboPoints = { order = 4, type = "group", - inline = true, + inline = false, name = L["Combo points"], hidden = function(info) if( info[2] == "global" or getVariable(info[2], "comboPoints", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, args = { @@ -3228,7 +3232,7 @@ local function loadUnitOptions() barAuraPoints = { order = 4, type = "group", - inline = true, + inline = false, name = L["Aura Combo Points"], hidden = function(info) return not ShadowUF.modules.auraPoints or not getVariable(info[2], "auraPoints", nil, "isBar") or not getVariable(info[2], nil, nil, "auraPoints") end, args = { @@ -3238,6 +3242,7 @@ local function loadUnitOptions() name = string.format(L["Enable %s"], L["Aura Combo Points"]), hidden = false, arg = "auraPoints.enabled", + width = "full" }, growth = { order = 2, @@ -3259,7 +3264,7 @@ local function loadUnitOptions() auraPoints = { order = 4, type = "group", - inline = true, + inline = false, name = L["Aura Combo Points"], hidden = function(info) if( info[2] == "global" or getVariable(info[2], "auraPoints", nil, "isBar") ) then return true end return not ShadowUF.modules.auraPoints or hideRestrictedOption(info) end, args = { @@ -3337,7 +3342,7 @@ local function loadUnitOptions() combatText = { order = 5, type = "group", - inline = true, + inline = false, name = L["Combat text"], hidden = hideRestrictedOption, args = { @@ -3349,13 +3354,6 @@ local function loadUnitOptions() arg = "combatText.enabled", hidden = false, }, - sep = { - order = 1, - type = "description", - name = "", - width = "full", - hidden = hideAdvancedOption, - }, anchorPoint = { order = 3, type = "select", @@ -3863,7 +3861,7 @@ local function loadUnitOptions() powerbar = { order = 1, type = "group", - inline = true, + inline = false, name = L["Power bar"], hidden = false, args = { @@ -3901,7 +3899,7 @@ local function loadUnitOptions() classmiscbars = { order = 2, type = "group", - inline = true, + inline = false, name = L["Class/misc bars"], hidden = function(info) local unit = info[2] @@ -3981,7 +3979,7 @@ local function loadUnitOptions() healthBar = { order = 2, type = "group", - inline = true, + inline = false, name = L["Health bar"], hidden = false, args = { @@ -3989,16 +3987,24 @@ local function loadUnitOptions() order = 1, type = "toggle", name = string.format(L["Enable %s"], L["Health bar"]), - arg = "healthBar.enabled", + arg = "healthBar.enabled" }, sep = { order = 3.5, type = "description", name = "", - hidden = function(info) return info[2] == "player" or info[2] == "pet" end, + hidden = function(info) return not (info[2] == "player" or info[2] == "pet") end, }, - healthColor = { + colorAggro = { order = 4, + type = "toggle", + name = L["Color on aggro"], + desc = L["Changes the health bar to the set hostile color (Red by default) when the unit takes aggro."], + arg = "healthBar.colorAggro", + hidden = hideRestrictedOption, + }, + healthColor = { + order = 5, type = "select", name = L["Color health by"], desc = L["Primary means of coloring the health bar, color on aggro and color by reaction will override this if necessary."], @@ -4006,28 +4012,20 @@ local function loadUnitOptions() arg = "healthBar.colorType", }, reaction = { - order = 5, + order = 6, type = "select", name = L["Color by reaction on"], desc = L["When to color the health bar by the units reaction, overriding the color health by option."], arg = "healthBar.reactionType", values = {["none"] = L["Never (Disabled)"], ["player"] = L["Players only"], ["npc"] = L["NPCs only"], ["both"] = L["Both"]}, hidden = function(info) return info[2] == "player" or info[2] == "pet" end, - }, - colorAggro = { - order = 6, - type = "toggle", - name = L["Color on aggro"], - desc = L["Changes the health bar to the set hostile color (Red by default) when the unit takes aggro."], - arg = "healthBar.colorAggro", - hidden = hideRestrictedOption, - }, + } }, }, healAbsorb = { order = 2.5, type = "group", - inline = true, + inline = false, name = L["Heal absorbs"], hidden = function(info) return ShadowUF.Units.zoneUnits[info[2]] or hideRestrictedOption(info) end, disabled = function(info) return not getVariable(info[2], "healthBar", nil, "enabled") end, @@ -4058,7 +4056,7 @@ local function loadUnitOptions() incHeal = { order = 3, type = "group", - inline = true, + inline = false, name = L["Incoming heals"], hidden = function(info) return ShadowUF.Units.zoneUnits[info[2]] or hideRestrictedOption(info) end, disabled = function(info) return not getVariable(info[2], "healthBar", nil, "enabled") end, @@ -4089,7 +4087,7 @@ local function loadUnitOptions() incAbsorb = { order = 3.5, type = "group", - inline = true, + inline = false, name = L["Incoming absorbs"], hidden = function(info) return ShadowUF.Units.zoneUnits[info[2]] or hideRestrictedOption(info) end, disabled = function(info) return not getVariable(info[2], "healthBar", nil, "enabled") end, @@ -4120,7 +4118,7 @@ local function loadUnitOptions() totemBar = { order = 3.6, type = "group", - inline = true, + inline = false, name = ShadowUF.modules.totemBar.moduleName, hidden = function(info) local unit = info[2] @@ -4161,7 +4159,7 @@ local function loadUnitOptions() emptyBar = { order = 4, type = "group", - inline = true, + inline = false, name = L["Empty bar"], hidden = false, args = { @@ -4171,22 +4169,7 @@ local function loadUnitOptions() name = string.format(L["Enable %s"], L["Empty bar"]), desc = L["Adds an empty bar that you can put text into as a way of uncluttering other bars."], arg = "emptyBar.enabled", - width = "full", - }, - reaction = { - order = 2, - type = "select", - name = L["Color by reaction on"], - desc = L["When to color the empty bar by reaction, overriding the default color by option."], - arg = "emptyBar.reactionType", - values = {["none"] = L["Never (Disabled)"], ["player"] = L["Players only"], ["npc"] = L["NPCs only"], ["both"] = L["Both"]}, - }, - colorType = { - order = 3, - type = "toggle", - name = L["Color by class"], - desc = L["Players will be colored by class."], - arg = "emptyBar.class", + width = "full" }, overrideColor = { order = 4, @@ -4214,13 +4197,29 @@ local function loadUnitOptions() end, arg = "emptyBar.backgroundColor", + width = "full" + }, + reaction = { + order = 2, + type = "select", + name = L["Color by reaction on"], + desc = L["When to color the empty bar by reaction, overriding the default color by option."], + arg = "emptyBar.reactionType", + values = {["none"] = L["Never (Disabled)"], ["player"] = L["Players only"], ["npc"] = L["NPCs only"], ["both"] = L["Both"]}, + }, + colorType = { + order = 3, + type = "toggle", + name = L["Color by class"], + desc = L["Players will be colored by class."], + arg = "emptyBar.class", }, }, }, castBar = { order = 5, type = "group", - inline = true, + inline = false, name = L["Cast bar"], hidden = hideRestrictedOption, args = { @@ -4231,6 +4230,7 @@ local function loadUnitOptions() desc = function(info) return ShadowUF.fakeUnits[info[2]] and string.format(L["Due to the nature of fake units, cast bars for %s are not super efficient and can take at most 0.10 seconds to notice a change in cast."], L.units[info[2]] or info[2]) end, hidden = false, arg = "castBar.enabled", + width = "full" }, autoHide = { order = 2, @@ -4278,13 +4278,6 @@ local function loadUnitOptions() hidden = hideAdvancedOption, arg = "castBar.name.anchorPoint", }, - nameSep = { - order = 6, - type = "description", - name = "", - width = "full", - hidden = hideAdvancedOption, - }, nameSize = { order = 7, type = "range", @@ -4323,6 +4316,7 @@ local function loadUnitOptions() name = L["Show cast time"], arg = "castBar.time.enabled", hidden = hideAdvancedOption, + width = "full" }, timeAnchor = { order = 12, @@ -4333,13 +4327,6 @@ local function loadUnitOptions() hidden = hideAdvancedOption, arg = "castBar.time.anchorPoint", }, - timeSep = { - order = 13, - type = "description", - name = "", - width = "full", - hidden = hideAdvancedOption, - }, timeSize = { order = 14, type = "range", @@ -6188,7 +6175,7 @@ function Config:Open() if( not registered ) then loadOptions() - LibStub("AceConfig-3.0"):RegisterOptionsTable("ShadowedUF", options) + AceRegistry:RegisterOptionsTable("ShadowedUF", options, true) AceDialog:SetDefaultSize("ShadowedUF", 865, 550) registered = true end From e9ccb6ef0e9f3441fae3134d40a2aa61e0afd527 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Dec 2013 14:48:40 -0800 Subject: [PATCH 459/794] Config UI now opens in <500ms instead of >5s --- ShadowedUnitFrames.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 42891171..cc2fbe0f 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -829,6 +829,7 @@ end local infoMessages = { { L["As of SUF v3.9, a bunch of new features and units have been added.|n"], + L["- Config UI now opens instantly, and does not take 5 seconds++ to show up!"], L["- Totem/Rune bars now have timers indicating time to refres/expire"], L["- Monk Stagger now shows the amount of staggered damage"], L["- Boss ToT, Main Assist ToT, Main Tank ToT, Party ToT, Battleground ToT and Arena ToT units have been added!"], From a7b70380bf8ddc9d1aded2123a2e0a0de03eac4c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Dec 2013 15:11:02 -0800 Subject: [PATCH 460/794] Bumping to v3.10 --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index cc2fbe0f..a0763ba5 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -828,7 +828,7 @@ end -- Upgrade info local infoMessages = { { - L["As of SUF v3.9, a bunch of new features and units have been added.|n"], + L["As of SUF v3.10, a bunch of new features and units have been added.|n"], L["- Config UI now opens instantly, and does not take 5 seconds++ to show up!"], L["- Totem/Rune bars now have timers indicating time to refres/expire"], L["- Monk Stagger now shows the amount of staggered damage"], From 941157ec46fce69afc9b1acb8f8d014dcb271917 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Dec 2013 18:03:18 -0800 Subject: [PATCH 461/794] Drop LFG eye indicator --- modules/indicators.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index d9f819b8..2f934751 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -19,11 +19,7 @@ end function Indicators:UpdatePhase(frame) if( not frame.indicators.phase or not frame.indicators.phase.enabled ) then return end - if( not UnitInOtherParty(frame.unit) ) then - frame.indicators.phase:SetTexture("Interface\\LFGFrame\\LFG-Eye") - frame.indicators.phase:SetTexCoord(0.125, 0.25, 0.25, 0.5) - frame.indicators.phase:Show() - elseif( UnitIsConnected(frame.unit) and not UnitInPhase(frame.unit) ) then + if( UnitIsConnected(frame.unit) and not UnitInPhase(frame.unit) ) then frame.indicators.phase:SetTexture("Interface\\TargetingFrame\\UI-PhasingIcon") frame.indicators.phase:SetTexCoord(0.15625, 0.84375, 0.15625, 0.84375) frame.indicators.phase:Show() From e1b83b72c2b439fa6dbba3c77769af0128350b2c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Dec 2013 18:15:56 -0800 Subject: [PATCH 462/794] Revert de-inlining of General tab, don't like the change --- options/config.lua | 50 ++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/options/config.lua b/options/config.lua index eecfe153..852b17bf 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2457,7 +2457,7 @@ local function loadUnitOptions() vehicle = { order = 1, type = "group", - inline = false, + inline = true, name = L["Vehicles"], hidden = function(info) return info[2] ~= "player" and info[2] ~= "party" or not ShadowUF.db.profile.advanced end, args = { @@ -2494,7 +2494,7 @@ local function loadUnitOptions() portrait = { order = 2, type = "group", - inline = false, + inline = true, hidden = false, name = L["Portrait"], args = { @@ -2503,7 +2503,6 @@ local function loadUnitOptions() type = "toggle", name = string.format(L["Enable %s"], L["Portrait"]), arg = "portrait.enabled", - width = "full" }, portraitType = { order = 1, @@ -2524,7 +2523,7 @@ local function loadUnitOptions() fader = { order = 3, type = "group", - inline = false, + inline = true, name = L["Combat fader"], hidden = hideRestrictedOption, args = { @@ -2534,8 +2533,7 @@ local function loadUnitOptions() name = string.format(L["Enable %s"], L["Combat fader"]), desc = L["Combat fader will fade out all your frames while they are inactive and fade them back in once you are in combat or active."], hidden = false, - arg = "fader.enabled", - width = "full" + arg = "fader.enabled" }, combatAlpha = { order = 1, @@ -2562,7 +2560,7 @@ local function loadUnitOptions() range = { order = 3, type = "group", - inline = false, + inline = true, name = L["Range indicator"], hidden = hideRestrictedOption, args = { @@ -2573,7 +2571,6 @@ local function loadUnitOptions() desc = L["Fades out the unit frames of people who are not within range of you."], arg = "range.enabled", hidden = false, - width = "full" }, inAlpha = { order = 1, @@ -2599,7 +2596,7 @@ local function loadUnitOptions() highlight = { order = 3.5, type = "group", - inline = false, + inline = true, name = L["Border highlighting"], hidden = hideRestrictedOption, args = { @@ -2681,7 +2678,7 @@ local function loadUnitOptions() barSouls = { order = 4, type = "group", - inline = false, + inline = true, name = L["Soul Shards"], hidden = function(info) return playerClass ~= "WARLOCK" or not getVariable(info[2], "soulShards", nil, "isBar") or not getVariable(info[2], nil, nil, "soulShards") end, args = { @@ -2712,7 +2709,7 @@ local function loadUnitOptions() soulShards = { order = 4, type = "group", - inline = false, + inline = true, name = L["Soul Shards"], hidden = function(info) if( info[2] == "global" or getVariable(info[2], "soulShards", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, args = { @@ -2791,7 +2788,7 @@ local function loadUnitOptions() barHolyPower = { order = 4, type = "group", - inline = false, + inline = true, name = L["Holy Power"], hidden = function(info) return playerClass ~= "PALADIN" or not getVariable(info[2], "holyPower", nil, "isBar") or not getVariable(info[2], nil, nil, "holyPower") end, args = { @@ -2822,7 +2819,7 @@ local function loadUnitOptions() holyPower = { order = 4, type = "group", - inline = false, + inline = true, name = L["Holy Power"], hidden = function(info) if( info[2] == "global" or getVariable(info[2], "holyPower", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, args = { @@ -2901,7 +2898,7 @@ local function loadUnitOptions() barShadowOrbs = { order = 4, type = "group", - inline = false, + inline = true, name = L["Shadow Orbs"], hidden = function(info) return playerClass ~= "PRIEST" or not getVariable(info[2], "shadowOrbs", nil, "isBar") or not getVariable(info[2], nil, nil, "shadowOrbs") end, args = { @@ -2932,7 +2929,7 @@ local function loadUnitOptions() shadowOrbs = { order = 4, type = "group", - inline = false, + inline = true, name = L["Holy Power"], hidden = function(info) if( info[2] == "global" or getVariable(info[2], "shadowOrbs", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, args = { @@ -3011,7 +3008,7 @@ local function loadUnitOptions() barChi = { order = 4, type = "group", - inline = false, + inline = true, name = L["Chi"], hidden = function(info) return playerClass ~= "MONK" or not getVariable(info[2], "chi", nil, "isBar") or not getVariable(info[2], nil, nil, "chi") end, args = { @@ -3042,7 +3039,7 @@ local function loadUnitOptions() chi = { order = 4, type = "group", - inline = false, + inline = true, name = L["Chi"], hidden = function(info) if( info[2] == "global" or getVariable(info[2], "chi", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, args = { @@ -3121,7 +3118,7 @@ local function loadUnitOptions() barComboPoints = { order = 4, type = "group", - inline = false, + inline = true, name = L["Combo points"], hidden = function(info) return not getVariable(info[2], "comboPoints", nil, "isBar") or not getVariable(info[2], nil, nil, "comboPoints") end, args = { @@ -3131,7 +3128,6 @@ local function loadUnitOptions() name = string.format(L["Enable %s"], L["Combo points"]), hidden = false, arg = "comboPoints.enabled", - width = "full" }, growth = { order = 2, @@ -3153,7 +3149,7 @@ local function loadUnitOptions() comboPoints = { order = 4, type = "group", - inline = false, + inline = true, name = L["Combo points"], hidden = function(info) if( info[2] == "global" or getVariable(info[2], "comboPoints", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, args = { @@ -3232,7 +3228,7 @@ local function loadUnitOptions() barAuraPoints = { order = 4, type = "group", - inline = false, + inline = true, name = L["Aura Combo Points"], hidden = function(info) return not ShadowUF.modules.auraPoints or not getVariable(info[2], "auraPoints", nil, "isBar") or not getVariable(info[2], nil, nil, "auraPoints") end, args = { @@ -3242,7 +3238,6 @@ local function loadUnitOptions() name = string.format(L["Enable %s"], L["Aura Combo Points"]), hidden = false, arg = "auraPoints.enabled", - width = "full" }, growth = { order = 2, @@ -3264,7 +3259,7 @@ local function loadUnitOptions() auraPoints = { order = 4, type = "group", - inline = false, + inline = true, name = L["Aura Combo Points"], hidden = function(info) if( info[2] == "global" or getVariable(info[2], "auraPoints", nil, "isBar") ) then return true end return not ShadowUF.modules.auraPoints or hideRestrictedOption(info) end, args = { @@ -3342,7 +3337,7 @@ local function loadUnitOptions() combatText = { order = 5, type = "group", - inline = false, + inline = true, name = L["Combat text"], hidden = hideRestrictedOption, args = { @@ -3354,6 +3349,13 @@ local function loadUnitOptions() arg = "combatText.enabled", hidden = false, }, + sep = { + order = 1, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, anchorPoint = { order = 3, type = "select", From ddec1209909c4e3f88a0b4b37514eb5719147ee2 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Dec 2013 18:22:32 -0800 Subject: [PATCH 463/794] Name update --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index a0763ba5..82322798 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -1,5 +1,5 @@ --[[ - Shadowed Unit Frames, Shadow of Mal'Ganis (US) PvP + Shadowed Unit Frames, Shadowed of Mal'Ganis (US) PvP ]] ShadowUF = select(2, ...) From a675b3583d3b0f28f85df4a389f391f5ec0e73a8 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Dec 2013 18:22:42 -0800 Subject: [PATCH 464/794] Casing fixes --- options/config.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/options/config.lua b/options/config.lua index 852b17bf..7f875fa3 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4519,7 +4519,7 @@ local function loadUnitOptions() options.args.enableUnits = { type = "group", - name = L["Enabled units"], + name = L["Enabled Units"], desc = getPageDescription, args = { help = { @@ -4605,7 +4605,7 @@ local function loadUnitOptions() options.args.units = { type = "group", - name = L["Unit configuration"], + name = L["Unit Configuration"], desc = getPageDescription, args = { help = { @@ -5276,7 +5276,7 @@ local function loadFilterOptions() options.args.filter = { type = "group", - name = L["Aura filters"], + name = L["Aura Filters"], childGroups = "tab", desc = getPageDescription, args = { @@ -5522,7 +5522,7 @@ local function loadTagOptions() options.args.tags = { type = "group", childGroups = "tab", - name = L["Add tags"], + name = L["Add Tags"], desc = getPageDescription, hidden = hideAdvancedOption, args = { From 2bc7420b2808a0ed924d22b1df3b1ada056e79ef Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Dec 2013 18:22:50 -0800 Subject: [PATCH 465/794] Removed unused variable --- modules/auras.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 22c738b4..ac8d3b6c 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -500,14 +500,10 @@ local function scan(parent, frame, type, config, displayConfig, filter) local isFriendly = UnitIsFriend(frame.parent.unit, "player") local curable = (isFriendly and type == "debuffs" and config.raid) local index = 0 - local cureType while( true ) do index = index + 1 local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID = UnitAura(frame.parent.unit, index, filter) if( not name ) then break end - - -- Blizzard bug, Enrage is an empty string. - cureType = auraType == "" and "Enrage" or auraType if( ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and ( parent.whitelist[name] or parent.whitelist[spellID] ) or parent.blacklist[type] and ( not parent.blacklist[name] and not parent.blacklist[spellID] ) ) and ( not curable or canCure[auraType] ) ) then -- Create any buttons we need From 24342922f37896630cf3a62b222db7f16d64dff7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Dec 2013 18:26:41 -0800 Subject: [PATCH 466/794] Allow canceling of personal vehicle auras --- modules/auras.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index ac8d3b6c..8d260949 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -207,11 +207,11 @@ local function hideTooltip(self) end local function cancelAura(self, mouse) - if( mouse ~= "RightButton" or not UnitIsUnit(self.parent.unit, "player") or InCombatLockdown() or self.filter == "TEMP" ) then + if( mouse ~= "RightButton" or not UnitIsUnit(self.parent.unit, "player") or not UnitIsUnit(self.parent.unit, "vehicle") or InCombatLockdown() or self.filter == "TEMP" ) then return end - CancelUnitBuff("player", self.auraID, self.filter) + CancelUnitBuff(self.parent.unit, self.auraID, self.filter) end local function updateButton(id, group, config) From 07e09495a9a857a64f9b73b821d0fcbaf857b0c0 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Dec 2013 18:30:33 -0800 Subject: [PATCH 467/794] Disable temporary enchant scans while in a vehicle --- modules/auras.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/auras.lua b/modules/auras.lua index 8d260949..8d17c2cc 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -439,10 +439,23 @@ end -- Unfortunately, temporary enchants have basically no support beyond hacks. So we will hack! tempEnchantScan = function(self, elapsed) + if( self.parent.unit == self.parent.vehicleUnit and self.lastTemporary > 0 ) then + mainHand.has = false + offHand.has = false + ranged.has = false + + self.temporaryEnchants = 0 + self.lastTemporary = 0 + + Auras:Update(self.parent) + return + end + timeElapsed = timeElapsed + elapsed if( timeElapsed < 0.50 ) then return end timeElapsed = timeElapsed - 0.50 + local hasMain, mainTimeLeft, mainCharges, hasOff, offTimeLeft, offCharges, hasRanged, rangedTimeLeft, rangedCharges = GetWeaponEnchantInfo() self.temporaryEnchants = 0 From c0233f1522c4b5e33670fe1541a9329e4472f716 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 9 Dec 2013 17:24:34 -0800 Subject: [PATCH 468/794] Try and fix phase indicator not updating correctly --- modules/indicators.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/indicators.lua b/modules/indicators.lua index 2f934751..578bb20e 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -302,6 +302,9 @@ function Indicators:OnEnable(frame) end if( config.indicators.phase and config.indicators.phase.enabled ) then + frame:RegisterUnitEvent("UNIT_PHASE", self, "UpdatePhase") + frame:RegisterNormalEvent("PARTY_MEMBER_ENABLE", self, "UpdatePhase") + frame:RegisterNormalEvent("PARTY_MEMBER_DISABLE", self, "UpdatePhase") frame:RegisterUpdateFunc(self, "UpdatePhase") frame.indicators.phase = frame.indicators.phase or frame.indicators:CreateTexture(nil, "OVERLAY") end From 9ae74ad3256b320a653e54ab42f918793f9dc978 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 9 Dec 2013 17:27:51 -0800 Subject: [PATCH 469/794] Fixed aura canceling --- modules/auras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index 8d17c2cc..875741a5 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -207,7 +207,7 @@ local function hideTooltip(self) end local function cancelAura(self, mouse) - if( mouse ~= "RightButton" or not UnitIsUnit(self.parent.unit, "player") or not UnitIsUnit(self.parent.unit, "vehicle") or InCombatLockdown() or self.filter == "TEMP" ) then + if( mouse ~= "RightButton" or ( not UnitIsUnit(self.parent.unit, "player") and not UnitIsUnit(self.parent.unit, "vehicle") ) or InCombatLockdown() or self.filter == "TEMP" ) then return end From b1cf1ae9f72b520eaa7da1a764421790620653bc Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 11 Dec 2013 20:04:07 -0800 Subject: [PATCH 470/794] Update all phase indicators when the players phase changes --- modules/indicators.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 578bb20e..458c55be 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -16,8 +16,10 @@ function Indicators:UpdateClass(frame) end end -function Indicators:UpdatePhase(frame) +function Indicators:UpdatePhase(frame, event, unit) if( not frame.indicators.phase or not frame.indicators.phase.enabled ) then return end + -- When the player phases, we need to update any phase indicators for other non-player units + if( event and unit ~= "player" ) then return end if( UnitIsConnected(frame.unit) and not UnitInPhase(frame.unit) ) then frame.indicators.phase:SetTexture("Interface\\TargetingFrame\\UI-PhasingIcon") @@ -301,10 +303,8 @@ function Indicators:OnEnable(frame) frame.indicators:SetScript("OnUpdate", nil) end - if( config.indicators.phase and config.indicators.phase.enabled ) then - frame:RegisterUnitEvent("UNIT_PHASE", self, "UpdatePhase") - frame:RegisterNormalEvent("PARTY_MEMBER_ENABLE", self, "UpdatePhase") - frame:RegisterNormalEvent("PARTY_MEMBER_DISABLE", self, "UpdatePhase") + if( config.indicators.phase and config.indicators.phase.enabled ) then + frame:RegisterNormalEvent("UNIT_PHASE", self, "UpdatePhase") frame:RegisterUpdateFunc(self, "UpdatePhase") frame.indicators.phase = frame.indicators.phase or frame.indicators:CreateTexture(nil, "OVERLAY") end From fdf28e87b8b8d4ebb7ea19bf44abc043dd149b3b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 13 Dec 2013 07:50:56 -0800 Subject: [PATCH 471/794] Add another event to try and force phase indicators to update --- modules/indicators.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/indicators.lua b/modules/indicators.lua index 458c55be..0f5e259d 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -305,6 +305,7 @@ function Indicators:OnEnable(frame) if( config.indicators.phase and config.indicators.phase.enabled ) then frame:RegisterNormalEvent("UNIT_PHASE", self, "UpdatePhase") + frame:RegisterNormalEvent("PLAYER_ENTERING_WORLD", self, "UpdatePhase") frame:RegisterUpdateFunc(self, "UpdatePhase") frame.indicators.phase = frame.indicators.phase or frame.indicators:CreateTexture(nil, "OVERLAY") end From ef326775d74635ce1b15d11b734ccb2ffd5d3033 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 17 Dec 2013 20:34:35 -0800 Subject: [PATCH 472/794] Fixed some obscure leaked globals --- modules/movers.lua | 2 -- modules/units.lua | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/movers.lua b/modules/movers.lua index 319af025..7b3283b4 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -484,8 +484,6 @@ function Movers:CreateInfoFrame() DEFAULT_CHAT_FRAME:AddMessage(L["You have entered combat, unit frames have been locked. Once you leave combat you will need to unlock them again through /shadowuf."]) end end) - frame:SetScript("OnShow", OnShow) - frame:SetScript("OnHide", OnHide) frame:SetScript("OnDragStart", function(self) self:StartMoving() end) diff --git a/modules/units.lua b/modules/units.lua index bb2e52bb..4c33c3d7 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -187,7 +187,7 @@ end -- Register a function to be called in an OnUpdate if it's an invalid unit (targettarget/etc) local function RegisterUpdateFunc(self, handler, func) if( not handler[func] ) then - error(string.format("Invalid handler/function passed to RegisterUpdateFunc for %s, the function %s does not exist.", self:GetName() or tostring(self), event, func), 3) + error(string.format("Invalid handler/function passed to RegisterUpdateFunc for %s, the function %s does not exist.", self:GetName() or tostring(self), func), 3) return end @@ -476,7 +476,7 @@ function Units:CheckGroupedUnitStatus(frame) if( frame.inVehicle and not UnitExists(frame.unit) and UnitExists(frame.unitOwner) ) then frame.inVehicle = false frame.unit = frame.unitOwner - frame.unitGUID = guid + frame.unitGUID = UnitGUID(frame.unit) frame:FullUpdate() else frame.unitGUID = UnitGUID(frame.unit) From 07e3f4f8a62d6866cc2ccc27a0cec33c973c1954 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 18 Dec 2013 19:26:35 -0800 Subject: [PATCH 473/794] Use UPDATE_WORLD_STATES for phase changes because I hate Blizzard --- modules/indicators.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 0f5e259d..38140746 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -16,10 +16,8 @@ function Indicators:UpdateClass(frame) end end -function Indicators:UpdatePhase(frame, event, unit) +function Indicators:UpdatePhase(frame) if( not frame.indicators.phase or not frame.indicators.phase.enabled ) then return end - -- When the player phases, we need to update any phase indicators for other non-player units - if( event and unit ~= "player" ) then return end if( UnitIsConnected(frame.unit) and not UnitInPhase(frame.unit) ) then frame.indicators.phase:SetTexture("Interface\\TargetingFrame\\UI-PhasingIcon") @@ -304,8 +302,8 @@ function Indicators:OnEnable(frame) end if( config.indicators.phase and config.indicators.phase.enabled ) then - frame:RegisterNormalEvent("UNIT_PHASE", self, "UpdatePhase") - frame:RegisterNormalEvent("PLAYER_ENTERING_WORLD", self, "UpdatePhase") + -- Player phase changes do not generate a phase change event. This seems to be the best + frame:RegisterNormalEvent("UPDATE_WORLD_STATES", self, "UpdatePhase") frame:RegisterUpdateFunc(self, "UpdatePhase") frame.indicators.phase = frame.indicators.phase or frame.indicators:CreateTexture(nil, "OVERLAY") end From db3f34b67c45988055651005a03077053ac069da Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 18 Dec 2013 20:04:10 -0800 Subject: [PATCH 474/794] Rewrote global checker to look at GETGLOBAL and SETGLOBAL --- .pkgmeta | 2 +- globalcheck.lua | 83 ------------------------------------------------- globalcheck.rb | 78 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 84 deletions(-) delete mode 100755 globalcheck.lua create mode 100755 globalcheck.rb diff --git a/.pkgmeta b/.pkgmeta index c4cad9cb..bad1bea5 100755 --- a/.pkgmeta +++ b/.pkgmeta @@ -29,5 +29,5 @@ externals: tag: latest ignore: - - globalcheck.lua + - globalcheck.rb - localcheck.lua diff --git a/globalcheck.lua b/globalcheck.lua deleted file mode 100755 index eac96f92..00000000 --- a/globalcheck.lua +++ /dev/null @@ -1,83 +0,0 @@ -local isOSX = true -local leaks = {} -local results = "" -local function output(msg) - results = results .. "\r\n" .. msg -end - -local function scanFile(path) - output(io.popen(string.format("luac -l %s", path)):read("*all")) -end - -local function scanFolder(path) - local command - if( isOSX ) then - command = string.format("ls \"%s\"", (path or "./")) - else - command = string.format("dir /B \"%s\"", (path or "")) - end - - for file in io.popen(command):lines() do - local extension = string.match(file, "%.([%a%d]+)$") - if( file ~= "" and not extension and file ~= "libs" ) then - if( path ) then - scanFolder(path .. "/" .. file) - else - scanFolder(file) - end - elseif( extension == "lua" and file ~= "localcheck.lua" and file ~= "globalcheck.lua" and not string.match(file, "^localization%.([a-zA-Z]+)%.lua") ) then - if( path ) then - scanFile(path .. "/" .. file) - else - scanFile(file) - end - end - end -end - -scanFolder() - -if( isOSX ) then - io.popen("unlink luac.out") -else - io.popen("del luac.out") -end - -local file = io.open("results.txt", "w") -file:write(tostring(results)) -file:flush() -file:close() - - -local f = io.open("results.txt", "r") -local data = f:read("*all") -function lines(str) - local t = {} - local function helper(line) table.insert(t, line) return "" end - helper((str:gsub("(.-)\r?\n", helper))) - return t -end - -local printFile -for _, line in pairs(lines(data)) do - if( string.match(line, "(.+) <(.+)>") ) then - file = line - printFile = nil - end - - if( string.match(line, "SETGLOBAL") ) then - if( not printFile ) then - print(file) - printFile = true - end - - print(line) - end -end - -f:close() -if( isOSX ) then - io.popen("unlink results.txt") -else - io.popen("del results.txt") -end diff --git a/globalcheck.rb b/globalcheck.rb new file mode 100755 index 00000000..ef994096 --- /dev/null +++ b/globalcheck.rb @@ -0,0 +1,78 @@ +# Train against the WoW UI first +path = File.expand_path("../../../../BlizzardInterfaceCode/Interface", __FILE__) + +$ranked = {} +Dir["#{path}/{AddOns,FrameXML}/**/*.lua"].each do |file| + res = `luac -l '#{file}' 2>&1` + if res !~ /^luac/ + res.split("\n\t").each do |line| + _, line, type, offset, target = line.split("\t") + next unless target + + if type == "GETGLOBAL" + target.gsub!(";", "") + target.strip! + + $ranked[target] ||= 0 + $ranked[target] += 1 + end + end + end +end + +# Anything that we don't use enough or WoW doesn't use enough for it to be trained +$blacklisted = ["ShadowUF", "rawset", "rawget", "setfenv", "getfenv", "math", "GetLocale", "UnitReaction", "LibStub", "loadstring", "print", "IsResting", "UnitAura", "UnitIsFriend", "GetComboPoints", "GetEclipseDirection", "UnitIsTapped", "UnitPlayerControlled", "UnitCreatureFamily", "UnitThreatSituation", "UnitClassification", "UnitInPhase", "IsEveryoneAssistant", "UnitStagger", "RegisterUnitWatch", "UnregisterUnitWatch", "UnitIsVisible", "UnitInRange", "CheckInteractDistance", "GetRuneCooldown", "GetRuneType", "GetTotemInfo", "RegisterStateDriver", "ClickCastHeader", "ClickCastFrames", "IsPlayerSpell", "UnitXP", "GetPetExperience", "GetBuildInfo", "CompactPartyFrame", "hooksecurefunc", "TemporaryEnchantFrame", "PriestBarFrame", "PaladinPowerBar", "EclipseBarFrame", "ShardBarFrame", "RuneFrame", "MonkHarmonyBar", "ComboFrame", "QueueStatusFrame", "LoadAddOn"] + +# Filter check +def filtered?(target) + if $ranked[target] and $ranked[target] >= 6 + true + elsif $blacklisted.include?(target) + true + elsif target.gsub(/[^A-Z]/, "").length >= 4 + true + else + false + end +end + +# Check all files for leaked globals + +total = 0 +Dir["./**/*.lua"].each do |file| + next if file =~ /localcheck/ + + res = `luac -l #{file} 2>&1` + if res =~ /luac:/ + puts "#{res.gsub("luac:", "").strip}" + next + end + + leaked = [] + res.split("\n\t").each do |line| + _, line, type, offset, target = line.split("\t") + next unless target + next unless type == "SETGLOBAL" or type == "GETGLOBAL" + + target.gsub!(";", "") + target.strip! + next if filtered?(target) + + leaked << {line: line, target: target} + end + + next if leaked.empty? + total += 1 + + puts + puts file + leaked.each do |row| + puts "#{row[:line]} #{row[:target]}" + end +end + +if total == 0 + puts "No leaked globals found!" +end + +File.unlink("./luac.out") rescue nil \ No newline at end of file From 14cf60c293255a89ed9fefc3fc8b326362daac21 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 18 Dec 2013 20:04:28 -0800 Subject: [PATCH 475/794] Fixed leaked globals --- modules/auras.lua | 2 +- modules/movers.lua | 2 +- options/config.lua | 23 ----------------------- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 875741a5..7f90a8c0 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -412,7 +412,7 @@ local function updateTemporaryEnchant(frame, slot, tempData, hasEnchant, timeLef end -- Enlarge our own auras - if( config.enlargeSelf and caster == ShadowUF.playerUnit ) then + if( config.enlargeSelf ) then button.isSelfScaled = true button:SetScale(config.selfScale) else diff --git a/modules/movers.lua b/modules/movers.lua index 7b3283b4..1e8b56d3 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -34,7 +34,7 @@ local function createConfigEnv() UnitIsWildBattlePet = function(unit) return unit == "target" or unit == "focus" end, UnitBattlePetType = function(unit) if( unit == "target" or unit == "focus" ) then - return getValue("UnitBattlePetType", unit, random(#(PET_TYPE_SUFFIX))) + return getValue("UnitBattlePetType", unit, math.random(#(PET_TYPE_SUFFIX))) end end, UnitHealthMax = function(unit) return 50000 end, diff --git a/options/config.lua b/options/config.lua index 7f875fa3..24db827d 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1833,29 +1833,6 @@ local function loadUnitOptions() text = string.format("%s[( )%s]", text, tag) end end - -- Removing a tag from global config, need to make sure we can do it - -- Hack, clean up later - elseif( unit == "global" ) then - table.wipe(savedTagTexts) - for unit in pairs(modifyUnits) do - if( not ShadowUF.Tags.unitBlacklist[tagGroup] or not string.match(unit, ShadowUF.Tags.unitBlacklist[tagGroup]) ) then - if( not ShadowUF.Tags.unitRestrictions[tag] or ShadowUF.Tags.unitRestrictions[tag] == unit ) then - local text = getVariable(unit, "text", id, "text") - for matchedTag in string.gmatch(text, "%[(.-)%]") do - local safeTag = "[" .. matchedTag .. "]" - if( string.match(safeTag, "%[" .. tag .. "%]") or string.match(safeTag, "%)" .. tag .. "%]") or string.match(safeTag, "%[" .. tag .. "%(") or string.match(safeTag, "%)" .. tag .. "%(") ) then - text = string.gsub(text, "%[" .. string.gsub(string.gsub(matchedTag, "%)", "%%)"), "%(", "%%(") .. "%]", "") - text = string.gsub(text, " ", "") - text = string.trim(text) - break - end - end - - savedTagTexts[unit] = text - savedTagTexts.global = text - end - end - end -- Removing a tag from a single unit, super easy :< else From 52ed50908f10504bbd347d9384f4359aa3704af0 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 18 Dec 2013 20:57:55 -0800 Subject: [PATCH 476/794] Rewrote localcheck into Ruby to actually auto submit i18n again --- globalcheck.rb | 1 - localcheck.lua | 249 ------------------------------------------------- localcheck.rb | 64 +++++++++++++ 3 files changed, 64 insertions(+), 250 deletions(-) delete mode 100755 localcheck.lua create mode 100755 localcheck.rb diff --git a/globalcheck.rb b/globalcheck.rb index ef994096..b5c08bb4 100755 --- a/globalcheck.rb +++ b/globalcheck.rb @@ -37,7 +37,6 @@ def filtered?(target) end # Check all files for leaked globals - total = 0 Dir["./**/*.lua"].each do |file| next if file =~ /localcheck/ diff --git a/localcheck.lua b/localcheck.lua deleted file mode 100755 index 31e78d5d..00000000 --- a/localcheck.lua +++ /dev/null @@ -1,249 +0,0 @@ --- If you want to hardcode toc or slug in and not enter it, do so here -local ADDON_SLUG -local TOC_FILE --- Automatically identify the slug based on the .git or .svn configuration data, change the path if it's not in root, or set to false to disable -local AUTO_IDENTIFY_SLUG = "./" --- Automatically find the TOC in the given path, set to false to disable -local AUTO_FIND_TOC = "./" --- Only necessary if you aren't auto identify the slug, curseforge or wowace. -local SITE_LOCATION = nil --- Personally I keep the api key in another file and just have this reference that to get it --- If you want to do this, create the file with CURSE_API_KEY = "" in it and set the path here --- set this to nil and it will ask you for your API key -local API_KEY_FILE = "../TestCode/api-key.lua" --- Patterns that should not be scrapped, case-insensitive --- Anything between the no-lib-strip is automatically ignored -local FILE_BLACKLIST = {"^localization", "^lib"} --- 1 = English -DEFAULT_LANGUAGE = "1" --- Removes phrases that are not found through this -DELETE_UNIMPORTED = true - --- No more modifying! -local OS_TYPE = os.getenv("HOME") and "linux" or "windows" - --- Mak sure we have LuaSockets -local _, http = pcall(require, "socket.http") -local _, ltn = pcall(require, "ltn12") -if( not http ) then - print("Failed to find socket.http, did you install LuaSockets?") -elseif( not ltn ) then - print("Failed to find ltn12, did you install LuaSockets?") -end - - --- Figure out the API key -if( API_KEY_FILE ) then - local file = io.open(API_KEY_FILE) - if( not file ) then - print(string.format("It appears the API key file %s does not exist.", API_KEY_FILE)) - else - file:close() - dofile(API_KEY_FILE) - - if( not CURSE_API_KEY ) then - print("You did not define CURSE_API_KEY in your key file, make sure it does not have local next to it.") - end - end -end - - -if( not CURSE_API_KEY ) then - while( not CURSE_API_KEY ) do - io.stdout:write("Enter API key: ") - CURSE_API_KEY = io.stdin:read("*line") - CURSE_API_KEY = CURSE_API_KEY ~= "" and CURSE_API_KEY or nil - end -end - --- Attempt to automatically identify the addon slug -if( AUTO_IDENTIFY_SLUG ) then - local git = io.open(AUTO_IDENTIFY_SLUG .. ".git/config") - local svn = io.open(AUTO_IDENTIFY_SLUG .. ".svn/entries") - - if( git ) then - local contents = git:read("*all") - git:close() - - SITE_LOCATION, ADDON_SLUG = string.match(contents, "git%.(.-)%.com:wow/(.-)/mainline%.git") - elseif( svn ) then - local contents = svn:read("*all") - svn:close() - - SITE_LOCATION, ADDON_SLUG = string.match(contents, "svn%.(.-)%.com/wow/(.-)/mainline") - end - - if( not ADDON_SLUG ) then - print("Failed to identify addon slug.") - elseif( not SITE_LOCATION ) then - print("Failed to identify site location.") - end -end - -if( not SITE_LOCATION ) then - while( not SITE_LOCATION ) do - io.stdout:write("Site location [wowace/curseforge]: ") - SITE_LOCATION = io.stdin:read("*line") - SITE_LOCATION = ( SITE_LOCATION == "wowace" or SITE_LOCATION == "curseforge" ) and SITE_LOCATION or nil - end -end - --- Manually ask for it -if( not ADDON_SLUG ) then - while( not ADDON_SLUG ) do - io.stdout:write("Enter slug: ") - ADDON_SLUG = io.stdin:read("*line") - ADDON_SLUG = ADDON_SLUG ~= "" and ADDON_SLUG or nil - end -end - -print(string.format("Using addon slug: %s", ADDON_SLUG)) - --- Find the TOC now -if( AUTO_FIND_TOC ) then - local pipe = OS_TYPE == "windows" and io.popen(string.format("dir /B \"%s\"", AUTO_FIND_TOC)) or io.popen(string.format("ls -1 \"%s\"", AUTO_FIND_TOC)) - if( type(pipe) == "userdata" ) then - for file in pipe:lines() do - if( string.match(file, "(.+)%.toc") ) then - TOC_FILE = file - break - end - end - - pipe:close() - if( not TOC_FILE ) then print("Failed to auto detect toc file.") end - else - print("Failed to auto find toc, cannot run dir /B or ls -1") - end -end - -if( not TOC_FILE ) then - while( not TOC_FILE ) do - io.stdout:write("TOC path: ") - TOC_FILE = io.stdin:read("*line") - TOC_FILE = TOC_FILE ~= "" and TOC_FILE or nil - if( TOC_FILE ) then - local file = io.open(TOC_FILE) - if( file ) then - file:close() - break - else - print(string.format("%s does not exist.", TOC_FILE)) - end - end - end -end - -print(string.format("Using TOC file %s", TOC_FILE)) -print("") - --- Parse through the TOC file so we know what to scan -local ignore -local localizedKeys = {} -for line in io.lines(TOC_FILE) do - line = string.gsub(line, "\r", "") - - if( string.match(line, "#@no%-lib%-strip@") ) then - ignore = true - elseif( string.match(line, "#@end%-no%-lib%-strip@") ) then - ignore = nil - end - - if( not ignore and string.match(line, "%.lua") and not string.match(line, "^%s*#")) then - -- Make sure it's a valid file - local blacklist - for _, check in pairs(FILE_BLACKLIST) do - if( string.match(string.lower(line), check) ) then - blacklist = true - break - end - end - - -- File checks out, scrap everything - if( not blacklist ) then - -- Fix slashes - if( OS_TYPE == "linux" ) then - line = string.gsub(line, "\\", "/") - end - - local keys = 0 - local contents = io.open(line):read("*all") - - for match in string.gmatch(contents, "L%[\"(.-)%\"]") do - if( not localizedKeys[match] ) then keys = keys + 1 end - localizedKeys[match] = true - end - - print(string.format("%s (%d keys)", line, keys)) - end - end -end - --- Compile all of the localization we found into string form -local totalLocalizedKeys = 0 -local localization = "" -for key in pairs(localizedKeys) do - localization = string.format("%s\nL[\"%s\"] = true", localization, key, key) - totalLocalizedKeys = totalLocalizedKeys + 1 -end - -if( totalLocalizedKeys == 0 ) then - print("Warning, failed to find any localizations, perhaps you messed up a configuration variable?") - return -end - -print(string.format("Found %d keys total", totalLocalizedKeys)) - -local addonData = { - ["format"] = "lua_additive_table", - ["language"] = DEFAULT_LANGUAGE, - ["delete_unimported"] = DELETE_UNIMPORTED and "y" or "n", - ["text"] = localization, -} - -print(localization) - --- Send it off -local boundary = string.format("-------%s", os.time()) -local source = {} -local body = "" - -for key, data in pairs(addonData) do - body = string.format("%s--%s\r\n", body, boundary) - body = string.format("%sContent-Disposition: form-data; name=\"%s\"\r\n\r\n", body, key) - body = string.format("%s%s\r\n", body, data) -end - -body = string.format("%s--%s\r\n", body, boundary) - -http.request({ - method = "POST", - url = string.format("http://www.%s.com/addons/%s/localization/import/?api-key=", SITE_LOCATION, ADDON_SLUG, CURSE_API_KEY), - sink = ltn12.sink.table(source), - source = ltn12.source.string(body), - headers = { - ["Content-Type"] = string.format("multipart/form-data; boundary=\"%s\"", boundary), - ["Content-Length"] = string.len(body), - ["Referer"] = string.format("http://www.%s.com/addons/%s/localization/import/", SITE_LOCATION, ADDON_SLUG) - }, -}) - -local contents = table.concat(source, "\n") -local errors = {} -for line in string.gmatch(contents, "(.-)\n") do - local msg = string.match(line, "(.-)

") - if( msg ) then - table.insert(errors, msg) - end -end - -print("") - -if( #(errors) == 0 ) then - print(string.format("Updated localization for %s on %s!", ADDON_SLUG, SITE_LOCATION)) -else - print("Localization failed:") - for _, line in pairs(errors) do - print(line) - end -end diff --git a/localcheck.rb b/localcheck.rb new file mode 100755 index 00000000..1c3c3850 --- /dev/null +++ b/localcheck.rb @@ -0,0 +1,64 @@ +require "typhoeus" +require "uri" + +skip = nil +i18n = {} + +toc_file = File.read("./ShadowedUnitFrames.toc") +toc_file.split("\n").each do |line| + # Scan TOC for relevant files that are active + line.strip! + next if line == "" + + if line == '#@no-lib-strip@' + skip = true + elsif line == '#@end-no-lib-strip@' + skip = nil + next + elsif line =~ /^\#/ + next + end + + next if skip || line =~ /^localization/ + + keys = 0 + + # Extract i18n + file = File.read("./#{line.tr("\\", "/")}") + file.scan(/L\["(.+?)"\]/).each do |match| + text = match.first + + i18n[text] = true + keys += 1 + end + + puts "#{line} (#{keys} keys)" +end + +puts "Total #{i18n.length}" +puts + +# Turn it into a lua additive table for uploading +compiled = "" +i18n.each_key do |text| + compiled << "L[\"#{text}\"] = true\n" +end + +# Onward! +URL = "http://www.wowace.com/addons/shadowed-unit-frames/localization/import/" + +res = Typhoeus.post(URL, + headers: {Referer: URL}, + body: URI.encode_www_form( + "api-key" => File.read(File.expand_path("~/.curse-key")).strip, + format: :lua_additive_table, + language: 1, + delete_unimported: "y", + text: compiled + ) +) + + +puts res.headers.inspect +puts res.code +puts res.body \ No newline at end of file From 199d5d87261ea400fd8cf6679bd155fbb7da1425 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 19 Dec 2013 18:25:16 -0800 Subject: [PATCH 477/794] Add auto recoevering of invalid heights in layouts --- modules/layout.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/layout.lua b/modules/layout.lua index 5dd9c327..b69d75b9 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -499,6 +499,8 @@ function Layout:PositionWidgets(frame, config) -- Figure out total weighting as well as what bars are full sized for i=#(barOrder), 1, -1 do table.remove(barOrder, i) end for key, module in pairs(ShadowUF.modules) do + if( config[key] and not config[key].height ) then config[key].height = 0.50 end + if( ( module.moduleHasBar or config[key] and config[key].isBar ) and frame[key] and frame[key]:IsShown() and config[key].height > 0 ) then totalWeight = totalWeight + config[key].height totalBars = totalBars + 1 From c3cc3d337cfcba0e42a45984f6b93ca6f760ad20 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 19 Dec 2013 18:28:54 -0800 Subject: [PATCH 478/794] Small text casing changes --- options/config.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/options/config.lua b/options/config.lua index 24db827d..8c111250 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1374,7 +1374,7 @@ local function loadGeneralOptions() text = { type = "group", order = 6, - name = L["Text management"], + name = L["Text Management"], hidden = false, args = { help = { @@ -4338,7 +4338,7 @@ local function loadUnitOptions() }, widgetSize = { order = 4, - name = L["Widget size"], + name = L["Widget Size"], type = "group", hidden = isModifiersSet, set = setUnit, @@ -5260,7 +5260,7 @@ local function loadFilterOptions() groups = { order = 1, type = "group", - name = L["Set filter zones"], + name = L["Set Filter Zones"], args = { help = { order = 0, @@ -5280,7 +5280,7 @@ local function loadFilterOptions() filters = { order = 2, type = "group", - name = L["Manage aura filters"], + name = L["Manage Aura Filters"], childGroups = "tree", args = { manage = { @@ -6092,7 +6092,7 @@ local function loadVisibilityOptions() options.args.visibility = { type = "group", childGroups = "tab", - name = L["Zone configuration"], + name = L["Zone Configuration"], desc = getPageDescription, args = { start = { From 19f27ade59a5c5c987332d64208212cf0641e5c7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 19 Dec 2013 18:35:41 -0800 Subject: [PATCH 479/794] Enabling enlarging stealable buffs will enable the scale slider --- options/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index 8c111250..7adcfee0 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2114,7 +2114,7 @@ local function loadUnitOptions() desc = L["Scale for auras that you casted or can Spellsteal, any number above 100% is bigger than default, any number below 100% is smaller than default."], min = 1, max = 3, step = 0.10, isPercent = true, - disabled = function(info) return not getVariable(info[2], "auras", info[#(info) - 1], "enlargeSelf") end, + disabled = function(info) return not getVariable(info[2], "auras", info[#(info) - 1], "enlargeSelf") and not getVariable(info[2], "auras", info[#(info) - 1], "enlargeStealable") end, hidden = hideAdvancedOption, arg = "auras.$parent.selfScale", }, From f27bf5471e35417348b267ccd7b754ba6eb99e9e Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 20 Dec 2013 14:45:10 -0800 Subject: [PATCH 480/794] Added a check for invalid order too --- modules/layout.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/layout.lua b/modules/layout.lua index b69d75b9..a265d56f 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -506,6 +506,8 @@ function Layout:PositionWidgets(frame, config) totalBars = totalBars + 1 table.insert(barOrder, key) + + config[key].order = config[key].order or 99 -- Decide whats full sized if( not frame.visibility.portrait or config.portrait.isBar or config[key].order < config.portrait.fullBefore or config[key].order > config.portrait.fullAfter ) then From b2e97b1a3be794a6ccd3bae83836281a22c4a658 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 25 Dec 2013 08:04:51 -0800 Subject: [PATCH 481/794] Don't mess with CRF strata anymore --- ShadowedUnitFrames.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 82322798..605ed92f 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -746,9 +746,6 @@ function ShadowUF:HideBlizzardFrames() hideRaid() CompactRaidFrameContainer:HookScript("OnShow", hideRaid) CompactRaidFrameManager:HookScript("OnShow", hideRaid) - - elseif( not self.db.profile.hidden.raid and not InCombatLockdown() ) then - CompactRaidFrameManager:SetFrameStrata("DIALOG") end end From ed1d9247c97737e6ec6c42d6ae7bd8f557555b61 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 31 Dec 2013 13:25:10 -0800 Subject: [PATCH 482/794] Don't fast register/unregister tags if no font strings are found --- modules/tags.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/tags.lua b/modules/tags.lua index 28676104..c912b34a 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -141,6 +141,8 @@ end -- This is for bars that can be shown or hidden often, like druid power function Tags:FastRegister(frame, parent) + if( not frame.fontStrings ) then return end + for _, fontString in pairs(frame.fontStrings) do -- Re-register anything that was already registered and is part of the parent if( regFontStrings[fontString] and fontString.parentBar == parent ) then @@ -151,6 +153,8 @@ function Tags:FastRegister(frame, parent) end function Tags:FastUnregister(frame, parent) + if( not frame.fontStrings ) then return end + for _, fontString in pairs(frame.fontStrings) do -- Redirect the updates to not do anything and hide it if( regFontStrings[fontString] and fontString.parentBar == parent ) then From f90d87fbab1711fd6fe867d8cd4b59e2530ac70b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 3 Feb 2014 22:18:38 -0800 Subject: [PATCH 483/794] Check not UnitIsEnemy to fix stealable buff borders when dueling --- modules/auras.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index 7f90a8c0..d59b847a 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -510,7 +510,8 @@ end local function scan(parent, frame, type, config, displayConfig, filter) if( frame.totalAuras >= frame.maxAuras or not config.enabled ) then return end - local isFriendly = UnitIsFriend(frame.parent.unit, "player") + -- UnitIsFriend returns true during a duel, which breaks stealable/curable detection + local isFriendly = not UnitIsEnemy(frame.parent.unit, "player") local curable = (isFriendly and type == "debuffs" and config.raid) local index = 0 while( true ) do From c4289ce9617ecfeeed38c3b02512d6fd8497e2b5 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 16 Feb 2014 12:01:42 -0800 Subject: [PATCH 484/794] Fixed MT ToT and MA ToTs default position being on top of the MT/MA Target frame --- modules/defaultlayout.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index bfbc0c47..f42ab499 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -214,10 +214,10 @@ function ShadowUF:LoadDefaultLayout(useMerge) raidpet = {anchorPoint = "C", anchorTo = "UIParent", x = 0, y = 0}, maintank = {anchorPoint = "C", anchorTo = "UIParent", x = 0, y = 0}, maintanktarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, - maintanktargettarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, + maintanktargettarget = {anchorPoint = "RT", anchorTo = "$parent", x = 150, y = 0}, mainassist = {anchorPoint = "C", anchorTo = "UIParent", x = 0, y = 0}, mainassisttarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, - mainassisttargettarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, + mainassisttargettarget = {anchorPoint = "RT", anchorTo = "$parent", x = 150, y = 0}, arena = {anchorPoint = "C", anchorTo = "UIParent", point = "", relativePoint = "", x = 0, y = 0}, arenapet = {anchorPoint = "RB", anchorTo = "$parent", x = 0, y = 0}, arenatarget = {anchorPoint = "RT", anchorTo = "$parent", x = 0, y = 0}, From 950e788b984e307638476711409ab712326db5aa Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 16 Feb 2014 12:07:58 -0800 Subject: [PATCH 485/794] Main Tank frames now populate off the MT assignment or by picking the Tank role --- ShadowedUnitFrames.lua | 1 + modules/units.lua | 3 ++- options/config.lua | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 605ed92f..489ac6ff 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -559,6 +559,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.raidpet.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} self.defaults.profile.units.raidpet.combatText.enabled = false -- MAINTANK + self.defaults.profile.units.maintank.roleFilter = "TANK" self.defaults.profile.units.maintank.groupFilter = "MAINTANK" self.defaults.profile.units.maintank.groupBy = "GROUP" self.defaults.profile.units.maintank.sortOrder = "ASC" diff --git a/modules/units.lua b/modules/units.lua index 4c33c3d7..70bf0aac 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -921,6 +921,7 @@ function Units:SetHeaderAttributes(frame, type) frame:SetAttribute("columnSpacing", config.columnSpacing) frame:SetAttribute("columnAnchorPoint", config.attribAnchorPoint) frame:SetAttribute("groupFilter", filter or "1,2,3,4,5,6,7,8") + frame:SetAttribute("roleFilter", config.roleFilter) if( config.groupBy == "CLASS" ) then frame:SetAttribute("groupingOrder", "DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,ROGUE,SHAMAN,WARLOCK,WARRIOR,MONK") @@ -932,7 +933,7 @@ function Units:SetHeaderAttributes(frame, type) frame:SetAttribute("groupingOrder", "1,2,3,4,5,6,7,8") frame:SetAttribute("groupBy", "GROUP") end - + -- Need to position the fake units elseif( type == "boss" or type == "arena" or type == "battleground" ) then frame:SetWidth(config.width) diff --git a/options/config.lua b/options/config.lua index 7adcfee0..e284af10 100755 --- a/options/config.lua +++ b/options/config.lua @@ -28,7 +28,7 @@ local unitCategories = { local UNIT_DESC = { ["boss"] = L["Boss units are for only certain fights, such as Blood Princes or the Gunship battle, you will not see them for every boss fight."], ["mainassist"] = L["Main Assists's are set by the Blizzard Main Assist system or mods that use them such as oRA3."], - ["maintank"] = L["Main Tank's are set by the Blizzard Main Tank system or mods that use them such as oRA3."], + ["maintank"] = L["Main Tank's are set through the Raid frames, or through selecting the Tank role."], ["battleground"] = L["Currently used in battlegrounds for showing flag carriers."], ["battlegroundpet"] = L["Current pet used by a battleground unit"], ["battlegroundtarget"] = L["Current target of a battleground unit"], From a5c1222bd4bd4838df6cca3a7813a424f0aac664 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 16 Feb 2014 13:29:00 -0800 Subject: [PATCH 486/794] Boss/Arena/BG header frames now dynamically resize total height/width to fix anchoring --- modules/movers.lua | 10 +++++++ modules/units.lua | 69 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 64 insertions(+), 15 deletions(-) diff --git a/modules/movers.lua b/modules/movers.lua index 1e8b56d3..b1816420 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -198,6 +198,8 @@ local function setupUnits(childrenOnly) -- Unit's not visible and it's enabled so it should elseif( not frame:IsVisible() and ShadowUF.db.profile.units[frame.unitType].enabled ) then UnregisterUnitWatch(frame) + + frame:SetAttribute("state-unitexists", true) frame:FullUpdate() frame:Show() end @@ -305,6 +307,14 @@ function Movers:Enable() setupUnits() setupUnits(true) + for unitType in pairs(ShadowUF.Units.zoneUnits) do + local header = ShadowUF.Units.headerFrames[unitType] + if( ShadowUF.db.profile.units[unitType].enabled and header ) then + header:SetAttribute("childChanged", 1) + end + end + + -- Don't show the dialog if the configuration is opened through the configmode spec if( not self.isConfigModeSpec ) then self:CreateInfoFrame() diff --git a/modules/units.lua b/modules/units.lua index 70bf0aac..04627192 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -922,7 +922,7 @@ function Units:SetHeaderAttributes(frame, type) frame:SetAttribute("columnAnchorPoint", config.attribAnchorPoint) frame:SetAttribute("groupFilter", filter or "1,2,3,4,5,6,7,8") frame:SetAttribute("roleFilter", config.roleFilter) - + if( config.groupBy == "CLASS" ) then frame:SetAttribute("groupingOrder", "DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,ROGUE,SHAMAN,WARLOCK,WARRIOR,MONK") frame:SetAttribute("groupBy", "CLASS") @@ -936,7 +936,10 @@ function Units:SetHeaderAttributes(frame, type) -- Need to position the fake units elseif( type == "boss" or type == "arena" or type == "battleground" ) then - frame:SetWidth(config.width) + frame:SetAttribute("attribPoint", config.attribPoint) + frame:SetAttribute("baseOffset", config.offset) + frame:SetAttribute("childChanged", 1) + self:PositionHeaderChildren(frame) -- Update party frames to not show anyone if they should be in raids @@ -1189,14 +1192,16 @@ function Units:LoadZoneHeader(type) return end - local headerFrame = CreateFrame("Frame", "SUFHeader" .. type, petBattleFrame) + local headerFrame = CreateFrame("Frame", "SUFHeader" .. type, petBattleFrame, "SecureHandlerBaseTemplate") headerFrame.isHeaderFrame = true headerFrame.unitType = type headerFrame.unitMappedType = remappedUnits[type] or type headerFrame:SetClampedToScreen(true) headerFrame:SetMovable(true) headerFrame:SetHeight(0.1) + headerFrame:SetAttribute("totalChildren", #(ShadowUF[type .. "Units"])) headerFrame.children = {} + headerFrames[type] = headerFrame if( type == "arena" ) then @@ -1206,23 +1211,22 @@ function Units:LoadZoneHeader(type) end end) end - + for id, unit in pairs(ShadowUF[type .. "Units"]) do local frame = self:CreateUnit("Button", "SUFHeader" .. type .. "UnitButton" .. id, headerFrame, "SecureUnitButtonTemplate") frame.ignoreAnchor = true + frame.hasStateWatch = true frame.unitUnmapped = type .. id frame:SetAttribute("unit", unit) + frame:SetAttribute("unitID", id) frame:Hide() headerFrame.children[id] = frame - + headerFrame:SetFrameRef("child" .. id, frame) + -- Arena frames are only allowed to be shown not hidden from the unit existing, or else when a Rogue -- stealths the frame will hide which looks bad. Instead force it to stay open and it has to be manually hidden when the player leaves an arena. if( type == "arena" ) then - frame:SetAttribute("unitID", id) - -- frame:SetFrameRef("prepframe", _G["ArenaPrepFrame" .. id]) - frame.hasStateWatch = true - stateMonitor:WrapScript(frame, "OnAttributeChanged", [[ if( name == "state-unitexists" ) then local parent = self:GetParent() @@ -1234,21 +1238,56 @@ function Units:LoadZoneHeader(type) end if( value ) then - -- self:GetFrameRef("prepframe"):Hide() self:Show() end end ]]) - - RegisterUnitWatch(frame, frame.hasStateWatch) else - RegisterUnitWatch(frame) + stateMonitor:WrapScript(frame, "OnAttributeChanged", [[ + if( name == "state-unitexists" ) then + local parent = self:GetParent() + parent:SetAttribute("childChanged", self:GetAttribute("unitID")) + + if( value ) then + self:Show() + else + self:Hide() + end + end + ]]) end + + RegisterUnitWatch(frame, frame.hasStateWatch) end - + + -- Dynamic height/width adjustment + stateMonitor:WrapScript(headerFrame, "OnAttributeChanged", [[ + if( name ~= "childchanged" ) then return end + + local visible = 0 + for i=1, self:GetAttribute("totalChildren") do + if( self:GetFrameRef("child" .. i):IsShown() ) then + visible = visible + 1 + end + end + + if( visible == 0 ) then + self:Hide() + return + end + + local child = self:GetFrameRef("child1") + local xMod = math.abs(self:GetAttribute("xMod")) + local yMod = math.abs(self:GetAttribute("yMod")) + local offset = self:GetAttribute("baseOffset") + + self:SetWidth(xMod * ((child:GetWidth() * (visible - 1)) + (offset * (visible - 1))) + child:GetWidth()) + self:SetHeight(yMod * ((child:GetHeight() * (visible - 1)) + (offset * (visible - 1))) + child:GetHeight()) + self:Show() + ]]) + self:SetHeaderAttributes(headerFrame, type) - ShadowUF.Layout:AnchorFrame(UIParent, headerFrame, ShadowUF.db.profile.positions[type]) end From 40d070308c19bb40da85a1d0047f6abe677205b7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Feb 2014 08:03:24 -0800 Subject: [PATCH 487/794] fixed battleground/arena/boss units not showing up if only one is shown --- ShadowedUnitFrames.lua | 2 +- modules/units.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 489ac6ff..1fcde788 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -22,7 +22,7 @@ ShadowUF.maintankUnits, ShadowUF.mainassistUnits, ShadowUF.raidpetUnits = Shadow for i=1, MAX_PARTY_MEMBERS do ShadowUF.partyUnits[i] = "party" .. i end for i=1, MAX_RAID_MEMBERS do ShadowUF.raidUnits[i] = "raid" .. i end for i=1, MAX_RAID_MEMBERS do ShadowUF.raidPetUnits[i] = "raidpet" .. i end -for i=1, MAX_BOSS_FRAMES do ShadowUF.bossUnits[i] = "boss" .. i end +for i=1, 1 do ShadowUF.bossUnits[i] = "boss" .. i end for i=1, 5 do ShadowUF.arenaUnits[i] = "arena" .. i end for i=1, 4 do ShadowUF.battlegroundUnits[i] = "arena" .. i end diff --git a/modules/units.lua b/modules/units.lua index 04627192..6ffea052 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1245,14 +1245,14 @@ function Units:LoadZoneHeader(type) else stateMonitor:WrapScript(frame, "OnAttributeChanged", [[ if( name == "state-unitexists" ) then - local parent = self:GetParent() - parent:SetAttribute("childChanged", self:GetAttribute("unitID")) - if( value ) then self:Show() else self:Hide() end + + local parent = self:GetParent() + parent:SetAttribute("childChanged", self:GetAttribute("unitID")) end ]]) end From 0ac6cabd8f288614f7b1c4ac97c95cc547c8a200 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Feb 2014 08:05:04 -0800 Subject: [PATCH 488/794] fixed an edge case where boss/arena/bg units could show Unknown instead of a name --- modules/units.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/units.lua b/modules/units.lua index 6ffea052..8b07a43e 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -626,6 +626,11 @@ OnAttributeChanged = function(self, name, unit) -- Update boss elseif( self.unitType == "boss" ) then self:RegisterNormalEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", Units, "CheckUnitStatus") + self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") + + -- Update arena/battleground + elseif( self.unitType == "arena" or self.unitType == "battleground" ) then + self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") -- Check for a unit guid to do a full update elseif( self.unitRealType == "raid" ) then From 057c5a35b7577990b182f7759ab3cf47ab8d49e4 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Feb 2014 08:14:57 -0800 Subject: [PATCH 489/794] fixed an old hack for loading boss units in party, now properly loads bosstarget/bosstargettarget in parties --- ShadowedUnitFrames.lua | 18 +++++++++++++----- modules/units.lua | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 1fcde788..8bb766e4 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -361,6 +361,18 @@ function ShadowUF:CheckUpgrade() end end +local function zoneEnabled(zone, zoneList) + if( type(zoneList) == "string" ) then + return zone == zoneList + end + + for id, row in pairs(zoneList) do + if( zone == row ) then return true end + end + + return false +end + function ShadowUF:LoadUnits() -- CanHearthAndResurrectFromArea() returns true for world pvp areas, according to BattlefieldFrame.lua local instanceType = CanHearthAndResurrectFromArea() and "pvp" or select(2, IsInInstance()) @@ -371,11 +383,7 @@ function ShadowUF:LoadUnits() for _, type in pairs(self.unitList) do local enabled = self.db.profile.units[type].enabled if( ShadowUF.Units.zoneUnits[type] and enabled ) then - if( type == "boss" ) then - enabled = (instanceType == "raid" or instanceType == "party") - else - enabled = ShadowUF.Units.zoneUnits[type] == instanceType - end + enabled = zoneEnabled(instanceType, ShadowUF.Units.zoneUnits[type]) elseif( instanceType ~= "none" ) then if( self.db.profile.visibility[instanceType][type] == false ) then enabled = false diff --git a/modules/units.lua b/modules/units.lua index 8b07a43e..142df7e5 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1,6 +1,6 @@ local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}, remappedUnits = {}, canCure = {}} Units.childUnits = {["partytarget"] = "party", ["partytargettarget"] = "party", ["partypet"] = "party", ["maintanktarget"] = "maintank", ["mainassisttarget"] = "mainassist", ["bosstarget"] = "boss", ["arenatarget"] = "arena", ["arenatargettarget"] = "arena", ["arenapet"] = "arena", ["battlegroundpet"] = "battleground", ["battlegroundtarget"] = "battleground", ["battlegroundtargettarget"] = "battleground", ["maintanktargettarget"] = "maintank", ["mainassisttargettarget"] = "mainassist", ["bosstargettarget"] = "boss"} -Units.zoneUnits = {["arena"] = "arena", ["arenapet"] = "arena", ["arenatarget"] = "arena", ["arenatargettarget"] = true, ["boss"] = "raid", ["bosstarget"] = "raid", ["battleground"] = "pvp", ["battlegroundtarget"] = "pvp", ["battlegroundtargettarget"] = true, ["battlegroundpet"] = "pvp", ["bosstargettarget"] = "raid"} +Units.zoneUnits = {["arena"] = "arena", ["arenapet"] = "arena", ["arenatarget"] = "arena", ["arenatargettarget"] = true, ["boss"] = {"party", "raid"}, ["bosstarget"] = {"party", "raid"}, ["battleground"] = "pvp", ["battlegroundtarget"] = "pvp", ["battlegroundtargettarget"] = true, ["battlegroundpet"] = "pvp", ["bosstargettarget"] = {"party", "raid"}} Units.remappedUnits = {["battleground"] = "arena", ["battlegroundpet"] = "arenapet", ["battlegroundtarget"] = "arenatarget", ["battlegroundtargettarget"] = "arenatargettarget"} Units.headerUnits = {["raid"] = true, ["party"] = true, ["maintank"] = true, ["mainassist"] = true, ["raidpet"] = true, ["partypet"] = true} From 2f38288482c3247ad048e74e9216c67a1f3c5500 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Feb 2014 15:40:12 -0800 Subject: [PATCH 490/794] always force a child update no matter state --- modules/units.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 142df7e5..56a3822a 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1257,7 +1257,7 @@ function Units:LoadZoneHeader(type) end local parent = self:GetParent() - parent:SetAttribute("childChanged", self:GetAttribute("unitID")) + parent:SetAttribute("childstate", self:GetAttribute("unitID") .. (value and 20 or 10)) end ]]) end @@ -1267,7 +1267,7 @@ function Units:LoadZoneHeader(type) -- Dynamic height/width adjustment stateMonitor:WrapScript(headerFrame, "OnAttributeChanged", [[ - if( name ~= "childchanged" ) then return end + if( name ~= "childchanged" and name ~= "childstate" ) then return end local visible = 0 for i=1, self:GetAttribute("totalChildren") do From 20871c5843e5fc371baa19745fd67bc5e1de005c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Feb 2014 18:10:33 -0800 Subject: [PATCH 491/794] removed debug code for boss frames --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 8bb766e4..25848c9e 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -22,7 +22,7 @@ ShadowUF.maintankUnits, ShadowUF.mainassistUnits, ShadowUF.raidpetUnits = Shadow for i=1, MAX_PARTY_MEMBERS do ShadowUF.partyUnits[i] = "party" .. i end for i=1, MAX_RAID_MEMBERS do ShadowUF.raidUnits[i] = "raid" .. i end for i=1, MAX_RAID_MEMBERS do ShadowUF.raidPetUnits[i] = "raidpet" .. i end -for i=1, 1 do ShadowUF.bossUnits[i] = "boss" .. i end +for i=1, MAX_BOSS_FRAMES do ShadowUF.bossUnits[i] = "boss" .. i end for i=1, 5 do ShadowUF.arenaUnits[i] = "arena" .. i end for i=1, 4 do ShadowUF.battlegroundUnits[i] = "arena" .. i end From 7e3a8e11dcbe5481d325e221cdf26e2af75e7909 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 22 Feb 2014 18:12:33 -0800 Subject: [PATCH 492/794] Switch back to childChanged for zone updates --- modules/units.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 56a3822a..142df7e5 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1257,7 +1257,7 @@ function Units:LoadZoneHeader(type) end local parent = self:GetParent() - parent:SetAttribute("childstate", self:GetAttribute("unitID") .. (value and 20 or 10)) + parent:SetAttribute("childChanged", self:GetAttribute("unitID")) end ]]) end @@ -1267,7 +1267,7 @@ function Units:LoadZoneHeader(type) -- Dynamic height/width adjustment stateMonitor:WrapScript(headerFrame, "OnAttributeChanged", [[ - if( name ~= "childchanged" and name ~= "childstate" ) then return end + if( name ~= "childchanged" ) then return end local visible = 0 for i=1, self:GetAttribute("totalChildren") do From 1f017d173e1599ca0f18158928d8df53775e8ad2 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 30 Mar 2014 22:08:56 -0700 Subject: [PATCH 493/794] Drop unneeded code --- modules/units.lua | 84 ----------------------------------------------- 1 file changed, 84 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 142df7e5..b3861f4d 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -28,91 +28,11 @@ petBattleFrame:WrapScript(petBattleFrame, "OnAttributeChanged", [[ RegisterStateDriver(petBattleFrame, "petbattle", "[petbattle] active; none") ---[[ -local perf = {} -local function logPerformance(module, func, started, unit, event) - local taken = debugprofilestop() - started - local prefix = (event and "event" or "update") .. ":" .. (module.moduleKey or "UNKNOWN") - - -- Log per module/function - local id = prefix .. ":" .. func .. ":global" - if( not perf[id] ) then perf[id] = {calls = 0, time = 0} end - perf[id].calls = perf[id].calls + 1 - perf[id].time = perf[id].time + taken - - -- Log per module/function/unit - if( unit ) then - id = prefix .. ":" .. func .. ":" .. unit - - if( not perf[id] ) then perf[id] = {calls = 0, time = 0} end - perf[id].calls = perf[id].calls + 1 - perf[id].time = perf[id].time + taken - end - - -- Log per module - if( not perf[prefix] ) then perf[prefix] = {calls = 0, time = 0} end - perf[prefix].calls = perf[prefix].calls + 1 - perf[prefix].time = perf[prefix].time + taken - - -- Log per module/unit - if( unit ) then - id = prefix .. ":" .. unit - - if( not perf[id] ) then perf[id] = {calls = 0, time = 0} end - perf[id].calls = perf[id].calls + 1 - perf[id].time = perf[id].time + taken - end -end - -function ShadowUF:DumpPerf() - local temp = {} - for id, stats in pairs(perf) do - stats.id = id - table.insert(temp, stats) - end - - table.sort(temp, function(a, b) return a.id < b.id end) - - local metrics = {} - for _, stats in pairs(temp) do - local type, module, func, unit = string.split(":", stats.id) - - local data = {} - data.id = nil - data.type = type - data.module = module - if( func ) then data.func = func end - if( unit ) then data.unit = unit end - - data.total_time = tonumber(string.format("%.4f", stats.time)) - data.calls = stats.calls - data.avg_time = tonumber((stats.calls > 0 and stats.time > 0) and string.format("%.4f", stats.time / stats.calls) or 0) - - if( data.calls > 0 and data.total_time > 0 ) then - table.insert(metrics, data) - end - end - - table.sort(metrics, function(a, b) - return a.avg_time > b.avg_time - end) - - LoadAddOn("Spew") - Spew("", metrics) - - ShadowUF.db.global.metrics = metrics -end -]] - -- Frame shown, do a full update local function FullUpdate(self) for i=1, #(self.fullUpdates), 2 do - --local start = debugprofilestop() - local handler = self.fullUpdates[i] handler[self.fullUpdates[i + 1]](handler, self) - - --logPerformance(handler, self.fullUpdates[i + 1], start, self.unitType, false) end end @@ -281,11 +201,7 @@ end local function OnEvent(self, event, unit, ...) if( not unitEvents[event] or self.unit == unit ) then for handler, func in pairs(self.registeredEvents[event]) do - --local start = debugprofilestop() - handler[func](handler, self, event, unit, ...) - - --logPerformance(handler, func, start, self.unitType, true) end end end From 218fb49c9c4e0b75934ae65daaa45af5ad370846 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 5 Apr 2014 22:29:09 -0700 Subject: [PATCH 494/794] updated list of ok globals --- globalcheck.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/globalcheck.rb b/globalcheck.rb index b5c08bb4..9971e8c4 100755 --- a/globalcheck.rb +++ b/globalcheck.rb @@ -21,7 +21,7 @@ end # Anything that we don't use enough or WoW doesn't use enough for it to be trained -$blacklisted = ["ShadowUF", "rawset", "rawget", "setfenv", "getfenv", "math", "GetLocale", "UnitReaction", "LibStub", "loadstring", "print", "IsResting", "UnitAura", "UnitIsFriend", "GetComboPoints", "GetEclipseDirection", "UnitIsTapped", "UnitPlayerControlled", "UnitCreatureFamily", "UnitThreatSituation", "UnitClassification", "UnitInPhase", "IsEveryoneAssistant", "UnitStagger", "RegisterUnitWatch", "UnregisterUnitWatch", "UnitIsVisible", "UnitInRange", "CheckInteractDistance", "GetRuneCooldown", "GetRuneType", "GetTotemInfo", "RegisterStateDriver", "ClickCastHeader", "ClickCastFrames", "IsPlayerSpell", "UnitXP", "GetPetExperience", "GetBuildInfo", "CompactPartyFrame", "hooksecurefunc", "TemporaryEnchantFrame", "PriestBarFrame", "PaladinPowerBar", "EclipseBarFrame", "ShardBarFrame", "RuneFrame", "MonkHarmonyBar", "ComboFrame", "QueueStatusFrame", "LoadAddOn"] +$blacklisted = ["ShadowUF", "rawset", "rawget", "setfenv", "getfenv", "math", "GetLocale", "UnitReaction", "LibStub", "loadstring", "print", "IsResting", "UnitAura", "UnitIsFriend", "GetComboPoints", "GetEclipseDirection", "UnitIsTapped", "UnitPlayerControlled", "UnitCreatureFamily", "UnitThreatSituation", "UnitClassification", "UnitInPhase", "IsEveryoneAssistant", "UnitStagger", "RegisterUnitWatch", "UnregisterUnitWatch", "UnitIsVisible", "UnitInRange", "CheckInteractDistance", "GetRuneCooldown", "GetRuneType", "GetTotemInfo", "RegisterStateDriver", "ClickCastHeader", "ClickCastFrames", "IsPlayerSpell", "UnitXP", "GetPetExperience", "GetBuildInfo", "CompactPartyFrame", "hooksecurefunc", "TemporaryEnchantFrame", "PriestBarFrame", "PaladinPowerBar", "EclipseBarFrame", "ShardBarFrame", "RuneFrame", "MonkHarmonyBar", "ComboFrame", "QueueStatusFrame", "LoadAddOn", "UnitIsEnemy"] # Filter check def filtered?(target) @@ -74,4 +74,4 @@ def filtered?(target) puts "No leaked globals found!" end -File.unlink("./luac.out") rescue nil \ No newline at end of file +File.unlink("./luac.out") rescue nil From eb0e4309df90cf82dd88e56fc78578f6df4918a7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 5 Apr 2014 22:29:33 -0700 Subject: [PATCH 495/794] experiment switching to animation timers for performance --- ShadowedUnitFrames.lua | 1 - modules/range.lua | 12 +++---- modules/tags.lua | 77 +++++++++++++++++++++++------------------- modules/units.lua | 43 +++++++++++++---------- 4 files changed, 73 insertions(+), 60 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 25848c9e..c8b19a12 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -895,7 +895,6 @@ function ShadowUF:ShowInfoPanel() end) end - function ShadowUF:Print(msg) DEFAULT_CHAT_FRAME:AddMessage("|cff33ff99Shadow UF|r: " .. msg) end diff --git a/modules/range.lua b/modules/range.lua index 40643dc9..b8cfc4bc 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -9,10 +9,6 @@ local friendlySpell = Range.friendly[playerClass] local hostileSpell = Range.hostile[playerClass] local function checkRange(self, elapsed) - self.timeElapsed = self.timeElapsed + elapsed - if( self.timeElapsed <= 0.50 ) then return end - self.timeElapsed = 0 - local frame = self.parent local spell @@ -40,16 +36,16 @@ function Range:ForceUpdate(frame) frame.range:Hide() else frame.range:Show() - checkRange(frame.range, 1) + checkRange(frame.range.timer) end end function Range:OnEnable(frame) if( not frame.range ) then frame.range = CreateFrame("Frame", nil, frame) - frame.range:SetScript("OnUpdate", checkRange) - frame.range.timeElapsed = 0 - frame.range.parent = frame + + frame.range.timer = frame:CreateOnUpdate(0.50, checkRange) + frame.range.timer.parent = frame end frame.range:Show() diff --git a/modules/tags.lua b/modules/tags.lua index c912b34a..f451656b 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -103,40 +103,46 @@ function Tags:Reload() end -- Frequent updates -local freqFrame = CreateFrame("Frame") -freqFrame.timeToUpdate = 0 -freqFrame:SetScript("OnUpdate", function(self, elapsed) - freqFrame.timeToUpdate = freqFrame.timeToUpdate - elapsed - if( freqFrame.timeToUpdate > 0 ) then return end - freqFrame.timeToUpdate = freqFrame.timeToUpdate + freqFrame.minInterval - - for fontString, timeLeft in pairs(frequentUpdates) do - if( fontString.parent:IsVisible() ) then - frequentUpdates[fontString] = timeLeft - freqFrame.minInterval - if( frequentUpdates[fontString] <= 0 ) then - fontString:UpdateTags() - end - end +local freqGroups = {} +local freqTriggers = {} + +local groupFrame = CreateFrame("Frame") +local function setupGroupInterval(interval) + if( freqGroups[interval] ) then + freqGroups[interval]:Play() + return end -end) -freqFrame:Hide() + + local group = groupFrame:CreateAnimationGroup() + group:SetLooping("REPEAT") + group:SetScript("OnLoop", function(self) + for _, fontString in pairs(freqTriggers[interval]) do + fontString:UpdateTags() + end + end) + + local animation = group:CreateAnimation("Animation") + animation:SetOrder(1) + animation:SetDuration(interval) + + freqGroups[interval] = group +end local function updateMinimumFrequency() - local min - for fontString, pollTime in pairs(frequentUpdates) do - if( not min or min > pollTime ) then - min = pollTime + for interval, _ in pairs(freqTriggers) do + table.wipe(freqTriggers[interval]) + + if( freqGroups[interval] ) then + freqGroups[interval]:Stop() end end - if( not min ) then - freqFrame:Hide() - return - end + for fontString, interval in pairs(frequentUpdates) do + if( not freqTriggers[interval] ) then freqTriggers[interval] = {} end + table.insert(freqTriggers[interval], fontString) - freqFrame.timeToUpdate = min - freqFrame.minInterval = min - freqFrame:Show() + setupGroupInterval(interval) + end end -- This is for bars that can be shown or hidden often, like druid power @@ -145,7 +151,7 @@ function Tags:FastRegister(frame, parent) for _, fontString in pairs(frame.fontStrings) do -- Re-register anything that was already registered and is part of the parent - if( regFontStrings[fontString] and fontString.parentBar == parent ) then + if( regFontStrings[fontString] and ( not parent or fontString.parentBar == parent ) ) then fontString.UpdateTags = tagPool[regFontStrings[fontString]] fontString:Show() end @@ -157,7 +163,7 @@ function Tags:FastUnregister(frame, parent) for _, fontString in pairs(frame.fontStrings) do -- Redirect the updates to not do anything and hide it - if( regFontStrings[fontString] and fontString.parentBar == parent ) then + if( regFontStrings[fontString] and ( not parent or fontString.parentBar == parent ) ) then fontString.UpdateTags = ShadowUF.noop fontString:Hide() end @@ -177,12 +183,13 @@ function Tags:Register(parent, fontString, tags, resetCache) -- Use the cached polling time if we already saved it -- as we won't be rececking everything next call + local freqUpdateRequired local pollTime = frequencyCache[tags] if( pollTime ) then frequentUpdates[fontString] = pollTime fontString.frequentStart = pollTime - updateMinimumFrequency() + freqUpdateRequired = true end local updateFunc = not resetCache and tagPool[tags] @@ -205,6 +212,7 @@ function Tags:Register(parent, fontString, tags, resetCache) if( not tagKey ) then hasPre, hasAp = false, true tagKey = string.match(tag, "([%w%p]+)(%b())") end frequencyCache[tag] = tagKey and (self.defaultFrequents[tagKey] or ShadowUF.db.profile.tags[tagKey] and ShadowUF.db.profile.tags[tagKey].frequency) + local tagFunc = tagKey and ShadowUF.tagFunc[tagKey] if( tagFunc ) then local startOff, endOff = string.find(tag, tagKey) @@ -242,7 +250,7 @@ function Tags:Register(parent, fontString, tags, resetCache) frequencyCache[tags] = pollTime frequentUpdates[fontString] = pollTime fontString.frequentStart = pollTime - updateMinimumFrequency() + freqUpdateRequired = true end -- It's an invalid tag, simply return the tag itself wrapped in brackets @@ -265,9 +273,6 @@ function Tags:Register(parent, fontString, tags, resetCache) end end - if( frequentUpdates[fontString] ) then - frequentUpdates[fontString] = fontString.frequentStart + 0.01 - end for id, func in pairs(args) do temp[id] = func(fontString.parent.unit, fontString.parent.unitOwner, fontString) or "" @@ -284,6 +289,10 @@ function Tags:Register(parent, fontString, tags, resetCache) -- Register any needed event self:RegisterEvents(parent, fontString, tags) + + if( freqUpdateRequired ) then + updateMinimumFrequency() + end end function Tags:Unregister(fontString) diff --git a/modules/units.lua b/modules/units.lua index b3861f4d..2125038b 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -210,14 +210,17 @@ Units.OnEvent = OnEvent -- Do a full update OnShow, and stop watching for events when it's not visible local function OnShow(self) + ShadowUF.Tags:FastRegister(self) + -- Reset the event handler self:SetScript("OnEvent", OnEvent) Units:CheckUnitStatus(self) end local function OnHide(self) + ShadowUF.Tags:FastUnregister(self) self:SetScript("OnEvent", nil) - + -- If it's a volatile such as target or focus, next time it's shown it has to do an update -- OR if the unit is still shown, but it's been hidden because our parent (Basically UIParent) -- we want to flag it as having changed so it can be updated @@ -226,20 +229,6 @@ local function OnHide(self) end end --- *target units do not give events, polling is necessary here -local function TargetUnitUpdate(self, elapsed) - self.timeElapsed = self.timeElapsed + elapsed - - if( self.timeElapsed >= 0.50 ) then - self.timeElapsed = self.timeElapsed - 0.50 - - -- Have to make sure the unit exists or else the frame will flash offline for a second until it hides - if( UnitExists(self.unit) ) then - self:FullUpdate() - end - end -end - -- Deal with enabling modules inside a zone local function SetVisibility(self) local layoutUpdate @@ -563,8 +552,13 @@ OnAttributeChanged = function(self, name, unit) -- *target units are not real units, thus they do not receive events and must be polled for data elseif( ShadowUF.fakeUnits[self.unitRealType] ) then - self.timeElapsed = 0 - self:SetScript("OnUpdate", TargetUnitUpdate) + if( not self.updateTimer ) then + self.updateTimer = self:CreateOnUpdate(0.50, function() + if( UnitExists(self.unit) ) then + self:FullUpdate() + end + end) + end -- Speeds up updating units when their owner changes target, if party1 changes target then party1target is force updated, if target changes target -- then targettarget and targettargettarget are also force updated @@ -633,6 +627,20 @@ local function initializeUnit(header, frameName) Units:CreateUnit(frame) end +-- Update helper +local function CreateOnUpdate(self, timer, callback) + local group = self:CreateAnimationGroup() + group:SetLooping("REPEAT") + group:SetScript("OnLoop", callback) + + local animation = group:CreateAnimation("Animation") + animation:SetOrder(1) + animation:SetDuration(0.50) + + group:Play() + return group +end + -- Show tooltip local function OnEnter(self) if( self.OnEnter ) then @@ -668,6 +676,7 @@ function Units:CreateUnit(...) frame.DisableRangeAlpha = DisableRangeAlpha frame.UnregisterUpdateFunc = UnregisterUpdateFunc frame.ReregisterUnitEvents = ReregisterUnitEvents + frame.CreateOnUpdate = CreateOnUpdate frame.SetBarColor = SetBarColor frame.SetBlockColor = SetBlockColor frame.FullUpdate = FullUpdate From 584ddfaa29d918ad52e2fe8f6df36b3b68ce7b6a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 11 Apr 2014 22:32:49 -0700 Subject: [PATCH 496/794] Further optimizations to tag and fake-unit cast bar timers --- modules/cast.lua | 31 +++--- modules/tags.lua | 243 ++++++++++++++++++---------------------------- modules/units.lua | 17 ++-- 3 files changed, 117 insertions(+), 174 deletions(-) diff --git a/modules/cast.lua b/modules/cast.lua index ad9cc4bf..5d631c8d 100755 --- a/modules/cast.lua +++ b/modules/cast.lua @@ -1,16 +1,11 @@ local Cast = {} local L = ShadowUF.L local FADE_TIME = 0.30 -local FAKE_UPDATE_TIME = 0.10 ShadowUF:RegisterModule(Cast, "castBar", L["Cast bar"], true) -- I'm not really thrilled with this method of detecting fake unit casts, mostly because it's inefficient and ugly -local function monitorFakeCast(self, elapsed) - self.timeElapsed = self.timeElapsed + elapsed - if( self.timeElapsed <= FAKE_UPDATE_TIME ) then return end - self.timeElapsed = self.timeElapsed - FAKE_UPDATE_TIME - +local function monitorFakeCast(self) local spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(self.parent.unit) local isChannelled if( not spell ) then @@ -53,14 +48,6 @@ local function monitorFakeCast(self, elapsed) end end -local function updateFakeUnitCast(self) - self.endTime = nil - self.notInterruptible = nil - self.spellName = nil - - monitorFakeCast(self, FAKE_UPDATE_TIME) -end - function Cast:OnEnable(frame) if( not frame.castBar ) then frame.castBar = CreateFrame("Frame", nil, frame) @@ -75,12 +62,9 @@ function Cast:OnEnable(frame) end if( ShadowUF.fakeUnits[frame.unitType] ) then - frame.castBar.monitor = frame.castBar.monitor or CreateFrame("Frame", nil, frame) - frame.castBar.monitor.timeElapsed = 0 + frame.castBar.monitor = frame:CreateOnUpdate(0.10, monitorFakeCast) frame.castBar.monitor.parent = frame - frame.castBar.monitor:SetScript("OnUpdate", monitorFakeCast) - frame.castBar.monitor:SetScript("OnShow", updateFakeUnitCast) - frame.castBar.monitor:Show() + frame:RegisterUpdateFunc(self, "UpdateFakeCast") return end @@ -463,3 +447,12 @@ function Cast:UpdateCast(frame, unit, channelled, spell, rank, displayName, icon setBarColor(cast, ShadowUF.db.profile.castColors.cast.r, ShadowUF.db.profile.castColors.cast.g, ShadowUF.db.profile.castColors.cast.b) end end + +-- Trigger checks on fake cast +function Cast:UpdateFakeCast(self) + local monitor = self.castBar.monitor + monitor.endTime = nil + monitor.notInterruptible = nil + monitor.spellName = nil + monitorFakeCast(monitor) +end diff --git a/modules/tags.lua b/modules/tags.lua index f451656b..190df6e3 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1,6 +1,6 @@ -- Thanks to haste for the original tagging code, which I then mostly ripped apart and stole! local Tags = {afkStatus = {}, offlineStatus = {}, customEvents = {}, powerMap = {}, moduleKey = "tags"} -local tagPool, functionPool, temp, regFontStrings, frequentUpdates, frequencyCache, powerMap = {}, {}, {}, {}, {}, {}, Tags.powerMap +local tagPool, functionPool, temp, regFontStrings, powerMap = {}, {}, {}, {}, Tags.powerMap local L = ShadowUF.L ShadowUF.Tags = Tags @@ -102,49 +102,6 @@ function Tags:Reload() end end --- Frequent updates -local freqGroups = {} -local freqTriggers = {} - -local groupFrame = CreateFrame("Frame") -local function setupGroupInterval(interval) - if( freqGroups[interval] ) then - freqGroups[interval]:Play() - return - end - - local group = groupFrame:CreateAnimationGroup() - group:SetLooping("REPEAT") - group:SetScript("OnLoop", function(self) - for _, fontString in pairs(freqTriggers[interval]) do - fontString:UpdateTags() - end - end) - - local animation = group:CreateAnimation("Animation") - animation:SetOrder(1) - animation:SetDuration(interval) - - freqGroups[interval] = group -end - -local function updateMinimumFrequency() - for interval, _ in pairs(freqTriggers) do - table.wipe(freqTriggers[interval]) - - if( freqGroups[interval] ) then - freqGroups[interval]:Stop() - end - end - - for fontString, interval in pairs(frequentUpdates) do - if( not freqTriggers[interval] ) then freqTriggers[interval] = {} end - table.insert(freqTriggers[interval], fontString) - - setupGroupInterval(interval) - end -end - -- This is for bars that can be shown or hidden often, like druid power function Tags:FastRegister(frame, parent) if( not frame.fontStrings ) then return end @@ -172,133 +129,121 @@ end -- Register a font string with the tag system -function Tags:Register(parent, fontString, tags, resetCache) - -- Unregister the font string first if we did register it already - if( fontString.UpdateTags ) then - self:Unregister(fontString) - end - - fontString.parent = parent - regFontStrings[fontString] = tags - - -- Use the cached polling time if we already saved it - -- as we won't be rececking everything next call - local freqUpdateRequired - local pollTime = frequencyCache[tags] - if( pollTime ) then - frequentUpdates[fontString] = pollTime - fontString.frequentStart = pollTime - - freqUpdateRequired = true +local powerEvents = {["UNIT_POWER"] = true, ["UNIT_POWER_FREQUENT"] = true, ["UNIT_MAXPOWER"] = true} +local frequencyCache = {} +local function createTagFunction(tags, resetCache) + if( tagPool[tags] and not resetCache ) then + return tagPool[tags], frequencyCache[tags] end - - local updateFunc = not resetCache and tagPool[tags] - if( not updateFunc ) then - -- Using .- prevents supporting tags such as [foo ([)]. Supporting that and having a single pattern - local formattedText = string.gsub(string.gsub(tags, "%%", "%%%%"), "[[].-[]]", "%%s") - formattedText = string.gsub(formattedText, "|", "||") - formattedText = string.gsub(formattedText, "||c", "|c") - formattedText = string.gsub(formattedText, "||r", "|r") - local args = {} - - for tag in string.gmatch(tags, "%[(.-)%]") do - -- Tags that use pre or appends "foo(|)" etc need special matching, which is what this will handle - local cachedFunc = not resetCache and functionPool[tag] or ShadowUF.tagFunc[tag] - if( not cachedFunc ) then - local hasPre, hasAp = true, true - local tagKey = select(2, string.match(tag, "(%b())([%w%p]+)(%b())")) - if( not tagKey ) then hasPre, hasAp = true, false tagKey = select(2, string.match(tag, "(%b())([%w%p]+)")) end - if( not tagKey ) then hasPre, hasAp = false, true tagKey = string.match(tag, "([%w%p]+)(%b())") end - - frequencyCache[tag] = tagKey and (self.defaultFrequents[tagKey] or ShadowUF.db.profile.tags[tagKey] and ShadowUF.db.profile.tags[tagKey].frequency) + -- Using .- prevents supporting tags such as [foo ([)]. Supporting that and having a single pattern + local formattedText = string.gsub(string.gsub(tags, "%%", "%%%%"), "[[].-[]]", "%%s") + formattedText = string.gsub(formattedText, "|", "||") + formattedText = string.gsub(formattedText, "||c", "|c") + formattedText = string.gsub(formattedText, "||r", "|r") - local tagFunc = tagKey and ShadowUF.tagFunc[tagKey] - if( tagFunc ) then - local startOff, endOff = string.find(tag, tagKey) - local pre = hasPre and string.sub(tag, 2, startOff - 2) - local ap = hasAp and string.sub(tag, endOff + 2, -2) - - if( pre and ap ) then - cachedFunc = function(...) - local str = tagFunc(...) - if( str ) then return pre .. str .. ap end - end - elseif( pre ) then - cachedFunc = function(...) - local str = tagFunc(...) - if( str ) then return pre .. str end - end - elseif( ap ) then - cachedFunc = function(...) - local str = tagFunc(...) - if( str ) then return str .. ap end - end + local args = {} + local lowestFrequency = 9999 + + for tag in string.gmatch(tags, "%[(.-)%]") do + -- Tags that use pre or appends "foo(|)" etc need special matching, which is what this will handle + local cachedFunc = not resetCache and functionPool[tag] or ShadowUF.tagFunc[tag] + if( not cachedFunc ) then + local hasPre, hasAp = true, true + local tagKey = select(2, string.match(tag, "(%b())([%w%p]+)(%b())")) + if( not tagKey ) then hasPre, hasAp = true, false tagKey = select(2, string.match(tag, "(%b())([%w%p]+)")) end + if( not tagKey ) then hasPre, hasAp = false, true tagKey = string.match(tag, "([%w%p]+)(%b())") end + + frequencyCache[tag] = tagKey and (Tags.defaultFrequents[tagKey] or ShadowUF.db.profile.tags[tagKey] and ShadowUF.db.profile.tags[tagKey].frequency) + + local tagFunc = tagKey and ShadowUF.tagFunc[tagKey] + if( tagFunc ) then + local startOff, endOff = string.find(tag, tagKey) + local pre = hasPre and string.sub(tag, 2, startOff - 2) + local ap = hasAp and string.sub(tag, endOff + 2, -2) + + if( pre and ap ) then + cachedFunc = function(...) + local str = tagFunc(...) + if( str ) then return pre .. str .. ap end + end + elseif( pre ) then + cachedFunc = function(...) + local str = tagFunc(...) + if( str ) then return pre .. str end + end + elseif( ap ) then + cachedFunc = function(...) + local str = tagFunc(...) + if( str ) then return str .. ap end end - - functionPool[tag] = cachedFunc end + + functionPool[tag] = cachedFunc end - - -- Figure out what the lowest update frequency for this font string and use it - local pollTime = self.defaultFrequents[tag] or frequencyCache[tag] - if( ShadowUF.db.profile.tags[tag] and ShadowUF.db.profile.tags[tag].frequency ) then - pollTime = ShadowUF.db.profile.tags[tag].frequency - end - - if( pollTime and ( not fontString.frequentStart or fontString.frequentStart > pollTime ) ) then - frequencyCache[tags] = pollTime - frequentUpdates[fontString] = pollTime - fontString.frequentStart = pollTime - freqUpdateRequired = true - end - - -- It's an invalid tag, simply return the tag itself wrapped in brackets - if( not cachedFunc ) then - functionPool[tag] = functionPool[tag] or function() return string.format("[%s-error]", tag) end - cachedFunc = functionPool[tag] - end - - table.insert(args, cachedFunc) + end + + -- Figure out the lowest frequency rate we update at + if( frequencyCache[tag] ) then + lowestFrequency = math.min(lowestFrequency, frequencyCache[tag]) end - -- Create our update function now - updateFunc = function(fontString, frame, event, unit, powerType) - if( event and powerType and fontString.powerFilters ) then - -- Check if we can filter out the update - if( event == "UNIT_POWER" or event == "UNIT_POWER_FREQUENT" or event == "UNIT_MAXPOWER" ) then - if( not fontString.powerFilters[powerType] and ( not fontString.powerFilters.CURRENT or fontString.powerType ~= powerType ) ) then - return - end - end + -- It's an invalid tag, simply return the tag itself wrapped in brackets + if( not cachedFunc ) then + functionPool[tag] = functionPool[tag] or function() return string.format("[%s-error]", tag) end + cachedFunc = functionPool[tag] + end + + table.insert(args, cachedFunc) + end + + frequencyCache[tags] = lowestFrequency < 9999 and lowestFrequency or nil + tagPool[tags] = function(fontString, frame, event, unit, powerType) + if( event and powerType and fontString.powerFilters and powerEvents[event] ) then + if( not fontString.powerFilters[powerType] and ( not fontString.powerFilters.CURRENT or fontString.powerType ~= powerType ) ) then + return end + end + for id, func in pairs(args) do + temp[id] = func(fontString.parent.unit, fontString.parent.unitOwner, fontString) or "" + end - for id, func in pairs(args) do - temp[id] = func(fontString.parent.unit, fontString.parent.unitOwner, fontString) or "" - end + fontString:SetFormattedText(formattedText, unpack(temp)) + end - fontString:SetFormattedText(formattedText, unpack(temp)) - end + return tagPool[tags], frequencyCache[tags] +end - tagPool[tags] = updateFunc +function Tags:Register(parent, fontString, tags, resetCache) + -- Unregister the font string first if we did register it already + if( fontString.UpdateTags ) then + self:Unregister(fontString) end + + fontString.parent = parent + regFontStrings[fontString] = tags -- And give other frames an easy way to force an update - fontString.UpdateTags = updateFunc + local frequency + fontString.UpdateTags, frequency = createTagFunction(tags, resetCache) - -- Register any needed event - self:RegisterEvents(parent, fontString, tags) + if( frequency ) then + fontString.monitor = fontString.monitor or parent:CreateOnUpdate(frequency, function() + fontString:UpdateTags() + end) - if( freqUpdateRequired ) then - updateMinimumFrequency() + fontString.monitor:SetTimer(frequency) + elseif( fontString.monitor ) then + fontString.monitor:Stop() end + + -- Register any needed event + self:RegisterEvents(parent, fontString, tags) end function Tags:Unregister(fontString) regFontStrings[fontString] = nil - frequentUpdates[fontString] = nil - updateMinimumFrequency() -- Unregister it as using HC for key, module in pairs(self.customEvents) do @@ -309,9 +254,9 @@ function Tags:Unregister(fontString) end -- Kill any tag data + if( fontString.monitor ) then fontString.monitor:Stop() end fontString.parent:UnregisterAll(fontString) fontString.powerFilters = nil - fontString.frequentStart = nil fontString.UpdateTags = nil fontString:SetText("") diff --git a/modules/units.lua b/modules/units.lua index 2125038b..7979880d 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -210,15 +210,12 @@ Units.OnEvent = OnEvent -- Do a full update OnShow, and stop watching for events when it's not visible local function OnShow(self) - ShadowUF.Tags:FastRegister(self) - -- Reset the event handler self:SetScript("OnEvent", OnEvent) Units:CheckUnitStatus(self) end local function OnHide(self) - ShadowUF.Tags:FastUnregister(self) self:SetScript("OnEvent", nil) -- If it's a volatile such as target or focus, next time it's shown it has to do an update @@ -628,16 +625,24 @@ local function initializeUnit(header, frameName) end -- Update helper -local function CreateOnUpdate(self, timer, callback) +local function SetTimer(self, seconds) + self.animation:SetDuration(seconds) + self:Play() +end + +local function CreateOnUpdate(self, seconds, callback) local group = self:CreateAnimationGroup() group:SetLooping("REPEAT") group:SetScript("OnLoop", callback) local animation = group:CreateAnimation("Animation") animation:SetOrder(1) - animation:SetDuration(0.50) - group:Play() + group.animation = animation + group.SetTimer = SetTimer + + group:SetTimer(seconds) + return group end From c885381643a7c9533457643d13e4840211ed1639 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 13 Apr 2014 11:35:50 -0700 Subject: [PATCH 497/794] Fixed Arcane Charge not showing up when using Aura Points --- modules/aurapoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index 66a1e757..7620e842 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -1,7 +1,7 @@ local AuraPoints = setmetatable({ isComboPoints = true, spells = { - ["MAGE"] = {max = 6, name = GetSpellInfo(36032)}, + ["MAGE"] = {max = 4, name = GetSpellInfo(114664)}, ["ROGUE"] = {max = 5, name = GetSpellInfo(115189)} } }, {__index = ShadowUF.ComboPoints}) From 8ab4c05ec56e5d9783e7af07a85891eaba387e8a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 18 Apr 2014 18:18:14 -0700 Subject: [PATCH 498/794] Fixed Arcane Charges not working for Aura Points --- modules/aurapoints.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index 7620e842..6d1ba1b2 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -1,8 +1,8 @@ local AuraPoints = setmetatable({ isComboPoints = true, spells = { - ["MAGE"] = {max = 4, name = GetSpellInfo(114664)}, - ["ROGUE"] = {max = 5, name = GetSpellInfo(115189)} + ["MAGE"] = {max = 4, name = GetSpellInfo(114664), filter = "HARMFUL"}, + ["ROGUE"] = {max = 5, name = GetSpellInfo(115189), filter = "HELPFUL"} } }, {__index = ShadowUF.ComboPoints}) @@ -22,5 +22,5 @@ function AuraPoints:OnEnable(frame) end function AuraPoints:GetPoints(unit) - return select(4, UnitAura("player", trackSpell.name)) or 0 + return select(4, UnitAura("player", trackSpell.name, trackSpell.filter)) or 0 end \ No newline at end of file From 3a50262db654a91165f9d08654f32bbed86f52b0 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 19 Apr 2014 09:58:46 -0700 Subject: [PATCH 499/794] Fixed parameter passing --- modules/aurapoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index 6d1ba1b2..003c6a5d 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -22,5 +22,5 @@ function AuraPoints:OnEnable(frame) end function AuraPoints:GetPoints(unit) - return select(4, UnitAura("player", trackSpell.name, trackSpell.filter)) or 0 + return select(4, UnitAura("player", trackSpell.name, nil, trackSpell.filter)) or 0 end \ No newline at end of file From 3898319ac377a59b37c95756e7aff6e121bd9c63 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 25 May 2014 15:11:56 -0700 Subject: [PATCH 500/794] Redid aura configuration, filters are much more flexible and the UI is a little easier to use --- ShadowedUnitFrames.lua | 38 ++- media/textures/backdrop.tga | Bin 0 -> 108 bytes modules/auras.lua | 147 +++++----- modules/defaultlayout.lua | 6 +- modules/indicators.lua | 1 + options/config.lua | 532 ++++++++++++++++++++---------------- 6 files changed, 425 insertions(+), 299 deletions(-) create mode 100755 media/textures/backdrop.tga diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index c8b19a12..621ae556 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 42 +ShadowUF.dbRevision = 43 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -100,6 +100,38 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 42 ) then + for unit, config in pairs(self.db.profile.units) do + config.auras.height = nil + + for type, auraConfig in pairs(config.auras) do + auraConfig.show = {misc = true} + auraConfig.show.player = auraConfig.player + auraConfig.show.raid = auraConfig.raid + + auraConfig.enlarge = {} + auraConfig.enlarge["SELF"] = auraConfig.enlargeSelf + auraConfig.enlarge["REMOVABLE"] = auraConfig.enlargeStealable + + auraConfig.timers = {} + if( auraConfig.selfTimers ) then + auraConfig.timers["SELF"] = true + else + auraConfig.timers["ALL"] = true + end + + auraConfig.selfTimers = nil + auraConfig.player = nil + auraConfig.raid = nil + auraConfig.enlargeSelf = nil + auraConfig.enlargeStealable = nil + end + + config.auras.buffs.show.consolidated = true + config.auras.debuffs.show.boss = true + end + end + if( revision <= 41 ) then local phase = self.db.profile.units.party.indicators.phase phase.anchorPoint = phase.anchorPoint or "RC" @@ -425,8 +457,8 @@ function ShadowUF:LoadUnitDefaults() indicators = {raidTarget = {enabled = true, size = 0}}, highlight = {}, auras = { - buffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, prioritize = true, enlargeSelf = false}, - debuffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, enlargeSelf = true}, + buffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, prioritize = true, show = {misc = true, player = true, raid = true, consolidated = true}, enlarge = {}, timers = {ALL = true}}, + debuffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, show = {misc = true, player = true, raid = true, boss = true}, enlarge = {SELF = true}, timers = {ALL = true}}, }, } diff --git a/media/textures/backdrop.tga b/media/textures/backdrop.tga new file mode 100755 index 0000000000000000000000000000000000000000..640e8c44df8347055375f37d2b2a5b769b371239 GIT binary patch literal 108 rcmZQz;9`IQ0R{mE35I?kml6y!EhH$^HOw>E)89`w!p+miRgVDxWTOrq literal 0 HcmV?d00001 diff --git a/modules/auras.lua b/modules/auras.lua index d59b847a..c2741697 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -313,13 +313,6 @@ local function updateGroup(self, type, config, reverseConfig) -- Update filters used for the anchor group.filter = group.type == "buffs" and "HELPFUL" or group.type == "debuffs" and "HARMFUL" or "" - - -- This is a bit of an odd filter, when used with a HELPFUL filter, it will only return buffs you can cast on group members - -- When used with HARMFUL it will only return debuffs you can cure - -- As of 5.0.5, this is still broken and won't account for talents or symbiosis - if( config.raid and group.type == "buffs" ) then - group.filter = group.filter .. "|RAID" - end for id, button in pairs(group.buttons) do updateButton(id, group, config) @@ -412,7 +405,7 @@ local function updateTemporaryEnchant(frame, slot, tempData, hasEnchant, timeLef end -- Enlarge our own auras - if( config.enlargeSelf ) then + if( config.enlarge.SELF ) then button.isSelfScaled = true button:SetScale(config.selfScale) else @@ -506,6 +499,82 @@ function Auras:UpdateFilter(frame) frame.auras.blacklist = black and ShadowUF.db.profile.filters.blacklists[black] or filterDefault end +local function categorizeAura(type, curable, auraType, caster, isRemovable, shouldConsolidate, canApplyAura, isBossDebuff) + if( playerUnits[caster] ) then + return "player" + elseif( isBossDebuff ) then + return "boss" + elseif( type == "buffs" and canApplyAura ) then + return "raid" + elseif( type == "debuffs" and ( isRemovable or ( curable and canCure[auraType] ) ) ) then + return "raid" + elseif( shouldConsolidate ) then + return "consolidated" + else + return "misc" + end +end + +local function renderAura(parent, frame, type, config, displayConfig, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) + -- Do our initial list check to see if we can quick filter it out + if( parent.whitelist[type] and not parent.whitelist[name] and not parent.whitelist[spellID] ) then return end + if( parent.blacklist[type] and not parent.blacklist[name] and not parent.blacklist[spellID] ) then return end + + -- Now do our type filter + local category = categorizeAura(type, curable, auraType, caster, isRemovable, shouldConsolidate, canApplyAura, isBossDebuff) + if( not config.show[category] ) then return end + + -- Create any buttons we need + frame.totalAuras = frame.totalAuras + 1 + if( #(frame.buttons) < frame.totalAuras ) then + updateButton(frame.totalAuras, frame, ShadowUF.db.profile.units[frame.parent.unitType].auras[frame.type]) + end + + -- Show debuff border, or a special colored border if it's stealable + local button = frame.buttons[frame.totalAuras] + if( isRemovable and not isFriendly and not ShadowUF.db.profile.auras.disableColor ) then + button.border:SetVertexColor(ShadowUF.db.profile.auraColors.removable.r, ShadowUF.db.profile.auraColors.removable.g, ShadowUF.db.profile.auraColors.removable.b) + elseif( ( not isFriendly or type == "debuffs" ) and not ShadowUF.db.profile.auras.disableColor ) then + local color = auraType and DebuffTypeColor[auraType] or DebuffTypeColor.none + button.border:SetVertexColor(color.r, color.g, color.b) + else + button.border:SetVertexColor(0.60, 0.60, 0.60) + end + + -- Show the cooldown ring + if( not ShadowUF.db.profile.auras.disableCooldown and duration > 0 and endTime > 0 and ( config.timers.ALL or ( category == "player" and config.timers.SELF ) or ( category == "boss" and config.timers.BOSS ) ) ) then + button.cooldown:SetCooldown(endTime - duration, duration) + button.cooldown:Show() + else + button.cooldown:Hide() + end + + -- Enlarge our own auras + if( ( category == "player" and config.enlarge.SELF ) or ( category == "boss" and config.enlarge.BOSS ) or ( category == "raid" and type == "debuffs" and config.enlarge.REMOVABLE ) ) then + button.isSelfScaled = true + button:SetScale(config.selfScale) + else + button.isSelfScaled = nil + button:SetScale(1) + end + + -- Size it + button:SetHeight(config.size) + button:SetWidth(config.size) + button.border:SetHeight(config.size + 1) + button.border:SetWidth(config.size + 1) + + -- Stack + icon + show! Never understood why, auras sometimes return 1 for stack even if they don't stack + button.auraID = index + button.filter = filter + button.unit = frame.parent.unit + button.columnHasScaled = nil + button.previousHasScale = nil + button.icon:SetTexture(texture) + button.stack:SetText(count > 1 and count or "") + button:Show() +end + -- Scan for auras local function scan(parent, frame, type, config, displayConfig, filter) if( frame.totalAuras >= frame.maxAuras or not config.enabled ) then return end @@ -516,70 +585,20 @@ local function scan(parent, frame, type, config, displayConfig, filter) local index = 0 while( true ) do index = index + 1 - local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID = UnitAura(frame.parent.unit, index, filter) + local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff = UnitAura(frame.parent.unit, index, filter) if( not name ) then break end - if( ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and ( parent.whitelist[name] or parent.whitelist[spellID] ) or parent.blacklist[type] and ( not parent.blacklist[name] and not parent.blacklist[spellID] ) ) and ( not curable or canCure[auraType] ) ) then - -- Create any buttons we need - frame.totalAuras = frame.totalAuras + 1 - if( #(frame.buttons) < frame.totalAuras ) then - updateButton(frame.totalAuras, frame, ShadowUF.db.profile.units[frame.parent.unitType].auras[frame.type]) - end - - -- Show debuff border, or a special colored border if it's stealable - local button = frame.buttons[frame.totalAuras] - if( isRemovable and not isFriendly and not ShadowUF.db.profile.auras.disableColor ) then - button.border:SetVertexColor(ShadowUF.db.profile.auraColors.removable.r, ShadowUF.db.profile.auraColors.removable.g, ShadowUF.db.profile.auraColors.removable.b) - elseif( ( not isFriendly or type == "debuffs" ) and not ShadowUF.db.profile.auras.disableColor ) then - local color = auraType and DebuffTypeColor[auraType] or DebuffTypeColor.none - button.border:SetVertexColor(color.r, color.g, color.b) - else - button.border:SetVertexColor(0.60, 0.60, 0.60) - end - - -- Show the cooldown ring - if( not ShadowUF.db.profile.auras.disableCooldown and duration > 0 and endTime > 0 and ( not config.selfTimers or ( config.selfTimers and playerUnits[caster] ) ) ) then - button.cooldown:SetCooldown(endTime - duration, duration) - button.cooldown:Show() - else - button.cooldown:Hide() - end - - -- Enlarge our own auras - if( config.enlargeSelf and playerUnits[caster] or ( isRemovable and not isFriendly and config.enlargeStealable ) ) then - button.isSelfScaled = true - button:SetScale(config.selfScale) - else - button.isSelfScaled = nil - button:SetScale(1) - end + renderAura(parent, frame, type, config, displayConfig, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) - -- Size it - button:SetHeight(config.size) - button:SetWidth(config.size) - button.border:SetHeight(config.size + 1) - button.border:SetWidth(config.size + 1) - - -- Stack + icon + show! Never understood why, auras sometimes return 1 for stack even if they don't stack - button.auraID = index - button.filter = filter - button.unit = frame.parent.unit - button.columnHasScaled = nil - button.previousHasScale = nil - button.icon:SetTexture(texture) - button.stack:SetText(count > 1 and count or "") - button:Show() - - -- Too many auras shown break out - -- Get down - if( frame.totalAuras >= frame.maxAuras ) then break end - end + -- Too many auras shown, break out + -- Get down + if( frame.totalAuras >= frame.maxAuras ) then break end end for i=frame.totalAuras + 1, #(frame.buttons) do frame.buttons[i]:Hide() end -- The default 1.30 scale doesn't need special handling, after that it does - if( config.enlargeSelf ) then + if( config.selfScale > 1.30 ) then positionAllButtons(frame, displayConfig) end end diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index f42ab499..dbcbd063 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -235,8 +235,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) config.parentUnit = { portrait = {enabled = false, type = "3D", alignment = "LEFT", width = 0.22, height = 0.50, order = 15, fullBefore = 0, fullAfter = 100}, auras = { - buffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0}, - debuffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0}, + buffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0, show = {misc = true, player = true, raid = true, consolidated = true}, enlarge = {}, timers = {ALL = true}}, + debuffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0, show = {misc = true, player = true, raid = true, boss = true}, enlarge = {SELF = true}, timers = {ALL = true}}, }, text = { {width = 0.50, name = L["Left text"], anchorTo = "$healthBar", anchorPoint = "CLI", x = 3, y = 0, size = 0, default = true}, @@ -358,7 +358,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, }, auras = { - buffs = {enabled = false, maxRows = 1, temporary = playerClass == "ROGUE" or playerClass == "SHAMAN"}, + buffs = {enabled = false, maxRows = 1}, debuffs = {enabled = false, maxRows = 1}, }, text = { diff --git a/modules/indicators.lua b/modules/indicators.lua index 38140746..ff0092cc 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -310,6 +310,7 @@ function Indicators:OnEnable(frame) if( config.indicators.resurrect and config.indicators.resurrect.enabled ) then frame:RegisterNormalEvent("INCOMING_RESURRECT_CHANGED", self, "UpdateResurrect") + frame:RegisterNormalEvent("UNIT_OTHER_PARTY_CHANGED", self, "UpdateResurrect") frame:RegisterUpdateFunc(self, "UpdateResurrect") frame.indicators.resurrect = frame.indicators.resurrect or frame.indicators:CreateTexture(nil, "OVERLAY") diff --git a/options/config.lua b/options/config.lua index e284af10..6b37d575 100755 --- a/options/config.lua +++ b/options/config.lua @@ -12,6 +12,12 @@ ShadowUF.Config = Config I'm going to have to split it out into separate files for each type to clean everything up but that takes time and I have other things I want to get done with first. + + -- dated 2009 + + In reality, this will never be cleaned up because jesus christ, I am not refactoring 7,000 lines of configuration. + + *** HERE BE DRAGONS *** ]] local unitCategories = { @@ -250,6 +256,8 @@ local function setUnit(info, value) if( moduleSubKey and not key ) then key = moduleSubKey moduleSubKey = nil end if( moduleSubKey == "$parent" ) then moduleSubKey = info[#(info) - 1] end if( moduleKey == "$parent" ) then moduleKey = info[#(info) - 1] end + if( moduleSubKey == "$parentparent" ) then moduleSubKey = info[#(info) - 2] end + if( moduleKey == "$parentparent" ) then moduleKey = info[#(info) - 2] end if( tonumber(moduleSubKey) ) then moduleSubKey = tonumber(moduleSubKey) end setDirectUnit(unit, moduleKey, moduleSubKey, key, value) @@ -272,6 +280,8 @@ local function getUnit(info) if( moduleSubKey and not key ) then key = moduleSubKey moduleSubKey = nil end if( moduleSubKey == "$parent" ) then moduleSubKey = info[#(info) - 1] end if( moduleKey == "$parent" ) then moduleKey = info[#(info) - 1] end + if( moduleSubKey == "$parentparent" ) then moduleSubKey = info[#(info) - 2] end + if( moduleKey == "$parentparent" ) then moduleKey = info[#(info) - 2] end if( tonumber(moduleSubKey) ) then moduleSubKey = tonumber(moduleSubKey) end return getVariable(info[2], moduleKey, moduleSubKey, key) @@ -1968,7 +1978,7 @@ local function loadUnitOptions() end local function disableAnchoredTo(info) - local auras = getVariable(info[2], "auras", nil, info[#(info) - 1]) + local auras = getVariable(info[2], "auras", nil, info[#(info) - 2]) return auras.anchorOn or not auras.enabled end @@ -1978,15 +1988,15 @@ local function loadUnitOptions() local debuffs = getVariable(info[2], "auras", nil, "debuffs") local anchor = buffs.enabled and buffs.prioritize and "buffs" or "debuffs" - if( not getVariable(info[2], "auras", info[#(info) - 1], "enabled") ) then + if( not getVariable(info[2], "auras", info[#(info) - 2], "enabled") ) then return true end - if( ( info[#(info)] == "x" or info[#(info)] == "y" ) and ( info[#(info) - 1] == "buffs" and buffs.anchorOn or info[#(info) - 1] == "debuffs" and debuffs.anchorOn ) ) then + if( ( info[#(info)] == "x" or info[#(info)] == "y" ) and ( info[#(info) - 2] == "buffs" and buffs.anchorOn or info[#(info) - 2] == "debuffs" and debuffs.anchorOn ) ) then return true end - if( anchor == info[#(info) - 1] or buffs.anchorOn or debuffs.anchorOn ) then + if( anchor == info[#(info) - 2] or buffs.anchorOn or debuffs.anchorOn ) then return false end @@ -2001,229 +2011,310 @@ local function loadUnitOptions() local function hideStealable(info) if( not ShadowUF.db.profile.advanced ) then return true end - if( info[2] == "player" or info[2] == "pet" or info[#(info) - 1] == "debuffs" ) then return true end + if( info[2] == "player" or info[2] == "pet" or info[#(info) - 2] == "debuffs" ) then return true end return false end + + local function hideBuffOption(info) + return info[#(info) - 2] ~= "buffs" + end + + local function hideDebuffOption(info) + return info[#(info) - 2] ~= "debuffs" + end + + local function reloadUnitAuras() + for _, frame in pairs(ShadowUF.Units.unitFrames) do + if( UnitExists(frame.unit) and frame.visibility.auras ) then + ShadowUF.modules.auras:UpdateFilter(frame) + frame:FullUpdate() + end + end + end + local aurasDisabled = function(info) return not getVariable(info[2], "auras", info[#(info) - 2], "enabled") end + Config.auraTable = { type = "group", - inline = true, hidden = false, name = function(info) return info[#(info)] == "buffs" and L["Buffs"] or L["Debuffs"] end, order = function(info) return info[#(info)] == "buffs" and 1 or 2 end, - disabled = function(info) return not getVariable(info[2], "auras", info[#(info) - 1], "enabled") end, + disabled = false, args = { - enabled = { - order = 1, - type = "toggle", - name = function(info) if( info[#(info) - 1] == "buffs" ) then return L["Enable buffs"] end return L["Enable debuffs"] end, - disabled = false, - arg = "auras.$parent.enabled", + general = { + type = "group", + name = L["General"], + order = 0, + args = { + enabled = { + order = 1, + type = "toggle", + name = function(info) if( info[#(info) - 2] == "buffs" ) then return L["Enable buffs"] end return L["Enable debuffs"] end, + disabled = false, + width = "full", + arg = "auras.$parentparent.enabled", + }, + temporary = { + order = 2, + type = "toggle", + name = L["Enable temporary enchants"], + desc = L["Adds temporary enchants to the buffs for the player."], + width = "full", + hidden = function(info) return info[2] ~= "player" end, + disabled = function(info) return not getVariable(info[2], "auras", "buffs", "enabled") end, + arg = "auras.buffs.temporary", + } + } }, - anchorOn = { - order = 2, - type = "toggle", - name = function(info) return info[#(info) - 1] == "buffs" and L["Anchor to debuffs"] or L["Anchor to buffs"] end, - desc = L["Allows you to anchor the aura group to another, you can then choose where it will be anchored using the position.|n|nUse this if you want to duplicate the default ui style where buffs and debuffs are separate groups."], + filters = { + type = "group", + name = L["Filters"], + order = 1, set = function(info, value) - setVariable(info[2], "auras", info[#(info) - 1] == "buffs" and "debuffs" or "buffs", "anchorOn", false) - setUnit(info, value) - end, - arg = "auras.$parent.anchorOn", - }, - prioritize = { - order = 2.25, - type = "toggle", - name = L["Prioritize buffs"], - desc = L["Show buffs before debuffs when sharing the same anchor point."], - hidden = function(info) return info[#(info) - 1] == "debuffs" end, - disabled = function(info) - if( not getVariable(info[2], "auras", info[#(info) - 1], "enabled") ) then return true end - - local buffs = getVariable(info[2], "auras", nil, "buffs") - local debuffs = getVariable(info[2], "auras", nil, "debuffs") - - return buffs.anchorOn or debuffs.anchorOn or buffs.anchorPoint ~= debuffs.anchorPoint - end, - arg = "auras.$parent.prioritize", - }, - sep2 = { - order = 6, - type = "description", - name = "", - width = "full", - }, - enlargeStealable = { - order = 6.5, - type = "toggle", - name = L["Enlarge removable auras"], - desc = L["If you can Spellsteal or remove an aura, then it will be shown scaled using the scaled aura size option."], - arg = "auras.$parent.enlargeStealable", - hidden = hideStealable, - }, - player = { - order = 7, - type = "toggle", - name = L["Show your auras only"], - desc = L["Filter out any auras that you did not cast yourself."], - arg = "auras.$parent.player", - }, - raid = { - order = 8, - type = "toggle", - name = function(info) return info[#(info) - 1] == "buffs" and L["Show castable on other auras only"] or L["Show curable only"] end, - desc = function(info) return info[#(info) - 1] == "buffs" and L["Filter out any auras that you cannot cast on another player, or yourself."] or L["Filter out any aura that you cannot cure."] end, - width = "double", - arg = "auras.$parent.raid", - hidden = function(info) return not hideStealable(info) end, - }, - raid2 = { - order = 8, - type = "toggle", - name = function(info) return info[#(info) - 1] == "buffs" and L["Show castable on other auras only"] or L["Show curable only"] end, - desc = function(info) return info[#(info) - 1] == "buffs" and L["Filter out any auras that you cannot cast on another player, or yourself."] or L["Filter out any aura that you cannot cure."] end, - arg = "auras.$parent.raid", - hidden = hideStealable, - }, - sep3 = { - order = 9, - type = "description", - name = "", - width = "full", - }, - selfTimers = { - order = 9.5, - type = "toggle", - name = L["Timers for self auras only"], - desc = L["Hides the cooldown ring for any auras that you did not cast."], - hidden = hideAdvancedOption, - arg = "auras.$parent.selfTimers", - }, - enlargeSelf = { - order = 10, - type = "toggle", - name = L["Enlarge your auras"], - desc = L["If you casted the aura, then the buff icon will be increased in size to make it more visible."], - arg = "auras.$parent.enlargeSelf", - }, - selfScale = { - order = 11, - type = "range", - name = L["Scaled aura size"], - desc = L["Scale for auras that you casted or can Spellsteal, any number above 100% is bigger than default, any number below 100% is smaller than default."], - min = 1, max = 3, step = 0.10, - isPercent = true, - disabled = function(info) return not getVariable(info[2], "auras", info[#(info) - 1], "enlargeSelf") and not getVariable(info[2], "auras", info[#(info) - 1], "enlargeStealable") end, - hidden = hideAdvancedOption, - arg = "auras.$parent.selfScale", - }, - selfTimersDouble = { - order = 11, - type = "toggle", - name = L["Timers for self auras only"], - desc = L["Hides the cooldown ring for any auras that you did not cast."], - hidden = hideBasicOption, - arg = "auras.$parent.selfTimers", - width = "double", - }, - sep4 = { - order = 12, - type = "description", - name = "", - width = "full", - }, - perRow = { - order = 13, - type = "range", - name = function(info) - local anchorPoint = getVariable(info[2], "auras", info[#(info) - 1], "anchorPoint") - if( ShadowUF.Layout:GetColumnGrowth(anchorPoint) == "LEFT" or ShadowUF.Layout:GetColumnGrowth(anchorPoint) == "RIGHT" ) then - return L["Per column"] - end - - return L["Per row"] - end, - desc = L["How many auras to show in a single row."], - min = 1, max = 100, step = 1, softMin = 1, softMax = 50, - disabled = disableSameAnchor, - arg = "auras.$parent.perRow", - }, - maxRows = { - order = 14, - type = "range", - name = L["Max rows"], - desc = L["How many rows total should be used, rows will be however long the per row value is set at."], - min = 1, max = 10, step = 1, softMin = 1, softMax = 5, - disabled = disableSameAnchor, - hidden = function(info) - local anchorPoint = getVariable(info[2], "auras", info[#(info) - 1], "anchorPoint") - if( ShadowUF.Layout:GetColumnGrowth(anchorPoint) == "LEFT" or ShadowUF.Layout:GetColumnGrowth(anchorPoint) == "RIGHT" ) then - return true - end - - return false + getVariable(info[2], "auras", info[#(info) - 2], "show")[info[#(info)]] = value + reloadUnitAuras() end, - arg = "auras.$parent.maxRows", - }, - maxColumns = { - order = 14, - type = "range", - name = L["Max columns"], - desc = L["How many auras per a column for example, entering two her will create two rows that are filled up to whatever per row is set as."], - min = 1, max = 100, step = 1, softMin = 1, softMax = 50, - hidden = function(info) - local anchorPoint = getVariable(info[2], "auras", info[#(info) - 1], "anchorPoint") - if( ShadowUF.Layout:GetColumnGrowth(anchorPoint) == "LEFT" or ShadowUF.Layout:GetColumnGrowth(anchorPoint) == "RIGHT" ) then - return false - end - - return true + get = function(info) + return getVariable(info[2], "auras", info[#(info) - 2], "show")[info[#(info)]] end, - disabled = disableSameAnchor, - arg = "auras.$parent.maxRows", - }, - size = { - order = 15, - type = "range", - name = L["Size"], - min = 1, max = 30, step = 1, - arg = "auras.$parent.size", - }, - sep5 = { - order = 16, - type = "description", - name = "", - width = "full", - }, - anchorPoint = { - order = 17, - type = "select", - name = L["Position"], - desc = L["How you want this aura to be anchored to the unit frame."], - values = getAuraAnchors, - disabled = disableAnchoredTo, - arg = "auras.$parent.anchorPoint", - }, - x = { - order = 18, - type = "range", - name = L["X Offset"], - min = -1000, max = 1000, step = 1, softMin = -100, softMax = 100, - disabled = disableSameAnchor, - hidden = hideAdvancedOption, - arg = "auras.$parent.x", + args = { + player = { + order = 1, + type = "toggle", + name = L["Show your auras"], + desc = L["Whether auras you casted should be shown"], + width = "full" + }, + raid = { + order = 2, + type = "toggle", + name = function(info) return info[#(info) - 2] == "buffs" and L["Show castable on other auras"] or L["Show curable/removable auras"] end, + desc = function(info) return info[#(info) - 2] == "buffs" and L["Whether to show buffs that you cannot cast."] or L["Whether to show any debuffs you can remove, cure or steal."] end, + width = "full" + }, + boss = { + order = 3, + type = "toggle", + name = L["Show casted by boss"], + desc = L["Whether to show any debuffs casted by the boss"], + hidden = hideDebuffOption, + width = "full" + }, + consolidated = { + order = 4, + type = "toggle", + name = L["Show consolidable auras"], + desc = L["Whether to show any auras that would be consolidated by the default UI."], + width = "full", + arg = "auras.$parentparent.show.consolidated" + }, + misc = { + order = 5, + type = "toggle", + name = L["Show any other auras"], + desc = L["Whether to show auras that do not fall into the above categories."], + width = "full" + } + } }, - y = { - order = 19, - type = "range", - name = L["Y Offset"], - min = -1000, max = 1000, step = 1, softMin = -100, softMax = 100, - disabled = disableSameAnchor, - hidden = hideAdvancedOption, - arg = "auras.$parent.y", + display = { + type = "group", + name = L["Display"], + order = 2, + args = { + prioritize = { + order = 1, + type = "toggle", + name = L["Prioritize buffs"], + desc = L["Show buffs before debuffs when sharing the same anchor point."], + hidden = hideBuffOption, + disabled = function(info) + if( not getVariable(info[2], "auras", info[#(info) - 2], "enabled") ) then return true end + + local buffs = getVariable(info[2], "auras", nil, "buffs") + local debuffs = getVariable(info[2], "auras", nil, "debuffs") + + return buffs.anchorOn or debuffs.anchorOn or buffs.anchorPoint ~= debuffs.anchorPoint + end, + arg = "auras.$parentparent.prioritize" + }, + sep1 = {order = 1.5, type = "description", name = "", width = "full"}, + selfScale = { + order = 2, + type = "range", + name = L["Scaled aura size"], + desc = L["Scale for auras that you casted or can Spellsteal, any number above 100% is bigger than default, any number below 100% is smaller than default."], + min = 1, max = 3, step = 0.10, + isPercent = true, + hidden = hideAdvancedOption, + arg = "auras.$parentparent.selfScale", + }, + sep12 = {order = 2.5, type = "description", name = "", width = "full"}, + timers = { + order = 3, + type = "multiselect", + name = L["Cooldown rings for"], + desc = L["When to show cooldown rings on auras"], + hidden = hideAdvancedOption, + values = function(info) + local tbl = {["ALL"] = L["All Auras"], ["SELF"] = L["Your Auras"]} + local type = info[#(info) - 2] + if( type == "debuffs" ) then + tbl["BOSS"] = L["Boss Debuffs"] + end + + return tbl; + end, + set = function(info, key, value) + local tbl = getVariable(info[2], "auras", info[#(info) - 2], "timers") + if( key == "ALL" and value ) then + tbl = {["ALL"] = true} + elseif( key ~= "ALL" and value ) then + tbl["ALL"] = nil + tbl[key] = value + else + tbl[key] = value + end + + setVariable(info[2], "auras", info[#(info) - 2], "timers", tbl) + reloadUnitAuras() + end, + get = function(info, key) + return getVariable(info[2], "auras", info[#(info) - 2], "timers")[key] + end + }, + sep3 = {order = 3.5, type = "description", name = "", width = "full"}, + enlarge = { + order = 4, + type = "multiselect", + name = L["Enlarge auras for"], + desc = L["What type of auras should be enlarged, use the scaled aura size option to change the size."], + values = function(info) + local tbl = {["SELF"] = L["Your Auras"]} + local type = info[#(info) - 2] + if( type == "debuffs" ) then + tbl["BOSS"] = L["Boss Debuffs"] + end + + if( info[2] ~= "player" ) then + tbl["REMOVABLE"] = L["Removable/Stealable"] + else + tbl["REMOVABLE"] = L["Removable"] + end + + return tbl; + end, + set = function(info, key, value) + local tbl = getVariable(info[2], "auras", info[#(info) - 2], "enlarge") + tbl[key] = value + + setVariable(info[2], "auras", info[#(info) - 2], "enlarge", tbl) + reloadUnitAuras() + end, + get = function(info, key) + return getVariable(info[2], "auras", info[#(info) - 2], "enlarge")[key] + end + } + } }, - }, + positioning = { + type = "group", + name = L["Positioning"], + order = 3, + args = { + anchorOn = { + order = 1, + type = "toggle", + name = function(info) return info[#(info) - 2] == "buffs" and L["Anchor to debuffs"] or L["Anchor to buffs"] end, + desc = L["Allows you to anchor the aura group to another, you can then choose where it will be anchored using the position.|n|nUse this if you want to duplicate the default ui style where buffs and debuffs are separate groups."], + set = function(info, value) + setVariable(info[2], "auras", info[#(info) - 2] == "buffs" and "debuffs" or "buffs", "anchorOn", false) + setUnit(info, value) + end, + width = "full", + arg = "auras.$parentparent.anchorOn", + }, + size = { + order = 2, + type = "range", + name = L["Icon Size"], + min = 1, max = 30, step = 1, + arg = "auras.$parentparent.size", + }, + sep1 = {order = 3, type = "description", name = "", width = "full"}, + perRow = { + order = 13, + type = "range", + name = function(info) + local anchorPoint = getVariable(info[2], "auras", info[#(info) - 2], "anchorPoint") + if( ShadowUF.Layout:GetColumnGrowth(anchorPoint) == "LEFT" or ShadowUF.Layout:GetColumnGrowth(anchorPoint) == "RIGHT" ) then + return L["Per column"] + end + + return L["Per row"] + end, + desc = L["How many auras to show in a single row."], + min = 1, max = 100, step = 1, softMin = 1, softMax = 50, + disabled = disableSameAnchor, + arg = "auras.$parent.perRow", + }, + maxRows = { + order = 14, + type = "range", + name = L["Max rows"], + desc = L["How many rows total should be used, rows will be however long the per row value is set at."], + min = 1, max = 10, step = 1, softMin = 1, softMax = 5, + disabled = disableSameAnchor, + hidden = function(info) + local anchorPoint = getVariable(info[2], "auras", info[#(info) - 2], "anchorPoint") + if( ShadowUF.Layout:GetColumnGrowth(anchorPoint) == "LEFT" or ShadowUF.Layout:GetColumnGrowth(anchorPoint) == "RIGHT" ) then + return true + end + + return false + end, + arg = "auras.$parentparent.maxRows", + }, + maxColumns = { + order = 14, + type = "range", + name = L["Max columns"], + desc = L["How many auras per a column for example, entering two her will create two rows that are filled up to whatever per row is set as."], + min = 1, max = 100, step = 1, softMin = 1, softMax = 50, + hidden = function(info) + local anchorPoint = getVariable(info[2], "auras", info[#(info) - 2], "anchorPoint") + if( ShadowUF.Layout:GetColumnGrowth(anchorPoint) == "LEFT" or ShadowUF.Layout:GetColumnGrowth(anchorPoint) == "RIGHT" ) then + return false + end + + return true + end, + disabled = disableSameAnchor, + arg = "auras.$parentparent.maxRows", + }, + x = { + order = 18, + type = "range", + name = L["X Offset"], + min = -1000, max = 1000, step = 1, softMin = -100, softMax = 100, + disabled = disableSameAnchor, + hidden = hideAdvancedOption, + arg = "auras.$parentparent.x", + }, + y = { + order = 19, + type = "range", + name = L["Y Offset"], + min = -1000, max = 1000, step = 1, softMin = -100, softMax = 100, + disabled = disableSameAnchor, + hidden = hideAdvancedOption, + arg = "auras.$parentparent.y", + }, + + } + } + } } local function hideBarOption(info) @@ -4432,25 +4523,8 @@ local function loadUnitOptions() hidden = isModifiersSet, set = setUnit, get = getUnit, + childGroups = "tree", args = { - temp = { - order = 0, - type = "group", - inline = true, - name = L["Temporary enchants"], - hidden = function(info) return info[2] ~= "player" end, - args = { - temporary = { - order = 0, - type = "toggle", - name = L["Enable temporary enchants"], - desc = L["Adds temporary enchants to the buffs for the player."], - disabled = function(info) return not getVariable(info[2], "auras", "buffs", "enabled") end, - arg = "auras.buffs.temporary", - width = "double", - }, - }, - }, buffs = Config.auraTable, debuffs = Config.auraTable, }, From 22cb7be7e25f4b43a17886a74ec2f4829ba804e1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 25 May 2014 17:47:30 -0700 Subject: [PATCH 501/794] Aura indicators are now built in, deprecating ShadowedUF_Indicators --- ShadowedUnitFrames.lua | 63 +- ShadowedUnitFrames.toc | 5 +- modules/auraindicators.lua | 285 +++++++++ modules/auras.lua | 4 +- options/config.lua | 1118 +++++++++++++++++++++++++++++++++++- 5 files changed, 1469 insertions(+), 6 deletions(-) create mode 100755 modules/auraindicators.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 621ae556..6f765612 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 43 +ShadowUF.dbRevision = 44 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -100,6 +100,13 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 43 ) then + for key, _ in pairs(self.db.profile.auraIndicators.indicators) do + self.db.profile.auraIndicators.height = nil + self.db.profile.auraIndicators.filters[key] = {boss = {priority = 100}, curable = {priority = 100}} + end + end + if( revision <= 42 ) then for unit, config in pairs(self.db.profile.units) do config.auras.height = nil @@ -456,6 +463,7 @@ function ShadowUF:LoadUnitDefaults() }, indicators = {raidTarget = {enabled = true, size = 0}}, highlight = {}, + auraIndicators = {enabled = false}, auras = { buffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, prioritize = true, show = {misc = true, player = true, raid = true, consolidated = true}, enlarge = {}, timers = {ALL = true}}, debuffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, show = {misc = true, player = true, raid = true, boss = true}, enlarge = {SELF = true}, timers = {ALL = true}}, @@ -629,10 +637,55 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.positions.partytarget.anchorTo = "$parent" self.defaults.profile.positions.partytarget.anchorPoint = "RT" self.defaults.profile.units.partytarget.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} + + -- Aura indicators + self.defaults.profile.auraIndicators = { + disabled = {}, + missing = {}, + linked = {}, + indicators = { + ["tl"] = {name = L["Top Left"], anchorPoint = "TLI", anchorTo = "$parent", height = 8, width = 8, alpha = 1.0, x = 4, y = -4, friendly = true, hostile = true}, + ["tr"] = {name = L["Top Right"], anchorPoint = "TRI", anchorTo = "$parent", height = 8, width = 8, alpha = 1.0, x = -3, y = -3, friendly = true, hostile = true}, + ["bl"] = {name = L["Bottom Left"], anchorPoint = "BLI", anchorTo = "$parent", height = 8, width = 8, alpha = 1.0, x = 4, y = 4, friendly = true, hostile = true}, + ["br"] = {name = L["Bottom Right"], anchorPoint = "BRI", anchorTo = "$parent", height = 8, width = 8, alpha = 1.0, x = -4, y = -4, friendly = true, hostile = true}, + ["c"] = {name = L["Center"], anchorPoint = "C", anchorTo = "$parent", height = 20, width = 20, alpha = 1.0, x = 0, y = 0, friendly = true, hostile = true}, + }, + filters = { + ["tl"] = {boss = {priority = 100}, curable = {priority = 100}}, + ["tr"] = {boss = {priority = 100}, curable = {priority = 100}}, + ["bl"] = {boss = {priority = 100}, curable = {priority = 100}}, + ["br"] = {boss = {priority = 100}, curable = {priority = 100}}, + ["c"] = {boss = {priority = 100}, curable = {priority = 100}}, + }, + auras = { + [GetSpellInfo(774)] = [[{indicator = '', group = "Druid", priority = 10, r = 0.66, g = 0.66, b = 1.0}]], -- Rejuvenation + [GetSpellInfo(8936)] = [[{indicator = '', group = "Druid", priority = 10, r = 0.50, g = 1.0, b = 0.63}]], -- Regrowth + [GetSpellInfo(33763)] = [[{indicator = '', group = "Druid", priority = 10, r = 0.07, g = 1.0, b = 0.01}]], -- Lifebloom + [GetSpellInfo(48438)] = [[{indicator = '', group = "Druid", priority = 10, r = 0.51, g = 0.72, b = 0.77}]], -- Wild Growth + [GetSpellInfo(1126)] = [[{indicator = '', group = "Druid", priority = 10, r = 1.0, g = 0.33, b = 0.90}]], -- Mark of the Wild + [GetSpellInfo(139)] = [[{indicator = '', group = "Priest", priority = 10, r = 1, g = 0.62, b = 0.88}]], -- Renew + [GetSpellInfo(17)] = [[{indicator = '', group = "Priest", priority = 10, r = 0.55, g = 0.69, b = 1.0}]], -- Power Word: Shield + [GetSpellInfo(21562)] = [[{indicator = '', group = "Priest", priority = 10, r = 0.58, g = 1.0, b = 0.50}]], -- Power Word: Fortitude + [GetSpellInfo(974)] = [[{indicator = '', group = "Shaman", priority = 10, r = 0.26, g = 1.0, b = 0.26}]], -- Earth Shield + [GetSpellInfo(61295)] = [[{indicator = '', group = "Shaman", priority = 10, r = 0.30, g = 0.24, b = 1.0}]], -- Riptide + [GetSpellInfo(1459)] = [[{indicator = '', group = "Mage", priority = 10, r = 0.10, g = 0.68, b = 0.88}]], -- Arcane Brilliance + [GetSpellInfo(20707)] = [[{indicator = '', group = "Warlock", priority = 10, r = 0.42, g = 0.21, b = 0.65}]], -- Soulstone Resurrection + } + } + + for classToken in pairs(RAID_CLASS_COLORS) do + self.defaults.profile.auraIndicators.disabled[classToken] = {} + end end -- Module APIs function ShadowUF:RegisterModule(module, key, name, isBar, class, spec, level) + -- Prevent duplicate registration for deprecated plugin + if( key == "auraIndicators" and IsAddOnLoaded("ShadowedUF_Indicators") and self.modules.auraIndicators ) then + self:Print(L["WARNING! ShadowedUF_Indicators has been deprecated as v4 and is now built in. Please delete ShadowedUF_Indicators, your configuration will be saved."]) + return + end + self.modules[key] = module module.moduleKey = key @@ -877,6 +930,14 @@ local infoMessages = { L["- Added Ancient Kings bar for Paladins"], L["- And more! See the change log for everything that has changed."], L["|nYou can disable the new text for Monk Stagger, Totem and Rune timers through /suf -> Unit configuration -> Text/Tags"] + }, + { + L["Welcome to Shadowed Unit Frames v4! Auras have been expanded in this release.|n"], + L["- Aura Indicators are now built in"], + L["- Auras can be filtered multiple criteria rather than just self casted"], + L["- Boss debuff filtering is in"], + L["- Cooldown rings and scaled auras are more configurable"], + L["- Aura config is no longer a bunch of clumped options"] } } diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 0f87f62c..fdeba561 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Title: Shadowed Unit Frames -## Notes: Now with 200% more shadows than the leading competitors +## Notes: Now with 300% more shadows than the leading competitors ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB @@ -39,6 +39,7 @@ modules\indicators.lua modules\xp.lua modules\cast.lua modules\auras.lua +modules\auraindicators.lua modules\combattext.lua modules\totems.lua modules\runes.lua @@ -63,4 +64,6 @@ modules\monkstagger.lua modules\aurapoints.lua #@do-not-package@ options\config.lua +globalcheck.rb +localcheck.rb #@end-do-not-package@ diff --git a/modules/auraindicators.lua b/modules/auraindicators.lua new file mode 100755 index 00000000..1c652c53 --- /dev/null +++ b/modules/auraindicators.lua @@ -0,0 +1,285 @@ +local Indicators = {} +ShadowUF:RegisterModule(Indicators, "auraIndicators", ShadowUF.L["Aura indicators"]) + +Indicators.auraFilters = {"boss", "curable"} + +Indicators.auraConfig = setmetatable({}, { + __index = function(tbl, index) + local aura = ShadowUF.db.profile.auraIndicators.auras[tostring(index)] + if( not aura ) then + tbl[index] = false + else + local func, msg = loadstring("return " .. aura) + if( func ) then + func = func() + elseif( msg ) then + error(msg, 3) + end + + tbl[index] = func + tbl[index].group = tbl[index].group or ShadowUF.L["Miscellaneous"] + end + + return tbl[index] +end}) + +local playerUnits = {player = true, vehicle = true, pet = true} +local backdropTbl = {bgFile = "Interface\\Addons\\ShadowedUnitFrames\\mediabackdrop", edgeFile = "Interface\\Addons\\ShadowedUnitFrames\\media\\backdrop", tile = true, tileSize = 1, edgeSize = 1} + +function Indicators:OnEnable(frame) + -- Not going to create the indicators we want here, will do that when we do the layout stuff + frame.auraIndicators = frame.auraIndicators or CreateFrame("Frame", nil, frame) + frame.auraIndicators:SetFrameLevel(4) + frame.auraIndicators:Show() + + -- Of course, watch for auras + frame:RegisterUnitEvent("UNIT_AURA", self, "UpdateAuras") + frame:RegisterUpdateFunc(self, "UpdateAuras") +end + +function Indicators:OnDisable(frame) + frame:UnregisterAll(self) + frame.auraIndicators:Hide() +end + +function Indicators:OnLayoutApplied(frame) + if( not frame.auraIndicators ) then return end + + -- Create indicators + local id = 1 + for key, indicatorConfig in pairs(ShadowUF.db.profile.auraIndicators.indicators) do + -- Create indicator as needed + local indicator = frame.auraIndicators["indicator-" .. id] + if( not indicator ) then + indicator = CreateFrame("Frame", nil, frame.auraIndicators) + indicator:SetFrameLevel(frame.topFrameLevel + 1) + indicator.texture = indicator:CreateTexture(nil, "OVERLAY") + indicator.texture:SetPoint("CENTER", indicator) + indicator:SetAlpha(indicatorConfig.alpha) + indicator:SetBackdrop(backdropTbl) + indicator:SetBackdropColor(0, 0, 0, 1) + indicator:SetBackdropBorderColor(0, 0, 0, 0) + + indicator.cooldown = CreateFrame("Cooldown", nil, indicator, "CooldownFrameTemplate") + indicator.cooldown:SetReverse(true) + indicator.cooldown:SetPoint("CENTER", 0, -1) + + indicator.stack = indicator:CreateFontString(nil, "OVERLAY") + indicator.stack:SetFont("Interface\\AddOns\\ShadowedUnitFrames\\media\\fonts\\Myriad Condensed Web.ttf", 12, "OUTLINE") + indicator.stack:SetShadowColor(0, 0, 0, 1.0) + indicator.stack:SetShadowOffset(0.8, -0.8) + indicator.stack:SetPoint("BOTTOMRIGHT", indicator, "BOTTOMRIGHT", 1, 0) + indicator.stack:SetWidth(18) + indicator.stack:SetHeight(10) + indicator.stack:SetJustifyH("RIGHT") + + frame.auraIndicators["indicator-" .. id] = indicator + end + + -- Quick access + indicator.filters = ShadowUF.db.profile.auraIndicators.filters[key] + indicator.config = ShadowUF.db.profile.units[frame.unitType].auraIndicators + + -- Set up the sizing options + indicator:SetHeight(indicatorConfig.height) + indicator.texture:SetWidth(indicatorConfig.width - 1) + indicator:SetWidth(indicatorConfig.width) + indicator.texture:SetHeight(indicatorConfig.height - 1) + + ShadowUF.Layout:AnchorFrame(frame, indicator, indicatorConfig) + + -- Let the auras module quickly access indicators without having to use index + frame.auraIndicators[key] = indicator + + id = id + 1 + end +end + +local playerClass = select(2, UnitClass("player")) +local filterMap = {} +local canCure = ShadowUF.Units.canCure +for _, key in pairs(Indicators.auraFilters) do filterMap[key] = "filter-" .. key end + +local function checkFilterAura(frame, type, isFriendly, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) + local category + if( isFriendly and isRemovable and canCure[auraType] and type == "debuffs" ) then + category = "curable" + elseif( isBossDebuff ) then + category = "boss" + else + return + end + + local applied = false + + for key, config in pairs(ShadowUF.db.profile.auraIndicators.indicators) do + local indicator = frame.auraIndicators[key] + if( indicator and indicator.config.enabled and indicator.filters[category].enabled and not ShadowUF.db.profile.units[frame.unitType].auraIndicators[filterMap[category]] ) then + indicator.showStack = config.showStack + indicator.priority = indicator.filters[category].priority + indicator.showIcon = true + indicator.showDuration = indicator.filters[category].duration + indicator.spellDuration = duration + indicator.spellEnd = endTime + indicator.spellIcon = texture + indicator.spellName = name + indicator.spellStack = count + indicator.colorR = nil + indicator.colorG = nil + indicator.colorB = nil + + applied = true + end + end + + return applied +end + +local function checkSpecificAura(frame, type, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) + -- Not relevant + if( not ShadowUF.db.profile.auraIndicators.auras[name] and not ShadowUF.db.profile.auraIndicators.auras[tostring(spellID)] ) then return end + + local auraConfig = Indicators.auraConfig[name] or Indicators.auraConfig[spellID] + + -- Only player auras + if( auraConfig.player and not playerUnits[caster] ) then return end + + local indicator = auraConfig and frame.auraIndicators[auraConfig.indicator] + -- No indicator or not enabled + if( not indicator or not indicator.enabled ) then return end + -- Missing aura only + if( auraConfig.missing ) then return end + + -- Disabled on a class level + if( ShadowUF.db.profile.auraIndicators.disabled[playerClass][name] ) then return end + -- Disabled aura group by unit + if( ShadowUF.db.profile.units[frame.unitType].auraIndicators[auraConfig.group] ) then return end + + + -- If the indicator is not restricted to the player only, then will give the player a slightly higher priority + local priority = auraConfig.priority + local color = auraConfig + if( not auraConfig.player and playerUnits[caster] ) then + priority = priority + 0.1 + color = auraConfig.selfColor or auraConfig + end + + if( priority <= indicator.priority ) then return end + + indicator.showStack = ShadowUF.db.profile.auraIndicators.indicators[auraConfig.indicator].showStack + indicator.priority = priority + indicator.showIcon = auraConfig.icon + indicator.showDuration = auraConfig.duration + indicator.spellDuration = duration + indicator.spellEnd = endTime + indicator.spellIcon = texture + indicator.spellName = name + indicator.spellStack = count + indicator.colorR = color.r + indicator.colorG = color.g + indicator.colorB = color.b + + return true +end + +local auraList = {} +local function scanAuras(frame, filter, type) + local isFriendly = not UnitIsEnemy(frame.unit, "player") + + local index = 0 + while( true ) do + index = index + 1 + local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff = UnitAura(frame.unit, index, filter) + if( not name ) then return end + + local result = checkFilterAura(frame, type, isFriendly, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) + if( not result ) then + checkSpecificAura(frame, type, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) + end + + auraList[name] = true + end +end + +function Indicators:UpdateIndicators(frame) + for key, indicatorConfig in pairs(ShadowUF.db.profile.auraIndicators.indicators) do + local indicator = frame.auraIndicators[key] + if( indicator and indicator.enabled and indicator.priority > -1 ) then + -- Show a cooldown ring + if( indicator.showDuration and indicator.spellDuration > 0 and indicator.spellEnd > 0 ) then + indicator.cooldown:SetCooldown(indicator.spellEnd - indicator.spellDuration, indicator.spellDuration) + else + indicator.cooldown:Hide() + end + + -- Show either the icon, or a solid color + if( indicator.showIcon and indicator.spellIcon ) then + indicator.texture:SetTexture(indicator.spellIcon) + indicator:SetBackdropColor(0, 0, 0, 0) + else + indicator.texture:SetTexture(indicator.colorR, indicator.colorG, indicator.colorB) + indicator:SetBackdropColor(0, 0, 0, 1) + end + + -- Show aura stack + if( indicator.showStack and indicator.spellStack > 1 ) then + indicator.stack:SetText(indicator.spellStack) + indicator.stack:Show() + else + indicator.stack:Hide() + end + + indicator:Show() + else + indicator:Hide() + end + end +end + +function Indicators:UpdateAuras(frame) + for k in pairs(auraList) do auraList[k] = nil end + for key, config in pairs(ShadowUF.db.profile.auraIndicators.indicators) do + local indicator = frame.auraIndicators[key] + if( indicator ) then + indicator.priority = -1 + + if( UnitIsEnemy(frame.unit, "player") ) then + indicator.enabled = config.hostile + else + indicator.enabled = config.friendly + end + end + end + + -- If they are dead, don't bother showing any indicators yet + if( UnitIsDeadOrGhost(frame.unit) or not UnitIsConnected(frame.unit) ) then + self:UpdateIndicators(frame) + return + end + + -- Scan auras + scanAuras(frame, "HELPFUL", "buffs") + scanAuras(frame, "HARMFUL", "debuffs") + + -- Check for any indicators that are triggered due to something missing + for name in pairs(ShadowUF.db.profile.auraIndicators.missing) do + if( not auraList[name] ) then + local aura = self.auraConfig[name] + local indicator = frame.auraIndicators[aura.indicator] + if( indicator and indicator.enabled and aura.priority > indicator.priority and not ShadowUF.db.profile.auraIndicators.disabled[playerClass][name] ) then + indicator.priority = aura.priority + indicator.showIcon = aura.icon + indicator.showDuration = aura.duration + indicator.spellDuration = 0 + indicator.spellEnd = 0 + indicator.spellIcon = aura.iconTexture or select(3, GetSpellInfo(name)) + indicator.colorR = aura.r + indicator.colorG = aura.g + indicator.colorB = aura.b + end + end + end + + -- Now force the indicators to update + self:UpdateIndicators(frame) +end \ No newline at end of file diff --git a/modules/auras.lua b/modules/auras.lua index c2741697..68179444 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -515,7 +515,7 @@ local function categorizeAura(type, curable, auraType, caster, isRemovable, shou end end -local function renderAura(parent, frame, type, config, displayConfig, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) +local function renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) -- Do our initial list check to see if we can quick filter it out if( parent.whitelist[type] and not parent.whitelist[name] and not parent.whitelist[spellID] ) then return end if( parent.blacklist[type] and not parent.blacklist[name] and not parent.blacklist[spellID] ) then return end @@ -588,7 +588,7 @@ local function scan(parent, frame, type, config, displayConfig, filter) local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff = UnitAura(frame.parent.unit, index, filter) if( not name ) then break end - renderAura(parent, frame, type, config, displayConfig, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) + renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) -- Too many auras shown, break out -- Get down diff --git a/options/config.lua b/options/config.lua index 6b37d575..b3009f11 100755 --- a/options/config.lua +++ b/options/config.lua @@ -6191,6 +6191,1118 @@ local function loadVisibilityOptions() } end +--------------------- +-- AURA INDICATORS OPTIONS +--------------------- +local function loadAuraIndicatorsOptions() + local Indicators = ShadowUF.modules.auraIndicators + local auraFilters = Indicators.auraFilters + + local groupList = {} + local function getAuraGroup(info) + for k in pairs(groupList) do groupList[k] = nil end + for name in pairs(ShadowUF.db.profile.auraIndicators.auras) do + local aura = Indicators.auraConfig[name] + groupList[aura.group] = aura.group + end + + return groupList + end + + local auraList = {} + local function getAuraList(info) + for k in pairs(auraList) do auraList[k] = nil end + for name in pairs(ShadowUF.db.profile.auraIndicators.auras) do + if( tonumber(name) ) then + spellID = name + name = GetSpellInfo(name) or L["Unknown"] + auraList[name] = string.format("%s (#%i)", name, spellID) + else + auraList[name] = name + end + end + + return auraList + end + + local indicatorList = {} + local function getIndicatorList(info) + for k in pairs(indicatorList) do indicatorList[k] = nil end + indicatorList[""] = L["None (Disabled)"] + for key, indicator in pairs(ShadowUF.db.profile.auraIndicators.indicators) do + indicatorList[key] = indicator.name + end + + return indicatorList + end + + local function writeTable(tbl) + local data = "" + + for key, value in pairs(tbl) do + local valueType = type(value) + + -- Wrap the key in brackets if it's a number + if( type(key) == "number" ) then + key = string.format("[%s]", key) + -- Wrap the string with quotes if it has a space in it + elseif( string.match(key, " ") ) then + key = string.format("[\"%s\"]", key) + end + + -- foo = {bar = 5} + if( valueType == "table" ) then + data = string.format("%s%s=%s;", data, key, writeTable(value)) + -- foo = true / foo = 5 + elseif( valueType == "number" or valueType == "boolean" ) then + data = string.format("%s%s=%s;", data, key, tostring(value)) + -- foo = "bar" + else + data = string.format("%s%s=%q;", data, key, tostring(value)) + end + end + + return "{" .. data .. "}" + end + + local function writeAuraTable(name) + ShadowUF.db.profile.auraIndicators.auras[name] = writeTable(Indicators.auraConfig[name]) + end + + local groupMap, auraMap, linkMap = {}, {}, {} + local groupID, auraID, linkID = 0, 0, 0 + + -- Actual aura configuration + local auraGroupTable = { + order = 1, + type = "group", + name = function(info) return groupMap[info[#(info)]] end, + desc = function(info) + local group = groupMap[info[#(info)]] + local totalInGroup = 0 + for _, aura in pairs(Indicators.auraConfig) do + if( type(aura) == "table" and aura.group == group ) then + totalInGroup = totalInGroup + 1 + end + end + + return string.format(L["%d auras in group"], totalInGroup) + end, + args = {}, + } + + local auraConfigTable = { + order = 0, + type = "group", + inline = true, + icon = function(info) + local aura = auraMap[info[#(info)]] + return tonumber(aura) and (select(3, GetSpellInfo(aura))) or nil + end, + name = function(info) + local aura = auraMap[info[#(info)]] + return tonumber(aura) and string.format("%s (#%i)", GetSpellInfo(aura) or "Unknown", aura) or aura + end, + hidden = function(info) + local group = groupMap[info[#(info) - 1]] + local aura = Indicators.auraConfig[auraMap[info[#(info)]]] + return aura.group ~= group + end, + set = function(info, value, g, b, a) + local aura = auraMap[info[#(info) - 1]] + local key = info[#(info)] + + -- So I don't have to load every aura to see if it only triggers if it's missing + if( key == "missing" ) then + ShadowUF.db.profile.auraIndicators.missing[aura] = value and true or nil + -- Changing the color + elseif( key == "color" ) then + Indicators.auraConfig[aura].r = value + Indicators.auraConfig[aura].g = g + Indicators.auraConfig[aura].b = b + Indicators.auraConfig[aura].alpha = a + + writeAuraTable(aura) + ShadowUF.Layout:Reload() + return + elseif( key == "selfColor" ) then + Indicators.auraConfig[aura].selfColor = Indicators.auraConfig[aura].selfColor or {} + Indicators.auraConfig[aura].selfColor.r = value + Indicators.auraConfig[aura].selfColor.g = g + Indicators.auraConfig[aura].selfColor.b = b + Indicators.auraConfig[aura].selfColor.alpha = a + + writeAuraTable(aura) + ShadowUF.Layout:Reload() + return + end + + Indicators.auraConfig[aura][key] = value + writeAuraTable(aura) + ShadowUF.Layout:Reload() + end, + get = function(info) + local aura = auraMap[info[#(info) - 1]] + local key = info[#(info)] + local config = Indicators.auraConfig[aura] + if( key == "color" ) then + return config.r, config.g, config.b, config.alpha + elseif( key == "selfColor" ) then + if( not config.selfColor ) then return 0, 0, 0, 1 end + return config.selfColor.r, config.selfColor.g, config.selfColor.b, config.selfColor.alpha + end + + return config[key] + end, + args = { + indicator = { + order = 1, + type = "select", + name = L["Show inside"], + desc = L["Indicator this aura should be displayed in."], + values = getIndicatorList, + hidden = false, + }, + priority = { + order = 2, + type = "range", + name = L["Priority"], + desc = L["If multiple auras are shown in the same indicator, the higher priority one is shown first."], + min = 0, max = 100, step = 1, + hidden = false, + }, + sep1 = { + order = 3, + type = "description", + name = "", + width = "full", + hidden = false, + }, + color = { + order = 4, + type = "color", + name = L["Indicator color"], + desc = L["Solid color to use in the indicator, only used if you do not have use aura icon enabled."], + disabled = function(info) return Indicators.auraConfig[auraMap[info[#(info) - 1]]].icon end, + hidden = false, + hasAlpha = true, + }, + selfColor = { + order = 4.5, + type = "color", + name = L["Your aura color"], + desc = L["This color will be used if the indicator shown is your own, only applies if icons are not used.\nHandy if you want to know if a target has a Rejuvenation on them, but you also want to know if you were the one who casted the Rejuvenation."], + hidden = false, + disabled = function(info) + if( Indicators.auraConfig[auraMap[info[#(info) - 1]]].icon ) then return true end + return Indicators.auraConfig[auraMap[info[#(info) - 1]]].player + end, + hasAlpha = true, + }, + sep2 = { + order = 5, + type = "description", + name = "", + width = "full", + hidden = false, + }, + icon = { + order = 6, + type = "toggle", + name = L["Show aura icon"], + desc = L["Instead of showing a solid color inside the indicator, the icon of the aura will be shown."], + hidden = false, + }, + duration = { + order = 7, + type = "toggle", + name = L["Show aura duration"], + desc = L["Shows a cooldown wheel on the indicator with how much time is left on the aura."], + hidden = false, + }, + player = { + order = 8, + type = "toggle", + name = L["Only show self cast auras"], + desc = L["Only auras you specifically cast will be shown."], + hidden = false, + }, + missing = { + order = 9, + type = "toggle", + name = L["Only show if missing"], + desc = L["Only active this aura inside an indicator if the group member does not have the aura."], + hidden = false, + }, + delete = { + order = 10, + type = "execute", + name = L["Delete"], + hidden = false, + confirm = true, + confirmText = L["Are you sure you want to delete this aura?"], + func = function(info) + local key = info[#(info) - 1] + local aura = auraMap[key] + + auraGroupTable.args[key] = nil + ShadowUF.db.profile.auraIndicators.auras[aura] = nil + ShadowUF.db.profile.auraIndicators.missing[aura] = nil + Indicators.auraConfig[aura] = nil + + -- Check if the group should disappear + local groupList = getAuraGroup(info) + for groupID, name in pairs(groupMap) do + if( not groupList[name] ) then + unitTable.args[tostring(groupID)] = nil + options.args.auraIndicators.args.auras.args[tostring(groupID)] = nil + groupMap[groupID] = nil + end + end + + ShadowUF.Layout:Reload() + end, + }, + }, + } + + local auraFilterConfigTable = { + order = 0, + type = "group", + hidden = false, + name = function(info) + return ShadowUF.db.profile.auraIndicators.indicators[info[#(info)]].name + end, + set = function(info, value) + local key = info[#(info)] + local indicator = info[#(info) - 2] + local filter = info[#(info) - 1] + ShadowUF.db.profile.auraIndicators.filters[indicator][filter][key] = value + ShadowUF.Layout:Reload() + end, + get = function(info) + local key = info[#(info)] + local indicator = info[#(info) - 2] + local filter = info[#(info) - 1] + if( not ShadowUF.db.profile.auraIndicators.filters[indicator][filter] ) then + ShadowUF.db.profile.auraIndicators.filters[indicator][filter] = {} + end + + return ShadowUF.db.profile.auraIndicators.filters[indicator][filter][key] + end, + args = { + help = { + order = 0, + type = "group", + name = L["Help"], + inline = true, + args = { + help = { + type = "description", + name = L["Auras matching a criteria will automatically show up in the indicator when enabled."] + } + } + }, + boss = { + order = 1, + type = "group", + name = L["Boss Auras"], + inline = true, + args = { + enabled = { + order = 1, + type = "toggle", + name = L["Show boss debuffs"], + desc = L["Shows debuffs cast by a boss."], + width = "full" + }, + duration = { + order = 2, + type = "toggle", + name = L["Show aura duration"], + desc = L["Shows a cooldown wheel on the indicator with how much time is left on the aura."], + width = "full" + }, + priority = { + order = 3, + type = "range", + name = L["Priority"], + desc = L["If multiple auras are shown in the same indicator, the higher priority one is shown first."], + min = 0, max = 100, step = 1 + } + } + }, + curable = { + order = 2, + type = "group", + name = L["Curable Auras"], + inline = true, + args = { + enabled = { + order = 1, + type = "toggle", + name = L["Show curable debuffs"], + desc = L["Shows debuffs that you can cure."], + width = "full" + }, + duration = { + order = 2, + type = "toggle", + name = L["Show aura duration"], + desc = L["Shows a cooldown wheel on the indicator with how much time is left on the aura."], + width = "full" + }, + priority = { + order = 3, + type = "range", + name = L["Priority"], + desc = L["If multiple auras are shown in the same indicator, the higher priority one is shown first."], + min = 0, max = 100, step = 1 + } + } + } + } + } + + local indicatorTable = { + order = 1, + type = "group", + name = function(info) return ShadowUF.db.profile.auraIndicators.indicators[info[#(info)]].name end, + args = { + config = { + order = 0, + type = "group", + inline = true, + name = function(info) return ShadowUF.db.profile.auraIndicators.indicators[info[#(info) - 1]].name end, + set = function(info, value) + local indicator = info[#(info) - 2] + local key = info[#(info)] + + ShadowUF.db.profile.auraIndicators.indicators[indicator][key] = value + ShadowUF.Layout:Reload() + end, + get = function(info) + local indicator = info[#(info) - 2] + local key = info[#(info)] + return ShadowUF.db.profile.auraIndicators.indicators[indicator][key] + end, + args = { + showStack = { + order = 1, + type = "toggle", + name = L["Show auras stack"], + desc = L["Any auras shown in this indicator will have their total stack displayed."], + width = "full", + }, + friendly = { + order = 2, + type = "toggle", + name = L["Enable for friendlies"], + desc = L["Checking this will show the indicator on friendly units."], + }, + hostile = { + order = 3, + type = "toggle", + name = L["Enable for hostiles"], + desc = L["Checking this will show the indciator on hostile units."], + }, + anchorPoint = { + order = 4, + type = "select", + name = L["Anchor point"], + values = {["BRI"] = L["Inside Bottom Right"], ["BLI"] = L["Inside Bottom Left"], ["TRI"] = L["Inside Top Right"], ["TLI"] = L["Inside Top Left"], ["CLI"] = L["Inside Center Left"], ["C"] = L["Center"], ["CRI"] = L["Inside Center Right"]}, + }, + size = { + order = 5, + name = L["Size"], + type = "range", + min = 0, max = 50, step = 1, + set = function(info, value) + local indicator = info[#(info) - 2] + ShadowUF.db.profile.auraIndicators.indicators[indicator].height = value + ShadowUF.db.profile.auraIndicators.indicators[indicator].width = value + ShadowUF.Layout:Reload() + end, + get = function(info) + local indicator = info[#(info) - 2] + return ShadowUF.db.profile.auraIndicators.indicators[indicator].height + end, + }, + x = { + order = 6, + type = "range", + name = L["X Offset"], + min = -50, max = 50, step = 1, + }, + y = { + order = 7, + type = "range", + name = L["Y Offset"], + min = -50, max = 50, step = 1, + }, + delete = { + order = 8, + type = "execute", + name = L["Delete"], + confirm = true, + confirmText = L["Are you sure you want to delete this indicator?"], + func = function(info) + local indicator = info[#(info) - 2] + + options.args.auraIndicators.args.indicators.args[indicator] = nil + options.args.auraIndicators.args.auras.args.filters.args[indicator] = nil + + ShadowUF.db.profile.auraIndicators.indicators[indicator] = nil + ShadowUF.db.profile.auraIndicators.filters[indicator] = nil + + -- Any aura that was set to us should be swapped back to none + for name in pairs(ShadowUF.db.profile.auraIndicators.auras) do + local aura = Indicators.auraConfig[name] + if( aura.indicator == indicator ) then + aura.indicator = "" + writeAuraTable(name) + end + end + + ShadowUF.Layout:Reload() + end, + }, + }, + }, + }, + } + + local parentLinkTable = { + order = 3, + type = "group", + icon = function(info) + local aura = auraMap[info[#(info)]] + return tonumber(aura) and (select(3, GetSpellInfo(aura))) or nil + end, + name = function(info) + local aura = linkMap[info[#(info)]] + return tonumber(aura) and string.format("%s (#%i)", GetSpellInfo(aura) or "Unknown", aura) or aura + end, + args = {}, + } + + local childLinkTable = { + order = 1, + icon = function(info) + local aura = auraMap[info[#(info)]] + return tonumber(aura) and (select(3, GetSpellInfo(aura))) or nil + end, + name = function(info) + local aura = linkMap[info[#(info)]] + return tonumber(aura) and string.format("%s (#%i)", GetSpellInfo(aura) or "Unknown", aura) or aura + end, + hidden = function(info) + local aura = linkMap[info[#(info)]] + local parent = linkMap[info[#(info) - 1]] + + return ShadowUF.db.profile.auraIndicators.linked[aura] ~= parent + end, + type = "group", + inline = true, + args = { + delete = { + type = "execute", + name = L["Delete link"], + hidden = false, + func = function(info) + local auraID = info[#(info) - 1] + local aura = linkMap[auraID] + local parent = ShadowUF.db.profile.auraIndicators.linked[aura] + ShadowUF.db.profile.auraIndicators.linked[aura] = nil + parentLinkTable.args[auraID] = nil + + local found + for _, to in pairs(ShadowUF.db.profile.auraIndicators.linked) do + if( to == parent ) then + found = true + break + end + end + + if( not found ) then + for id, name in pairs(linkMap) do + if( name == parent ) then + options.args.auraIndicators.args.linked.args[tostring(id)] = nil + linkMap[id] = nil + end + end + end + + ShadowUF.Layout:Reload() + end, + }, + }, + } + + local addAura, addLink, setGlobalUnits, globalConfig = {}, {}, {}, {} + + -- Per unit enabled status + local unitTable = { + order = ShadowUF.Config.getUnitOrder or 1, + type = "group", + name = function(info) return L.units[info[3]] end, + hidden = function(info) return not ShadowUF.db.profile.units[info[3]].enabled end, + desc = function(info) + local totalDisabled = 0 + for key, enabled in pairs(ShadowUF.db.profile.units[info[3]].auraIndicators) do + if( key ~= "enabled" and enabled ) then + totalDisabled = totalDisabled + 1 + end + end + + if( totalDisabled == 1 ) then return L["1 aura group disabled"] end + return totalDisabled > 0 and string.format(L["%s aura groups disabled"], totalDisabled) or L["All aura groups enabled for unit."] + end, + args = { + enabled = { + order = 1, + inline = true, + type = "group", + name = function(info) return string.format(L["On %s units"], L.units[info[3]]) end, + args = { + enabled = { + order = 1, + type = "toggle", + name = L["Enable Indicators"], + desc = function(info) return string.format(L["Unchecking this will completely disable aura indicators for %s."], L.units[info[3]]) end, + set = function(info, value) ShadowUF.db.profile.units[info[3]].auraIndicators.enabled = value; ShadowUF.Layout:Reload() end, + get = function(info) return ShadowUF.db.profile.units[info[3]].auraIndicators.enabled end, + }, + }, + }, + filters = { + order = 2, + inline = true, + type = "group", + name = L["Aura Filters"], + disabled = function(info) return not ShadowUF.db.profile.units[info[3]].auraIndicators.enabled end, + args = {}, + }, + groups = { + order = 3, + inline = true, + type = "group", + name = L["Aura Groups"], + disabled = function(info) return not ShadowUF.db.profile.units[info[3]].auraIndicators.enabled end, + args = {}, + }, + } + } + + local unitFilterTable = { + order = 1, + type = "toggle", + name = function(info) return info[#(info)] == "boss" and L["Boss Auras"] or L["Curable Auras"] end, + desc = function(info) + local auraIndicators = ShadowUF.db.profile.units[info[3]].auraIndicators + return auraIndicators["filter-" .. info[#(info)]] and string.format(L["Disabled for %s."], L.units[info[3]]) or string.format(L["Enabled for %s."], L.units[info[3]]) + end, + set = function(info, value) ShadowUF.db.profile.units[info[3]].auraIndicators["filter-" .. info[#(info)]] = not value and true or nil end, + get = function(info, value) return not ShadowUF.db.profile.units[info[3]].auraIndicators["filter-" .. info[#(info)]] end + } + + local globalUnitFilterTable = { + order = 1, + type = "toggle", + name = function(info) return info[#(info)] == "boss" and L["Boss Auras"] or L["Curable Auras"] end, + disabled = function(info) for unit in pairs(setGlobalUnits) do return false end return true end, + set = function(info, value) + local key = "filter-" .. info[#(info)] + globalConfig[key] = not value and true or nil + + for unit in pairs(setGlobalUnits) do + ShadowUF.db.profile.units[unit].auraIndicators[key] = globalConfig[key] + end + end, + get = function(info, value) return not globalConfig["filter-" .. info[#(info)]] end + } + + local unitGroupTable = { + order = 1, + type = "toggle", + name = function(info) return groupMap[info[#(info)]] end, + desc = function(info) + local auraIndicators = ShadowUF.db.profile.units[info[3]].auraIndicators + local group = groupMap[info[#(info)]] + + return auraIndicators[group] and string.format(L["Disabled for %s."], L.units[info[3]]) or string.format(L["Enabled for %s."], L.units[info[3]]) + end, + set = function(info, value) ShadowUF.db.profile.units[info[3]].auraIndicators[groupMap[info[#(info)]]] = not value and true or nil end, + get = function(info, value) return not ShadowUF.db.profile.units[info[3]].auraIndicators[groupMap[info[#(info)]]] end + } + + local globalUnitGroupTable = { + order = 1, + type = "toggle", + name = function(info) return groupMap[info[#(info)]] end, + disabled = function(info) for unit in pairs(setGlobalUnits) do return false end return true end, + set = function(info, value) + local auraGroup = groupMap[info[#(info)]] + globalConfig[auraGroup] = not value and true or nil + + for unit in pairs(setGlobalUnits) do + ShadowUF.db.profile.units[unit].auraIndicators[auraGroup] = globalConfig[auraGroup] + end + end, + get = function(info, value) return not globalConfig[groupMap[info[#(info)]]] end + } + + local enabledUnits = {} + local function getEnabledUnits() + table.wipe(enabledUnits) + for unit, config in pairs(ShadowUF.db.profile.units) do + if( config.enabled and config.auraIndicators.enabled ) then + enabledUnits[unit] = L.units[unit] + end + end + + return enabledUnits + end + + -- Actual tab view thing + options.args.auraIndicators = { + order = 4.5, + type = "group", + name = L["Aura Indicators"], + desc = L["For configuring aura indicators on unit frames."], + childGroups = "tab", + hidden = false, + args = { + indicators = { + order = 1, + type = "group", + name = L["Indicators"], + childGroups = "tree", + args = { + add = { + order = 0, + type = "group", + name = L["Add Indicator"], + args = { + add = { + order = 0, + type = "group", + inline = true, + name = L["Add new indicator"], + args = { + name = { + order = 0, + type = "input", + name = L["Indicator name"], + width = "full", + set = function(info, value) + local id = string.format("%d", GetTime() + math.random(100)) + ShadowUF.db.profile.auraIndicators.indicators[id] = {enabled = true, friendly = true, hostile = true, name = value, anchorPoint = "C", anchorTo = "$parent", height = 10, width = 10, alpha = 1.0, x = 0, y = 0} + ShadowUF.db.profile.auraIndicators.filters[id] = {boss = {}, curable = {}} + + options.args.auraIndicators.args.indicators.args[id] = indicatorTable + options.args.auraIndicators.args.auras.args.filters.args[id] = auraFilterConfigTable + + AceDialog.Status.ShadowedUF.children.auraIndicators.children.indicators.status.groups.selected = id + AceRegistry:NotifyChange("ShadowedUF") + end, + get = function() return "" end, + }, + }, + }, + }, + }, + }, + }, + auras = { + order = 2, + type = "group", + name = L["Auras"], + args = { + add = { + order = 0, + type = "group", + name = L["Add Aura"], + set = function(info, value) addAura[info[#(info)]] = value end, + get = function(info) return addAura[info[#(info)]] end, + args = { + add = { + order = 0, + inline = true, + type = "group", + name = L["Add Aura"], + args = { + name = { + order = 0, + type = "input", + name = L["Spell Name/ID"], + desc = L["If name is entered, it must be exact as it is case sensitive. Alternatively, you can use spell id instead."], + width = "full", + }, + group = { + order = 1, + type = "select", + name = L["Aura group"], + desc = L["What group this aura belongs to, this is where you will find it when configuring."], + values = getAuraGroup, + }, + custom = { + order = 2, + type = "input", + name = L["New aura group"], + desc = L["Allows you to enter a new aura group."], + }, + create = { + order = 3, + type = "execute", + name = L["Add aura"], + disabled = function(info) return not addAura.name or (not addAura.group and not addAura.custom) end, + func = function(info) + addAura.custom = string.trim(addAura.custom or "") + addAura.custom = addAura.custom ~= "" and addAura.custom or nil + if( addAura.group and string.trim(addAura.group) == "" ) then + addAura.group = L["Miscellaneous"] + end + + local group = addAura.custom or addAura.group + + -- Don't overwrite an existing group, but don't tell them either, mostly because I don't want to add error reporting code + if( not ShadowUF.db.profile.auraIndicators.auras[addAura.name] ) then + -- Odds are, if they are saying to show it only if a buff is missing it's cause they want to know when their own class buff is not there + -- so will cheat it, and jump start it by storing the texture if we find it from GetSpellInfo directly + Indicators.auraConfig[addAura.name] = {indicator = "", group = group, iconTexture = select(3, GetSpellInfo(addAura.name)), priority = 0, r = 0, g = 0, b = 0} + ShadowUF.db.profile.auraIndicators.auras[addAura.name] = "{}" + + auraID = auraID + 1 + auraMap[tostring(auraID)] = addAura.name + auraGroupTable.args[tostring(auraID)] = auraConfigTable + end + + addAura.name = nil + addAura.custom = nil + addAura.group = nil + + -- Check if the group exists + local gID + for id, name in pairs(groupMap) do + if( name == group ) then + gID = id + break + end + end + + if( not gID ) then + groupID = groupID + 1 + groupMap[tostring(groupID)] = group + + unitTable.args.groups.args[tostring(groupID)] = unitGroupTable + options.args.auraIndicators.args.units.args.global.args.groups.args[tostring(groupID)] = globalUnitGroupTable + options.args.auraIndicators.args.auras.args[tostring(groupID)] = auraGroupTable + end + + -- Shunt the user to the this groups page + AceDialog.Status.ShadowedUF.children.auraIndicators.children.auras.status.groups.selected = tostring(gID or groupID) + AceRegistry:NotifyChange("ShadowedUF") + + ShadowUF.Layout:Reload() + end, + }, + }, + }, + }, + }, + filters = { + order = 1, + type = "group", + name = L["Automatic Auras"], + args = {} + }, + groups = { + order = 2, + type = "group", + name = L["Groups"], + args = {} + }, + }, + }, + --[[ + linked = { + order = 3, + type = "group", + name = L["Linked spells"], + childGroups = "tree", + args = { + help = { + order = 0, + type = "group", + name = L["Help"], + inline = true, + args = { + help = { + order = 0, + type = "description", + name = L["You can link auras together using this, for example you can link Mark of the Wild to Gift of the Wild so if the player has Mark of the Wild but not Gift of the Wild, it will still show Mark of the Wild as if they had Gift of the Wild."], + width = "full", + }, + }, + }, + add = { + order = 1, + type = "group", + name = L["Add link"], + inline = true, + set = function(info, value) + addLink[info[#(info)] ] = value + end, + get = function(info) return addLink[info[#(info)] ] end, + args = { + from = { + order = 0, + type = "input", + name = L["Link from"], + desc = L["Spell you want to link to a primary aura, the casing must be exact."], + }, + to = { + order = 1, + type = "select", + name = L["Link to"], + values = getAuraList, + }, + link = { + order = 3, + type = "execute", + name = L["Link"], + disabled = function() return not addLink.from or not addLink.to or addLink.from == "" end, + func = function(info) + local lID, pID + for id, name in pairs(linkMap) do + if( name == addLink.from ) then + lID = id + elseif( name == addLink.to ) then + pID = id + end + end + + if( not pID ) then + linkID = linkID + 1 + pID = linkID + linkMap[tostring(linkID)] = addLink.to + end + + if( not lID ) then + linkID = linkID + 1 + lID = linkID + linkMap[tostring(linkID)] = addLink.from + end + + ShadowUF.db.profile.auraIndicators.linked[addLink.from] = addLink.to + options.args.auraIndicators.args.linked.args[tostring(pID)] = parentLinkTable + parentLinkTable.args[tostring(lID)] = childLinkTable + + addLink.from = nil + addLink.to = nil + + ShadowUF.Layout:Reload() + end, + }, + }, + }, + }, + }, + ]] + units = { + order = 4, + type = "group", + name = L["Enable Indicators"], + args = { + help = { + order = 0, + type = "group", + name = L["Help"], + inline = true, + args = { + help = { + order = 0, + type = "description", + name = L["You can disable aura filters and groups for units here. For example, you could set an aura group that shows DPS debuffs to only show on the target."], + width = "full", + }, + }, + }, + global = { + order = 0, + type = "group", + name = L["Global"], + desc = L["Global configurating will let you mass enable or disable aura groups for multiple units at once."], + args = { + units = { + order = 0, + type = "multiselect", + name = L["Units to change"], + desc = L["Units that should have the aura groups settings changed below."], + values = getEnabledUnits, + set = function(info, unit, enabled) setGlobalUnits[unit] = enabled or nil end, + get = function(info, unit) return setGlobalUnits[unit] end, + }, + filters = { + order = 1, + type = "group", + inline = true, + name = L["Aura filters"], + args = {} + }, + groups = { + order = 2, + type = "group", + inline = true, + name = L["Aura groups"], + args = {} + }, + }, + }, + }, + }, + classes = { + order = 5, + type = "group", + name = L["Disable Auras by Class"], + childGroups = "tree", + args = { + help = { + order = 0, + type = "group", + name = L["Help"], + inline = true, + args = { + help = { + order = 0, + type = "description", + name = L["You can override what aura is enabled on a per-class basis, note that if the aura is disabled through the main listing, then your class settings here will not matter."], + width = "full", + }, + }, + } + }, + }, + }, + } + + local classTable = { + order = 1, + type = "group", + name = function(info) return LOCALIZED_CLASS_NAMES_MALE[info[#(info)]] end, + args = {}, + } + + local classAuraTable = { + order = 1, + type = "toggle", + icon = function(info) + local aura = auraMap[info[#(info)]] + return tonumber(aura) and (select(3, GetSpellInfo(aura))) or nil + end, + name = function(info) + local aura = auraMap[info[#(info)]] + return tonumber(aura) and string.format("%s (#%i)", GetSpellInfo(aura) or "Unknown", aura) or aura + end, + set = function(info, value) + local aura = auraMap[info[#(info)]] + local class = info[#(info) - 1] + value = not value + + if( value == false ) then value = nil end + ShadowUF.db.profile.auraIndicators.disabled[class][aura] = value + ShadowUF.Layout:Reload() + end, + get = function(info) + local aura = auraMap[info[#(info)]] + local class = info[#(info) - 1] + + return not ShadowUF.db.profile.auraIndicators.disabled[class][aura] + end, + } + + -- Build links + local addedFrom = {} + for from, to in pairs(ShadowUF.db.profile.auraIndicators.linked) do + local pID = addedFrom[to] + if( not pID ) then + linkID = linkID + 1 + pID = linkID + + addedFrom[to] = pID + end + + linkID = linkID + 1 + + ShadowUF.db.profile.auraIndicators.linked[from] = to + options.args.auraIndicators.args.linked.args[tostring(pID)] = parentLinkTable + parentLinkTable.args[tostring(linkID)] = childLinkTable + + linkMap[tostring(linkID)] = from + linkMap[tostring(pID)] = to + end + + -- Build the aura configuration + local groups = {} + for name in pairs(ShadowUF.db.profile.auraIndicators.auras) do + local aura = Indicators.auraConfig[name] + if( aura.group ) then + auraMap[tostring(auraID)] = name + auraGroupTable.args[tostring(auraID)] = auraConfigTable + classTable.args[tostring(auraID)] = classAuraTable + auraID = auraID + 1 + + groups[aura.group] = true + end + end + + -- Now create all of the parent stuff + for group in pairs(groups) do + groupMap[tostring(groupID)] = group + unitTable.args.groups.args[tostring(groupID)] = unitGroupTable + + options.args.auraIndicators.args.units.args.global.args.groups.args[tostring(groupID)] = globalUnitGroupTable + options.args.auraIndicators.args.auras.args.groups.args[tostring(groupID)] = auraGroupTable + + groupID = groupID + 1 + end + + for _, type in pairs(auraFilters) do + unitTable.args.filters.args[type] = unitFilterTable + options.args.auraIndicators.args.units.args.global.args.filters.args[type] = globalUnitFilterTable + end + + -- Aura status by unit + for unit, config in pairs(ShadowUF.db.profile.units) do + options.args.auraIndicators.args.units.args[unit] = unitTable + end + + -- Build class status thing + for classToken in pairs(RAID_CLASS_COLORS) do + options.args.auraIndicators.args.classes.args[classToken] = classTable + end + + -- Quickly build the indicator one + for key in pairs(ShadowUF.db.profile.auraIndicators.indicators) do + options.args.auraIndicators.args.indicators.args[key] = indicatorTable + options.args.auraIndicators.args.auras.args.filters.args[key] = auraFilterConfigTable + end + + -- Automatically unlock the advanced text configuration for raid frames, regardless of advanced being enabled + local advanceTextTable = ShadowUF.Config.advanceTextTable + local originalHidden = advanceTextTable.args.sep.hidden + local function unlockRaidText(info) + if( info[2] == "raid" ) then return false end + return originalHidden(info) + end + + advanceTextTable.args.anchorPoint.hidden = unlockRaidText + advanceTextTable.args.sep.hidden = unlockRaidText + advanceTextTable.args.x.hidden = unlockRaidText + advanceTextTable.args.y.hidden = unlockRaidText +end + local function loadOptions() options = { type = "group", @@ -6204,16 +7316,18 @@ local function loadOptions() loadTagOptions() loadFilterOptions() loadVisibilityOptions() - + loadAuraIndicatorsOptions() + -- Ordering options.args.general.order = 1 options.args.enableUnits.order = 2 options.args.units.order = 3 options.args.filter.order = 4 + options.args.auraIndicators.order = 4.5 options.args.hideBlizzard.order = 5 options.args.visibility.order = 6 options.args.tags.order = 7 - + -- So modules can access it easier/debug Config.options = options From 44f2c590bb887f36ece8da773295a6658a55326b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 25 May 2014 17:54:02 -0700 Subject: [PATCH 502/794] Fixed resurrection indicators not working --- ShadowedUnitFrames.lua | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 6f765612..ae6a18a6 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 44 +ShadowUF.dbRevision = 45 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -100,6 +100,27 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 44 ) then + ShadowUF:LoadDefaultLayout(true) + + for unit, config in pairs(self.defaults.profile.units) do + if( config.indicators and config.indicators.resurrect ) then + local db = self.db.profile.units[unit] + if( unit == "target" ) then + options = {enabled = true, anchorPoint = "RC", size = 28, x = -39, y = -1, anchorTo = "$parent"} + else + options = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"} + end + + for key, value in pairs(options) do + if( db.indicators.resurrect[key] == nil ) then + db.indicators.resurrect[key] = value + end + end + end + end + end + if( revision <= 43 ) then for key, _ in pairs(self.db.profile.auraIndicators.indicators) do self.db.profile.auraIndicators.height = nil @@ -487,15 +508,15 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units[unit].indicators.class = {enabled = false, size = 19} end end - - -- Want pvp/leader/ML enabled for these units - if( unit == "player" or unit == "party" or unit == "target" or unit == "raid" or unit == "focus" ) then + + if( unit == "player" or unit == "party" or unit == "target" or unit == "raid" or unit == "focus" or unit == "mainassist" or unit == "maintank" ) then self.defaults.profile.units[unit].indicators.leader = {enabled = true, size = 0} self.defaults.profile.units[unit].indicators.masterLoot = {enabled = true, size = 0} self.defaults.profile.units[unit].indicators.pvp = {enabled = true, size = 0} self.defaults.profile.units[unit].indicators.role = {enabled = true, size = 0} self.defaults.profile.units[unit].indicators.status = {enabled = false, size = 19} - + self.defaults.profile.units[unit].indicators.resurrect = {enabled = true} + if( unit ~= "focus" and unit ~= "target" ) then self.defaults.profile.units[unit].indicators.ready = {enabled = true, size = 0} end @@ -507,7 +528,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units[unit].altPowerBar = {enabled = not ShadowUF.fakeUnits[unit]} end - + -- PLAYER self.defaults.profile.units.player.enabled = true self.defaults.profile.units.player.healthBar.predicted = true From a91a6507028ea941cdb66e2683c567cf2e99ef48 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 25 May 2014 18:05:55 -0700 Subject: [PATCH 503/794] Fixed leaked globals --- ShadowedUnitFrames.lua | 8 +++++++- options/config.lua | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index ae6a18a6..304d02e2 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -106,6 +106,8 @@ function ShadowUF:CheckUpgrade() for unit, config in pairs(self.defaults.profile.units) do if( config.indicators and config.indicators.resurrect ) then local db = self.db.profile.units[unit] + + local options if( unit == "target" ) then options = {enabled = true, anchorPoint = "RC", size = 28, x = -39, y = -1, anchorTo = "$parent"} else @@ -684,13 +686,17 @@ function ShadowUF:LoadUnitDefaults() [GetSpellInfo(33763)] = [[{indicator = '', group = "Druid", priority = 10, r = 0.07, g = 1.0, b = 0.01}]], -- Lifebloom [GetSpellInfo(48438)] = [[{indicator = '', group = "Druid", priority = 10, r = 0.51, g = 0.72, b = 0.77}]], -- Wild Growth [GetSpellInfo(1126)] = [[{indicator = '', group = "Druid", priority = 10, r = 1.0, g = 0.33, b = 0.90}]], -- Mark of the Wild + [GetSpellInfo(139)] = [[{indicator = '', group = "Priest", priority = 10, r = 1, g = 0.62, b = 0.88}]], -- Renew [GetSpellInfo(17)] = [[{indicator = '', group = "Priest", priority = 10, r = 0.55, g = 0.69, b = 1.0}]], -- Power Word: Shield [GetSpellInfo(21562)] = [[{indicator = '', group = "Priest", priority = 10, r = 0.58, g = 1.0, b = 0.50}]], -- Power Word: Fortitude + + [GetSpellInfo(20707)] = [[{indicator = '', group = "Warlock", priority = 10, r = 0.42, g = 0.21, b = 0.65}]], -- Soulstone Resurrection, + [GetSpellInfo(974)] = [[{indicator = '', group = "Shaman", priority = 10, r = 0.26, g = 1.0, b = 0.26}]], -- Earth Shield [GetSpellInfo(61295)] = [[{indicator = '', group = "Shaman", priority = 10, r = 0.30, g = 0.24, b = 1.0}]], -- Riptide + [GetSpellInfo(1459)] = [[{indicator = '', group = "Mage", priority = 10, r = 0.10, g = 0.68, b = 0.88}]], -- Arcane Brilliance - [GetSpellInfo(20707)] = [[{indicator = '', group = "Warlock", priority = 10, r = 0.42, g = 0.21, b = 0.65}]], -- Soulstone Resurrection } } diff --git a/options/config.lua b/options/config.lua index b3009f11..477a167c 100755 --- a/options/config.lua +++ b/options/config.lua @@ -6198,6 +6198,8 @@ local function loadAuraIndicatorsOptions() local Indicators = ShadowUF.modules.auraIndicators local auraFilters = Indicators.auraFilters + local unitTable + local groupList = {} local function getAuraGroup(info) for k in pairs(groupList) do groupList[k] = nil end @@ -6214,7 +6216,7 @@ local function loadAuraIndicatorsOptions() for k in pairs(auraList) do auraList[k] = nil end for name in pairs(ShadowUF.db.profile.auraIndicators.auras) do if( tonumber(name) ) then - spellID = name + local spellID = name name = GetSpellInfo(name) or L["Unknown"] auraList[name] = string.format("%s (#%i)", name, spellID) else @@ -6742,7 +6744,7 @@ local function loadAuraIndicatorsOptions() local addAura, addLink, setGlobalUnits, globalConfig = {}, {}, {}, {} -- Per unit enabled status - local unitTable = { + unitTable = { order = ShadowUF.Config.getUnitOrder or 1, type = "group", name = function(info) return L.units[info[3]] end, From 53a99cc19f96b4b799c3048364bbe335ae566a48 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 25 May 2014 18:10:54 -0700 Subject: [PATCH 504/794] Update arena# units on ARENA_OPPONENT_UPDATE --- modules/units.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/units.lua b/modules/units.lua index 7979880d..432041c7 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -534,6 +534,10 @@ OnAttributeChanged = function(self, name, unit) elseif( self.unitType == "arena" or self.unitType == "battleground" ) then self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") + if( self.unitType == "arena" ) then + self:RegisterUnitEvent("ARENA_OPPONENT_UPDATE", Units, "FullUpdate") + end + -- Check for a unit guid to do a full update elseif( self.unitRealType == "raid" ) then self:RegisterNormalEvent("GROUP_ROSTER_UPDATE", Units, "CheckGroupedUnitStatus") From b1fc0043e5703537df87a2e8edfb7098aa0833dc Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 26 May 2014 13:23:58 -0700 Subject: [PATCH 505/794] Event registration typo --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 432041c7..bd1753a8 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -535,7 +535,7 @@ OnAttributeChanged = function(self, name, unit) self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") if( self.unitType == "arena" ) then - self:RegisterUnitEvent("ARENA_OPPONENT_UPDATE", Units, "FullUpdate") + self:RegisterUnitEvent("ARENA_OPPONENT_UPDATE", self, "FullUpdate") end -- Check for a unit guid to do a full update From 6aac13888238bc4bba9be66e050fc8ad72ebd464 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 26 May 2014 13:25:27 -0700 Subject: [PATCH 506/794] Fixed an error if you already had auraIndicators loaded previously --- options/config.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/options/config.lua b/options/config.lua index 477a167c..4622258f 100755 --- a/options/config.lua +++ b/options/config.lua @@ -7027,12 +7027,12 @@ local function loadAuraIndicatorsOptions() }, }, }, - --[[ linked = { order = 3, type = "group", name = L["Linked spells"], childGroups = "tree", + hidden = true, args = { help = { order = 0, @@ -7111,7 +7111,6 @@ local function loadAuraIndicatorsOptions() }, }, }, - ]] units = { order = 4, type = "group", From 4d5b71619d0318c15c78690cbbf54775cf499394 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 28 May 2014 15:56:05 -0700 Subject: [PATCH 507/794] Fixed blacklist for auras not working properly --- modules/auras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index 68179444..5ff22115 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -518,7 +518,7 @@ end local function renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) -- Do our initial list check to see if we can quick filter it out if( parent.whitelist[type] and not parent.whitelist[name] and not parent.whitelist[spellID] ) then return end - if( parent.blacklist[type] and not parent.blacklist[name] and not parent.blacklist[spellID] ) then return end + if( parent.blacklist[type] and ( parent.blacklist[name] or parent.blacklist[spellID] ) ) then return end -- Now do our type filter local category = categorizeAura(type, curable, auraType, caster, isRemovable, shouldConsolidate, canApplyAura, isBossDebuff) From c990c06b7d477b59ae0186356481674a22e96e5a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 30 May 2014 16:47:22 -0700 Subject: [PATCH 508/794] Fixed anchor point aura option being missing --- options/config.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/options/config.lua b/options/config.lua index 4622258f..37b04177 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2061,7 +2061,7 @@ local function loadUnitOptions() name = L["Enable temporary enchants"], desc = L["Adds temporary enchants to the buffs for the player."], width = "full", - hidden = function(info) return info[2] ~= "player" end, + hidden = function(info) return info[2] ~= "player" or info[#(info) - 2] ~= "buffs" end, disabled = function(info) return not getVariable(info[2], "auras", "buffs", "enabled") end, arg = "auras.buffs.temporary", } @@ -2106,8 +2106,7 @@ local function loadUnitOptions() type = "toggle", name = L["Show consolidable auras"], desc = L["Whether to show any auras that would be consolidated by the default UI."], - width = "full", - arg = "auras.$parentparent.show.consolidated" + width = "full" }, misc = { order = 5, @@ -2235,6 +2234,15 @@ local function loadUnitOptions() width = "full", arg = "auras.$parentparent.anchorOn", }, + anchorPoint = { + order = 1.5, + type = "select", + name = L["Position"], + desc = L["How you want this aura to be anchored to the unit frame."], + values = getAuraAnchors, + disabled = disableAnchoredTo, + arg = "auras.$parentparent.anchorPoint", + }, size = { order = 2, type = "range", @@ -2257,7 +2265,7 @@ local function loadUnitOptions() desc = L["How many auras to show in a single row."], min = 1, max = 100, step = 1, softMin = 1, softMax = 50, disabled = disableSameAnchor, - arg = "auras.$parent.perRow", + arg = "auras.$parentparent.perRow", }, maxRows = { order = 14, From f1f968164658e17c61620d4f52cd9c656067c580 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 30 May 2014 16:51:08 -0700 Subject: [PATCH 509/794] Hide the delete button for default aura indicator auras --- options/config.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index 37b04177..37a7175d 100755 --- a/options/config.lua +++ b/options/config.lua @@ -6448,7 +6448,9 @@ local function loadAuraIndicatorsOptions() order = 10, type = "execute", name = L["Delete"], - hidden = false, + hidden = function(info) + return ShadowUF.db.defaults.profile.auraIndicators.auras[auraMap[info[#(info) - 1]]] + end, confirm = true, confirmText = L["Are you sure you want to delete this aura?"], func = function(info) From e7747b5b494ca13be37b4e8c85024a216d2e37b7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 30 May 2014 17:11:56 -0700 Subject: [PATCH 510/794] Toggle the units config open by default --- options/config.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index 37a7175d..ebfdafbf 100755 --- a/options/config.lua +++ b/options/config.lua @@ -7346,6 +7346,7 @@ local function loadOptions() ShadowUF:FireModuleEvent("OnConfigurationLoad") end +local defaultToggles function Config:Open() AceDialog = AceDialog or LibStub("AceConfigDialog-3.0") AceRegistry = AceRegistry or LibStub("AceConfigRegistry-3.0") @@ -7359,4 +7360,11 @@ function Config:Open() end AceDialog:Open("ShadowedUF") -end + + if( not defaultToggles ) then + defaultToggles = true + + AceDialog.Status.ShadowedUF.status.groups.groups.units = true + AceRegistry:NotifyChange("ShadowedUF") + end +end \ No newline at end of file From 7c55f2d1a521f80c0c6964b26bcdf72a79001972 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 7 Jun 2014 16:40:46 -0700 Subject: [PATCH 511/794] Consolidated filters only applies to buffs --- modules/auras.lua | 2 +- options/config.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index 5ff22115..459d03ec 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -508,7 +508,7 @@ local function categorizeAura(type, curable, auraType, caster, isRemovable, shou return "raid" elseif( type == "debuffs" and ( isRemovable or ( curable and canCure[auraType] ) ) ) then return "raid" - elseif( shouldConsolidate ) then + elseif( type == "buffs" and shouldConsolidate ) then return "consolidated" else return "misc" diff --git a/options/config.lua b/options/config.lua index ebfdafbf..31d965b8 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2106,6 +2106,7 @@ local function loadUnitOptions() type = "toggle", name = L["Show consolidable auras"], desc = L["Whether to show any auras that would be consolidated by the default UI."], + hidden = hideBuffOption, width = "full" }, misc = { From ae23121da5d09ae144ea99f56ce37a75c7c3fc46 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Jun 2014 13:00:20 -0700 Subject: [PATCH 512/794] Sort class aura groups ahead of misc groups --- options/config.lua | 53 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/options/config.lua b/options/config.lua index 31d965b8..2b4e440e 100755 --- a/options/config.lua +++ b/options/config.lua @@ -41,6 +41,26 @@ local UNIT_DESC = { ["battlegroundtargettarget"] = L["Current target of target of a battleground unit"] } +local CLASSES = { + ["HUNTER"] = L["Hunter"], + ["WARRIOR"] = L["Warrior"], + ["PALADIN"] = L["Paladin"], + ["MAGE"] = L["Mage"], + ["PRIEST"] = L["Priest"], + ["WARLOCK"] = L["Warlock"], + ["SHAMAN"] = L["Shaman"], + ["DEATHKNIGHT"] = L["Death Knight"], + ["DRUID"] = L["Druid"], + ["MONK"] = L["Monk"], + ["ROGUE"] = L["Rogue"] +} + +-- Just in case they add a class we don't have +for classToken in pairs(RAID_CLASS_COLORS) do + CLASSES[classToken] = CLASSES[classToken] or classToken +end + + local PAGE_DESC = { ["general"] = L["General configuration to all enabled units."], ["enableUnits"] = L["Various units can be enabled through this page, such as raid or party targets."], @@ -6283,9 +6303,16 @@ local function loadAuraIndicatorsOptions() local groupMap, auraMap, linkMap = {}, {}, {} local groupID, auraID, linkID = 0, 0, 0 + local reverseClassMap = {} + for token, text in pairs(CLASSES) do + reverseClassMap[text] = token + end + -- Actual aura configuration local auraGroupTable = { - order = 1, + order = function(info) + return reverseClassMap[groupMap[info[#(info)]]] and 1 or 2 + end, type = "group", name = function(info) return groupMap[info[#(info)]] end, desc = function(info) @@ -6850,8 +6877,10 @@ local function loadAuraIndicatorsOptions() } local globalUnitGroupTable = { - order = 1, type = "toggle", + order = function(info) + return reverseClassMap[groupMap[info[#(info)]]] and 1 or 2 + end, name = function(info) return groupMap[info[#(info)]] end, disabled = function(info) for unit in pairs(setGlobalUnits) do return false end return true end, set = function(info, value) @@ -6971,20 +7000,15 @@ local function loadAuraIndicatorsOptions() name = L["Add aura"], disabled = function(info) return not addAura.name or (not addAura.group and not addAura.custom) end, func = function(info) - addAura.custom = string.trim(addAura.custom or "") - addAura.custom = addAura.custom ~= "" and addAura.custom or nil - if( addAura.group and string.trim(addAura.group) == "" ) then - addAura.group = L["Miscellaneous"] - end - - local group = addAura.custom or addAura.group - + local group = string.trim(addAura.custom or "") + if( group == "" ) then group = string.trim(addAura.group or "") end + if( group == "" ) then group = L["Miscellaneous"] end + -- Don't overwrite an existing group, but don't tell them either, mostly because I don't want to add error reporting code if( not ShadowUF.db.profile.auraIndicators.auras[addAura.name] ) then -- Odds are, if they are saying to show it only if a buff is missing it's cause they want to know when their own class buff is not there -- so will cheat it, and jump start it by storing the texture if we find it from GetSpellInfo directly Indicators.auraConfig[addAura.name] = {indicator = "", group = group, iconTexture = select(3, GetSpellInfo(addAura.name)), priority = 0, r = 0, g = 0, b = 0} - ShadowUF.db.profile.auraIndicators.auras[addAura.name] = "{}" auraID = auraID + 1 auraMap[tostring(auraID)] = addAura.name @@ -7002,7 +7026,7 @@ local function loadAuraIndicatorsOptions() gID = id break end - end + end if( not gID ) then groupID = groupID + 1 @@ -7010,7 +7034,7 @@ local function loadAuraIndicatorsOptions() unitTable.args.groups.args[tostring(groupID)] = unitGroupTable options.args.auraIndicators.args.units.args.global.args.groups.args[tostring(groupID)] = globalUnitGroupTable - options.args.auraIndicators.args.auras.args[tostring(groupID)] = auraGroupTable + options.args.auraIndicators.args.auras.args.groups.args[tostring(groupID)] = auraGroupTable end -- Shunt the user to the this groups page @@ -7271,7 +7295,8 @@ local function loadAuraIndicatorsOptions() -- Now create all of the parent stuff for group in pairs(groups) do - groupMap[tostring(groupID)] = group + local token = CLASSES[string.upper(string.gsub(group, " ", ""))] + groupMap[tostring(groupID)] = token or group unitTable.args.groups.args[tostring(groupID)] = unitGroupTable options.args.auraIndicators.args.units.args.global.args.groups.args[tostring(groupID)] = globalUnitGroupTable From 37f42a9c8b5beb83a7dae86a611daa80e9d6fa9a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Jun 2014 13:00:32 -0700 Subject: [PATCH 513/794] Fixed new auras groups not being save properly --- options/config.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/options/config.lua b/options/config.lua index 2b4e440e..ff637901 100755 --- a/options/config.lua +++ b/options/config.lua @@ -7009,6 +7009,7 @@ local function loadAuraIndicatorsOptions() -- Odds are, if they are saying to show it only if a buff is missing it's cause they want to know when their own class buff is not there -- so will cheat it, and jump start it by storing the texture if we find it from GetSpellInfo directly Indicators.auraConfig[addAura.name] = {indicator = "", group = group, iconTexture = select(3, GetSpellInfo(addAura.name)), priority = 0, r = 0, g = 0, b = 0} + writeAuraTable(addAura.name) auraID = auraID + 1 auraMap[tostring(auraID)] = addAura.name From 5267dd86b5089ebe5f0a9d26d6f52063ec17bd47 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Jun 2014 13:17:42 -0700 Subject: [PATCH 514/794] Redid default aura indicators with configured class auras (Thanks Tonyleila!) --- ShadowedUnitFrames.lua | 60 ++++++++++++++++++++++++++++---------- modules/auraindicators.lua | 7 ++++- 2 files changed, 50 insertions(+), 17 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 304d02e2..ef23de77 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -681,22 +681,50 @@ function ShadowUF:LoadUnitDefaults() ["c"] = {boss = {priority = 100}, curable = {priority = 100}}, }, auras = { - [GetSpellInfo(774)] = [[{indicator = '', group = "Druid", priority = 10, r = 0.66, g = 0.66, b = 1.0}]], -- Rejuvenation - [GetSpellInfo(8936)] = [[{indicator = '', group = "Druid", priority = 10, r = 0.50, g = 1.0, b = 0.63}]], -- Regrowth - [GetSpellInfo(33763)] = [[{indicator = '', group = "Druid", priority = 10, r = 0.07, g = 1.0, b = 0.01}]], -- Lifebloom - [GetSpellInfo(48438)] = [[{indicator = '', group = "Druid", priority = 10, r = 0.51, g = 0.72, b = 0.77}]], -- Wild Growth - [GetSpellInfo(1126)] = [[{indicator = '', group = "Druid", priority = 10, r = 1.0, g = 0.33, b = 0.90}]], -- Mark of the Wild - - [GetSpellInfo(139)] = [[{indicator = '', group = "Priest", priority = 10, r = 1, g = 0.62, b = 0.88}]], -- Renew - [GetSpellInfo(17)] = [[{indicator = '', group = "Priest", priority = 10, r = 0.55, g = 0.69, b = 1.0}]], -- Power Word: Shield - [GetSpellInfo(21562)] = [[{indicator = '', group = "Priest", priority = 10, r = 0.58, g = 1.0, b = 0.50}]], -- Power Word: Fortitude - - [GetSpellInfo(20707)] = [[{indicator = '', group = "Warlock", priority = 10, r = 0.42, g = 0.21, b = 0.65}]], -- Soulstone Resurrection, - - [GetSpellInfo(974)] = [[{indicator = '', group = "Shaman", priority = 10, r = 0.26, g = 1.0, b = 0.26}]], -- Earth Shield - [GetSpellInfo(61295)] = [[{indicator = '', group = "Shaman", priority = 10, r = 0.30, g = 0.24, b = 1.0}]], -- Riptide - - [GetSpellInfo(1459)] = [[{indicator = '', group = "Mage", priority = 10, r = 0.10, g = 0.68, b = 0.88}]], -- Arcane Brilliance + ["20707"] = [[{indicator = '', group = "Warlock", priority = 10, r = 0.42, g = 0.21, b = 0.65}]], + ["1459"] = [[{indicator = '', group = "Mage", priority = 10, r = 0.10, g = 0.68, b = 0.88}]], + ["116849"] = [[{r=0.19607843137255, group="Monk", indicator="c", g=1, player=false, duration=true, b=0.3843137254902, alpha=1, priority=0, icon=true, iconTexture="Interface\\Icons\\ability_monk_chicocoon"}]], + ["1126"] = [[{r=0.47450980392157, group="Druid", indicator="", g=0.2156862745098, player=true, duration=true, missing=true, b=0.81960784313725, priority=0, alpha=1, iconTexture="Interface\\Icons\\Spell_Nature_Regeneration"}]], + ["121176"] = [[{alpha=1, b=0, priority=0, r=0.062745098039216, group="PvP Flags", indicator="bl", g=1, iconTexture="Interface\\Icons\\INV_BannerPVP_03"}]], + ["19705"] = [[{r=0.80392156862745, group="Food", indicator="", g=0.76470588235294, missing=true, duration=true, priority=0, alpha=1, b=0.24313725490196}]], + ["19740"] = [[{r=0.93333333333333, group="Paladin", indicator="", g=0.84705882352941, selfColor={alpha=1, b=0.18823529411765, g=0.89411764705882, r=0.9843137254902, }, player=false, missing=true, duration=true, alpha=1, priority=0, b=0.15294117647059, iconTexture="Interface\\Icons\\Spell_Holy_GreaterBlessingofKings"}]], + ["53563"] = [[{r=0.64313725490196, group="Paladin", indicator="tr", g=0.24705882352941, player=true, alpha=1, b=0.73333333333333, priority=100, duration=false, iconTexture="Interface\\Icons\\Ability_Paladin_BeaconofLight"}]], + ["47753"] = [[{b=0, group="Priest", indicator="br", alpha=1, player=true, duration=true, r=0.8078431372549, priority=0, g=0.76862745098039, iconTexture="Interface\\Icons\\Spell_Holy_DevineAegis"}]], + ["774"] = [[{r=0.57647058823529, group="Druid", indicator="tr", g=0.28235294117647, player=true, duration=true, b=0.6156862745098, priority=100, alpha=1, iconTexture="Interface\\Icons\\Spell_Nature_Rejuvenation"}]], + ["33206"] = [[{r=0, group="Priest", indicator="c", g=0, b=0, duration=true, priority=0, icon=true, iconTexture="Interface\\Icons\\Spell_Holy_PainSupression"}]], + ["974"] = [[{r=1, group="Shaman", indicator="tr", g=0.65882352941176, player=true, alpha=1, priority=10, b=0.27843137254902, iconTexture="Interface\\Icons\\Spell_Nature_SkinofEarth"}]], + ["105284"] = [[{r=0.17647058823529, group="Shaman", indicator="br", g=0.50196078431373, player=true, duration=true, alpha=1, priority=0, b=0.78039215686275, iconTexture="INTERFACE\\ICONS\\spell_shaman_blessingoftheeternals"}]], + ["6788"] = [[{b=0.29019607843137, group="Priest", indicator="tl", alpha=1, player=false, g=0.56862745098039, duration=true, r=0.83921568627451, priority=20, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_AshesToAshes"}]], + ["33763"] = [[{r=0.23137254901961, group="Druid", indicator="tl", g=1, player=true, duration=true, alpha=1, priority=0, b=0.2, iconTexture="Interface\\Icons\\INV_Misc_Herb_Felblossom"}]], + ["61316"] = [[{alpha=1, b=1, priority=0, r=0, group="Mage", indicator="", g=0.96078431372549, iconTexture="Interface\\Icons\\Achievement_Dungeon_TheVioletHold_Heroic"}]], + ["139"] = [[{r=0.23921568627451, group="Priest", indicator="tr", g=1, player=true, alpha=1, duration=true, b=0.39607843137255, priority=10, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_Renew"}]], + ["41635"] = [[{r=1, group="Priest", indicator="br", g=0.90196078431373, missing=false, player=true, duration=false, alpha=1, b=0, priority=50, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_PrayerOfMendingtga"}]], + ["64904"] = [[{r=0.23529411764706, group="Priest", indicator="31685", g=0.67843137254902, player=true, duration=false, b=0.67058823529412, priority=0, alpha=1, iconTexture="Interface\\Icons\\Spell_Holy_Rapture"}]], + ["20217"] = [[{r=1, group="Paladin", indicator="", g=0.30196078431373, selfColor={alpha=1, b=0.91764705882353, g=0.058823529411765, r=1, }, player=false, duration=true, missing=true, alpha=1, priority=90, b=0.94117647058824, iconTexture="Interface\\Icons\\Spell_Magic_GreaterBlessingofKings"}]], + ["47788"] = [[{r=0, group="Priest", indicator="c", g=0, b=0, duration=true, priority=0, icon=true, iconTexture="Interface\\Icons\\Spell_Holy_GuardianSpirit"}]], + ["61295"] = [[{r=0.17647058823529, group="Shaman", indicator="tl", g=0.4, player=true, alpha=1, duration=true, b=1, priority=0, icon=false, iconTexture="Interface\\Icons\\spell_nature_riptide"}]], + ["109773"] = [[{r=0.52941176470588, group="Warlock", indicator="", g=0.12941176470588, alpha=1, b=0.71372549019608, priority=0, missing=true, iconTexture="INTERFACE\\ICONS\\spell_warlock_focusshadow"}]], + ["17"] = [[{r=1, group="Priest", indicator="tl", g=0.41960784313725, player=true, alpha=1, duration=true, b=0.5843137254902, priority=0, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_PowerWordShield"}]], + ["29166"] = [[{r=0, group="Druid", indicator="c", g=0, b=0, duration=true, priority=0, icon=true, iconTexture="Interface\\Icons\\Spell_Nature_Lightning"}]], + ["23335"] = [[{r=0, group="PvP Flags", indicator="bl", g=0, duration=false, b=0, priority=0, icon=true, iconTexture="Interface\\Icons\\INV_BannerPVP_02"}]], + ["102342"] = [[{r=0, group="Druid", indicator="c", g=0, duration=true, b=0, priority=0, icon=true, iconTexture="Interface\\Icons\\spell_druid_ironbark"}]], + ["121177"] = [[{r=0.78039215686275, group="PvP Flags", indicator="bl", g=0.42352941176471, alpha=1, b=0, priority=0, icon=false, iconTexture="Interface\\Icons\\INV_BannerPVP_03"}]], + ["586"] = [[{r=0, group="Priest", indicator="", g=0.85882352941176, selfColor={alpha=1, b=1, g=0.93725490196078, r=0, }, alpha=1, priority=0, b=1, iconTexture="Interface\\Icons\\Spell_Magic_LesserInvisibilty"}]], + ["23333"] = [[{icon=true, b=0, priority=0, r=0, group="PvP Flags", indicator="bl", g=0, iconTexture="Interface\\Icons\\INV_BannerPVP_01"}]], + ["119611"] = [[{r=0.26274509803922, group="Monk", indicator="tl", g=0.76078431372549, player=true, duration=true, alpha=1, b=0.53725490196078, priority=0, icon=false, iconTexture="Interface\\Icons\\ability_monk_renewingmists"}]], + ["20925"] = [[{r=1, group="Paladin", indicator="tl", g=0.98823529411765, selfColor={b=0.56078431372549, alpha=1, g=0.93725490196078, r=1, }, player=true, duration=true, alpha=1, priority=100, b=0.47450980392157, iconTexture="Interface\\Icons\\Ability_Paladin_BlessedMending"}]], + ["8936"] = [[{r=0.12156862745098, group="Druid", indicator="br", g=0.45882352941176, player=true, duration=true, b=0.12156862745098, priority=100, alpha=1, iconTexture="Interface\\Icons\\Spell_Nature_ResistNature"}]], + ["86273"] = [[{b=0, group="Paladin", indicator="br", g=0.45882352941176, player=true, duration=true, r=1, priority=100, alpha=1, iconTexture="Interface\\Icons\\Spell_Holy_Absolution"}]], + ["34976"] = [[{r=0, group="PvP Flags", indicator="bl", g=0, player=false, b=0, priority=0, icon=true, iconTexture="Interface\\Icons\\INV_BannerPVP_03"}]], + ["121164"] = [[{alpha=1, b=1, priority=0, r=0, group="PvP Flags", indicator="bl", g=0.003921568627451, iconTexture="Interface\\Icons\\INV_BannerPVP_03"}]], + ["48438"] = [[{r=0.55294117647059, group="Druid", indicator="31685", g=1, player=true, duration=true, b=0.3921568627451, priority=100, alpha=1, iconTexture="Interface\\Icons\\Ability_Druid_Flourish"}]], + ["1022"] = [[{r=0, group="Paladin", indicator="c", g=0, player=false, duration=true, b=0, priority=0, icon=true, iconTexture="Interface\\Icons\\Spell_Holy_SealOfProtection"}]], + ["132120"] = [[{b=0.25098039215686, group="Monk", indicator="tr", g=1, player=true, duration=true, r=0.83137254901961, priority=100, alpha=1, iconTexture="Interface\\Icons\\spell_monk_envelopingmist"}]], + ["121175"] = [[{r=1, group="PvP Flags", indicator="bl", g=0.24705882352941, b=0.90196078431373, alpha=1, priority=0, icon=false, iconTexture="Interface\\Icons\\INV_BannerPVP_03"}]], + ["64844"] = [[{r=0.67843137254902, group="Priest", indicator="31685", g=0.30588235294118, player=true, alpha=1, priority=0, b=0.14117647058824, iconTexture="Interface\\Icons\\Spell_Holy_DivineProvidence"}]], + ["124081"] = [[{r=0.51372549019608, group="Monk", indicator="br", g=1, player=true, duration=true, b=0.90588235294118, alpha=1, priority=100, icon=false, iconTexture="Interface\\Icons\\ability_monk_forcesphere"}]], + ["21562"] = [[{r=1, group="Priest", indicator="", g=1, alpha=1, missing=true, priority=0, b=1, iconTexture="Interface\\Icons\\Spell_Holy_WordFortitude"}]], + ["115921"] = [[{r=0.30980392156863, group="Monk", indicator="", g=0.69411764705882, selfColor={alpha=1, b=0.36078431372549, g=0.71764705882353, r=0.29803921568627, }, missing=true, alpha=1, duration=true, priority=0, b=0.019607843137255, iconTexture="Interface\\Icons\\ability_monk_legacyoftheemperor"}]], } } diff --git a/modules/auraindicators.lua b/modules/auraindicators.lua index 1c652c53..c36ea0f6 100755 --- a/modules/auraindicators.lua +++ b/modules/auraindicators.lua @@ -3,6 +3,11 @@ ShadowUF:RegisterModule(Indicators, "auraIndicators", ShadowUF.L["Aura indicator Indicators.auraFilters = {"boss", "curable"} +local groups = { + ["PvP Flags"] = ShadowUF.L["PvP Flags"], + ["Food"] = ShadowUF.L["Food"] +} + Indicators.auraConfig = setmetatable({}, { __index = function(tbl, index) local aura = ShadowUF.db.profile.auraIndicators.auras[tostring(index)] @@ -17,7 +22,7 @@ Indicators.auraConfig = setmetatable({}, { end tbl[index] = func - tbl[index].group = tbl[index].group or ShadowUF.L["Miscellaneous"] + tbl[index].group = groups[tbl[index].group] or tbl[index].group or ShadowUF.L["Miscellaneous"] end return tbl[index] From 8ef0ac1c54ab31a0b5f3ca078c7330471be07c2a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Jun 2014 13:21:52 -0700 Subject: [PATCH 515/794] Don't inline auras in groups to show an icon and make it easier to reconfigure --- options/config.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/options/config.lua b/options/config.lua index ff637901..3a5a36c1 100755 --- a/options/config.lua +++ b/options/config.lua @@ -33,12 +33,12 @@ local unitCategories = { local UNIT_DESC = { ["boss"] = L["Boss units are for only certain fights, such as Blood Princes or the Gunship battle, you will not see them for every boss fight."], - ["mainassist"] = L["Main Assists's are set by the Blizzard Main Assist system or mods that use them such as oRA3."], + ["mainassist"] = L["Main Assists's are set by the Blizzard Main Assist system or mods that use it."], ["maintank"] = L["Main Tank's are set through the Raid frames, or through selecting the Tank role."], ["battleground"] = L["Currently used in battlegrounds for showing flag carriers."], - ["battlegroundpet"] = L["Current pet used by a battleground unit"], - ["battlegroundtarget"] = L["Current target of a battleground unit"], - ["battlegroundtargettarget"] = L["Current target of target of a battleground unit"] + ["battlegroundpet"] = L["Current pet used by a battleground unit."], + ["battlegroundtarget"] = L["Current target of a battleground unit."], + ["battlegroundtargettarget"] = L["Current target of target of a battleground unit."] } local CLASSES = { @@ -6332,7 +6332,6 @@ local function loadAuraIndicatorsOptions() local auraConfigTable = { order = 0, type = "group", - inline = true, icon = function(info) local aura = auraMap[info[#(info)]] return tonumber(aura) and (select(3, GetSpellInfo(aura))) or nil From 23d5f942a7c4bb0f6e82245b2bdafaf81e2f6db3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Jun 2014 13:23:01 -0700 Subject: [PATCH 516/794] Removed unneeded localization --- options/config.lua | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/options/config.lua b/options/config.lua index 3a5a36c1..ee4f8388 100755 --- a/options/config.lua +++ b/options/config.lua @@ -41,26 +41,6 @@ local UNIT_DESC = { ["battlegroundtargettarget"] = L["Current target of target of a battleground unit."] } -local CLASSES = { - ["HUNTER"] = L["Hunter"], - ["WARRIOR"] = L["Warrior"], - ["PALADIN"] = L["Paladin"], - ["MAGE"] = L["Mage"], - ["PRIEST"] = L["Priest"], - ["WARLOCK"] = L["Warlock"], - ["SHAMAN"] = L["Shaman"], - ["DEATHKNIGHT"] = L["Death Knight"], - ["DRUID"] = L["Druid"], - ["MONK"] = L["Monk"], - ["ROGUE"] = L["Rogue"] -} - --- Just in case they add a class we don't have -for classToken in pairs(RAID_CLASS_COLORS) do - CLASSES[classToken] = CLASSES[classToken] or classToken -end - - local PAGE_DESC = { ["general"] = L["General configuration to all enabled units."], ["enableUnits"] = L["Various units can be enabled through this page, such as raid or party targets."], @@ -7295,7 +7275,7 @@ local function loadAuraIndicatorsOptions() -- Now create all of the parent stuff for group in pairs(groups) do - local token = CLASSES[string.upper(string.gsub(group, " ", ""))] + local token = LOCALIZED_CLASS_NAMES_MALE[string.upper(string.gsub(group, " ", ""))] groupMap[tostring(groupID)] = token or group unitTable.args.groups.args[tostring(groupID)] = unitGroupTable From bcac884278f3900ace462e61f2584d264924f855 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 8 Jun 2014 13:44:14 -0700 Subject: [PATCH 517/794] Added icons and coloring where possible to aura indicators --- options/config.lua | 46 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/options/config.lua b/options/config.lua index ee4f8388..314cf8e6 100755 --- a/options/config.lua +++ b/options/config.lua @@ -6284,7 +6284,7 @@ local function loadAuraIndicatorsOptions() local groupID, auraID, linkID = 0, 0, 0 local reverseClassMap = {} - for token, text in pairs(CLASSES) do + for token, text in pairs(LOCALIZED_CLASS_NAMES_MALE) do reverseClassMap[text] = token end @@ -6294,7 +6294,12 @@ local function loadAuraIndicatorsOptions() return reverseClassMap[groupMap[info[#(info)]]] and 1 or 2 end, type = "group", - name = function(info) return groupMap[info[#(info)]] end, + name = function(info) + local token = reverseClassMap[groupMap[info[#(info)]]] + if( not token ) then return groupMap[info[#(info)]] end + + return ShadowUF:Hex(ShadowUF.db.profile.classColors[token]) .. LOCALIZED_CLASS_NAMES_MALE[token] .. "|r" + end, desc = function(info) local group = groupMap[info[#(info)]] local totalInGroup = 0 @@ -6842,9 +6847,15 @@ local function loadAuraIndicatorsOptions() } local unitGroupTable = { - order = 1, + order = function(info) + return reverseClassMap[groupMap[info[#(info)]]] and 1 or 2 + end, type = "toggle", - name = function(info) return groupMap[info[#(info)]] end, + name = function(info) + local token = reverseClassMap[groupMap[info[#(info)]]] + if( not token ) then return groupMap[info[#(info)]] end + return ShadowUF:Hex(ShadowUF.db.profile.classColors[token]) .. LOCALIZED_CLASS_NAMES_MALE[token] .. "|r" + end, desc = function(info) local auraIndicators = ShadowUF.db.profile.units[info[3]].auraIndicators local group = groupMap[info[#(info)]] @@ -6860,7 +6871,11 @@ local function loadAuraIndicatorsOptions() order = function(info) return reverseClassMap[groupMap[info[#(info)]]] and 1 or 2 end, - name = function(info) return groupMap[info[#(info)]] end, + name = function(info) + local token = reverseClassMap[groupMap[info[#(info)]]] + if( not token ) then return groupMap[info[#(info)]] end + return ShadowUF:Hex(ShadowUF.db.profile.classColors[token]) .. LOCALIZED_CLASS_NAMES_MALE[token] .. "|r" + end, disabled = function(info) for unit in pairs(setGlobalUnits) do return false end return true end, set = function(info, value) local auraGroup = groupMap[info[#(info)]] @@ -7202,11 +7217,13 @@ local function loadAuraIndicatorsOptions() }, }, } - + local classTable = { order = 1, type = "group", - name = function(info) return LOCALIZED_CLASS_NAMES_MALE[info[#(info)]] end, + name = function(info) + return ShadowUF:Hex(ShadowUF.db.profile.classColors[info[#(info)]]) .. LOCALIZED_CLASS_NAMES_MALE[info[#(info)]] .. "|r" + end, args = {}, } @@ -7218,8 +7235,21 @@ local function loadAuraIndicatorsOptions() return tonumber(aura) and (select(3, GetSpellInfo(aura))) or nil end, name = function(info) + local aura = tonumber(auraMap[info[#(info)]]) + if( not aura ) then return auraMap[info[#(info)]] end + + local name, _, icon = GetSpellInfo(aura) + if( not name ) then return name end + + return "|T" .. icon .. ":18:18:0:0|t " .. name + end, + desc = function(info) local aura = auraMap[info[#(info)]] - return tonumber(aura) and string.format("%s (#%i)", GetSpellInfo(aura) or "Unknown", aura) or aura + if( tonumber(aura) ) then + return string.format(L["Spell ID %s"], aura) + else + return aura + end end, set = function(info, value) local aura = auraMap[info[#(info)]] From 43751ea9701a7c2409c28d95f99aa4d6242f1ed3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 9 Jun 2014 17:21:03 -0700 Subject: [PATCH 518/794] Fixed localization handling for aura groups --- modules/auraindicators.lua | 7 +----- options/config.lua | 48 ++++++++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/modules/auraindicators.lua b/modules/auraindicators.lua index c36ea0f6..36ab6a12 100755 --- a/modules/auraindicators.lua +++ b/modules/auraindicators.lua @@ -3,11 +3,6 @@ ShadowUF:RegisterModule(Indicators, "auraIndicators", ShadowUF.L["Aura indicator Indicators.auraFilters = {"boss", "curable"} -local groups = { - ["PvP Flags"] = ShadowUF.L["PvP Flags"], - ["Food"] = ShadowUF.L["Food"] -} - Indicators.auraConfig = setmetatable({}, { __index = function(tbl, index) local aura = ShadowUF.db.profile.auraIndicators.auras[tostring(index)] @@ -22,7 +17,7 @@ Indicators.auraConfig = setmetatable({}, { end tbl[index] = func - tbl[index].group = groups[tbl[index].group] or tbl[index].group or ShadowUF.L["Miscellaneous"] + if( not tbl[index].group ) then tbl[index].group = "Miscellaneous" end end return tbl[index] diff --git a/options/config.lua b/options/config.lua index 314cf8e6..340caacf 100755 --- a/options/config.lua +++ b/options/config.lua @@ -6209,6 +6209,16 @@ local function loadAuraIndicatorsOptions() local unitTable + local groupAliases = { + ["pvpflags"] = L["PvP Flags"], + ["food"] = L["Food"], + ["miscellaneous"] = L["Miscellaneous"] + } + + for token, name in pairs(LOCALIZED_CLASS_NAMES_MALE) do + groupAliases[string.lower(token)] = name + end + local groupList = {} local function getAuraGroup(info) for k in pairs(groupList) do groupList[k] = nil end @@ -6288,17 +6298,24 @@ local function loadAuraIndicatorsOptions() reverseClassMap[text] = token end + function groupName(name) + local converted = string.lower(string.gsub(name, " ", "")) + return groupAliases[converted] or name + end + -- Actual aura configuration local auraGroupTable = { order = function(info) - return reverseClassMap[groupMap[info[#(info)]]] and 1 or 2 + return reverseClassMap[groupName(groupMap[info[#(info)]])] and 1 or 2 end, type = "group", name = function(info) - local token = reverseClassMap[groupMap[info[#(info)]]] - if( not token ) then return groupMap[info[#(info)]] end + local name = groupName(groupMap[info[#(info)]]) - return ShadowUF:Hex(ShadowUF.db.profile.classColors[token]) .. LOCALIZED_CLASS_NAMES_MALE[token] .. "|r" + local token = reverseClassMap[name] + if( not token ) then return name end + + return ShadowUF:Hex(ShadowUF.db.profile.classColors[token]) .. name .. "|r" end, desc = function(info) local group = groupMap[info[#(info)]] @@ -6848,17 +6865,18 @@ local function loadAuraIndicatorsOptions() local unitGroupTable = { order = function(info) - return reverseClassMap[groupMap[info[#(info)]]] and 1 or 2 + return reverseClassMap[groupName(groupMap[info[#(info)]])] and 1 or 2 end, type = "toggle", name = function(info) - local token = reverseClassMap[groupMap[info[#(info)]]] - if( not token ) then return groupMap[info[#(info)]] end - return ShadowUF:Hex(ShadowUF.db.profile.classColors[token]) .. LOCALIZED_CLASS_NAMES_MALE[token] .. "|r" + local name = groupName(groupMap[info[#(info)]]) + local token = reverseClassMap[name] + if( not token ) then return name end + return ShadowUF:Hex(ShadowUF.db.profile.classColors[token]) .. name .. "|r" end, desc = function(info) local auraIndicators = ShadowUF.db.profile.units[info[3]].auraIndicators - local group = groupMap[info[#(info)]] + local group = groupName(groupMap[info[#(info)]]) return auraIndicators[group] and string.format(L["Disabled for %s."], L.units[info[3]]) or string.format(L["Enabled for %s."], L.units[info[3]]) end, @@ -6869,12 +6887,13 @@ local function loadAuraIndicatorsOptions() local globalUnitGroupTable = { type = "toggle", order = function(info) - return reverseClassMap[groupMap[info[#(info)]]] and 1 or 2 + return reverseClassMap[groupName(groupMap[info[#(info)]])] and 1 or 2 end, name = function(info) - local token = reverseClassMap[groupMap[info[#(info)]]] - if( not token ) then return groupMap[info[#(info)]] end - return ShadowUF:Hex(ShadowUF.db.profile.classColors[token]) .. LOCALIZED_CLASS_NAMES_MALE[token] .. "|r" + local name = groupName(groupMap[info[#(info)]]) + local token = reverseClassMap[name] + if( not token ) then return name end + return ShadowUF:Hex(ShadowUF.db.profile.classColors[token]) .. name .. "|r" end, disabled = function(info) for unit in pairs(setGlobalUnits) do return false end return true end, set = function(info, value) @@ -7305,8 +7324,7 @@ local function loadAuraIndicatorsOptions() -- Now create all of the parent stuff for group in pairs(groups) do - local token = LOCALIZED_CLASS_NAMES_MALE[string.upper(string.gsub(group, " ", ""))] - groupMap[tostring(groupID)] = token or group + groupMap[tostring(groupID)] = group unitTable.args.groups.args[tostring(groupID)] = unitGroupTable options.args.auraIndicators.args.units.args.global.args.groups.args[tostring(groupID)] = globalUnitGroupTable From d7b5d6f8445579ac5cfb11af565aa9551de1d0d6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 9 Jun 2014 17:37:16 -0700 Subject: [PATCH 519/794] Linked Dalarn Brilliance and Arcane Brilliance --- ShadowedUnitFrames.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index ef23de77..f2dde389 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -665,7 +665,9 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.auraIndicators = { disabled = {}, missing = {}, - linked = {}, + linked = { + [GetSpellInfo(61316)] = GetSpellInfo(1459) + }, indicators = { ["tl"] = {name = L["Top Left"], anchorPoint = "TLI", anchorTo = "$parent", height = 8, width = 8, alpha = 1.0, x = 4, y = -4, friendly = true, hostile = true}, ["tr"] = {name = L["Top Right"], anchorPoint = "TRI", anchorTo = "$parent", height = 8, width = 8, alpha = 1.0, x = -3, y = -3, friendly = true, hostile = true}, From 4d7cef445dbf260940b75389aa06697abaf17697 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 9 Jun 2014 17:39:22 -0700 Subject: [PATCH 520/794] Visual tweaks to the aura indicators UI --- options/config.lua | 174 +++++++++++++++++++++++---------------------- 1 file changed, 90 insertions(+), 84 deletions(-) diff --git a/options/config.lua b/options/config.lua index 340caacf..db859b8f 100755 --- a/options/config.lua +++ b/options/config.lua @@ -6554,15 +6554,13 @@ local function loadAuraIndicatorsOptions() order = 1, type = "toggle", name = L["Show boss debuffs"], - desc = L["Shows debuffs cast by a boss."], - width = "full" + desc = L["Shows debuffs cast by a boss."] }, duration = { order = 2, type = "toggle", name = L["Show aura duration"], - desc = L["Shows a cooldown wheel on the indicator with how much time is left on the aura."], - width = "full" + desc = L["Shows a cooldown wheel on the indicator with how much time is left on the aura."] }, priority = { order = 3, @@ -6583,15 +6581,13 @@ local function loadAuraIndicatorsOptions() order = 1, type = "toggle", name = L["Show curable debuffs"], - desc = L["Shows debuffs that you can cure."], - width = "full" + desc = L["Shows debuffs that you can cure."] }, duration = { order = 2, type = "toggle", name = L["Show aura duration"], - desc = L["Shows a cooldown wheel on the indicator with how much time is left on the aura."], - width = "full" + desc = L["Shows a cooldown wheel on the indicator with how much time is left on the aura."] }, priority = { order = 3, @@ -6918,6 +6914,8 @@ local function loadAuraIndicatorsOptions() return enabledUnits end + + local widthReset -- Actual tab view thing options.args.auraIndicators = { @@ -6973,6 +6971,23 @@ local function loadAuraIndicatorsOptions() order = 2, type = "group", name = L["Auras"], + hidden = function(info) + if( not widthReset and AceDialog.Status.ShadowedUF.children.auraIndicators ) then + if( AceDialog.Status.ShadowedUF.children.auraIndicators.children.auras ) then + widthReset = true + + AceDialog.Status.ShadowedUF.children.auraIndicators.children.auras.status.groups.treewidth = 230 + + AceDialog.Status.ShadowedUF.children.auraIndicators.children.auras.status.groups.groups = {} + AceDialog.Status.ShadowedUF.children.auraIndicators.children.auras.status.groups.groups.filters = true + AceDialog.Status.ShadowedUF.children.auraIndicators.children.auras.status.groups.groups.groups = true + + AceRegistry:NotifyChange("ShadowedUF") + end + end + + return false + end, args = { add = { order = 0, @@ -6981,84 +6996,75 @@ local function loadAuraIndicatorsOptions() set = function(info, value) addAura[info[#(info)]] = value end, get = function(info) return addAura[info[#(info)]] end, args = { - add = { + name = { order = 0, - inline = true, - type = "group", - name = L["Add Aura"], - args = { - name = { - order = 0, - type = "input", - name = L["Spell Name/ID"], - desc = L["If name is entered, it must be exact as it is case sensitive. Alternatively, you can use spell id instead."], - width = "full", - }, - group = { - order = 1, - type = "select", - name = L["Aura group"], - desc = L["What group this aura belongs to, this is where you will find it when configuring."], - values = getAuraGroup, - }, - custom = { - order = 2, - type = "input", - name = L["New aura group"], - desc = L["Allows you to enter a new aura group."], - }, - create = { - order = 3, - type = "execute", - name = L["Add aura"], - disabled = function(info) return not addAura.name or (not addAura.group and not addAura.custom) end, - func = function(info) - local group = string.trim(addAura.custom or "") - if( group == "" ) then group = string.trim(addAura.group or "") end - if( group == "" ) then group = L["Miscellaneous"] end - - -- Don't overwrite an existing group, but don't tell them either, mostly because I don't want to add error reporting code - if( not ShadowUF.db.profile.auraIndicators.auras[addAura.name] ) then - -- Odds are, if they are saying to show it only if a buff is missing it's cause they want to know when their own class buff is not there - -- so will cheat it, and jump start it by storing the texture if we find it from GetSpellInfo directly - Indicators.auraConfig[addAura.name] = {indicator = "", group = group, iconTexture = select(3, GetSpellInfo(addAura.name)), priority = 0, r = 0, g = 0, b = 0} - writeAuraTable(addAura.name) - - auraID = auraID + 1 - auraMap[tostring(auraID)] = addAura.name - auraGroupTable.args[tostring(auraID)] = auraConfigTable - end - - addAura.name = nil - addAura.custom = nil - addAura.group = nil - - -- Check if the group exists - local gID - for id, name in pairs(groupMap) do - if( name == group ) then - gID = id - break - end - end - - if( not gID ) then - groupID = groupID + 1 - groupMap[tostring(groupID)] = group + type = "input", + name = L["Spell Name/ID"], + desc = L["If name is entered, it must be exact as it is case sensitive. Alternatively, you can use spell id instead."] + }, + group = { + order = 1, + type = "select", + name = L["Aura group"], + desc = L["What group this aura belongs to, this is where you will find it when configuring."], + values = getAuraGroup, + }, + custom = { + order = 2, + type = "input", + name = L["New aura group"], + desc = L["Allows you to enter a new aura group."], + }, + create = { + order = 3, + type = "execute", + name = L["Add aura"], + disabled = function(info) return not addAura.name or (not addAura.group and not addAura.custom) end, + func = function(info) + local group = string.trim(addAura.custom or "") + if( group == "" ) then group = string.trim(addAura.group or "") end + if( group == "" ) then group = L["Miscellaneous"] end + + -- Don't overwrite an existing group, but don't tell them either, mostly because I don't want to add error reporting code + if( not ShadowUF.db.profile.auraIndicators.auras[addAura.name] ) then + -- Odds are, if they are saying to show it only if a buff is missing it's cause they want to know when their own class buff is not there + -- so will cheat it, and jump start it by storing the texture if we find it from GetSpellInfo directly + Indicators.auraConfig[addAura.name] = {indicator = "", group = group, iconTexture = select(3, GetSpellInfo(addAura.name)), priority = 0, r = 0, g = 0, b = 0} + writeAuraTable(addAura.name) + + auraID = auraID + 1 + auraMap[tostring(auraID)] = addAura.name + auraGroupTable.args[tostring(auraID)] = auraConfigTable + end + + addAura.name = nil + addAura.custom = nil + addAura.group = nil + + -- Check if the group exists + local gID + for id, name in pairs(groupMap) do + if( name == group ) then + gID = id + break + end + end + + if( not gID ) then + groupID = groupID + 1 + groupMap[tostring(groupID)] = group - unitTable.args.groups.args[tostring(groupID)] = unitGroupTable - options.args.auraIndicators.args.units.args.global.args.groups.args[tostring(groupID)] = globalUnitGroupTable - options.args.auraIndicators.args.auras.args.groups.args[tostring(groupID)] = auraGroupTable - end - - -- Shunt the user to the this groups page - AceDialog.Status.ShadowedUF.children.auraIndicators.children.auras.status.groups.selected = tostring(gID or groupID) - AceRegistry:NotifyChange("ShadowedUF") - - ShadowUF.Layout:Reload() - end, - }, - }, + unitTable.args.groups.args[tostring(groupID)] = unitGroupTable + options.args.auraIndicators.args.units.args.global.args.groups.args[tostring(groupID)] = globalUnitGroupTable + options.args.auraIndicators.args.auras.args.groups.args[tostring(groupID)] = auraGroupTable + end + + -- Shunt the user to the this groups page + AceDialog.Status.ShadowedUF.children.auraIndicators.children.auras.status.groups.selected = tostring(gID or groupID) + AceRegistry:NotifyChange("ShadowedUF") + + ShadowUF.Layout:Reload() + end, }, }, }, From 90b2cabfc06eb228a3052681b7da376f92d42b68 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 9 Jun 2014 17:46:39 -0700 Subject: [PATCH 521/794] Do a one time force enable on all aura filters --- ShadowedUnitFrames.lua | 22 +++++++++++++++++++--- modules/defaultlayout.lua | 4 ++-- options/config.lua | 5 ++--- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index f2dde389..adf10457 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 45 +ShadowUF.dbRevision = 46 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -100,6 +100,22 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 45 ) then + for unit, config in pairs(self.db.profile.units) do + if( config.auras ) then + for _, key in pairs({"buffs", "debuffs"}) do + local aura = config.auras[key] + aura.show = aura.show or {} + aura.show.player = true + aura.show.boss = true + aura.show.raid = true + aura.show.consolidated = true + aura.show.misc = true + end + end + end + end + if( revision <= 44 ) then ShadowUF:LoadDefaultLayout(true) @@ -488,8 +504,8 @@ function ShadowUF:LoadUnitDefaults() highlight = {}, auraIndicators = {enabled = false}, auras = { - buffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, prioritize = true, show = {misc = true, player = true, raid = true, consolidated = true}, enlarge = {}, timers = {ALL = true}}, - debuffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, show = {misc = true, player = true, raid = true, boss = true}, enlarge = {SELF = true}, timers = {ALL = true}}, + buffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, prioritize = true, show = {player = true, boss = true, raid = true, consolidated = true, misc = true}, enlarge = {}, timers = {ALL = true}}, + debuffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, show = {player = true, boss = true, raid = true, consolidated = true, misc = true}, enlarge = {SELF = true}, timers = {ALL = true}}, }, } diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index dbcbd063..872277ab 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -235,8 +235,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) config.parentUnit = { portrait = {enabled = false, type = "3D", alignment = "LEFT", width = 0.22, height = 0.50, order = 15, fullBefore = 0, fullAfter = 100}, auras = { - buffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0, show = {misc = true, player = true, raid = true, consolidated = true}, enlarge = {}, timers = {ALL = true}}, - debuffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0, show = {misc = true, player = true, raid = true, boss = true}, enlarge = {SELF = true}, timers = {ALL = true}}, + buffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0, show = {player = true, boss = true, raid = true, consolidated = true, misc = true}, enlarge = {}, timers = {ALL = true}}, + debuffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0, show = {player = true, boss = true, raid = true, consolidated = true, misc = true}, enlarge = {SELF = true}, timers = {ALL = true}}, }, text = { {width = 0.50, name = L["Left text"], anchorTo = "$healthBar", anchorPoint = "CLI", x = 3, y = 0, size = 0, default = true}, diff --git a/options/config.lua b/options/config.lua index db859b8f..430120e1 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2097,8 +2097,7 @@ local function loadUnitOptions() order = 3, type = "toggle", name = L["Show casted by boss"], - desc = L["Whether to show any debuffs casted by the boss"], - hidden = hideDebuffOption, + desc = L["Whether to show any auras casted by the boss"], width = "full" }, consolidated = { @@ -6298,7 +6297,7 @@ local function loadAuraIndicatorsOptions() reverseClassMap[text] = token end - function groupName(name) + local function groupName(name) local converted = string.lower(string.gsub(name, " ", "")) return groupAliases[converted] or name end From cbebd3b05acacf44d0d21d618aaded71182bd9b3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 14 Jun 2014 22:09:26 -0700 Subject: [PATCH 522/794] Fixed stealable/removable auras not being scaled --- modules/auras.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 459d03ec..789df31f 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -549,8 +549,8 @@ local function renderAura(parent, frame, type, config, displayConfig, index, fil button.cooldown:Hide() end - -- Enlarge our own auras - if( ( category == "player" and config.enlarge.SELF ) or ( category == "boss" and config.enlarge.BOSS ) or ( category == "raid" and type == "debuffs" and config.enlarge.REMOVABLE ) ) then + -- Enlarge auras + if( ( category == "player" and config.enlarge.SELF ) or ( category == "boss" and config.enlarge.BOSS ) or ( isRemovable and not isFriendly and config.enlarge.REMOVABLE ) ) then button.isSelfScaled = true button:SetScale(config.selfScale) else From b8b2a612ffdc79c21d3e930e08e716adb9608a30 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 20 Jun 2014 20:49:26 -0700 Subject: [PATCH 523/794] Fixed logic for determining curable auras --- modules/auras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index 789df31f..679b9c05 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -581,7 +581,7 @@ local function scan(parent, frame, type, config, displayConfig, filter) -- UnitIsFriend returns true during a duel, which breaks stealable/curable detection local isFriendly = not UnitIsEnemy(frame.parent.unit, "player") - local curable = (isFriendly and type == "debuffs" and config.raid) + local curable = (isFriendly and type == "debuffs") local index = 0 while( true ) do index = index + 1 From 48552ed508375e87b2dc8bfe77d9c0c34fa9ce28 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 20 Jun 2014 21:02:05 -0700 Subject: [PATCH 524/794] Fixed ToT child units not working --- modules/units.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index bd1753a8..9154dd5c 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1250,6 +1250,14 @@ function Units:LoadChildUnit(parent, type, id) parent.hasChildren = true + if( string.match(type, "pet$") ) then + suffix = "pet" + elseif( string.match(type, "targettarget$") ) then + suffix = "targettarget" + else + suffix = "target" + end + -- Now we can create the actual frame local frame = self:CreateUnit("Button", "SUFChild" .. type .. string.match(parent:GetName(), "(%d+)"), parent, "SecureUnitButtonTemplate") frame.unitType = type @@ -1258,7 +1266,7 @@ function Units:LoadChildUnit(parent, type, id) frame.hasStateWatch = type == "partypet" frame:SetFrameStrata("LOW") frame:SetAttribute("useparent-unit", true) - frame:SetAttribute("unitsuffix", string.match(type, "pet$") and "pet" or "target") + frame:SetAttribute("unitsuffix", suffix) OnAttributeChanged(frame, "unit", SecureButton_GetModifiedUnit(frame)) frameList[frame] = true From 3a2eee0df85dac0a5660a9d4431643a24c501892 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 20 Jun 2014 21:23:51 -0700 Subject: [PATCH 525/794] Redid aura categorization priority to fix display bugs --- modules/auras.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 679b9c05..1d87674e 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -500,14 +500,22 @@ function Auras:UpdateFilter(frame) end local function categorizeAura(type, curable, auraType, caster, isRemovable, shouldConsolidate, canApplyAura, isBossDebuff) - if( playerUnits[caster] ) then - return "player" - elseif( isBossDebuff ) then - return "boss" + -- Can dispell, curable checks type already + if( curable and canCure[auraType] ) then + return "raid" + -- Can apply it ourselves elseif( type == "buffs" and canApplyAura ) then return "raid" - elseif( type == "debuffs" and ( isRemovable or ( curable and canCure[auraType] ) ) ) then + -- Can be stolen/purged (dispellable) + elseif( type == "debuffs" and isRemovable ) then return "raid" + -- Boss aura + elseif( isBossDebuff ) then + return "boss" + -- Player casted it + elseif( playerUnits[caster] ) then + return "player" + -- Consolidatable buff elseif( type == "buffs" and shouldConsolidate ) then return "consolidated" else From c4a848eca674e1d6d4ade923fddaee7b5ce819a3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 20 Jun 2014 21:30:36 -0700 Subject: [PATCH 526/794] Fixed aura indicators curable filter not working --- modules/auraindicators.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/auraindicators.lua b/modules/auraindicators.lua index 36ab6a12..1d001d88 100755 --- a/modules/auraindicators.lua +++ b/modules/auraindicators.lua @@ -102,7 +102,7 @@ for _, key in pairs(Indicators.auraFilters) do filterMap[key] = "filter-" .. key local function checkFilterAura(frame, type, isFriendly, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) local category - if( isFriendly and isRemovable and canCure[auraType] and type == "debuffs" ) then + if( isFriendly and canCure[auraType] and type == "debuffs" ) then category = "curable" elseif( isBossDebuff ) then category = "boss" @@ -145,6 +145,7 @@ local function checkSpecificAura(frame, type, name, rank, texture, count, auraTy if( auraConfig.player and not playerUnits[caster] ) then return end local indicator = auraConfig and frame.auraIndicators[auraConfig.indicator] + -- No indicator or not enabled if( not indicator or not indicator.enabled ) then return end -- Missing aura only From c754777105e3fbdc3d1d57d59f938fae0c85d31c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 20 Jun 2014 21:30:46 -0700 Subject: [PATCH 527/794] Fixed aura indicators not being updated on config change until UI reload --- options/config.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/options/config.lua b/options/config.lua index 430120e1..5ed65eaa 100755 --- a/options/config.lua +++ b/options/config.lua @@ -6287,6 +6287,12 @@ local function loadAuraIndicatorsOptions() local function writeAuraTable(name) ShadowUF.db.profile.auraIndicators.auras[name] = writeTable(Indicators.auraConfig[name]) + Indicators.auraConfig[name] = nil + + local spellID = tonumber(name) + if( spellID ) then + Indicators.auraConfig[spellID] = nil + end end local groupMap, auraMap, linkMap = {}, {}, {} From f19b0a79c9eed4d07c51ab5a8c3a227afa6db267 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 20 Jun 2014 21:32:51 -0700 Subject: [PATCH 528/794] Fixed leaked global --- modules/units.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/units.lua b/modules/units.lua index 9154dd5c..f12156f7 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1250,6 +1250,7 @@ function Units:LoadChildUnit(parent, type, id) parent.hasChildren = true + local suffix if( string.match(type, "pet$") ) then suffix = "pet" elseif( string.match(type, "targettarget$") ) then From 1da8615c958d3ce46df68ad7777b8f5bb89cf3cd Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 28 Jun 2014 10:34:14 -0700 Subject: [PATCH 529/794] Added debug flag to record aruas to narrow down the issue --- modules/auras.lua | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/modules/auras.lua b/modules/auras.lua index 1d87674e..af3208f9 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -523,7 +523,48 @@ local function categorizeAura(type, curable, auraType, caster, isRemovable, shou end end +local monitor = false +function ShadowUF:StartMonitor() + monitor = true + self.db.profile.auraDebug = {} + self:Print("Monitor started, WARNING. Make sure you type /script ShadowUF:StopMonitor(); once you've finished") +end + +function ShadowUF:StopMonitor() + self:Print("Monitor stopped, do a /console reloadui then send your ShadowedUnitFrames.lua to Shadowed") + monitor = false +end + local function renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) + if( monitor ) then + ShadowUF.db.profile.auraDebug[spellID] = {} + ShadowUF.db.profile.auraDebug[spellID] = { + type = type, + category = categorizeAura(type, curable, auraType, caster, isRemovable, shouldConsolidate, canApplyAura, isBossDebuff), + isFriendly = isFriendly, + curable = curable, + name = name, + rank = rank, + texture = texture, + count = count, + auraType = auraType, + duration = duration, + endTime = endTime, + caster = caster, + isRemovable = isRemovable, + shouldConsolidate = shouldConsolidate, + canApplyAura = canApplyAura, + isBossDebuff = isBossDebuff, + canCureFlag = canCure[auraType], + isPlayer = playerUnits[caster], + whitelisted = parent.whitelist[type] and not parent.whitelist[name] and not parent.whitelist[spellID], + blacklisted = parent.blacklist[type] and ( parent.blacklist[name] or parent.blacklist[spellID] ), + enlargeRemovable = config.enlarge.REMOVABLE, + enlargeSelf = config.enlarge.SELF, + enlargeBoss = config.enlarge.BOSS + } + end + -- Do our initial list check to see if we can quick filter it out if( parent.whitelist[type] and not parent.whitelist[name] and not parent.whitelist[spellID] ) then return end if( parent.blacklist[type] and ( parent.blacklist[name] or parent.blacklist[spellID] ) ) then return end @@ -583,6 +624,7 @@ local function renderAura(parent, frame, type, config, displayConfig, index, fil button:Show() end + -- Scan for auras local function scan(parent, frame, type, config, displayConfig, filter) if( frame.totalAuras >= frame.maxAuras or not config.enabled ) then return end From f7e242bb56a2889740d1a582236c5f53116b113c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 28 Jun 2014 10:36:54 -0700 Subject: [PATCH 530/794] Bump player auras back to the top --- modules/auras.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index af3208f9..75258770 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -500,6 +500,9 @@ function Auras:UpdateFilter(frame) end local function categorizeAura(type, curable, auraType, caster, isRemovable, shouldConsolidate, canApplyAura, isBossDebuff) + -- Player casted it + if( playerUnits[caster] ) then + return "player" -- Can dispell, curable checks type already if( curable and canCure[auraType] ) then return "raid" @@ -512,9 +515,6 @@ local function categorizeAura(type, curable, auraType, caster, isRemovable, shou -- Boss aura elseif( isBossDebuff ) then return "boss" - -- Player casted it - elseif( playerUnits[caster] ) then - return "player" -- Consolidatable buff elseif( type == "buffs" and shouldConsolidate ) then return "consolidated" From f29a4e2bee6d323139df3012d85760278ee82583 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 28 Jun 2014 10:38:28 -0700 Subject: [PATCH 531/794] Move boss auras back up --- modules/auras.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 75258770..24e17876 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -503,8 +503,11 @@ local function categorizeAura(type, curable, auraType, caster, isRemovable, shou -- Player casted it if( playerUnits[caster] ) then return "player" + -- Boss aura + elseif( isBossDebuff ) then + return "boss" -- Can dispell, curable checks type already - if( curable and canCure[auraType] ) then + elseif( curable and canCure[auraType] ) then return "raid" -- Can apply it ourselves elseif( type == "buffs" and canApplyAura ) then @@ -512,9 +515,6 @@ local function categorizeAura(type, curable, auraType, caster, isRemovable, shou -- Can be stolen/purged (dispellable) elseif( type == "debuffs" and isRemovable ) then return "raid" - -- Boss aura - elseif( isBossDebuff ) then - return "boss" -- Consolidatable buff elseif( type == "buffs" and shouldConsolidate ) then return "consolidated" From 63f2ee906ac73b9d37323ddc7ad4745b33a21c3e Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 29 Jun 2014 17:14:05 -0700 Subject: [PATCH 532/794] Added more debug code --- modules/auras.lua | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 24e17876..397d4775 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -526,7 +526,8 @@ end local monitor = false function ShadowUF:StartMonitor() monitor = true - self.db.profile.auraDebug = {} + self.db.globla.auraDebug = {} + self.db.global.showConfig = {} self:Print("Monitor started, WARNING. Make sure you type /script ShadowUF:StopMonitor(); once you've finished") end @@ -536,9 +537,16 @@ function ShadowUF:StopMonitor() end local function renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) - if( monitor ) then - ShadowUF.db.profile.auraDebug[spellID] = {} - ShadowUF.db.profile.auraDebug[spellID] = { + if( monitor ) then + local unit = frame.parent.unit + + ShadowUF.db.global.auraConfig[unit] = ShadowUF.db.global.auraConfig[unit] or {} + ShadowUF.db.global.auraConfig[unit][type] = config.show + + ShadowUF.db.global.auraDebug[unit] = ShadowUF.db.global.auraDebug[unit] or {} + + ShadowUF.db.global.auraDebug[unit][spellID] = {} + ShadowUF.db.global.auraDebug[unit][spellID] = { type = type, category = categorizeAura(type, curable, auraType, caster, isRemovable, shouldConsolidate, canApplyAura, isBossDebuff), isFriendly = isFriendly, @@ -551,17 +559,17 @@ local function renderAura(parent, frame, type, config, displayConfig, index, fil duration = duration, endTime = endTime, caster = caster, - isRemovable = isRemovable, - shouldConsolidate = shouldConsolidate, - canApplyAura = canApplyAura, - isBossDebuff = isBossDebuff, - canCureFlag = canCure[auraType], - isPlayer = playerUnits[caster], - whitelisted = parent.whitelist[type] and not parent.whitelist[name] and not parent.whitelist[spellID], - blacklisted = parent.blacklist[type] and ( parent.blacklist[name] or parent.blacklist[spellID] ), - enlargeRemovable = config.enlarge.REMOVABLE, - enlargeSelf = config.enlarge.SELF, - enlargeBoss = config.enlarge.BOSS + isRemovable = not not isRemovable, + shouldConsolidate = not not shouldConsolidate, + canApplyAura = not not canApplyAura, + isBossDebuff = not not isBossDebuff, + canCureFlag = not not canCure[auraType], + isPlayer = not not playerUnits[caster], + whitelisted = not not (parent.whitelist[type] and not parent.whitelist[name] and not parent.whitelist[spellID]), + blacklisted = not not (parent.blacklist[type] and ( parent.blacklist[name] or parent.blacklist[spellID] )), + enlargeRemovable = not not config.enlarge.REMOVABLE, + enlargeSelf = not not config.enlarge.SELF, + enlargeBoss = not not config.enlarge.BOSS } end From 827236e275b8f0db3e65b2b23354aa5b58763d2c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 29 Jun 2014 17:15:21 -0700 Subject: [PATCH 533/794] Typo --- modules/auras.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 397d4775..fdf7e254 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -526,8 +526,8 @@ end local monitor = false function ShadowUF:StartMonitor() monitor = true - self.db.globla.auraDebug = {} - self.db.global.showConfig = {} + self.db.global.auraDebug = {} + self.db.global.auraConfig = {} self:Print("Monitor started, WARNING. Make sure you type /script ShadowUF:StopMonitor(); once you've finished") end From a5499b8c3ae7fbc1342bf5b65c409a90f116836b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 2 Aug 2014 16:08:39 -0700 Subject: [PATCH 534/794] fixed OnEvent error in WoD --- modules/movers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/movers.lua b/modules/movers.lua index b1816420..0feae4c1 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -350,7 +350,7 @@ function Movers:Disable() frame:SetAttribute("unit", frame.originalUnit) frame:SetScript("OnDragStop", nil) frame:SetScript("OnDragStart", nil) - frame:SetScript("OnEvent", frame:IsVisible() and ShadowUF.Units.OnEvent) + frame:SetScript("OnEvent", frame:IsVisible() and ShadowUF.Units.OnEvent or nil) frame:SetScript("OnUpdate", frame.originalOnUpdate) frame.OnEnter = frame.originalOnEnter frame.OnLeave = frame.originalOnLeave From c780803aeb5eff257dc7e9d2e15e758527ae7836 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 2 Aug 2014 16:10:42 -0700 Subject: [PATCH 535/794] Added WoD tag --- ShadowedUnitFrames.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index adf10457..bf1267d6 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -3,6 +3,7 @@ ]] ShadowUF = select(2, ...) +ShadowUF.IS_WOD = select(4, GetBuildInfo()) >= 60000 local L = ShadowUF.L ShadowUF.dbRevision = 46 From 133ecdd3940b6d7e3010988d25203fc2ab2fb6f1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 2 Aug 2014 16:29:58 -0700 Subject: [PATCH 536/794] Priests can have up to 5 Shadow Orbs in WoD --- modules/shadoworbs.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/shadoworbs.lua b/modules/shadoworbs.lua index e30f4efe..d90b51be 100755 --- a/modules/shadoworbs.lua +++ b/modules/shadoworbs.lua @@ -1,6 +1,6 @@ local ShadowOrbs = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(ShadowOrbs, "shadowOrbs", ShadowUF.L["Shadow Orbs"], nil, "PRIEST", SPEC_PRIEST_SHADOW, SHADOW_ORBS_SHOW_LEVEL) -local shadowConfig = {max = PRIEST_BAR_NUM_ORBS, key = "shadowOrbs", colorKey = "SHADOWORBS", powerType = SPELL_POWER_SHADOW_ORBS, eventType = "SHADOW_ORBS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local shadowConfig = {max = ShadowUF.IS_WOD and 5 or PRIEST_BAR_NUM_ORBS, key = "shadowOrbs", colorKey = "SHADOWORBS", powerType = SPELL_POWER_SHADOW_ORBS, eventType = "SHADOW_ORBS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function ShadowOrbs:OnEnable(frame) frame.shadowOrbs = frame.shadowOrbs or CreateFrame("Frame", nil, frame) From 74b69b7b41537178dc52969b3d42d8687286cd62 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 2 Aug 2014 16:45:44 -0700 Subject: [PATCH 537/794] Enable dismissable totem bars in WoD (must be turned on) --- modules/totems.lua | 4 ++-- options/config.lua | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/totems.lua b/modules/totems.lua index 485ed5e5..0fe7c1c0 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -115,8 +115,8 @@ function Totems:OnLayoutApplied(frame) totem.secure = totem.secure or CreateFrame("Button", frame:GetName() .. "Secure" .. totem.id, totem, "SecureUnitButtonTemplate") totem.secure:RegisterForClicks("RightButtonUp") totem.secure:SetAllPoints(totem) - totem.secure:SetAttribute("type2", "macro") - totem.secure:SetAttribute("macrotext2", "/click TotemFrameTotem" .. totem.id .. " RightButton") + totem.secure:SetAttribute("type2", "destroytotem") + totem.secure:SetAttribute("*totem-slot*", totem.id) totem.secure:Show() elseif( totem.secure ) then diff --git a/options/config.lua b/options/config.lua index 5ed65eaa..27fdd7c3 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4223,15 +4223,16 @@ local function loadUnitOptions() desc = L["Uses the icon of the totem being shown instead of a status bar."], arg = "totemBar.icon", }, - --secure = { - -- order = 3, - -- type = "toggle", - -- name = L["Dismissable totems bars"], - -- desc = function(info) - -- return L["Allows you to disable the totem by right clicking it.|n|nWarning: Inner bars for this unit will not resize in combat if you enable this."] - -- end, - -- arg = "totemBar.secure", - --}, + secure = { + order = 3, + type = "toggle", + name = L["Dismissable Totem bars"], + hidden = function() return not ShadowUF.IS_WOD end, + desc = function(info) + return L["Allows you to disable the totem by right clicking it.|n|nWarning: Inner bars for this unit will not resize in combat if you enable this."] + end, + arg = "totemBar.secure", + }, }, }, emptyBar = { From a0919065d045947e92d2ac0239557d7622da9396 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 2 Aug 2014 16:47:40 -0700 Subject: [PATCH 538/794] Fixed totem timers not hiding if totems are destroyed early --- modules/totems.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/totems.lua b/modules/totems.lua index 0fe7c1c0..5adc59fd 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -184,8 +184,8 @@ function Totems:Update(frame) indicator.endTime = nil end - if( self.fontString ) then - self.fontString:UpdateTags() + if( indicator.fontString ) then + indicator.fontString:UpdateTags() end end From e4f1072f440fb06b531ddd8cb1dd4637d6c8329d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 2 Aug 2014 16:59:23 -0700 Subject: [PATCH 539/794] Tweak boss events to try and fix update issues --- modules/units.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index f12156f7..03d209c1 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -527,7 +527,8 @@ OnAttributeChanged = function(self, name, unit) -- Update boss elseif( self.unitType == "boss" ) then - self:RegisterNormalEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", Units, "CheckUnitStatus") + self:RegisterNormalEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", Units, "FullUpdate") + self:RegisterUnitEvent("UNIT_TARGETABLE_CHANGED", Units, "FullUpdate") self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") -- Update arena/battleground From 1b8266307940b0116d10e7019ab1abc29bddd92c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 3 Aug 2014 19:11:55 -0700 Subject: [PATCH 540/794] Typo --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 03d209c1..1e3db2d1 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -528,7 +528,7 @@ OnAttributeChanged = function(self, name, unit) -- Update boss elseif( self.unitType == "boss" ) then self:RegisterNormalEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", Units, "FullUpdate") - self:RegisterUnitEvent("UNIT_TARGETABLE_CHANGED", Units, "FullUpdate") + self:RegisterUnitEvent("UNIT_TARGETABLE_CHANGED", self, "FullUpdate") self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") -- Update arena/battleground From 5b0c5c99e42014d04631f7270c79f9bb2cfe317c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 4 Aug 2014 08:37:50 -0700 Subject: [PATCH 541/794] One more typo --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 1e3db2d1..1bc0ff49 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -527,7 +527,7 @@ OnAttributeChanged = function(self, name, unit) -- Update boss elseif( self.unitType == "boss" ) then - self:RegisterNormalEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", Units, "FullUpdate") + self:RegisterNormalEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", self, "FullUpdate") self:RegisterUnitEvent("UNIT_TARGETABLE_CHANGED", self, "FullUpdate") self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") From bd5e1e7a79ba8f845bf07144253a060f31dfdca3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 8 Oct 2014 21:05:01 -0700 Subject: [PATCH 542/794] Reload UFs for raid/party units on connection change --- modules/units.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/units.lua b/modules/units.lua index 1bc0ff49..6026572a 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -543,6 +543,7 @@ OnAttributeChanged = function(self, name, unit) elseif( self.unitRealType == "raid" ) then self:RegisterNormalEvent("GROUP_ROSTER_UPDATE", Units, "CheckGroupedUnitStatus") self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") + self:RegisterUnitEvent("UNIT_CONNECTION", self, "FullUpdate") -- Party members need to watch for changes elseif( self.unitRealType == "party" ) then @@ -551,6 +552,7 @@ OnAttributeChanged = function(self, name, unit) self:RegisterNormalEvent("PARTY_MEMBER_DISABLE", Units, "CheckGroupedUnitStatus") self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") self:RegisterUnitEvent("UNIT_OTHER_PARTY_CHANGED", self, "FullUpdate") + self:RegisterUnitEvent("UNIT_CONNECTION", self, "FullUpdate") -- *target units are not real units, thus they do not receive events and must be polled for data elseif( ShadowUF.fakeUnits[self.unitRealType] ) then From 4659223243a1cc6656ee746d334fafe679657bd5 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 8 Oct 2014 21:10:52 -0700 Subject: [PATCH 543/794] Fixed question mark portraits not working --- modules/portrait.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/portrait.lua b/modules/portrait.lua index c30b533a..53df29fd 100755 --- a/modules/portrait.lua +++ b/modules/portrait.lua @@ -77,11 +77,14 @@ function Portrait:Update(frame, event) SetPortraitTexture(frame.portrait, frame.unitOwner) -- Using 3D portrait, but the players not in range so swap to question mark elseif( not UnitIsVisible(frame.unitOwner) or not UnitIsConnected(frame.unitOwner) ) then - frame.portrait:SetModelScale(4.25) - frame.portrait:SetPosition(0, 0, -0.4) - frame.portrait:SetModel("Interface\\Buttons\\talktomequestionmark.mdx") + frame.portrait:ClearModel() + frame.portrait:SetModelScale(5.5) + frame.portrait:SetPosition(0, 0, -0.8) + frame.portrait:SetModel("Interface\\Buttons\\talktomequestionmark.m2") + -- Use animated 3D portrait else + frame.portrait:ClearModel() frame.portrait:SetUnit(frame.unitOwner) frame.portrait:SetPortraitZoom(1) frame.portrait:SetPosition(0, 0, 0) From e9c297f6937ed0c0e9d2c304e1fb57e5d2a15b8c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 8 Oct 2014 21:20:03 -0700 Subject: [PATCH 544/794] Fixed an error when enabling Arena ToT or BG ToT --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 6026572a..96f8bcab 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1,6 +1,6 @@ local Units = {headerFrames = {}, unitFrames = {}, frameList = {}, unitEvents = {}, remappedUnits = {}, canCure = {}} Units.childUnits = {["partytarget"] = "party", ["partytargettarget"] = "party", ["partypet"] = "party", ["maintanktarget"] = "maintank", ["mainassisttarget"] = "mainassist", ["bosstarget"] = "boss", ["arenatarget"] = "arena", ["arenatargettarget"] = "arena", ["arenapet"] = "arena", ["battlegroundpet"] = "battleground", ["battlegroundtarget"] = "battleground", ["battlegroundtargettarget"] = "battleground", ["maintanktargettarget"] = "maintank", ["mainassisttargettarget"] = "mainassist", ["bosstargettarget"] = "boss"} -Units.zoneUnits = {["arena"] = "arena", ["arenapet"] = "arena", ["arenatarget"] = "arena", ["arenatargettarget"] = true, ["boss"] = {"party", "raid"}, ["bosstarget"] = {"party", "raid"}, ["battleground"] = "pvp", ["battlegroundtarget"] = "pvp", ["battlegroundtargettarget"] = true, ["battlegroundpet"] = "pvp", ["bosstargettarget"] = {"party", "raid"}} +Units.zoneUnits = {["arena"] = "arena", ["arenapet"] = "arena", ["arenatarget"] = "arena", ["arenatargettarget"] = "arena", ["boss"] = {"party", "raid"}, ["bosstarget"] = {"party", "raid"}, ["battleground"] = "pvp", ["battlegroundtarget"] = "pvp", ["battlegroundtargettarget"] = "pvp", ["battlegroundpet"] = "pvp", ["bosstargettarget"] = {"party", "raid"}} Units.remappedUnits = {["battleground"] = "arena", ["battlegroundpet"] = "arenapet", ["battlegroundtarget"] = "arenatarget", ["battlegroundtargettarget"] = "arenatargettarget"} Units.headerUnits = {["raid"] = true, ["party"] = true, ["maintank"] = true, ["mainassist"] = true, ["raidpet"] = true, ["partypet"] = true} From 4df89b339677c06b4528648f33d81d52b1579909 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 8 Oct 2014 22:54:36 -0700 Subject: [PATCH 545/794] Arena frames now show during prep phase with opponents spec/class --- ShadowedUnitFrames.lua | 17 +++++++++-- modules/defaultlayout.lua | 4 +++ modules/empty.lua | 2 +- modules/health.lua | 2 +- modules/indicators.lua | 32 +++++++++++++++++++-- modules/movers.lua | 3 ++ modules/portrait.lua | 3 +- modules/power.lua | 2 +- modules/units.lua | 60 +++++++++++++++++++++++++++++++++------ options/config.lua | 8 ++++-- 10 files changed, 112 insertions(+), 21 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index bf1267d6..bc8dc242 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -6,7 +6,7 @@ ShadowUF = select(2, ...) ShadowUF.IS_WOD = select(4, GetBuildInfo()) >= 60000 local L = ShadowUF.L -ShadowUF.dbRevision = 46 +ShadowUF.dbRevision = 47 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -95,12 +95,17 @@ function ShadowUF:CheckBuild() if( self.db.profile.wowBuild == build ) then return end -- Nothing to add here right now - self.db.profile.wowBuild = build end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 46 ) then + local config = self.db.profile.units.arena + config.indicators.arenaSpec = {enabled = true, anchorPoint = "LC", size = 28, x = 0, y = 0, anchorTo = "$parent"} + config.indicators.lfdRole = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = 14, anchorTo = "$parent"} + end + if( revision <= 45 ) then for unit, config in pairs(self.db.profile.units) do if( config.auras ) then @@ -479,6 +484,10 @@ function ShadowUF:LoadUnits() self.Units:UninitializeFrame(type) end end + + if( instanceType == "arena" ) then + self.Units:InitializeArena() + end end function ShadowUF:LoadUnitDefaults() @@ -610,6 +619,8 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.arena.auras.debuffs.maxRows = 1 self.defaults.profile.units.arena.auras.buffs.maxRows = 1 self.defaults.profile.units.arena.offset = 0 + self.defaults.profile.units.arena.indicators.arenaSpec = {enabled = true, size = 0, x = 0, y = 0} + self.defaults.profile.units.arena.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} -- BATTLEGROUND self.defaults.profile.units.battleground.enabled = false self.defaults.profile.units.battleground.attribPoint = "TOP" @@ -914,6 +925,8 @@ function ShadowUF:HideBlizzardFrames() hideRaid() CompactRaidFrameContainer:HookScript("OnShow", hideRaid) CompactRaidFrameManager:HookScript("OnShow", hideRaid) + elseif( not self.db.profile.hidden.raid and not InCombatLockdown() ) then + CompactRaidFrameManager:SetFrameStrata("DIALOG") end end diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 872277ab..d57c0750 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -470,6 +470,10 @@ function ShadowUF:LoadDefaultLayout(useMerge) buffs = {enabled = true, maxRows = 1, perRow = 9}, debuffs = {enabled = true, maxRows = 1, perRow = 9}, }, + indicators = { + pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, + arenaSpec = {anchorTo = "$parent", anchorPoint = "LC", size = 28, x = 0, y = 0} + }, text = { {text = "[name]"}, {text = "[curmaxhp]"}, diff --git a/modules/empty.lua b/modules/empty.lua index a9156cb5..d0438a58 100755 --- a/modules/empty.lua +++ b/modules/empty.lua @@ -52,7 +52,7 @@ function Empty:UpdateColor(frame) end end elseif( ShadowUF.db.profile.units[frame.unitType].emptyBar.class and ( UnitIsPlayer(frame.unit) or UnitCreatureFamily(frame.unit) ) ) then - local class = UnitCreatureFamily(frame.unit) or select(2, UnitClass(frame.unit)) + local class = UnitCreatureFamily(frame.unit) or frame:UnitClassToken() color = class and ShadowUF.db.profile.classColors[class] end diff --git a/modules/health.lua b/modules/health.lua index ac8fb602..46676e83 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -87,7 +87,7 @@ function Health:UpdateColor(frame) end end elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorType == "class" and ( UnitIsPlayer(unit) or UnitCreatureFamily(unit) ) ) then - local class = UnitCreatureFamily(frame.unit) or select(2, UnitClass(frame.unit)) + local class = UnitCreatureFamily(frame.unit) or frame:UnitClassToken() color = class and ShadowUF.db.profile.classColors[class] elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorType == "static" ) then color = ShadowUF.db.profile.healthColors.static diff --git a/modules/indicators.lua b/modules/indicators.lua index ff0092cc..3a403c40 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -1,11 +1,24 @@ -local Indicators = {list = {"status", "pvp", "leader", "resurrect", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class", "phase", "questBoss", "petBattle"}} +local Indicators = {list = {"status", "pvp", "leader", "resurrect", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class", "phase", "questBoss", "petBattle", "arenaSpec"}} ShadowUF:RegisterModule(Indicators, "indicators", ShadowUF.L["Indicators"]) +function Indicators:UpdateArenaSpec(frame) + if( not frame.indicators.arenaSpec or not frame.indicators.arenaSpec.enabled ) then return end + + local specID = GetArenaOpponentSpec(frame.unitID) + local specIcon = specID and select(4, GetSpecializationInfoByID(specID)) + if( specIcon ) then + frame.indicators.arenaSpec:SetTexture(specIcon) + frame.indicators.arenaSpec:Show() + else + frame.indicators.arenaSpec:Hide() + end +end + function Indicators:UpdateClass(frame) if( not frame.indicators.class or not frame.indicators.class.enabled ) then return end - local class = select(2, UnitClass(frame.unit)) + local class = frame:UnitClassToken() if( UnitIsPlayer(frame.unit) and class ) then local coords = CLASS_BUTTONS[class] frame.indicators.class:SetTexture("Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes") @@ -75,7 +88,14 @@ end function Indicators:UpdateLFDRole(frame, event) if( not frame.indicators.lfdRole or not frame.indicators.lfdRole.enabled ) then return end - local role = UnitGroupRolesAssigned(frame.unitOwner) + local role + if( frame.unitType ~= "arena" ) then + role = UnitGroupRolesAssigned(frame.unitOwner) + else + local specID = GetArenaOpponentSpec(frame.unitID) + role = specID and select(6, GetSpecializationInfoByID(specID)) + end + if( role == "TANK" ) then frame.indicators.lfdRole:SetTexCoord(0, 19/64, 22/64, 41/64) frame.indicators.lfdRole:Show() @@ -301,6 +321,12 @@ function Indicators:OnEnable(frame) frame.indicators:SetScript("OnUpdate", nil) end + if( config.indicators.arenaSpec and config.indicators.arenaSpec.enabled ) then + frame:RegisterUnitEvent("ARENA_OPPONENT_UPDATE", self, "UpdateArenaSpec") + frame:RegisterUpdateFunc(self, "UpdateArenaSpec") + frame.indicators.arenaSpec = frame.indicators.arenaSpec or frame.indicators:CreateTexture(nil, "OVERLAY") + end + if( config.indicators.phase and config.indicators.phase.enabled ) then -- Player phase changes do not generate a phase change event. This seems to be the best frame:RegisterNormalEvent("UPDATE_WORLD_STATES", self, "UpdatePhase") diff --git a/modules/movers.lua b/modules/movers.lua index 0feae4c1..021af3d0 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -37,6 +37,9 @@ local function createConfigEnv() return getValue("UnitBattlePetType", unit, math.random(#(PET_TYPE_SUFFIX))) end end, + GetArenaOpponentSpec = function(unitID) + return getValue("GetArenaOpponentSpec", unitID, math.random(250, 270)) + end, UnitHealthMax = function(unit) return 50000 end, UnitPower = function(unit, powerType) if( powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS ) then diff --git a/modules/portrait.lua b/modules/portrait.lua index 53df29fd..73930164 100755 --- a/modules/portrait.lua +++ b/modules/portrait.lua @@ -61,10 +61,9 @@ end function Portrait:Update(frame, event) local type = ShadowUF.db.profile.units[frame.unitType].portrait.type - -- Use class thingy if( type == "class" ) then - local classToken = select(2, UnitClass(frame.unitOwner)) + local classToken = frame:UnitClassToken() if( classToken ) then frame.portrait:SetTexture("Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes") frame.portrait:SetTexCoord(CLASS_ICON_TCOORDS[classToken][1], CLASS_ICON_TCOORDS[classToken][2], CLASS_ICON_TCOORDS[classToken][3], CLASS_ICON_TCOORDS[classToken][4]) diff --git a/modules/power.lua b/modules/power.lua index beb48209..732bc309 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -31,7 +31,7 @@ function Power:UpdateColor(frame) if( frame.powerBar.minusMob ) then color = ShadowUF.db.profile.healthColors.offline elseif( ShadowUF.db.profile.units[frame.unitType].powerBar.colorType == "class" and UnitIsPlayer(frame.unit) ) then - local class = select(2, UnitClass(frame.unit)) + local class = frame:UnitClassToken() color = class and ShadowUF.db.profile.classColors[class] end diff --git a/modules/units.lua b/modules/units.lua index 96f8bcab..892da2a5 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -209,6 +209,12 @@ end Units.OnEvent = OnEvent -- Do a full update OnShow, and stop watching for events when it's not visible +local function OnShowForced(self) + -- Reset the event handler + self:SetScript("OnEvent", OnEvent) + self:FullUpdate() +end + local function OnShow(self) -- Reset the event handler self:SetScript("OnEvent", OnEvent) @@ -531,13 +537,14 @@ OnAttributeChanged = function(self, name, unit) self:RegisterUnitEvent("UNIT_TARGETABLE_CHANGED", self, "FullUpdate") self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") - -- Update arena/battleground - elseif( self.unitType == "arena" or self.unitType == "battleground" ) then - self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") + -- Update arena + elseif( self.unitType == "arena" ) then + self:RegisterUnitEvent("UNIT_NAME_UPDATE", self, "FullUpdate") + self:RegisterUnitEvent("UNIT_CONNECTION", self, "FullUpdate") - if( self.unitType == "arena" ) then - self:RegisterUnitEvent("ARENA_OPPONENT_UPDATE", self, "FullUpdate") - end + -- Update battleground + elseif( self.unitType == "battleground" ) then + self:RegisterUnitEvent("UNIT_NAME_UPDATE", Units, "CheckUnitStatus") -- Check for a unit guid to do a full update elseif( self.unitRealType == "raid" ) then @@ -673,6 +680,15 @@ local function SUF_OnEnter(self) end -- Create the generic things that we want in every secure frame regardless if it's a button or a header +local function ClassToken(self) + return (select(2, UnitClass(self.unit))) +end + +local function ArenaClassToken(self) + local specID = GetArenaOpponentSpec(self.unitID) + return specID and select(7, GetSpecializationInfoByID(specID)) +end + function Units:CreateUnit(...) local frame = select("#", ...) > 1 and CreateFrame(...) or select(1, ...) frame.fullUpdates = {} @@ -693,8 +709,9 @@ function Units:CreateUnit(...) frame.SetBlockColor = SetBlockColor frame.FullUpdate = FullUpdate frame.SetVisibility = SetVisibility + frame.UnitClassToken = ClassToken frame.topFrameLevel = 5 - + -- Ensures that text is the absolute highest thing there is frame.highFrame = CreateFrame("Frame", nil, frame) frame.highFrame:SetFrameLevel(frame.topFrameLevel + 2) @@ -1162,6 +1179,10 @@ function Units:LoadZoneHeader(type) frame:SetAttribute("unit", unit) frame:SetAttribute("unitID", id) frame:Hide() + + -- Override with our arena specific concerns + frame.UnitClassToken = ArenaClassToken + frame:SetScript("OnShow", OnShowForced) headerFrame.children[id] = frame headerFrame:SetFrameRef("child" .. id, frame) @@ -1387,6 +1408,21 @@ function Units:CreateBar(parent) return bar end +-- Handle showing for the arena prep frames +function Units:InitializeArena() + if( not headerFrames.arena or InCombatLockdown() ) then return end + + local specs = GetNumArenaOpponentSpecs() + if( not specs or specs == 0 ) then return end + + for i=1, specs do + local frame = headerFrames.arena.children[i] + frame:SetAttribute("state-unitexists", true) + frame:Show() + frame:FullUpdate() + end +end + -- Deal with zone changes for enabling modules local instanceType, queueZoneCheck function Units:CheckPlayerZone(force) @@ -1454,6 +1490,7 @@ end local function checkSymbiosisSpells() if( not symbiosisSpells ) then return end + if( ShadowUF.IS_WOD ) then return false end local changed = false for type, spellID in pairs(symbiosisSpells) do @@ -1467,12 +1504,15 @@ local function checkSymbiosisSpells() return changed end + local centralFrame = CreateFrame("Frame") centralFrame:RegisterEvent("PLAYER_REGEN_ENABLED") centralFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") centralFrame:RegisterEvent("PLAYER_LOGIN") centralFrame:RegisterEvent("PLAYER_LEVEL_UP") centralFrame:RegisterEvent("CINEMATIC_STOP") +centralFrame:RegisterEvent("ARENA_PREP_OPPONENT_SPECIALIZATIONS") +centralFrame:RegisterEvent("ARENA_OPPONENT_UPDATE") centralFrame:SetScript("OnEvent", function(self, event, unit) -- Check if the player changed zone types and we need to change module status, while they are dead -- we won't change their zone type as releasing from an instance will change the zone type without them @@ -1483,7 +1523,11 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) else self:UnregisterEvent("PLAYER_UNGHOST") Units:CheckPlayerZone() - end + end + + -- Force update frames + elseif( event == "ARENA_PREP_OPPONENT_SPECIALIZATIONS" or event == "ARENA_OPPONENT_UPDATE" ) then + Units:InitializeArena() -- They're alive again so they "officially" changed zone types now elseif( event == "PLAYER_UNGHOST" ) then diff --git a/options/config.lua b/options/config.lua index 27fdd7c3..c8747c8f 100755 --- a/options/config.lua +++ b/options/config.lua @@ -50,14 +50,16 @@ local PAGE_DESC = { ["tags"] = L["Advanced tag management, allows you to add your own custom tags."], ["filter"] = L["Simple aura filtering by whitelists and blacklists."], } -local INDICATOR_NAMES = {["questBoss"] = L["Quest Boss"], ["leader"] = L["Leader / Assist"], ["lfdRole"] = L["Dungeon Role"], ["masterLoot"] = L["Master Looter"], ["pvp"] = L["PvP Flag"], ["raidTarget"] = L["Raid Target"], ["ready"] = L["Ready Status"], ["role"] = L["Raid Role"], ["status"] = L["Combat Status"], ["class"] = L["Class Icon"], ["resurrect"] = L["Resurrect Status"], ["phase"] = L["Other Party/Phase Status"], ["petBattle"] = L["Pet Battle"]} +local INDICATOR_NAMES = {["questBoss"] = L["Quest Boss"], ["leader"] = L["Leader / Assist"], ["lfdRole"] = L["Class Role"], ["masterLoot"] = L["Master Looter"], ["pvp"] = L["PvP Flag"], ["raidTarget"] = L["Raid Target"], ["ready"] = L["Ready Status"], ["role"] = L["Raid Role"], ["status"] = L["Combat Status"], ["class"] = L["Class Icon"], ["resurrect"] = L["Resurrect Status"], ["phase"] = L["Other Party/Phase Status"], ["petBattle"] = L["Pet Battle"], ["arenaSpec"] = L["Arena Spec"]} local AREA_NAMES = {["arena"] = L["Arenas"],["none"] = L["Everywhere else"], ["party"] = L["Party instances"], ["pvp"] = L["Battleground"], ["raid"] = L["Raid instances"]} local INDICATOR_DESC = { - ["leader"] = L["Crown indicator for group leader or assistants."], ["lfdRole"] = L["Role the unit is playing in dungeons formed through the Looking For Dungeon system."], + ["leader"] = L["Crown indicator for group leader or assistants."], ["lfdRole"] = L["Role the unit is playing."], ["masterLoot"] = L["Bag indicator for master looters."], ["pvp"] = L["PVP flag indicator, Horde for Horde flagged pvpers and Alliance for Alliance flagged pvpers."], ["raidTarget"] = L["Raid target indicator."], ["ready"] = L["Ready status of group members."], ["phase"] = L["Shows when a party member is in a different phase or another group."], ["questBoss"] = L["Shows that a NPC is a boss for a quest."], ["petBattle"] = L["Shows what kind of pet the unit is for pet battles."], - ["role"] = L["Raid role indicator, adds a shield indicator for main tanks and a sword icon for main assists."], ["status"] = L["Status indicator, shows if the unit is currently in combat. For the player it will also show if you are rested."], ["class"] = L["Class icon for players."]} + ["role"] = L["Raid role indicator, adds a shield indicator for main tanks and a sword icon for main assists."], ["status"] = L["Status indicator, shows if the unit is currently in combat. For the player it will also show if you are rested."], ["class"] = L["Class icon for players."], + ["arenaSpec"] = L["Talent spec of your arena opponents."] +} local TAG_GROUPS = {["classification"] = L["Classifications"], ["health"] = L["Health"], ["misc"] = L["Miscellaneous"], ["playerthreat"] = L["Player threat"], ["power"] = L["Power"], ["status"] = L["Status"], ["threat"] = L["Threat"], ["raid"] = L["Raid"], ["classspec"] = L["Class Specific"], ["classtimer"] = L["Class Timer"]} local pointPositions = {["BOTTOM"] = L["Bottom"], ["TOP"] = L["Top"], ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["TOPLEFT"] = L["Top Left"], ["TOPRIGHT"] = L["Top Right"], ["BOTTOMLEFT"] = L["Bottom Left"], ["BOTTOMRIGHT"] = L["Bottom Right"], ["CENTER"] = L["Center"]} From ef4af3a3cb01db19acc7665ebcea088f2fc14849 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 12 Oct 2014 21:03:49 -0700 Subject: [PATCH 546/794] Fixed labeling for enlarging stealable/dispellable auras to be less confusing --- modules/auras.lua | 50 ---------------------------------------------- options/config.lua | 13 ++++++------ 2 files changed, 7 insertions(+), 56 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index fdf7e254..c57fd047 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -1,5 +1,4 @@ local Auras = {} -local stealableColor = {r = 1, g = 1, b = 1} local playerUnits = {player = true, vehicle = true, pet = true} local mainHand, offHand, ranged, tempEnchantScan = {time = 0}, {time = 0}, {time = 0} local canCure = ShadowUF.Units.canCure @@ -523,56 +522,7 @@ local function categorizeAura(type, curable, auraType, caster, isRemovable, shou end end -local monitor = false -function ShadowUF:StartMonitor() - monitor = true - self.db.global.auraDebug = {} - self.db.global.auraConfig = {} - self:Print("Monitor started, WARNING. Make sure you type /script ShadowUF:StopMonitor(); once you've finished") -end - -function ShadowUF:StopMonitor() - self:Print("Monitor stopped, do a /console reloadui then send your ShadowedUnitFrames.lua to Shadowed") - monitor = false -end - local function renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) - if( monitor ) then - local unit = frame.parent.unit - - ShadowUF.db.global.auraConfig[unit] = ShadowUF.db.global.auraConfig[unit] or {} - ShadowUF.db.global.auraConfig[unit][type] = config.show - - ShadowUF.db.global.auraDebug[unit] = ShadowUF.db.global.auraDebug[unit] or {} - - ShadowUF.db.global.auraDebug[unit][spellID] = {} - ShadowUF.db.global.auraDebug[unit][spellID] = { - type = type, - category = categorizeAura(type, curable, auraType, caster, isRemovable, shouldConsolidate, canApplyAura, isBossDebuff), - isFriendly = isFriendly, - curable = curable, - name = name, - rank = rank, - texture = texture, - count = count, - auraType = auraType, - duration = duration, - endTime = endTime, - caster = caster, - isRemovable = not not isRemovable, - shouldConsolidate = not not shouldConsolidate, - canApplyAura = not not canApplyAura, - isBossDebuff = not not isBossDebuff, - canCureFlag = not not canCure[auraType], - isPlayer = not not playerUnits[caster], - whitelisted = not not (parent.whitelist[type] and not parent.whitelist[name] and not parent.whitelist[spellID]), - blacklisted = not not (parent.blacklist[type] and ( parent.blacklist[name] or parent.blacklist[spellID] )), - enlargeRemovable = not not config.enlarge.REMOVABLE, - enlargeSelf = not not config.enlarge.SELF, - enlargeBoss = not not config.enlarge.BOSS - } - end - -- Do our initial list check to see if we can quick filter it out if( parent.whitelist[type] and not parent.whitelist[name] and not parent.whitelist[spellID] ) then return end if( parent.blacklist[type] and ( parent.blacklist[name] or parent.blacklist[spellID] ) ) then return end diff --git a/options/config.lua b/options/config.lua index c8747c8f..33086e0f 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1365,9 +1365,10 @@ local function loadGeneralOptions() removableColor = { order = 0, type = "color", - name = L["Stealable or Removable"], - desc = L["Border coloring of stealable or removable auras."], + name = L["Stealable/Curable/Dispellable"], + desc = L["Border coloring of stealable, curable and dispellable auras."], arg = "auraColors.removable", + width = "double" } } }, @@ -2198,10 +2199,10 @@ local function loadUnitOptions() tbl["BOSS"] = L["Boss Debuffs"] end - if( info[2] ~= "player" ) then - tbl["REMOVABLE"] = L["Removable/Stealable"] - else - tbl["REMOVABLE"] = L["Removable"] + if( type == "debuffs" ) then + tbl["REMOVABLE"] = L["Curable"] + elseif( info[2] ~= "player" and info[2] ~= "pet" and info[2] ~= "party" and info[2] ~= "raid" and type == "buffs" ) then + tbl["REMOVABLE"] = L["Dispellable/Stealable"] end return tbl; From 1221d6924fb1694b5a9ed47ed2eaac844cfbd4cb Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 12 Oct 2014 21:30:56 -0700 Subject: [PATCH 547/794] Remove the LFD Cooldown strata change as it causes issues (apparently nevs fault!) --- ShadowedUnitFrames.lua | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index bc8dc242..0ce1a3e4 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -982,19 +982,6 @@ function ShadowUF:HideBlizzardFrames() hideBlizzardFrames(false, PlayerPowerBarAlt) end - -- fix LFD Cooldown Frame - -- this is technically not our problem, but due to having the frames on the same strata, it looks like this to the users - -- and the fix is simple enough - if( not active_hiddens.lfd ) then - active_hiddens.lfd = true - - LFDQueueFrameCooldownFrame:SetFrameLevel(QueueStatusFrame:GetFrameLevel() + 20) - LFDQueueFrameCooldownFrame:SetFrameStrata("TOOLTIP") - - QueueStatusFrame:SetFrameLevel(QueueStatusFrame:GetFrameLevel() + 20) - QueueStatusFrame:SetFrameStrata("TOOLTIP") - end - -- As a reload is required to reset the hidden hooks, we can just set this to true if anything is true for type, flag in pairs(self.db.profile.hidden) do if( flag ) then From 9e0fe167b6bef711b41883ee6003abb61aee6135 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 12 Oct 2014 21:46:54 -0700 Subject: [PATCH 548/794] TOC Bump to 60000 --- ShadowedUnitFrames.toc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index fdeba561..eb4e56cf 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ -## Interface: 50400 +## Interface: 60000 ## Title: Shadowed Unit Frames -## Notes: Now with 300% more shadows than the leading competitors +## Notes: Does anyone read this? It's been totaly inane things for the last 5 years. ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB From 94293ada47972a286dd8b532ee5e8a139a7f8f52 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 12 Oct 2014 21:56:46 -0700 Subject: [PATCH 549/794] Fixed casts not being shown as interruptible --- modules/cast.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/cast.lua b/modules/cast.lua index 5d631c8d..4d763b70 100755 --- a/modules/cast.lua +++ b/modules/cast.lua @@ -9,7 +9,7 @@ local function monitorFakeCast(self) local spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(self.parent.unit) local isChannelled if( not spell ) then - spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitChannelInfo(self.parent.unit) + spell, rank, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible = UnitChannelInfo(self.parent.unit) isChannelled = true end @@ -18,7 +18,7 @@ local function monitorFakeCast(self) self.endTime = endTime self.notInterruptible = notInterruptible self.spellName = spell - Cast:UpdateCast(self.parent, self.parent.unit, isChannelled, spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, notInterruptible) + Cast:UpdateCast(self.parent, self.parent.unit, isChannelled, spell, rank, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible) -- Cast stopped elseif( self.endTime and not endTime ) then if( GetTime() <= (self.endTime / 1000) ) then @@ -262,7 +262,8 @@ end function Cast:UpdateCurrentCast(frame) if( UnitCastingInfo(frame.unit) ) then - self:UpdateCast(frame, frame.unit, false, UnitCastingInfo(frame.unit)) + local name, subText, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(frame.unit) + self:UpdateCast(frame, frame.unit, false, name, subText, text, texture, startTime, endTime, isTradeSkill, notInterruptible) elseif( UnitChannelInfo(frame.unit) ) then self:UpdateCast(frame, frame.unit, true, UnitChannelInfo(frame.unit)) else @@ -281,11 +282,13 @@ end -- Cast updated/changed function Cast:EventUpdateCast(frame) - self:UpdateCast(frame, frame.unit, false, UnitCastingInfo(frame.unit)) + local name, subText, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(frame.unit) + self:UpdateCast(frame, frame.unit, false, name, subText, text, texture, startTime, endTime, isTradeSkill, notInterruptible) end function Cast:EventDelayCast(frame) - self:UpdateDelay(frame, UnitCastingInfo(frame.unit)) + local name, subText, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(frame.unit) + self:UpdateDelay(frame, name, subText, text, texture, startTime, endTime, isTradeSkill, notInterruptible) end -- Channel updated/changed @@ -386,7 +389,7 @@ function Cast:UpdateDelay(frame, spell, rank, displayName, icon, startTime, endT end -- Update the actual bar -function Cast:UpdateCast(frame, unit, channelled, spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, notInterruptible) +function Cast:UpdateCast(frame, unit, channelled, spell, rank, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible) if( not spell ) then return end local cast = frame.castBar.bar if( ShadowUF.db.profile.units[frame.unitType].castBar.autoHide ) then From 51e6151247cebef19e2a012e04f2ed60a32c043d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 13 Oct 2014 17:29:57 -0700 Subject: [PATCH 550/794] Fixed an error when disabling fake unit cast bars --- modules/cast.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/cast.lua b/modules/cast.lua index 4d763b70..7dd00fc4 100755 --- a/modules/cast.lua +++ b/modules/cast.lua @@ -163,7 +163,8 @@ function Cast:OnDisable(frame, unit) frame:UnregisterAll(self) if( frame.castBar ) then - if( frame.castBar.monitor ) then frame.castBar.monitor:Hide() end + if( frame.castBar.monitor ) then frame.castBar.monitor:Stop() end + frame.castBar.bar.name:Hide() frame.castBar.bar.time:Hide() frame.castBar.bar:Hide() From 19a5406dd478046bf3cf304e9b51652998af8854 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 15 Oct 2014 09:20:47 -0700 Subject: [PATCH 551/794] Bump TOC for the options addon --- options/ShadowedUF_Options.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index 446f0c8f..a8b64645 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 50400 +## Interface: 60000 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From f677fe8ec66a10f23de6a10fd80ceda4d3cc62e6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 15 Oct 2014 22:11:14 -0700 Subject: [PATCH 552/794] Fixed cooldown rings not showing up --- modules/auras.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index c57fd047..fd5ef160 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -223,10 +223,11 @@ local function updateButton(id, group, config) button:SetScript("OnLeave", hideTooltip) button:RegisterForClicks("RightButtonUp") - button.cooldown = CreateFrame("Cooldown", group.parent:GetName() .. "Aura" .. group.type .. id .. "Cooldown", button) + button.cooldown = CreateFrame("Cooldown", group.parent:GetName() .. "Aura" .. group.type .. id .. "Cooldown", button, "CooldownFrameTemplate") button.cooldown:SetAllPoints(button) button.cooldown:SetReverse(true) button.cooldown:SetFrameLevel(7) + button.cooldown:SetEdgeTexture("", 0, 0, 0, 0) button.cooldown:Hide() button.stack = button:CreateFontString(nil, "OVERLAY") From 6ea34b4e3c191780ce1cda0191412b19272d2538 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 16 Oct 2014 20:43:26 -0700 Subject: [PATCH 553/794] Work around cooldown circles not inheriting alpha for combat fader --- modules/auras.lua | 6 ++++-- modules/fader.lua | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index fd5ef160..b3ae290c 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -226,8 +226,10 @@ local function updateButton(id, group, config) button.cooldown = CreateFrame("Cooldown", group.parent:GetName() .. "Aura" .. group.type .. id .. "Cooldown", button, "CooldownFrameTemplate") button.cooldown:SetAllPoints(button) button.cooldown:SetReverse(true) - button.cooldown:SetFrameLevel(7) - button.cooldown:SetEdgeTexture("", 0, 0, 0, 0) + button.cooldown:SetDrawEdge(false) + button.cooldown:SetDrawSwipe(true) + button.cooldown:SetHideCountdownNumbers(true) + button.cooldown:SetSwipeColor(0, 0, 0, 0.8) button.cooldown:Hide() button.stack = button:CreateFontString(nil, "OVERLAY") diff --git a/modules/fader.lua b/modules/fader.lua index 0361ff06..e40ece50 100755 --- a/modules/fader.lua +++ b/modules/fader.lua @@ -2,9 +2,28 @@ local Fader = {} local powerDepletes = {[SPELL_POWER_MANA] = true, [SPELL_POWER_ENERGY] = true, [SPELL_POWER_FOCUS] = true} ShadowUF:RegisterModule(Fader, "fader", ShadowUF.L["Combat fader"]) +-- TODO: Remove once Blizzard fixes cooldown wheels not taking parents alpha +local function tempAuraFader(frame, alpha) + if( not frame.auras ) then return end + + local childAlpha = 0.8 * alpha + if( frame.auras.buffs ) then + for id, button in pairs(frame.auras.buffs.buttons) do + button.cooldown:SetSwipeColor(0, 0, 0, childAlpha) + end + end + + if( frame.auras.debuffs ) then + for id, button in pairs(frame.auras.debuffs.buttons) do + button.cooldown:SetSwipeColor(0, 0, 0, childAlpha) + end + end +end + local function faderUpdate(self, elapsed) self.timeElapsed = self.timeElapsed + elapsed if( self.timeElapsed >= self.fadeTime ) then + tempAuraFader(self.parent, self.alphaEnd) self.parent:SetAlpha(self.alphaEnd) self:Hide() @@ -19,6 +38,8 @@ local function faderUpdate(self, elapsed) else self.parent:SetAlpha(((self.fadeTime - self.timeElapsed) / self.fadeTime) * (self.alphaStart - self.alphaEnd) + self.alphaEnd) end + + tempAuraFader(self.parent, self.parent:GetAlpha()) end local function startFading(self, type, alpha, speedyFade) From 17088260de5083a612ab4acb3c367695957f32b9 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 16 Oct 2014 20:45:50 -0700 Subject: [PATCH 554/794] Don't mess with CRF strata --- ShadowedUnitFrames.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 0ce1a3e4..044e88b7 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -925,8 +925,6 @@ function ShadowUF:HideBlizzardFrames() hideRaid() CompactRaidFrameContainer:HookScript("OnShow", hideRaid) CompactRaidFrameManager:HookScript("OnShow", hideRaid) - elseif( not self.db.profile.hidden.raid and not InCombatLockdown() ) then - CompactRaidFrameManager:SetFrameStrata("DIALOG") end end From 0a8c9b22fb59a2721177f49a86241934700ef632 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 16 Oct 2014 20:52:39 -0700 Subject: [PATCH 555/794] Fixed Eclipse left/right direction arrow not working --- modules/eclipse.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/eclipse.lua b/modules/eclipse.lua index 5c18cb0d..69404325 100755 --- a/modules/eclipse.lua +++ b/modules/eclipse.lua @@ -12,7 +12,7 @@ function Eclipse:OnEnable(frame) frame.eclipseBar.marker = CreateFrame("Frame", nil, frame.eclipseBar) frame.eclipseBar.marker:SetPoint("CENTER", frame.eclipseBar) frame.eclipseBar.marker.texture = frame.eclipseBar.marker:CreateTexture(nil, "OVERLAY") - frame.eclipseBar.marker.texture:SetTexture([[Interface\PlayerFrame\UI-DruidEclipse]]) + frame.eclipseBar.marker.texture:SetAtlas("DruidEclipse-Arrow") frame.eclipseBar.marker.texture:SetTexCoord(1.0, 0.914, 0.82, 1.0) frame.eclipseBar.marker.texture:SetBlendMode("ADD") frame.eclipseBar.marker.texture:SetAllPoints(frame.eclipseBar.marker) From 4d62014465f442e796f491fc4924f40874027bcd Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 16 Oct 2014 21:01:05 -0700 Subject: [PATCH 556/794] Fixed polled tags not updating unless you used pre/post append --- modules/tags.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/tags.lua b/modules/tags.lua index 190df6e3..c720e83a 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -181,8 +181,11 @@ local function createTagFunction(tags, resetCache) functionPool[tag] = cachedFunc end + else + frequencyCache[tag] = Tags.defaultFrequents[tag] or ShadowUF.db.profile.tags[tag] and ShadowUF.db.profile.tags[tag].frequency end + -- Figure out the lowest frequency rate we update at if( frequencyCache[tag] ) then lowestFrequency = math.min(lowestFrequency, frequencyCache[tag]) From 24ade2d2fa548d12356c7675fd1e078ef6466795 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 17 Oct 2014 09:24:12 -0700 Subject: [PATCH 557/794] TOC update --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index eb4e56cf..b0005fc5 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ ## Interface: 60000 ## Title: Shadowed Unit Frames -## Notes: Does anyone read this? It's been totaly inane things for the last 5 years. +## Notes: "Debug" code free since '93! ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB From 49fe3288f3cb348258f8b58b41565715e5d26079 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 18 Oct 2014 17:03:15 -0700 Subject: [PATCH 558/794] Redo combo point modules to dynamically create indicators as needed and not rely on the max flag --- modules/combopoints.lua | 158 ++++++++++++++++++++++------------------ 1 file changed, 86 insertions(+), 72 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index c94cd109..9f8773e6 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -3,9 +3,78 @@ ShadowUF:RegisterModule(Combo, "comboPoints", ShadowUF.L["Combo points"]) ShadowUF.ComboPoints = Combo local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBOPOINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local function createIcons(config, pointsFrame, max) + local point, relativePoint + local x, y = 0, 0 + + local pointsConfig = pointsFrame.cpConfig + + if( config.growth == "LEFT" ) then + point, relativePoint = "BOTTOMRIGHT", "BOTTOMLEFT" + x = config.spacing + elseif( config.growth == "RIGHT" ) then + point, relativePoint = "BOTTOMLEFT", "BOTTOMRIGHT" + x = config.spacing + elseif( config.growth == "UP" ) then + point, relativePoint = "BOTTOMLEFT", "TOPLEFT" + y = config.spacing + elseif( config.growth == "DOWN" ) then + point, relativePoint = "TOPLEFT", "BOTTOMLEFT" + y = config.spacing + end + + for id=1, max do + pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") + local texture = pointsFrame.icons[id] + texture:SetTexture(pointsConfig.icon) + texture:SetSize(config.size, config.size) + + if( id > 1 ) then + texture:ClearAllPoints() + texture:SetPoint(point, pointsFrame.icons[id - 1], relativePoint, x, y) + else + texture:ClearAllPoints() + texture:SetPoint("CENTER", pointsFrame, "CENTER", 0, 0) + end + end +end + +local function createBlocks(config, pointsFrame, max) + local pointsConfig = pointsFrame.cpConfig + pointsFrame.visibleBlocks = pointsConfig.max + + -- Position bars, the 5 accounts for borders + local blockWidth = (pointsFrame:GetWidth() - (pointsConfig.max - 1)) / pointsConfig.max + for id=1, pointsConfig.max do + pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") + local texture = pointsFrame.blocks[id] + local color = ShadowUF.db.profile.powerColors[pointsConfig.colorKey or "COMBOPOINTS"] + texture:SetVertexColor(color.r, color.g, color.b, color.a) + texture:SetHorizTile(false) + texture:SetTexture(ShadowUF.Layout.mediaPath.statusbar) + texture:SetHeight(pointsFrame:GetHeight()) + texture:SetWidth(blockWidth) + texture:ClearAllPoints() + + if( config.growth == "LEFT" ) then + if( id > 1 ) then + texture:SetPoint("TOPRIGHT", pointsFrame.blocks[id - 1], "TOPLEFT", -1, 0) + else + texture:SetPoint("TOPRIGHT", pointsFrame, "TOPRIGHT", 0, 0) + end + else + if( id > 1 ) then + texture:SetPoint("TOPLEFT", pointsFrame.blocks[id - 1], "TOPRIGHT", 1, 0) + else + texture:SetPoint("TOPLEFT", pointsFrame, "TOPLEFT", 0, 0) + end + end + end +end + function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) - frame.comboPoints.config = cpConfig + frame.comboPoints.cpConfig = cpConfig frame.comboPointType = cpConfig.key frame:RegisterNormalEvent("UNIT_COMBO_POINTS", self, "Update") frame:RegisterUpdateFunc(self, "Update") @@ -17,9 +86,10 @@ function Combo:OnLayoutApplied(frame, config) if( not pointsFrame ) then return end pointsFrame:SetFrameLevel(frame.topFrameLevel + 1) - - local pointsConfig = pointsFrame.config + + local pointsConfig = pointsFrame.cpConfig config = config[key] + -- Not a bar so set the containers frame configuration if( config and not config.isBar ) then ShadowUF.Layout:ToggleVisibility(pointsFrame, frame.visibility[key]) @@ -39,74 +109,15 @@ function Combo:OnLayoutApplied(frame, config) pointsFrame.blocks = pointsFrame.blocks or {} pointsFrame.points = pointsFrame.blocks - pointsFrame.visibleBlocks = pointsConfig.max - - -- Position bars, the 5 accounts for borders - local blockWidth = (pointsFrame:GetWidth() - (pointsConfig.max - 1)) / pointsConfig.max - for id=1, pointsConfig.max do - pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") - local texture = pointsFrame.blocks[id] - local color = ShadowUF.db.profile.powerColors[pointsConfig.colorKey or "COMBOPOINTS"] - texture:SetVertexColor(color.r, color.g, color.b, color.a) - texture:SetHorizTile(false) - texture:SetTexture(ShadowUF.Layout.mediaPath.statusbar) - texture:SetHeight(pointsFrame:GetHeight()) - texture:SetWidth(blockWidth) - texture:ClearAllPoints() - - if( config.growth == "LEFT" ) then - if( id > 1 ) then - texture:SetPoint("TOPRIGHT", pointsFrame.blocks[id - 1], "TOPLEFT", -1, 0) - else - texture:SetPoint("TOPRIGHT", pointsFrame, "TOPRIGHT", 0, 0) - end - else - if( id > 1 ) then - texture:SetPoint("TOPLEFT", pointsFrame.blocks[id - 1], "TOPRIGHT", 1, 0) - else - texture:SetPoint("TOPLEFT", pointsFrame, "TOPLEFT", 0, 0) - end - end - end + createBlocks(config, pointsFrame, pointsConfig.max) -- guess not, will have to do icons :( else - local point, relativePoint - local x, y = 0, 0 - - if( config.growth == "LEFT" ) then - point, relativePoint = "BOTTOMRIGHT", "BOTTOMLEFT" - x = config.spacing - elseif( config.growth == "RIGHT" ) then - point, relativePoint = "BOTTOMLEFT", "BOTTOMRIGHT" - x = config.spacing - elseif( config.growth == "UP" ) then - point, relativePoint = "BOTTOMLEFT", "TOPLEFT" - y = config.spacing - elseif( config.growth == "DOWN" ) then - point, relativePoint = "TOPLEFT", "BOTTOMLEFT" - y = config.spacing - end - - pointsFrame.icons = pointsFrame.icons or {} pointsFrame.points = pointsFrame.icons - - for id=1, pointsConfig.max do - pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") - local texture = pointsFrame.icons[id] - texture:SetTexture(pointsConfig.icon) - texture:SetSize(config.size, config.size) - - if( id > 1 ) then - texture:ClearAllPoints() - texture:SetPoint(point, pointsFrame.icons[id - 1], relativePoint, x, y) - else - texture:ClearAllPoints() - texture:SetPoint("CENTER", pointsFrame, "CENTER", 0, 0) - end - end - + + createIcons(config, pointsFrame, pointsConfig.max) + -- Position the main frame pointsFrame:SetSize(0.1, 0.1) @@ -121,16 +132,19 @@ end function Combo:UpdateBarBlocks(frame, event, unit, powerType) local pointsFrame = frame[frame.comboPointType] - if( not pointsFrame or not pointsFrame.config.eventType or not pointsFrame.blocks ) then return end - if( event and powerType ~= pointsFrame.config.eventType ) then return end + if( not pointsFrame or not pointsFrame.cpConfig.eventType or not pointsFrame.blocks ) then return end + if( event and powerType ~= pointsFrame.cpConfig.eventType ) then return end + + local max = UnitPowerMax("player", pointsFrame.config.powerType) + if( max == 0 or pointsFrame.visibleBlocks == max ) then return end if( not ShadowUF.db.profile.units[frame.unitType][frame.comboPointType].isBar ) then + createIcons(ShadowUF.db.profile.units[frame.unitType][frame.comboPointType], pointsFrame, max) return + else + createBlocks(ShadowUF.db.profile.units[frame.unitType][frame.comboPointType], pointsFrame, max) end - local max = UnitPowerMax("player", pointsFrame.config.powerType) - if( max == 0 or pointsFrame.visibleBlocks == max ) then return end - local blockWidth = (pointsFrame:GetWidth() - (max - 1)) / max for id=1, max do pointsFrame.blocks[id]:SetWidth(blockWidth) @@ -158,7 +172,7 @@ end function Combo:Update(frame, event, unit, powerType) local key = frame.comboPointType -- Anything power based will have an eventType to filter on - if( event and frame[key].config.eventType and frame[key].config.eventType ~= powerType ) then return end + if( event and frame[key].cpConfig.eventType and frame[key].cpConfig.eventType ~= powerType ) then return end local points = self:GetPoints(unit) From cebb3d1665f2ac75e7373cd75b7338594cdacd59 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 18 Oct 2014 17:08:35 -0700 Subject: [PATCH 559/794] Strip out any WoD specific code --- ShadowedUnitFrames.lua | 1 - modules/shadoworbs.lua | 2 +- modules/units.lua | 41 +---------------------------------------- options/config.lua | 1 - 4 files changed, 2 insertions(+), 43 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 044e88b7..b5571e63 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -3,7 +3,6 @@ ]] ShadowUF = select(2, ...) -ShadowUF.IS_WOD = select(4, GetBuildInfo()) >= 60000 local L = ShadowUF.L ShadowUF.dbRevision = 47 diff --git a/modules/shadoworbs.lua b/modules/shadoworbs.lua index d90b51be..b39bc68f 100755 --- a/modules/shadoworbs.lua +++ b/modules/shadoworbs.lua @@ -1,6 +1,6 @@ local ShadowOrbs = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(ShadowOrbs, "shadowOrbs", ShadowUF.L["Shadow Orbs"], nil, "PRIEST", SPEC_PRIEST_SHADOW, SHADOW_ORBS_SHOW_LEVEL) -local shadowConfig = {max = ShadowUF.IS_WOD and 5 or PRIEST_BAR_NUM_ORBS, key = "shadowOrbs", colorKey = "SHADOWORBS", powerType = SPELL_POWER_SHADOW_ORBS, eventType = "SHADOW_ORBS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local shadowConfig = {max = 5, key = "shadowOrbs", colorKey = "SHADOWORBS", powerType = SPELL_POWER_SHADOW_ORBS, eventType = "SHADOW_ORBS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function ShadowOrbs:OnEnable(frame) frame.shadowOrbs = frame.shadowOrbs or CreateFrame("Frame", nil, frame) diff --git a/modules/units.lua b/modules/units.lua index 892da2a5..4886357f 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1455,7 +1455,7 @@ function Units:CheckPlayerZone(force) end end --- Handle figuring out what auras players can cure and also account for symbiosis which can let you cure additional ones +-- Handle figuring out what auras players can cure local curableSpells = { ["DRUID"] = {[88423] = {"Magic", "Curse", "Poison"}, [2782] = {"Curse", "Poison"}, [2908] = {"Enrage"}}, ["HUNTER"] = {[19801] = {"Magic", "Enrage"}}, @@ -1467,12 +1467,7 @@ local curableSpells = { ["MONK"] = {[115450] = {"Poison", "Disease"}, [115451] = {"Magic"}} } -local symbiosisSpells = { - ["DRUID"] = {["Disease"] = 122288}, -} - curableSpells = curableSpells[select(2, UnitClass("player"))] -symbiosisSpells = symbiosisSpells[select(2, UnitClass("player"))] local function checkCurableSpells() if( not curableSpells ) then return end @@ -1488,23 +1483,6 @@ local function checkCurableSpells() end end -local function checkSymbiosisSpells() - if( not symbiosisSpells ) then return end - if( ShadowUF.IS_WOD ) then return false end - - local changed = false - for type, spellID in pairs(symbiosisSpells) do - local hasSpell = IsPlayerSpell(spellID) - if( ( Units.canCure[type] and not hasSpell ) or ( not Units.canCure[type] and hasSpell ) ) then - changed = true - Units.canCure[type] = hasSpell - end - end - - return changed -end - - local centralFrame = CreateFrame("Frame") centralFrame:RegisterEvent("PLAYER_REGEN_ENABLED") centralFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") @@ -1540,17 +1518,6 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) unitFrames.player:FullUpdate() end - -- Symbiosis for curable changes - elseif( event == "SPELL_UPDATE_USABLE" ) then - local changed = checkSymbiosisSpells() - if( changed ) then - for frame in pairs(ShadowUF.Units.frameList) do - if( frame.unit and frame:IsVisible() ) then - frame:FullUpdate() - end - end - end - -- Monitor talent changes for curable changes elseif( event == "PLAYER_SPECIALIZATION_CHANGED" ) then checkCurableSpells() @@ -1567,14 +1534,8 @@ centralFrame:SetScript("OnEvent", function(self, event, unit) elseif( event == "PLAYER_LOGIN" ) then checkCurableSpells() - checkSymbiosisSpells() - self:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED") - if( symbiosisSpells ) then - self:RegisterEvent("SPELL_UPDATE_USABLE") - end - -- This is slightly hackish, but it suits the purpose just fine for somthing thats rarely called. elseif( event == "PLAYER_REGEN_ENABLED" ) then -- Now do all of the creation for child wrapping diff --git a/options/config.lua b/options/config.lua index 33086e0f..bf22d7ab 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4230,7 +4230,6 @@ local function loadUnitOptions() order = 3, type = "toggle", name = L["Dismissable Totem bars"], - hidden = function() return not ShadowUF.IS_WOD end, desc = function(info) return L["Allows you to disable the totem by right clicking it.|n|nWarning: Inner bars for this unit will not resize in combat if you enable this."] end, From 4aef667b5a47076d423f518d108627d1e3fc9cdb Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 18 Oct 2014 17:12:26 -0700 Subject: [PATCH 560/794] Properly add localcheck.rb to not be packaged --- .pkgmeta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pkgmeta b/.pkgmeta index bad1bea5..c658dff4 100755 --- a/.pkgmeta +++ b/.pkgmeta @@ -30,4 +30,4 @@ externals: ignore: - globalcheck.rb - - localcheck.lua + - localcheck.rb From ded34a7b998619163d28409f83ee8fd3b5ec6534 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 18 Oct 2014 21:13:44 -0700 Subject: [PATCH 561/794] Fixed a combo points error when using SoulShards/ShadowOrbs/HolyPower/Chi --- modules/aurapoints.lua | 2 +- modules/chi.lua | 2 +- modules/holypower.lua | 2 +- modules/shadoworbs.lua | 2 +- modules/soulshards.lua | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index 003c6a5d..e41380d7 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -14,7 +14,7 @@ local auraConfig = {max = trackSpell.max, key = "auraPoints", colorKey = "AURAPO function AuraPoints:OnEnable(frame) frame.auraPoints = frame.auraPoints or CreateFrame("Frame", nil, frame) - frame.auraPoints.config = auraConfig + frame.auraPoints.cpConfig = auraConfig frame.comboPointType = auraConfig.key frame:RegisterUnitEvent("UNIT_AURA", self, "Update") diff --git a/modules/chi.lua b/modules/chi.lua index da198295..1ab8227c 100755 --- a/modules/chi.lua +++ b/modules/chi.lua @@ -4,7 +4,7 @@ local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = SPELL_POW function Chi:OnEnable(frame) frame.chi = frame.chi or CreateFrame("Frame", nil, frame) - frame.chi.config = chiConfig + frame.chi.cpConfig = chiConfig frame.comboPointType = chiConfig.key frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") diff --git a/modules/holypower.lua b/modules/holypower.lua index 0531692e..88194ec2 100755 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -4,7 +4,7 @@ local holyConfig = {max = HOLY_POWER_FULL, key = "holyPower", colorKey = "HOLYPO function HolyPower:OnEnable(frame) frame.holyPower = frame.holyPower or CreateFrame("Frame", nil, frame) - frame.holyPower.config = holyConfig + frame.holyPower.cpConfig = holyConfig frame.comboPointType = holyConfig.key frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") diff --git a/modules/shadoworbs.lua b/modules/shadoworbs.lua index b39bc68f..673ad730 100755 --- a/modules/shadoworbs.lua +++ b/modules/shadoworbs.lua @@ -4,7 +4,7 @@ local shadowConfig = {max = 5, key = "shadowOrbs", colorKey = "SHADOWORBS", powe function ShadowOrbs:OnEnable(frame) frame.shadowOrbs = frame.shadowOrbs or CreateFrame("Frame", nil, frame) - frame.shadowOrbs.config = shadowConfig + frame.shadowOrbs.cpConfig = shadowConfig frame.comboPointType = shadowConfig.key frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") diff --git a/modules/soulshards.lua b/modules/soulshards.lua index 044c705b..65b60bc3 100755 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -4,7 +4,7 @@ local soulsConfig = {max = 4, key = "soulShards", colorKey = "SOULSHARDS", power function Souls:OnEnable(frame) frame.soulShards = frame.soulShards or CreateFrame("Frame", nil, frame) - frame.soulShards.config = soulsConfig + frame.soulShards.cpConfig = soulsConfig frame.comboPointType = soulsConfig.key frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") From 5f87d0b5ba18e5135b95bec9a9eb62fe9b86df1a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 19 Oct 2014 10:13:10 -0700 Subject: [PATCH 562/794] One more CP related error --- modules/combopoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 9f8773e6..94b5888a 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -135,7 +135,7 @@ function Combo:UpdateBarBlocks(frame, event, unit, powerType) if( not pointsFrame or not pointsFrame.cpConfig.eventType or not pointsFrame.blocks ) then return end if( event and powerType ~= pointsFrame.cpConfig.eventType ) then return end - local max = UnitPowerMax("player", pointsFrame.config.powerType) + local max = UnitPowerMax("player", pointsFrame.cpConfig.powerType) if( max == 0 or pointsFrame.visibleBlocks == max ) then return end if( not ShadowUF.db.profile.units[frame.unitType][frame.comboPointType].isBar ) then From d9e809dc1b00aefa81bffba60f85644604277895 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 21 Oct 2014 22:55:45 -0700 Subject: [PATCH 563/794] Combo points have been moved to the Player unit --- ShadowedUnitFrames.lua | 8 +++++++- modules/defaultlayout.lua | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index b5571e63..50213e6d 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 47 +ShadowUF.dbRevision = 48 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -99,6 +99,12 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 47 ) then + local config = self.db.profile.units + config.player.comboPoints = config.target.comboPoints + config.target.comboPoints = nil + end + if( revision <= 46 ) then local config = self.db.profile.units.arena config.indicators.arenaSpec = {enabled = true, anchorPoint = "LC", size = 28, x = 0, y = 0, anchorTo = "$parent"} diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index d57c0750..a3508c3c 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -343,6 +343,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, eclipseBar = {enabled = true, background = true, order = 70, height = 0.75}, + comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, auraPoints = {enabled = false, showAlways = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, demonicFuryBar = {enabled = true, background = false, height = 0.50, order = 70}, burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70}, @@ -795,7 +796,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) incAbsorb = {cap = 1}, healAbsorb = {cap = 1}, castBar = {order = 60}, - comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, indicators = { lfdRole = {enabled = false}, resurrect = {enabled = true, anchorPoint = "RC", size = 28, x = -39, y = -1, anchorTo = "$parent"}, From 794459a151a2b428244f7a844a69172bc0aac2cd Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 25 Oct 2014 09:39:17 -0700 Subject: [PATCH 564/794] Fixed error when unlocking frames as a Shadow Priest --- modules/movers.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/movers.lua b/modules/movers.lua index 021af3d0..e47e31a3 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -49,7 +49,7 @@ local function createConfigEnv() elseif( powerType == SPELL_POWER_CHI) then return 4 elseif( powerType == SPELL_POWER_SHADOW_ORBS ) then - return PRIEST_BAR_NUM_ORBS + return 5 elseif( powerType == SPELL_POWER_BURNING_EMBERS ) then return math.floor(MAX_POWER_PER_EMBER + (MAX_POWER_PER_EMBER / 2)) elseif( powerType == SPELL_POWER_DEMONIC_FURY ) then @@ -75,7 +75,7 @@ local function createConfigEnv() elseif( powerType == SPELL_POWER_LIGHT_FORCE ) then return 4 elseif( powerType == SPELL_POWER_SHADOW_ORBS ) then - return PRIEST_BAR_NUM_ORBS + return 5 elseif( powerType == SPELL_POWER_BURNING_EMBERS ) then return MAX_POWER_PER_EMBER * 3 elseif( powerType == SPELL_POWER_DEMONIC_FURY ) then From 0671d0bccd7b1f1fb0121abb06c6aaa5f9af2ee2 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 25 Oct 2014 09:48:34 -0700 Subject: [PATCH 565/794] Fixed an error when using a fishing pole temporary enchant --- modules/auras.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index b3ae290c..8a6e089c 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -376,6 +376,7 @@ local function updateTemporaryEnchant(frame, slot, tempData, hasEnchant, timeLef -- If there's less than a 750 millisecond differences in the times, we don't need to bother updating. -- Any sort of enchant takes more than 0.750 seconds to cast so it's impossible for the user to have two -- temporary enchants with that little difference, as totems don't really give pulsing auras anymore. + charges = charges or 0 if( tempData.has and ( timeLeft < tempData.time and ( tempData.time - timeLeft ) < 750 ) and charges == tempData.charges ) then return false end -- Some trickys magic, we can't get the start time of temporary enchants easily. @@ -387,7 +388,7 @@ local function updateTemporaryEnchant(frame, slot, tempData, hasEnchant, timeLef tempData.has = hasEnchant tempData.time = timeLeft tempData.charges = charges - + local config = ShadowUF.db.profile.units[frame.parent.unitType].auras[frame.type] -- Create any buttons we need From bb9b7486f8b027941d1ca779cdc9902660ef7a82 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 26 Oct 2014 00:03:04 -0700 Subject: [PATCH 566/794] Updated a few of the range checker spells --- modules/range.lua | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index b8cfc4bc..0d34f1c7 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -1,7 +1,31 @@ local Range = { - friendly = {["WARRIOR"] = GetSpellInfo(3411), ["PRIEST"] = GetSpellInfo(2061), ["DRUID"] = GetSpellInfo(774), ["PALADIN"] = GetSpellInfo(635), ["SHAMAN"] = GetSpellInfo(331), ["WARLOCK"] = GetSpellInfo(5697), ["DEATHKNIGHT"] = GetSpellInfo(49016), ["MAGE"] = GetSpellInfo(475), ["ROGUE"] = GetSpellInfo(57934), ["MONK"] = GetSpellInfo(115450)}, - hostile = {["WARRIOR"] = GetSpellInfo(355), ["PRIEST"] = GetSpellInfo(585), ["DRUID"] = GetSpellInfo(5176), ["PALADIN"] = GetSpellInfo(62124), ["SHAMAN"] = GetSpellInfo(403), ["HUNTER"] = GetSpellInfo(75), ["WARLOCK"] = GetSpellInfo(686), ["DEATHKNIGHT"] = GetSpellInfo(49576), ["MAGE"] = GetSpellInfo(133), ["ROGUE"] = GetSpellInfo(2094), ["MONK"] = GetSpellInfo(115546)}, + friendly = { + ["WARRIOR"] = GetSpellInfo(3411), + ["PRIEST"] = GetSpellInfo(774), + ["DRUID"] = GetSpellInfo(774), + ["PALADIN"] = GetSpellInfo(85673), + ["SHAMAN"] = GetSpellInfo(331), + ["WARLOCK"] = GetSpellInfo(5697), + ["DEATHKNIGHT"] = GetSpellInfo(49016), + ["MAGE"] = GetSpellInfo(475), + ["ROGUE"] = GetSpellInfo(57934), + ["MONK"] = GetSpellInfo(115450) + }, + hostile = { + ["WARRIOR"] = GetSpellInfo(355), + ["PRIEST"] = GetSpellInfo(589), + ["DRUID"] = GetSpellInfo(5176), + ["PALADIN"] = GetSpellInfo(62124), + ["SHAMAN"] = GetSpellInfo(403), + ["HUNTER"] = GetSpellInfo(75), + ["WARLOCK"] = GetSpellInfo(686), + ["DEATHKNIGHT"] = GetSpellInfo(49576), + ["MAGE"] = GetSpellInfo(44614), + ["ROGUE"] = GetSpellInfo(2094), + ["MONK"] = GetSpellInfo(115546) + }, } + ShadowUF:RegisterModule(Range, "range", ShadowUF.L["Range indicator"]) local playerClass = select(2, UnitClass("player")) From 87efc12b9cb718066ba454839a621ad7b66d8030 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 26 Oct 2014 13:29:10 -0700 Subject: [PATCH 567/794] Updated spellID for Mage Arcane Charges --- modules/aurapoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index e41380d7..34042336 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -1,7 +1,7 @@ local AuraPoints = setmetatable({ isComboPoints = true, spells = { - ["MAGE"] = {max = 4, name = GetSpellInfo(114664), filter = "HARMFUL"}, + ["MAGE"] = {max = 4, name = GetSpellInfo(36032), filter = "HARMFUL"}, ["ROGUE"] = {max = 5, name = GetSpellInfo(115189), filter = "HELPFUL"} } }, {__index = ShadowUF.ComboPoints}) From b9c9a287ceca97d41c234b4a6915a3bd6cbcd0d8 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 26 Oct 2014 14:39:58 -0700 Subject: [PATCH 568/794] Redid config a little, range check spells has its own tab and profile config is now on the left menu --- options/config.lua | 143 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 108 insertions(+), 35 deletions(-) diff --git a/options/config.lua b/options/config.lua index bf22d7ab..fc5e709d 100755 --- a/options/config.lua +++ b/options/config.lua @@ -464,17 +464,32 @@ local function loadGeneralOptions() return true end - + local function setRange(info, spell) ShadowUF.db.profile.range[info[#(info)] .. playerClass] = spell and spell ~= "" and spell or nil ShadowUF.Layout:Reload() end - local function getRange(info, spell) + local function getRange(info) local spell = ShadowUF.db.profile.range[info[#(info)] .. playerClass] return spell and spell ~= "" and spell or ShadowUF.modules.range[info[#(info)]][playerClass] end - + + local function rangeWithIcon(info) + local name = getRange(info) + local text = L["Spell Name"] + if( string.match(info[#(info)], "Alt") ) then + text = L["Alternate Spell Name"] + end + + local icon = select(3, GetSpellInfo(name)) + if( not icon ) then + icon = "Interface\\Icons\\Inv_misc_questionmark" + end + + return "|T" .. icon .. ":18:18:0:0|t " .. text + end + local textData = {} local function writeTable(tbl) @@ -959,32 +974,6 @@ local function loadGeneralOptions() }, }, }, - range = { - order = 5, - type = "group", - inline = true, - name = L["Range spells"], - args = { - friendly = { - order = 0, - type = "input", - name = L["Friendly spell"], - desc = L["Name of a friendly spell to check range on friendlies.|n|nThis is automatically set for your current class only."], - validate = validateSpell, - set = setRange, - get = getRange, - }, - hostile = { - order = 1, - type = "input", - name = L["Hostile spell"], - desc = L["Name of a hostile spell to check range on enemies.|n|nThis is automatically set for your current class only."], - validate = validateSpell, - set = setRange, - get = getRange, - }, - }, - }, }, }, color = { @@ -1383,7 +1372,92 @@ local function loadGeneralOptions() }, }, }, - profile = LibStub("AceDBOptions-3.0"):GetOptionsTable(ShadowUF.db, true), + range = { + order = 5, + type = "group", + name = L["Range Checker"], + args = { + help = { + order = 0, + type = "group", + inline = true, + name = L["Help"], + args = { + help = { + order = 0, + type = "description", + name = L["This will be set for your current class only."], + }, + }, + }, + friendly = { + order = 1, + inline = true, + type = "group", + name = L["On Friendly Units"], + args = { + friendly = { + order = 1, + type = "input", + name = rangeWithIcon, + desc = L["Name of a friendly spell to check range."], + validate = validateSpell, + set = setRange, + get = getRange, + }, + spacer = { + order = 2, + type = "description", + width = "normal", + name = "" + }, + friendlyAlt = { + order = 3, + type = "input", + name = rangeWithIcon, + desc = L["Alternatively friendly spell to use to check range."], + hidden = hideAdvancedOption, + validate = validateSpell, + set = setRange, + get = getRange, + }, + } + }, + hostile = { + order = 2, + inline = true, + type = "group", + name = L["On Hostile Units"], + args = { + hostile = { + order = 1, + type = "input", + name = rangeWithIcon, + desc = L["Name of a friendly spell to check range."], + validate = validateSpell, + set = setRange, + get = getRange, + }, + spacer = { + order = 2, + type = "description", + width = "normal", + name = "" + }, + hostileAlt = { + order = 3, + type = "input", + name = rangeWithIcon, + desc = L["Alternatively friendly spell to use to check range."], + hidden = hideAdvancedOption, + validate = validateSpell, + set = setRange, + get = getRange, + }, + } + }, + }, + }, text = { type = "group", order = 6, @@ -1493,11 +1567,6 @@ local function loadGeneralOptions() options.args.general.args.color.args.classColors.args.PET = Config.classTable options.args.general.args.color.args.classColors.args.VEHICLE = Config.classTable - - options.args.general.args.profile.order = 4 - - local LibDualSpec = LibStub("LibDualSpec-1.0") - LibDualSpec:EnhanceOptions(options.args.general.args.profile, ShadowUF.db) end --------------------- @@ -4578,6 +4647,9 @@ local function loadUnitOptions() return true end + + options.args.profile = LibStub("AceDBOptions-3.0"):GetOptionsTable(ShadowUF.db, true) + LibStub("LibDualSpec-1.0"):EnhanceOptions(options.args.profile, ShadowUF.db) options.args.enableUnits = { type = "group", @@ -7399,6 +7471,7 @@ local function loadOptions() -- Ordering options.args.general.order = 1 + options.args.profile.order = 1.5 options.args.enableUnits.order = 2 options.args.units.order = 3 options.args.filter.order = 4 From e88f83f9156afcb8ee7668ec284d7fe5a9a0a65e Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 26 Oct 2014 14:40:21 -0700 Subject: [PATCH 569/794] Fixed cooldown wheels not being alphaed when using the range checker --- modules/units.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/modules/units.lua b/modules/units.lua index 4886357f..d7468499 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -157,17 +157,37 @@ local function UnregisterAll(self, handler) end end +-- TODO: Remove once Blizzard fixes cooldown wheels not taking parents alpha +local function SetAuraAlpha(self, alpha) + if( not self.auras ) then return end + + local childAlpha = 0.8 * alpha + if( self.auras.buffs ) then + for id, button in pairs(self.auras.buffs.buttons) do + button.cooldown:SetSwipeColor(0, 0, 0, childAlpha) + end + end + + if( self.auras.debuffs ) then + for id, button in pairs(self.auras.debuffs.buttons) do + button.cooldown:SetSwipeColor(0, 0, 0, childAlpha) + end + end +end + -- Handles setting alphas in a way so combat fader and range checker don't override each other local function DisableRangeAlpha(self, toggle) self.disableRangeAlpha = toggle if( not toggle and self.rangeAlpha ) then + self:SetAuraAlpha(self.rangeAlpha) self:SetAlpha(self.rangeAlpha) end end local function SetRangeAlpha(self, alpha) if( not self.disableRangeAlpha ) then + self:SetAuraAlpha(alpha) self:SetAlpha(alpha) else self.rangeAlpha = alpha @@ -694,6 +714,7 @@ function Units:CreateUnit(...) frame.fullUpdates = {} frame.registeredEvents = {} frame.visibility = {} + frame.SetAuraAlpha = SetAuraAlpha frame.BlizzRegisterUnitEvent = frame.RegisterUnitEvent frame.RegisterNormalEvent = RegisterNormalEvent frame.RegisterUnitEvent = RegisterUnitEvent From a4cf7326e15df05eea9a90966609d4f935d0d83d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 26 Oct 2014 14:40:40 -0700 Subject: [PATCH 570/794] Redid the range check module and spells, now uses interact distance and you can specify an alt spell too --- globalcheck.rb | 2 +- modules/range.lua | 118 +++++++++++++++++++++++++++++----------------- modules/tags.lua | 1 - 3 files changed, 75 insertions(+), 46 deletions(-) diff --git a/globalcheck.rb b/globalcheck.rb index 9971e8c4..70db0be9 100755 --- a/globalcheck.rb +++ b/globalcheck.rb @@ -21,7 +21,7 @@ end # Anything that we don't use enough or WoW doesn't use enough for it to be trained -$blacklisted = ["ShadowUF", "rawset", "rawget", "setfenv", "getfenv", "math", "GetLocale", "UnitReaction", "LibStub", "loadstring", "print", "IsResting", "UnitAura", "UnitIsFriend", "GetComboPoints", "GetEclipseDirection", "UnitIsTapped", "UnitPlayerControlled", "UnitCreatureFamily", "UnitThreatSituation", "UnitClassification", "UnitInPhase", "IsEveryoneAssistant", "UnitStagger", "RegisterUnitWatch", "UnregisterUnitWatch", "UnitIsVisible", "UnitInRange", "CheckInteractDistance", "GetRuneCooldown", "GetRuneType", "GetTotemInfo", "RegisterStateDriver", "ClickCastHeader", "ClickCastFrames", "IsPlayerSpell", "UnitXP", "GetPetExperience", "GetBuildInfo", "CompactPartyFrame", "hooksecurefunc", "TemporaryEnchantFrame", "PriestBarFrame", "PaladinPowerBar", "EclipseBarFrame", "ShardBarFrame", "RuneFrame", "MonkHarmonyBar", "ComboFrame", "QueueStatusFrame", "LoadAddOn", "UnitIsEnemy"] +$blacklisted = ["ShadowUF", "rawset", "rawget", "setfenv", "getfenv", "math", "GetLocale", "UnitReaction", "LibStub", "loadstring", "print", "IsResting", "UnitAura", "UnitIsFriend", "GetComboPoints", "GetEclipseDirection", "UnitIsTapped", "UnitPlayerControlled", "UnitCreatureFamily", "UnitThreatSituation", "UnitClassification", "UnitInPhase", "IsEveryoneAssistant", "UnitStagger", "RegisterUnitWatch", "UnregisterUnitWatch", "UnitIsVisible", "UnitInRange", "CheckInteractDistance", "GetRuneCooldown", "GetRuneType", "GetTotemInfo", "RegisterStateDriver", "ClickCastHeader", "ClickCastFrames", "IsPlayerSpell", "UnitXP", "GetPetExperience", "GetBuildInfo", "CompactPartyFrame", "hooksecurefunc", "TemporaryEnchantFrame", "PriestBarFrame", "PaladinPowerBar", "EclipseBarFrame", "ShardBarFrame", "RuneFrame", "MonkHarmonyBar", "ComboFrame", "QueueStatusFrame", "LoadAddOn", "UnitIsEnemy", "IsUsableSpell"] # Filter check def filtered?(target) diff --git a/modules/range.lua b/modules/range.lua index 0d34f1c7..52407286 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -1,56 +1,83 @@ local Range = { friendly = { - ["WARRIOR"] = GetSpellInfo(3411), - ["PRIEST"] = GetSpellInfo(774), - ["DRUID"] = GetSpellInfo(774), - ["PALADIN"] = GetSpellInfo(85673), - ["SHAMAN"] = GetSpellInfo(331), - ["WARLOCK"] = GetSpellInfo(5697), - ["DEATHKNIGHT"] = GetSpellInfo(49016), - ["MAGE"] = GetSpellInfo(475), - ["ROGUE"] = GetSpellInfo(57934), - ["MONK"] = GetSpellInfo(115450) + ["PRIEST"] = GetSpellInfo(2061), -- Flash Heal + ["DRUID"] = GetSpellInfo(774), -- Rejuvenation + ["PALADIN"] = GetSpellInfo(85673), -- Word of Glory + ["SHAMAN"] = GetSpellInfo(8004), -- Healing Surge + ["WARLOCK"] = GetSpellInfo(5697), -- Unending Breath + ["DEATHKNIGHT"] = GetSpellInfo(47541), -- Death Coil + ["MAGE"] = GetSpellInfo(475), -- Remove Curse + ["MONK"] = GetSpellInfo(115450) -- Detox }, hostile = { - ["WARRIOR"] = GetSpellInfo(355), - ["PRIEST"] = GetSpellInfo(589), - ["DRUID"] = GetSpellInfo(5176), - ["PALADIN"] = GetSpellInfo(62124), - ["SHAMAN"] = GetSpellInfo(403), - ["HUNTER"] = GetSpellInfo(75), - ["WARLOCK"] = GetSpellInfo(686), - ["DEATHKNIGHT"] = GetSpellInfo(49576), - ["MAGE"] = GetSpellInfo(44614), - ["ROGUE"] = GetSpellInfo(2094), - ["MONK"] = GetSpellInfo(115546) + ["WARRIOR"] = GetSpellInfo(355), -- Taunt + ["PRIEST"] = GetSpellInfo(589), -- Shadow Word: Pain + ["DRUID"] = GetSpellInfo(5176), -- Wrath + ["PALADIN"] = GetSpellInfo(20271), -- Judgement + ["SHAMAN"] = GetSpellInfo(403), -- Lightning Bolt + ["HUNTER"] = GetSpellInfo(75), -- Auto Shot + ["WARLOCK"] = GetSpellInfo(686), -- Shadow Bolt + ["DEATHKNIGHT"] = GetSpellInfo(49576), -- Death Grip + ["MAGE"] = GetSpellInfo(44614), -- Frostfire Bolt + ["ROGUE"] = GetSpellInfo(1725), -- Distract + ["MONK"] = GetSpellInfo(115546) -- Provoke }, + friendlyAlt = {}, + hostileAlt = { + ["MAGE"] = GetSpellInfo(30451) -- Arcane Blast + } } ShadowUF:RegisterModule(Range, "range", ShadowUF.L["Range indicator"]) local playerClass = select(2, UnitClass("player")) -local friendlySpell = Range.friendly[playerClass] -local hostileSpell = Range.hostile[playerClass] +local rangeSpells = {} local function checkRange(self, elapsed) local frame = self.parent - local spell + local oorAlpha = ShadowUF.db.profile.units[frame.unitType].range.oorAlpha + local inAlpha = ShadowUF.db.profile.units[frame.unitType].range.inAlpha - -- Check which spell to use - if( UnitCanAssist("player", frame.unit) ) then - spell = friendlySpell - elseif( UnitCanAttack("player", frame.unit) ) then - spell = hostileSpell + -- Offline + if( not UnitIsConnected(frame.unit) ) then + frame:SetRangeAlpha(oorAlpha) + return + -- Hostile spell + elseif( rangeSpells.hostile and UnitCanAttack("player", frame.unit) and IsSpellInRange(rangeSpells.hostile) == 1 ) then + frame:SetRangeAlpha(inAlpha) + return + -- Friendly spell + elseif( rangeSpells.friendly and UnitCanAssist("player", frame.unit) and IsSpellInRange(rangeSpells.friendly, frame.unit) == 1 ) then + frame:SetRangeAlpha(inAlpha) + return + -- Use the built in UnitInRange + elseif( UnitInRaid(frame.unit) or UnitInParty(frame.unit) ) then + frame:SetRangeAlpha(UnitInRange(frame.unit, "player") and inAlpha or oorAlpha) + return end - if( spell ) then - frame:SetRangeAlpha(IsSpellInRange(spell, frame.unit) == 1 and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) - -- That didn't work, but they are grouped lets try the actual API for this, it's a bit flaky though and not that useful generally - elseif( UnitInRaid(frame.unit) or UnitInParty(frame.unit) ) then - frame:SetRangeAlpha(UnitInRange(frame.unit, "player") and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) - -- Nope, fall back to interaction :( - else - frame:SetRangeAlpha(CheckInteractDistance(frame.unit, 4) and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) + -- Interact + if( CheckInteractDistance(frame.unit, 2) ) then + frame:SetRangeAlpha(inAlpha) + return + end + + frame:SetRangeAlpha(oorAlpha) +end + +local function updateSpellCache(type) + rangeSpells[type] = nil + if( IsUsableSpell(ShadowUF.db.profile.range[type .. playerClass]) ) then + rangeSpells[type] = ShadowUF.db.profile.range[type .. playerClass] + + elseif( IsUsableSpell(ShadowUF.db.profile.range[type .. "Alt" .. playerClass]) ) then + rangeSpells[type] = ShadowUF.db.profile.range[type .. "Alt" .. playerClass] + + elseif( IsUsableSpell(Range[type][playerClass]) ) then + rangeSpells[type] = Range[type][playerClass] + + elseif( IsUsableSpell(Range[type .. "Alt"][playerClass]) ) then + rangeSpells[type] = Range[type .. "Alt"][playerClass] end end @@ -72,17 +99,14 @@ function Range:OnEnable(frame) frame.range.timer.parent = frame end - frame.range:Show() - + frame:RegisterNormalEvent("PLAYER_SPECIALIZATION_CHANGED", self, "SpellChecks") frame:RegisterUpdateFunc(self, "ForceUpdate") + + frame.range:Show() end function Range:OnLayoutApplied(frame) - hostileSpell = ShadowUF.db.profile.range["hostile" .. playerClass] or self.hostile[playerClass] - if( not GetSpellInfo(hostileSpell) ) then hostileSpell = nil end - - friendlySpell = ShadowUF.db.profile.range["friendly" .. playerClass] or self.friendly[playerClass] - if( not GetSpellInfo(friendlySpell) ) then friendlySpell = nil end + self:SpellChecks() end function Range:OnDisable(frame) @@ -93,3 +117,9 @@ function Range:OnDisable(frame) frame:SetRangeAlpha(1.0) end end + + +function Range:SpellChecks(frame) + updateSpellCache("friendly") + updateSpellCache("hostile") +end \ No newline at end of file diff --git a/modules/tags.lua b/modules/tags.lua index c720e83a..8627281d 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1,4 +1,3 @@ --- Thanks to haste for the original tagging code, which I then mostly ripped apart and stole! local Tags = {afkStatus = {}, offlineStatus = {}, customEvents = {}, powerMap = {}, moduleKey = "tags"} local tagPool, functionPool, temp, regFontStrings, powerMap = {}, {}, {}, {}, Tags.powerMap local L = ShadowUF.L From e08a5e3e8e8393d7b5215f92590f07a9b338dcbb Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 26 Oct 2014 19:31:03 -0700 Subject: [PATCH 571/794] Fixed enlarge curable debuffs not working --- modules/auras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index 8a6e089c..0fa28ebe 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -561,7 +561,7 @@ local function renderAura(parent, frame, type, config, displayConfig, index, fil end -- Enlarge auras - if( ( category == "player" and config.enlarge.SELF ) or ( category == "boss" and config.enlarge.BOSS ) or ( isRemovable and not isFriendly and config.enlarge.REMOVABLE ) ) then + if( ( category == "player" and config.enlarge.SELF ) or ( category == "boss" and config.enlarge.BOSS ) or ( config.enlarge.REMOVABLE and ( ( isRemovable and not isFriendly ) or ( curable and canCure[auraType]) ) ) ) then button.isSelfScaled = true button:SetScale(config.selfScale) else From 2295ed92ed516c5cd95a24b4888e6a7f9297e476 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 3 Nov 2014 22:25:14 -0800 Subject: [PATCH 572/794] Check IsUsableSpell instead of IsPlayerSpell for curable auras --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index d7468499..8647ea17 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1496,7 +1496,7 @@ local function checkCurableSpells() table.wipe(Units.canCure) for spellID, cures in pairs(curableSpells) do - if( IsPlayerSpell(spellID) ) then + if( IsUsableSpell(spellID) ) then for _, type in pairs(cures) do Units.canCure[type] = true end From 085b772daeb074d041cb40f2368ffb58c24ff474 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 3 Nov 2014 22:27:15 -0800 Subject: [PATCH 573/794] Death Knights no longer have a controllable temporary pet --- modules/combopoints.lua | 2 +- modules/totems.lua | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 94b5888a..d7b5f7df 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -27,7 +27,7 @@ local function createIcons(config, pointsFrame, max) pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.icons[id] texture:SetTexture(pointsConfig.icon) - texture:SetSize(config.size, config.size) + texture:SetSize(config.size or 24, config.size or 24) if( id > 1 ) then texture:ClearAllPoints() diff --git a/modules/totems.lua b/modules/totems.lua index 5adc59fd..fd2127d8 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -4,10 +4,7 @@ local MAX_TOTEMS = MAX_TOTEMS -- Death Knights untalented ghouls are guardians and are considered totems........... so set it up for them local playerClass = select(2, UnitClass("player")) -if( playerClass == "DEATHKNIGHT" ) then - MAX_TOTEMS = 1 - ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Guardian bar"], true, "DEATHKNIGHT", {1, 2}, 55) -elseif( playerClass == "PALADIN" ) then +if( playerClass == "PALADIN" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Ancient Kings bar"], true, "PALADIN", 75) elseif( playerClass == "DRUID" ) then From 31e7ed706911bfba0f42595213cd950572bf990d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 3 Nov 2014 22:29:27 -0800 Subject: [PATCH 574/794] Set PlayerFrame as movable --- ShadowedUnitFrames.lua | 1 + modules/combopoints.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 50213e6d..1ac01fa7 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -946,6 +946,7 @@ function ShadowUF:HideBlizzardFrames() PlayerFrame:RegisterEvent("UNIT_ENTERED_VEHICLE") PlayerFrame:RegisterEvent("UNIT_EXITING_VEHICLE") PlayerFrame:RegisterEvent("UNIT_EXITED_VEHICLE") + PlayerFrame:SetMovable(true) PlayerFrame:SetUserPlaced(true) PlayerFrame:SetDontSavePosition(true) end diff --git a/modules/combopoints.lua b/modules/combopoints.lua index d7b5f7df..a3759444 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -27,7 +27,7 @@ local function createIcons(config, pointsFrame, max) pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.icons[id] texture:SetTexture(pointsConfig.icon) - texture:SetSize(config.size or 24, config.size or 24) + texture:SetSize(config.size or 16, config.size or 16) if( id > 1 ) then texture:ClearAllPoints() From 55082f18790ceccd71e2818b4ebfb84e11624168 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 4 Nov 2014 20:31:41 -0800 Subject: [PATCH 575/794] Fixed enemy removal spells being flagged as curable --- modules/units.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 8647ea17..891b8ed6 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1478,11 +1478,9 @@ end -- Handle figuring out what auras players can cure local curableSpells = { - ["DRUID"] = {[88423] = {"Magic", "Curse", "Poison"}, [2782] = {"Curse", "Poison"}, [2908] = {"Enrage"}}, - ["HUNTER"] = {[19801] = {"Magic", "Enrage"}}, - ["ROGUE"] = {[5938] = {"Enrage"}}, + ["DRUID"] = {[88423] = {"Magic", "Curse", "Poison"}, [2782] = {"Curse", "Poison"}} ["MAGE"] = {[475] = {"Curse"}}, - ["PRIEST"] = {[528] = {"Magic"}, [527] = {"Magic", "Disease"}}, + ["PRIEST"] = {[527] = {"Magic", "Disease"}}, ["PALADIN"] = {[4987] = {"Poison", "Disease"}, [53551] = {"Magic"}}, ["SHAMAN"] = {[77130] = {"Curse", "Magic"}, [51886] = {"Curse"}}, ["MONK"] = {[115450] = {"Poison", "Disease"}, [115451] = {"Magic"}} @@ -1496,9 +1494,9 @@ local function checkCurableSpells() table.wipe(Units.canCure) for spellID, cures in pairs(curableSpells) do - if( IsUsableSpell(spellID) ) then - for _, type in pairs(cures) do - Units.canCure[type] = true + if( IsPlayerSpell(spellID) ) then + for _, auraType in pairs(cures) do + Units.canCure[auraType] = true end end end From f3e9913e85d524f29c889fa623df2f1ff2b3fb31 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 5 Nov 2014 09:06:54 -0800 Subject: [PATCH 576/794] Commas hard --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 891b8ed6..c95b3f7d 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1478,7 +1478,7 @@ end -- Handle figuring out what auras players can cure local curableSpells = { - ["DRUID"] = {[88423] = {"Magic", "Curse", "Poison"}, [2782] = {"Curse", "Poison"}} + ["DRUID"] = {[88423] = {"Magic", "Curse", "Poison"}, [2782] = {"Curse", "Poison"}}, ["MAGE"] = {[475] = {"Curse"}}, ["PRIEST"] = {[527] = {"Magic", "Disease"}}, ["PALADIN"] = {[4987] = {"Poison", "Disease"}, [53551] = {"Magic"}}, From 53edc55c72e8638b2976b0560006560a39ba16ae Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 10 Nov 2014 20:56:32 -0800 Subject: [PATCH 577/794] Added Lightwell totem bar for Holy Priests --- ShadowedUnitFrames.lua | 6 +++++- modules/defaultlayout.lua | 3 ++- modules/totems.lua | 5 +++++ options/config.lua | 9 ++++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 1ac01fa7..f59d8377 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 48 +ShadowUF.dbRevision = 49 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -99,6 +99,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 48 ) then + ShadowUF:LoadDefaultLayout(true) + end + if( revision <= 47 ) then local config = self.db.profile.units config.player.comboPoints = config.target.comboPoints diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index a3508c3c..972fcab4 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -167,7 +167,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) AURAPOINTS = {r = 1.0, g = 0.80, b = 0.0}, STAGGER_GREEN = {r = 0.52, g = 1.0, b = 0.52}, STAGGER_YELLOW = {r = 1.0, g = 0.98, b = 0.72}, - STAGGER_RED = {r = 1.0, g = 0.42, b = 0.42} + STAGGER_RED = {r = 1.0, g = 0.42, b = 0.42}, + LIGHTWELL = {r = 0.80, g = 0.80, b = 0.80} } config.healthColors = { tapped = {r = 0.5, g = 0.5, b = 0.5}, diff --git a/modules/totems.lua b/modules/totems.lua index fd2127d8..eb1e61fc 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -16,6 +16,9 @@ elseif( playerClass == "MONK" ) then elseif( playerClass == "MAGE" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Rune of Power bar"], true, "MAGE", {1, 2, 3}, 90) +elseif( playerClass == "PRIEST" ) then + MAX_TOTEMS = 1 + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Lightwell bar"], true, "PRIEST", 2, 36) else ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Totem bar"], true, "SHAMAN") end @@ -56,6 +59,8 @@ function Totems:OnEnable(frame) totemColors[1] = ShadowUF.db.profile.powerColors.STATUE elseif( playerClass == "MAGE" ) then totemColors[1] = ShadowUF.db.profile.powerColors.RUNEOFPOWER + elseif( playerClass == "PRIEST" ) then + totemColors[1] = ShadowUF.db.profile.powerColors.LIGHTWELL else totemColors[1] = {r = 1, g = 0, b = 0.4} totemColors[2] = {r = 0, g = 1, b = 0.4} diff --git a/options/config.lua b/options/config.lua index fc5e709d..1ae02df8 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1265,13 +1265,20 @@ local function loadGeneralOptions() arg = "powerColors.STATUE", hidden = function(info) return select(2, UnitClass("player")) ~= "MONK" end, }, - STATUE = { + RUNEOFPOWER = { order = 17.5, type = "color", name = L["Rune of Power"], arg = "powerColors.RUNEOFPOWER", hidden = function(info) return select(2, UnitClass("player")) ~= "MAGE" end, }, + LIGHTWELL = { + order = 17.6, + type = "color", + name = L["Lightwell"], + arg = "powerColors.LIGHTWELL", + hidden = function(info) return select(2, UnitClass("player")) ~= "PRIEST" end, + }, POWER_TYPE_FEL_ENERGY = { order = 18, type = "color", From 9a3a30e5644e5b6658541ab73cd916293fda1094 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 10 Nov 2014 21:07:36 -0800 Subject: [PATCH 578/794] Fixed export producing broken strings that could not be imported --- options/config.lua | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/options/config.lua b/options/config.lua index 1ae02df8..d6747139 100755 --- a/options/config.lua +++ b/options/config.lua @@ -501,7 +501,7 @@ local function loadGeneralOptions() if( type(key) == "number" ) then key = string.format("[%s]", key) -- Wrap the string with quotes if it has a space in it - elseif( string.match(key, "[%p%s%c]") ) then + elseif( string.match(key, "[%p%s%c]") or string.match(key, "^[0-9]+$") ) then key = string.format("['%s']", string.gsub(key, "'", "\\'")) end @@ -569,15 +569,6 @@ local function loadGeneralOptions() get = function(info) return layoutData[info[#(info)]] end, width = "double", }, - modules = { - order = 4, - type = "toggle", - name = L["Import non-standard module settings"], - desc = L["Will not import settings of modules that are not included with Shadowed Unit Frames by default."], - set = function(info, value) layoutData[info[#(info)]] = value end, - get = function(info) return layoutData[info[#(info)]] end, - width = "double", - }, import = { order = 5, type = "input", @@ -612,18 +603,6 @@ local function loadGeneralOptions() end end - -- Strip module settings that aren't with SUF by default - if( not layoutData.modules ) then - local validModules = {["healthBar"] = true, ["powerBar"] = true, ["portrait"] = true, ["range"] = true, ["text"] = true, ["indicators"] = true, ["auras"] = true, ["incAbsorb"] = true, ["healAbsorb"] = true, ["incHeal"] = true, ["castBar"] = true, ["combatText"] = true, ["highlight"] = true, ["runeBar"] = true, ["totemBar"] = true, ["xpBar"] = true, ["fader"] = true, ["comboPoints"] = true, ["eclipseBar"] = true, ["soulShards"] = true, ["holyPower"] = true, ["altPowerBar"] = true, ["demonicFuryBar"] = true, ["burningEmbersBar"] = true, ["chi"] = true, ["shadowOrbs"] = true, ["auraPoints"] = true, ["staggerBar"] = true} - for _, unitData in pairs(layout.units) do - for key, data in pairs(unitData) do - if( type(data) == "table" and not validModules[key] and ShadowUF.modules[key] ) then - unitData[key] = nil - end - end - end - end - -- Check if we need move over the visibility and positions info layout.positions = layout.positions or CopyTable(ShadowUF.db.profile.positions) layout.visibility = layout.visibility or CopyTable(ShadowUF.db.profile.positions) @@ -6347,8 +6326,8 @@ local function loadAuraIndicatorsOptions() -- Wrap the key in brackets if it's a number if( type(key) == "number" ) then key = string.format("[%s]", key) - -- Wrap the string with quotes if it has a space in it - elseif( string.match(key, " ") ) then + -- Wrap the string with quotes if it has a space or digits in it + elseif( string.match(key, " ") or string.match(key, "^[0-9]+$") ) then key = string.format("[\"%s\"]", key) end From 51123cae30ba814a618e0738abf02f3fdd85946a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 10 Nov 2014 21:11:59 -0800 Subject: [PATCH 579/794] Priests can always cure Magic --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index c95b3f7d..5998f05e 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1480,7 +1480,7 @@ end local curableSpells = { ["DRUID"] = {[88423] = {"Magic", "Curse", "Poison"}, [2782] = {"Curse", "Poison"}}, ["MAGE"] = {[475] = {"Curse"}}, - ["PRIEST"] = {[527] = {"Magic", "Disease"}}, + ["PRIEST"] = {[527] = {"Magic", "Disease"}, [32375] = {"Magic"}}, ["PALADIN"] = {[4987] = {"Poison", "Disease"}, [53551] = {"Magic"}}, ["SHAMAN"] = {[77130] = {"Curse", "Magic"}, [51886] = {"Curse"}}, ["MONK"] = {[115450] = {"Poison", "Disease"}, [115451] = {"Magic"}} From da3473b11d19d8811e63cb92123216e54af2fb25 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 10 Nov 2014 21:15:26 -0800 Subject: [PATCH 580/794] Link Dark Intent and Waterstrider to Arcane Brilliance --- ShadowedUnitFrames.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index f59d8377..5aeff30e 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -703,7 +703,9 @@ function ShadowUF:LoadUnitDefaults() disabled = {}, missing = {}, linked = { - [GetSpellInfo(61316)] = GetSpellInfo(1459) + [GetSpellInfo(61316)] = GetSpellInfo(1459), -- Dalarn Brilliance -> AB + [GetSpellInfo(109773)] = GetSpellInfo(1459), -- Dark Intent -> AB + [GetSpellInfo(126309)] = GetSpellInfo(1459) -- Waterstrider -> AB }, indicators = { ["tl"] = {name = L["Top Left"], anchorPoint = "TLI", anchorTo = "$parent", height = 8, width = 8, alpha = 1.0, x = 4, y = -4, friendly = true, hostile = true}, From cad5a237929d7facf3db7dfd8c6d7ef389be6aa5 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 10 Nov 2014 21:25:35 -0800 Subject: [PATCH 581/794] Added an option to hide power bars unless the unit has mana for header units (raid/party/mt/ma) --- modules/power.lua | 18 ++++++++++++------ options/config.lua | 15 ++++++++------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/modules/power.lua b/modules/power.lua index 732bc309..411c28b8 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -27,6 +27,18 @@ function Power:UpdateColor(frame) local powerID, currentType, altR, altG, altB = UnitPowerType(frame.unit) frame.powerBar.currentType = currentType + -- Overridden power types like Warlock pets, or Ulduar vehicles use "POWER_TYPE_#####" but triggers power events with "ENERGY", so this fixes that + -- by using the powerID to figure out the event type + if( not powerMap[currentType] ) then + frame.powerBar.currentType = powerMap[powerID] or "ENERGY" + end + + if( ShadowUF.db.profile.units[frame.unitType].powerBar.onlyMana ) then + ShadowUF.Layout:SetBarVisibility(frame, "powerBar", currentType == "MANA") + if( currentType ~= "MANA" ) then return end + end + + local color if( frame.powerBar.minusMob ) then color = ShadowUF.db.profile.healthColors.offline @@ -49,12 +61,6 @@ function Power:UpdateColor(frame) frame:SetBarColor("powerBar", color.r, color.g, color.b) - -- Overridden power types like Warlock pets, or Ulduar vehicles use "POWER_TYPE_#####" but triggers power events with "ENERGY", so this fixes that - -- by using the powerID to figure out the event type - if( not powerMap[currentType] ) then - frame.powerBar.currentType = powerMap[powerID] or "ENERGY" - end - self:Update(frame) end diff --git a/options/config.lua b/options/config.lua index d6747139..d37103ce 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4007,13 +4007,6 @@ local function loadUnitOptions() name = string.format(L["Enable %s"], L["Power bar"]), arg = "powerBar.enabled", }, - --predictPower = { - -- order = 2, - -- type = "toggle", - -- name = L["Enable quick power"], - -- desc = L["Turns fast updating of the power bar on giving you more up to date power information than normal."], - -- arg = "powerBar.predicted", - --}, altPowerBar = { order = 3, type = "toggle", @@ -4029,6 +4022,14 @@ local function loadUnitOptions() desc = L["Primary means of coloring the power bar. Coloring by class only applies to players, for non-players it will default to the power type."], values = {["class"] = L["Class"], ["type"] = L["Power Type"]}, arg = "powerBar.colorType", + }, + onlyMana = { + order = 6, + type = "toggle", + name = L["Only show when mana"], + desc = L["Hides the power bar unless the class has mana."], + hidden = function(info) return not ShadowUF.Units.headerUnits[info[2]] end, + arg = "powerBar.onlyMana", } }, }, From 57d9339d52aaf131a541e6fb64de861bf37666a6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 10 Nov 2014 21:26:26 -0800 Subject: [PATCH 582/794] Fixed range checker to use the proper interact distance --- modules/range.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/range.lua b/modules/range.lua index 52407286..9b8d6edd 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -57,7 +57,7 @@ local function checkRange(self, elapsed) end -- Interact - if( CheckInteractDistance(frame.unit, 2) ) then + if( CheckInteractDistance(frame.unit, 1) ) then frame:SetRangeAlpha(inAlpha) return end From d3e80e0111205839beb99c9cc7f59dc7ae06fa20 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 15 Nov 2014 10:38:51 -0800 Subject: [PATCH 583/794] Cleaned up Chi code --- modules/chi.lua | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/modules/chi.lua b/modules/chi.lua index 1ab8227c..36466688 100755 --- a/modules/chi.lua +++ b/modules/chi.lua @@ -1,6 +1,6 @@ local Chi = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(Chi, "chi", ShadowUF.L["Chi"], nil, "MONK") -local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = SPELL_POWER_CHI, eventType = "CHI", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local chiConfig = {max = 6, key = "chi", colorKey = "CHI", powerType = SPELL_POWER_CHI, eventType = "CHI", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function Chi:OnEnable(frame) frame.chi = frame.chi or CreateFrame("Frame", nil, frame) @@ -22,20 +22,6 @@ function Chi:OnLayoutApplied(frame, config) self:UpdateBarBlocks(frame) end -function Chi:Update(frame, event, unit, powerType) - if( powerType and powerType ~= chiConfig.eventType ) then return end - - local points = UnitPower("player", chiConfig.powerType) - -- Bar display, hide it if we don't have any combo points - if( ShadowUF.db.profile.units[frame.unitType].chi.isBar ) then - ShadowUF.Layout:SetBarVisibility(frame, "chi", ShadowUF.db.profile.units[frame.unitType].chi.showAlways or (points and points > 0)) - end - - for id, pointTexture in pairs(frame.chi.points) do - if( id <= points ) then - pointTexture:Show() - else - pointTexture:Hide() - end - end -end +function Chi:GetPoints(unit) + return UnitPower("player", chiConfig.powerType) +end \ No newline at end of file From 0fcff7dbe5011c84df01d4950a2574e705d54b39 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 25 Nov 2014 23:00:43 -0800 Subject: [PATCH 584/794] Bump frame strata to fix raid manager/work order visual issues --- modules/units.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/units.lua b/modules/units.lua index 5998f05e..aeae0ea1 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -16,6 +16,7 @@ ShadowUF:RegisterModule(Units, "units") -- This is the wrapper frame that everything parents to so we can just hide it when we need to deal with pet battles local petBattleFrame = CreateFrame("Frame", "SUFWrapperFrame", UIParent, "SecureHandlerBaseTemplate") +petBattleFrame:SetFrameStrata("BACKGROUND") petBattleFrame:SetAllPoints(UIParent) petBattleFrame:WrapScript(petBattleFrame, "OnAttributeChanged", [[ if( name ~= "state-petbattle" ) then return end From 49ab27f33600798414f0b7369a63386ac596a7a1 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 25 Nov 2014 23:04:16 -0800 Subject: [PATCH 585/794] Fixed bar block combo points error if we had more than expected --- modules/combopoints.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index a3759444..0a03a5f0 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -41,11 +41,11 @@ end local function createBlocks(config, pointsFrame, max) local pointsConfig = pointsFrame.cpConfig - pointsFrame.visibleBlocks = pointsConfig.max + pointsFrame.visibleBlocks = max -- Position bars, the 5 accounts for borders - local blockWidth = (pointsFrame:GetWidth() - (pointsConfig.max - 1)) / pointsConfig.max - for id=1, pointsConfig.max do + local blockWidth = (pointsFrame:GetWidth() - (max - 1)) / max + for id=1, max do pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.blocks[id] local color = ShadowUF.db.profile.powerColors[pointsConfig.colorKey or "COMBOPOINTS"] From fcdd4e59901068a553f5e8d9b748cc516fe92d37 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 25 Nov 2014 23:18:03 -0800 Subject: [PATCH 586/794] Disable dismissable totem bars if we only have one "totem" --- modules/layout.lua | 8 ++++---- modules/totems.lua | 13 +++++++++---- options/config.lua | 5 ++++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/modules/layout.lua b/modules/layout.lua index a265d56f..8e1bbd3b 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -124,17 +124,17 @@ end function Layout:Load(frame) local unitConfig = ShadowUF.db.profile.units[frame.unitType] + -- About to set layout + ShadowUF:FireModuleEvent("OnPreLayoutApply", frame, unitConfig) + -- Figure out if we're secure locking frame.secureLocked = nil for _, module in pairs(ShadowUF.moduleOrder) do - if( frame.visibility[module.moduleKey] and ShadowUF.db.profile.units[frame.unitType][module.moduleKey].secure ) then + if( frame.visibility[module.moduleKey] and ShadowUF.db.profile.units[frame.unitType][module.moduleKey].secure and module:SecureLockable() ) then frame.secureLocked = true break end end - - -- About to set layout - ShadowUF:FireModuleEvent("OnPreLayoutApply", frame, unitConfig) -- Load all of the layout things self:SetupFrame(frame, unitConfig) diff --git a/modules/totems.lua b/modules/totems.lua index eb1e61fc..7687f488 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -26,6 +26,9 @@ end ShadowUF.BlockTimers:Inject(Totems, "TOTEM_TIMER") ShadowUF.DynamicBlocks:Inject(Totems) +function Totems:SecureLockable() + return MAX_TOTEMS > 1 +end function Totems:OnEnable(frame) if( not frame.totemBar ) then @@ -83,13 +86,15 @@ function Totems:OnDisable(frame) end end +function Totems:OnPreLayoutApply(frame) + if( frame.visibility.totemBar and playerClass == "DRUID" ) then + MAX_TOTEMS = GetSpecialization() == 4 and 1 or 3 + end +end + function Totems:OnLayoutApplied(frame) if( not frame.visibility.totemBar ) then return end - if( playerClass == "DRUID" ) then - MAX_TOTEMS = GetSpecialization() == 4 and 1 or 3 - end - local barWidth = (frame.totemBar:GetWidth() - (MAX_TOTEMS - 1)) / MAX_TOTEMS local config = ShadowUF.db.profile.units[frame.unitType].totemBar diff --git a/options/config.lua b/options/config.lua index d37103ce..af75db73 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4286,11 +4286,14 @@ local function loadUnitOptions() order = 3, type = "toggle", name = L["Dismissable Totem bars"], + hidden = function() + return not ShadowUF.modules.totemBar:SecureLockable() + end, desc = function(info) return L["Allows you to disable the totem by right clicking it.|n|nWarning: Inner bars for this unit will not resize in combat if you enable this."] end, arg = "totemBar.secure", - }, + } }, }, emptyBar = { From 77c3a794dee3f16e7c5112c97d97cfdb5ffe2de7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 27 Nov 2014 21:56:36 -0800 Subject: [PATCH 587/794] Fixed range timer start/stop bugs --- modules/range.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index 9b8d6edd..59476305 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -84,9 +84,9 @@ end function Range:ForceUpdate(frame) if( UnitIsUnit(frame.unit, "player") ) then frame:SetRangeAlpha(ShadowUF.db.profile.units[frame.unitType].range.inAlpha) - frame.range:Hide() + frame.range.timer:Stop() else - frame.range:Show() + frame.range.timer:Play() checkRange(frame.range.timer) end end @@ -102,7 +102,7 @@ function Range:OnEnable(frame) frame:RegisterNormalEvent("PLAYER_SPECIALIZATION_CHANGED", self, "SpellChecks") frame:RegisterUpdateFunc(self, "ForceUpdate") - frame.range:Show() + frame.range.timer:Play() end function Range:OnLayoutApplied(frame) @@ -113,7 +113,7 @@ function Range:OnDisable(frame) frame:UnregisterAll(self) if( frame.range ) then - frame.range:Hide() + frame.range.timer:Stop() frame:SetRangeAlpha(1.0) end end From 836a5046d6b2981a7d886f68e31bab9edf279ccf Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 9 Dec 2014 16:49:00 -0800 Subject: [PATCH 588/794] Fixed bugs with zone enabled units not actually being restricted to zones --- modules/units.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/units.lua b/modules/units.lua index aeae0ea1..b8195114 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1170,6 +1170,10 @@ end function Units:LoadZoneHeader(type) if( headerFrames[type] ) then headerFrames[type]:Show() + + if( type == "arena" ) then + self:InitializeArena() + end return end @@ -1274,6 +1278,10 @@ function Units:LoadZoneHeader(type) self:SetHeaderAttributes(headerFrame, type) ShadowUF.Layout:AnchorFrame(UIParent, headerFrame, ShadowUF.db.profile.positions[type]) + + if( type == "arena" ) then + self:InitializeArena() + end end -- Load a unit that is a child of another unit (party pet/party target) @@ -1376,6 +1384,7 @@ function Units:UninitializeFrame(type) for frame in pairs(frameList) do if( frame.unitType == type ) then UnregisterUnitWatch(frame) + frame:SetAttribute("state-unitexits", false) frame:Hide() end end From 74af9b59924ab7bba55a0cd5824012f1de4ad03c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 9 Dec 2014 17:09:52 -0800 Subject: [PATCH 589/794] hide the split raid frames when not in a raid --- modules/units.lua | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index b8195114..8c67ba88 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -992,7 +992,26 @@ local function setupRaidStateMonitor(id, headerFrame) stateMonitor.raids[id]:SetFrameRef("raidHeader", headerFrame) stateMonitor.raids[id]:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) stateMonitor.raids[id]:WrapScript(stateMonitor.raids[id], "OnAttributeChanged", [[ - if( name ~= "state-raidmonitor" and name ~= "raiddisabled" and name ~= "hidesemiraid" ) then return end + if( name == "hasraid" or name == "hasparty" or name == "recheck" ) then + local header = self:GetFrameRef("raidHeader") + local raid = self:GetAttribute("hasraid") + local party = self:GetAttribute("hasparty") + + if( header:GetAttribute("showParty") ) then + if( not party and not raid ) then + header:Hide() + elseif( party or raid ) then + header:Show() + end + elseif( not raid ) then + header:Hide() + elseif( raid ) then + header:Show() + end + + elseif( name ~= "state-raidmonitor" and name ~= "raiddisabled" and name ~= "hidesemiraid" ) then + return + end local header = self:GetFrameRef("raidHeader") if( self:GetAttribute("raidDisabled") ) then @@ -1008,6 +1027,8 @@ local function setupRaidStateMonitor(id, headerFrame) ]]) RegisterStateDriver(stateMonitor.raids[id], "raidmonitor", "[target=raid6, exists] raid6; none") + RegisterStateDriver(stateMonitor.raids[id], "hasraid", "[target=raid1, exists] raid; none") + RegisterStateDriver(stateMonitor.raids[id], "hasparty", "[target=party1, exists] party; none") end function Units:LoadSplitGroupHeader(type) @@ -1017,6 +1038,7 @@ function Units:LoadSplitGroupHeader(type) for id, monitor in pairs(stateMonitor.raids) do monitor:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) monitor:SetAttribute("raidDisabled", id == -1 and true or nil) + monitor:SetAttribute("recheck", time()) end local config = ShadowUF.db.profile.units[type] From 719109610d2bd1458517979cf4b75532c711a17a Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 9 Dec 2014 17:28:17 -0800 Subject: [PATCH 590/794] fixed MONOCHROME font crashing SUF --- ShadowedUnitFrames.lua | 16 +++++++++------- localcheck.rb | 27 ++++++++++++++------------- options/config.lua | 2 +- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 5aeff30e..25c0750a 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 49 +ShadowUF.dbRevision = 50 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -99,6 +99,12 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 49 ) then + if( ShadowUF.db.profile.font.extra == "MONOCHROME" ) then + ShadowUF.db.profile.font.extra = "" + end + end + if( revision <= 48 ) then ShadowUF:LoadDefaultLayout(true) end @@ -475,8 +481,8 @@ function ShadowUF:LoadUnits() for _, type in pairs(self.unitList) do local enabled = self.db.profile.units[type].enabled - if( ShadowUF.Units.zoneUnits[type] and enabled ) then - enabled = zoneEnabled(instanceType, ShadowUF.Units.zoneUnits[type]) + if( ShadowUF.Units.zoneUnits[type] ) then + enabled = enabled and zoneEnabled(instanceType, ShadowUF.Units.zoneUnits[type]) elseif( instanceType ~= "none" ) then if( self.db.profile.visibility[instanceType][type] == false ) then enabled = false @@ -493,10 +499,6 @@ function ShadowUF:LoadUnits() self.Units:UninitializeFrame(type) end end - - if( instanceType == "arena" ) then - self.Units:InitializeArena() - end end function ShadowUF:LoadUnitDefaults() diff --git a/localcheck.rb b/localcheck.rb index 1c3c3850..2cbcc69f 100755 --- a/localcheck.rb +++ b/localcheck.rb @@ -1,5 +1,5 @@ -require "typhoeus" require "uri" +require "net/http" skip = nil i18n = {} @@ -45,20 +45,21 @@ end # Onward! -URL = "http://www.wowace.com/addons/shadowed-unit-frames/localization/import/" +URL = URI.parse("http://www.wowace.com/addons/shadowed-unit-frames/localization/import/") -res = Typhoeus.post(URL, - headers: {Referer: URL}, - body: URI.encode_www_form( - "api-key" => File.read(File.expand_path("~/.curse-key")).strip, - format: :lua_additive_table, - language: 1, - delete_unimported: "y", - text: compiled - ) -) +http = Net::HTTP.new(URL.host, URL.port) +request = Net::HTTP::Post.new(URL.request_uri) +request.add_field("Referer", "http://www.wowace.com/addons/shadowed-unit-frames/localization/import/") +request.set_form_data( + "api-key" => File.read(File.expand_path("~/.curse-key")).strip, + format: :lua_additive_table, + language: 1, + delete_unimported: "y", + text: compiled +) -puts res.headers.inspect +res = http.request(request) +puts res.header.inspect puts res.code puts res.body \ No newline at end of file diff --git a/options/config.lua b/options/config.lua index af75db73..3eed5e40 100755 --- a/options/config.lua +++ b/options/config.lua @@ -885,7 +885,7 @@ local function loadGeneralOptions() order = 3, type = "select", name = L["Outline"], - values = {["OUTLINE"] = L["Thin outline"], ["THICKOUTLINE"] = L["Thick outline"], ["MONOCHROME"] = L["Monochrome"], [""] = L["None"]}, + values = {["OUTLINE"] = L["Thin outline"], ["THICKOUTLINE"] = L["Thick outline"], ["MONOCHROMEOUTLINE"] = L["Monochrome Outline"], [""] = L["None"]}, arg = "font.extra", hidden = hideAdvancedOption, }, From ed3d94bf2944452dd6ba8dadb441462f9e642eb7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 10 Dec 2014 23:31:41 -0800 Subject: [PATCH 591/794] Fixed error when using a fishing lure --- modules/auras.lua | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 0fa28ebe..7acf9bdd 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -372,13 +372,13 @@ end -- Temporary enchant support local timeElapsed = 0 -local function updateTemporaryEnchant(frame, slot, tempData, hasEnchant, timeLeft, charges) +local function updateTemporaryEnchant(frame, slot, tempData, hasEnchant, enchantId, timeLeft, charges) -- If there's less than a 750 millisecond differences in the times, we don't need to bother updating. -- Any sort of enchant takes more than 0.750 seconds to cast so it's impossible for the user to have two -- temporary enchants with that little difference, as totems don't really give pulsing auras anymore. charges = charges or 0 - if( tempData.has and ( timeLeft < tempData.time and ( tempData.time - timeLeft ) < 750 ) and charges == tempData.charges ) then return false end - + if( tempData.has and tempData.enchantId == enchantId and ( timeLeft < tempData.time and ( tempData.time - timeLeft ) < 750 ) ) then return false end + -- Some trickys magic, we can't get the start time of temporary enchants easily. -- So will save the first time we find when a new enchant is added if( timeLeft > tempData.time or not tempData.has ) then @@ -388,6 +388,7 @@ local function updateTemporaryEnchant(frame, slot, tempData, hasEnchant, timeLef tempData.has = hasEnchant tempData.time = timeLeft tempData.charges = charges + tempData.enchantId = enchantId local config = ShadowUF.db.profile.units[frame.parent.unitType].auras[frame.type] @@ -452,12 +453,12 @@ tempEnchantScan = function(self, elapsed) timeElapsed = timeElapsed - 0.50 - local hasMain, mainTimeLeft, mainCharges, hasOff, offTimeLeft, offCharges, hasRanged, rangedTimeLeft, rangedCharges = GetWeaponEnchantInfo() + local hasMain, mainTimeLeft, mainCharges, mainEnchantId, hasOff, offTimeLeft, offCharges, offEnchantId = GetWeaponEnchantInfo() self.temporaryEnchants = 0 if( hasMain ) then self.temporaryEnchants = self.temporaryEnchants + 1 - updateTemporaryEnchant(self, 16, mainHand, hasMain, mainTimeLeft or 0, mainCharges) + updateTemporaryEnchant(self, 16, mainHand, hasMain, mainEnchantId, mainTimeLeft or 0, mainCharges) mainHand.time = mainTimeLeft or 0 end @@ -465,19 +466,12 @@ tempEnchantScan = function(self, elapsed) if( hasOff and self.temporaryEnchants < self.maxAuras ) then self.temporaryEnchants = self.temporaryEnchants + 1 - updateTemporaryEnchant(self, 17, offHand, hasOff, offTimeLeft or 0, offCharges) + updateTemporaryEnchant(self, 17, offHand, hasOff, offEnchantId, offTimeLeft or 0, offCharges) offHand.time = offTimeLeft or 0 end offHand.has = hasOff - if( hasRanged and self.temporaryEnchants < self.maxAuras ) then - self.temporaryEnchants = self.temporaryEnchants + 1 - updateTemporaryEnchant(self, 18, ranged, hasRanged, rangedTimeLeft or 0, rangedCharges) - end - - ranged.has = hasRanged - -- Update if totals changed if( self.lastTemporary ~= self.temporaryEnchants ) then self.lastTemporary = self.temporaryEnchants From 5b78dfeb0c135c05531e5e3e4f26b7a31957221b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 10 Dec 2014 23:40:19 -0800 Subject: [PATCH 592/794] Revert the majority of the range checker changes to get it stable --- modules/range.lua | 47 +++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index 59476305..992a9d95 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -33,36 +33,28 @@ ShadowUF:RegisterModule(Range, "range", ShadowUF.L["Range indicator"]) local playerClass = select(2, UnitClass("player")) local rangeSpells = {} -local function checkRange(self, elapsed) +local function checkRange(self) local frame = self.parent - local oorAlpha = ShadowUF.db.profile.units[frame.unitType].range.oorAlpha - local inAlpha = ShadowUF.db.profile.units[frame.unitType].range.inAlpha - -- Offline - if( not UnitIsConnected(frame.unit) ) then - frame:SetRangeAlpha(oorAlpha) - return - -- Hostile spell - elseif( rangeSpells.hostile and UnitCanAttack("player", frame.unit) and IsSpellInRange(rangeSpells.hostile) == 1 ) then - frame:SetRangeAlpha(inAlpha) - return - -- Friendly spell - elseif( rangeSpells.friendly and UnitCanAssist("player", frame.unit) and IsSpellInRange(rangeSpells.friendly, frame.unit) == 1 ) then - frame:SetRangeAlpha(inAlpha) - return - -- Use the built in UnitInRange - elseif( UnitInRaid(frame.unit) or UnitInParty(frame.unit) ) then - frame:SetRangeAlpha(UnitInRange(frame.unit, "player") and inAlpha or oorAlpha) - return + -- Check which spell to use + local spell + if( UnitCanAssist("player", frame.unit) ) then + spell = rangeSpells.friendly + elseif( UnitCanAttack("player", frame.unit) ) then + spell = rangeSpells.hostile end - -- Interact - if( CheckInteractDistance(frame.unit, 1) ) then - frame:SetRangeAlpha(inAlpha) - return + if( not UnitIsConnected(frame.unit) ) then + frame:SetRangeAlpha(ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) + elseif( spell ) then + frame:SetRangeAlpha(IsSpellInRange(spell, frame.unit) == 1 and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) + -- That didn't work, but they are grouped lets try the actual API for this, it's a bit flaky though and not that useful generally + elseif( UnitInRaid(frame.unit) or UnitInParty(frame.unit) ) then + frame:SetRangeAlpha(UnitInRange(frame.unit, "player") and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) + -- Nope, fall back to interaction :( + else + frame:SetRangeAlpha(CheckInteractDistance(frame.unit, 1) and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) end - - frame:SetRangeAlpha(oorAlpha) end local function updateSpellCache(type) @@ -106,7 +98,7 @@ function Range:OnEnable(frame) end function Range:OnLayoutApplied(frame) - self:SpellChecks() + self:SpellChecks(frame) end function Range:OnDisable(frame) @@ -122,4 +114,7 @@ end function Range:SpellChecks(frame) updateSpellCache("friendly") updateSpellCache("hostile") + if( frame.range ) then + checkRange(frame.range.timer) + end end \ No newline at end of file From 2ba39267d64479eecc70459a9a2bead4a91ba302 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 10 Dec 2014 23:52:04 -0800 Subject: [PATCH 593/794] Should properly fix zone units showing up in the wrong zone --- modules/units.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/units.lua b/modules/units.lua index 8c67ba88..1ccc2346 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1192,6 +1192,9 @@ end function Units:LoadZoneHeader(type) if( headerFrames[type] ) then headerFrames[type]:Show() + for _, child in pairs(headerFrames[type].children) do + RegisterUnitWatch(frame, frame.hasStateWatch) + end if( type == "arena" ) then self:InitializeArena() @@ -1398,6 +1401,11 @@ function Units:UninitializeFrame(type) if( headerFrames[type].children ) then for _, frame in pairs(headerFrames[type].children) do + if( zoneUnits[type] ) then + UnregisterUnitWatch(frame) + frame:SetAttribute("state-unitexists", false) + end + frame:Hide() end end From 6cae35708184921767dec1ecfff6b719441c284b Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 11 Dec 2014 00:43:02 -0800 Subject: [PATCH 594/794] Typo --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 1ccc2346..5ca4fe1f 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1193,7 +1193,7 @@ function Units:LoadZoneHeader(type) if( headerFrames[type] ) then headerFrames[type]:Show() for _, child in pairs(headerFrames[type].children) do - RegisterUnitWatch(frame, frame.hasStateWatch) + RegisterUnitWatch(child, child.hasStateWatch) end if( type == "arena" ) then From 17b9d568fea40dabc7ccaa8ade07379581db8f0d Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 11 Dec 2014 15:26:57 -0800 Subject: [PATCH 595/794] Variable scoping is hard --- modules/units.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 5ca4fe1f..4e201b4d 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -7,7 +7,7 @@ Units.headerUnits = {["raid"] = true, ["party"] = true, ["maintank"] = true, ["m local stateMonitor = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate") stateMonitor.raids = {} local playerClass = select(2, UnitClass("player")) -local unitFrames, headerFrames, frameList, unitEvents, childUnits, headerUnits, queuedCombat = Units.unitFrames, Units.headerFrames, Units.frameList, Units.unitEvents, Units.childUnits, Units.headerUnits, {} +local unitFrames, headerFrames, frameList, unitEvents, childUnits, headerUnits, queuedCombat, zoneUnits = Units.unitFrames, Units.headerFrames, Units.frameList, Units.unitEvents, Units.childUnits, Units.headerUnits, {}, Units.zoneUnits local remappedUnits = Units.remappedUnits local _G = getfenv(0) @@ -1401,7 +1401,7 @@ function Units:UninitializeFrame(type) if( headerFrames[type].children ) then for _, frame in pairs(headerFrames[type].children) do - if( zoneUnits[type] ) then + if( self.zoneUnits[type] ) then UnregisterUnitWatch(frame) frame:SetAttribute("state-unitexists", false) end From 2aec196404f02d93dd3704ed42e3f7186ac7d690 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 18 Dec 2014 20:09:42 -0800 Subject: [PATCH 596/794] Hide Arena prep frames when arena frames are hidden --- ShadowedUnitFrames.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 25c0750a..bb931060 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -987,7 +987,11 @@ function ShadowUF:HideBlizzardFrames() ArenaEnemyFrames:UnregisterAllEvents() ArenaEnemyFrames:SetParent(self.hiddenFrame) + ArenaPrepFrames:UnregisterAllEvents() + ArenaPrepFrames:SetParent(self.hiddenFrame) + SetCVar("showArenaEnemyFrames", 0, "SHOW_ARENA_ENEMY_FRAMES_TEXT") + end if( self.db.profile.hidden.playerAltPower and not active_hiddens.playerAltPower ) then From ccae5b6415229d6707e65a21992ea9de82ccaff3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 18 Dec 2014 20:13:18 -0800 Subject: [PATCH 597/794] Added default aura indicators --- ShadowedUnitFrames.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index bb931060..0e7d7f74 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -728,6 +728,7 @@ function ShadowUF:LoadUnitDefaults() ["1459"] = [[{indicator = '', group = "Mage", priority = 10, r = 0.10, g = 0.68, b = 0.88}]], ["116849"] = [[{r=0.19607843137255, group="Monk", indicator="c", g=1, player=false, duration=true, b=0.3843137254902, alpha=1, priority=0, icon=true, iconTexture="Interface\\Icons\\ability_monk_chicocoon"}]], ["1126"] = [[{r=0.47450980392157, group="Druid", indicator="", g=0.2156862745098, player=true, duration=true, missing=true, b=0.81960784313725, priority=0, alpha=1, iconTexture="Interface\\Icons\\Spell_Nature_Regeneration"}]], + ["155777"] = [[{r=0.57647058823529, group="Druid", indicator="tr", g=0.28235294117647, player=true, duration=true, b=0.6156862745098, priority=100, alpha=1, iconTexture="Interface\\Icons\\Spell_Nature_Rejuvenation"}]], ["121176"] = [[{alpha=1, b=0, priority=0, r=0.062745098039216, group="PvP Flags", indicator="bl", g=1, iconTexture="Interface\\Icons\\INV_BannerPVP_03"}]], ["19705"] = [[{r=0.80392156862745, group="Food", indicator="", g=0.76470588235294, missing=true, duration=true, priority=0, alpha=1, b=0.24313725490196}]], ["19740"] = [[{r=0.93333333333333, group="Paladin", indicator="", g=0.84705882352941, selfColor={alpha=1, b=0.18823529411765, g=0.89411764705882, r=0.9843137254902, }, player=false, missing=true, duration=true, alpha=1, priority=0, b=0.15294117647059, iconTexture="Interface\\Icons\\Spell_Holy_GreaterBlessingofKings"}]], @@ -736,18 +737,17 @@ function ShadowUF:LoadUnitDefaults() ["774"] = [[{r=0.57647058823529, group="Druid", indicator="tr", g=0.28235294117647, player=true, duration=true, b=0.6156862745098, priority=100, alpha=1, iconTexture="Interface\\Icons\\Spell_Nature_Rejuvenation"}]], ["33206"] = [[{r=0, group="Priest", indicator="c", g=0, b=0, duration=true, priority=0, icon=true, iconTexture="Interface\\Icons\\Spell_Holy_PainSupression"}]], ["974"] = [[{r=1, group="Shaman", indicator="tr", g=0.65882352941176, player=true, alpha=1, priority=10, b=0.27843137254902, iconTexture="Interface\\Icons\\Spell_Nature_SkinofEarth"}]], - ["105284"] = [[{r=0.17647058823529, group="Shaman", indicator="br", g=0.50196078431373, player=true, duration=true, alpha=1, priority=0, b=0.78039215686275, iconTexture="INTERFACE\\ICONS\\spell_shaman_blessingoftheeternals"}]], ["6788"] = [[{b=0.29019607843137, group="Priest", indicator="tl", alpha=1, player=false, g=0.56862745098039, duration=true, r=0.83921568627451, priority=20, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_AshesToAshes"}]], ["33763"] = [[{r=0.23137254901961, group="Druid", indicator="tl", g=1, player=true, duration=true, alpha=1, priority=0, b=0.2, iconTexture="Interface\\Icons\\INV_Misc_Herb_Felblossom"}]], ["61316"] = [[{alpha=1, b=1, priority=0, r=0, group="Mage", indicator="", g=0.96078431372549, iconTexture="Interface\\Icons\\Achievement_Dungeon_TheVioletHold_Heroic"}]], ["139"] = [[{r=0.23921568627451, group="Priest", indicator="tr", g=1, player=true, alpha=1, duration=true, b=0.39607843137255, priority=10, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_Renew"}]], ["41635"] = [[{r=1, group="Priest", indicator="br", g=0.90196078431373, missing=false, player=true, duration=false, alpha=1, b=0, priority=50, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_PrayerOfMendingtga"}]], - ["64904"] = [[{r=0.23529411764706, group="Priest", indicator="31685", g=0.67843137254902, player=true, duration=false, b=0.67058823529412, priority=0, alpha=1, iconTexture="Interface\\Icons\\Spell_Holy_Rapture"}]], ["20217"] = [[{r=1, group="Paladin", indicator="", g=0.30196078431373, selfColor={alpha=1, b=0.91764705882353, g=0.058823529411765, r=1, }, player=false, duration=true, missing=true, alpha=1, priority=90, b=0.94117647058824, iconTexture="Interface\\Icons\\Spell_Magic_GreaterBlessingofKings"}]], ["47788"] = [[{r=0, group="Priest", indicator="c", g=0, b=0, duration=true, priority=0, icon=true, iconTexture="Interface\\Icons\\Spell_Holy_GuardianSpirit"}]], ["61295"] = [[{r=0.17647058823529, group="Shaman", indicator="tl", g=0.4, player=true, alpha=1, duration=true, b=1, priority=0, icon=false, iconTexture="Interface\\Icons\\spell_nature_riptide"}]], ["109773"] = [[{r=0.52941176470588, group="Warlock", indicator="", g=0.12941176470588, alpha=1, b=0.71372549019608, priority=0, missing=true, iconTexture="INTERFACE\\ICONS\\spell_warlock_focusshadow"}]], ["17"] = [[{r=1, group="Priest", indicator="tl", g=0.41960784313725, player=true, alpha=1, duration=true, b=0.5843137254902, priority=0, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_PowerWordShield"}]], + ["152118"] = [[{r=1, group="Priest", indicator="tl", g=0.41960784313725, player=true, alpha=1, duration=true, b=0.5843137254902, priority=0, icon=false, iconTexture="Interface\\Icons\\Ability_Priest_ClarityOfWill"}]], ["29166"] = [[{r=0, group="Druid", indicator="c", g=0, b=0, duration=true, priority=0, icon=true, iconTexture="Interface\\Icons\\Spell_Nature_Lightning"}]], ["23335"] = [[{r=0, group="PvP Flags", indicator="bl", g=0, duration=false, b=0, priority=0, icon=true, iconTexture="Interface\\Icons\\INV_BannerPVP_02"}]], ["102342"] = [[{r=0, group="Druid", indicator="c", g=0, duration=true, b=0, priority=0, icon=true, iconTexture="Interface\\Icons\\spell_druid_ironbark"}]], From 70a94452f2dedffb47239435e80f7b4c38017113 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 18 Dec 2014 20:16:56 -0800 Subject: [PATCH 598/794] Trying a fix for Holy Power --- modules/holypower.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/holypower.lua b/modules/holypower.lua index 88194ec2..595666eb 100755 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -1,6 +1,6 @@ local HolyPower = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN", nil, PALADINPOWERBAR_SHOW_LEVEL) -local holyConfig = {max = HOLY_POWER_FULL, key = "holyPower", colorKey = "HOLYPOWER", powerType = SPELL_POWER_HOLY_POWER, eventType = "HOLY_POWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local holyConfig = {max = 5, key = "holyPower", colorKey = "HOLYPOWER", powerType = SPELL_POWER_HOLY_POWER, eventType = "HOLY_POWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function HolyPower:OnEnable(frame) frame.holyPower = frame.holyPower or CreateFrame("Frame", nil, frame) @@ -32,8 +32,8 @@ function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) local color = ShadowUF.db.profile.powerColors["BANKEDHOLYPOWER"] local max = UnitPowerMax("player", holyConfig.powerType) - if( max > 0 and max > HOLY_POWER_FULL ) then - for id=HOLY_POWER_FULL+1, max do + if( max == 5 ) then + for id=4, 5 do if( config.isBar ) then pointsFrame.blocks[id]:SetVertexColor(color.r, color.g, color.b) else From b04843bc691d4859e159fce541f5db4f0bfdd02c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 25 Dec 2014 11:15:59 -0800 Subject: [PATCH 599/794] Fixed combo point config due to target -> player move --- ShadowedUnitFrames.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 0e7d7f74..683d5d01 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 50 +ShadowUF.dbRevision = 51 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -99,6 +99,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 49 ) then + ShadowUF:LoadDefaultLayout(true) + end + if( revision <= 49 ) then if( ShadowUF.db.profile.font.extra == "MONOCHROME" ) then ShadowUF.db.profile.font.extra = "" @@ -582,6 +586,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.soulShards = {enabled = true, isBar = true} self.defaults.profile.units.player.staggerBar = {enabled = true} self.defaults.profile.units.player.demonicFuryBar = {enabled = true} + self.defaults.profile.units.player.comboPoints = {enabled = true, isBar = true} self.defaults.profile.units.player.burningEmbersBar = {enabled = true} self.defaults.profile.units.player.eclipseBar = {enabled = true} self.defaults.profile.units.player.holyPower = {enabled = true, isBar = true} @@ -609,7 +614,6 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.focustarget.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60} -- TARGET self.defaults.profile.units.target.enabled = true - self.defaults.profile.units.target.comboPoints = {enabled = true, isBar = true} self.defaults.profile.units.target.indicators.lfdRole = {enabled = false, size = 0, x = 0, y = 0} self.defaults.profile.units.target.indicators.questBoss = {enabled = true, size = 0, x = 0, y = 0} -- TARGETTARGET/TARGETTARGETTARGET From a15df23e3fe7cd42cb7bfd42ae8c5653db4cc605 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 31 Dec 2014 12:10:26 -0800 Subject: [PATCH 600/794] Trying a fix for the combo point crash bug --- modules/combopoints.lua | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 0a03a5f0..9df95080 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -3,7 +3,9 @@ ShadowUF:RegisterModule(Combo, "comboPoints", ShadowUF.L["Combo points"]) ShadowUF.ComboPoints = Combo local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBOPOINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} -local function createIcons(config, pointsFrame, max) +local function createIcons(config, pointsFrame, cpMax) + if( not cpMax ) then return end + local point, relativePoint local x, y = 0, 0 @@ -12,18 +14,18 @@ local function createIcons(config, pointsFrame, max) if( config.growth == "LEFT" ) then point, relativePoint = "BOTTOMRIGHT", "BOTTOMLEFT" x = config.spacing - elseif( config.growth == "RIGHT" ) then - point, relativePoint = "BOTTOMLEFT", "BOTTOMRIGHT" - x = config.spacing elseif( config.growth == "UP" ) then point, relativePoint = "BOTTOMLEFT", "TOPLEFT" y = config.spacing elseif( config.growth == "DOWN" ) then point, relativePoint = "TOPLEFT", "BOTTOMLEFT" y = config.spacing + else + point, relativePoint = "BOTTOMLEFT", "BOTTOMRIGHT" + x = config.spacing end - for id=1, max do + for id=1, cpMax do pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.icons[id] texture:SetTexture(pointsConfig.icon) @@ -39,13 +41,15 @@ local function createIcons(config, pointsFrame, max) end end -local function createBlocks(config, pointsFrame, max) +local function createBlocks(config, pointsFrame, cpMax) + if( not cpMax ) then return end + local pointsConfig = pointsFrame.cpConfig - pointsFrame.visibleBlocks = max + pointsFrame.visibleBlocks = cpMax -- Position bars, the 5 accounts for borders - local blockWidth = (pointsFrame:GetWidth() - (max - 1)) / max - for id=1, max do + local blockWidth = (pointsFrame:GetWidth() - (cpMax - 1)) / cpMax + for id=1, cpMax do pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.blocks[id] local color = ShadowUF.db.profile.powerColors[pointsConfig.colorKey or "COMBOPOINTS"] From c5ca240b085ba7cae026f0cd54efa1da55f335ce Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 3 Jan 2015 13:56:00 -0800 Subject: [PATCH 601/794] Make sure we default x/y for combo points too --- modules/combopoints.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 9df95080..c2db6591 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -6,8 +6,7 @@ local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBO local function createIcons(config, pointsFrame, cpMax) if( not cpMax ) then return end - local point, relativePoint - local x, y = 0, 0 + local point, relativePoint, x, y local pointsConfig = pointsFrame.cpConfig @@ -24,6 +23,9 @@ local function createIcons(config, pointsFrame, cpMax) point, relativePoint = "BOTTOMLEFT", "BOTTOMRIGHT" x = config.spacing end + + x = x or 0 + y = y or 0 for id=1, cpMax do pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") From d1a16c1d3912dce3d2a45224e4a10da1da9062dd Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 3 Jan 2015 14:38:19 -0800 Subject: [PATCH 602/794] Fixed split raid frames being scattered on UI Reload --- modules/units.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 4e201b4d..0c27feb2 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -839,7 +839,7 @@ function Units:SetHeaderAttributes(frame, type) local lastHeader = frame for id=1, 8 do local childHeader = headerFrames["raid" .. id] - if( childHeader and childHeader:IsVisible() ) then + if( childHeader ) then childHeader:SetAttribute("showRaid", ShadowUF.db.profile.locked and true) childHeader:SetAttribute("minWidth", config.width * widthMod) @@ -876,6 +876,11 @@ function Units:SetHeaderAttributes(frame, type) lastHeader = childHeader end + + -- There appears to be a bug where if you reloadui with a split raid frames the positions get messed up + -- if we force a repositioning through startingIndex it's fixed thought. + childHeader:SetAttribute("startingIndex", 10000) + childHeader:SetAttribute("startingIndex", 1) end end From e608520a6760b94e6aada84df7af11eb49283708 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 3 Jan 2015 14:46:51 -0800 Subject: [PATCH 603/794] Fixed split headers not hiding when toggling them off --- modules/units.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 0c27feb2..da2d53bd 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1102,13 +1102,6 @@ end -- Load a header unit, party or raid function Units:LoadGroupHeader(type) - -- Any frames that were split out in this group need to be hidden - for _, headerFrame in pairs(headerFrames) do - if( headerFrame.splitParent == type ) then - headerFrame:Hide() - end - end - -- Already created, so just reshow and we out if( headerFrames[type] ) then headerFrames[type]:Show() @@ -1191,6 +1184,18 @@ function Units:LoadGroupHeader(type) else headerFrame:Show() end + + -- Any frames that were split out in this group need to be hidden + if( headerFrames.raidParent ) then + for _, headerFrame in pairs(headerFrames) do + if( headerFrame.splitParent == type ) then + headerFrame:Hide() + end + end + + headerFrames.raidParent:Hide() + headerFrames.raidParent = nil + end end -- Fake headers that are supposed to act like headers to the users, but are really not From 6f7f51577114c02737a7feeac5eaa5149cc44030 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 3 Jan 2015 15:19:31 -0800 Subject: [PATCH 604/794] Stripped out split frame group hiding as it doesn't work --- modules/units.lua | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index da2d53bd..a363f38a 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -997,24 +997,7 @@ local function setupRaidStateMonitor(id, headerFrame) stateMonitor.raids[id]:SetFrameRef("raidHeader", headerFrame) stateMonitor.raids[id]:SetAttribute("hideSemiRaid", ShadowUF.db.profile.units.raid.hideSemiRaid) stateMonitor.raids[id]:WrapScript(stateMonitor.raids[id], "OnAttributeChanged", [[ - if( name == "hasraid" or name == "hasparty" or name == "recheck" ) then - local header = self:GetFrameRef("raidHeader") - local raid = self:GetAttribute("hasraid") - local party = self:GetAttribute("hasparty") - - if( header:GetAttribute("showParty") ) then - if( not party and not raid ) then - header:Hide() - elseif( party or raid ) then - header:Show() - end - elseif( not raid ) then - header:Hide() - elseif( raid ) then - header:Show() - end - - elseif( name ~= "state-raidmonitor" and name ~= "raiddisabled" and name ~= "hidesemiraid" ) then + if( name ~= "state-raidmonitor" and name ~= "raiddisabled" and name ~= "hidesemiraid" ) then return end @@ -1032,8 +1015,6 @@ local function setupRaidStateMonitor(id, headerFrame) ]]) RegisterStateDriver(stateMonitor.raids[id], "raidmonitor", "[target=raid6, exists] raid6; none") - RegisterStateDriver(stateMonitor.raids[id], "hasraid", "[target=raid1, exists] raid; none") - RegisterStateDriver(stateMonitor.raids[id], "hasparty", "[target=party1, exists] party; none") end function Units:LoadSplitGroupHeader(type) From d58ca48f13d5e711544e2ff9eb7f4bd78f906753 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 4 Jan 2015 19:43:34 -0800 Subject: [PATCH 605/794] Yet another attempt at fixing Blizzards insane crash bug --- modules/combopoints.lua | 26 ++++++++++++-------------- modules/units.lua | 1 - 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index c2db6591..53497b3c 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -3,11 +3,8 @@ ShadowUF:RegisterModule(Combo, "comboPoints", ShadowUF.L["Combo points"]) ShadowUF.ComboPoints = Combo local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBOPOINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} -local function createIcons(config, pointsFrame, cpMax) - if( not cpMax ) then return end - +local function createIcons(config, pointsFrame) local point, relativePoint, x, y - local pointsConfig = pointsFrame.cpConfig if( config.growth == "LEFT" ) then @@ -27,7 +24,7 @@ local function createIcons(config, pointsFrame, cpMax) x = x or 0 y = y or 0 - for id=1, cpMax do + for id=1, pointsConfig.max do pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.icons[id] texture:SetTexture(pointsConfig.icon) @@ -43,15 +40,13 @@ local function createIcons(config, pointsFrame, cpMax) end end -local function createBlocks(config, pointsFrame, cpMax) - if( not cpMax ) then return end - +local function createBlocks(config, pointsFrame) local pointsConfig = pointsFrame.cpConfig - pointsFrame.visibleBlocks = cpMax + pointsFrame.visibleBlocks = pointsConfig.max -- Position bars, the 5 accounts for borders - local blockWidth = (pointsFrame:GetWidth() - (cpMax - 1)) / cpMax - for id=1, cpMax do + local blockWidth = (pointsFrame:GetWidth() - (pointsConfig.max - 1)) / pointsConfig.max + for id=1, pointsConfig.max do pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.blocks[id] local color = ShadowUF.db.profile.powerColors[pointsConfig.colorKey or "COMBOPOINTS"] @@ -144,11 +139,15 @@ function Combo:UpdateBarBlocks(frame, event, unit, powerType) local max = UnitPowerMax("player", pointsFrame.cpConfig.powerType) if( max == 0 or pointsFrame.visibleBlocks == max ) then return end + pointsConfig.max = max + if( not ShadowUF.db.profile.units[frame.unitType][frame.comboPointType].isBar ) then - createIcons(ShadowUF.db.profile.units[frame.unitType][frame.comboPointType], pointsFrame, max) + createIcons(ShadowUF.db.profile.units[frame.unitType][frame.comboPointType], pointsFrame) + pointsFrame.visibleBlocks = max return else - createBlocks(ShadowUF.db.profile.units[frame.unitType][frame.comboPointType], pointsFrame, max) + createBlocks(ShadowUF.db.profile.units[frame.unitType][frame.comboPointType], pointsFrame) + pointsFrame.visibleBlocks = max end local blockWidth = (pointsFrame:GetWidth() - (max - 1)) / max @@ -161,7 +160,6 @@ function Combo:UpdateBarBlocks(frame, event, unit, powerType) pointsFrame.blocks[id]:Hide() end - pointsFrame.visibleBlocks = max end function Combo:GetPoints(unit) diff --git a/modules/units.lua b/modules/units.lua index a363f38a..edb70631 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -355,7 +355,6 @@ function Units:CheckVehicleStatus(frame, event, unit) -- Not in a vehicle yet, and they entered one that has a UI or they were in a vehicle but the GUID changed (vehicle -> vehicle) if( ( not frame.inVehicle or frame.unitGUID ~= UnitGUID(frame.vehicleUnit) ) and UnitHasVehicleUI(frame.unitOwner) and UnitHasVehiclePlayerFrameUI(frame.unitOwner) and not ShadowUF.db.profile.units[frame.unitType].disableVehicle ) then - frame.inVehicle = true frame.unit = frame.vehicleUnit From 6b34e4875bcf4666ddba4573b4c7086e0ad6b6d6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 4 Jan 2015 20:00:43 -0800 Subject: [PATCH 606/794] Only hide pet frames if we have a vehicle UI (Tries to fix Mount-in-Training not showing) --- modules/units.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index edb70631..729230ba 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -504,6 +504,7 @@ OnAttributeChanged = function(self, name, unit) -- Pet changed, going from pet -> vehicle for one if( self.unit == "pet" or self.unitType == "partypet" ) then self.unitRealOwner = self.unit == "pet" and "player" or ShadowUF.partyUnits[self.unitID] + self:SetAttribute("unitRealOwner", self.unitRealOwner) self:RegisterNormalEvent("UNIT_PET", Units, "CheckPetUnitUpdated") if( self.unit == "pet" ) then @@ -520,7 +521,8 @@ OnAttributeChanged = function(self, name, unit) -- Hide any pet that became a vehicle, we detect this by the owner being untargetable but they have a pet out stateMonitor:WrapScript(self, "OnAttributeChanged", [[ if( name == "state-vehicleupdated" ) then - self:SetAttribute("unitIsVehicle", value == "vehicle" and true or false) + print(self:GetName(), self:GetAttribute("unitRealOwner"), UnitHasVehicleUI(self:GetAttribute("unitRealOwner")), value) + self:SetAttribute("unitIsVehicle", UnitHasVehicleUI(self:GetAttribute("unitRealOwner")) and value == "vehicle" and true or false) elseif( name == "disablevehicleswap" or name == "state-unitexists" or name == "unitisvehicle" ) then -- Unit does not exist, OR unit is a vehicle and vehicle swap is not disabled, hide frame if( not self:GetAttribute("state-unitexists") or ( self:GetAttribute("unitIsVehicle") and not self:GetAttribute("disableVehicleSwap") ) ) then From 2b889e6bf22e4ca41a787168b0760362b75019a5 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 4 Jan 2015 20:01:10 -0800 Subject: [PATCH 607/794] Debug code is bad --- modules/units.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 729230ba..77780579 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -521,7 +521,6 @@ OnAttributeChanged = function(self, name, unit) -- Hide any pet that became a vehicle, we detect this by the owner being untargetable but they have a pet out stateMonitor:WrapScript(self, "OnAttributeChanged", [[ if( name == "state-vehicleupdated" ) then - print(self:GetName(), self:GetAttribute("unitRealOwner"), UnitHasVehicleUI(self:GetAttribute("unitRealOwner")), value) self:SetAttribute("unitIsVehicle", UnitHasVehicleUI(self:GetAttribute("unitRealOwner")) and value == "vehicle" and true or false) elseif( name == "disablevehicleswap" or name == "state-unitexists" or name == "unitisvehicle" ) then -- Unit does not exist, OR unit is a vehicle and vehicle swap is not disabled, hide frame From 8b101bfe32e4226d772ac6010d3cabc1539a9f09 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 4 Jan 2015 20:39:43 -0800 Subject: [PATCH 608/794] Redo the combo points module, should fix random bugs when using Chi, Holy Power, Shadow Orbs, Soul Shards, Aura Points and Combo Points --- ShadowedUnitFrames.lua | 27 ++--- ShadowedUnitFrames.toc | 1 + modules/aurapoints.lua | 4 + modules/basecombopoints.lua | 174 +++++++++++++++++++++++++++++++ modules/chi.lua | 13 +-- modules/combopoints.lua | 199 ++++-------------------------------- modules/holypower.lua | 16 +-- modules/shadoworbs.lua | 9 +- modules/soulshards.lua | 8 +- 9 files changed, 238 insertions(+), 213 deletions(-) create mode 100644 modules/basecombopoints.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 683d5d01..18354799 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 51 +ShadowUF.dbRevision = 52 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -1012,31 +1012,18 @@ end -- Upgrade info local infoMessages = { + -- Old messages we don't need anymore + {}, {}, { - L["As of SUF v3.10, a bunch of new features and units have been added.|n"], - L["- Config UI now opens instantly, and does not take 5 seconds++ to show up!"], - L["- Totem/Rune bars now have timers indicating time to refres/expire"], - L["- Monk Stagger now shows the amount of staggered damage"], - L["- Boss ToT, Main Assist ToT, Main Tank ToT, Party ToT, Battleground ToT and Arena ToT units have been added!"], - L["- Auto profile switching based on dual spec is available in /suf -> Profile"], - L["- Highlight based on unit rare/elite is now available"], - L["- Added absorb shield tags"], - L["- Added Ancient Kings bar for Paladins"], - L["- And more! See the change log for everything that has changed."], - L["|nYou can disable the new text for Monk Stagger, Totem and Rune timers through /suf -> Unit configuration -> Text/Tags"] - }, - { - L["Welcome to Shadowed Unit Frames v4! Auras have been expanded in this release.|n"], - L["- Aura Indicators are now built in"], - L["- Auras can be filtered multiple criteria rather than just self casted"], - L["- Boss debuff filtering is in"], - L["- Cooldown rings and scaled auras are more configurable"], - L["- Aura config is no longer a bunch of clumped options"] + L["You must restart Shadowed Unit Frames."], + L["If you don't, you will be unable to use any combo point features (Chi, Holy Power, Combo Points, Aura Points, etc) until you do so."] } } function ShadowUF:ShowInfoPanel() local infoID = ShadowUF.db.global.infoID or 0 + if( ShadowUF.ComboPoints and infoID < 3 ) then infoID = 3 end + ShadowUF.db.global.infoID = #(infoMessages) if( infoID < 0 or infoID >= #(infoMessages) ) then return end diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index b0005fc5..9d3ea6fe 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -44,6 +44,7 @@ modules\combattext.lua modules\totems.lua modules\runes.lua modules\fader.lua +modules\basecombopoints.lua modules\combopoints.lua modules\incheal.lua modules\incabsorb.lua diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index 34042336..50acbde9 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -21,6 +21,10 @@ function AuraPoints:OnEnable(frame) frame:RegisterUpdateFunc(self, "Update") end +function Combo:GetComboPointType() + return "auraPoints" +end + function AuraPoints:GetPoints(unit) return select(4, UnitAura("player", trackSpell.name, nil, trackSpell.filter)) or 0 end \ No newline at end of file diff --git a/modules/basecombopoints.lua b/modules/basecombopoints.lua new file mode 100644 index 00000000..c41bd692 --- /dev/null +++ b/modules/basecombopoints.lua @@ -0,0 +1,174 @@ +local Combo = {isComboPoints = true} +ShadowUF.ComboPoints = Combo + +local function createIcons(config, pointsFrame) + local point, relativePoint, x, y + local pointsConfig = pointsFrame.cpConfig + + if( config.growth == "LEFT" ) then + point, relativePoint = "BOTTOMRIGHT", "BOTTOMLEFT" + x = config.spacing + elseif( config.growth == "UP" ) then + point, relativePoint = "BOTTOMLEFT", "TOPLEFT" + y = config.spacing + elseif( config.growth == "DOWN" ) then + point, relativePoint = "TOPLEFT", "BOTTOMLEFT" + y = config.spacing + else + point, relativePoint = "BOTTOMLEFT", "BOTTOMRIGHT" + x = config.spacing + end + + x = x or 0 + y = y or 0 + + for id=1, pointsConfig.max do + pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") + local texture = pointsFrame.icons[id] + texture:SetTexture(pointsConfig.icon) + texture:SetSize(config.size or 16, config.size or 16) + + if( id > 1 ) then + texture:ClearAllPoints() + texture:SetPoint(point, pointsFrame.icons[id - 1], relativePoint, x, y) + else + texture:ClearAllPoints() + texture:SetPoint("CENTER", pointsFrame, "CENTER", 0, 0) + end + end +end + +local function createBlocks(config, pointsFrame) + local pointsConfig = pointsFrame.cpConfig + pointsFrame.visibleBlocks = pointsConfig.max + + -- Position bars, the 5 accounts for borders + local blockWidth = (pointsFrame:GetWidth() - (pointsConfig.max - 1)) / pointsConfig.max + for id=1, pointsConfig.max do + pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") + local texture = pointsFrame.blocks[id] + local color = ShadowUF.db.profile.powerColors[pointsConfig.colorKey or "COMBOPOINTS"] + texture:SetVertexColor(color.r, color.g, color.b, color.a) + texture:SetHorizTile(false) + texture:SetTexture(ShadowUF.Layout.mediaPath.statusbar) + texture:SetHeight(pointsFrame:GetHeight()) + texture:SetWidth(blockWidth) + texture:ClearAllPoints() + + if( config.growth == "LEFT" ) then + if( id > 1 ) then + texture:SetPoint("TOPRIGHT", pointsFrame.blocks[id - 1], "TOPLEFT", -1, 0) + else + texture:SetPoint("TOPRIGHT", pointsFrame, "TOPRIGHT", 0, 0) + end + else + if( id > 1 ) then + texture:SetPoint("TOPLEFT", pointsFrame.blocks[id - 1], "TOPRIGHT", 1, 0) + else + texture:SetPoint("TOPLEFT", pointsFrame, "TOPLEFT", 0, 0) + end + end + end +end + +function Combo:OnLayoutApplied(frame, config) + local key = self:GetComboPointType() + local pointsFrame = frame[key] + if( not pointsFrame ) then return end + + pointsFrame:SetFrameLevel(frame.topFrameLevel + 1) + + local pointsConfig = pointsFrame.cpConfig + config = config[key] + + -- Not a bar so set the containers frame configuration + if( config and not config.isBar ) then + ShadowUF.Layout:ToggleVisibility(pointsFrame, frame.visibility[key]) + end + + if( not frame.visibility[key] ) then return end + + -- Hide the active combo points + if( pointsFrame.points ) then + for _, texture in pairs(pointsFrame.points) do + texture:Hide() + end + end + + -- Setup for bar display! + if( config.isBar ) then + pointsFrame.blocks = pointsFrame.blocks or {} + pointsFrame.points = pointsFrame.blocks + + createBlocks(config, pointsFrame, pointsConfig.max) + + -- guess not, will have to do icons :( + else + pointsFrame.icons = pointsFrame.icons or {} + pointsFrame.points = pointsFrame.icons + + createIcons(config, pointsFrame, pointsConfig.max) + + -- Position the main frame + pointsFrame:SetSize(0.1, 0.1) + + ShadowUF.Layout:AnchorFrame(frame, pointsFrame, config) + end +end + +function Combo:OnDisable(frame) + frame:UnregisterAll(self) +end + +function Combo:UpdateBarBlocks(frame, event, unit, powerType) + local key = self:GetComboPointType() + local pointsFrame = frame[key] + if( not pointsFrame or not pointsFrame.cpConfig.eventType or not pointsFrame.blocks ) then return end + if( event and powerType ~= pointsFrame.cpConfig.eventType ) then return end + + local max = UnitPowerMax("player", pointsFrame.cpConfig.powerType) + if( max == 0 or pointsFrame.visibleBlocks == max ) then return end + + pointsConfig.max = max + + if( not ShadowUF.db.profile.units[frame.unitType][key].isBar ) then + createIcons(ShadowUF.db.profile.units[frame.unitType][key], pointsFrame) + pointsFrame.visibleBlocks = max + return + else + createBlocks(ShadowUF.db.profile.units[frame.unitType][key], pointsFrame) + pointsFrame.visibleBlocks = max + end + + local blockWidth = (pointsFrame:GetWidth() - (max - 1)) / max + for id=1, max do + pointsFrame.blocks[id]:SetWidth(blockWidth) + pointsFrame.blocks[id]:Show() + end + + for id=max+1, max do + pointsFrame.blocks[id]:Hide() + end + +end + +function Combo:Update(frame, event, unit, powerType) + local key = self:GetComboPointType() + -- Anything power based will have an eventType to filter on + if( event and frame[key].cpConfig.eventType and frame[key].cpConfig.eventType ~= powerType ) then return end + + local points = self:GetPoints(unit) + + -- Bar display, hide it if we don't have any combo points + if( ShadowUF.db.profile.units[frame.unitType][key].isBar ) then + ShadowUF.Layout:SetBarVisibility(frame, key, ShadowUF.db.profile.units[frame.unitType][key].showAlways or (points and points > 0)) + end + + for id, pointTexture in pairs(frame[key].points) do + if( id <= points ) then + pointTexture:Show() + else + pointTexture:Hide() + end + end +end diff --git a/modules/chi.lua b/modules/chi.lua index 36466688..63658715 100755 --- a/modules/chi.lua +++ b/modules/chi.lua @@ -1,3 +1,5 @@ +if( not ShadowUF.ComboPoints ) then return end + local Chi = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(Chi, "chi", ShadowUF.L["Chi"], nil, "MONK") local chiConfig = {max = 6, key = "chi", colorKey = "CHI", powerType = SPELL_POWER_CHI, eventType = "CHI", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} @@ -5,7 +7,6 @@ local chiConfig = {max = 6, key = "chi", colorKey = "CHI", powerType = SPELL_POW function Chi:OnEnable(frame) frame.chi = frame.chi or CreateFrame("Frame", nil, frame) frame.chi.cpConfig = chiConfig - frame.comboPointType = chiConfig.key frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") @@ -13,15 +14,15 @@ function Chi:OnEnable(frame) frame:RegisterUpdateFunc(self, "Update") end -function Chi:OnDisable(frame) - frame:UnregisterAll(self) -end - function Chi:OnLayoutApplied(frame, config) - ShadowUF.ComboPoints:OnLayoutApplied(frame, config) + ShadowUF.ComboPoints.OnLayoutApplied(self, frame, config) self:UpdateBarBlocks(frame) end +function Chi:GetComboPointType() + return "chi" +end + function Chi:GetPoints(unit) return UnitPower("player", chiConfig.powerType) end \ No newline at end of file diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 53497b3c..24782cfa 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -1,195 +1,38 @@ -local Combo = {isComboPoints = true} -ShadowUF:RegisterModule(Combo, "comboPoints", ShadowUF.L["Combo points"]) -ShadowUF.ComboPoints = Combo -local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBOPOINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} - -local function createIcons(config, pointsFrame) - local point, relativePoint, x, y - local pointsConfig = pointsFrame.cpConfig +if( not ShadowUF.ComboPoints ) then return end - if( config.growth == "LEFT" ) then - point, relativePoint = "BOTTOMRIGHT", "BOTTOMLEFT" - x = config.spacing - elseif( config.growth == "UP" ) then - point, relativePoint = "BOTTOMLEFT", "TOPLEFT" - y = config.spacing - elseif( config.growth == "DOWN" ) then - point, relativePoint = "TOPLEFT", "BOTTOMLEFT" - y = config.spacing - else - point, relativePoint = "BOTTOMLEFT", "BOTTOMRIGHT" - x = config.spacing - end - - x = x or 0 - y = y or 0 - - for id=1, pointsConfig.max do - pointsFrame.icons[id] = pointsFrame.icons[id] or pointsFrame:CreateTexture(nil, "OVERLAY") - local texture = pointsFrame.icons[id] - texture:SetTexture(pointsConfig.icon) - texture:SetSize(config.size or 16, config.size or 16) - - if( id > 1 ) then - texture:ClearAllPoints() - texture:SetPoint(point, pointsFrame.icons[id - 1], relativePoint, x, y) - else - texture:ClearAllPoints() - texture:SetPoint("CENTER", pointsFrame, "CENTER", 0, 0) - end - end -end - -local function createBlocks(config, pointsFrame) - local pointsConfig = pointsFrame.cpConfig - pointsFrame.visibleBlocks = pointsConfig.max - - -- Position bars, the 5 accounts for borders - local blockWidth = (pointsFrame:GetWidth() - (pointsConfig.max - 1)) / pointsConfig.max - for id=1, pointsConfig.max do - pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") - local texture = pointsFrame.blocks[id] - local color = ShadowUF.db.profile.powerColors[pointsConfig.colorKey or "COMBOPOINTS"] - texture:SetVertexColor(color.r, color.g, color.b, color.a) - texture:SetHorizTile(false) - texture:SetTexture(ShadowUF.Layout.mediaPath.statusbar) - texture:SetHeight(pointsFrame:GetHeight()) - texture:SetWidth(blockWidth) - texture:ClearAllPoints() - - if( config.growth == "LEFT" ) then - if( id > 1 ) then - texture:SetPoint("TOPRIGHT", pointsFrame.blocks[id - 1], "TOPLEFT", -1, 0) - else - texture:SetPoint("TOPRIGHT", pointsFrame, "TOPRIGHT", 0, 0) - end - else - if( id > 1 ) then - texture:SetPoint("TOPLEFT", pointsFrame.blocks[id - 1], "TOPRIGHT", 1, 0) - else - texture:SetPoint("TOPLEFT", pointsFrame, "TOPLEFT", 0, 0) - end - end - end -end +local Combo = setmetatable({}, {__index = ShadowUF.ComboPoints}) +ShadowUF:RegisterModule(Combo, "comboPoints", ShadowUF.L["Combo points"]) +local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBOPOINTS", powerType = 4, eventType = "COMBO_POINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) frame.comboPoints.cpConfig = cpConfig - frame.comboPointType = cpConfig.key - frame:RegisterNormalEvent("UNIT_COMBO_POINTS", self, "Update") + frame:RegisterUnitEvent("UNIT_POWER", self, "Update") frame:RegisterUpdateFunc(self, "Update") end -function Combo:OnLayoutApplied(frame, config) - local key = frame.comboPointType - local pointsFrame = frame[key] - if( not pointsFrame ) then return end - - pointsFrame:SetFrameLevel(frame.topFrameLevel + 1) - - local pointsConfig = pointsFrame.cpConfig - config = config[key] - - -- Not a bar so set the containers frame configuration - if( config and not config.isBar ) then - ShadowUF.Layout:ToggleVisibility(pointsFrame, frame.visibility[key]) - end - - if( not frame.visibility[key] ) then return end - - -- Hide the active combo points - if( pointsFrame.points ) then - for _, texture in pairs(pointsFrame.points) do - texture:Hide() - end - end - - -- Setup for bar display! - if( config.isBar ) then - pointsFrame.blocks = pointsFrame.blocks or {} - pointsFrame.points = pointsFrame.blocks - - createBlocks(config, pointsFrame, pointsConfig.max) - - -- guess not, will have to do icons :( - else - pointsFrame.icons = pointsFrame.icons or {} - pointsFrame.points = pointsFrame.icons - - createIcons(config, pointsFrame, pointsConfig.max) - - -- Position the main frame - pointsFrame:SetSize(0.1, 0.1) - - ShadowUF.Layout:AnchorFrame(frame, pointsFrame, config) - end -end - -function Combo:OnDisable(frame) - frame:UnregisterAll(self) -end - - -function Combo:UpdateBarBlocks(frame, event, unit, powerType) - local pointsFrame = frame[frame.comboPointType] - if( not pointsFrame or not pointsFrame.cpConfig.eventType or not pointsFrame.blocks ) then return end - if( event and powerType ~= pointsFrame.cpConfig.eventType ) then return end - - local max = UnitPowerMax("player", pointsFrame.cpConfig.powerType) - if( max == 0 or pointsFrame.visibleBlocks == max ) then return end - - pointsConfig.max = max - - if( not ShadowUF.db.profile.units[frame.unitType][frame.comboPointType].isBar ) then - createIcons(ShadowUF.db.profile.units[frame.unitType][frame.comboPointType], pointsFrame) - pointsFrame.visibleBlocks = max - return - else - createBlocks(ShadowUF.db.profile.units[frame.unitType][frame.comboPointType], pointsFrame) - pointsFrame.visibleBlocks = max - end - - local blockWidth = (pointsFrame:GetWidth() - (max - 1)) / max - for id=1, max do - pointsFrame.blocks[id]:SetWidth(blockWidth) - pointsFrame.blocks[id]:Show() - end - - for id=max+1, max do - pointsFrame.blocks[id]:Hide() - end - +function Combo:GetComboPointType() + return "comboPoints" end function Combo:GetPoints(unit) -- For Malygos dragons, they also self cast their CP on themselves, which is why we check CP on ourself - local playerUnit = UnitHasVehicleUI("player") and UnitHasVehiclePlayerFrameUI("player") and "vehicle" or "player" - local points = GetComboPoints(playerUnit) - if( points == 0 ) then - points = GetComboPoints(playerUnit, playerUnit) - end + if( UnitHasVehicleUI("player") and UnitHasVehiclePlayerFrameUI("player") ) then + local points = GetComboPoints("vehicle") + if( points == 0 ) then + points = GetComboPoints("vehicle", "vehicle") + end - return points + return points + else + return UnitPower("player", cpConfig.powerType) + end end function Combo:Update(frame, event, unit, powerType) - local key = frame.comboPointType - -- Anything power based will have an eventType to filter on - if( event and frame[key].cpConfig.eventType and frame[key].cpConfig.eventType ~= powerType ) then return end - - local points = self:GetPoints(unit) - - -- Bar display, hide it if we don't have any combo points - if( ShadowUF.db.profile.units[frame.unitType][key].isBar ) then - ShadowUF.Layout:SetBarVisibility(frame, key, ShadowUF.db.profile.units[frame.unitType][key].showAlways or (points and points > 0)) - end - - for id, pointTexture in pairs(frame[key].points) do - if( id <= points ) then - pointTexture:Show() - else - pointTexture:Hide() - end + if( event == "UNIT_COMBO_POINTS" ) then + ShadowUF.ComboPoints.Update(self, frame) + else + ShadowUF.ComboPoints.Update(self, frame, event, unit, powerType) end -end +end \ No newline at end of file diff --git a/modules/holypower.lua b/modules/holypower.lua index 595666eb..d3232c0f 100755 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -1,3 +1,5 @@ +if( not ShadowUF.ComboPoints ) then return end + local HolyPower = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN", nil, PALADINPOWERBAR_SHOW_LEVEL) local holyConfig = {max = 5, key = "holyPower", colorKey = "HOLYPOWER", powerType = SPELL_POWER_HOLY_POWER, eventType = "HOLY_POWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} @@ -5,7 +7,6 @@ local holyConfig = {max = 5, key = "holyPower", colorKey = "HOLYPOWER", powerTyp function HolyPower:OnEnable(frame) frame.holyPower = frame.holyPower or CreateFrame("Frame", nil, frame) frame.holyPower.cpConfig = holyConfig - frame.comboPointType = holyConfig.key frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") @@ -17,16 +18,15 @@ function HolyPower:OnEnable(frame) end function HolyPower:OnLayoutApplied(frame, config) - ShadowUF.ComboPoints:OnLayoutApplied(frame, config) + ShadowUF.ComboPoints.OnLayoutApplied(self, frame, config) self:UpdateBarBlocks(frame) end function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) - local pointsFrame = frame[frame.comboPointType] - if( not pointsFrame or frame.comboPointType ~= holyConfig.key ) then return end - if( event and powerType ~= holyConfig.eventType ) then return end + local pointsFrame = frame[self:GetComboPointType()] + if( not pointsFrame or ( event and powerType ~= holyConfig.eventType ) ) then return end - ShadowUF.ComboPoints:UpdateBarBlocks(frame) + ShadowUF.ComboPoints.UpdateBarBlocks(self, frame) local config = ShadowUF.db.profile.units[frame.unitType].holyPower local color = ShadowUF.db.profile.powerColors["BANKEDHOLYPOWER"] @@ -43,6 +43,10 @@ function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) end end +function HolyPower:GetComboPointType() + return "holyPower" +end + function HolyPower:GetPoints(unit) return UnitPower("player", holyConfig.powerType) end \ No newline at end of file diff --git a/modules/shadoworbs.lua b/modules/shadoworbs.lua index 673ad730..a26b4567 100755 --- a/modules/shadoworbs.lua +++ b/modules/shadoworbs.lua @@ -1,3 +1,5 @@ +if( not ShadowUF.ComboPoints ) then return end + local ShadowOrbs = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(ShadowOrbs, "shadowOrbs", ShadowUF.L["Shadow Orbs"], nil, "PRIEST", SPEC_PRIEST_SHADOW, SHADOW_ORBS_SHOW_LEVEL) local shadowConfig = {max = 5, key = "shadowOrbs", colorKey = "SHADOWORBS", powerType = SPELL_POWER_SHADOW_ORBS, eventType = "SHADOW_ORBS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} @@ -5,7 +7,6 @@ local shadowConfig = {max = 5, key = "shadowOrbs", colorKey = "SHADOWORBS", powe function ShadowOrbs:OnEnable(frame) frame.shadowOrbs = frame.shadowOrbs or CreateFrame("Frame", nil, frame) frame.shadowOrbs.cpConfig = shadowConfig - frame.comboPointType = shadowConfig.key frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") @@ -16,10 +17,14 @@ function ShadowOrbs:OnEnable(frame) end function ShadowOrbs:OnLayoutApplied(frame, config) - ShadowUF.ComboPoints:OnLayoutApplied(frame, config) + ShadowUF.ComboPoints.OnLayoutApplied(self, frame, config) self:UpdateBarBlocks(frame) end +function ShadowOrbs:GetComboPointType() + return "shadowOrbs" +end + function ShadowOrbs:GetPoints(unit) return UnitPower("player", shadowConfig.powerType) end \ No newline at end of file diff --git a/modules/soulshards.lua b/modules/soulshards.lua index 65b60bc3..49feea42 100755 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -1,3 +1,5 @@ +if( not ShadowUF.ComboPoints ) then return end + local Souls = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(Souls, "soulShards", ShadowUF.L["Soul Shards"], nil, "WARLOCK", SPEC_WARLOCK_AFFLICTION) local soulsConfig = {max = 4, key = "soulShards", colorKey = "SOULSHARDS", powerType = SPELL_POWER_SOUL_SHARDS, eventType = "SOUL_SHARDS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\shard"} @@ -16,10 +18,14 @@ function Souls:OnEnable(frame) end function Souls:OnLayoutApplied(frame, config) - ShadowUF.ComboPoints:OnLayoutApplied(frame, config) + ShadowUF.ComboPoints.OnLayoutApplied(self, frame, config) self:UpdateBarBlocks(frame) end +function Souls:GetComboPointType() + return "soulShards" +end + function Souls:GetPoints(unit) return UnitPower("player", soulsConfig.powerType) end \ No newline at end of file From 5182fe7dc5441ac824d862637a7d772eb021a14c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sun, 4 Jan 2015 21:10:59 -0800 Subject: [PATCH 609/794] Redo the Eclipse Bar to add a highlight based on where you are, and fixed the arrow going outside of the unit frame --- ShadowedUnitFrames.lua | 337 ++--------------------------------------- modules/eclipse.lua | 89 ++++++++++- 2 files changed, 93 insertions(+), 333 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 18354799..c3c295cc 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 52 +ShadowUF.dbRevision = 53 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -99,6 +99,15 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 53 ) then + for i=1, #(self.db.profile.units.player.text) do + if( self.db.profile.units.player.text[i].anchorTo == "$eclipseBar" ) then + table.remove(self.db.profile.units.player.text, i) + break + end + end + end + if( revision <= 49 ) then ShadowUF:LoadDefaultLayout(true) end @@ -109,10 +118,6 @@ function ShadowUF:CheckUpgrade() end end - if( revision <= 48 ) then - ShadowUF:LoadDefaultLayout(true) - end - if( revision <= 47 ) then local config = self.db.profile.units config.player.comboPoints = config.target.comboPoints @@ -140,328 +145,6 @@ function ShadowUF:CheckUpgrade() end end end - - if( revision <= 44 ) then - ShadowUF:LoadDefaultLayout(true) - - for unit, config in pairs(self.defaults.profile.units) do - if( config.indicators and config.indicators.resurrect ) then - local db = self.db.profile.units[unit] - - local options - if( unit == "target" ) then - options = {enabled = true, anchorPoint = "RC", size = 28, x = -39, y = -1, anchorTo = "$parent"} - else - options = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"} - end - - for key, value in pairs(options) do - if( db.indicators.resurrect[key] == nil ) then - db.indicators.resurrect[key] = value - end - end - end - end - end - - if( revision <= 43 ) then - for key, _ in pairs(self.db.profile.auraIndicators.indicators) do - self.db.profile.auraIndicators.height = nil - self.db.profile.auraIndicators.filters[key] = {boss = {priority = 100}, curable = {priority = 100}} - end - end - - if( revision <= 42 ) then - for unit, config in pairs(self.db.profile.units) do - config.auras.height = nil - - for type, auraConfig in pairs(config.auras) do - auraConfig.show = {misc = true} - auraConfig.show.player = auraConfig.player - auraConfig.show.raid = auraConfig.raid - - auraConfig.enlarge = {} - auraConfig.enlarge["SELF"] = auraConfig.enlargeSelf - auraConfig.enlarge["REMOVABLE"] = auraConfig.enlargeStealable - - auraConfig.timers = {} - if( auraConfig.selfTimers ) then - auraConfig.timers["SELF"] = true - else - auraConfig.timers["ALL"] = true - end - - auraConfig.selfTimers = nil - auraConfig.player = nil - auraConfig.raid = nil - auraConfig.enlargeSelf = nil - auraConfig.enlargeStealable = nil - end - - config.auras.buffs.show.consolidated = true - config.auras.debuffs.show.boss = true - end - end - - if( revision <= 41 ) then - local phase = self.db.profile.units.party.indicators.phase - phase.anchorPoint = phase.anchorPoint or "RC" - phase.size = phase.size or 14 - phase.x = phase.x or -11 - phase.y = phase.y or 0 - phase.anchorTo = phase.anchorTo or "$parent" - end - - if( revision <= 40 ) then - ShadowUF:LoadDefaultLayout(true) - - for unit, config in pairs(self.db.profile.units) do - if( config.healAbsorb and not self.defaults.profile.units[unit].healAbsorb ) then - config.healAbsorb = nil - end - end - end - - if( revision <= 39 ) then - table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[monk:abs:stagger]", anchorTo = "$staggerBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) - end - - if( revision <= 38 ) then - table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Timer Text"], text = "", anchorTo = "$runeBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true}) - table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Timer Text"], text = "", anchorTo = "$totemBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true}) - - for _, config in pairs(self.db.profile.units) do - for id, text in pairs(config.text) do - if( id <= 5 ) then - text.default = true - end - end - end - end - - if( revision <= 37 ) then - self.db.profile.healthColors.healAbsorb = {r = 0.68, g = 0.47, b = 1} - end - - if( revision <= 34 ) then - self.db.profile.units.player.staggerBar = {enabled = true, background = true, height = 0.30, order = 70} - self.db.profile.powerColors.STAGGER_GREEN = {r = 0.52, g = 1.0, b = 0.52} - self.db.profile.powerColors.STAGGER_YELLOW = {r = 1.0, g = 0.98, b = 0.72} - self.db.profile.powerColors.STAGGER_RED = {r = 1.0, g = 0.42, b = 0.42} - end - - if( revision <= 33 ) then - for unit, config in pairs(self.db.profile.units) do - if( not self.defaults.profile.units[unit].incHeal and config.incHeal ) then - config.incHeal = nil - end - - if( not self.defaults.profile.units[unit].incAbsorb and config.incAbsorb ) then - config.incAbsorb = nil - end - - if( config.incAbsorb ) then - config.incAbsorb.cap = config.incAbsorb.cap or 1.30 - end - - if( config.incHeal ) then - config.incHeal.cap = config.incHeal.cap or 1.30 - end - end - end - - if( revision <= 32 ) then - for unit, config in pairs(self.db.profile.units) do - if( config.incAbsorb and not config.incAbsorb.cap ) then - config.incAbsorb.cap = 1.30 - end - end - end - - if( revision <= 31 or not self.db.profile.healthColors.incAbsorb ) then - self.db.profile.healthColors.incAbsorb = {r = 0.93, g = 0.75, b = 0.09} - - for unit, config in pairs(self.db.profile.units) do - if( config.incHeal ) then - config.incHeal.enabled = config.incHeal.heals - config.incHeal.heals = nil - config.incAbsorb = {enabled = config.incHeal.enabled} - end - end - end - - if( revision <= 30 ) then - self.db.profile.powerColors.RUNEOFPOWER = {r = 0.35, g = 0.45, b = 0.60} - end - - if( revision <= 29 ) then - self.db.profile.units.player.totemBar.showAlways = true - end - - if( revision <= 28 ) then - self.db.profile.units.target.indicators.questBoss = {enabled = true, anchorPoint = "BR", size = 22, x = 9, y = 24, anchorTo = "$parent"} - self.db.profile.units.focus.indicators.questBoss = {enabled = false, anchorPoint = "BR", size = 22, x = 7, y = 14, anchorTo = "$parent"} - - for unit, config in pairs(self.db.profile.units) do - for key, module in pairs(ShadowUF.modules) do - if( config[key] and ( module.moduleHasBar or module.isComboPoints or config[key].isBar or config[key].order ) ) then - config[key].height = config[key].height or 0.40 - end - end - end - end - - if( revision <= 27 ) then - self.db.profile.healthColors.aggro = CopyTable(self.db.profile.healthColors.hostile) - end - - if( revision <= 26 ) then - for _, unit in pairs(self.unitList) do - if( unit ~= "player" ) then - for id, text in pairs(self.db.profile.units[unit].text) do - if( text.anchorTo == "$demonicFuryBar" ) then - self.db.profile.units[unit].text[id] = nil - end - end - end - end - end - - if( revision <= 25 ) then - table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = -1, x = 0, y = 0, default = true}) - end - - if( revision <= 24 ) then - self.db.profile.powerColors.AURAPOINTS = {r = 1.0, g = 0.80, b = 0} - self.db.profile.units.player.auraPoints = {enabled = false, showAlways = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40} - end - - if( revision <= 23 ) then - self.db.profile.hidden.playerAltPower = false - self.db.profile.powerColors.ALTERNATE = {r = 0.815, g = 0.941, b = 1} - end - - if( revision <= 22 ) then - self:LoadDefaultLayout(true) - - for _, unit in pairs(self.unitList) do - if( ShadowUF.fakeUnits[unit] ) then - self.db.profile.units[unit].altPowerBar.enabled = false - end - end - end - - if( revision <= 21 ) then - self.db.profile.powerColors["POWER_TYPE_FEL_ENERGY"] = {r = 0.878, g = 0.980, b = 0} - end - - if( revision <= 20 ) then - self.db.profile.powerColors["ALTERNATE"] = {r = 0.71, g = 0.0, b = 1.0} - - for _, unit in pairs(self.unitList) do - self.db.profile.units[unit].altPowerBar.enabled = true - self.db.profile.units[unit].altPowerBar.background = true - self.db.profile.units[unit].altPowerBar.height = 0.40 - self.db.profile.units[unit].altPowerBar.order = 100 - end - end - - if( revision <= 19 ) then - self.db.profile.units.pet.altPowerBar.enabled = true - table.insert(self.db.profile.units.player.text, {enabled = true, width = 1, name = L["Text"], text = "[warlock:demonic:curpp]", anchorTo = "$demonicFuryBar", anchorPoint = "C", size = -1, x = 0, y = 0, default = true}) - end - - if( revision <= 18 ) then - self.db.profile.powerColors["MUSHROOMS"] = {r = 0.20, g = 0.90, b = 0.20} - self.db.profile.powerColors["STATUE"] = {r = 0.35, g = 0.45, b = 0.60} - end - - if( revision <= 17 ) then - self.db.profile.units.target.indicators.petBattle = {enabled = true, anchorPoint = "BL", size = 18, x = -6, y = 14, anchorTo = "$parent"} - self.db.profile.units.focus.indicators.petBattle = {enabled = false, anchorPoint = "BL", size = 18, x = -6, y = 12, anchorTo = "$parent"} - self.db.profile.units.party.indicators.phase = {enabled = true} - end - - if( revision <= 16 ) then - self.db.profile.units.target.indicators.questBoss = {enabled = true, anchorPoint = "BR", size = 22, x = 9, y = 24, anchorTo = "$parent"} - self.db.profile.units.focus.indicators.questBoss = {enabled = false, anchorPoint = "BR", size = 22, x = 7, y = 14, anchorTo = "$parent"} - end - - if( revision <= 15 ) then - self.db.profile.powerColors["DEMONICFURY"] = {r = 0.58, g = 0.51, b = 0.79} - self.db.profile.powerColors["BURNINGEMBERS"] = {r = 0.58, g = 0.51, b = 0.79} - self.db.profile.powerColors["FULLBURNINGEMBER"] = {r = 0.88, g = 0.09, b = 0.062} - self.db.profile.powerColors["SHADOWORBS"] = {r = 0.58, g = 0.51, b = 0.79} - - self.db.profile.units.player.shadowOrbs = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true} - self.db.profile.units.player.burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70} - self.db.profile.units.player.demonicFuryBar = {enabled = true, background = false, height = 0.40, order = 70} - end - - if( revision <= 14 ) then - self.db.profile.powerColors["CHI"] = {r = 0.71, g = 1.0, b = 0.92} - - self.db.profile.units.player.chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true} - end - - if( revision <= 13 ) then - self.db.profile.powerColors["BANKEDHOLYPOWER"] = {r = 0.96, g = 0.61, b = 0.84} - end - - if( revision <= 12 ) then - self.db.profile.classColors["MONK"] = {r = 0.0, g = 1.00, b = 0.59} - end - - if( revision <= 11 ) then - for unit, config in pairs(self.db.profile.units) do - if( config.powerBar ) then - config.powerBar.colorType = "type" - end - end - end - - if( revision <= 10 ) then - for unit, config in pairs(self.db.profile.units) do - if( config.healthBar ) then - config.healthBar.predicted = nil - end - end - - for unit, config in pairs(self.db.profile.units) do - if( unit ~= "party" and config.indicators and config.indicators.phase ) then - config.indicators.phase = nil - end - end - end - - if( revision <= 8 ) then - for unit, config in pairs(self.db.profile.units) do - if( config.incHeal ) then - config.incHeal.heals = config.incHeal.enabled - end - end - end - - if( revision <= 7 ) then - self.db.profile.auraColors = {removable = {r = 1, g = 1, b = 1}} - end - - if( revision <= 6 ) then - for _, unit in pairs({"player", "focus", "target", "raid", "party", "mainassist", "maintank"}) do - local db = self.db.profile.units[unit] - if( not db.indicators.resurrect ) then - if( unit == "target" ) then - db.indicators.resurrect = {enabled = true, anchorPoint = "RC", size = 28, x = -39, y = -1, anchorTo = "$parent"} - else - db.indicators.resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"} - end - end - - if( unit == "party" and not db.indicators.phase ) then - db.indicators.phase = {enabled = false, anchorPoint = "BR", size = 23, x = 8, y = 36, anchorTo = "$parent"} - end - end - end end local function zoneEnabled(zone, zoneList) diff --git a/modules/eclipse.lua b/modules/eclipse.lua index 69404325..1721963d 100755 --- a/modules/eclipse.lua +++ b/modules/eclipse.lua @@ -1,7 +1,4 @@ -- Moon on left, Sun on right --- Cast Arcane -> Move to Sun (Buff Nature) --- Cast Nature -> Move to Moon (Buff Arcane) --- 1 = Balance spec local Eclipse = {types = {"sun", "moon"}} ShadowUF:RegisterModule(Eclipse, "eclipseBar", ShadowUF.L["Eclipse bar"], true, "DRUID", 1) @@ -11,9 +8,11 @@ function Eclipse:OnEnable(frame) -- the arrow marker frame.eclipseBar.marker = CreateFrame("Frame", nil, frame.eclipseBar) frame.eclipseBar.marker:SetPoint("CENTER", frame.eclipseBar) + frame.eclipseBar.marker:SetFrameLevel(frame.topFrameLevel + 5) frame.eclipseBar.marker.texture = frame.eclipseBar.marker:CreateTexture(nil, "OVERLAY") frame.eclipseBar.marker.texture:SetAtlas("DruidEclipse-Arrow") frame.eclipseBar.marker.texture:SetTexCoord(1.0, 0.914, 0.82, 1.0) + frame.eclipseBar.marker.texture:SetVertexColor(1, 1, 1, 1) frame.eclipseBar.marker.texture:SetBlendMode("ADD") frame.eclipseBar.marker.texture:SetAllPoints(frame.eclipseBar.marker) @@ -25,8 +24,53 @@ function Eclipse:OnEnable(frame) frame.eclipseBar.sun = frame.eclipseBar:CreateTexture(nil, "ARTWORK") frame.eclipseBar.sun:SetPoint("TOPRIGHT", frame.eclipseBar, "TOPRIGHT") frame.eclipseBar.sun:SetPoint("BOTTOMLEFT", frame.eclipseBar, "BOTTOM") + + for _, type in pairs(self.types) do + local typeFrame = frame.eclipseBar[type] + typeFrame.highlight = CreateFrame("Frame", nil, frame.eclipseBar) + typeFrame.highlight:SetFrameLevel(frame.topFrameLevel) + typeFrame.highlight:SetAllPoints(typeFrame) + typeFrame.highlight:SetSize(1, 1) + + typeFrame.highlight.top = typeFrame.highlight:CreateTexture(nil, "OVERLAY") + typeFrame.highlight.top:SetBlendMode("ADD") + typeFrame.highlight.top:SetTexture("Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\highlight") + typeFrame.highlight.top:SetPoint("TOPLEFT", typeFrame, 0, 0) + typeFrame.highlight.top:SetPoint("TOPRIGHT", typeFrame, 0, 0) + typeFrame.highlight.top:SetHeight(30) + typeFrame.highlight.top:SetTexCoord(0.3125, 0.625, 0, 0.3125) + typeFrame.highlight.top:SetHorizTile(false) + + typeFrame.highlight.left = typeFrame.highlight:CreateTexture(nil, "OVERLAY") + typeFrame.highlight.left:SetBlendMode("ADD") + typeFrame.highlight.left:SetTexture("Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\highlight") + typeFrame.highlight.left:SetPoint("TOPLEFT", typeFrame, 0, 0) + typeFrame.highlight.left:SetPoint("BOTTOMLEFT", typeFrame, 0, 0) + typeFrame.highlight.left:SetWidth(30) + typeFrame.highlight.left:SetTexCoord(0, 0.3125, 0.3125, 0.625) + typeFrame.highlight.left:SetHorizTile(false) + + typeFrame.highlight.right = typeFrame.highlight:CreateTexture(nil, "OVERLAY") + typeFrame.highlight.right:SetBlendMode("ADD") + typeFrame.highlight.right:SetTexture("Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\highlight") + typeFrame.highlight.right:SetPoint("TOPRIGHT", typeFrame, 0, 0) + typeFrame.highlight.right:SetPoint("BOTTOMRIGHT", typeFrame, 0, 0) + typeFrame.highlight.right:SetWidth(30) + typeFrame.highlight.right:SetTexCoord(0.625, 0.93, 0.3125, 0.625) + typeFrame.highlight.right:SetHorizTile(false) + + typeFrame.highlight.bottom = typeFrame.highlight:CreateTexture(nil, "OVERLAY") + typeFrame.highlight.bottom:SetBlendMode("ADD") + typeFrame.highlight.bottom:SetTexture("Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\highlight") + typeFrame.highlight.bottom:SetPoint("BOTTOMLEFT", typeFrame, 0, 0) + typeFrame.highlight.bottom:SetPoint("BOTTOMRIGHT", typeFrame, 0, 0) + typeFrame.highlight.bottom:SetHeight(30) + typeFrame.highlight.bottom:SetTexCoord(0.3125, 0.625, 0.625, 0.93) + typeFrame.highlight.bottom:SetHorizTile(false) + typeFrame.highlight:Hide() + end end - + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") frame:RegisterNormalEvent("ECLIPSE_DIRECTION_CHANGE", self, "UpdateDirection") @@ -42,13 +86,31 @@ end function Eclipse:OnLayoutApplied(frame) if( not frame.visibility.eclipseBar ) then return end + local highlightSize = math.ceil(frame.eclipseBar:GetHeight()) for _, type in pairs(self.types) do local color = ShadowUF.db.profile.powerColors["ECLIPSE_" .. string.upper(type)] frame.eclipseBar[type]:SetTexture(ShadowUF.Layout.mediaPath.statusbar) frame.eclipseBar[type]:SetVertexColor(color.r, color.g, color.b) frame.eclipseBar[type]:SetHorizTile(false) + + for _, type in pairs(self.types) do + local typeFrame = frame.eclipseBar[type] + typeFrame.highlight.top:SetVertexColor(color.r, color.g, color.b, 0.9) + typeFrame.highlight.top:SetHeight(highlightSize) + + typeFrame.highlight.bottom:SetVertexColor(color.r, color.g, color.b, 0.9) + typeFrame.highlight.bottom:SetHeight(highlightSize) + + typeFrame.highlight.left:SetVertexColor(color.r, color.g, color.b, 0.9) + typeFrame.highlight.left:SetWidth(highlightSize) + + typeFrame.highlight.right:SetVertexColor(color.r, color.g, color.b, 0.9) + typeFrame.highlight.right:SetWidth(highlightSize) + end end + frame.eclipseBar.marker:SetSize(frame.eclipseBar:GetHeight() * 2, frame.eclipseBar:GetHeight() * 2) + self:UpdateVisibility(frame) end @@ -71,6 +133,21 @@ function Eclipse:Update(frame, event, unit, powerType) if( event and powerType ~= "ECLIPSE" ) then return end local power = UnitPower("player", SPELL_POWER_ECLIPSE) - local xpos = (frame.eclipseBar:GetWidth() / 2) * (power / 100) - frame.eclipseBar.marker:SetPoint("CENTER", frame.eclipseBar, "CENTER", xpos, 0) + local halfWidth = (frame.eclipseBar:GetWidth() - frame.eclipseBar.marker:GetWidth()) / 2 + local x = halfWidth * (power / 100) + frame.eclipseBar.marker:SetPoint("CENTER", frame.eclipseBar, "CENTER", x, 0) + + -- Sun power + if( power > 0 ) then + frame.eclipseBar.sun.highlight:Show() + frame.eclipseBar.moon.highlight:Hide() + -- Moon power + elseif( power < 0 ) then + frame.eclipseBar.sun.highlight:Hide() + frame.eclipseBar.moon.highlight:Show() + -- No power + else + frame.eclipseBar.sun.highlight:Hide() + frame.eclipseBar.moon.highlight:Hide() + end end From fb7f3fd866ddac462ffc8986199466ea626b74a4 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 5 Jan 2015 16:43:15 -0800 Subject: [PATCH 610/794] Typo --- modules/aurapoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index 50acbde9..2334d56d 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -21,7 +21,7 @@ function AuraPoints:OnEnable(frame) frame:RegisterUpdateFunc(self, "Update") end -function Combo:GetComboPointType() +function AuraPoints:GetComboPointType() return "auraPoints" end From 76392443896131a911665635d994e8c740c42bb3 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Wed, 7 Jan 2015 07:03:13 -0800 Subject: [PATCH 611/794] Fixed an error on Chi points --- modules/basecombopoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/basecombopoints.lua b/modules/basecombopoints.lua index c41bd692..3f10224d 100644 --- a/modules/basecombopoints.lua +++ b/modules/basecombopoints.lua @@ -129,7 +129,7 @@ function Combo:UpdateBarBlocks(frame, event, unit, powerType) local max = UnitPowerMax("player", pointsFrame.cpConfig.powerType) if( max == 0 or pointsFrame.visibleBlocks == max ) then return end - pointsConfig.max = max + pointsFrame.pointsConfig.max = max if( not ShadowUF.db.profile.units[frame.unitType][key].isBar ) then createIcons(ShadowUF.db.profile.units[frame.unitType][key], pointsFrame) From c20b20db627d83468cb4cd0dec486c523fc67a02 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 8 Jan 2015 18:56:39 -0800 Subject: [PATCH 612/794] One last Combo Points bug fix --- modules/basecombopoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/basecombopoints.lua b/modules/basecombopoints.lua index 3f10224d..cacb868a 100644 --- a/modules/basecombopoints.lua +++ b/modules/basecombopoints.lua @@ -129,7 +129,7 @@ function Combo:UpdateBarBlocks(frame, event, unit, powerType) local max = UnitPowerMax("player", pointsFrame.cpConfig.powerType) if( max == 0 or pointsFrame.visibleBlocks == max ) then return end - pointsFrame.pointsConfig.max = max + pointsFrame.cpConfig.max = max if( not ShadowUF.db.profile.units[frame.unitType][key].isBar ) then createIcons(ShadowUF.db.profile.units[frame.unitType][key], pointsFrame) From 9c0887de05c342d538b4d03764c3b273ae31f3fa Mon Sep 17 00:00:00 2001 From: Shadowed Date: Mon, 12 Jan 2015 17:33:36 -0800 Subject: [PATCH 613/794] Make sure we kill combo points on target --- ShadowedUnitFrames.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index c3c295cc..87a24f74 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 53 +ShadowUF.dbRevision = 55 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -99,6 +99,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 55 ) then + ShadowUF.db.profile.units.target.comboPoints = nil + end + if( revision <= 53 ) then for i=1, #(self.db.profile.units.player.text) do if( self.db.profile.units.player.text[i].anchorTo == "$eclipseBar" ) then From 04bb616553dec43be334940dbb015df7582c2ea6 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 13 Jan 2015 17:35:39 -0800 Subject: [PATCH 614/794] Ensure indicators always have a priority --- modules/auraindicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auraindicators.lua b/modules/auraindicators.lua index 1d001d88..c1d1eaa4 100755 --- a/modules/auraindicators.lua +++ b/modules/auraindicators.lua @@ -268,7 +268,7 @@ function Indicators:UpdateAuras(frame) local aura = self.auraConfig[name] local indicator = frame.auraIndicators[aura.indicator] if( indicator and indicator.enabled and aura.priority > indicator.priority and not ShadowUF.db.profile.auraIndicators.disabled[playerClass][name] ) then - indicator.priority = aura.priority + indicator.priority = aura.priority or -1 indicator.showIcon = aura.icon indicator.showDuration = aura.duration indicator.spellDuration = 0 From ed1afb83d27f3679afa63a0f7c5b6501424f01e7 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 20 Jan 2015 19:08:27 -0800 Subject: [PATCH 615/794] Combo Points can be shown on the target unit again too --- ShadowedUnitFrames.lua | 6 +----- modules/combopoints.lua | 4 ++-- modules/defaultlayout.lua | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 87a24f74..43a0620f 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -99,10 +99,6 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision - if( revision <= 55 ) then - ShadowUF.db.profile.units.target.comboPoints = nil - end - if( revision <= 53 ) then for i=1, #(self.db.profile.units.player.text) do if( self.db.profile.units.player.text[i].anchorTo == "$eclipseBar" ) then @@ -125,7 +121,6 @@ function ShadowUF:CheckUpgrade() if( revision <= 47 ) then local config = self.db.profile.units config.player.comboPoints = config.target.comboPoints - config.target.comboPoints = nil end if( revision <= 46 ) then @@ -303,6 +298,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.target.enabled = true self.defaults.profile.units.target.indicators.lfdRole = {enabled = false, size = 0, x = 0, y = 0} self.defaults.profile.units.target.indicators.questBoss = {enabled = true, size = 0, x = 0, y = 0} + self.defaults.profile.units.target.comboPoints = {enabled = false, isBar = true} -- TARGETTARGET/TARGETTARGETTARGET self.defaults.profile.units.targettarget.enabled = true self.defaults.profile.units.targettargettarget.enabled = true diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 24782cfa..7dfe488a 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -7,7 +7,7 @@ local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBO function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) frame.comboPoints.cpConfig = cpConfig - frame:RegisterUnitEvent("UNIT_POWER", self, "Update") + frame:RegisterNormalEvent("UNIT_POWER", self, "Update") frame:RegisterUpdateFunc(self, "Update") end @@ -32,7 +32,7 @@ end function Combo:Update(frame, event, unit, powerType) if( event == "UNIT_COMBO_POINTS" ) then ShadowUF.ComboPoints.Update(self, frame) - else + elseif( unit == frame.unit or unit == frame.vehicleUnit or unit == "player" or unit == "vehicle" ) then ShadowUF.ComboPoints.Update(self, frame, event, unit, powerType) end end \ No newline at end of file diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 972fcab4..3eff04c5 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -797,6 +797,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) incAbsorb = {cap = 1}, healAbsorb = {cap = 1}, castBar = {order = 60}, + comboPoints = {enabled = false, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, indicators = { lfdRole = {enabled = false}, resurrect = {enabled = true, anchorPoint = "RC", size = 28, x = -39, y = -1, anchorTo = "$parent"}, From acba500cae7c932bfd1917d42cc4f041ab7fac7c Mon Sep 17 00:00:00 2001 From: Shadowed Date: Tue, 20 Jan 2015 19:48:04 -0800 Subject: [PATCH 616/794] Bypass combo point unit filter for non-events --- modules/combopoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 7dfe488a..ec5d8589 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -32,7 +32,7 @@ end function Combo:Update(frame, event, unit, powerType) if( event == "UNIT_COMBO_POINTS" ) then ShadowUF.ComboPoints.Update(self, frame) - elseif( unit == frame.unit or unit == frame.vehicleUnit or unit == "player" or unit == "vehicle" ) then + elseif( not event or ( unit == frame.unit or unit == frame.vehicleUnit or unit == "player" or unit == "vehicle" ) ) then ShadowUF.ComboPoints.Update(self, frame, event, unit, powerType) end end \ No newline at end of file From 374d6b952769fc589e52d1af7598648652e08777 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Thu, 22 Jan 2015 07:35:20 -0800 Subject: [PATCH 617/794] Make sure we register UNIT_COMBO_POINTS for target CPs now --- modules/combopoints.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index ec5d8589..d53d748e 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -8,6 +8,11 @@ function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) frame.comboPoints.cpConfig = cpConfig frame:RegisterNormalEvent("UNIT_POWER", self, "Update") + + if( frame.unitOwner == "target" ) then + frame:RegisterNormalEvent("UNIT_COMBO_POINTS", self, "Update") + end + frame:RegisterUpdateFunc(self, "Update") end From 31abf22ba64430b6d18e994071aa7412b31da04a Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 1 Mar 2015 12:49:05 +0100 Subject: [PATCH 618/794] Fix first group in split raid frames being hidden after reload in a raid --- modules/units.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 77780579..8c5554b6 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1173,9 +1173,6 @@ function Units:LoadGroupHeader(type) headerFrame:Hide() end end - - headerFrames.raidParent:Hide() - headerFrames.raidParent = nil end end From 5f3a70c5659f1d2ae1e40e8215ccc2b90274f682 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 4 Aug 2015 09:32:22 +0200 Subject: [PATCH 619/794] Update TOC for 6.2 --- ShadowedUnitFrames.toc | 2 +- options/ShadowedUF_Options.toc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 9d3ea6fe..5da21411 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,4 +1,4 @@ -## Interface: 60000 +## Interface: 60200 ## Title: Shadowed Unit Frames ## Notes: "Debug" code free since '93! ## Author: Shadowed diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index a8b64645..d1534654 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 60000 +## Interface: 60200 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From b2621649276f8b3b336d46bb3079b91c9ed1b630 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 7 Aug 2015 14:36:02 -0700 Subject: [PATCH 620/794] Updated auras with Hellfire Citadel (Thanks MysticalOS) --- ShadowedUnitFrames.lua | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 43a0620f..2ebb4842 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -455,6 +455,70 @@ function ShadowUF:LoadUnitDefaults() ["124081"] = [[{r=0.51372549019608, group="Monk", indicator="br", g=1, player=true, duration=true, b=0.90588235294118, alpha=1, priority=100, icon=false, iconTexture="Interface\\Icons\\ability_monk_forcesphere"}]], ["21562"] = [[{r=1, group="Priest", indicator="", g=1, alpha=1, missing=true, priority=0, b=1, iconTexture="Interface\\Icons\\Spell_Holy_WordFortitude"}]], ["115921"] = [[{r=0.30980392156863, group="Monk", indicator="", g=0.69411764705882, selfColor={alpha=1, b=0.36078431372549, g=0.71764705882353, r=0.29803921568627, }, missing=true, alpha=1, duration=true, priority=0, b=0.019607843137255, iconTexture="Interface\\Icons\\ability_monk_legacyoftheemperor"}]], + ["189895"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\INV_Enchant_VoidSphere\";}", + ["189627"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\achievement_zone_cataclysmgreen\";}", + ["181306"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Ability_Mage_LivingBomb\";}", + ["181753"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_felarakkoa_feldetonation_green\";}", + ["121176"] = "{b=0;group=\"PvP Flags\";indicator=\"bl\";alpha=1;g=1;r=0.062745098039216;priority=0;icon=false;iconTexture=\"Interface\\\\Icons\\\\INV_BannerPVP_03\";}", + ["188929"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Ability_Hunter_MarkedForDeath\";}", + ["189032"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_malkorok_blightofyshaarj_green\";}", + ["182826"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Fire_FelFlameRing\";}", + ["181515"] = "{b=0;g=0;priority=1;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_SeedOfDestruction\";}", + ["179219"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_felarakkoa_feldetonation_red\";}", + ["138732"] = "{icon=true;b=0;priority=10;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\Spell_Nature_CallStorm\";}", + ["121175"] = "{r=1;group=\"PvP Flags\";indicator=\"bl\";g=0.24705882352941;b=0.90196078431373;alpha=1;priority=0;icon=false;iconTexture=\"Interface\\\\Icons\\\\INV_BannerPVP_03\";}", + ["179864"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Arcane_PrismaticCloak\";}", + ["122370"] = "{icon=true;b=0;priority=10;r=0;group=\"Heart of Fear\";indicator=\"c\";g=0;iconTexture=\"INTERFACE\\\\ICONS\\\\trade_archaeology_insect in amber\";}", + ["184124"] = "{b=0;g=0;priority=1;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_AntiMagicShell\";}", + ["184450"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_bossfelorcs_necromancer_purple\";}", + ["Necrotic Plague"] = "{priority=10;g=0;indicator=\"c\";b=0;group=\"Icecrown Citadel\";duration=true;icon=true;r=0;}", + ["186134"] = "{icon=true;b=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"tr\";g=0;iconTexture=\"Interface\\\\Icons\\\\spell_fel_elementaldevastation\";}", + ["185066"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_bossfelorcs_necromancer_red\";}", + ["47788"] = "{r=0;group=\"Priest\";indicator=\"c\";g=0;b=0;duration=true;priority=0;icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Holy_GuardianSpirit\";}", + ["121881"] = "{icon=true;b=0;priority=10;r=0;group=\"Heart of Fear\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\inv_misc_uncutgemnormal\";}", + ["134339"] = "{icon=true;b=0;priority=10;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\ability_priest_angelicfeather\";}", + ["123081"] = "{icon=true;b=0;priority=10;r=0;group=\"Heart of Fear\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\spell_nature_sicklypolymorph\";}", + ["183817"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Ability_Warlock_EverlastingAffliction\";}", + ["154952"] = "{r=0;group=\"BRF\";indicator=\"c\";g=0;duration=true;b=0;priority=0;icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_fixated_state_red\";}", + ["130395"] = "{icon=true;b=0;priority=10;r=0;group=\"Mogu'Shan Vaults\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\inv_belt_44b\";}", + ["179978"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_bossgorefiend_touchofdoom\";}", + ["182280"] = "{icon=true;b=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\Ability_Hunter_MarkedForDeath\";}", + ["121164"] = "{b=1;group=\"PvP Flags\";indicator=\"bl\";alpha=1;g=0.003921568627451;r=0;priority=0;icon=false;iconTexture=\"Interface\\\\Icons\\\\INV_BannerPVP_03\";}", + ["189031"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_malkorok_blightofyshaarj_yellow\";}", + ["186500"] = "{b=0;g=0;priority=1;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"INTERFACE\\\\ICONS\\\\inv_misc_steelweaponchain\";}", + ["188666"] = "{b=0;g=0;priority=1;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"INTERFACE\\\\ICONS\\\\ability_warlock_soulsiphon\";}", + ["186333"] = "{b=0;g=0;priority=1;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_DevouringPlague\";}", + ["121177"] = "{r=0.78039215686275;group=\"PvP Flags\";indicator=\"bl\";g=0.42352941176471;alpha=1;b=0;priority=0;icon=false;iconTexture=\"Interface\\\\Icons\\\\INV_BannerPVP_03\";}", + ["186135"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"tr\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_AntiShadow\";}", + ["106199"] = "{indicator = '', group = \"Dragonsoul\", priority = 10, icon = true}", + ["181275"] = "{icon=true;b=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\spell_warlock_summonterrorguard\";}", + ["181957"] = "{b=0;g=0;priority=2;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Frost_ArcticWinds\";}", + ["189030"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_malkorok_blightofyshaarj_red\";}", + ["105479"] = "{indicator = '', group = \"Dragonsoul\", priority = 10, icon = true}", + ["182178"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_arakkoa_spinning_blade\";}", + ["189777"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"INTERFACE\\\\ICONS\\\\inv_misc_steelweaponchain\";}", + ["186407"] = "{r=0;indicator=\"c\";b=0;group=\"Hellfire Citadel\";priority=2;g=0;iconTexture=\"Interface\\\\Icons\\\\spell_fel_incinerate\";}", + ["180166"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"tr\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_ChillTouch\";}", + ["180079"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\inv_blacksmithdye_black\";}", + ["184449"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_bossfelorcs_necromancer_purple\";}", + ["180526"] = "{b=0;priority=0;r=0;group=\"Heart of Fear\";indicator=\"\";g=0;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_TwistedFaith\";}", + ["185510"] = "{r=0;icon=true;indicator=\"tr\";b=0;group=\"Hellfire Citadel\";priority=1;g=0;iconTexture=\"INTERFACE\\\\ICONS\\\\inv_misc_steelweaponchain\";}", + ["185065"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_bossfelorcs_necromancer_orange\";}", + ["182769"] = "{r=0;icon=true;indicator=\"tr\";b=0;group=\"Hellfire Citadel\";priority=0;g=0;iconTexture=\"Interface\\\\Icons\\\\ability_fixated_state_purple\";}", + ["181508"] = "{b=0;group=\"Hellfire Citadel\";indicator=\"c\";g=0;alpha=1;r=0;priority=1;icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_SeedOfDestruction\";}", + ["181099"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_AuraOfDarkness\";}", + ["181307"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_Requiem\";}", + ["183865"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_warlock_shadowfurytga\";}", + ["186961"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_warlock_moltencoregreen\";}", + ["136193"] = "{icon=true;b=0;priority=10;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\Spell_Lightning_LightningBolt01\";}", + ["182200"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_arakkoa_spinning_blade\";}", + ["109325"] = "{duration=false;group=\"Dragonsoul\";priority=10;icon=true;indicator=\"c\";}", + ["Dark Parasite"] = "{icon=true;alpha=1;b=0;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;priority=10;}", + ["181597"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_bossmannoroth_mannorothsgaze\";}", + ["133795"] = "{icon=true;b=0;priority=10;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_LifeDrain02\";}", + ["116829"] = "{icon=true;b=0;priority=10;r=0;group=\"Mogu'Shan Vaults\";indicator=\"c\";g=0;iconTexture=\"INTERFACE\\\\ICONS\\\\priest_icon_chakra_blue\";}", + ["137085"] = "{icon=true;b=0;priority=10;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\Ability_Mage_WintersGrasp\";}", + ["140546"] = "{icon=true;b=0;priority=10;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\achievement_boss_primordius\";}", } } From b210dc2bee0709a390bb788eb45015d852917b25 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 7 Aug 2015 16:37:49 -0700 Subject: [PATCH 621/794] Dropped cooldown wheel alpha hack as it was apparently fixed --- modules/units.lua | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 8c5554b6..15398e38 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -158,37 +158,17 @@ local function UnregisterAll(self, handler) end end --- TODO: Remove once Blizzard fixes cooldown wheels not taking parents alpha -local function SetAuraAlpha(self, alpha) - if( not self.auras ) then return end - - local childAlpha = 0.8 * alpha - if( self.auras.buffs ) then - for id, button in pairs(self.auras.buffs.buttons) do - button.cooldown:SetSwipeColor(0, 0, 0, childAlpha) - end - end - - if( self.auras.debuffs ) then - for id, button in pairs(self.auras.debuffs.buttons) do - button.cooldown:SetSwipeColor(0, 0, 0, childAlpha) - end - end -end - -- Handles setting alphas in a way so combat fader and range checker don't override each other local function DisableRangeAlpha(self, toggle) self.disableRangeAlpha = toggle if( not toggle and self.rangeAlpha ) then - self:SetAuraAlpha(self.rangeAlpha) self:SetAlpha(self.rangeAlpha) end end local function SetRangeAlpha(self, alpha) if( not self.disableRangeAlpha ) then - self:SetAuraAlpha(alpha) self:SetAlpha(alpha) else self.rangeAlpha = alpha @@ -715,7 +695,6 @@ function Units:CreateUnit(...) frame.fullUpdates = {} frame.registeredEvents = {} frame.visibility = {} - frame.SetAuraAlpha = SetAuraAlpha frame.BlizzRegisterUnitEvent = frame.RegisterUnitEvent frame.RegisterNormalEvent = RegisterNormalEvent frame.RegisterUnitEvent = RegisterUnitEvent From e2b42edddd3c13d91352f70c7e6b5b1290b58825 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Fri, 7 Aug 2015 16:40:09 -0700 Subject: [PATCH 622/794] Don't update runes if cooled is nil --- modules/runes.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/runes.lua b/modules/runes.lua index 383c6738..c4baf0fb 100755 --- a/modules/runes.lua +++ b/modules/runes.lua @@ -83,6 +83,9 @@ function Runes:UpdateUsable(frame, event, id, usable) local rune = frame.runeBar.runes[id] local startTime, cooldown, cooled = GetRuneCooldown(id) + -- Blizzard changed something with this API apparently and now it can be true/false/nil + if( cooled == nil ) then return end + if( not cooled ) then rune.endTime = startTime + cooldown rune:SetMinMaxValues(startTime, rune.endTime) From a33eeec9cfe79a27d4df6504f0170b50eed49afd Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 8 Aug 2015 10:33:23 -0700 Subject: [PATCH 623/794] Strip out MoP indicators to make nevcairiel happy --- ShadowedUnitFrames.lua | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 2ebb4842..95ae43ce 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -459,49 +459,33 @@ function ShadowUF:LoadUnitDefaults() ["189627"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\achievement_zone_cataclysmgreen\";}", ["181306"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Ability_Mage_LivingBomb\";}", ["181753"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_felarakkoa_feldetonation_green\";}", - ["121176"] = "{b=0;group=\"PvP Flags\";indicator=\"bl\";alpha=1;g=1;r=0.062745098039216;priority=0;icon=false;iconTexture=\"Interface\\\\Icons\\\\INV_BannerPVP_03\";}", ["188929"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Ability_Hunter_MarkedForDeath\";}", ["189032"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_malkorok_blightofyshaarj_green\";}", ["182826"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Fire_FelFlameRing\";}", ["181515"] = "{b=0;g=0;priority=1;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_SeedOfDestruction\";}", ["179219"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_felarakkoa_feldetonation_red\";}", - ["138732"] = "{icon=true;b=0;priority=10;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\Spell_Nature_CallStorm\";}", - ["121175"] = "{r=1;group=\"PvP Flags\";indicator=\"bl\";g=0.24705882352941;b=0.90196078431373;alpha=1;priority=0;icon=false;iconTexture=\"Interface\\\\Icons\\\\INV_BannerPVP_03\";}", ["179864"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Arcane_PrismaticCloak\";}", - ["122370"] = "{icon=true;b=0;priority=10;r=0;group=\"Heart of Fear\";indicator=\"c\";g=0;iconTexture=\"INTERFACE\\\\ICONS\\\\trade_archaeology_insect in amber\";}", ["184124"] = "{b=0;g=0;priority=1;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_AntiMagicShell\";}", ["184450"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_bossfelorcs_necromancer_purple\";}", - ["Necrotic Plague"] = "{priority=10;g=0;indicator=\"c\";b=0;group=\"Icecrown Citadel\";duration=true;icon=true;r=0;}", ["186134"] = "{icon=true;b=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"tr\";g=0;iconTexture=\"Interface\\\\Icons\\\\spell_fel_elementaldevastation\";}", ["185066"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_bossfelorcs_necromancer_red\";}", - ["47788"] = "{r=0;group=\"Priest\";indicator=\"c\";g=0;b=0;duration=true;priority=0;icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Holy_GuardianSpirit\";}", - ["121881"] = "{icon=true;b=0;priority=10;r=0;group=\"Heart of Fear\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\inv_misc_uncutgemnormal\";}", - ["134339"] = "{icon=true;b=0;priority=10;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\ability_priest_angelicfeather\";}", - ["123081"] = "{icon=true;b=0;priority=10;r=0;group=\"Heart of Fear\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\spell_nature_sicklypolymorph\";}", ["183817"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Ability_Warlock_EverlastingAffliction\";}", - ["154952"] = "{r=0;group=\"BRF\";indicator=\"c\";g=0;duration=true;b=0;priority=0;icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_fixated_state_red\";}", - ["130395"] = "{icon=true;b=0;priority=10;r=0;group=\"Mogu'Shan Vaults\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\inv_belt_44b\";}", ["179978"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_bossgorefiend_touchofdoom\";}", ["182280"] = "{icon=true;b=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\Ability_Hunter_MarkedForDeath\";}", - ["121164"] = "{b=1;group=\"PvP Flags\";indicator=\"bl\";alpha=1;g=0.003921568627451;r=0;priority=0;icon=false;iconTexture=\"Interface\\\\Icons\\\\INV_BannerPVP_03\";}", ["189031"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_malkorok_blightofyshaarj_yellow\";}", ["186500"] = "{b=0;g=0;priority=1;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"INTERFACE\\\\ICONS\\\\inv_misc_steelweaponchain\";}", ["188666"] = "{b=0;g=0;priority=1;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"INTERFACE\\\\ICONS\\\\ability_warlock_soulsiphon\";}", ["186333"] = "{b=0;g=0;priority=1;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_DevouringPlague\";}", - ["121177"] = "{r=0.78039215686275;group=\"PvP Flags\";indicator=\"bl\";g=0.42352941176471;alpha=1;b=0;priority=0;icon=false;iconTexture=\"Interface\\\\Icons\\\\INV_BannerPVP_03\";}", ["186135"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"tr\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_AntiShadow\";}", - ["106199"] = "{indicator = '', group = \"Dragonsoul\", priority = 10, icon = true}", ["181275"] = "{icon=true;b=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\spell_warlock_summonterrorguard\";}", ["181957"] = "{b=0;g=0;priority=2;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Frost_ArcticWinds\";}", ["189030"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_malkorok_blightofyshaarj_red\";}", - ["105479"] = "{indicator = '', group = \"Dragonsoul\", priority = 10, icon = true}", ["182178"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_arakkoa_spinning_blade\";}", ["189777"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"INTERFACE\\\\ICONS\\\\inv_misc_steelweaponchain\";}", ["186407"] = "{r=0;indicator=\"c\";b=0;group=\"Hellfire Citadel\";priority=2;g=0;iconTexture=\"Interface\\\\Icons\\\\spell_fel_incinerate\";}", ["180166"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"tr\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_ChillTouch\";}", ["180079"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\inv_blacksmithdye_black\";}", ["184449"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_bossfelorcs_necromancer_purple\";}", - ["180526"] = "{b=0;priority=0;r=0;group=\"Heart of Fear\";indicator=\"\";g=0;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_TwistedFaith\";}", ["185510"] = "{r=0;icon=true;indicator=\"tr\";b=0;group=\"Hellfire Citadel\";priority=1;g=0;iconTexture=\"INTERFACE\\\\ICONS\\\\inv_misc_steelweaponchain\";}", ["185065"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_bossfelorcs_necromancer_orange\";}", ["182769"] = "{r=0;icon=true;indicator=\"tr\";b=0;group=\"Hellfire Citadel\";priority=0;g=0;iconTexture=\"Interface\\\\Icons\\\\ability_fixated_state_purple\";}", @@ -510,15 +494,8 @@ function ShadowUF:LoadUnitDefaults() ["181307"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_Requiem\";}", ["183865"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_warlock_shadowfurytga\";}", ["186961"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_warlock_moltencoregreen\";}", - ["136193"] = "{icon=true;b=0;priority=10;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\Spell_Lightning_LightningBolt01\";}", ["182200"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_arakkoa_spinning_blade\";}", - ["109325"] = "{duration=false;group=\"Dragonsoul\";priority=10;icon=true;indicator=\"c\";}", - ["Dark Parasite"] = "{icon=true;alpha=1;b=0;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;priority=10;}", ["181597"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\ability_bossmannoroth_mannorothsgaze\";}", - ["133795"] = "{icon=true;b=0;priority=10;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\Spell_Shadow_LifeDrain02\";}", - ["116829"] = "{icon=true;b=0;priority=10;r=0;group=\"Mogu'Shan Vaults\";indicator=\"c\";g=0;iconTexture=\"INTERFACE\\\\ICONS\\\\priest_icon_chakra_blue\";}", - ["137085"] = "{icon=true;b=0;priority=10;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\Ability_Mage_WintersGrasp\";}", - ["140546"] = "{icon=true;b=0;priority=10;r=0;group=\"Throne of Thunder\";indicator=\"c\";g=0;iconTexture=\"Interface\\\\Icons\\\\achievement_boss_primordius\";}", } } From 894f2fdec05fa4d3120c85e556057ea14a62ec5f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 14 Aug 2015 11:38:51 +0200 Subject: [PATCH 624/794] Don't unregister UNIT_NAME_UPDATE on group headers anymore. This fixed an issue in WoW 3.x which does not exist anymore, and has in fact caused issues with raid members not being displayed reliably after joining a group since MoP. --- modules/units.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 15398e38..c3ef0391 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1096,7 +1096,6 @@ function Units:LoadGroupHeader(type) headerFrame.isHeaderFrame = true headerFrame.unitType = type headerFrame.unitMappedType = type - headerFrame:UnregisterEvent("UNIT_NAME_UPDATE") -- For securely managely the display local config = ShadowUF.db.profile.units[type] From ff0a599c775005e8a721422d10c550efe8e0948e Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 14 Aug 2015 12:00:50 +0200 Subject: [PATCH 625/794] Remove unregister of UNIT_NAME_UPDATE in split group headers as well --- modules/units.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index c3ef0391..1b934d25 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1016,7 +1016,6 @@ function Units:LoadSplitGroupHeader(type) frame:SetAttribute("initial-unitWatch", true) frame:SetAttribute("showRaid", true) frame:SetAttribute("groupFilter", id) - frame:UnregisterEvent("UNIT_NAME_UPDATE") frame:SetAttribute("initialConfigFunction", secureInitializeUnit) frame.initialConfigFunction = initializeUnit frame.isHeaderFrame = true From 670551c3e360fb8d7bc0ec4516414f7a0e15ea6f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 19 Sep 2015 15:57:14 +0200 Subject: [PATCH 626/794] Remove innervate aura, the spell no longer exists --- ShadowedUnitFrames.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 95ae43ce..e21bac84 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -435,7 +435,6 @@ function ShadowUF:LoadUnitDefaults() ["109773"] = [[{r=0.52941176470588, group="Warlock", indicator="", g=0.12941176470588, alpha=1, b=0.71372549019608, priority=0, missing=true, iconTexture="INTERFACE\\ICONS\\spell_warlock_focusshadow"}]], ["17"] = [[{r=1, group="Priest", indicator="tl", g=0.41960784313725, player=true, alpha=1, duration=true, b=0.5843137254902, priority=0, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_PowerWordShield"}]], ["152118"] = [[{r=1, group="Priest", indicator="tl", g=0.41960784313725, player=true, alpha=1, duration=true, b=0.5843137254902, priority=0, icon=false, iconTexture="Interface\\Icons\\Ability_Priest_ClarityOfWill"}]], - ["29166"] = [[{r=0, group="Druid", indicator="c", g=0, b=0, duration=true, priority=0, icon=true, iconTexture="Interface\\Icons\\Spell_Nature_Lightning"}]], ["23335"] = [[{r=0, group="PvP Flags", indicator="bl", g=0, duration=false, b=0, priority=0, icon=true, iconTexture="Interface\\Icons\\INV_BannerPVP_02"}]], ["102342"] = [[{r=0, group="Druid", indicator="c", g=0, duration=true, b=0, priority=0, icon=true, iconTexture="Interface\\Icons\\spell_druid_ironbark"}]], ["121177"] = [[{r=0.78039215686275, group="PvP Flags", indicator="bl", g=0.42352941176471, alpha=1, b=0, priority=0, icon=false, iconTexture="Interface\\Icons\\INV_BannerPVP_03"}]], From 3a9cf67f07a55e146337f1c274b565876bb58e35 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 13 May 2016 08:52:54 +0200 Subject: [PATCH 627/794] Convert LibDualSpec to an optional dependency --- ShadowedUnitFrames.lua | 4 ++-- options/config.lua | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index e21bac84..59195130 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -51,8 +51,8 @@ function ShadowUF:OnInitialize() self.db.RegisterCallback(self, "OnProfileCopied", "ProfilesChanged") self.db.RegisterCallback(self, "OnProfileReset", "ProfileReset") - local LibDualSpec = LibStub("LibDualSpec-1.0") - LibDualSpec:EnhanceDatabase(self.db, "ShadowedUnitFrames") + local LibDualSpec = LibStub("LibDualSpec-1.0", true) + if LibDualSpec then LibDualSpec:EnhanceDatabase(self.db, "ShadowedUnitFrames") end -- Setup tag cache self.tagFunc = setmetatable({}, { diff --git a/options/config.lua b/options/config.lua index 3eed5e40..8626fc6b 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4639,7 +4639,8 @@ local function loadUnitOptions() end options.args.profile = LibStub("AceDBOptions-3.0"):GetOptionsTable(ShadowUF.db, true) - LibStub("LibDualSpec-1.0"):EnhanceOptions(options.args.profile, ShadowUF.db) + local LibDualSpec = LibStub("LibDualSpec-1.0", true) + if LibDualSpec then LibDualSpec:EnhanceOptions(options.args.profile, ShadowUF.db) end options.args.enableUnits = { type = "group", From c40306f2053d3b800b89bf9b92e43d4c842e8a7f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 13 May 2016 08:53:23 +0200 Subject: [PATCH 628/794] Update handling of tapped units for 7.0 --- modules/empty.lua | 2 +- modules/health.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/empty.lua b/modules/empty.lua index d0438a58..2f0cee14 100755 --- a/modules/empty.lua +++ b/modules/empty.lua @@ -32,7 +32,7 @@ function Empty:UpdateColor(frame) local color local reactionType = ShadowUF.db.profile.units[frame.unitType].emptyBar.reactionType - if( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(frame.unit) and not UnitIsTappedByAllThreatList(frame.unit) and not UnitIsTappedByPlayer(frame.unit) and UnitIsTapped(frame.unit) and UnitCanAttack("player", frame.unit) ) then + if( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(frame.unit) and UnitIsTapDenied(frame.unit) and UnitCanAttack("player", frame.unit) ) then color = ShadowUF.db.profile.healthColors.tapped elseif( not UnitPlayerOrPetInRaid(frame.unit) and not UnitPlayerOrPetInParty(frame.unit) and ( ( ( reactionType == "player" or reactionType == "both" ) and UnitIsPlayer(frame.unit) and not UnitIsFriend(frame.unit, "player") ) or ( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(frame.unit) ) ) ) then if( not UnitIsFriend(frame.unit, "player") and UnitPlayerControlled(frame.unit) ) then diff --git a/modules/health.lua b/modules/health.lua index 46676e83..a6889f94 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -67,7 +67,7 @@ function Health:UpdateColor(frame) return elseif( frame.inVehicle ) then color = ShadowUF.db.profile.classColors.VEHICLE - elseif( not UnitIsTappedByAllThreatList(unit) and not UnitIsTappedByPlayer(unit) and UnitIsTapped(unit) and UnitCanAttack("player", unit) ) then + elseif( UnitIsTapDenied(unit) and UnitCanAttack("player", unit) ) then color = ShadowUF.db.profile.healthColors.tapped elseif( not UnitPlayerOrPetInRaid(unit) and not UnitPlayerOrPetInParty(unit) and ( ( ( reactionType == "player" or reactionType == "both" ) and UnitIsPlayer(unit) and not UnitIsFriend(unit, "player") ) or ( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(unit) ) ) ) then if( not UnitIsFriend(unit, "player") and UnitPlayerControlled(unit) ) then From 55ce27e21859e51c368fe64eb194c91544614a79 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 13 May 2016 08:54:04 +0200 Subject: [PATCH 629/794] Remove linked spells that no longer exist --- ShadowedUnitFrames.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 59195130..ea125462 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -391,11 +391,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.auraIndicators = { disabled = {}, missing = {}, - linked = { - [GetSpellInfo(61316)] = GetSpellInfo(1459), -- Dalarn Brilliance -> AB - [GetSpellInfo(109773)] = GetSpellInfo(1459), -- Dark Intent -> AB - [GetSpellInfo(126309)] = GetSpellInfo(1459) -- Waterstrider -> AB - }, + linked = {}, indicators = { ["tl"] = {name = L["Top Left"], anchorPoint = "TLI", anchorTo = "$parent", height = 8, width = 8, alpha = 1.0, x = 4, y = -4, friendly = true, hostile = true}, ["tr"] = {name = L["Top Right"], anchorPoint = "TRI", anchorTo = "$parent", height = 8, width = 8, alpha = 1.0, x = -3, y = -3, friendly = true, hostile = true}, From fad7eb922596ccbd8e07251b39547f428d7537ee Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 13 May 2016 08:54:36 +0200 Subject: [PATCH 630/794] Update TOC for 7.0 --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 5da21411..c8fe9ee2 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,4 +1,4 @@ -## Interface: 60200 +## Interface: 70000 ## Title: Shadowed Unit Frames ## Notes: "Debug" code free since '93! ## Author: Shadowed From 6bc5982a5067d500c9993d0acff39f8676c2dfa3 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 13 May 2016 08:55:49 +0200 Subject: [PATCH 631/794] Remove class power frames from blizzard hider which no longer exist --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index ea125462..cf9df929 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -683,7 +683,7 @@ function ShadowUF:HideBlizzardFrames() end if( self.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then - basicHideBlizzardFrames(PriestBarFrame, PaladinPowerBar, EclipseBarFrame, ShardBarFrame, RuneFrame, MonkHarmonyBar, WarlockPowerFrame) + basicHideBlizzardFrames(PriestBarFrame, EclipseBarFrame, RuneFrame, WarlockPowerFrame) end if( self.db.profile.hidden.pet and not active_hiddens.pet ) then From a1ac8e446283a66f1054f63631eccbf6c8c3fee4 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 14 May 2016 09:22:24 +0200 Subject: [PATCH 632/794] Check for player controlled units in tap handling --- modules/empty.lua | 2 +- modules/health.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/empty.lua b/modules/empty.lua index 2f0cee14..4fc1739e 100755 --- a/modules/empty.lua +++ b/modules/empty.lua @@ -32,7 +32,7 @@ function Empty:UpdateColor(frame) local color local reactionType = ShadowUF.db.profile.units[frame.unitType].emptyBar.reactionType - if( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(frame.unit) and UnitIsTapDenied(frame.unit) and UnitCanAttack("player", frame.unit) ) then + if( ( reactionType == "npc" or reactionType == "both" ) and not UnitPlayerControlled(frame.unit) and UnitIsTapDenied(frame.unit) and UnitCanAttack("player", frame.unit) ) then color = ShadowUF.db.profile.healthColors.tapped elseif( not UnitPlayerOrPetInRaid(frame.unit) and not UnitPlayerOrPetInParty(frame.unit) and ( ( ( reactionType == "player" or reactionType == "both" ) and UnitIsPlayer(frame.unit) and not UnitIsFriend(frame.unit, "player") ) or ( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(frame.unit) ) ) ) then if( not UnitIsFriend(frame.unit, "player") and UnitPlayerControlled(frame.unit) ) then diff --git a/modules/health.lua b/modules/health.lua index a6889f94..7e36469c 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -67,7 +67,7 @@ function Health:UpdateColor(frame) return elseif( frame.inVehicle ) then color = ShadowUF.db.profile.classColors.VEHICLE - elseif( UnitIsTapDenied(unit) and UnitCanAttack("player", unit) ) then + elseif( not UnitPlayerControlled(unit) and UnitIsTapDenied(unit) and UnitCanAttack("player", unit) ) then color = ShadowUF.db.profile.healthColors.tapped elseif( not UnitPlayerOrPetInRaid(unit) and not UnitPlayerOrPetInParty(unit) and ( ( ( reactionType == "player" or reactionType == "both" ) and UnitIsPlayer(unit) and not UnitIsFriend(unit, "player") ) or ( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(unit) ) ) ) then if( not UnitIsFriend(unit, "player") and UnitPlayerControlled(unit) ) then From b3cc2215eb8a3d9baa6874c7b7d7e9855172cca2 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 18 May 2016 00:56:10 +0200 Subject: [PATCH 633/794] Add Demon Hunter class color entry --- ShadowedUnitFrames.lua | 6 +++++- modules/defaultlayout.lua | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index cf9df929..cf06412d 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 55 +ShadowUF.dbRevision = 56 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -99,6 +99,10 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 55 ) then + self.db.profile.classColors.DEMONHUNTER = {r = 0.64, g = 0.19, b = 0.79} + end + if( revision <= 53 ) then for i=1, #(self.db.profile.units.player.text) do if( self.db.profile.units.player.text[i].anchorTo == "$eclipseBar" ) then diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 3eff04c5..9378635a 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -136,6 +136,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) WARRIOR = {r = 0.78, g = 0.61, b = 0.43}, DEATHKNIGHT = {r = 0.77, g = 0.12 , b = 0.23}, MONK = {r = 0.0, g = 1.00 , b = 0.59}, + DEMONHUNTER = {r = 0.64, g = 0.19, b = 0.79}, PET = {r = 0.20, g = 0.90, b = 0.20}, VEHICLE = {r = 0.23, g = 0.41, b = 0.23}, } From 04dd8a536b38d03be3d2cbf567cb811b2c61d636 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 18 May 2016 00:57:03 +0200 Subject: [PATCH 634/794] Add Demon Hunter to class groupings --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index 1b934d25..5c5f41ff 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -889,7 +889,7 @@ function Units:SetHeaderAttributes(frame, type) frame:SetAttribute("roleFilter", config.roleFilter) if( config.groupBy == "CLASS" ) then - frame:SetAttribute("groupingOrder", "DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,ROGUE,SHAMAN,WARLOCK,WARRIOR,MONK") + frame:SetAttribute("groupingOrder", "DEATHKNIGHT,DEMONHUNTER,DRUID,HUNTER,MAGE,PALADIN,PRIEST,ROGUE,SHAMAN,WARLOCK,WARRIOR,MONK") frame:SetAttribute("groupBy", "CLASS") elseif( config.groupBy == "ASSIGNEDROLE" ) then frame:SetAttribute("groupingOrder", "TANK,HEALER,DAMAGER,NONE") From fe163e8f58584acc3b5f08f2b8c1c45fff68cca8 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 12:20:44 +0200 Subject: [PATCH 635/794] Remove the Burning Embers module and enable Soul Shards for all warlock specs --- ShadowedUnitFrames.toc | 1 - modules/burningembers.lua | 119 -------------------------------------- modules/soulshards.lua | 4 +- 3 files changed, 2 insertions(+), 122 deletions(-) delete mode 100755 modules/burningembers.lua diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index c8fe9ee2..1424140a 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -57,7 +57,6 @@ modules\soulshards.lua modules\holypower.lua modules\chi.lua modules\demonicfury.lua -modules\burningembers.lua modules\altpower.lua modules\shadoworbs.lua modules\monk.lua diff --git a/modules/burningembers.lua b/modules/burningembers.lua deleted file mode 100755 index 5188a8d5..00000000 --- a/modules/burningembers.lua +++ /dev/null @@ -1,119 +0,0 @@ -local Embers = {} -ShadowUF:RegisterModule(Embers, "burningEmbersBar", ShadowUF.L["Burning Embers bar"], true, "WARLOCK", SPEC_WARLOCK_DESTRUCTION) - --- This is a local in ShardBar.lua so we can't access it right now -local MAX_POWER_PER_EMBER = MAX_POWER_PER_EMBER or 10 - -function Embers:OnEnable(frame) - if( not frame.burningEmbersBar ) then - frame.burningEmbersBar = CreateFrame("StatusBar", nil, frame) - frame.burningEmbersBar:SetMinMaxValues(0, 1) - frame.burningEmbersBar:SetValue(0) - frame.burningEmbersBar.embers = {} - - for id=1, 4 do - local ember = ShadowUF.Units:CreateBar(frame.burningEmbersBar) - - if( id > 1 ) then - ember:SetPoint("TOPLEFT", frame.burningEmbersBar.embers[id - 1], "TOPRIGHT", 1, 0) - else - ember:SetPoint("TOPLEFT", frame.burningEmbersBar, "TOPLEFT", 0, 0) - end - - frame.burningEmbersBar.embers[id] = ember - end - end - - frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") - frame:RegisterUpdateFunc(self, "Update") - frame:RegisterUpdateFunc(self, "UpdateBarBlocks") -end - -function Embers:OnDisable(frame) - frame:UnregisterAll(self) - - for id, ember in pairs(frame.burningEmbersBar.embers) do - ember.background:Hide() - end -end - -function Embers:OnLayoutApplied(frame) - if( not frame.visibility.burningEmbersBar ) then return end - - for id, ember in pairs(frame.burningEmbersBar.embers) do - if( ShadowUF.db.profile.units[frame.unitType].burningEmbersBar.background ) then - ember.background:Show() - else - ember.background:Hide() - end - - ember.background:SetTexture(ShadowUF.Layout.mediaPath.statusbar) - ember.background:SetHorizTile(false) - ember:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) - ember:GetStatusBarTexture():SetHorizTile(false) - ember:SetHeight(frame.burningEmbersBar:GetHeight()) - ember:SetMinMaxValues(0, MAX_POWER_PER_EMBER) - ember:SetOrientation(ShadowUF.db.profile.units[frame.unitType].burningEmbersBar.vertical and "VERTICAL" or "HORIZONTAL") - ember:SetReverseFill(ShadowUF.db.profile.units[frame.unitType].burningEmbersBar.reverse and true or false) - ember.setColor = nil - end - - self:UpdateBarBlocks(frame) -end - -function Embers:UpdateBarBlocks(frame, event, unit, powerType) - if( not frame.visibility.burningEmbersBar ) then return end - if( event and powerType ~= "BURNING_EMBERS" ) then return end - - local max = UnitPowerMax("player", SPELL_POWER_BURNING_EMBERS, true) - max = floor(max / MAX_POWER_PER_EMBER) - - if( max == 0 or frame.burningEmbersBar.visibleBlocks == max ) then return end - - local blockWidth = (frame.burningEmbersBar:GetWidth() - (max - 1)) / max - for id=1, max do - local ember = frame.burningEmbersBar.embers[id] - ember:SetWidth(blockWidth) - - if( ShadowUF.db.profile.units[frame.unitType].burningEmbersBar.background ) then - ember.background:Show() - end - - ember:Show() - end - - for id=max+1, #(frame.burningEmbersBar.embers) do - frame.burningEmbersBar.embers[id]:Hide() - end - - frame.burningEmbersBar.visibleBlocks = max -end - -function Embers:Update(frame, event, unit, powerType) - if( event and powerType ~= "BURNING_EMBERS" ) then return end - - local power = UnitPower("player", SPELL_POWER_BURNING_EMBERS, true) - for id=1, frame.burningEmbersBar.visibleBlocks do - local ember = frame.burningEmbersBar.embers[id] - - local color - if( power >= MAX_POWER_PER_EMBER ) then - color = "FULLBURNINGEMBER" - ember:SetValue(MAX_POWER_PER_EMBER) - elseif( power > 0 ) then - color = "BURNINGEMBERS" - ember:SetValue(power) - else - color = "BURNINGEMBERS" - ember:SetValue(0) - end - - if( ember.setColor ~= color ) then - ember.setColor = color - frame:SetBlockColor(ember, "burningEmbersBar", ShadowUF.db.profile.powerColors[color].r, ShadowUF.db.profile.powerColors[color].g, ShadowUF.db.profile.powerColors[color].b) - end - - power = power - MAX_POWER_PER_EMBER - end -end diff --git a/modules/soulshards.lua b/modules/soulshards.lua index 49feea42..4f5388d4 100755 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -1,8 +1,8 @@ if( not ShadowUF.ComboPoints ) then return end local Souls = setmetatable({}, {__index = ShadowUF.ComboPoints}) -ShadowUF:RegisterModule(Souls, "soulShards", ShadowUF.L["Soul Shards"], nil, "WARLOCK", SPEC_WARLOCK_AFFLICTION) -local soulsConfig = {max = 4, key = "soulShards", colorKey = "SOULSHARDS", powerType = SPELL_POWER_SOUL_SHARDS, eventType = "SOUL_SHARDS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\shard"} +ShadowUF:RegisterModule(Souls, "soulShards", ShadowUF.L["Soul Shards"], nil, "WARLOCK") +local soulsConfig = {max = 5, key = "soulShards", colorKey = "SOULSHARDS", powerType = SPELL_POWER_SOUL_SHARDS, eventType = "SOUL_SHARDS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\shard"} function Souls:OnEnable(frame) frame.soulShards = frame.soulShards or CreateFrame("Frame", nil, frame) From 71930801be16fca010eb80099b7868cb823b504d Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 12:21:13 +0200 Subject: [PATCH 636/794] Remove handling of UNIT_COMBO_POINTS, its all done through UNIT_POWER now --- modules/combopoints.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index d53d748e..5501c5ac 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -8,10 +8,6 @@ function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) frame.comboPoints.cpConfig = cpConfig frame:RegisterNormalEvent("UNIT_POWER", self, "Update") - - if( frame.unitOwner == "target" ) then - frame:RegisterNormalEvent("UNIT_COMBO_POINTS", self, "Update") - end frame:RegisterUpdateFunc(self, "Update") end From b59fe1e95f9071f2ecd1ab4ea7c80eb3e1a28326 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 12:28:55 +0200 Subject: [PATCH 637/794] Remove remnants of other warlock spec specific bars --- ShadowedUnitFrames.toc | 1 - modules/demonicfury.lua | 34 ---------------------------------- options/config.lua | 37 ------------------------------------- 3 files changed, 72 deletions(-) delete mode 100755 modules/demonicfury.lua diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 1424140a..a1a644d7 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -56,7 +56,6 @@ modules\eclipse.lua modules\soulshards.lua modules\holypower.lua modules\chi.lua -modules\demonicfury.lua modules\altpower.lua modules\shadoworbs.lua modules\monk.lua diff --git a/modules/demonicfury.lua b/modules/demonicfury.lua deleted file mode 100755 index 197dd153..00000000 --- a/modules/demonicfury.lua +++ /dev/null @@ -1,34 +0,0 @@ -local DemonicFury = {} -ShadowUF:RegisterModule(DemonicFury, "demonicFuryBar", ShadowUF.L["Demonic Fury"], true, "WARLOCK", SPEC_WARLOCK_DEMONOLOGY) - -function DemonicFury:OnEnable(frame) - frame.demonicFuryBar = frame.demonicFuryBar or ShadowUF.Units:CreateBar(frame) - - frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateMax") - - frame:RegisterUpdateFunc(self, "Update") - frame:RegisterUpdateFunc(self, "UpdateMax") -end - -function DemonicFury:OnLayoutApplied(frame) - if( frame.visibility.demonicFuryBar ) then - local color = ShadowUF.db.profile.powerColors.DEMONICFURY - frame:SetBarColor("demonicFuryBar", color.r, color.g, color.b) - end -end - -function DemonicFury:OnDisable(frame) - frame:UnregisterAll(self) -end - -function DemonicFury:UpdateMax(frame, event, unit, powerType) - if( event and powerType ~= "DEMONIC_FURY" ) then return end - frame.demonicFuryBar:SetMinMaxValues(0, UnitPowerMax("player", SPELL_POWER_DEMONIC_FURY) or 0) -end - -function DemonicFury:Update(frame, event, unit, powerType) - if( event and powerType ~= "DEMONIC_FURY" ) then return end - - frame.demonicFuryBar:SetValue(UnitPower("player", SPELL_POWER_DEMONIC_FURY) or 0) -end \ No newline at end of file diff --git a/options/config.lua b/options/config.lua index 8626fc6b..81f88af9 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1202,27 +1202,6 @@ local function loadGeneralOptions() arg = "powerColors.SOULSHARDS", hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, }, - DEMONICFURY = { - order = 15, - type = "color", - name = L["Demonic Fury"], - arg = "powerColors.DEMONICFURY", - hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, - }, - BURNINGEMBERS = { - order = 16, - type = "color", - name = L["Burning Embers"], - arg = "powerColors.BURNINGEMBERS", - hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, - }, - FULLBURNINGEMBER = { - order = 16, - type = "color", - name = L["Full Burning Ember"], - arg = "powerColors.FULLBURNINGEMBER", - hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, - }, CHI = { order = 17, type = "color", @@ -4063,14 +4042,6 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "eclipseBar.enabled", }, - demonicFuryBar = { - order = 1.25, - type = "toggle", - name = string.format(L["Enable %s"], L["Demonic Fury bar"]), - desc = L["Adds a Demonic Fury bar for Demonology Warlocks."], - hidden = hideRestrictedOption, - arg = "demonicFuryBar.enabled", - }, staggerBar = { order = 1.25, type = "toggle", @@ -4079,14 +4050,6 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "staggerBar.enabled", }, - burningEmbersBar = { - order = 1.25, - type = "toggle", - name = string.format(L["Enable %s"], L["Burning Embers bar"]), - desc = L["Adds a Burning Embers bar for Destruction Warlocks."], - hidden = hideRestrictedOption, - arg = "burningEmbersBar.enabled", - }, druidBar = { order = 3, type = "toggle", From 49083531c4e9e43fbea612f9c1d2a633d4754f4d Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 12:29:51 +0200 Subject: [PATCH 638/794] Remove mistweaver monk special mana bar --- ShadowedUnitFrames.toc | 1 - modules/monk.lua | 28 ---------------------------- options/config.lua | 8 -------- 3 files changed, 37 deletions(-) delete mode 100755 modules/monk.lua diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index a1a644d7..3a2fdbc9 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -58,7 +58,6 @@ modules\holypower.lua modules\chi.lua modules\altpower.lua modules\shadoworbs.lua -modules\monk.lua modules\monkstagger.lua modules\aurapoints.lua #@do-not-package@ diff --git a/modules/monk.lua b/modules/monk.lua deleted file mode 100755 index 2cb874bd..00000000 --- a/modules/monk.lua +++ /dev/null @@ -1,28 +0,0 @@ -local Monk = {} -ShadowUF:RegisterModule(Monk, "monkBar", ShadowUF.L["Monk mana bar"], true, "MONK", SPEC_MONK_MISTWEAVER) - -function Monk:OnEnable(frame) - frame.monkBar = frame.monkBar or ShadowUF.Units:CreateBar(frame) - - frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") - - frame:RegisterUpdateFunc(self, "Update") -end - -function Monk:OnDisable(frame) - frame:UnregisterAll(self) -end - -function Monk:OnLayoutApplied(frame) - if( frame.visibility.monkBar ) then - local color = ShadowUF.db.profile.powerColors.MANA - frame:SetBarColor("monkBar", color.r, color.g, color.b) - end -end - -function Monk:Update(frame, event, unit, powerType) - if( powerType ~= "MANA" ) then return end - frame.monkBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, SPELL_POWER_MANA)) - frame.monkBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, SPELL_POWER_MANA)) -end diff --git a/options/config.lua b/options/config.lua index 81f88af9..1173a8ce 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4058,14 +4058,6 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "druidBar.enabled", }, - monkBar = { - order = 3, - type = "toggle", - name = string.format(L["Enable %s"], L["Monk mana bar"]), - desc = L["Shows the mana power bar for Mistweaver Monks."], - hidden = hideRestrictedOption, - arg = "monkBar.enabled", - }, xpBar = { order = 4, type = "toggle", From fc00233b0eb9fd17f43e1ebae95dab04c0e909b9 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 12:30:36 +0200 Subject: [PATCH 639/794] Update Monk Chi bar, 5 Chi and only for Windwalker --- modules/chi.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/chi.lua b/modules/chi.lua index 63658715..7757db83 100755 --- a/modules/chi.lua +++ b/modules/chi.lua @@ -1,8 +1,8 @@ if( not ShadowUF.ComboPoints ) then return end local Chi = setmetatable({}, {__index = ShadowUF.ComboPoints}) -ShadowUF:RegisterModule(Chi, "chi", ShadowUF.L["Chi"], nil, "MONK") -local chiConfig = {max = 6, key = "chi", colorKey = "CHI", powerType = SPELL_POWER_CHI, eventType = "CHI", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +ShadowUF:RegisterModule(Chi, "chi", ShadowUF.L["Chi"], nil, "MONK", SPEC_MONK_WINDWALKER) +local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = SPELL_POWER_CHI, eventType = "CHI", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function Chi:OnEnable(frame) frame.chi = frame.chi or CreateFrame("Frame", nil, frame) From e01136537ebdb973913b97c4ac3a7e4afe03ac4a Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 12:54:12 +0200 Subject: [PATCH 640/794] Remove more remnants of removed bars --- ShadowedUnitFrames.lua | 3 --- modules/defaultlayout.lua | 6 ------ modules/movers.lua | 4 ---- options/config.lua | 2 +- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index cf06412d..56d12569 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -266,14 +266,11 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.runeBar = {enabled = false} self.defaults.profile.units.player.totemBar = {enabled = false} self.defaults.profile.units.player.druidBar = {enabled = false} - self.defaults.profile.units.player.monkBar = {enabled = false} self.defaults.profile.units.player.xpBar = {enabled = false} self.defaults.profile.units.player.fader = {enabled = false} self.defaults.profile.units.player.soulShards = {enabled = true, isBar = true} self.defaults.profile.units.player.staggerBar = {enabled = true} - self.defaults.profile.units.player.demonicFuryBar = {enabled = true} self.defaults.profile.units.player.comboPoints = {enabled = true, isBar = true} - self.defaults.profile.units.player.burningEmbersBar = {enabled = true} self.defaults.profile.units.player.eclipseBar = {enabled = true} self.defaults.profile.units.player.holyPower = {enabled = true, isBar = true} self.defaults.profile.units.player.shadowOrbs = {enabled = true, isBar = true} diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 9378635a..cf19cb78 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -155,9 +155,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) HOLYPOWER = {r = 0.95, g = 0.90, b = 0.60}, BANKEDHOLYPOWER = {r = 0.96, g = 0.61, b = 0.84}, SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, - DEMONICFURY = {r = 0.58, g = 0.51, b = 0.79}, - BURNINGEMBERS = {r = 0.58, g = 0.51, b = 0.79}, - FULLBURNINGEMBER = {r = 0.88, g = 0.09, b = 0.062}, SHADOWORBS = {r = 0.58, g = 0.51, b = 0.79}, ALTERNATE = {r = 0.815, g = 0.941, b = 1}, CHI = {r = 0.71, g = 1.0, b = 0.92}, @@ -347,8 +344,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) eclipseBar = {enabled = true, background = true, order = 70, height = 0.75}, comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, auraPoints = {enabled = false, showAlways = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, - demonicFuryBar = {enabled = true, background = false, height = 0.50, order = 70}, - burningEmbersBar = {enabled = true, background = false, height = 0.40, order = 70}, staggerBar = {enabled = true, background = true, height = 0.30, order = 70}, soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, @@ -370,7 +365,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[perpp]"}, {text = "[curmaxpp]"}, {text = "[(()afk() )][name][( ()group())]"}, - {enabled = true, width = 1, name = L["Text"], text = "[warlock:demonic:curpp]", anchorTo = "$demonicFuryBar", anchorPoint = "C", x = 3, y = 0, size = -1, default = true}, {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = 0, x = 0, y = 0, default = true}, {enabled = true, width = 1, name = L["Timer Text"], text = "[totem:timer]", anchorTo = "$totemBar", anchorPoint = "C", x = 0, y = 0, size = 0, default = true, block = true}, {enabled = true, width = 1, name = L["Timer Text"], text = "[rune:timer]", anchorTo = "$runeBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true}, diff --git a/modules/movers.lua b/modules/movers.lua index e47e31a3..f2262c8f 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -50,10 +50,6 @@ local function createConfigEnv() return 4 elseif( powerType == SPELL_POWER_SHADOW_ORBS ) then return 5 - elseif( powerType == SPELL_POWER_BURNING_EMBERS ) then - return math.floor(MAX_POWER_PER_EMBER + (MAX_POWER_PER_EMBER / 2)) - elseif( powerType == SPELL_POWER_DEMONIC_FURY ) then - return 100 end return getValue("UnitPower", unit, math.random(20000, 50000)) diff --git a/options/config.lua b/options/config.lua index 1173a8ce..77e5688a 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4020,7 +4020,7 @@ local function loadUnitOptions() hidden = function(info) local unit = info[2] if( unit == "global" ) then - return not globalConfig.runeBar and not globalConfig.eclipseBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.monkBar and not globalConfig.xpBar and not globalConfig.demonicFuryBar and not globalConfig.burningEmbersBar and not globalConfig.staggerBar + return not globalConfig.runeBar and not globalConfig.eclipseBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.priestBar and not globalConfig.xpBar and not globalConfig.staggerBar else return unit ~= "player" and unit ~= "pet" end From 849689de552c5c7e9013be41197228d720bae170 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 12:54:45 +0200 Subject: [PATCH 641/794] Remove Shadow Orbs bar, add a Priest Mana bar (shadow only) --- ShadowedUnitFrames.lua | 2 +- ShadowedUnitFrames.toc | 2 +- modules/defaultlayout.lua | 3 +-- modules/movers.lua | 2 -- modules/priest.lua | 39 +++++++++++++++++++++++++++++++++++++++ modules/shadoworbs.lua | 30 ------------------------------ options/config.lua | 8 ++++++++ 7 files changed, 50 insertions(+), 36 deletions(-) create mode 100644 modules/priest.lua delete mode 100755 modules/shadoworbs.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 56d12569..0ad230e1 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -266,6 +266,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.runeBar = {enabled = false} self.defaults.profile.units.player.totemBar = {enabled = false} self.defaults.profile.units.player.druidBar = {enabled = false} + self.defaults.profile.units.player.priestBar = {enabled = true} self.defaults.profile.units.player.xpBar = {enabled = false} self.defaults.profile.units.player.fader = {enabled = false} self.defaults.profile.units.player.soulShards = {enabled = true, isBar = true} @@ -273,7 +274,6 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.comboPoints = {enabled = true, isBar = true} self.defaults.profile.units.player.eclipseBar = {enabled = true} self.defaults.profile.units.player.holyPower = {enabled = true, isBar = true} - self.defaults.profile.units.player.shadowOrbs = {enabled = true, isBar = true} self.defaults.profile.units.player.chi = {enabled = true, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} self.defaults.profile.units.player.auraPoints = {enabled = false, isBar = true} diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 3a2fdbc9..de18ddee 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -57,9 +57,9 @@ modules\soulshards.lua modules\holypower.lua modules\chi.lua modules\altpower.lua -modules\shadoworbs.lua modules\monkstagger.lua modules\aurapoints.lua +modules\priest.lua #@do-not-package@ options\config.lua globalcheck.rb diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index cf19cb78..f09e984b 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -155,7 +155,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) HOLYPOWER = {r = 0.95, g = 0.90, b = 0.60}, BANKEDHOLYPOWER = {r = 0.96, g = 0.61, b = 0.84}, SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, - SHADOWORBS = {r = 0.58, g = 0.51, b = 0.79}, ALTERNATE = {r = 0.815, g = 0.941, b = 1}, CHI = {r = 0.71, g = 1.0, b = 0.92}, STATUE = {r = 0.35, g = 0.45, b = 0.60}, @@ -341,6 +340,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) runeBar = {enabled = true, background = false, height = 0.40, order = 70}, totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, + priestBar = {enabled = true, background = true, height = 0.40, order = 70}, eclipseBar = {enabled = true, background = true, order = 70, height = 0.75}, comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, auraPoints = {enabled = false, showAlways = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, @@ -348,7 +348,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, - shadowOrbs = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, incHeal = {cap = 1}, incAbsorb = {cap = 1}, healAbsorb = {cap = 1}, diff --git a/modules/movers.lua b/modules/movers.lua index f2262c8f..0a7cd4fb 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -48,8 +48,6 @@ local function createConfigEnv() return getValue("UnitPower", unit, math.random(-100, 100)) elseif( powerType == SPELL_POWER_CHI) then return 4 - elseif( powerType == SPELL_POWER_SHADOW_ORBS ) then - return 5 end return getValue("UnitPower", unit, math.random(20000, 50000)) diff --git a/modules/priest.lua b/modules/priest.lua new file mode 100644 index 00000000..4a1f9512 --- /dev/null +++ b/modules/priest.lua @@ -0,0 +1,39 @@ +local Priest = {} +ShadowUF:RegisterModule(Priest, "priestBar", ShadowUF.L["Priest mana bar"], true, "PRIEST", SPEC_PRIEST_SHADOW) + +function Priest:OnEnable(frame) + frame.priestBar = frame.priestBar or ShadowUF.Units:CreateBar(frame) + + frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "PowerChanged") + + frame:RegisterUpdateFunc(self, "PowerChanged") + frame:RegisterUpdateFunc(self, "Update") +end + +function Priest:OnDisable(frame) + frame:UnregisterAll(self) +end + +function Priest:OnLayoutApplied(frame) + if( not frame.visibility.priestBar ) then return end + + local color = ShadowUF.db.profile.powerColors.MANA + frame:SetBarColor("priestBar", color.r, color.g, color.b) +end + +function Priest:PowerChanged(frame) + local visible = UnitPowerType(frame.unit) ~= ADDITIONAL_POWER_BAR_INDEX and not frame.inVehicle + local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent" + + frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") + frame[type](frame, "UNIT_POWERMAX", self, "Update") + ShadowUF.Layout:SetBarVisibility(frame, "priestBar", visible) + + if( visible ) then self:Update(frame) end +end + +function Priest:Update(frame, event, unit, powerType) + if( powerType and powerType ~= "MANA" ) then return end + frame.priestBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, SPELL_POWER_MANA)) + frame.priestBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, SPELL_POWER_MANA)) +end diff --git a/modules/shadoworbs.lua b/modules/shadoworbs.lua deleted file mode 100755 index a26b4567..00000000 --- a/modules/shadoworbs.lua +++ /dev/null @@ -1,30 +0,0 @@ -if( not ShadowUF.ComboPoints ) then return end - -local ShadowOrbs = setmetatable({}, {__index = ShadowUF.ComboPoints}) -ShadowUF:RegisterModule(ShadowOrbs, "shadowOrbs", ShadowUF.L["Shadow Orbs"], nil, "PRIEST", SPEC_PRIEST_SHADOW, SHADOW_ORBS_SHOW_LEVEL) -local shadowConfig = {max = 5, key = "shadowOrbs", colorKey = "SHADOWORBS", powerType = SPELL_POWER_SHADOW_ORBS, eventType = "SHADOW_ORBS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} - -function ShadowOrbs:OnEnable(frame) - frame.shadowOrbs = frame.shadowOrbs or CreateFrame("Frame", nil, frame) - frame.shadowOrbs.cpConfig = shadowConfig - - frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") - frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") - - frame:RegisterUpdateFunc(self, "Update") - frame:RegisterUpdateFunc(self, "UpdateBarBlocks") -end - -function ShadowOrbs:OnLayoutApplied(frame, config) - ShadowUF.ComboPoints.OnLayoutApplied(self, frame, config) - self:UpdateBarBlocks(frame) -end - -function ShadowOrbs:GetComboPointType() - return "shadowOrbs" -end - -function ShadowOrbs:GetPoints(unit) - return UnitPower("player", shadowConfig.powerType) -end \ No newline at end of file diff --git a/options/config.lua b/options/config.lua index 77e5688a..ea5190d9 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4058,6 +4058,14 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "druidBar.enabled", }, + priestBar = { + order = 3, + type = "toggle", + name = string.format(L["Enable %s"], L["Priest mana bar"]), + desc = L["Adds a mana bar to the player frame for shadow priests."], + hidden = hideRestrictedOption, + arg = "priestBar.enabled", + }, xpBar = { order = 4, type = "toggle", From 2e454535731895e80b3020573d49f8a4cb92df16 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 13:01:35 +0200 Subject: [PATCH 642/794] Add Insanity and Maelstrom power types --- modules/defaultlayout.lua | 2 ++ options/config.lua | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index f09e984b..306f26af 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -152,6 +152,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) AMMOSLOT = {r = 0.85, g = 0.60, b = 0.55}, FUEL = {r = 0.85, g = 0.47, b = 0.36}, COMBOPOINTS = {r = 1.0, g = 0.80, b = 0.0}, + INSANITY = {r = 0.40, g = 0, b = 0.80}, + MAELSTROM = {r = 0.00, g = 0.50, b = 1.00}, HOLYPOWER = {r = 0.95, g = 0.90, b = 0.60}, BANKEDHOLYPOWER = {r = 0.96, g = 0.61, b = 0.84}, SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, diff --git a/options/config.lua b/options/config.lua index ea5190d9..271ebb3d 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1172,13 +1172,20 @@ local function loadGeneralOptions() arg = "powerColors.AURAPOINTS", hidden = function() return not ShadowUF.modules.auraPoints end }, - SHADOWORBS = { + INSANITY = { order = 12, type = "color", - name = L["Shadow Orbs"], - arg = "powerColors.SHADOWORBS", + name = L["Insanity"], + arg = "powerColors.INSANITY", hidden = function(info) return select(2, UnitClass("player")) ~= "PRIEST" end, }, + MAELSTROM = { + order = 12, + type = "color", + name = L["Maelstrom"], + arg = "powerColors.MAELSTROM", + hidden = function(info) return select(2, UnitClass("player")) ~= "SHAMAN" end, + }, HOLYPOWER = { order = 12, type = "color", From 0ecebbe6e6c239a5edfd4130d3c236b20cbd919c Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 13:13:04 +0200 Subject: [PATCH 643/794] Remove unused power types --- modules/defaultlayout.lua | 2 -- modules/totems.lua | 5 ----- options/config.lua | 14 -------------- 3 files changed, 21 deletions(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 306f26af..274bf181 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -162,12 +162,10 @@ function ShadowUF:LoadDefaultLayout(useMerge) STATUE = {r = 0.35, g = 0.45, b = 0.60}, RUNEOFPOWER = {r = 0.35, g = 0.45, b = 0.60}, MUSHROOMS = {r = 0.20, g = 0.90, b = 0.20}, - POWER_TYPE_FEL_ENERGY = {r = 0.878, g = 0.980, b = 0}, AURAPOINTS = {r = 1.0, g = 0.80, b = 0.0}, STAGGER_GREEN = {r = 0.52, g = 1.0, b = 0.52}, STAGGER_YELLOW = {r = 1.0, g = 0.98, b = 0.72}, STAGGER_RED = {r = 1.0, g = 0.42, b = 0.42}, - LIGHTWELL = {r = 0.80, g = 0.80, b = 0.80} } config.healthColors = { tapped = {r = 0.5, g = 0.5, b = 0.5}, diff --git a/modules/totems.lua b/modules/totems.lua index 7687f488..ac77a179 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -16,9 +16,6 @@ elseif( playerClass == "MONK" ) then elseif( playerClass == "MAGE" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Rune of Power bar"], true, "MAGE", {1, 2, 3}, 90) -elseif( playerClass == "PRIEST" ) then - MAX_TOTEMS = 1 - ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Lightwell bar"], true, "PRIEST", 2, 36) else ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Totem bar"], true, "SHAMAN") end @@ -62,8 +59,6 @@ function Totems:OnEnable(frame) totemColors[1] = ShadowUF.db.profile.powerColors.STATUE elseif( playerClass == "MAGE" ) then totemColors[1] = ShadowUF.db.profile.powerColors.RUNEOFPOWER - elseif( playerClass == "PRIEST" ) then - totemColors[1] = ShadowUF.db.profile.powerColors.LIGHTWELL else totemColors[1] = {r = 1, g = 0, b = 0.4} totemColors[2] = {r = 0, g = 1, b = 0.4} diff --git a/options/config.lua b/options/config.lua index 271ebb3d..2e6b0527 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1237,20 +1237,6 @@ local function loadGeneralOptions() arg = "powerColors.RUNEOFPOWER", hidden = function(info) return select(2, UnitClass("player")) ~= "MAGE" end, }, - LIGHTWELL = { - order = 17.6, - type = "color", - name = L["Lightwell"], - arg = "powerColors.LIGHTWELL", - hidden = function(info) return select(2, UnitClass("player")) ~= "PRIEST" end, - }, - POWER_TYPE_FEL_ENERGY = { - order = 18, - type = "color", - name = L["Fel Energy"], - arg = "powerColors.POWER_TYPE_FEL_ENERGY", - hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, - }, ALTERNATE = { order = 19, type = "color", From 814e2ca9669d4726a76d763cc98c32731e696ca7 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 13:17:25 +0200 Subject: [PATCH 644/794] Add Fury and Pain power types for demon hunters --- modules/defaultlayout.lua | 2 ++ options/config.lua | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 274bf181..844496e9 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -159,6 +159,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, ALTERNATE = {r = 0.815, g = 0.941, b = 1}, CHI = {r = 0.71, g = 1.0, b = 0.92}, + FURY = {r = 0.788, g = 0.259, b = 0.992}, + PAIN = {r = 1, g = 0, b = 0}, STATUE = {r = 0.35, g = 0.45, b = 0.60}, RUNEOFPOWER = {r = 0.35, g = 0.45, b = 0.60}, MUSHROOMS = {r = 0.20, g = 0.90, b = 0.20}, diff --git a/options/config.lua b/options/config.lua index 2e6b0527..de0bf698 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1216,6 +1216,20 @@ local function loadGeneralOptions() arg = "powerColors.CHI", hidden = function(info) return select(2, UnitClass("player")) ~= "MONK" end, }, + FURY = { + order = 17, + type = "color", + name = L["Fury"], + arg = "powerColors.FURY", + hidden = function(info) return select(2, UnitClass("player")) ~= "DEMONHUNTER" end, + }, + PAIN = { + order = 17, + type = "color", + name = L["Pain"], + arg = "powerColors.PAIN", + hidden = function(info) return select(2, UnitClass("player")) ~= "DEMONHUNTER" end, + }, MUSHROOMS = { order = 17, type = "color", From 2d037fb486f53dc8beafb5d6a7a62166ae3fa8d9 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 13:32:27 +0200 Subject: [PATCH 645/794] Remove eclipse bar --- ShadowedUnitFrames.lua | 3 +- ShadowedUnitFrames.toc | 1 - modules/defaultlayout.lua | 4 - modules/eclipse.lua | 153 -------------------------------------- modules/tags.lua | 8 -- options/config.lua | 32 +------- 6 files changed, 5 insertions(+), 196 deletions(-) delete mode 100755 modules/eclipse.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 0ad230e1..84f6921b 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -272,7 +272,6 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.soulShards = {enabled = true, isBar = true} self.defaults.profile.units.player.staggerBar = {enabled = true} self.defaults.profile.units.player.comboPoints = {enabled = true, isBar = true} - self.defaults.profile.units.player.eclipseBar = {enabled = true} self.defaults.profile.units.player.holyPower = {enabled = true, isBar = true} self.defaults.profile.units.player.chi = {enabled = true, isBar = true} self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0} @@ -684,7 +683,7 @@ function ShadowUF:HideBlizzardFrames() end if( self.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then - basicHideBlizzardFrames(PriestBarFrame, EclipseBarFrame, RuneFrame, WarlockPowerFrame) + basicHideBlizzardFrames(PriestBarFrame, RuneFrame, WarlockPowerFrame) end if( self.db.profile.hidden.pet and not active_hiddens.pet ) then diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index de18ddee..130cddb7 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -52,7 +52,6 @@ modules\healabsorb.lua modules\range.lua modules\empty.lua modules\druid.lua -modules\eclipse.lua modules\soulshards.lua modules\holypower.lua modules\chi.lua diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 844496e9..defac28d 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -147,8 +147,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) ENERGY = {r = 1.0, g = 0.85, b = 0.10}, RUNES = {r = 0.50, g = 0.50, b = 0.50}, RUNIC_POWER = {b = 0.60, g = 0.45, r = 0.35}, - ECLIPSE_SUN = {r = 1.0, g = 1.0, b = 0.0}, - ECLIPSE_MOON = {r = 0.30, g = 0.52, b = 0.90}, AMMOSLOT = {r = 0.85, g = 0.60, b = 0.55}, FUEL = {r = 0.85, g = 0.47, b = 0.36}, COMBOPOINTS = {r = 1.0, g = 0.80, b = 0.0}, @@ -343,7 +341,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, priestBar = {enabled = true, background = true, height = 0.40, order = 70}, - eclipseBar = {enabled = true, background = true, order = 70, height = 0.75}, comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, auraPoints = {enabled = false, showAlways = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, staggerBar = {enabled = true, background = true, height = 0.30, order = 70}, @@ -366,7 +363,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[perpp]"}, {text = "[curmaxpp]"}, {text = "[(()afk() )][name][( ()group())]"}, - {enabled = true, width = 1, name = L["Text"], text = "[druid:eclipse]", anchorTo = "$eclipseBar", anchorPoint = "CLI", size = 0, x = 0, y = 0, default = true}, {enabled = true, width = 1, name = L["Timer Text"], text = "[totem:timer]", anchorTo = "$totemBar", anchorPoint = "C", x = 0, y = 0, size = 0, default = true, block = true}, {enabled = true, width = 1, name = L["Timer Text"], text = "[rune:timer]", anchorTo = "$runeBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true}, {enabled = true, width = 1, name = L["Text"], text = "[monk:abs:stagger]", anchorTo = "$staggerBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true} diff --git a/modules/eclipse.lua b/modules/eclipse.lua deleted file mode 100755 index 1721963d..00000000 --- a/modules/eclipse.lua +++ /dev/null @@ -1,153 +0,0 @@ --- Moon on left, Sun on right -local Eclipse = {types = {"sun", "moon"}} -ShadowUF:RegisterModule(Eclipse, "eclipseBar", ShadowUF.L["Eclipse bar"], true, "DRUID", 1) - -function Eclipse:OnEnable(frame) - if( not frame.eclipseBar ) then - frame.eclipseBar = CreateFrame("Frame", nil, frame) - -- the arrow marker - frame.eclipseBar.marker = CreateFrame("Frame", nil, frame.eclipseBar) - frame.eclipseBar.marker:SetPoint("CENTER", frame.eclipseBar) - frame.eclipseBar.marker:SetFrameLevel(frame.topFrameLevel + 5) - frame.eclipseBar.marker.texture = frame.eclipseBar.marker:CreateTexture(nil, "OVERLAY") - frame.eclipseBar.marker.texture:SetAtlas("DruidEclipse-Arrow") - frame.eclipseBar.marker.texture:SetTexCoord(1.0, 0.914, 0.82, 1.0) - frame.eclipseBar.marker.texture:SetVertexColor(1, 1, 1, 1) - frame.eclipseBar.marker.texture:SetBlendMode("ADD") - frame.eclipseBar.marker.texture:SetAllPoints(frame.eclipseBar.marker) - - -- the actual bar textures - frame.eclipseBar.moon = frame.eclipseBar:CreateTexture(nil, "ARTWORK") - frame.eclipseBar.moon:SetPoint("TOPLEFT", frame.eclipseBar, "TOPLEFT") - frame.eclipseBar.moon:SetPoint("BOTTOMRIGHT", frame.eclipseBar, "BOTTOM") - - frame.eclipseBar.sun = frame.eclipseBar:CreateTexture(nil, "ARTWORK") - frame.eclipseBar.sun:SetPoint("TOPRIGHT", frame.eclipseBar, "TOPRIGHT") - frame.eclipseBar.sun:SetPoint("BOTTOMLEFT", frame.eclipseBar, "BOTTOM") - - for _, type in pairs(self.types) do - local typeFrame = frame.eclipseBar[type] - typeFrame.highlight = CreateFrame("Frame", nil, frame.eclipseBar) - typeFrame.highlight:SetFrameLevel(frame.topFrameLevel) - typeFrame.highlight:SetAllPoints(typeFrame) - typeFrame.highlight:SetSize(1, 1) - - typeFrame.highlight.top = typeFrame.highlight:CreateTexture(nil, "OVERLAY") - typeFrame.highlight.top:SetBlendMode("ADD") - typeFrame.highlight.top:SetTexture("Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\highlight") - typeFrame.highlight.top:SetPoint("TOPLEFT", typeFrame, 0, 0) - typeFrame.highlight.top:SetPoint("TOPRIGHT", typeFrame, 0, 0) - typeFrame.highlight.top:SetHeight(30) - typeFrame.highlight.top:SetTexCoord(0.3125, 0.625, 0, 0.3125) - typeFrame.highlight.top:SetHorizTile(false) - - typeFrame.highlight.left = typeFrame.highlight:CreateTexture(nil, "OVERLAY") - typeFrame.highlight.left:SetBlendMode("ADD") - typeFrame.highlight.left:SetTexture("Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\highlight") - typeFrame.highlight.left:SetPoint("TOPLEFT", typeFrame, 0, 0) - typeFrame.highlight.left:SetPoint("BOTTOMLEFT", typeFrame, 0, 0) - typeFrame.highlight.left:SetWidth(30) - typeFrame.highlight.left:SetTexCoord(0, 0.3125, 0.3125, 0.625) - typeFrame.highlight.left:SetHorizTile(false) - - typeFrame.highlight.right = typeFrame.highlight:CreateTexture(nil, "OVERLAY") - typeFrame.highlight.right:SetBlendMode("ADD") - typeFrame.highlight.right:SetTexture("Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\highlight") - typeFrame.highlight.right:SetPoint("TOPRIGHT", typeFrame, 0, 0) - typeFrame.highlight.right:SetPoint("BOTTOMRIGHT", typeFrame, 0, 0) - typeFrame.highlight.right:SetWidth(30) - typeFrame.highlight.right:SetTexCoord(0.625, 0.93, 0.3125, 0.625) - typeFrame.highlight.right:SetHorizTile(false) - - typeFrame.highlight.bottom = typeFrame.highlight:CreateTexture(nil, "OVERLAY") - typeFrame.highlight.bottom:SetBlendMode("ADD") - typeFrame.highlight.bottom:SetTexture("Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\highlight") - typeFrame.highlight.bottom:SetPoint("BOTTOMLEFT", typeFrame, 0, 0) - typeFrame.highlight.bottom:SetPoint("BOTTOMRIGHT", typeFrame, 0, 0) - typeFrame.highlight.bottom:SetHeight(30) - typeFrame.highlight.bottom:SetTexCoord(0.3125, 0.625, 0.625, 0.93) - typeFrame.highlight.bottom:SetHorizTile(false) - typeFrame.highlight:Hide() - end - end - - frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") - frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "Update") - frame:RegisterNormalEvent("ECLIPSE_DIRECTION_CHANGE", self, "UpdateDirection") - frame:RegisterNormalEvent("UPDATE_SHAPESHIFT_FORM", self, "UpdateVisibility") - - frame:RegisterUpdateFunc(self, "UpdateVisibility") -end - -function Eclipse:OnDisable(frame) - frame:UnregisterAll(self) -end - -function Eclipse:OnLayoutApplied(frame) - if( not frame.visibility.eclipseBar ) then return end - - local highlightSize = math.ceil(frame.eclipseBar:GetHeight()) - for _, type in pairs(self.types) do - local color = ShadowUF.db.profile.powerColors["ECLIPSE_" .. string.upper(type)] - frame.eclipseBar[type]:SetTexture(ShadowUF.Layout.mediaPath.statusbar) - frame.eclipseBar[type]:SetVertexColor(color.r, color.g, color.b) - frame.eclipseBar[type]:SetHorizTile(false) - - for _, type in pairs(self.types) do - local typeFrame = frame.eclipseBar[type] - typeFrame.highlight.top:SetVertexColor(color.r, color.g, color.b, 0.9) - typeFrame.highlight.top:SetHeight(highlightSize) - - typeFrame.highlight.bottom:SetVertexColor(color.r, color.g, color.b, 0.9) - typeFrame.highlight.bottom:SetHeight(highlightSize) - - typeFrame.highlight.left:SetVertexColor(color.r, color.g, color.b, 0.9) - typeFrame.highlight.left:SetWidth(highlightSize) - - typeFrame.highlight.right:SetVertexColor(color.r, color.g, color.b, 0.9) - typeFrame.highlight.right:SetWidth(highlightSize) - end - end - - frame.eclipseBar.marker:SetSize(frame.eclipseBar:GetHeight() * 2, frame.eclipseBar:GetHeight() * 2) - - - self:UpdateVisibility(frame) -end - -function Eclipse:UpdateVisibility(frame) - local form = GetShapeshiftFormID() - ShadowUF.Layout:SetBarVisibility(frame, "eclipseBar", form == MOONKIN_FORM or not form and not frame.inVehicle) - self:UpdateDirection(frame) - self:Update(frame, nil, nil, "ECLIPSE") -end - -function Eclipse:UpdateDirection(frame) - local direction = GetEclipseDirection() - if( direction ) then - frame.eclipseBar.marker.texture:SetTexCoord(unpack(ECLIPSE_MARKER_COORDS[direction])) - end -end - -function Eclipse:Update(frame, event, unit, powerType) - if( event and powerType ~= "ECLIPSE" ) then return end - - local power = UnitPower("player", SPELL_POWER_ECLIPSE) - local halfWidth = (frame.eclipseBar:GetWidth() - frame.eclipseBar.marker:GetWidth()) / 2 - local x = halfWidth * (power / 100) - frame.eclipseBar.marker:SetPoint("CENTER", frame.eclipseBar, "CENTER", x, 0) - - -- Sun power - if( power > 0 ) then - frame.eclipseBar.sun.highlight:Show() - frame.eclipseBar.moon.highlight:Hide() - -- Moon power - elseif( power < 0 ) then - frame.eclipseBar.sun.highlight:Hide() - frame.eclipseBar.moon.highlight:Show() - -- No power - else - frame.eclipseBar.sun.highlight:Hide() - frame.eclipseBar.moon.highlight:Hide() - end -end diff --git a/modules/tags.lua b/modules/tags.lua index 8627281d..2d351e2d 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -909,11 +909,6 @@ Tags.defaultTags = { return string.format("%s/%s", ShadowUF:FormatLargeNumber(power), ShadowUF:FormatLargeNumber(maxPower)) end]], - ["druid:eclipse"] = [[function(unit, unitOwner) - if( GetSpecialization() ~= 1 ) then return nil end - - return UnitPower(unitOwner, SPELL_POWER_ECLIPSE) - end]], ["druid:absolutepp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end if( GetSpecialization() ~= SPEC_MONK_MISTWEAVER ) then return nil end @@ -1061,7 +1056,6 @@ Tags.defaultEvents = { ["curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["absolutepp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["smart:curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", - ["druid:eclipse"] = "SUF_POWERTYPE:ECLIPSE UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["druid:curpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", ["druid:abscurpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", ["druid:curmaxpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", @@ -1289,7 +1283,6 @@ Tags.defaultHelp = { ["abbrev:name"] = L["Abbreviates unit names above 10 characters, \"Dark Rune Champion\" becomes \"D.R.Champion\" and \"Dark Rune Commoner\" becomes \"D.R.Commoner\"."], ["group"] = L["Shows current group number of the unit."], ["close"] = L["Closes a color code, prevents colors from showing up on text that you do not want it to."], - ["druid:eclipse"] = L["Current Eclipse, <0 is Lunar Energy and >0 is Solar Energy."], ["druid:curpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "currpp"), ["druid:abscurpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "abscurpp"), ["druid:curmaxpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "curmaxpp"), @@ -1388,7 +1381,6 @@ Tags.defaultNames = { ["dechp"] = L["Decimal percent HP"], ["group"] = L["Group number"], ["close"] = L["Close color"], - ["druid:eclipse"] = L["Eclipse (Druid)"], ["druid:curpp"] = L["Current power (Druid)"], ["druid:abscurpp"] = L["Current power (Druid/Absolute)"], ["druid:curmaxpp"] = L["Cur/Max power (Druid)"], diff --git a/options/config.lua b/options/config.lua index de0bf698..0be1a305 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1129,22 +1129,6 @@ local function loadGeneralOptions() name = L["Runic Power"], arg = "powerColors.RUNIC_POWER", }, - ECLIPSE_MOON = { - order = 7, - type = "color", - name = L["Eclipse (Moon)"], - desc = L["Bar coloring for the moon portion of the eclipse bar."], - hidden = function(info) return select(2, UnitClass("player")) ~= "DRUID" end, - arg = "powerColors.ECLIPSE_MOON", - }, - ECLIPSE_SUN = { - order = 8, - type = "color", - name = L["Eclipse (Sun)"], - desc = L["Bar coloring for the moon portion of the eclipse bar."], - hidden = function(info) return select(2, UnitClass("player")) ~= "DRUID" end, - arg = "powerColors.ECLIPSE_SUN", - }, AMMOSLOT = { order = 9, type = "color", @@ -2407,7 +2391,7 @@ local function loadUnitOptions() hidden = hideBarOption, arg = "$parent.background", }, - sep2 = {order = 1.55, type = "description", name = "", hidden = function(info) return not (not ShadowUF.modules[info[#(info) - 1]] or info[#(info) - 1] == "eclipseBar" or not ShadowUF.db.profile.advanced or ShadowUF.modules[info[#(info) - 1]].isComboPoints) end}, + sep2 = {order = 1.55, type = "description", name = "", hidden = function(info) return not (not ShadowUF.modules[info[#(info) - 1]] or not ShadowUF.db.profile.advanced or ShadowUF.modules[info[#(info) - 1]].isComboPoints) end}, overrideBackground = { order = 1.6, type = "toggle", @@ -2473,10 +2457,10 @@ local function loadUnitOptions() type = "toggle", name = L["Invert colors"], desc = L["Flips coloring so the bar color is shown as the background color and the background as the bar"], - hidden = function(info) return not ShadowUF.modules[info[#(info) - 1]] or info[#(info) - 1] == "eclipseBar" or not ShadowUF.db.profile.advanced or ShadowUF.modules[info[#(info) - 1]].isComboPoints end, + hidden = function(info) return not ShadowUF.modules[info[#(info) - 1]] or not ShadowUF.db.profile.advanced or ShadowUF.modules[info[#(info) - 1]].isComboPoints end, arg = "$parent.invert", }, - sep3 = {order = 3, type = "description", name = "", hidden = function(info) return not ShadowUF.modules[info[#(info) - 1]] or info[#(info) - 1] == "eclipseBar" or not ShadowUF.db.profile.advanced or ShadowUF.modules[info[#(info) - 1]].isComboPoints end,}, + sep3 = {order = 3, type = "description", name = "", hidden = function(info) return not ShadowUF.modules[info[#(info) - 1]] or not ShadowUF.db.profile.advanced or ShadowUF.modules[info[#(info) - 1]].isComboPoints end,}, order = { order = 4, type = "range", @@ -4027,7 +4011,7 @@ local function loadUnitOptions() hidden = function(info) local unit = info[2] if( unit == "global" ) then - return not globalConfig.runeBar and not globalConfig.eclipseBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.priestBar and not globalConfig.xpBar and not globalConfig.staggerBar + return not globalConfig.runeBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.priestBar and not globalConfig.xpBar and not globalConfig.staggerBar else return unit ~= "player" and unit ~= "pet" end @@ -4041,14 +4025,6 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "runeBar.enabled", }, - eclipseBar = { - order = 1.25, - type = "toggle", - name = string.format(L["Enable %s"], L["Eclipse bar"]), - desc = L["Adds eclipse bars and how far into sun or moon eclipse is."], - hidden = hideRestrictedOption, - arg = "eclipseBar.enabled", - }, staggerBar = { order = 1.25, type = "toggle", From 1849a07e2d2cba7099642429e637d5701d49055b Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 13:32:43 +0200 Subject: [PATCH 646/794] Update the totem bar for druid changes Its only used by restoration druids efflorescene now. --- modules/totems.lua | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/modules/totems.lua b/modules/totems.lua index ac77a179..e741e8b1 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -8,8 +8,8 @@ if( playerClass == "PALADIN" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Ancient Kings bar"], true, "PALADIN", 75) elseif( playerClass == "DRUID" ) then - MAX_TOTEMS = 3 - ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Mushroom bar"], true, "DRUID", {1, 4}, 84) + MAX_TOTEMS = 1 + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Mushroom bar"], true, "DRUID", 4, 88) elseif( playerClass == "MONK" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Statue bar"], true, "MONK", {1, 2}, 70) @@ -52,7 +52,7 @@ function Totems:OnEnable(frame) end if( playerClass == "DRUID" ) then - totemColors[1], totemColors[2], totemColors[3] = ShadowUF.db.profile.powerColors.MUSHROOMS, ShadowUF.db.profile.powerColors.MUSHROOMS, ShadowUF.db.profile.powerColors.MUSHROOMS + totemColors[1] = ShadowUF.db.profile.powerColors.MUSHROOMS elseif( playerClass == "DEATHKNIGHT" ) then totemColors[1] = ShadowUF.db.profile.classColors.PET elseif( playerClass == "MONK" ) then @@ -81,12 +81,6 @@ function Totems:OnDisable(frame) end end -function Totems:OnPreLayoutApply(frame) - if( frame.visibility.totemBar and playerClass == "DRUID" ) then - MAX_TOTEMS = GetSpecialization() == 4 and 1 or 3 - end -end - function Totems:OnLayoutApplied(frame) if( not frame.visibility.totemBar ) then return end From 24ca529a0ed9402908de9a22b37866ac508b323f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 13:41:19 +0200 Subject: [PATCH 647/794] Add Astral Power for Balance Druids --- modules/defaultlayout.lua | 1 + options/config.lua | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index defac28d..18edaf02 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -152,6 +152,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) COMBOPOINTS = {r = 1.0, g = 0.80, b = 0.0}, INSANITY = {r = 0.40, g = 0, b = 0.80}, MAELSTROM = {r = 0.00, g = 0.50, b = 1.00}, + LUNAR_POWER = {r = 0.30, g = 0.52, b = 0.90}, HOLYPOWER = {r = 0.95, g = 0.90, b = 0.60}, BANKEDHOLYPOWER = {r = 0.96, g = 0.61, b = 0.84}, SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, diff --git a/options/config.lua b/options/config.lua index 0be1a305..52ecbb18 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1214,6 +1214,13 @@ local function loadGeneralOptions() arg = "powerColors.PAIN", hidden = function(info) return select(2, UnitClass("player")) ~= "DEMONHUNTER" end, }, + LUNAR_POWER = { + order = 17, + type = "color", + name = L["Astral Power"], + arg = "powerColors.LUNAR_POWER", + hidden = function(info) return select(2, UnitClass("player")) ~= "DRUID" end, + }, MUSHROOMS = { order = 17, type = "color", From 8f8a3584058b3923fb7ddffce25bc362a8208029 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 13:45:35 +0200 Subject: [PATCH 648/794] Upgrade existing profiles and add proper defaults for new elements --- ShadowedUnitFrames.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 84f6921b..56a07f07 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -100,7 +100,26 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision if( revision <= 55 ) then + -- new classes self.db.profile.classColors.DEMONHUNTER = {r = 0.64, g = 0.19, b = 0.79} + + -- new power types + self.db.profile.powerColors.INSANITY = {r = 0.40, g = 0, b = 0.80} + self.db.profile.powerColors.MAELSTROM = {r = 0.00, g = 0.50, b = 1.00} + self.db.profile.powerColors.FURY = {r = 0.788, g = 0.259, b = 0.992} + self.db.profile.powerColors.PAIN = {r = 1, g = 0, b = 0} + self.db.profile.powerColors.LUNAR_POWER = {r = 0.30, g = 0.52, b = 0.90} + + -- new bars + local config = self.db.profile.units + config.player.priestBar = {enabled = true, background = true, height = 0.40, order = 70} + + -- clean out old bars + config.player.demonicFuryBar = nil + config.player.burningEmbersBar = nil + config.player.shadowOrbs = nil + config.player.eclipseBar = nil + config.player.monkBar = nil end if( revision <= 53 ) then From f9e16e290e400917f08cb90f5a99ddaa32775876 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 13:46:23 +0200 Subject: [PATCH 649/794] Force upgrading of profiles until development is done --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 56a07f07..9173cc9f 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -99,7 +99,7 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision - if( revision <= 55 ) then + if( revision <= 56 ) then -- new classes self.db.profile.classColors.DEMONHUNTER = {r = 0.64, g = 0.19, b = 0.79} From be650f803dbf619a0509b9ef4e205539bb6cbd1f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 13:56:52 +0200 Subject: [PATCH 650/794] Update rune handling for legion --- modules/runes.lua | 32 ++++---------------------------- options/config.lua | 7 +++++++ 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/modules/runes.lua b/modules/runes.lua index c4baf0fb..988bb29d 100755 --- a/modules/runes.lua +++ b/modules/runes.lua @@ -1,6 +1,5 @@ local Runes = {} local RUNE_MAP = {[1] = 1, [2] = 2, [3] = 5, [4] = 6, [5] = 3, [6] = 4} -local runeColors = {{r = 1, g = 0, b = 0.4}, {r = 0, g = 1, b = 0.4}, {r = 0, g = 0.4, b = 1}, {r = 0.7, g = 0.5, b = 1}} ShadowUF:RegisterModule(Runes, "runeBar", ShadowUF.L["Rune bar"], true, "DEATHKNIGHT") ShadowUF.BlockTimers:Inject(Runes, "RUNE_TIMER") ShadowUF.DynamicBlocks:Inject(Runes) @@ -28,8 +27,6 @@ function Runes:OnEnable(frame) end frame:RegisterNormalEvent("RUNE_POWER_UPDATE", self, "UpdateUsable") - frame:RegisterNormalEvent("RUNE_TYPE_UPDATE", self, "Update") - frame:RegisterUpdateFunc(self, "Update") frame:RegisterUpdateFunc(self, "UpdateUsable") end @@ -53,6 +50,9 @@ function Runes:OnLayoutApplied(frame) rune:SetStatusBarTexture(ShadowUF.Layout.mediaPath.statusbar) rune:GetStatusBarTexture():SetHorizTile(false) rune:SetWidth(barWidth) + + local color = ShadowUF.db.profile.powerColors.RUNES + frame:SetBlockColor(rune, "runeBar", color.r, color.g, color.b) end end @@ -74,10 +74,7 @@ end -- Updates the timers on runes function Runes:UpdateUsable(frame, event, id, usable) - if( not id ) then - self:UpdateColors(frame) - return - elseif( not frame.runeBar.runes[id] ) then + if( not id or not frame.runeBar.runes[id] ) then return end @@ -104,24 +101,3 @@ function Runes:UpdateUsable(frame, event, id, usable) rune.fontString:UpdateTags() end end - -function Runes:UpdateColors(frame) - for id, rune in pairs(frame.runeBar.runes) do - local colorType = GetRuneType(id) - if( frame.runeBar.runes[id].colorType ~= colorType ) then - local color = runeColors[colorType] - frame:SetBlockColor(frame.runeBar.runes[id], "runeBar", color.r, color.g, color.b) - end - end -end - --- No rune is passed for full update (Login), a single rune is passed when a single rune type changes, such as Blood Tap -function Runes:Update(frame, event, id) - if( not id ) then return end - - local colorType = GetRuneType(id) - if( frame.runeBar.runes[id].colorType ~= colorType ) then - local color = runeColors[colorType] - frame:SetBlockColor(frame.runeBar.runes[id], "runeBar", color.r, color.g, color.b) - end -end diff --git a/options/config.lua b/options/config.lua index 52ecbb18..d493685d 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1129,6 +1129,13 @@ local function loadGeneralOptions() name = L["Runic Power"], arg = "powerColors.RUNIC_POWER", }, + RUNES = { + order = 7, + type = "color", + name = L["Runes"], + arg = "powerColors.RUNES", + hidden = function(info) return select(2, UnitClass("player")) ~= "DEATHKNIGHT" end, + }, AMMOSLOT = { order = 9, type = "color", From a95bf6d7af2bf78b6722c1cba757fbec47fce54c Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 14:01:42 +0200 Subject: [PATCH 651/794] Limit Holy Power module to retribution --- modules/holypower.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/holypower.lua b/modules/holypower.lua index d3232c0f..83526a2a 100755 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -1,7 +1,7 @@ if( not ShadowUF.ComboPoints ) then return end local HolyPower = setmetatable({}, {__index = ShadowUF.ComboPoints}) -ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN", nil, PALADINPOWERBAR_SHOW_LEVEL) +ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN", SPEC_PALADIN_RETRIBUTION, PALADINPOWERBAR_SHOW_LEVEL) local holyConfig = {max = 5, key = "holyPower", colorKey = "HOLYPOWER", powerType = SPELL_POWER_HOLY_POWER, eventType = "HOLY_POWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function HolyPower:OnEnable(frame) From 7bd960df3ea928df473255707b81b52351b4fc8c Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 14:12:52 +0200 Subject: [PATCH 652/794] Add a shaman mana bar --- ShadowedUnitFrames.lua | 2 ++ ShadowedUnitFrames.toc | 1 + modules/defaultlayout.lua | 1 + modules/shaman.lua | 39 +++++++++++++++++++++++++++++++++++++++ options/config.lua | 10 +++++++++- 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 modules/shaman.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 9173cc9f..008e7eeb 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -113,6 +113,7 @@ function ShadowUF:CheckUpgrade() -- new bars local config = self.db.profile.units config.player.priestBar = {enabled = true, background = true, height = 0.40, order = 70} + config.player.shamanBar = {enabled = true, background = true, height = 0.40, order = 70} -- clean out old bars config.player.demonicFuryBar = nil @@ -286,6 +287,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.totemBar = {enabled = false} self.defaults.profile.units.player.druidBar = {enabled = false} self.defaults.profile.units.player.priestBar = {enabled = true} + self.defaults.profile.units.player.shamanBar = {enabled = true} self.defaults.profile.units.player.xpBar = {enabled = false} self.defaults.profile.units.player.fader = {enabled = false} self.defaults.profile.units.player.soulShards = {enabled = true, isBar = true} diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 130cddb7..a1f37fc4 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -59,6 +59,7 @@ modules\altpower.lua modules\monkstagger.lua modules\aurapoints.lua modules\priest.lua +modules\shaman.lua #@do-not-package@ options\config.lua globalcheck.rb diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 18edaf02..5c7e551c 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -342,6 +342,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) totemBar = {enabled = true, background = false, height = 0.40, order = 70}, druidBar = {enabled = true, background = true, height = 0.40, order = 70}, priestBar = {enabled = true, background = true, height = 0.40, order = 70}, + shamanBar = {enabled = true, background = true, height = 0.40, order = 70}, comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, auraPoints = {enabled = false, showAlways = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40}, staggerBar = {enabled = true, background = true, height = 0.30, order = 70}, diff --git a/modules/shaman.lua b/modules/shaman.lua new file mode 100644 index 00000000..1ae610ac --- /dev/null +++ b/modules/shaman.lua @@ -0,0 +1,39 @@ +local Shaman = {} +ShadowUF:RegisterModule(Shaman, "shamanBar", ShadowUF.L["Shaman mana bar"], true, "SHAMAN") + +function Shaman:OnEnable(frame) + frame.shamanBar = frame.shamanBar or ShadowUF.Units:CreateBar(frame) + + frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "PowerChanged") + + frame:RegisterUpdateFunc(self, "PowerChanged") + frame:RegisterUpdateFunc(self, "Update") +end + +function Shaman:OnDisable(frame) + frame:UnregisterAll(self) +end + +function Shaman:OnLayoutApplied(frame) + if( not frame.visibility.shamanBar ) then return end + + local color = ShadowUF.db.profile.powerColors.MANA + frame:SetBarColor("shamanBar", color.r, color.g, color.b) +end + +function Shaman:PowerChanged(frame) + local visible = UnitPowerType(frame.unit) ~= ADDITIONAL_POWER_BAR_INDEX and not frame.inVehicle + local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent" + + frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") + frame[type](frame, "UNIT_POWERMAX", self, "Update") + ShadowUF.Layout:SetBarVisibility(frame, "shamanBar", visible) + + if( visible ) then self:Update(frame) end +end + +function Shaman:Update(frame, event, unit, powerType) + if( powerType and powerType ~= "MANA" ) then return end + frame.shamanBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, SPELL_POWER_MANA)) + frame.shamanBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, SPELL_POWER_MANA)) +end diff --git a/options/config.lua b/options/config.lua index d493685d..2329ed7b 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4025,7 +4025,7 @@ local function loadUnitOptions() hidden = function(info) local unit = info[2] if( unit == "global" ) then - return not globalConfig.runeBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.priestBar and not globalConfig.xpBar and not globalConfig.staggerBar + return not globalConfig.runeBar and not globalConfig.totemBar and not globalConfig.druidBar and not globalConfig.priestBar and not globalConfig.shamanBar and not globalConfig.xpBar and not globalConfig.staggerBar else return unit ~= "player" and unit ~= "pet" end @@ -4063,6 +4063,14 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "priestBar.enabled", }, + shamanBar = { + order = 3, + type = "toggle", + name = string.format(L["Enable %s"], L["Shaman mana bar"]), + desc = L["Adds a mana bar to the player frame for elemental and enhancement shamans."], + hidden = hideRestrictedOption, + arg = "shamanBar.enabled", + }, xpBar = { order = 4, type = "toggle", From c4ffbcec600a2d4b9f1775d294b1d4156ca61375 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 15:10:01 +0200 Subject: [PATCH 653/794] Update TOC of the options addon --- options/ShadowedUF_Options.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index d1534654..c62895be 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 60200 +## Interface: 70000 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From d009e13f6d4ffc0b8656a27a8c6420206ea52cee Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 May 2016 15:11:05 +0200 Subject: [PATCH 654/794] Ruby scripts should not be part of the TOC file --- ShadowedUnitFrames.toc | 2 -- 1 file changed, 2 deletions(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index a1f37fc4..87541bda 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -62,6 +62,4 @@ modules\priest.lua modules\shaman.lua #@do-not-package@ options\config.lua -globalcheck.rb -localcheck.rb #@end-do-not-package@ From 6bbb143940f326aac07b71f4cdc83d495a4cc5ad Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 23 May 2016 10:16:47 +0200 Subject: [PATCH 655/794] Replace ruby scripts by a lua script --- .pkgmeta | 3 +- globalcheck.rb | 77 ---------------- localcheck.lua | 246 +++++++++++++++++++++++++++++++++++++++++++++++++ localcheck.rb | 65 ------------- 4 files changed, 247 insertions(+), 144 deletions(-) delete mode 100755 globalcheck.rb create mode 100644 localcheck.lua delete mode 100755 localcheck.rb diff --git a/.pkgmeta b/.pkgmeta index c658dff4..93c40647 100755 --- a/.pkgmeta +++ b/.pkgmeta @@ -29,5 +29,4 @@ externals: tag: latest ignore: - - globalcheck.rb - - localcheck.rb + - localcheck.lua diff --git a/globalcheck.rb b/globalcheck.rb deleted file mode 100755 index 70db0be9..00000000 --- a/globalcheck.rb +++ /dev/null @@ -1,77 +0,0 @@ -# Train against the WoW UI first -path = File.expand_path("../../../../BlizzardInterfaceCode/Interface", __FILE__) - -$ranked = {} -Dir["#{path}/{AddOns,FrameXML}/**/*.lua"].each do |file| - res = `luac -l '#{file}' 2>&1` - if res !~ /^luac/ - res.split("\n\t").each do |line| - _, line, type, offset, target = line.split("\t") - next unless target - - if type == "GETGLOBAL" - target.gsub!(";", "") - target.strip! - - $ranked[target] ||= 0 - $ranked[target] += 1 - end - end - end -end - -# Anything that we don't use enough or WoW doesn't use enough for it to be trained -$blacklisted = ["ShadowUF", "rawset", "rawget", "setfenv", "getfenv", "math", "GetLocale", "UnitReaction", "LibStub", "loadstring", "print", "IsResting", "UnitAura", "UnitIsFriend", "GetComboPoints", "GetEclipseDirection", "UnitIsTapped", "UnitPlayerControlled", "UnitCreatureFamily", "UnitThreatSituation", "UnitClassification", "UnitInPhase", "IsEveryoneAssistant", "UnitStagger", "RegisterUnitWatch", "UnregisterUnitWatch", "UnitIsVisible", "UnitInRange", "CheckInteractDistance", "GetRuneCooldown", "GetRuneType", "GetTotemInfo", "RegisterStateDriver", "ClickCastHeader", "ClickCastFrames", "IsPlayerSpell", "UnitXP", "GetPetExperience", "GetBuildInfo", "CompactPartyFrame", "hooksecurefunc", "TemporaryEnchantFrame", "PriestBarFrame", "PaladinPowerBar", "EclipseBarFrame", "ShardBarFrame", "RuneFrame", "MonkHarmonyBar", "ComboFrame", "QueueStatusFrame", "LoadAddOn", "UnitIsEnemy", "IsUsableSpell"] - -# Filter check -def filtered?(target) - if $ranked[target] and $ranked[target] >= 6 - true - elsif $blacklisted.include?(target) - true - elsif target.gsub(/[^A-Z]/, "").length >= 4 - true - else - false - end -end - -# Check all files for leaked globals -total = 0 -Dir["./**/*.lua"].each do |file| - next if file =~ /localcheck/ - - res = `luac -l #{file} 2>&1` - if res =~ /luac:/ - puts "#{res.gsub("luac:", "").strip}" - next - end - - leaked = [] - res.split("\n\t").each do |line| - _, line, type, offset, target = line.split("\t") - next unless target - next unless type == "SETGLOBAL" or type == "GETGLOBAL" - - target.gsub!(";", "") - target.strip! - next if filtered?(target) - - leaked << {line: line, target: target} - end - - next if leaked.empty? - total += 1 - - puts - puts file - leaked.each do |row| - puts "#{row[:line]} #{row[:target]}" - end -end - -if total == 0 - puts "No leaked globals found!" -end - -File.unlink("./luac.out") rescue nil diff --git a/localcheck.lua b/localcheck.lua new file mode 100644 index 00000000..eb8e2a22 --- /dev/null +++ b/localcheck.lua @@ -0,0 +1,246 @@ +-- If you want to hardcode toc or slug in and not enter it, do so here +local ADDON_SLUG +local TOC_FILE +-- Automatically identify the slug based on the .git or .svn configuration data, change the path if it's not in root, or set to false to disable +local AUTO_IDENTIFY_SLUG = "./" +-- Automatically find the TOC in the given path, set to false to disable +local AUTO_FIND_TOC = "./" +-- Only necessary if you aren't auto identify the slug, curseforge or wowace. +local SITE_LOCATION = nil +-- Personally I keep the api key in another file and just have this reference that to get it +-- If you want to do this, create the file with CURSE_API_KEY = "" in it and set the path here +-- set this to nil and it will ask you for your API key +local API_KEY_FILE = "../TestCode/api-key.lua" +-- Patterns that should not be scrapped, case-insensitive +-- Anything between the no-lib-strip is automatically ignored +local FILE_BLACKLIST = {"^localization", "^lib"} +-- 1 = English +DEFAULT_LANGUAGE = "1" +-- Removes phrases that are not found through this +DELETE_UNIMPORTED = true + +-- No more modifying! +local OS_TYPE = os.getenv("HOME") and "linux" or "windows" + +-- Mak sure we have LuaSockets +local _, http = pcall(require, "socket.http") +local _, ltn = pcall(require, "ltn12") +if( not http ) then + print("Failed to find socket.http, did you install LuaSockets?") +elseif( not ltn ) then + print("Failed to find ltn12, did you install LuaSockets?") +end + + +-- Figure out the API key +if( API_KEY_FILE ) then + local file = io.open(API_KEY_FILE) + if( not file ) then + print(string.format("It appears the API key file %s does not exist.", API_KEY_FILE)) + else + file:close() + dofile(API_KEY_FILE) + + if( not CURSE_API_KEY ) then + print("You did not define CURSE_API_KEY in your key file, make sure it does not have local next to it.") + end + end +end + + +if( not CURSE_API_KEY ) then + while( not CURSE_API_KEY ) do + io.stdout:write("Enter API key: ") + CURSE_API_KEY = io.stdin:read("*line") + CURSE_API_KEY = CURSE_API_KEY ~= "" and CURSE_API_KEY or nil + end +end + +-- Attempt to automatically identify the addon slug +if( AUTO_IDENTIFY_SLUG ) then + local git = io.open(AUTO_IDENTIFY_SLUG .. ".git/config") + local svn = io.open(AUTO_IDENTIFY_SLUG .. ".svn/entries") + + if( git ) then + local contents = git:read("*all") + git:close() + + SITE_LOCATION, ADDON_SLUG = string.match(contents, "git%.([^\n]-)%.com:wow/([^\n]-)/mainline%.git") + elseif( svn ) then + local contents = svn:read("*all") + svn:close() + + SITE_LOCATION, ADDON_SLUG = string.match(contents, "svn%.(.-)%.com/wow/(.-)/mainline") + end + + if( not ADDON_SLUG ) then + print("Failed to identify addon slug.") + elseif( not SITE_LOCATION ) then + print("Failed to identify site location.") + end +end + +if( not SITE_LOCATION ) then + while( not SITE_LOCATION ) do + io.stdout:write("Site location [wowace/curseforge]: ") + SITE_LOCATION = io.stdin:read("*line") + SITE_LOCATION = ( SITE_LOCATION == "wowace" or SITE_LOCATION == "curseforge" ) and SITE_LOCATION or nil + end +end + +-- Manually ask for it +if( not ADDON_SLUG ) then + while( not ADDON_SLUG ) do + io.stdout:write("Enter slug: ") + ADDON_SLUG = io.stdin:read("*line") + ADDON_SLUG = ADDON_SLUG ~= "" and ADDON_SLUG or nil + end +end + +print(string.format("Using addon slug: %s", ADDON_SLUG)) + +-- Find the TOC now +if( AUTO_FIND_TOC ) then + local pipe = OS_TYPE == "windows" and io.popen(string.format("dir /B \"%s\"", AUTO_FIND_TOC)) or io.popen(string.format("ls -1 \"%s\"", AUTO_FIND_TOC)) + if( type(pipe) == "userdata" ) then + for file in pipe:lines() do + if( string.match(file, "(.+)%.toc") ) then + TOC_FILE = file + break + end + end + + pipe:close() + if( not TOC_FILE ) then print("Failed to auto detect toc file.") end + else + print("Failed to auto find toc, cannot run dir /B or ls -1") + end +end + +if( not TOC_FILE ) then + while( not TOC_FILE ) do + io.stdout:write("TOC path: ") + TOC_FILE = io.stdin:read("*line") + TOC_FILE = TOC_FILE ~= "" and TOC_FILE or nil + if( TOC_FILE ) then + local file = io.open(TOC_FILE) + if( file ) then + file:close() + break + else + print(string.format("%s does not exist.", TOC_FILE)) + end + end + end +end + +print(string.format("Using TOC file %s", TOC_FILE)) +print("") + +-- Parse through the TOC file so we know what to scan +local ignore +local localizedKeys = {} +for line in io.lines(TOC_FILE) do + line = string.gsub(line, "\r", "") + + if( string.match(line, "#@no%-lib%-strip@") ) then + ignore = true + elseif( string.match(line, "#@end%-no%-lib%-strip@") ) then + ignore = nil + end + + if( not ignore and string.match(line, "%.lua") and not string.match(line, "^%s*#")) then + -- Make sure it's a valid file + local blacklist + for _, check in pairs(FILE_BLACKLIST) do + if( string.match(string.lower(line), check) ) then + blacklist = true + break + end + end + + -- File checks out, scrap everything + if( not blacklist ) then + -- Fix slashes + if( OS_TYPE == "linux" ) then + line = string.gsub(line, "\\", "/") + end + + local keys = 0 + local contents = io.open(line):read("*all") + + for match in string.gmatch(contents, "L%[\"(.-)%\"]") do + if( not localizedKeys[match] ) then keys = keys + 1 end + localizedKeys[match] = true + end + + print(string.format("%s (%d keys)", line, keys)) + end + end +end + +-- Compile all of the localization we found into string form +local totalLocalizedKeys = 0 +local localization = "" +for key in pairs(localizedKeys) do + localization = string.format("%s\nL[\"%s\"] = true", localization, key, key) + totalLocalizedKeys = totalLocalizedKeys + 1 +end + +if( totalLocalizedKeys == 0 ) then + print("Warning, failed to find any localizations, perhaps you messed up a configuration variable?") + return +end + +print(string.format("Found %d keys total", totalLocalizedKeys)) + +local addonData = { + ["format"] = "lua_additive_table", + ["language"] = DEFAULT_LANGUAGE, + ["delete_unimported"] = DELETE_UNIMPORTED and "y" or "n", + ["text"] = localization, +} + +-- Send it off +local boundary = string.format("-------%s", os.time()) +local source = {} +local body = "" + +for key, data in pairs(addonData) do + body = string.format("%s--%s\r\n", body, boundary) + body = string.format("%sContent-Disposition: form-data; name=\"%s\"\r\n\r\n", body, key) + body = string.format("%s%s\r\n", body, data) +end + +body = string.format("%s--%s\r\n", body, boundary) + +http.request({ + method = "POST", + url = string.format("http://www.%s.com/addons/%s/localization/import/?api-key=%s", SITE_LOCATION, ADDON_SLUG, CURSE_API_KEY), + sink = ltn12.sink.table(source), + source = ltn12.source.string(body), + headers = { + ["Content-Type"] = string.format("multipart/form-data; boundary=\"%s\"", boundary), + ["Content-Length"] = string.len(body), + }, +}) + +local contents = table.concat(source, "\n") +local errors = {} +for line in string.gmatch(contents, "(.-)\n") do + local msg = string.match(line, "(.-)

") + if( msg ) then + table.insert(errors, msg) + end +end + +print("") + +if( #(errors) == 0 ) then + print(string.format("Updated localization for %s on %s!", ADDON_SLUG, SITE_LOCATION)) +else + print("Localization failed:") + for _, line in pairs(errors) do + print(line) + end +end diff --git a/localcheck.rb b/localcheck.rb deleted file mode 100755 index 2cbcc69f..00000000 --- a/localcheck.rb +++ /dev/null @@ -1,65 +0,0 @@ -require "uri" -require "net/http" - -skip = nil -i18n = {} - -toc_file = File.read("./ShadowedUnitFrames.toc") -toc_file.split("\n").each do |line| - # Scan TOC for relevant files that are active - line.strip! - next if line == "" - - if line == '#@no-lib-strip@' - skip = true - elsif line == '#@end-no-lib-strip@' - skip = nil - next - elsif line =~ /^\#/ - next - end - - next if skip || line =~ /^localization/ - - keys = 0 - - # Extract i18n - file = File.read("./#{line.tr("\\", "/")}") - file.scan(/L\["(.+?)"\]/).each do |match| - text = match.first - - i18n[text] = true - keys += 1 - end - - puts "#{line} (#{keys} keys)" -end - -puts "Total #{i18n.length}" -puts - -# Turn it into a lua additive table for uploading -compiled = "" -i18n.each_key do |text| - compiled << "L[\"#{text}\"] = true\n" -end - -# Onward! -URL = URI.parse("http://www.wowace.com/addons/shadowed-unit-frames/localization/import/") - -http = Net::HTTP.new(URL.host, URL.port) - -request = Net::HTTP::Post.new(URL.request_uri) -request.add_field("Referer", "http://www.wowace.com/addons/shadowed-unit-frames/localization/import/") -request.set_form_data( - "api-key" => File.read(File.expand_path("~/.curse-key")).strip, - format: :lua_additive_table, - language: 1, - delete_unimported: "y", - text: compiled -) - -res = http.request(request) -puts res.header.inspect -puts res.code -puts res.body \ No newline at end of file From 50beead8ac306d72d16467c3596f7a25fef98970 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 28 May 2016 19:48:31 +0200 Subject: [PATCH 656/794] Disable numbers on aura indicator cooldowns --- modules/auraindicators.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/auraindicators.lua b/modules/auraindicators.lua index c1d1eaa4..c35fff70 100755 --- a/modules/auraindicators.lua +++ b/modules/auraindicators.lua @@ -63,6 +63,7 @@ function Indicators:OnLayoutApplied(frame) indicator.cooldown = CreateFrame("Cooldown", nil, indicator, "CooldownFrameTemplate") indicator.cooldown:SetReverse(true) indicator.cooldown:SetPoint("CENTER", 0, -1) + indicator.cooldown:SetHideCountdownNumbers(true) indicator.stack = indicator:CreateFontString(nil, "OVERLAY") indicator.stack:SetFont("Interface\\AddOns\\ShadowedUnitFrames\\media\\fonts\\Myriad Condensed Web.ttf", 12, "OUTLINE") From 69607e8debcaaa4f32cd86d0132635d649c90341 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 28 May 2016 19:48:55 +0200 Subject: [PATCH 657/794] Properly use SetColorTexture in aura indicators --- modules/auraindicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auraindicators.lua b/modules/auraindicators.lua index c35fff70..2a6c5cbc 100755 --- a/modules/auraindicators.lua +++ b/modules/auraindicators.lua @@ -219,7 +219,7 @@ function Indicators:UpdateIndicators(frame) indicator.texture:SetTexture(indicator.spellIcon) indicator:SetBackdropColor(0, 0, 0, 0) else - indicator.texture:SetTexture(indicator.colorR, indicator.colorG, indicator.colorB) + indicator.texture:SetColorTexture(indicator.colorR, indicator.colorG, indicator.colorB) indicator:SetBackdropColor(0, 0, 0, 1) end From 98268ceddc04321b4103171065297f40111f9405 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 1 Jun 2016 12:23:34 +0200 Subject: [PATCH 658/794] Update HideBlizzard frames --- ShadowedUnitFrames.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 008e7eeb..f8055cf4 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -686,7 +686,7 @@ function ShadowUF:HideBlizzardFrames() end if( self.db.profile.hidden.buffs and not active_hiddens.buffs ) then - hideBlizzardFrames(false, BuffFrame, TemporaryEnchantFrame, ConsolidatedBuffs) + hideBlizzardFrames(false, BuffFrame, TemporaryEnchantFrame) end if( self.db.profile.hidden.player and not active_hiddens.player ) then @@ -704,7 +704,7 @@ function ShadowUF:HideBlizzardFrames() end if( self.db.profile.hidden.playerPower and not active_hiddens.playerPower ) then - basicHideBlizzardFrames(PriestBarFrame, RuneFrame, WarlockPowerFrame) + basicHideBlizzardFrames(PriestBarFrame, RuneFrame, WarlockPowerFrame, MonkHarmonyBarFrame, PaladinPowerBarFrame, MageArcaneChargesFrame) end if( self.db.profile.hidden.pet and not active_hiddens.pet ) then From 0d5abbc2683869d00f04486f92d914ab105c2fbf Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 1 Jun 2016 12:43:12 +0200 Subject: [PATCH 659/794] Add Arcane Charge module for mages --- ShadowedUnitFrames.lua | 3 + ShadowedUnitFrames.toc | 1 + modules/arcanecharges.lua | 31 ++++++++++ modules/defaultlayout.lua | 2 + options/config.lua | 118 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 155 insertions(+) create mode 100644 modules/arcanecharges.lua diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index f8055cf4..8aa12b87 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -109,11 +109,13 @@ function ShadowUF:CheckUpgrade() self.db.profile.powerColors.FURY = {r = 0.788, g = 0.259, b = 0.992} self.db.profile.powerColors.PAIN = {r = 1, g = 0, b = 0} self.db.profile.powerColors.LUNAR_POWER = {r = 0.30, g = 0.52, b = 0.90} + self.db.profile.powerColors.ARCANECHARGES = {r = 0.1, g = 0.1, b = 0.98} -- new bars local config = self.db.profile.units config.player.priestBar = {enabled = true, background = true, height = 0.40, order = 70} config.player.shamanBar = {enabled = true, background = true, height = 0.40, order = 70} + config.player.arcaneCharges = {enabled = true, anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true} -- clean out old bars config.player.demonicFuryBar = nil @@ -291,6 +293,7 @@ function ShadowUF:LoadUnitDefaults() self.defaults.profile.units.player.xpBar = {enabled = false} self.defaults.profile.units.player.fader = {enabled = false} self.defaults.profile.units.player.soulShards = {enabled = true, isBar = true} + self.defaults.profile.units.player.arcaneCharges = {enabled = true, isBar = true} self.defaults.profile.units.player.staggerBar = {enabled = true} self.defaults.profile.units.player.comboPoints = {enabled = true, isBar = true} self.defaults.profile.units.player.holyPower = {enabled = true, isBar = true} diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 87541bda..c224e4bc 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -60,6 +60,7 @@ modules\monkstagger.lua modules\aurapoints.lua modules\priest.lua modules\shaman.lua +modules\arcanecharges.lua #@do-not-package@ options\config.lua #@end-do-not-package@ diff --git a/modules/arcanecharges.lua b/modules/arcanecharges.lua new file mode 100644 index 00000000..16a7fa1c --- /dev/null +++ b/modules/arcanecharges.lua @@ -0,0 +1,31 @@ +if( not ShadowUF.ComboPoints ) then return end + +local ArcaneCharges = setmetatable({}, {__index = ShadowUF.ComboPoints}) +ShadowUF:RegisterModule(ArcaneCharges, "arcaneCharges", ShadowUF.L["Arcane Charges"], nil, "MAGE", SPEC_MAGE_ARCANE) +local arcaneConfig = {max = 5, key = "arcaneCharges", colorKey = "ARCANECHARGES", powerType = SPELL_POWER_ARCANE_CHARGES, eventType = "ARCANE_CHARGES", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} + +function ArcaneCharges:OnEnable(frame) + frame.arcaneCharges = frame.arcaneCharges or CreateFrame("Frame", nil, frame) + frame.arcaneCharges.cpConfig = arcaneConfig + frame.comboPointType = arcaneConfig.key + + frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") + frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") + frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") + + frame:RegisterUpdateFunc(self, "Update") + frame:RegisterUpdateFunc(self, "UpdateBarBlocks") +end + +function ArcaneCharges:OnLayoutApplied(frame, config) + ShadowUF.ComboPoints.OnLayoutApplied(self, frame, config) + self:UpdateBarBlocks(frame) +end + +function ArcaneCharges:GetComboPointType() + return "arcaneCharges" +end + +function ArcaneCharges:GetPoints(unit) + return UnitPower("player", arcaneConfig.powerType) +end \ No newline at end of file diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 5c7e551c..8999c974 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -156,6 +156,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) HOLYPOWER = {r = 0.95, g = 0.90, b = 0.60}, BANKEDHOLYPOWER = {r = 0.96, g = 0.61, b = 0.84}, SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, + ARCANECHARGES = {r = 0.1, g = 0.1, b = 0.98}, ALTERNATE = {r = 0.815, g = 0.941, b = 1}, CHI = {r = 0.71, g = 1.0, b = 0.92}, FURY = {r = 0.788, g = 0.259, b = 0.992}, @@ -349,6 +350,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) soulShards = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, holyPower = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, chi = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -3, y = 6, size = 14, spacing = -4, growth = "LEFT", isBar = true, showAlways = true}, + arcaneCharges = {anchorTo = "$parent", order = 60, height = 0.40, anchorPoint = "BR", x = -8, y = 6, size = 12, spacing = -2, growth = "LEFT", isBar = true, showAlways = true}, incHeal = {cap = 1}, incAbsorb = {cap = 1}, healAbsorb = {cap = 1}, diff --git a/options/config.lua b/options/config.lua index 2329ed7b..f0176879 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1200,6 +1200,14 @@ local function loadGeneralOptions() arg = "powerColors.SOULSHARDS", hidden = function(info) return select(2, UnitClass("player")) ~= "WARLOCK" end, }, + ARCANECHARGES = { + order = 15, + type = "color", + name = L["Arcane Charges"], + hasAlpha = true, + arg = "powerColors.ARCANECHARGES", + hidden = function(info) return select(2, UnitClass("player")) ~= "MAGE" end, + }, CHI = { order = 17, type = "color", @@ -2902,6 +2910,116 @@ local function loadUnitOptions() }, }, }, + -- ARCANE CHARGES + barArcane = { + order = 4, + type = "group", + inline = true, + name = L["Arcane Charges"], + hidden = function(info) return playerClass ~= "MAGE" or not getVariable(info[2], "arcaneCharges", nil, "isBar") or not getVariable(info[2], nil, nil, "arcaneCharges") end, + args = { + enabled = { + order = 1, + type = "toggle", + name = string.format(L["Enable %s"], L["Arcane Charges"]), + hidden = false, + arg = "arcaneCharges.enabled", + }, + growth = { + order = 2, + type = "select", + name = L["Growth"], + values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"]}, + hidden = false, + arg = "arcaneCharges.growth", + }, + showAlways = { + order = 3, + type = "toggle", + name = L["Don't hide when empty"], + hidden = false, + arg = "arcaneCharges.showAlways", + }, + }, + }, + arcaneCharges = { + order = 4, + type = "group", + inline = true, + name = L["Arcane Charges"], + hidden = function(info) if( info[2] == "global" or getVariable(info[2], "arcaneCharges", nil, "isBar") ) then return true end return hideRestrictedOption(info) end, + args = { + enabled = { + order = 0, + type = "toggle", + name = string.format(L["Enable %s"], L["Arcane Charges"]), + hidden = false, + arg = "arcaneCharges.enabled", + }, + sep1 = { + order = 1, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, + growth = { + order = 2, + type = "select", + name = L["Growth"], + values = {["UP"] = L["Up"], ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["DOWN"] = L["Down"]}, + hidden = false, + arg = "arcaneCharges.growth", + }, + size = { + order = 2, + type = "range", + name = L["Size"], + min = 0, max = 50, step = 1, softMin = 0, softMax = 20, + hidden = hideAdvancedOption, + arg = "arcaneCharges.size", + }, + spacing = { + order = 3, + type = "range", + name = L["Spacing"], + min = -30, max = 30, step = 1, softMin = -15, softMax = 15, + hidden = hideAdvancedOption, + arg = "arcaneCharges.spacing", + }, + sep2 = { + order = 4, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, + anchorPoint = { + order = 5, + type = "select", + name = L["Anchor point"], + values = positionList, + hidden = false, + arg = "arcaneCharges.anchorPoint", + }, + x = { + order = 6, + type = "range", + name = L["X Offset"], + min = -30, max = 30, step = 1, + hidden = false, + arg = "arcaneCharges.x", + }, + y = { + order = 7, + type = "range", + name = L["Y Offset"], + min = -30, max = 30, step = 1, + hidden = false, + arg = "arcaneCharges.y", + }, + }, + }, -- HOLY POWER barHolyPower = { order = 4, From 667b202230e74855c5bbac0be28ed99f6513cfbe Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 21 Jun 2016 09:03:01 +0200 Subject: [PATCH 660/794] Replace all mention of UNIT_COMBO_POINTS --- modules/combopoints.lua | 5 ++--- modules/tags.lua | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 5501c5ac..4c6c8110 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -8,6 +8,7 @@ function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) frame.comboPoints.cpConfig = cpConfig frame:RegisterNormalEvent("UNIT_POWER", self, "Update") + frame:RegisterNormalEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUpdateFunc(self, "Update") end @@ -31,9 +32,7 @@ function Combo:GetPoints(unit) end function Combo:Update(frame, event, unit, powerType) - if( event == "UNIT_COMBO_POINTS" ) then - ShadowUF.ComboPoints.Update(self, frame) - elseif( not event or ( unit == frame.unit or unit == frame.vehicleUnit or unit == "player" or unit == "vehicle" ) ) then + if( not event or ( unit == frame.unit or unit == frame.vehicleUnit or unit == "player" or unit == "vehicle" ) ) then ShadowUF.ComboPoints.Update(self, frame, event, unit, powerType) end end \ No newline at end of file diff --git a/modules/tags.lua b/modules/tags.lua index 2d351e2d..288d126e 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1083,7 +1083,7 @@ Tags.defaultEvents = { ["perpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_CONNECTION", ["status"] = "UNIT_HEALTH UNIT_HEALTH_FREQUENT PLAYER_UPDATE_RESTING UNIT_CONNECTION", ["smartlevel"] = "UNIT_LEVEL PLAYER_LEVEL_UP UNIT_CLASSIFICATION_CHANGED", - ["cpoints"] = "UNIT_COMBO_POINTS PLAYER_TARGET_CHANGED", + ["cpoints"] = "UNIT_POWER_FREQUENT PLAYER_TARGET_CHANGED", ["rare"] = "UNIT_CLASSIFICATION_CHANGED", ["classification"] = "UNIT_CLASSIFICATION_CHANGED", ["shortclassification"] = "UNIT_CLASSIFICATION_CHANGED", @@ -1482,7 +1482,7 @@ local function loadAPIEvents() ["GetRuneCooldown"] = "RUNE_POWER_UPDATE", ["GetRuneType"] = "RUNE_TYPE_UPDATE", ["GetRaidTargetIndex"] = "RAID_TARGET_UPDATE", - ["GetComboPoints"] = "UNIT_COMBO_POINTS", + ["GetComboPoints"] = "UNIT_POWER_FREQUENT", ["GetNumSubgroupMembers"] = "GROUP_ROSTER_UPDATE", ["GetNumGroupMembers"] = "GROUP_ROSTER_UPDATE", ["GetRaidRosterInfo"] = "GROUP_ROSTER_UPDATE", From 33be868e3ac4b8291578c976f6b5e9d7fe5a98d7 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 24 Jun 2016 17:19:30 +0200 Subject: [PATCH 661/794] Remove consolidated buffs --- ShadowedUnitFrames.lua | 5 ++--- modules/auraindicators.lua | 10 +++++----- modules/auras.lua | 13 +++++-------- modules/defaultlayout.lua | 4 ++-- options/config.lua | 8 -------- 5 files changed, 14 insertions(+), 26 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 8aa12b87..3786715a 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -164,7 +164,6 @@ function ShadowUF:CheckUpgrade() aura.show.player = true aura.show.boss = true aura.show.raid = true - aura.show.consolidated = true aura.show.misc = true end end @@ -237,8 +236,8 @@ function ShadowUF:LoadUnitDefaults() highlight = {}, auraIndicators = {enabled = false}, auras = { - buffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, prioritize = true, show = {player = true, boss = true, raid = true, consolidated = true, misc = true}, enlarge = {}, timers = {ALL = true}}, - debuffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, show = {player = true, boss = true, raid = true, consolidated = true, misc = true}, enlarge = {SELF = true}, timers = {ALL = true}}, + buffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, prioritize = true, show = {player = true, boss = true, raid = true, misc = true}, enlarge = {}, timers = {ALL = true}}, + debuffs = {enabled = false, perRow = 10, maxRows = 4, selfScale = 1.30, show = {player = true, boss = true, raid = true, misc = true}, enlarge = {SELF = true}, timers = {ALL = true}}, }, } diff --git a/modules/auraindicators.lua b/modules/auraindicators.lua index 2a6c5cbc..7519fa05 100755 --- a/modules/auraindicators.lua +++ b/modules/auraindicators.lua @@ -101,7 +101,7 @@ local filterMap = {} local canCure = ShadowUF.Units.canCure for _, key in pairs(Indicators.auraFilters) do filterMap[key] = "filter-" .. key end -local function checkFilterAura(frame, type, isFriendly, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) +local function checkFilterAura(frame, type, isFriendly, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) local category if( isFriendly and canCure[auraType] and type == "debuffs" ) then category = "curable" @@ -136,7 +136,7 @@ local function checkFilterAura(frame, type, isFriendly, name, rank, texture, cou return applied end -local function checkSpecificAura(frame, type, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) +local function checkSpecificAura(frame, type, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) -- Not relevant if( not ShadowUF.db.profile.auraIndicators.auras[name] and not ShadowUF.db.profile.auraIndicators.auras[tostring(spellID)] ) then return end @@ -191,12 +191,12 @@ local function scanAuras(frame, filter, type) local index = 0 while( true ) do index = index + 1 - local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff = UnitAura(frame.unit, index, filter) + local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff = UnitAura(frame.unit, index, filter) if( not name ) then return end - local result = checkFilterAura(frame, type, isFriendly, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) + local result = checkFilterAura(frame, type, isFriendly, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) if( not result ) then - checkSpecificAura(frame, type, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) + checkSpecificAura(frame, type, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) end auraList[name] = true diff --git a/modules/auras.lua b/modules/auras.lua index 7acf9bdd..292042b9 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -496,7 +496,7 @@ function Auras:UpdateFilter(frame) frame.auras.blacklist = black and ShadowUF.db.profile.filters.blacklists[black] or filterDefault end -local function categorizeAura(type, curable, auraType, caster, isRemovable, shouldConsolidate, canApplyAura, isBossDebuff) +local function categorizeAura(type, curable, auraType, caster, isRemovable, canApplyAura, isBossDebuff) -- Player casted it if( playerUnits[caster] ) then return "player" @@ -512,21 +512,18 @@ local function categorizeAura(type, curable, auraType, caster, isRemovable, shou -- Can be stolen/purged (dispellable) elseif( type == "debuffs" and isRemovable ) then return "raid" - -- Consolidatable buff - elseif( type == "buffs" and shouldConsolidate ) then - return "consolidated" else return "misc" end end -local function renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) +local function renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) -- Do our initial list check to see if we can quick filter it out if( parent.whitelist[type] and not parent.whitelist[name] and not parent.whitelist[spellID] ) then return end if( parent.blacklist[type] and ( parent.blacklist[name] or parent.blacklist[spellID] ) ) then return end -- Now do our type filter - local category = categorizeAura(type, curable, auraType, caster, isRemovable, shouldConsolidate, canApplyAura, isBossDebuff) + local category = categorizeAura(type, curable, auraType, caster, isRemovable, canApplyAura, isBossDebuff) if( not config.show[category] ) then return end -- Create any buttons we need @@ -591,10 +588,10 @@ local function scan(parent, frame, type, config, displayConfig, filter) local index = 0 while( true ) do index = index + 1 - local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff = UnitAura(frame.parent.unit, index, filter) + local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff = UnitAura(frame.parent.unit, index, filter) if( not name ) then break end - renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) + renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) -- Too many auras shown, break out -- Get down diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 8999c974..3a328f7c 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -235,8 +235,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) config.parentUnit = { portrait = {enabled = false, type = "3D", alignment = "LEFT", width = 0.22, height = 0.50, order = 15, fullBefore = 0, fullAfter = 100}, auras = { - buffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0, show = {player = true, boss = true, raid = true, consolidated = true, misc = true}, enlarge = {}, timers = {ALL = true}}, - debuffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0, show = {player = true, boss = true, raid = true, consolidated = true, misc = true}, enlarge = {SELF = true}, timers = {ALL = true}}, + buffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0, show = {player = true, boss = true, raid = true, misc = true}, enlarge = {}, timers = {ALL = true}}, + debuffs = {enabled = false, anchorPoint = "BL", size = 16, perRow = 10, x = 0, y = 0, show = {player = true, boss = true, raid = true, misc = true}, enlarge = {SELF = true}, timers = {ALL = true}}, }, text = { {width = 0.50, name = L["Left text"], anchorTo = "$healthBar", anchorPoint = "CLI", x = 3, y = 0, size = 0, default = true}, diff --git a/options/config.lua b/options/config.lua index f0176879..c44f6f64 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2150,14 +2150,6 @@ local function loadUnitOptions() desc = L["Whether to show any auras casted by the boss"], width = "full" }, - consolidated = { - order = 4, - type = "toggle", - name = L["Show consolidable auras"], - desc = L["Whether to show any auras that would be consolidated by the default UI."], - hidden = hideBuffOption, - width = "full" - }, misc = { order = 5, type = "toggle", From d25b841c225a252f2c8ad95ceac3e54033a5b32e Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 14 Jul 2016 09:01:11 +0200 Subject: [PATCH 662/794] Bump db revision, now that most changes are in --- ShadowedUnitFrames.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 3786715a..d02a6680 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 56 +ShadowUF.dbRevision = 57 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} From b078f4b72908b7645b742368775166a744fa4b42 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 16 Jul 2016 16:05:50 +0200 Subject: [PATCH 663/794] Update default range checker spells --- modules/range.lua | 82 +++++++++++++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 31 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index 992a9d95..394165ae 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -1,31 +1,44 @@ local Range = { friendly = { - ["PRIEST"] = GetSpellInfo(2061), -- Flash Heal - ["DRUID"] = GetSpellInfo(774), -- Rejuvenation - ["PALADIN"] = GetSpellInfo(85673), -- Word of Glory + ["PRIEST"] = { + (GetSpellInfo(527)), -- Purify + (GetSpellInfo(17)), -- Power Word: Shield + }, + ["DRUID"] = { + (GetSpellInfo(774)), -- Rejuvenation + (GetSpellInfo(2782)), -- Remove Corruption + }, + ["PALADIN"] = GetSpellInfo(19750), -- Flash of Light ["SHAMAN"] = GetSpellInfo(8004), -- Healing Surge ["WARLOCK"] = GetSpellInfo(5697), -- Unending Breath ["DEATHKNIGHT"] = GetSpellInfo(47541), -- Death Coil - ["MAGE"] = GetSpellInfo(475), -- Remove Curse - ["MONK"] = GetSpellInfo(115450) -- Detox + ["MONK"] = GetSpellInfo(115450), -- Detox }, hostile = { - ["WARRIOR"] = GetSpellInfo(355), -- Taunt - ["PRIEST"] = GetSpellInfo(589), -- Shadow Word: Pain - ["DRUID"] = GetSpellInfo(5176), -- Wrath + ["DEATHKNIGHT"] = { + (GetSpellInfo(47541)), -- Death Coil + (GetSpellInfo(49576)), -- Death Grip + }, + ["DEMONHUNTER"] = GetSpellInfo(185123), -- Throw Glaive + ["DRUID"] = GetSpellInfo(8921), -- Moonfire + ["HUNTER"] = { + (GetSpellInfo(193455)), -- Cobra Shot + (GetSpellInfo(19434)), -- Aimed Short + (GetSpellInfo(193265)), -- Hatchet Toss + }, + ["MAGE"] = { + (GetSpellInfo(116)), -- Frostbolt + (GetSpellInfo(30451)), -- Arcane Blast + (GetSpellInfo(133)), -- Fireball + }, + ["MONK"] = GetSpellInfo(115546), -- Provoke ["PALADIN"] = GetSpellInfo(20271), -- Judgement - ["SHAMAN"] = GetSpellInfo(403), -- Lightning Bolt - ["HUNTER"] = GetSpellInfo(75), -- Auto Shot - ["WARLOCK"] = GetSpellInfo(686), -- Shadow Bolt - ["DEATHKNIGHT"] = GetSpellInfo(49576), -- Death Grip - ["MAGE"] = GetSpellInfo(44614), -- Frostfire Bolt + ["PRIEST"] = GetSpellInfo(585), -- Smite ["ROGUE"] = GetSpellInfo(1725), -- Distract - ["MONK"] = GetSpellInfo(115546) -- Provoke + ["SHAMAN"] = GetSpellInfo(403), -- Lightning Bolt + ["WARLOCK"] = GetSpellInfo(689), -- Drain Life + ["WARRIOR"] = GetSpellInfo(355), -- Taunt }, - friendlyAlt = {}, - hostileAlt = { - ["MAGE"] = GetSpellInfo(30451) -- Arcane Blast - } } ShadowUF:RegisterModule(Range, "range", ShadowUF.L["Range indicator"]) @@ -57,19 +70,26 @@ local function checkRange(self) end end -local function updateSpellCache(type) - rangeSpells[type] = nil - if( IsUsableSpell(ShadowUF.db.profile.range[type .. playerClass]) ) then - rangeSpells[type] = ShadowUF.db.profile.range[type .. playerClass] - - elseif( IsUsableSpell(ShadowUF.db.profile.range[type .. "Alt" .. playerClass]) ) then - rangeSpells[type] = ShadowUF.db.profile.range[type .. "Alt" .. playerClass] - - elseif( IsUsableSpell(Range[type][playerClass]) ) then - rangeSpells[type] = Range[type][playerClass] - - elseif( IsUsableSpell(Range[type .. "Alt"][playerClass]) ) then - rangeSpells[type] = Range[type .. "Alt"][playerClass] +local function updateSpellCache(category) + rangeSpells[category] = nil + if( IsUsableSpell(ShadowUF.db.profile.range[category .. playerClass]) ) then + rangeSpells[category] = ShadowUF.db.profile.range[category .. playerClass] + + elseif( IsUsableSpell(ShadowUF.db.profile.range[category .. "Alt" .. playerClass]) ) then + rangeSpells[category] = ShadowUF.db.profile.range[category .. "Alt" .. playerClass] + + elseif( Range[category][playerClass] ) then + if( type(Range[category][playerClass]) == "table" ) then + for i = 1, #Range[category][playerClass] do + local spell = Range[category][playerClass][i] + if( IsUsableSpell(spell) ) then + rangeSpells[category] = spell + break + end + end + elseif( IsUsableSpell(Range[category][playerClass]) ) then + rangeSpells[category] = Range[category][playerClass] + end end end From 86ac5795da4b58065bfd2b88a1cb775f244b5621 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 10:04:14 +0200 Subject: [PATCH 664/794] Update localization script --- localcheck.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localcheck.lua b/localcheck.lua index eb8e2a22..fa8b0214 100644 --- a/localcheck.lua +++ b/localcheck.lua @@ -212,7 +212,7 @@ for key, data in pairs(addonData) do body = string.format("%s%s\r\n", body, data) end -body = string.format("%s--%s\r\n", body, boundary) +body = string.format("%s--%s--\r\n", body, boundary) http.request({ method = "POST", From 5b48de9ba07af694eb7c79a85dc18a0ae4a7c0e6 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 10:12:21 +0200 Subject: [PATCH 665/794] Use CLASS_ICON_TCOORDS instead of CLASS_BUTTONS --- modules/indicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 3a403c40..8fd2787f 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -20,7 +20,7 @@ function Indicators:UpdateClass(frame) local class = frame:UnitClassToken() if( UnitIsPlayer(frame.unit) and class ) then - local coords = CLASS_BUTTONS[class] + local coords = CLASS_ICON_TCOORDS[class] frame.indicators.class:SetTexture("Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes") frame.indicators.class:SetTexCoord(coords[1], coords[2], coords[3], coords[4]) frame.indicators.class:Show() From b7bea7d5d4c57762a1a47a3f29080c8f834a7440 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 11:39:47 +0200 Subject: [PATCH 666/794] Fix range checker options --- options/config.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/options/config.lua b/options/config.lua index c44f6f64..6f075e0b 100755 --- a/options/config.lua +++ b/options/config.lua @@ -469,10 +469,9 @@ local function loadGeneralOptions() ShadowUF.db.profile.range[info[#(info)] .. playerClass] = spell and spell ~= "" and spell or nil ShadowUF.Layout:Reload() end - + local function getRange(info) - local spell = ShadowUF.db.profile.range[info[#(info)] .. playerClass] - return spell and spell ~= "" and spell or ShadowUF.modules.range[info[#(info)]][playerClass] + return ShadowUF.db.profile.range[info[#(info)] .. playerClass] end local function rangeWithIcon(info) @@ -1364,7 +1363,7 @@ local function loadGeneralOptions() help = { order = 0, type = "description", - name = L["This will be set for your current class only."], + name = L["This will be set for your current class only.\nIf no custom spells are set, defaults appropriate for your class will be used."], }, }, }, From 7453907d31463f3f98231fe07fed6f873638169f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 11:45:17 +0200 Subject: [PATCH 667/794] Remove class aura indicators which no longer exist --- ShadowedUnitFrames.lua | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index d02a6680..2dbdd4e6 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -431,27 +431,19 @@ function ShadowUF:LoadUnitDefaults() }, auras = { ["20707"] = [[{indicator = '', group = "Warlock", priority = 10, r = 0.42, g = 0.21, b = 0.65}]], - ["1459"] = [[{indicator = '', group = "Mage", priority = 10, r = 0.10, g = 0.68, b = 0.88}]], ["116849"] = [[{r=0.19607843137255, group="Monk", indicator="c", g=1, player=false, duration=true, b=0.3843137254902, alpha=1, priority=0, icon=true, iconTexture="Interface\\Icons\\ability_monk_chicocoon"}]], - ["1126"] = [[{r=0.47450980392157, group="Druid", indicator="", g=0.2156862745098, player=true, duration=true, missing=true, b=0.81960784313725, priority=0, alpha=1, iconTexture="Interface\\Icons\\Spell_Nature_Regeneration"}]], ["155777"] = [[{r=0.57647058823529, group="Druid", indicator="tr", g=0.28235294117647, player=true, duration=true, b=0.6156862745098, priority=100, alpha=1, iconTexture="Interface\\Icons\\Spell_Nature_Rejuvenation"}]], ["121176"] = [[{alpha=1, b=0, priority=0, r=0.062745098039216, group="PvP Flags", indicator="bl", g=1, iconTexture="Interface\\Icons\\INV_BannerPVP_03"}]], ["19705"] = [[{r=0.80392156862745, group="Food", indicator="", g=0.76470588235294, missing=true, duration=true, priority=0, alpha=1, b=0.24313725490196}]], - ["19740"] = [[{r=0.93333333333333, group="Paladin", indicator="", g=0.84705882352941, selfColor={alpha=1, b=0.18823529411765, g=0.89411764705882, r=0.9843137254902, }, player=false, missing=true, duration=true, alpha=1, priority=0, b=0.15294117647059, iconTexture="Interface\\Icons\\Spell_Holy_GreaterBlessingofKings"}]], ["53563"] = [[{r=0.64313725490196, group="Paladin", indicator="tr", g=0.24705882352941, player=true, alpha=1, b=0.73333333333333, priority=100, duration=false, iconTexture="Interface\\Icons\\Ability_Paladin_BeaconofLight"}]], - ["47753"] = [[{b=0, group="Priest", indicator="br", alpha=1, player=true, duration=true, r=0.8078431372549, priority=0, g=0.76862745098039, iconTexture="Interface\\Icons\\Spell_Holy_DevineAegis"}]], ["774"] = [[{r=0.57647058823529, group="Druid", indicator="tr", g=0.28235294117647, player=true, duration=true, b=0.6156862745098, priority=100, alpha=1, iconTexture="Interface\\Icons\\Spell_Nature_Rejuvenation"}]], ["33206"] = [[{r=0, group="Priest", indicator="c", g=0, b=0, duration=true, priority=0, icon=true, iconTexture="Interface\\Icons\\Spell_Holy_PainSupression"}]], - ["974"] = [[{r=1, group="Shaman", indicator="tr", g=0.65882352941176, player=true, alpha=1, priority=10, b=0.27843137254902, iconTexture="Interface\\Icons\\Spell_Nature_SkinofEarth"}]], ["6788"] = [[{b=0.29019607843137, group="Priest", indicator="tl", alpha=1, player=false, g=0.56862745098039, duration=true, r=0.83921568627451, priority=20, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_AshesToAshes"}]], ["33763"] = [[{r=0.23137254901961, group="Druid", indicator="tl", g=1, player=true, duration=true, alpha=1, priority=0, b=0.2, iconTexture="Interface\\Icons\\INV_Misc_Herb_Felblossom"}]], - ["61316"] = [[{alpha=1, b=1, priority=0, r=0, group="Mage", indicator="", g=0.96078431372549, iconTexture="Interface\\Icons\\Achievement_Dungeon_TheVioletHold_Heroic"}]], ["139"] = [[{r=0.23921568627451, group="Priest", indicator="tr", g=1, player=true, alpha=1, duration=true, b=0.39607843137255, priority=10, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_Renew"}]], ["41635"] = [[{r=1, group="Priest", indicator="br", g=0.90196078431373, missing=false, player=true, duration=false, alpha=1, b=0, priority=50, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_PrayerOfMendingtga"}]], - ["20217"] = [[{r=1, group="Paladin", indicator="", g=0.30196078431373, selfColor={alpha=1, b=0.91764705882353, g=0.058823529411765, r=1, }, player=false, duration=true, missing=true, alpha=1, priority=90, b=0.94117647058824, iconTexture="Interface\\Icons\\Spell_Magic_GreaterBlessingofKings"}]], ["47788"] = [[{r=0, group="Priest", indicator="c", g=0, b=0, duration=true, priority=0, icon=true, iconTexture="Interface\\Icons\\Spell_Holy_GuardianSpirit"}]], ["61295"] = [[{r=0.17647058823529, group="Shaman", indicator="tl", g=0.4, player=true, alpha=1, duration=true, b=1, priority=0, icon=false, iconTexture="Interface\\Icons\\spell_nature_riptide"}]], - ["109773"] = [[{r=0.52941176470588, group="Warlock", indicator="", g=0.12941176470588, alpha=1, b=0.71372549019608, priority=0, missing=true, iconTexture="INTERFACE\\ICONS\\spell_warlock_focusshadow"}]], ["17"] = [[{r=1, group="Priest", indicator="tl", g=0.41960784313725, player=true, alpha=1, duration=true, b=0.5843137254902, priority=0, icon=false, iconTexture="Interface\\Icons\\Spell_Holy_PowerWordShield"}]], ["152118"] = [[{r=1, group="Priest", indicator="tl", g=0.41960784313725, player=true, alpha=1, duration=true, b=0.5843137254902, priority=0, icon=false, iconTexture="Interface\\Icons\\Ability_Priest_ClarityOfWill"}]], ["23335"] = [[{r=0, group="PvP Flags", indicator="bl", g=0, duration=false, b=0, priority=0, icon=true, iconTexture="Interface\\Icons\\INV_BannerPVP_02"}]], @@ -460,19 +452,14 @@ function ShadowUF:LoadUnitDefaults() ["586"] = [[{r=0, group="Priest", indicator="", g=0.85882352941176, selfColor={alpha=1, b=1, g=0.93725490196078, r=0, }, alpha=1, priority=0, b=1, iconTexture="Interface\\Icons\\Spell_Magic_LesserInvisibilty"}]], ["23333"] = [[{icon=true, b=0, priority=0, r=0, group="PvP Flags", indicator="bl", g=0, iconTexture="Interface\\Icons\\INV_BannerPVP_01"}]], ["119611"] = [[{r=0.26274509803922, group="Monk", indicator="tl", g=0.76078431372549, player=true, duration=true, alpha=1, b=0.53725490196078, priority=0, icon=false, iconTexture="Interface\\Icons\\ability_monk_renewingmists"}]], - ["20925"] = [[{r=1, group="Paladin", indicator="tl", g=0.98823529411765, selfColor={b=0.56078431372549, alpha=1, g=0.93725490196078, r=1, }, player=true, duration=true, alpha=1, priority=100, b=0.47450980392157, iconTexture="Interface\\Icons\\Ability_Paladin_BlessedMending"}]], ["8936"] = [[{r=0.12156862745098, group="Druid", indicator="br", g=0.45882352941176, player=true, duration=true, b=0.12156862745098, priority=100, alpha=1, iconTexture="Interface\\Icons\\Spell_Nature_ResistNature"}]], - ["86273"] = [[{b=0, group="Paladin", indicator="br", g=0.45882352941176, player=true, duration=true, r=1, priority=100, alpha=1, iconTexture="Interface\\Icons\\Spell_Holy_Absolution"}]], ["34976"] = [[{r=0, group="PvP Flags", indicator="bl", g=0, player=false, b=0, priority=0, icon=true, iconTexture="Interface\\Icons\\INV_BannerPVP_03"}]], ["121164"] = [[{alpha=1, b=1, priority=0, r=0, group="PvP Flags", indicator="bl", g=0.003921568627451, iconTexture="Interface\\Icons\\INV_BannerPVP_03"}]], ["48438"] = [[{r=0.55294117647059, group="Druid", indicator="31685", g=1, player=true, duration=true, b=0.3921568627451, priority=100, alpha=1, iconTexture="Interface\\Icons\\Ability_Druid_Flourish"}]], ["1022"] = [[{r=0, group="Paladin", indicator="c", g=0, player=false, duration=true, b=0, priority=0, icon=true, iconTexture="Interface\\Icons\\Spell_Holy_SealOfProtection"}]], - ["132120"] = [[{b=0.25098039215686, group="Monk", indicator="tr", g=1, player=true, duration=true, r=0.83137254901961, priority=100, alpha=1, iconTexture="Interface\\Icons\\spell_monk_envelopingmist"}]], ["121175"] = [[{r=1, group="PvP Flags", indicator="bl", g=0.24705882352941, b=0.90196078431373, alpha=1, priority=0, icon=false, iconTexture="Interface\\Icons\\INV_BannerPVP_03"}]], ["64844"] = [[{r=0.67843137254902, group="Priest", indicator="31685", g=0.30588235294118, player=true, alpha=1, priority=0, b=0.14117647058824, iconTexture="Interface\\Icons\\Spell_Holy_DivineProvidence"}]], ["124081"] = [[{r=0.51372549019608, group="Monk", indicator="br", g=1, player=true, duration=true, b=0.90588235294118, alpha=1, priority=100, icon=false, iconTexture="Interface\\Icons\\ability_monk_forcesphere"}]], - ["21562"] = [[{r=1, group="Priest", indicator="", g=1, alpha=1, missing=true, priority=0, b=1, iconTexture="Interface\\Icons\\Spell_Holy_WordFortitude"}]], - ["115921"] = [[{r=0.30980392156863, group="Monk", indicator="", g=0.69411764705882, selfColor={alpha=1, b=0.36078431372549, g=0.71764705882353, r=0.29803921568627, }, missing=true, alpha=1, duration=true, priority=0, b=0.019607843137255, iconTexture="Interface\\Icons\\ability_monk_legacyoftheemperor"}]], ["189895"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\INV_Enchant_VoidSphere\";}", ["189627"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\achievement_zone_cataclysmgreen\";}", ["181306"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Ability_Mage_LivingBomb\";}", From 2e07b9c2d4d129912d884a668c2ceec5d01ae23b Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 11:47:33 +0200 Subject: [PATCH 668/794] Add Druid Innervate aura --- ShadowedUnitFrames.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 2dbdd4e6..9ffdbaae 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -460,6 +460,7 @@ function ShadowUF:LoadUnitDefaults() ["121175"] = [[{r=1, group="PvP Flags", indicator="bl", g=0.24705882352941, b=0.90196078431373, alpha=1, priority=0, icon=false, iconTexture="Interface\\Icons\\INV_BannerPVP_03"}]], ["64844"] = [[{r=0.67843137254902, group="Priest", indicator="31685", g=0.30588235294118, player=true, alpha=1, priority=0, b=0.14117647058824, iconTexture="Interface\\Icons\\Spell_Holy_DivineProvidence"}]], ["124081"] = [[{r=0.51372549019608, group="Monk", indicator="br", g=1, player=true, duration=true, b=0.90588235294118, alpha=1, priority=100, icon=false, iconTexture="Interface\\Icons\\ability_monk_forcesphere"}]], + ["29166"] = [[{r=0, group="Druid", indicator="c", g=0, b=0, duration=true, priority=0, icon=true, iconTexture="Interface\\Icons\\Spell_Nature_Lightning"}]], ["189895"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\INV_Enchant_VoidSphere\";}", ["189627"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\achievement_zone_cataclysmgreen\";}", ["181306"] = "{b=0;g=0;priority=0;r=0;group=\"Hellfire Citadel\";indicator=\"c\";icon=true;iconTexture=\"Interface\\\\Icons\\\\Ability_Mage_LivingBomb\";}", From d61cd61b0d7137be2f3506f3940f8909c9b1d373 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 13:26:07 +0200 Subject: [PATCH 669/794] Properly update combo points on the target frame --- modules/combopoints.lua | 4 ++-- modules/units.lua | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 4c6c8110..20aa4478 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -7,8 +7,8 @@ local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBO function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) frame.comboPoints.cpConfig = cpConfig - frame:RegisterNormalEvent("UNIT_POWER", self, "Update") - frame:RegisterNormalEvent("UNIT_POWER_FREQUENT", self, "Update") + frame:RegisterNormalEvent("UNIT_POWER", self, "Update", "player") + frame:RegisterNormalEvent("UNIT_POWER_FREQUENT", self, "Update", "player") frame:RegisterUpdateFunc(self, "Update") end diff --git a/modules/units.lua b/modules/units.lua index 5c5f41ff..97df6811 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -59,7 +59,7 @@ local function ReregisterUnitEvents(self) end -- Register an event that should always call the frame -local function RegisterNormalEvent(self, event, handler, func) +local function RegisterNormalEvent(self, event, handler, func, unitOverride) -- Make sure the handler/func exists if( not handler[func] ) then error(string.format("Invalid handler/function passed for %s on event %s, the function %s does not exist.", self:GetName() or tostring(self), tostring(event), tostring(func)), 3) @@ -67,7 +67,11 @@ local function RegisterNormalEvent(self, event, handler, func) end if( unitEvents[event] and not ShadowUF.fakeUnits[self.unitRealType] ) then - self:BlizzRegisterUnitEvent(event, self.unitOwner, self.vehicleUnit) + self:BlizzRegisterUnitEvent(event, unitOverride or self.unitOwner, self.vehicleUnit) + if unitOverride then + self.unitEventOverrides = self.unitEventOverrides or {} + self.unitEventOverrides[event] = unitOverride + end else self:RegisterEvent(event) end @@ -200,7 +204,7 @@ end -- Event handling local function OnEvent(self, event, unit, ...) - if( not unitEvents[event] or self.unit == unit ) then + if( not unitEvents[event] or self.unit == unit or (self.unitEventOverrides and self.unitEventOverrides[event] == unit)) then for handler, func in pairs(self.registeredEvents[event]) do handler[func](handler, self, event, unit, ...) end From e8d9f6edda866682fea547bee3161e557afd697e Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 13:38:54 +0200 Subject: [PATCH 670/794] Properly update the max number of combo points on talent/spec changes --- modules/combopoints.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 20aa4478..ab28065e 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -7,10 +7,13 @@ local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBO function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) frame.comboPoints.cpConfig = cpConfig + frame:RegisterNormalEvent("UNIT_POWER", self, "Update", "player") frame:RegisterNormalEvent("UNIT_POWER_FREQUENT", self, "Update", "player") + frame:RegisterNormalEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks", "player") frame:RegisterUpdateFunc(self, "Update") + frame:RegisterUpdateFunc(self, "UpdateBarBlocks") end function Combo:GetComboPointType() From 25d9d8bb914932c2b27ddf97b6df062430ca8eaf Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 14:56:01 +0200 Subject: [PATCH 671/794] Fix deleting aura filter white/black lists --- options/config.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/options/config.lua b/options/config.lua index 6f075e0b..43f100eb 100755 --- a/options/config.lua +++ b/options/config.lua @@ -5119,10 +5119,12 @@ local function loadFilterOptions() ShadowUF.db.profile.filters[filterType][filter] = nil -- Delete anything that used this filter too - local filterList = filterType == "whitelist" and ShadowUF.db.profile.filters.zonewhite or filterType == "blacklist" and ShadowUF.db.profile.filters.zoneblack - for id, filterUsed in pairs(filterList) do - if( filterUsed == filter ) then - filterList[id] = nil + local filterList = filterType == "whitelists" and ShadowUF.db.profile.filters.zonewhite or filterType == "blacklists" and ShadowUF.db.profile.filters.zoneblack + if filterList then + for id, filterUsed in pairs(filterList) do + if( filterUsed == filter ) then + filterList[id] = nil + end end end From 941bca2ca5df3652774620c23e14531794579167 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 15:09:57 +0200 Subject: [PATCH 672/794] Use interact distance on rogues, they don't have a universally usable spell --- modules/range.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/range.lua b/modules/range.lua index 394165ae..1bce9bf8 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -34,7 +34,7 @@ local Range = { ["MONK"] = GetSpellInfo(115546), -- Provoke ["PALADIN"] = GetSpellInfo(20271), -- Judgement ["PRIEST"] = GetSpellInfo(585), -- Smite - ["ROGUE"] = GetSpellInfo(1725), -- Distract + --["ROGUE"] = GetSpellInfo(1725), -- Distract ["SHAMAN"] = GetSpellInfo(403), -- Lightning Bolt ["WARLOCK"] = GetSpellInfo(689), -- Drain Life ["WARRIOR"] = GetSpellInfo(355), -- Taunt From 051ce105fd906acd7878aa3a89e5d1d4a42b926e Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 15:15:51 +0200 Subject: [PATCH 673/794] Fix combo point count after login --- modules/combopoints.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index ab28065e..8111aa69 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -7,6 +7,7 @@ local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBO function Combo:OnEnable(frame) frame.comboPoints = frame.comboPoints or CreateFrame("Frame", nil, frame) frame.comboPoints.cpConfig = cpConfig + cpConfig.max = UnitPowerMax("player", cpConfig.powerType) frame:RegisterNormalEvent("UNIT_POWER", self, "Update", "player") frame:RegisterNormalEvent("UNIT_POWER_FREQUENT", self, "Update", "player") From 69fc7538b41b88790fc0e33243bf6af267774336 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 16:45:10 +0200 Subject: [PATCH 674/794] Fix duplicate table assignments --- modules/defaultlayout.lua | 1 - modules/movers.lua | 1 - 2 files changed, 2 deletions(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 3a328f7c..cb4573d6 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -686,7 +686,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) healAbsorb = {cap = 1}, portrait = {enabled = false, fullAfter = 50}, castBar = {order = 60}, - healAbsorb = {cap = 1}, indicators = { resurrect = {enabled = true, anchorPoint = "LC", size = 28, x = 37, y = -1, anchorTo = "$parent"}, }, diff --git a/modules/movers.lua b/modules/movers.lua index 0a7cd4fb..351e1d32 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -90,7 +90,6 @@ local function createConfigEnv() UnitAffectingCombat = function() return true end, UnitThreatSituation = function() return 0 end, UnitDetailedThreatSituation = function() return nil end, - UnitThreatSituation = function() return 0 end, UnitCastingInfo = function(unit) -- 1 -> 10: spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, notInterruptible local data = unitConfig["UnitCastingInfo" .. unit] or {} From b4bf5bddce4075ed962074e6cdbc9ee5c9739a17 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 16:45:56 +0200 Subject: [PATCH 675/794] Add X-Website TOC tag --- ShadowedUnitFrames.toc | 1 + 1 file changed, 1 insertion(+) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index c224e4bc..a00d2147 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -4,6 +4,7 @@ ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB +## X-Website: http://www.wowace.com/addons/shadowed-unit-frames/ ## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibDualSpec-1.0, Clique #@no-lib-strip@ From c7ac916efc8651f7434311b1a48a1645631fc37a Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 19 Jul 2016 23:31:30 +0200 Subject: [PATCH 676/794] Bail out early with zero combo points --- modules/basecombopoints.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/basecombopoints.lua b/modules/basecombopoints.lua index cacb868a..7e76da94 100644 --- a/modules/basecombopoints.lua +++ b/modules/basecombopoints.lua @@ -40,6 +40,7 @@ end local function createBlocks(config, pointsFrame) local pointsConfig = pointsFrame.cpConfig + if pointsConfig.max == 0 then return end pointsFrame.visibleBlocks = pointsConfig.max -- Position bars, the 5 accounts for borders From 3bf302ad3ba651ca0e3d1bbc029d6d049aa24311 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 21 Jul 2016 09:21:38 +0200 Subject: [PATCH 677/794] Fix curable debuff types for Monks and Paladins --- modules/units.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 97df6811..fdc53b01 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -1488,11 +1488,10 @@ end -- Handle figuring out what auras players can cure local curableSpells = { ["DRUID"] = {[88423] = {"Magic", "Curse", "Poison"}, [2782] = {"Curse", "Poison"}}, - ["MAGE"] = {[475] = {"Curse"}}, ["PRIEST"] = {[527] = {"Magic", "Disease"}, [32375] = {"Magic"}}, - ["PALADIN"] = {[4987] = {"Poison", "Disease"}, [53551] = {"Magic"}}, + ["PALADIN"] = {[4987] = {"Poison", "Disease", "Magic"}, [213644] = {"Poison", "Disease"}}, ["SHAMAN"] = {[77130] = {"Curse", "Magic"}, [51886] = {"Curse"}}, - ["MONK"] = {[115450] = {"Poison", "Disease"}, [115451] = {"Magic"}} + ["MONK"] = {[115450] = {"Poison", "Disease", "Magic"}, [218164] = {"Poison", "Disease"}}, } curableSpells = curableSpells[select(2, UnitClass("player"))] From 4ec9273b695978b0bcfd61df750bc1efe5ed7cec Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 21 Jul 2016 17:47:23 +0200 Subject: [PATCH 678/794] Remove Anticipation from Aura Points The spell was changed and no longer does what it once did. --- modules/aurapoints.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index 2334d56d..9d1d5553 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -2,12 +2,11 @@ local AuraPoints = setmetatable({ isComboPoints = true, spells = { ["MAGE"] = {max = 4, name = GetSpellInfo(36032), filter = "HARMFUL"}, - ["ROGUE"] = {max = 5, name = GetSpellInfo(115189), filter = "HELPFUL"} } }, {__index = ShadowUF.ComboPoints}) local trackSpell = AuraPoints.spells[select(2, UnitClass("player"))] -if( not trackSpell ) then return end +if( not trackSpell or not trackSpell.name ) then return end ShadowUF:RegisterModule(AuraPoints, "auraPoints", ShadowUF.L["Aura Combo Points"]) local auraConfig = {max = trackSpell.max, key = "auraPoints", colorKey = "AURAPOINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} From a487db2f26c43b893d28313043be092619a48a01 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 21 Jul 2016 17:49:34 +0200 Subject: [PATCH 679/794] Disable Mage Arcane Charges Aura Points mode, its handled as a full power now --- modules/aurapoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index 9d1d5553..c05ead44 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -1,7 +1,7 @@ local AuraPoints = setmetatable({ isComboPoints = true, spells = { - ["MAGE"] = {max = 4, name = GetSpellInfo(36032), filter = "HARMFUL"}, + --["MAGE"] = {max = 4, name = GetSpellInfo(36032), filter = "HARMFUL"}, } }, {__index = ShadowUF.ComboPoints}) From bd03b65d304e03326eb75bc85733109e94cd37e0 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 21 Jul 2016 17:57:46 +0200 Subject: [PATCH 680/794] Set a proper default for new powers --- modules/movers.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/movers.lua b/modules/movers.lua index 351e1d32..dd16bfa8 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -72,6 +72,8 @@ local function createConfigEnv() return 5 elseif( powerType == SPELL_POWER_BURNING_EMBERS ) then return MAX_POWER_PER_EMBER * 3 + elseif( powerType == SPELL_POWER_COMBO_POINTS ) then + return 5 elseif( powerType == SPELL_POWER_DEMONIC_FURY ) then return 100 end From 544dc74b2e6577c557cef1777c2c0f90ce4f8503 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 22 Jul 2016 00:29:10 +0200 Subject: [PATCH 681/794] Report proper maximum power values for all power types --- modules/movers.lua | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/movers.lua b/modules/movers.lua index dd16bfa8..320587bd 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -62,20 +62,19 @@ local function createConfigEnv() return getValue("UnitGetTotalAbsorbs", unit, math.random(2500, 5000)) end, UnitPowerMax = function(unit, powerType) - if( powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS ) then - return 3 - elseif( powerType == SPELL_POWER_ECLIPSE ) then + if( powerType == SPELL_POWER_RAGE or powerType == SPELL_POWER_ENERGY or powerType == SPELL_POWER_RUNIC_POWER + or powerType == SPELL_POWER_LUNAR_POWER or powerType == SPELL_POWER_MAELSTROM or powerType == SPELL_POWER_INSANITY + or powerType == SPELL_POWER_FURY or powerType == SPELL_POWER_PAIN ) then return 100 - elseif( powerType == SPELL_POWER_LIGHT_FORCE ) then - return 4 - elseif( powerType == SPELL_POWER_SHADOW_ORBS ) then + elseif( powerType == SPELL_POWER_FOCUS ) then + return 120 + elseif( powerType == SPELL_POWER_COMBO_POINTS or powerType == SPELL_POWER_SOUL_SHARDS or powerType == SPELL_POWER_HOLY_POWER + or powerType == SPELL_POWER_CHI ) then return 5 - elseif( powerType == SPELL_POWER_BURNING_EMBERS ) then - return MAX_POWER_PER_EMBER * 3 - elseif( powerType == SPELL_POWER_COMBO_POINTS ) then - return 5 - elseif( powerType == SPELL_POWER_DEMONIC_FURY ) then - return 100 + elseif( powerType == SPELL_POWER_RUNES ) then + return 6 + elseif( powerType == SPELL_POWER_ARCANE_CHARGES ) then + return 4 end return 50000 From cf6830a62eb966f7b31bf3a2fec0f41d419dddac Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 25 Jul 2016 09:14:13 +0200 Subject: [PATCH 682/794] Fix layout export to properly handle multi-line strings --- options/config.lua | 98 +++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 58 deletions(-) diff --git a/options/config.lua b/options/config.lua index 43f100eb..10857494 100755 --- a/options/config.lua +++ b/options/config.lua @@ -355,6 +355,45 @@ Config.hideBasicOption = hideBasicOption -------------------- -- GENERAL CONFIGURATION --------------------- + +local function writeTable(tbl) + local data = "" + for key, value in pairs(tbl) do + local valueType = type(value) + + -- Wrap the key in brackets if it's a number + if( type(key) == "number" ) then + key = string.format("[%s]", key) + -- Wrap the string with quotes if it has a space in it + elseif( string.match(key, "[%p%s%c]") or string.match(key, "^[0-9]+$") ) then + key = string.format("['%s']", string.gsub(key, "'", "\\'")) + end + + -- foo = {bar = 5} + if( valueType == "table" ) then + data = string.format("%s%s=%s;", data, key, writeTable(value)) + -- foo = true / foo = 5 + elseif( valueType == "number" or valueType == "boolean" ) then + data = string.format("%s%s=%s;", data, key, tostring(value)) + -- foo = "bar" + else + value = tostring(value) + if value and string.match(value, "[\n]") then + local token = "" + while string.find(value, "%["..token.."%[") or string.find(value, "%]"..token.."%]") do + token = token .. "=" + end + value = string.format("[%s[%s]%s]", token, value, token) + else + value = string.format("%q", value) + end + data = string.format("%s%s=%s;", data, key, value) + end + end + + return "{" .. data .. "}" +end + local function loadGeneralOptions() SML = SML or LibStub:GetLibrary("LibSharedMedia-3.0") @@ -490,35 +529,7 @@ local function loadGeneralOptions() end local textData = {} - - local function writeTable(tbl) - local data = "" - for key, value in pairs(tbl) do - local valueType = type(value) - - -- Wrap the key in brackets if it's a number - if( type(key) == "number" ) then - key = string.format("[%s]", key) - -- Wrap the string with quotes if it has a space in it - elseif( string.match(key, "[%p%s%c]") or string.match(key, "^[0-9]+$") ) then - key = string.format("['%s']", string.gsub(key, "'", "\\'")) - end - - -- foo = {bar = 5} - if( valueType == "table" ) then - data = string.format("%s%s=%s;", data, key, writeTable(value)) - -- foo = true / foo = 5 - elseif( valueType == "number" or valueType == "boolean" ) then - data = string.format("%s%s=%s;", data, key, tostring(value)) - -- foo = "bar" - else - data = string.format("%s%s='%s';", data, key, string.gsub(tostring(value), "'", "\\'")) - end - end - - return "{" .. data .. "}" - end - + local layoutData = {positions = true, visibility = true, modules = false} local layoutManager = { type = "group", @@ -6400,35 +6411,6 @@ local function loadAuraIndicatorsOptions() return indicatorList end - - local function writeTable(tbl) - local data = "" - - for key, value in pairs(tbl) do - local valueType = type(value) - - -- Wrap the key in brackets if it's a number - if( type(key) == "number" ) then - key = string.format("[%s]", key) - -- Wrap the string with quotes if it has a space or digits in it - elseif( string.match(key, " ") or string.match(key, "^[0-9]+$") ) then - key = string.format("[\"%s\"]", key) - end - - -- foo = {bar = 5} - if( valueType == "table" ) then - data = string.format("%s%s=%s;", data, key, writeTable(value)) - -- foo = true / foo = 5 - elseif( valueType == "number" or valueType == "boolean" ) then - data = string.format("%s%s=%s;", data, key, tostring(value)) - -- foo = "bar" - else - data = string.format("%s%s=%q;", data, key, tostring(value)) - end - end - - return "{" .. data .. "}" - end local function writeAuraTable(name) ShadowUF.db.profile.auraIndicators.auras[name] = writeTable(Indicators.auraConfig[name]) From c065adc734038c97703a4c4dd23975127a701ecb Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 29 Jul 2016 16:09:30 +0200 Subject: [PATCH 683/794] nil check priority before using it --- modules/auraindicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auraindicators.lua b/modules/auraindicators.lua index 7519fa05..e412d1d3 100755 --- a/modules/auraindicators.lua +++ b/modules/auraindicators.lua @@ -206,7 +206,7 @@ end function Indicators:UpdateIndicators(frame) for key, indicatorConfig in pairs(ShadowUF.db.profile.auraIndicators.indicators) do local indicator = frame.auraIndicators[key] - if( indicator and indicator.enabled and indicator.priority > -1 ) then + if( indicator and indicator.enabled and indicator.priority and indicator.priority > -1 ) then -- Show a cooldown ring if( indicator.showDuration and indicator.spellDuration > 0 and indicator.spellEnd > 0 ) then indicator.cooldown:SetCooldown(indicator.spellEnd - indicator.spellDuration, indicator.spellDuration) From 1a29e2134206f950a3c50d4f02db9e509a018eb5 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 2 Aug 2016 07:51:24 +0200 Subject: [PATCH 684/794] Update localization script to use https --- localcheck.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localcheck.lua b/localcheck.lua index fa8b0214..c09f34b3 100644 --- a/localcheck.lua +++ b/localcheck.lua @@ -23,7 +23,7 @@ DELETE_UNIMPORTED = true local OS_TYPE = os.getenv("HOME") and "linux" or "windows" -- Mak sure we have LuaSockets -local _, http = pcall(require, "socket.http") +local _, http = pcall(require, "ssl.https") local _, ltn = pcall(require, "ltn12") if( not http ) then print("Failed to find socket.http, did you install LuaSockets?") @@ -216,7 +216,7 @@ body = string.format("%s--%s--\r\n", body, boundary) http.request({ method = "POST", - url = string.format("http://www.%s.com/addons/%s/localization/import/?api-key=%s", SITE_LOCATION, ADDON_SLUG, CURSE_API_KEY), + url = string.format("https://www.%s.com/addons/%s/localization/import/?api-key=%s", SITE_LOCATION, ADDON_SLUG, CURSE_API_KEY), sink = ltn12.sink.table(source), source = ltn12.source.string(body), headers = { From aa4fad01ec7e09febe17129ebacf2014abf834f5 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 5 Aug 2016 12:47:58 +0200 Subject: [PATCH 685/794] Some extra safety checks for block handling --- modules/basecombopoints.lua | 2 +- modules/helpers.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/basecombopoints.lua b/modules/basecombopoints.lua index 7e76da94..d06a5dc6 100644 --- a/modules/basecombopoints.lua +++ b/modules/basecombopoints.lua @@ -147,7 +147,7 @@ function Combo:UpdateBarBlocks(frame, event, unit, powerType) pointsFrame.blocks[id]:Show() end - for id=max+1, max do + for id=max+1, #pointsFrame.blocks do pointsFrame.blocks[id]:Hide() end diff --git a/modules/helpers.lua b/modules/helpers.lua index be85304d..0b0d1fd8 100755 --- a/modules/helpers.lua +++ b/modules/helpers.lua @@ -21,7 +21,7 @@ ShadowUF.BlockTimers = BlockTimers; local DynamicBlocks = {} function DynamicBlocks:Inject(module) module.OnLayoutWidgets = function(self, frame) - if( not frame.visibility[module.moduleKey] ) then return end + if( not frame.visibility[module.moduleKey] or not frame[module.moduleKey].blocks) then return end local height = frame[module.moduleKey]:GetHeight() for _, block in pairs(frame[module.moduleKey].blocks) do From b9b945af4eae2060cbd243d1bd6bf39379d9ee92 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 5 Aug 2016 12:51:53 +0200 Subject: [PATCH 686/794] Properly update combopoint derived bars block sizes --- modules/basecombopoints.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/basecombopoints.lua b/modules/basecombopoints.lua index d06a5dc6..470b7c9d 100644 --- a/modules/basecombopoints.lua +++ b/modules/basecombopoints.lua @@ -173,3 +173,13 @@ function Combo:Update(frame, event, unit, powerType) end end end + +function Combo:OnLayoutWidgets(frame) + local key = self:GetComboPointType() + if( not frame.visibility[key] or not ShadowUF.db.profile.units[frame.unitType][key].isBar or not frame[key].blocks) then return end + + local height = frame[key]:GetHeight() + for _, block in pairs(frame[key].blocks) do + block:SetHeight(height) + end +end From 2a9753e3325b25766c92bcbbb9bf33a8fc5723a0 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 5 Aug 2016 13:06:05 +0200 Subject: [PATCH 687/794] Remove wrong condition in druid:absolutepp tag --- modules/tags.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/tags.lua b/modules/tags.lua index 288d126e..b4b6104b 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -911,7 +911,6 @@ Tags.defaultTags = { end]], ["druid:absolutepp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end - if( GetSpecialization() ~= SPEC_MONK_MISTWEAVER ) then return nil end return UnitPower(unit, SPELL_POWER_MANA) end]], From 3612bdfba07ab2fb4f4229ffee0c47dc1801d0f3 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 5 Aug 2016 13:08:32 +0200 Subject: [PATCH 688/794] Fix druid mana tags in balance form --- modules/tags.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index b4b6104b..05844073 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -885,19 +885,19 @@ Tags.defaultTags = { ["druid:curpp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local powerType = UnitPowerType(unit) - if( powerType ~= 1 and powerType ~= 3 ) then return nil end + if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end return ShadowUF:FormatLargeNumber(UnitPower(unit, SPELL_POWER_MANA)) end]], ["druid:abscurpp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local powerType = UnitPowerType(unit) - if( powerType ~= 1 and powerType ~= 3 ) then return nil end + if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end return UnitPower(unit, SPELL_POWER_MANA) end]], ["druid:curmaxpp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local powerType = UnitPowerType(unit) - if( powerType ~= 1 and powerType ~= 3 ) then return nil end + if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end local maxPower = UnitPowerMax(unit, SPELL_POWER_MANA) local power = UnitPower(unit, SPELL_POWER_MANA) @@ -911,6 +911,8 @@ Tags.defaultTags = { end]], ["druid:absolutepp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end + local powerType = UnitPowerType(unit) + if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end return UnitPower(unit, SPELL_POWER_MANA) end]], From 189820454c9b992625dd099d99feb0546fdd7c3f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 5 Aug 2016 13:25:00 +0200 Subject: [PATCH 689/794] Remove outdated class-specific tags --- modules/tags.lua | 65 +++++++----------------------------------------- 1 file changed, 9 insertions(+), 56 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 05844073..16e2ae53 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -778,51 +778,21 @@ Tags.defaultTags = { local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_HOLY_POWER) return points and points > 0 and points end]], - ["priest:shadoworbs"] = [[function(unit, unitOwner) - local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_SHADOW_ORBS) - return points and points > 0 and points - end]], ["monk:chipoints"] = [[function(unit, unitOwner) local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_CHI) return points and points > 0 and points end]], - ["warlock:demonic:perpp"] = [[function(unit, unitOwner) - local maxPower = UnitPowerMax(unit, SPELL_POWER_DEMONIC_FURY) - if( maxPower <= 0 ) then - return nil - elseif( UnitIsDeadOrGhost(unit) or not UnitIsConnected(unit) ) then - return "0%" - end - - return string.format("%d%%", math.floor(UnitPower(unit, SPELL_POWER_DEMONIC_FURY) / maxPower * 100 + 0.5)) - end]], - ["warlock:demonic:maxpp"] = [[function(unit, unitOwner) - local power = UnitPowerMax(unit, SPELL_POWER_DEMONIC_FURY) - if( power <= 0 ) then - return nil - elseif( UnitIsDeadOrGhost(unit) ) then - return 0 - end - - return ShadowUF:FormatLargeNumber(power) - end]], - ["warlock:demonic:curpp"] = [[function(unit, unitOwner) - local power = UnitPower(unit, SPELL_POWER_DEMONIC_FURY) - if( power <= 0 ) then - return nil - elseif( UnitIsDeadOrGhost(unit) ) then - return 0 - end - - return ShadowUF:FormatLargeNumber(power) - end]], ["cpoints"] = [[function(unit, unitOwner) - local points = GetComboPoints(ShadowUF.playerUnit) - if( points == 0 ) then - points = GetComboPoints(ShadowUF.playerUnit, ShadowUF.playerUnit) + if( UnitHasVehicleUI("player") and UnitHasVehiclePlayerFrameUI("player") ) then + local points = GetComboPoints("vehicle") + if( points == 0 ) then + points = GetComboPoints("vehicle", "vehicle") + end + + return points + else + return UnitPower("player", SPELL_POWER_COMBO_POINTS) end - - return points > 0 and points end]], ["smartlevel"] = [[function(unit, unitOwner) local classif = UnitClassification(unit) @@ -1100,11 +1070,7 @@ Tags.defaultEvents = { ["unit:scaled:threat"] = "UNIT_THREAT_SITUATION_UPDATE", ["unit:color:sit"] = "UNIT_THREAT_SITUATION_UPDATE", ["unit:situation"] = "UNIT_THREAT_SITUATION_UPDATE", - ["warlock:demonic:curpp"] = "SUF_POWERTYPE:DEMONIC_FURY UNIT_POWER_FREQUENT", - ["warlock:demonic:maxpp"] = "SUF_POWERTYPE:DEMONIC_FURY UNIT_MAXPOWER", - ["warlock:demonic:perpp"] = "SUF_POWERTYPE:DEMONIC_FURY UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["monk:chipoints"] = "SUF_POWERTYPE:LIGHT_FORCE UNIT_POWER_FREQUENT", - ["priest:shadoworbs"] = "SUF_POWERTYPE:SHADOW_ORBS UNIT_POWER_FREQUENT", } -- Default update frequencies for tag updating, used if it's needed to override the update speed @@ -1189,7 +1155,6 @@ Tags.defaultCategories = { ["druid:abscurpp"] = "classspec", ["druid:curmaxpp"] = "classspec", ["druid:absolutepp"] = "classspec", - ["druid:eclipse"] = "classspec", ["monk:curpp"] = "classspec", ["monk:abscurpp"] = "classspec", ["monk:curmaxpp"] = "classspec", @@ -1208,11 +1173,7 @@ Tags.defaultCategories = { ["unit:color:aggro"] = "threat", ["unit:raid:assist"] = "raid", ["unit:raid:targeting"] = "raid", - ["warlock:demonic:curpp"] = "classspec", - ["warlock:demonic:maxpp"] = "classspec", - ["warlock:demonic:perpp"] = "classspec", ["monk:chipoints"] = "classspec", - ["priest:shadoworbs"] = "classspec", ["monk:stagger"] = "classspec", ["monk:abs:stagger"] = "classspec" } @@ -1304,11 +1265,7 @@ Tags.defaultHelp = { ["color:aggro"] = L["Same as [color:sit] except it only returns red if you have aggro, rather than transiting from yellow -> orange -> red."], ["unit:raid:targeting"] = L["How many people in your raid are targeting the unit, for example if you put this on yourself it will show how many people are targeting you. This includes you in the count!"], ["unit:raid:assist"] = L["How many people are assisting the unit, for example if you put this on yourself it will show how many people are targeting your target. This includes you in the count!"], - ["warlock:demonic:curpp"] = string.format(L["Works the same as [%s], but this is usedd to show Demonic Fury power for Demonology Warlocks."], "curpp"), - ["warlock:demonic:maxpp"] = string.format(L["Works the same as [%s], but this is usedd to show Demonic Fury power for Demonology Warlocks."], "maxpp"), - ["warlock:demonic:perpp"] = string.format(L["Works the same as [%s], but this is usedd to show Demonic Fury power for Demonology Warlocks."], "perpp"), ["monk:chipoints"] = L["How many Chi points you currently have."], - ["priest:shadoworbs"] = L["How many Shadow Orbs you have if you're Shadow"], ["monk:stagger"] = L["Shows the current staggered damage, if 12,000 damage is staggered, shows 12k."], ["monk:abs:stagger"] = L["Shows the absolute staggered damage, if 16,000 damage is staggered, shows 16,000."] } @@ -1399,11 +1356,7 @@ Tags.defaultNames = { ["unit:color:aggro"] = L["Unit color code on aggro"], ["unit:raid:targeting"] = L["Raid targeting unit"], ["unit:raid:assist"] = L["Raid assisting unit"], - ["warlock:demonic:curpp"] = L["Current Demonic Fury (Short)"], - ["warlock:demonic:maxpp"] = L["Max Demonic Fury (Short)"], - ["warlock:demonic:perpp"] = L["Percent Demonic Fury"], ["monk:chipoints"] = L["Chi Points"], - ["priest:shadoworbs"] = L["Shadow Orbs"], ["monk:stagger"] = L["Stagger (Monk)"], ["monk:abs:stagger"] = L["Stagger (Monk/Absolute)"] } From 2e01695c4204dad1c393bd31a5f5f882c90c9de3 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 5 Aug 2016 13:35:20 +0200 Subject: [PATCH 690/794] Monk mana tags are also unused now --- modules/tags.lua | 50 +----------------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 16e2ae53..72b7b830 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -886,38 +886,6 @@ Tags.defaultTags = { return UnitPower(unit, SPELL_POWER_MANA) end]], - ["monk:curpp"] = [[function(unit, unitOwner) - if( select(2, UnitClass(unit)) ~= "MONK" ) then return nil end - if( GetSpecialization() ~= SPEC_MONK_MISTWEAVER ) then return nil end - - return ShadowUF:FormatLargeNumber(UnitPower(unit, SPELL_POWER_MANA)) - end]], - ["monk:abscurpp"] = [[function(unit, unitOwner) - if( select(2, UnitClass(unit)) ~= "MONK" ) then return nil end - if( GetSpecialization() ~= SPEC_MONK_MISTWEAVER ) then return nil end - - return UnitPower(unit, SPELL_POWER_MANA) - end]], - ["monk:curmaxpp"] = [[function(unit, unitOwner) - if( select(2, UnitClass(unit)) ~= "MONK" ) then return nil end - if( GetSpecialization() ~= SPEC_MONK_MISTWEAVER ) then return nil end - - local maxPower = UnitPowerMax(unit, SPELL_POWER_MANA) - local power = UnitPower(unit, SPELL_POWER_MANA) - if( UnitIsDeadOrGhost(unit) ) then - return string.format("0/%s", ShadowUF:FormatLargeNumber(maxPower)) - elseif( maxPower == 0 and power == 0 ) then - return nil - end - - return string.format("%s/%s", ShadowUF:FormatLargeNumber(power), ShadowUF:FormatLargeNumber(maxPower)) - end]], - ["monk:absolutepp"] = [[function(unit, unitOwner) - if( select(2, UnitClass(unit)) ~= "MONK" ) then return nil end - if( GetSpecialization() ~= SPEC_MONK_MISTWEAVER ) then return nil end - - return UnitPower(unit, SPELL_POWER_MANA) - end]], ["per:incheal"] = [[function(unit, unitOwner, fontString) local heal = UnitGetIncomingHeals(unit) local maxHealth = UnitHealthMax(unit) @@ -1031,10 +999,6 @@ Tags.defaultEvents = { ["druid:abscurpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", ["druid:curmaxpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", ["druid:absolutepp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["monk:curpp"] = "SUF_POWERTYPE:LIGHT_FORCE UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", - ["monk:abscurpp"] = "SUF_POWERTYPE:LIGHT_FORCE UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", - ["monk:curmaxpp"] = "SUF_POWERTYPE:LIGHT_FORCE UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["monk:absolutepp"] = "SUF_POWERTYPE:LIGHT_FORCE UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", ["sshards"] = "SUF_POWERTYPE:SOUL_SHARDS UNIT_POWER_FREQUENT", ["hpower"] = "SUF_POWERTYPE:HOLY_POWER UNIT_POWER_FREQUENT", ["level"] = "UNIT_LEVEL UNIT_FACTION PLAYER_LEVEL_UP", @@ -1155,10 +1119,6 @@ Tags.defaultCategories = { ["druid:abscurpp"] = "classspec", ["druid:curmaxpp"] = "classspec", ["druid:absolutepp"] = "classspec", - ["monk:curpp"] = "classspec", - ["monk:abscurpp"] = "classspec", - ["monk:curmaxpp"] = "classspec", - ["monk:absolutepp"] = "classspec", ["sshards"] = "classspec", ["hpower"] = "classspec", ["situation"] = "playerthreat", @@ -1249,10 +1209,6 @@ Tags.defaultHelp = { ["druid:abscurpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "abscurpp"), ["druid:curmaxpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "curmaxpp"), ["druid:absolutepp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "absolutepp"), - ["monk:curpp"] = string.format(L["Works the same as [%s], but this is only shown if you are a Mistweaver Monk."], "currpp"), - ["monk:abscurpp"] = string.format(L["Works the same as [%s], but this is only shown if you are a Mistweaver Monk."], "abscurpp"), - ["monk:curmaxpp"] = string.format(L["Works the same as [%s], but this is only shown if you are a Mistweaver Monk."], "curmaxpp"), - ["monk:absolutepp"] = string.format(L["Works the same as [%s], but this is only shown if you are a Mistweaver Monk."], "absolutepp"), ["situation"] = L["Returns text based on your threat situation with your target: Aggro for Aggro, High for being close to taking aggro, and Medium as a general warning to be wary."], ["color:sit"] = L["Returns a color code of the threat situation with your target: Red for Aggro, Orange for High threat and Yellow to be careful."], ["scaled:threat"] = L["Returns a scaled threat percent of your aggro on your current target, always 0 - 100%."], @@ -1342,11 +1298,7 @@ Tags.defaultNames = { ["druid:curpp"] = L["Current power (Druid)"], ["druid:abscurpp"] = L["Current power (Druid/Absolute)"], ["druid:curmaxpp"] = L["Cur/Max power (Druid)"], - ["druid:absolutepp"] = L["Current health (Druid/Absolute)"], - ["monk:curpp"] = L["Current power (Monk)"], - ["monk:abscurpp"] = L["Current power (Monk/Absolute)"], - ["monk:curmaxpp"] = L["Cur/Max power (Monk)"], - ["monk:absolutepp"] = L["Current health (Monk/Absolute)"], + ["druid:absolutepp"] = L["Cur/Max power (Druid/Absolute)"], ["situation"] = L["Threat situation"], ["color:sit"] = L["Color code for situation"], ["scaled:threat"] = L["Scaled threat percent"], From d2c017ea930e29f89b7b836020364e30eec42dff Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 08:51:23 +0200 Subject: [PATCH 691/794] Safer table access when loading a layout module --- modules/layout.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/layout.lua b/modules/layout.lua index 8e1bbd3b..1f9a9784 100755 --- a/modules/layout.lua +++ b/modules/layout.lua @@ -130,7 +130,8 @@ function Layout:Load(frame) -- Figure out if we're secure locking frame.secureLocked = nil for _, module in pairs(ShadowUF.moduleOrder) do - if( frame.visibility[module.moduleKey] and ShadowUF.db.profile.units[frame.unitType][module.moduleKey].secure and module:SecureLockable() ) then + if( frame.visibility[module.moduleKey] and ShadowUF.db.profile.units[frame.unitType][module.moduleKey] and + ShadowUF.db.profile.units[frame.unitType][module.moduleKey].secure and module:SecureLockable() ) then frame.secureLocked = true break end From bdcbc77baf36e0fe2ead47df5e1ccf19469239a2 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 09:04:55 +0200 Subject: [PATCH 692/794] Implement "Show background" for combo point derived bars (Ticket #962) --- modules/basecombopoints.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/basecombopoints.lua b/modules/basecombopoints.lua index 470b7c9d..d690d874 100644 --- a/modules/basecombopoints.lua +++ b/modules/basecombopoints.lua @@ -56,6 +56,20 @@ local function createBlocks(config, pointsFrame) texture:SetWidth(blockWidth) texture:ClearAllPoints() + if not texture.background and config.background then + texture.background = pointsFrame:CreateTexture(nil, "BORDER") + texture.background:SetHeight(1) + texture.background:SetWidth(1) + texture.background:SetAllPoints(texture) + texture.background:SetHorizTile(false) + texture.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha) + texture.background:SetTexture(ShadowUF.Layout.mediaPath.statusbar) + end + + if texture.background then + texture.background:SetShown(config.background) + end + if( config.growth == "LEFT" ) then if( id > 1 ) then texture:SetPoint("TOPRIGHT", pointsFrame.blocks[id - 1], "TOPLEFT", -1, 0) From a7a1722ec973b3c8bd13031185ea2e678a2d7ae1 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 10:29:39 +0200 Subject: [PATCH 693/794] Increase framelevel of indicators to sit above text tags (Ticket #957) --- modules/auraindicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auraindicators.lua b/modules/auraindicators.lua index e412d1d3..eb18be79 100755 --- a/modules/auraindicators.lua +++ b/modules/auraindicators.lua @@ -52,7 +52,7 @@ function Indicators:OnLayoutApplied(frame) local indicator = frame.auraIndicators["indicator-" .. id] if( not indicator ) then indicator = CreateFrame("Frame", nil, frame.auraIndicators) - indicator:SetFrameLevel(frame.topFrameLevel + 1) + indicator:SetFrameLevel(frame.topFrameLevel + 2) indicator.texture = indicator:CreateTexture(nil, "OVERLAY") indicator.texture:SetPoint("CENTER", indicator) indicator:SetAlpha(indicatorConfig.alpha) From 296f78e82a34065665f3fb0f7e775eeb2d12218b Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 10:36:14 +0200 Subject: [PATCH 694/794] Properly set the frame level of aura frames to allow them to be ontop of any bars --- modules/auras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auras.lua b/modules/auras.lua index 292042b9..456b8699 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -295,7 +295,7 @@ local function updateGroup(self, type, config, reverseConfig) group.type = type group.parent = self group.anchorTo = self - group:SetFrameLevel(5) + group:SetFrameLevel(self.highFrame:GetFrameLevel() + 1) group:Show() -- If debuffs are anchored to buffs, debuffs need to grow however buffs do From 3c5bc90eb383b9c8da95d7bcbd6a500f048edd51 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 11:07:29 +0200 Subject: [PATCH 695/794] Split emptyBar text into Left/Right --- ShadowedUnitFrames.lua | 19 +++++++++++++++++-- modules/defaultlayout.lua | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 9ffdbaae..89409261 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 57 +ShadowUF.dbRevision = 58 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -99,6 +99,20 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision + if( revision <= 57 ) then + for unit, config in pairs(self.db.profile.units) do + if config.text then + for _, text in pairs(config.text) do + if text.anchorTo == "$emptyBar" and text.name == L["Left text"] then + text.width = 0.50 + end + end + -- insert empty bar right text + table.insert(config.text, {width = 0.60, name = L["Right text"], text = "", anchorTo = "$emptyBar", anchorPoint = "CRI", x = -3, y = 0, size = 0, default = true}) + end + end + end + if( revision <= 56 ) then -- new classes self.db.profile.classColors.DEMONHUNTER = {r = 0.64, g = 0.19, b = 0.79} @@ -230,7 +244,8 @@ function ShadowUF:LoadUnitDefaults() {enabled = true, name = L["Right text"], text = "[curmaxhp]", anchorPoint = "C", anchorTo = "$healthBar", size = 0}, {enabled = true, name = L["Left text"], text = "[level] [race]", anchorPoint = "C", anchorTo = "$powerBar", size = 0}, {enabled = true, name = L["Right text"], text = "[curmaxpp]", anchorPoint = "C", anchorTo = "$powerBar", size = 0}, - {enabled = true, name = L["Text"], text = "", anchorTo = "$emptyBar", anchorPoint = "C", size = 0, x = 0, y = 0} + {enabled = true, name = L["Left text"], text = "", anchorTo = "$emptyBar", anchorPoint = "C", size = 0, x = 0, y = 0}, + {enabled = true, name = L["Right text"], text = "", anchorTo = "$emptyBar", anchorPoint = "C", size = 0, x = 0, y = 0}, }, indicators = {raidTarget = {enabled = true, size = 0}}, highlight = {}, diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index cb4573d6..5330564a 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -245,7 +245,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) {width = 0.50, name = L["Left text"], anchorTo = "$powerBar", anchorPoint = "CLI", x = 3, y = 0, size = 0, default = true}, {width = 0.60, name = L["Right text"], anchorTo = "$powerBar", anchorPoint = "CRI", x = -3, y = 0, size = 0, default = true}, - {width = 1, name = L["Text"], anchorTo = "$emptyBar", anchorPoint = "CLI", x = 3, y = 0, size = 0, default = true}, + {width = 0.50, name = L["Left text"], anchorTo = "$emptyBar", anchorPoint = "CLI", x = 3, y = 0, size = 0, default = true}, + {width = 0.60, name = L["Right text"], anchorTo = "$emptyBar", anchorPoint = "CRI", x = -3, y = 0, size = 0, default = true}, }, indicators = { raidTarget = {anchorTo = "$parent", anchorPoint = "C", size = 20, x = 0, y = 0}, From dbaa330b41c3b1c98a31a5c62e9143508d9a27c7 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 12:23:42 +0200 Subject: [PATCH 696/794] Handle class coloring of the pet bar --- modules/health.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/health.lua b/modules/health.lua index 7e36469c..a4978f23 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -86,8 +86,8 @@ function Health:UpdateColor(frame) color = ShadowUF.db.profile.healthColors.hostile end end - elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorType == "class" and ( UnitIsPlayer(unit) or UnitCreatureFamily(unit) ) ) then - local class = UnitCreatureFamily(frame.unit) or frame:UnitClassToken() + elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorType == "class" and (UnitIsPlayer(unit) or unit == "pet") ) then + local class = (unit == "pet") and "PET" or frame:UnitClassToken() color = class and ShadowUF.db.profile.classColors[class] elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorType == "static" ) then color = ShadowUF.db.profile.healthColors.static From 98968f22a0888db0e221e757a7d4d197ffeab21f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 12:28:55 +0200 Subject: [PATCH 697/794] Added a new option to color the health bar of pets by the players class color --- modules/health.lua | 3 +++ options/config.lua | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/health.lua b/modules/health.lua index a4978f23..d9ab8a47 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -89,6 +89,9 @@ function Health:UpdateColor(frame) elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorType == "class" and (UnitIsPlayer(unit) or unit == "pet") ) then local class = (unit == "pet") and "PET" or frame:UnitClassToken() color = class and ShadowUF.db.profile.classColors[class] + elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorType == "playerclass" and unit == "pet") then + local class = select(2, UnitClass("player")) + color = class and ShadowUF.db.profile.classColors[class] elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorType == "static" ) then color = ShadowUF.db.profile.healthColors.static end diff --git a/options/config.lua b/options/config.lua index 10857494..7ea7095d 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4233,7 +4233,13 @@ local function loadUnitOptions() type = "select", name = L["Color health by"], desc = L["Primary means of coloring the health bar, color on aggro and color by reaction will override this if necessary."], - values = {["class"] = L["Class"], ["static"] = L["Static"], ["percent"] = L["Health percent"]}, + values = function(info) + if info[2] == "pet" then + return {["class"] = L["Class"], ["static"] = L["Static"], ["percent"] = L["Health percent"], ["playerclass"] = L["Player Class"]} + else + return {["class"] = L["Class"], ["static"] = L["Static"], ["percent"] = L["Health percent"]} + end + end, arg = "healthBar.colorType", }, reaction = { From 05dcba3d01017f16f3bd5b44c0ca2fbcf98c9dc3 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 12:45:38 +0200 Subject: [PATCH 698/794] Extend owner class coloring to party/raid/arena pets --- modules/health.lua | 14 ++++++++++++++ options/config.lua | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/health.lua b/modules/health.lua index d9ab8a47..ce944606 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -92,6 +92,20 @@ function Health:UpdateColor(frame) elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorType == "playerclass" and unit == "pet") then local class = select(2, UnitClass("player")) color = class and ShadowUF.db.profile.classColors[class] + elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorType == "playerclass" and (frame.unitType == "partypet" or frame.unitType == "raidpet" or frame.unitType == "arenapet") and (frame.parent or frame.unitType == "raidpet") ) then + local unit + if frame.unitType == "raidpet" then + local id = string.match(frame.unit, "raidpet(%d+)") + if id then + unit = "raid" .. id + end + elseif frame.parent then + unit = frame.parent.unit + end + if unit then + local class = select(2, UnitClass(unit)) + color = class and ShadowUF.db.profile.classColors[class] + end elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorType == "static" ) then color = ShadowUF.db.profile.healthColors.static end diff --git a/options/config.lua b/options/config.lua index 7ea7095d..bbd6a8cb 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4234,7 +4234,7 @@ local function loadUnitOptions() name = L["Color health by"], desc = L["Primary means of coloring the health bar, color on aggro and color by reaction will override this if necessary."], values = function(info) - if info[2] == "pet" then + if info[2] == "pet" or info[2] == "partypet" or info[2] == "raidpet" or info[2] == "arenapet" then return {["class"] = L["Class"], ["static"] = L["Static"], ["percent"] = L["Health percent"], ["playerclass"] = L["Player Class"]} else return {["class"] = L["Class"], ["static"] = L["Static"], ["percent"] = L["Health percent"]} From b66bcc2ae880e62b77bc1d3266f549af623b0a48 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 13:30:13 +0200 Subject: [PATCH 699/794] Fix frame level of the incoming heal overlay on inverted bars --- modules/incheal.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/incheal.lua b/modules/incheal.lua index 72ae2338..50604364 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -28,6 +28,8 @@ function IncHeal:OnLayoutApplied(frame) frame:UnregisterSingleEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", self, "UpdateFrame") end + self.frameLevelMod = (ShadowUF.db.profile.units[frame.unitType].healthBar.invert and 0 or 2) + -- Since we're hiding, reset state bar.total = nil From ee8c1a07459bad767a514b26cc35501869bc6203 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 15:50:49 +0200 Subject: [PATCH 700/794] Fix the per:incheal tag --- modules/tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tags.lua b/modules/tags.lua index 72b7b830..34d80fd0 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -889,7 +889,7 @@ Tags.defaultTags = { ["per:incheal"] = [[function(unit, unitOwner, fontString) local heal = UnitGetIncomingHeals(unit) local maxHealth = UnitHealthMax(unit) - return heal and heal > 0 and maxHealth > 0 and string.format("%d%%", (heal / maxHealth)) + return heal and heal > 0 and maxHealth > 0 and string.format("%d%%", (heal / maxHealth) * 100) end]], ["abs:incheal"] = [[function(unit, unitOwner, fontString) local heal = UnitGetIncomingHeals(unit) From 148eb51ae0e9e6f2cfb217c964840390116e2097 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 19:13:15 +0200 Subject: [PATCH 701/794] More framelevel fixes for incoming heal/absorb bars --- modules/healabsorb.lua | 1 + modules/incabsorb.lua | 1 + modules/incheal.lua | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/healabsorb.lua b/modules/healabsorb.lua index 498d2aac..bcfda265 100755 --- a/modules/healabsorb.lua +++ b/modules/healabsorb.lua @@ -3,6 +3,7 @@ ShadowUF:RegisterModule(HealAbsorb, "healAbsorb", ShadowUF.L["Healing absorb"]) function HealAbsorb:OnEnable(frame) frame.healAbsorb = frame.healAbsorb or ShadowUF.Units:CreateBar(frame) + frame.healAbsorb.frameLevelMod = HealAbsorb.frameLevelMod frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") diff --git a/modules/incabsorb.lua b/modules/incabsorb.lua index 0c22b2fd..002f843b 100755 --- a/modules/incabsorb.lua +++ b/modules/incabsorb.lua @@ -3,6 +3,7 @@ ShadowUF:RegisterModule(IncAbsorb, "incAbsorb", ShadowUF.L["Incoming absorbs"]) function IncAbsorb:OnEnable(frame) frame.incAbsorb = frame.incAbsorb or ShadowUF.Units:CreateBar(frame) + frame.incAbsorb.frameLevelMod = IncAbsorb.frameLevelMod frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") diff --git a/modules/incheal.lua b/modules/incheal.lua index 50604364..8710744c 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -4,6 +4,7 @@ ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) function IncHeal:OnEnable(frame) frame.incHeal = frame.incHeal or ShadowUF.Units:CreateBar(frame) + frame.incHeal.frameLevelMod = IncHeal.frameLevelMod frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") @@ -28,7 +29,7 @@ function IncHeal:OnLayoutApplied(frame) frame:UnregisterSingleEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", self, "UpdateFrame") end - self.frameLevelMod = (ShadowUF.db.profile.units[frame.unitType].healthBar.invert and 0 or 2) + self.frameLevelMod = bar.frameLevelMod - (ShadowUF.db.profile.units[frame.unitType].healthBar.invert and 3 or 0) -- Since we're hiding, reset state bar.total = nil From 1a3d839067eacc492773f1f30acd46ae2216cb89 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 19:13:30 +0200 Subject: [PATCH 702/794] Properly calculate the size of the incoming heal overlay --- modules/incheal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index 8710744c..d73fcd94 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -115,7 +115,7 @@ function IncHeal:PositionBar(frame, incAmount) else local maxHealth = UnitHealthMax(frame.unit) local healthSize = bar.healthSize * (maxHealth > 0 and health / maxHealth or 0) - local incSize = bar.healthSize * (health > 0 and incAmount / health or 0) + local incSize = bar.healthSize * (maxHealth > 0 and incAmount / maxHealth or 0) if( (healthSize + incSize) > bar.maxSize ) then incSize = bar.cappedSize From 03d697847f47fc5d2abfac87e5b9e352560fc947 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 20:39:09 +0200 Subject: [PATCH 703/794] Fix condition for capping the size of the incheal bar --- modules/incheal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index d73fcd94..d2b7cd3a 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -118,7 +118,7 @@ function IncHeal:PositionBar(frame, incAmount) local incSize = bar.healthSize * (maxHealth > 0 and incAmount / maxHealth or 0) if( (healthSize + incSize) > bar.maxSize ) then - incSize = bar.cappedSize + incSize = bar.maxSize - healthSize end if( bar.orientation == "HORIZONTAL" ) then From 9d4d03aa85ce735488a2457f29e39e40df48dd56 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 8 Aug 2016 22:06:34 +0200 Subject: [PATCH 704/794] Remove now-unused variable --- modules/incheal.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index d2b7cd3a..33c0cb36 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -83,7 +83,6 @@ function IncHeal:OnLayoutApplied(frame) end bar.positionMod = bar.reverseFill and -1 or 1 - bar.cappedSize = bar.healthSize * (cap - 1) bar.maxSize = bar.healthSize * cap end end From a58daedaa38d5cd9aee63ad122405752e44411d5 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 9 Aug 2016 12:45:07 +0200 Subject: [PATCH 705/794] Remove obsolete banked holypower handling --- modules/holypower.lua | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/modules/holypower.lua b/modules/holypower.lua index 83526a2a..47e58583 100755 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -22,27 +22,6 @@ function HolyPower:OnLayoutApplied(frame, config) self:UpdateBarBlocks(frame) end -function HolyPower:UpdateBarBlocks(frame, event, unit, powerType) - local pointsFrame = frame[self:GetComboPointType()] - if( not pointsFrame or ( event and powerType ~= holyConfig.eventType ) ) then return end - - ShadowUF.ComboPoints.UpdateBarBlocks(self, frame) - - local config = ShadowUF.db.profile.units[frame.unitType].holyPower - local color = ShadowUF.db.profile.powerColors["BANKEDHOLYPOWER"] - - local max = UnitPowerMax("player", holyConfig.powerType) - if( max == 5 ) then - for id=4, 5 do - if( config.isBar ) then - pointsFrame.blocks[id]:SetVertexColor(color.r, color.g, color.b) - else - pointsFrame.icons[id]:SetVertexColor(color.r, color.g, color.b) - end - end - end -end - function HolyPower:GetComboPointType() return "holyPower" end From 250cdc54ac7021137d14a19c7d04736b0b4aac08 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 9 Aug 2016 12:53:30 +0200 Subject: [PATCH 706/794] Remove more remnants of obsolete power types --- modules/defaultlayout.lua | 1 - options/config.lua | 8 -------- 2 files changed, 9 deletions(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 5330564a..bf197beb 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -154,7 +154,6 @@ function ShadowUF:LoadDefaultLayout(useMerge) MAELSTROM = {r = 0.00, g = 0.50, b = 1.00}, LUNAR_POWER = {r = 0.30, g = 0.52, b = 0.90}, HOLYPOWER = {r = 0.95, g = 0.90, b = 0.60}, - BANKEDHOLYPOWER = {r = 0.96, g = 0.61, b = 0.84}, SOULSHARDS = {r = 0.58, g = 0.51, b = 0.79}, ARCANECHARGES = {r = 0.1, g = 0.1, b = 0.98}, ALTERNATE = {r = 0.815, g = 0.941, b = 1}, diff --git a/options/config.lua b/options/config.lua index bbd6a8cb..09995cc2 100755 --- a/options/config.lua +++ b/options/config.lua @@ -1194,14 +1194,6 @@ local function loadGeneralOptions() arg = "powerColors.HOLYPOWER", hidden = function(info) return select(2, UnitClass("player")) ~= "PALADIN" end, }, - BANKEDHOLYPOWER = { - order = 13, - type = "color", - name = L["Banked Holy Power"], - hasAlpha = true, - arg = "powerColors.BANKEDHOLYPOWER", - hidden = function(info) return select(2, UnitClass("player")) ~= "PALADIN" end, - }, SOULSHARDS = { order = 14, type = "color", From 1a1e620be75c0f14b238341e8e27f5f80f396be9 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 10 Aug 2016 08:43:12 +0200 Subject: [PATCH 707/794] incheal: Always check the maxHealth and bail out early if its not set --- modules/incheal.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/incheal.lua b/modules/incheal.lua index 33c0cb36..b8b54b9b 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -103,18 +103,24 @@ function IncHeal:PositionBar(frame, incAmount) return end + local maxHealth = UnitHealthMax(frame.unit) + if( maxHealth <= 0 ) then + bar.total = nil + bar:Hide() + return + end + if( not bar.total ) then bar:Show() end bar.total = incAmount -- When the primary bar has an alpha of 100%, we can cheat and do incoming heals easily. Otherwise we need to do it a more complex way to keep it looking good if( bar.simple ) then bar.total = health + incAmount - bar:SetMinMaxValues(0, UnitHealthMax(frame.unit) * (ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap or 1.30)) + bar:SetMinMaxValues(0, maxHealth * (ShadowUF.db.profile.units[frame.unitType][self.frameKey].cap or 1.30)) bar:SetValue(bar.total) else - local maxHealth = UnitHealthMax(frame.unit) - local healthSize = bar.healthSize * (maxHealth > 0 and health / maxHealth or 0) - local incSize = bar.healthSize * (maxHealth > 0 and incAmount / maxHealth or 0) + local healthSize = bar.healthSize * (health / maxHealth) + local incSize = bar.healthSize * (incAmount / maxHealth) if( (healthSize + incSize) > bar.maxSize ) then incSize = bar.maxSize - healthSize From 221467ea1b6fb702023b3e512d14b212d63aba30 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 10 Aug 2016 12:00:01 +0200 Subject: [PATCH 708/794] incheal: fix framelevel in a few cases and simplify frame level handling --- modules/healabsorb.lua | 1 - modules/incabsorb.lua | 1 - modules/incheal.lua | 5 +---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/healabsorb.lua b/modules/healabsorb.lua index bcfda265..498d2aac 100755 --- a/modules/healabsorb.lua +++ b/modules/healabsorb.lua @@ -3,7 +3,6 @@ ShadowUF:RegisterModule(HealAbsorb, "healAbsorb", ShadowUF.L["Healing absorb"]) function HealAbsorb:OnEnable(frame) frame.healAbsorb = frame.healAbsorb or ShadowUF.Units:CreateBar(frame) - frame.healAbsorb.frameLevelMod = HealAbsorb.frameLevelMod frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") diff --git a/modules/incabsorb.lua b/modules/incabsorb.lua index 002f843b..0c22b2fd 100755 --- a/modules/incabsorb.lua +++ b/modules/incabsorb.lua @@ -3,7 +3,6 @@ ShadowUF:RegisterModule(IncAbsorb, "incAbsorb", ShadowUF.L["Incoming absorbs"]) function IncAbsorb:OnEnable(frame) frame.incAbsorb = frame.incAbsorb or ShadowUF.Units:CreateBar(frame) - frame.incAbsorb.frameLevelMod = IncAbsorb.frameLevelMod frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") diff --git a/modules/incheal.lua b/modules/incheal.lua index b8b54b9b..cc620f5c 100755 --- a/modules/incheal.lua +++ b/modules/incheal.lua @@ -4,7 +4,6 @@ ShadowUF:RegisterModule(IncHeal, "incHeal", ShadowUF.L["Incoming heals"]) function IncHeal:OnEnable(frame) frame.incHeal = frame.incHeal or ShadowUF.Units:CreateBar(frame) - frame.incHeal.frameLevelMod = IncHeal.frameLevelMod frame:RegisterUnitEvent("UNIT_MAXHEALTH", self, "UpdateFrame") frame:RegisterUnitEvent("UNIT_HEALTH", self, "UpdateFrame") @@ -29,8 +28,6 @@ function IncHeal:OnLayoutApplied(frame) frame:UnregisterSingleEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", self, "UpdateFrame") end - self.frameLevelMod = bar.frameLevelMod - (ShadowUF.db.profile.units[frame.unitType].healthBar.invert and 3 or 0) - -- Since we're hiding, reset state bar.total = nil @@ -63,7 +60,7 @@ function IncHeal:OnLayoutApplied(frame) bar:SetPoint("BOTTOM" .. point, frame.healthBar) else bar.simple = nil - bar:SetFrameLevel(frame.topFrameLevel - self.frameLevelMod) + bar:SetFrameLevel(frame.topFrameLevel - self.frameLevelMod + 3) bar:SetWidth(1) bar:SetMinMaxValues(0, 1) bar:SetValue(1) From a839e9ccf07f6e0e59a5dfdc907b92debb6eac25 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 12 Aug 2016 09:15:11 +0200 Subject: [PATCH 709/794] Update power statusbar and tags after repopping at a spirit healer This uses the deprecated UNIT_MANA event, since its the only one that actually fires in that instance and seems vaguely related. --- modules/power.lua | 3 +++ modules/tags.lua | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/modules/power.lua b/modules/power.lua index 411c28b8..27dc6839 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -13,6 +13,9 @@ function Power:OnEnable(frame) frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdateColor") frame:RegisterUnitEvent("UNIT_CLASSIFICATION_CHANGED", self, "UpdateClassification") + -- UNIT_MANA fires after repopping at a spirit healer, make sure to update powers then + frame:RegisterUnitEvent("UNIT_MANA", self, "Update") + frame:RegisterUpdateFunc(self, "UpdateClassification") frame:RegisterUpdateFunc(self, "UpdateColor") frame:RegisterUpdateFunc(self, "Update") diff --git a/modules/tags.lua b/modules/tags.lua index 34d80fd0..c23a96a0 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -68,6 +68,11 @@ function Tags:RegisterEvents(parent, fontString, tags) else parent:RegisterNormalEvent(event, fontString, "UpdateTags") end + + -- register UNIT_MANA event since its the only event that fires after repopping at a spirit healer + if event == "UNIT_POWER" or event == "UNIT_POWER_FREQUENT" then + parent:RegisterUnitEvent("UNIT_MANA", fontString, "UpdateTags") + end end end end From eeb706287a37faf2b0c184a2d1899a5608b822c9 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 13 Aug 2016 08:50:06 +0200 Subject: [PATCH 710/794] Added a new option to change the color of the healthbar if the unit has a curable debuff --- modules/health.lua | 32 +++++++++++++++++++++++++++++++- options/config.lua | 19 ++++++++++++++----- 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/modules/health.lua b/modules/health.lua index ce944606..17d8a148 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -1,5 +1,6 @@ local Health = {} ShadowUF:RegisterModule(Health, "healthBar", ShadowUF.L["Health bar"], true) +local canCure = ShadowUF.Units.canCure local function getGradientColor(unit) local maxHealth = UnitHealthMax(unit) @@ -41,7 +42,12 @@ function Health:OnEnable(frame) if( frame.unit == "pet" ) then frame:RegisterUnitEvent("UNIT_POWER", self, "UpdateColor") end - + + if ( ShadowUF.db.profile.units[frame.unitType].healthBar.colorDispel ) then + frame:RegisterNormalEvent("UNIT_AURA", self, "UpdateAura") + frame:RegisterUpdateFunc(self, "UpdateAura") + end + frame:RegisterUpdateFunc(self, "UpdateColor") frame:RegisterUpdateFunc(self, "Update") end @@ -50,6 +56,28 @@ function Health:OnDisable(frame) frame:UnregisterAll(self) end +function Health:UpdateAura(frame) + local hadDebuff = frame.healthBar.hasDebuff + frame.healthBar.hasDebuff = nil + if( UnitIsFriend(frame.unit, "player") ) then + local id = 0 + while( true ) do + id = id + 1 + local name, _, _, _, auraType = UnitDebuff(frame.unit, id) + if( not name ) then break end + + if( canCure[auraType] ) then + frame.healthBar.hasDebuff = auraType + break + end + end + end + + if hadDebuff ~= frame.healthBar.hasDebuff then + self:UpdateColor(frame) + end +end + function Health:UpdateColor(frame) frame.healthBar.hasReaction = nil frame.healthBar.hasPercent = nil @@ -62,6 +90,8 @@ function Health:UpdateColor(frame) frame.healthBar.wasOffline = true frame:SetBarColor("healthBar", ShadowUF.db.profile.healthColors.offline.r, ShadowUF.db.profile.healthColors.offline.g, ShadowUF.db.profile.healthColors.offline.b) return + elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorDispel and frame.healthBar.hasDebuff ) then + color = DebuffTypeColor[frame.healthBar.hasDebuff] elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorAggro and UnitThreatSituation(frame.unit) == 3 ) then frame:SetBarColor("healthBar", ShadowUF.db.profile.healthColors.aggro.r, ShadowUF.db.profile.healthColors.aggro.g, ShadowUF.db.profile.healthColors.aggro.b) return diff --git a/options/config.lua b/options/config.lua index 09995cc2..80240610 100755 --- a/options/config.lua +++ b/options/config.lua @@ -229,7 +229,7 @@ local function setVariable(unit, moduleKey, moduleSubKey, key, value) end local function specialRestricted(unit, moduleKey, moduleSubKey, key) - if( ShadowUF.fakeUnits[unit] and ( key == "colorAggro" or key == "aggro" or moduleKey == "incHeal" or moduleKey == "healAbsorb" or moduleKey == "incAbsorb" or moduleKey == "castBar" ) ) then + if( ShadowUF.fakeUnits[unit] and ( key == "colorAggro" or key == "aggro" or key == "colorDispel" or moduleKey == "incHeal" or moduleKey == "healAbsorb" or moduleKey == "incAbsorb" or moduleKey == "castBar" ) ) then return true elseif( moduleKey == "healthBar" and unit == "player" and key == "reaction" ) then return true @@ -313,7 +313,7 @@ local function hideRestrictedOption(info) elseif( ( key == "incHeal" and not ShadowUF.modules.incHeal ) or ( key == "incAbsorb" and not ShadowUF.modules.incAbsorb ) or ( key == "healAbsorb" and not ShadowUF.modules.healAbsorb ) ) then return true -- Non-standard units do not support color by aggro or incoming heal - elseif( key == "colorAggro" or key == "incHeal" or key == "incAbsorb" or key == "aggro" ) then + elseif( key == "colorAggro" or key == "colorDispel" or key == "incHeal" or key == "incAbsorb" or key == "aggro" ) then return string.match(unit, "%w+target" ) -- Fall back for indicators, no variable table so it shouldn't be shown elseif( info[#(info) - 1] == "indicators" ) then @@ -4219,9 +4219,18 @@ local function loadUnitOptions() desc = L["Changes the health bar to the set hostile color (Red by default) when the unit takes aggro."], arg = "healthBar.colorAggro", hidden = hideRestrictedOption, - }, - healthColor = { + }, + colorDispel = { order = 5, + type = "toggle", + name = L["Color on curable debuff"], + desc = L["Changes the health bar to the color of any curable debuff."], + arg = "healthBar.colorDispel", + hidden = hideRestrictedOption, + width = "full", + }, + healthColor = { + order = 6, type = "select", name = L["Color health by"], desc = L["Primary means of coloring the health bar, color on aggro and color by reaction will override this if necessary."], @@ -4235,7 +4244,7 @@ local function loadUnitOptions() arg = "healthBar.colorType", }, reaction = { - order = 6, + order = 7, type = "select", name = L["Color by reaction on"], desc = L["When to color the health bar by the units reaction, overriding the color health by option."], From 34c61f6ad87a78f64c7cfc04bc8036cb35a051a2 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 13 Aug 2016 09:08:38 +0200 Subject: [PATCH 711/794] Use RegisterUnitEvent for UNIT_AURA --- modules/health.lua | 2 +- modules/highlight.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/health.lua b/modules/health.lua index 17d8a148..4771daf2 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -44,7 +44,7 @@ function Health:OnEnable(frame) end if ( ShadowUF.db.profile.units[frame.unitType].healthBar.colorDispel ) then - frame:RegisterNormalEvent("UNIT_AURA", self, "UpdateAura") + frame:RegisterUnitEvent("UNIT_AURA", self, "UpdateAura") frame:RegisterUpdateFunc(self, "UpdateAura") end diff --git a/modules/highlight.lua b/modules/highlight.lua index f024b481..bbe09546 100755 --- a/modules/highlight.lua +++ b/modules/highlight.lua @@ -87,7 +87,7 @@ function Highlight:OnEnable(frame) end if( ShadowUF.db.profile.units[frame.unitType].highlight.debuff ) then - frame:RegisterNormalEvent("UNIT_AURA", self, "UpdateAura") + frame:RegisterUnitEvent("UNIT_AURA", self, "UpdateAura") frame:RegisterUpdateFunc(self, "UpdateAura") end From 412626d336941af7d0d32a8937d1f3293344bbdb Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 13 Aug 2016 11:09:51 +0200 Subject: [PATCH 712/794] Add a smart hostfile/friendly aura filter --- modules/auras.lua | 2 +- options/config.lua | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 456b8699..067e3543 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -524,7 +524,7 @@ local function renderAura(parent, frame, type, config, displayConfig, index, fil -- Now do our type filter local category = categorizeAura(type, curable, auraType, caster, isRemovable, canApplyAura, isBossDebuff) - if( not config.show[category] ) then return end + if( not config.show[category] and (not config.show.relevant or (type == "debuffs") ~= isFriendly) ) then return end -- Create any buttons we need frame.totalAuras = frame.totalAuras + 1 diff --git a/options/config.lua b/options/config.lua index 80240610..74f3e41d 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2158,7 +2158,14 @@ local function loadUnitOptions() name = L["Show any other auras"], desc = L["Whether to show auras that do not fall into the above categories."], width = "full" - } + }, + relevant = { + order = 6, + type = "toggle", + name = L["Smart Friendly/Hostile Filter"], + desc = L["Only apply the selected filters to buffs on friendly units and debuffs on hostile units, and otherwise show all auras."], + width = "full" + }, } }, display = { From 23205989578fd747b36298c4b2219215e6a132db Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 13 Aug 2016 15:43:36 +0200 Subject: [PATCH 713/794] Add safety checks to ensure aura config is setup properly --- modules/auraindicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auraindicators.lua b/modules/auraindicators.lua index eb18be79..07d3dc69 100755 --- a/modules/auraindicators.lua +++ b/modules/auraindicators.lua @@ -265,7 +265,7 @@ function Indicators:UpdateAuras(frame) -- Check for any indicators that are triggered due to something missing for name in pairs(ShadowUF.db.profile.auraIndicators.missing) do - if( not auraList[name] ) then + if( not auraList[name] and self.auraConfig[name] ) then local aura = self.auraConfig[name] local indicator = frame.auraIndicators[aura.indicator] if( indicator and indicator.enabled and aura.priority > indicator.priority and not ShadowUF.db.profile.auraIndicators.disabled[playerClass][name] ) then From 1d9a25a193496468860b10b50dd97627e05091a0 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 13 Aug 2016 15:55:05 +0200 Subject: [PATCH 714/794] Fix deleting the last aura from a group --- options/config.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index 74f3e41d..646601a2 100755 --- a/options/config.lua +++ b/options/config.lua @@ -6642,7 +6642,8 @@ local function loadAuraIndicatorsOptions() for groupID, name in pairs(groupMap) do if( not groupList[name] ) then unitTable.args[tostring(groupID)] = nil - options.args.auraIndicators.args.auras.args[tostring(groupID)] = nil + options.args.auraIndicators.args.units.args.global.args.groups.args[tostring(groupID)] = nil + options.args.auraIndicators.args.auras.args.groups.args[tostring(groupID)] = nil groupMap[groupID] = nil end end From d187a88319f3aa04a95c4d45b01b9b0c2b9fbb14 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 13 Aug 2016 22:19:41 +0200 Subject: [PATCH 715/794] Force a power update on PLAYER_UNGHOST to catch resurrecting after a corpse run --- modules/power.lua | 5 +++++ modules/tags.lua | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/modules/power.lua b/modules/power.lua index 27dc6839..2abffb15 100755 --- a/modules/power.lua +++ b/modules/power.lua @@ -13,6 +13,11 @@ function Power:OnEnable(frame) frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "UpdateColor") frame:RegisterUnitEvent("UNIT_CLASSIFICATION_CHANGED", self, "UpdateClassification") + -- run an update after returning to life + if ( frame.unit == "player" ) then + frame:RegisterNormalEvent("PLAYER_UNGHOST", self, "Update") + end + -- UNIT_MANA fires after repopping at a spirit healer, make sure to update powers then frame:RegisterUnitEvent("UNIT_MANA", self, "Update") diff --git a/modules/tags.lua b/modules/tags.lua index c23a96a0..5a0dcf63 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -72,6 +72,10 @@ function Tags:RegisterEvents(parent, fontString, tags) -- register UNIT_MANA event since its the only event that fires after repopping at a spirit healer if event == "UNIT_POWER" or event == "UNIT_POWER_FREQUENT" then parent:RegisterUnitEvent("UNIT_MANA", fontString, "UpdateTags") + + if ( parent.unit == "player" ) then + parent:RegisterNormalEvent("PLAYER_UNGHOST", fontString, "UpdateTags") + end end end end From a0f76bf3b0c660038a07f75b7d0d354c6c89c8b1 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 14 Aug 2016 01:05:52 +0200 Subject: [PATCH 716/794] Add a new set of mana:*pp tags to always show current mana The normal *pp tags always show the primary power type, like Insanity or Maelstrom on S-Priests and Shamans. These tags allow getting a clear mana value. --- modules/tags.lua | 84 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 81 insertions(+), 3 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 5a0dcf63..25fc8280 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -861,6 +861,60 @@ Tags.defaultTags = { return nil end]], + ["mana:curpp"] = [[function(unit, unitOwner) + if( UnitPowerMax(unit, SPELL_POWER_MANA) <= 0 ) then + return nil + elseif( UnitIsDeadOrGhost(unit) ) then + return 0 + end + + return ShadowUF:FormatLargeNumber(UnitPower(unit, SPELL_POWER_MANA)) + end]], + ["mana:abscurpp"] = [[function(unit, unitOwner) + if( UnitPowerMax(unit, SPELL_POWER_MANA) <= 0 ) then + return nil + elseif( UnitIsDeadOrGhost(unit) ) then + return 0 + end + + return UnitPower(unit, SPELL_POWER_MANA) + end]], + ["mana:maxpp"] = [[function(unit, unitOwner) + local power = UnitPowerMax(unit, SPELL_POWER_MANA) + if( power <= 0 ) then + return nil + elseif( UnitIsDeadOrGhost(unit) ) then + return 0 + end + + return ShadowUF:FormatLargeNumber(power) + end]], + ["mana:absmaxpp"] = [[function(unit, unitOwner) + local power = UnitPowerMax(unit, SPELL_POWER_MANA) + return power > 0 and power or nil + end]], + ["mana:absolutepp"] = [[function(unit, unitOwner) + local maxPower = UnitPowerMax(unit, SPELL_POWER_MANA) + local power = UnitPower(unit, SPELL_POWER_MANA) + if( UnitIsDeadOrGhost(unit) ) then + return string.format("0/%s", maxPower) + elseif( maxPower <= 0 ) then + return nil + end + + return string.format("%s/%s", power, maxPower) + end]], + ["mana:curmaxpp"] = [[function(unit, unitOwner) + local maxPower = UnitPowerMax(unit, SPELL_POWER_MANA) + local power = UnitPower(unit, SPELL_POWER_MANA) + if( UnitIsDeadOrGhost(unit) ) then + return string.format("0/%s", ShadowUF:FormatLargeNumber(maxPower)) + elseif( maxPower <= 0 ) then + return nil + end + + return string.format("%s/%s", ShadowUF:FormatLargeNumber(power), ShadowUF:FormatLargeNumber(maxPower)) + end]], ["druid:curpp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local powerType = UnitPowerType(unit) @@ -1004,6 +1058,12 @@ Tags.defaultEvents = { ["curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["absolutepp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["smart:curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", + ["mana:curpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["mana:abscurpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["mana:maxpp"] = "SUF_POWERTYPE:MANA UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["mana:absmaxpp"] = "SUF_POWERTYPE:MANA UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["mana:absolutepp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["mana:curmaxpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", ["druid:curpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", ["druid:abscurpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", ["druid:curmaxpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", @@ -1144,7 +1204,13 @@ Tags.defaultCategories = { ["unit:raid:targeting"] = "raid", ["monk:chipoints"] = "classspec", ["monk:stagger"] = "classspec", - ["monk:abs:stagger"] = "classspec" + ["monk:abs:stagger"] = "classspec", + ["mana:curpp"] = "classspec", + ["mana:abscurpp"] = "classspec", + ["mana:maxpp"] = "classspec", + ["mana:absmaxpp"] = "classspec", + ["mana:absolutepp"] = "classspec", + ["mana:curmaxpp"] = "classspec", } -- Default tag help @@ -1232,7 +1298,13 @@ Tags.defaultHelp = { ["unit:raid:assist"] = L["How many people are assisting the unit, for example if you put this on yourself it will show how many people are targeting your target. This includes you in the count!"], ["monk:chipoints"] = L["How many Chi points you currently have."], ["monk:stagger"] = L["Shows the current staggered damage, if 12,000 damage is staggered, shows 12k."], - ["monk:abs:stagger"] = L["Shows the absolute staggered damage, if 16,000 damage is staggered, shows 16,000."] + ["monk:abs:stagger"] = L["Shows the absolute staggered damage, if 16,000 damage is staggered, shows 16,000."], + ["mana:curpp"] = string.format(L["Works the same as [%s], but always shows mana, irregardless of the current primary power type."], "curpp"), + ["mana:abscurpp"] = string.format(L["Works the same as [%s], but always shows mana, irregardless of the current primary power type."], "abscurpp"), + ["mana:maxpp"] = string.format(L["Works the same as [%s], but always shows mana, irregardless of the current primary power type."], "maxpp"), + ["mana:absmaxpp"] = string.format(L["Works the same as [%s], but always shows mana, irregardless of the current primary power type."], "absmaxpp"), + ["mana:absolutepp"] = string.format(L["Works the same as [%s], but always shows mana, irregardless of the current primary power type."], "absolutepp"), + ["mana:curmaxpp"] = string.format(L["Works the same as [%s], but always shows mana, irregardless of the current primary power type."], "curmaxpp"), } Tags.defaultNames = { @@ -1319,7 +1391,13 @@ Tags.defaultNames = { ["unit:raid:assist"] = L["Raid assisting unit"], ["monk:chipoints"] = L["Chi Points"], ["monk:stagger"] = L["Stagger (Monk)"], - ["monk:abs:stagger"] = L["Stagger (Monk/Absolute)"] + ["monk:abs:stagger"] = L["Stagger (Monk/Absolute)"], + ["mana:curpp"] = L["Current power (Mana)"], + ["mana:abscurpp"] = L["Current power (Mana/Absolute)"], + ["mana:maxpp"] = L["Max power (Mana)"], + ["mana:absmaxpp"] = L["Max power (Mana/Absolute)"], + ["mana:absolutepp"] = L["Cur/Max power (Mana/Absolute)"], + ["mana:curmaxpp"] = L["Cur/Max power (Mana)"], } -- List of event types From d38c6e54537359d0a791cd1b6114225567f4661e Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 14 Aug 2016 01:52:33 +0200 Subject: [PATCH 717/794] Revert "Add a new set of mana:*pp tags to always show current mana" This reverts commit a0f76bf3b0c660038a07f75b7d0d354c6c89c8b1. --- modules/tags.lua | 84 ++---------------------------------------------- 1 file changed, 3 insertions(+), 81 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index 25fc8280..5a0dcf63 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -861,60 +861,6 @@ Tags.defaultTags = { return nil end]], - ["mana:curpp"] = [[function(unit, unitOwner) - if( UnitPowerMax(unit, SPELL_POWER_MANA) <= 0 ) then - return nil - elseif( UnitIsDeadOrGhost(unit) ) then - return 0 - end - - return ShadowUF:FormatLargeNumber(UnitPower(unit, SPELL_POWER_MANA)) - end]], - ["mana:abscurpp"] = [[function(unit, unitOwner) - if( UnitPowerMax(unit, SPELL_POWER_MANA) <= 0 ) then - return nil - elseif( UnitIsDeadOrGhost(unit) ) then - return 0 - end - - return UnitPower(unit, SPELL_POWER_MANA) - end]], - ["mana:maxpp"] = [[function(unit, unitOwner) - local power = UnitPowerMax(unit, SPELL_POWER_MANA) - if( power <= 0 ) then - return nil - elseif( UnitIsDeadOrGhost(unit) ) then - return 0 - end - - return ShadowUF:FormatLargeNumber(power) - end]], - ["mana:absmaxpp"] = [[function(unit, unitOwner) - local power = UnitPowerMax(unit, SPELL_POWER_MANA) - return power > 0 and power or nil - end]], - ["mana:absolutepp"] = [[function(unit, unitOwner) - local maxPower = UnitPowerMax(unit, SPELL_POWER_MANA) - local power = UnitPower(unit, SPELL_POWER_MANA) - if( UnitIsDeadOrGhost(unit) ) then - return string.format("0/%s", maxPower) - elseif( maxPower <= 0 ) then - return nil - end - - return string.format("%s/%s", power, maxPower) - end]], - ["mana:curmaxpp"] = [[function(unit, unitOwner) - local maxPower = UnitPowerMax(unit, SPELL_POWER_MANA) - local power = UnitPower(unit, SPELL_POWER_MANA) - if( UnitIsDeadOrGhost(unit) ) then - return string.format("0/%s", ShadowUF:FormatLargeNumber(maxPower)) - elseif( maxPower <= 0 ) then - return nil - end - - return string.format("%s/%s", ShadowUF:FormatLargeNumber(power), ShadowUF:FormatLargeNumber(maxPower)) - end]], ["druid:curpp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local powerType = UnitPowerType(unit) @@ -1058,12 +1004,6 @@ Tags.defaultEvents = { ["curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["absolutepp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", ["smart:curmaxpp"] = "SUF_POWERTYPE:CURRENT UNIT_POWER_FREQUENT UNIT_MAXPOWER", - ["mana:curpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", - ["mana:abscurpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", - ["mana:maxpp"] = "SUF_POWERTYPE:MANA UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["mana:absmaxpp"] = "SUF_POWERTYPE:MANA UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["mana:absolutepp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", - ["mana:curmaxpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", ["druid:curpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", ["druid:abscurpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", ["druid:curmaxpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", @@ -1204,13 +1144,7 @@ Tags.defaultCategories = { ["unit:raid:targeting"] = "raid", ["monk:chipoints"] = "classspec", ["monk:stagger"] = "classspec", - ["monk:abs:stagger"] = "classspec", - ["mana:curpp"] = "classspec", - ["mana:abscurpp"] = "classspec", - ["mana:maxpp"] = "classspec", - ["mana:absmaxpp"] = "classspec", - ["mana:absolutepp"] = "classspec", - ["mana:curmaxpp"] = "classspec", + ["monk:abs:stagger"] = "classspec" } -- Default tag help @@ -1298,13 +1232,7 @@ Tags.defaultHelp = { ["unit:raid:assist"] = L["How many people are assisting the unit, for example if you put this on yourself it will show how many people are targeting your target. This includes you in the count!"], ["monk:chipoints"] = L["How many Chi points you currently have."], ["monk:stagger"] = L["Shows the current staggered damage, if 12,000 damage is staggered, shows 12k."], - ["monk:abs:stagger"] = L["Shows the absolute staggered damage, if 16,000 damage is staggered, shows 16,000."], - ["mana:curpp"] = string.format(L["Works the same as [%s], but always shows mana, irregardless of the current primary power type."], "curpp"), - ["mana:abscurpp"] = string.format(L["Works the same as [%s], but always shows mana, irregardless of the current primary power type."], "abscurpp"), - ["mana:maxpp"] = string.format(L["Works the same as [%s], but always shows mana, irregardless of the current primary power type."], "maxpp"), - ["mana:absmaxpp"] = string.format(L["Works the same as [%s], but always shows mana, irregardless of the current primary power type."], "absmaxpp"), - ["mana:absolutepp"] = string.format(L["Works the same as [%s], but always shows mana, irregardless of the current primary power type."], "absolutepp"), - ["mana:curmaxpp"] = string.format(L["Works the same as [%s], but always shows mana, irregardless of the current primary power type."], "curmaxpp"), + ["monk:abs:stagger"] = L["Shows the absolute staggered damage, if 16,000 damage is staggered, shows 16,000."] } Tags.defaultNames = { @@ -1391,13 +1319,7 @@ Tags.defaultNames = { ["unit:raid:assist"] = L["Raid assisting unit"], ["monk:chipoints"] = L["Chi Points"], ["monk:stagger"] = L["Stagger (Monk)"], - ["monk:abs:stagger"] = L["Stagger (Monk/Absolute)"], - ["mana:curpp"] = L["Current power (Mana)"], - ["mana:abscurpp"] = L["Current power (Mana/Absolute)"], - ["mana:maxpp"] = L["Max power (Mana)"], - ["mana:absmaxpp"] = L["Max power (Mana/Absolute)"], - ["mana:absolutepp"] = L["Cur/Max power (Mana/Absolute)"], - ["mana:curmaxpp"] = L["Cur/Max power (Mana)"], + ["monk:abs:stagger"] = L["Stagger (Monk/Absolute)"] } -- List of event types From 4a3d3fc81a54203bfded9d2c1fa2f2e8796e97f5 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 14 Aug 2016 02:04:06 +0200 Subject: [PATCH 718/794] Add sec:curpp/abscurpp/curmaxpp/absolutepp tags, a generic version of the druid:* tags --- modules/tags.lua | 78 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/modules/tags.lua b/modules/tags.lua index 5a0dcf63..968da05e 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -895,6 +895,72 @@ Tags.defaultTags = { return UnitPower(unit, SPELL_POWER_MANA) end]], + ["sec:curpp"] = [[function(unit, unitOwner) + local class = select(2, UnitClass(unit)) + local powerType = UnitPowerType(unit) + if( class == "DRUID" ) then + if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end + elseif( class == "PRIEST" ) then + if( powerType ~= SPELL_POWER_INSANITY ) then return nil end + elseif( class == "SHAMAN" ) then + if( powerType ~= SPELL_POWER_MAELSTROM ) then return nil end + else + return nil + end + return ShadowUF:FormatLargeNumber(UnitPower(unit, SPELL_POWER_MANA)) + end]], + ["sec:abscurpp"] = [[function(unit, unitOwner) + local class = select(2, UnitClass(unit)) + local powerType = UnitPowerType(unit) + if( class == "DRUID" ) then + if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end + elseif( class == "PRIEST" ) then + if( powerType ~= SPELL_POWER_INSANITY ) then return nil end + elseif( class == "SHAMAN" ) then + if( powerType ~= SPELL_POWER_MAELSTROM ) then return nil end + else + return nil + end + return UnitPower(unit, SPELL_POWER_MANA) + end]], + ["sec:curmaxpp"] = [[function(unit, unitOwner) + local class = select(2, UnitClass(unit)) + local powerType = UnitPowerType(unit) + if( class == "DRUID" ) then + if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end + elseif( class == "PRIEST" ) then + if( powerType ~= SPELL_POWER_INSANITY ) then return nil end + elseif( class == "SHAMAN" ) then + if( powerType ~= SPELL_POWER_MAELSTROM ) then return nil end + else + return nil + end + + local maxPower = UnitPowerMax(unit, SPELL_POWER_MANA) + local power = UnitPower(unit, SPELL_POWER_MANA) + if( UnitIsDeadOrGhost(unit) ) then + return string.format("0/%s", ShadowUF:FormatLargeNumber(maxPower)) + elseif( maxPower == 0 and power == 0 ) then + return nil + end + + return string.format("%s/%s", ShadowUF:FormatLargeNumber(power), ShadowUF:FormatLargeNumber(maxPower)) + end]], + ["sec:absolutepp"] = [[function(unit, unitOwner) + local class = select(2, UnitClass(unit)) + local powerType = UnitPowerType(unit) + if( class == "DRUID" ) then + if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end + elseif( class == "PRIEST" ) then + if( powerType ~= SPELL_POWER_INSANITY ) then return nil end + elseif( class == "SHAMAN" ) then + if( powerType ~= SPELL_POWER_MAELSTROM ) then return nil end + else + return nil + end + + return UnitPower(unit, SPELL_POWER_MANA) + end]], ["per:incheal"] = [[function(unit, unitOwner, fontString) local heal = UnitGetIncomingHeals(unit) local maxHealth = UnitHealthMax(unit) @@ -1008,6 +1074,10 @@ Tags.defaultEvents = { ["druid:abscurpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", ["druid:curmaxpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", ["druid:absolutepp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["sec:curpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["sec:abscurpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER", + ["sec:curmaxpp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", + ["sec:absolutepp"] = "SUF_POWERTYPE:MANA UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_DISPLAYPOWER", ["sshards"] = "SUF_POWERTYPE:SOUL_SHARDS UNIT_POWER_FREQUENT", ["hpower"] = "SUF_POWERTYPE:HOLY_POWER UNIT_POWER_FREQUENT", ["level"] = "UNIT_LEVEL UNIT_FACTION PLAYER_LEVEL_UP", @@ -1128,6 +1198,10 @@ Tags.defaultCategories = { ["druid:abscurpp"] = "classspec", ["druid:curmaxpp"] = "classspec", ["druid:absolutepp"] = "classspec", + ["sec:curpp"] = "classspec", + ["sec:abscurpp"] = "classspec", + ["sec:curmaxpp"] = "classspec", + ["sec:absolutepp"] = "classspec", ["sshards"] = "classspec", ["hpower"] = "classspec", ["situation"] = "playerthreat", @@ -1218,6 +1292,10 @@ Tags.defaultHelp = { ["druid:abscurpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "abscurpp"), ["druid:curmaxpp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "curmaxpp"), ["druid:absolutepp"] = string.format(L["Works the same as [%s], but this is only shown if the unit is in Cat or Bear form."], "absolutepp"), + ["sec:curpp"] = string.format(L["Works the same as [%s], but always shows mana and is only shown if mana is a secondary power."], "curpp"), + ["sec:abscurpp"] = string.format(L["Works the same as [%s], but always shows mana and is only shown if mana is a secondary power."], "abscurpp"), + ["sec:curmaxpp"] = string.format(L["Works the same as [%s], but always shows mana and is only shown if mana is a secondary power."], "curmaxpp"), + ["sec:absolutepp"] = string.format(L["Works the same as [%s], but always shows mana and is only shown if mana is a secondary power."], "absolutepp"), ["situation"] = L["Returns text based on your threat situation with your target: Aggro for Aggro, High for being close to taking aggro, and Medium as a general warning to be wary."], ["color:sit"] = L["Returns a color code of the threat situation with your target: Red for Aggro, Orange for High threat and Yellow to be careful."], ["scaled:threat"] = L["Returns a scaled threat percent of your aggro on your current target, always 0 - 100%."], From bd1742162f476838d6d13a11b7df915b38294d2c Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 14 Aug 2016 02:18:57 +0200 Subject: [PATCH 719/794] Add missing tag name entries --- modules/tags.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/tags.lua b/modules/tags.lua index 968da05e..e88e80d0 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -1386,6 +1386,10 @@ Tags.defaultNames = { ["druid:abscurpp"] = L["Current power (Druid/Absolute)"], ["druid:curmaxpp"] = L["Cur/Max power (Druid)"], ["druid:absolutepp"] = L["Cur/Max power (Druid/Absolute)"], + ["sec:curpp"] = L["Current power (Secondary)"], + ["sec:abscurpp"] = L["Current power (Secondary/Absolute)"], + ["sec:curmaxpp"] = L["Cur/Max power (Secondary)"], + ["sec:absolutepp"] = L["Cur/Max power (Secondary/Absolute)"], ["situation"] = L["Threat situation"], ["color:sit"] = L["Color code for situation"], ["scaled:threat"] = L["Scaled threat percent"], From 705d692c128d5bede0a3279f7de2a01af5e804e9 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 17 Aug 2016 11:22:38 +0200 Subject: [PATCH 720/794] Cleanup text tags a bit more to avoid errors and restore consistency --- ShadowedUnitFrames.lua | 40 +++++++++++++++++++++++---------------- modules/defaultlayout.lua | 30 +++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 89409261..0436063e 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -5,7 +5,7 @@ ShadowUF = select(2, ...) local L = ShadowUF.L -ShadowUF.dbRevision = 58 +ShadowUF.dbRevision = 59 ShadowUF.playerUnit = "player" ShadowUF.enabledUnits = {} ShadowUF.modules = {} @@ -99,16 +99,35 @@ end function ShadowUF:CheckUpgrade() local revision = self.db.profile.revision or self.dbRevision - if( revision <= 57 ) then + if( revision <= 58 ) then for unit, config in pairs(self.db.profile.units) do if config.text then - for _, text in pairs(config.text) do + local i = 1 + while i <= #config.text do + local text = config.text[i] if text.anchorTo == "$emptyBar" and text.name == L["Left text"] then text.width = 0.50 end + if text.anchorTo == "$demonicFuryBar" or text.anchorTo == "$eclipseBar" or text.anchorTo == "$burningEmbersBar" or text.anchorTo == "$monkBar" then + table.remove(config.text, i) + elseif i > 6 and text.default and text.anchorTo == "$emptyBar" then + table.remove(config.text, i) + else + i = i + 1 + end + end + + if not config.text[6] or config.text[6].anchorTo ~= "$emptyBar" then + table.insert(config.text, 6, {enabled = true, width = 0.60, name = L["Right text"], text = "", anchorTo = "$emptyBar", anchorPoint = "CRI", size = 0, x = -3, y = 0, default = true}) + else + config.text[6].width = 0.60 + config.text[6].name = L["Right text"] + config.text[6].anchorPoint = "CRI" + config.text[6].size = 0 + config.text[6].x = -3 + config.text[6].y = 0 + config.text[6].default = true end - -- insert empty bar right text - table.insert(config.text, {width = 0.60, name = L["Right text"], text = "", anchorTo = "$emptyBar", anchorPoint = "CRI", x = -3, y = 0, size = 0, default = true}) end end end @@ -139,15 +158,6 @@ function ShadowUF:CheckUpgrade() config.player.monkBar = nil end - if( revision <= 53 ) then - for i=1, #(self.db.profile.units.player.text) do - if( self.db.profile.units.player.text[i].anchorTo == "$eclipseBar" ) then - table.remove(self.db.profile.units.player.text, i) - break - end - end - end - if( revision <= 49 ) then ShadowUF:LoadDefaultLayout(true) end @@ -317,8 +327,6 @@ function ShadowUF:LoadUnitDefaults() table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) - table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) - table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}) -- PET self.defaults.profile.units.pet.enabled = true diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index bf197beb..24986564 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -299,6 +299,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = "[(()afk() )][name]"}, + {text = ""}, }, }, raidpet = { @@ -329,6 +330,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = "[name]"}, + {text = ""}, }, }, player = { @@ -367,6 +369,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[perpp]"}, {text = "[curmaxpp]"}, {text = "[(()afk() )][name][( ()group())]"}, + {text = ""}, {enabled = true, width = 1, name = L["Timer Text"], text = "[totem:timer]", anchorTo = "$totemBar", anchorPoint = "C", x = 0, y = 0, size = 0, default = true, block = true}, {enabled = true, width = 1, name = L["Timer Text"], text = "[rune:timer]", anchorTo = "$runeBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true}, {enabled = true, width = 1, name = L["Text"], text = "[monk:abs:stagger]", anchorTo = "$staggerBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true} @@ -400,6 +403,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[level( )][perpp]"}, {text = "[curmaxpp]"}, {text = "[(()afk() )][name]"}, + {text = ""}, }, }, boss = { @@ -422,6 +426,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[perpp]"}, {text = "[curmaxpp]"}, {text = "[name]"}, + {text = ""}, }, portrait = {enabled = false}, }, @@ -451,6 +456,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = "[name]"}, + {text = ""}, }, }, arena = { @@ -478,6 +484,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[perpp]"}, {text = "[curmaxpp]"}, {text = "[name]"}, + {text = ""}, }, }, arenapet = { @@ -511,6 +518,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = "[name]"}, + {text = ""}, }, }, arenatargettarget = { @@ -529,6 +537,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = "[name]"}, + {text = ""}, }, }, battleground = { @@ -556,6 +565,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = "[name]"}, + {text = ""}, }, }, battlegroundpet = { @@ -571,6 +581,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = "[name]"}, + {text = ""}, }, }, battlegroundtarget = { @@ -589,6 +600,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = "[name]"}, + {text = ""}, }, }, battlegroundtargettarget = { @@ -607,6 +619,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = "[name]"}, + {text = ""}, }, }, maintank = { @@ -637,6 +650,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[perpp]"}, {text = "[curmaxpp]"}, {text = "[(()afk() )][name]"}, + {text = ""}, }, }, maintanktarget = { @@ -653,6 +667,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[classification( )][perpp]", width = 0.50}, {text = "[curmaxpp]", anchorTo = "$powerBar", width = 0.60}, {text = "[(()afk() )][name]"}, + {text = ""}, }, }, maintanktargettarget = { @@ -669,6 +684,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[classification( )][perpp]", width = 0.50}, {text = "[curmaxpp]", anchorTo = "$powerBar", width = 0.60}, {text = "[(()afk() )][name]"}, + {text = ""}, }, }, mainassist = { @@ -699,6 +715,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[level( )][perpp]"}, {text = "[curmaxpp]"}, {text = "[(()afk() )][name]"}, + {text = ""}, }, }, mainassisttarget = { @@ -716,6 +733,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[level( )][classification( )][perpp]", width = 0.50}, {text = "[curmaxpp]", anchorTo = "$powerBar", width = 0.60}, {text = "[(()afk() )][name]"}, + {text = ""}, }, }, mainassisttargettarget = { @@ -733,6 +751,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[level( )][classification( )][perpp]", width = 0.50}, {text = "[curmaxpp]", anchorTo = "$powerBar", width = 0.60}, {text = "[(()afk() )][name]"}, + {text = ""}, }, }, partypet = { @@ -764,6 +783,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = "[name]"}, + {text = ""}, }, }, partytargettarget = { @@ -781,6 +801,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = "[name]"}, + {text = ""}, }, }, target = { @@ -809,6 +830,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[level( )][classification( )][perpp]", width = 0.50}, {text = "[curmaxpp]", anchorTo = "$powerBar", width = 0.60}, {text = "[(()afk() )][name]"}, + {text = ""}, }, }, pet = { @@ -826,6 +848,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[perpp]"}, {text = "[curmaxpp]"}, {text = "[name]"}, + {text = ""}, }, }, pettarget = { @@ -842,6 +865,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[perpp]"}, {text = "[curmaxpp]"}, {text = "[name]"}, + {text = ""}, }, }, focus = { @@ -864,6 +888,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[perpp]"}, {text = "[curpp]"}, {text = "[(()afk() )][name]"}, + {text = ""}, }, }, focustarget = { @@ -882,6 +907,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = "[(()afk() )][name]"}, + {text = ""}, }, }, targettarget = { @@ -899,6 +925,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[curhp]"}, {text = "[perpp]"}, {text = "[curpp]"}, + {text = ""}, + {text = ""}, }, }, targettargettarget = { @@ -916,6 +944,8 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = ""}, {text = ""}, {text = ""}, + {text = ""}, + {text = ""}, }, }, } From 74414effb54aaee9ae71a53ecbc45b4ee8a16e08 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 17 Aug 2016 12:03:01 +0200 Subject: [PATCH 721/794] Properly mark the default text tags as default --- ShadowedUnitFrames.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 0436063e..babf0d74 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -250,12 +250,12 @@ function ShadowUF:LoadUnitDefaults() portrait = {enabled = false}, castBar = {enabled = false, name = {}, time = {}}, text = { - {enabled = true, name = L["Left text"], text = "[name]", anchorPoint = "C", anchorTo = "$healthBar", size = 0}, - {enabled = true, name = L["Right text"], text = "[curmaxhp]", anchorPoint = "C", anchorTo = "$healthBar", size = 0}, - {enabled = true, name = L["Left text"], text = "[level] [race]", anchorPoint = "C", anchorTo = "$powerBar", size = 0}, - {enabled = true, name = L["Right text"], text = "[curmaxpp]", anchorPoint = "C", anchorTo = "$powerBar", size = 0}, - {enabled = true, name = L["Left text"], text = "", anchorTo = "$emptyBar", anchorPoint = "C", size = 0, x = 0, y = 0}, - {enabled = true, name = L["Right text"], text = "", anchorTo = "$emptyBar", anchorPoint = "C", size = 0, x = 0, y = 0}, + {enabled = true, name = L["Left text"], text = "[name]", anchorPoint = "C", anchorTo = "$healthBar", size = 0, default = true}, + {enabled = true, name = L["Right text"], text = "[curmaxhp]", anchorPoint = "C", anchorTo = "$healthBar", size = 0, default = true}, + {enabled = true, name = L["Left text"], text = "[level] [race]", anchorPoint = "C", anchorTo = "$powerBar", size = 0, default = true}, + {enabled = true, name = L["Right text"], text = "[curmaxpp]", anchorPoint = "C", anchorTo = "$powerBar", size = 0, default = true}, + {enabled = true, name = L["Left text"], text = "", anchorTo = "$emptyBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}, + {enabled = true, name = L["Right text"], text = "", anchorTo = "$emptyBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}, }, indicators = {raidTarget = {enabled = true, size = 0}}, highlight = {}, From ba329dff983429c73bea1e9a814433d273e6fee5 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 17 Aug 2016 12:08:48 +0200 Subject: [PATCH 722/794] More text tag defaults, don't need to save them in the SV --- ShadowedUnitFrames.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index babf0d74..fe4fb8a2 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -250,12 +250,12 @@ function ShadowUF:LoadUnitDefaults() portrait = {enabled = false}, castBar = {enabled = false, name = {}, time = {}}, text = { - {enabled = true, name = L["Left text"], text = "[name]", anchorPoint = "C", anchorTo = "$healthBar", size = 0, default = true}, - {enabled = true, name = L["Right text"], text = "[curmaxhp]", anchorPoint = "C", anchorTo = "$healthBar", size = 0, default = true}, - {enabled = true, name = L["Left text"], text = "[level] [race]", anchorPoint = "C", anchorTo = "$powerBar", size = 0, default = true}, - {enabled = true, name = L["Right text"], text = "[curmaxpp]", anchorPoint = "C", anchorTo = "$powerBar", size = 0, default = true}, - {enabled = true, name = L["Left text"], text = "", anchorTo = "$emptyBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}, - {enabled = true, name = L["Right text"], text = "", anchorTo = "$emptyBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true}, + {enabled = true, name = L["Left text"], text = "[name]", anchorPoint = "CLI", anchorTo = "$healthBar", width = 0.50, size = 0, x = 3, y = 0, default = true}, + {enabled = true, name = L["Right text"], text = "[curmaxhp]", anchorPoint = "CRI", anchorTo = "$healthBar", width = 0.60, size = 0, x = -3, y = 0, default = true}, + {enabled = true, name = L["Left text"], text = "[level] [race]", anchorPoint = "CLI", anchorTo = "$powerBar", width = 0.50, size = 0, x = 3, y = 0, default = true}, + {enabled = true, name = L["Right text"], text = "[curmaxpp]", anchorPoint = "CRI", anchorTo = "$powerBar", width = 0.60, size = 0, x = -3, y = 0, default = true}, + {enabled = true, name = L["Left text"], text = "", anchorTo = "$emptyBar", anchorPoint = "CLI", width = 0.50, size = 0, x = 3, y = 0, default = true}, + {enabled = true, name = L["Right text"], text = "", anchorTo = "$emptyBar", anchorPoint = "CRI", width = 0.60, size = 0, x = -3, y = 0, default = true}, }, indicators = {raidTarget = {enabled = true, size = 0}}, highlight = {}, From fd1e0aae255af79d2df74790e5373f6f35162f32 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 17 Aug 2016 21:34:19 +0200 Subject: [PATCH 723/794] Purge empty text tags --- ShadowedUnitFrames.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index fe4fb8a2..d23f64e0 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -105,14 +105,17 @@ function ShadowUF:CheckUpgrade() local i = 1 while i <= #config.text do local text = config.text[i] - if text.anchorTo == "$emptyBar" and text.name == L["Left text"] then - text.width = 0.50 - end - if text.anchorTo == "$demonicFuryBar" or text.anchorTo == "$eclipseBar" or text.anchorTo == "$burningEmbersBar" or text.anchorTo == "$monkBar" then + if not text then + table.remove(config.text, i) + elseif text.anchorTo == "$demonicFuryBar" or text.anchorTo == "$eclipseBar" or text.anchorTo == "$burningEmbersBar" or text.anchorTo == "$monkBar" then table.remove(config.text, i) elseif i > 6 and text.default and text.anchorTo == "$emptyBar" then table.remove(config.text, i) else + if text.anchorTo == "$emptyBar" and text.name == L["Left text"] then + text.width = 0.50 + end + i = i + 1 end end From b9abe08e42c43f1f48a7d111d767eff5fc7ecd5e Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 28 Aug 2016 03:09:47 +0200 Subject: [PATCH 724/794] Add basic defaults for all text tags to avoid errors when they are removed --- ShadowedUnitFrames.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index d23f64e0..25a68d45 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -259,6 +259,7 @@ function ShadowUF:LoadUnitDefaults() {enabled = true, name = L["Right text"], text = "[curmaxpp]", anchorPoint = "CRI", anchorTo = "$powerBar", width = 0.60, size = 0, x = -3, y = 0, default = true}, {enabled = true, name = L["Left text"], text = "", anchorTo = "$emptyBar", anchorPoint = "CLI", width = 0.50, size = 0, x = 3, y = 0, default = true}, {enabled = true, name = L["Right text"], text = "", anchorTo = "$emptyBar", anchorPoint = "CRI", width = 0.60, size = 0, x = -3, y = 0, default = true}, + ['*'] = {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0}, }, indicators = {raidTarget = {enabled = true, size = 0}}, highlight = {}, From 311ae8e9b84c772676c10f4c49fad71d8da1eb7c Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 28 Aug 2016 12:44:48 +0200 Subject: [PATCH 725/794] Fix migration with the new defaults --- ShadowedUnitFrames.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 25a68d45..de4ab188 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -104,7 +104,11 @@ function ShadowUF:CheckUpgrade() if config.text then local i = 1 while i <= #config.text do - local text = config.text[i] + local text + if rawget(config.text, i) or i <= #(self.defaults.profile.units[unit].text) then + text = config.text[i] + end + if not text then table.remove(config.text, i) elseif text.anchorTo == "$demonicFuryBar" or text.anchorTo == "$eclipseBar" or text.anchorTo == "$burningEmbersBar" or text.anchorTo == "$monkBar" then From 9676e6a8beec2dfba83ca67f36288d7e66d10bb1 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 28 Aug 2016 20:42:39 +0200 Subject: [PATCH 726/794] Use LibSpellRange-1.0 for spell range checking --- .pkgmeta | 2 ++ ShadowedUnitFrames.toc | 3 ++- modules/range.lua | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.pkgmeta b/.pkgmeta index 93c40647..85d74311 100755 --- a/.pkgmeta +++ b/.pkgmeta @@ -18,6 +18,8 @@ externals: libs/LibDualSpec-1.0: url: git://git.wowace.com/wow/libdualspec-1-0/mainline.git tag: latest + libs/LibSpellRange-1.0: + url: svn://svn.curseforge.com/wow/libspellrange-1-0/mainline/trunk options/libs/AceConfig-3.0: url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConfig-3.0 options/libs/AceDBOptions-3.0: diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index a00d2147..7a423c4b 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -5,7 +5,7 @@ ## Version: @project-version@ ## SavedVariables: ShadowedUFDB ## X-Website: http://www.wowace.com/addons/shadowed-unit-frames/ -## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibDualSpec-1.0, Clique +## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibDualSpec-1.0, LibSpellRange-1.0, Clique #@no-lib-strip@ libs\LibStub\LibStub.lua @@ -13,6 +13,7 @@ libs\CallbackHandler-1.0\CallbackHandler-1.0\CallbackHandler-1.0.xml libs\LibSharedMedia-3.0\lib.xml libs\AceDB-3.0\AceDB-3.0.xml libs\LibDualSpec-1.0\LibDualSpec-1.0.lua +libs\LibSpellRange-1.0\lib.xml #@end-no-lib-strip@ localization\enUS.lua diff --git a/modules/range.lua b/modules/range.lua index 1bce9bf8..59c0cf94 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -43,6 +43,8 @@ local Range = { ShadowUF:RegisterModule(Range, "range", ShadowUF.L["Range indicator"]) +local LSR = LibStub("SpellRange-1.0") + local playerClass = select(2, UnitClass("player")) local rangeSpells = {} @@ -60,7 +62,7 @@ local function checkRange(self) if( not UnitIsConnected(frame.unit) ) then frame:SetRangeAlpha(ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) elseif( spell ) then - frame:SetRangeAlpha(IsSpellInRange(spell, frame.unit) == 1 and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) + frame:SetRangeAlpha(LSR.IsSpellInRange(spell, frame.unit) == 1 and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) -- That didn't work, but they are grouped lets try the actual API for this, it's a bit flaky though and not that useful generally elseif( UnitInRaid(frame.unit) or UnitInParty(frame.unit) ) then frame:SetRangeAlpha(UnitInRange(frame.unit, "player") and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) From 6d7043ec338b88cbaca281198fc389b296dd0035 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 11 Sep 2016 11:03:16 +0200 Subject: [PATCH 727/794] totems: try to find the appropriate totem index automatically --- modules/totems.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/totems.lua b/modules/totems.lua index e741e8b1..1cd37e26 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -157,7 +157,14 @@ end function Totems:Update(frame) local totalActive = 0 for _, indicator in pairs(frame.totemBar.totems) do - local have, name, start, duration, icon = GetTotemInfo(indicator.id) + local have, name, start, duration, icon + if MAX_TOTEMS == 1 and indicator.id == 1 then + local id = 1 + while not have and id <= 4 do + have, name, start, duration, icon = GetTotemInfo(id) + id = id + 1 + end + end if( have and start > 0 ) then if( ShadowUF.db.profile.units[frame.unitType].totemBar.icon ) then indicator:SetStatusBarTexture(icon) From 1cde3098122c916abf7474a34c42eb3aa2f3b194 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 11 Sep 2016 11:03:37 +0200 Subject: [PATCH 728/794] totems: add warlock soul effigy bar --- modules/totems.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/totems.lua b/modules/totems.lua index 1cd37e26..49f7e483 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -16,6 +16,9 @@ elseif( playerClass == "MONK" ) then elseif( playerClass == "MAGE" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Rune of Power bar"], true, "MAGE", {1, 2, 3}, 90) +elseif( playerClass == "WARLOCK" ) then + MAX_TOTEMS = 1 + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Soul Effigy bar"], true, "WARLOCK", 1, 100) else ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Totem bar"], true, "SHAMAN") end @@ -53,7 +56,7 @@ function Totems:OnEnable(frame) if( playerClass == "DRUID" ) then totemColors[1] = ShadowUF.db.profile.powerColors.MUSHROOMS - elseif( playerClass == "DEATHKNIGHT" ) then + elseif( playerClass == "WARLOCK" ) then totemColors[1] = ShadowUF.db.profile.classColors.PET elseif( playerClass == "MONK" ) then totemColors[1] = ShadowUF.db.profile.powerColors.STATUE From f97b98777c22269eccd6b3911c098d3f8d2b93b8 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 11 Sep 2016 11:06:01 +0200 Subject: [PATCH 729/794] totems: use class upvalue --- modules/totems.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/totems.lua b/modules/totems.lua index 49f7e483..8dbb2384 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -36,7 +36,7 @@ function Totems:OnEnable(frame) frame.totemBar.totems = {} frame.totemBar.blocks = frame.totemBar.totems - local priorities = (select(2, UnitClass("player")) == "SHAMAN") and SHAMAN_TOTEM_PRIORITIES or STANDARD_TOTEM_PRIORITIES + local priorities = (playerClass == "SHAMAN") and SHAMAN_TOTEM_PRIORITIES or STANDARD_TOTEM_PRIORITIES for id=1, MAX_TOTEMS do local totem = ShadowUF.Units:CreateBar(frame.totemBar) From d28eb73cbaedca077f8d6b1923cb5815e8718acd Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 12 Sep 2016 09:18:16 +0200 Subject: [PATCH 730/794] Add a new override aura filter type The override filter bypasses ("overrides") any other filters and ensures the aura is always shown. --- ShadowedUnitFrames.lua | 2 +- modules/auras.lua | 5 +++- options/config.lua | 63 ++++++++++++++++++++++++++++-------------- 3 files changed, 47 insertions(+), 23 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index de4ab188..c0b49c89 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -37,7 +37,7 @@ function ShadowUF:OnInitialize() units = {}, positions = {}, range = {}, - filters = {zonewhite = {}, zoneblack = {}, whitelists = {}, blacklists = {}}, + filters = {zonewhite = {}, zoneblack = {}, zoneoverride = {}, whitelists = {}, blacklists = {}, overridelists = {}}, visibility = {arena = {}, pvp = {}, party = {}, raid = {}}, hidden = {cast = false, playerPower = true, buffs = false, party = true, raid = false, player = true, pet = true, target = true, focus = true, boss = true, arena = true, playerAltPower = false}, }, diff --git a/modules/auras.lua b/modules/auras.lua index 067e3543..cc709cc9 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -492,8 +492,10 @@ function Auras:UpdateFilter(frame) local white = ShadowUF.db.profile.filters.zonewhite[zone .. frame.unitType] local black = ShadowUF.db.profile.filters.zoneblack[zone .. frame.unitType] + local override = ShadowUF.db.profile.filters.zoneoverride[zone .. frame.unitType] frame.auras.whitelist = white and ShadowUF.db.profile.filters.whitelists[white] or filterDefault frame.auras.blacklist = black and ShadowUF.db.profile.filters.blacklists[black] or filterDefault + frame.auras.overridelist = override and ShadowUF.db.profile.filters.overridelists[override] or filterDefault end local function categorizeAura(type, curable, auraType, caster, isRemovable, canApplyAura, isBossDebuff) @@ -524,7 +526,8 @@ local function renderAura(parent, frame, type, config, displayConfig, index, fil -- Now do our type filter local category = categorizeAura(type, curable, auraType, caster, isRemovable, canApplyAura, isBossDebuff) - if( not config.show[category] and (not config.show.relevant or (type == "debuffs") ~= isFriendly) ) then return end + -- check override and type filters + if( not ( parent.overridelist[type] and ( parent.overridelist[name] or parent.overridelist[spellID] ) ) and not config.show[category] and (not config.show.relevant or (type == "debuffs") ~= isFriendly) ) then return end -- Create any buttons we need frame.totalAuras = frame.totalAuras + 1 diff --git a/options/config.lua b/options/config.lua index 646601a2..a65847d4 100755 --- a/options/config.lua +++ b/options/config.lua @@ -5065,13 +5065,13 @@ end -- FILTER CONFIGURATION --------------------- local function loadFilterOptions() - local hasWhitelist, hasBlacklist, rebuildFilters + local hasWhitelist, hasBlacklist, hasOverridelist, rebuildFilters local filterMap, spellMap = {}, {} local manageFiltersTable = { - order = function(info) return info[#(info)] == "whitelists" and 1 or 2 end, + order = function(info) return info[#(info)] == "whitelists" and 1 or info[#(info)] == "blacklists" and 2 or 3 end, type = "group", - name = function(info) return info[#(info)] == "whitelists" and L["Whitelists"] or L["Blacklists"] end, + name = function(info) return info[#(info)] == "whitelists" and L["Whitelists"] or info[#(info)] == "blacklists" and L["Blacklists"] or L["Override lists"] end, args = { }, } @@ -5144,7 +5144,7 @@ local function loadFilterOptions() ShadowUF.db.profile.filters[filterType][filter] = nil -- Delete anything that used this filter too - local filterList = filterType == "whitelists" and ShadowUF.db.profile.filters.zonewhite or filterType == "blacklists" and ShadowUF.db.profile.filters.zoneblack + local filterList = filterType == "whitelists" and ShadowUF.db.profile.filters.zonewhite or filterType == "blacklists" and ShadowUF.db.profile.filters.zoneblack or filterType == "overridelists" and ShadowUF.db.profile.filters.zoneoverride if filterList then for id, filterUsed in pairs(filterList) do if( filterUsed == filter ) then @@ -5264,13 +5264,13 @@ local function loadFilterOptions() order = function(info) return info[#(info)] == "global" and 1 or info[#(info)] == "none" and 2 or 3 end, type = "group", inline = true, - hidden = function() return not hasWhitelist and not hasBlacklist end, + hidden = function() return not hasWhitelist and not hasBlacklist and not hasOverridelist end, name = function(info) return AREA_NAMES[info[#(info)]] or L["Global"] end, set = function(info, value) local filter = filterMap[info[#(info)]] local zone = info[#(info) - 1] local unit = info[#(info) - 2] - local filterKey = ShadowUF.db.profile.filters.whitelists[filter] and "zonewhite" or "zoneblack" + local filterKey = ShadowUF.db.profile.filters.whitelists[filter] and "zonewhite" or ShadowUF.db.profile.filters.blacklists[filter] and "zoneblack" or "zoneoverride" for _, zoneConfig in pairs(zoneList) do if( zone == "global" or zoneConfig == zone ) then @@ -5299,20 +5299,20 @@ local function loadFilterOptions() if( unit == "global" or zone == "global" ) then local id = zone == "global" and zone .. unit or zone - local filterKey = ShadowUF.db.profile.filters.whitelists[filter] and "zonewhite" or "zoneblack" + local filterKey = ShadowUF.db.profile.filters.whitelists[filter] and "zonewhite" or ShadowUF.db.profile.filters.blacklists[filter] and "zoneblack" or "zoneoverride" if( info[#(info)] == "nofilter" ) then - return globalSettings[id .. "zonewhite"] == false and globalSettings[id .. "zoneblack"] == false + return globalSettings[id .. "zonewhite"] == false and globalSettings[id .. "zoneblack"] == false and globalSettings[id .. "zoneoverride"] == false end return globalSettings[id .. filterKey] == filter end if( info[#(info)] == "nofilter" ) then - return not ShadowUF.db.profile.filters.zonewhite[zone .. unit] and not ShadowUF.db.profile.filters.zoneblack[zone .. unit] + return not ShadowUF.db.profile.filters.zonewhite[zone .. unit] and not ShadowUF.db.profile.filters.zoneblack[zone .. unit] and not ShadowUF.db.profile.filters.zoneoverride[zone .. unit] end - return ShadowUF.db.profile.filters.zonewhite[zone .. unit] == filter or ShadowUF.db.profile.filters.zoneblack[zone .. unit] == filter + return ShadowUF.db.profile.filters.zonewhite[zone .. unit] == filter or ShadowUF.db.profile.filters.zoneblack[zone .. unit] == filter or ShadowUF.db.profile.filters.zoneoverride[zone .. unit] == filter end, args = { nofilter = { @@ -5330,14 +5330,17 @@ local function loadFilterOptions() if( unit == "global" ) then globalSettings[zoneConfig .. "zonewhite"] = false globalSettings[zoneConfig .. "zoneblack"] = false + globalSettings[zoneConfig .. "zoneoverride"] = false for _, unit in pairs(ShadowUF.unitList) do ShadowUF.db.profile.filters.zonewhite[zoneConfig .. unit] = nil ShadowUF.db.profile.filters.zoneblack[zoneConfig .. unit] = nil + ShadowUF.db.profile.filters.zoneoverride[zoneConfig .. unit] = nil end else ShadowUF.db.profile.filters.zonewhite[zoneConfig .. unit] = nil ShadowUF.db.profile.filters.zoneblack[zoneConfig .. unit] = nil + ShadowUF.db.profile.filters.zoneoverride[zoneConfig .. unit] = nil end end end @@ -5345,6 +5348,7 @@ local function loadFilterOptions() if( zone == "global" ) then globalSettings[zone .. unit .. "zonewhite"] = false globalSettings[zone .. unit .. "zoneblack"] = false + globalSettings[zone .. unit .. "zoneoverride"] = false end reloadUnitAuras() @@ -5362,17 +5366,23 @@ local function loadFilterOptions() name = L["Blacklists"], -- In theory I would make this black, but as black doesn't work with a black background I'll skip that hidden = function(info) return not hasBlacklist end }, + override = { + order = 5, + type = "header", + name = L["Override lists"], -- In theory I would make this black, but as black doesn't work with a black background I'll skip that + hidden = function(info) return not hasOverridelist end + }, }, } -- Toggle used for set filter zones to enable filters local filterToggle = { - order = function(info) return ShadowUF.db.profile.filters.whitelists[filterMap[info[#(info)]]] and 2 or 4 end, + order = function(info) return ShadowUF.db.profile.filters.whitelists[filterMap[info[#(info)]]] and 2 or ShadowUF.db.profile.filters.blacklists[filterMap[info[#(info)]]] and 4 or 6 end, type = "toggle", name = function(info) return filterMap[info[#(info)]] end, desc = function(info) local filter = filterMap[info[#(info)]] - filter = ShadowUF.db.profile.filters.whitelists[filter] or ShadowUF.db.profile.filters.blacklists[filter] + filter = ShadowUF.db.profile.filters.whitelists[filter] or ShadowUF.db.profile.filters.blacklists[filter] or ShadowUF.db.profile.filters.overridelists[filter] if( filter.buffs and filter.debuffs ) then return L["Filtering both buffs and debuffs"] elseif( filter.buffs ) then @@ -5390,15 +5400,15 @@ local function loadFilterOptions() local filterID, spellID = 0, 0 local function buildList(type) local manageFiltersTable = { - order = type == "whitelists" and 1 or 2, + order = type == "whitelists" and 1 or type == "blacklists" and 2 or 3, type = "group", - name = type == "whitelists" and L["Whitelists"] or L["Blacklists"], + name = type == "whitelists" and L["Whitelists"] or type == "blacklists" and L["Blacklists"] or L["Override lists"], args = { groups = { order = 0, type = "group", inline = true, - name = function(info) return info[#(info) - 1] == "whitelists" and L["Whitelist filters"] or L["Blacklist filters"] end, + name = function(info) return info[#(info) - 1] == "whitelists" and L["Whitelist filters"] or info[#(info) - 1] == "blacklists" and L["Blacklist filters"] or L["Override list filters"] end, args = { }, }, @@ -5437,7 +5447,7 @@ local function loadFilterOptions() end if( not hasFilters ) then - if( type == "whitelists" ) then hasWhitelist = nil else hasBlacklist = nil end + if( type == "whitelists" ) then hasWhitelist = nil elseif( type == "blacklists" ) then hasBlacklist = nil else hasOverridelist = nil end manageFiltersTable.args.groups.args.noFilters = noFilters end @@ -5451,12 +5461,14 @@ local function loadFilterOptions() filterID = 0 hasBlacklist = true hasWhitelist = true + hasOverridelist = true table.wipe(filterMap) table.wipe(spellMap) options.args.filter.args.filters.args.whitelists = buildList("whitelists") options.args.filter.args.filters.args.blacklists = buildList("blacklists") + options.args.filter.args.filters.args.overridelists = buildList("overridelists") end local unitFilterSelection = { @@ -5476,7 +5488,7 @@ local function loadFilterOptions() type = "group", inline = true, name = L["Help"], - hidden = function() return hasWhitelist or hasBlacklist end, + hidden = function() return hasWhitelist or hasBlacklist or hasOverridelist end, args = { help = { type = "description", @@ -5489,7 +5501,7 @@ local function loadFilterOptions() order = 0, type = "header", name = function(info) return (info[#(info) - 1] == "global" and L["Global"] or L.units[info[#(info) - 1]]) end, - hidden = function() return not hasWhitelist and not hasBlacklist end, + hidden = function() return not hasWhitelist and not hasBlacklist and not hasOverridelist end, }, global = filterTable, none = filterTable, @@ -5548,7 +5560,7 @@ local function loadFilterOptions() args = { help = { type = "description", - name = L["Whitelists will hide any aura not in the filter group.|nBlacklists will hide auras that are in the filter group."], + name = L["Whitelists will hide any aura not in the filter group.|nBlacklists will hide auras that are in the filter group.|nOverride lists will bypass any filter and always be shown."], width = "full", } }, @@ -5603,7 +5615,16 @@ local function loadFilterOptions() return "" end end - + + for filter in pairs(ShadowUF.db.profile.filters.overridelists) do + if( string.lower(filter) == name ) then + addFilter.error = string.format(L["The override list \"%s\" already exists."], value) + addFilter.errorName = value + AceRegistry:NotifyChange("ShadowedUF") + return "" + end + end + addFilter.error = nil addFilter.errorName = nil return true @@ -5614,7 +5635,7 @@ local function loadFilterOptions() type = "select", name = L["Filter type"], set = function(info, value) addFilter[info[#(info)]] = value end, - values = {["whitelists"] = L["Whitelist"], ["blacklists"] = L["Blacklist"]}, + values = {["whitelists"] = L["Whitelist"], ["blacklists"] = L["Blacklist"], ["overridelists"] = L["Override list"]}, }, add = { order = 2, From 3a407515d42e2b2f361bbc694e8da65a0d8478a8 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 12 Sep 2016 09:37:22 +0200 Subject: [PATCH 731/794] Slightly increase the default config UI size to fit elements better --- options/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/config.lua b/options/config.lua index a65847d4..45d7d31b 100755 --- a/options/config.lua +++ b/options/config.lua @@ -7584,7 +7584,7 @@ function Config:Open() loadOptions() AceRegistry:RegisterOptionsTable("ShadowedUF", options, true) - AceDialog:SetDefaultSize("ShadowedUF", 865, 550) + AceDialog:SetDefaultSize("ShadowedUF", 895, 570) registered = true end From 9029a0460ca59927e4c38b304fa00e3a426c9f68 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 12 Sep 2016 09:37:41 +0200 Subject: [PATCH 732/794] Improve handling of spell IDs in aura filter lists --- modules/auras.lua | 2 ++ options/config.lua | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index cc709cc9..9e1bf025 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -520,6 +520,8 @@ local function categorizeAura(type, curable, auraType, caster, isRemovable, canA end local function renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) + -- aura filters are all saved as strings, so need to override here + spellID = tostring(spellID) -- Do our initial list check to see if we can quick filter it out if( parent.whitelist[type] and not parent.whitelist[name] and not parent.whitelist[spellID] ) then return end if( parent.blacklist[type] and ( parent.blacklist[name] or parent.blacklist[spellID] ) ) then return end diff --git a/options/config.lua b/options/config.lua index 45d7d31b..96c859fe 100755 --- a/options/config.lua +++ b/options/config.lua @@ -5117,7 +5117,7 @@ local function loadFilterOptions() add = { order = 0, type = "input", - name = L["Aura name"], + name = L["Aura name or spell ID"], --dialogControl = "Aura_EditBox", hidden = false, set = function(info, value) @@ -5201,11 +5201,16 @@ local function loadFilterOptions() local spellLabel = { order = function(info) return tonumber(string.match(info[#(info)], "(%d+)")) end, type = "description", - -- Odd I know, AceConfigDialog-3.0 expands descriptions to full width if width is nil - -- on the other hand we can't set width to "normal" so tricking it - width = "", + width = "double", fontSize = "medium", - name = function(info) return spellMap[info[#(info)]] end, + name = function(info) + local name = spellMap[info[#(info)]] + if tonumber(name) then + local spellName, _, icon = GetSpellInfo(name) + name = string.format("|T%s:14:14:0:0|t %s (#%i)", icon or "Interface\\Icons\\Inv_misc_questionmark", spellName or L["Unknown"], name) + end + return name + end, } local spellRow = { From 889b92855582c80f0fd021bbdbf574759d2372f6 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 12 Sep 2016 09:44:07 +0200 Subject: [PATCH 733/794] Reload auras when deleting a filter entry --- options/config.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/options/config.lua b/options/config.lua index 96c859fe..1009e1b1 100755 --- a/options/config.lua +++ b/options/config.lua @@ -5224,6 +5224,8 @@ local function loadFilterOptions() local filterType = info[#(info) - 3] ShadowUF.db.profile.filters[filterType][filter][spell] = nil + + reloadUnitAuras() rebuildFilters() end } From b5a1aeb6c166f7879d063a79c6bcd3fb09f90304 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 13 Sep 2016 14:37:36 +0200 Subject: [PATCH 734/794] runes: fix rune order after 7.0 changes (Ticket 978) --- modules/runes.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/runes.lua b/modules/runes.lua index 988bb29d..51a20773 100755 --- a/modules/runes.lua +++ b/modules/runes.lua @@ -1,5 +1,4 @@ local Runes = {} -local RUNE_MAP = {[1] = 1, [2] = 2, [3] = 5, [4] = 6, [5] = 3, [6] = 4} ShadowUF:RegisterModule(Runes, "runeBar", ShadowUF.L["Rune bar"], true, "DEATHKNIGHT") ShadowUF.BlockTimers:Inject(Runes, "RUNE_TIMER") ShadowUF.DynamicBlocks:Inject(Runes) @@ -17,12 +16,12 @@ function Runes:OnEnable(frame) rune.id = id if( id > 1 ) then - rune:SetPoint("TOPLEFT", frame.runeBar.runes[RUNE_MAP[id - 1]], "TOPRIGHT", 1, 0) + rune:SetPoint("TOPLEFT", frame.runeBar.runes[id-1], "TOPRIGHT", 1, 0) else rune:SetPoint("TOPLEFT", frame.runeBar, "TOPLEFT", 0, 0) end - frame.runeBar.runes[RUNE_MAP[id]] = rune + frame.runeBar.runes[id] = rune end end From 0dae4cb97e0bf2c3072dc45fc1758295007035da Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 13 Sep 2016 15:15:41 +0200 Subject: [PATCH 735/794] totems: fix totems for shamans (Ticket 983) --- modules/totems.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/totems.lua b/modules/totems.lua index 8dbb2384..da1fc8ba 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -167,6 +167,8 @@ function Totems:Update(frame) have, name, start, duration, icon = GetTotemInfo(id) id = id + 1 end + else + have, name, start, duration, icon = GetTotemInfo(indicator.id) end if( have and start > 0 ) then if( ShadowUF.db.profile.units[frame.unitType].totemBar.icon ) then From 7201e8badc412780d197dab60e288d14c5bc606f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 31 Oct 2016 13:25:54 +0100 Subject: [PATCH 736/794] Update TOC for 7.1 --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 7a423c4b..f586696d 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,4 +1,4 @@ -## Interface: 70000 +## Interface: 70100 ## Title: Shadowed Unit Frames ## Notes: "Debug" code free since '93! ## Author: Shadowed From d087c24adfd708df7a9e8e5bbaaffbf5d83847e9 Mon Sep 17 00:00:00 2001 From: Shadowed Date: Sat, 26 Nov 2016 10:14:39 -0800 Subject: [PATCH 737/794] Force rebuild --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index f586696d..b72430f4 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,6 +1,6 @@ ## Interface: 70100 ## Title: Shadowed Unit Frames -## Notes: "Debug" code free since '93! +## Notes: Moooooooooooooooooo ## Author: Shadowed ## Version: @project-version@ ## SavedVariables: ShadowedUFDB From 0c703873ed80b3a0863a2142df0103fc72bc41f0 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 13 Dec 2016 01:23:13 +0100 Subject: [PATCH 738/794] Cleanup pkgmeta repository paths a bit to include less clutter --- .pkgmeta | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pkgmeta b/.pkgmeta index 85d74311..74c982e9 100755 --- a/.pkgmeta +++ b/.pkgmeta @@ -13,11 +13,11 @@ externals: libs/AceDB-3.0: url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDB-3.0 libs/LibSharedMedia-3.0: - url: svn://svn.wowace.com/wow/libsharedmedia-3-0/mainline/trunk + url: svn://svn.wowace.com/wow/libsharedmedia-3-0/mainline/trunk/LibSharedMedia-3.0 tag: latest libs/LibDualSpec-1.0: - url: git://git.wowace.com/wow/libdualspec-1-0/mainline.git - tag: latest + url: git://git.wowace.com/wow/libdualspec-1-0/mainline.git + tag: latest libs/LibSpellRange-1.0: url: svn://svn.curseforge.com/wow/libspellrange-1-0/mainline/trunk options/libs/AceConfig-3.0: @@ -27,7 +27,7 @@ externals: options/libs/AceGUI-3.0: url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceGUI-3.0 options/libs/AceGUI-3.0-SharedMediaWidgets: - url: svn://svn.wowace.com/wow/ace-gui-3-0-shared-media-widgets/mainline/trunk + url: svn://svn.wowace.com/wow/ace-gui-3-0-shared-media-widgets/mainline/trunk/AceGUI-3.0-SharedMediaWidgets tag: latest ignore: From b485eb905368920247d3d62e1c18e54dbb77c847 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 14 Dec 2016 20:26:14 +0100 Subject: [PATCH 739/794] Update TOC for 7.1 --- options/ShadowedUF_Options.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index c62895be..f3691c74 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 70000 +## Interface: 70100 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From e51d92629865a966f3d1c88c9da6fd375fc0c5a3 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 1 Feb 2017 06:19:01 +0100 Subject: [PATCH 740/794] Fix class token retrievel for arena unit frames --- modules/units.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/units.lua b/modules/units.lua index fdc53b01..16e20c40 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -691,7 +691,7 @@ end local function ArenaClassToken(self) local specID = GetArenaOpponentSpec(self.unitID) - return specID and select(7, GetSpecializationInfoByID(specID)) + return specID and select(6, GetSpecializationInfoByID(specID)) end function Units:CreateUnit(...) From 317a7d240e90089d7ed37fec31d77b4941ec9573 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 1 Feb 2017 06:22:19 +0100 Subject: [PATCH 741/794] Use Shadow Bolt as the default warlock range spell --- modules/range.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/range.lua b/modules/range.lua index 59c0cf94..c4d07677 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -36,7 +36,7 @@ local Range = { ["PRIEST"] = GetSpellInfo(585), -- Smite --["ROGUE"] = GetSpellInfo(1725), -- Distract ["SHAMAN"] = GetSpellInfo(403), -- Lightning Bolt - ["WARLOCK"] = GetSpellInfo(689), -- Drain Life + ["WARLOCK"] = GetSpellInfo(686), -- Shadow Bolt ["WARRIOR"] = GetSpellInfo(355), -- Taunt }, } From 3148661a5281de5666dcffb86257587b7e1c7eea Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 28 Feb 2017 12:44:05 +0100 Subject: [PATCH 742/794] range: show units in another phase as out of range --- modules/range.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/range.lua b/modules/range.lua index c4d07677..1f1fe1b3 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -59,7 +59,7 @@ local function checkRange(self) spell = rangeSpells.hostile end - if( not UnitIsConnected(frame.unit) ) then + if( not UnitIsConnected(frame.unit) or not UnitInPhase(frame.unit) ) then frame:SetRangeAlpha(ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) elseif( spell ) then frame:SetRangeAlpha(LSR.IsSpellInRange(spell, frame.unit) == 1 and ShadowUF.db.profile.units[frame.unitType].range.inAlpha or ShadowUF.db.profile.units[frame.unitType].range.oorAlpha) From 189d13450bf51993b45ade4c27575a598094266f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 28 Feb 2017 13:44:02 +0100 Subject: [PATCH 743/794] range: replace animation timer by C_Timer --- modules/range.lua | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/modules/range.lua b/modules/range.lua index 1f1fe1b3..6268f9d8 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -95,12 +95,26 @@ local function updateSpellCache(category) end end +local function createTimer(frame) + if( not frame.range.timer ) then + frame.range.timer = C_Timer.NewTicker(0.5, checkRange) + frame.range.timer.parent = frame + end +end + +local function cancelTimer(frame) + if( frame.range and frame.range.timer ) then + frame.range.timer:Cancel() + frame.range.timer = nil + end +end + function Range:ForceUpdate(frame) if( UnitIsUnit(frame.unit, "player") ) then frame:SetRangeAlpha(ShadowUF.db.profile.units[frame.unitType].range.inAlpha) - frame.range.timer:Stop() + cancelTimer(frame) else - frame.range.timer:Play() + createTimer(frame) checkRange(frame.range.timer) end end @@ -108,15 +122,12 @@ end function Range:OnEnable(frame) if( not frame.range ) then frame.range = CreateFrame("Frame", nil, frame) - - frame.range.timer = frame:CreateOnUpdate(0.50, checkRange) - frame.range.timer.parent = frame end frame:RegisterNormalEvent("PLAYER_SPECIALIZATION_CHANGED", self, "SpellChecks") frame:RegisterUpdateFunc(self, "ForceUpdate") - frame.range.timer:Play() + createTimer(frame) end function Range:OnLayoutApplied(frame) @@ -127,7 +138,7 @@ function Range:OnDisable(frame) frame:UnregisterAll(self) if( frame.range ) then - frame.range.timer:Stop() + cancelTimer(frame) frame:SetRangeAlpha(1.0) end end From 48ac37a63b2902be3a58cf1217a2f3520853443a Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 28 Feb 2017 13:44:18 +0100 Subject: [PATCH 744/794] tags: replace tag update timer by C_Timer --- modules/tags.lua | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/modules/tags.lua b/modules/tags.lua index e88e80d0..bda986ff 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -226,6 +226,23 @@ local function createTagFunction(tags, resetCache) return tagPool[tags], frequencyCache[tags] end +local function createMonitorTimer(fontString, frequency) + if( not fontString.monitor or fontString.monitor.frequency ~= frequency ) then + if fontString.monitor then + fontString.monitor:Cancel() + end + fontString.monitor = C_Timer.NewTicker(frequency, function() fontString:UpdateTags() end) + fontString.monitor.frequency = frequency + end +end + +local function cancelMonitorTimer(fontString) + if( fontString.monitor ) then + fontString.monitor:Cancel() + fontString.monitor = nil + end +end + function Tags:Register(parent, fontString, tags, resetCache) -- Unregister the font string first if we did register it already if( fontString.UpdateTags ) then @@ -240,13 +257,9 @@ function Tags:Register(parent, fontString, tags, resetCache) fontString.UpdateTags, frequency = createTagFunction(tags, resetCache) if( frequency ) then - fontString.monitor = fontString.monitor or parent:CreateOnUpdate(frequency, function() - fontString:UpdateTags() - end) - - fontString.monitor:SetTimer(frequency) + createMonitorTimer(fontString, frequency) elseif( fontString.monitor ) then - fontString.monitor:Stop() + cancelMonitorTimer(fontString) end -- Register any needed event @@ -265,7 +278,7 @@ function Tags:Unregister(fontString) end -- Kill any tag data - if( fontString.monitor ) then fontString.monitor:Stop() end + cancelMonitorTimer(fontString) fontString.parent:UnregisterAll(fontString) fontString.powerFilters = nil fontString.UpdateTags = nil From 37ad89d4225d240a289595094b437861a5f004cd Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 28 Feb 2017 13:51:24 +0100 Subject: [PATCH 745/794] Replace fake unit update timers by C_Timer --- modules/cast.lua | 19 ++++++++++++++++--- modules/units.lua | 14 +++++++------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/modules/cast.lua b/modules/cast.lua index 7dd00fc4..76a45cab 100755 --- a/modules/cast.lua +++ b/modules/cast.lua @@ -48,6 +48,20 @@ local function monitorFakeCast(self) end end +local function createFakeCastMonitor(frame) + if( not frame.castBar.monitor ) then + frame.castBar.monitor = C_Timer.NewTicker(0.10, monitorFakeCast) + frame.castBar.monitor.parent = frame + end +end + +local function cancelFakeCastMonitor(frame) + if( frame.castBar and frame.castBar.monitor ) then + frame.castBar.monitor:Cancel() + frame.castBar.monitor = nil + end +end + function Cast:OnEnable(frame) if( not frame.castBar ) then frame.castBar = CreateFrame("Frame", nil, frame) @@ -62,8 +76,7 @@ function Cast:OnEnable(frame) end if( ShadowUF.fakeUnits[frame.unitType] ) then - frame.castBar.monitor = frame:CreateOnUpdate(0.10, monitorFakeCast) - frame.castBar.monitor.parent = frame + createFakeCastMonitor(frame) frame:RegisterUpdateFunc(self, "UpdateFakeCast") return end @@ -163,7 +176,7 @@ function Cast:OnDisable(frame, unit) frame:UnregisterAll(self) if( frame.castBar ) then - if( frame.castBar.monitor ) then frame.castBar.monitor:Stop() end + cancelFakeCastMonitor(frame) frame.castBar.bar.name:Hide() frame.castBar.bar.time:Hide() diff --git a/modules/units.lua b/modules/units.lua index 16e20c40..766351fe 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -419,6 +419,12 @@ local function updateChildUnits(...) end end +local function createFakeUnitUpdateTimer(frame) + if( not frame.updateTimer ) then + frame.updateTimer = C_Timer.NewTicker(0.5, function() if( UnitExists(frame.unit) ) then frame:FullUpdate() end end) + end +end + -- Attribute set, something changed -- unit = Active unitid -- unitID = Just the number from the unitid @@ -568,13 +574,7 @@ OnAttributeChanged = function(self, name, unit) -- *target units are not real units, thus they do not receive events and must be polled for data elseif( ShadowUF.fakeUnits[self.unitRealType] ) then - if( not self.updateTimer ) then - self.updateTimer = self:CreateOnUpdate(0.50, function() - if( UnitExists(self.unit) ) then - self:FullUpdate() - end - end) - end + createFakeUnitUpdateTimer(self) -- Speeds up updating units when their owner changes target, if party1 changes target then party1target is force updated, if target changes target -- then targettarget and targettargettarget are also force updated From a3e3ef36560cfd2888ec1ebdae0c6facb3349cf2 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 28 Feb 2017 13:51:35 +0100 Subject: [PATCH 746/794] Remove animation based timer, its unused now --- modules/units.lua | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 766351fe..e9079726 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -643,28 +643,6 @@ local function initializeUnit(header, frameName) Units:CreateUnit(frame) end --- Update helper -local function SetTimer(self, seconds) - self.animation:SetDuration(seconds) - self:Play() -end - -local function CreateOnUpdate(self, seconds, callback) - local group = self:CreateAnimationGroup() - group:SetLooping("REPEAT") - group:SetScript("OnLoop", callback) - - local animation = group:CreateAnimation("Animation") - animation:SetOrder(1) - - group.animation = animation - group.SetTimer = SetTimer - - group:SetTimer(seconds) - - return group -end - -- Show tooltip local function OnEnter(self) if( self.OnEnter ) then @@ -709,7 +687,6 @@ function Units:CreateUnit(...) frame.DisableRangeAlpha = DisableRangeAlpha frame.UnregisterUpdateFunc = UnregisterUpdateFunc frame.ReregisterUnitEvents = ReregisterUnitEvents - frame.CreateOnUpdate = CreateOnUpdate frame.SetBarColor = SetBarColor frame.SetBlockColor = SetBlockColor frame.FullUpdate = FullUpdate From f71ea6329ddb0ac3a91109bb648d767c19dc89b3 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 28 Feb 2017 19:25:28 +0100 Subject: [PATCH 747/794] Fix updating on spec change --- modules/range.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/range.lua b/modules/range.lua index 6268f9d8..ee98bee6 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -148,6 +148,6 @@ function Range:SpellChecks(frame) updateSpellCache("friendly") updateSpellCache("hostile") if( frame.range ) then - checkRange(frame.range.timer) + self:ForceUpdate(frame) end end \ No newline at end of file From 9fce3afdca84129db9d53e1e37ceb628802b2f75 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 7 Mar 2017 15:57:42 +0100 Subject: [PATCH 748/794] Re-factor the OmniCC option to also toggle Blizzard Cooldown Count numbers --- modules/auras.lua | 2 +- options/config.lua | 28 ++++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 9e1bf025..614161a0 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -228,7 +228,6 @@ local function updateButton(id, group, config) button.cooldown:SetReverse(true) button.cooldown:SetDrawEdge(false) button.cooldown:SetDrawSwipe(true) - button.cooldown:SetHideCountdownNumbers(true) button.cooldown:SetSwipeColor(0, 0, 0, 0.8) button.cooldown:Hide() @@ -264,6 +263,7 @@ local function updateButton(id, group, config) -- Set the button sizing button.cooldown.noCooldownCount = ShadowUF.db.profile.omnicc + button.cooldown:SetHideCountdownNumbers(button.cooldown.noCooldownCount) button:SetHeight(config.size) button:SetWidth(config.size) button.border:SetHeight(config.size + 1) diff --git a/options/config.lua b/options/config.lua index 1009e1b1..f9d5b726 100755 --- a/options/config.lua +++ b/options/config.lua @@ -711,27 +711,28 @@ local function loadGeneralOptions() end, arg = "locked", }, - sep = { - order = 1.5, - type = "description", - name = "", - width = "full", - hidden = hideAdvancedOption, - }, advanced = { - order = 2, + order = 1.5, type = "toggle", name = L["Advanced"], desc = L["Enabling advanced settings will give you access to more configuration options. This is meant for people who want to tweak every single thing, and should not be enabled by default as it increases the options."], arg = "advanced", }, + sep = { + order = 2, + type = "description", + name = "", + width = "full", + hidden = hideAdvancedOption, + }, omnicc = { order = 2.5, type = "toggle", - name = L["Disable OmniCC"], - desc = L["Disables showing OmniCC timers in all Shadowed Unit Frame auras."], + name = L["Disable Cooldown Count"], + desc = L["Disables showing Cooldown Count timers (Blizzard/OmniCC) in all Shadowed Unit Frame auras."], arg = "omnicc", hidden = hideAdvancedOption, + width = "double", }, hideCombat = { order = 3, @@ -739,6 +740,13 @@ local function loadGeneralOptions() name = L["Hide tooltips in combat"], desc = L["Prevents unit tooltips from showing while in combat."], arg = "tooltipCombat", + width = "double", + }, + sep2 = { + order = 3.5, + type = "description", + name = "", + width = "full", }, auraBorder = { order = 5, From 949ee94dfceb607bf79811af5596625947c5f85f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 7 Mar 2017 16:15:51 +0100 Subject: [PATCH 749/794] Use Hand of Reckoning for Paladin hostile range checking Judgment appears to not be functional --- modules/range.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/range.lua b/modules/range.lua index ee98bee6..2f98191e 100755 --- a/modules/range.lua +++ b/modules/range.lua @@ -32,7 +32,7 @@ local Range = { (GetSpellInfo(133)), -- Fireball }, ["MONK"] = GetSpellInfo(115546), -- Provoke - ["PALADIN"] = GetSpellInfo(20271), -- Judgement + ["PALADIN"] = GetSpellInfo(62124), -- Hand of Reckoning ["PRIEST"] = GetSpellInfo(585), -- Smite --["ROGUE"] = GetSpellInfo(1725), -- Distract ["SHAMAN"] = GetSpellInfo(403), -- Lightning Bolt From 7a4fb4cf9a986f41af7709cc0e351ca286fdad45 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 28 Mar 2017 19:25:45 +0200 Subject: [PATCH 750/794] Update TOC for 7.2 --- ShadowedUnitFrames.toc | 2 +- options/ShadowedUF_Options.toc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index b72430f4..86381c07 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,4 +1,4 @@ -## Interface: 70100 +## Interface: 70200 ## Title: Shadowed Unit Frames ## Notes: Moooooooooooooooooo ## Author: Shadowed diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index f3691c74..a66f97d6 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 70100 +## Interface: 70200 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From e63feb876cc8a4dca33fb9e378d061aa2ac4e867 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 29 Mar 2017 09:32:15 +0200 Subject: [PATCH 751/794] Always show the cooldown count option, not only in advanced mode --- options/config.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/options/config.lua b/options/config.lua index f9d5b726..e42f29f9 100755 --- a/options/config.lua +++ b/options/config.lua @@ -723,7 +723,6 @@ local function loadGeneralOptions() type = "description", name = "", width = "full", - hidden = hideAdvancedOption, }, omnicc = { order = 2.5, @@ -731,7 +730,6 @@ local function loadGeneralOptions() name = L["Disable Cooldown Count"], desc = L["Disables showing Cooldown Count timers (Blizzard/OmniCC) in all Shadowed Unit Frame auras."], arg = "omnicc", - hidden = hideAdvancedOption, width = "double", }, hideCombat = { From 3d49caef98e9b6f79734fd45b7559fb3e8e6533a Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 29 Mar 2017 09:43:15 +0200 Subject: [PATCH 752/794] Separate Blizzard cooldown count from OmniCC cooldown count and disable Blizzard by default --- ShadowedUnitFrames.lua | 1 + modules/auras.lua | 2 +- options/config.lua | 12 ++++++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index c0b49c89..1e842d3d 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -33,6 +33,7 @@ function ShadowUF:OnInitialize() advanced = false, tooltipCombat = false, omnicc = false, + blizzardcc = true, tags = {}, units = {}, positions = {}, diff --git a/modules/auras.lua b/modules/auras.lua index 614161a0..881260e5 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -263,7 +263,7 @@ local function updateButton(id, group, config) -- Set the button sizing button.cooldown.noCooldownCount = ShadowUF.db.profile.omnicc - button.cooldown:SetHideCountdownNumbers(button.cooldown.noCooldownCount) + button.cooldown:SetHideCountdownNumbers(ShadowUF.db.profile.blizzardcc) button:SetHeight(config.size) button:SetWidth(config.size) button.border:SetHeight(config.size + 1) diff --git a/options/config.lua b/options/config.lua index e42f29f9..2cccefc6 100755 --- a/options/config.lua +++ b/options/config.lua @@ -727,11 +727,19 @@ local function loadGeneralOptions() omnicc = { order = 2.5, type = "toggle", - name = L["Disable Cooldown Count"], - desc = L["Disables showing Cooldown Count timers (Blizzard/OmniCC) in all Shadowed Unit Frame auras."], + name = L["Disable OmniCC Cooldown Count"], + desc = L["Disables showing Cooldown Count timers in all Shadowed Unit Frame auras."], arg = "omnicc", width = "double", }, + blizzardcc = { + order = 2.5, + type = "toggle", + name = L["Disable Blizzard Cooldown Count"], + desc = L["Disables showing Cooldown Count timers in all Shadowed Unit Frame auras."], + arg = "blizzardcc", + width = "double", + }, hideCombat = { order = 3, type = "toggle", From 70df3d35c33c1a35e47d31198a9885a84ed341c8 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 29 Jun 2017 11:10:01 +0200 Subject: [PATCH 753/794] Update to use Enum.PowerType instead of SPELL_POWER_* constants --- modules/arcanecharges.lua | 2 +- modules/chi.lua | 2 +- modules/druid.lua | 4 +-- modules/fader.lua | 2 +- modules/holypower.lua | 2 +- modules/movers.lua | 22 +++++++------- modules/priest.lua | 4 +-- modules/shaman.lua | 4 +-- modules/soulshards.lua | 2 +- modules/tags.lua | 60 +++++++++++++++++++-------------------- 10 files changed, 51 insertions(+), 53 deletions(-) diff --git a/modules/arcanecharges.lua b/modules/arcanecharges.lua index 16a7fa1c..8d8eebd0 100644 --- a/modules/arcanecharges.lua +++ b/modules/arcanecharges.lua @@ -2,7 +2,7 @@ if( not ShadowUF.ComboPoints ) then return end local ArcaneCharges = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(ArcaneCharges, "arcaneCharges", ShadowUF.L["Arcane Charges"], nil, "MAGE", SPEC_MAGE_ARCANE) -local arcaneConfig = {max = 5, key = "arcaneCharges", colorKey = "ARCANECHARGES", powerType = SPELL_POWER_ARCANE_CHARGES, eventType = "ARCANE_CHARGES", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local arcaneConfig = {max = 5, key = "arcaneCharges", colorKey = "ARCANECHARGES", powerType = Enum.PowerType.ArcaneCharges, eventType = "ARCANE_CHARGES", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function ArcaneCharges:OnEnable(frame) frame.arcaneCharges = frame.arcaneCharges or CreateFrame("Frame", nil, frame) diff --git a/modules/chi.lua b/modules/chi.lua index 7757db83..fccb1a04 100755 --- a/modules/chi.lua +++ b/modules/chi.lua @@ -2,7 +2,7 @@ if( not ShadowUF.ComboPoints ) then return end local Chi = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(Chi, "chi", ShadowUF.L["Chi"], nil, "MONK", SPEC_MONK_WINDWALKER) -local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = SPELL_POWER_CHI, eventType = "CHI", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local chiConfig = {max = 5, key = "chi", colorKey = "CHI", powerType = Enum.PowerType.Chi, eventType = "CHI", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function Chi:OnEnable(frame) frame.chi = frame.chi or CreateFrame("Frame", nil, frame) diff --git a/modules/druid.lua b/modules/druid.lua index 481638d8..92de7e69 100755 --- a/modules/druid.lua +++ b/modules/druid.lua @@ -34,6 +34,6 @@ end function Druid:Update(frame, event, unit, powerType) if( powerType and powerType ~= "MANA" ) then return end - frame.druidBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, SPELL_POWER_MANA)) - frame.druidBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, SPELL_POWER_MANA)) + frame.druidBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, Enum.PowerType.Mana)) + frame.druidBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, Enum.PowerType.Mana)) end diff --git a/modules/fader.lua b/modules/fader.lua index e40ece50..67b14512 100755 --- a/modules/fader.lua +++ b/modules/fader.lua @@ -1,5 +1,5 @@ local Fader = {} -local powerDepletes = {[SPELL_POWER_MANA] = true, [SPELL_POWER_ENERGY] = true, [SPELL_POWER_FOCUS] = true} +local powerDepletes = {[Enum.PowerType.Mana] = true, [Enum.PowerType.Energy] = true, [Enum.PowerType.Focus] = true} ShadowUF:RegisterModule(Fader, "fader", ShadowUF.L["Combat fader"]) -- TODO: Remove once Blizzard fixes cooldown wheels not taking parents alpha diff --git a/modules/holypower.lua b/modules/holypower.lua index 47e58583..015e68d9 100755 --- a/modules/holypower.lua +++ b/modules/holypower.lua @@ -2,7 +2,7 @@ if( not ShadowUF.ComboPoints ) then return end local HolyPower = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN", SPEC_PALADIN_RETRIBUTION, PALADINPOWERBAR_SHOW_LEVEL) -local holyConfig = {max = 5, key = "holyPower", colorKey = "HOLYPOWER", powerType = SPELL_POWER_HOLY_POWER, eventType = "HOLY_POWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} +local holyConfig = {max = 5, key = "holyPower", colorKey = "HOLYPOWER", powerType = Enum.PowerType.HolyPower, eventType = "HOLY_POWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"} function HolyPower:OnEnable(frame) frame.holyPower = frame.holyPower or CreateFrame("Frame", nil, frame) diff --git a/modules/movers.lua b/modules/movers.lua index 320587bd..2f6acfd3 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -42,11 +42,9 @@ local function createConfigEnv() end, UnitHealthMax = function(unit) return 50000 end, UnitPower = function(unit, powerType) - if( powerType == SPELL_POWER_HOLY_POWER or powerType == SPELL_POWER_SOUL_SHARDS ) then + if( powerType == Enum.PowerType.HolyPower or powerType == Enum.PowerType.SoulShards ) then return 3 - elseif( powerType == SPELL_POWER_ECLIPSE ) then - return getValue("UnitPower", unit, math.random(-100, 100)) - elseif( powerType == SPELL_POWER_CHI) then + elseif( powerType == Enum.PowerType.Chi) then return 4 end @@ -62,18 +60,18 @@ local function createConfigEnv() return getValue("UnitGetTotalAbsorbs", unit, math.random(2500, 5000)) end, UnitPowerMax = function(unit, powerType) - if( powerType == SPELL_POWER_RAGE or powerType == SPELL_POWER_ENERGY or powerType == SPELL_POWER_RUNIC_POWER - or powerType == SPELL_POWER_LUNAR_POWER or powerType == SPELL_POWER_MAELSTROM or powerType == SPELL_POWER_INSANITY - or powerType == SPELL_POWER_FURY or powerType == SPELL_POWER_PAIN ) then + if( powerType == Enum.PowerType.Rage or powerType == Enum.PowerType.Energy or powerType == Enum.PowerType.RunicPower + or powerType == Enum.PowerType.LunarPower or powerType == Enum.PowerType.Maelstrom or powerType == Enum.PowerType.Insanity + or powerType == Enum.PowerType.Fury or powerType == Enum.PowerType.Pain ) then return 100 - elseif( powerType == SPELL_POWER_FOCUS ) then + elseif( powerType == Enum.PowerType.Focus ) then return 120 - elseif( powerType == SPELL_POWER_COMBO_POINTS or powerType == SPELL_POWER_SOUL_SHARDS or powerType == SPELL_POWER_HOLY_POWER - or powerType == SPELL_POWER_CHI ) then + elseif( powerType == Enum.PowerType.ComboPoints or powerType == Enum.PowerType.SoulShards or powerType == Enum.PowerType.HolyPower + or powerType == Enum.PowerType.Chi ) then return 5 - elseif( powerType == SPELL_POWER_RUNES ) then + elseif( powerType == Enum.PowerType.Runes ) then return 6 - elseif( powerType == SPELL_POWER_ARCANE_CHARGES ) then + elseif( powerType == Enum.PowerType.ArcaneCharges ) then return 4 end diff --git a/modules/priest.lua b/modules/priest.lua index 4a1f9512..a7e3d416 100644 --- a/modules/priest.lua +++ b/modules/priest.lua @@ -34,6 +34,6 @@ end function Priest:Update(frame, event, unit, powerType) if( powerType and powerType ~= "MANA" ) then return end - frame.priestBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, SPELL_POWER_MANA)) - frame.priestBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, SPELL_POWER_MANA)) + frame.priestBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, Enum.PowerType.Mana)) + frame.priestBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, Enum.PowerType.Mana)) end diff --git a/modules/shaman.lua b/modules/shaman.lua index 1ae610ac..963c043e 100644 --- a/modules/shaman.lua +++ b/modules/shaman.lua @@ -34,6 +34,6 @@ end function Shaman:Update(frame, event, unit, powerType) if( powerType and powerType ~= "MANA" ) then return end - frame.shamanBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, SPELL_POWER_MANA)) - frame.shamanBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, SPELL_POWER_MANA)) + frame.shamanBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, Enum.PowerType.Mana)) + frame.shamanBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, Enum.PowerType.Mana)) end diff --git a/modules/soulshards.lua b/modules/soulshards.lua index 4f5388d4..1c76dc5a 100755 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -2,7 +2,7 @@ if( not ShadowUF.ComboPoints ) then return end local Souls = setmetatable({}, {__index = ShadowUF.ComboPoints}) ShadowUF:RegisterModule(Souls, "soulShards", ShadowUF.L["Soul Shards"], nil, "WARLOCK") -local soulsConfig = {max = 5, key = "soulShards", colorKey = "SOULSHARDS", powerType = SPELL_POWER_SOUL_SHARDS, eventType = "SOUL_SHARDS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\shard"} +local soulsConfig = {max = 5, key = "soulShards", colorKey = "SOULSHARDS", powerType = Enum.PowerType.SoulShards, eventType = "SOUL_SHARDS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\shard"} function Souls:OnEnable(frame) frame.soulShards = frame.soulShards or CreateFrame("Frame", nil, frame) diff --git a/modules/tags.lua b/modules/tags.lua index bda986ff..f0b3fd5d 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -793,15 +793,15 @@ Tags.defaultTags = { end end]], ["sshards"] = [[function(unit, unitOwner) - local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_SOUL_SHARDS) + local points = UnitPower(ShadowUF.playerUnit, Enum.PowerType.SoulShards) return points and points > 0 and points end]], ["hpower"] = [[function(unit, unitOwner) - local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_HOLY_POWER) + local points = UnitPower(ShadowUF.playerUnit, Enum.PowerType.HolyPower) return points and points > 0 and points end]], ["monk:chipoints"] = [[function(unit, unitOwner) - local points = UnitPower(ShadowUF.playerUnit, SPELL_POWER_CHI) + local points = UnitPower(ShadowUF.playerUnit, Enum.PowerType.Chi) return points and points > 0 and points end]], ["cpoints"] = [[function(unit, unitOwner) @@ -813,7 +813,7 @@ Tags.defaultTags = { return points else - return UnitPower("player", SPELL_POWER_COMBO_POINTS) + return UnitPower("player", Enum.PowerType.ComboPoints) end end]], ["smartlevel"] = [[function(unit, unitOwner) @@ -877,22 +877,22 @@ Tags.defaultTags = { ["druid:curpp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local powerType = UnitPowerType(unit) - if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end - return ShadowUF:FormatLargeNumber(UnitPower(unit, SPELL_POWER_MANA)) + if( powerType ~= Enum.PowerType.Rage and powerType ~= Enum.PowerType.Energy and powerType ~= Enum.PowerType.LunarPower ) then return nil end + return ShadowUF:FormatLargeNumber(UnitPower(unit, Enum.PowerType.Mana)) end]], ["druid:abscurpp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local powerType = UnitPowerType(unit) - if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end - return UnitPower(unit, SPELL_POWER_MANA) + if( powerType ~= Enum.PowerType.Rage and powerType ~= Enum.PowerType.Energy and powerType ~= Enum.PowerType.LunarPower ) then return nil end + return UnitPower(unit, Enum.PowerType.Mana) end]], ["druid:curmaxpp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local powerType = UnitPowerType(unit) - if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end + if( powerType ~= Enum.PowerType.Rage and powerType ~= Enum.PowerType.Energy and powerType ~= Enum.PowerType.LunarPower ) then return nil end - local maxPower = UnitPowerMax(unit, SPELL_POWER_MANA) - local power = UnitPower(unit, SPELL_POWER_MANA) + local maxPower = UnitPowerMax(unit, Enum.PowerType.Mana) + local power = UnitPower(unit, Enum.PowerType.Mana) if( UnitIsDeadOrGhost(unit) ) then return string.format("0/%s", ShadowUF:FormatLargeNumber(maxPower)) elseif( maxPower == 0 and power == 0 ) then @@ -904,53 +904,53 @@ Tags.defaultTags = { ["druid:absolutepp"] = [[function(unit, unitOwner) if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local powerType = UnitPowerType(unit) - if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end + if( powerType ~= Enum.PowerType.Rage and powerType ~= Enum.PowerType.Energy and powerType ~= Enum.PowerType.LunarPower ) then return nil end - return UnitPower(unit, SPELL_POWER_MANA) + return UnitPower(unit, Enum.PowerType.Mana) end]], ["sec:curpp"] = [[function(unit, unitOwner) local class = select(2, UnitClass(unit)) local powerType = UnitPowerType(unit) if( class == "DRUID" ) then - if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end + if( powerType ~= Enum.PowerType.Rage and powerType ~= Enum.PowerType.Energy and powerType ~= Enum.PowerType.LunarPower ) then return nil end elseif( class == "PRIEST" ) then - if( powerType ~= SPELL_POWER_INSANITY ) then return nil end + if( powerType ~= Enum.PowerType.Insanity ) then return nil end elseif( class == "SHAMAN" ) then - if( powerType ~= SPELL_POWER_MAELSTROM ) then return nil end + if( powerType ~= Enum.PowerType.Maelstrom ) then return nil end else return nil end - return ShadowUF:FormatLargeNumber(UnitPower(unit, SPELL_POWER_MANA)) + return ShadowUF:FormatLargeNumber(UnitPower(unit, Enum.PowerType.Mana)) end]], ["sec:abscurpp"] = [[function(unit, unitOwner) local class = select(2, UnitClass(unit)) local powerType = UnitPowerType(unit) if( class == "DRUID" ) then - if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end + if( powerType ~= Enum.PowerType.Rage and powerType ~= Enum.PowerType.Energy and powerType ~= Enum.PowerType.LunarPower ) then return nil end elseif( class == "PRIEST" ) then - if( powerType ~= SPELL_POWER_INSANITY ) then return nil end + if( powerType ~= Enum.PowerType.Insanity ) then return nil end elseif( class == "SHAMAN" ) then - if( powerType ~= SPELL_POWER_MAELSTROM ) then return nil end + if( powerType ~= Enum.PowerType.Maelstrom ) then return nil end else return nil end - return UnitPower(unit, SPELL_POWER_MANA) + return UnitPower(unit, Enum.PowerType.Mana) end]], ["sec:curmaxpp"] = [[function(unit, unitOwner) local class = select(2, UnitClass(unit)) local powerType = UnitPowerType(unit) if( class == "DRUID" ) then - if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end + if( powerType ~= Enum.PowerType.Rage and powerType ~= Enum.PowerType.Energy and powerType ~= Enum.PowerType.LunarPower ) then return nil end elseif( class == "PRIEST" ) then - if( powerType ~= SPELL_POWER_INSANITY ) then return nil end + if( powerType ~= Enum.PowerType.Insanity ) then return nil end elseif( class == "SHAMAN" ) then - if( powerType ~= SPELL_POWER_MAELSTROM ) then return nil end + if( powerType ~= Enum.PowerType.Maelstrom ) then return nil end else return nil end - local maxPower = UnitPowerMax(unit, SPELL_POWER_MANA) - local power = UnitPower(unit, SPELL_POWER_MANA) + local maxPower = UnitPowerMax(unit, Enum.PowerType.Mana) + local power = UnitPower(unit, Enum.PowerType.Mana) if( UnitIsDeadOrGhost(unit) ) then return string.format("0/%s", ShadowUF:FormatLargeNumber(maxPower)) elseif( maxPower == 0 and power == 0 ) then @@ -963,16 +963,16 @@ Tags.defaultTags = { local class = select(2, UnitClass(unit)) local powerType = UnitPowerType(unit) if( class == "DRUID" ) then - if( powerType ~= SPELL_POWER_RAGE and powerType ~= SPELL_POWER_ENERGY and powerType ~= SPELL_POWER_LUNAR_POWER ) then return nil end + if( powerType ~= Enum.PowerType.Rage and powerType ~= Enum.PowerType.Energy and powerType ~= Enum.PowerType.LunarPower ) then return nil end elseif( class == "PRIEST" ) then - if( powerType ~= SPELL_POWER_INSANITY ) then return nil end + if( powerType ~= Enum.PowerType.Insanity ) then return nil end elseif( class == "SHAMAN" ) then - if( powerType ~= SPELL_POWER_MAELSTROM ) then return nil end + if( powerType ~= Enum.PowerType.Maelstrom ) then return nil end else return nil end - return UnitPower(unit, SPELL_POWER_MANA) + return UnitPower(unit, Enum.PowerType.Mana) end]], ["per:incheal"] = [[function(unit, unitOwner, fontString) local heal = UnitGetIncomingHeals(unit) From 34a04d1a13de9600bc711f410fce3e1763828102 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 29 Jun 2017 11:55:24 +0200 Subject: [PATCH 754/794] Support partial soul shards for destruction warlocks --- modules/basecombopoints.lua | 12 ++++++++---- modules/soulshards.lua | 20 ++++++++++++++++++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/modules/basecombopoints.lua b/modules/basecombopoints.lua index d690d874..71071e19 100644 --- a/modules/basecombopoints.lua +++ b/modules/basecombopoints.lua @@ -44,7 +44,7 @@ local function createBlocks(config, pointsFrame) pointsFrame.visibleBlocks = pointsConfig.max -- Position bars, the 5 accounts for borders - local blockWidth = (pointsFrame:GetWidth() - (pointsConfig.max - 1)) / pointsConfig.max + local blockWidth = (pointsFrame:GetWidth() - ((pointsConfig.max / pointsConfig.grouping or 1) - 1)) / pointsConfig.max for id=1, pointsConfig.max do pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.blocks[id] @@ -70,15 +70,19 @@ local function createBlocks(config, pointsFrame) texture.background:SetShown(config.background) end + local offset = 1 + if pointsConfig.grouping and ((id - 1) % pointsConfig.grouping ~= 0) then + offset = 0 + end if( config.growth == "LEFT" ) then if( id > 1 ) then - texture:SetPoint("TOPRIGHT", pointsFrame.blocks[id - 1], "TOPLEFT", -1, 0) + texture:SetPoint("TOPRIGHT", pointsFrame.blocks[id - 1], "TOPLEFT", -offset, 0) else texture:SetPoint("TOPRIGHT", pointsFrame, "TOPRIGHT", 0, 0) end else if( id > 1 ) then - texture:SetPoint("TOPLEFT", pointsFrame.blocks[id - 1], "TOPRIGHT", 1, 0) + texture:SetPoint("TOPLEFT", pointsFrame.blocks[id - 1], "TOPRIGHT", offset, 0) else texture:SetPoint("TOPLEFT", pointsFrame, "TOPLEFT", 0, 0) end @@ -141,7 +145,7 @@ function Combo:UpdateBarBlocks(frame, event, unit, powerType) if( not pointsFrame or not pointsFrame.cpConfig.eventType or not pointsFrame.blocks ) then return end if( event and powerType ~= pointsFrame.cpConfig.eventType ) then return end - local max = UnitPowerMax("player", pointsFrame.cpConfig.powerType) + local max = self.GetMaxPoints and self:GetMaxPoints() or UnitPowerMax("player", pointsFrame.cpConfig.powerType) if( max == 0 or pointsFrame.visibleBlocks == max ) then return end pointsFrame.cpConfig.max = max diff --git a/modules/soulshards.lua b/modules/soulshards.lua index 1c76dc5a..8561f805 100755 --- a/modules/soulshards.lua +++ b/modules/soulshards.lua @@ -7,11 +7,14 @@ local soulsConfig = {max = 5, key = "soulShards", colorKey = "SOULSHARDS", power function Souls:OnEnable(frame) frame.soulShards = frame.soulShards or CreateFrame("Frame", nil, frame) frame.soulShards.cpConfig = soulsConfig + frame.soulShards.cpConfig.max = (GetSpecialization() == SPEC_WARLOCK_DESTRUCTION) and 50 or 5 + frame.soulShards.cpConfig.grouping = (GetSpecialization() == SPEC_WARLOCK_DESTRUCTION) and UnitPowerDisplayMod(soulsConfig.powerType) or 1 frame.comboPointType = soulsConfig.key frame:RegisterUnitEvent("UNIT_POWER_FREQUENT", self, "Update") frame:RegisterUnitEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks") frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "Update") + frame:RegisterNormalEvent("PLAYER_SPECIALIZATION_CHANGED", self, "SpecChanged") frame:RegisterUpdateFunc(self, "Update") frame:RegisterUpdateFunc(self, "UpdateBarBlocks") @@ -22,10 +25,23 @@ function Souls:OnLayoutApplied(frame, config) self:UpdateBarBlocks(frame) end +function Souls:SpecChanged(frame) + -- update shard count on spec swap + if frame and frame.soulShards then + frame.soulShards.cpConfig.max = (GetSpecialization() == SPEC_WARLOCK_DESTRUCTION) and 50 or 5 + frame.soulShards.cpConfig.grouping = (GetSpecialization() == SPEC_WARLOCK_DESTRUCTION) and UnitPowerDisplayMod(soulsConfig.powerType) or 1 + end + self:UpdateBarBlocks(frame) +end + function Souls:GetComboPointType() return "soulShards" end function Souls:GetPoints(unit) - return UnitPower("player", soulsConfig.powerType) -end \ No newline at end of file + return UnitPower("player", soulsConfig.powerType, (GetSpecialization() == SPEC_WARLOCK_DESTRUCTION)) +end + +function Souls:GetMaxPoints(unit) + return UnitPowerMax("player", soulsConfig.powerType, (GetSpecialization() == SPEC_WARLOCK_DESTRUCTION)) +end From 48bc8b5fdafa01ce5b162bf1eb8b23cf687d242e Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 29 Jun 2017 15:56:00 +0200 Subject: [PATCH 755/794] Fix combo points in "bar" layout --- modules/basecombopoints.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/basecombopoints.lua b/modules/basecombopoints.lua index 71071e19..1fbdeb39 100644 --- a/modules/basecombopoints.lua +++ b/modules/basecombopoints.lua @@ -44,7 +44,7 @@ local function createBlocks(config, pointsFrame) pointsFrame.visibleBlocks = pointsConfig.max -- Position bars, the 5 accounts for borders - local blockWidth = (pointsFrame:GetWidth() - ((pointsConfig.max / pointsConfig.grouping or 1) - 1)) / pointsConfig.max + local blockWidth = (pointsFrame:GetWidth() - ((pointsConfig.max / (pointsConfig.grouping or 1)) - 1)) / pointsConfig.max for id=1, pointsConfig.max do pointsFrame.blocks[id] = pointsFrame.blocks[id] or pointsFrame:CreateTexture(nil, "OVERLAY") local texture = pointsFrame.blocks[id] From 68b403c9f70a1e3529fbc50d5490e7f0642ef028 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 29 Aug 2017 23:27:35 +0200 Subject: [PATCH 756/794] Update TOC for 7.3 --- ShadowedUnitFrames.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index 86381c07..e214e823 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,4 +1,4 @@ -## Interface: 70200 +## Interface: 70300 ## Title: Shadowed Unit Frames ## Notes: Moooooooooooooooooo ## Author: Shadowed From 6c2e324f4f8312184421f479c96df66f179e2d90 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 18 Jan 2018 10:23:43 +0100 Subject: [PATCH 757/794] Properly handle raid members in vehicles which should not cause targeting to change 7.3.5 finally added the APIs required to properly fix this. Fixes ticket #1081 --- ShadowedUnitFrames.toc | 1 + ShadowedUnitFrames.xml | 8 ++++++++ modules/units.lua | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 ShadowedUnitFrames.xml diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index e214e823..c111848b 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -26,6 +26,7 @@ localization\ruRU.lua localization\zhCN.lua localization\zhTW.lua +ShadowedUnitFrames.xml ShadowedUnitFrames.lua modules\helpers.lua modules\units.lua diff --git a/ShadowedUnitFrames.xml b/ShadowedUnitFrames.xml new file mode 100644 index 00000000..ed2fc96e --- /dev/null +++ b/ShadowedUnitFrames.xml @@ -0,0 +1,8 @@ + + + diff --git a/modules/units.lua b/modules/units.lua index e9079726..3afcb1be 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -631,7 +631,7 @@ local secureInitializeUnit = [[ end ]] -local unitButtonTemplate = ClickCastHeader and "ClickCastUnitTemplate,SecureUnitButtonTemplate" or "SecureUnitButtonTemplate" +local unitButtonTemplate = ClickCastHeader and "ClickCastUnitTemplate,SUF_SecureUnitTemplate" or "SUF_SecureUnitTemplate" -- Header unit initialized local function initializeUnit(header, frameName) @@ -699,7 +699,7 @@ function Units:CreateUnit(...) frame.highFrame:SetFrameLevel(frame.topFrameLevel + 2) frame.highFrame:SetAllPoints(frame) - frame:SetScript("OnAttributeChanged", OnAttributeChanged) + frame:HookScript("OnAttributeChanged", OnAttributeChanged) frame:SetScript("OnEvent", OnEvent) frame:HookScript("OnEnter", OnEnter) frame:HookScript("OnLeave", OnLeave) From 95d06b32b758a169407dff511f2164e0c10a2bb1 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 18 Jan 2018 10:38:05 +0100 Subject: [PATCH 758/794] Update totem module for recent-ish class changes --- modules/totems.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/totems.lua b/modules/totems.lua index da1fc8ba..53e64339 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -6,19 +6,19 @@ local MAX_TOTEMS = MAX_TOTEMS local playerClass = select(2, UnitClass("player")) if( playerClass == "PALADIN" ) then MAX_TOTEMS = 1 - ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Ancient Kings bar"], true, "PALADIN", 75) + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Ancient Kings bar"], true, "PALADIN", nil, 70) elseif( playerClass == "DRUID" ) then MAX_TOTEMS = 1 - ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Mushroom bar"], true, "DRUID", 4, 88) + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Mushroom bar"], true, "DRUID", 4, 70) elseif( playerClass == "MONK" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Statue bar"], true, "MONK", {1, 2}, 70) elseif( playerClass == "MAGE" ) then MAX_TOTEMS = 1 - ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Rune of Power bar"], true, "MAGE", {1, 2, 3}, 90) + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Rune of Power bar"], true, "MAGE", {1, 2, 3}, 45) elseif( playerClass == "WARLOCK" ) then - MAX_TOTEMS = 1 - ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Soul Effigy bar"], true, "WARLOCK", 1, 100) + MAX_TOTEMS = 2 + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Imp & Dreadstalker bar"], true, "WARLOCK", 2) else ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Totem bar"], true, "SHAMAN") end From 5425159707808326b5ff9bc981ac0a0398014390 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 18 Jan 2018 10:43:12 +0100 Subject: [PATCH 759/794] Update TOC of the options addon --- options/ShadowedUF_Options.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index a66f97d6..1d7584fd 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 70200 +## Interface: 70300 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From a128655dd19b995cd5ea1f816c88793249f80db9 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 22 Jan 2018 00:11:11 +0100 Subject: [PATCH 760/794] Check that unit is set before trying to register the state driver --- ShadowedUnitFrames.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowedUnitFrames.xml b/ShadowedUnitFrames.xml index ed2fc96e..ec6af43d 100644 --- a/ShadowedUnitFrames.xml +++ b/ShadowedUnitFrames.xml @@ -1,7 +1,7 @@ From c45e99993bb9bbf7b1e546c29a0f196f6ae8be0d Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 22 Jan 2018 00:19:00 +0100 Subject: [PATCH 761/794] Add a missing color entry for the second demonology warlock guardian bar --- modules/totems.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/totems.lua b/modules/totems.lua index 53e64339..32307ce7 100755 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -58,6 +58,7 @@ function Totems:OnEnable(frame) totemColors[1] = ShadowUF.db.profile.powerColors.MUSHROOMS elseif( playerClass == "WARLOCK" ) then totemColors[1] = ShadowUF.db.profile.classColors.PET + totemColors[2] = ShadowUF.db.profile.classColors.PET elseif( playerClass == "MONK" ) then totemColors[1] = ShadowUF.db.profile.powerColors.STATUE elseif( playerClass == "MAGE" ) then From 0d3c416d8ccbeabc635b6f0c282ea3bdc7a7f83d Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 23 Apr 2018 11:53:31 +0200 Subject: [PATCH 762/794] Move DualSpec handling at the end of startup init This should avoid errors when DualSpec tries to switch the profile during load already when SUF is not fully setup yet. --- ShadowedUnitFrames.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 1e842d3d..151e09df 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -52,9 +52,6 @@ function ShadowUF:OnInitialize() self.db.RegisterCallback(self, "OnProfileCopied", "ProfilesChanged") self.db.RegisterCallback(self, "OnProfileReset", "ProfileReset") - local LibDualSpec = LibStub("LibDualSpec-1.0", true) - if LibDualSpec then LibDualSpec:EnhanceDatabase(self.db, "ShadowedUnitFrames") end - -- Setup tag cache self.tagFunc = setmetatable({}, { __index = function(tbl, index) @@ -88,6 +85,9 @@ function ShadowUF:OnInitialize() self.Layout:LoadSML() self:LoadUnits() self.modules.movers:Update() + + local LibDualSpec = LibStub("LibDualSpec-1.0", true) + if LibDualSpec then LibDualSpec:EnhanceDatabase(self.db, "ShadowedUnitFrames") end end function ShadowUF:CheckBuild() From 5f60eec1ba28f1af27bdea0cc2c569a4e6956352 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 23 Apr 2018 11:56:38 +0200 Subject: [PATCH 763/794] auras: protect against forbidden gametooltip --- modules/auras.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/auras.lua b/modules/auras.lua index 881260e5..9a88469f 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -182,13 +182,14 @@ end -- Aura button functions -- Updates the X seconds left on aura tooltip while it's shown local function updateTooltip(self) - if( GameTooltip:IsOwned(self) ) then + if( not GameTooltip:IsForbidden() and GameTooltip:IsOwned(self) ) then GameTooltip:SetUnitAura(self.unit, self.auraID, self.filter) end end local function showTooltip(self) if( not ShadowUF.db.profile.locked ) then return end + if( GameTooltip:IsForbidden() ) then return end GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT") if( self.filter == "TEMP" ) then @@ -202,7 +203,9 @@ end local function hideTooltip(self) self:SetScript("OnUpdate", nil) - GameTooltip:Hide() + if not GameTooltip:IsForbidden() then + GameTooltip:Hide() + end end local function cancelAura(self, mouse) From 427fd6d56bae698610dd9185222c8c249e901b04 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 23 Apr 2018 12:00:34 +0200 Subject: [PATCH 764/794] units: protect against forbidden tooltip --- modules/units.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/units.lua b/modules/units.lua index 3afcb1be..5f00b7f5 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -658,7 +658,15 @@ end local function SUF_OnEnter(self) if( not ShadowUF.db.profile.tooltipCombat or not InCombatLockdown() ) then - UnitFrame_OnEnter(self) + if not GameTooltip:IsForbidden() then + UnitFrame_OnEnter(self) + end + end +end + +local function SUF_OnLeave(self) + if not GameTooltip:IsForbidden() then + UnitFrame_OnLeave(self) end end @@ -707,7 +715,7 @@ function Units:CreateUnit(...) frame:SetScript("OnHide", OnHide) frame.OnEnter = SUF_OnEnter - frame.OnLeave = UnitFrame_OnLeave + frame.OnLeave = SUF_OnLeave frame:RegisterForClicks("AnyUp") -- non-header frames don't set those, so we need to do it From 152c7cf4b65c924534a95bcfd0b936c0550d1ab8 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 23 Apr 2018 12:22:44 +0200 Subject: [PATCH 765/794] indicators: show prestige icon instead of the generic pvp faciton icon --- modules/indicators.lua | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 8fd2787f..7fb7a348 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -161,11 +161,27 @@ function Indicators:UpdatePVPFlag(frame) local faction = UnitFactionGroup(frame.unit) if( UnitIsPVPFreeForAll(frame.unit) ) then - frame.indicators.pvp:SetTexture("Interface\\TargetingFrame\\UI-PVP-FFA") - frame.indicators.pvp:Show() + local prestige = UnitPrestige(frame.unit) + if (prestige > 0) then + frame.indicators.pvp:SetTexture(GetPrestigeInfo(prestige)) + frame.indicators.pvp:SetTexCoord(0.1,1.1,0.1,1.1) + frame.indicators.pvp:Show() + else + frame.indicators.pvp:SetTexture("Interface\\TargetingFrame\\UI-PVP-FFA") + frame.indicators.pvp:SetTexCoord(0,1,0,1) + frame.indicators.pvp:Show() + end elseif( faction and faction ~= "Neutral" and UnitIsPVP(frame.unit) ) then - frame.indicators.pvp:SetTexture(string.format("Interface\\TargetingFrame\\UI-PVP-%s", faction)) - frame.indicators.pvp:Show() + local prestige = UnitPrestige(frame.unit) + if (prestige > 0) then + frame.indicators.pvp:SetTexture(GetPrestigeInfo(prestige)) + frame.indicators.pvp:SetTexCoord(0.1,1.1,0.1,1.1) + frame.indicators.pvp:Show() + else + frame.indicators.pvp:SetTexture(string.format("Interface\\TargetingFrame\\UI-PVP-%s", faction)) + frame.indicators.pvp:SetTexCoord(0,1,0,1) + frame.indicators.pvp:Show() + end else frame.indicators.pvp:Hide() end @@ -346,6 +362,8 @@ function Indicators:OnEnable(frame) if( config.indicators.pvp and config.indicators.pvp.enabled ) then frame:RegisterUnitEvent("PLAYER_FLAGS_CHANGED", self, "UpdatePVPFlag") frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdatePVPFlag") + frame:RegisterNormalEvent("HONOR_PRESTIGE_UPDATE", self, "UpdatePVPFlag") + frame:RegisterNormalEvent("PRESTIGE_AND_HONOR_INVOLUNTARILY_CHANGED", self, "UpdatePVPFlag") frame:RegisterUpdateFunc(self, "UpdatePVPFlag") frame.indicators.pvp = frame.indicators.pvp or frame.indicators:CreateTexture(nil, "OVERLAY") From d65c3714522ac7a6419bc642ee86ce10740cc6ea Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 11 Jul 2018 01:50:23 +0200 Subject: [PATCH 766/794] Update repository locations in the .pkgmeta Update to new WoWAce layout, and for new SpellInRange location --- .pkgmeta | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.pkgmeta b/.pkgmeta index 74c982e9..53a34028 100755 --- a/.pkgmeta +++ b/.pkgmeta @@ -5,30 +5,27 @@ move-folders: externals: libs/LibStub: - url: svn://svn.wowace.com/wow/libstub/mainline/trunk + url: https://repos.wowace.com/wow/libstub/trunk tag: latest libs/CallbackHandler-1.0: - url: svn://svn.wowace.com/wow/callbackhandler/mainline/trunk + url: https://repos.wowace.com/wow/callbackhandler/trunk tag: latest libs/AceDB-3.0: - url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDB-3.0 + url: https://repos.wowace.com/wow/ace3/trunk/AceDB-3.0 libs/LibSharedMedia-3.0: - url: svn://svn.wowace.com/wow/libsharedmedia-3-0/mainline/trunk/LibSharedMedia-3.0 - tag: latest + url: https://repos.wowace.com/wow/libsharedmedia-3-0/trunk/LibSharedMedia-3.0 libs/LibDualSpec-1.0: - url: git://git.wowace.com/wow/libdualspec-1-0/mainline.git - tag: latest + url: https://repos.wowace.com/wow/libdualspec-1-0 libs/LibSpellRange-1.0: - url: svn://svn.curseforge.com/wow/libspellrange-1-0/mainline/trunk + url: git://github.com/ascott18/LibSpellRange-1.0.git options/libs/AceConfig-3.0: - url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConfig-3.0 + url: https://repos.wowace.com/wow/ace3/trunk/AceConfig-3.0 options/libs/AceDBOptions-3.0: - url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDBOptions-3.0 + url: https://repos.wowace.com/wow/ace3/trunk/AceDBOptions-3.0 options/libs/AceGUI-3.0: - url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceGUI-3.0 + url: https://repos.wowace.com/wow/ace3/trunk/AceGUI-3.0 options/libs/AceGUI-3.0-SharedMediaWidgets: - url: svn://svn.wowace.com/wow/ace-gui-3-0-shared-media-widgets/mainline/trunk/AceGUI-3.0-SharedMediaWidgets - tag: latest + url: https://repos.wowace.com/wow/ace-gui-3-0-shared-media-widgets/trunk/AceGUI-3.0-SharedMediaWidgets ignore: - localcheck.lua From 0dcfbec79a11db991582b16f034a5c412a09f8b1 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 21 Apr 2018 15:47:18 +0200 Subject: [PATCH 767/794] 8.0: UNIT_POWER -> UNIT_POWER_UPDATE --- modules/combopoints.lua | 2 +- modules/health.lua | 2 +- modules/tags.lua | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/combopoints.lua b/modules/combopoints.lua index 8111aa69..cb80f800 100755 --- a/modules/combopoints.lua +++ b/modules/combopoints.lua @@ -9,7 +9,7 @@ function Combo:OnEnable(frame) frame.comboPoints.cpConfig = cpConfig cpConfig.max = UnitPowerMax("player", cpConfig.powerType) - frame:RegisterNormalEvent("UNIT_POWER", self, "Update", "player") + frame:RegisterNormalEvent("UNIT_POWER_UPDATE", self, "Update", "player") frame:RegisterNormalEvent("UNIT_POWER_FREQUENT", self, "Update", "player") frame:RegisterNormalEvent("UNIT_MAXPOWER", self, "UpdateBarBlocks", "player") diff --git a/modules/health.lua b/modules/health.lua index 4771daf2..702ed867 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -40,7 +40,7 @@ function Health:OnEnable(frame) frame:RegisterUnitEvent("UNIT_TARGETABLE_CHANGED", self, "UpdateColor") if( frame.unit == "pet" ) then - frame:RegisterUnitEvent("UNIT_POWER", self, "UpdateColor") + frame:RegisterUnitEvent("UNIT_POWER_UPDATE", self, "UpdateColor") end if ( ShadowUF.db.profile.units[frame.unitType].healthBar.colorDispel ) then diff --git a/modules/tags.lua b/modules/tags.lua index f0b3fd5d..82b34b21 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -70,7 +70,7 @@ function Tags:RegisterEvents(parent, fontString, tags) end -- register UNIT_MANA event since its the only event that fires after repopping at a spirit healer - if event == "UNIT_POWER" or event == "UNIT_POWER_FREQUENT" then + if event == "UNIT_POWER_UPDATE" or event == "UNIT_POWER_FREQUENT" then parent:RegisterUnitEvent("UNIT_MANA", fontString, "UpdateTags") if ( parent.unit == "player" ) then @@ -137,7 +137,7 @@ end -- Register a font string with the tag system -local powerEvents = {["UNIT_POWER"] = true, ["UNIT_POWER_FREQUENT"] = true, ["UNIT_MAXPOWER"] = true} +local powerEvents = {["UNIT_POWER_UPDATE"] = true, ["UNIT_POWER_FREQUENT"] = true, ["UNIT_MAXPOWER"] = true} local frequencyCache = {} local function createTagFunction(tags, resetCache) if( tagPool[tags] and not resetCache ) then From 1b81a091af27fc607ea79d8f30c06a085acccc42 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 21 Apr 2018 15:48:53 +0200 Subject: [PATCH 768/794] 8.0: UnitAura/Buff/Debuff return no rank anylonger --- modules/auraindicators.lua | 10 +++++----- modules/aurapoints.lua | 2 +- modules/auras.lua | 6 +++--- modules/health.lua | 2 +- modules/highlight.lua | 2 +- modules/movers.lua | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/auraindicators.lua b/modules/auraindicators.lua index 07d3dc69..be7bdfd7 100755 --- a/modules/auraindicators.lua +++ b/modules/auraindicators.lua @@ -101,7 +101,7 @@ local filterMap = {} local canCure = ShadowUF.Units.canCure for _, key in pairs(Indicators.auraFilters) do filterMap[key] = "filter-" .. key end -local function checkFilterAura(frame, type, isFriendly, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) +local function checkFilterAura(frame, type, isFriendly, name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) local category if( isFriendly and canCure[auraType] and type == "debuffs" ) then category = "curable" @@ -136,7 +136,7 @@ local function checkFilterAura(frame, type, isFriendly, name, rank, texture, cou return applied end -local function checkSpecificAura(frame, type, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) +local function checkSpecificAura(frame, type, name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) -- Not relevant if( not ShadowUF.db.profile.auraIndicators.auras[name] and not ShadowUF.db.profile.auraIndicators.auras[tostring(spellID)] ) then return end @@ -191,12 +191,12 @@ local function scanAuras(frame, filter, type) local index = 0 while( true ) do index = index + 1 - local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff = UnitAura(frame.unit, index, filter) + local name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff = UnitAura(frame.unit, index, filter) if( not name ) then return end - local result = checkFilterAura(frame, type, isFriendly, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) + local result = checkFilterAura(frame, type, isFriendly, name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) if( not result ) then - checkSpecificAura(frame, type, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) + checkSpecificAura(frame, type, name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) end auraList[name] = true diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index c05ead44..debf111f 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -25,5 +25,5 @@ function AuraPoints:GetComboPointType() end function AuraPoints:GetPoints(unit) - return select(4, UnitAura("player", trackSpell.name, nil, trackSpell.filter)) or 0 + return select(3, UnitAura("player", trackSpell.name, nil, trackSpell.filter)) or 0 end \ No newline at end of file diff --git a/modules/auras.lua b/modules/auras.lua index 9a88469f..177eec07 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -522,7 +522,7 @@ local function categorizeAura(type, curable, auraType, caster, isRemovable, canA end end -local function renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) +local function renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) -- aura filters are all saved as strings, so need to override here spellID = tostring(spellID) -- Do our initial list check to see if we can quick filter it out @@ -596,10 +596,10 @@ local function scan(parent, frame, type, config, displayConfig, filter) local index = 0 while( true ) do index = index + 1 - local name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff = UnitAura(frame.parent.unit, index, filter) + local name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff = UnitAura(frame.parent.unit, index, filter) if( not name ) then break end - renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, rank, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) + renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) -- Too many auras shown, break out -- Get down diff --git a/modules/health.lua b/modules/health.lua index 702ed867..0895a687 100755 --- a/modules/health.lua +++ b/modules/health.lua @@ -63,7 +63,7 @@ function Health:UpdateAura(frame) local id = 0 while( true ) do id = id + 1 - local name, _, _, _, auraType = UnitDebuff(frame.unit, id) + local name, _, _, auraType = UnitDebuff(frame.unit, id) if( not name ) then break end if( canCure[auraType] ) then diff --git a/modules/highlight.lua b/modules/highlight.lua index bbe09546..46ea1179 100755 --- a/modules/highlight.lua +++ b/modules/highlight.lua @@ -179,7 +179,7 @@ function Highlight:UpdateAura(frame) local id = 0 while( true ) do id = id + 1 - local name, _, _, _, auraType = UnitDebuff(frame.unit, id) + local name, _, _, auraType = UnitDebuff(frame.unit, id) if( not name ) then break end if( auraType == "" ) then auraType = "Enrage" end diff --git a/modules/movers.lua b/modules/movers.lua index 2f6acfd3..52f7938c 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -136,7 +136,7 @@ local function createConfigEnv() local texture = filter == "HELPFUL" and "Interface\\Icons\\Spell_Nature_Rejuvenation" or "Interface\\Icons\\Ability_DualWield" local mod = id % 5 local auraType = mod == 0 and "Magic" or mod == 1 and "Curse" or mod == 2 and "Poison" or mod == 3 and "Disease" or "none" - return L["Test Aura"], L["Rank 1"], texture, id, auraType, 0, 0, "player", id % 6 == 0 + return L["Test Aura"], texture, id, auraType, 0, 0, "player", id % 6 == 0 end, UnitName = function(unit) local unitID = string.match(unit, "(%d+)") From 8c3f14069fc7c5df7c4235d1eb4bf4b174368201 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 21 Apr 2018 16:02:54 +0200 Subject: [PATCH 769/794] 8.0: UnitAura no longer takes a spell name argument --- ShadowedUnitFrames.lua | 12 ++++++++++++ modules/aurapoints.lua | 2 +- modules/tags.lua | 30 +++++++++++++++--------------- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 151e09df..215600bb 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -90,6 +90,18 @@ function ShadowUF:OnInitialize() if LibDualSpec then LibDualSpec:EnhanceDatabase(self.db, "ShadowedUnitFrames") end end +function ShadowUF.UnitAuraBySpell(unit, spell, filter) + local index = 0 + while true do + index = index + 1 + local name, _, _, _, _, _, _, _, _, spellID = UnitAura(unit, index, filter) + if not name then break end + if (type(spell) == "string" and spell == name) or (type(spell) == "number" and spell == spellID) then + return UnitAura(unit, index, filter) + end + end +end + function ShadowUF:CheckBuild() local build = select(4, GetBuildInfo()) if( self.db.profile.wowBuild == build ) then return end diff --git a/modules/aurapoints.lua b/modules/aurapoints.lua index debf111f..006cfeca 100755 --- a/modules/aurapoints.lua +++ b/modules/aurapoints.lua @@ -25,5 +25,5 @@ function AuraPoints:GetComboPointType() end function AuraPoints:GetPoints(unit) - return select(3, UnitAura("player", trackSpell.name, nil, trackSpell.filter)) or 0 + return select(3, ShadowUF.UnitAuraBySpell("player", trackSpell.name, trackSpell.filter)) or 0 end \ No newline at end of file diff --git a/modules/tags.lua b/modules/tags.lua index 82b34b21..bc56728b 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -368,7 +368,7 @@ end}) -- Going to have to start using an env wrapper for tags I think local Druid = {} -Druid.CatForm, Druid.Shapeshift = GetSpellInfo(768) +Druid.CatForm = GetSpellInfo(768) Druid.MoonkinForm = GetSpellInfo(24858) Druid.TravelForm = GetSpellInfo(783) Druid.BearForm = GetSpellInfo(5487) @@ -394,19 +394,19 @@ Tags.defaultTags = { if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local Druid = ShadowUF.Druid - if( UnitAura(unit, Druid.CatForm, Druid.Shapeshift) ) then + if( ShadowUF.UnitAuraBySpell(unit, Druid.CatForm) ) then return ShadowUF.L["C"] - elseif( UnitAura(unit, Druid.TreeForm, Druid.Shapeshift) ) then + elseif( ShadowUF.UnitAuraBySpell(unit, Druid.TreeForm) ) then return ShadowUF.L["T"] - elseif( UnitAura(unit, Druid.MoonkinForm, Druid.Shapeshift) ) then + elseif( ShadowUF.UnitAuraBySpell(unit, Druid.MoonkinForm) ) then return ShadowUF.L["M"] - elseif( UnitAura(unit, Druid.BearForm, Druid.Shapeshift) ) then + elseif( ShadowUF.UnitAuraBySpell(unit, Druid.BearForm) ) then return ShadowUF.L["B"] - elseif( UnitAura(unit, Druid.SwiftFlightForm, Druid.Shapeshift) or UnitAura(unit, Druid.FlightForm, Druid.Shapeshift) ) then + elseif( ShadowUF.UnitAuraBySpell(unit, Druid.SwiftFlightForm) or ShadowUF.UnitAuraBySpell(unit, Druid.FlightForm) ) then return ShadowUF.L["F"] - elseif( UnitAura(unit, Druid.TravelForm, Druid.Shapeshift) ) then + elseif( ShadowUF.UnitAuraBySpell(unit, Druid.TravelForm) ) then return ShadowUF.L["T"] - elseif( UnitAura(unit, Druid.AquaticForm, Druid.Shapeshift) ) then + elseif( ShadowUF.UnitAuraBySpell(unit, Druid.AquaticForm) ) then return ShadowUF.L["A"] end end]], @@ -414,19 +414,19 @@ Tags.defaultTags = { if( select(2, UnitClass(unit)) ~= "DRUID" ) then return nil end local Druid = ShadowUF.Druid - if( UnitAura(unit, Druid.CatForm, Druid.Shapeshift) ) then + if( ShadowUF.UnitAuraBySpell(unit, Druid.CatForm) ) then return ShadowUF.L["Cat"] - elseif( UnitAura(unit, Druid.TreeForm, Druid.Shapeshift) ) then + elseif( ShadowUF.UnitAuraBySpell(unit, Druid.TreeForm) ) then return ShadowUF.L["Tree"] - elseif( UnitAura(unit, Druid.MoonkinForm, Druid.Shapeshift) ) then + elseif( ShadowUF.UnitAuraBySpell(unit, Druid.MoonkinForm) ) then return ShadowUF.L["Moonkin"] - elseif( UnitAura(unit, Druid.BearForm, Druid.Shapeshift) ) then + elseif( ShadowUF.UnitAuraBySpell(unit, Druid.BearForm) ) then return ShadowUF.L["Bear"] - elseif( UnitAura(unit, Druid.SwiftFlightForm, Druid.Shapeshift) or UnitAura(unit, Druid.FlightForm, Druid.Shapeshift) ) then + elseif( ShadowUF.UnitAuraBySpell(unit, Druid.SwiftFlightForm) or ShadowUF.UnitAuraBySpell(unit, Druid.FlightForm) ) then return ShadowUF.L["Flight"] - elseif( UnitAura(unit, Druid.TravelForm, Druid.Shapeshift) ) then + elseif( ShadowUF.UnitAuraBySpell(unit, Druid.TravelForm) ) then return ShadowUF.L["Travel"] - elseif( UnitAura(unit, Druid.AquaticForm, Druid.Shapeshift) ) then + elseif( ShadowUF.UnitAuraBySpell(unit, Druid.AquaticForm) ) then return ShadowUF.L["Aquatic"] end end]], From a1bdf00d3d396987572009dd00b0631fadc1c6f1 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 21 Apr 2018 16:23:22 +0200 Subject: [PATCH 770/794] 8.0: Update for cast API changes --- modules/cast.lua | 62 ++++++++++++++++++++++------------------------ modules/fader.lua | 4 +-- options/config.lua | 8 ------ 3 files changed, 32 insertions(+), 42 deletions(-) diff --git a/modules/cast.lua b/modules/cast.lua index 76a45cab..c2437701 100755 --- a/modules/cast.lua +++ b/modules/cast.lua @@ -6,10 +6,10 @@ ShadowUF:RegisterModule(Cast, "castBar", L["Cast bar"], true) -- I'm not really thrilled with this method of detecting fake unit casts, mostly because it's inefficient and ugly local function monitorFakeCast(self) - local spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(self.parent.unit) + local spell, displayName, icon, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID = UnitCastingInfo(self.parent.unit) local isChannelled if( not spell ) then - spell, rank, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible = UnitChannelInfo(self.parent.unit) + spell, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible, spellID = UnitChannelInfo(self.parent.unit) isChannelled = true end @@ -18,11 +18,12 @@ local function monitorFakeCast(self) self.endTime = endTime self.notInterruptible = notInterruptible self.spellName = spell - Cast:UpdateCast(self.parent, self.parent.unit, isChannelled, spell, rank, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible) + self.spellID = spellID + Cast:UpdateCast(self.parent, self.parent.unit, isChannelled, spell, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible, spellID) -- Cast stopped elseif( self.endTime and not endTime ) then if( GetTime() <= (self.endTime / 1000) ) then - Cast:EventInterruptCast(self.parent, nil, self.parent.unit, self.spellName) + Cast:EventInterruptCast(self.parent, nil, self.parent.unit, nil, self.spellID) end self.notInterruptible = nil @@ -34,7 +35,7 @@ local function monitorFakeCast(self) -- Cast delayed if( self.endTime and endTime ~= self.endTime ) then self.endTime = endTime - Cast:UpdateDelay(self.parent, spell, rank, displayName, icon, startTime, endTime) + Cast:UpdateDelay(self.parent, spell, displayName, icon, startTime, endTime) end -- Cast interruptible status changed @@ -90,7 +91,7 @@ function Cast:OnEnable(frame) frame:RegisterUnitEvent("UNIT_SPELLCAST_CHANNEL_START", self, "EventUpdateChannel") frame:RegisterUnitEvent("UNIT_SPELLCAST_CHANNEL_STOP", self, "EventStopCast") - frame:RegisterUnitEvent("UNIT_SPELLCAST_CHANNEL_INTERRUPTED", self, "EventInterruptCast") + --frame:RegisterUnitEvent("UNIT_SPELLCAST_CHANNEL_INTERRUPTED", self, "EventInterruptCast") frame:RegisterUnitEvent("UNIT_SPELLCAST_CHANNEL_UPDATE", self, "EventDelayChannel") frame:RegisterUnitEvent("UNIT_SPELLCAST_INTERRUPTIBLE", self, "EventInterruptible") @@ -276,10 +277,11 @@ end function Cast:UpdateCurrentCast(frame) if( UnitCastingInfo(frame.unit) ) then - local name, subText, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(frame.unit) - self:UpdateCast(frame, frame.unit, false, name, subText, text, texture, startTime, endTime, isTradeSkill, notInterruptible) + local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID = UnitCastingInfo(frame.unit) + self:UpdateCast(frame, frame.unit, false, name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID) elseif( UnitChannelInfo(frame.unit) ) then - self:UpdateCast(frame, frame.unit, true, UnitChannelInfo(frame.unit)) + local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID = UnitChannelInfo(frame.unit) + self:UpdateCast(frame, frame.unit, true, name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID) else if( ShadowUF.db.profile.units[frame.unitType].castBar.autoHide ) then ShadowUF.Layout:SetBarVisibility(frame, "castBar", false) @@ -296,28 +298,30 @@ end -- Cast updated/changed function Cast:EventUpdateCast(frame) - local name, subText, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(frame.unit) - self:UpdateCast(frame, frame.unit, false, name, subText, text, texture, startTime, endTime, isTradeSkill, notInterruptible) + local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID = UnitCastingInfo(frame.unit) + self:UpdateCast(frame, frame.unit, false, name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID) end function Cast:EventDelayCast(frame) - local name, subText, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(frame.unit) - self:UpdateDelay(frame, name, subText, text, texture, startTime, endTime, isTradeSkill, notInterruptible) + local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID = UnitCastingInfo(frame.unit) + self:UpdateDelay(frame, name, text, texture, startTime, endTime) end -- Channel updated/changed function Cast:EventUpdateChannel(frame) - self:UpdateCast(frame, frame.unit, true, UnitChannelInfo(frame.unit)) + local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID = UnitChannelInfo(frame.unit) + self:UpdateCast(frame, frame.unit, true, name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID) end function Cast:EventDelayChannel(frame) - self:UpdateDelay(frame, UnitChannelInfo(frame.unit)) + local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID = UnitChannelInfo(frame.unit) + self:UpdateDelay(frame, name, text, texture, startTime, endTime) end -- Cast finished -function Cast:EventStopCast(frame, event, unit, spell) +function Cast:EventStopCast(frame, event, unit, castID, spellID) local cast = frame.castBar.bar - if( cast.spellName ~= spell or ( event == "UNIT_SPELLCAST_FAILED" and cast.isChannelled ) ) then return end + if( cast.spellID ~= spellID or ( event == "UNIT_SPELLCAST_FAILED" and cast.isChannelled ) ) then return end if( cast.time.enabled ) then cast.time:SetText("0.0") end @@ -337,9 +341,9 @@ function Cast:EventStopCast(frame, event, unit, spell) end -- Cast interrupted -function Cast:EventInterruptCast(frame, event, unit, spell) +function Cast:EventInterruptCast(frame, event, unit, castID, spellID) local cast = frame.castBar.bar - if( cast.spellName ~= spell ) then return end + if( spellID and cast.spellID ~= spellID ) then return end setBarColor(cast, ShadowUF.db.profile.castColors.interrupted.r, ShadowUF.db.profile.castColors.interrupted.g, ShadowUF.db.profile.castColors.interrupted.b) if( ShadowUF.db.profile.units[frame.unitType].castBar.autoHide ) then @@ -350,7 +354,7 @@ function Cast:EventInterruptCast(frame, event, unit, spell) cast.name:SetText(L["Interrupted"]) end - cast.spellName = nil + cast.spellID = nil cast.fadeElapsed = FADE_TIME + 0.20 cast.fadeStart = cast.fadeElapsed cast:SetScript("OnUpdate", fadeOnUpdate) @@ -381,7 +385,7 @@ function Cast:EventUninterruptible(frame) setBarColor(frame.castBar.bar, ShadowUF.db.profile.castColors.uninterruptible.r, ShadowUF.db.profile.castColors.uninterruptible.g, ShadowUF.db.profile.castColors.uninterruptible.b) end -function Cast:UpdateDelay(frame, spell, rank, displayName, icon, startTime, endTime) +function Cast:UpdateDelay(frame, spell, displayName, icon, startTime, endTime) if( not spell or not frame.castBar.bar.startTime ) then return end local cast = frame.castBar.bar startTime = startTime / 1000 @@ -403,7 +407,7 @@ function Cast:UpdateDelay(frame, spell, rank, displayName, icon, startTime, endT end -- Update the actual bar -function Cast:UpdateCast(frame, unit, channelled, spell, rank, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible) +function Cast:UpdateCast(frame, unit, channelled, spell, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible, spellID) if( not spell ) then return end local cast = frame.castBar.bar if( ShadowUF.db.profile.units[frame.unitType].castBar.autoHide ) then @@ -412,15 +416,9 @@ function Cast:UpdateCast(frame, unit, channelled, spell, rank, displayName, icon -- Set casted spell if( ShadowUF.db.profile.units[frame.unitType].castBar.name.enabled ) then - if( ShadowUF.db.profile.units[frame.unitType].castBar.name.rank and rank and rank ~= "" ) then - cast.name:SetFormattedText("%s (%s)", spell, rank) - cast.name:SetAlpha(ShadowUF.db.profile.bars.alpha) - cast.name:Show() - else - cast.name:SetText(spell) - cast.name:SetAlpha(ShadowUF.db.profile.bars.alpha) - cast.name:Show() - end + cast.name:SetText(spell) + cast.name:SetAlpha(ShadowUF.db.profile.bars.alpha) + cast.name:Show() end -- Show cast time @@ -442,7 +440,7 @@ function Cast:UpdateCast(frame, unit, channelled, spell, rank, displayName, icon cast.endSeconds = cast.endTime - cast.startTime cast.elapsed = cast.isChannelled and cast.endSeconds or 0 cast.spellName = spell - cast.spellRank = rank + cast.spellID = spellID cast.pushback = 0 cast.lastUpdate = cast.startTime cast:SetMinMaxValues(0, cast.endSeconds) diff --git a/modules/fader.lua b/modules/fader.lua index 67b14512..072d280c 100755 --- a/modules/fader.lua +++ b/modules/fader.lua @@ -122,7 +122,7 @@ end local activeCastID -function Fader:CastStart(frame, event, unit, spellName, spellRank, id) +function Fader:CastStart(frame, event, unit, id) if( unit ~= "player" or activeCastID == id ) then return end activeCastID = id @@ -130,7 +130,7 @@ function Fader:CastStart(frame, event, unit, spellName, spellRank, id) self:Update(frame) end -function Fader:CastStop(frame, event, unit, spellName, spellRank, id) +function Fader:CastStop(frame, event, unit, id) if( unit ~= "player" or activeCastID ~= id ) then return end activeCastID = nil diff --git a/options/config.lua b/options/config.lua index 2cccefc6..5e088184 100755 --- a/options/config.lua +++ b/options/config.lua @@ -4517,14 +4517,6 @@ local function loadUnitOptions() arg = "castBar.name.enabled", hidden = hideAdvancedOption, }, - rankEnabled = { - order = 4.5, - type = "toggle", - name = L["Show cast rank"], - arg = "castBar.name.rank", - hidden = hideAdvancedOption, - disabled = disableIfCastName, - }, nameAnchor = { order = 5, type = "select", From ee8deeab5dc4db4fc097e8378bc7b7b5bd3c8d0b Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 3 May 2018 17:32:35 +0200 Subject: [PATCH 771/794] Don't register UPDATE_WORLD_STATES, it doesn't exist anylonger --- modules/indicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 7fb7a348..c71c9e6b 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -345,7 +345,7 @@ function Indicators:OnEnable(frame) if( config.indicators.phase and config.indicators.phase.enabled ) then -- Player phase changes do not generate a phase change event. This seems to be the best - frame:RegisterNormalEvent("UPDATE_WORLD_STATES", self, "UpdatePhase") + -- TODO: what event does fire here? frame:RegisterNormalEvent("UPDATE_WORLD_STATES", self, "UpdatePhase") frame:RegisterUpdateFunc(self, "UpdatePhase") frame.indicators.phase = frame.indicators.phase or frame.indicators:CreateTexture(nil, "OVERLAY") end From 242d0de272b47bf6ff483cf1cf47fcc33500fc54 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 3 May 2018 17:32:57 +0200 Subject: [PATCH 772/794] Fix casting info during unlock --- modules/movers.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/movers.lua b/modules/movers.lua index 52f7938c..4abb09ef 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -90,18 +90,18 @@ local function createConfigEnv() UnitThreatSituation = function() return 0 end, UnitDetailedThreatSituation = function() return nil end, UnitCastingInfo = function(unit) - -- 1 -> 10: spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, notInterruptible + -- 1 -> 10: spell, displayName, icon, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID local data = unitConfig["UnitCastingInfo" .. unit] or {} if( not data[6] or GetTime() < data[6] ) then data[1] = L["Test spell"] - data[2] = L["Rank 1"] - data[3] = L["Test spell"] - data[4] = "Interface\\Icons\\Spell_Nature_Rejuvenation" - data[5] = GetTime() * 1000 - data[6] = data[5] + 60000 - data[7] = false - data[8] = math.floor(GetTime()) - data[9] = math.random(0, 100) < 25 + data[2] = L["Test spell"] + data[3] = "Interface\\Icons\\Spell_Nature_Rejuvenation" + data[4] = GetTime() * 1000 + data[5] = data[5] + 60000 + data[6] = false + data[7] = math.floor(GetTime()) + data[8] = math.random(0, 100) < 25 + data[9] = 1000, unitConfig["UnitCastingInfo" .. unit] = data end From b92194207cfe319ae4a48e8a527b80c457e52d48 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 3 May 2018 17:33:33 +0200 Subject: [PATCH 773/794] Fix typo --- modules/movers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/movers.lua b/modules/movers.lua index 4abb09ef..3fd82744 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -101,7 +101,7 @@ local function createConfigEnv() data[6] = false data[7] = math.floor(GetTime()) data[8] = math.random(0, 100) < 25 - data[9] = 1000, + data[9] = 1000 unitConfig["UnitCastingInfo" .. unit] = data end From f7b73cb5d77e0dbfc7d90dc2b5c64d582833f907 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 3 May 2018 17:37:55 +0200 Subject: [PATCH 774/794] Fix more logic errors in cast info mover --- modules/movers.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/movers.lua b/modules/movers.lua index 3fd82744..70e4a6ff 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -92,12 +92,12 @@ local function createConfigEnv() UnitCastingInfo = function(unit) -- 1 -> 10: spell, displayName, icon, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID local data = unitConfig["UnitCastingInfo" .. unit] or {} - if( not data[6] or GetTime() < data[6] ) then + if( not data[5] or GetTime() < data[5] ) then data[1] = L["Test spell"] data[2] = L["Test spell"] data[3] = "Interface\\Icons\\Spell_Nature_Rejuvenation" data[4] = GetTime() * 1000 - data[5] = data[5] + 60000 + data[5] = data[4] + 60000 data[6] = false data[7] = math.floor(GetTime()) data[8] = math.random(0, 100) < 25 From 8a1c88c7712d10c7411068ff9d5dd8b835bdc6cc Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 3 May 2018 17:38:07 +0200 Subject: [PATCH 775/794] Fix ARENA_OPPONENT_UPDATE event type --- modules/indicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index c71c9e6b..b1c468e6 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -338,7 +338,7 @@ function Indicators:OnEnable(frame) end if( config.indicators.arenaSpec and config.indicators.arenaSpec.enabled ) then - frame:RegisterUnitEvent("ARENA_OPPONENT_UPDATE", self, "UpdateArenaSpec") + frame:RegisterNormalEvent("ARENA_OPPONENT_UPDATE", self, "UpdateArenaSpec") frame:RegisterUpdateFunc(self, "UpdateArenaSpec") frame.indicators.arenaSpec = frame.indicators.arenaSpec or frame.indicators:CreateTexture(nil, "OVERLAY") end From 3a5a437cc748576abfe09f328e9562af005c5ea8 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 3 May 2018 17:43:59 +0200 Subject: [PATCH 776/794] Fix UNIT_MAXPOWER event spelling --- modules/druid.lua | 2 +- modules/priest.lua | 2 +- modules/shaman.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/druid.lua b/modules/druid.lua index 92de7e69..a55b7f22 100755 --- a/modules/druid.lua +++ b/modules/druid.lua @@ -26,7 +26,7 @@ function Druid:PowerChanged(frame) local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent" frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") - frame[type](frame, "UNIT_POWERMAX", self, "Update") + frame[type](frame, "UNIT_MAXPOWER", self, "Update") ShadowUF.Layout:SetBarVisibility(frame, "druidBar", visible) if( visible ) then self:Update(frame) end diff --git a/modules/priest.lua b/modules/priest.lua index a7e3d416..114ce366 100644 --- a/modules/priest.lua +++ b/modules/priest.lua @@ -26,7 +26,7 @@ function Priest:PowerChanged(frame) local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent" frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") - frame[type](frame, "UNIT_POWERMAX", self, "Update") + frame[type](frame, "UNIT_MAXPOWER", self, "Update") ShadowUF.Layout:SetBarVisibility(frame, "priestBar", visible) if( visible ) then self:Update(frame) end diff --git a/modules/shaman.lua b/modules/shaman.lua index 963c043e..2dc5270e 100644 --- a/modules/shaman.lua +++ b/modules/shaman.lua @@ -26,7 +26,7 @@ function Shaman:PowerChanged(frame) local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent" frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update") - frame[type](frame, "UNIT_POWERMAX", self, "Update") + frame[type](frame, "UNIT_MAXPOWER", self, "Update") ShadowUF.Layout:SetBarVisibility(frame, "shamanBar", visible) if( visible ) then self:Update(frame) end From eb66bb1c1dfe3fbce0c76bcf00e7475ffddea8e1 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 16 May 2018 19:35:24 +0200 Subject: [PATCH 777/794] Update TOC for 8.0 --- ShadowedUnitFrames.toc | 2 +- options/ShadowedUF_Options.toc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowedUnitFrames.toc b/ShadowedUnitFrames.toc index c111848b..240cae26 100755 --- a/ShadowedUnitFrames.toc +++ b/ShadowedUnitFrames.toc @@ -1,4 +1,4 @@ -## Interface: 70300 +## Interface: 80000 ## Title: Shadowed Unit Frames ## Notes: Moooooooooooooooooo ## Author: Shadowed diff --git a/options/ShadowedUF_Options.toc b/options/ShadowedUF_Options.toc index 1d7584fd..dac346ce 100755 --- a/options/ShadowedUF_Options.toc +++ b/options/ShadowedUF_Options.toc @@ -1,4 +1,4 @@ -## Interface: 70300 +## Interface: 80000 ## Title: Shadowed UF (Options) ## Notes: Configuration for Shadowed Unit Frames. ## Author: Shadowed From 7c799eec941888dc9d14993980771b259f33bd2d Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 25 May 2018 00:31:21 +0200 Subject: [PATCH 778/794] Update honor events for latest beta build --- modules/indicators.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index b1c468e6..3bbb2522 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -362,8 +362,7 @@ function Indicators:OnEnable(frame) if( config.indicators.pvp and config.indicators.pvp.enabled ) then frame:RegisterUnitEvent("PLAYER_FLAGS_CHANGED", self, "UpdatePVPFlag") frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdatePVPFlag") - frame:RegisterNormalEvent("HONOR_PRESTIGE_UPDATE", self, "UpdatePVPFlag") - frame:RegisterNormalEvent("PRESTIGE_AND_HONOR_INVOLUNTARILY_CHANGED", self, "UpdatePVPFlag") + frame:RegisterNormalEvent("HONOR_LEVEL_UPDATE", self, "UpdatePVPFlag") frame:RegisterUpdateFunc(self, "UpdatePVPFlag") frame.indicators.pvp = frame.indicators.pvp or frame.indicators:CreateTexture(nil, "OVERLAY") From ba66614ea4a4bb6c93c1a36f81a77b42d6946625 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 25 May 2018 00:39:36 +0200 Subject: [PATCH 779/794] Prestige has gone missing in the latest build --- modules/indicators.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 3bbb2522..40b7fc7a 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -161,7 +161,7 @@ function Indicators:UpdatePVPFlag(frame) local faction = UnitFactionGroup(frame.unit) if( UnitIsPVPFreeForAll(frame.unit) ) then - local prestige = UnitPrestige(frame.unit) + local prestige = 0 --UnitPrestige(frame.unit) if (prestige > 0) then frame.indicators.pvp:SetTexture(GetPrestigeInfo(prestige)) frame.indicators.pvp:SetTexCoord(0.1,1.1,0.1,1.1) @@ -172,7 +172,7 @@ function Indicators:UpdatePVPFlag(frame) frame.indicators.pvp:Show() end elseif( faction and faction ~= "Neutral" and UnitIsPVP(frame.unit) ) then - local prestige = UnitPrestige(frame.unit) + local prestige = 0 --UnitPrestige(frame.unit) if (prestige > 0) then frame.indicators.pvp:SetTexture(GetPrestigeInfo(prestige)) frame.indicators.pvp:SetTexCoord(0.1,1.1,0.1,1.1) From 3ae44d6a492c33cae0b58186948de8525bb5cbde Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 11 Jun 2018 18:49:02 +0200 Subject: [PATCH 780/794] Updated font to include additional glyphs for european languages (notably cyrillic) --- media/fonts/Myriad Condensed Web.ttf | Bin 82836 -> 169032 bytes modules/defaultlayout.lua | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/media/fonts/Myriad Condensed Web.ttf b/media/fonts/Myriad Condensed Web.ttf index ce9546b9c4a5d30717626a8cf6089925f39e28bb..dc23c18e3d03500812258a0f00c74dd57afe964d 100755 GIT binary patch literal 169032 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�HlT`@u9~KlBj0>1|>` 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 z zTDm!Z)y5^41R@$B%Sc;bhic)G)6Wla61nh5=+24^jpx z#hJzK0?y~`W`XdD?zwa1c{6s0KVz|c=d8K1a`&){a@Mjm_45km;^DIuU&$HEGSn}I zg)iuP51o!&EoXt_9TH4ZxbY2BkTla9x8{)+BdbPkR)47lEmrN9S$&75ApfA_AaE<2 zbP6MU-57+Bm}FWQP_Z5h!tQy)Mh3N;Wsp4Zt)oKy9@`M_U9sRNi4fsjFUXU6w zv|!-PHxDcrI<>gGqNupCTpy1b3GtaYqY@Rq0@0Cob3@P};d2iOGXx!y9Fii~i5*OK z94x^fM5o+>s~5Z%H}$e+_W9z`$_r?Z(@l{tq!CI6=I5mq!J14{v5DUWQKZAnc)gWL zUMs8jGOw3uW|k$DNL7+xhq(P2DdriYNn$Y)Q;f`NGJ+~eexqh^G0g%D(_G9gxt<`) z6Kc?puK;|iektjw;y4GYB&Z?eNCbGP0Z)7msEvh)V*P{~LXW&t03RSJmTpr z6e-e(KfJ#4-D9u4dZ=gf%qb5(GIiSI*?d*_weZi_1l@ysLimO7zMk;kn3J)unLm6+ zUpvg0kA{4x(db=RDw%h)6+xpSdlXKJEO$r#5%kNr8+_u6Q`w+sPinAeaRVwx$db-i-od(jRN=rBHBI ztDzltNT#*eT4^0?t+Oh;(ZQHz_u3on9d?=T0o{pVlI8)0XYSb8r@0IwD!XMfk6q2o z8!Q&%N}JXJiAav+ZuJSLQ}cSgncgn1Z18&hW}hX?Qeu%TmP$UB*YQT26%I5j$ZaTa z7J&IH$UQgMIe0J@cqrugbJ3W<51T#_tUs~<(cc@`Abet}U)NfukndwWHm1cSOZ|J& z82gWz4?QwxX5O-$FYbNhxwqNHX)OETM-M;z__%q~f46n+xwro&>+`Pwj@dB(box5@ zVoP9sfUi$t^)@DGIOpTEsTzN@A5adm`dv0AH6^qrv?oYS&Q@o;v(wotw@KB8dVCFh zmvyogw~3GOMAMosGc%am&E4k1X4!0(TxHt14%rYVi_G{0v(SotO{kxi^;pM-T{G&N+CG1COUbffPdw7Jd~s9lJr7nbsNS}$c5{xL z_)2rfpT!x*?JZ3KUYlU%d@1mz%Q=SC@;oxER;vVR3!(ZrpW! z^2|tOyrLQsTsbaC+-|%3DOvHzZi}qA6cb;gxjQV(Vo{h~Q7v{wV#_sSCDjqHqH1&w zd#YR3S7|~+&A|fPc7ozS&ZsHCMduo^CV#_ODIdwlgCaI@d|cGzZ}szHU!`xXPvV-7)%nHw`UYQh zfD$PDDZdXIAD=IFgVd!kMS-`}hH7g)u6wK1@r>EeSNqj*?x}9xXlMZ^!rV`224*lA z;{B+e>0>^htOcm80E;#m{ktsZ@2-<7gu zr9WNNw#LM#^wIWFICn059q?T6k-EgjL_RjAE`~SRT5bAF)*GaH-ig(*v|9LBPaP;t zj5FOSm>RE?DRqEG8thDJx3Yu{nntl3tbXrD!%qc2J#{ZE(__Y;m_ zz%-Bdb6lhL;AwQ>Lq9h|&w*~96Lda`0D{(tp9U6_B5MWFX$ulR2p()gH0Tu-_^Bh| zZcCtlH{jO2*UQ9$R)|&zs>e%eu%OU|m<QxI^(SXKKY-rBmG|QGO}6!;7g4+ zu*P)84j93~@jzIN>Jo$uc~xHY+MvCPVg<{(chWoS+js9f^U;gj-aE5vbIqN1 zPTq9ilvxw+pTl<+JbU-LJ+D6g=5+P3|9t+)p`V;yR55B}O~Z`ppZz{-RrNzH^QQh< z>=oB(NEPCPN$!yJlltTpL`f_SAcLiL=THwu|*Lt3tEf zu1bygs)_UU7AD1S5G)=CZdq_v{4pCWT9dKW2nCVr3A+&2b%w(CgfZC9K946EubmWq zxpdJ$rx#-R#KnV!5%M;cr*|2V;vE!lr$$9=!4}0h$bFs8WeeLjLayDkYVXILp|`{B zduG;;n>AzNh^JjE*avez+WtDz!XI4-uM3Zm3cC+)eQMF_dVMWw!RuDxn@qtAZVRrc z^p5q`c^kbg-u2!NuU6%(cGf%lZe^{?UG1)SH@Ss)*Xh=x%#1+X^`L^<{}HDwg^c!? zklo_Co?q5QDzP91`QVs`Ugenu-^{M#o2BdCSrvHbp~3utL%DdldEmgIQhrfc`JkeT z@+*+(rM>6POjO!woIFJ+V+i&^Z%oXS*#FgUUiJMGrL7d zG*)=!Dm(1~yO3zCum*Uns+j!s^TszqQA7Yvuxs*8pSUBYugg5&Sp!}EVdMHHy?@T_ zH@tE0)v15`i)%8`V#s}Ikoz>68uT(rmVU(xCpeQ8iJ%WLwK9Wl{svRt2&yC-<=wCr7?fAhk5lwf5Ea{W z0SY3g5Ig1SZ!gIP0ethEumJ)m6TXjfhCasy!5cK$3!Q<~D|ULI6#BPwc4&LyOwKWL z-aBP|rbaq}gN(UD+lDD?|Bt6EY&SKS^C0mnXIvRC`L3MdqnpB6%h@uSErYF(#z(&3 zZOV9j)0aVegRM)kAC(DX6Y3Hg6I!5=>`2gr-nTxbDWx@~J*6{6s|r*H>H|%I)YvAVPkQfaj0})o$E5OV+O`EVPg{lxy;52=JoL4GlMS;mO2W%3OP6BLg30~ zhq8}lf0He7Z+2!j5bcJ)-thGelHp7`>z~e~>eTvFekk#qM9vKfj5RrMOEaFAH!v|F zv77sYjk$TA+}ykknM|se7$1adH`kRY73WtaS10piyS>yGQ{1&+H<2*(odz&1*gQPnX~@rgr@-+}gHYf` zZ;=*T)S}e8c_1R`N5@FG=ePiWhFF8mHOA?cqo_v2sw?=lB6@0x4E;%YIhce@U^1i~~l0TF=pKN2}@MmY8 z+F^~)R@N$8l~)x}KwYn}x$*}2MR|`b%Bt-$Yf)I2un(DxV0tY!JMf5GE!r@PO*^S7 z9#vJWe3;eDPf9X0Ffv;MEwIcrRgzp5s{+a*D^{t_!XQCGgpxG1Sglm+RLP+Fz%(3I zFR2QMjO0{jaPVkWNF<5mkRFcGQDN-W6}UQU<;UIE0HW&C4ZRSoq6#Zrj_6g?JN6^y z%kItmWg zbQGn}OgM$nEYIm$-`ht#TB)R?i3=&1X?=tnGGPJB zz$e1JR&t#`%?Gj4l}%7|)a2`8*!y4|K(xe_D)dfKpL z6Zvp>mwb#HZpiIh7)q3gMj zTc!1;4im7}G~2Wkrov9FW0Sqr-fr)-%WSEeHM-d=1}1gc8C&mQyu-oPx|q+!x?og- zAj_MSPKDRG*lNSi47>%>E)3_KR@URc8wd?~Crnc+W1f|g+p@CG+^5;>G9NM@GoLma z&1Tz5Bb2So@?ED9QLw{oGLYHq?X!)^Cgz;42FI$PrNUO?^?C8hQLH*Gx+Q|H=$nFd z2gSk@Lb8yoguOfZ6h(x15ZwmQohYRe=I!3!zLy3;jRH|>q?@**N6B>V?Z z4t2x$th;CJJ@xS$bG9$f$N!}m3X;+|;OYM1Ps2UouftzP`99#V>;n#)@J;>e!9}fZ zMy*&(U1L(GG%791dT=}S*c_}ahhQLy?dig&+EGnF68mEMh${c^vFm&`>jMUa@?&IjE`T)dTXR)v9SVoKx_14fLe@ zf_9^$NS3W;X`vdlsN&Q`4;*$j8~d7z5rb!lS_ZJCFbW96fB=3XJcga@naO8{he(DM z;kZ>w*{bl}y?ygb=-WuQ1aB~`R)UNa^iA?=CaG%GRgnuM6aN*^h?O(x2mWf;;z$?h zeP8W5YLO5fxAGa`Qnn>LUi4SGqUU*izGdRS`6#2IL%J0F#d-sSwU^byvV=W#vwAxl zYpOGGsR}2Kv;OuW_PKVc9Qw6Pcd@$>`j`=hxrP@FZy98%Rc5}`e!pal_24|=sBv+o zT42o|3oom_lcf?)6waVg21@X;kT#*EQ=BnQZj^jJrv>L}AvIAaEDjQh<0K^gbX77- z@pOi3@s07^MR9#+>Y4|Mz!MxNFacr>1jf{ydtYFQuBANS6nubSlXYAH*%w*80%Z+z z{=2hO>`WabefYDE@F(H-Sq-y4_i)yPrEh)l@xJ<^5Bb5KsikZN{^`N(?BVB4qDae++u!+ueV;0^}+%M z1>(?xt2^ixo^1ufsN_s--Nr6&+ZI;0DP=te`4HSkGkc!y!&_E}J|#*B+VKBwB)(9B zomX0T)yNB-y|D0#Mo|6oUR1+aRq)&@>RD-6FcaieT-Ds9#3}uiJ&J6Qj4KTW^GY=q zx0Zp>q+OcchwOrS={j_r$|&E2>)I*AOljoY?!?``Ft9}Jo^j=dmlx-$OH$6}v$ zJk>W|=?(O2r#}Sefkovn${@}*MliUv7+DK$gccKHJ`*c8jfJvJ;+3$*_{_{F#%D5H ztrnXRp+PY$GMYR_ycY=%HOmpR$zwK~Op;=?Da>pkmk}3)$!azjjXD+QaBDL=B^!>9 z<6n-CpvkZfUy%QAGI*-4Dr7YJk~8@Dn;J=?~I=2*7C>Ek}QEZOKgNMOZ z7fI z<}Naui`=yaW099+TIBP3d_J!l>yBL<)onU7leXCH@VMO$yVYb}WV3s0HoF_TKp(!4 zvbkiFH`Za79ClN1#Aq}>Xc!(hQ>QDo|loCq2{fg)4DjlM<9Vsasd?odxq|5s2; z4^dGMZy2D5L3d(Wkvt|LP$UQ9uu5MIsCaoX#Sj zruuY}I@T?VGZDY;05LA%LPWNV3IzPReR?l?)<2y?Tu8?wCx z{#?Nw`}9}=V)%qr{{cc@dj<0hZ%3eZX{n>MAh)#7F8W>lL~l%dn@bJZ*}!tVK}+A; zjtF(M2j*ute8*L)p+SrYW(}U1k*Ts&6U$W1EY)4$5}q&a0=GOT6Er0w{6W(nE3>#Q zWpnl0$4fH`et7uEXnx?HcNT5GGLr9M{DsZo&wEDTm=qq}__ss6O(#~-yZI#W*-c*s z8?$6~Mq#I+oj+q`r(q=TP*}Py&PbAA5BV_|*r4Zcw{_a&YYt~{hm>OAf;LDhm+sPC z(B7Af68^hYn{|WrMe82xTd+v>xj2omj?+^FYPHF#rTk@)C5m?vI_Ssm7971}mc zQbCzaW`|G;X;#g&(Bg1PPFl!<7LmL&Ty!;LbhSen*RJ>%+7uY z_vpQR1v9*HF1!}9VHy0w2EcAEbelg3PVovG8BTAb85Gydq)QsB)D0RPCb<|aTqBq` zxgB`~ltJZD%#oBe- z_;z>e9ie*9+zo8VG?*T}Ar ztFBE=a2!z%RY+CBCJJgSZh@#6CF4Hy^FFaDrL}d<$rIr#hi}SC8P>XCd2_jvA9rNe zdmkHmPRP4^E}GW1%x%;6YnWVy{SvmTSAtFRR5s7X9)<8&2a4SanY=!cK^ZIjFr+#g z)4i)DVbL*-!ia4n{9WF<)S1bSuGC;XQg2UNf7+B~r^sONCj%0rdzpA{_RN z?`&;ZNho~M^XKr_EdKN-%=pvQTYK)>zGls~pRZp3a{lt7ISP9S|50x^YYhJ+{M&zq zcmKdJi2vem;oq^M3x8t;;ok~uZpS5uYyd-HZZdbmhJMKmH+(M`Ux&@M&}#Nrtw0$v zc-EA7*>OlFUaw@ekt=p3O9bjX3Uwib)OeUi)TO<)D4W?KS*?cn1)4fm?Shh2cXkmf zk8glmFo*=aF+ik#K%~}y&h+V0Lr-b+8gDq4Uy$pCB}x275eh7bK&b}ZWkIkay-o^P za-qf0w_$=Hy4TQ6cp199sTtA${9i&p*9G_Fl-7Bh{`RNOpB(tZ#85(E+`|t|n=^M! z_|jMA$V@0sh^m$kB^VMCbglB?6!=IIR5qMq7r@&mdbs*j0YS$%W`p=@L`X8n z%nF&szRWy_?aI}Sf4F~VVjFZTw_qW~7WPJU@m}a$golKnf;vqXo7T%P_PzCrw9#n8 zRkw-EG~FurJs)=AG11sEYgz5A@R5&qu6&^X_*wOH>YLX;@n65$RFps;7d8Coo@qDV{(AE--q-m|2i6g{EA)g#yGiA%B}sW5stOHar7h^tfT9K?L2$@~ z^EVd~c~rQC477)umgwxCy-< z5`^!RPHyh2fiNSCq2fY}I!Z0u);#CRwoiWl)_Y3Xl~C6&*(_=Fl{drx4F4Vfs}mkA z*k2ds{w~I6X6eD#I`EO3@Ng1pATDSC@8DfMr#B{58Cf^|?}S6G!HBP7;*2jEB}IlV1OLQMGsy}#0?jl`Q%on#1W^S4+Ig62kUs6RD?!QW z0=ocHJUD9!pU~8!HMqu$q&hPbIL4dc)x!qAsQnvb=@HxtT$+pbfFeqT3g6S`4+OR;~yZkrJrZ-JPC_YnGTJzmq0 z4CScXj-JUF9ii(ug;@!D?*>4DR%(EGz0`EM-NVjI(?tzACuq2=RM}BE7=E;Oxbe z49o{@rNoBda??2ygU{#VU{-9d5}O0J&LXGF<8-=AHrrx%tjBG0xMPu547cfG#i&Te z#j)gxjU`1=4AP<~9*R72y96#8P57)!U?W^IuwjbJ-C<+Zw&S+wCo49aqtkgDW?(0C zI!(q-NQ=BH_M2F)LCounXIeaylvqi4uJTHF+^xqUI>b-E0$*)7-Zj7vsHR3pC(w67 zK7oQtmsN!JQ@r=;^MS6}0zrYWaKnqDDqgZ7dy7OxBns8ONYl|ZdP`nMN`bb$WL1Cb zdlyKJBLdLNUPWy^U*utg0_DXYK*%rAShm1?f%uSH;uu0Vj08L*GgXz?9_l2Gt;Ff(sP@bYK8$aRy=&20y26z~MNiW6 zI3rH>R4_7+FX!91bQfpiEMV>)xBSc^3C~l84S;QuzX;6*=nO=4L6WKs?67hiJJpH* z;@O3dWpIdeKh>==+h$`g;)@M7m$k7COcq5@kxj*aDQTk(@JO%gby(^!DRst1V~cUU zvBRjatxl-tqRKhh1UbA8PkiY)7E}}eGqn!?KeU4s1DU+WU=lN` zMiMlzQe#@NyV5<@-QpHLd#V9UDfS|_0iW~1brUX#4Z<6-LFi;~7370a>Q&BM{jg7G zgM>y#{}C*B?^fbPPmSV?jwgb;MR!||)~9q-^yY=B8jd~AW`>Q!5P=Ol?MGfLJQU{8QBd3Bz=|F-bD zH~uSGPC2tTyo8rXmYy?HXK>dQd|oU5R{=@)>GN6`yi3zJO3E};8t@NjasL4)3{_UIUDt#X|L;~z{ z_z-CLS1e5rFGJop(Z*u;3>8*dn9|Ie}I_+{h-u~zsI z2t(ef71tmEfFoO)h2LfXvm0S+!I~5NW@~K0=TEpNW=_ApTU4w zkR%&u>SHvp9IynlmkFI9%!fa;5m;_(5a* z;5N3am9@&s#f$QjG@qqQM)};OB^Z6zixOZU2B`!yPbztPL@DM~rhM*VsB1pj)hZ*| z4#Q-$tJZS#O%#(_phA&q0CWwE5+FaZvDHWf1SVe`<^p9Ky{+q~aCc?Z9(?XT!(;)! zhrNp2JpKpNP6)!Ha%hJi&Va`|gQ;G2)_Wd7w0$lXwB#Y$k_V-u2B~n(@Op;;X9wOJ z0Qb6}d=3WKHrr0yKHCwSvKeOBStwSasL_=2uIj*GIUIp#mnoq5eVe_VNII%R>Ymr# z6>u3+ln&XEvRP)S8?BmG*FS(;vND@&vWBer)*5TQwNWVQd#z@t)hD2SP=h^Ej5Tu; z&^EA-Y*MCgFqaqWpb3fC3Bcp)VdTfV-k=N~H#TU3iX$Zjj%hMrp|z8aDx#bEW-PX1 zlFBq}k@W{{Db~=>CUH5Hg_D_ziY|35zG#kG+ ze(;+&PF}_r#@BXDSiWIb>rY<{ogQ^x!@#_QXQoU64GWi6!5(Qh5W`-&^rE&7>K{L4 zIg3F)Wjbqu&JWEysOG8i8g;8czGB@VbBq2F`k7CQE{LvWO zAi1wo4zwHDapNf?98fkJ6dCbFI*?gI*g;*_*n{Bud8xHk$1;v)D< zfHDfU2HS(DgNhkJ^o7YFx}MgXh@e9+(B~DoO9Z@J1kzg);|T8}{L=!s!z(KQ${Dnv z%ggxwaO0+5eDd{M-}+{(e)>b*k3ZPBdqXiZ|NeI@Ex$eco!!s=E5=F3$4*YnpH6Lo zn!?VfFp)ORXGPhpXj_y|LvXCevKIq2%fu$ohiqD4L4Z$lEpV-NZFWJ_8~kaV=0LF1 z?KkyUlxZ(Me)K<|cy6rHGGp=mD;LjMZfN^k z+lmbx&oJk2|C{;O$0H|KKKgGze6oLMqTgT2*_a<*pz&VP*1|j@Ff6Zj)w!?;fCmLG z81l^b?hIhcz#XB4j9oRz2!j+-y3B!4m(yhgMzH>h6tTm=9GzCrsTWim@I-#ezscic zn{1lcr2qbxx*$3Cq!e6Rcz7+F8+ipL*@XGri9q7>Am@)dt>9K#It`J$PFH4Uz!i2vbvLWo!EEFjrlf^CQd4bd8<~lA zSxPaOA(9OA&6boEo2q7S^lE?~f(;j}%y;AIy;+Dg^Hh8z` zj$_-T9g}uXh!Y1(#G%~+sFz$C)#XNc=<1NiH}-Gay)1vp`in}#zQnWR%lylSLgBIVe9U@FdG7HKgXNvX!e& zsHw~WSC5}bj&7sNx*3eH5G6hfST%ewr@W9SiB*wY4zvsa9TomXj2$fj0!CvB2?0&P zVLiJ9KmrI?qu;%5zjEiZYj^E`e(DNC+rWvAV}}Qx;S=Hy&l`9S^9BhtOcQ#mQyP1a z`MFa)%!c>bktWEB4hmizywKe9OUW-FNgz6Qx!LCV$?RCMWW~jaD}&Dv+VK_W*Mj}~ z1GQx(H;pPDag*H7BIN{BzgdIE{8D^Ao1BPM&C^0Zgnh9{UL$XnyJf`$#}Vt2B1R{Y zjfZP4ke($Mm4fBup^I`MTWhmPOF>3BC3OsOVN${$u1stiNom_8=Z)f(7#~cTp&;@q z-|h4B_J8XDtGH4MS?*As=y4rW{bJqr20&7AF3wUBwLLt z!iuV*S^)Dg*eLesF&dmeaa#aEf`1WdrZl&@O^Vrs1Z@|V4zq5yYfd}O3w=tUn^0_Z zlo?R5Btc*s4k8+0H4|1+$1=E%4FNOg;RH+_Oqf9k1MJ0oCENR#H{$(l&YSVS*6%m8 zUEHpvvb*BT2Hs@-bK+g-yuJ=t0ba^dChQ#8KbRPbfhNXQWZVtB&D3mW_Jk$B?DR*w?IxFdv*$3k z^rdVL<4N;Dw>QMF*7kyjFPk}}tmIM?+tI*#0DXT2-Vm4}pO;}svEq=^CzcyJr#l?* zPXC8QzZK=~io9}okFakKu0NMpe^`g4zF{Gnx-7~aKkgl+%vu|(Rz5Aw4y6s#1 zjYUti@7%lh*pY$fP~ye$z`X;z_?#7Mw=EsmH#lB$1IEiIJ+3Vv)1ewRH|#(QcApvq z!ML0ckQF(44w>ayfNpJb%5t@v1u3h8_G2hn$X%B0G#ajMlgqx@hRnwfSti95%85q` z*s$f$;CdkW1~(ndEiuWkoZL5%YkqL=(YIlt!iq>XqM*tC2mF_}9&E76te4jB-rqZ= zh5EVe$$x!u;7RO0+m;PHkIq4EL2sXjzS$soA4cy&@QEFA@V%bH$mFzj+YZ^};{nXc z8l_(8QT8f_6{Ft&ZU9CPS&Rmk-v!TUAQa#ZSC9&60hys$rXeBO`@}C8!zU z{BV63=6H%aRMF78r}qqTYjJ0Br|AYWAz5^Bg5*omuylDM&s+5Jy}f77{Z&kca7PV_(mvn3Q?7@U4ubiNH zq8p{i!VGD~w2m%{CJqptTuKdgIs&pYt<&Uc3^#{4!uM)ItxoFaCNuO&t9~mz!U(Zm z&j>-dQQSY=P8ecz6F&z;OxPY`3VR3dUDEbQ8B9N;sk_#+)1=IP>G6O4v2JO0CGk5Z{5 z>}#uV!;8^px3o-4F*y8=9Ea>znL+idIclXkPMxM2Wh=@f^ubR?RT6T|E->^HBTloW z)zV`zSR@OqBU+hmtV|D9VvX>RCVHpe$78sUQVDv7x1<=shc zG!$5~W3Y=q4*kreupf_EnGShelwgf&G{+wS#VLEB4b^TB%eks*}!+g>eiDr zyHgaN2Oa@zb7?hcSjwR=7}U0!Sx*WR@!~FUWX4`-3tK6P?#43x}rQ81=XS30waje;n|?^CI<(? zyDjhp;wE5%>HiPD5O2v`8x#$=JCuU}6^%BR%b{MKE@;qDr7BsNl(qTu=1rV_%ao7z zwYM}CO=#36jGFb)3*Fx-+ECk|-T2M?mS^w(LDjmly6Uo9hA%tZP9_}YT@?2+UqLMt zsYScB4myaAi$H*>%W5@s+5>K-%ZG_}3W5LLjx)Lp;!vM>=p}O9z13u)xRDhj46xivGGLzDcjnBh z;%rmZ^m`xNvPD@{dv3$P$NMdtd|O}SVKP{l)QWw7tlW=l{*E>)1V*SDOcW@6X13I` z7Ww&rm9?9D%zME=~J=K7o*F^JaF%_JQ5u=M+>H7j5}&xt6TzxqH9Uxqsj7E9L%y zG50^ZVaLB8#McdgYQgCTLQN1CP-Lb?HU?!NI@x&5ru*z=7DNgn3cqN>B{Q6} zX4M=t1Ga|7)s$%sib@mk08X=Cfd}-o%1#lL6eypOuUQNA)s;`0ZZmdb;em!P%^_LU zB^=Oiot#3pVjUir&P%)w0U(4lfcLUUi*ySH(gwq=$Mjli+~xR(1tEyI5E>i}eHD>G zQY8@n`v=kNLc!66X6yzJ`P9U^($|*0=I{Z1mUv+85m*Vp#6(~(^wPiC75CBJ__1ej zE9<7r;m=>J5o-uqH`M?S@-5mWM4wOj8AkiGft^;wKQlY!rGJvai^!=6*8UlHLUpn8 za0&o7WC@0Yd}OdKxDB!IPlJYj=V>S3=G^K0)G6_8|tT3@CTuR?*2bzRQRW0bHfyDhuZ=y83^IBHJlyiV2}bO=N{yGK}v;j zp0ieV7Cs&=hMz>NUV`vpL1NaBEH;a3+iG_JE#<((vB5~J*Q{PAu(wWxd1#{5YaJAn z_5xvydA3ywVvYqt7KM11G2nE_L1t8uEQSe&H>V*A!2k9&45%6iJ|MkqLGVg&7(l9B z33{vXn}D;idP+MX8R%7l0r?ah`PHxv&mwZbWUpL91lV~JKO`NO&PsAM)?qNE8VQjp z^}rPyeoXqEDL$PK3WFFtzjv{g<4x$(buc(g<8e`+lSt z?Z0@q&u29Jcz^uUuJ$~?l2X{-gZZ3OJ(u?ltlT`Azk0ETeew9p?Va)Ax{M$^j1TkM zE&Y$ytK%Nz)qFGWhNbbpv25LjYpGi)=+U?h=2OlN_B23(&RovL#yLg)~{vf@U>*yyyFWfvv`XnNhU zf~t_H2?^IyzL^C@yjli&()Ewjh-G4Cjg9m9E*|iqxy}q@Tax{=GcR@k!s}c9tUNeQVq64-ie)lDX`BWufDTT@!eb^nqd#iIqa@Lfk{K za&Y&=J8{ra8er?Spfh=tdz}|JvUQwI>F@jflE`bk`(`9 zTX=i($b03(azFS{R2W$dBHLh4Z5G>BX7Dka zgJJu$bxIaPr^#ut=rjq{0<3f#U?r2o;J~~#^&rczA5$MbR!lb9UJ$gPU^f!AK1Q(H zty2Vn+?IMfI5`pS9>uCf#2XZJnf@44SANqRpUhk1cNDUd&1~n3D;>(i%LZC*RKOZQ zeW*cv_+vzAhe@lnSSXest3h$-#+U(ts-QVfaJkMfFET?YfE3D_{x3i_X8=y-)&M;V zFg4v8$_F2y>ky`(EJt#j^jf8$vLJ(jc2o`{s%4GJjUg?<3_^@R+Dbj~1U%T0G3D$A(y}-C=v=5r=JCM)rnB91d=4?ifFB zLEXA7%XVv1>nHp?Psu!*yZqK~JhQBQL;bvY<2%sDopBq>5S-uXeX;~T2G>E6=Y$sr z2C4Z#B&?@8?cB1(@WF*re6MP7Y&K}wYAhJbi&e+!Vl!gK8lX(gAt+2W=6Z8uVstXV zPvHib0~Pl)OUBUA(JaRyZ-4;P2S{@yUE1UaFDww5wf}6SK=z}Lj!`gT>7!O%nHU}M z84VpqjeWes=ICn6&e&$dP}ywlvDk(Vn}e@v?wC4tUj4T9%bqEnKey^=rjqybin((u zb}!qqZrY5EIUO_~TG=y7DSrn%JhQb?Oc6=;HU=oS{_Qm z`4y`ZJYuS?+P24b-lmvrwh)}FPyz)=gYxX>G`$Vd#_|%^+nB$JICqmbOHkhi;R>lN z7wjV-Ue1brao?u-Wi9tST{r)}^|Noh@2-{8(-*V-J=pWkSIc$s47h+n)oxF9fJYETgF#bCRPFYV9aQahyYZ*U=5kBd zqiP>`gEV_cWA6}#UN4eTmJ&mIZN-Su@4Os(Se^rh_Nt08xBP9I{3^z7{iV-j4sPdE z>1pl8Y9Fig0OU}B`%b!4!g&_zN=XTH@>J&NI&ME@KWjg4S3sB5X==AJtC|xF3Rx{u~vj4>`RU;*FBL1UR8EqK=Q9HnZd2Q(oQ-)<%chVRe7o zGQMONuds>Mx*l#25Z{OL-a1$`OwlX&XCUleQZtP=RRxn|b@(=SN3o;N=aO}X?_{o8> z;=GNQ9!9KcD)fX(_8;1%ofZ4Q0rO({C*@G*3t4~Rg+d<6%Fp7nVoPGY8LX5qM%e4& z_u!c$wH9m)R%TJzo9fpHaP=F`Ve@6_FM`O+B<+KLk$=bPsY`Er^o0l4)&JWQ z2fkIbeABGucR%#%+K&4E9oynB%{tsuJK@PAhVY7-iDN3KRE+6d)G>c-^S0d+Ry9nm zzvYgy+dA&tGJov6jooqMO-)PdYm2JpuO59HrW^L!Y^9Nx8N!h9L9i=lJLP}%n?0}A z*uazX%? zy07L8qy1plm zM3b)PdCHl$6xtMOj&y$8(EBdM^G} zR3ztu1*a-ESN2nLhog#~wL9^d|G1e_k*l1D^;S8L%bLkrC7Xur9maX~m{7yrqi=+UU^&McRzTP@5TCRj(1-Ig+e#d{@8Dk$N6u+ z|4sZYR?YpBi@Vl8@Po36wQueE(L4Hl8U^5SzOoaX6*1|%+AKo^Aq9BRRNyIR_`z7g zc%sG+u#Hw{9yX@zj65VZ10M>oAang$i3LC9I)7qM(x*dT(j3RoSiL!IO{jrsB_ zq43ihHsf#QbZskK|yeRk*f zTQ`+dPs94Dkhb&R$aBF9U}YuRco8!@Z8~S-Z%SvRPvILl2mcqqd@_HNpW&avHaQ3A z-J8}kR>1g>k@u$gj2W-sXnxahhOh@H7Y)bUUo`L}5LW`o+yHo{_d1gTZU;w!0K6w| zXrwm5-OK6y?K;g9$A&8t7J+3*RwLr^h$id>jZQrZ4IRc#h|?o<1*;Jx3BCc~wRunY zP?(3q9vDqN&7LP%xYhs;Z>#|J!S~V{=@e!e@jZ(jS7_h^WhcqVAlwx><8EthE_hwLHq}sf$#x9&}8N2$jbi4X9brm* z;9ri!FUUnFcXYk~UU%oa@iCL%<&6HejfiHX8xBa zKm72?T_66ofX6yHtsJB05x zYV)Zrmulomd?fhuNG?s$YL0`81}<;26LZ_fKDB*q>T)@667+_c40;WK#Gx}xm=maNLL+Fxgb7L zkV&qHue&e4f<1EIz!rdXXq+2R*|!1#Nj2&1&kFCv#{N3&$5@> z6}iqv@SHU^g`A7l=|{j|2I>r)MTVzHCV_VX{Q_JNTk;A5e=}p(r^SRP~0>7mU{$CgjfEu=3l}X0K*t+%x{qKe~C;_>praJaE^oPu%q& z)#{Wq$e?2MKO0Py5z2Gse58Y_bHP)q)FrBIA%P)6owCeGU4+V7saZbY)4tY%6tT>A z*SM8rC>@|n*wpx2pK};?-mf)MPeoWZpVhNQIBr>X7CwJL&NFAA-+e}7kh<@&r2_ND zQfS53~iZARU+=Em&UnC6=*8|1Uq zs=^rkQW=R_ca%eMqgJqnZABr7q+KU+C?J@VR-TUT+kv_dh>r znH~(@w0&~C$}n-@o%pBUuH)-59-}TjDH{#rksCcyi}~SbcQBXD0-Fv4!Hg)(60+yp zYsiPRCZPjE9MV<`uNw*gmI$NX04Ok377|ckEZQvYSmk)&-BrJPddq}Wo96R%?>+y} zYt4?Y=Nm-)63k0%6yJqCq*}|T_IsXNtu>Jgw?>R|B? z&UOZus?B;7F}SV~TU-vB}%yi5ADB|9l0(BU%ADTl`rq?^;+Ky&&rnQP&Np8$^E_CPkR^E}v2&bqmPoHS1ubSZKBz@8deUez_ zskR8-BQFv;X7F2Z?ACwL>J1X~NeP=h%xfd^{xjgwLFOYj@H&vwVme3wC&(5PLVp4( zj?fe0f$|#i`mntyPIm!cGMnwBEkf2pc_e@6~tKZd?&|LokuJoZ`pXP<6k7cT3Gq%TU)^%^dHVTc)WUAfZQ4<%O~_(OsAaI1V0 zKQZu`WPU;Bpzt1DSxIdR(AK55eO0uTKBKnMYJM7RU5BV?DQpy0(o~7>AWsb#etf4) zeCNIk`uQg$&i^64U-BZF&-^TRZ^-fTbIYEys z{WJ)s_iFe*5G*w6M9I)06H0Ok(!r3f2lqQ95%y0qKPgpG$AvZxt&0~dC%~GdoxE`k1_IUD2C#8D~25Ig%B^SWQ8<#*J(c)In;^v zF4zB}{Z#4mWcwh(tT{Y*z4NyXUe7cz9incDxSj~LcVDmlmcjN@r2oeGGhqSHm7@rw zD~4~$r7d1mc!CXho0$wxV1`8CqZ(u)L&Xg&)E#MQF*64fo9yukx?tEiW;a3xCR+&Z zwVq5T<3E5i$RB*ljIJ*k~x@Q9e^w& zXw`!F6++GBZxa?C&bZq!E2%IG49b5%m2q7fVQk8T(7@LdacDf_Ez86PqI=kAQlmcb z5cfK}l4Q7TZp$6Bm(6FZ`rfE2F0QC9EUp6E)lkaeiu~pYOBPOCT=?}nhW_G_wWUS1 zH(vY>aS)%>Fb_~=0TxdPK4K^E*{^7Gu^(FuZin6O@%dfI81Nb_V=N!x9X|0&W4vzZ zBfVUw^D!6jN#@6l8fQk3Q(7J)M>-Of9z&f5aHM%r^cNh94C!1-HSpGy&liM#O`9#n z>k-6;CMiPs0wsg0$OsI&lANdXN0=7Z8P-9rW_2hxGfMIvE6*b9gDQ~GLq=Uw87cV( zpJ#D!rWRzgAH|mzvAqMY6~*^MDJe6J1W)Vs_@s__#&-6`Hs1F0n;<~P#+M`Cb1F8) z(b|9S&0t(-hX=n~%FYzNIlD9ahuQKHbDMdac_)Zlj)*z>srhRp-#3GCm@g7sM%{wV zXb_|n z@FT~+JiR~z}9@t0_4WQgyo zrX18?O77HyZE0Vpwkn@YNMCTDx~LftEdV#>u!oRM$n;GSd!pFi_20Psy{Q1Pi2WT< zG6#L?rQXY@SCg6{(NP;l~UmPNxf` zu6uw84?Kucp82L4Q@sfs(8!dNBd&*RTGVteGL6%0#HCEdE%a~}CbLcfO+jNAvpNkl z(4L8Km$1yJ4gIe>t7Y&O=v>g5u{?JUJR5Ml>U7Ymn|E#6&Bm~zf%)HF&0dRt8lC#V z$7fE|YkbuvJ~9&D6aV*tGN3CqZHl{$ESp6yLKelf#C-e6xEy0yChqAp)XYqbyg!3m zbC`c{11#)ESfm~Xk74QODW2AHl<%4{v zYE8AO$#vC{B5MK@SWTcQhH0J0CQW6%taoaB5_^7Xd~zIbpO=p{ z#_QSP#&|=#p^+Vq*EcdOMCe>&FZF^SqXYQ2h?Ij=j-RyWu!b05*#Kj47K|~uA<8JY zQ-|1&LWNC0pn=HKxD+U1gi&Q-e}R9eAFB)NZkvx$DS>(?(E-)i>XF|DFqc$kKxCv2 zL}dmD${e`u#$|S98ZDu4s30^l)DYSkf^kKwbB|AUQI1y{Hbi?`T6Q#=?v=bA$!a#6 z{Qf{Bl1ffGDi@3@&BBBmPMl>Hu$E;!3cQ-+_68qS$v3Cqv#bYUU9<3mik9cNm**;i z9#X7R=mUa(8*U1Er5}e>ZKq*AMwH1IaC*l75-n}EUbUpJ&(VjaYwx7 z*895;jG8p+rI&%L(^%{5u93aJh#yCx%$@UKqDC9z|Nh6rJNa`LKb^}e|NKe^*1X`d zGp@oKxFNBI`!0Q?OC*m6cKy||LT}$Y*nTp50PLMYg1O!Qi}q8QIoUqsrS_pK*Q9=a zT9f+qOuIAKfJSGMU||?-wL1Wy?_M ziqCa!&4th_9f-2ssg3M5?g6L&qv$qM9u0*c`(Paia#)}cg2+VOgNT{I#Qp0`S}JyO z*+u-?VZq|3@8o5PEgkoq(yvHAOel!}TqLDscP z(J(gtwdLRUy#8xb{FvMq4_O{wyJ`cj7x~x78|gxRev$N?wzRphwUFog*jAB!yCi#G zHgCwBmANx>U#24J7yv-e@{o=WDg$!9g*t=5aHl^|(1}bmAQVEupp>=AX3N`TGNo-& zJ%lD9^Ld76k!Otu>X^qD16Vv2?=o}QerM=^3%K)y9*`syAT^8 z3jtyH01B^Pc5qQXp&qE$GYj3UVE?av)^Vh`J^kicHUHARbYgVuq;K9;Svj+0uWRvb zC*=*y_t)O8nYY$7$HtGpYfIhtev-W@W7hZ^=TtVeR6RWvIXZ@Y?W+bnH zl|PWYh9YVkyY?Ew$+prxNV13K1qqZ{j>dB0igmFwcpW>E?b(RnVEa7LzCfHkq3_5v z9?C`Jy5&nHQVo-}pY{~7t)kGB%-gKn5ItQ4VYH}ZP07|0nf&!s0#4y!c$l|&cX}1U zH8|{D#{BQ9BZ4F9M$8y-XvFamr$(F|VKR>x5p^2hh4}>GRn_GTm{O7Uk}9(3d^|Ed zJEbe?%Crq*Tl}UGEHq+7Ip{Ko0DwT>MAWOM08ffS_j%gLyu~~?lBGr><(u>XcC)7y zj1nFgVsNco&P>xos8E#P6#Kl4SnPq-r3&b8;DM=FCKenW2+J!%Kf2;Xb5hJrmPt`+ z-2*d}jR!leh-C-M$?c3;o8-}`OwjWv7Y5FJ@1fQ?(R+Tlv^QIs`Kz`rWetPP>P_fAIOzw%X=7Z|rK@bD+3!)u>eyj?BF4 z;*r?I)!jYu4bPpPI2CF2;GvB#=WpRY<+4oemsIf!C`=%K`+?Cu$1iZ>p43CBoL|?d z6R;pzSZpS5$eZu2@z#5xKma$U+iPiE;+70$h&942>kMDTZIjdKlLN^hWxo-0A4F$?n^TbNwRUcJn2NsLJo}|Y4;V-b| zV!aVRaJJY_zCkht_!_{D$p+(6B;s`Da95N?c~oE0?iN~i*ZtlaX&=5PbkWpQ`d;EI z)ciWX!-}Nc$@Z}{YJYjx7}B2h4gI?Ak$#N!iJc=4Ux43q=uUv&xb!9_TA}F6rx2#t z8&Ot6NNyk)fHhNx?n~H)kO4;fD6BEGU4xW$(N+Nk{FQAl{RwSfy4;o(?M<|`8mX;y z$ayclg|=r5blv)S??GGL(nP6i8PZ+9ip2iKrFzJ`S&(_aup%Hi4ryFco6OdLEwU{e zi6mjR#t&K-hD1E7rLh%~4${t)T9ewEDqBE8m@1`)k?yAgz(#*1!j+rhw1SY>t5&1Ye4HW1H=f&0Ybn!6U>ci+6lE9I{yHdi&woA!;R6Xre^f9bz2#J^;gKm3N-s+84t4&1l% z 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

^5POnv+w5}Nj~~!)IP8+7a|X(Jh*3uwuH7f8 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࿪TbmRQ0ovjINVw$@?p&8HdqyzDRUPi`w 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 delta 25705 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 Qw(;;h@q&DHV4C*-0v%rMj{pDw diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 24986564..3555c5c5 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -116,7 +116,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) -- Some localizations do not work with Myriad Condensed Web, need to automatically swap it to a localization that will work for it local SML = LibStub:GetLibrary("LibSharedMedia-3.0") - if( GetLocale() == "koKR" or GetLocale() == "zhCN" or GetLocale() == "zhTW" or GetLocale() == "ruRU" ) then + if( GetLocale() == "koKR" or GetLocale() == "zhCN" or GetLocale() == "zhTW" ) then config.font.name = SML.DefaultMedia.font end From 0b7bf33565ff5a3d53465d68ef1a6e3f5b8f5fcd Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 23 Jun 2018 23:35:27 +0200 Subject: [PATCH 781/794] Restore ARENA_OPPONENT_UPDATE as a unit event --- modules/indicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 40b7fc7a..be490d67 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -338,7 +338,7 @@ function Indicators:OnEnable(frame) end if( config.indicators.arenaSpec and config.indicators.arenaSpec.enabled ) then - frame:RegisterNormalEvent("ARENA_OPPONENT_UPDATE", self, "UpdateArenaSpec") + frame:RegisterUnitEvent("ARENA_OPPONENT_UPDATE", self, "UpdateArenaSpec") frame:RegisterUpdateFunc(self, "UpdateArenaSpec") frame.indicators.arenaSpec = frame.indicators.arenaSpec or frame.indicators:CreateTexture(nil, "OVERLAY") end From 292945ee5406fb53b53071c90fcbdae0c29e49a7 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 23 Jun 2018 23:38:29 +0200 Subject: [PATCH 782/794] Remove remnants of prestige support, it has been removed from the game --- modules/indicators.lua | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index be490d67..6c7995fe 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -161,27 +161,13 @@ function Indicators:UpdatePVPFlag(frame) local faction = UnitFactionGroup(frame.unit) if( UnitIsPVPFreeForAll(frame.unit) ) then - local prestige = 0 --UnitPrestige(frame.unit) - if (prestige > 0) then - frame.indicators.pvp:SetTexture(GetPrestigeInfo(prestige)) - frame.indicators.pvp:SetTexCoord(0.1,1.1,0.1,1.1) - frame.indicators.pvp:Show() - else - frame.indicators.pvp:SetTexture("Interface\\TargetingFrame\\UI-PVP-FFA") - frame.indicators.pvp:SetTexCoord(0,1,0,1) - frame.indicators.pvp:Show() - end + frame.indicators.pvp:SetTexture("Interface\\TargetingFrame\\UI-PVP-FFA") + frame.indicators.pvp:SetTexCoord(0,1,0,1) + frame.indicators.pvp:Show() elseif( faction and faction ~= "Neutral" and UnitIsPVP(frame.unit) ) then - local prestige = 0 --UnitPrestige(frame.unit) - if (prestige > 0) then - frame.indicators.pvp:SetTexture(GetPrestigeInfo(prestige)) - frame.indicators.pvp:SetTexCoord(0.1,1.1,0.1,1.1) - frame.indicators.pvp:Show() - else - frame.indicators.pvp:SetTexture(string.format("Interface\\TargetingFrame\\UI-PVP-%s", faction)) - frame.indicators.pvp:SetTexCoord(0,1,0,1) - frame.indicators.pvp:Show() - end + frame.indicators.pvp:SetTexture(string.format("Interface\\TargetingFrame\\UI-PVP-%s", faction)) + frame.indicators.pvp:SetTexCoord(0,1,0,1) + frame.indicators.pvp:Show() else frame.indicators.pvp:Hide() end @@ -362,7 +348,6 @@ function Indicators:OnEnable(frame) if( config.indicators.pvp and config.indicators.pvp.enabled ) then frame:RegisterUnitEvent("PLAYER_FLAGS_CHANGED", self, "UpdatePVPFlag") frame:RegisterUnitEvent("UNIT_FACTION", self, "UpdatePVPFlag") - frame:RegisterNormalEvent("HONOR_LEVEL_UPDATE", self, "UpdatePVPFlag") frame:RegisterUpdateFunc(self, "UpdatePVPFlag") frame.indicators.pvp = frame.indicators.pvp or frame.indicators:CreateTexture(nil, "OVERLAY") From f3dba2fd4d06087f811688a7ca2ee136fc427884 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 24 Jun 2018 02:07:48 +0200 Subject: [PATCH 783/794] Replace locale script --- .pkgmeta | 2 +- localcheck.lua | 246 ---------------------------------------------- locale-export.lua | 110 +++++++++++++++++++++ 3 files changed, 111 insertions(+), 247 deletions(-) delete mode 100644 localcheck.lua create mode 100644 locale-export.lua diff --git a/.pkgmeta b/.pkgmeta index 53a34028..3653d851 100755 --- a/.pkgmeta +++ b/.pkgmeta @@ -28,4 +28,4 @@ externals: url: https://repos.wowace.com/wow/ace-gui-3-0-shared-media-widgets/trunk/AceGUI-3.0-SharedMediaWidgets ignore: - - localcheck.lua + - locale-export.lua diff --git a/localcheck.lua b/localcheck.lua deleted file mode 100644 index c09f34b3..00000000 --- a/localcheck.lua +++ /dev/null @@ -1,246 +0,0 @@ --- If you want to hardcode toc or slug in and not enter it, do so here -local ADDON_SLUG -local TOC_FILE --- Automatically identify the slug based on the .git or .svn configuration data, change the path if it's not in root, or set to false to disable -local AUTO_IDENTIFY_SLUG = "./" --- Automatically find the TOC in the given path, set to false to disable -local AUTO_FIND_TOC = "./" --- Only necessary if you aren't auto identify the slug, curseforge or wowace. -local SITE_LOCATION = nil --- Personally I keep the api key in another file and just have this reference that to get it --- If you want to do this, create the file with CURSE_API_KEY = "" in it and set the path here --- set this to nil and it will ask you for your API key -local API_KEY_FILE = "../TestCode/api-key.lua" --- Patterns that should not be scrapped, case-insensitive --- Anything between the no-lib-strip is automatically ignored -local FILE_BLACKLIST = {"^localization", "^lib"} --- 1 = English -DEFAULT_LANGUAGE = "1" --- Removes phrases that are not found through this -DELETE_UNIMPORTED = true - --- No more modifying! -local OS_TYPE = os.getenv("HOME") and "linux" or "windows" - --- Mak sure we have LuaSockets -local _, http = pcall(require, "ssl.https") -local _, ltn = pcall(require, "ltn12") -if( not http ) then - print("Failed to find socket.http, did you install LuaSockets?") -elseif( not ltn ) then - print("Failed to find ltn12, did you install LuaSockets?") -end - - --- Figure out the API key -if( API_KEY_FILE ) then - local file = io.open(API_KEY_FILE) - if( not file ) then - print(string.format("It appears the API key file %s does not exist.", API_KEY_FILE)) - else - file:close() - dofile(API_KEY_FILE) - - if( not CURSE_API_KEY ) then - print("You did not define CURSE_API_KEY in your key file, make sure it does not have local next to it.") - end - end -end - - -if( not CURSE_API_KEY ) then - while( not CURSE_API_KEY ) do - io.stdout:write("Enter API key: ") - CURSE_API_KEY = io.stdin:read("*line") - CURSE_API_KEY = CURSE_API_KEY ~= "" and CURSE_API_KEY or nil - end -end - --- Attempt to automatically identify the addon slug -if( AUTO_IDENTIFY_SLUG ) then - local git = io.open(AUTO_IDENTIFY_SLUG .. ".git/config") - local svn = io.open(AUTO_IDENTIFY_SLUG .. ".svn/entries") - - if( git ) then - local contents = git:read("*all") - git:close() - - SITE_LOCATION, ADDON_SLUG = string.match(contents, "git%.([^\n]-)%.com:wow/([^\n]-)/mainline%.git") - elseif( svn ) then - local contents = svn:read("*all") - svn:close() - - SITE_LOCATION, ADDON_SLUG = string.match(contents, "svn%.(.-)%.com/wow/(.-)/mainline") - end - - if( not ADDON_SLUG ) then - print("Failed to identify addon slug.") - elseif( not SITE_LOCATION ) then - print("Failed to identify site location.") - end -end - -if( not SITE_LOCATION ) then - while( not SITE_LOCATION ) do - io.stdout:write("Site location [wowace/curseforge]: ") - SITE_LOCATION = io.stdin:read("*line") - SITE_LOCATION = ( SITE_LOCATION == "wowace" or SITE_LOCATION == "curseforge" ) and SITE_LOCATION or nil - end -end - --- Manually ask for it -if( not ADDON_SLUG ) then - while( not ADDON_SLUG ) do - io.stdout:write("Enter slug: ") - ADDON_SLUG = io.stdin:read("*line") - ADDON_SLUG = ADDON_SLUG ~= "" and ADDON_SLUG or nil - end -end - -print(string.format("Using addon slug: %s", ADDON_SLUG)) - --- Find the TOC now -if( AUTO_FIND_TOC ) then - local pipe = OS_TYPE == "windows" and io.popen(string.format("dir /B \"%s\"", AUTO_FIND_TOC)) or io.popen(string.format("ls -1 \"%s\"", AUTO_FIND_TOC)) - if( type(pipe) == "userdata" ) then - for file in pipe:lines() do - if( string.match(file, "(.+)%.toc") ) then - TOC_FILE = file - break - end - end - - pipe:close() - if( not TOC_FILE ) then print("Failed to auto detect toc file.") end - else - print("Failed to auto find toc, cannot run dir /B or ls -1") - end -end - -if( not TOC_FILE ) then - while( not TOC_FILE ) do - io.stdout:write("TOC path: ") - TOC_FILE = io.stdin:read("*line") - TOC_FILE = TOC_FILE ~= "" and TOC_FILE or nil - if( TOC_FILE ) then - local file = io.open(TOC_FILE) - if( file ) then - file:close() - break - else - print(string.format("%s does not exist.", TOC_FILE)) - end - end - end -end - -print(string.format("Using TOC file %s", TOC_FILE)) -print("") - --- Parse through the TOC file so we know what to scan -local ignore -local localizedKeys = {} -for line in io.lines(TOC_FILE) do - line = string.gsub(line, "\r", "") - - if( string.match(line, "#@no%-lib%-strip@") ) then - ignore = true - elseif( string.match(line, "#@end%-no%-lib%-strip@") ) then - ignore = nil - end - - if( not ignore and string.match(line, "%.lua") and not string.match(line, "^%s*#")) then - -- Make sure it's a valid file - local blacklist - for _, check in pairs(FILE_BLACKLIST) do - if( string.match(string.lower(line), check) ) then - blacklist = true - break - end - end - - -- File checks out, scrap everything - if( not blacklist ) then - -- Fix slashes - if( OS_TYPE == "linux" ) then - line = string.gsub(line, "\\", "/") - end - - local keys = 0 - local contents = io.open(line):read("*all") - - for match in string.gmatch(contents, "L%[\"(.-)%\"]") do - if( not localizedKeys[match] ) then keys = keys + 1 end - localizedKeys[match] = true - end - - print(string.format("%s (%d keys)", line, keys)) - end - end -end - --- Compile all of the localization we found into string form -local totalLocalizedKeys = 0 -local localization = "" -for key in pairs(localizedKeys) do - localization = string.format("%s\nL[\"%s\"] = true", localization, key, key) - totalLocalizedKeys = totalLocalizedKeys + 1 -end - -if( totalLocalizedKeys == 0 ) then - print("Warning, failed to find any localizations, perhaps you messed up a configuration variable?") - return -end - -print(string.format("Found %d keys total", totalLocalizedKeys)) - -local addonData = { - ["format"] = "lua_additive_table", - ["language"] = DEFAULT_LANGUAGE, - ["delete_unimported"] = DELETE_UNIMPORTED and "y" or "n", - ["text"] = localization, -} - --- Send it off -local boundary = string.format("-------%s", os.time()) -local source = {} -local body = "" - -for key, data in pairs(addonData) do - body = string.format("%s--%s\r\n", body, boundary) - body = string.format("%sContent-Disposition: form-data; name=\"%s\"\r\n\r\n", body, key) - body = string.format("%s%s\r\n", body, data) -end - -body = string.format("%s--%s--\r\n", body, boundary) - -http.request({ - method = "POST", - url = string.format("https://www.%s.com/addons/%s/localization/import/?api-key=%s", SITE_LOCATION, ADDON_SLUG, CURSE_API_KEY), - sink = ltn12.sink.table(source), - source = ltn12.source.string(body), - headers = { - ["Content-Type"] = string.format("multipart/form-data; boundary=\"%s\"", boundary), - ["Content-Length"] = string.len(body), - }, -}) - -local contents = table.concat(source, "\n") -local errors = {} -for line in string.gmatch(contents, "(.-)\n") do - local msg = string.match(line, "(.-)

") - if( msg ) then - table.insert(errors, msg) - end -end - -print("") - -if( #(errors) == 0 ) then - print(string.format("Updated localization for %s on %s!", ADDON_SLUG, SITE_LOCATION)) -else - print("Localization failed:") - for _, line in pairs(errors) do - print(line) - end -end diff --git a/locale-export.lua b/locale-export.lua new file mode 100644 index 00000000..c250058b --- /dev/null +++ b/locale-export.lua @@ -0,0 +1,110 @@ +local TOC_FILE +local AUTO_FIND_TOC = "./" +-- Patterns that should not be scrapped, case-insensitive +-- Anything between the no-lib-strip is automatically ignored +local FILE_BLACKLIST = {"^localization", "^lib"} + +-- No more modifying! +local OS_TYPE = os.getenv("HOME") and "linux" or "windows" + +local function printerr(pattern, ...) + io.stderr:write(string.format(pattern .. "\n", ...)) +end + +-- Find the TOC now +if( AUTO_FIND_TOC ) then + local pipe = OS_TYPE == "windows" and io.popen(string.format("dir /B \"%s\"", AUTO_FIND_TOC)) or io.popen(string.format("ls -1 \"%s\"", AUTO_FIND_TOC)) + if( type(pipe) == "userdata" ) then + for file in pipe:lines() do + if( string.match(file, "(.+)%.toc") ) then + TOC_FILE = file + break + end + end + + pipe:close() + if( not TOC_FILE ) then printerr("Failed to auto detect toc file.") end + else + printerr("Failed to auto find toc, cannot run dir /B or ls -1") + end +end + +if( not TOC_FILE ) then + while( not TOC_FILE ) do + io.stdout:write("TOC path: ") + TOC_FILE = io.stdin:read("*line") + TOC_FILE = TOC_FILE ~= "" and TOC_FILE or nil + if( TOC_FILE ) then + local file = io.open(TOC_FILE) + if( file ) then + file:close() + break + else + printerr("%s does not exist.", TOC_FILE) + return + end + end + end +end + +printerr("Using TOC file %s", TOC_FILE) +printerr("") + +-- Parse through the TOC file so we know what to scan +local ignore +local localizedKeys = {} +for line in io.lines(TOC_FILE) do + line = string.gsub(line, "\r", "") + + if( string.match(line, "#@no%-lib%-strip@") ) then + ignore = true + elseif( string.match(line, "#@end%-no%-lib%-strip@") ) then + ignore = nil + end + + if( not ignore and string.match(line, "%.lua") and not string.match(line, "^%s*#")) then + -- Make sure it's a valid file + local blacklist + for _, check in pairs(FILE_BLACKLIST) do + if( string.match(string.lower(line), check) ) then + blacklist = true + break + end + end + + -- File checks out, scrap everything + if( not blacklist ) then + -- Fix slashes + if( OS_TYPE == "linux" ) then + line = string.gsub(line, "\\", "/") + end + + local keys = 0 + local contents = io.open(line):read("*all") + + for match in string.gmatch(contents, "L%[\"(.-)%\"]") do + if( not localizedKeys[match] ) then keys = keys + 1 end + localizedKeys[match] = true + end + + printerr("%s (%d keys)", line, keys) + end + end +end + +-- Compile all of the localization we found into string form +local totalLocalizedKeys = 0 +local localization = "" +for key in pairs(localizedKeys) do + localization = string.format("%s\nL[\"%s\"] = true", localization, key, key) + totalLocalizedKeys = totalLocalizedKeys + 1 +end + +if( totalLocalizedKeys == 0 ) then + printerr("Warning, failed to find any localizations, perhaps you messed up a configuration variable?") + return +end + +printerr("Found %d keys total", totalLocalizedKeys) + +print(localization) From 97d3962ff9daa0ab125991b5d18d5a731c9f3ab0 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 1 Jul 2018 10:07:22 +0200 Subject: [PATCH 784/794] Replace locale script once again --- locale-export.lua | 110 ---------------------- locale-import.lua | 226 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 226 insertions(+), 110 deletions(-) delete mode 100644 locale-export.lua create mode 100644 locale-import.lua diff --git a/locale-export.lua b/locale-export.lua deleted file mode 100644 index c250058b..00000000 --- a/locale-export.lua +++ /dev/null @@ -1,110 +0,0 @@ -local TOC_FILE -local AUTO_FIND_TOC = "./" --- Patterns that should not be scrapped, case-insensitive --- Anything between the no-lib-strip is automatically ignored -local FILE_BLACKLIST = {"^localization", "^lib"} - --- No more modifying! -local OS_TYPE = os.getenv("HOME") and "linux" or "windows" - -local function printerr(pattern, ...) - io.stderr:write(string.format(pattern .. "\n", ...)) -end - --- Find the TOC now -if( AUTO_FIND_TOC ) then - local pipe = OS_TYPE == "windows" and io.popen(string.format("dir /B \"%s\"", AUTO_FIND_TOC)) or io.popen(string.format("ls -1 \"%s\"", AUTO_FIND_TOC)) - if( type(pipe) == "userdata" ) then - for file in pipe:lines() do - if( string.match(file, "(.+)%.toc") ) then - TOC_FILE = file - break - end - end - - pipe:close() - if( not TOC_FILE ) then printerr("Failed to auto detect toc file.") end - else - printerr("Failed to auto find toc, cannot run dir /B or ls -1") - end -end - -if( not TOC_FILE ) then - while( not TOC_FILE ) do - io.stdout:write("TOC path: ") - TOC_FILE = io.stdin:read("*line") - TOC_FILE = TOC_FILE ~= "" and TOC_FILE or nil - if( TOC_FILE ) then - local file = io.open(TOC_FILE) - if( file ) then - file:close() - break - else - printerr("%s does not exist.", TOC_FILE) - return - end - end - end -end - -printerr("Using TOC file %s", TOC_FILE) -printerr("") - --- Parse through the TOC file so we know what to scan -local ignore -local localizedKeys = {} -for line in io.lines(TOC_FILE) do - line = string.gsub(line, "\r", "") - - if( string.match(line, "#@no%-lib%-strip@") ) then - ignore = true - elseif( string.match(line, "#@end%-no%-lib%-strip@") ) then - ignore = nil - end - - if( not ignore and string.match(line, "%.lua") and not string.match(line, "^%s*#")) then - -- Make sure it's a valid file - local blacklist - for _, check in pairs(FILE_BLACKLIST) do - if( string.match(string.lower(line), check) ) then - blacklist = true - break - end - end - - -- File checks out, scrap everything - if( not blacklist ) then - -- Fix slashes - if( OS_TYPE == "linux" ) then - line = string.gsub(line, "\\", "/") - end - - local keys = 0 - local contents = io.open(line):read("*all") - - for match in string.gmatch(contents, "L%[\"(.-)%\"]") do - if( not localizedKeys[match] ) then keys = keys + 1 end - localizedKeys[match] = true - end - - printerr("%s (%d keys)", line, keys) - end - end -end - --- Compile all of the localization we found into string form -local totalLocalizedKeys = 0 -local localization = "" -for key in pairs(localizedKeys) do - localization = string.format("%s\nL[\"%s\"] = true", localization, key, key) - totalLocalizedKeys = totalLocalizedKeys + 1 -end - -if( totalLocalizedKeys == 0 ) then - printerr("Warning, failed to find any localizations, perhaps you messed up a configuration variable?") - return -end - -printerr("Found %d keys total", totalLocalizedKeys) - -print(localization) diff --git a/locale-import.lua b/locale-import.lua new file mode 100644 index 00000000..ffba821e --- /dev/null +++ b/locale-import.lua @@ -0,0 +1,226 @@ +-- Need to hardcode the project id here +local ADDON_PROJECT_ID = 19268 +local TOC_FILE +-- Automatically identify the slug based on the .git or .svn configuration data, change the path if it's not in root, or set to false to disable +local AUTO_IDENTIFY_SLUG = "./" +-- Automatically find the TOC in the given path, set to false to disable +local AUTO_FIND_TOC = "./" +-- Only necessary if you aren't auto identify the slug, curseforge or wowace. +local SITE_LOCATION = nil +-- Personally I keep the api key in another file and just have this reference that to get it +-- If you want to do this, create the file with CURSE_API_KEY = "" in it and set the path here +-- set this to nil and it will ask you for your API key +local API_KEY_FILE = "../../cf-api-key.lua" +-- Patterns that should not be scrapped, case-insensitive +-- Anything between the no-lib-strip is automatically ignored +local FILE_BLACKLIST = {"^localization", "^lib"} + +-- default language to import to +local DEFAULT_LANGUAGE = "enUS" +-- Removes phrases that are not found through this +local DELETE_UNIMPORTED = true + +-- No more modifying! +local OS_TYPE = os.getenv("HOME") and "linux" or "windows" + +-- Mak sure we have LuaSockets +local _, http = pcall(require, "ssl.https") +local _, ltn = pcall(require, "ltn12") +if( not http ) then + print("Failed to find socket.http, did you install LuaSockets?") +elseif( not ltn ) then + print("Failed to find ltn12, did you install LuaSockets?") +end + +-- check project id is set +if not ADDON_PROJECT_ID then + print("No project id specified, did you set it?") + return +end + +-- Figure out the API key +if( API_KEY_FILE ) then + local file = io.open(API_KEY_FILE) + if( not file ) then + print(string.format("It appears the API key file %s does not exist.", API_KEY_FILE)) + else + file:close() + dofile(API_KEY_FILE) + + if( not CURSE_API_KEY ) then + print("You did not define CURSE_API_KEY in your key file, make sure it does not have local next to it.") + end + end +end + +if( not CURSE_API_KEY ) then + while( not CURSE_API_KEY ) do + io.stdout:write("Enter API key: ") + CURSE_API_KEY = io.stdin:read("*line") + CURSE_API_KEY = CURSE_API_KEY ~= "" and CURSE_API_KEY or nil + end +end + +-- Attempt to automatically identify the addon slug +if( AUTO_IDENTIFY_SLUG ) then + local git = io.open(AUTO_IDENTIFY_SLUG .. ".git/config") + local svn = io.popen("svn info --show-item url " .. AUTO_IDENTIFY_SLUG) + + if( git ) then + local contents = git:read("*all") + + SITE_LOCATION = string.match(contents, "repos%.([^\n]-)%.com/wow/([^\n]-)") + elseif( svn ) then + local contents = svn:read("*all") + + SITE_LOCATION = string.match(contents, "repos%.([^\n]-)%.com/wow/([^\n]-)") + end + + if( git ) then git:close() end + if( svn ) then svn:close() end + + if( not SITE_LOCATION ) then + print("Failed to identify site location.") + end +end + +if( not SITE_LOCATION ) then + while( not SITE_LOCATION ) do + io.stdout:write("Site location [wowace/curseforge]: ") + SITE_LOCATION = io.stdin:read("*line") + SITE_LOCATION = ( SITE_LOCATION == "wowace" or SITE_LOCATION == "curseforge" ) and SITE_LOCATION or nil + end +end + +-- Find the TOC now +if( AUTO_FIND_TOC ) then + local pipe = OS_TYPE == "windows" and io.popen(string.format("dir /B \"%s\"", AUTO_FIND_TOC)) or io.popen(string.format("ls -1 \"%s\"", AUTO_FIND_TOC)) + if( type(pipe) == "userdata" ) then + for file in pipe:lines() do + if( string.match(file, "(.+)%.toc") ) then + TOC_FILE = file + break + end + end + + pipe:close() + if( not TOC_FILE ) then print("Failed to auto detect toc file.") end + else + print("Failed to auto find toc, cannot run dir /B or ls -1") + end +end + +if( not TOC_FILE ) then + while( not TOC_FILE ) do + io.stdout:write("TOC path: ") + TOC_FILE = io.stdin:read("*line") + TOC_FILE = TOC_FILE ~= "" and TOC_FILE or nil + if( TOC_FILE ) then + local file = io.open(TOC_FILE) + if( file ) then + file:close() + break + else + print(string.format("%s does not exist.", TOC_FILE)) + end + end + end +end + +print(string.format("Using TOC file %s", TOC_FILE)) +print("") + +-- Parse through the TOC file so we know what to scan +local ignore +local localizedKeys = {} +for line in io.lines(TOC_FILE) do + line = string.gsub(line, "\r", "") + + if( string.match(line, "#@no%-lib%-strip@") ) then + ignore = true + elseif( string.match(line, "#@end%-no%-lib%-strip@") ) then + ignore = nil + end + + if( not ignore and string.match(line, "%.lua") and not string.match(line, "^%s*#")) then + -- Make sure it's a valid file + local blacklist + for _, check in pairs(FILE_BLACKLIST) do + if( string.match(string.lower(line), check) ) then + blacklist = true + break + end + end + + -- File checks out, scrap everything + if( not blacklist ) then + -- Fix slashes + if( OS_TYPE == "linux" ) then + line = string.gsub(line, "\\", "/") + end + + local keys = 0 + local contents = io.open(line):read("*all") + + for match in string.gmatch(contents, "L%[\"(.-)%\"]") do + if( not localizedKeys[match] ) then keys = keys + 1 end + localizedKeys[match] = true + end + + print(string.format("%s (%d keys)", line, keys)) + end + end +end + +-- Compile all of the localization we found into string form +local totalLocalizedKeys = 0 +local localization = "" +for key in pairs(localizedKeys) do + localization = string.format("%s\nL[\"%s\"] = true", localization, key, key) + totalLocalizedKeys = totalLocalizedKeys + 1 +end + +if( totalLocalizedKeys == 0 ) then + print("Warning, failed to find any localizations, perhaps you messed up a configuration variable?") + return +end + +print(string.format("Found %d keys total", totalLocalizedKeys)) + +local addonData = { + ["metadata"] = ("{ language: \"%s\", \"namespace\": \"\", \"missing-phrase-handling\": \"%s\" }"):format(DEFAULT_LANGUAGE, DELETE_UNIMPORTED and "DeletePhrase" or "DoNothing"), + ["localizations"] = localization, +} + +-- Send it off +local boundary = string.format("-------%s", os.time()) +local source = {} +local body = "" + +for key, data in pairs(addonData) do + body = string.format("%s--%s\r\n", body, boundary) + body = string.format("%sContent-Disposition: form-data; name=\"%s\"\r\n\r\n", body, key) + body = string.format("%s%s\r\n", body, data) +end + +body = string.format("%s--%s--\r\n", body, boundary) + +local host = SITE_LOCATION == "curseforge" and "wow.curseforge.com" or "www.wowace.com" + +http.request({ + method = "POST", + url = string.format("https://%s/api/projects/%s/localization/import", host, ADDON_PROJECT_ID), + sink = ltn12.sink.table(source), + source = ltn12.source.string(body), + headers = { + ["X-Api-Token"] = CURSE_API_KEY, + ["Content-Type"] = string.format("multipart/form-data; boundary=\"%s\"", boundary), + ["Content-Length"] = string.len(body), + }, +}) + +local contents = table.concat(source, "\n") +print(contents) +print("") + +print(string.format("Updated localization on %s!", SITE_LOCATION)) From cd0aa55d916c6817958dcef7eacb9793f7454852 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 16 Jul 2018 14:26:09 +0200 Subject: [PATCH 785/794] Enable arena/battleground frames in the default layout, and disable the pvp indicator by default on the bg frames --- modules/defaultlayout.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index 3555c5c5..e7f703e2 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -460,6 +460,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) }, }, arena = { + enabled = true, width = 170, height = 45, scale = 1.0, @@ -539,8 +540,9 @@ function ShadowUF:LoadDefaultLayout(useMerge) {text = "[name]"}, {text = ""}, }, - }, + }, battleground = { + enabled = true, width = 140, height = 35, scale = 1.0, @@ -557,7 +559,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) debuffs = {enabled = false, maxRows = 1, perRow = 9}, }, indicators = { - pvp = {enabled = true, anchorTo = "$parent", anchorPoint = "LC", size = 40, x = 16, y = -8}, + pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, }, text = { {text = "[name]"}, From 83e9d10a92dd9d397dc4b9de4de87b8b702c87b5 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 17 Jul 2018 17:08:33 +0200 Subject: [PATCH 786/794] Update ignore in pkgmeta --- .pkgmeta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pkgmeta b/.pkgmeta index 3653d851..ae9b73da 100755 --- a/.pkgmeta +++ b/.pkgmeta @@ -28,4 +28,4 @@ externals: url: https://repos.wowace.com/wow/ace-gui-3-0-shared-media-widgets/trunk/AceGUI-3.0-SharedMediaWidgets ignore: - - locale-export.lua + - locale-import.lua From 66d7e473652057df315269508a0f230d674b9760 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 Jul 2018 01:06:30 +0200 Subject: [PATCH 787/794] Restore pvp indicator defaults on battleground frames --- modules/defaultlayout.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/defaultlayout.lua b/modules/defaultlayout.lua index e7f703e2..37df4895 100755 --- a/modules/defaultlayout.lua +++ b/modules/defaultlayout.lua @@ -559,7 +559,7 @@ function ShadowUF:LoadDefaultLayout(useMerge) debuffs = {enabled = false, maxRows = 1, perRow = 9}, }, indicators = { - pvp = {anchorTo = "$parent", anchorPoint = "BL", size = 22, x = 0, y = 11}, + pvp = {enabled = true, anchorTo = "$parent", anchorPoint = "LC", size = 40, x = 16, y = -8}, }, text = { {text = "[name]"}, From 8591de619e3e74cf826286c714907a6012383d94 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 Jul 2018 21:07:48 +0200 Subject: [PATCH 788/794] Remove setting the arena cvar, its not required to hide the frames --- ShadowedUnitFrames.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/ShadowedUnitFrames.lua b/ShadowedUnitFrames.lua index 215600bb..32881c6e 100755 --- a/ShadowedUnitFrames.lua +++ b/ShadowedUnitFrames.lua @@ -767,9 +767,6 @@ function ShadowUF:HideBlizzardFrames() ArenaEnemyFrames:SetParent(self.hiddenFrame) ArenaPrepFrames:UnregisterAllEvents() ArenaPrepFrames:SetParent(self.hiddenFrame) - - SetCVar("showArenaEnemyFrames", 0, "SHOW_ARENA_ENEMY_FRAMES_TEXT") - end if( self.db.profile.hidden.playerAltPower and not active_hiddens.playerAltPower ) then From 8a1a31905e2ec23dab07726f62c911cdeda4b7f0 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 21 Jul 2018 22:52:06 +0200 Subject: [PATCH 789/794] Protect tags from failing due to mismatched event types --- modules/tags.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/tags.lua b/modules/tags.lua index bc56728b..04f152b1 100755 --- a/modules/tags.lua +++ b/modules/tags.lua @@ -63,7 +63,14 @@ function Tags:RegisterEvents(parent, fontString, tags) fontString[event] = true -- Unit event elseif( Tags.eventType[event] ~= "unitless" or ShadowUF.Units.unitEvents[event] ) then - parent:RegisterUnitEvent(event, fontString, "UpdateTags") + local success, err = pcall(parent.RegisterUnitEvent, parent, event, fontString, "UpdateTags") + if not success then + -- switch the tag back + ShadowUF.Units.unitEvents[event] = false + Tags.eventType[event] = "unitless" + + parent:RegisterNormalEvent(event, fontString, "UpdateTags") + end -- Everything else else parent:RegisterNormalEvent(event, fontString, "UpdateTags") @@ -1430,12 +1437,20 @@ Tags.eventType = { ["PLAYER_TARGET_CHANGED"] = "unitless", ["PARTY_LEADER_CHANGED"] = "unitless", ["PLAYER_ENTERING_WORLD"] = "unitless", + ["PLAYER_REGEN_DISABLED"] = "unitless", + ["PLAYER_REGEN_ENABLED"] = "unitless", ["PLAYER_XP_UPDATE"] = "unitless", ["PLAYER_TOTEM_UPDATE"] = "unitless", ["PLAYER_LEVEL_UP"] = "unitless", ["UPDATE_EXHAUSTION"] = "unitless", ["PLAYER_UPDATE_RESTING"] = "unitless", ["UNIT_COMBO_POINTS"] = "unitless", + ["PARTY_LOOT_METHOD_CHANGED"] = "unitless", + ["READY_CHECK"] = "unitless", + ["READY_CHECK_FINISHED"] = "unitless", + ["RUNE_POWER_UPDATE"] = "unitless", + ["RUNE_TYPE_UPDATE"] = "unitless", + ["UPDATE_FACTION"] = "unitless", } -- Tag groups that have a special filter that can't be used on certain units, like the threat API's From 1f3eca3d09304e40be4a86c7ec79a11b242f4a5f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 21 Jul 2018 23:05:28 +0200 Subject: [PATCH 790/794] Switch ARENA_OPPONENT_UPDATE back to a normal event. Its not 100% a unit event. --- modules/indicators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/indicators.lua b/modules/indicators.lua index 6c7995fe..ea9c7694 100755 --- a/modules/indicators.lua +++ b/modules/indicators.lua @@ -324,7 +324,7 @@ function Indicators:OnEnable(frame) end if( config.indicators.arenaSpec and config.indicators.arenaSpec.enabled ) then - frame:RegisterUnitEvent("ARENA_OPPONENT_UPDATE", self, "UpdateArenaSpec") + frame:RegisterNormalEvent("ARENA_OPPONENT_UPDATE", self, "UpdateArenaSpec") frame:RegisterUpdateFunc(self, "UpdateArenaSpec") frame.indicators.arenaSpec = frame.indicators.arenaSpec or frame.indicators:CreateTexture(nil, "OVERLAY") end From c880ddb2828cba0b29bb5f7c2b7bc5fa974d924f Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 6 Sep 2018 08:53:27 +0200 Subject: [PATCH 791/794] Update castbar module to use the GUID for cast tracking --- modules/cast.lua | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/modules/cast.lua b/modules/cast.lua index c2437701..f3989327 100755 --- a/modules/cast.lua +++ b/modules/cast.lua @@ -19,7 +19,7 @@ local function monitorFakeCast(self) self.notInterruptible = notInterruptible self.spellName = spell self.spellID = spellID - Cast:UpdateCast(self.parent, self.parent.unit, isChannelled, spell, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible, spellID) + Cast:UpdateCast(self.parent, self.parent.unit, isChannelled, spell, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible, spellID, castID) -- Cast stopped elseif( self.endTime and not endTime ) then if( GetTime() <= (self.endTime / 1000) ) then @@ -278,7 +278,7 @@ end function Cast:UpdateCurrentCast(frame) if( UnitCastingInfo(frame.unit) ) then local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID = UnitCastingInfo(frame.unit) - self:UpdateCast(frame, frame.unit, false, name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID) + self:UpdateCast(frame, frame.unit, false, name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID, castID) elseif( UnitChannelInfo(frame.unit) ) then local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID = UnitChannelInfo(frame.unit) self:UpdateCast(frame, frame.unit, true, name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID) @@ -299,7 +299,7 @@ end -- Cast updated/changed function Cast:EventUpdateCast(frame) local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID = UnitCastingInfo(frame.unit) - self:UpdateCast(frame, frame.unit, false, name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID) + self:UpdateCast(frame, frame.unit, false, name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID, castID) end function Cast:EventDelayCast(frame) @@ -321,17 +321,20 @@ end -- Cast finished function Cast:EventStopCast(frame, event, unit, castID, spellID) local cast = frame.castBar.bar - if( cast.spellID ~= spellID or ( event == "UNIT_SPELLCAST_FAILED" and cast.isChannelled ) ) then return end + if( event == "UNIT_SPELLCAST_CHANNEL_STOP" and not castID ) then castID = spellID end + if( cast.castID ~= castID or ( event == "UNIT_SPELLCAST_FAILED" and cast.isChannelled ) ) then return end if( cast.time.enabled ) then cast.time:SetText("0.0") end - setBarColor(cast, ShadowUF.db.profile.castColors.interrupted.r, ShadowUF.db.profile.castColors.interrupted.g, ShadowUF.db.profile.castColors.interrupted.b) + --setBarColor(cast, ShadowUF.db.profile.castColors.interrupted.r, ShadowUF.db.profile.castColors.interrupted.g, ShadowUF.db.profile.castColors.interrupted.b) if( ShadowUF.db.profile.units[frame.unitType].castBar.autoHide ) then ShadowUF.Layout:SetBarVisibility(frame, "castBar", true) end cast.spellName = nil + cast.spellID = nil + cast.castID = nil cast.fadeElapsed = FADE_TIME cast.fadeStart = FADE_TIME cast:SetScript("OnUpdate", fadeOnUpdate) @@ -343,7 +346,7 @@ end -- Cast interrupted function Cast:EventInterruptCast(frame, event, unit, castID, spellID) local cast = frame.castBar.bar - if( spellID and cast.spellID ~= spellID ) then return end + if( castID and cast.castID ~= castID ) then return end setBarColor(cast, ShadowUF.db.profile.castColors.interrupted.r, ShadowUF.db.profile.castColors.interrupted.g, ShadowUF.db.profile.castColors.interrupted.b) if( ShadowUF.db.profile.units[frame.unitType].castBar.autoHide ) then @@ -364,9 +367,9 @@ function Cast:EventInterruptCast(frame, event, unit, castID, spellID) end -- Cast succeeded -function Cast:EventCastSucceeded(frame, unit, spell) +function Cast:EventCastSucceeded(frame, event, unit, castID, spellID) local cast = frame.castBar.bar - if( not cast.isChannelled and cast.spellName == spell ) then + if( not cast.isChannelled and cast.castID == castID ) then setBarColor(cast, ShadowUF.db.profile.castColors.finished.r, ShadowUF.db.profile.castColors.finished.g, ShadowUF.db.profile.castColors.finished.b) end end @@ -407,7 +410,7 @@ function Cast:UpdateDelay(frame, spell, displayName, icon, startTime, endTime) end -- Update the actual bar -function Cast:UpdateCast(frame, unit, channelled, spell, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible, spellID) +function Cast:UpdateCast(frame, unit, channelled, spell, displayName, icon, startTime, endTime, isTradeSkill, notInterruptible, spellID, castID) if( not spell ) then return end local cast = frame.castBar.bar if( ShadowUF.db.profile.units[frame.unitType].castBar.autoHide ) then @@ -441,6 +444,7 @@ function Cast:UpdateCast(frame, unit, channelled, spell, displayName, icon, star cast.elapsed = cast.isChannelled and cast.endSeconds or 0 cast.spellName = spell cast.spellID = spellID + cast.castID = channelled and spellID or castID cast.pushback = 0 cast.lastUpdate = cast.startTime cast:SetMinMaxValues(0, cast.endSeconds) @@ -469,5 +473,6 @@ function Cast:UpdateFakeCast(self) monitor.endTime = nil monitor.notInterruptible = nil monitor.spellName = nil + monitor.spellID = nil monitorFakeCast(monitor) end From 3004024c08ae64b35472ae83e575b5dff8aeb27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20Weiersh=C3=A4user?= Date: Sat, 12 Jan 2019 16:12:39 +0100 Subject: [PATCH 792/794] train notes --- modules/auras.lua | 23 ++++++++++++++++++++--- modules/mynotes.txt | 44 ++++++++++++++++++++++++++++++++++++++++++++ modules/units.lua | 2 +- options/config.lua | 1 - 4 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 modules/mynotes.txt diff --git a/modules/auras.lua b/modules/auras.lua index 177eec07..58c43c5b 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -72,7 +72,7 @@ local positionData = setmetatable({}, { end, }) -local function positionButton(id, group, config) +local function positionButton(id, group, config) local position = positionData[group.forcedAnchorPoint or config.anchorPoint] local button = group.buttons[id] button.isAuraAnchor = nil @@ -106,7 +106,9 @@ local function positionButton(id, group, config) end end - +--[[ + cartok: maybe this is, where the time sorting addition needs to get implemented. +]] local columnsHaveScale = {} local function positionAllButtons(group, config) local position = positionData[group.forcedAnchorPoint or config.anchorPoint] @@ -208,6 +210,14 @@ local function hideTooltip(self) end end +--[[ + cartok: add a handler to blacklist buffs/debuffs on a extra blacklist + - every unit frame should have this extra blacklist + - ... bigger plan inc. +]] +local function addAuraToBlacklist(self, mouse) +end + local function cancelAura(self, mouse) if( mouse ~= "RightButton" or ( not UnitIsUnit(self.parent.unit, "player") and not UnitIsUnit(self.parent.unit, "vehicle") ) or InCombatLockdown() or self.filter == "TEMP" ) then return @@ -226,6 +236,7 @@ local function updateButton(id, group, config) button:SetScript("OnLeave", hideTooltip) button:RegisterForClicks("RightButtonUp") + -- cartok: should check if these features are enabled or if omnicc is used. button.cooldown = CreateFrame("Cooldown", group.parent:GetName() .. "Aura" .. group.type .. id .. "Cooldown", button, "CooldownFrameTemplate") button.cooldown:SetAllPoints(button) button.cooldown:SetReverse(true) @@ -274,6 +285,7 @@ local function updateButton(id, group, config) button.stack:SetFont("Interface\\AddOns\\ShadowedUnitFrames\\media\\fonts\\Myriad Condensed Web.ttf", math.floor((config.size * 0.60) + 0.5), "OUTLINE") button:SetScript("OnClick", cancelAura) + button.parent = group.parent button:ClearAllPoints() button:Hide() @@ -319,6 +331,11 @@ local function updateGroup(self, type, config, reverseConfig) -- Update filters used for the anchor group.filter = group.type == "buffs" and "HELPFUL" or group.type == "debuffs" and "HARMFUL" or "" + --[[ + cartok: add time sorting here? + - setting it to descending/ascending will mean the aura with the longest/shortest + - duration will be the first/last, and the aura vanishing soonest will be last/fist. + ]] for id, button in pairs(group.buttons) do updateButton(id, group, config) end @@ -439,7 +456,7 @@ end -- Unfortunately, temporary enchants have basically no support beyond hacks. So we will hack! tempEnchantScan = function(self, elapsed) - if( self.parent.unit == self.parent.vehicleUnit and self.lastTemporary > 0 ) then + if( self.parent.unit == self.parent.vehicleUnit and self.lastTemporary > 0 ) then mainHand.has = false offHand.has = false ranged.has = false diff --git a/modules/mynotes.txt b/modules/mynotes.txt new file mode 100644 index 00000000..3f464608 --- /dev/null +++ b/modules/mynotes.txt @@ -0,0 +1,44 @@ + +---- aura related function call sequence ---- + += MODULE WRAPPING +ShadowUF wrapps the lua module registering with ShadowUF:RegisterModule method. + + += ZONE MONITOR +ShadowedUnitFrames.lua: +- ShadowUF:OnInitialize() + - LoadDefaultLayout() + > for each item in ShadowUF.unitList call + modules/units.lua: + - ShadowUF.Units:InitializeFrame() + - ShadowUF.Units:LoadUnit() + - centralFrame:SetScript("OnEvent", function) + - ShadowUF.Units:CheckPlayerZone() + - for each frame in call + > ShadowUF.modules.auras:UpdateFilter() + modules/auras.lua: + - updates black/white/override lists these are used on aura init/update. + += AURA EVENT CALLBACKS +modules/auras.lua: +- Auras:OnEnable(frame) + - creates (new) table for auras: frame.auras = frame.auras or {} + - Auras:UpdateFilter(frame) + - frame:RegisterUnitEvent("UNIT_AURA", self, "UPDATE") + - Auras:Update(frame) + - loads config from db. + - scans for auras by calling 'scan' function for all kinds of auras + - anchors auras on buffs or debuffs if activated. + > scan(parent, frame, type, config, displayConfig, filter) + - categorizes aura: + - isFriendly, curable + - index = 0 <--- just an initial index, updated elsewhere! + - calls UnitAura constructor to render it via 'renderAura' function. + > renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) + - categorizeAura(type, curable, auraType, caster, isRemovable, canApplyAura, isBossDebuff) + - applies whitelist/blacklist/override and type filters. + - creates buttons (ace lib i guess!), uses incrementing counter as aura id. + - creates button border etc. + > updateButton(frame.totalAuras, frame, ShadowUF.db.profile.units[frame.parent.unitType].auras[frame.type])) + - positionButton(id, group, config)! diff --git a/modules/units.lua b/modules/units.lua index 5f00b7f5..1f2fd99a 100755 --- a/modules/units.lua +++ b/modules/units.lua @@ -953,7 +953,7 @@ function Units:LoadUnit(unit) frame:SetAttribute("unit", unit) frame.hasStateWatch = unit == "pet" - -- Annd lets get this going + -- And lets get this going RegisterUnitWatch(frame, frame.hasStateWatch) end diff --git a/options/config.lua b/options/config.lua index 5e088184..41b58ad5 100755 --- a/options/config.lua +++ b/options/config.lua @@ -355,7 +355,6 @@ Config.hideBasicOption = hideBasicOption -------------------- -- GENERAL CONFIGURATION --------------------- - local function writeTable(tbl) local data = "" for key, value in pairs(tbl) do From e13f4101f9f372b82891ff2612355d1c69dc1431 Mon Sep 17 00:00:00 2001 From: cartok Date: Tue, 15 Jan 2019 16:10:10 +0100 Subject: [PATCH 793/794] added time sorting for auras --- .gitignore | 3 ++- modules/auras.lua | 64 +++++++++++++++++++++++++++++++++++++-------- modules/mynotes.txt | 44 ------------------------------- options/config.lua | 57 +++++++++++++++++++++++++++------------- 4 files changed, 94 insertions(+), 74 deletions(-) delete mode 100644 modules/mynotes.txt diff --git a/.gitignore b/.gitignore index 24b392cd..ee749279 100755 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ suf.tmproj -.DS_Store \ No newline at end of file +.DS_Store +mynotes.txt \ No newline at end of file diff --git a/modules/auras.lua b/modules/auras.lua index 58c43c5b..6e13fbbd 100755 --- a/modules/auras.lua +++ b/modules/auras.lua @@ -610,19 +610,61 @@ local function scan(parent, frame, type, config, displayConfig, filter) -- UnitIsFriend returns true during a duel, which breaks stealable/curable detection local isFriendly = not UnitIsEnemy(frame.parent.unit, "player") local curable = (isFriendly and type == "debuffs") - local index = 0 - while( true ) do - index = index + 1 - local name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff = UnitAura(frame.parent.unit, index, filter) - if( not name ) then break end - renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) - - -- Too many auras shown, break out - -- Get down - if( frame.totalAuras >= frame.maxAuras ) then break end + -- get all displayable auras + -- sort auras by endTime if enabled + if(config.timeSortingEnabled and config.timeSortingMethod ~= nil) then + -- create table of all auras containing only save index and endTime of all auras + local auras = {} + local index = 0 + while( frame.totalAuras <= frame.maxAuras ) do + index = index + 1 + local name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff = UnitAura(frame.parent.unit, index, filter) + if( not name ) then + break + else + -- auras with infinite duration have duration = 0 and endTime = 0 + -- set endTime to infinity so they will be properly handled + if(duration == 0) then + endTime = math.huge + end + auras[index] = { + ["endTime"] = endTime, + ["index"] = index, + } + end + end + -- sort table by ascending endTime + if(config.timeSortingMethod == "ASC") then + table.sort(auras, function(a,b) return (a.endTime < b.endTime) end) + end + -- sort table by descending endTime + if(config.timeSortingMethod == "DESC") then + table.sort(auras, function(a,b) return (a.endTime > b.endTime) end) + end + -- use ordered aura index + -- aura render loop + for _, aura in pairs(auras) do + local index = aura.index + local name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff = UnitAura(frame.parent.unit, index, filter) + renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) + end + else + -- no time sorting + -- aura render loop + local index = 0 + while( frame.totalAuras <= frame.maxAuras ) do + index = index + 1 + local name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff = UnitAura(frame.parent.unit, index, filter) + if( not name ) then + break + else + renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) + end + end end - + + -- what is this for? for i=frame.totalAuras + 1, #(frame.buttons) do frame.buttons[i]:Hide() end -- The default 1.30 scale doesn't need special handling, after that it does diff --git a/modules/mynotes.txt b/modules/mynotes.txt deleted file mode 100644 index 3f464608..00000000 --- a/modules/mynotes.txt +++ /dev/null @@ -1,44 +0,0 @@ - ----- aura related function call sequence ---- - -= MODULE WRAPPING -ShadowUF wrapps the lua module registering with ShadowUF:RegisterModule method. - - -= ZONE MONITOR -ShadowedUnitFrames.lua: -- ShadowUF:OnInitialize() - - LoadDefaultLayout() - > for each item in ShadowUF.unitList call - modules/units.lua: - - ShadowUF.Units:InitializeFrame() - - ShadowUF.Units:LoadUnit() - - centralFrame:SetScript("OnEvent", function) - - ShadowUF.Units:CheckPlayerZone() - - for each frame in call - > ShadowUF.modules.auras:UpdateFilter() - modules/auras.lua: - - updates black/white/override lists these are used on aura init/update. - -= AURA EVENT CALLBACKS -modules/auras.lua: -- Auras:OnEnable(frame) - - creates (new) table for auras: frame.auras = frame.auras or {} - - Auras:UpdateFilter(frame) - - frame:RegisterUnitEvent("UNIT_AURA", self, "UPDATE") - - Auras:Update(frame) - - loads config from db. - - scans for auras by calling 'scan' function for all kinds of auras - - anchors auras on buffs or debuffs if activated. - > scan(parent, frame, type, config, displayConfig, filter) - - categorizes aura: - - isFriendly, curable - - index = 0 <--- just an initial index, updated elsewhere! - - calls UnitAura constructor to render it via 'renderAura' function. - > renderAura(parent, frame, type, config, displayConfig, index, filter, isFriendly, curable, name, texture, count, auraType, duration, endTime, caster, isRemovable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff) - - categorizeAura(type, curable, auraType, caster, isRemovable, canApplyAura, isBossDebuff) - - applies whitelist/blacklist/override and type filters. - - creates buttons (ace lib i guess!), uses incrementing counter as aura id. - - creates button border etc. - > updateButton(frame.totalAuras, frame, ShadowUF.db.profile.units[frame.parent.unitType].auras[frame.type])) - - positionButton(id, group, config)! diff --git a/options/config.lua b/options/config.lua index 41b58ad5..e4858cc2 100755 --- a/options/config.lua +++ b/options/config.lua @@ -2287,7 +2287,7 @@ local function loadUnitOptions() order = 3, args = { anchorOn = { - order = 1, + order = 1.1, type = "toggle", name = function(info) return info[#(info) - 2] == "buffs" and L["Anchor to debuffs"] or L["Anchor to buffs"] end, desc = L["Allows you to anchor the aura group to another, you can then choose where it will be anchored using the position.|n|nUse this if you want to duplicate the default ui style where buffs and debuffs are separate groups."], @@ -2295,11 +2295,24 @@ local function loadUnitOptions() setVariable(info[2], "auras", info[#(info) - 2] == "buffs" and "debuffs" or "buffs", "anchorOn", false) setUnit(info, value) end, - width = "full", + disabled = aurasDisabled, arg = "auras.$parentparent.anchorOn", }, + timeSortingEnabled = { + order = 1.2, + type = "toggle", + name = "Enable time sorting", + desc = "Allows you to select a sorting method for the unit frames auras.", + set = function(info, value) + local current = getVariable(info[2], "auras", info[#(info) - 2] == "buffs" and "debuffs" or "buffs", "timeSortingToggle") + setVariable(info[2], "auras", info[#(info) - 2] == "buffs" and "debuffs" or "buffs", "timeSortingToggle", not current) + setUnit(info, value) + end, + disabled = aurasDisabled, + arg = "auras.$parentparent.timeSortingEnabled", + }, anchorPoint = { - order = 1.5, + order = 2.1, type = "select", name = L["Position"], desc = L["How you want this aura to be anchored to the unit frame."], @@ -2307,16 +2320,17 @@ local function loadUnitOptions() disabled = disableAnchoredTo, arg = "auras.$parentparent.anchorPoint", }, - size = { - order = 2, - type = "range", - name = L["Icon Size"], - min = 1, max = 30, step = 1, - arg = "auras.$parentparent.size", + timeSortingMethod = { + order = 2.2, + type = "select", + name = "Sorting method", + desc = "Sort auras by ascending or descending duration. Ascending sorts least duration to the start, descending sorts least duration to the end.", + values = { ["ASC"] = "Ascending", ["DESC"] = "Descending" }, + disabled = disableTimeSorting, + arg = "auras.$parentparent.timeSortingMethod", }, - sep1 = {order = 3, type = "description", name = "", width = "full"}, perRow = { - order = 13, + order = 3.1, type = "range", name = function(info) local anchorPoint = getVariable(info[2], "auras", info[#(info) - 2], "anchorPoint") @@ -2332,7 +2346,7 @@ local function loadUnitOptions() arg = "auras.$parentparent.perRow", }, maxRows = { - order = 14, + order = 3.2, type = "range", name = L["Max rows"], desc = L["How many rows total should be used, rows will be however long the per row value is set at."], @@ -2349,7 +2363,7 @@ local function loadUnitOptions() arg = "auras.$parentparent.maxRows", }, maxColumns = { - order = 14, + order = 3.2, type = "range", name = L["Max columns"], desc = L["How many auras per a column for example, entering two her will create two rows that are filled up to whatever per row is set as."], @@ -2366,24 +2380,31 @@ local function loadUnitOptions() arg = "auras.$parentparent.maxRows", }, x = { - order = 18, + order = 4.1, type = "range", name = L["X Offset"], - min = -1000, max = 1000, step = 1, softMin = -100, softMax = 100, + min = -1000, max = 1000, step = 1, softMin = -300, softMax = 300, disabled = disableSameAnchor, hidden = hideAdvancedOption, arg = "auras.$parentparent.x", }, y = { - order = 19, + order = 4.2, type = "range", name = L["Y Offset"], - min = -1000, max = 1000, step = 1, softMin = -100, softMax = 100, + min = -1000, max = 1000, step = 1, softMin = -300, softMax = 300, disabled = disableSameAnchor, hidden = hideAdvancedOption, arg = "auras.$parentparent.y", }, - + size = { + order = 5.1, + type = "range", + name = L["Icon Size"], + min = 1, max = 40, step = 1, + disabled = aurasDisabled, + arg = "auras.$parentparent.size", + }, } } } From b05743d4ff8d1760af10c416f0a07dee42bd6376 Mon Sep 17 00:00:00 2001 From: cartok Date: Sat, 19 Jan 2019 15:02:46 +0100 Subject: [PATCH 794/794] apply aura config to movers --- modules/movers.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/movers.lua b/modules/movers.lua index 70e4a6ff..07e446f5 100755 --- a/modules/movers.lua +++ b/modules/movers.lua @@ -131,7 +131,16 @@ local function createConfigEnv() return getValue("UnitStagger", math.random(2000, 10000)) end, UnitAura = function(unit, id, filter) - if( type(id) ~= "number" or id > 40 ) then return end + -- apply buff and debuff configurations + -- info: raid and group frame units have numbers we need to load their general config + -- by removing the numbers from the name. + local config = ShadowUF.db.profile.units[string.match(unit, "%a+")] + local buffConfig = config.auras.buffs + local debuffConfig = config.auras.debuffs + -- calculate max auras + local maxBuffs, maxDebuffs = buffConfig.perRow * buffConfig.maxRows, debuffConfig.perRow * debuffConfig.maxRows + if( filter == "HELPFUL" and (type(id) ~= "number" or id > maxBuffs) ) then return end + if( filter ~= "HELPFUL" and (type(id) ~= "number" or id > maxDebuffs) ) then return end local texture = filter == "HELPFUL" and "Interface\\Icons\\Spell_Nature_Rejuvenation" or "Interface\\Icons\\Ability_DualWield" local mod = id % 5