- Boss segments now need to have at least 30 seconds to be added on the overall data.
- When the segment limit is reach, segments with less combat time will be erased instead of the olders. - Added item level tracker. - Details Storage now stores the item level of the character as well and only guild runs. - Fixed window positioning when changing from Solo mode to Group mode.
This commit is contained in:
@@ -2387,7 +2387,7 @@ function _detalhes:MontaAtributosOption (instancia, func)
|
||||
--> custom
|
||||
|
||||
--GameCooltip:AddLine ("$div")
|
||||
CoolTip:AddLine ("$div", nil, 1, -2, 1)
|
||||
CoolTip:AddLine ("$div", nil, 1, -3, 1)
|
||||
|
||||
CoolTip:AddMenu (1, func, nil, 5, nil, atributos.lista[5], nil, true)
|
||||
CoolTip:AddIcon ("Interface\\AddOns\\Details\\images\\atributos_icones", 1, 1, 20, 20, p*(5-1), p*(5), 0, 1)
|
||||
|
||||
@@ -88,6 +88,7 @@ function historico:adicionar (tabela)
|
||||
end
|
||||
|
||||
--> adiciona no index #1
|
||||
|
||||
_table_insert (self.tabelas, 1, tabela)
|
||||
|
||||
--_detalhes.encounter_counter
|
||||
@@ -157,16 +158,20 @@ function historico:adicionar (tabela)
|
||||
end
|
||||
|
||||
if (overall_added) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) overall data flag match with the current combat.")
|
||||
end
|
||||
if (InCombatLockdown()) then
|
||||
_detalhes.schedule_add_to_overall = true
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) player is in combat, scheduling overall addition.")
|
||||
end
|
||||
if (tabela.is_boss and tabela:GetCombatTime() < 30) then
|
||||
_detalhes:Msg ("segment not added to overall (less than 30 seconds of combat time).")
|
||||
else
|
||||
historico:adicionar_overall (tabela)
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) overall data flag match with the current combat.")
|
||||
end
|
||||
if (InCombatLockdown()) then
|
||||
_detalhes.schedule_add_to_overall = true
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) player is in combat, scheduling overall addition.")
|
||||
end
|
||||
else
|
||||
historico:adicionar_overall (tabela)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -232,13 +237,39 @@ function historico:adicionar (tabela)
|
||||
--> verifica se precisa apagar a última tabela do histórico
|
||||
if (#self.tabelas > _detalhes.segments_amount) then
|
||||
|
||||
local combat_removed = self.tabelas [#self.tabelas]
|
||||
|
||||
--> diminuir quantidades no overall
|
||||
--if (combat_removed.overall_added) then
|
||||
-- _detalhes.tabela_overall = _detalhes.tabela_overall - combat_removed
|
||||
-- print ("removendo combate 2")
|
||||
--end
|
||||
local combat_removed, combat_index
|
||||
|
||||
--> verifica se estão dando try em um boss e remove o combate menos relevante
|
||||
local bossid = tabela.is_boss and tabela.is_boss.id
|
||||
|
||||
local last_segment = self.tabelas [#self.tabelas]
|
||||
local last_bossid = last_segment.is_boss and last_segment.is_boss.id
|
||||
|
||||
if (_detalhes.zone_type == "raid" and bossid and last_bossid and bossid == last_bossid) then
|
||||
|
||||
local shorter_combat
|
||||
local shorter_id
|
||||
local min_time = 99999
|
||||
|
||||
for i = 4, #self.tabelas do
|
||||
local combat = self.tabelas [i]
|
||||
if (combat.is_boss and combat.is_boss.id == bossid and combat:GetCombatTime() < min_time and not combat.is_boss.killed) then
|
||||
shorter_combat = combat
|
||||
shorter_id = i
|
||||
min_time = combat:GetCombatTime()
|
||||
end
|
||||
end
|
||||
|
||||
if (shorter_combat) then
|
||||
combat_removed = shorter_combat
|
||||
combat_index = shorter_id
|
||||
end
|
||||
end
|
||||
|
||||
if (not combat_removed) then
|
||||
combat_removed = self.tabelas [#self.tabelas]
|
||||
combat_index = #self.tabelas
|
||||
end
|
||||
|
||||
--> verificar novamente a time machine
|
||||
for _, jogador in ipairs (combat_removed [1]._ActorTable) do --> damage
|
||||
@@ -253,8 +284,8 @@ function historico:adicionar (tabela)
|
||||
end
|
||||
|
||||
--> remover
|
||||
_table_remove (self.tabelas, #self.tabelas)
|
||||
_detalhes:SendEvent ("DETAILS_DATA_SEGMENTREMOVED", nil, nil)
|
||||
_table_remove (self.tabelas, combat_index)
|
||||
_detalhes:SendEvent ("DETAILS_DATA_SEGMENTREMOVED")
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -455,6 +455,9 @@
|
||||
|
||||
--> add to storage
|
||||
if (not InCombatLockdown() and not UnitAffectingCombat ("player") and not _detalhes.logoff_saving_data) then
|
||||
|
||||
--_detalhes.StoreEncounter()
|
||||
|
||||
local successful, errortext = pcall (_detalhes.StoreEncounter)
|
||||
if (not successful) then
|
||||
_detalhes:Msg ("error occurred on StoreEncounter():", errortext)
|
||||
|
||||
+266
-201
@@ -2,6 +2,8 @@ local _detalhes = _G._detalhes
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
|
||||
local UnitName = UnitName
|
||||
local UnitGUID = UnitGUID
|
||||
local UnitGroupRolesAssigned = UnitGroupRolesAssigned
|
||||
local select = select
|
||||
local floor = floor
|
||||
|
||||
@@ -293,6 +295,11 @@ function _detalhes:GetPerformanceRaidType()
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> background tasks
|
||||
|
||||
|
||||
local background_tasks = {}
|
||||
local task_timers = {
|
||||
["LOW"] = 30,
|
||||
@@ -354,6 +361,10 @@ end
|
||||
|
||||
_detalhes.background_tasks_loop = _detalhes:ScheduleRepeatingTimer ("DoBackgroundTasks", 120)
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> storage stuff
|
||||
|
||||
local store_instances = {
|
||||
[1205] = true, --Blackrock Foundry
|
||||
[1228] = true, --Highmaul
|
||||
@@ -384,181 +395,8 @@ function _detalhes:StoreEncounter (combat)
|
||||
local diff = combat:GetDifficulty()
|
||||
|
||||
--> check for heroic mode
|
||||
if (diff == 5 or diff == 6 or diff == 15) then --test on raid finder or diff == 7 or diff == 17
|
||||
|
||||
local role = UnitGroupRolesAssigned ("player")
|
||||
if (role ~= "DAMAGER" and role ~= "HEALER") then
|
||||
return
|
||||
end
|
||||
|
||||
--> check if the storage is already loaded
|
||||
if (not IsAddOnLoaded ("Details_DataStorage")) then
|
||||
local loaded, reason = LoadAddOn ("Details_DataStorage")
|
||||
if (not loaded) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
--> get the storage table
|
||||
local db = DetailsDataStorage
|
||||
|
||||
if (not db and _detalhes.CreateStorageDB) then
|
||||
db = _detalhes:CreateStorageDB()
|
||||
if (not db) then
|
||||
return
|
||||
end
|
||||
elseif (not db) then
|
||||
return
|
||||
end
|
||||
|
||||
local self_database = db.SELF_STORAGE
|
||||
|
||||
if (not self_database) then
|
||||
--> outdate database?
|
||||
return
|
||||
end
|
||||
|
||||
local heroic_branch = self_database ["HEROIC"]
|
||||
if (not heroic_branch) then
|
||||
heroic_branch = {}
|
||||
self_database ["HEROIC"] = heroic_branch
|
||||
end
|
||||
|
||||
--> heroic database: numeric table with combats
|
||||
local encounter_database = heroic_branch [encounter_id]
|
||||
|
||||
if (not encounter_database) then
|
||||
heroic_branch [encounter_id] = {}
|
||||
encounter_database = heroic_branch [encounter_id]
|
||||
end
|
||||
|
||||
--> get player data
|
||||
local t = {
|
||||
total = 0,
|
||||
spells = {},
|
||||
}
|
||||
|
||||
if (role == "DAMAGER") then
|
||||
|
||||
local player = combat (1, _detalhes.playername)
|
||||
|
||||
if (player) then
|
||||
t.total = player.total
|
||||
for spellid, spell in pairs (player.spells._ActorTable) do
|
||||
t.spells [spellid] = spell.total
|
||||
end
|
||||
end
|
||||
|
||||
elseif (role == "HEALER") then
|
||||
local player = combat (2, _detalhes.playername)
|
||||
if (player) then
|
||||
t.total = player.total
|
||||
for spellid, spell in pairs (player.spells._ActorTable) do
|
||||
t.spells [spellid] = spell.total
|
||||
end
|
||||
end
|
||||
end
|
||||
if (diff == 14 or diff == 15 or diff == 16) then --test on raid finder ' or diff == 17'
|
||||
|
||||
if (t.total > 0) then
|
||||
local this_combat_data = {
|
||||
total = t.total,
|
||||
spells = t.spells,
|
||||
date = date ("%H:%M %d/%m/%y"),
|
||||
time = time(),
|
||||
elapsed = combat:GetCombatTime(),
|
||||
}
|
||||
tinsert (encounter_database, this_combat_data)
|
||||
end
|
||||
|
||||
--> check for normal mode
|
||||
elseif (diff == 3 or diff == 4 or diff == 14) then
|
||||
|
||||
local role = UnitGroupRolesAssigned ("player")
|
||||
if (role ~= "DAMAGER" and role ~= "HEALER") then
|
||||
return
|
||||
end
|
||||
|
||||
--> check if the storage is already loaded
|
||||
if (not IsAddOnLoaded ("Details_DataStorage")) then
|
||||
local loaded, reason = LoadAddOn ("Details_DataStorage")
|
||||
if (not loaded) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
--> get the storage table
|
||||
local db = DetailsDataStorage
|
||||
|
||||
if (not db and _detalhes.CreateStorageDB) then
|
||||
db = _detalhes:CreateStorageDB()
|
||||
if (not db) then
|
||||
return
|
||||
end
|
||||
elseif (not db) then
|
||||
return
|
||||
end
|
||||
|
||||
local self_database = db.SELF_STORAGE
|
||||
|
||||
if (not self_database) then
|
||||
--> outdate database?
|
||||
return
|
||||
end
|
||||
|
||||
local normal_branch = self_database ["NORMAL"]
|
||||
if (not normal_branch) then
|
||||
normal_branch = {}
|
||||
self_database ["NORMAL"] = normal_branch
|
||||
end
|
||||
|
||||
--> heroic database: numeric table with combats
|
||||
local encounter_database = normal_branch [encounter_id]
|
||||
|
||||
if (not encounter_database) then
|
||||
normal_branch [encounter_id] = {}
|
||||
encounter_database = normal_branch [encounter_id]
|
||||
end
|
||||
|
||||
--> get player data
|
||||
local t = {
|
||||
total = 0,
|
||||
spells = {},
|
||||
role = role,
|
||||
}
|
||||
|
||||
if (role == "DAMAGER") then
|
||||
local player = combat (1, _detalhes.playername)
|
||||
if (player) then
|
||||
t.total = player.total
|
||||
for spellid, spell in pairs (player.spells._ActorTable) do
|
||||
t.spells [spellid] = spell.total
|
||||
end
|
||||
end
|
||||
|
||||
elseif (role == "HEALER") then
|
||||
local player = combat (2, _detalhes.playername)
|
||||
if (player) then
|
||||
t.total = player.total
|
||||
for spellid, spell in pairs (player.spells._ActorTable) do
|
||||
t.spells [spellid] = spell.total
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (t.total > 0) then
|
||||
local this_combat_data = {
|
||||
total = t.total,
|
||||
spells = t.spells,
|
||||
date = date ("%H:%M %d/%m/%y"),
|
||||
time = time(),
|
||||
elapsed = combat:GetCombatTime(),
|
||||
}
|
||||
tinsert (encounter_database, this_combat_data)
|
||||
end
|
||||
|
||||
--> check if is a mythic encounter and store the mythic encounter
|
||||
elseif (difficulty == 16) then
|
||||
|
||||
--> check the guild name
|
||||
local match = 0
|
||||
local guildName = select (1, GetGuildInfo ("player"))
|
||||
@@ -578,7 +416,7 @@ function _detalhes:StoreEncounter (combat)
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
--> check if the storage is already loaded
|
||||
if (not IsAddOnLoaded ("Details_DataStorage")) then
|
||||
local loaded, reason = LoadAddOn ("Details_DataStorage")
|
||||
@@ -586,7 +424,7 @@ function _detalhes:StoreEncounter (combat)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--> get the storage table
|
||||
local db = DetailsDataStorage
|
||||
|
||||
@@ -598,49 +436,276 @@ function _detalhes:StoreEncounter (combat)
|
||||
elseif (not db) then
|
||||
return
|
||||
end
|
||||
|
||||
local raid_database = db.RAID_STORAGE
|
||||
|
||||
if (not raid_database) then
|
||||
db.RAID_STORAGE = {}
|
||||
raid_database = db.RAID_STORAGE
|
||||
local diff_storage = db [diff]
|
||||
if (not diff_storage) then
|
||||
db [diff] = {}
|
||||
diff_storage = db [diff]
|
||||
end
|
||||
|
||||
--> encounter_database: numeric table with combats
|
||||
local encounter_database = raid_database [encounter_id]
|
||||
|
||||
local encounter_database = diff_storage [encounter_id]
|
||||
if (not encounter_database) then
|
||||
raid_database [encounter_id] = {}
|
||||
encounter_database = raid_database [encounter_id]
|
||||
diff_storage [encounter_id] = {}
|
||||
encounter_database = diff_storage [encounter_id]
|
||||
end
|
||||
|
||||
--> get raid members data
|
||||
local this_combat_data = {
|
||||
damage = {},
|
||||
heal = {},
|
||||
healing = {},
|
||||
date = date ("%H:%M %d/%m/%y"),
|
||||
time = time(),
|
||||
elapsed = combat:GetCombatTime(),
|
||||
guild = guildName,
|
||||
}
|
||||
|
||||
local damage_container_hash = combat [1]._NameIndexTable
|
||||
local damage_container_pool = combat [1]._ActorTable
|
||||
|
||||
for i = 1, raid_size do
|
||||
local player_name, player_realm = UnitName ("raid" .. i)
|
||||
if (player_realm and player_realm ~= "") then
|
||||
player_name = player_name .. "-" .. player_realm
|
||||
local healing_container_hash = combat [2]._NameIndexTable
|
||||
local healing_container_pool = combat [2]._ActorTable
|
||||
|
||||
for i = 1, GetNumGroupMembers() do
|
||||
|
||||
local role = UnitGroupRolesAssigned ("raid" .. i)
|
||||
|
||||
if (role == "DAMAGER") then
|
||||
local player_name, player_realm = UnitName ("raid" .. i)
|
||||
if (player_realm and player_realm ~= "") then
|
||||
player_name = player_name .. "-" .. player_realm
|
||||
end
|
||||
|
||||
local damage_actor = damage_container_pool [damage_container_hash [player_name]]
|
||||
if (damage_actor) then
|
||||
local guid = UnitGUID (player_name) or UnitGUID (UnitName ("raid" .. i))
|
||||
this_combat_data.damage [player_name] = {floor (damage_actor.total), _detalhes.item_level_pool [guid] or 0}
|
||||
end
|
||||
elseif (role == "HEALER") then
|
||||
local player_name, player_realm = UnitName ("raid" .. i)
|
||||
if (player_realm and player_realm ~= "") then
|
||||
player_name = player_name .. "-" .. player_realm
|
||||
end
|
||||
|
||||
local heal_actor = healing_container_pool [healing_container_hash [player_name]]
|
||||
if (heal_actor) then
|
||||
local guid = UnitGUID (player_name) or UnitGUID (UnitName ("raid" .. i))
|
||||
this_combat_data.healing [player_name] = {floor (heal_actor.total), _detalhes.item_level_pool [guid] or 0}
|
||||
end
|
||||
end
|
||||
|
||||
local damage_actor = combat (1, player_name)
|
||||
if (damage_actor) then
|
||||
this_combat_data.damage [player_name] = floor (damage_actor.total)
|
||||
end
|
||||
|
||||
local heal_actor = combat (2, player_name)
|
||||
if (heal_actor) then
|
||||
this_combat_data.heal [player_name] = floor (heal_actor.total)
|
||||
end
|
||||
end
|
||||
|
||||
tinsert (encounter_database, this_combat_data)
|
||||
|
||||
print ("|cFFFFFF00Details! Storage|r: encounter saved!")
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> inspect stuff
|
||||
|
||||
local ilvl_core = _detalhes:CreateEventListener()
|
||||
|
||||
ilvl_core:RegisterEvent ("GROUP_ONENTER", "OnEnter")
|
||||
ilvl_core:RegisterEvent ("GROUP_ONLEAVE", "OnLeave")
|
||||
ilvl_core:RegisterEvent ("COMBAT_PLAYER_ENTER", "EnterCombat")
|
||||
ilvl_core:RegisterEvent ("COMBAT_PLAYER_LEAVE", "LeaveCombat")
|
||||
ilvl_core:RegisterEvent ("ZONE_TYPE_CHANGED", "ZoneChanged")
|
||||
|
||||
local inspecting = {}
|
||||
local inspect_frame = CreateFrame ("frame")
|
||||
|
||||
local check_inspect_queue = function()
|
||||
for spellid, timeout_id in pairs (inspecting) do
|
||||
return
|
||||
end
|
||||
|
||||
inspect_frame:UnregisterEvent ("INSPECT_READY")
|
||||
end
|
||||
|
||||
local inspect_amout = function()
|
||||
local i = 0
|
||||
for spellid, timeout_id in pairs (inspecting) do
|
||||
i = i + 1
|
||||
end
|
||||
return i
|
||||
end
|
||||
|
||||
function _detalhes:IlvlFromNetwork (player, realm, core, ilvl)
|
||||
local guid = UnitGUID (player .. "-" .. realm)
|
||||
if (not guid) then
|
||||
guid = UnitGUID (player)
|
||||
if (not guid) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes.item_level_pool [guid] = {name = player, ilvl = ilvl, time = time()}
|
||||
end
|
||||
|
||||
inspect_frame:SetScript ("OnEvent", function (self, event, ...)
|
||||
local guid, unitid, arg3 = select (1, ...)
|
||||
|
||||
if (inspecting [guid]) then
|
||||
local unitid, cancel_tread = inspecting [guid] [1], inspecting [guid] [2]
|
||||
inspecting [guid] = nil
|
||||
|
||||
ilvl_core:CancelTimer (cancel_tread)
|
||||
|
||||
--> do inspect stuff
|
||||
if (unitid) then
|
||||
if (CheckInteractDistance (unitid, 1)) then
|
||||
local item_amount = 0
|
||||
local item_level = 0
|
||||
|
||||
for equip_id = 1, 17 do
|
||||
if (equip_id ~= 4) then --shirt slot
|
||||
local item = GetInventoryItemLink (unitid, equip_id)
|
||||
if (item) then
|
||||
local name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo (item)
|
||||
if (iLevel) then
|
||||
item_amount = item_amount + 1
|
||||
item_level = item_level + iLevel
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local average = item_level / item_amount
|
||||
|
||||
-- register
|
||||
if (average > 0) then
|
||||
_detalhes.item_level_pool [guid] = {name = UnitName (unitid), ilvl = average, time = time()}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--> check queue
|
||||
check_inspect_queue()
|
||||
end
|
||||
end)
|
||||
|
||||
function ilvl_core:InspectTimeOut (guid)
|
||||
inspecting [guid] = nil
|
||||
check_inspect_queue()
|
||||
end
|
||||
|
||||
function ilvl_core:GetItemLevel (unitid, guid)
|
||||
--> double check
|
||||
if (UnitAffectingCombat ("player") or InCombatLockdown()) then
|
||||
return
|
||||
end
|
||||
if (not unitid or not CanInspect (unitid) or not CheckInteractDistance (unitid, 1)) then
|
||||
return
|
||||
end
|
||||
|
||||
inspect_frame:RegisterEvent ("INSPECT_READY")
|
||||
inspecting [guid] = {unitid, ilvl_core:ScheduleTimer ("InspectTimeOut", 12, guid)}
|
||||
|
||||
NotifyInspect (unitid)
|
||||
end
|
||||
|
||||
function ilvl_core:Reset()
|
||||
ilvl_core.raid_id = 1
|
||||
end
|
||||
|
||||
function ilvl_core:Loop()
|
||||
if (inspect_amout() > 1) then
|
||||
return
|
||||
end
|
||||
|
||||
local members_amt = GetNumGroupMembers()
|
||||
if (ilvl_core.raid_id > members_amt) then
|
||||
ilvl_core.raid_id = 1
|
||||
end
|
||||
|
||||
local unitid = "raid" .. ilvl_core.raid_id
|
||||
|
||||
local guid = UnitGUID (unitid)
|
||||
if (not guid) then
|
||||
ilvl_core.raid_id = ilvl_core.raid_id + 1
|
||||
return
|
||||
end
|
||||
|
||||
if (inspecting [guid]) then
|
||||
return
|
||||
end
|
||||
|
||||
local ilvl_table = _detalhes.ilevel:GetIlvl (guid)
|
||||
if (ilvl_table and ilvl_table.time + 3600 > time()) then
|
||||
ilvl_core.raid_id = ilvl_core.raid_id + 1
|
||||
return
|
||||
end
|
||||
|
||||
ilvl_core:GetItemLevel (unitid, guid)
|
||||
ilvl_core.raid_id = ilvl_core.raid_id + 1
|
||||
end
|
||||
|
||||
function ilvl_core:EnterCombat()
|
||||
if (ilvl_core.loop_process) then
|
||||
ilvl_core:CancelTimer (ilvl_core.loop_process)
|
||||
ilvl_core.loop_process = nil
|
||||
end
|
||||
end
|
||||
|
||||
local can_start_loop = function()
|
||||
if (_detalhes:GetZoneType() ~= "raid" or ilvl_core.loop_process or _detalhes.in_combat) then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function ilvl_core:LeaveCombat()
|
||||
if (can_start_loop()) then
|
||||
ilvl_core:Reset()
|
||||
ilvl_core.loop_process = ilvl_core:ScheduleRepeatingTimer ("Loop", 2)
|
||||
end
|
||||
end
|
||||
|
||||
function ilvl_core:ZoneChanged (zone_type)
|
||||
if (can_start_loop()) then
|
||||
ilvl_core:Reset()
|
||||
ilvl_core.loop_process = ilvl_core:ScheduleRepeatingTimer ("Loop", 2)
|
||||
end
|
||||
end
|
||||
|
||||
function ilvl_core:OnEnter()
|
||||
if (IsInRaid()) then
|
||||
_detalhes:SentMyItemLevel()
|
||||
end
|
||||
|
||||
if (can_start_loop()) then
|
||||
ilvl_core:Reset()
|
||||
ilvl_core.loop_process = ilvl_core:ScheduleRepeatingTimer ("Loop", 2)
|
||||
end
|
||||
end
|
||||
|
||||
function ilvl_core:OnLeave()
|
||||
if (ilvl_core.loop_process) then
|
||||
ilvl_core:CancelTimer (ilvl_core.loop_process)
|
||||
ilvl_core.loop_process = nil
|
||||
end
|
||||
end
|
||||
|
||||
--> ilvl API
|
||||
_detalhes.ilevel = {}
|
||||
|
||||
function _detalhes.ilevel:GetPool()
|
||||
return _detalhes.item_level_pool
|
||||
end
|
||||
|
||||
function _detalhes.ilevel:GetIlvl (guid)
|
||||
return _detalhes.item_level_pool [guid]
|
||||
end
|
||||
|
||||
function _detalhes.ilevel:GetInOrder()
|
||||
local order = {}
|
||||
|
||||
for guid, t in pairs (_detalhes.item_level_pool) do
|
||||
order [#order+1] = {t.name, t.ilvl, t.time}
|
||||
end
|
||||
|
||||
table.sort (order, _detalhes.Sort2)
|
||||
|
||||
return order
|
||||
end
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
local CONST_VERSION_CHECK = "CV"
|
||||
|
||||
local CONST_ITEMLEVEL_DATA = "IL"
|
||||
|
||||
local CONST_CLOUD_REQUEST = "CR"
|
||||
local CONST_CLOUD_FOUND = "CF"
|
||||
local CONST_CLOUD_DATARQ = "CD"
|
||||
@@ -39,6 +41,7 @@
|
||||
["HIGHFIVE_REQUEST"] = CONST_HIGHFIVE_REQUEST,
|
||||
["HIGHFIVE_DATA"] = CONST_HIGHFIVE_DATA,
|
||||
["VERSION_CHECK"] = CONST_VERSION_CHECK,
|
||||
["ITEMLEVEL_DATA"] = CONST_ITEMLEVEL_DATA,
|
||||
["CLOUD_REQUEST"] = CONST_CLOUD_REQUEST,
|
||||
["CLOUD_FOUND"] = CONST_CLOUD_FOUND,
|
||||
["CLOUD_DATARQ"] = CONST_CLOUD_DATARQ,
|
||||
@@ -245,6 +248,7 @@
|
||||
[CONST_HIGHFIVE_REQUEST] = _detalhes.network.HighFive_Request,
|
||||
[CONST_HIGHFIVE_DATA] = _detalhes.network.HighFive_DataReceived,
|
||||
[CONST_VERSION_CHECK] = _detalhes.network.Update_VersionReceived,
|
||||
[CONST_ITEMLEVEL_DATA] = _detalhes.network.ItemLevel_Received,
|
||||
|
||||
[CONST_CLOUD_REQUEST] = _detalhes.network.Cloud_Request,
|
||||
[CONST_CLOUD_FOUND] = _detalhes.network.Cloud_Found,
|
||||
@@ -453,6 +457,17 @@
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> item level
|
||||
function _detalhes:SentMyItemLevel()
|
||||
local overall, equipped = GetAverageItemLevel()
|
||||
_detalhes:SendRaidData (CONST_ITEMLEVEL_DATA, overall)
|
||||
end
|
||||
|
||||
function _detalhes.network.ItemLevel_Received (player, realm, core_version, itemlevel)
|
||||
_detalhes:IlvlFromNetwork (player, realm, core_version, itemlevel)
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> update
|
||||
|
||||
+7
-4
@@ -2606,7 +2606,13 @@
|
||||
return _detalhes.zone_type
|
||||
end
|
||||
function _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA (...)
|
||||
|
||||
local zoneName, zoneType, _, _, _, _, _, zoneMapID = _GetInstanceInfo()
|
||||
|
||||
_detalhes.zone_type = zoneType
|
||||
_detalhes.zone_id = zoneMapID
|
||||
_detalhes.zone_name = zoneName
|
||||
|
||||
if (_detalhes.last_zone_type ~= zoneType) then
|
||||
_detalhes:SendEvent ("ZONE_TYPE_CHANGED", nil, zoneType)
|
||||
_detalhes.last_zone_type = zoneType
|
||||
@@ -2614,10 +2620,6 @@
|
||||
|
||||
_detalhes:CheckChatOnZoneChange (zoneType)
|
||||
|
||||
_detalhes.zone_type = zoneType
|
||||
_detalhes.zone_id = zoneMapID
|
||||
_detalhes.zone_name = zoneName
|
||||
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) zone change:", _detalhes.zone_name, "is a", _detalhes.zone_type, "zone.")
|
||||
end
|
||||
@@ -2859,6 +2861,7 @@
|
||||
|
||||
if (_detalhes.schedule_store_boss_encounter) then
|
||||
if (not _detalhes.logoff_saving_data) then
|
||||
--_detalhes.StoreEncounter()
|
||||
local successful, errortext = pcall (_detalhes.StoreEncounter)
|
||||
if (not successful) then
|
||||
_detalhes:Msg ("error occurred on StoreEncounter():", errortext)
|
||||
|
||||
+3
-1
@@ -388,7 +388,9 @@
|
||||
return _detalhes:ScheduleTimer ("SaveMainWindowPosition", 1, self)
|
||||
end
|
||||
|
||||
self:SaveLibWindow()
|
||||
if (self.mostrando ~= "solo") then
|
||||
self:SaveLibWindow()
|
||||
end
|
||||
|
||||
--> save the position
|
||||
local _w = baseframe_width
|
||||
|
||||
@@ -943,9 +943,9 @@ local default_profile = {
|
||||
anchor_relative = "top",
|
||||
anchor_offset = {0, 0},
|
||||
|
||||
border_texture = "Blizzard Tooltip",
|
||||
border_color = {1, 1, 1, 1},
|
||||
border_size = 16,
|
||||
border_texture = "Details BarBorder 3",
|
||||
border_color = {0.76, 0.76, 0.76, 1},
|
||||
border_size = 14,
|
||||
},
|
||||
|
||||
}
|
||||
@@ -1054,6 +1054,8 @@ local default_global_data = {
|
||||
},
|
||||
--> auras
|
||||
details_auras = {},
|
||||
--> ilvl
|
||||
item_level_pool = {},
|
||||
}
|
||||
|
||||
_detalhes.default_global_data = default_global_data
|
||||
|
||||
@@ -935,7 +935,27 @@ function SlashCmdList.DETAILS (msg, editbox)
|
||||
local _, _, flags = barra.texto_esquerdo:GetFont()
|
||||
print ("outline:",flags)
|
||||
end
|
||||
|
||||
elseif (msg == "ilvl") then
|
||||
local item_amount = 0
|
||||
local item_level = 0
|
||||
|
||||
for equip_id = 1, 17 do
|
||||
if (equip_id ~= 4) then --shirt slot
|
||||
local item = GetInventoryItemLink ("player", equip_id)
|
||||
if (item) then
|
||||
local name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo (item)
|
||||
if (iLevel) then
|
||||
item_amount = item_amount + 1
|
||||
item_level = item_level + iLevel
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local average = item_level / item_amount
|
||||
print ("your item lvl:", average)
|
||||
|
||||
else
|
||||
|
||||
--if (_detalhes.opened_windows < 1) then
|
||||
|
||||
Binary file not shown.
@@ -1,8 +1,13 @@
|
||||
|
||||
DETAILS_STORAGE_VERSION = 2
|
||||
DETAILS_STORAGE_VERSION = 3
|
||||
|
||||
function _detalhes:CreateStorageDB()
|
||||
DetailsDataStorage = {VERSION = DETAILS_STORAGE_VERSION, RAID_STORAGE = {}, SELF_STORAGE = {}}
|
||||
DetailsDataStorage = {
|
||||
VERSION = DETAILS_STORAGE_VERSION,
|
||||
[14] = {}, --normal mode
|
||||
[15] = {}, --heroic mode
|
||||
[16] = {}, --mythic mode
|
||||
}
|
||||
return DetailsDataStorage
|
||||
end
|
||||
|
||||
@@ -11,17 +16,22 @@ f:Hide()
|
||||
f:RegisterEvent ("ADDON_LOADED")
|
||||
|
||||
f:SetScript ("OnEvent", function (self, event, addonName)
|
||||
|
||||
if (addonName == "Details_DataStorage") then
|
||||
|
||||
DetailsDataStorage = DetailsDataStorage or _detalhes:CreateStorageDB()
|
||||
|
||||
if (DetailsDataStorage.VERSION < DETAILS_STORAGE_VERSION) then
|
||||
--> do revisions
|
||||
if (DetailsDataStorage.VERSION == 1) then
|
||||
DetailsDataStorage.SELF_STORAGE = {}
|
||||
DetailsDataStorage.VERSION = 2
|
||||
if (DetailsDataStorage.VERSION < 3) then
|
||||
table.wipe (DetailsDataStorage)
|
||||
DetailsDataStorage = _detalhes:CreateStorageDB()
|
||||
end
|
||||
end
|
||||
|
||||
print ("|cFFFFFF00Details! Storage|r: loaded!")
|
||||
DETAILS_STORAGE_LOADED = true
|
||||
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
+19
@@ -347,6 +347,25 @@ function _G._detalhes:Start()
|
||||
_detalhes:AddDefaultCustomDisplays()
|
||||
|
||||
--> Reset for the new structure
|
||||
if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < 64 and enable_reset_warning) then
|
||||
function _detalhes:ResetDataStorage()
|
||||
if (not IsAddOnLoaded ("Details_DataStorage")) then
|
||||
local loaded, reason = LoadAddOn ("Details_DataStorage")
|
||||
if (not loaded) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local db = DetailsDataStorage
|
||||
if (db) then
|
||||
table.wipe (db)
|
||||
end
|
||||
|
||||
DetailsDataStorage = _detalhes:CreateStorageDB()
|
||||
end
|
||||
_detalhes:ScheduleTimer ("ResetDataStorage", 1)
|
||||
end
|
||||
|
||||
if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < 47 and enable_reset_warning) then
|
||||
for i = #_detalhes.custom, 1, -1 do
|
||||
_detalhes.atributo_custom:RemoveCustom (i)
|
||||
|
||||
Reference in New Issue
Block a user