Skip to content

Commit

Permalink
Revert changes for bubbles skin.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shestak committed Oct 6, 2012
1 parent f724469 commit 7673419
Showing 1 changed file with 12 additions and 32 deletions.
44 changes: 12 additions & 32 deletions ShestakUI/Modules/Skins/Blizzard/Bubbles.lua
Expand Up @@ -34,39 +34,19 @@ local function isChatBubble(frame)
return frame:GetRegions():GetTexture() == [[Interface\Tooltips\ChatBubble-Background]]
end

local function FindBubble()
local newNumKids = WorldFrame:GetNumChildren()
if newNumKids ~= numKids then
for i = numKids + 1, newNumKids do
local frame = select(i, WorldFrame:GetChildren())

if isChatBubble(frame) then return frame end
end
numKids = newNumKids
end
end

local function onUpdate(self, elapsed)
f:SetScript("OnUpdate", function(self, elapsed)
total = total + elapsed

local frame = FindBubble()
if frame or total > 0.3 then
self:SetScript("OnUpdate", nil)
if total > 0.1 then
total = 0
if frame then styleBubble(frame) end
end
end

local events = {
CHAT_MSG_SAY = "chatBubbles", CHAT_MSG_YELL = "chatBubbles",
CHAT_MSG_PARTY = "chatBubblesParty", CHAT_MSG_PARTY_LEADER = "chatBubblesParty",
CHAT_MSG_MONSTER_SAY = "chatBubbles", CHAT_MSG_MONSTER_YELL = "chatBubbles", CHAT_MSG_MONSTER_PARTY = "chatBubblesParty",
}

for event in pairs(events) do f:RegisterEvent(event) end

f:SetScript("OnEvent", function(self, event)
if GetCVarBool(events[event]) then
f:SetScript("OnUpdate", onUpdate)
local newNumKids = WorldFrame:GetNumChildren()
if newNumKids ~= numKids then
for i = numKids + 1, newNumKids do
local frame = select(i, WorldFrame:GetChildren())
if isChatBubble(frame) then
styleBubble(frame)
end
end
numKids = newNumKids
end
end
end)

0 comments on commit 7673419

Please sign in to comment.