- Trash segments are now erased when player leave the game.

- Fixed few bugs on player comparison window.
- Options panel for plugins are now on Dialog strata.

- New API: combat:IsTrash() return true if the segment is a raid trash segment.
This commit is contained in:
tercio
2014-07-17 23:32:05 -03:00
parent e406fe464b
commit 0b8cab413e
8 changed files with 59 additions and 19 deletions
+3 -3
View File
@@ -4,9 +4,9 @@
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0", "LibHotCorners")
_detalhes.version = "v1.19.0 (core 22)"
_detalhes.userversion = "v1.19.0"
_detalhes.build_counter = 9 --it's 11 for release
_detalhes.version = "v1.19.1 (core 22)"
_detalhes.userversion = "v1.19.1"
_detalhes.build_counter = 9 --it's 12 for release
_detalhes.realversion = 22
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+4
View File
@@ -52,6 +52,10 @@
return self.TimeData [name]
end
function combate:IsTrash()
return self.is_trash
end
--return the name of the encounter or enemy
function combate:GetCombatName (try_find)
if (self.is_pvp) then
+23 -9
View File
@@ -4,6 +4,8 @@
local gump = _detalhes.gump
local _
_detalhes.custom_function_cache = {}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> local pointers
@@ -99,11 +101,19 @@ function atributo_custom:RefreshWindow (instance, combat, force, export)
--> be save reseting the values on every refresh
instance_container:ResetCustomActorContainer()
--> todo: cache custom scripts
local func = loadstring (custom_object.script)
local func
if (_detalhes.custom_function_cache [instance.customName]) then
func = _detalhes.custom_function_cache [instance.customName]
else
func = loadstring (custom_object.script)
if (not func) then
_detalhes.custom_function_cache [instance.customName] = func
end
end
if (not func) then
print ("error building the function.", func)
_detalhes:Msg (Loc ["STRING_CUSTOM_FUNC_INVALID"], func)
_detalhes:EndRefresh (instance, 0, combat, combat [1])
end
--> call the loop function
@@ -399,9 +409,9 @@ end
GameCooltip:AddLine (name)
GameCooltip:AddIcon (icon, 1, 1, 14, 14)
GameCooltip:AddLine ("Damage: ", spell.total) --> localize-me
GameCooltip:AddLine ("Hits: ", spell.counter) --> localize-me
GameCooltip:AddLine ("Critical Hits: ", spell.c_amt) --> localize-me
GameCooltip:AddLine (Loc ["STRING_DAMAGE"] .. ": ", spell.total)
GameCooltip:AddLine (Loc ["STRING_HITS"] .. ": ", spell.counter)
GameCooltip:AddLine (Loc ["STRING_CRITICAL_HITS"] .. ": ", spell.c_amt)
end
elseif (target) then
@@ -577,9 +587,9 @@ end
GameCooltip:AddLine (name)
GameCooltip:AddIcon (icon, 1, 1, 14, 14)
GameCooltip:AddLine ("Healing: ", spell.total) --> localize-me
GameCooltip:AddLine ("Hits: ", spell.counter) --> localize-me
GameCooltip:AddLine ("Critical Hits: ", spell.c_amt) --> localize-me
GameCooltip:AddLine (Loc ["STRING_HEAL"] .. ": ", spell.total)
GameCooltip:AddLine (Loc ["STRING_HITS"] .. ": ", spell.counter)
GameCooltip:AddLine (Loc ["STRING_CRITICAL_HITS"] .. ": ", spell.c_amt)
end
elseif (target) then
@@ -1177,6 +1187,10 @@ end
_detalhes.switch:OnRemoveCustom (index)
end
function _detalhes:ResetCustomFunctionsCache()
table.wipe (_detalhes.custom_function_cache)
end
function _detalhes.refresh:r_atributo_custom()
--> check for non used temp displays
+10 -1
View File
@@ -189,6 +189,15 @@
local historico_tabelas = _detalhes.tabela_historico.tabelas or {}
--> remove os segmentos de trash
for i = #historico_tabelas, 1, -1 do
local combate = historico_tabelas [i]
if (combate:IsTrash()) then
table.remove (historico_tabelas, i)
end
end
--> remove os segmentos > que o limite permitido para salvar
if (_detalhes.segments_amount_to_save and _detalhes.segments_amount_to_save < _detalhes.segments_amount) then
for i = _detalhes.segments_amount, _detalhes.segments_amount_to_save+1, -1 do
if (_detalhes.tabela_historico.tabelas [i]) then
@@ -518,7 +527,7 @@
end
end
--> panic mode
if (_detalhes.segments_panic_mode and _detalhes.can_panic_mode) then
if (_detalhes.tabela_vigente.is_boss) then
+3
View File
@@ -222,6 +222,7 @@
end
_detalhes.switch:OnRemoveCustom (index)
_detalhes:ResetCustomFunctionsCache()
end
function DetailsCustomPanel:StartEdit (custom_object, import)
@@ -320,6 +321,8 @@
elseif (string.len (name) > 32) then
return false, _detalhes:Msg (Loc ["STRING_CUSTOM_LONGNAME"])
end
_detalhes:ResetCustomFunctionsCache()
local icon = self.icon_image:GetTexture()
local desc = self.desc_field:GetText()
+12 -4
View File
@@ -1796,7 +1796,7 @@ function gump:CriaJanelaInfo()
if (data [2] > player_3_target_total) then
local diff = data [2] - player_3_target_total
local up = diff / player_3_target_total [2] * 100
local up = diff / player_3_target_total * 100
up = _math_floor (up)
if (up > 999) then
up = ">" .. 999
@@ -2431,9 +2431,13 @@ function gump:CriaJanelaInfo()
if (player2_misc) then
local spell = player2_misc.debuff_uptime_spell_tables and player2_misc.debuff_uptime_spell_tables._ActorTable and player2_misc.debuff_uptime_spell_tables._ActorTable [spellid]
if (spell and spell.uptime and player1_uptime) then
if (spell and spell.uptime) then
local minutos, segundos = _math_floor (spell.uptime/60), _math_floor (spell.uptime%60)
if (player1_uptime > spell.uptime) then
if (not player1_uptime) then
frame2.tooltip.uptime_label2:SetText (minutos .. "m" .. segundos .. "s (0%)|r")
elseif (player1_uptime > spell.uptime) then
local diff = player1_uptime - spell.uptime
local up = diff / spell.uptime * 100
up = _math_floor (up)
@@ -2524,7 +2528,11 @@ function gump:CriaJanelaInfo()
local spell = player3_misc.debuff_uptime_spell_tables and player3_misc.debuff_uptime_spell_tables._ActorTable and player3_misc.debuff_uptime_spell_tables._ActorTable [spellid]
if (spell and spell.uptime) then
local minutos, segundos = _math_floor (spell.uptime/60), _math_floor (spell.uptime%60)
if (player1_uptime > spell.uptime) then
if (not player1_uptime) then
frame3.tooltip.uptime_label2:SetText (minutos .. "m" .. segundos .. "s (0%)|r")
elseif (player1_uptime > spell.uptime) then
local diff = player1_uptime - spell.uptime
local up = diff / spell.uptime * 100
up = _math_floor (up)
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -33,7 +33,7 @@ do
local options_frame = CreateFrame ("frame", "EncounterDetailsOptionsWindow", UIParent, "ButtonFrameTemplate")
tinsert (UISpecialFrames, "EncounterDetailsOptionsWindow")
options_frame:SetSize (500, 200)
options_frame:SetFrameStrata ("HIGH")
options_frame:SetFrameStrata ("DIALOG")
options_frame:SetScript ("OnMouseDown", function(self) self:StartMoving()end)
options_frame:SetScript ("OnMouseUp", function(self) self:StopMovingOrSizing()end)
options_frame:SetMovable (true)