Updates, please see /details news

This commit is contained in:
Tercio Jose
2022-04-22 13:30:41 -03:00
parent 7762e29d00
commit 694b52ddc4
27 changed files with 2703 additions and 1676 deletions
+44
View File
@@ -10,6 +10,8 @@ do
local _select = select
local _unpack = unpack
local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0")
local unknown_class_coords = {0.75, 1, 0.75, 1}
function Details:GetUnknownClassIcon()
@@ -255,6 +257,34 @@ do
end
end
function Details:GetUnitId(unitName)
unitName = unitName or self.nome
local unitId = openRaidLib.GetUnitID(unitName)
if (unitId) then
return unitId
end
if (IsInRaid()) then
for i = 1, GetNumGroupMembers() do
local unitId = "raid" .. i
if (GetUnitName(unitId, true) == unitName) then
return unitId
end
end
elseif (IsInGroup()) then
for i = 1, GetNumGroupMembers() -1 do
local unitId = "party" .. i
if (GetUnitName(unitId, true) == unitName) then
return unitId
end
end
if (UnitName("player") == unitName) then
return "player"
end
end
end
function _detalhes:ReGuessSpec (t)
local Actor, container = t[1], t[2]
@@ -272,6 +302,8 @@ do
Actor.spec = spec
Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe
Actor.guessing_spec = nil
Details:SendEvent("UNIT_SPEC", nil, Actor:GetUnitId(), spec, Actor.serial)
if (container) then
container.need_refresh = true
@@ -296,6 +328,8 @@ do
Actor.spec = spec
Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe
Details:SendEvent("UNIT_SPEC", nil, Actor:GetUnitId(), spec, Actor.serial)
if (container) then
container.need_refresh = true
@@ -328,6 +362,8 @@ do
Actor.spec = spec
Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe
Details:SendEvent("UNIT_SPEC", nil, Actor:GetUnitId(), spec, Actor.serial)
if (container) then
container.need_refresh = true
@@ -396,6 +432,8 @@ do
Actor.spec = spec
Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe
Details:SendEvent("UNIT_SPEC", nil, Actor:GetUnitId(), spec, Actor.serial)
Actor.guessing_spec = nil
@@ -421,6 +459,8 @@ do
Actor.spec = spec
Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe
Actor.guessing_spec = nil
Details:SendEvent("UNIT_SPEC", nil, Actor:GetUnitId(), spec, Actor.serial)
if (container) then
container.need_refresh = true
@@ -447,6 +487,8 @@ do
Actor.spec = spec
Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe
Actor.guessing_spec = nil
Details:SendEvent("UNIT_SPEC", nil, Actor:GetUnitId(), spec, Actor.serial)
if (container) then
container.need_refresh = true
@@ -479,6 +521,8 @@ do
Actor.spec = spec
Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe
Actor.guessing_spec = nil
Details:SendEvent("UNIT_SPEC", nil, Actor:GetUnitId(), spec, Actor.serial)
if (container) then
container.need_refresh = true