Small bug fixes and improvements

This commit is contained in:
Tercio Jose
2022-10-10 13:26:13 -03:00
parent b588d5e30c
commit 1ed29008aa
119 changed files with 6556 additions and 6650 deletions
+50 -50
View File
@@ -5,7 +5,7 @@ do
local _detalhes = _G._detalhes
local _
local _pairs = pairs
local _ipairs = ipairs
local ipairs = ipairs
local _UnitClass = UnitClass
local _select = select
local _unpack = unpack
@@ -42,13 +42,13 @@ do
local _, class = _UnitClass (name)
if (not class) then
for index, container in _ipairs(_detalhes.tabela_overall) do
for index, container in ipairs(_detalhes.tabela_overall) do
local index = container._NameIndexTable [name]
if (index) then
local actor = container._ActorTable [index]
if (actor.classe ~= "UNGROUPPLAYER") then
local left, right, top, bottom = unpack (_detalhes.class_coords [actor.classe] or unknown_class_coords)
local r, g, b = unpack (_detalhes.class_colors [actor.classe])
local left, right, top, bottom = unpack(_detalhes.class_coords [actor.classe] or unknown_class_coords)
local r, g, b = unpack(_detalhes.class_colors [actor.classe])
return actor.classe, left, right, top, bottom, r or 1, g or 1, b or 1
end
end
@@ -56,8 +56,8 @@ do
return "UNKNOW", 0.75, 1, 0.75, 1, 1, 1, 1, 1
else
local left, right, top, bottom = unpack (_detalhes.class_coords [class])
local r, g, b = unpack (_detalhes.class_colors [class])
local left, right, top, bottom = unpack(_detalhes.class_coords [class])
local r, g, b = unpack(_detalhes.class_colors [class])
return class, left, right, top, bottom, r or 1, g or 1, b or 1
end
end
@@ -71,7 +71,7 @@ do
NONE = {0, 50/512, 110/512, 150/512},
}
function _detalhes:GetRoleIcon (role)
return [[Interface\AddOns\Details\images\icons2]], unpack (roles [role])
return [[Interface\AddOns\Details\images\icons2]], unpack(roles [role])
end
function _detalhes:GetClassIcon (class)
@@ -95,7 +95,7 @@ do
elseif (c == "PET") then
return [[Interface\AddOns\Details\images\classes_small]], 0.25, 0.49609375, 0.75, 1
else
return [[Interface\AddOns\Details\images\classes_small]], _unpack (_detalhes.class_coords [c])
return [[Interface\AddOns\Details\images\classes_small]], _unpack(_detalhes.class_coords [c])
end
end
@@ -106,13 +106,13 @@ do
end
if (spec == 0) then
return [[Interface\AddOns\Details\images\classes_small]], unpack (_detalhes.class_coords["UNKNOW"])
return [[Interface\AddOns\Details\images\classes_small]], unpack(_detalhes.class_coords["UNKNOW"])
end
if (useAlpha) then
return [[Interface\AddOns\Details\images\spec_icons_normal_alpha]], unpack (_detalhes.class_specs_coords [spec])
return [[Interface\AddOns\Details\images\spec_icons_normal_alpha]], unpack(_detalhes.class_specs_coords [spec])
else
return [[Interface\AddOns\Details\images\spec_icons_normal]], unpack (_detalhes.class_specs_coords [spec])
return [[Interface\AddOns\Details\images\spec_icons_normal]], unpack(_detalhes.class_specs_coords [spec])
end
end
end
@@ -120,18 +120,18 @@ do
local default_color = {1, 1, 1, 1}
function _detalhes:GetClassColor (class)
if (self.classe) then
return unpack (_detalhes.class_colors [self.classe] or default_color)
return unpack(_detalhes.class_colors [self.classe] or default_color)
elseif (type(class) == "table" and class.classe) then
return unpack (_detalhes.class_colors [class.classe] or default_color)
return unpack(_detalhes.class_colors [class.classe] or default_color)
elseif (type(class) == "string") then
return unpack (_detalhes.class_colors [class] or default_color)
return unpack(_detalhes.class_colors [class] or default_color)
elseif (self.color) then
return unpack(self.color)
else
return unpack (default_color)
return unpack(default_color)
end
end
@@ -150,14 +150,14 @@ do
local spec = playerObject.spec
if (spec) then
texture = [[Interface\AddOns\Details\images\spec_icons_normal]]
L, R, T, B = unpack (_detalhes.class_specs_coords [spec])
L, R, T, B = unpack(_detalhes.class_specs_coords [spec])
else
texture = [[Interface\AddOns\Details\images\classes_small]]
L, R, T, B = unpack (_detalhes.class_coords [playerObject.classe or "UNKNOW"])
L, R, T, B = unpack(_detalhes.class_coords [playerObject.classe or "UNKNOW"])
end
else
texture = [[Interface\AddOns\Details\images\classes_small]]
L, R, T, B = unpack (_detalhes.class_coords ["UNKNOW"])
L, R, T, B = unpack(_detalhes.class_coords ["UNKNOW"])
end
return texture, L, R, T, B
@@ -172,7 +172,7 @@ do
end
if (Actor.spells) then --correcao pros containers misc, precisa pegar os diferentes tipos de containers de l
for spellid, _ in _pairs (Actor.spells._ActorTable) do
for spellid, _ in _pairs(Actor.spells._ActorTable) do
local class = _detalhes.ClassSpellList [spellid]
if (class) then
Actor.classe = class
@@ -182,7 +182,7 @@ do
container.need_refresh = true
end
if (Actor.minha_barra and type (Actor.minha_barra) == "table") then
if (Actor.minha_barra and type(Actor.minha_barra) == "table") then
Actor.minha_barra.minha_tabela = nil
_detalhes:ScheduleWindowUpdate (2, true)
end
@@ -194,11 +194,11 @@ do
if (not Actor.nome) then
if (not _detalhes.NoActorNameWarning) then
print ("==============")
_detalhes:Msg ("Unhandled Exception: Actor has no name, ContainerID: ", container.tipo)
_detalhes:Msg ("After the current combat, reset data and use /reload.")
_detalhes:Msg ("Report this issue to the Author: Actor with no name, container: ", container.tipo)
print ("==============")
print("==============")
_detalhes:Msg("Unhandled Exception: Actor has no name, ContainerID: ", container.tipo)
_detalhes:Msg("After the current combat, reset data and use /reload.")
_detalhes:Msg("Report this issue to the Author: Actor with no name, container: ", container.tipo)
print("==============")
_detalhes.NoActorNameWarning = true
end
return
@@ -214,7 +214,7 @@ do
container.need_refresh = true
end
if (Actor.minha_barra and type (Actor.minha_barra) == "table") then
if (Actor.minha_barra and type(Actor.minha_barra) == "table") then
Actor.minha_barra.minha_tabela = nil
_detalhes:ScheduleWindowUpdate (2, true)
end
@@ -224,8 +224,8 @@ do
if (tries and tries < 10) then
t[3] = tries + 1 --thanks @Farmbuyer on curseforge
--_detalhes:ScheduleTimer ("GuessClass", 2, {Actor, container, tries+1})
_detalhes:ScheduleTimer ("GuessClass", 2, t) --passing the same table instead of creating a new one
--_detalhes:ScheduleTimer("GuessClass", 2, {Actor, container, tries+1})
_detalhes:ScheduleTimer("GuessClass", 2, t) --passing the same table instead of creating a new one
end
return false
@@ -240,7 +240,7 @@ do
-- try get the spec from actor name
function _detalhes:GetSpec (name)
local guid = UnitGUID (name)
local guid = UnitGUID(name)
if (guid) then
local spec = _detalhes.cached_specs [guid]
if (spec) then
@@ -248,7 +248,7 @@ do
end
end
for index, container in _ipairs(_detalhes.tabela_overall) do
for index, container in ipairs(_detalhes.tabela_overall) do
local index = container._NameIndexTable [name]
if (index) then
local actor = container._ActorTable [index]
@@ -294,7 +294,7 @@ do
--get from the spell cast list
if (_detalhes.tabela_vigente) then
local misc_actor = _detalhes.tabela_vigente (4, Actor.nome)
local misc_actor = _detalhes.tabela_vigente(4, Actor.nome)
if (misc_actor and misc_actor.spell_cast) then
for spellid, _ in pairs(misc_actor.spell_cast) do
local spec = SpecSpellList [spellid]
@@ -311,7 +311,7 @@ do
container.need_refresh = true
end
if (Actor.minha_barra and type (Actor.minha_barra) == "table") then
if (Actor.minha_barra and type(Actor.minha_barra) == "table") then
Actor.minha_barra.minha_tabela = nil
_detalhes:ScheduleWindowUpdate (2, true)
end
@@ -322,7 +322,7 @@ do
end
else
if (Actor.spells) then
for spellid, _ in _pairs (Actor.spells._ActorTable) do
for spellid, _ in _pairs(Actor.spells._ActorTable) do
local spec = SpecSpellList [spellid]
if (spec) then
if (spec ~= Actor.spec) then
@@ -337,7 +337,7 @@ do
container.need_refresh = true
end
if (Actor.minha_barra and type (Actor.minha_barra) == "table") then
if (Actor.minha_barra and type(Actor.minha_barra) == "table") then
Actor.minha_barra.minha_tabela = nil
_detalhes:ScheduleWindowUpdate (2, true)
end
@@ -356,7 +356,7 @@ do
local misc_actor = container_misc._ActorTable [index]
local buffs = misc_actor.buff_uptime_spells and misc_actor.buff_uptime_spells._ActorTable
if (buffs) then
for spellid, spell in _pairs (buffs) do
for spellid, spell in _pairs(buffs) do
local spec = SpecSpellList [spellid]
if (spec) then
if (spec ~= Actor.spec) then
@@ -371,7 +371,7 @@ do
container.need_refresh = true
end
if (Actor.minha_barra and type (Actor.minha_barra) == "table") then
if (Actor.minha_barra and type(Actor.minha_barra) == "table") then
Actor.minha_barra.minha_tabela = nil
_detalhes:ScheduleWindowUpdate (2, true)
end
@@ -414,7 +414,7 @@ do
container.need_refresh = true
end
if (Actor.minha_barra and type (Actor.minha_barra) == "table") then
if (Actor.minha_barra and type(Actor.minha_barra) == "table") then
Actor.minha_barra.minha_tabela = nil
_detalhes:ScheduleWindowUpdate (2, true)
end
@@ -424,7 +424,7 @@ do
--get from the spell cast list
if (_detalhes.tabela_vigente) then
local misc_actor = _detalhes.tabela_vigente (4, Actor.nome)
local misc_actor = _detalhes.tabela_vigente(4, Actor.nome)
if (misc_actor and misc_actor.spell_cast) then
for spellid, _ in pairs(misc_actor.spell_cast) do
@@ -443,7 +443,7 @@ do
container.need_refresh = true
end
if (Actor.minha_barra and type (Actor.minha_barra) == "table") then
if (Actor.minha_barra and type(Actor.minha_barra) == "table") then
Actor.minha_barra.minha_tabela = nil
_detalhes:ScheduleWindowUpdate (2, true)
end
@@ -453,7 +453,7 @@ do
end
else
if (Actor.spells) then --correcao pros containers misc, precisa pegar os diferentes tipos de containers de l
for spellid, _ in _pairs (Actor.spells._ActorTable) do
for spellid, _ in _pairs(Actor.spells._ActorTable) do
local spec = SpecSpellList [spellid]
if (spec) then
_detalhes.cached_specs [Actor.serial] = spec
@@ -468,7 +468,7 @@ do
container.need_refresh = true
end
if (Actor.minha_barra and type (Actor.minha_barra) == "table") then
if (Actor.minha_barra and type(Actor.minha_barra) == "table") then
Actor.minha_barra.minha_tabela = nil
_detalhes:ScheduleWindowUpdate (2, true)
end
@@ -481,7 +481,7 @@ do
else
if (Actor.spells) then --correcao pros containers misc, precisa pegar os diferentes tipos de containers de l
for spellid, _ in _pairs (Actor.spells._ActorTable) do
for spellid, _ in _pairs(Actor.spells._ActorTable) do
local spec = SpecSpellList [spellid]
if (spec) then
_detalhes.cached_specs [Actor.serial] = spec
@@ -496,7 +496,7 @@ do
container.need_refresh = true
end
if (Actor.minha_barra and type (Actor.minha_barra) == "table") then
if (Actor.minha_barra and type(Actor.minha_barra) == "table") then
Actor.minha_barra.minha_tabela = nil
_detalhes:ScheduleWindowUpdate (2, true)
end
@@ -514,7 +514,7 @@ do
local misc_actor = container_misc._ActorTable [index]
local buffs = misc_actor.buff_uptime_spells and misc_actor.buff_uptime_spells._ActorTable
if (buffs) then
for spellid, spell in _pairs (buffs) do
for spellid, spell in _pairs(buffs) do
local spec = SpecSpellList [spellid]
if (spec) then
@@ -530,7 +530,7 @@ do
container.need_refresh = true
end
if (Actor.minha_barra and type (Actor.minha_barra) == "table") then
if (Actor.minha_barra and type(Actor.minha_barra) == "table") then
Actor.minha_barra.minha_tabela = nil
_detalhes:ScheduleWindowUpdate (2, true)
end
@@ -556,7 +556,7 @@ do
container.need_refresh = true
end
if (Actor.minha_barra and type (Actor.minha_barra) == "table") then
if (Actor.minha_barra and type(Actor.minha_barra) == "table") then
Actor.minha_barra.minha_tabela = nil
_detalhes:ScheduleWindowUpdate (2, true)
end
@@ -567,12 +567,12 @@ do
if (_detalhes.streamer_config.quick_detection) then
if (tries and tries < 30) then
t[3] = tries + 1
_detalhes:ScheduleTimer ("GuessSpec", 1, t)
_detalhes:ScheduleTimer("GuessSpec", 1, t)
end
else
if (tries and tries < 10) then
t[3] = tries + 1
_detalhes:ScheduleTimer ("GuessSpec", 3, t)
_detalhes:ScheduleTimer("GuessSpec", 3, t)
end
end
@@ -617,7 +617,7 @@ function _detalhes:AddClassOrSpecIcon (playerName, class, spec, iconSize, useAlp
if (spec) then
local specString = ""
local L, R, T, B = unpack (_detalhes.class_specs_coords [spec])
local L, R, T, B = unpack(_detalhes.class_specs_coords [spec])
if (L) then
if (useAlphaIcons) then
specString = "|TInterface\\AddOns\\Details\\images\\spec_icons_normal_alpha:" .. size .. ":" .. size .. ":0:0:512:512:" .. (L * 512) .. ":" .. (R * 512) .. ":" .. (T * 512) .. ":" .. (B * 512) .. "|t"
@@ -630,7 +630,7 @@ function _detalhes:AddClassOrSpecIcon (playerName, class, spec, iconSize, useAlp
if (class) then
local classString = ""
local L, R, T, B = unpack (_detalhes.class_coords [class])
local L, R, T, B = unpack(_detalhes.class_coords [class])
if (L) then
local imageSize = 128
if (useAlphaIcons) then