- Full rewrite on custom displays.

- Fixed the report bug on healing, energy and misc attributes.
- Fixed a bug where the player pet wasn't being tracked after logon in the game.

- NewAPI: instance:IsGroupMode() return if a instance is in group mode.
- NewAPI: instance:GetCustomObject() return the custom object current used by the isntance.
- NewAPI: _detalhes:GetEncounterActorsName (EJ_EncounterID) return a hash table with [bossname] -> {[model] [displayInfo]}
- NewAPI: actor:GetDisplayName() actor:Class() return the formated name; return the class.
- NewAPI: _detalhes:GetClassIcon (class) return the icon path and texcoords.
This commit is contained in:
tercio
2014-06-21 18:11:08 -03:00
parent 9d7b43fba6
commit b1cf458ca5
31 changed files with 4006 additions and 2031 deletions
+3
View File
@@ -148,6 +148,9 @@
--> record last event before dead
esta_tabela.last_events_tables = {}
--> players in the raid
esta_tabela.raid_roster = {}
--> frags
esta_tabela.frags = {}
esta_tabela.frags_need_refresh = false
+1331 -115
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -127,6 +127,10 @@
return amount
end
end
--[[ exported]] function _detalhes:IsGroupPlayer()
return self.grupo
end
--[[ exported]] function _detalhes:IsPlayer()
if (self.flag_original) then
@@ -210,7 +214,7 @@
return _unpack (_detalhes.class_colors.ARENA_ALLY)
else
if (not is_player_class [actor.classe] and _bit_band (actor.flag_original, 0x00000020) ~= 0) then --> neutral
if (not is_player_class [actor.classe] and actor.flag_original and _bit_band (actor.flag_original, 0x00000020) ~= 0) then --> neutral
return _unpack (_detalhes.class_colors.NEUTRAL)
else
return _unpack (_detalhes.class_colors [actor.classe])
+1 -1
View File
@@ -269,7 +269,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex
showing:remapear()
if (exportar) then
return total, keyName, instancia.top
return total, keyName, instancia.top, amount
end
if (amount < 1) then --> não há barras para mostrar
+1 -1
View File
@@ -359,7 +359,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo
showing:remapear()
if (exportar) then
return total, keyName, instancia.top
return total, keyName, instancia.top, amount
end
if (amount < 1) then --> não há barras para mostrar
+45 -12
View File
@@ -158,6 +158,10 @@ function _detalhes:IsRaidMode()
return self.modo == _detalhes._detalhes_props["MODO_RAID"]
end
function _detalhes:IsGroupMode()
return self.modo == _detalhes._detalhes_props["MODO_GROUP"]
end
function _detalhes:IsNormalMode()
if (self:GetInstanceId() == 2 or self:GetInstanceId() == 3) then
return true
@@ -166,6 +170,19 @@ function _detalhes:IsNormalMode()
end
end
function _detalhes:GetCustomObject()
return _detalhes.custom [self.sub_atributo]
end
function _detalhes:ResetAttribute()
if (self.iniciada) then
self:TrocaTabela (nil, 1, 1, true)
else
self.atributo = 1
self.sub_atributo = 1
end
end
------------------------------------------------------------------------------------------------------------------------
--> retorna se a instância esta ou não ativa
@@ -1312,7 +1329,10 @@ function _detalhes:InstanceReset (instance)
self:AtualizaSegmentos (self)
self:AtualizaSoloMode_AfertReset()
self:ResetaGump()
_detalhes:AtualizaGumpPrincipal (self, true) --atualiza todas as instancias
if (not _detalhes.initializing) then
_detalhes:AtualizaGumpPrincipal (self, true) --atualiza todas as instancias
end
end
function _detalhes:RefreshBars (instance)
@@ -1737,6 +1757,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
instancia.sub_atributo = sub_atributo
if (sub_attribute_click) then
--print ("aqui", instancia.sub_atributo)
instancia.sub_atributo_last [instancia.atributo] = instancia.sub_atributo
end
@@ -1928,21 +1949,32 @@ function _detalhes:MontaAtributosOption (instancia, func)
--> custom
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)
CoolTip:AddMenu (2, _detalhes.OpenCustomWindow, nil, nil, nil, Loc ["STRING_CUSTOM_NEW"], "Interface\\PaperDollInfoFrame\\Character-Plus", true)
CoolTip:AddMenu (2, _detalhes.OpenCustomDisplayWindow, nil, nil, nil, Loc ["STRING_CUSTOM_NEW"], "Interface\\PaperDollInfoFrame\\Character-Plus", true)
for index, custom in _ipairs (_detalhes.custom) do
CoolTip:AddMenu (2, func, nil, 5, index, custom.name, custom.icon, true)
CoolTip:AddLine (custom.name, nil, 2)
CoolTip:AddMenu (2, func, true, 5, index)
CoolTip:AddIcon (custom.icon, 2, 1, 16, 16)
end
--> set the wallpaper on custom
GameCooltip:SetWallpaper (2, [[Interface\TALENTFRAME\WarriorArm-TopLeft]], {1, 0, 0, 1}, {1, 1, 1, 0.1})
if (#_detalhes.custom == 0) then
CoolTip:SetLastSelected (2, 5, 1)
else
CoolTip:SetLastSelected (2, 5, instancia.sub_atributo_last [5]+1)
if (instancia.atributo == 5) then
CoolTip:SetLastSelected (2, 5, instancia.sub_atributo+1)
else
CoolTip:SetLastSelected (2, 5, instancia.sub_atributo_last [5]+1)
end
end
CoolTip:SetOption ("StatusBarTexture", [[Interface\AddOns\Details\images\bar4_vidro]])
CoolTip:SetLastSelected (1, atributo_ativo)
CoolTip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
CoolTip:SetWallpaper (1, [[Interface\SPELLBOOK\DeathKnightBlood-TopLeft]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
--CoolTip:SetWallpaper (1, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-Parchment-Horizontal-Desaturated]], nil, {1, 1, 1, 0.3})
return menu_principal, sub_menus
@@ -2235,7 +2267,8 @@ function _detalhes:monta_relatorio (este_relatorio, custom)
if (not is_current) then
--> assumindo que self é sempre uma instância aqui.
local total, keyName, keyNameSec, first, container_amount
local total, keyName, keyNameSec, first
local container_amount = 0
local atributo = self.atributo
local container = self.showing [atributo]._ActorTable
@@ -2261,6 +2294,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom)
end
elseif (atributo == 2) then --> heal
total, keyName, first, container_amount = _detalhes.atributo_heal:RefreshWindow (self, self.showing, true, true)
if (self.sub_atributo == 1) then
keyNameSec = "hps"
end
@@ -2281,10 +2315,8 @@ function _detalhes:monta_relatorio (este_relatorio, custom)
elseif (atributo == 5) then --> custom
if (_detalhes.custom [self.sub_atributo]) then
total, keyName, first, container_amount = _detalhes.atributo_custom:RefreshWindow (self, self.showing, true, {key = "custom"})
total = self.showing.totals [self.customName]
atributo = _detalhes.custom [self.sub_atributo].attribute
container = self.showing [atributo]._ActorTable
total, container, first, container_amount = _detalhes.atributo_custom:RefreshWindow (self, self.showing, true, true)
keyName = "value"
else
total, keyName, first, container_amount = _detalhes.atributo_damage:RefreshWindow (self, self.showing, true, true)
total = 1
@@ -2294,10 +2326,11 @@ function _detalhes:monta_relatorio (este_relatorio, custom)
--print (total, keyName, first, atributo, container_amount)
end
amt = math.min (amt, container_amount)
amt = math.min (amt, container_amount or 0)
for i = 1, amt do
local _thisActor = container [i]
if (_thisActor) then
local amount = _thisActor [keyName]
@@ -2403,7 +2436,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom)
atributo = _detalhes.custom [self.sub_atributo].attribute
end
local this_amt = math.min (#container, container_amount, amt)
local this_amt = math.min (#container, container_amount or 0, amt)
this_amt = #container - this_amt
for i = container_amount, this_amt, -1 do
+1 -1
View File
@@ -566,7 +566,7 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo
showing:remapear()
if (exportar) then
return total, keyName, instancia.top
return total, keyName, instancia.top, amount
end
if (amount < 1) then --> não há barras para mostrar
+39 -1
View File
@@ -12,6 +12,7 @@
local _setmetatable = setmetatable --lua local
local _getmetatable = getmetatable --lua local
local _bit_band = bit.band --lua local
local _table_sort = table.sort --lua local
local _ipairs = ipairs --lua local
local _pairs = pairs --lua local
@@ -62,6 +63,29 @@
return 0
end
end
function container_combatentes:GetTotal (key)
local total = 0
key = key or "total"
for _, actor in _ipairs (self._ActorTable) do
total = total + (actor [key] or 0)
end
return total
end
function container_combatentes:GetTotalOnRaid (key, combat)
local total = 0
key = key or "total"
local roster = combat.raid_roster
for _, actor in _ipairs (self._ActorTable) do
if (roster [actor.nome]) then
total = total + (actor [key] or 0)
end
end
return total
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> internals
@@ -435,7 +459,6 @@
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- grava o objeto no mapa do container
local size = #self._ActorTable+1
self._ActorTable [size] = novo_objeto --> grava na tabela de indexes
self._NameIndexTable [nome] = size --> grava no hash map o index deste jogador
@@ -490,6 +513,21 @@
end
end
local bykey
local sort = function (t1, t2)
return t1 [bykey] > t2 [bykey]
end
function container_combatentes:SortByKey (key)
bykey = key
_table_sort (self._ActorTable, sort)
self:remapear()
end
function container_combatentes:Remap()
return self:remapear()
end
function container_combatentes:remapear()
local mapa = self._NameIndexTable
local conteudo = self._ActorTable
+16
View File
@@ -132,6 +132,7 @@ function container_pets:BuscarPets()
end
end
end
elseif (_IsInGroup()) then
for i = 1, _GetNumGroupMembers()-1, 1 do
local pet_serial = _UnitGUID ("partypet"..i)
@@ -149,6 +150,21 @@ function container_pets:BuscarPets()
end
end
end
local pet_serial = _UnitGUID ("pet")
if (pet_serial) then
if (not _detalhes.tabela_pets.pets [pet_serial]) then
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("pet"), 0x1114, _UnitGUID ("player"), _detalhes.playername, 0x514)
end
end
else
local pet_serial = _UnitGUID ("pet")
if (pet_serial) then
if (not _detalhes.tabela_pets.pets [pet_serial]) then
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("pet"), 0x1114, _UnitGUID ("player"), _detalhes.playername, 0x514)
end
end
end
end