Merge pull request #147 from Flamanis/master

Allow for Custom Actor objects to be defined in Custom Displays
This commit is contained in:
Tercio Jose
2020-11-27 10:18:54 -03:00
committed by GitHub
3 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -157,7 +157,7 @@
local okey, _total, _top, _amount = _pcall (func, combat, instance_container, instance)
if (not okey) then
_detalhes:Msg ("|cFFFF9900error on custom display function|r:", total)
_detalhes:Msg ("|cFFFF9900error on custom display function|r:", _total)
return _detalhes:EndRefresh (instance, 0, combat, combat [1])
end
@@ -757,6 +757,9 @@
-- ~add
function atributo_custom:AddValue (actor, actortotal, checktop, name_complement)
local actor_table = self:GetActorTable (actor, name_complement)
if (not getmetatable(actor)) then
_setmetatable(actor,atributo_custom.mt)
end
actor_table.my_actor = actor
actor_table.value = actor_table.value + actortotal
@@ -845,6 +848,7 @@
classe = class,
value = _detalhes:GetOrderNumber(),
is_custom = true,
color = actor.color,
}, atributo_custom.mt)
new_actor.name_complement = name_complement
+2
View File
@@ -330,6 +330,8 @@
else
if (not is_player_class [actor.classe] and actor.flag_original and _bit_band (actor.flag_original, 0x00000020) ~= 0) then --> neutral
return _unpack (Details.class_colors.NEUTRAL)
elseif (actor.color) then
return _unpack(actor.color)
else
return _unpack (Details.class_colors [actor.classe or "UNKNOW"])
end
+3 -1
View File
@@ -117,8 +117,10 @@ do
elseif (type (class) == "string") then
return unpack (_detalhes.class_colors [class] or default_color)
elseif (self.color) then
return unpack(self.color)
else
unpack (default_color)
return unpack (default_color)
end
end