- Added support for battlegrounds.

- Added option for disable showing battleground enemies when the window is in group mode.
- Added option to disable the sync from battleground score board.
- Enemies from a battleground match segment won't be erased when the player logout.
This commit is contained in:
Tercio
2015-05-29 16:18:39 -03:00
parent 562f215d64
commit 1113bfe3d2
13 changed files with 215 additions and 35 deletions
+4
View File
@@ -215,4 +215,8 @@ Open the bookmark panel on the top of the desired window.
_detalhes.switch:CloseMe()
Closes the bookmark panel.
_detalhes:GetArenaInfo (mapid)
returns a table containing the texture file and coords for a arena.
_detalhes:GetBattlegroundInfo (mapid)
returns a table containing the texture file and coords for a battleground.
+10
View File
@@ -97,6 +97,14 @@ bossInfo = combat:GetBossInfo()
returns the table containing informations about the boss encounter.
table members: name, zone, mapid, diff, diff_string, id, ej_instance_id, killed, index
battlegroudInfo = combat:GetPvPInfo()
returns the table containing infos about the battlegroud:
table members: name, mapid
arenaInfo = combat:GetArenaInfo()
returns the table containing infos about the arena:
table members: name, mapid, zone
time = combat:GetCombatTime()
returns the length of the combat in seconds, if the combat is in progress, returns the current elapsed time.
@@ -135,6 +143,8 @@ DETAILS_TOTALS_ONLYGROUP = true
total = combat:GetTotal ( attribute, subAttribute [, onlyGroup] )
returns the total of the requested attribute.
--------------------------------------------------------------------
Other Calls:
+30 -9
View File
File diff suppressed because one or more lines are too long
+9 -1
View File
@@ -74,6 +74,14 @@
return self.is_boss
end
function combate:GetPvPInfo()
return self.is_pvp
end
function combate:GetArenaInfo()
return self.is_arena
end
function combate:GetDeaths()
return self.last_events_tables
end
@@ -203,7 +211,7 @@
esta_tabela.pvp = true --> o who é da facção oposta ou foi dado mind control
end
else
esta_tabela.pvp = true --> se ambos são friendly, seria isso um PVP entre jogadores da mesma facções?
esta_tabela.pvp = true --> se ambos são friendly, seria isso um PVP entre jogadores da mesma facção?
end
end
+6 -5
View File
@@ -288,7 +288,6 @@
--[[exported]] function _detalhes:GetBarColor (actor)
actor = actor or self
if (actor.monster) then
return _unpack (_detalhes.class_colors.ENEMY)
@@ -1731,7 +1730,7 @@ end
end
if (instancia.row_info.texture_background_class_color) then
esta_barra.background:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b)
end
end
--icon
if (self.spellicon) then
@@ -1803,7 +1802,7 @@ end
else
esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA
end
else
else --alliance
if (UsingCustomLeftText) then
esta_barra.texto_esquerdo:SetText (_string_replace (instancia.row_info.textL_custom_text, esta_barra.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t"))
else
@@ -1811,9 +1810,11 @@ end
end
end
if (instancia.row_info.texture_class_colors) then
--if (instancia.row_info.texture_class_colors and not instancia.showing.is_pvp) then
esta_barra.textura:SetVertexColor (0.94117, 0, 0.01960, 1)
end
--elseif (instancia.showing.is_pvp) then
--esta_barra.background:SetVertexColor (1, 0, 0, 0.05)
--end
end
else
if (self.arena_ally) then
+5 -1
View File
@@ -184,6 +184,10 @@
if (_detalhes:IsATank (serial)) then
novo_objeto.isTank = true
end
else
if (_detalhes.pvp_as_group and _detalhes.tabela_vigente.is_pvp and _detalhes.is_in_battleground) then
novo_objeto.grupo = true
end
end
if (_detalhes.is_in_arena) then
@@ -259,7 +263,7 @@
end
--> é inimigo
if (_bit_band (flag, 0x00000040) ~= 0) then
if (_bit_band (flag, REACTION_HOSTILE) ~= 0) then
if (_bit_band (flag, OBJECT_TYPE_PLAYER) == 0 and _bit_band (flag, OBJECT_TYPE_PETGUARDIAN) == 0) then
novo_objeto.monster = true
end
+1 -1
View File
@@ -411,7 +411,7 @@
if (not _detalhes.tabela_vigente.is_boss) then
if (_detalhes.tabela_vigente.is_pvp) then
if (_detalhes.tabela_vigente.is_pvp or _detalhes.tabela_vigente.is_arena) then
_detalhes:FlagActorsOnPvPCombat()
end
+93 -6
View File
@@ -1,4 +1,3 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local _detalhes = _G._detalhes
@@ -2899,6 +2898,7 @@
_detalhes:LeftArena()
end
if (_detalhes.is_in_battleground and zoneType ~= "pvp") then
_detalhes.pvp_parser_frame:StopBgUpdater()
_detalhes.is_in_battleground = nil
end
@@ -2916,9 +2916,12 @@
if (not _in_combat) then
_detalhes:EntrarEmCombate()
_current_combat.pvp = true
_current_combat.is_pvp = {name = zoneName, mapid = ZoneMapID}
end
_current_combat.pvp = true
_current_combat.is_pvp = {name = zoneName, mapid = zoneMapID}
_detalhes.pvp_parser_frame:StartBgUpdater()
elseif (zoneType == "arena") then
@@ -2938,9 +2941,9 @@
_detalhes.last_instance = zoneMapID
end
if (_current_combat.pvp) then
_current_combat.pvp = false
end
--if (_current_combat.pvp) then
-- _current_combat.pvp = false
--end
end
_detalhes:SchedulePetUpdate (7)
@@ -3698,3 +3701,87 @@
return nil --_detalhes:NewError ("Couldn't find a combat object for passed parameters")
end
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> battleground parser
_detalhes.pvp_parser_frame:SetScript ("OnEvent", function (self, event)
self:ReadPvPData()
end)
function _detalhes:BgScoreUpdate()
RequestBattlefieldScoreData()
end
function _detalhes.pvp_parser_frame:StartBgUpdater()
if (not _detalhes.use_battleground_server_parser) then
return
end
_detalhes.pvp_parser_frame:RegisterEvent ("UPDATE_BATTLEFIELD_SCORE")
if (_detalhes.pvp_parser_frame.ticker) then
_detalhes:CancelTimer (_detalhes.pvp_parser_frame.ticker)
end
_detalhes.pvp_parser_frame.ticker = _detalhes:ScheduleRepeatingTimer ("BgScoreUpdate", 10)
end
function _detalhes.pvp_parser_frame:StopBgUpdater()
_detalhes.pvp_parser_frame:UnregisterEvent ("UPDATE_BATTLEFIELD_SCORE")
_detalhes:CancelTimer (_detalhes.pvp_parser_frame.ticker)
_detalhes.pvp_parser_frame.ticker = nil
end
function _detalhes.pvp_parser_frame:ReadPvPData()
local players = GetNumBattlefieldScores()
for i = 1, players do
local name, killingBlows, honorableKills, deaths, honorGained, faction, race, class, classToken, damageDone, healingDone, bgRating, ratingChange, preMatchMMR, mmrChange, talentSpec = GetBattlefieldScore (i)
local actor = _detalhes.tabela_vigente (1, name)
if (actor) then
actor.total = damageDone
actor.classe = classToken
else
local guid = _UnitGUID (name)
if (guid) then
local flag
if (_detalhes.faction_id == faction) then --> is from the same faction
flag = 0x514
else
flag = 0x548
end
actor = _current_damage_container:PegarCombatente (guid, name, flag, true)
actor.total = _detalhes:GetOrderNumber()
actor.classe = classToken
end
end
local actor = _detalhes.tabela_vigente (2, name)
if (actor) then
actor.total = healingDone
actor.classe = classToken
else
local guid = _UnitGUID (name)
if (guid) then
local flag
if (_detalhes.faction_id == faction) then --> is from the same faction
flag = 0x514
else
flag = 0x548
end
actor = _current_heal_container:PegarCombatente (guid, name, flag, true)
actor.total = _detalhes:GetOrderNumber()
actor.classe = classToken
end
end
end
end
+1 -1
View File
@@ -1006,7 +1006,7 @@
end
--> raid history window
--> raid history window ~history
function _detalhes:OpenRaidHistoryWindow()
if (not _G.DetailsRaidHistoryWindow) then
+2
View File
@@ -25,8 +25,10 @@ function _detalhes:ApplyBasicKeys()
self.faction = UnitFactionGroup ("player")
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
self.faction_id = 1
end
self.zone_type = nil
+2
View File
@@ -935,6 +935,8 @@ local default_profile = {
overall_clear_newchallenge = true,
overall_clear_logout = false,
close_shields = false,
pvp_as_group = true,
use_battleground_server_parser = true,
--> skins
standard_skin = false,
+29 -2
View File
@@ -4476,12 +4476,34 @@ function window:CreateFrame2()
window:CreateLineBackground2 (frame2, "cloudCaptureSlider", "cloudCaptureLabel", Loc ["STRING_OPTIONS_CLOUD_DESC"] )
--> battleground
--> remote parser
g:NewLabel (frame2, _, "$parentRemoteParserLabel", "RemoteParserLabel", Loc ["STRING_OPTIONS_BG_REMOTE_PARSER"], "GameFontHighlightLeft")
g:NewSwitch (frame2, _, "$parentRemoteParserSlider", "RemoteParserSlider", 60, 20, _, _, _detalhes.use_battleground_server_parser)
frame2.RemoteParserSlider:SetPoint ("left", frame2.RemoteParserLabel, "right", 2)
frame2.RemoteParserSlider.OnSwitch = function (self, _, value)
_detalhes.use_battleground_server_parser = value
end
window:CreateLineBackground2 (frame2, "RemoteParserSlider", "RemoteParserLabel", Loc ["STRING_OPTIONS_BG_REMOTE_PARSER_DESC"])
--> show all
g:NewLabel (frame2, _, "$parentShowAllLabel", "ShowAllLabel", Loc ["STRING_OPTIONS_BG_ALL_ALLY"], "GameFontHighlightLeft")
g:NewSwitch (frame2, _, "$parentShowAllSlider", "ShowAllSlider", 60, 20, _, _, _detalhes.pvp_as_group)
frame2.ShowAllSlider:SetPoint ("left", frame2.ShowAllLabel, "right", 2)
frame2.ShowAllSlider.OnSwitch = function (self, _, value)
_detalhes.pvp_as_group = value
end
window:CreateLineBackground2 (frame2, "ShowAllSlider", "ShowAllLabel", Loc ["STRING_OPTIONS_BG_ALL_ALLY_DESC"])
--> anchors
--general anchor
g:NewLabel (frame2, _, "$parentGeneralAnchor", "GeneralAnchorLabel", Loc ["STRING_OPTIONS_GENERAL_ANCHOR"], "GameFontNormal")
--captures anchor
g:NewLabel (frame2, _, "$parentDataCollectAnchor", "DataCollectAnchorLabel", Loc ["STRING_OPTIONS_DATACOLLECT_ANCHOR"], "GameFontNormal")
--battleground anchor
g:NewLabel (frame2, _, "$parentBattlegroundAnchor", "BattlegroundAnchorLabel", Loc ["STRING_OPTIONS_BG_ANCHOR"], "GameFontNormal")
local x = window.left_start_at
@@ -4502,8 +4524,6 @@ function window:CreateFrame2()
{"miscCaptureImage", 10},
{"auraCaptureImage", 11},
{"cloudCaptureLabel", 12, true},
}
window:arrange_menu (frame2, left_side, x, window.top_start_at)
@@ -4520,6 +4540,10 @@ function window:CreateFrame2()
{"OverallNewBossLabel", 7, true},
{"OverallNewChallengeLabel", 8},
{"OverallOnLogoutLabel", 9},
{"BattlegroundAnchorLabel", 10, true},
{"RemoteParserLabel", 11},
{"ShowAllLabel", 12},
}
window:arrange_menu (frame2, right_side, x, -90)
@@ -10100,6 +10124,9 @@ end --> if not window
_G.DetailsOptionsWindow2CaptureAuraSlider.MyObject:SetValue (_detalhes.capture_real ["aura"])
_G.DetailsOptionsWindow2CloudAuraSlider.MyObject:SetValue (_detalhes.cloud_capture)
_G.DetailsOptionsWindow2RemoteParserSlider.MyObject:SetValue (_detalhes.use_battleground_server_parser)
_G.DetailsOptionsWindow2ShowAllSlider.MyObject:SetValue (_detalhes.pvp_as_group)
--> window 3
local skin = editing_instance.skin
+23 -9
View File
@@ -5323,20 +5323,25 @@ local build_segment_list = function (self, elapsed)
CoolTip:SetWallpaper (2, [[Interface\BlackMarket\HotItemBanner]], unknown_boss_tex, unknown_boss_color, true)
end
elseif (thisCombat.is_arena) then
local file, coords = _detalhes:GetArenaInfo (thisCombat.is_arena.mapid)
enemy = thisCombat.is_arena.name
CoolTip:AddLine (thisCombat.is_arena.name, _, 1, "yellow")
elseif (thisCombat.is_pvp) then
CoolTip:AddLine (thisCombat.is_pvp.name, _, 1, "yellow")
enemy = thisCombat.is_pvp.name
CoolTip:AddIcon ([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 12, 0.251953125, 0.306640625, 0.205078125, 0.248046875)
local file, coords = _detalhes:GetBattlegroundInfo (thisCombat.is_pvp.mapid)
if (file) then
CoolTip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color)
end
elseif (thisCombat.is_arena) then
CoolTip:AddLine (thisCombat.is_arena.name, _, 1, "yellow")
enemy = thisCombat.is_arena.name
CoolTip:AddIcon ([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 12, 0.251953125, 0.306640625, 0.205078125, 0.248046875)
local file, coords = _detalhes:GetArenaInfo (thisCombat.is_arena.mapid)
if (file) then
CoolTip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color)
end
else
enemy = thisCombat.enemy
if (enemy) then
@@ -5396,6 +5401,7 @@ local build_segment_list = function (self, elapsed)
CoolTip:AddIcon ([[Interface\QUESTFRAME\UI-Quest-BulletPoint]], "main", "left", 16, 16, nil, nil, nil, nil, "orange")
local enemy = _detalhes.tabela_vigente.is_boss and _detalhes.tabela_vigente.is_boss.name or _detalhes.tabela_vigente.enemy or "--x--x--"
local file, coords
if (_detalhes.tabela_vigente.is_boss and _detalhes.tabela_vigente.is_boss.name) then
local portrait = _detalhes:GetBossPortrait (_detalhes.tabela_vigente.is_boss.mapid, _detalhes.tabela_vigente.is_boss.index)
@@ -5415,11 +5421,20 @@ local build_segment_list = function (self, elapsed)
end
end
end
elseif (_detalhes.tabela_vigente.is_pvp) then
enemy = _detalhes.tabela_vigente.is_pvp.name
file, coords = _detalhes:GetBattlegroundInfo (_detalhes.tabela_vigente.is_pvp.mapid)
elseif (_detalhes.tabela_vigente.is_arena) then
enemy = _detalhes.tabela_vigente.is_arena.name
file, coords = _detalhes:GetArenaInfo (_detalhes.tabela_vigente.is_arena.mapid)
else
CoolTip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsBackground]], segments_common_tex, segments_common_color)
end
CoolTip:AddLine (Loc ["STRING_SEGMENT_ENEMY"] .. ":", enemy, 2, "white", "white")
if (file) then
CoolTip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color)
end
if (not _detalhes.tabela_vigente:GetEndTime()) then
if (_detalhes.in_combat) then
@@ -5435,7 +5450,6 @@ local build_segment_list = function (self, elapsed)
CoolTip:AddLine (Loc ["STRING_SEGMENT_TIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white")
end
CoolTip:AddLine (Loc ["STRING_SEGMENT_START"] .. ":", _detalhes.tabela_vigente.data_inicio, 2, "white", "white")
CoolTip:AddLine (Loc ["STRING_SEGMENT_END"] .. ":", _detalhes.tabela_vigente.data_fim or "in progress", 2, "white", "white")