Skip to content

Commit

Permalink
Round of fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Mar 24, 2023
1 parent 383f21e commit 7cf01d1
Show file tree
Hide file tree
Showing 6 changed files with 256 additions and 174 deletions.
4 changes: 2 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
local addonName, Details222 = ...
local version, build, date, tocversion = GetBuildInfo()

_detalhes.build_counter = 10722
_detalhes.alpha_build_counter = 10722 --if this is higher than the regular counter, use it instead
_detalhes.build_counter = 10727
_detalhes.alpha_build_counter = 10727 --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
Expand Down
80 changes: 43 additions & 37 deletions classes/class_utility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ end
---@param whichRowLine number
---@param rankPosition number
---@param instance table
function atributo_misc:UpdateDeathRow(morte, whichRowLine, rankPosition, instance)
function atributo_misc:UpdateDeathRow(morte, whichRowLine, rankPosition, instance) --todo: change this function name
morte["dead"] = true
local thisRow = instance.barras[whichRowLine]

Expand Down Expand Up @@ -753,8 +753,23 @@ function atributo_misc:RefreshWindow(instance, combatObject, bIsForceRefresh, bI

local whichRowLine = 1

--if sort direction is descending, need to invert the values in the table which holds the deaths in the combat
if (instance.bars_sort_direction == 1) then
local bIsRaidCombat = combatObject:GetCombatType() == DETAILS_SEGMENTTYPE_RAID_BOSS
local bIsMythicDungeonOverall = combatObject:IsMythicDungeonOverall()
local bIsOverallData = instance:GetSegmentId() == DETAILS_SEGMENTID_OVERALL

local bReverseDeathLog = false
if (bIsRaidCombat and Details.combat_log.inverse_deathlog_raid) then
bReverseDeathLog = true

elseif (bIsMythicDungeonOverall and Details.combat_log.inverse_deathlog_mplus) then
bReverseDeathLog = true

elseif (bIsOverallData and Details.combat_log.inverse_deathlog_overalldata) then
bReverseDeathLog = true
end

if (bReverseDeathLog) then
--reverse the table
local tempTable = {}
for i = #allDeathsInTheCombat, 1, -1 do
tempTable[#tempTable+1] = allDeathsInTheCombat[i]
Expand All @@ -779,53 +794,45 @@ function atributo_misc:RefreshWindow(instance, combatObject, bIsForceRefresh, bI

return _detalhes:EndRefresh(instance, total, combatObject, utilityActorContainer)
else

if (instance.atributo == 5) then --custom
--faz o sort da categoria e retorna o amount corrigido
table.sort (conteudo, _detalhes.SortIfHaveKey)
table.sort(conteudo, Details.SortIfHaveKey)

--n�o mostrar resultados com zero
for i = amount, 1, -1 do --de tr�s pra frente
--strip results with zero
for i = amount, 1, -1 do
if (not conteudo[i][keyName] or conteudo[i][keyName] < 1) then
amount = amount - 1
else
break
end
end

--pega o total ja aplicado na tabela do combate
total = combatObject.totals [class_type] [keyName]

--grava o total
--get the total done from the combat total data
total = combatObject.totals[class_type][keyName]
instance.top = conteudo[1][keyName]

elseif (modo == modo_ALL) then --mostrando ALL
table.sort(conteudo, Details.SortIfHaveKey)

table.sort (conteudo, _detalhes.SortIfHaveKey)

--n�o mostrar resultados com zero
for i = amount, 1, -1 do --de tr�s pra frente
--strip results with zero
for i = amount, 1, -1 do
if (not conteudo[i][keyName] or conteudo[i][keyName] < 1) then
amount = amount - 1
else
break
end
end

--pega o total ja aplicado na tabela do combate
total = combatObject.totals [class_type] [keyName]

--grava o total
--get the total done from the combat total data
total = combatObject.totals[class_type][keyName]
instance.top = conteudo[1][keyName]

elseif (modo == modo_GROUP) then --mostrando GROUP
elseif (modo == modo_GROUP) then
table.sort(conteudo, Details.SortGroupIfHaveKey)

--if (refresh_needed) then
table.sort (conteudo, _detalhes.SortGroupIfHaveKey)
--end
for index, player in ipairs(conteudo) do
if (player.grupo) then --� um player e esta em grupo
if (not player[keyName] or player[keyName] < 1) then --dano menor que 1, interromper o loop
if (player.grupo) then --is a player and is in the player group
--stop when the amount is zero
if (not player[keyName] or player[keyName] < 1) then
amount = index - 1
break
elseif (index == 1) then --esse IF aqui, precisa mesmo ser aqui? n�o daria pra pega-lo com uma chave [1] nad grupo == true?
Expand All @@ -842,29 +849,28 @@ function atributo_misc:RefreshWindow(instance, combatObject, bIsForceRefresh, bI
end
end

--refaz o mapa do container
--refresh the container map
utilityActorContainer:remapear()

if (bIsExport) then
return total, keyName, instance.top, amount
end

if (amount < 1) then --n�o h� barras para mostrar
--check if there's nothing to show
if (amount < 1) then
instance:EsconderScrollBar() --precisaria esconder a scroll bar
return _detalhes:EndRefresh (instance, total, combatObject, utilityActorContainer) --retorna a tabela que precisa ganhar o refresh
return Details:EndRefresh(instance, total, combatObject, utilityActorContainer)
end

--estra mostrando ALL ent�o posso seguir o padr�o correto? primeiro, atualiza a scroll bar...
instance:RefreshScrollBar (amount)
instance:RefreshScrollBar(amount)

--depois faz a atualiza��o normal dele atrav�s dos_ iterators
local whichRowLine = 1
local barras_container = instance.barras
local percentage_type = instance.row_info.percent_type
local bars_show_data = instance.row_info.textR_show_data
local bars_brackets = instance:GetBarBracket()
local bars_separator = instance:GetBarSeparator()
local use_animations = _detalhes.is_using_row_animations and (not instance.baseframe.isStretching and not bIsForceRefresh)
local bUseAnimations = _detalhes.is_using_row_animations and (not instance.baseframe.isStretching and not bIsForceRefresh)

if (total == 0) then
total = 0.00000001
Expand All @@ -875,22 +881,22 @@ function atributo_misc:RefreshWindow(instance, combatObject, bIsForceRefresh, bI

if (instance.bars_sort_direction == 1) then --top to bottom
for i = instance.barraS[1], instance.barraS[2], 1 do --vai atualizar s� o range que esta sendo mostrado
conteudo[i]:RefreshLine(instance, barras_container, whichRowLine, i, total, subAttribute, bIsForceRefresh, keyName, nil, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator)
conteudo[i]:RefreshLine(instance, barras_container, whichRowLine, i, total, subAttribute, bIsForceRefresh, keyName, nil, percentage_type, bUseAnimations, bars_show_data, bars_brackets, bars_separator)
whichRowLine = whichRowLine+1
end

elseif (instance.bars_sort_direction == 2) then --bottom to top
for i = instance.barraS[2], instance.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado
if (conteudo[i]) then
conteudo[i]:RefreshLine(instance, barras_container, whichRowLine, i, total, subAttribute, bIsForceRefresh, keyName, nil, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator)
conteudo[i]:RefreshLine(instance, barras_container, whichRowLine, i, total, subAttribute, bIsForceRefresh, keyName, nil, percentage_type, bUseAnimations, bars_show_data, bars_brackets, bars_separator)
whichRowLine = whichRowLine+1
end
end

end

if (use_animations) then
instance:PerformAnimations (whichRowLine-1)
if (bUseAnimations) then
instance:PerformAnimations(whichRowLine-1)
end

if (instance.atributo == 5) then --custom
Expand Down
11 changes: 8 additions & 3 deletions core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@
local cacheAnything = {
arenaHealth = {},
paladin_vivaldi_blessings = {},
track_hunter_frenzy = false,
}



--cache the data for passive trinkets procs
local _trinket_data_cache = {}

Expand Down Expand Up @@ -2506,7 +2509,7 @@
--BfA monk talent
monk_guard_talent [sourceSerial] = amount

elseif (spellId == 272790) then --hunter pet Frenzy quick fix for show the Frenzy uptime
elseif (spellId == 272790 and cacheAnything.track_hunter_frenzy) then --hunter pet Frenzy quick fix for show the Frenzy uptime
if (pet_frenzy_cache[sourceName]) then
if (DetailsFramework:IsNearlyEqual(pet_frenzy_cache[sourceName], time, 0.2)) then
return
Expand Down Expand Up @@ -2715,7 +2718,7 @@
end

if (tipo == "BUFF") then
if (spellid == 272790) then --hunter pet Frenzy spellid
if (spellid == 272790 and cacheAnything.track_hunter_frenzy) then --hunter pet Frenzy spellid
local miscActorObject = misc_cache[sourceName]
if (miscActorObject) then
--fastest way to query utility spell data
Expand Down Expand Up @@ -2803,7 +2806,7 @@
end

if (tipo == "BUFF") then
if (spellid == 272790) then --hunter pet Frenzy spellid
if (spellid == 272790 and cacheAnything.track_hunter_frenzy) then --hunter pet Frenzy spellid
if (not pet_frenzy_cache[sourceName]) then
return
end
Expand Down Expand Up @@ -6006,6 +6009,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1

wipe(cacheAnything.paladin_vivaldi_blessings)

cacheAnything.track_hunter_frenzy = Details.combat_log.track_hunter_frenzy

damage_cache = setmetatable({}, _detalhes.weaktable)
damage_cache_pets = setmetatable({}, _detalhes.weaktable)
damage_cache_petsOwners = setmetatable({}, _detalhes.weaktable)
Expand Down
25 changes: 11 additions & 14 deletions frames/window_options2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ if (true) then
--return
end


local Details = _G.Details
local DF = _G.DetailsFramework
local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details")
--local SharedMedia = _G.LibStub:GetLibrary("LibSharedMedia-3.0")
--local LDB = _G.LibStub("LibDataBroker-1.1", true)
--local LDBIcon = LDB and _G.LibStub("LibDBIcon-1.0", true)

--options panel namespace
Details.options = {}
Expand All @@ -26,7 +22,6 @@ local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")
local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")
local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE")

local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")
local options_button_template_selected = DF.table.copy({}, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
options_button_template_selected.backdropbordercolor = {1, .8, .2}
Expand Down Expand Up @@ -95,7 +90,7 @@ function Details.options.InitializeOptionsWindow(instance)
--what the window is showing
local atributo = instance.atributo
local sub_atributo = instance.sub_atributo

if (atributo == 5) then --custom
local CustomObject = _detalhes.custom [sub_atributo]
if (not CustomObject) then
Expand All @@ -108,7 +103,7 @@ function Details.options.InitializeOptionsWindow(instance)
end
else
local modo = instance.modo

if (modo == 1) then --solo plugin
atributo = _detalhes.SoloTables.Mode or 1
local SoloInfo = _detalhes.SoloTables.Menu [atributo]
Expand All @@ -117,7 +112,7 @@ function Details.options.InitializeOptionsWindow(instance)
else
instanceList [#instanceList+1] = {value = index, label = "#".. index .. " unknown", onclick = onSelectInstance, icon = ""}
end

elseif (modo == 4) then --raid plugin
local plugin_name = instance.current_raid_plugin or instance.last_raid_plugin
if (plugin_name) then
Expand Down Expand Up @@ -298,18 +293,20 @@ function Details.options.InitializeOptionsWindow(instance)
[15] = "Broadcaster Tools",
[16] = Loc ["STRING_OPTIONSMENU_SPELLS"],
[17] = Loc ["STRING_OPTIONSMENU_DATACHART"],

[18] = "Mythic Dungeon",

[19] = "Search Results",

[20] = "Combat Log",
}

local optionsSectionsOrder = {
1, "", 3, 4, "", 5, 6, 7, 12, 13, "", 9, 2, 8, 10, 11, 18, "", 14, 15, 16, 17, "", 19
1, 20, "", 3, 4, "", 5, 6, 7, 12, 13, "", 9, 2, 8, 10, 11, 18, "", 14, 15, 16, 17, "", 19
}

local maxSectionIds = 19
local maxSectionIds = 0
for k in pairs(sectionsName) do
maxSectionIds = maxSectionIds + 1
end

Details.options.maxSectionIds = maxSectionIds

local buttonYPosition = -40
Expand Down Expand Up @@ -403,7 +400,7 @@ function Details.options.InitializeOptionsWindow(instance)
Details:OpenOptionsWindow(_G.DetailsOptionsWindow.instance)
end
end

Details.options.SelectOptionsSection(1)
end

Expand Down
Loading

0 comments on commit 7cf01d1

Please sign in to comment.