Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TBC: Frames should inherit BackdropTemplate #3

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Don't track content of these folders
.release/
.release/
.idea/
45 changes: 45 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions EavesDrop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ local function shortenValue(value)
elseif value >= 10000 then
value = string_format("%.1fk",value / 1000)
end
return value
return tostring(value)
end

local function round(num, idp)
Expand Down Expand Up @@ -475,17 +475,17 @@ function EavesDrop:CombatEvent()
outtype, intype = "TSPELL", "PSPELL"
else
spellId, spellName, spellSchool, amount, overDamage, school, resisted, blocked, absorbed, critical, glancing, crushing = a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12
texture = select(3, GetSpellInfo(spellId))
texture = select(3, GetSpellInfo(spellName))
outtype, intype = "TSPELL", "PSPELL"
end
text = tostring(shortenValue(amount))

if (critical) then text = critchar..text..critchar end
if (crushing) then text = crushchar..text..crushchar end
if (glancing) then text = glancechar..text..glancechar end
if (resisted) then text = string_format("%s (%d)", text, shortenValue(resisted)) end
if (blocked) then text = string_format("%s (%d)", text, shortenValue(blocked)) end
if (absorbed) then text = string_format("%s (%d)", text, shortenValue(absorbed))end
if (resisted) then text = string_format("%s (%s)", text, shortenValue(resisted)) end
if (blocked) then text = string_format("%s (%s)", text, shortenValue(blocked)) end
if (absorbed) then text = string_format("%s (%s)", text, shortenValue(absorbed))end

if fromPlayer then
if (self:TrackStat(inout, "hit", spellName, texture, SCHOOL_STRINGS[school], amount, critical, message)) then
Expand All @@ -509,15 +509,15 @@ function EavesDrop:CombatEvent()
------------buff/debuff gain----------------
elseif etype == "BUFF" then
spellId, spellName, spellSchool, auraType, amount = a1, a2, a3, a4, a5
texture = select(3, GetSpellInfo(spellId))
texture = select(3, GetSpellInfo(spellName))
if toPlayer and db[auraType] then
self:DisplayEvent(INCOMING, self:ShortenString(spellName), texture, db["P"..auraType], message)
else return
end
------------buff/debuff lose----------------
elseif etype == "FADE" then
spellId, spellName, spellSchool, auraType, amount = a1, a2, a3, a4, a5
texture = select(3, GetSpellInfo(spellId))
texture = select(3, GetSpellInfo(spellName))
if toPlayer and db[auraType.."FADE"] then
self:DisplayEvent(INCOMING, self:ShortenString(spellName).." "..L["Fades"], texture, db["P"..auraType], message)
else return
Expand All @@ -526,12 +526,12 @@ function EavesDrop:CombatEvent()
elseif etype == "HEAL" then
spellId, spellName, spellSchool, amount, overHeal, absorbed, critical = a1, a2, a3, a4, a5, a6, a7
text = tostring(shortenValue(amount))
texture = select(3, GetSpellInfo(spellId))
texture = select(3, GetSpellInfo(spellName))

if toPlayer then
totHealingIn = totHealingIn + amount
if (amount < db["HFILTER"]) then return end
if (db["OVERHEAL"]) and overHeal > 0 then text = string_format("%d {%d}", shortenValue(amount-overHeal), shortenValue(overHeal)) end
if (db["OVERHEAL"]) and overHeal > 0 then text = string_format("%s {%s}", shortenValue(amount-overHeal), shortenValue(overHeal)) end
if (critical) then text = critchar..text..critchar end
if (db["HEALERID"] == true and not fromPlayer) then text = text.." ("..sourceName..")" end
color = db["PHEAL"]
Expand All @@ -542,7 +542,7 @@ function EavesDrop:CombatEvent()
elseif fromPlayer then
totHealingOut = totHealingOut + amount
if (amount < db["HFILTER"]) then return end
if (db["OVERHEAL"]) and overHeal > 0 then text = string_format("%d {%d}", shortenValue(amount-overHeal), shortenValue(overHeal)) end
if (db["OVERHEAL"]) and overHeal > 0 then text = string_format("%s {%s}", shortenValue(amount-overHeal), shortenValue(overHeal)) end
if (critical) then text = critchar..text..critchar end
color = db["THEAL"]
if (self:TrackStat(inout, "heal", spellName, texture, SCHOOL_STRINGS[spellSchool], amount, critical, message)) then
Expand All @@ -560,7 +560,7 @@ function EavesDrop:CombatEvent()
tcolor = "TMELEE"
else
spellId, spellName, spellSchool, missType = a1, a2, a3, a4
texture = select(3, GetSpellInfo(spellId))
texture = select(3, GetSpellInfo(spellName))
tcolor = "TSPELL"
end
text = _G[missType]
Expand All @@ -577,7 +577,7 @@ function EavesDrop:CombatEvent()
elseif etype == "DRAIN" then
if (db["GAINS"]) then
spellId, spellName, spellSchool, amount, powerType, extraAmount = a1, a2, a3, a4, a5, a6
texture = select(3, GetSpellInfo(spellId))
texture = select(3, GetSpellInfo(spellName))
if toPlayer then
text = string_format("-%d %s", amount, string_nil(""))
color = db["PGAIN"]
Expand All @@ -597,7 +597,7 @@ function EavesDrop:CombatEvent()
elseif etype == "POWER" then
if (db["GAINS"]) then
spellId, spellName, spellSchool, amount, powerType = a1, a2, a3, a4, a5
texture = select(3, GetSpellInfo(spellId))
texture = select(3, GetSpellInfo(spellName))
if toPlayer then
if (amount < db["MFILTER"]) then return end
color = db["PGAIN"]
Expand Down Expand Up @@ -630,7 +630,7 @@ end
function EavesDrop:PLAYER_XP_UPDATE()
local xp = UnitXP("player")
local xpgained = xp - pxp
self:DisplayEvent(MISC, string_format("+%d (%s)", shortenValue(xpgained), XP), nil, db["EXPC"], nil)
self:DisplayEvent(MISC, string_format("+%s (%s)", shortenValue(xpgained), XP), nil, db["EXPC"], nil)
pxp = xp
end

Expand Down Expand Up @@ -984,13 +984,13 @@ end
--Set last reflection
function EavesDrop:ParseReflect(timestamp, event, hideCaster, sourceGUID, sourceName, sourceFlags, sourceFlags2, destGUID, destName, destFlags, destFlags2, ...)
local spellId, spellName, spellSchool, amount, school, resisted, blocked, absorbed, critical, glancing, crushing = ...
local texture = select(3, GetSpellInfo(spellId))
local texture = select(3, GetSpellInfo(spellName))
local text = amount
local messsage = CombatLog_OnEvent(Blizzard_CombatLog_CurrentSettings, timestamp, event, hideCaster, sourceGUID, sourceName, sourceFlags, sourceFlags2, destGUID, destName, destFlags, destFlags2, ...)

--reflected events
if (self.ReflectTarget == sourceName and sourceName == destName and self.ReflectSkill == spellName) then
local text = string_format("%s: %d", REFLECT, shortenValue(amount))
local text = string_format("%s: %s", REFLECT, shortenValue(amount))
if (critical) then text = critchar..text..critchar end
self:DisplayEvent(OUTGOING, text, texture, self:SpellColor(db["TSPELL"], SCHOOL_STRINGS[school]), messsage)
self:ClearReflect()
Expand Down
8 changes: 4 additions & 4 deletions EavesDrop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Font name="EavesDropFontNormalSmall" inherits="GameFontNormalSmall" virtual="true"/>

<!-- EVENT TEMPLATE -->
<Frame name="EavesDropEventTemplate" virtual="true">
<Frame name="EavesDropEventTemplate" virtual="true" inherits="BackdropTemplate">
<Size>
<AbsDimension x="200" y="21"/>
</Size>
Expand Down Expand Up @@ -110,7 +110,7 @@
</Frame>

<!-- EVENT HISTORY TEMPLATE -->
<Frame name="EavesDropHistoryEventTemplate" virtual="true">
<Frame name="EavesDropHistoryEventTemplate" virtual="true" inherits="BackdropTemplate">
<Size>
<AbsDimension x="200" y="20" />
</Size>
Expand Down Expand Up @@ -202,7 +202,7 @@
</Button>

<!-- MAIN FRAME -->
<Frame name="EavesDropFrame" enableMouse="true" movable="true" frameStrata="LOW" parent="UIParent">
<Frame name="EavesDropFrame" enableMouse="true" movable="true" frameStrata="LOW" parent="UIParent" inherits="BackdropTemplate">
<Backdrop bgFile="Interface\ChatFrame\ChatFrameBackground" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
Expand Down Expand Up @@ -606,7 +606,7 @@
</Button>

<!-- HISTORY FRAME -->
<Frame name="EavesDropHistoryFrame" enableMouse="true" movable="true" frameStrata="LOW" clampedToScreen="true" parent="UIParent" hidden="true">
<Frame name="EavesDropHistoryFrame" enableMouse="true" movable="true" frameStrata="LOW" clampedToScreen="true" parent="UIParent" hidden="true" inherits="BackdropTemplate">
<Backdrop bgFile="Interface\ChatFrame\ChatFrameBackground" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
Expand Down