- Mode menu now have a sub menu for raid plugins.

- Red and Green colors under comparison frame has been inverted.
- Fixed some report issues with dps and hps, also almost all reports now have guide lines.
- Fixed DPS and HPS bug involving 'Everything Mode'.
- NewAPI: ActorObject:GetBarColor() return the color in r, b, g which the actor's bar should be filled.
This commit is contained in:
tercio
2014-06-13 22:32:10 -03:00
parent 73c62f0626
commit 1bf2d2fe8c
22 changed files with 745 additions and 339 deletions
+121 -45
View File
@@ -23,6 +23,7 @@
local _GetInstanceInfo = GetInstanceInfo --wow api local
local _UnitExists = UnitExists --wow api local
local _UnitGUID = UnitGUID --wow api local
local _UnitName = UnitName --wow api local
local _IsAltKeyDown = IsAltKeyDown
local _IsShiftKeyDown = IsShiftKeyDown
@@ -117,6 +118,47 @@
_detalhes.tabela_vigente.is_boss = boss_table
if (_detalhes.in_combat and not _detalhes.leaving_combat) then
--> catch boss function if any
local bossFunction, bossFunctionType = _detalhes:GetBossFunction (ZoneMapID, BossIndex)
if (bossFunction) then
if (_bit_band (bossFunctionType, 0x1) ~= 0) then --realtime
_detalhes.bossFunction = bossFunction
_detalhes.tabela_vigente.bossFunction = _detalhes:ScheduleTimer ("bossFunction", 1)
end
end
if (_detalhes.zone_type ~= "raid") then
local endType, endData = _detalhes:GetEncounterEnd (ZoneMapID, BossIndex)
if (endType and endData) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) setting boss end type to:", endType)
end
_detalhes.encounter_end_table.type = endType
_detalhes.encounter_end_table.killed = {}
_detalhes.encounter_end_table.data = {}
if (type (endData) == "table") then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) boss type is table:", endType)
end
if (endType == 1 or endType == 2) then
for _, npcID in ipairs (endData) do
_detalhes.encounter_end_table.data [npcID] = false
end
end
else
if (endType == 1 or endType == 2) then
_detalhes.encounter_end_table.data [endData] = false
end
end
end
end
end
_detalhes:SendEvent ("COMBAT_BOSS_FOUND", nil, index, name)
return boss_table
@@ -148,54 +190,11 @@
local BossIndex = BossIds [serial]
if (BossIndex) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) boss found:",_detalhes:GetBossName (ZoneMapID, BossIndex))
end
if (_detalhes.in_combat) then
--> catch boss function if any
local bossFunction, bossFunctionType = _detalhes:GetBossFunction (ZoneMapID, BossIndex)
if (bossFunction) then
if (_bit_band (bossFunctionType, 0x1) ~= 0) then --realtime
_detalhes.bossFunction = bossFunction
local combat = _detalhes:GetCombat ("current")
combat.bossFunction = _detalhes:ScheduleTimer ("bossFunction", 1)
end
end
--> catch boss end if any
local endType, endData = _detalhes:GetEncounterEnd (ZoneMapID, BossIndex)
if (endType and endData) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) setting boss end type to:", endType)
end
_detalhes.encounter.type = endType
_detalhes.encounter.killed = {}
_detalhes.encounter.data = {}
if (type (endData) == "table") then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) boss type is table:", endType)
end
if (endType == 1 or endType == 2) then
for _, npcID in ipairs (endData) do
_detalhes.encounter.data [npcID] = false
end
end
else
if (endType == 1 or endType == 2) then
_detalhes.encounter.data [endData] = false
end
end
end
end
return boss_found (BossIndex, _detalhes:GetBossName (ZoneMapID, BossIndex), ZoneName, ZoneMapID, DifficultyID)
end
end
end
@@ -249,7 +248,7 @@
_detalhes:Msg ("(debug) started a new combat.")
end
--> não tem historico, addon foi resetado, a primeira tabela é descartada -- Erase first table is does not have a firts segment history, this occour after reset or first run
--> não tem historico, addon foi resetado, a primeira tabela é descartada -- Erase first table is do es not have a firts segment history, this occour after reset or first run
if (not _detalhes.tabela_historico.tabelas[1]) then
--> precisa zerar aqui a tabela overall
_table_wipe (_detalhes.tabela_overall)
@@ -291,7 +290,7 @@
--> é o timer que ve se o jogador ta em combate ou não -- check if any party or raid members are in combat
_detalhes.tabela_vigente.verifica_combate = _detalhes:ScheduleRepeatingTimer ("EstaEmCombate", 1)
_table_wipe (_detalhes.encounter)
_table_wipe (_detalhes.encounter_end_table)
_table_wipe (_detalhes.pets_ignored)
_table_wipe (_detalhes.pets_no_owner)
@@ -359,6 +358,8 @@
_detalhes:Msg ("(debug) ended a combat.")
end
_detalhes.leaving_combat = true
if (_detalhes.schedule_remove_overall and not from_encounter_end and not InCombatLockdown()) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) found schedule overall data deletion.")
@@ -554,6 +555,7 @@
end
_detalhes.in_combat = false --sinaliza ao addon que não há combate no momento
_detalhes.leaving_combat = false --sinaliza que não esta mais saindo do combate
_table_wipe (_detalhes.cache_damage_group)
_table_wipe (_detalhes.cache_healing_group)
@@ -576,6 +578,80 @@
_detalhes:SendEvent ("COMBAT_PLAYER_LEAVE", nil, _detalhes.tabela_vigente)
end
function _detalhes:GetPlayersInArena()
local aliados = GetNumGroupMembers (LE_PARTY_CATEGORY_HOME)
for i = 1, aliados-1 do
local role = UnitGroupRolesAssigned ("party" .. i)
if (role ~= "NONE") then
local name = GetUnitName ("party" .. i, true)
_detalhes.arena_table [name] = {role = role}
end
end
local role = UnitGroupRolesAssigned ("player")
if (role ~= "NONE") then
local name = GetUnitName ("player", true)
_detalhes.arena_table [name] = {role = role}
end
if (_detalhes.debug) then
_detalhes:Msg ("(debug) Found", oponentes, "enemies and", aliados, "allies")
end
end
function _detalhes:CreateArenaSegment()
_detalhes:GetPlayersInArena()
_detalhes.arena_begun = true
_detalhes.start_arena = nil
if (_detalhes.in_combat) then
_detalhes:SairDoCombate()
end
--> inicia um novo combate
_detalhes:EntrarEmCombate()
--> sinaliza que esse combate é arena
_detalhes.tabela_vigente.arena = true
_detalhes.tabela_vigente.is_arena = {name = _detalhes.zone_name, zone = _detalhes.zone_name, mapid = _detalhes.zone_id}
end
function _detalhes:StartArenaSegment (...)
if (_detalhes.debug) then
_detalhes:Msg ("(debug) starting a new arena segment.")
end
local timerType, timeSeconds, totalTime = select (1, ...)
if (_detalhes.start_arena) then
_detalhes:CancelTimer (_detalhes.start_arena, true)
end
_detalhes.start_arena = _detalhes:ScheduleTimer ("CreateArenaSegment", timeSeconds)
_detalhes:GetPlayersInArena()
end
function _detalhes:EnteredInArena()
if (_detalhes.debug) then
_detalhes:Msg ("(debug) arena detected.")
end
_detalhes.arena_begun = false
_detalhes:GetPlayersInArena()
end
function _detalhes:LeftArena()
_detalhes.is_in_arena = false
_detalhes.arena_begun = false
if (_detalhes.start_arena) then
_detalhes:CancelTimer (_detalhes.start_arena, true)
end
end
function _detalhes:MakeEqualizeOnActor (player, realm, receivedActor)
+48 -3
View File
@@ -2175,6 +2175,18 @@
end
_current_combat.frags_need_refresh = true
--> detect dungeon boss
--if (_detalhes.zone_type == "party") then
-- local npcID = tonumber (alvo_serial:sub (6, 10), 16)
-- local boss_ids = _detalhes:GetBossIds (_detalhes.zone_id)
-- if (boss_ids) then
-- if (_detalhes.zone_id [npcID]) then
-- end
-- end
--end
--> player death
elseif (not _UnitIsFeignDeath (alvo_name)) then
@@ -2510,8 +2522,9 @@
-- PARSER
--serach key: ~parser ~event ~start ~inicio
_detalhes.parser_functions = {}
function _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA (...)
local zoneName, zoneType, _, _, _, _, _, zoneMapID = _GetInstanceInfo()
@@ -2520,6 +2533,14 @@
_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
if (_detalhes.is_in_arena and zoneType ~= "arena") then
_detalhes:LeftArena()
end
if (zoneType == "pvp") then
if (not _current_combat.pvp) then
@@ -2533,6 +2554,16 @@
_current_combat.is_pvp = {name = zoneName, zone = ZoneName, mapid = ZoneMapID}
_detalhes.listener:RegisterEvent ("CHAT_MSG_BG_SYSTEM_NEUTRAL")
end
elseif (zoneType == "arena") then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) zone type is arena.")
end
_detalhes.is_in_arena = true
_detalhes:EnteredInArena()
else
if (_detalhes:IsInInstance()) then
_detalhes.last_instance = zoneMapID
@@ -2715,8 +2746,22 @@
end
function _detalhes.parser_functions:START_TIMER (...)
if (_detalhes.debug) then
_detalhes:Msg ("(debug) found a timer.")
end
if (C_Scenario.IsChallengeMode() and _detalhes.overall_clear_newchallenge) then
_detalhes.historico:resetar_overall()
if (_detalhes.debug) then
_detalhes:Msg ("(debug) timer is a challenge mode start.")
end
elseif (_detalhes.is_in_arena) then
_detalhes:StartArenaSegment (...)
if (_detalhes.debug) then
_detalhes:Msg ("(debug) timer is a arena countdown.")
end
end
end
@@ -2862,7 +2907,7 @@
return _detalhes.cache_damage_group
end
function _detalhes:GetActorsOnHealingCache()
return _detalhes.cache_damage_group
return _detalhes.cache_healing_group
end
function _detalhes:ClearParserCache()
+14 -34
View File
@@ -33,35 +33,6 @@
current_plugin_object.Frame:Hide()
end
instance.current_raid_plugin = nil
--[[
if (_G.DetailsWaitForPluginFrame:IsShown()) then
_detalhes:CancelWaitForPlugin()
end
gump:Fade (instancia, 1, nil, "barras")
gump:Fade (instancia.scroll, 0)
if (instancia.need_rolagem) then
instancia:MostrarScrollBar (true)
else
--> precisa verificar se ele precisa a rolagem certo?
instancia:ReajustaGump()
end
--> calcula se existem barras, etc...
if (not instancia.rows_fit_in_window) then --> as barras não forma iniciadas ainda
instancia.rows_fit_in_window = _math_floor (instancia.baseframe.BoxBarrasAltura / instancia.row_height)
if (instancia.rows_created < instancia.rows_fit_in_window) then
for i = #instancia.barras+1, instancia.rows_fit_in_window do
local nova_barra = gump:CriaNovaBarra (instancia, i, 30) --> cria nova barra
nova_barra.texto_esquerdo:SetText (Loc ["STRING_NEWROW"])
nova_barra.statusbar:SetValue (100)
instancia.barras [i] = nova_barra
end
instancia.rows_created = #instancia.barras
end
end
--]]
end
function _detalhes:RaidPluginInstalled (plugin_name)
@@ -77,8 +48,15 @@
end
end
function _detalhes.RaidTables:EnableRaidMode (instance, plugin_name)
function _detalhes.RaidTables:EnableRaidMode (instance, plugin_name, from_cooltip, from_mode_menu)
--> check if came from cooltip
if (from_cooltip) then
self = _detalhes.RaidTables
instance = plugin_name
plugin_name = from_cooltip
end
--> set the mode
if (instance.modo == modo_alone) then
instance:SoloMode (false)
@@ -121,6 +99,11 @@
--last check if the name is okey
if (self:IsAvailable (plugin_name, instance)) then
self:switch (nil, plugin_name, instance)
if (from_mode_menu) then
--refresh
instance.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(instance.baseframe.cabecalho.modo_selecao)
end
else
if (not instance.wait_for_plugin) then
instance:CreateWaitForPlugin()
@@ -154,8 +137,6 @@
--check if is available
local in_use = self.PluginsInUse [ plugin_name ]
-- print (instance:GetId() .. " In Use By Instance: ", in_use )
if (in_use and in_use ~= instance:GetId()) then
return false
else
@@ -168,8 +149,7 @@
self.PluginsInUse [ absolute_name ] = instance_number
end
end
----------------
function _detalhes.RaidTables:switch (_, plugin_name, instance)
+1 -1
View File
@@ -276,7 +276,7 @@
_detalhes:TimeDataTick()
_detalhes:BrokerTick()
if (_detalhes.zone_type == "pvp" or _InCombatLockdown()) then
if (_detalhes.zone_type == "pvp" or _detalhes.zone_type == "arena" or _InCombatLockdown()) then
return true
elseif (_UnitAffectingCombat("player")) then
return true