Skip to content

Commit

Permalink
small tooltip improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
coolmodi committed Oct 23, 2019
1 parent 111938d commit d2fbce7
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 5 deletions.
10 changes: 5 additions & 5 deletions UI/TooltipDisplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ local function AppendEfficiency(calcData, effectNum, isHeal, showTime)
local effectData = calcData[effectNum];
local unitPart = isHeal and "HEAL" or "DAMAGE";

if effectNum == 1 and SpellCalc_settings.ttEffCost then
if effectNum == 1 and SpellCalc_settings.ttEffCost and calcData.effectiveCost ~= calcData.baseCost then
GameTooltip:AddLine(("%s: %.1f"):format(L["TT_EFFCOST"], calcData.effectiveCost), TTCOLOR, TTCOLOR, TTCOLOR);
end

if SpellCalc_settings.ttPerMana then
if SpellCalc_settings.ttPerMana and effectData.perMana > 0 then
GameTooltip:AddLine(("%s: %.2f"):format(L["TT_PER_MANA_"..unitPart], effectData.perMana), TTCOLOR, TTCOLOR, TTCOLOR);
end

if SpellCalc_settings.ttToOom then
if SpellCalc_settings.ttToOom and effectData.doneToOom > 0 then
if showTime then
GameTooltip:AddLine(("%s: %d (%.1fs, %.1f casts)"):format(L["TT_UNTILOOM_"..unitPart], effectData.doneToOom, calcData.timeToOom, calcData.castsToOom), TTCOLOR, TTCOLOR, TTCOLOR);
else
Expand Down Expand Up @@ -186,14 +186,14 @@ local function AppendDmgShieldEffect(calcData, effectNum)
if effectData.charges > 0 then
GameTooltip:AddLine(("%s: %dx %d | %d total"):format(L["TT_DAMAGE"], effectData.charges, effectData.perCharge, effectData.hitAvg), TTCOLOR, TTCOLOR, TTCOLOR);
else
GameTooltip:AddLine(("%s: %d"):format(L["TT_DAMAGE"], effectData.ticks, effectData.perTick, effectData.hitAvg), TTCOLOR, TTCOLOR, TTCOLOR);
GameTooltip:AddLine(("%s: %.1f"):format(L["TT_DAMAGE"], effectData.perCharge), TTCOLOR, TTCOLOR, TTCOLOR);
end
end

AppendCoefData(calcData, effectData);
AppendMitigation(calcData);

if SpellCalc_settings.ttPerSecond then
if SpellCalc_settings.ttPerSecond and effectData.perSecond > 0 then
GameTooltip:AddLine(("%s: %.1f"):format(L["TT_PERSECC_DAMAGE"], effectData.perSecond), TTCOLOR, TTCOLOR, TTCOLOR);
end

Expand Down
3 changes: 3 additions & 0 deletions core/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ local function MakeSpellTable(spellType, primaryType, secondaryType)
};

if spellType == SPELL_TYPE.SPELL then
st.baseCost = 0;
st.effectiveCost = 0;
st.castsToOom = 0;
st.timeToOom = 0;
Expand Down Expand Up @@ -282,6 +283,8 @@ function _addon:CalcSpell(spellId)
--------------------------
-- Ressource stuff

calcData.baseCost = spellCost;

if spellCost == 0 then
calcData.effectiveCost = -1;
if spellType == SPELL_TYPE.SPELL then
Expand Down
81 changes: 81 additions & 0 deletions data/classes/druid_spell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ _addon.spellBaseInfo = {
[GetSpellInfo(339)] = { -- Entangling Roots
school = 4,
},
[GetSpellInfo(467)] = { -- Thorns
school = 4,
},
[GetSpellInfo(774)] = { -- Rejuvenation
school = 4,
},
Expand Down Expand Up @@ -54,6 +57,19 @@ _addon.spellRankInfo = {
},
}
},
[467] = { -- Thorns(Rank 1)
spellLevel = 6,
maxLevel = 0,
duration = 600,
effects = {
[1] = {
isDmgShield = true,
charges = 0,
min = 3,
coef = 0,
},
}
},
[774] = { -- Rejuvenation(Rank 1)
spellLevel = 4,
maxLevel = 9,
Expand All @@ -68,6 +84,19 @@ _addon.spellRankInfo = {
},
}
},
[782] = { -- Thorns(Rank 2)
spellLevel = 14,
maxLevel = 0,
duration = 600,
effects = {
[1] = {
isDmgShield = true,
charges = 0,
min = 6,
coef = 0,
},
}
},
[1058] = { -- Rejuvenation(Rank 2)
spellLevel = 10,
maxLevel = 15,
Expand Down Expand Up @@ -95,6 +124,19 @@ _addon.spellRankInfo = {
},
}
},
[1075] = { -- Thorns(Rank 3)
spellLevel = 24,
maxLevel = 0,
duration = 600,
effects = {
[1] = {
isDmgShield = true,
charges = 0,
min = 9,
coef = 0,
},
}
},
[1430] = { -- Rejuvenation(Rank 3)
spellLevel = 16,
maxLevel = 21,
Expand Down Expand Up @@ -391,6 +433,19 @@ _addon.spellRankInfo = {
},
}
},
[8914] = { -- Thorns(Rank 4)
spellLevel = 34,
maxLevel = 0,
duration = 600,
effects = {
[1] = {
isDmgShield = true,
charges = 0,
min = 12,
coef = 0,
},
}
},
[8921] = { -- Moonfire(Rank 1)
spellLevel = 4,
maxLevel = 9,
Expand Down Expand Up @@ -686,6 +741,19 @@ _addon.spellRankInfo = {
},
}
},
[9756] = { -- Thorns(Rank 5)
spellLevel = 44,
maxLevel = 0,
duration = 600,
effects = {
[1] = {
isDmgShield = true,
charges = 0,
min = 15,
coef = 0,
},
}
},
[9758] = { -- Healing Touch(Rank 8)
spellLevel = 44,
maxLevel = 49,
Expand Down Expand Up @@ -937,6 +1005,19 @@ _addon.spellRankInfo = {
},
}
},
[9910] = { -- Thorns(Rank 6)
spellLevel = 54,
maxLevel = 0,
duration = 600,
effects = {
[1] = {
isDmgShield = true,
charges = 0,
min = 18,
coef = 0,
},
}
},
[9912] = { -- Wrath(Rank 8)
spellLevel = 54,
maxLevel = 60,
Expand Down

0 comments on commit d2fbce7

Please sign in to comment.