General development and bug fixes (see commit description).
- Fixed the deaths display, where the windows wasn't usig custom text scripts. - Fixed an issue with custom displays, where it was unable to use class colors in their texts. - More development and bug fixes on the new Mythic+ Run Completion panel. - Framework Update.
This commit is contained in:
+137
-136
@@ -2,6 +2,7 @@
|
||||
local _ = nil
|
||||
_detalhes.custom_function_cache = {}
|
||||
local addonName, Details222 = ...
|
||||
local Details = _detalhes
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--local pointers
|
||||
@@ -11,17 +12,17 @@
|
||||
local tinsert = table.insert
|
||||
local ipairs = ipairs
|
||||
local unpack = table.unpack or unpack
|
||||
local _GetSpellInfo = _detalhes.getspellinfo
|
||||
local _GetSpellInfo = Details.getspellinfo
|
||||
local IsInRaid = IsInRaid
|
||||
local IsInGroup = IsInGroup
|
||||
local stringReplace = _detalhes.string.replace
|
||||
local stringReplace = Details.string.replace
|
||||
|
||||
local Loc = LibStub("AceLocale-3.0"):GetLocale("Details")
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--constants
|
||||
|
||||
local classCustom = _detalhes.atributo_custom
|
||||
local classCustom = Details.atributo_custom
|
||||
classCustom.mt = {__index = classCustom}
|
||||
|
||||
local combatContainers = {
|
||||
@@ -35,7 +36,7 @@
|
||||
classCustom._InstanceLastCombatShown = {}
|
||||
classCustom._TargetActorsProcessed = {}
|
||||
|
||||
local ToKFunctions = _detalhes.ToKFunctions
|
||||
local ToKFunctions = Details.ToKFunctions
|
||||
local SelectedToKFunction = ToKFunctions[1]
|
||||
local UsingCustomRightText = false
|
||||
local UsingCustomLeftText = false
|
||||
@@ -86,25 +87,25 @@
|
||||
local func
|
||||
local scriptTypeName = "search"
|
||||
|
||||
if (_detalhes.custom_function_cache [instanceObject.customName]) then
|
||||
func = _detalhes.custom_function_cache [instanceObject.customName]
|
||||
if (Details.custom_function_cache [instanceObject.customName]) then
|
||||
func = Details.custom_function_cache [instanceObject.customName]
|
||||
else
|
||||
local errortext
|
||||
func, errortext = loadstring (customObject.script)
|
||||
if (func) then
|
||||
DetailsFramework:SetEnvironment(func)
|
||||
_detalhes.custom_function_cache [instanceObject.customName] = func
|
||||
Details.custom_function_cache [instanceObject.customName] = func
|
||||
else
|
||||
_detalhes:Msg("|cFFFF9900error compiling code for custom display " .. (instanceObject.customName or "") .. " |r:", errortext)
|
||||
Details:Msg("|cFFFF9900error compiling code for custom display " .. (instanceObject.customName or "") .. " |r:", errortext)
|
||||
end
|
||||
|
||||
if (customObject.tooltip) then
|
||||
local tooltip_script, errortext = loadstring (customObject.tooltip)
|
||||
if (tooltip_script) then
|
||||
DetailsFramework:SetEnvironment(tooltip_script)
|
||||
_detalhes.custom_function_cache [instanceObject.customName .. "Tooltip"] = tooltip_script
|
||||
Details.custom_function_cache [instanceObject.customName .. "Tooltip"] = tooltip_script
|
||||
else
|
||||
_detalhes:Msg("|cFFFF9900error compiling tooltip code for custom display " .. (instanceObject.customName or "") .. " |r:", errortext)
|
||||
Details:Msg("|cFFFF9900error compiling tooltip code for custom display " .. (instanceObject.customName or "") .. " |r:", errortext)
|
||||
end
|
||||
scriptTypeName = "tooltip"
|
||||
end
|
||||
@@ -113,9 +114,9 @@
|
||||
local total_script, errortext = loadstring (customObject.total_script)
|
||||
if (total_script) then
|
||||
DetailsFramework:SetEnvironment(total_script)
|
||||
_detalhes.custom_function_cache [instanceObject.customName .. "Total"] = total_script
|
||||
Details.custom_function_cache [instanceObject.customName .. "Total"] = total_script
|
||||
else
|
||||
_detalhes:Msg("|cFFFF9900error compiling total code for custom display " .. (instanceObject.customName or "") .. " |r:", errortext)
|
||||
Details:Msg("|cFFFF9900error compiling total code for custom display " .. (instanceObject.customName or "") .. " |r:", errortext)
|
||||
end
|
||||
scriptTypeName = "total"
|
||||
end
|
||||
@@ -124,24 +125,24 @@
|
||||
local percent_script, errortext = loadstring (customObject.percent_script)
|
||||
if (percent_script) then
|
||||
DetailsFramework:SetEnvironment(percent_script)
|
||||
_detalhes.custom_function_cache [instanceObject.customName .. "Percent"] = percent_script
|
||||
Details.custom_function_cache [instanceObject.customName .. "Percent"] = percent_script
|
||||
else
|
||||
_detalhes:Msg("|cFFFF9900error compiling percent code for custom display " .. (instanceObject.customName or "") .. " |r:", errortext)
|
||||
Details:Msg("|cFFFF9900error compiling percent code for custom display " .. (instanceObject.customName or "") .. " |r:", errortext)
|
||||
end
|
||||
scriptTypeName = "percent"
|
||||
end
|
||||
end
|
||||
|
||||
if (not func) then
|
||||
_detalhes:Msg(Loc ["STRING_CUSTOM_FUNC_INVALID"], func)
|
||||
_detalhes:EndRefresh (instanceObject, 0, combatObject, combatObject [1])
|
||||
Details:Msg(Loc ["STRING_CUSTOM_FUNC_INVALID"], func)
|
||||
Details:EndRefresh (instanceObject, 0, combatObject, combatObject [1])
|
||||
end
|
||||
|
||||
local okey, _total, _top, _amount = pcall (func, combatObject, instance_container, instanceObject)
|
||||
if (not okey) then
|
||||
local errorText = _total
|
||||
_detalhes:Msg("|cFFFF9900error on display " .. customObject:GetName() .. " (" .. scriptTypeName .. ")|r:", errorText)
|
||||
return _detalhes:EndRefresh(instanceObject, 0, combatObject, combatObject[1])
|
||||
Details:Msg("|cFFFF9900error on display " .. customObject:GetName() .. " (" .. scriptTypeName .. ")|r:", errorText)
|
||||
return Details:EndRefresh(instanceObject, 0, combatObject, combatObject[1])
|
||||
end
|
||||
|
||||
total = _total or 0
|
||||
@@ -178,7 +179,7 @@
|
||||
end
|
||||
end
|
||||
instanceObject:EsconderScrollBar()
|
||||
return _detalhes:EndRefresh (instanceObject, total, combatObject, nil)
|
||||
return Details:EndRefresh (instanceObject, total, combatObject, nil)
|
||||
end
|
||||
|
||||
if (amount > #instance_container._ActorTable) then
|
||||
@@ -195,8 +196,8 @@
|
||||
-- key name value need to be formated
|
||||
if (customObject) then
|
||||
|
||||
local percent_script = _detalhes.custom_function_cache [instanceObject.customName .. "Percent"]
|
||||
local total_script = _detalhes.custom_function_cache [instanceObject.customName .. "Total"]
|
||||
local percent_script = Details.custom_function_cache [instanceObject.customName .. "Percent"]
|
||||
local total_script = Details.custom_function_cache [instanceObject.customName .. "Total"]
|
||||
local okey
|
||||
|
||||
for index, actor in ipairs(instance_container._ActorTable) do
|
||||
@@ -206,8 +207,8 @@
|
||||
if (percent_script) then
|
||||
okey, percent = pcall (percent_script, floor(actor.value), top, total, combatObject, instanceObject, actor)
|
||||
if (not okey) then
|
||||
_detalhes:Msg("|cFFFF9900percent script error|r:", percent)
|
||||
return _detalhes:EndRefresh (instanceObject, 0, combatObject, combatObject [1])
|
||||
Details:Msg("|cFFFF9900percent script error|r:", percent)
|
||||
return Details:EndRefresh (instanceObject, 0, combatObject, combatObject [1])
|
||||
end
|
||||
else
|
||||
percent = format ("%.1f", floor(actor.value) / total * 100)
|
||||
@@ -216,8 +217,8 @@
|
||||
if (total_script) then
|
||||
local okey, value = pcall (total_script, floor(actor.value), top, total, combatObject, instanceObject, actor)
|
||||
if (not okey) then
|
||||
_detalhes:Msg("|cFFFF9900total script error|r:", value)
|
||||
return _detalhes:EndRefresh (instanceObject, 0, combatObject, combatObject [1])
|
||||
Details:Msg("|cFFFF9900total script error|r:", value)
|
||||
return Details:EndRefresh (instanceObject, 0, combatObject, combatObject [1])
|
||||
end
|
||||
|
||||
if (type(value) == "number") then
|
||||
@@ -252,7 +253,7 @@
|
||||
|
||||
classCustom:Refresh (instanceObject, instance_container, combatObject, force, total, top, customObject)
|
||||
|
||||
return _detalhes:EndRefresh (instanceObject, total, combatObject, combatObject [container_index])
|
||||
return Details:EndRefresh (instanceObject, total, combatObject, combatObject [container_index])
|
||||
|
||||
end
|
||||
|
||||
@@ -288,11 +289,11 @@
|
||||
|
||||
elseif (source == "[raid]") then
|
||||
|
||||
if (_detalhes.in_combat and instance.segmento == 0 and not export) then
|
||||
if (Details.in_combat and instance.segmento == 0 and not export) then
|
||||
if (container_index == 1) then
|
||||
combat_container = _detalhes.cache_damage_group
|
||||
combat_container = Details.cache_damage_group
|
||||
elseif (container_index == 2) then
|
||||
combat_container = _detalhes.cache_healing_group
|
||||
combat_container = Details.cache_healing_group
|
||||
end
|
||||
end
|
||||
|
||||
@@ -319,7 +320,7 @@
|
||||
end
|
||||
|
||||
elseif (source == "[player]") then
|
||||
local pindex = combat [container_index]._NameIndexTable [_detalhes.playername]
|
||||
local pindex = combat [container_index]._NameIndexTable [Details.playername]
|
||||
if (pindex) then
|
||||
local actor = combat [container_index]._ActorTable [pindex]
|
||||
local actortotal = func (_, actor, source, target, spellid, combat, instance_container)
|
||||
@@ -379,8 +380,8 @@
|
||||
end
|
||||
end
|
||||
|
||||
local percent_script = _detalhes.custom_function_cache [instance.customName .. "Percent"]
|
||||
local total_script = _detalhes.custom_function_cache [instance.customName .. "Total"]
|
||||
local percent_script = Details.custom_function_cache [instance.customName .. "Percent"]
|
||||
local total_script = Details.custom_function_cache [instance.customName .. "Total"]
|
||||
|
||||
local bars_show_data = instance.row_info.textR_show_data
|
||||
local bars_brackets = instance:GetBarBracket()
|
||||
@@ -399,7 +400,7 @@
|
||||
local row1 = barContainer [1]
|
||||
row1.minha_tabela = nil
|
||||
row1.lineText1:SetText(Loc ["STRING_TOTAL"])
|
||||
row1.lineText4:SetText(_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combatElapsedTime) .. ")")
|
||||
row1.lineText4:SetText(Details:ToK2 (total) .. " (" .. Details:ToK (total / combatElapsedTime) .. ")")
|
||||
|
||||
row1:SetValue(100)
|
||||
local r, g, b = unpack(instance.total_bar.color)
|
||||
@@ -435,7 +436,7 @@
|
||||
local row1 = barContainer [1]
|
||||
row1.minha_tabela = nil
|
||||
row1.lineText1:SetText(Loc ["STRING_TOTAL"])
|
||||
row1.lineText4:SetText(_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combatElapsedTime) .. ")")
|
||||
row1.lineText4:SetText(Details:ToK2 (total) .. " (" .. Details:ToK (total / combatElapsedTime) .. ")")
|
||||
|
||||
row1:SetValue(100)
|
||||
local r, g, b = unpack(instance.total_bar.color)
|
||||
@@ -493,8 +494,8 @@
|
||||
--local value, top, total, combat, instance = ...
|
||||
okey, percent = pcall (percent_script, self.value, top, total, combat, instance, self)
|
||||
if (not okey) then
|
||||
_detalhes:Msg("|cFFFF9900error on custom display function|r:", percent)
|
||||
return _detalhes:EndRefresh (instance, 0, combat, combat [1])
|
||||
Details:Msg("|cFFFF9900error on custom display function|r:", percent)
|
||||
return Details:EndRefresh (instance, 0, combat, combat [1])
|
||||
end
|
||||
else
|
||||
if (percentage_type == 1) then
|
||||
@@ -512,8 +513,8 @@
|
||||
if (total_script) then
|
||||
local okey, value = pcall (total_script, self.value, top, total, combat, instance, self)
|
||||
if (not okey) then
|
||||
_detalhes:Msg("|cFFFF9900error on custom display function|r:", value)
|
||||
return _detalhes:EndRefresh (instance, 0, combat, combat [1])
|
||||
Details:Msg("|cFFFF9900error on custom display function|r:", value)
|
||||
return Details:EndRefresh (instance, 0, combat, combat [1])
|
||||
end
|
||||
|
||||
if (instance.use_multi_fontstrings) then
|
||||
@@ -554,7 +555,7 @@
|
||||
-- update tooltip function --
|
||||
|
||||
if (self.id) then
|
||||
local school = _detalhes.spell_school_cache[self.nome]
|
||||
local school = Details.spell_school_cache[self.nome]
|
||||
if (school) then
|
||||
local schoolColor = Details.spells_school[school]
|
||||
if (not schoolColor) then
|
||||
@@ -611,7 +612,7 @@
|
||||
|
||||
esta_barra.last_value = esta_porcentagem --reseta o ultimo valor da barra
|
||||
|
||||
if (_detalhes.is_using_row_animations and forcar) then
|
||||
if (Details.is_using_row_animations and forcar) then
|
||||
esta_barra.tem_animacao = 0
|
||||
esta_barra:SetScript("OnUpdate", nil)
|
||||
end
|
||||
@@ -620,7 +621,7 @@
|
||||
|
||||
elseif (esta_porcentagem ~= esta_barra.last_value) then --continua mostrando a mesma tabela ent�o compara a porcentagem
|
||||
--apenas atualizar
|
||||
if (_detalhes.is_using_row_animations) then
|
||||
if (Details.is_using_row_animations) then
|
||||
|
||||
local upRow = barras_container [whichRowLine-1]
|
||||
if (upRow) then
|
||||
@@ -641,14 +642,14 @@
|
||||
end
|
||||
end
|
||||
|
||||
function classCustom:RefreshBarra(esta_barra, instancia, from_resize)
|
||||
function classCustom:RefreshBarra(thisBar, instanceObject, bFromResize)
|
||||
local class, enemy, arena_enemy, arena_ally = self.classe, self.enemy, self.arena_enemy, self.arena_ally
|
||||
|
||||
if (from_resize) then
|
||||
if (bFromResize) then
|
||||
if (self.id) then
|
||||
local school = _detalhes.spell_school_cache[self.nome]
|
||||
if (school) then
|
||||
local schoolColor = Details.spells_school[school]
|
||||
local schoolData = Details.spell_school_cache[self.nome]
|
||||
if (schoolData) then
|
||||
local schoolColor = Details.spells_school[schoolData]
|
||||
if (not schoolColor) then
|
||||
schoolColor = Details.spells_school[1]
|
||||
end
|
||||
@@ -662,64 +663,64 @@
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes:SetBarColors(esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b)
|
||||
self:SetBarColors(thisBar, instanceObject, actor_class_color_r, actor_class_color_g, actor_class_color_b)
|
||||
|
||||
--we need a customized icon settings for custom displays.
|
||||
if (self.classe == "UNKNOW") then
|
||||
esta_barra.icone_classe:SetTexture("Interface\\LFGFRAME\\LFGROLE_BW")
|
||||
esta_barra.icone_classe:SetTexCoord(.25, .5, 0, 1)
|
||||
esta_barra.icone_classe:SetVertexColor(1, 1, 1)
|
||||
thisBar.icone_classe:SetTexture("Interface\\LFGFRAME\\LFGROLE_BW")
|
||||
thisBar.icone_classe:SetTexCoord(.25, .5, 0, 1)
|
||||
thisBar.icone_classe:SetVertexColor(1, 1, 1)
|
||||
|
||||
elseif (self.classe == "UNGROUPPLAYER") then
|
||||
if (self.enemy) then
|
||||
if (_detalhes.faction_against == "Horde") then
|
||||
esta_barra.icone_classe:SetTexture("Interface\\ICONS\\Achievement_Character_Orc_Male")
|
||||
esta_barra.icone_classe:SetTexCoord(0, 1, 0, 1)
|
||||
if (Details.faction_against == "Horde") then
|
||||
thisBar.icone_classe:SetTexture("Interface\\ICONS\\Achievement_Character_Orc_Male")
|
||||
thisBar.icone_classe:SetTexCoord(0, 1, 0, 1)
|
||||
else
|
||||
esta_barra.icone_classe:SetTexture("Interface\\ICONS\\Achievement_Character_Human_Male")
|
||||
esta_barra.icone_classe:SetTexCoord(0, 1, 0, 1)
|
||||
thisBar.icone_classe:SetTexture("Interface\\ICONS\\Achievement_Character_Human_Male")
|
||||
thisBar.icone_classe:SetTexCoord(0, 1, 0, 1)
|
||||
end
|
||||
else
|
||||
if (_detalhes.faction_against == "Horde") then
|
||||
esta_barra.icone_classe:SetTexture("Interface\\ICONS\\Achievement_Character_Human_Male")
|
||||
esta_barra.icone_classe:SetTexCoord(0, 1, 0, 1)
|
||||
if (Details.faction_against == "Horde") then
|
||||
thisBar.icone_classe:SetTexture("Interface\\ICONS\\Achievement_Character_Human_Male")
|
||||
thisBar.icone_classe:SetTexCoord(0, 1, 0, 1)
|
||||
else
|
||||
esta_barra.icone_classe:SetTexture("Interface\\ICONS\\Achievement_Character_Orc_Male")
|
||||
esta_barra.icone_classe:SetTexCoord(0, 1, 0, 1)
|
||||
thisBar.icone_classe:SetTexture("Interface\\ICONS\\Achievement_Character_Orc_Male")
|
||||
thisBar.icone_classe:SetTexCoord(0, 1, 0, 1)
|
||||
end
|
||||
end
|
||||
esta_barra.icone_classe:SetVertexColor(1, 1, 1)
|
||||
thisBar.icone_classe:SetVertexColor(1, 1, 1)
|
||||
|
||||
elseif (self.classe == "PET") then
|
||||
esta_barra.icone_classe:SetTexture(instancia.row_info.icon_file)
|
||||
esta_barra.icone_classe:SetTexCoord(0.25, 0.49609375, 0.75, 1)
|
||||
esta_barra.icone_classe:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b)
|
||||
thisBar.icone_classe:SetTexture(instanceObject.row_info.icon_file)
|
||||
thisBar.icone_classe:SetTexCoord(0.25, 0.49609375, 0.75, 1)
|
||||
thisBar.icone_classe:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b)
|
||||
|
||||
else
|
||||
if (self.id) then
|
||||
esta_barra.icone_classe:SetTexCoord(0.078125, 0.921875, 0.078125, 0.921875)
|
||||
esta_barra.icone_classe:SetTexture(self.icon)
|
||||
thisBar.icone_classe:SetTexCoord(0.078125, 0.921875, 0.078125, 0.921875)
|
||||
thisBar.icone_classe:SetTexture(self.icon)
|
||||
else
|
||||
if (instancia.row_info.use_spec_icons) then
|
||||
if (instanceObject.row_info.use_spec_icons) then
|
||||
if ((self.spec and self.spec ~= 0) or (self.my_actor.spec and self.my_actor.spec ~= 0)) then
|
||||
esta_barra.icone_classe:SetTexture(instancia.row_info.spec_file)
|
||||
esta_barra.icone_classe:SetTexCoord(unpack(_detalhes.class_specs_coords[self.spec or self.my_actor.spec]))
|
||||
thisBar.icone_classe:SetTexture(instanceObject.row_info.spec_file)
|
||||
thisBar.icone_classe:SetTexCoord(unpack(Details.class_specs_coords[self.spec or self.my_actor.spec]))
|
||||
else
|
||||
esta_barra.icone_classe:SetTexture([[Interface\AddOns\Details\images\classes_small]])
|
||||
esta_barra.icone_classe:SetTexCoord(unpack(Details.class_coords[self.classe]))
|
||||
thisBar.icone_classe:SetTexture([[Interface\AddOns\Details\images\classes_small]])
|
||||
thisBar.icone_classe:SetTexCoord(unpack(Details.class_coords[self.classe]))
|
||||
end
|
||||
else
|
||||
esta_barra.icone_classe:SetTexture(instancia.row_info.icon_file)
|
||||
esta_barra.icone_classe:SetTexCoord(unpack(Details.class_coords[self.classe]))
|
||||
thisBar.icone_classe:SetTexture(instanceObject.row_info.icon_file)
|
||||
thisBar.icone_classe:SetTexCoord(unpack(Details.class_coords[self.classe]))
|
||||
end
|
||||
end
|
||||
esta_barra.icone_classe:SetVertexColor(1, 1, 1)
|
||||
thisBar.icone_classe:SetVertexColor(1, 1, 1)
|
||||
end
|
||||
|
||||
--left text
|
||||
self:SetBarLeftText (esta_barra, instancia, enemy, arena_enemy, arena_ally, UsingCustomLeftText)
|
||||
self:SetBarLeftText(thisBar, instanceObject, enemy, arena_enemy, arena_ally, UsingCustomLeftText)
|
||||
|
||||
esta_barra.lineText1:SetSize(esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15)
|
||||
thisBar.lineText1:SetSize(thisBar:GetWidth() - thisBar.lineText4:GetStringWidth() - 20, 15)
|
||||
|
||||
end
|
||||
|
||||
@@ -829,7 +830,7 @@
|
||||
end
|
||||
if (class == "UNKNOW") then
|
||||
--try once again
|
||||
class = _detalhes:GetClass(actor.nome or actor.name)
|
||||
class = Details:GetClass(actor.nome or actor.name)
|
||||
if (class and class ~= "UNKNOW") then
|
||||
actor.classe = class
|
||||
end
|
||||
@@ -839,7 +840,7 @@
|
||||
local newActor = setmetatable({
|
||||
nome = actor.nome or actor.name,
|
||||
classe = class,
|
||||
value = _detalhes:GetOrderNumber(),
|
||||
value = Details:GetOrderNumber(),
|
||||
is_custom = true,
|
||||
color = actor.color,
|
||||
}, classCustom.mt)
|
||||
@@ -847,7 +848,7 @@
|
||||
newActor.customColor = actor.customColor
|
||||
|
||||
newActor.name_complement = name_complement
|
||||
newActor.displayName = actor.displayName or (_detalhes:GetOnlyName(newActor.nome) .. (name_complement or ""))
|
||||
newActor.displayName = actor.displayName or (Details:GetOnlyName(newActor.nome) .. (name_complement or ""))
|
||||
|
||||
newActor:SetSpecId(actor.spec)
|
||||
|
||||
@@ -935,19 +936,19 @@
|
||||
local actorObject = self.my_actor
|
||||
|
||||
if (actorObject.id) then
|
||||
_detalhes:AddTooltipSpellHeaderText (select(1, _GetSpellInfo(actorObject.id)), "yellow", 1, select(3, _GetSpellInfo(actorObject.id)), 0.90625, 0.109375, 0.15625, 0.875, false, 18)
|
||||
Details:AddTooltipSpellHeaderText (select(1, _GetSpellInfo(actorObject.id)), "yellow", 1, select(3, _GetSpellInfo(actorObject.id)), 0.90625, 0.109375, 0.15625, 0.875, false, 18)
|
||||
else
|
||||
_detalhes:AddTooltipSpellHeaderText (customObject:GetName(), "yellow", 1, customObject:GetIcon(), 0.90625, 0.109375, 0.15625, 0.875, false, 18)
|
||||
Details:AddTooltipSpellHeaderText (customObject:GetName(), "yellow", 1, customObject:GetIcon(), 0.90625, 0.109375, 0.15625, 0.875, false, 18)
|
||||
end
|
||||
|
||||
_detalhes:AddTooltipHeaderStatusbar (1, 1, 1, 0.6)
|
||||
Details:AddTooltipHeaderStatusbar (1, 1, 1, 0.6)
|
||||
|
||||
if (customObject:IsScripted()) then
|
||||
if (customObject.tooltip) then
|
||||
local func = _detalhes.custom_function_cache [instanceObject.customName .. "Tooltip"]
|
||||
local func = Details.custom_function_cache [instanceObject.customName .. "Tooltip"]
|
||||
local okey, errortext = pcall(func, actorObject, instanceObject.showing, instanceObject, keydown)
|
||||
if (not okey) then
|
||||
_detalhes:Msg("|cFFFF9900error on custom display tooltip function|r:", errortext)
|
||||
Details:Msg("|cFFFF9900error on custom display tooltip function|r:", errortext)
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -1044,14 +1045,14 @@
|
||||
|
||||
function classCustom:RemoveCustom (index)
|
||||
|
||||
if (not _detalhes.tabela_instancias) then
|
||||
if (not Details.tabela_instancias) then
|
||||
--do not remove customs while the addon is loading.
|
||||
return
|
||||
end
|
||||
|
||||
table.remove (_detalhes.custom, index)
|
||||
table.remove (Details.custom, index)
|
||||
|
||||
for _, instance in ipairs(_detalhes.tabela_instancias) do
|
||||
for _, instance in ipairs(Details.tabela_instancias) do
|
||||
if (instance.atributo == 5 and instance.sub_atributo == index) then
|
||||
instance:ResetAttribute()
|
||||
elseif (instance.atributo == 5 and instance.sub_atributo > index) then
|
||||
@@ -1062,33 +1063,33 @@
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes.switch:OnRemoveCustom (index)
|
||||
Details.switch:OnRemoveCustom (index)
|
||||
end
|
||||
|
||||
--export for plugins
|
||||
function _detalhes:RemoveCustomObject (object_name)
|
||||
for index, object in ipairs(_detalhes.custom) do
|
||||
function Details:RemoveCustomObject (object_name)
|
||||
for index, object in ipairs(Details.custom) do
|
||||
if (object.name == object_name) then
|
||||
return classCustom:RemoveCustom (index)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:ResetCustomFunctionsCache()
|
||||
Details:Destroy(_detalhes.custom_function_cache)
|
||||
function Details:ResetCustomFunctionsCache()
|
||||
Details:Destroy(Details.custom_function_cache)
|
||||
end
|
||||
|
||||
function _detalhes.refresh:r_atributo_custom()
|
||||
function Details.refresh:r_atributo_custom()
|
||||
--check for non used temp displays
|
||||
if (_detalhes.tabela_instancias) then
|
||||
if (Details.tabela_instancias) then
|
||||
|
||||
for i = #_detalhes.custom, 1, -1 do
|
||||
local custom_object = _detalhes.custom [i]
|
||||
for i = #Details.custom, 1, -1 do
|
||||
local custom_object = Details.custom [i]
|
||||
if (custom_object.temp) then
|
||||
--check if there is a instance showing this custom
|
||||
local showing = false
|
||||
|
||||
for index, instance in ipairs(_detalhes.tabela_instancias) do
|
||||
for index, instance in ipairs(Details.tabela_instancias) do
|
||||
if (instance.atributo == 5 and instance.sub_atributo == i) then
|
||||
showing = true
|
||||
end
|
||||
@@ -1102,37 +1103,37 @@
|
||||
end
|
||||
|
||||
--restore metatable and indexes
|
||||
for index, custom_object in ipairs(_detalhes.custom) do
|
||||
for index, custom_object in ipairs(Details.custom) do
|
||||
setmetatable(custom_object, classCustom)
|
||||
custom_object.__index = classCustom
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes.clear:c_atributo_custom()
|
||||
for _, custom_object in ipairs(_detalhes.custom) do
|
||||
function Details.clear:c_atributo_custom()
|
||||
for _, custom_object in ipairs(Details.custom) do
|
||||
custom_object.__index = nil
|
||||
end
|
||||
end
|
||||
|
||||
function classCustom:UpdateSelectedToKFunction()
|
||||
SelectedToKFunction = ToKFunctions [_detalhes.ps_abbreviation]
|
||||
FormatTooltipNumber = ToKFunctions [_detalhes.tooltip.abbreviation]
|
||||
TooltipMaximizedMethod = _detalhes.tooltip.maximize_method
|
||||
SelectedToKFunction = ToKFunctions [Details.ps_abbreviation]
|
||||
FormatTooltipNumber = ToKFunctions [Details.tooltip.abbreviation]
|
||||
TooltipMaximizedMethod = Details.tooltip.maximize_method
|
||||
classCustom:UpdateDamageDoneBracket()
|
||||
classCustom:UpdateHealingDoneBracket()
|
||||
end
|
||||
|
||||
function _detalhes:InstallCustomObject (object)
|
||||
function Details:InstallCustomObject (object)
|
||||
local have = false
|
||||
if (object.script_version) then
|
||||
for _, custom in ipairs(_detalhes.custom) do
|
||||
for _, custom in ipairs(Details.custom) do
|
||||
if (custom.name == object.name and (custom.script_version and custom.script_version >= object.script_version) ) then
|
||||
have = true
|
||||
break
|
||||
end
|
||||
end
|
||||
else
|
||||
for _, custom in ipairs(_detalhes.custom) do
|
||||
for _, custom in ipairs(Details.custom) do
|
||||
if (custom.name == object.name) then
|
||||
have = true
|
||||
break
|
||||
@@ -1141,27 +1142,27 @@
|
||||
end
|
||||
|
||||
if (not have) then
|
||||
for i, custom in ipairs(_detalhes.custom) do
|
||||
for i, custom in ipairs(Details.custom) do
|
||||
if (custom.name == object.name) then
|
||||
table.remove (_detalhes.custom, i)
|
||||
table.remove (Details.custom, i)
|
||||
break
|
||||
end
|
||||
end
|
||||
setmetatable(object, _detalhes.atributo_custom)
|
||||
object.__index = _detalhes.atributo_custom
|
||||
_detalhes.custom [#_detalhes.custom+1] = object
|
||||
setmetatable(object, Details.atributo_custom)
|
||||
object.__index = Details.atributo_custom
|
||||
Details.custom [#Details.custom+1] = object
|
||||
end
|
||||
end
|
||||
|
||||
function Details222.GetCustomDisplayIDByName(customDisplayName)
|
||||
for customDisplayID, customObject in ipairs(_detalhes.custom) do
|
||||
for customDisplayID, customObject in ipairs(Details.custom) do
|
||||
if (customObject.name == customDisplayName) then
|
||||
return customDisplayID
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:AddDefaultCustomDisplays()
|
||||
function Details:AddDefaultCustomDisplays()
|
||||
local PotionUsed = {
|
||||
name = Loc ["STRING_CUSTOM_POT_DEFAULT"],
|
||||
icon = [[Interface\ICONS\INV_Potion_03]],
|
||||
@@ -1280,8 +1281,8 @@
|
||||
table.remove (self.custom, i)
|
||||
end
|
||||
end
|
||||
setmetatable(PotionUsed, _detalhes.atributo_custom)
|
||||
PotionUsed.__index = _detalhes.atributo_custom
|
||||
setmetatable(PotionUsed, Details.atributo_custom)
|
||||
PotionUsed.__index = Details.atributo_custom
|
||||
self.custom [#self.custom+1] = PotionUsed
|
||||
end
|
||||
|
||||
@@ -1366,8 +1367,8 @@
|
||||
table.remove (self.custom, i)
|
||||
end
|
||||
end
|
||||
setmetatable(Healthstone, _detalhes.atributo_custom)
|
||||
Healthstone.__index = _detalhes.atributo_custom
|
||||
setmetatable(Healthstone, Details.atributo_custom)
|
||||
Healthstone.__index = Details.atributo_custom
|
||||
self.custom [#self.custom+1] = Healthstone
|
||||
end
|
||||
|
||||
@@ -1430,8 +1431,8 @@
|
||||
table.remove (self.custom, i)
|
||||
end
|
||||
end
|
||||
setmetatable(DamageActivityTime, _detalhes.atributo_custom)
|
||||
DamageActivityTime.__index = _detalhes.atributo_custom
|
||||
setmetatable(DamageActivityTime, Details.atributo_custom)
|
||||
DamageActivityTime.__index = Details.atributo_custom
|
||||
self.custom [#self.custom+1] = DamageActivityTime
|
||||
end
|
||||
|
||||
@@ -1492,8 +1493,8 @@
|
||||
table.remove (self.custom, i)
|
||||
end
|
||||
end
|
||||
setmetatable(HealActivityTime, _detalhes.atributo_custom)
|
||||
HealActivityTime.__index = _detalhes.atributo_custom
|
||||
setmetatable(HealActivityTime, Details.atributo_custom)
|
||||
HealActivityTime.__index = Details.atributo_custom
|
||||
self.custom [#self.custom+1] = HealActivityTime
|
||||
end
|
||||
|
||||
@@ -1588,8 +1589,8 @@
|
||||
end
|
||||
end
|
||||
if (not have) then
|
||||
setmetatable(CC_Done, _detalhes.atributo_custom)
|
||||
CC_Done.__index = _detalhes.atributo_custom
|
||||
setmetatable(CC_Done, Details.atributo_custom)
|
||||
CC_Done.__index = Details.atributo_custom
|
||||
|
||||
for i, custom in ipairs(self.custom) do
|
||||
if (custom.name == Loc ["STRING_CUSTOM_CC_DONE"]) then
|
||||
@@ -1722,8 +1723,8 @@
|
||||
end
|
||||
end
|
||||
if (not have) then
|
||||
setmetatable(CC_Received, _detalhes.atributo_custom)
|
||||
CC_Received.__index = _detalhes.atributo_custom
|
||||
setmetatable(CC_Received, Details.atributo_custom)
|
||||
CC_Received.__index = Details.atributo_custom
|
||||
|
||||
for i, custom in ipairs(self.custom) do
|
||||
if (custom.name == Loc ["STRING_CUSTOM_CC_RECEIVED"]) then
|
||||
@@ -1982,8 +1983,8 @@
|
||||
end
|
||||
end
|
||||
if (not have) then
|
||||
setmetatable(MySpells, _detalhes.atributo_custom)
|
||||
MySpells.__index = _detalhes.atributo_custom
|
||||
setmetatable(MySpells, Details.atributo_custom)
|
||||
MySpells.__index = Details.atributo_custom
|
||||
|
||||
for i, custom in ipairs(self.custom) do
|
||||
if (custom.name == Loc ["STRING_CUSTOM_MYSPELLS"]) then
|
||||
@@ -2074,8 +2075,8 @@
|
||||
end
|
||||
end
|
||||
if (not have) then
|
||||
setmetatable(DamageOnSkullTarget, _detalhes.atributo_custom)
|
||||
DamageOnSkullTarget.__index = _detalhes.atributo_custom
|
||||
setmetatable(DamageOnSkullTarget, Details.atributo_custom)
|
||||
DamageOnSkullTarget.__index = Details.atributo_custom
|
||||
|
||||
for i, custom in ipairs(self.custom) do
|
||||
if (custom.name == Loc ["STRING_CUSTOM_DAMAGEONSKULL"]) then
|
||||
@@ -2204,8 +2205,8 @@
|
||||
end
|
||||
end
|
||||
if (not have) then
|
||||
setmetatable(DamageOnAnyTarget, _detalhes.atributo_custom)
|
||||
DamageOnAnyTarget.__index = _detalhes.atributo_custom
|
||||
setmetatable(DamageOnAnyTarget, Details.atributo_custom)
|
||||
DamageOnAnyTarget.__index = Details.atributo_custom
|
||||
|
||||
for i, custom in ipairs(self.custom) do
|
||||
if (custom.name == Loc ["STRING_CUSTOM_DAMAGEONANYMARKEDTARGET"]) then
|
||||
@@ -2390,8 +2391,8 @@
|
||||
table.remove (self.custom, i)
|
||||
end
|
||||
end
|
||||
setmetatable(DynamicOverallDamage, _detalhes.atributo_custom)
|
||||
DynamicOverallDamage.__index = _detalhes.atributo_custom
|
||||
setmetatable(DynamicOverallDamage, Details.atributo_custom)
|
||||
DynamicOverallDamage.__index = Details.atributo_custom
|
||||
self.custom [#self.custom+1] = DynamicOverallDamage
|
||||
end
|
||||
|
||||
@@ -2491,13 +2492,13 @@
|
||||
table.remove (self.custom, i)
|
||||
end
|
||||
end
|
||||
setmetatable(DamageOnShields, _detalhes.atributo_custom)
|
||||
DamageOnShields.__index = _detalhes.atributo_custom
|
||||
setmetatable(DamageOnShields, Details.atributo_custom)
|
||||
DamageOnShields.__index = Details.atributo_custom
|
||||
self.custom [#self.custom+1] = DamageOnShields
|
||||
end
|
||||
|
||||
---------------------------------------
|
||||
|
||||
_detalhes:ResetCustomFunctionsCache()
|
||||
Details:ResetCustomFunctionsCache()
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user