From e1a33dc364c0db5dab1b0876c16e6319097a7fba Mon Sep 17 00:00:00 2001 From: Flamanis Date: Thu, 26 Nov 2020 14:08:47 -0600 Subject: [PATCH 1/4] Fix Search Error Detection, Allow custom actors --- classes/class_custom.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/class_custom.lua b/classes/class_custom.lua index 10a7a15f..cdeeeec8 100644 --- a/classes/class_custom.lua +++ b/classes/class_custom.lua @@ -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,8 @@ classe = class, value = _detalhes:GetOrderNumber(), is_custom = true, + color = actor.color, + icone = actor.icon or actor.icone }, atributo_custom.mt) new_actor.name_complement = name_complement From 638cf0cc749080c16709ece4323df63d0fa718b1 Mon Sep 17 00:00:00 2001 From: Flamanis Date: Thu, 26 Nov 2020 14:09:40 -0600 Subject: [PATCH 2/4] Allow for custom actors with a color. --- classes/class_damage.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/class_damage.lua b/classes/class_damage.lua index 001ae745..7e7ff0d6 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -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 From d2bab21d7a334f5bd2cd610fe15a25f5515221fb Mon Sep 17 00:00:00 2001 From: Flamanis Date: Thu, 26 Nov 2020 14:11:21 -0600 Subject: [PATCH 3/4] GetClassColor custom actor support + Fix Allow for GetClassColor to return a custom color from custom actors. And fix the final else not returning anything. --- functions/playerclass.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/playerclass.lua b/functions/playerclass.lua index a76c5554..a3aef963 100644 --- a/functions/playerclass.lua +++ b/functions/playerclass.lua @@ -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 From 56384d66fcf4df68139e4c33fb69b84694d9c9a5 Mon Sep 17 00:00:00 2001 From: Flamanis Date: Thu, 26 Nov 2020 16:37:10 -0600 Subject: [PATCH 4/4] Remove custom icon Upon testing I couldn't get it to work atm. So I'm just removing it from the pull request. --- classes/class_custom.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/classes/class_custom.lua b/classes/class_custom.lua index cdeeeec8..fb1a22bc 100644 --- a/classes/class_custom.lua +++ b/classes/class_custom.lua @@ -849,7 +849,6 @@ value = _detalhes:GetOrderNumber(), is_custom = true, color = actor.color, - icone = actor.icon or actor.icone }, atributo_custom.mt) new_actor.name_complement = name_complement