Updated LibOpenRaid and DetailsFramework

This commit is contained in:
Tercio Jose
2022-10-09 19:47:56 -03:00
parent 9974a87119
commit 944178f76f
126 changed files with 15502 additions and 15495 deletions
+15 -15
View File
@@ -89,7 +89,7 @@ Details.API_Description = {
}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> ~segments
--~segments
--[=[
Details.SegmentInfo (segment)
@@ -211,7 +211,7 @@ tinsert (Details.API_Description.namespaces[1].api, {
function Details.SegmentDamagingUnits (includePlayerUnits, includeEnemyUnits, includeFriendlyPetUnits, segment)
segment = segment or 0
if (type (includePlayerUnits) ~= "boolean") then
if (type(includePlayerUnits) ~= "boolean") then
includePlayerUnits = true
end
@@ -290,7 +290,7 @@ tinsert (Details.API_Description.namespaces[1].api, {
function Details.SegmentHealingUnits (includePlayerUnits, includeEnemyUnits, includeFriendlyPetUnits, segment)
segment = segment or 0
if (type (includePlayerUnits) ~= "boolean") then
if (type(includePlayerUnits) ~= "boolean") then
includePlayerUnits = true
end
@@ -434,7 +434,7 @@ function Details.SegmentPhases (segment)
local phaseData = combatObject.PhaseData
for phaseChangeId, phaseTable in ipairs (phaseData) do
for phaseChangeId, phaseTable in ipairs(phaseData) do
local phaseNumber = phaseTable [1]
DetailsFramework.table.addunique (phases, phaseNumber)
end
@@ -443,7 +443,7 @@ function Details.SegmentPhases (segment)
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> unit ~information
--unit ~information
--[=[
Details.UnitInfo (unitId, segment)
--=]=]
@@ -607,7 +607,7 @@ function Details.UnitTexture (unitId, segment)
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> ~damage
--~damage
--[=[
Details.UnitDamage (unitId, segment)
@@ -827,7 +827,7 @@ tinsert (Details.API_Description.namespaces[1].api, {
})
function Details.UnitDamageBySpell (unitId, spellId, isLiteral, segment)
if (type (isLiteral) ~= "boolean") then
if (type(isLiteral) ~= "boolean") then
isLiteral = true
end
segment = segment or 0
@@ -897,7 +897,7 @@ tinsert (Details.API_Description.namespaces[1].api, {
})
function Details.UnitDamageSpellInfo (unitId, spellId, isLiteral, segment)
if (type (isLiteral) ~= "boolean") then
if (type(isLiteral) ~= "boolean") then
isLiteral = true
end
segment = segment or 0
@@ -1021,7 +1021,7 @@ tinsert (Details.API_Description.namespaces[1].api, {
})
function Details.UnitDamageSpellOnUnit (unitId, spellId, targetUnitId, isLiteral, segment)
if (type (isLiteral) ~= "boolean") then
if (type(isLiteral) ~= "boolean") then
isLiteral = true
end
segment = segment or 0
@@ -1188,7 +1188,7 @@ tinsert (Details.API_Description.namespaces[1].api, {
function Details.UnitDamageTakenFromSpell (unitId, spellId, isLiteral, segment)
segment = segment or 0
if (type (isLiteral) ~= "boolean") then
if (type(isLiteral) ~= "boolean") then
isLiteral = true
end
@@ -1389,7 +1389,7 @@ end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> ~healing
--~healing
--[=[
@@ -1556,7 +1556,7 @@ tinsert (Details.API_Description.namespaces[1].api, {
})
function Details.UnitHealingBySpell (unitId, spellId, isLiteral, segment)
if (type (isLiteral) ~= "boolean") then
if (type(isLiteral) ~= "boolean") then
isLiteral = true
end
segment = segment or 0
@@ -1628,7 +1628,7 @@ tinsert (Details.API_Description.namespaces[1].api, {
})
function Details.UnitHealingSpellInfo (unitId, spellId, isLiteral, segment)
if (type (isLiteral) ~= "boolean") then
if (type(isLiteral) ~= "boolean") then
isLiteral = true
end
segment = segment or 0
@@ -1753,7 +1753,7 @@ tinsert (Details.API_Description.namespaces[1].api, {
})
function Details.UnitHealingSpellOnUnit (unitId, spellId, targetUnitId, isLiteral, segment)
if (type (isLiteral) ~= "boolean") then
if (type(isLiteral) ~= "boolean") then
isLiteral = true
end
segment = segment or 0
@@ -1927,7 +1927,7 @@ tinsert (Details.API_Description.namespaces[1].api, {
function Details.UnitHealingTakenFromSpell (unitId, spellId, isLiteral, segment)
segment = segment or 0
if (type (isLiteral) ~= "boolean") then
if (type(isLiteral) ~= "boolean") then
isLiteral = true
end
+22 -22
View File
@@ -4,7 +4,7 @@ do
local _detalhes = _G._detalhes
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
--> Globals
--Globals
--[[global]] DETAILS_ATTRIBUTE_DAMAGE = 1
--[[global]] DETAILS_SUBATTRIBUTE_DAMAGEDONE = 1
@@ -81,27 +81,27 @@ do
"aura", --debuff uptime
}
--> Main Attributes
--Main Attributes
_detalhes.atributos = {
--> Attributes amount = 4: damage / heal / energy / misc
--Attributes amount = 4: damage / heal / energy / misc
[0] = 4,
--[[ DAMAGE ]]
dano = 1, --> identifier
[1] = 8, --> sub attributes
dano = 1, --identifier
[1] = 8, -- sub attributes
--[[ HEALING ]]
cura = 2, --> identifier
[2] = 7, --> sub attributes
cura = 2, --identifier
[2] = 7, -- sub attributes
--[[ ENERGY ]]
e_energy = 3,--> identifier
[3] = 6, --> sub attributes
e_energy = 3,--identifier
[3] = 6, -- sub attributes
--[[ MISC ]]
misc = 4, --> identifier
[4] = 8, --> sub attributes
misc = 4, --identifier
[4] = 8, -- sub attributes
--[[ CUSTOM ]]
custom = 5,
@@ -109,19 +109,19 @@ do
--[[ String Names ]]
lista = {
Loc ["STRING_ATTRIBUTE_DAMAGE"],--> Damage
Loc ["STRING_ATTRIBUTE_HEAL"], --> Healing
Loc ["STRING_ATTRIBUTE_ENERGY"], --> Energy
Loc ["STRING_ATTRIBUTE_MISC"], --> Misc
Loc ["STRING_SCRIPTS_TITLE"] --> Custom
Loc ["STRING_ATTRIBUTE_DAMAGE"],--Damage
Loc ["STRING_ATTRIBUTE_HEAL"], --Healing
Loc ["STRING_ATTRIBUTE_ENERGY"], --Energy
Loc ["STRING_ATTRIBUTE_MISC"], --Misc
Loc ["STRING_SCRIPTS_TITLE"] --Custom
}
}
--> Sub Attributes
--Sub Attributes
_detalhes.sub_atributos = {
{
--> Damage sub classes information
--Damage sub classes information
damage_done = 1,
dps = 2,
damage_taken = 3,
@@ -154,7 +154,7 @@ do
},
{
--> Healing sub classes information
--Healing sub classes information
healing_done = 1,
hps = 2,
overheal = 3,
@@ -185,7 +185,7 @@ do
},
{
--> Energy sub classes information
--Energy sub classes information
mana_ganha = 1, -- id 0
rage_ganha = 2, -- id 1
energy_ganha = 3, --id 3
@@ -212,7 +212,7 @@ do
},
{
--> Misc sub classes information
--Misc sub classes information
cc_break = 1,
ress = 2,
kick = 3,
@@ -257,7 +257,7 @@ do
return CustomObject.name
elseif (CustomObject and customName and CustomObject.name ~= customName) then
for _, custom in ipairs (_detalhes.custom) do
for _, custom in ipairs(_detalhes.custom) do
if (custom.name == customName) then
return custom.name
end
+5 -5
View File
@@ -45,23 +45,23 @@ if (not _G.DetailsFramework.IsTimewalkWoW()) then
end
autoRunCodeEventFrame.OnEventFunc = function(self, event)
--> ignore events triggered more than once in a small time window
--ignore events triggered more than once in a small time window
if (autoRunCodeEventFrame [event] and not autoRunCodeEventFrame [event]:IsCancelled()) then
return
end
if (event == "PLAYER_SPECIALIZATION_CHANGED") then
--> create a trigger for the event, many times it is triggered more than once
--> so if the event is triggered a second time, it will be ignored
--create a trigger for the event, many times it is triggered more than once
--so if the event is triggered a second time, it will be ignored
local newTimer = C_Timer.NewTimer(1, function()
Details:DispatchAutoRunCode("on_specchanged")
--> clear and invalidate the timer
--clear and invalidate the timer
autoRunCodeEventFrame[event]:Cancel()
autoRunCodeEventFrame[event] = nil
end)
--> store the trigger
--store the trigger
autoRunCodeEventFrame[event] = newTimer
end
end
+29 -29
View File
@@ -3,12 +3,12 @@ do
local _detalhes = _G._detalhes
_detalhes.EncounterInformation = {}
local _ipairs = ipairs --> lua local
local _ipairs = ipairs --lua local
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> details api functions
--details api functions
--> return if the player is inside a raid supported by details
--return if the player is inside a raid supported by details
function _detalhes:IsInInstance()
local _, _, _, _, _, _, _, zoneMapID = GetInstanceInfo()
if (_detalhes.EncounterInformation [zoneMapID]) then
@@ -18,7 +18,7 @@ do
end
end
--> return the full table with all data for the instance
--return the full table with all data for the instance
function _detalhes:GetRaidInfoFromEncounterID (encounterID, encounterEJID)
for id, raidTable in pairs (_detalhes.EncounterInformation) do
if (encounterID) then
@@ -40,7 +40,7 @@ do
end
end
--> return the ids of trash mobs in the instance
--return the ids of trash mobs in the instance
function _detalhes:GetInstanceTrashInfo (mapid)
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].trash_ids
end
@@ -64,7 +64,7 @@ do
end
end
--> return the boss table using a encounter id
--return the boss table using a encounter id
function _detalhes:GetBossEncounterDetailsFromEncounterId (mapid, encounterid)
if (not mapid) then
local bossIndex, instance
@@ -100,12 +100,12 @@ do
end
end
--> return the EJ boss id
--return the EJ boss id
function _detalhes:GetEncounterIdFromBossIndex (mapid, index)
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounter_ids and _detalhes.EncounterInformation [mapid].encounter_ids [index]
end
--> return the table which contain information about the start of a encounter
--return the table which contain information about the start of a encounter
function _detalhes:GetEncounterStartInfo (mapid, encounterid)
local bossindex = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounter_ids and _detalhes.EncounterInformation [mapid].encounter_ids [encounterid]
if (bossindex) then
@@ -113,7 +113,7 @@ do
end
end
--> return the table which contain information about the end of a encounter
--return the table which contain information about the end of a encounter
function _detalhes:GetEncounterEndInfo (mapid, encounterid)
local bossindex = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounter_ids and _detalhes.EncounterInformation [mapid].encounter_ids [encounterid]
if (bossindex) then
@@ -121,7 +121,7 @@ do
end
end
--> return the function for the boss
--return the function for the boss
function _detalhes:GetEncounterEnd (mapid, bossindex)
local t = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex]
if (t) then
@@ -133,17 +133,17 @@ do
return
end
--> generic boss find function
--generic boss find function
function _detalhes:GetRaidBossFindFunction (mapid)
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].find_boss_encounter
end
--> return if the boss need sync
--return if the boss need sync
function _detalhes:GetEncounterEqualize (mapid, bossindex)
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex] and _detalhes.EncounterInformation [mapid].encounters [bossindex].equalize
end
--> return the function for the boss
--return the function for the boss
function _detalhes:GetBossFunction (mapid, bossindex)
local func = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex] and _detalhes.EncounterInformation [mapid].encounters [bossindex].func
if (func) then
@@ -152,30 +152,30 @@ do
return
end
--> return the boss table with information about name, adds, spells, etc
--return the boss table with information about name, adds, spells, etc
function _detalhes:GetBossDetails (mapid, bossindex)
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex]
end
--> return a table with all names of boss enemies
--return a table with all names of boss enemies
function _detalhes:GetEncounterActors (mapid, bossindex)
end
--> return a table with spells id of specified encounter
--return a table with spells id of specified encounter
function _detalhes:GetEncounterSpells (mapid, bossindex)
local encounter = _detalhes:GetBossDetails (mapid, bossindex)
local habilidades_poll = {}
if (encounter.continuo) then
for index, spellid in _ipairs (encounter.continuo) do
for index, spellid in _ipairs(encounter.continuo) do
habilidades_poll [spellid] = true
end
end
local fases = encounter.phases
if (fases) then
for fase_id, fase in _ipairs (fases) do
for fase_id, fase in _ipairs(fases) do
if (fase.spells) then
for index, spellid in _ipairs (fase.spells) do
for index, spellid in _ipairs(fase.spells) do
habilidades_poll [spellid] = true
end
end
@@ -184,7 +184,7 @@ do
return habilidades_poll
end
--> return a table with all boss ids from a raid instance
--return a table with all boss ids from a raid instance
function _detalhes:GetBossIds (mapid)
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].boss_ids
end
@@ -196,17 +196,17 @@ do
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].is_raid
end
--> return a table with all encounter names present in raid instance
--return a table with all encounter names present in raid instance
function _detalhes:GetBossNames (mapid)
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].boss_names
end
--> return the encounter name
--return the encounter name
function _detalhes:GetBossName (mapid, bossindex)
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].boss_names [bossindex]
end
--> same thing as GetBossDetails, just a alias
--same thing as GetBossDetails, just a alias
function _detalhes:GetBossEncounterDetails (mapid, bossindex)
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex]
end
@@ -224,7 +224,7 @@ do
end
end
--> return the wallpaper for the raid instance
--return the wallpaper for the raid instance
function _detalhes:GetRaidBackground (mapid)
local bosstables = _detalhes.EncounterInformation [mapid]
if (bosstables) then
@@ -234,7 +234,7 @@ do
end
end
end
--> return the icon for the raid instance
--return the icon for the raid instance
function _detalhes:GetRaidIcon (mapid, ejID, instanceType)
local raidIcon = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].icon
if (raidIcon) then
@@ -271,7 +271,7 @@ do
end
end
--> return the boss icon
--return the boss icon
function _detalhes:GetBossIcon (mapid, bossindex)
if (_detalhes.EncounterInformation [mapid]) then
local line = math.ceil (bossindex / 4)
@@ -280,7 +280,7 @@ do
end
end
--> return the boss portrit
--return the boss portrit
function _detalhes:GetBossPortrait (mapid, bossindex, encounterName, ejID)
if (mapid and bossindex) then
local haveIcon = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex] and _detalhes.EncounterInformation [mapid].encounters [bossindex].portrait
@@ -302,7 +302,7 @@ do
return nil
end
--> return a list with names of adds and bosses
--return a list with names of adds and bosses
function _detalhes:GetEncounterActorsName (EJ_EncounterID)
--code snippet from wowpedia
local actors = {}
@@ -387,7 +387,7 @@ do
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> core
--core
function _detalhes:InstallEncounter (InstanceTable)
_detalhes.EncounterInformation [InstanceTable.id] = InstanceTable
+8 -8
View File
@@ -2,7 +2,7 @@
local Details = _G.Details
--> get the total of damage and healing of a phase of an encounter
--get the total of damage and healing of a phase of an encounter
function Details:OnCombatPhaseChanged()
local current_combat = Details:GetCurrentCombat()
@@ -23,13 +23,13 @@ function Details:OnCombatPhaseChanged()
current_combat.PhaseData.heal [current_phase] = phase_healing_container
end
for index, damage_actor in ipairs (Details.cache_damage_group) do
for index, damage_actor in ipairs(Details.cache_damage_group) do
local phase_damage = damage_actor.total - (phase_damage_section [damage_actor.nome] or 0)
phase_damage_section [damage_actor.nome] = damage_actor.total
phase_damage_container [damage_actor.nome] = (phase_damage_container [damage_actor.nome] or 0) + phase_damage
end
for index, healing_actor in ipairs (Details.cache_healing_group) do
for index, healing_actor in ipairs(Details.cache_healing_group) do
local phase_heal = healing_actor.total - (phase_healing_section [healing_actor.nome] or 0)
phase_healing_section [healing_actor.nome] = healing_actor.total
phase_healing_container [healing_actor.nome] = (phase_healing_container [healing_actor.nome] or 0) + phase_heal
@@ -82,8 +82,8 @@ function Details:BossModsLink()
tinsert (cur_combat.PhaseData, {phase, time})
end
Details:SendEvent ("COMBAT_ENCOUNTER_PHASE_CHANGED", nil, phase)
--Details:Msg ("Current phase is now:", phase)
Details:SendEvent("COMBAT_ENCOUNTER_PHASE_CHANGED", nil, phase)
--Details:Msg("Current phase is now:", phase)
end
end
@@ -104,8 +104,8 @@ function Details:CreateCallbackListeners()
local current_table_dbm = {}
local current_table_bigwigs = {}
local event_frame = CreateFrame ("frame", nil, UIParent, "BackdropTemplate")
event_frame:SetScript ("OnEvent", function(self, event, ...)
local event_frame = CreateFrame("frame", nil, UIParent, "BackdropTemplate")
event_frame:SetScript("OnEvent", function(self, event, ...)
if (event == "ENCOUNTER_START") then
local encounterID, encounterName, difficultyID, raidSize = select (1, ...)
current_encounter = encounterID
@@ -158,7 +158,7 @@ function Details:CreateCallbackListeners()
function Details:BigWigs_StartBar (event, module, spellid, bar_text, time, icon, ...)
spellid = tostring (spellid)
if (not current_table_bigwigs [spellid]) then
current_table_bigwigs [spellid] = {(type (module) == "string" and module) or (module and module.moduleName) or "", spellid or "", bar_text or "", time or 0, icon or ""}
current_table_bigwigs [spellid] = {(type(module) == "string" and module) or (module and module.moduleName) or "", spellid or "", bar_text or "", time or 0, icon or ""}
end
end
if (BigWigsLoader.RegisterMessage) then
+23 -23
View File
@@ -8,34 +8,34 @@
local _detalhes = _G._detalhes
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
local _
--> initialize buffs name container
--initialize buffs name container
_detalhes.Buffs.BuffsTable = {} -- armazenara o [nome do buff] = { tabela do buff }
_detalhes.Buffs.__index = _detalhes.Buffs
--> switch off recording buffs by default
--switch off recording buffs by default
_detalhes.RecordPlayerSelfBuffs = false
_detalhes.RecordPlayerAbilityWithBuffs = false
_detalhes.RecordPlayerSelfDebuffs = false
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> local pointers
--local pointers
local _pairs = pairs --> lua local
local _ipairs = ipairs --> lua local
local _pairs = pairs --lua local
local _ipairs = ipairs --lua local
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> details api functions
--details api functions
--> return if the buff is already registred or not
--return if the buff is already registred or not
function _detalhes.Buffs:IsRegistred (buff)
if (type (buff) == "number") then
if (type(buff) == "number") then
for _, buffObject in _pairs (_detalhes.Buffs.BuffsTable) do
if (buffObject.id == buff) then
return true
end
end
return false
elseif (type (buff) == "string") then
elseif (type(buff) == "string") then
for name, _ in _pairs (_detalhes.Buffs.BuffsTable) do
if (name == buff) then
return true
@@ -45,7 +45,7 @@
end
end
--> register a new buff name
--register a new buff name
function _detalhes.Buffs:NewBuff (BuffName, BuffId)
if (not BuffName) then
BuffName = GetSpellInfo(BuffId)
@@ -57,7 +57,7 @@
end
end
--> remove a registred buff
--remove a registred buff
function _detalhes.Buffs:RemoveBuff (BuffName)
if (not _detalhes.Buffs.BuffsTable [BuffName]) then
return false
@@ -67,7 +67,7 @@
end
end
--> return a list of registred buffs
--return a list of registred buffs
function _detalhes.Buffs:GetBuffList()
local list = {}
for name, _ in _pairs (_detalhes.Buffs.BuffsTable) do
@@ -76,7 +76,7 @@
return list
end
--> return a list of registred buffs ids
--return a list of registred buffs ids
function _detalhes.Buffs:GetBuffListIds()
local list = {}
for name, buffObject in _pairs (_detalhes.Buffs.BuffsTable) do
@@ -87,7 +87,7 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> internal functions
--internal functions
function _detalhes.Buffs:UpdateBuff (method)
-- self = buff table
@@ -97,7 +97,7 @@
self.castedAmt = self.castedAmt + 1
self.active = true
self.appliedAt [#self.appliedAt+1] = _detalhes.tabela_vigente:GetCombatTime()
_detalhes:SendEvent ("BUFF_UPDATE")
_detalhes:SendEvent("BUFF_UPDATE")
elseif (method == "refresh") then
@@ -105,7 +105,7 @@
self.duration = self.duration + (_detalhes._tempo - self.start)
self.start = _detalhes._tempo
self.appliedAt [#self.appliedAt+1] = _detalhes.tabela_vigente:GetCombatTime()
_detalhes:SendEvent ("BUFF_UPDATE")
_detalhes:SendEvent("BUFF_UPDATE")
elseif (method == "remove") then
@@ -117,27 +117,27 @@
self.droppedAmt = self.droppedAmt + 1
self.start = nil
self.active = false
_detalhes:SendEvent ("BUFF_UPDATE")
_detalhes:SendEvent("BUFF_UPDATE")
end
end
--> build buffs
--build buffs
function _detalhes.Buffs:BuildTables()
_detalhes.Buffs.built = true
if (_detalhes.savedbuffs) then
for _, BuffId in _ipairs (_detalhes.savedbuffs) do
for _, BuffId in _ipairs(_detalhes.savedbuffs) do
_detalhes.Buffs:NewBuff (nil, BuffId)
end
end
end
--> save buff list when addon exit
--save buff list when addon exit
function _detalhes.Buffs:SaveBuffs()
_detalhes_database.savedbuffs = _detalhes.Buffs:GetBuffListIds()
end
--> construct a buff table of the new buff registred
--construct a buff table of the new buff registred
function _detalhes.Buffs:BuildBuffTable (BuffName, BuffId)
local bufftable = {name = BuffName, id = BuffId, duration = 0, start = nil, castedAmt = 0, refreshAmt = 0, droppedAmt = 0, active = false, appliedAt = {}}
bufftable.IsBuff = true
@@ -146,7 +146,7 @@
end
--> update player buffs
--update player buffs
function _detalhes.Buffs:CatchBuffs()
if (not _detalhes.Buffs.built) then
@@ -168,7 +168,7 @@
BuffTable.droppedAmt = 0
end
--> catch buffs untracked yet
--catch buffs untracked yet
for buffIndex = 1, 41 do
local name = UnitAura ("player", buffIndex)
if (name) then
+1 -1
View File
@@ -170,7 +170,7 @@ do
return self.pets
end
--> inherits to all actors without placing it on _detalhes namespace.
--inherits to all actors without placing it on _detalhes namespace.
_detalhes.container_combatentes.guid = _detalhes.GetGUID
_detalhes.container_combatentes.name = _detalhes.GetName
_detalhes.container_combatentes.class = _detalhes.GetActorClass
+2 -2
View File
@@ -444,10 +444,10 @@ function Details.Coach.WelcomePanel()
local welcomePanel = _G.DETAILSCOACHPANEL
if (not welcomePanel) then
welcomePanel = DetailsFramework:CreateSimplePanel(UIParent)
welcomePanel:SetSize (400, 280)
welcomePanel:SetSize(400, 280)
welcomePanel:SetTitle ("Details! Coach")
welcomePanel:ClearAllPoints()
welcomePanel:SetPoint ("left", UIParent, "left", 10, 0)
welcomePanel:SetPoint("left", UIParent, "left", 10, 0)
welcomePanel:Hide()
DetailsFramework:ApplyStandardBackdrop(welcomePanel)
+40 -40
View File
@@ -4,10 +4,10 @@ local Details = _G.Details
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> extra buttons at the death options (release, death recap)
--extra buttons at the death options (release, death recap)
local detailsOnDeathMenu = CreateFrame ("frame", "DetailsOnDeathMenu", UIParent, "BackdropTemplate")
detailsOnDeathMenu:SetHeight (30)
local detailsOnDeathMenu = CreateFrame("frame", "DetailsOnDeathMenu", UIParent, "BackdropTemplate")
detailsOnDeathMenu:SetHeight(30)
detailsOnDeathMenu.Debug = false
detailsOnDeathMenu:RegisterEvent ("PLAYER_REGEN_ENABLED")
@@ -16,14 +16,14 @@ DetailsFramework:ApplyStandardBackdrop (detailsOnDeathMenu)
detailsOnDeathMenu:SetAlpha (0.75)
--disable text
detailsOnDeathMenu.disableLabel = Details.gump:CreateLabel (detailsOnDeathMenu, "you can disable this at /details > Raid Tools", 9)
detailsOnDeathMenu.disableLabel = Details.gump:CreateLabel(detailsOnDeathMenu, "you can disable this at /details > Raid Tools", 9)
detailsOnDeathMenu.warningLabel = Details.gump:CreateLabel (detailsOnDeathMenu, "", 11)
detailsOnDeathMenu.warningLabel = Details.gump:CreateLabel(detailsOnDeathMenu, "", 11)
detailsOnDeathMenu.warningLabel.textcolor = "red"
detailsOnDeathMenu.warningLabel:SetPoint ("bottomleft", detailsOnDeathMenu, "bottomleft", 5, 2)
detailsOnDeathMenu.warningLabel:SetPoint("bottomleft", detailsOnDeathMenu, "bottomleft", 5, 2)
detailsOnDeathMenu.warningLabel:Hide()
detailsOnDeathMenu:SetScript ("OnEvent", function(self, event, ...)
detailsOnDeathMenu:SetScript("OnEvent", function(self, event, ...)
if (event == "ENCOUNTER_END") then
C_Timer.After (0.5, detailsOnDeathMenu.ShowPanel)
end
@@ -108,7 +108,7 @@ end
--encounter breakdown button
detailsOnDeathMenu.breakdownButton = Details.gump:CreateButton (detailsOnDeathMenu, detailsOnDeathMenu.OpenEncounterBreakdown, 120, 20, "Encounter Breakdown", "breakdownButton")
detailsOnDeathMenu.breakdownButton:SetTemplate (Details.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE"))
detailsOnDeathMenu.breakdownButton:SetPoint ("topleft", detailsOnDeathMenu, "topleft", 5, -5)
detailsOnDeathMenu.breakdownButton:SetPoint("topleft", detailsOnDeathMenu, "topleft", 5, -5)
detailsOnDeathMenu.breakdownButton:Hide()
detailsOnDeathMenu.breakdownButton.CoolTip = {
@@ -129,7 +129,7 @@ detailsOnDeathMenu.breakdownButton.CoolTip = {
GameCooltip2:AddLine ("Encounter Breakdown plugin is disabled in the Addon Control Panel.", "", 1, "red")
end
end, --> called when user mouse over the frame
end, --called when user mouse over the frame
OnEnterFunc = function(self)
detailsOnDeathMenu.button_mouse_over = true
end,
@@ -139,12 +139,12 @@ detailsOnDeathMenu.breakdownButton.CoolTip = {
FixedValue = "none",
ShowSpeed = .5,
Options = function()
GameCooltip:SetOption ("MyAnchor", "top")
GameCooltip:SetOption ("RelativeAnchor", "bottom")
GameCooltip:SetOption ("WidthAnchorMod", 0)
GameCooltip:SetOption ("HeightAnchorMod", -13)
GameCooltip:SetOption ("TextSize", 10)
GameCooltip:SetOption ("FixedWidth", 220)
GameCooltip:SetOption("MyAnchor", "top")
GameCooltip:SetOption("RelativeAnchor", "bottom")
GameCooltip:SetOption("WidthAnchorMod", 0)
GameCooltip:SetOption("HeightAnchorMod", -13)
GameCooltip:SetOption("TextSize", 10)
GameCooltip:SetOption("FixedWidth", 220)
end
}
GameCooltip2:CoolTipInject (detailsOnDeathMenu.breakdownButton)
@@ -152,7 +152,7 @@ GameCooltip2:CoolTipInject (detailsOnDeathMenu.breakdownButton)
--player endurance button
detailsOnDeathMenu.enduranceButton = Details.gump:CreateButton (detailsOnDeathMenu, detailsOnDeathMenu.OpenPlayerEndurance, 120, 20, "Player Endurance", "enduranceButton")
detailsOnDeathMenu.enduranceButton:SetTemplate (Details.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE"))
detailsOnDeathMenu.enduranceButton:SetPoint ("topleft", detailsOnDeathMenu.breakdownButton, "topright", 2, 0)
detailsOnDeathMenu.enduranceButton:SetPoint("topleft", detailsOnDeathMenu.breakdownButton, "topright", 2, 0)
detailsOnDeathMenu.enduranceButton:Hide()
detailsOnDeathMenu.enduranceButton.CoolTip = {
@@ -170,7 +170,7 @@ detailsOnDeathMenu.enduranceButton.CoolTip = {
GameCooltip2:AddLine ("Advanced Death Logs plugin is disabled or not installed, check the Addon Control Panel or download it from the Curseforge APP.", "", 1, "red")
end
end, --> called when user mouse over the frame
end, --called when user mouse over the frame
OnEnterFunc = function(self)
detailsOnDeathMenu.button_mouse_over = true
end,
@@ -180,12 +180,12 @@ detailsOnDeathMenu.enduranceButton.CoolTip = {
FixedValue = "none",
ShowSpeed = .5,
Options = function()
GameCooltip:SetOption ("MyAnchor", "top")
GameCooltip:SetOption ("RelativeAnchor", "bottom")
GameCooltip:SetOption ("WidthAnchorMod", 0)
GameCooltip:SetOption ("HeightAnchorMod", -13)
GameCooltip:SetOption ("TextSize", 10)
GameCooltip:SetOption ("FixedWidth", 220)
GameCooltip:SetOption("MyAnchor", "top")
GameCooltip:SetOption("RelativeAnchor", "bottom")
GameCooltip:SetOption("WidthAnchorMod", 0)
GameCooltip:SetOption("HeightAnchorMod", -13)
GameCooltip:SetOption("TextSize", 10)
GameCooltip:SetOption("FixedWidth", 220)
end
}
GameCooltip2:CoolTipInject (detailsOnDeathMenu.enduranceButton)
@@ -193,7 +193,7 @@ GameCooltip2:CoolTipInject (detailsOnDeathMenu.enduranceButton)
--spells
detailsOnDeathMenu.spellsButton = Details.gump:CreateButton (detailsOnDeathMenu, detailsOnDeathMenu.OpenPlayerSpells, 48, 20, "Spells", "SpellsButton")
detailsOnDeathMenu.spellsButton:SetTemplate (Details.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE"))
detailsOnDeathMenu.spellsButton:SetPoint ("topleft", detailsOnDeathMenu.enduranceButton, "topright", 2, 0)
detailsOnDeathMenu.spellsButton:SetPoint("topleft", detailsOnDeathMenu.enduranceButton, "topright", 2, 0)
detailsOnDeathMenu.spellsButton:Hide()
detailsOnDeathMenu.spellsButton.CoolTip = {
@@ -202,7 +202,7 @@ detailsOnDeathMenu.spellsButton.CoolTip = {
GameCooltip2:Preset (2)
GameCooltip2:AddLine ("Open your player Details! breakdown.")
end, --> called when user mouse over the frame
end, --called when user mouse over the frame
OnEnterFunc = function(self)
detailsOnDeathMenu.button_mouse_over = true
end,
@@ -212,12 +212,12 @@ detailsOnDeathMenu.spellsButton.CoolTip = {
FixedValue = "none",
ShowSpeed = .5,
Options = function()
GameCooltip:SetOption ("MyAnchor", "top")
GameCooltip:SetOption ("RelativeAnchor", "bottom")
GameCooltip:SetOption ("WidthAnchorMod", 0)
GameCooltip:SetOption ("HeightAnchorMod", -13)
GameCooltip:SetOption ("TextSize", 10)
GameCooltip:SetOption ("FixedWidth", 220)
GameCooltip:SetOption("MyAnchor", "top")
GameCooltip:SetOption("RelativeAnchor", "bottom")
GameCooltip:SetOption("WidthAnchorMod", 0)
GameCooltip:SetOption("HeightAnchorMod", -13)
GameCooltip:SetOption("TextSize", 10)
GameCooltip:SetOption("FixedWidth", 220)
end
}
GameCooltip2:CoolTipInject (detailsOnDeathMenu.spellsButton)
@@ -232,11 +232,11 @@ function detailsOnDeathMenu.CanShowPanel()
return true
end
--> check if the player just wiped in an encounter
--check if the player just wiped in an encounter
if (IsInRaid()) then
local isInInstance = IsInInstance()
if (isInInstance) then
--> check if all players in the raid are out of combat
--check if all players in the raid are out of combat
for i = 1, GetNumGroupMembers() do
if (UnitAffectingCombat ("raid" .. i)) then
C_Timer.After (0.5, detailsOnDeathMenu.ShowPanel)
@@ -261,11 +261,11 @@ function detailsOnDeathMenu.ShowPanel()
end
if (ElvUI) then
detailsOnDeathMenu:SetPoint ("topleft", StaticPopup1, "bottomleft", 0, -1)
detailsOnDeathMenu:SetPoint ("topright", StaticPopup1, "bottomright", 0, -1)
detailsOnDeathMenu:SetPoint("topleft", StaticPopup1, "bottomleft", 0, -1)
detailsOnDeathMenu:SetPoint("topright", StaticPopup1, "bottomright", 0, -1)
else
detailsOnDeathMenu:SetPoint ("topleft", StaticPopup1, "bottomleft", 4, 2)
detailsOnDeathMenu:SetPoint ("topright", StaticPopup1, "bottomright", -4, 2)
detailsOnDeathMenu:SetPoint("topleft", StaticPopup1, "bottomleft", 4, 2)
detailsOnDeathMenu:SetPoint("topright", StaticPopup1, "bottomright", -4, 2)
end
detailsOnDeathMenu.breakdownButton:Show()
@@ -274,14 +274,14 @@ function detailsOnDeathMenu.ShowPanel()
detailsOnDeathMenu:Show()
detailsOnDeathMenu:SetHeight (30)
detailsOnDeathMenu:SetHeight(30)
if (not Details:GetTutorialCVar ("DISABLE_ONDEATH_PANEL")) then
detailsOnDeathMenu.disableLabel:Show()
detailsOnDeathMenu.disableLabel:SetPoint ("bottomleft", detailsOnDeathMenu, "bottomleft", 5, 1)
detailsOnDeathMenu.disableLabel:SetPoint("bottomleft", detailsOnDeathMenu, "bottomleft", 5, 1)
detailsOnDeathMenu.disableLabel.color = "gray"
detailsOnDeathMenu.disableLabel.alpha = 0.5
detailsOnDeathMenu:SetHeight (detailsOnDeathMenu:GetHeight() + 10)
detailsOnDeathMenu:SetHeight(detailsOnDeathMenu:GetHeight() + 10)
if (math.random (1, 3) == 3) then
Details:SetTutorialCVar ("DISABLE_ONDEATH_PANEL", true)
+86 -86
View File
@@ -9,7 +9,7 @@ local on_deathrecap_line_enter = function(self)
if (self.spellid) then
GameTooltip:SetOwner (self, "ANCHOR_RIGHT")
Details:GameTooltipSetSpellByID (self.spellid)
self:SetBackdropColor (.3, .3, .3, .2)
self:SetBackdropColor(.3, .3, .3, .2)
GameTooltip:Show()
self.backgroundTextureOverlay:Show()
self.timeAt:SetAlpha (1)
@@ -21,7 +21,7 @@ end
local on_deathrecap_line_leave = function(self)
GameTooltip:Hide()
self:SetBackdropColor (.3, .3, .3, 0)
self:SetBackdropColor(.3, .3, .3, 0)
self.backgroundTextureOverlay:Hide()
self.timeAt:SetAlpha (textAlpha)
self.sourceName:SetAlpha (textAlpha)
@@ -30,19 +30,19 @@ local on_deathrecap_line_leave = function(self)
end
local create_deathrecap_line = function(parent, n)
local line = CreateFrame ("frame", "DetailsDeathRecapLine" .. n, parent, "BackdropTemplate")
line:SetPoint ("topleft", parent, "topleft", 10, (-24 * n) - 17)
line:SetPoint ("topright", parent, "topright", -10, (-24 * n) - 17)
line:SetScript ("OnEnter", on_deathrecap_line_enter)
line:SetScript ("OnLeave", on_deathrecap_line_leave)
local line = CreateFrame("frame", "DetailsDeathRecapLine" .. n, parent, "BackdropTemplate")
line:SetPoint("topleft", parent, "topleft", 10, (-24 * n) - 17)
line:SetPoint("topright", parent, "topright", -10, (-24 * n) - 17)
line:SetScript("OnEnter", on_deathrecap_line_enter)
line:SetScript("OnLeave", on_deathrecap_line_leave)
line:SetSize (300, 21)
line:SetSize(300, 21)
local timeAt = line:CreateFontString (nil, "overlay", "GameFontNormal")
local backgroundTexture = line:CreateTexture (nil, "border")
local backgroundTextureOverlay = line:CreateTexture (nil, "artwork")
local spellIcon = line:CreateTexture (nil, "overlay")
local spellIconBorder = line:CreateTexture (nil, "overlay")
local backgroundTexture = line:CreateTexture(nil, "border")
local backgroundTextureOverlay = line:CreateTexture(nil, "artwork")
local spellIcon = line:CreateTexture(nil, "overlay")
local spellIconBorder = line:CreateTexture(nil, "overlay")
spellIcon:SetDrawLayer ("overlay", 1)
spellIconBorder:SetDrawLayer ("overlay", 2)
local sourceName = line:CreateFontString (nil, "overlay", "GameFontNormal")
@@ -51,30 +51,30 @@ local create_deathrecap_line = function(parent, n)
local lifeStatusBar = line:CreateTexture(nil, "border", nil, -3)
--grave icon
local graveIcon = line:CreateTexture (nil, "overlay")
graveIcon:SetTexture ([[Interface\MINIMAP\POIIcons]])
local graveIcon = line:CreateTexture(nil, "overlay")
graveIcon:SetTexture([[Interface\MINIMAP\POIIcons]])
graveIcon:SetTexCoord (146/256, 160/256, 0/512, 18/512)
graveIcon:SetPoint ("left", line, "left", 11, 0)
graveIcon:SetSize (14, 18)
graveIcon:SetPoint("left", line, "left", 11, 0)
graveIcon:SetSize(14, 18)
--spell icon
spellIcon:SetSize (19, 19)
spellIconBorder:SetTexture ([[Interface\ENCOUNTERJOURNAL\LootTab]])
spellIcon:SetSize(19, 19)
spellIconBorder:SetTexture([[Interface\ENCOUNTERJOURNAL\LootTab]])
spellIconBorder:SetTexCoord (6/256, 38/256, 49/128, 81/128)
spellIconBorder:SetSize (20, 20)
spellIconBorder:SetPoint ("topleft", spellIcon, "topleft", 0, 0)
spellIconBorder:SetSize(20, 20)
spellIconBorder:SetPoint("topleft", spellIcon, "topleft", 0, 0)
--locations
timeAt:SetPoint ("left", line, "left", 2, 0)
spellIcon:SetPoint ("left", line, "left", 50, 0)
sourceName:SetPoint ("left", line, "left", 82, 0)
amount:SetPoint ("left", line, "left", 240, 0)
lifePercent:SetPoint ("left", line, "left", 320, 0)
timeAt:SetPoint("left", line, "left", 2, 0)
spellIcon:SetPoint("left", line, "left", 50, 0)
sourceName:SetPoint("left", line, "left", 82, 0)
amount:SetPoint("left", line, "left", 240, 0)
lifePercent:SetPoint("left", line, "left", 320, 0)
--text colors
Details.gump:SetFontColor (amount, "red")
Details.gump:SetFontColor (timeAt, "gray")
Details.gump:SetFontColor (sourceName, "yellow")
Details.gump:SetFontColor(amount, "red")
Details.gump:SetFontColor(timeAt, "gray")
Details.gump:SetFontColor(sourceName, "yellow")
Details.gump:SetFontSize (sourceName, 10)
@@ -85,50 +85,50 @@ local create_deathrecap_line = function(parent, n)
lifePercent:SetAlpha (textAlpha)
--text setup
amount:SetWidth (85)
amount:SetJustifyH ("right")
lifePercent:SetWidth (42)
lifePercent:SetJustifyH ("right")
amount:SetWidth(85)
amount:SetJustifyH("right")
lifePercent:SetWidth(42)
lifePercent:SetJustifyH("right")
--life statusbar
lifeStatusBar:SetPoint("topleft", line, "topleft")
lifeStatusBar:SetPoint("bottomleft", line, "bottomleft")
lifeStatusBar:SetColorTexture(0.5, 0.5, 0.5, 0.4)
backgroundTexture:SetTexture ([[Interface\AddOns\Details\images\deathrecap_background]])
backgroundTexture:SetTexture([[Interface\AddOns\Details\images\deathrecap_background]])
backgroundTexture:SetTexCoord (0, 1, 0, 1)
backgroundTexture:SetVertexColor (.1, .1, .1, .3)
--top border
local TopFader = line:CreateTexture (nil, "border")
TopFader:SetTexture ([[Interface\AddOns\Details\images\deathrecap_background_top]])
local TopFader = line:CreateTexture(nil, "border")
TopFader:SetTexture([[Interface\AddOns\Details\images\deathrecap_background_top]])
TopFader:SetTexCoord (0, 1, 0, 1)
TopFader:SetVertexColor (.1, .1, .1, .3)
TopFader:SetPoint ("bottomleft", backgroundTexture, "topleft", 0, -0)
TopFader:SetPoint ("bottomright", backgroundTexture, "topright", 0, -0)
TopFader:SetHeight (32)
TopFader:SetPoint("bottomleft", backgroundTexture, "topleft", 0, -0)
TopFader:SetPoint("bottomright", backgroundTexture, "topright", 0, -0)
TopFader:SetHeight(32)
TopFader:Hide()
line.TopFader = TopFader
if (n == 10) then
--bottom fader
local backgroundTexture2 = line:CreateTexture (nil, "border")
backgroundTexture2:SetTexture ([[Interface\AddOns\Details\images\deathrecap_background_bottom]])
local backgroundTexture2 = line:CreateTexture(nil, "border")
backgroundTexture2:SetTexture([[Interface\AddOns\Details\images\deathrecap_background_bottom]])
backgroundTexture2:SetTexCoord (0, 1, 0, 1)
backgroundTexture2:SetVertexColor (.1, .1, .1, .3)
backgroundTexture2:SetPoint ("topleft", backgroundTexture, "bottomleft", 0, 0)
backgroundTexture2:SetPoint ("topright", backgroundTexture, "bottomright", 0, 0)
backgroundTexture2:SetHeight (32)
backgroundTexture2:SetPoint("topleft", backgroundTexture, "bottomleft", 0, 0)
backgroundTexture2:SetPoint("topright", backgroundTexture, "bottomright", 0, 0)
backgroundTexture2:SetHeight(32)
Details.gump:SetFontSize (amount, 14)
Details.gump:SetFontSize (lifePercent, 14)
backgroundTexture:SetVertexColor (.2, .1, .1, .3)
end
backgroundTexture:SetPoint ("topleft", 0, 1)
backgroundTexture:SetPoint ("bottomright", 0, -1)
backgroundTexture:SetPoint("topleft", 0, 1)
backgroundTexture:SetPoint("bottomright", 0, -1)
backgroundTexture:SetDesaturated (true)
backgroundTextureOverlay:SetTexture ([[Interface\AdventureMap\AdventureMap]])
backgroundTextureOverlay:SetTexture([[Interface\AdventureMap\AdventureMap]])
backgroundTextureOverlay:SetTexCoord (460/1024, 659/1024, 330/1024, 350/1024)
backgroundTextureOverlay:SetAllPoints()
backgroundTextureOverlay:SetDesaturated (true)
@@ -238,7 +238,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
for i = 1, 10 do
Details.DeathRecap.Lines [i]:Hide()
end
for i, button in ipairs (Details.DeathRecap.Segments) do
for i, button in ipairs(Details.DeathRecap.Segments) do
button:Hide()
end
end
@@ -255,10 +255,10 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
--create details death recap if not existant
if (not Details.DeathRecap) then
Details.DeathRecap = CreateFrame ("frame", "DetailsDeathRecap", DeathRecapFrame, "BackdropTemplate")
Details.DeathRecap = CreateFrame("frame", "DetailsDeathRecap", DeathRecapFrame, "BackdropTemplate")
Details.DeathRecap:SetAllPoints()
DeathRecapFrame.Title:SetText (DeathRecapFrame.Title:GetText() .. " (by Details!)")
DeathRecapFrame.Title:SetText(DeathRecapFrame.Title:GetText() .. " (by Details!)")
--lines
Details.DeathRecap.Lines = {}
@@ -269,18 +269,18 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
--segments
Details.DeathRecap.Segments = {}
for i = 5, 1, -1 do
local segmentButton = CreateFrame ("button", "DetailsDeathRecapSegmentButton" .. i, Details.DeathRecap, "BackdropTemplate")
local segmentButton = CreateFrame("button", "DetailsDeathRecapSegmentButton" .. i, Details.DeathRecap, "BackdropTemplate")
segmentButton:SetSize (16, 20)
segmentButton:SetPoint ("topright", DeathRecapFrame, "topright", (-abs (i-6) * 22) - 10, -5)
segmentButton:SetSize(16, 20)
segmentButton:SetPoint("topright", DeathRecapFrame, "topright", (-abs (i-6) * 22) - 10, -5)
local text = segmentButton:CreateFontString (nil, "overlay", "GameFontNormal")
segmentButton.text = text
text:SetText ("#" .. i)
text:SetPoint ("center")
Details.gump:SetFontColor (text, "silver")
text:SetText("#" .. i)
text:SetPoint("center")
Details.gump:SetFontColor(text, "silver")
segmentButton:SetScript ("OnClick", function()
segmentButton:SetScript("OnClick", function()
OpenDetailsDeathRecapAtSegment (i)
end)
tinsert (Details.DeathRecap.Segments, i, segmentButton)
@@ -320,11 +320,11 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
if (Details.death_recap.show_segments) then
local last_index = 0
local buttonsInUse = {}
for i, button in ipairs (Details.DeathRecap.Segments) do
for i, button in ipairs(Details.DeathRecap.Segments) do
if (Details.tabela_historico.tabelas [i]) then
button:Show()
tinsert (buttonsInUse, button)
Details.gump:SetFontColor (button.text, "silver")
Details.gump:SetFontColor(button.text, "silver")
last_index = i
else
button:Hide()
@@ -338,18 +338,18 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
for i = 1, #buttonsInUse2 do
local button = buttonsInUse2 [i]
button:ClearAllPoints()
button:SetPoint ("topright", DeathRecapFrame, "topright", (-i * 22) - 10, -5)
button:SetPoint("topright", DeathRecapFrame, "topright", (-i * 22) - 10, -5)
end
if (not segment) then
Details.gump:SetFontColor (Details.DeathRecap.Segments [1].text, "orange")
Details.gump:SetFontColor(Details.DeathRecap.Segments [1].text, "orange")
else
Details.gump:SetFontColor (Details.DeathRecap.Segments [segment].text, "orange")
Details.gump:SetFontColor(Details.DeathRecap.Segments [segment].text, "orange")
death = Details.tabela_historico.tabelas [segment] and Details.tabela_historico.tabelas [segment].last_events_tables
end
else
for i, button in ipairs (Details.DeathRecap.Segments) do
for i, button in ipairs(Details.DeathRecap.Segments) do
button:Hide()
end
end
@@ -407,14 +407,14 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
for i = #events, 1, -1 do
local event = events [i]
local evType = event [1]
if (type (evType) == "boolean" and evType) then
if (type(evType) == "boolean" and evType) then
hitKill = event
break
end
end
if (hitKill) then
local haveHitKill = false
for index, t in ipairs (BiggestDamageHits) do
for index, t in ipairs(BiggestDamageHits) do
if (t == hitKill) then
haveHitKill = true
break
@@ -430,9 +430,9 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
for i = #events, 1, -1 do
local event = events [i]
local evType = event [1]
if (type (evType) == "boolean" and evType) then
if (type(evType) == "boolean" and evType) then
local alreadyHave = false
for index, t in ipairs (BiggestDamageHits) do
for index, t in ipairs(BiggestDamageHits) do
if (t == event) then
alreadyHave = true
break
@@ -470,7 +470,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
local lineIndex = 10
--for i = #events, 1, -1 do
for i, event in ipairs (events) do
for i, event in ipairs(events) do
local event = events [i]
local evType = event [1]
@@ -483,15 +483,15 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
local customSpellInfo = event [11]
if (type (evType) == "boolean" and evType) then
if (type(evType) == "boolean" and evType) then
local line = Details.DeathRecap.Lines [lineIndex]
if (line) then
line.timeAt:SetText (format ("%.1f", eventTime - timeOfDeath) .. "s")
line.spellIcon:SetTexture (spellIcon or customSpellInfo and customSpellInfo [3] or "")
line.timeAt:SetText(format ("%.1f", eventTime - timeOfDeath) .. "s")
line.spellIcon:SetTexture(spellIcon or customSpellInfo and customSpellInfo [3] or "")
line.TopFader:Hide()
--line.spellIcon:SetTexCoord (.1, .9, .1, .9)
--line.sourceName:SetText ("|cFFC6B0D9" .. source .. "|r")
--line.sourceName:SetText("|cFFC6B0D9" .. source .. "|r")
--parse source and cut the length of the string after setting the spellname and source
local sourceClass = Details:GetClass (source)
@@ -517,12 +517,12 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
end
end
--> remove real name or owner name
--remove real name or owner name
source = Details:GetOnlyName (source)
--> remove owner name
--remove owner name
source = source:gsub ((" <.*"), "")
--> if a player?
--if a player?
if (Details.player_class [sourceClass]) then
source = Details:AddClassOrSpecIcon (source, sourceClass, sourceSpec, 16, true)
@@ -531,7 +531,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
end
--> remove the dot signal from the spell name
--remove the dot signal from the spell name
if (not spellName) then
spellName = customSpellInfo and customSpellInfo [2] or "*?*"
if (spellName:find (STRING_ENVIRONMENTAL_DAMAGE_FALLING)) then
@@ -541,7 +541,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
else
source = "Gravity"
end
--/run for a,b in pairs (_G) do if (type (b)=="string" and b:find ("Falling")) then print (a,b) end end
--/run for a,b in pairs (_G) do if (type(b)=="string" and b:find ("Falling")) then print (a,b) end end
end
end
@@ -549,18 +549,18 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
spellName = spellName:gsub ("[*] ", "")
source = source or ""
line.sourceName:SetText (spellName .. " (" .. "|cFFC6B0D9" .. source .. "|r" .. ")")
line.sourceName:SetText(spellName .. " (" .. "|cFFC6B0D9" .. source .. "|r" .. ")")
DetailsFramework:TruncateText (line.sourceName, 185)
if (amount > 1000) then
--line.amount:SetText ("-" .. Details:ToK (amount))
line.amount:SetText ("-" .. Details:comma_value(floor(amount)))
--line.amount:SetText("-" .. Details:ToK (amount))
line.amount:SetText("-" .. Details:comma_value(floor(amount)))
else
--line.amount:SetText ("-" .. floor (amount))
line.amount:SetText ("-" .. floor (amount))
--line.amount:SetText("-" .. floor (amount))
line.amount:SetText("-" .. floor (amount))
end
line.lifePercent:SetText (hp .. "%")
line.lifePercent:SetText(hp .. "%")
line.lifeStatusBar:SetWidth(line:GetWidth() * (hp/100))
line.spellid = event [2]
@@ -569,12 +569,12 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
if (Details.death_recap.show_life_percent) then
line.lifePercent:Show()
line.amount:SetPoint ("left", line, "left", 240, 0)
line.lifePercent:SetPoint ("left", line, "left", 320, 0)
line.amount:SetPoint("left", line, "left", 240, 0)
line.lifePercent:SetPoint("left", line, "left", 320, 0)
else
line.lifePercent:Hide()
line.amount:SetPoint ("left", line, "left", 280, 0)
--line.lifePercent:SetPoint ("left", line, "left", 320, 0)
line.amount:SetPoint("left", line, "left", 280, 0)
--line.lifePercent:SetPoint("left", line, "left", 320, 0)
end
end
+136 -136
View File
@@ -11,7 +11,7 @@ local Loc = _G.LibStub("AceLocale-3.0"):GetLocale( "Details" )
--constants
local CONST_USE_PLAYER_EDPS = false
--> Generate damage chart for mythic dungeon runs
--Generate damage chart for mythic dungeon runs
--[=[
The chart table needs to be stored saparated from the combat
@@ -234,7 +234,7 @@ end
function mythicDungeonCharts:OnEndMythicDungeon()
if (mythicDungeonCharts.ChartTable and mythicDungeonCharts.ChartTable.Running) then
--> stop capturinfg
--stop capturinfg
mythicDungeonCharts.ChartTable.Running = false
mythicDungeonCharts.ChartTable.ElapsedTime = time() - mythicDungeonCharts.ChartTable.StartTime
mythicDungeonCharts.ChartTable.EndTime = time()
@@ -243,8 +243,8 @@ function mythicDungeonCharts:OnEndMythicDungeon()
local name, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
mythicDungeonCharts.ChartTable.DungeonName = name
--> check if is inside the dungeon
--> many players just leave the dungeon in order the re-enter and start the run again, the chart window is showing in these cases data to an imcomplete run.
--check if is inside the dungeon
--many players just leave the dungeon in order the re-enter and start the run again, the chart window is showing in these cases data to an imcomplete run.
local isInsideDungeon = IsInInstance()
if (not isInsideDungeon) then
mythicDungeonCharts:Debug ("OnEndMythicDungeon() player wasn't inside the dungeon.")
@@ -253,7 +253,7 @@ function mythicDungeonCharts:OnEndMythicDungeon()
mythicDungeonCharts:Debug ("Dungeon ended successfully, chart data capture stopped, scheduling to open the window.")
--> the run is valid, schedule to open the chart window
--the run is valid, schedule to open the chart window
_detalhes.mythic_plus.delay_to_show_graphic = 5
C_Timer.After (_detalhes.mythic_plus.delay_to_show_graphic or 5, mythicDungeonCharts.ShowReadyPanel)
@@ -285,17 +285,17 @@ function mythicDungeonCharts.ShowReadyPanel()
--create the panel
if (not mythicDungeonCharts.ReadyFrame) then
mythicDungeonCharts.ReadyFrame = CreateFrame ("frame", "DetailsMythicDungeonReadyFrame", UIParent, "BackdropTemplate")
mythicDungeonCharts.ReadyFrame = CreateFrame("frame", "DetailsMythicDungeonReadyFrame", UIParent, "BackdropTemplate")
local f = mythicDungeonCharts.ReadyFrame
f:SetSize (255, 80)
f:SetPoint ("center", UIParent, "center", 300, 0)
f:SetSize(255, 80)
f:SetPoint("center", UIParent, "center", 300, 0)
f:SetFrameStrata ("LOW")
f:EnableMouse (true)
f:SetMovable (true)
f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f:SetBackdropColor (0, 0, 0, 0.9)
f:SetBackdropBorderColor (0, 0, 0, 1)
f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f:SetBackdropColor(0, 0, 0, 0.9)
f:SetBackdropBorderColor(0, 0, 0, 1)
DetailsFramework:ApplyStandardBackdrop (f)
DetailsFramework:CreateTitleBar (f, "Details! Damage Graphic for M+")
@@ -311,12 +311,12 @@ function mythicDungeonCharts.ShowReadyPanel()
--show button
f.ShowButton = DetailsFramework:CreateButton (f, function() mythicDungeonCharts.ShowChart(); f:Hide() end, 80, 20, Loc ["STRING_SLASH_SHOW"])
f.ShowButton:SetTemplate (DetailsFramework:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
f.ShowButton:SetPoint ("topright", f, "topright", -5, -30)
f.ShowButton:SetPoint("topright", f, "topright", -5, -30)
--discart button
f.DiscartButton = DetailsFramework:CreateButton (f, function() f:Hide() end, 80, 20, Loc ["STRING_DISCARD"])
f.DiscartButton:SetTemplate (DetailsFramework:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
f.DiscartButton:SetPoint ("right", f.ShowButton, "left", -5, 0)
f.DiscartButton:SetPoint("right", f.ShowButton, "left", -5, 0)
--disable feature check box (dont show this again)
local on_switch_enable = function(self, _, value)
@@ -324,8 +324,8 @@ function mythicDungeonCharts.ShowReadyPanel()
end
local notAgainSwitch, notAgainLabel = DetailsFramework:CreateSwitch (f, on_switch_enable, not _detalhes.mythic_plus.show_damage_graphic, _, _, _, _, _, _, _, _, _, Loc ["STRING_MINITUTORIAL_BOOKMARK4"], DetailsFramework:GetTemplate ("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"), "GameFontHighlightLeft")
notAgainSwitch:ClearAllPoints()
notAgainLabel:SetPoint ("left", notAgainSwitch, "right", 2, 0)
notAgainSwitch:SetPoint ("bottomleft", f, "bottomleft", 5, 5)
notAgainLabel:SetPoint("left", notAgainSwitch, "right", 2, 0)
notAgainSwitch:SetPoint("bottomleft", f, "bottomleft", 5, 5)
notAgainSwitch:SetAsCheckBox()
end
@@ -336,62 +336,62 @@ function mythicDungeonCharts.ShowChart()
if (not mythicDungeonCharts.Frame) then
mythicDungeonCharts.Frame = CreateFrame ("frame", "DetailsMythicDungeonChartFrame", UIParent, "BackdropTemplate")
mythicDungeonCharts.Frame = CreateFrame("frame", "DetailsMythicDungeonChartFrame", UIParent, "BackdropTemplate")
local f = mythicDungeonCharts.Frame
f:SetSize (1200, 620)
f:SetPoint ("center", UIParent, "center", 0, 0)
f:SetSize(1200, 620)
f:SetPoint("center", UIParent, "center", 0, 0)
f:SetFrameStrata ("LOW")
f:EnableMouse (true)
f:SetMovable (true)
f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f:SetBackdropColor (0, 0, 0, 0.9)
f:SetBackdropBorderColor (0, 0, 0, 1)
f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f:SetBackdropColor(0, 0, 0, 0.9)
f:SetBackdropBorderColor(0, 0, 0, 1)
--minimized frame
mythicDungeonCharts.FrameMinimized = CreateFrame ("frame", "DetailsMythicDungeonChartFrameminimized", UIParent, "BackdropTemplate")
mythicDungeonCharts.FrameMinimized = CreateFrame("frame", "DetailsMythicDungeonChartFrameminimized", UIParent, "BackdropTemplate")
local fMinimized = mythicDungeonCharts.FrameMinimized
fMinimized:SetSize (160, 24)
fMinimized:SetPoint ("center", UIParent, "center", 0, 0)
fMinimized:SetSize(160, 24)
fMinimized:SetPoint("center", UIParent, "center", 0, 0)
fMinimized:SetFrameStrata ("LOW")
fMinimized:EnableMouse (true)
fMinimized:SetMovable (true)
fMinimized:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
fMinimized:SetBackdropColor (0, 0, 0, 0.9)
fMinimized:SetBackdropBorderColor (0, 0, 0, 1)
fMinimized:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
fMinimized:SetBackdropColor(0, 0, 0, 0.9)
fMinimized:SetBackdropBorderColor(0, 0, 0, 1)
fMinimized:Hide()
f.IsMinimized = false
--titlebar
local titlebar = CreateFrame ("frame", nil, f, "BackdropTemplate")
titlebar:SetPoint ("topleft", f, "topleft", 2, -3)
titlebar:SetPoint ("topright", f, "topright", -2, -3)
titlebar:SetHeight (20)
titlebar:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
titlebar:SetBackdropColor (.5, .5, .5, 1)
titlebar:SetBackdropBorderColor (0, 0, 0, 1)
local titlebar = CreateFrame("frame", nil, f, "BackdropTemplate")
titlebar:SetPoint("topleft", f, "topleft", 2, -3)
titlebar:SetPoint("topright", f, "topright", -2, -3)
titlebar:SetHeight(20)
titlebar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
titlebar:SetBackdropColor(.5, .5, .5, 1)
titlebar:SetBackdropBorderColor(0, 0, 0, 1)
--> title
local titleLabel = _detalhes.gump:NewLabel (titlebar, titlebar, nil, "titulo", "Plugins", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
titleLabel:SetPoint ("center", titlebar , "center")
titleLabel:SetPoint ("top", titlebar , "top", 0, -5)
--title
local titleLabel = _detalhes.gump:NewLabel(titlebar, titlebar, nil, "titulo", "Plugins", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
titleLabel:SetPoint("center", titlebar , "center")
titleLabel:SetPoint("top", titlebar , "top", 0, -5)
f.TitleText = titleLabel
--titlebar when minimized
local titlebarMinimized = CreateFrame ("frame", nil, fMinimized, "BackdropTemplate")
titlebarMinimized:SetPoint ("topleft", fMinimized, "topleft", 2, -3)
titlebarMinimized:SetPoint ("topright", fMinimized, "topright", -2, -3)
titlebarMinimized:SetHeight (20)
titlebarMinimized:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
titlebarMinimized:SetBackdropColor (.5, .5, .5, 1)
titlebarMinimized:SetBackdropBorderColor (0, 0, 0, 1)
local titlebarMinimized = CreateFrame("frame", nil, fMinimized, "BackdropTemplate")
titlebarMinimized:SetPoint("topleft", fMinimized, "topleft", 2, -3)
titlebarMinimized:SetPoint("topright", fMinimized, "topright", -2, -3)
titlebarMinimized:SetHeight(20)
titlebarMinimized:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
titlebarMinimized:SetBackdropColor(.5, .5, .5, 1)
titlebarMinimized:SetBackdropBorderColor(0, 0, 0, 1)
--> title
local titleLabelMinimized = _detalhes.gump:NewLabel (titlebarMinimized, titlebarMinimized, nil, "titulo", "Dungeon Run Chart", "GameFontHighlightLeft", 10, {227/255, 186/255, 4/255})
titleLabelMinimized:SetPoint ("left", titlebarMinimized , "left", 4, 0)
--titleLabelMinimized:SetPoint ("top", titlebarMinimized , "top", 0, -5)
--title
local titleLabelMinimized = _detalhes.gump:NewLabel(titlebarMinimized, titlebarMinimized, nil, "titulo", "Dungeon Run Chart", "GameFontHighlightLeft", 10, {227/255, 186/255, 4/255})
titleLabelMinimized:SetPoint("left", titlebarMinimized , "left", 4, 0)
--titleLabelMinimized:SetPoint("top", titlebarMinimized , "top", 0, -5)
f.TitleTextMinimized = titleLabelMinimized
_detalhes:FormatBackground (f)
@@ -412,7 +412,7 @@ function mythicDungeonCharts.ShowChart()
LibWindow.SavePosition (fMinimized)
f.ChartFrame = Details:GetFramework():CreateChartPanel (f, 1200, 600, "DetailsMythicDungeonChartGraphicFrame")
f.ChartFrame:SetPoint ("topleft", f, "topleft", 5, -20)
f.ChartFrame:SetPoint("topleft", f, "topleft", 5, -20)
f.ChartFrame.FrameInUse = {}
f.ChartFrame.FrameFree = {}
@@ -424,29 +424,29 @@ function mythicDungeonCharts.ShowChart()
f.ChartFrame.Graphic.DrawLine = mythicDungeonCharts.CustomDrawLine
f.ChartFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f.ChartFrame:SetBackdropColor (0, 0, 0, 0.0)
f.ChartFrame:SetBackdropBorderColor (0, 0, 0, 0)
f.ChartFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f.ChartFrame:SetBackdropColor(0, 0, 0, 0.0)
f.ChartFrame:SetBackdropBorderColor(0, 0, 0, 0)
f.ChartFrame:EnableMouse (false)
f.ChartFrame.CloseButton:Hide()
f.BossWidgetsFrame = CreateFrame ("frame", "$parentBossFrames", f, "BackdropTemplate")
f.BossWidgetsFrame = CreateFrame("frame", "$parentBossFrames", f, "BackdropTemplate")
f.BossWidgetsFrame:SetFrameLevel (f:GetFrameLevel()+10)
f.BossWidgetsFrame.Widgets = {}
f.BossWidgetsFrame.GraphPin = f.BossWidgetsFrame:CreateTexture (nil, "overlay")
f.BossWidgetsFrame.GraphPin:SetTexture ([[Interface\BUTTONS\UI-RadioButton]])
f.BossWidgetsFrame.GraphPin = f.BossWidgetsFrame:CreateTexture(nil, "overlay")
f.BossWidgetsFrame.GraphPin:SetTexture([[Interface\BUTTONS\UI-RadioButton]])
f.BossWidgetsFrame.GraphPin:SetTexCoord (17/64, 32/64, 0, 1)
f.BossWidgetsFrame.GraphPin:SetSize (16, 16)
f.BossWidgetsFrame.GraphPin:SetSize(16, 16)
f.BossWidgetsFrame.GraphPinGlow = f.BossWidgetsFrame:CreateTexture (nil, "artwork")
f.BossWidgetsFrame.GraphPinGlow:SetTexture ([[Interface\Calendar\EventNotificationGlow]])
f.BossWidgetsFrame.GraphPinGlow = f.BossWidgetsFrame:CreateTexture(nil, "artwork")
f.BossWidgetsFrame.GraphPinGlow:SetTexture([[Interface\Calendar\EventNotificationGlow]])
f.BossWidgetsFrame.GraphPinGlow:SetTexCoord (0, 1, 0, 1)
f.BossWidgetsFrame.GraphPinGlow:SetSize (14, 14)
f.BossWidgetsFrame.GraphPinGlow:SetBlendMode ("ADD")
f.BossWidgetsFrame.GraphPinGlow:SetPoint ("center", f.BossWidgetsFrame.GraphPin, "center", 0, 0)
f.BossWidgetsFrame.GraphPinGlow:SetSize(14, 14)
f.BossWidgetsFrame.GraphPinGlow:SetBlendMode("ADD")
f.BossWidgetsFrame.GraphPinGlow:SetPoint("center", f.BossWidgetsFrame.GraphPin, "center", 0, 0)
f:Hide()
@@ -460,66 +460,66 @@ function mythicDungeonCharts.ShowChart()
end
end
local closeButton = CreateFrame ("button", "$parentCloseButton", f, "UIPanelCloseButton")
local closeButton = CreateFrame("button", "$parentCloseButton", f, "UIPanelCloseButton")
closeButton:GetNormalTexture():SetDesaturated (true)
closeButton:SetWidth (24)
closeButton:SetHeight (24)
closeButton:SetPoint ("topright", f, "topright", 0, -1)
closeButton:SetWidth(24)
closeButton:SetHeight(24)
closeButton:SetPoint("topright", f, "topright", 0, -1)
closeButton:SetFrameLevel (f:GetFrameLevel()+16)
local minimizeButton = CreateFrame ("button", "$parentCloseButton", f, "UIPanelCloseButton")
local minimizeButton = CreateFrame("button", "$parentCloseButton", f, "UIPanelCloseButton")
minimizeButton:GetNormalTexture():SetDesaturated (true)
minimizeButton:SetWidth (24)
minimizeButton:SetHeight (24)
minimizeButton:SetPoint ("right", closeButton, "left", 2, 0)
minimizeButton:SetWidth(24)
minimizeButton:SetHeight(24)
minimizeButton:SetPoint("right", closeButton, "left", 2, 0)
minimizeButton:SetFrameLevel (f:GetFrameLevel()+16)
minimizeButton:SetNormalTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Up]])
minimizeButton:SetPushedTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Down]])
minimizeButton:SetHighlightTexture ([[Interface\BUTTONS\UI-Panel-MinimizeButton-Highlight]])
minimizeButton:SetNormalTexture([[Interface\BUTTONS\UI-Panel-HideButton-Up]])
minimizeButton:SetPushedTexture([[Interface\BUTTONS\UI-Panel-HideButton-Down]])
minimizeButton:SetHighlightTexture([[Interface\BUTTONS\UI-Panel-MinimizeButton-Highlight]])
local closeButtonWhenMinimized = CreateFrame ("button", "$parentCloseButton", fMinimized, "UIPanelCloseButton")
local closeButtonWhenMinimized = CreateFrame("button", "$parentCloseButton", fMinimized, "UIPanelCloseButton")
closeButtonWhenMinimized:GetNormalTexture():SetDesaturated (true)
closeButtonWhenMinimized:SetWidth (24)
closeButtonWhenMinimized:SetHeight (24)
closeButtonWhenMinimized:SetPoint ("topright", fMinimized, "topright", 0, -1)
closeButtonWhenMinimized:SetWidth(24)
closeButtonWhenMinimized:SetHeight(24)
closeButtonWhenMinimized:SetPoint("topright", fMinimized, "topright", 0, -1)
closeButtonWhenMinimized:SetFrameLevel (fMinimized:GetFrameLevel()+16)
local minimizeButtonWhenMinimized = CreateFrame ("button", "$parentCloseButton", fMinimized, "UIPanelCloseButton")
local minimizeButtonWhenMinimized = CreateFrame("button", "$parentCloseButton", fMinimized, "UIPanelCloseButton")
minimizeButtonWhenMinimized:GetNormalTexture():SetDesaturated (true)
minimizeButtonWhenMinimized:SetWidth (24)
minimizeButtonWhenMinimized:SetHeight (24)
minimizeButtonWhenMinimized:SetPoint ("right", closeButtonWhenMinimized, "left", 2, 0)
minimizeButtonWhenMinimized:SetWidth(24)
minimizeButtonWhenMinimized:SetHeight(24)
minimizeButtonWhenMinimized:SetPoint("right", closeButtonWhenMinimized, "left", 2, 0)
minimizeButtonWhenMinimized:SetFrameLevel (fMinimized:GetFrameLevel()+16)
minimizeButtonWhenMinimized:SetNormalTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Up]])
minimizeButtonWhenMinimized:SetPushedTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Down]])
minimizeButtonWhenMinimized:SetHighlightTexture ([[Interface\BUTTONS\UI-Panel-MinimizeButton-Highlight]])
minimizeButtonWhenMinimized:SetNormalTexture([[Interface\BUTTONS\UI-Panel-HideButton-Up]])
minimizeButtonWhenMinimized:SetPushedTexture([[Interface\BUTTONS\UI-Panel-HideButton-Down]])
minimizeButtonWhenMinimized:SetHighlightTexture([[Interface\BUTTONS\UI-Panel-MinimizeButton-Highlight]])
closeButtonWhenMinimized:SetScript ("OnClick", function()
closeButtonWhenMinimized:SetScript("OnClick", function()
f.IsMinimized = false
fMinimized:Hide()
minimizeButtonWhenMinimized:SetNormalTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Up]])
minimizeButtonWhenMinimized:SetPushedTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Down]])
minimizeButtonWhenMinimized:SetNormalTexture([[Interface\BUTTONS\UI-Panel-HideButton-Up]])
minimizeButtonWhenMinimized:SetPushedTexture([[Interface\BUTTONS\UI-Panel-HideButton-Down]])
end)
--> replace the default click function
--replace the default click function
local minimize_func = function(self)
if (f.IsMinimized) then
f.IsMinimized = false
fMinimized:Hide()
f:Show()
minimizeButtonWhenMinimized:SetNormalTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Up]])
minimizeButtonWhenMinimized:SetPushedTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Down]])
minimizeButtonWhenMinimized:SetNormalTexture([[Interface\BUTTONS\UI-Panel-HideButton-Up]])
minimizeButtonWhenMinimized:SetPushedTexture([[Interface\BUTTONS\UI-Panel-HideButton-Down]])
else
f.IsMinimized = true
f:Hide()
fMinimized:Show()
minimizeButtonWhenMinimized:SetNormalTexture ([[Interface\BUTTONS\UI-Panel-CollapseButton-Up]])
minimizeButtonWhenMinimized:SetPushedTexture ([[Interface\BUTTONS\UI-Panel-CollapseButton-Up]])
minimizeButtonWhenMinimized:SetNormalTexture([[Interface\BUTTONS\UI-Panel-CollapseButton-Up]])
minimizeButtonWhenMinimized:SetPushedTexture([[Interface\BUTTONS\UI-Panel-CollapseButton-Up]])
end
end
minimizeButton:SetScript ("OnClick", minimize_func)
minimizeButtonWhenMinimized:SetScript ("OnClick", minimize_func)
minimizeButton:SetScript("OnClick", minimize_func)
minimizeButtonWhenMinimized:SetScript("OnClick", minimize_func)
--enabled box
-- /run _G.DetailsMythicDungeonChartHandler.ShowChart(); DetailsMythicDungeonChartFrame.ShowChartFrame()
@@ -529,53 +529,53 @@ function mythicDungeonCharts.ShowChart()
local enabledSwitch, enabledLabel = Details.gump:CreateSwitch (f, on_switch_enable, _detalhes.mythic_plus.show_damage_graphic, _, _, _, _, _, _, _, _, _, "Enabled", Details.gump:GetTemplate ("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"), "GameFontHighlightLeft")
enabledSwitch:SetAsCheckBox()
enabledSwitch.tooltip = "Show this chart at the end of a mythic dungeon run.\n\nIf disabled, you can reactivate it again at the options panel > streamer settings."
enabledLabel:SetPoint ("right", minimizeButton, "left", -22, 0)
enabledSwitch:SetSize (16, 16)
Details.gump:SetFontColor (enabledLabel, "gray")
enabledLabel:SetPoint("right", minimizeButton, "left", -22, 0)
enabledSwitch:SetSize(16, 16)
Details.gump:SetFontColor(enabledLabel, "gray")
enabledSwitch.checked_texture:SetVertexColor (.75, .75, .75)
local leftDivisorLine = f.BossWidgetsFrame:CreateTexture (nil, "overlay")
leftDivisorLine:SetSize (2, f.ChartFrame.Graphic:GetHeight())
local leftDivisorLine = f.BossWidgetsFrame:CreateTexture(nil, "overlay")
leftDivisorLine:SetSize(2, f.ChartFrame.Graphic:GetHeight())
leftDivisorLine:SetColorTexture (1, 1, 1, 1)
leftDivisorLine:SetPoint ("bottomleft", f.ChartFrame.Graphic.TextFrame, "bottomleft", -2, 0)
leftDivisorLine:SetPoint("bottomleft", f.ChartFrame.Graphic.TextFrame, "bottomleft", -2, 0)
local bottomDivisorLine = f.BossWidgetsFrame:CreateTexture (nil, "overlay")
bottomDivisorLine:SetSize (f.ChartFrame.Graphic:GetWidth(), 2)
local bottomDivisorLine = f.BossWidgetsFrame:CreateTexture(nil, "overlay")
bottomDivisorLine:SetSize(f.ChartFrame.Graphic:GetWidth(), 2)
bottomDivisorLine:SetColorTexture (1, 1, 1, 1)
bottomDivisorLine:SetPoint ("bottomleft", f.ChartFrame.Graphic.TextFrame, "bottomleft", 0, 0)
bottomDivisorLine:SetPoint("bottomleft", f.ChartFrame.Graphic.TextFrame, "bottomleft", 0, 0)
f.ChartFrame.Graphic:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f.ChartFrame.Graphic:SetBackdropColor (.5, .50, .50, 0.8)
f.ChartFrame.Graphic:SetBackdropBorderColor (0, 0, 0, 0.5)
f.ChartFrame.Graphic:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f.ChartFrame.Graphic:SetBackdropColor(.5, .50, .50, 0.8)
f.ChartFrame.Graphic:SetBackdropBorderColor(0, 0, 0, 0.5)
function f.ChartFrame.RefreshBossTimeline (self, bossTable, elapsedTime)
for i, bossTable in ipairs (mythicDungeonCharts.ChartTable.BossDefeated) do
for i, bossTable in ipairs(mythicDungeonCharts.ChartTable.BossDefeated) do
local bossWidget = f.BossWidgetsFrame.Widgets [i]
if (not bossWidget) then
local newBossWidget = CreateFrame ("frame", "$parentBossWidget" .. i, f.BossWidgetsFrame, "BackdropTemplate")
newBossWidget:SetSize (64, 32)
newBossWidget:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
newBossWidget:SetBackdropColor (0, 0, 0, 0.1)
newBossWidget:SetBackdropBorderColor (0, 0, 0, 0)
local newBossWidget = CreateFrame("frame", "$parentBossWidget" .. i, f.BossWidgetsFrame, "BackdropTemplate")
newBossWidget:SetSize(64, 32)
newBossWidget:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
newBossWidget:SetBackdropColor(0, 0, 0, 0.1)
newBossWidget:SetBackdropBorderColor(0, 0, 0, 0)
local bossAvatar = Details:GetFramework():CreateImage (newBossWidget, "", 64, 32, "border")
bossAvatar:SetPoint ("bottomleft", newBossWidget, "bottomleft", 0, 0)
bossAvatar:SetPoint("bottomleft", newBossWidget, "bottomleft", 0, 0)
newBossWidget.AvatarTexture = bossAvatar
local verticalLine = Details:GetFramework():CreateImage (newBossWidget, "", 1, f.ChartFrame.Graphic:GetHeight(), "overlay")
verticalLine:SetColorTexture (1, 1, 1, 0.3)
verticalLine:SetPoint ("bottomleft", newBossWidget, "bottomright", 0, 0)
verticalLine:SetPoint("bottomleft", newBossWidget, "bottomright", 0, 0)
local timeText = Details:GetFramework():CreateLabel (newBossWidget)
timeText:SetPoint ("bottomright", newBossWidget, "bottomright", 0, 0)
local timeText = Details:GetFramework():CreateLabel(newBossWidget)
timeText:SetPoint("bottomright", newBossWidget, "bottomright", 0, 0)
newBossWidget.TimeText = timeText
local timeBackground = Details:GetFramework():CreateImage (newBossWidget, "", 30, 12, "artwork")
timeBackground:SetColorTexture (0, 0, 0, 0.5)
timeBackground:SetPoint ("topleft", timeText, "topleft", -2, 2)
timeBackground:SetPoint ("bottomright", timeText, "bottomright", 2, 0)
timeBackground:SetPoint("topleft", timeText, "topleft", -2, 2)
timeBackground:SetPoint("bottomright", timeText, "bottomright", 2, 0)
f.BossWidgetsFrame.Widgets [i] = newBossWidget
bossWidget = newBossWidget
@@ -585,15 +585,15 @@ function mythicDungeonCharts.ShowChart()
local secondsPerPixel = chartLength / elapsedTime
local xPosition = bossTable[1] * secondsPerPixel
bossWidget:SetPoint ("bottomright", f.ChartFrame.Graphic, "bottomleft", xPosition, 0)
bossWidget:SetPoint("bottomright", f.ChartFrame.Graphic, "bottomleft", xPosition, 0)
bossWidget.TimeText:SetText (Details:GetFramework():IntegerToTimer (bossTable[1]))
bossWidget.TimeText:SetText(Details:GetFramework():IntegerToTimer (bossTable[1]))
if (bossTable[2].bossimage) then
bossWidget.AvatarTexture:SetTexture (bossTable[2].bossimage)
bossWidget.AvatarTexture:SetTexture(bossTable[2].bossimage)
else
local bossAvatar = Details:GetBossPortrait (nil, nil, bossTable[2].name, bossTable[2].ej_instance_id)
bossWidget.AvatarTexture:SetTexture (bossAvatar)
bossWidget.AvatarTexture:SetTexture(bossAvatar)
end
end
end
@@ -673,7 +673,7 @@ function mythicDungeonCharts.ShowChart()
--generate boss time table
local bossTimeTable = {}
for i, bossTable in ipairs (mythicDungeonCharts.ChartTable.BossDefeated) do
for i, bossTable in ipairs(mythicDungeonCharts.ChartTable.BossDefeated) do
local combatTime = bossTable [3] or math.random (10, 30)
tinsert (bossTimeTable, bossTable[1])
@@ -688,7 +688,7 @@ function mythicDungeonCharts.ShowChart()
mythicDungeonCharts.Frame.ChartFrame:SetTitle ("")
Details:GetFramework():SetFontSize (mythicDungeonCharts.Frame.ChartFrame.chart_title, 14)
mythicDungeonCharts.Frame.TitleText:SetText (mythicDungeonCharts.ChartTable.DungeonName and phrase .. mythicDungeonCharts.ChartTable.DungeonName or phrase)
mythicDungeonCharts.Frame.TitleText:SetText(mythicDungeonCharts.ChartTable.DungeonName and phrase .. mythicDungeonCharts.ChartTable.DungeonName or phrase)
mythicDungeonCharts.Frame.ShowChartFrame()
@@ -712,13 +712,13 @@ local PixelFrameOnEnter = function(self)
--multiply the max dps with the percent
dps = mythicDungeonCharts.Frame.ChartFrame.Graphic.max_value * dps
mythicDungeonCharts.Frame.BossWidgetsFrame.GraphPin:SetPoint ("center", self, "center", 0, 0)
mythicDungeonCharts.Frame.BossWidgetsFrame.GraphPin:SetPoint("center", self, "center", 0, 0)
mythicDungeonCharts.Frame.BossWidgetsFrame.GraphPin:Show()
mythicDungeonCharts.Frame.BossWidgetsFrame.GraphPinGlow:Show()
GameCooltip2:Preset (2)
GameCooltip2:SetOption ("FixedWidth", 100)
GameCooltip2:SetOption ("TextSize", 10)
GameCooltip2:SetOption("FixedWidth", 100)
GameCooltip2:SetOption("TextSize", 10)
local onlyName = _detalhes:GetOnlyName (playerName)
GameCooltip2:AddLine (onlyName)
@@ -758,11 +758,11 @@ function mythicDungeonCharts:CustomDrawLine (C, sx, sy, ex, ey, w, color, layer,
local T = tremove(C.GraphLib_Lines) or C:CreateTexture(nil, "ARTWORK")
if linetexture then --> this data series texture
if linetexture then --this data series texture
T:SetTexture(linetexture)
elseif C.CustomLine then --> overall chart texture
elseif C.CustomLine then --overall chart texture
T:SetTexture(C.CustomLine)
else --> no texture assigned, use default
else --no texture assigned, use default
T:SetTexture(TextureDirectory.."line")
end
@@ -829,13 +829,13 @@ function mythicDungeonCharts:CustomDrawLine (C, sx, sy, ex, ey, w, color, layer,
local pixelFrame = tremove (mythicDungeonCharts.Frame.ChartFrame.FrameFree)
if (not pixelFrame) then
local newFrame = CreateFrame ("frame", nil, mythicDungeonCharts.Frame.ChartFrame, "BackdropTemplate")
newFrame:SetSize (1, 1)
local newFrame = CreateFrame("frame", nil, mythicDungeonCharts.Frame.ChartFrame, "BackdropTemplate")
newFrame:SetSize(1, 1)
--newFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 2, tile = true})
--newFrame:SetBackdropColor (0, 0, 0, 1)
newFrame:SetScript ("OnEnter", PixelFrameOnEnter)
newFrame:SetScript ("OnLeave", PixelFrameOnLeave)
--newFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 2, tile = true})
--newFrame:SetBackdropColor(0, 0, 0, 1)
newFrame:SetScript("OnEnter", PixelFrameOnEnter)
newFrame:SetScript("OnLeave", PixelFrameOnLeave)
pixelFrame = newFrame
end
+43 -43
View File
@@ -5,9 +5,9 @@
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
local _
--> Event types:
--Event types:
_detalhes.RegistredEvents = {
--> instances
--instances
["DETAILS_INSTANCE_OPEN"] = {},
["DETAILS_INSTANCE_CLOSE"] = {},
["DETAILS_INSTANCE_SIZECHANGED"] = {},
@@ -20,16 +20,16 @@
["DETAILS_INSTANCE_CHANGEMODE"] = {},
["DETAILS_INSTANCE_NEWROW"] = {},
--> misc
--misc
["DETAILS_OPTIONS_MODIFIED"] = {},
["UNIT_SPEC"] = {},
["UNIT_TALENTS"] = {},
--> data
--data
["DETAILS_DATA_RESET"] = {},
["DETAILS_DATA_SEGMENTREMOVED"] = {},
--> combat
--combat
["COMBAT_ENCOUNTER_START"] = {},
["COMBAT_ENCOUNTER_END"] = {},
["COMBAT_PLAYER_ENTER"] = {},
@@ -48,18 +48,18 @@
["COMBAT_MYTHICDUNGEON_START"] = {},
["COMBAT_MYTHICDUNGEON_END"] = {},
--> area
--area
["ZONE_TYPE_CHANGED"] = {},
--> roster
--roster
["GROUP_ONENTER"] = {},
["GROUP_ONLEAVE"] = {},
--> buffs
--buffs
["BUFF_UPDATE"] = {},
["BUFF_UPDATE_DEBUFFPOWER"] = {},
--> network
--network
["REALM_CHANNEL_ENTER"] = {}, --deprecated (realm channels are disabled)
["REALM_CHANNEL_LEAVE"] = {}, --deprecated
["COMM_EVENT_RECEIVED"] = {}, --added on core 129
@@ -67,7 +67,7 @@
}
local function AlreadyRegistred (_tables, _object)
for index, _this_object in ipairs (_tables) do
for index, _this_object in ipairs(_tables) do
if (_this_object.__eventtable) then
if (_this_object [1] == _object) then
return index
@@ -124,7 +124,7 @@ local common_events = {
}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> register a event
--register a event
function _detalhes:RegisterEvent (object, event, func)
@@ -183,7 +183,7 @@ local common_events = {
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> Unregister a Event
--Unregister a Event
function _detalhes:UnregisterEvent (object, event)
@@ -236,24 +236,24 @@ local common_events = {
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> internal functions
--internal functions
local dispatch_error = function(name, errortext)
_detalhes:Msg ((name or "<no context>"), " |cFFFF9900error|r: ", errortext)
end
--> safe call an external func with payload and without telling who is calling
--safe call an external func with payload and without telling who is calling
function _detalhes:QuickDispatchEvent (func, event, ...)
if (type (func) ~= "function") then
if (type(func) ~= "function") then
return
elseif (type (event) ~= "string") then
elseif (type(event) ~= "string") then
return
end
local okay, errortext = pcall (func, event, ...)
if (not okay) then
--> trigger an error msg
--trigger an error msg
dispatch_error (_, errortext)
return
@@ -262,22 +262,22 @@ local common_events = {
return true
end
--> quick dispatch with context, send the caller object within the payload
--quick dispatch with context, send the caller object within the payload
function _detalhes:QuickDispatchEventWithContext (context, func, event, ...)
if (type (context) ~= "table") then
if (type(context) ~= "table") then
return
elseif (type (func) ~= "function") then
elseif (type(func) ~= "function") then
return
elseif (type (event) ~= "string") then
elseif (type(event) ~= "string") then
return
end
local okay, errortext = pcall (func, context, event, ...)
if (not okay) then
--> attempt to get the context name
--attempt to get the context name
local objectName = context.__name or context._name or context.name or context.Name
--> trigger an error msg
--trigger an error msg
dispatch_error (objectName, errortext)
return
@@ -286,34 +286,34 @@ local common_events = {
return true
end
--> Send Event
function _detalhes:SendEvent (event, object, ...)
--Send Event
function _detalhes:SendEvent(event, object, ...)
--> send event to all registred plugins
--send event to all registred plugins
if (event == "PLUGIN_DISABLED" or event == "PLUGIN_ENABLED") then
return object:OnDetailsEvent (event, ...)
elseif (not object) then
--> iterate among all plugins which registered a function for this event
for _, PluginObject in ipairs (_detalhes.RegistredEvents[event]) do
--iterate among all plugins which registered a function for this event
for _, PluginObject in ipairs(_detalhes.RegistredEvents[event]) do
--> when __eventtable is true, the plugin registered a function or method name to callback
--> if is false, we call OnDetailsEvent method on the plugin
--when __eventtable is true, the plugin registered a function or method name to callback
--if is false, we call OnDetailsEvent method on the plugin
if (PluginObject.__eventtable) then
local pluginTable = PluginObject [1]
--> check if the plugin is enabled
--check if the plugin is enabled
if (pluginTable.Enabled and pluginTable.__enabled) then
--> check if fegistered a function
if (type (PluginObject [2]) == "function") then
--check if fegistered a function
if (type(PluginObject [2]) == "function") then
local func = PluginObject [2]
_detalhes:QuickDispatchEvent (func, event, ...)
--PluginObject [2] (event, ...)
--> if not it must be a method name
--if not it must be a method name
else
local methodName = PluginObject [2]
local func = pluginTable [methodName]
@@ -332,31 +332,31 @@ local common_events = {
end
end
--> plugin notifications (does not send to listeners)
elseif (type (object) == "string" and object == "SEND_TO_ALL") then
--plugin notifications (does not send to listeners)
elseif (type(object) == "string" and object == "SEND_TO_ALL") then
for _, PluginObject in ipairs (_detalhes.RaidTables.Plugins) do
for _, PluginObject in ipairs(_detalhes.RaidTables.Plugins) do
if (PluginObject.__enabled) then
_detalhes:QuickDispatchEventWithContext (PluginObject, PluginObject.OnDetailsEvent, event)
--PluginObject:OnDetailsEvent (event)
end
end
for _, PluginObject in ipairs (_detalhes.SoloTables.Plugins) do
for _, PluginObject in ipairs(_detalhes.SoloTables.Plugins) do
if (PluginObject.__enabled) then
_detalhes:QuickDispatchEventWithContext (PluginObject, PluginObject.OnDetailsEvent, event)
--PluginObject:OnDetailsEvent (event)
end
end
for _, PluginObject in ipairs (_detalhes.ToolBar.Plugins) do
for _, PluginObject in ipairs(_detalhes.ToolBar.Plugins) do
if (PluginObject.__enabled) then
_detalhes:QuickDispatchEventWithContext (PluginObject, PluginObject.OnDetailsEvent, event)
--PluginObject:OnDetailsEvent (event)
end
end
else
--> send the event only for requested plugin
--send the event only for requested plugin
if (object.Enabled and object.__enabled) then
return _detalhes:QuickDispatchEventWithContext (object, object.OnDetailsEvent, event, ...)
--return object:OnDetailsEvent (event, ...)
@@ -365,13 +365,13 @@ local common_events = {
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> special cases
--special cases
function _detalhes:SendOptionsModifiedEvent (instance)
_detalhes.last_options_modified = _detalhes.last_options_modified or (GetTime() - 5)
if (_detalhes.last_options_modified + 0.3 < GetTime()) then
_detalhes:SendEvent ("DETAILS_OPTIONS_MODIFIED", nil, instance)
_detalhes:SendEvent("DETAILS_OPTIONS_MODIFIED", nil, instance)
_detalhes.last_options_modified = GetTime()
if (_detalhes.last_options_modified_schedule) then
_detalhes:CancelTimer (_detalhes.last_options_modified_schedule)
@@ -386,7 +386,7 @@ local common_events = {
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> listeners
--listeners
local listener_meta = setmetatable ({}, _detalhes)
listener_meta.__index = listener_meta
+3 -3
View File
@@ -29,9 +29,9 @@
return false, "Invalid hook type."
end
for _, this_func in ipairs (_detalhes.hooks [hook_type]) do
for _, this_func in ipairs(_detalhes.hooks [hook_type]) do
if (this_func == func) then
--> already installed
--already installed
return
end
end
@@ -50,7 +50,7 @@
return false, "Invalid hook type."
end
for index, this_func in ipairs (_detalhes.hooks [hook_type]) do
for index, this_func in ipairs(_detalhes.hooks [hook_type]) do
if (this_func == func) then
+84 -84
View File
@@ -6,40 +6,40 @@
local _
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> On Details! Load:
--> load default keys into the main object
--On Details! Load:
--load default keys into the main object
function _detalhes:ApplyBasicKeys()
--> we are not in debug mode
--we are not in debug mode
self.debug = false
--> connected to realm channel
--connected to realm channel
self.is_connected = false
--> who is
--who is
self.playername = UnitName ("player")
self.playerserial = UnitGUID ("player")
--> player faction and enemy faction
--player faction and enemy faction
self.faction = UnitFactionGroup ("player")
if (self.faction == PLAYER_FACTION_GROUP[0]) then --> player is horde
self.faction_against = PLAYER_FACTION_GROUP[1] --> ally
if (self.faction == PLAYER_FACTION_GROUP[0]) then --player is horde
self.faction_against = PLAYER_FACTION_GROUP[1] --ally
self.faction_id = 0
elseif (self.faction == PLAYER_FACTION_GROUP[1]) then --> player is alliance
self.faction_against = PLAYER_FACTION_GROUP[0] --> horde
elseif (self.faction == PLAYER_FACTION_GROUP[1]) then --player is alliance
self.faction_against = PLAYER_FACTION_GROUP[0] --horde
self.faction_id = 1
end
self.zone_type = nil
_detalhes.temp_table1 = {}
--> combat
--combat
self.encounter = {}
self.in_combat = false
self.combat_id = 0
--> instances (windows)
--instances (windows)
self.solo = self.solo or nil
self.raid = self.raid or nil
self.opened_windows = 0
@@ -61,9 +61,9 @@ function _detalhes:ApplyBasicKeys()
["unknown"] = {0.5, 0.75, 0.75, 1}
}
--> load default profile keys
--load default profile keys
for key, value in pairs (_detalhes.default_profile) do
if (type (value) == "table") then
if (type(value) == "table") then
local ctable = Details.CopyTable (value)
self [key] = ctable
else
@@ -71,42 +71,42 @@ function _detalhes:ApplyBasicKeys()
end
end
--> end
--end
return true
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> On Details! Load:
--> check if this is a first run, reset, or just load the saved data.
--On Details! Load:
--check if this is a first run, reset, or just load the saved data.
function _detalhes:LoadGlobalAndCharacterData()
--> check and build the default container for character database
--check and build the default container for character database
--> it exists?
--it exists?
if (not _detalhes_database) then
_detalhes_database = Details.CopyTable (_detalhes.default_player_data)
end
--> load saved values
--load saved values
for key, value in pairs (_detalhes.default_player_data) do
--> check if key exists, e.g. a new key was added
--check if key exists, e.g. a new key was added
if (_detalhes_database [key] == nil) then
if (type (value) == "table") then
if (type(value) == "table") then
_detalhes_database [key] = Details.CopyTable (_detalhes.default_player_data [key])
else
_detalhes_database [key] = value
end
elseif (type (_detalhes_database [key]) == "table") then
elseif (type(_detalhes_database [key]) == "table") then
if (type(_detalhes.default_player_data [key]) == "string") then
print("|cFFFFAA00Details!|r error 0x8538, report on discord", key, _detalhes_database [key], _detalhes.default_player_data [key])
end
for key2, value2 in pairs (_detalhes.default_player_data [key]) do
if (_detalhes_database [key] [key2] == nil) then
if (type (value2) == "table") then
if (type(value2) == "table") then
_detalhes_database [key] [key2] = Details.CopyTable (_detalhes.default_player_data [key] [key2])
else
_detalhes_database [key] [key2] = value2
@@ -115,8 +115,8 @@ function _detalhes:LoadGlobalAndCharacterData()
end
end
--> copy the key from saved table to details object
if (type (value) == "table") then
--copy the key from saved table to details object
if (type(value) == "table") then
_detalhes [key] = Details.CopyTable (_detalhes_database [key])
else
_detalhes [key] = _detalhes_database [key]
@@ -124,22 +124,22 @@ function _detalhes:LoadGlobalAndCharacterData()
end
--> check and build the default container for account database
--check and build the default container for account database
if (not _detalhes_global) then
_detalhes_global = Details.CopyTable (_detalhes.default_global_data)
end
for key, value in pairs (_detalhes.default_global_data) do
--> check if key exists
--check if key exists
if (_detalhes_global [key] == nil) then
if (type (value) == "table") then
if (type(value) == "table") then
_detalhes_global [key] = Details.CopyTable (_detalhes.default_global_data [key])
else
_detalhes_global [key] = value
end
elseif (type (_detalhes_global [key]) == "table") then
elseif (type(_detalhes_global [key]) == "table") then
if (type(_detalhes.default_global_data [key]) == "string") then
C_Timer.After(5, function()
@@ -151,10 +151,10 @@ function _detalhes:LoadGlobalAndCharacterData()
_detalhes_global ["always_use_profile_name"] = ""
end
if (type (_detalhes_global [key]) == "table") then
if (type(_detalhes_global [key]) == "table") then
for key2, value2 in pairs (_detalhes.default_global_data [key]) do
if (_detalhes_global [key] [key2] == nil) then
if (type (value2) == "table") then
if (type(value2) == "table") then
_detalhes_global [key] [key2] = Details.CopyTable (_detalhes.default_global_data [key] [key2])
else
_detalhes_global [key] [key2] = value2
@@ -164,8 +164,8 @@ function _detalhes:LoadGlobalAndCharacterData()
end
end
--> copy the key from saved table to details object
if (type (value) == "table") then
--copy the key from saved table to details object
if (type(value) == "table") then
_detalhes [key] = Details.CopyTable (_detalhes_global [key])
else
_detalhes [key] = _detalhes_global [key]
@@ -173,17 +173,17 @@ function _detalhes:LoadGlobalAndCharacterData()
end
--> end
--end
return true
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> On Details! Load:
--> load previous saved combat data
--On Details! Load:
--load previous saved combat data
function _detalhes:LoadCombatTables()
--> if isn't nothing saved, build a new one
--if isn't nothing saved, build a new one
if (not _detalhes_database.tabela_historico) then
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
_detalhes.tabela_overall = _detalhes.combate:NovaTabela()
@@ -192,7 +192,7 @@ function _detalhes:LoadCombatTables()
_detalhes:UpdateContainerCombatentes()
else
--> build basic containers
--build basic containers
-- segments
_detalhes.tabela_historico = _detalhes_database.tabela_historico or _detalhes.historico:NovoHistorico()
-- overall
@@ -205,9 +205,9 @@ function _detalhes:LoadCombatTables()
end
_detalhes:UpdateContainerCombatentes()
--> if the core revision was incremented, reset all combat data
--if the core revision was incremented, reset all combat data
if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < _detalhes.realversion) then
--> details was been hard upgraded
--details was been hard upgraded
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
_detalhes.tabela_overall = _detalhes.combate:NovaTabela()
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
@@ -217,11 +217,11 @@ function _detalhes:LoadCombatTables()
_detalhes_database.tabela_historico = nil
_detalhes_database.tabela_overall = nil
else
--> check integrity
--check integrity
local combat = _detalhes.tabela_historico.tabelas [1]
if (combat) then
if (not combat[1] or not combat[2] or not combat[3] or not combat[4]) then
--> something went wrong in last logon, let's just reset and we are good to go
--something went wrong in last logon, let's just reset and we are good to go
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
_detalhes.tabela_pets = _detalhes.container_pets:NovoContainer()
@@ -239,27 +239,27 @@ function _detalhes:LoadCombatTables()
_detalhes.tabela_overall = _detalhes.combate:NovaTabela()
end
--> re-build all indexes and metatables
--re-build all indexes and metatables
_detalhes:RestauraMetaTables()
--> get last combat table
--get last combat table
local historico_UM = _detalhes.tabela_historico.tabelas[1]
if (historico_UM) then
_detalhes.tabela_vigente = historico_UM --> significa que elas eram a mesma tabela, ento aqui elas se tornam a mesma tabela
_detalhes.tabela_vigente = historico_UM --significa que elas eram a mesma tabela, ento aqui elas se tornam a mesma tabela
else
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
end
--> need refresh for all containers
for _, container in ipairs (_detalhes.tabela_overall) do
--need refresh for all containers
for _, container in ipairs(_detalhes.tabela_overall) do
container.need_refresh = true
end
for _, container in ipairs (_detalhes.tabela_vigente) do
for _, container in ipairs(_detalhes.tabela_vigente) do
container.need_refresh = true
end
--> erase combat data from the database
--erase combat data from the database
_detalhes_database.tabela_vigente = nil
_detalhes_database.tabela_historico = nil
_detalhes_database.tabela_pets = nil
@@ -274,23 +274,23 @@ function _detalhes:LoadCombatTables()
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> On Details! Load:
--> load the saved config on the addon
--On Details! Load:
--load the saved config on the addon
function _detalhes:LoadConfig()
--> plugins data
--plugins data
_detalhes.plugin_database = _detalhes_database.plugin_database or {}
--> startup
--startup
--> set the nicktag cache host
--set the nicktag cache host
_detalhes:NickTagSetCache (_detalhes_database.nick_tag_cache)
--> count data
--count data
_detalhes:CountDataOnLoad()
--> solo e raid plugin
--solo e raid plugin
if (_detalhes_database.SoloTablesSaved) then
if (_detalhes_database.SoloTablesSaved.Mode) then
_detalhes.SoloTables.Mode = _detalhes_database.SoloTablesSaved.Mode
@@ -300,7 +300,7 @@ function _detalhes:LoadConfig()
end
end
--> switch tables
--switch tables
_detalhes.switch.slots = _detalhes_global.switchSaved.slots
_detalhes.switch.table = _detalhes_global.switchSaved.table
@@ -312,46 +312,46 @@ function _detalhes:LoadConfig()
end
end
--> last boss
--last boss
_detalhes.last_encounter = _detalhes_database.last_encounter
--> buffs
--buffs
_detalhes.savedbuffs = _detalhes_database.savedbuffs
_detalhes.Buffs:BuildTables()
--> initialize parser
--initialize parser
_detalhes.capture_current = {}
for captureType, captureValue in pairs (_detalhes.capture_real) do
_detalhes.capture_current [captureType] = captureValue
end
--> row animations
--row animations
_detalhes:SetUseAnimations()
--> initialize spell cache
--initialize spell cache
_detalhes:ClearSpellCache()
--> version first run
--version first run
if (not _detalhes_database.last_version or _detalhes_database.last_version ~= _detalhes.userversion) then
_detalhes.is_version_first_run = true
end
--> profile
--profile
local unitname = UnitName ("player")
--> fix for old versions
if (type (_detalhes.always_use_profile) == "string") then
--fix for old versions
if (type(_detalhes.always_use_profile) == "string") then
_detalhes.always_use_profile = false
_detalhes.always_use_profile_name = ""
end
if (type (_detalhes.always_use_profile_name) ~= "string") then
if (type(_detalhes.always_use_profile_name) ~= "string") then
_detalhes.always_use_profile = false
_detalhes.always_use_profile_name = ""
end
--> check for "always use this profile"
--check for "always use this profile"
if (_detalhes.always_use_profile and not _detalhes.always_use_profile_exception [unitname]) then
local profile_name = _detalhes.always_use_profile_name
if (profile_name and profile_name ~= "" and _detalhes:GetProfile (profile_name)) then
@@ -359,26 +359,26 @@ function _detalhes:LoadConfig()
end
end
--> character first run
--character first run
if (_detalhes_database.active_profile == "") then
_detalhes.character_first_run = true
--> a primeira vez que este character usa profiles, precisa copiar as keys existentes
-- a primeira vez que este character usa profiles, precisa copiar as keys existentes
local current_profile_name = _detalhes:GetCurrentProfileName()
_detalhes:GetProfile (current_profile_name, true)
_detalhes:SaveProfileSpecial()
end
--> load profile and active instances
--load profile and active instances
local current_profile_name = _detalhes:GetCurrentProfileName()
--> check if exists, if not, create one
--check if exists, if not, create one
local profile = _detalhes:GetProfile (current_profile_name, true)
--> instances
--instances
_detalhes.tabela_instancias = _detalhes_database.tabela_instancias or {}
--> fix for version 1.21.0
if (#_detalhes.tabela_instancias > 0) then --> only happens once after the character logon
for index, saved_skin in ipairs (profile.instances) do
--fix for version 1.21.0
if (#_detalhes.tabela_instancias > 0) then --only happens once after the character logon
for index, saved_skin in ipairs(profile.instances) do
local instance = _detalhes.tabela_instancias [index]
if (instance) then
saved_skin.__was_opened = instance.ativa
@@ -390,7 +390,7 @@ function _detalhes:LoadConfig()
for key, value in pairs (instance) do
if (_detalhes.instance_defaults [key] ~= nil) then
if (type (value) == "table") then
if (type(value) == "table") then
saved_skin [key] = Details.CopyTable (value)
else
saved_skin [key] = value
@@ -424,26 +424,26 @@ function _detalhes:LoadConfig()
_detalhes.tabela_instancias = {}
end
--> apply the profile
--apply the profile
_detalhes:ApplyProfile (current_profile_name, true)
--> custom
--custom
_detalhes.custom = _detalhes_global.custom
_detalhes.refresh:r_atributo_custom()
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> On Details! Load:
--> count logons, tutorials, etc
--On Details! Load:
--count logons, tutorials, etc
function _detalhes:CountDataOnLoad()
--> basic
--basic
if (not _detalhes_global.got_first_run) then
_detalhes.is_first_run = true
end
--> tutorial
--tutorial
self.tutorial = self.tutorial or {}
self.tutorial.logons = self.tutorial.logons or 0
+104 -104
View File
@@ -14,7 +14,7 @@ Details.MythicPlus = {
}
-- ~mythic ~dungeon
local DetailsMythicPlusFrame = _G.CreateFrame ("frame", "DetailsMythicPlusFrame", UIParent)
local DetailsMythicPlusFrame = _G.CreateFrame("frame", "DetailsMythicPlusFrame", UIParent)
DetailsMythicPlusFrame.DevelopmentDebug = false
--disabling the mythic+ feature if the user is playing in wow classic
@@ -49,10 +49,10 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd()
print ("Details!", "MergeSegmentsOnEnd() > starting to merge mythic segments.", "InCombatLockdown():", InCombatLockdown())
end
--> create a new combat to be the overall for the mythic run
--create a new combat to be the overall for the mythic run
Details:EntrarEmCombate()
--> get the current combat just created and the table with all past segments
--get the current combat just created and the table with all past segments
local newCombat = Details:GetCurrentCombat()
local segmentHistory = Details:GetCombatSegments()
@@ -61,8 +61,8 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd()
local lastSegment
local totalSegments = 0
--> add all boss segments from this run to this new segment
for i = 1, 25 do --> from the newer combat to the oldest
--add all boss segments from this run to this new segment
for i = 1, 25 do --from the newer combat to the oldest
local pastCombat = segmentHistory [i]
if (pastCombat and pastCombat.is_mythic_dungeon_run_id == Details.mythic_dungeon_id) then
local canAddThisSegment = true
@@ -90,7 +90,7 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd()
end
end
--> get the date where the first segment started
--get the date where the first segment started
if (lastSegment) then
startDate = lastSegment:GetDate()
end
@@ -101,7 +101,7 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd()
local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
--> tag the segment as mythic overall segment
--tag the segment as mythic overall segment
newCombat.is_mythic_dungeon = {
StartedAt = Details.MythicPlus.StartedAt, --the start of the run
EndedAt = Details.MythicPlus.EndedAt, --the end of the run
@@ -119,20 +119,20 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd()
newCombat.is_mythic_dungeon_segment = true
newCombat.is_mythic_dungeon_run_id = Details.mythic_dungeon_id
--> set the segment time and date
--set the segment time and date
newCombat:SetStartTime (GetTime() - totalTime)
newCombat:SetEndTime (GetTime())
newCombat:SetDate (startDate, endDate)
--> immediatly finishes the segment just started
--immediatly finishes the segment just started
Details:SairDoCombate()
--> update all windows
--update all windows
Details:InstanciaCallFunction(Details.FadeHandler.Fader, "IN", nil, "barras")
Details:InstanciaCallFunction(Details.AtualizaSegmentos)
Details:InstanciaCallFunction(Details.AtualizaSoloMode_AfertReset)
Details:InstanciaCallFunction(Details.ResetaGump)
Details:RefreshMainWindow (-1, true)
Details:RefreshMainWindow(-1, true)
if (DetailsMythicPlusFrame.DevelopmentDebug) then
print ("Details!", "MergeSegmentsOnEnd() > finished merging segments.")
@@ -149,7 +149,7 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd()
end
end
--> after each boss fight, if enalbed on settings, create an extra segment with all trash segments from the boss just killed
--after each boss fight, if enalbed on settings, create an extra segment with all trash segments from the boss just killed
function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule)
if (DetailsMythicPlusFrame.DevelopmentDebug) then
print ("Details!", "MergeTrashCleanup() > running", DetailsMythicPlusFrame.TrashMergeScheduled and #DetailsMythicPlusFrame.TrashMergeScheduled)
@@ -157,26 +157,26 @@ function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule)
local segmentsToMerge = DetailsMythicPlusFrame.TrashMergeScheduled
--> table exists and there's at least one segment
--table exists and there's at least one segment
if (segmentsToMerge and segmentsToMerge[1]) then
--the first segment is the segment where all other trash segments will be added
local masterSegment = segmentsToMerge[1]
masterSegment.is_mythic_dungeon_trash = nil
--> get the current combat just created and the table with all past segments
--get the current combat just created and the table with all past segments
local newCombat = masterSegment
local totalTime = newCombat:GetCombatTime()
local startDate, endDate = "", ""
local lastSegment
--> add segments
--add segments
for i = 2, #segmentsToMerge do --segment #1 is the host
local pastCombat = segmentsToMerge[i]
newCombat = newCombat + pastCombat
totalTime = totalTime + pastCombat:GetCombatTime()
--> tag this combat as already added to a boss trash overall
--tag this combat as already added to a boss trash overall
pastCombat._trashoverallalreadyadded = true
if (endDate == "") then
@@ -186,14 +186,14 @@ function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule)
lastSegment = pastCombat
end
--> get the date where the first segment started
--get the date where the first segment started
if (lastSegment) then
startDate = lastSegment:GetDate()
end
local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
--> tag the segment as mythic overall segment
--tag the segment as mythic overall segment
newCombat.is_mythic_dungeon = {
StartedAt = segmentsToMerge.PreviousBossKilledAt, --start of the mythic run or when the previous boss got killed
EndedAt = segmentsToMerge.LastBossKilledAt, --the time() when encounter_end got triggered
@@ -211,17 +211,17 @@ function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule)
newCombat.is_mythic_dungeon_segment = true
newCombat.is_mythic_dungeon_run_id = Details.mythic_dungeon_id
--> set the segment time / using a sum of combat times, this combat time is reliable
--set the segment time / using a sum of combat times, this combat time is reliable
newCombat:SetStartTime (GetTime() - totalTime)
newCombat:SetEndTime (GetTime())
--> set the segment date
--set the segment date
newCombat:SetDate (startDate, endDate)
if (DetailsMythicPlusFrame.DevelopmentDebug) then
print ("Details!", "MergeTrashCleanup() > finished merging trash segments.", _detalhes.tabela_vigente, _detalhes.tabela_vigente.is_boss)
end
--> should delete the trash segments after the merge?
--should delete the trash segments after the merge?
if (_detalhes.mythic_plus.delete_trash_after_merge) then
local segmentHistory = Details:GetCombatSegments()
for i = #segmentHistory, 1, -1 do
@@ -235,31 +235,31 @@ function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule)
tremove (segmentsToMerge, i)
end
Details:SendEvent ("DETAILS_DATA_SEGMENTREMOVED")
Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED")
else
--> clear the segments to merge table
--clear the segments to merge table
for i = #segmentsToMerge, 1, -1 do
tremove (segmentsToMerge, i)
--> notify plugins about a segment deleted
Details:SendEvent ("DETAILS_DATA_SEGMENTREMOVED")
--notify plugins about a segment deleted
Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED")
end
--> clear encounter name and id
--clear encounter name and id
segmentsToMerge.EncounterID = nil
segmentsToMerge.EncounterName = nil
end
--> update all windows
--update all windows
Details:InstanciaCallFunction (Details.FadeHandler.Fader, "IN", nil, "barras")
Details:InstanciaCallFunction (Details.AtualizaSegmentos)
Details:InstanciaCallFunction (Details.AtualizaSoloMode_AfertReset)
Details:InstanciaCallFunction (Details.ResetaGump)
Details:RefreshMainWindow (-1, true)
Details:RefreshMainWindow(-1, true)
end
end
--> this function merges trash segments after all bosses of the mythic dungeon are defeated
--> happens when the group finishes all bosses but don't complete the trash requirement
--this function merges trash segments after all bosses of the mythic dungeon are defeated
--happens when the group finishes all bosses but don't complete the trash requirement
function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone()
if (DetailsMythicPlusFrame.DevelopmentDebug) then
print ("Details!", "MergeRemainingTrashAfterAllBossesDone() > running, #segments: ", #DetailsMythicPlusFrame.TrashMergeScheduled2, "trash overall table:", DetailsMythicPlusFrame.TrashMergeScheduled2_OverallCombat)
@@ -268,20 +268,20 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone()
local segmentsToMerge = DetailsMythicPlusFrame.TrashMergeScheduled2
local overallCombat = DetailsMythicPlusFrame.TrashMergeScheduled2_OverallCombat
--> needs to merge, add the total combat time, set the date end to the date of the first segment
--needs to merge, add the total combat time, set the date end to the date of the first segment
local totalTime = 0
local startDate, endDate = "", ""
local lastSegment
--> add segments
for i, pastCombat in ipairs (segmentsToMerge) do
--add segments
for i, pastCombat in ipairs(segmentsToMerge) do
overallCombat = overallCombat + pastCombat
if (DetailsMythicPlusFrame.DevelopmentDebug) then
print ("MergeRemainingTrashAfterAllBossesDone() > segment added")
end
totalTime = totalTime + pastCombat:GetCombatTime()
--> tag this combat as already added to a boss trash overall
--tag this combat as already added to a boss trash overall
pastCombat._trashoverallalreadyadded = true
if (endDate == "") then --get the end date of the first index only
@@ -291,13 +291,13 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone()
lastSegment = pastCombat
end
--> set the segment time / using a sum of combat times, this combat time is reliable
--set the segment time / using a sum of combat times, this combat time is reliable
local startTime = overallCombat:GetStartTime()
overallCombat:SetStartTime (startTime - totalTime)
if (DetailsMythicPlusFrame.DevelopmentDebug) then
print ("MergeRemainingTrashAfterAllBossesDone() > total combat time:", totalTime)
end
--> set the segment date
--set the segment date
local startDate = overallCombat:GetDate()
overallCombat:SetDate (startDate, endDate)
if (DetailsMythicPlusFrame.DevelopmentDebug) then
@@ -314,15 +314,15 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone()
print ("MergeRemainingTrashAfterAllBossesDone() > elapsed time after:", mythicDungeonInfo.EndedAt - mythicDungeonInfo.StartedAt)
end
--> should delete the trash segments after the merge?
--should delete the trash segments after the merge?
if (_detalhes.mythic_plus.delete_trash_after_merge) then
local removedCurrentSegment = false
local segmentHistory = Details:GetCombatSegments()
for _, pastCombat in ipairs (segmentsToMerge) do
for _, pastCombat in ipairs(segmentsToMerge) do
for i = #segmentHistory, 1, -1 do
local segment = segmentHistory [i]
if (segment == pastCombat) then
--> remove the segment
--remove the segment
if (_detalhes.tabela_vigente == segment) then
removedCurrentSegment = true
end
@@ -337,17 +337,17 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone()
end
if (removedCurrentSegment) then
--> find another current segment
--find another current segment
local segmentHistory = Details:GetCombatSegments()
_detalhes.tabela_vigente = segmentHistory [1]
if (not _detalhes.tabela_vigente) then
--> assuming there's no segment from the dungeon run
--assuming there's no segment from the dungeon run
Details:EntrarEmCombate()
Details:SairDoCombate()
end
--> update all windows
--update all windows
Details:InstanciaCallFunction(Details.FadeHandler.Fader, "IN", nil, "barras")
Details:InstanciaCallFunction(Details.AtualizaSegmentos)
Details:InstanciaCallFunction(Details.AtualizaSoloMode_AfertReset)
@@ -355,13 +355,13 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone()
Details:RefreshMainWindow(-1, true)
end
Details:SendEvent ("DETAILS_DATA_SEGMENTREMOVED")
Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED")
else
--> clear the segments to merge table
--clear the segments to merge table
for i = #segmentsToMerge, 1, -1 do
tremove (segmentsToMerge, i)
--> notify plugins about a segment deleted
Details:SendEvent ("DETAILS_DATA_SEGMENTREMOVED")
--notify plugins about a segment deleted
Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED")
end
end
@@ -382,7 +382,7 @@ function DetailsMythicPlusFrame.BossDefeated (this_is_end_end, encounterID, enco
local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
--> add the mythic dungeon info to the combat
--add the mythic dungeon info to the combat
_detalhes.tabela_vigente.is_mythic_dungeon = {
StartedAt = Details.MythicPlus.StartedAt, --the start of the run
EndedAt = time(), --when the boss got killed
@@ -397,38 +397,38 @@ function DetailsMythicPlusFrame.BossDefeated (this_is_end_end, encounterID, enco
EJID = Details.MythicPlus.ejID,
}
--> check if need to merge the trash for this boss
--check if need to merge the trash for this boss
if (_detalhes.mythic_plus.merge_boss_trash and not Details.MythicPlus.IsRestoredState) then
--> store on an table all segments which should be merged
--store on an table all segments which should be merged
local segmentsToMerge = DetailsMythicPlusFrame.TrashMergeScheduled or {}
--> table with all past semgnets
--table with all past semgnets
local segmentHistory = Details:GetCombatSegments()
--> iterate among segments
for i = 1, 25 do --> from the newer combat to the oldest
--iterate among segments
for i = 1, 25 do --from the newer combat to the oldest
local pastCombat = segmentHistory [i]
--> does the combat exists
--does the combat exists
if (pastCombat and not pastCombat._trashoverallalreadyadded and pastCombat.is_mythic_dungeon_trash) then
--> is the combat a mythic segment from this run?
--is the combat a mythic segment from this run?
local isMythicSegment, SegmentID = pastCombat:IsMythicDungeon()
if (isMythicSegment and SegmentID == Details.mythic_dungeon_id and not pastCombat.is_boss) then
local mythicDungeonInfo = pastCombat:GetMythicDungeonInfo() -- .is_mythic_dungeon only boss, trash overall and run overall have it
if (not mythicDungeonInfo or not mythicDungeonInfo.TrashOverallSegment) then
--> trash segment found, schedule to merge
--trash segment found, schedule to merge
tinsert (segmentsToMerge, pastCombat)
end
end
end
end
--> add encounter information
--add encounter information
segmentsToMerge.EncounterID = encounterID
segmentsToMerge.EncounterName = encounterName
segmentsToMerge.PreviousBossKilledAt = Details.MythicPlus.PreviousBossKilledAt
--> reduce this boss encounter time from the trash lenght time, since the boss doesn't count towards the time spent cleaning trash
--reduce this boss encounter time from the trash lenght time, since the boss doesn't count towards the time spent cleaning trash
segmentsToMerge.LastBossKilledAt = time() - _detalhes.tabela_vigente:GetCombatTime()
DetailsMythicPlusFrame.TrashMergeScheduled = segmentsToMerge
@@ -448,25 +448,25 @@ function DetailsMythicPlusFrame.BossDefeated (this_is_end_end, encounterID, enco
--end
end
--> close the combat
--close the combat
if (this_is_end_end) then
--> player left the dungeon
--player left the dungeon
if (in_combat and _detalhes.mythic_plus.always_in_combat) then
Details:SairDoCombate()
end
else
--> re-enter in combat if details! is set to always be in combat during mythic plus
--re-enter in combat if details! is set to always be in combat during mythic plus
if (Details.mythic_plus.always_in_combat) then
Details:EntrarEmCombate()
end
--> increase the segment number for the mythic run
--increase the segment number for the mythic run
Details.MythicPlus.SegmentID = Details.MythicPlus.SegmentID + 1
--> register the time when the last boss has been killed (started a clean up for the next trash)
--register the time when the last boss has been killed (started a clean up for the next trash)
Details.MythicPlus.PreviousBossKilledAt = time()
--> update the saved table inside the profile
--update the saved table inside the profile
_detalhes:UpdateState_CurrentMythicDungeonRun (true, Details.MythicPlus.SegmentID, Details.MythicPlus.PreviousBossKilledAt)
end
end
@@ -483,7 +483,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft)
Details:UpdateState_CurrentMythicDungeonRun()
--> at this point, details! should not be in combat, but if something triggered a combat start, just close the combat right away
--at this point, details! should not be in combat, but if something triggered a combat start, just close the combat right away
if (Details.in_combat) then
if (DetailsMythicPlusFrame.DevelopmentDebug) then
print ("Details!", "MythicDungeonFinished() > was in combat, calling SairDoCombate():", InCombatLockdown())
@@ -493,40 +493,40 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft)
local segmentsToMerge = {}
--> check if there is trash segments after the last boss. need to merge these segments with the trash segment of the last boss
--check if there is trash segments after the last boss. need to merge these segments with the trash segment of the last boss
if (_detalhes.mythic_plus.merge_boss_trash and not Details.MythicPlus.IsRestoredState and not fromZoneLeft) then
--> is the current combat not a boss fight?
--> this mean a combat was opened after the last boss of the dungeon was killed
--is the current combat not a boss fight?
--this mean a combat was opened after the last boss of the dungeon was killed
if (not Details.tabela_vigente.is_boss and Details.tabela_vigente:GetCombatTime() > 5) then
if (DetailsMythicPlusFrame.DevelopmentDebug) then
print ("Details!", "MythicDungeonFinished() > the last combat isn't a boss fight, might have trash after bosses done.")
end
--> table with all past semgnets
--table with all past semgnets
local segmentHistory = Details:GetCombatSegments()
for i = 1, #segmentHistory do
local pastCombat = segmentHistory [i]
--> does the combat exists
--does the combat exists
if (pastCombat and not pastCombat._trashoverallalreadyadded and pastCombat:GetCombatTime() > 5) then
--> is the last boss?
--is the last boss?
if (pastCombat.is_boss) then
break
end
--> is the combat a mythic segment from this run?
--is the combat a mythic segment from this run?
local isMythicSegment, SegmentID = pastCombat:IsMythicDungeon()
if (isMythicSegment and SegmentID == Details.mythic_dungeon_id and pastCombat.is_mythic_dungeon_trash) then
--> if have mythic dungeon info, cancel the loop
--if have mythic dungeon info, cancel the loop
local mythicDungeonInfo = pastCombat:GetMythicDungeonInfo()
if (mythicDungeonInfo) then
break
end
--> merge this segment
--merge this segment
tinsert (segmentsToMerge, pastCombat)
if (DetailsMythicPlusFrame.DevelopmentDebug) then
@@ -543,7 +543,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft)
print ("Details!", "MythicDungeonFinished() > found ", #segmentsToMerge, "segments after the last boss")
end
--> find the latest trash overall
--find the latest trash overall
local segmentHistory = Details:GetCombatSegments()
local latestTrashOverall
for i = 1, #segmentHistory do
@@ -555,7 +555,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft)
end
if (latestTrashOverall) then
--> stores the segment table and the trash overall segment to use on the merge
--stores the segment table and the trash overall segment to use on the merge
DetailsMythicPlusFrame.TrashMergeScheduled2 = segmentsToMerge
DetailsMythicPlusFrame.TrashMergeScheduled2_OverallCombat = latestTrashOverall
@@ -575,7 +575,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft)
end
end
--> merge segments
--merge segments
if (_detalhes.mythic_plus.make_overall_when_done and not Details.MythicPlus.IsRestoredState and not fromZoneLeft) then
--if (not InCombatLockdown() and not UnitAffectingCombat ("player")) then
if (DetailsMythicPlusFrame.DevelopmentDebug) then
@@ -592,7 +592,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft)
Details.MythicPlus.IsRestoredState = nil
--> shutdown parser for a few seconds to avoid opening new segments after the run ends
--shutdown parser for a few seconds to avoid opening new segments after the run ends
if (not fromZoneLeft) then
Details:CaptureSet (false, "damage", false, 15)
Details:CaptureSet (false, "energy", false, 15)
@@ -601,7 +601,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft)
Details:CaptureSet (false, "spellcast", false, 15)
end
--> store data
--store data
--[=[
local expansion = tostring (select (4, GetBuildInfo())):match ("%d%d")
if (expansion and type (expansion) == "string" and string.len (expansion) == 2) then
@@ -623,10 +623,10 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft)
end
function DetailsMythicPlusFrame.MythicDungeonStarted()
--> flag as a mythic dungeon
--flag as a mythic dungeon
DetailsMythicPlusFrame.IsDoingMythicDungeon = true
--> this counter is individual for each character
--this counter is individual for each character
Details.mythic_dungeon_id = Details.mythic_dungeon_id + 1
local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo()
@@ -640,11 +640,11 @@ function DetailsMythicPlusFrame.MythicDungeonStarted()
local ejID = DF.EncounterJournal.EJ_GetInstanceForMap (mapID)
--> setup the mythic run info
--setup the mythic run info
Details.MythicPlus.Started = true
Details.MythicPlus.DungeonName = zoneName
Details.MythicPlus.DungeonID = currentZoneID
Details.MythicPlus.StartedAt = time()+9.7 --> there's the countdown timer of 10 seconds
Details.MythicPlus.StartedAt = time()+9.7 --there's the countdown timer of 10 seconds
Details.MythicPlus.EndedAt = nil --reset
Details.MythicPlus.SegmentID = 1
Details.MythicPlus.Level = mythicLevel
@@ -653,7 +653,7 @@ function DetailsMythicPlusFrame.MythicDungeonStarted()
Details:SaveState_CurrentMythicDungeonRun (Details.mythic_dungeon_id, zoneName, currentZoneID, time()+9.7, 1, mythicLevel, ejID, time())
--> start a new combat segment after 10 seconds
--start a new combat segment after 10 seconds
if (_detalhes.mythic_plus.always_in_combat) then
C_Timer.After (9.7, function()
if (DetailsMythicPlusFrame.DevelopmentDebug) then
@@ -666,10 +666,10 @@ function DetailsMythicPlusFrame.MythicDungeonStarted()
local name, groupType, difficultyID, difficult = GetInstanceInfo()
if (groupType == "party" and Details.overall_clear_newchallenge) then
Details.historico:resetar_overall()
Details:Msg ("overall data are now reset.")
Details:Msg("overall data are now reset.")
if (Details.debug) then
Details:Msg ("(debug) timer is for a mythic+ dungeon, overall has been reseted.")
Details:Msg("(debug) timer is for a mythic+ dungeon, overall has been reseted.")
end
end
@@ -680,17 +680,17 @@ function DetailsMythicPlusFrame.MythicDungeonStarted()
end
function DetailsMythicPlusFrame.OnChallengeModeStart()
--> is this a mythic dungeon?
--is this a mythic dungeon?
local _, _, difficulty, _, _, _, _, currentZoneID = GetInstanceInfo()
if (difficulty == 8 and DetailsMythicPlusFrame.LastTimer and DetailsMythicPlusFrame.LastTimer+2 > GetTime()) then
--> start the dungeon on Details!
--start the dungeon on Details!
DetailsMythicPlusFrame.MythicDungeonStarted()
--print("D! mythic dungeon started!")
else
--print("D! mythic dungeon was already started!")
--> from zone changed
--from zone changed
local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo()
local zoneName, _, _, _, _, _, _, currentZoneID = GetInstanceInfo()
@@ -726,7 +726,7 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve
elseif (event == "COMBAT_PLAYER_LEAVE") then
--> ignore the event if ignoring mythic dungeon special treatment
--ignore the event if ignoring mythic dungeon special treatment
if (_detalhes.streamer_config.disable_mythic_dungeon) then
return
end
@@ -737,10 +737,10 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve
if (combatObject.is_boss) then
if (not combatObject.is_boss.killed) then
--> just in case the combat get tagged as boss fight
--just in case the combat get tagged as boss fight
Details.tabela_vigente.is_boss = nil
--> tag the combat as mythic dungeon trash
--tag the combat as mythic dungeon trash
local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
Details.tabela_vigente.is_mythic_dungeon_trash = {
ZoneName = zoneName,
@@ -756,7 +756,7 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve
end
elseif (event == "COMBAT_ENCOUNTER_START") then
--> ignore the event if ignoring mythic dungeon special treatment
--ignore the event if ignoring mythic dungeon special treatment
if (_detalhes.streamer_config.disable_mythic_dungeon) then
return
end
@@ -765,7 +765,7 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve
--nothing
elseif (event == "COMBAT_ENCOUNTER_END") then
--> ignore the event if ignoring mythic dungeon special treatment
--ignore the event if ignoring mythic dungeon special treatment
if (_detalhes.streamer_config.disable_mythic_dungeon) then
return
end
@@ -788,12 +788,12 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve
end
end
--> ignore the event if ignoring mythic dungeon special treatment
--ignore the event if ignoring mythic dungeon special treatment
if (_detalhes.streamer_config.disable_mythic_dungeon) then
return
end
--> reset spec cache if broadcaster requested
--reset spec cache if broadcaster requested
if (_detalhes.streamer_config.reset_spec_cache) then
wipe (_detalhes.cached_specs)
end
@@ -802,19 +802,19 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve
elseif (event == "COMBAT_MYTHICDUNGEON_END") then
--> ignore the event if ignoring mythic dungeon special treatment
--ignore the event if ignoring mythic dungeon special treatment
if (_detalhes.streamer_config.disable_mythic_dungeon) then
return
end
--> delay to wait the encounter_end trigger first
--> assuming here the party cleaned the mobs kill objective before going to kill the last boss
--delay to wait the encounter_end trigger first
--assuming here the party cleaned the mobs kill objective before going to kill the last boss
C_Timer.After (2, DetailsMythicPlusFrame.MythicDungeonFinished)
end
end
DetailsMythicPlusFrame:SetScript ("OnEvent", function(_, event, ...)
DetailsMythicPlusFrame:SetScript("OnEvent", function(_, event, ...)
if (event == "START_TIMER") then
DetailsMythicPlusFrame.LastTimer = GetTime()
@@ -826,7 +826,7 @@ DetailsMythicPlusFrame:SetScript ("OnEvent", function(_, event, ...)
print ("Zone changed and is Doing Mythic Dungeon")
end
--> ignore the event if ignoring mythic dungeon special treatment
--ignore the event if ignoring mythic dungeon special treatment
if (_detalhes.streamer_config.disable_mythic_dungeon) then
return
end
@@ -837,13 +837,13 @@ DetailsMythicPlusFrame:SetScript ("OnEvent", function(_, event, ...)
print ("Zone changed and the zone is different than the dungeon")
end
--> send mythic dungeon end event
_detalhes:SendEvent ("COMBAT_MYTHICDUNGEON_END")
--send mythic dungeon end event
_detalhes:SendEvent("COMBAT_MYTHICDUNGEON_END")
--> finish the segment
--finish the segment
DetailsMythicPlusFrame.BossDefeated (true)
--> finish the mythic run
--finish the mythic run
DetailsMythicPlusFrame.MythicDungeonFinished (true)
end
end
+18 -18
View File
@@ -121,7 +121,7 @@ function Details.packFunctions.PackCombatData(combatObject, flags)
Details.packFunctions.PackUtility(combatObject)
end
--> prepare data to send over network
--prepare data to send over network
local exportedString = flags .. ","
--add the combat info
@@ -572,7 +572,7 @@ function Details.packFunctions.PackDamage(combatObject)
end
--------------------------------------------------------------------------------------------------------------------------------
--> unpack
--unpack
--@currentCombat: details! combat object
--@combatData: array with strings with combat information
@@ -616,7 +616,7 @@ function Details.packFunctions.UnPackDamage(currentCombat, combatData, tablePosi
actorObject.grupo = isActorInGroup(class, actorFlag)
actorObject.flag_original = actorFlag
--> copy back the base damage
--copy back the base damage
actorObject.total = tonumber(combatData[tablePosition+1]) --[2]
actorObject.totalabsorbed = tonumber(combatData[tablePosition+2]) --[3]
actorObject.damage_taken = tonumber(combatData[tablePosition+3]) --[4]
@@ -625,7 +625,7 @@ function Details.packFunctions.UnPackDamage(currentCombat, combatData, tablePosi
tablePosition = tablePosition + 6 --increase table position
--> copy back the actor spells
--copy back the actor spells
--amount of indexes used to store spells for this actor
local spellsSize = tonumber(combatData [tablePosition]) --[7]
if (isDebugging) then
@@ -822,7 +822,7 @@ function Details.packFunctions.PackHeal(combatObject)
end
--------------------------------------------------------------------------------------------------------------------------------
--> unpack
--unpack
function Details.packFunctions.UnPackHeal(currentCombat, combatData, tablePosition)
@@ -864,7 +864,7 @@ function Details.packFunctions.UnPackHeal(currentCombat, combatData, tablePositi
actorObject.grupo = isActorInGroup(class, actorFlag)
actorObject.flag_original = actorFlag
--> copy the base healing
--copy the base healing
actorObject.total = tonumber(combatData[tablePosition+1]) --[2]
actorObject.totalabsorb = tonumber(combatData[tablePosition+2]) --[3]
actorObject.totalover = tonumber(combatData[tablePosition+3]) --[4]
@@ -873,7 +873,7 @@ function Details.packFunctions.UnPackHeal(currentCombat, combatData, tablePositi
tablePosition = tablePosition + 6
--> copy back the actor spells
--copy back the actor spells
--amount of indexes used to store spells for this actor
local spellsSize = tonumber(combatData [tablePosition]) --[7]
if (isDebugging) then
@@ -916,7 +916,7 @@ function Details.packFunctions.UnPackHeal(currentCombat, combatData, tablePositi
end
--------------------------------------------------------------------------------------------------
--> pack utility data
--pack utility data
--pack utility passes the player utility info + pets the player own
--each player will also send an enemy, the enemy will be in order of raidIndex of the player
@@ -1135,7 +1135,7 @@ function Details.packFunctions.PackUtility(combatObject)
--]=]
--> cooldowns, pack player cooldowns used
--cooldowns, pack player cooldowns used
actorUtilityInfo [#actorUtilityInfo + 1] = "C"
local cooldownContainer = actor.cooldowns_defensive_spells and actor.cooldowns_defensive_spells._ActorTable
local totalSpellIndexes = 0
@@ -1171,7 +1171,7 @@ function Details.packFunctions.PackUtility(combatObject)
actorUtilityInfo [#actorUtilityInfo + 1] = 0
end
--> interrupts, pack player interrupts
--interrupts, pack player interrupts
actorUtilityInfo [#actorUtilityInfo + 1] = "I"
local interruptsContainer = actor.interrupt_spells and actor.interrupt_spells._ActorTable
local totalSpellIndexes = 0
@@ -1219,7 +1219,7 @@ function Details.packFunctions.PackUtility(combatObject)
actorUtilityInfo [#actorUtilityInfo + 1] = 0
end
--> cc break, pack player crowd control breaks
--cc break, pack player crowd control breaks
actorUtilityInfo [#actorUtilityInfo + 1] = "B"
local ccBreakContainer = actor.cc_break_spells and actor.cc_break_spells._ActorTable
local totalSpellIndexes = 0
@@ -1267,7 +1267,7 @@ function Details.packFunctions.PackUtility(combatObject)
actorUtilityInfo [#actorUtilityInfo + 1] = 0
end
--> dispel, pack player dispels done
--dispel, pack player dispels done
actorUtilityInfo [#actorUtilityInfo + 1] = "D"
local dispelsContainer = actor.dispell_spells and actor.dispell_spells._ActorTable
local totalSpellIndexes = 0
@@ -1315,7 +1315,7 @@ function Details.packFunctions.PackUtility(combatObject)
actorUtilityInfo [#actorUtilityInfo + 1] = 0
end
--> ress, pack player ress performed
--ress, pack player ress performed
actorUtilityInfo [#actorUtilityInfo + 1] = "R"
local ressContainer = actor.ress_spells and actor.ress_spells._ActorTable
local totalSpellIndexes = 0
@@ -1402,7 +1402,7 @@ function Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePos
--D - dispels
--R - ress
--> copy back the actor cooldowns spells
--copy back the actor cooldowns spells
tablePosition = tablePosition + 1
tablePosition = tablePosition + 1
@@ -1449,7 +1449,7 @@ function Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePos
tablePosition = tablePosition + spellsSize --increase table position
end
--> copy back the actor interrupts spells
--copy back the actor interrupts spells
--tablePosition = tablePosition + 1
local startInterrupt = combatData[tablePosition]
tablePosition = tablePosition + 1
@@ -1506,7 +1506,7 @@ function Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePos
tablePosition = tablePosition + spellsSize --increase table position
end
--> copy back the actor cc break spells
--copy back the actor cc break spells
--tablePosition = tablePosition + 1
local startCCBreak = combatData[tablePosition]
tablePosition = tablePosition + 1
@@ -1564,7 +1564,7 @@ function Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePos
tablePosition = tablePosition + spellsSize --increase table position
end
--> copy back the actor dispel spells
--copy back the actor dispel spells
--tablePosition = tablePosition + 1
tablePosition = tablePosition + 1
@@ -1623,7 +1623,7 @@ function Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePos
--ress
--ress_targets
--ress_spells
--> copy back the actor ress spells
--copy back the actor ress spells
--tablePosition = tablePosition + 1
tablePosition = tablePosition + 1
+28 -28
View File
@@ -4,45 +4,45 @@ local Details = _G.Details
local plater_integration_frame = CreateFrame ("frame", "DetailsPlaterFrame", UIParent, "BackdropTemplate")
local plater_integration_frame = CreateFrame("frame", "DetailsPlaterFrame", UIParent, "BackdropTemplate")
plater_integration_frame.DamageTaken = {}
--> aprox. 6 updates per second
--aprox. 6 updates per second
local CONST_REALTIME_UPDATE_TIME = 0.166
--> how many samples to store, 30 x .166 aprox 5 seconds buffer
--how many samples to store, 30 x .166 aprox 5 seconds buffer
local CONST_BUFFER_SIZE = 30
--> Dps division factor
--Dps division factor
PLATER_DPS_SAMPLE_SIZE = CONST_BUFFER_SIZE * CONST_REALTIME_UPDATE_TIME
--> separate CLEU events from the Tick event for performance
plater_integration_frame.OnTickFrame = CreateFrame ("frame", "DetailsPlaterFrameOnTicker", UIParent, "BackdropTemplate")
--separate CLEU events from the Tick event for performance
plater_integration_frame.OnTickFrame = CreateFrame("frame", "DetailsPlaterFrameOnTicker", UIParent, "BackdropTemplate")
--> on tick function
--on tick function
plater_integration_frame.OnTickFrameFunc = function(self, deltaTime)
if (self.NextUpdate < 0) then
for targetGUID, damageTable in pairs (plater_integration_frame.DamageTaken) do
--> total damage
--total damage
local totalDamage = damageTable.TotalDamageTaken
local totalDamageFromPlayer = damageTable.TotalDamageTakenFromPlayer
--> damage on this update
--damage on this update
local damageOnThisUpdate = totalDamage - damageTable.LastTotalDamageTaken
local damageOnThisUpdateFromPlayer = totalDamageFromPlayer - damageTable.LastTotalDamageTakenFromPlayer
--> update the last damage taken
--update the last damage taken
damageTable.LastTotalDamageTaken = totalDamage
damageTable.LastTotalDamageTakenFromPlayer = totalDamageFromPlayer
--> sum the current damage
--sum the current damage
damageTable.CurrentDamage = damageTable.CurrentDamage + damageOnThisUpdate
damageTable.CurrentDamageFromPlayer = damageTable.CurrentDamageFromPlayer + damageOnThisUpdateFromPlayer
--> add to the buffer the damage added
--add to the buffer the damage added
tinsert (damageTable.RealTimeBuffer, 1, damageOnThisUpdate)
tinsert (damageTable.RealTimeBufferFromPlayer, 1, damageOnThisUpdateFromPlayer)
--> remove the damage from the buffer
--remove the damage from the buffer
local damageRemoved = tremove (damageTable.RealTimeBuffer, CONST_BUFFER_SIZE + 1)
if (damageRemoved) then
damageTable.CurrentDamage = max (damageTable.CurrentDamage - damageRemoved, 0)
@@ -62,7 +62,7 @@ plater_integration_frame.OnTickFrameFunc = function(self, deltaTime)
end
--> parse the damage taken by unit
--parse the damage taken by unit
function plater_integration_frame.AddDamageToGUID (sourceGUID, targetGUID, time, amount)
local damageTable = plater_integration_frame.DamageTaken [targetGUID]
@@ -82,7 +82,7 @@ function plater_integration_frame.AddDamageToGUID (sourceGUID, targetGUID, time,
CurrentDamageFromPlayer = 0,
}
--> is the damage from the player it self?
--is the damage from the player it self?
if (sourceGUID == plater_integration_frame.PlayerGUID) then
plater_integration_frame.DamageTaken [targetGUID].TotalDamageTakenFromPlayer = amount
end
@@ -96,10 +96,10 @@ function plater_integration_frame.AddDamageToGUID (sourceGUID, targetGUID, time,
end
end
plater_integration_frame:SetScript ("OnEvent", function(self)
plater_integration_frame:SetScript("OnEvent", function(self)
local time, token, hidding, sourceGUID, sourceName, sourceFlag, sourceFlag2, targetGUID, targetName, targetFlag, targetFlag2, spellID, spellName, spellType, amount, overKill, school, resisted, blocked, absorbed, isCritical = CombatLogGetCurrentEventInfo()
--> tamage taken by the GUID unit
--tamage taken by the GUID unit
if (token == "SPELL_DAMAGE" or token == "SPELL_PERIODIC_DAMAGE" or token == "RANGE_DAMAGE" or token == "DAMAGE_SHIELD") then
plater_integration_frame.AddDamageToGUID (sourceGUID, targetGUID, time, amount)
@@ -113,25 +113,25 @@ function Details:RefreshPlaterIntegration()
if (Plater and Details.plater.realtime_dps_enabled or Details.plater.realtime_dps_player_enabled or Details.plater.damage_taken_enabled) then
--> wipe the cache
--wipe the cache
wipe (plater_integration_frame.DamageTaken)
--> read cleu events
--read cleu events
plater_integration_frame:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
--> start the real time dps updater
--start the real time dps updater
plater_integration_frame.OnTickFrame.NextUpdate = CONST_REALTIME_UPDATE_TIME
plater_integration_frame.OnTickFrame:SetScript ("OnUpdate", plater_integration_frame.OnTickFrameFunc)
plater_integration_frame.OnTickFrame:SetScript("OnUpdate", plater_integration_frame.OnTickFrameFunc)
--> cache the player serial
--cache the player serial
plater_integration_frame.PlayerGUID = UnitGUID ("player")
--> cancel the timer if already have one
--cancel the timer if already have one
if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer:IsCancelled()) then
plater_integration_frame.CleanUpTimer:Cancel()
end
--> cleanup the old tables
--cleanup the old tables
plater_integration_frame.CleanUpTimer = C_Timer.NewTicker (10, function()
local now = time()
for GUID, damageTable in pairs (plater_integration_frame.DamageTaken) do
@@ -142,13 +142,13 @@ function Details:RefreshPlaterIntegration()
end)
else
--> unregister the cleu
--unregister the cleu
plater_integration_frame:UnregisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
--> stop the real time updater
plater_integration_frame.OnTickFrame:SetScript ("OnUpdate", nil)
--stop the real time updater
plater_integration_frame.OnTickFrame:SetScript("OnUpdate", nil)
--> stop the cleanup process
--stop the cleanup process
if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer:IsCancelled()) then
plater_integration_frame.CleanUpTimer:Cancel()
end
+19 -19
View File
@@ -42,7 +42,7 @@ 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]
@@ -80,9 +80,9 @@ do
if (self.classe) then
c = self.classe
elseif (type (class) == "table" and class.classe) then
elseif (type(class) == "table" and class.classe) then
c = class.classe
elseif (type (class) == "string") then
elseif (type(class) == "string") then
c = class
else
c = "UNKNOW"
@@ -122,10 +122,10 @@ do
if (self.classe) then
return unpack (_detalhes.class_colors [self.classe] or default_color)
elseif (type (class) == "table" and class.classe) then
elseif (type(class) == "table" and class.classe) then
return unpack (_detalhes.class_colors [class.classe] or default_color)
elseif (type (class) == "string") then
elseif (type(class) == "string") then
return unpack (_detalhes.class_colors [class] or default_color)
elseif (self.color) then
@@ -171,7 +171,7 @@ do
return false
end
if (Actor.spells) then --> correcao pros containers misc, precisa pegar os diferentes tipos de containers de l
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
local class = _detalhes.ClassSpellList [spellid]
if (class) 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]
@@ -292,7 +292,7 @@ do
local Actor, container = t[1], t[2]
local SpecSpellList = _detalhes.SpecSpellList
--> get from the spell cast list
--get from the spell cast list
if (_detalhes.tabela_vigente) then
local misc_actor = _detalhes.tabela_vigente (4, Actor.nome)
if (misc_actor and misc_actor.spell_cast) then
@@ -402,7 +402,7 @@ do
--local misc_actor = info.instancia.showing (4, self:name())
--spell_cast
--> get from the spec cache
--get from the spec cache
local spec = _detalhes.cached_specs [Actor.serial]
if (spec) then
Actor.spec = spec
@@ -422,7 +422,7 @@ do
return spec
end
--> get from the spell cast list
--get from the spell cast list
if (_detalhes.tabela_vigente) then
local misc_actor = _detalhes.tabela_vigente (4, Actor.nome)
@@ -452,7 +452,7 @@ do
end
end
else
if (Actor.spells) then --> correcao pros containers misc, precisa pegar os diferentes tipos de containers de l
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
local spec = SpecSpellList [spellid]
if (spec) then
@@ -480,7 +480,7 @@ do
end
else
if (Actor.spells) then --> correcao pros containers misc, precisa pegar os diferentes tipos de containers de l
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
local spec = SpecSpellList [spellid]
if (spec) then
@@ -583,26 +583,26 @@ end
function _detalhes:AddColorString (player_name, class)
--> check if the class colors exists
--check if the class colors exists
local classColors = _G.RAID_CLASS_COLORS
if (classColors) then
local color = classColors [class]
--> check if the player name is valid
if (type (player_name) == "string" and color) then
--check if the player name is valid
if (type(player_name) == "string" and color) then
player_name = "|c" .. color.colorStr .. player_name .. "|r"
return player_name
end
end
--> if failed, return the player name without modifications
--if failed, return the player name without modifications
return player_name
end
function _detalhes:AddRoleIcon (player_name, role, size)
--> check if is a valid role
--check if is a valid role
local roleIcon = _detalhes.role_texcoord [role]
if (type (player_name) == "string" and roleIcon and role ~= "NONE") then
--> add the role icon
if (type(player_name) == "string" and roleIcon and role ~= "NONE") then
--add the role icon
size = size or 14
player_name = "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. size .. ":" .. size .. ":0:0:256:256:" .. roleIcon .. "|t " .. player_name
return player_name
+181 -181
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -1,6 +1,6 @@
--> install data for raiding tiers
--install data for raiding tiers
local C_Timer = _G.C_Timer
local DetailsFramework = _G.DetailsFramework
@@ -9,7 +9,7 @@ local tinsert = _G.tinsert
function Details.InstallRaidInfo()
do
--> data for Sanctum of Domination (Shadowlands tier 1)
--data for Sanctum of Domination (Shadowlands tier 1)
local INSTANCE_EJID = 1193
local INSTANCE_MAPID = 2450
local HDIMAGESPATH = [[Details\images\raid]]
@@ -93,7 +93,7 @@ function Details.InstallRaidInfo()
end
do
--> data for Castle Nathria (Shadowlands tier 1)
--data for Castle Nathria (Shadowlands tier 1)
--F:\World of Warcraft\_retail_\BlizzardInterfaceArt\Interface\GLUES\LOADINGSCREENS\Expansion07\Main\LOADINGSCREEN_NzothRAID
local INSTANCE_EJID = 1190
local INSTANCE_MAPID = 2296
+6 -6
View File
@@ -12,7 +12,7 @@
local _
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> basic functions
--basic functions
_detalhes.current_row_animation = ""
_detalhes.row_animation_pool = {}
@@ -35,7 +35,7 @@
end
function _detalhes:SelectRowAnimation (name)
for key, value in ipairs (_detalhes.row_animation_pool) do
for key, value in ipairs(_detalhes.row_animation_pool) do
if (value.name == name) then
_detalhes.current_row_animation = name
return true
@@ -46,21 +46,21 @@
function _detalhes:GetRowAnimationList()
local t = {}
for key, value in ipairs (_detalhes.row_animation_pool) do
for key, value in ipairs(_detalhes.row_animation_pool) do
tinsert (t, value.name)
end
return t
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> install default animations
--install default animations
do
local fade_func = function(row, state)
if (state) then
Details.FadeHandler.Fader (row, "out")
Details.FadeHandler.Fader(row, "out")
else
Details.FadeHandler.Fader (row, "in")
Details.FadeHandler.Fader(row, "in")
end
end
local fade_desc = "Default animation, makes the bar fade in or fade out when showing or hiding in the window"
+21 -21
View File
@@ -5,15 +5,15 @@ local _detalhes = _G._detalhes
function _detalhes:WipeConfig()
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
local b = CreateFrame ("button", "DetailsResetConfigButton", UIParent)
local b = CreateFrame("button", "DetailsResetConfigButton", UIParent)
tinsert (UISpecialFrames, "DetailsResetConfigButton")
DetailsFramework:ApplyStandardBackdrop(b)
b:SetSize (250, 40)
b:SetText (Loc ["STRING_SLASH_WIPECONFIG_CONFIRM"])
b:SetScript ("OnClick", function() _detalhes.wipe_full_config = true; ReloadUI(); end)
b:SetPoint ("center", UIParent, "center", 0, 0)
b:SetSize(250, 40)
b:SetText(Loc ["STRING_SLASH_WIPECONFIG_CONFIRM"])
b:SetScript("OnClick", function() _detalhes.wipe_full_config = true; ReloadUI(); end)
b:SetPoint("center", UIParent, "center", 0, 0)
end
local is_exception = {
@@ -23,13 +23,13 @@ local is_exception = {
function _detalhes:SaveLocalInstanceConfig()
for index, instance in _detalhes:ListInstances() do
--> check for the max size toggle, don't save it
--check for the max size toggle, don't save it
if (instance.is_in_max_size) then
instance.is_in_max_size = false
instance:SetSize (instance.original_width, instance.original_height)
instance:SetSize(instance.original_width, instance.original_height)
end
--> save local instance data
--save local instance data
local a1, a2 = instance:GetDisplay()
local t = {
@@ -71,10 +71,10 @@ end
function _detalhes:SaveConfig()
--> save instance configs localy
--save instance configs localy
_detalhes:SaveLocalInstanceConfig()
--> cleanup
--cleanup
_detalhes:PrepareTablesForSave()
@@ -87,33 +87,33 @@ function _detalhes:SaveConfig()
local name, ttype, difficulty, difficultyName, maxPlayers, playerDifficulty, isDynamicInstance, mapID, instanceGroupSize = GetInstanceInfo()
if (ttype == "party" or ttype == "raid") then
--> salvar container de pet
--salvar container de pet
_detalhes_database.tabela_pets = _detalhes.tabela_pets.pets
end
xpcall (_detalhes.TimeDataCleanUpTemporary, _detalhes.saver_error_func)
--> buffs
--buffs
xpcall (_detalhes.Buffs.SaveBuffs, _detalhes.saver_error_func)
--> date
--date
_detalhes.last_day = date ("%d")
--> salva o container do personagem
--salva o container do personagem
for key, value in pairs (_detalhes.default_player_data) do
if (not is_exception [key]) then
_detalhes_database [key] = _detalhes [key]
end
end
--> salva o container das globais
--salva o container das globais
for key, value in pairs (_detalhes.default_global_data) do
if (key ~= "__profiles") then
_detalhes_global [key] = _detalhes [key]
end
end
--> solo e raid mode
--solo e raid mode
if (_detalhes.SoloTables.Mode) then
_detalhes_database.SoloTablesSaved = {}
_detalhes_database.SoloTablesSaved.Mode = _detalhes.SoloTables.Mode
@@ -124,16 +124,16 @@ function _detalhes:SaveConfig()
_detalhes_database.RaidTablesSaved = nil
--> salva switch tables
--salva switch tables
_detalhes_global.switchSaved.slots = _detalhes.switch.slots
_detalhes_global.switchSaved.table = _detalhes.switch.table
--> last boss
--last boss
_detalhes_database.last_encounter = _detalhes.last_encounter
--> last versions
_detalhes_database.last_realversion = _detalhes.realversion --> core number
_detalhes_database.last_version = _detalhes.userversion --> version
--last versions
_detalhes_database.last_realversion = _detalhes.realversion --core number
_detalhes_database.last_version = _detalhes.userversion --version
_detalhes_global.got_first_run = true
end
+16 -16
View File
@@ -3,7 +3,7 @@ local _detalhes = _G._detalhes
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
local _
--> install skin function:
--install skin function:
function _detalhes:InstallSkin (skin_name, skin_table)
if (not skin_name) then
return false
@@ -71,7 +71,7 @@ local _
_detalhes:DelayOptionsRefresh()
end
--> install wow interface skin:
--install wow interface skin:
_detalhes:InstallSkin ("WoW Interface", {
file = [[Interface\AddOns\Details\images\skins\default_skin.blp]],
author = "Details!",
@@ -294,7 +294,7 @@ local _
instance:AttributeMenu (nil, nil, 4)
if (_detalhes.options_group_edit) then
for _, this_instance in ipairs (instance:GetInstanceGroup()) do
for _, this_instance in ipairs(instance:GetInstanceGroup()) do
if (this_instance ~= instance) then
this_instance:ToolbarMenuSetButtonsOptions (nil, true)
this_instance:AttributeMenu (nil, nil, nil, nil, nil, nil, nil, true)
@@ -382,7 +382,7 @@ local _
["text_face"] = "Accidental Presidency",
["anchor"] = {
1.4, -- [1]
1, -- [2]
2, -- [2]
},
["text_color"] = {
1, -- [1]
@@ -473,7 +473,7 @@ local _
["textL_custom_text"] = "{data1}. {data3}{data2}",
["font_size"] = 16,
["height"] = 21,
["texture_file"] = "Interface\\AddOns\\Details\\images\\BantoBar",
["texture_file"] = "Interface\\AddOns\\Details\\images\\bar_skyline",
["icon_file"] = "Interface\\AddOns\\Details\\images\\classes_small",
["textR_bracket"] = "(",
["textR_enable_custom_text"] = false,
@@ -484,7 +484,7 @@ local _
},
["textL_show_number"] = true,
["textR_custom_text"] = "{data1} ({data2}, {data3}%)",
["texture"] = "BantoBar",
["texture"] = "Skyline",
["use_spec_icons"] = true,
["textR_class_colors"] = false,
["textL_class_colors"] = false,
@@ -1038,20 +1038,20 @@ local _
local ElvUIRightChatDataPanel = RightChatDataPanel and RightChatDataPanel:IsShown()
if (instance1.skin == "Forced Square") then
instance1.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0))
instance2.baseframe:SetSize (wight/2 - 4 + 2, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0))
instance1.baseframe:SetSize(wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0))
instance2.baseframe:SetSize(wight/2 - 4 + 2, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0))
elseif (instance1.skin == "ElvUI Frame Style") then
instance1.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0))
instance2.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0))
instance1.baseframe:SetSize(wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0))
instance2.baseframe:SetSize(wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0))
elseif (instance1.skin == "ElvUI Style II") then
instance1.baseframe:SetSize (wight/2 - 4 - 2, height - 20 - 2 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0))
instance2.baseframe:SetSize (wight/2 - 4 - 2, height - 20 - 2 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0))
instance1.baseframe:SetSize(wight/2 - 4 - 2, height - 20 - 2 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0))
instance2.baseframe:SetSize(wight/2 - 4 - 2, height - 20 - 2 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0))
else
instance1.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0))
instance2.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0))
instance1.baseframe:SetSize(wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0))
instance2.baseframe:SetSize(wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0))
end
@@ -1059,8 +1059,8 @@ local _
instance1.snap [3] = 2; instance2.snap [1] = 1;
instance1.horizontalSnap = true; instance2.horizontalSnap = true
instance1.baseframe:SetPoint ("bottomleft", RightChatDataPanel, "topleft", 1 - (instance1.skin == "Forced Square" and 1 or 0), 1 + (statusbar_enabled1 and 14 or 0) - (ElvUIRightChatDataPanel and 0 or 22))
instance2.baseframe:SetPoint ("bottomright", RightChatToggleButton, "topright", -1, 1 + (statusbar_enabled2 and 14 or 0) - (ElvUIRightChatDataPanel and 0 or 22))
instance1.baseframe:SetPoint("bottomleft", RightChatDataPanel, "topleft", 1 - (instance1.skin == "Forced Square" and 1 or 0), 1 + (statusbar_enabled1 and 14 or 0) - (ElvUIRightChatDataPanel and 0 or 22))
instance2.baseframe:SetPoint("bottomright", RightChatToggleButton, "topright", -1, 1 + (statusbar_enabled2 and 14 or 0) - (ElvUIRightChatDataPanel and 0 or 22))
instance1:LockInstance (true)
instance2:LockInstance (true)
+137 -137
View File
@@ -246,7 +246,7 @@ function SlashCmdList.DETAILS (msg, editbox)
Details:Dump (state)
else
Details:Msg ("Window 1 not found.")
Details:Msg("Window 1 not found.")
end
elseif (command == "bosstimers" or command == "bosstimer" or command == "timer" or command == "timers") then
@@ -294,12 +294,12 @@ function SlashCmdList.DETAILS (msg, editbox)
local exiterrors = _detalhes_global.exit_errors
print ("EXIT LOG:")
for index, text in ipairs (exitlog) do
for index, text in ipairs(exitlog) do
print (text)
end
print ("ERRORS:")
if (exiterrors) then
for index, text in ipairs (exiterrors) do
for index, text in ipairs(exiterrors) do
print (text)
end
else
@@ -308,18 +308,18 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (msg == "tr") then
local f = CreateFrame ("frame", nil, UIParent)
f:SetSize (300, 300)
f:SetPoint ("center")
local f = CreateFrame("frame", nil, UIParent)
f:SetSize(300, 300)
f:SetPoint("center")
-- /run TTT:SetTexture ("Interface\\1024.tga")
local texture = f:CreateTexture ("TTT", "background")
-- /run TTT:SetTexture("Interface\\1024.tga")
local texture = f:CreateTexture("TTT", "background")
texture:SetAllPoints()
texture:SetTexture ("Interface\\1023.tga")
texture:SetTexture("Interface\\1023.tga")
local A = DetailsFramework:CreateAnimationHub (texture)
local b = DetailsFramework:CreateAnimation (A, "ROTATION", 1, 40, 360)
local b = DetailsFramework:CreateAnimation(A, "ROTATION", 1, 40, 360)
b:SetTarget (texture)
A:Play()
@@ -377,11 +377,11 @@ function SlashCmdList.DETAILS (msg, editbox)
instance1.baseframe:ClearAllPoints()
instance2.baseframe:ClearAllPoints()
instance1.baseframe:SetSize (w/2 - 4, h-20-21-8)
instance2.baseframe:SetSize (w/2 - 4, h-20-21-8)
instance1.baseframe:SetSize(w/2 - 4, h-20-21-8)
instance2.baseframe:SetSize(w/2 - 4, h-20-21-8)
instance1.baseframe:SetPoint ("bottomleft", RightChatDataPanel, "topleft", 1, 1)
instance2.baseframe:SetPoint ("bottomright", RightChatToggleButton, "topright", -1, 1)
instance1.baseframe:SetPoint("bottomleft", RightChatDataPanel, "topleft", 1, 1)
instance2.baseframe:SetPoint("bottomright", RightChatToggleButton, "topright", -1, 1)
elseif (msg == "addcombat") then
@@ -439,7 +439,7 @@ function SlashCmdList.DETAILS (msg, editbox)
_detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos) -- atualiza o instancia.showing para as novas tabelas criadas
_detalhes:InstanciaCallFunction (_detalhes.AtualizaSoloMode_AfertReset) -- verifica se precisa zerar as tabela da janela solo mode
_detalhes:InstanciaCallFunction (_detalhes.ResetaGump) --_detalhes:ResetaGump ("de todas as instancias")
_detalhes:RefreshMainWindow (-1, true) --atualiza todas as instancias
_detalhes:RefreshMainWindow(-1, true) --atualiza todas as instancias
@@ -472,11 +472,11 @@ function SlashCmdList.DETAILS (msg, editbox)
local instance = _detalhes.tabela_instancias [1]
instance.baseframe:ClearAllPoints()
--instance.baseframe:SetPoint ("CENTER", UIParent, "CENTER", 300, 100)
instance.baseframe:SetPoint ("left", DetailsWelcomeWindow, "right", 10, 0)
--instance.baseframe:SetPoint("CENTER", UIParent, "CENTER", 300, 100)
instance.baseframe:SetPoint("left", DetailsWelcomeWindow, "right", 10, 0)
elseif (msg == "model") then
local frame = CreateFrame ("PlayerModel");
local frame = CreateFrame("PlayerModel");
frame:SetPoint("center",UIParent,"center");
frame:SetHeight(600);
frame:SetWidth(300);
@@ -563,23 +563,23 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (msg == "slider") then
local f = CreateFrame ("frame", "TESTEDESCROLL", UIParent)
f:SetPoint ("center", UIParent, "center", 200, -2)
f:SetWidth (300)
f:SetHeight (150)
f:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}})
f:SetBackdropColor (0, 0, 0, 1)
local f = CreateFrame("frame", "TESTEDESCROLL", UIParent)
f:SetPoint("center", UIParent, "center", 200, -2)
f:SetWidth(300)
f:SetHeight(150)
f:SetBackdrop({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}})
f:SetBackdropColor(0, 0, 0, 1)
f:EnableMouseWheel (true)
local rows = {}
for i = 1, 7 do
local row = CreateFrame ("frame", nil, UIParent)
row:SetPoint ("topleft", f, "topleft", 10, -(i-1)*21)
row:SetWidth (200)
row:SetHeight (20)
row:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}})
local row = CreateFrame("frame", nil, UIParent)
row:SetPoint("topleft", f, "topleft", 10, -(i-1)*21)
row:SetWidth(200)
row:SetHeight(20)
row:SetBackdrop({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}})
local t = row:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
t:SetPoint ("left", row, "left")
t:SetPoint("left", row, "left")
row.text = t
rows [#rows+1] = row
end
@@ -598,12 +598,12 @@ function SlashCmdList.DETAILS (msg, editbox)
local t = _detalhes.ResetButton:GetHighlightTexture()
t:SetVertexColor (0, 1, 0, 1)
--print (t:GetObjectType())
--_detalhes.ResetButton:SetHighlightTexture (t)
_detalhes.ResetButton:SetNormalTexture (t)
--_detalhes.ResetButton:SetHighlightTexture(t)
_detalhes.ResetButton:SetNormalTexture(t)
print ("backdrop", _detalhes.ResetButton:GetBackdrop())
_detalhes.ResetButton:SetBackdropColor (0, 0, 1, 1)
_detalhes.ResetButton:SetBackdropColor(0, 0, 1, 1)
--Details.VarDump (_detalhes.ResetButton)
@@ -620,7 +620,7 @@ function SlashCmdList.DETAILS (msg, editbox)
local petGUID = UnitGUID ("target")
if (not _G.DetailsScanTooltip) then
local scanTool = CreateFrame ("GameTooltip", "DetailsScanTooltip", nil, "GameTooltipTemplate")
local scanTool = CreateFrame("GameTooltip", "DetailsScanTooltip", nil, "GameTooltipTemplate")
scanTool:SetOwner (WorldFrame, "ANCHOR_NONE")
end
@@ -711,7 +711,7 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (msg == "error") then
a = nil + 1
--> debug
--debug
elseif (command == "resetcapture") then
_detalhes.capture_real = {
["damage"] = true,
@@ -724,7 +724,7 @@ function SlashCmdList.DETAILS (msg, editbox)
_detalhes:CaptureRefresh()
print (Loc ["STRING_DETAILS1"] .. "capture has been reseted.")
--> debug
--debug
elseif (command == "barra") then
local whichRowLine = rest and tonumber (rest) or 1
@@ -740,8 +740,8 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (msg == "opened") then
print ("Instances opened: " .. _detalhes.opened_windows)
--> debug, get a guid of something
elseif (command == "backdrop") then --> localize-me
--debug, get a guid of something
elseif (command == "backdrop") then --localize-me
local f = MacroFrameTextBackground
local backdrop = MacroFrameTextBackground:GetBackdrop()
@@ -751,10 +751,10 @@ function SlashCmdList.DETAILS (msg, editbox)
print ("bgcolor:",f:GetBackdropColor())
print ("bordercolor",f:GetBackdropBorderColor())
elseif (command == "myguid") then --> localize-me
elseif (command == "myguid") then --localize-me
local g = UnitGUID ("player")
print (type (g))
print (type(g))
print (g)
print (string.len (g))
local serial = g:sub (12, 18)
@@ -777,16 +777,16 @@ function SlashCmdList.DETAILS (msg, editbox)
tile = true, edgeSize = 1, tileSize = 5,
}
Details.id_frame = CreateFrame ("Frame", "DetailsID", UIParent, "BackdropTemplate")
Details.id_frame = CreateFrame("Frame", "DetailsID", UIParent, "BackdropTemplate")
Details.id_frame:SetHeight(14)
Details.id_frame:SetWidth(120)
Details.id_frame:SetPoint ("center", UIParent, "center")
Details.id_frame:SetPoint("center", UIParent, "center")
Details.id_frame:SetBackdrop(backdrop)
tinsert(UISpecialFrames, "DetailsID")
Details.id_frame.texto = CreateFrame ("editbox", nil, Details.id_frame, "BackdropTemplate")
Details.id_frame.texto:SetPoint ("topleft", Details.id_frame, "topleft")
Details.id_frame.texto = CreateFrame("editbox", nil, Details.id_frame, "BackdropTemplate")
Details.id_frame.texto:SetPoint("topleft", Details.id_frame, "topleft")
Details.id_frame.texto:SetAutoFocus(false)
Details.id_frame.texto:SetFontObject (GameFontHighlightSmall)
Details.id_frame.texto:SetHeight(14)
@@ -795,15 +795,15 @@ function SlashCmdList.DETAILS (msg, editbox)
Details.id_frame.texto:EnableMouse(true)
Details.id_frame.texto:SetBackdropColor(0, 0, 0, 0.5)
Details.id_frame.texto:SetBackdropBorderColor(0.3, 0.3, 0.30, 0.80)
Details.id_frame.texto:SetText ("")
Details.id_frame.texto:SetText("")
Details.id_frame.texto.perdeu_foco = nil
Details.id_frame.texto:SetScript ("OnEnterPressed", function()
Details.id_frame.texto:SetScript("OnEnterPressed", function()
Details.id_frame.texto:ClearFocus()
Details.id_frame:Hide()
end)
Details.id_frame.texto:SetScript ("OnEscapePressed", function()
Details.id_frame.texto:SetScript("OnEscapePressed", function()
Details.id_frame.texto:ClearFocus()
Details.id_frame:Hide()
end)
@@ -813,7 +813,7 @@ function SlashCmdList.DETAILS (msg, editbox)
C_Timer.After(0.1, function()
Details.id_frame:Show()
Details.id_frame.texto:SetFocus()
Details.id_frame.texto:SetText ("" .. npcId)
Details.id_frame.texto:SetText("" .. npcId)
Details.id_frame.texto:HighlightText()
end)
end
@@ -833,16 +833,16 @@ function SlashCmdList.DETAILS (msg, editbox)
tile = true, edgeSize = 1, tileSize = 5,
}
_detalhes.id_frame = CreateFrame ("Frame", "DetailsID", UIParent)
_detalhes.id_frame = CreateFrame("Frame", "DetailsID", UIParent)
_detalhes.id_frame:SetHeight(14)
_detalhes.id_frame:SetWidth(120)
_detalhes.id_frame:SetPoint ("center", UIParent, "center")
_detalhes.id_frame:SetPoint("center", UIParent, "center")
_detalhes.id_frame:SetBackdrop(backdrop)
tinsert (UISpecialFrames, "DetailsID")
_detalhes.id_frame.texto = CreateFrame ("editbox", nil, _detalhes.id_frame)
_detalhes.id_frame.texto:SetPoint ("topleft", _detalhes.id_frame, "topleft")
_detalhes.id_frame.texto = CreateFrame("editbox", nil, _detalhes.id_frame)
_detalhes.id_frame.texto:SetPoint("topleft", _detalhes.id_frame, "topleft")
_detalhes.id_frame.texto:SetAutoFocus(false)
_detalhes.id_frame.texto:SetFontObject (GameFontHighlightSmall)
_detalhes.id_frame.texto:SetHeight(14)
@@ -852,15 +852,15 @@ function SlashCmdList.DETAILS (msg, editbox)
_detalhes.id_frame.texto:SetBackdrop(ManualBackdrop)
_detalhes.id_frame.texto:SetBackdropColor(0, 0, 0, 0.5)
_detalhes.id_frame.texto:SetBackdropBorderColor(0.3, 0.3, 0.30, 0.80)
_detalhes.id_frame.texto:SetText ("") --localize-me
_detalhes.id_frame.texto:SetText("") --localize-me
_detalhes.id_frame.texto.perdeu_foco = nil
_detalhes.id_frame.texto:SetScript ("OnEnterPressed", function()
_detalhes.id_frame.texto:SetScript("OnEnterPressed", function()
_detalhes.id_frame.texto:ClearFocus()
_detalhes.id_frame:Hide()
end)
_detalhes.id_frame.texto:SetScript ("OnEscapePressed", function()
_detalhes.id_frame.texto:SetScript("OnEscapePressed", function()
_detalhes.id_frame.texto:ClearFocus()
_detalhes.id_frame:Hide()
end)
@@ -874,13 +874,13 @@ function SlashCmdList.DETAILS (msg, editbox)
local guid = UnitGUID ("target")
if (guid) then
local g = _detalhes:GetNpcIdFromGuid (guid)
_detalhes.id_frame.texto:SetText ("" .. g)
_detalhes.id_frame.texto:SetText("" .. g)
_detalhes.id_frame.texto:HighlightText()
end
else
print (pass_guid.. " -> " .. tonumber (pass_guid:sub(6, 10), 16))
_detalhes.id_frame.texto:SetText (""..tonumber (pass_guid:sub(6, 10), 16))
_detalhes.id_frame.texto:SetText(""..tonumber (pass_guid:sub(6, 10), 16))
_detalhes.id_frame.texto:HighlightText()
end
@@ -969,13 +969,13 @@ function SlashCmdList.DETAILS (msg, editbox)
local container = _detalhes.tabela_vigente [t]._ActorTable
print (#container, "actors found.")
for index, actor in ipairs (container) do
for index, actor in ipairs(container) do
f:add (actor.nome, index, filter)
end
f:Show()
--> debug
--debug
elseif (msg == "save") then
print ("running... this is a debug command, details wont work until next /reload.")
_detalhes:PrepareTablesForSave()
@@ -998,7 +998,7 @@ function SlashCmdList.DETAILS (msg, editbox)
print("NPC ID:", tonumber((UnitGUID("target")):sub(-12, -9), 16) )
end
--> debug
--debug
elseif (command == "debugnet") then
if (_detalhes.debugnet) then
_detalhes.debugnet = false
@@ -1031,7 +1031,7 @@ function SlashCmdList.DETAILS (msg, editbox)
end
end
--> debug combat log
--debug combat log
elseif (msg == "combatlog") then
if (_detalhes.isLoggingCombat) then
LoggingCombat (false)
@@ -1074,7 +1074,7 @@ function SlashCmdList.DETAILS (msg, editbox)
if (not DetailsPosBox) then
_detalhes.gump:CreateTextEntry (UIParent, function()end, 200, 20, nil, "DetailsPosBox")
DetailsPosBox:SetPoint ("center", UIParent, "center")
DetailsPosBox:SetPoint("center", UIParent, "center")
end
local one, two = rest:match("^(%S*)%s*(.-)$")
@@ -1089,7 +1089,7 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (msg == "outline") then
local instancia = _detalhes.tabela_instancias [1]
for _, barra in ipairs (instancia.barras) do
for _, barra in ipairs(instancia.barras) do
local _, _, flags = barra.lineText1:GetFont()
print ("outline:",flags)
end
@@ -1203,8 +1203,8 @@ function SlashCmdList.DETAILS (msg, editbox)
if (iLevel) then
item_level = item_level + iLevel
print (iLevel, item)
--> 16 = main hand 17 = off hand
--> if using a two-hand, ignore the off hand slot
--16 = main hand 17 = off hand
-- if using a two-hand, ignore the off hand slot
if (equip_id == 16 and two_hand [equipSlot]) then
item_amount = 15
break
@@ -1233,7 +1233,7 @@ function SlashCmdList.DETAILS (msg, editbox)
if (not bar) then
bar = Details.gump:CreateBar (UIParent, nil, 600, 200, 100, nil, "DetailsTestBar")
_G.DetailsTestBar = bar
bar:SetPoint ("center", 0, 0)
bar:SetPoint("center", 0, 0)
bar.RightTextIsTimer = true
bar.BarIsInverse = true
end
@@ -1252,12 +1252,12 @@ function SlashCmdList.DETAILS (msg, editbox)
local myframe = TestFrame
if (not myframe) then
myframe = TestFrame or CreateFrame ("frame", "TestFrame", UIParent)
myframe:SetPoint ("center", UIParent, "center")
myframe:SetSize (300, 300)
myframe.texture = myframe:CreateTexture (nil, "overlay")
myframe = TestFrame or CreateFrame("frame", "TestFrame", UIParent)
myframe:SetPoint("center", UIParent, "center")
myframe:SetSize(300, 300)
myframe.texture = myframe:CreateTexture(nil, "overlay")
myframe.texture:SetAllPoints()
myframe.texture:SetTexture ([[Interface\AddOns\WorldQuestTracker\media\icon_flag_common]])
myframe.texture:SetTexture([[Interface\AddOns\WorldQuestTracker\media\icon_flag_common]])
else
if (myframe.texture:IsShown()) then
myframe.texture:Hide()
@@ -1283,14 +1283,14 @@ function SlashCmdList.DETAILS (msg, editbox)
for i = 1, 10 do
local a = CreateFrame ("statusbar", nil, UIParent)
a:SetPoint ("topleft", UIParent, "topleft", i*32, y)
a:SetSize (32, 32)
local a = CreateFrame("statusbar", nil, UIParent)
a:SetPoint("topleft", UIParent, "topleft", i*32, y)
a:SetSize(32, 32)
a:SetMinMaxValues (0, 1)
local texture = a:CreateTexture (nil, "overlay")
texture:SetSize (32, 32)
texture:SetPoint ("topleft")
local texture = a:CreateTexture(nil, "overlay")
texture:SetSize(32, 32)
texture:SetPoint("topleft")
if (i%10 == 0) then
y = y - 32
@@ -1300,19 +1300,19 @@ function SlashCmdList.DETAILS (msg, editbox)
-- https://www.dropbox.com/s/ulyeqa2z0ummlu7/1024.tga?dl=0
local time = 0
a:SetScript ("OnUpdate", function(self, deltaTime)
a:SetScript("OnUpdate", function(self, deltaTime)
time = time + deltaTime
--texture:SetSize (math.random (50, 300), math.random (50, 300))
--texture:SetSize(math.random (50, 300), math.random (50, 300))
--local spec = allspecs [math.random (#allspecs)]
texture:SetTexture ([[Interface\AddOns\Details\images\options_window]])
--texture:SetTexture ([[Interface\Store\Store-Splash]])
--texture:SetTexture ([[Interface\AddOns\Details\images\options_window]])
--texture:SetTexture ([[Interface\CHARACTERFRAME\Button_BloodPresence_DeathKnight]])
texture:SetTexture([[Interface\AddOns\Details\images\options_window]])
--texture:SetTexture([[Interface\Store\Store-Splash]])
--texture:SetTexture([[Interface\AddOns\Details\images\options_window]])
--texture:SetTexture([[Interface\CHARACTERFRAME\Button_BloodPresence_DeathKnight]])
--texture:SetTexCoord (unpack (_detalhes.class_specs_coords [spec]))
--a:SetAlpha (abs (math.sin (time)))
--a:SetValue (abs (math.sin (time)))
--a:SetValue(abs (math.sin (time)))
end)
end
@@ -1391,16 +1391,16 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (msg == "merge") then
--> at this point, details! should not be in combat
--at this point, details! should not be in combat
if (_detalhes.in_combat) then
_detalhes:Msg ("already in combat, closing current segment.")
_detalhes:SairDoCombate()
end
--> create a new combat to be the overall for the mythic run
--create a new combat to be the overall for the mythic run
_detalhes:EntrarEmCombate()
--> get the current combat just created and the table with all past segments
--get the current combat just created and the table with all past segments
local newCombat = _detalhes:GetCurrentCombat()
local segmentHistory = _detalhes:GetCombatSegments()
local totalTime = 0
@@ -1408,7 +1408,7 @@ function SlashCmdList.DETAILS (msg, editbox)
local lastSegment
local segmentsAdded = 0
--> add all boss segments from this run to this new segment
--add all boss segments from this run to this new segment
for i = 1, 25 do
local pastCombat = segmentHistory [i]
if (pastCombat and pastCombat ~= newCombat) then
@@ -1431,7 +1431,7 @@ function SlashCmdList.DETAILS (msg, editbox)
_detalhes:Msg ("done merging, segments: " .. segmentsAdded .. ", total time: " .. DetailsFramework:IntegerToTimer (totalTime))
--[[ --mythic+ debug
--> tag the segment as mythic overall segment
--tag the segment as mythic overall segment
newCombat.is_mythic_dungeon = {
MapID = _detalhes.MythicPlus.Dungeon,
StartedAt = _detalhes.MythicPlus.StartedAt, --the start of the run
@@ -1444,17 +1444,17 @@ function SlashCmdList.DETAILS (msg, editbox)
}
--]]
--> set some data
--set some data
newCombat:SetStartTime (GetTime() - totalTime)
newCombat:SetEndTime (GetTime())
newCombat.data_inicio = startDate
newCombat.data_fim = endDate
--> immediatly finishes the segment just started
--immediatly finishes the segment just started
_detalhes:SairDoCombate()
--> cleanup the past segments table
--cleanup the past segments table
for i = 25, 1, -1 do
local pastCombat = segmentHistory [i]
if (pastCombat and pastCombat ~= newCombat) then
@@ -1463,14 +1463,14 @@ function SlashCmdList.DETAILS (msg, editbox)
end
end
--> clear memory
--clear memory
collectgarbage()
_detalhes:InstanciaCallFunction (Details.FadeHandler.Fader, "in", nil, "barras")
_detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos)
_detalhes:InstanciaCallFunction (_detalhes.AtualizaSoloMode_AfertReset)
_detalhes:InstanciaCallFunction (_detalhes.ResetaGump)
_detalhes:RefreshMainWindow (-1, true)
_detalhes:RefreshMainWindow(-1, true)
elseif (msg == "ej") then
@@ -1488,7 +1488,7 @@ function SlashCmdList.DETAILS (msg, editbox)
local nextID = {sectionInfo.siblingSectionID}
while (nextID [1]) do
--> get the deepest section in the hierarchy
--get the deepest section in the hierarchy
local ID = tremove (nextID)
local sectionInfo = C_EncounterJournal.GetSectionInfo (ID)
@@ -1559,7 +1559,7 @@ function SlashCmdList.DETAILS (msg, editbox)
local f = DetailsRecordFrameAnimation
if (not f) then
f = CreateFrame ("frame", "DetailsRecordFrameAnimation", UIParent)
f = CreateFrame("frame", "DetailsRecordFrameAnimation", UIParent)
--estrela no inicio dando um giro
--Interface\Cooldown\star4
@@ -1567,8 +1567,8 @@ function SlashCmdList.DETAILS (msg, editbox)
--Interface\Artifacts\ArtifactAnim2
local animationHub = DetailsFramework:CreateAnimationHub (f, function() f:Show() end)
DetailsFramework:CreateAnimation (animationHub, "Scale", 1, .10, .9, .9, 1.1, 1.1)
DetailsFramework:CreateAnimation (animationHub, "Scale", 2, .10, 1.2, 1.2, 1, 1)
DetailsFramework:CreateAnimation(animationHub, "Scale", 1, .10, .9, .9, 1.1, 1.1)
DetailsFramework:CreateAnimation(animationHub, "Scale", 2, .10, 1.2, 1.2, 1, 1)
end
--BFA BETA
@@ -1611,7 +1611,7 @@ function SlashCmdList.DETAILS (msg, editbox)
local keys = {}
--> copy from table2 to table1 overwriting values
--copy from table2 to table1 overwriting values
function f.copy (t1, t2)
if (t1.Timer) then
t1, t2 = t1.t1, t1.t2
@@ -1621,7 +1621,7 @@ function SlashCmdList.DETAILS (msg, editbox)
if (key == "targets") then
t1 [key] = {}
elseif (type (value) == "table") then
elseif (type(value) == "table") then
t1 [key] = t1 [key] or {}
--print (key, value)
@@ -1657,12 +1657,12 @@ function SlashCmdList.DETAILS (msg, editbox)
--end
if (command) then
--> check if the line passed is a parameters in the default profile
--check if the line passed is a parameters in the default profile
if (_detalhes.default_profile [command]) then
if (rest and (rest ~= "" and rest ~= " ")) then
local whichType = type (_detalhes.default_profile [command])
--> attempt to cast the passed value to the same value as the type in the profile
--attempt to cast the passed value to the same value as the type in the profile
if (whichType == "number") then
rest = tonumber (rest)
if (rest) then
@@ -1697,7 +1697,7 @@ function SlashCmdList.DETAILS (msg, editbox)
else
local value = _detalhes [command]
if (type (value) == "boolean") then
if (type(value) == "boolean") then
value = value and "true" or "false"
end
print (Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' current value is: " .. value)
@@ -1759,11 +1759,11 @@ function Details:UpdateUserPanel (usersTable)
if (not Details.UserPanel) then
DetailsUserPanel = DetailsFramework:CreateSimplePanel (UIParent)
DetailsUserPanel:SetSize (707, 505)
DetailsUserPanel:SetSize(707, 505)
DetailsUserPanel:SetTitle ("Details! Version Check")
DetailsUserPanel.Data = {}
DetailsUserPanel:ClearAllPoints()
DetailsUserPanel:SetPoint ("left", UIParent, "left", 10, 0)
DetailsUserPanel:SetPoint("left", UIParent, "left", 10, 0)
DetailsUserPanel:Hide()
Details.UserPanel = DetailsUserPanel
@@ -1794,7 +1794,7 @@ function Details:UpdateUserPanel (usersTable)
}
DetailsUserPanel.Header = DetailsFramework:CreateHeader (DetailsUserPanel, headerTable, headerOptions)
DetailsUserPanel.Header:SetPoint ("topleft", DetailsUserPanel, "topleft", 5, headerY)
DetailsUserPanel.Header:SetPoint("topleft", DetailsUserPanel, "topleft", 5, headerY)
local scroll_refresh = function(self, data, offset, total_lines)
@@ -1821,43 +1821,43 @@ function Details:UpdateUserPanel (usersTable)
local lineOnEnter = function(self)
if (self.IsCritical) then
self:SetBackdropColor (unpack (backdrop_color_is_critical_on_enter))
self:SetBackdropColor(unpack (backdrop_color_is_critical_on_enter))
else
self:SetBackdropColor (unpack (backdrop_color_on_enter))
self:SetBackdropColor(unpack (backdrop_color_on_enter))
end
end
local lineOnLeave = function(self)
if (self.IsCritical) then
self:SetBackdropColor (unpack (backdrop_color_is_critical))
self:SetBackdropColor(unpack (backdrop_color_is_critical))
else
self:SetBackdropColor (unpack (backdrop_color))
self:SetBackdropColor(unpack (backdrop_color))
end
GameTooltip:Hide()
end
local scroll_createline = function(self, index)
local line = CreateFrame ("button", "$parentLine" .. index, self, "BackdropTemplate")
line:SetPoint ("topleft", self, "topleft", 3, -((index-1)*(scroll_line_height+1)) - 1)
line:SetSize (scroll_width - 2, scroll_line_height)
local line = CreateFrame("button", "$parentLine" .. index, self, "BackdropTemplate")
line:SetPoint("topleft", self, "topleft", 3, -((index-1)*(scroll_line_height+1)) - 1)
line:SetSize(scroll_width - 2, scroll_line_height)
line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
line:SetBackdropColor (unpack (backdrop_color))
line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
line:SetBackdropColor(unpack (backdrop_color))
DetailsFramework:Mixin (line, DetailsFramework.HeaderFunctions)
line:SetScript ("OnEnter", lineOnEnter)
line:SetScript ("OnLeave", lineOnLeave)
line:SetScript("OnEnter", lineOnEnter)
line:SetScript("OnLeave", lineOnLeave)
--username
local userNameText = DetailsFramework:CreateLabel (line)
local userNameText = DetailsFramework:CreateLabel(line)
--realm
local realmText = DetailsFramework:CreateLabel (line)
local realmText = DetailsFramework:CreateLabel(line)
--version
local versionText = DetailsFramework:CreateLabel (line)
local versionText = DetailsFramework:CreateLabel(line)
line:AddFrameToHeaderAlignment (userNameText)
line:AddFrameToHeaderAlignment (realmText)
@@ -1874,7 +1874,7 @@ function Details:UpdateUserPanel (usersTable)
local usersScroll = DetailsFramework:CreateScrollBox (DetailsUserPanel, "$parentUsersScroll", scroll_refresh, DetailsUserPanel.Data, scroll_width, scroll_height, scroll_lines, scroll_line_height)
DetailsFramework:ReskinSlider(usersScroll)
usersScroll:SetPoint ("topleft", DetailsUserPanel, "topleft", 5, scrollY)
usersScroll:SetPoint("topleft", DetailsUserPanel, "topleft", 5, scrollY)
Details.UserPanel.ScrollBox = usersScroll
--create lines
@@ -1882,10 +1882,10 @@ function Details:UpdateUserPanel (usersTable)
usersScroll:CreateLine (scroll_createline)
end
DetailsUserPanel:SetScript ("OnShow", function()
DetailsUserPanel:SetScript("OnShow", function()
end)
DetailsUserPanel:SetScript ("OnHide", function()
DetailsUserPanel:SetScript("OnHide", function()
end)
end
@@ -1896,14 +1896,14 @@ end
function _detalhes:CreateListPanel()
_detalhes.ListPanel = _detalhes.gump:NewPanel (UIParent, nil, "DetailsActorsFrame", nil, 300, 600)
_detalhes.ListPanel:SetPoint ("center", UIParent, "center", 300, 0)
_detalhes.ListPanel:SetPoint("center", UIParent, "center", 300, 0)
_detalhes.ListPanel.barras = {}
tinsert (UISpecialFrames, "DetailsActorsFrame")
_detalhes.ListPanel.close_with_right = true
local container_barras_window = CreateFrame ("ScrollFrame", "Details_ActorsBarrasScroll", _detalhes.ListPanel.widget)
local container_barras = CreateFrame ("Frame", "Details_ActorsBarras", container_barras_window)
local container_barras_window = CreateFrame("ScrollFrame", "Details_ActorsBarrasScroll", _detalhes.ListPanel.widget)
local container_barras = CreateFrame("Frame", "Details_ActorsBarras", container_barras_window)
_detalhes.ListPanel.container = container_barras
_detalhes.ListPanel.width = 500
@@ -1912,24 +1912,24 @@ function _detalhes:CreateListPanel()
container_barras_window:SetBackdrop({
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-gold-Border", tile = true, tileSize = 16, edgeSize = 5,
insets = {left = 1, right = 1, top = 0, bottom = 1},})
container_barras_window:SetBackdropBorderColor (0, 0, 0, 0)
container_barras_window:SetBackdropBorderColor(0, 0, 0, 0)
container_barras:SetBackdrop({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
insets = {left = 1, right = 1, top = 0, bottom = 1},})
container_barras:SetBackdropColor (0, 0, 0, 0)
container_barras:SetBackdropColor(0, 0, 0, 0)
container_barras:SetAllPoints (container_barras_window)
container_barras:SetWidth (500)
container_barras:SetHeight (150)
container_barras:SetAllPoints(container_barras_window)
container_barras:SetWidth(500)
container_barras:SetHeight(150)
container_barras:EnableMouse (true)
container_barras:SetResizable (false)
container_barras:SetResizable(false)
container_barras:SetMovable (true)
container_barras_window:SetWidth (460)
container_barras_window:SetHeight (550)
container_barras_window:SetWidth(460)
container_barras_window:SetHeight(550)
container_barras_window:SetScrollChild (container_barras)
container_barras_window:SetPoint ("TOPLEFT", _detalhes.ListPanel.widget, "TOPLEFT", 21, -10)
container_barras_window:SetPoint("TOPLEFT", _detalhes.ListPanel.widget, "TOPLEFT", 21, -10)
_detalhes.gump:NewScrollBar (container_barras_window, container_barras, -10, -17)
container_barras_window.slider:Altura (560)
@@ -1946,7 +1946,7 @@ function _detalhes:CreateListPanel()
if (not row) then
row = {text = _detalhes.ListPanel.container:CreateFontString (nil, "overlay", "GameFontNormal")}
_detalhes.ListPanel.barras [index] = row
row.text:SetPoint ("topleft", _detalhes.ListPanel.container, "topleft", 0, -index * 15)
row.text:SetPoint("topleft", _detalhes.ListPanel.container, "topleft", 0, -index * 15)
end
if (filter and text:find (filter)) then
@@ -1955,7 +1955,7 @@ function _detalhes:CreateListPanel()
row.text:SetTextColor (1, 1, 1)
end
row.text:SetText (text)
row.text:SetText(text)
end
return _detalhes.ListPanel
+23 -23
View File
@@ -3,7 +3,7 @@
do
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> On The Fly SpellCache
--On The Fly SpellCache
local _detalhes = _G._detalhes
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
@@ -14,12 +14,12 @@ do
local _GetSpellInfo = GetSpellInfo
local _unpack = unpack
--> is this a timewalking exp?
--is this a timewalking exp?
local is_classic_exp = DetailsFramework.IsClassicWow()
--> default container
--default container
_detalhes.spellcache = {}
local unknowSpell = {Loc ["STRING_UNKNOWSPELL"], _, "Interface\\Icons\\Ability_Druid_Eclipse"} --> localize-me
local unknowSpell = {Loc ["STRING_UNKNOWSPELL"], _, "Interface\\Icons\\Ability_Druid_Eclipse"} --localize-me
local AllSpellNames
if (is_classic_exp) then
@@ -59,7 +59,7 @@ do
return spellName, _, AllSpellNames [spell] or spellIcon
end
--> reset spell cache
--reset spell cache
function _detalhes:ClearSpellCache()
_detalhes.spellcache = _setmetatable ({},
{__index = function(tabela, valor)
@@ -68,8 +68,8 @@ do
return esta_magia
end
--> should save only icon and name, other values are not used
if (valor) then --> check if spell is valid before
--should save only icon and name, other values are not used
if (valor) then --check if spell is valid before
local cache
if (is_classic_exp) then
cache = {GetSpellInfoClassic(valor)}
@@ -84,19 +84,19 @@ do
end})
--> default overwrites
--default overwrites
--_rawset (_detalhes.spellcache, 1, {Loc ["STRING_MELEE"], 1, "Interface\\AddOns\\Details\\images\\melee.tga"})
--_rawset (_detalhes.spellcache, 2, {Loc ["STRING_AUTOSHOT"], 1, "Interface\\AddOns\\Details\\images\\autoshot.tga"})
--> built-in overwrites
--built-in overwrites
for spellId, spellTable in pairs (_detalhes.SpellOverwrite) do
local name, _, icon = _GetSpellInfo(spellId)
_rawset (_detalhes.spellcache, spellId, {spellTable.name or name, 1, spellTable.icon or icon})
end
--> user overwrites
--user overwrites
-- [1] spellid [2] spellname [3] spellicon
for index, spellTable in ipairs (_detalhes.savedCustomSpells) do
for index, spellTable in ipairs(_detalhes.savedCustomSpells) do
_rawset (_detalhes.spellcache, spellTable [1], {spellTable [2], 1, spellTable [3]})
end
end
@@ -157,7 +157,7 @@ do
[108271] = {name = GetSpellInfo(108271), icon = "Interface\\Addons\\Details\\images\\icon_astral_shift"},
[196917] = {name = lightOfTheMartyr_Name .. " (" .. Loc ["STRING_DAMAGE"] .. ")", icon = lightOfTheMartyr_Icon},
--> bfa trinkets (deprecated)
--bfa trinkets (deprecated)
[278155] = {name = GetSpellInfo(278155) .. " (Trinket)"}, --[Twitching Tentacle of Xalzaix]
[279664] = {name = GetSpellInfo(279664) .. " (Trinket)"}, --[Vanquished Tendril of G'huun]
[278227] = {name = GetSpellInfo(278227) .. " (Trinket)"}, --[T'zane's Barkspines]
@@ -229,7 +229,7 @@ do
for spellid, t in pairs (defaultSpellCustomization) do
local already_have
for index, spelltable in ipairs (_detalhes.savedCustomSpells) do
for index, spelltable in ipairs(_detalhes.savedCustomSpells) do
if (spelltable [1] == spellid) then
already_have = spelltable
end
@@ -256,7 +256,7 @@ do
function _detalhes:UserCustomSpellAdd (spellid, name, icon)
local is_overwrite = false
for index, t in ipairs (_detalhes.savedCustomSpells) do
for index, t in ipairs(_detalhes.savedCustomSpells) do
if (t [1] == spellid) then
t[2] = name
t[3] = icon
@@ -284,12 +284,12 @@ do
return false
end
--> overwrite for API GetSpellInfo function
--overwrite for API GetSpellInfo function
_detalhes.getspellinfo = function(spellid) return _unpack (_detalhes.spellcache[spellid]) end
_detalhes.GetSpellInfo = _detalhes.getspellinfo
--> overwrite SpellInfo if the spell is a DoT, so Details.GetSpellInfo will return the name modified
--overwrite SpellInfo if the spell is a DoT, so Details.GetSpellInfo will return the name modified
function _detalhes:SpellIsDot (spellid)
local spellName, rank, spellIcon = _GetSpellInfo(spellid)
@@ -301,7 +301,7 @@ do
end
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> Cache All Spells
--Cache All Spells
function _detalhes:BuildSpellListSlow()
@@ -314,13 +314,13 @@ do
local max = 160000
if (not load_frame) then
load_frame = CreateFrame ("frame", "DetailsLoadSpellCache", UIParent)
load_frame = CreateFrame("frame", "DetailsLoadSpellCache", UIParent)
load_frame:SetFrameStrata ("DIALOG")
local progress_label = load_frame:CreateFontString ("DetailsLoadSpellCacheProgress", "overlay", "GameFontHighlightSmall")
progress_label:SetText ("Loading Spells: 0%")
progress_label:SetText("Loading Spells: 0%")
function _detalhes:BuildSpellListSlowTick()
progress_label:SetText ("Loading Spells: " .. load_frame:GetProgress() .. "%")
progress_label:SetText("Loading Spells: " .. load_frame:GetProgress() .. "%")
end
load_frame.tick = _detalhes:ScheduleRepeatingTimer ("BuildSpellListSlowTick", 1)
@@ -338,11 +338,11 @@ do
_detalhes.spellcachefull = SpellCache
load_frame:SetScript ("OnUpdate", function()
load_frame:SetScript("OnUpdate", function()
for spellid = step, step+500 do
local name, _, icon = blizzGetSpellInfo (spellid)
if (name) then
local LetterIndex = _string_lower (_string_sub (name, 1, 1)) --> get the first letter
local LetterIndex = _string_lower (_string_sub (name, 1, 1)) --get the first letter
local CachedIndex = SpellCache [LetterIndex]
if (CachedIndex) then
CachedIndex [spellid] = {name, icon}
@@ -358,7 +358,7 @@ do
_G.DetailsLoadSpellCache.inprogress = false
_detalhes:CancelTimer (_G.DetailsLoadSpellCache.tick)
DetailsLoadSpellCacheProgress:Hide()
load_frame:SetScript ("OnUpdate", nil)
load_frame:SetScript("OnUpdate", nil)
end
end)
+9 -9
View File
@@ -3902,7 +3902,7 @@ do
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
_detalhes.SpellOverwrite = {
--[124464] = {name = GetSpellInfo(124464) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> shadow word: pain mastery proc (priest)
--[124464] = {name = GetSpellInfo(124464) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --shadow word: pain mastery proc (priest)
}
_detalhes.spells_school = {
@@ -3960,7 +3960,7 @@ end
--save spells of a segment
local SplitLoadFrame = CreateFrame ("frame")
local SplitLoadFrame = CreateFrame("frame")
local MiscContainerNames = {
"dispell_spells",
"cooldowns_defensive_spells",
@@ -3977,9 +3977,9 @@ local SplitLoadFunc = function(self, deltaTime)
if (not container) then
if (Details.debug) then
Details:Msg ("(debug) finished index spells.")
Details:Msg("(debug) finished index spells.")
end
SplitLoadFrame:SetScript ("OnUpdate", nil)
SplitLoadFrame:SetScript("OnUpdate", nil)
return
end
@@ -3997,9 +3997,9 @@ local SplitLoadFunc = function(self, deltaTime)
--finished all the 4 container? kill the process
if (SplitLoadFrame.NextActorContainer == 5) then
SplitLoadFrame:SetScript ("OnUpdate", nil)
SplitLoadFrame:SetScript("OnUpdate", nil)
if (Details.debug) then
Details:Msg ("(debug) finished index spells.")
Details:Msg("(debug) finished index spells.")
end
return
end
@@ -4040,7 +4040,7 @@ local SplitLoadFunc = function(self, deltaTime)
--if is a misc container
elseif (SplitLoadFrame.NextActorContainer == 4) then
for _, containerName in ipairs (MiscContainerNames) do
for _, containerName in ipairs(MiscContainerNames) do
--check if the actor have this container
if (actorToIndex [containerName]) then
local spellList = actorToIndex [containerName]._ActorTable
@@ -4086,9 +4086,9 @@ end
function Details.StoreSpells()
if (Details.debug) then
Details:Msg ("(debug) started to index spells.")
Details:Msg("(debug) started to index spells.")
end
SplitLoadFrame:SetScript ("OnUpdate", SplitLoadFunc)
SplitLoadFrame:SetScript("OnUpdate", SplitLoadFunc)
SplitLoadFrame.NextActorContainer = 1
SplitLoadFrame.NextActorIndex = 1
end
+1 -1
View File
@@ -318,7 +318,7 @@ function Details:CreateTestBars (alphabet, isArena)
current_combat.totals [1] = total_damage
current_combat.totals [2] = total_heal
for _, instance in ipairs (Details.tabela_instancias) do
for _, instance in ipairs(Details.tabela_instancias) do
if (instance:IsEnabled()) then
instance:InstanceReset()
end
+44 -44
View File
@@ -3,25 +3,25 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> basic stuff
--basic stuff
local _
local _detalhes = _G._detalhes
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
--> mantain the enabled time captures
--mantain the enabled time captures
_detalhes.timeContainer = {}
_detalhes.timeContainer.Exec = {}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> local pointers
--local pointers
local ipairs = ipairs
local _math_floor = math.floor
local _pcall = pcall
local time = time
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> constants
--constants
local INDEX_NAME = 1
local INDEX_FUNCTION = 2
@@ -34,16 +34,16 @@
local DEFAULT_USER_MATRIX = {max_value = 0, last_value = 0}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> register and unregister captures
--register and unregister captures
function _detalhes:TimeDataUpdate (index_or_name, name, func, matrix, author, version, icon, is_enabled)
local this_capture
if (type (index_or_name) == "number") then
if (type(index_or_name) == "number") then
this_capture = _detalhes.savedTimeCaptures [index_or_name]
else
for index, t in ipairs (_detalhes.savedTimeCaptures) do
for index, t in ipairs(_detalhes.savedTimeCaptures) do
if (t [INDEX_NAME] == index_or_name) then
this_capture = t
end
@@ -82,31 +82,31 @@
--matrix = table containing {max_value = 0, last_value = 0}
function _detalhes:TimeDataRegister (name, func, matrix, author, version, icon, is_enabled, force_no_save)
--> check name
--check name
if (not name) then
return "Couldn't register the time capture, name was nil."
end
--> check if the name already exists
for index, t in ipairs (_detalhes.savedTimeCaptures) do
--check if the name already exists
for index, t in ipairs(_detalhes.savedTimeCaptures) do
if (t [INDEX_NAME] == name) then
return "Couldn't register the time capture, name already registred."
end
end
--> check function
--check function
if (not func) then
return "Couldn't register the time capture, invalid function."
end
local no_save = nil
--> passed a function means that this isn't came from a user
--> so the plugin register the capture every time it loads.
if (type (func) == "function") then
--passed a function means that this isn't came from a user
--so the plugin register the capture every time it loads.
if (type(func) == "function") then
no_save = true
--> this a custom capture from a user, so we register a default user table for matrix
elseif (type (func) == "string") then
--this a custom capture from a user, so we register a default user table for matrix
elseif (type(func) == "string") then
matrix = DEFAULT_USER_MATRIX
end
@@ -115,7 +115,7 @@
no_save = true
end
--> check matrix
--check matrix
if (not matrix or type (matrix) ~= "table") then
return "Couldn't register the time capture, matrix was invalid."
end
@@ -134,15 +134,15 @@
end
--> unregister
--unregister
function _detalhes:TimeDataUnregister (name)
if (type (name) == "number") then
if (type(name) == "number") then
tremove (_detalhes.savedTimeCaptures, name)
if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then
DetailsOptionsWindowTab17UserTimeCapturesFillPanel.MyObject:Refresh()
end
else
for index, t in ipairs (_detalhes.savedTimeCaptures) do
for index, t in ipairs(_detalhes.savedTimeCaptures) do
if (t [INDEX_NAME] == name) then
tremove (_detalhes.savedTimeCaptures, index)
if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then
@@ -155,10 +155,10 @@
end
end
--> cleanup when logout
--cleanup when logout
function _detalhes:TimeDataCleanUpTemporary()
local new_table = {}
for index, t in ipairs (_detalhes.savedTimeCaptures) do
for index, t in ipairs(_detalhes.savedTimeCaptures) do
if (not t.do_not_save) then
tinsert (new_table, t)
end
@@ -168,27 +168,27 @@
local tick_time = 0
--> starting a combat
--starting a combat
function _detalhes:TimeDataCreateCombatTables()
--> create capture table
--create capture table
local data_captured = {}
--> drop the last capture exec table without wiping
--drop the last capture exec table without wiping
local exec = {}
_detalhes.timeContainer.Exec = exec
_detalhes:SendEvent ("COMBAT_CHARTTABLES_CREATING")
_detalhes:SendEvent("COMBAT_CHARTTABLES_CREATING")
--> build the exec table
for index, t in ipairs (_detalhes.savedTimeCaptures) do
--build the exec table
for index, t in ipairs(_detalhes.savedTimeCaptures) do
if (t [INDEX_ENABLED]) then
local data = {}
data_captured [t [INDEX_NAME]] = data
if (type (t [INDEX_FUNCTION]) == "string") then
--> user
if (type(t [INDEX_FUNCTION]) == "string") then
--user
local func, errortext = loadstring (t [INDEX_FUNCTION])
if (func) then
DetailsFramework:SetEnvironment(func)
@@ -197,7 +197,7 @@
_detalhes:Msg ("|cFFFF9900error compiling script for time data (charts)|r: ", errortext)
end
else
--> plugin
--plugin
local func = t [INDEX_FUNCTION]
DetailsFramework:SetEnvironment(func)
tinsert (exec, { func = func, data = data, attributes = Details.CopyTable (t [INDEX_MATRIX]) })
@@ -206,11 +206,11 @@
end
end
_detalhes:SendEvent ("COMBAT_CHARTTABLES_CREATED")
_detalhes:SendEvent("COMBAT_CHARTTABLES_CREATED")
tick_time = 0
--> return the capture table the to combat object
--return the capture table the to combat object
return data_captured
end
@@ -238,14 +238,14 @@
tick_time = tick_time + 1
for index, t in ipairs (_detalhes.timeContainer.Exec) do
for index, t in ipairs(_detalhes.timeContainer.Exec) do
if (t.is_user) then
--> by a user
--by a user
exec_user_func (t.func, t.attributes, t.data, tick_time)
else
--> by a plugin
--by a plugin
t.func (t.attributes, t.data, tick_time)
end
@@ -255,7 +255,7 @@
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> broker dps stuff
--broker dps stuff
local ToKFunctions = _detalhes.ToKFunctions
@@ -285,7 +285,7 @@
local get_combat_time = function()
local combat_time = _detalhes.tabela_vigente:GetCombatTime()
local minutos, segundos = _math_floor (combat_time / 60), _math_floor (combat_time % 60)
local minutos, segundos = _math_floor(combat_time / 60), _math_floor(combat_time % 60)
if (segundos < 10) then
segundos = "0" .. segundos
end
@@ -297,7 +297,7 @@
damage_container:SortByKey ("total")
local pos = 1
for index, actor in ipairs (damage_container._ActorTable) do
for index, actor in ipairs(damage_container._ActorTable) do
if (actor.grupo) then
if (actor.nome == _detalhes.playername) then
return pos
@@ -314,7 +314,7 @@
heal_container:SortByKey ("total")
local pos = 1
for index, actor in ipairs (heal_container._ActorTable) do
for index, actor in ipairs(heal_container._ActorTable) do
if (actor.grupo) then
if (actor.nome == _detalhes.playername) then
return pos
@@ -332,7 +332,7 @@
local first
local first_index
for index, actor in ipairs (damage_container._ActorTable) do
for index, actor in ipairs(damage_container._ActorTable) do
if (actor.grupo) then
first = actor
first_index = index
@@ -378,7 +378,7 @@
local first
local first_index
for index, actor in ipairs (heal_container._ActorTable) do
for index, actor in ipairs(heal_container._ActorTable) do
if (actor.grupo) then
first = actor
first_index = index
@@ -528,10 +528,10 @@
end
function _detalhes:SetDataBrokerText (text)
if (type (text) == "string") then
if (type(text) == "string") then
_detalhes.data_broker_text = text
_detalhes:BrokerTick()
elseif (text == nil or (type (text) == "boolean" and not text)) then
elseif (text == nil or (type(text) == "boolean" and not text)) then
_detalhes.data_broker_text = ""
_detalhes:BrokerTick()
end