Skip to content

Commit

Permalink
5.3.1 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Allez committed Sep 20, 2012
1 parent 63f750e commit 1632b06
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 40 deletions.
4 changes: 3 additions & 1 deletion core/general.lua
Expand Up @@ -2,9 +2,11 @@ local addon_name, ns = ...

if GetLocale() == "ruRU" then
UI_FONT = "Interface\\Addons\\"..addon_name.."\\media\\VisitorR.TTF"
UI_FONT_SIZE = 10
NORMAL_FONT = "Interface\\Addons\\"..addon_name.."\\media\\myriad.ttf"
else
UI_FONT = "Interface\\Addons\\"..addon_name.."\\media\\visitor1.TTF"
UI_FONT_SIZE = 9
NORMAL_FONT = "Interface\\Addons\\"..addon_name.."\\media\\myriad.ttf"
end

Expand All @@ -16,7 +18,7 @@ local config = {
},
size = {
order = 2,
value = 10,
value = UI_FONT_SIZE,
type = "range",
min = 8,
max = 20,
Expand Down
20 changes: 13 additions & 7 deletions elements/combattext.lua
Expand Up @@ -21,12 +21,6 @@ local frames = {}

for i = 1, 4 do
local f = CreateFrame("ScrollingMessageFrame", "CombatText_"..i, UIParent)
f:SetFont(GameFontNormal:GetFont(), 16, "OUTLINE")
f:SetShadowColor(0, 0, 0, 1)
f:SetFadeDuration(0.4)
f:SetTimeVisible(3)
f:SetMaxLines(100)
f:SetSpacing(2)

if i == 1 then
f:SetJustifyH("RIGHT")
Expand All @@ -50,6 +44,7 @@ for i = 1, 4 do
if UIMovableFrames then tinsert(UIMovableFrames, f) end
end


local tbl = {
["DAMAGE"] = {frame = 1, prefix = "-", arg2 = true, r = 1, g = 0.1, b = 0.1},
["DAMAGE_CRIT"] = {frame = 1, prefix = "c-", arg2 = true, r = 1, g = 0.1, b = 0.1},
Expand Down Expand Up @@ -110,7 +105,17 @@ local OnUpdate = function(self, elapsed)
end

local OnEvent = function(self, event, ...)
if event == "COMBAT_TEXT_UPDATE" then
if event == "PLAYER_ENTERING_WORLD" then
self:UnregisterEvent(event)
for _, v in pairs(frames) do
v:SetFont(UIConfig.general.fonts.normalfont, 16, "OUTLINE")
v:SetShadowColor(0, 0, 0, 1)
v:SetFadeDuration(0.4)
v:SetTimeVisible(3)
v:SetMaxLines(100)
v:SetSpacing(2)
end
elseif event == "COMBAT_TEXT_UPDATE" then
local subev, arg2, arg3 = ...
info = tbl[subev]
if info then
Expand Down Expand Up @@ -204,6 +209,7 @@ local OnEvent = function(self, event, ...)
end

local addon = CreateFrame("Frame")
addon:RegisterEvent("PLAYER_ENTERING_WORLD")
addon:RegisterEvent("COMBAT_TEXT_UPDATE")
addon:RegisterEvent("PLAYER_REGEN_ENABLED")
addon:RegisterEvent("PLAYER_REGEN_DISABLED")
Expand Down
32 changes: 16 additions & 16 deletions elements/unitframes/layout.lua
Expand Up @@ -914,24 +914,24 @@ local CreateStyle = function(self, unit)
end

if class == 'PRIEST' and UnitLevel('player') >= 20 and cfg.elements.shadoworbs then
self.ShadowOrbs = CreateFrame('Frame', addon_name.."_ShadowOrbs", UIParent)
self.ShadowOrbs:SetPoint('TOPLEFT', self.Health, 10, 4)
self.ShadowOrbs:SetSize(130, 5)
self.ShadowOrbs:SetFrameLevel(self.Health:GetFrameLevel()+2)
self.ShadowOrbs.bg = CreateBG(self.ShadowOrbs)
self.ShadowOrbsBar = CreateFrame('Frame', addon_name.."_ShadowOrbs", UIParent)
self.ShadowOrbsBar:SetPoint('TOPLEFT', self.Health, 10, 4)
self.ShadowOrbsBar:SetSize(130, 5)
self.ShadowOrbsBar:SetFrameLevel(self.Health:GetFrameLevel()+2)
self.ShadowOrbsBar.bg = CreateBG(self.ShadowOrbsBar)
for i = 1, 3 do
self.ShadowOrbs[i] = CreateFrame('StatusBar', nil, ShadowOrbs)
self.ShadowOrbs[i]:SetStatusBarTexture(texture)
self.ShadowOrbs[i]:SetSize(self.ShadowOrbs:GetWidth() / 3 - 0.85, self.ShadowOrbs:GetHeight())
self.ShadowOrbs[i]:SetStatusBarColor(0.70, 0.32, 0.75)
self.ShadowOrbs[i].bg = self.ShadowOrbs:CreateTexture(nil, 'BACKGROUND')
self.ShadowOrbs[i].bg:SetTexture(texture)
self.ShadowOrbs[i].bg:SetVertexColor(0.2, 0.1, 0.2)
self.ShadowOrbs[i].bg:SetAllPoints(self.ShadowOrbs[i])
self.ShadowOrbsBar[i] = CreateFrame('StatusBar', nil, self.ShadowOrbsBar)
self.ShadowOrbsBar[i]:SetStatusBarTexture(texture)
self.ShadowOrbsBar[i]:SetSize(self.ShadowOrbsBar:GetWidth() / 3 - 0.85, self.ShadowOrbsBar:GetHeight())
self.ShadowOrbsBar[i]:SetStatusBarColor(0.70, 0.32, 0.75)
self.ShadowOrbsBar[i].bg = self.ShadowOrbsBar:CreateTexture(nil, 'BACKGROUND')
self.ShadowOrbsBar[i].bg:SetTexture(texture)
self.ShadowOrbsBar[i].bg:SetVertexColor(0.2, 0.1, 0.2)
self.ShadowOrbsBar[i].bg:SetAllPoints(self.ShadowOrbsBar[i])
if i == 1 then
self.ShadowOrbs[i]:SetPoint('LEFT')
self.ShadowOrbsBar[i]:SetPoint('LEFT')
else
self.ShadowOrbs[i]:SetPoint('LEFT', self.ShadowOrbs[i-1], 'RIGHT', 1, 0)
self.ShadowOrbsBar[i]:SetPoint('LEFT', self.ShadowOrbsBar[i-1], 'RIGHT', 1, 0)
end
end
end
Expand Down Expand Up @@ -1194,7 +1194,7 @@ local CreateStyle = function(self, unit)
self.Portrait:SetPoint("BOTTOMRIGHT", -0.5, 0)
self.Portrait.PreUpdate = PreUpdatePortrait
-- Combat text
self.CombatFeedbackText = CreateFS(self.Portrait, 16, 'OUTLINE', stdfont)
self.CombatFeedbackText = CreateFS(self.Portrait, 16, 'OUTLINE', UIConfig.general.fonts.normalfont)
self.CombatFeedbackText:SetPoint('CENTER')
-- Auras on portraits
self.AuraTracker = CreateFrame('Frame', nil, self)
Expand Down
80 changes: 80 additions & 0 deletions elements/unitframes/modules/oUF_ShadowOrbsBar.lua
@@ -0,0 +1,80 @@
if(select(2, UnitClass('player')) ~= 'PRIEST') then return end

local parent, ns = ...
local oUF = ns.oUF

local PRIEST_BAR_NUM_ORBS = PRIEST_BAR_NUM_ORBS
local SPELL_POWER_SHADOW_ORBS = SPELL_POWER_SHADOW_ORBS

local function Update(self, event, unit, powerType)
if(self.unit ~= unit or (powerType and powerType ~= 'SHADOW_ORBS')) then return end

local sb = self.ShadowOrbsBar

if(sb.PreUpdate) then
sb:PreUpdate(unit)
end

local numOrbs = UnitPower('player', SPELL_POWER_SHADOW_ORBS)

for i = 1, PRIEST_BAR_NUM_ORBS do
if i <= numOrbs then
sb[i]:SetAlpha(1)
else
sb[i]:SetAlpha(.2)
end
end

if(sb.PostUpdate) then
return sb:PostUpdate(numOrbs)
end
end

local Path = function(self, ...)
return (self.ShadowOrbsBar.Override or Update) (self, ...)
end

local ForceUpdate = function(element)
return Path(element.__owner, 'ForceUpdate', element.__owner.unit, 'SHADOW_ORBS')
end

local function Visibility(self, event, unit)
local sb = self.ShadowOrbsBar
local spec = GetSpecialization()

if spec == SPEC_PRIEST_SHADOW then
sb:Show()
if self.Debuffs then self.Debuffs:Point("BOTTOMRIGHT", self, "TOPRIGHT", 2, 19) end
else
sb:Hide()
if self.Debuffs then self.Debuffs:Point("BOTTOMRIGHT", self, "TOPRIGHT", 2, 5) end
end
end

local function Enable(self, unit)
local sb = self.ShadowOrbsBar
if(sb) and unit == 'player' then
sb.__owner = self
sb.ForceUpdate = ForceUpdate

self:RegisterEvent('UNIT_POWER', Path)
self:RegisterEvent('UNIT_DISPLAYPOWER', Path)

sb.Visibility = CreateFrame("Frame", nil, sb)
sb.Visibility:RegisterEvent("PLAYER_TALENT_UPDATE")
sb.Visibility:SetScript("OnEvent", function(frame, event, unit) Visibility(self, event, unit) end)

return true
end
end

local function Disable(self)
local sb = self.ShadowOrbsBar
if(sb) then
self:UnregisterEvent('UNIT_POWER', Path)
self:UnregisterEvent('UNIT_DISPLAYPOWER', Path)
sb.Visibility:UnregisterEvent("PLAYER_TALENT_UPDATE")
end
end

oUF:AddElement('ShadowOrbsBar', Path, Enable, Disable)
29 changes: 13 additions & 16 deletions elements/unitframes/modules/oUF_WarlockSpecBars.lua
Expand Up @@ -15,6 +15,12 @@ local SPEC_WARLOCK_AFFLICTION_GLYPH_SHARDS = 63302
local SPEC_WARLOCK_DEMONOLOGY = SPEC_WARLOCK_DEMONOLOGY
local LATEST_SPEC = 0

local Colors = {
[1] = {0.90, 0.42, 0.85, 1},
[2] = {95/255, 222/255, 95/255, 1},
[3] = {222/255, 95/255, 95/255, 1},
}

local Update = function(self, event, unit, powerType)
if(self.unit ~= unit or (powerType and powerType ~= "BURNING_EMBERS" and powerType ~= "SOUL_SHARDS" and powerType ~= "DEMONIC_FURY")) then return end

Expand Down Expand Up @@ -99,6 +105,8 @@ local function Visibility(self, event, unit)
else
wsb[i]:SetWidth(w - s)
end
wsb[i]:SetStatusBarColor(unpack(Colors[SPEC_WARLOCK_DESTRUCTION]))
if wsb[i].bg then wsb[i].bg:SetAlpha(0.15) wsb[i].bg:SetTexture(unpack(Colors[SPEC_WARLOCK_DESTRUCTION])) end
end

if maxembers == 3 then wsb[4]:Hide() else wsb[4]:Show() end
Expand All @@ -117,6 +125,8 @@ local function Visibility(self, event, unit)
else
wsb[i]:SetWidth(w - s)
end
wsb[i]:SetStatusBarColor(unpack(Colors[SPEC_WARLOCK_AFFLICTION]))
if wsb[i].bg then wsb[i].bg:SetAlpha(0) end
end

if maxshards == 3 then wsb[4]:Hide() else wsb[4]:Show() end
Expand All @@ -125,6 +135,8 @@ local function Visibility(self, event, unit)
wsb[3]:Hide()
wsb[4]:Hide()
wsb[1]:SetWidth(wsb:GetWidth())
wsb[1]:SetStatusBarColor(unpack(Colors[SPEC_WARLOCK_DEMONOLOGY]))
if wsb[1].bg then wsb[1].bg:SetAlpha(0.15) wsb[1].bg:SetTexture(unpack(Colors[SPEC_WARLOCK_DEMONOLOGY])) end
end

-- force an update each time we respec
Expand Down Expand Up @@ -158,25 +170,10 @@ local function Enable(self)
-- why the fuck does PLAYER_TALENT_UPDATE doesnt trigger on initial login if we register to: self or self.PluginName
wsb.Visibility = CreateFrame("Frame", nil, wsb)
wsb.Visibility:RegisterEvent("PLAYER_TALENT_UPDATE")
wsb.Visibility:RegisterEvent("PLAYER_ENTERING_WORLD")
wsb.Visibility:SetScript("OnEvent", function(frame, event, unit) Visibility(self, event, unit) end)

for i = 1, 4 do
local Point = wsb[i]
if not Point:GetStatusBarTexture() then
Point:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=])
end

Point:SetFrameLevel(wsb:GetFrameLevel() + 1)
Point:GetStatusBarTexture():SetHorizTile(false)

if Point.bg then
Point.bg:SetAllPoints()
end
end
Visibility(self, nil, nil)

wsb:Hide()

return true
end
end
Expand Down
1 change: 1 addition & 0 deletions elements/unitframes/unitframes.xml
Expand Up @@ -8,6 +8,7 @@
<Script file='modules\oUF_TotemBar.lua' />
<Script file='modules\oUF_DebuffHighlight.lua' />
<Script file='modules\oUF_WarlockSpecBars.lua' />
<Script file='modules\oUF_ShadowOrbsBar.lua' />
<Script file='tags.lua' />
<Script file='raiddebuff.lua' />
<Script file='layout.lua' />
Expand Down

0 comments on commit 1632b06

Please sign in to comment.