Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Nov 27, 2022
1 parent 25cb9e8 commit ebe8c49
Show file tree
Hide file tree
Showing 22 changed files with 233 additions and 65 deletions.
2 changes: 1 addition & 1 deletion Details.toc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Interface: 100002
## Title: Details! Damage Meter
## Notes: Essential tool to impress that chick in your raid.
## SavedVariables: _detalhes_global
## SavedVariables: _detalhes_global, __details_backup
## SavedVariablesPerCharacter: _detalhes_database
## OptionalDeps: Ace3, LibSharedMedia-3.0, LibWindow-1.1, LibDBIcon-1.0, NickTag-1.0, LibDataBroker-1.1, LibGraph-2.0
## Version: #@project-version@
Expand Down
1 change: 1 addition & 0 deletions Details_TBC.toc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ functions\plater.lua
functions\deathmenu.lua
functions\macros.lua
functions\testbars.lua
functions\warcraftlogs.lua

core\timemachine.lua

Expand Down
3 changes: 2 additions & 1 deletion Details_Wrath.toc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Interface: 30400
## Title: Details! Damage Meter
## Notes: Essential tool to impress that chick in your raid.
## SavedVariables: _detalhes_global
## SavedVariables: _detalhes_global, __details_backup
## SavedVariablesPerCharacter: _detalhes_database
## OptionalDeps: Ace3, LibSharedMedia-3.0, LibWindow-1.1, LibDBIcon-1.0, NickTag-1.0, LibDataBroker-1.1, LibItemUpgradeInfo-1.0, LibGroupInSpecT-1.1, LibCompress, LibGraph-2.0
## Version: #@project-version@
Expand Down Expand Up @@ -57,6 +57,7 @@ functions\plater.lua
functions\deathmenu.lua
functions\macros.lua
functions\testbars.lua
functions\warcraftlogs.lua

core\timemachine.lua

Expand Down
33 changes: 31 additions & 2 deletions Libs/DF/cooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ function DF:CreateCoolTip()
["SelectedBottomAnchorMod"] = true,
["SelectedLeftAnchorMod"] = true,
["SelectedRightAnchorMod"] = true,

["SparkTexture"] = true,
["SparkHeightOffset"] = true,
["SparkWidthOffset"] = true,
["SparkHeight"] = true,
["SparkWidth"] = true,
["SparkAlpha"] = true,
["SparkColor"] = true,
["SparkPositionXOffset"] = true,
["SparkPositionYOffset"] = true,
}

gameCooltip.AliasList = {
Expand Down Expand Up @@ -548,6 +558,9 @@ function DF:CreateCoolTip()
statusbar.spark:SetBlendMode("ADD")
statusbar.spark:SetSize(12, 24)
statusbar.spark:SetPoint("LEFT", statusbar, "RIGHT", -20, -1)
statusbar.spark.originalWidth = 12
statusbar.spark.originalHeight = 24
statusbar.spark.originalTexture = "Interface\\CastingBar\\UI-CastingBar-Spark"

statusbar.background = statusbar:CreateTexture("$parent_Background", "ARTWORK")
statusbar.background:Hide()
Expand Down Expand Up @@ -1153,10 +1166,26 @@ function DF:CreateCoolTip()
end

function gameCooltip:RefreshSpark(menuButton)
local sparkTexture = gameCooltip.OptionsTable.SparkTexture or menuButton.spark.originalTexture
local sparkAlpha = gameCooltip.OptionsTable.SparkAlpha or 1
local sparkColor = gameCooltip.OptionsTable.SparkColor or "white"

local sparkWidth = gameCooltip.OptionsTable.SparkWidth or menuButton.spark.originalWidth
local sparkHeight = gameCooltip.OptionsTable.SparkHeight or menuButton.spark.originalHeight
local sparkWidthOffset = gameCooltip.OptionsTable.SparkWidthOffset or 0
local sparkHeightOffset = gameCooltip.OptionsTable.SparkHeightOffset or 0
local positionXOffset = gameCooltip.OptionsTable.SparkPositionXOffset or 0
local positionYOffset = gameCooltip.OptionsTable.SparkPositionYOffset or 0

menuButton.spark:SetSize(sparkWidth + sparkWidthOffset, sparkHeight + sparkHeightOffset)
menuButton.spark:SetTexture(sparkTexture)
menuButton.spark:SetVertexColor(DF:ParseColors(sparkColor))
menuButton.spark:SetAlpha(sparkAlpha)

menuButton.spark:ClearAllPoints()
menuButton.spark:SetPoint("left", menuButton.statusbar, "left", (menuButton.statusbar:GetValue() * (menuButton.statusbar:GetWidth() / 100)) - 5, 0)
menuButton.spark:SetPoint("left", menuButton.statusbar, "left", (menuButton.statusbar:GetValue() * (menuButton.statusbar:GetWidth() / 100)) - 5 + positionXOffset, 0 + positionYOffset)
menuButton.spark2:ClearAllPoints()
menuButton.spark2:SetPoint("left", menuButton.statusbar, "left", menuButton.statusbar:GetValue() * (menuButton.statusbar:GetWidth()/100) - 16, 0)
menuButton.spark2:SetPoint("left", menuButton.statusbar, "left", menuButton.statusbar:GetValue() * (menuButton.statusbar:GetWidth()/100) - 16 + positionXOffset, 0 + positionYOffset)
end

function gameCooltip:StatusBar(menuButton, statusBarSettings)
Expand Down
2 changes: 1 addition & 1 deletion Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 396
local dversion = 397
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)

Expand Down
19 changes: 14 additions & 5 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
local addonName, Details222 = ...
local version, build, date, tocversion = GetBuildInfo()

_detalhes.build_counter = 10290
_detalhes.alpha_build_counter = 10290 --if this is higher than the regular counter, use it instead
_detalhes.build_counter = 10300
_detalhes.alpha_build_counter = 10300 --if this is higher than the regular counter, use it instead
_detalhes.dont_open_news = true
_detalhes.game_version = version
_detalhes.userversion = version .. " " .. _detalhes.build_counter
_detalhes.realversion = 146 --core version, this is used to check API version for scripts and plugins (see alias below)
_detalhes.realversion = 147 --core version, this is used to check API version for scripts and plugins (see alias below)
_detalhes.APIVersion = _detalhes.realversion --core version
_detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" --simple stirng to show to players

Expand All @@ -24,6 +24,7 @@

_detalhes.BFACORE = 131 --core version on BFA launch
_detalhes.SHADOWLANDSCORE = 143 --core version on Shadowlands launch
_detalhes.DRAGONFLIGHT = 147 --core version on Dragonflight launch

Details = _detalhes

Expand Down Expand Up @@ -54,6 +55,14 @@
--namespace for the player breakdown window
Details.PlayerBreakdown = {}

--color namespace
Details222.ColorScheme = {
["gradient-background"] = {0.1215, 0.1176, 0.1294, 0.8},
}

function Details222.ColorScheme.GetColorFor(colorScheme)
return Details222.ColorScheme[colorScheme]
end

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--initialization stuff
Expand All @@ -69,8 +78,8 @@ do
local news = {
{"v10.0.2.10277.146", "Nov 18th, 2022"},
"REMINDER: '/details coach' to get damage/healing/deaths in real time as the 21st person (coach) for the next raid tier in dragonflight.",
"",
"New <Plugin: Cast Log> show a time line of spells used by players in the group, Raid Leader: show all attack and defense cooldowns used by the raid.",
"New Compare tab: recreated from scratch, this new Compare has no player limitation, pets merged, bigger lines.",
"New <Plugin: Cast Log> show a time line of spells used by players in the group, Raid Leader: show all attack and defense cooldowns used by the raid (download it now on wago or curseforge).",
"Wago: Details! Standalone version is now hosted on addons.wago.io and WowUp.com.",
"",

Expand Down
14 changes: 7 additions & 7 deletions classes/class_damage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--damage taken by spell

local byspell_tooltip_background = {value = 100, color = {0.1960, 0.1960, 0.1960, 0.9097}, texture = [[Interface\AddOns\Details\images\bar_background2]]}
local byspell_tooltip_background = {value = 100, color = {0.1960, 0.1960, 0.1960, 0.9097}, texture = [[Interface\AddOns\Details\images\bar_background_dark]]}

function Details:ToolTipBySpell (instance, tabela, thisLine, keydown)

Expand Down Expand Up @@ -5091,7 +5091,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellId, spellLine, instance)
end

t4[1] = 0
t4[2] = {p = 100, c = {0.282353, 0.239216, 0.545098, 0.6}}
t4[2] = {p = 100, c = {0.200, 0.576, 0.498, 0.6}}
t4[3] = "Spell Empower Average Level: " .. format("%.2f", empowerLevelSum / empowerAmount)
t4[4] = ""
t4[5] = ""
Expand All @@ -5100,23 +5100,23 @@ function atributo_damage:MontaDetalhesDamageDone (spellId, spellLine, instance)
t4[11] = ""

if (level1AverageDamage ~= "0") then
t4[4] = "Level 1 Average: " .. level1AverageDamage .. " (" .. (empowerAmountPerLevel[1] or 0) .. ")"
t4[4] = "Level 1 Avg: " .. level1AverageDamage .. " (" .. (empowerAmountPerLevel[1] or 0) .. ")"
end

if (level2AverageDamage ~= "0") then
t4[6] = "Level 2 Average: " .. level2AverageDamage .. " (" .. (empowerAmountPerLevel[2] or 0) .. ")"
t4[6] = "Level 2 Avg: " .. level2AverageDamage .. " (" .. (empowerAmountPerLevel[2] or 0) .. ")"
end

if (level3AverageDamage ~= "0") then
t4[11] = "Level 3 Average: " .. level3AverageDamage .. " (" .. (empowerAmountPerLevel[3] or 0) .. ")"
t4[11] = "Level 3 Avg: " .. level3AverageDamage .. " (" .. (empowerAmountPerLevel[3] or 0) .. ")"
end

if (level4AverageDamage ~= "0") then
t4[10] = "Level 4 Average: " .. level4AverageDamage .. " (" .. (empowerAmountPerLevel[4] or 0) .. ")"
t4[10] = "Level 4 Avg: " .. level4AverageDamage .. " (" .. (empowerAmountPerLevel[4] or 0) .. ")"
end

if (level5AverageDamage ~= "0") then
t4[5] = "Level 5 Average: " .. level5AverageDamage .. " (" .. (empowerAmountPerLevel[5] or 0) .. ")"
t4[5] = "Level 5 Avg: " .. level5AverageDamage .. " (" .. (empowerAmountPerLevel[5] or 0) .. ")"
end
end

Expand Down
2 changes: 1 addition & 1 deletion classes/class_utility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ function Details.ShowDeathTooltip(instance, lineFrame, combatObject, deathTable)

elseif (evType == 4) then
--debuff
gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (" .. source .. ")", "x" .. amount .. AURA_TYPE_DEBUFF .. " (" .. healthPercent .. "%)", 1, "white", "white")
gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (" .. source .. ")", "x" .. amount .. " " .. AURA_TYPE_DEBUFF .. " (" .. healthPercent .. "%)", 1, "white", "white")
gameCooltip:AddIcon(spellIcon)
gameCooltip:AddStatusBar(100, 1, barTypeColors.debuff, showSpark)
end
Expand Down
26 changes: 25 additions & 1 deletion core/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,30 @@
Details.tooltip.icon_size.W = Details.tooltip.line_height
Details.tooltip.icon_size.H = Details.tooltip.line_height

--[[spark options
["SparkTexture"] = true,
["SparkHeightOffset"] = true,
["SparkWidthOffset"] = true,
["SparkHeight"] = true,
["SparkWidth"] = true,
["SparkAlpha"] = true,
["SparkColor"] = true,
["SparkPositionXOffset"] = true,
["SparkPositionYOffset"] = true,
--]]

useSpark = true
--GameCooltip:SetOption("SparkHeightOffset", 6)
GameCooltip:SetOption("SparkTexture", [[Interface\Buttons\WHITE8X8]])
GameCooltip:SetOption("SparkWidth", 1)
GameCooltip:SetOption("SparkHeight", 20)
GameCooltip:SetOption("SparkColor", "gray")
GameCooltip:SetOption("SparkAlpha", 0.15)
GameCooltip:SetOption("SparkPositionXOffset", 5)
--GameCooltip:SetOption("SparkAlpha", 0.3)
--GameCooltip:SetOption("SparkPositionXOffset", -2)


value = value or 100

if (not side) then
Expand Down Expand Up @@ -1634,7 +1658,7 @@
GameCooltip:Reset()
GameCooltip:SetType ("tooltip")

GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_background]])
GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_background_dark]])

GameCooltip:SetOption("TextSize", Details.tooltip.fontsize)
GameCooltip:SetOption("TextFont", Details.tooltip.fontface)
Expand Down
64 changes: 49 additions & 15 deletions core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@

--Seal of Command
[20424] = 69403, --53739 and 53733

--odyn's fury warrior
[385062] = 385059,
[385061] = 385059,
[385060] = 385059,
}

else --retail
Expand Down Expand Up @@ -5161,7 +5166,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (not isWOTLK) then
C_Timer.After(1, function()
if (Details.show_warning_id1) then
if (Details.show_warning_id1_amount < 10) then
if (Details.show_warning_id1_amount < 2) then
Details.show_warning_id1_amount = Details.show_warning_id1_amount + 1
Details:Msg("|cFFFFFF00you might find differences on damage done, this is due to a bug in the game client, nothing related to Details! itself (" .. Details.show_warning_id1_amount .. " / 10).")
end
Expand Down Expand Up @@ -5276,7 +5281,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (not isWOTLK) then
C_Timer.After(1, function()
if (Details.show_warning_id1) then
if (Details.show_warning_id1_amount < 10) then
if (Details.show_warning_id1_amount < 2) then
Details.show_warning_id1_amount = Details.show_warning_id1_amount + 1
Details:Msg("|cFFFFFF00you may find differences on damage done, this is due to a bug in the game client, nothing related to Details! itself (" .. Details.show_warning_id1_amount .. " / 10).")
end
Expand Down Expand Up @@ -6021,18 +6026,34 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
local saver = CreateFrame("frame", nil, UIParent)
saver:RegisterEvent("PLAYER_LOGOUT")
saver:SetScript("OnEvent", function(...)
__details_backup = __details_backup or {
_exit_error = {},
_instance_backup = {},
}
local exitErrors = __details_backup._exit_error

local addToExitErrors = function(text)
table.insert(exitErrors, 1, text)
table.remove(exitErrors, 10)
end

local currentStep = ""

--save the time played on this class, run protected
pcall(function()
local savePlayTimeClass, savePlayTimeError = pcall(function()
Details.SavePlayTimeOnClass()
end)

local currentStep = 0
if (not savePlayTimeClass) then
addToExitErrors("Saving Play Time:" .. savePlayTimeError)
end

--SAVINGDATA = true
_detalhes_global.exit_log = {}
_detalhes_global.exit_errors = _detalhes_global.exit_errors or {}

currentStep = "Checking the framework integrity"

if (not _detalhes.gump) then
--failed to load the framework
tinsert(_detalhes_global.exit_log, "The framework wasn't in Details member 'gump'.")
Expand All @@ -6041,9 +6062,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end

local saver_error = function(errortext)
_detalhes_global = _detalhes_global or {}
tinsert(_detalhes_global.exit_errors, 1, currentStep .. "|" .. date() .. "|" .. _detalhes.userversion .. "|" .. errortext .. "|" .. debugstack())
tremove(_detalhes_global.exit_errors, 6)
--if the error log cause an error?
local writeLog = function()
_detalhes_global = _detalhes_global or {}
tinsert(_detalhes_global.exit_errors, 1, currentStep .. "|" .. date() .. "|" .. _detalhes.userversion .. "|" .. errortext .. "|" .. debugstack())
tremove(_detalhes_global.exit_errors, 6)
addToExitErrors(currentStep .. "|" .. date() .. "|" .. _detalhes.userversion .. "|" .. errortext .. "|" .. debugstack())
end
xpcall(writeLog, addToExitErrors)
end

_detalhes.saver_error_func = saver_error
Expand All @@ -6058,17 +6084,24 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1

--do not save window pos
if (_detalhes.tabela_instancias) then
currentStep = "Dealing With Instances"
tinsert(_detalhes_global.exit_log, "2 - Clearing user place from instances.")
for id, instance in _detalhes:ListInstances() do
if (id) then
tinsert(_detalhes_global.exit_log, " - " .. id .. " has baseFrame: " .. (instance.baseframe and "yes" or "no") .. ".")
if (instance.baseframe) then
instance.baseframe:SetUserPlaced (false)
instance.baseframe:SetDontSavePosition (true)
local clearInstances = function()
currentStep = "Dealing With Instances"
tinsert(_detalhes_global.exit_log, "2 - Clearing user place from instances.")
for id, instance in _detalhes:ListInstances() do
if (id) then
tinsert(_detalhes_global.exit_log, " - " .. id .. " has baseFrame: " .. (instance.baseframe and "yes" or "no") .. ".")
if (instance.baseframe) then
instance.baseframe:SetUserPlaced (false)
instance.baseframe:SetDontSavePosition (true)
end
end
end
end
xpcall(clearInstances, saver_error)
else
tinsert(_detalhes_global.exit_errors, 1, "not _detalhes.tabela_instancias")
tremove(_detalhes_global.exit_errors, 6)
addToExitErrors("not _detalhes.tabela_instancias")
end

--leave combat start save tables
Expand All @@ -6087,6 +6120,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1

if (_detalhes.wipe_full_config) then
tinsert(_detalhes_global.exit_log, "5 - Is a full config wipe.")
addToExitErrors("true: _detalhes.wipe_full_config")
_detalhes_global = nil
_detalhes_database = nil
return
Expand Down
Loading

0 comments on commit ebe8c49

Please sign in to comment.