From 449d7f8a2594378550dbcbda95091f91221119a0 Mon Sep 17 00:00:00 2001 From: tercio Date: Tue, 16 Dec 2014 14:41:34 -0200 Subject: [PATCH] - Elapsed combat time now uses Float numbers instead of Integer. --- boot.lua | 14 ++++++++----- classes/classe_combate.lua | 41 ++++++++++++++++++++++---------------- classes/classe_damage.lua | 1 + core/control.lua | 27 +++++++++++++++---------- core/meta.lua | 6 ++++-- core/parser.lua | 38 +++++++++++++++++++++-------------- core/timemachine.lua | 13 +++++------- core/windows.lua | 6 ++++-- functions/slash.lua | 4 ++-- gumps/janela_principal.lua | 14 ++++++------- 10 files changed, 95 insertions(+), 69 deletions(-) diff --git a/boot.lua b/boot.lua index 84b2bb73..54a5f504 100644 --- a/boot.lua +++ b/boot.lua @@ -1,11 +1,11 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> global name declaration - + _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 282 --it's 281 for release - _detalhes.userversion = "v3.5.1" - _detalhes.realversion = 49 --core version + _detalhes.build_counter = 284 --it's 284 for release + _detalhes.userversion = "v3.6.0" + _detalhes.realversion = 50 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -18,6 +18,10 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ +|cFFFFFF00v3.6.0 (|cFFFFCC00Dec 16, 2014|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Elapsed combat time now uses Float numbers instead of Integer, this might bug something, be aware of anomalies.\n +This change makes fun things, now we can make Dps and Hps update really quick and also increase the accuracy with warcraftlogs.\n\n + |cFFFFFF00v3.5.0 (|cFFFFCC00Dec 14, 2014|r|cFFFFFF00)|r:\n\n |cFFFFFF00-|r Fixed tooltip for Auras and Voidzones, now shows sorted by damage and time.\n\n |cFFFFFF00-|r More fixes for Korgath encounter on Highmaul.\n\n @@ -28,7 +32,7 @@ do |cFFFFFF00-|r Clicking on report button when the report window is already open, make it close.\n\n --]] - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.5.1 (|cFFFFCC00Dec 16, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed few accuracy on miss spells.\n\n|cFFFFFF00v3.5.0 (|cFFFFCC00Dec 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltip for Auras and Voidzones, now shows sorted by damage and time.\n\n|cFFFFFF00-|r More fixes for Korgath encounter on Highmaul.\n\n|cFFFFFF00-|r Added slash commands: 'reset' 'config'.\n\n|cFFFFFF00-|r Spell bars on Player Details Window now is painted with the spell spellschool color.\n\n|cFFFFFF00-|r Multistrike doesn't count any more for spell's Minimal Damage.\n\n|cFFFFFF00-|r Resource display got an tooltip which shows what resource is and resource gained per minute.\n\n|cFFFFFF00-|r Clicking on report button when the report window is already open, make it close.\n\n|cFFFFFF00v3.4.7 (|cFFFFCC00Dec 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs plugin got updates on Endurance Player Value and few bug fixes.\n\n|cFFFFFF00-|r Max Window Amount options can new be set to 1, before the minimum was 3.\n\n|cFFFFFF00-|r Fixed a problem with friendly fire tooltip where sometimes it wasn't showing up.\n\n|cFFFFFF00-|r Fixed cooldowns tooltip which wasn't showing rounded numbers (49.99 instead of 50).\n\n|cFFFFFF00-|r Fixed Warrior's Shield Block which wasn't being count as a cooldown.\n\n|cFFFFFF00-|r Fixed a problem where sometimes when a hunter pull and reset the boss right after, was causing segments to merge.\n\n|cFFFFFF00v3.4.4 (|cFFFFCC00Dec 05, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a issue with Ko'Ragh boss on Highmaul raid.\n\n|cFFFFFF00-|r Few changes on Bookmark panel.\n\n|cFFFFFF00v3.4.3 (|cFFFFCC00Dec 02, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Removed 'Simple Gray' skin.\n\n|cFFFFFF00-|r Addde new skin: 'Forced Square'.\n\n|cFFFFFF00-|r 'Default Skin' got renamed to 'WoW Interface'.\n\n|cFFFFFF00v3.4.2 (|cFFFFCC00Dec 01, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a bug with menu desaturation where erase and close buttons stay colored after clicking on it.\n\n|cFFFFFF00-|r Fixed stretch where sometimes after release the window, all exceeded bars shows up and fade in again.\n\n|cFFFFFF00-|r Fixed a bug with the +- buttons on the window's scale option.\n\n|cFFFFFF00-|r Fixed the border for sub menus on mode menu.\n\n|cFFFFFF00v3.4.0 (|cFFFFCC00Nov 29, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed custom displays ignoring 'target' setted.\n\n|cFFFFFF00-|r Fixed plugins showing its icon even when auto hide menus is enabled.\n\n|cFFFFFF00-|r .Updates slash command 'worldboss' now it shows Draenor bosses.\n\n|cFFFFFF00v3.3.0 (|cFFFFCC00Nov 25, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 3D models for the bars in the window. The options are at Appearance -> Rows: Advanced.\n\n|cFFFFFF00-|r Now when showing custom displays, clicking on a bar report what is shown on bar's tooltip.\n\n|cFFFFFF00-|r More fixes for dungeon bosses identification.\n\n|cFFFFFF00-|r Fixed a tooltip bug with Debuff Uptime and Aura & Voidzone displays.\n\n|cFFFFFF00-|r Fixed Player Details Window for friendly fire and damage taken.\n\n|cFFFFFF00-|r Fixed Molten Core Raid Finder version where all bosses was considered trash segments.\n\n|cFFFFFF00v3.2.4 (|cFFFFCC00Nov 19, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r More fixes for dungeon bosses recognition.\n\n|cFFFFFF00-|r Fixes for few errors during combat parser.\n\n|cFFFFFF00v3.2.3 (|cFFFFCC00Nov 18, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed Monk's Stagger ability which was counting as damage done.\n\n|cFFFFFF00-|r Added WoD dungeon information, this fixes dungeon bosses being assigned as 'trash cleanup'.\n\n|cFFFFFF00-|r Added more information on API.txt document (is in Details! root folder).\n\n|cFFFFFF00v3.2.1 (|cFFFFCC00Nov 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Custom Displays updated to track WoD potions.\n\n|cFFFFFF00-|r Added Feedback panel at options panel.\n\n|cFFFFFF00v3.2.0 (|cFFFFCC00Nov 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major changes on the way Details! store information, these changes saves up to 40% memory and 4% cpu usage.\n\n|cFFFFFF00-|r Fixed problem with pet's healing messing with the owner activity time.\n\n|cFFFFFF00-|r Added Energy -> Resources.\n\n|cFFFFFF00-|r Fixed combat initialization when the player start casting a Dot spell.\n\n|cFFFFFF00-|r Added new custom display: Damage Taken By Spell.\n\n|cFFFFFF00v2.2.3 (|cFFFFCC00Oct 26, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the healing done problem with Priest's Spirit of Redemption.\n\n|cFFFFFF00-|r Fixed avoidance by absorb when the hit missed was a multistrike hit.\n\n|cFFFFFF00-|r Fixed a script time out problem when erasing data while in combat.\n\n|cFFFFFF00-|r Fixed bug with interrupt tooltip when the player have a pet.\n\n|cFFFFFF00v2.2.1 (|cFFFFCC00Oct 22, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the gap between the button and its menu which sometimes traveling the mouse between them was activating tooltips from window's bars.\n\n|cFFFFFF00-|r Fixed an annoying menu blink when the window was near the right side of the screen.\n\n|cFFFFFF00-|r Fixed the stretch grab which was over other windows even with the 'stretch always on top' option disabled.\n\n|cFFFFFF00-|r Few fixes on healing done from absorbs.\n\n|cFFFFFF00v2.1.6 (|cFFFFCC00Oct 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed death's tooltip which wasn't respecting tooltip's configuration set on options panel.\n\n|cFFFFFF00-|r Now when the window is close to the top of the screen, menus will anchor on bottom side of the menu icons.\n\n|cFFFFFF00-|r Added micro displays options on Window Settings bracket.\n\n|cFFFFFF00-|r Fixed the problem with bar's custom texts.\n\n|cFFFFFF00-|r Lua functions inside custom texts, Chart Data scripts and Custom Displays scripts are now protected calls and won't break the addon functionality if an error occurs. Unfortunately we still doesn't have a documentation for Details! API.\n\n|cFFFFFF00-|r Fixed an incomum bug with tank avoidance tables.\n\n|cFFFFFF00-|r Tiny Threat: added option to use class colors instead of green-to-red colors.\n\n|cFFFFFF00-|r Added option to enable shadows on toolbar's buttons.\n\n|cFFFFFF00-|r Added option to set the specing between each button on toolbar.\n\n|cFFFFFF00-|r Finally we merged the left and right menus into only one with 6 icons.\n\n|cFFFFFF00-|r Removed window button and added a new option bracket to manage windows under Mode Menu.\n\n|cFFFFFF00-|r Few changes on 'Default Skin', 'Minimalistic', 'Simple Gray' and 'ElvUI Frame Style BW' (need reaply).\n\n|cFFFFFF00- Important:|r If the menus is out of the position, just reaply the skin.\n\nv2.0.15 (|cFFFFCC00Oct 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltips where sometimes it wans't showing at all.\n\n|cFFFFFF00-|r Fixed the healing done amount on Malkorok encounter.\n\nv2.0.14 (|cFFFFCC00Oct 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added pre-potion recognition for WoD pots.\n\n|cFFFFFF00-|r Added spell list for Blackrock Foundry encounters." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.6.0 (|cFFFFCC00Dec 16, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Elapsed combat time now uses Float numbers instead of Integer, this might bug something, be aware of anomalies.\nThis change makes fun things, now we can make Dps and Hps update really quick and also increase the accuracy with warcraftlogs.\n\n|cFFFFFF00v3.5.1 (|cFFFFCC00Dec 16, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed few accuracy on miss spells.\n\n|cFFFFFF00v3.5.0 (|cFFFFCC00Dec 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltip for Auras and Voidzones, now shows sorted by damage and time.\n\n|cFFFFFF00-|r More fixes for Korgath encounter on Highmaul.\n\n|cFFFFFF00-|r Added slash commands: 'reset' 'config'.\n\n|cFFFFFF00-|r Spell bars on Player Details Window now is painted with the spell spellschool color.\n\n|cFFFFFF00-|r Multistrike doesn't count any more for spell's Minimal Damage.\n\n|cFFFFFF00-|r Resource display got an tooltip which shows what resource is and resource gained per minute.\n\n|cFFFFFF00-|r Clicking on report button when the report window is already open, make it close.\n\n|cFFFFFF00v3.4.7 (|cFFFFCC00Dec 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs plugin got updates on Endurance Player Value and few bug fixes.\n\n|cFFFFFF00-|r Max Window Amount options can new be set to 1, before the minimum was 3.\n\n|cFFFFFF00-|r Fixed a problem with friendly fire tooltip where sometimes it wasn't showing up.\n\n|cFFFFFF00-|r Fixed cooldowns tooltip which wasn't showing rounded numbers (49.99 instead of 50).\n\n|cFFFFFF00-|r Fixed Warrior's Shield Block which wasn't being count as a cooldown.\n\n|cFFFFFF00-|r Fixed a problem where sometimes when a hunter pull and reset the boss right after, was causing segments to merge.\n\n|cFFFFFF00v3.4.4 (|cFFFFCC00Dec 05, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a issue with Ko'Ragh boss on Highmaul raid.\n\n|cFFFFFF00-|r Few changes on Bookmark panel.\n\n|cFFFFFF00v3.4.3 (|cFFFFCC00Dec 02, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Removed 'Simple Gray' skin.\n\n|cFFFFFF00-|r Addde new skin: 'Forced Square'.\n\n|cFFFFFF00-|r 'Default Skin' got renamed to 'WoW Interface'.\n\n|cFFFFFF00v3.4.2 (|cFFFFCC00Dec 01, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a bug with menu desaturation where erase and close buttons stay colored after clicking on it.\n\n|cFFFFFF00-|r Fixed stretch where sometimes after release the window, all exceeded bars shows up and fade in again.\n\n|cFFFFFF00-|r Fixed a bug with the +- buttons on the window's scale option.\n\n|cFFFFFF00-|r Fixed the border for sub menus on mode menu.\n\n|cFFFFFF00v3.4.0 (|cFFFFCC00Nov 29, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed custom displays ignoring 'target' setted.\n\n|cFFFFFF00-|r Fixed plugins showing its icon even when auto hide menus is enabled.\n\n|cFFFFFF00-|r .Updates slash command 'worldboss' now it shows Draenor bosses.\n\n|cFFFFFF00v3.3.0 (|cFFFFCC00Nov 25, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 3D models for the bars in the window. The options are at Appearance -> Rows: Advanced.\n\n|cFFFFFF00-|r Now when showing custom displays, clicking on a bar report what is shown on bar's tooltip.\n\n|cFFFFFF00-|r More fixes for dungeon bosses identification.\n\n|cFFFFFF00-|r Fixed a tooltip bug with Debuff Uptime and Aura & Voidzone displays.\n\n|cFFFFFF00-|r Fixed Player Details Window for friendly fire and damage taken.\n\n|cFFFFFF00-|r Fixed Molten Core Raid Finder version where all bosses was considered trash segments.\n\n|cFFFFFF00v3.2.4 (|cFFFFCC00Nov 19, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r More fixes for dungeon bosses recognition.\n\n|cFFFFFF00-|r Fixes for few errors during combat parser.\n\n|cFFFFFF00v3.2.3 (|cFFFFCC00Nov 18, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed Monk's Stagger ability which was counting as damage done.\n\n|cFFFFFF00-|r Added WoD dungeon information, this fixes dungeon bosses being assigned as 'trash cleanup'.\n\n|cFFFFFF00-|r Added more information on API.txt document (is in Details! root folder).\n\n|cFFFFFF00v3.2.1 (|cFFFFCC00Nov 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Custom Displays updated to track WoD potions.\n\n|cFFFFFF00-|r Added Feedback panel at options panel.\n\n|cFFFFFF00v3.2.0 (|cFFFFCC00Nov 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major changes on the way Details! store information, these changes saves up to 40% memory and 4% cpu usage.\n\n|cFFFFFF00-|r Fixed problem with pet's healing messing with the owner activity time.\n\n|cFFFFFF00-|r Added Energy -> Resources.\n\n|cFFFFFF00-|r Fixed combat initialization when the player start casting a Dot spell.\n\n|cFFFFFF00-|r Added new custom display: Damage Taken By Spell.\n\n|cFFFFFF00v2.2.3 (|cFFFFCC00Oct 26, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the healing done problem with Priest's Spirit of Redemption.\n\n|cFFFFFF00-|r Fixed avoidance by absorb when the hit missed was a multistrike hit.\n\n|cFFFFFF00-|r Fixed a script time out problem when erasing data while in combat.\n\n|cFFFFFF00-|r Fixed bug with interrupt tooltip when the player have a pet.\n\n|cFFFFFF00v2.2.1 (|cFFFFCC00Oct 22, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the gap between the button and its menu which sometimes traveling the mouse between them was activating tooltips from window's bars.\n\n|cFFFFFF00-|r Fixed an annoying menu blink when the window was near the right side of the screen.\n\n|cFFFFFF00-|r Fixed the stretch grab which was over other windows even with the 'stretch always on top' option disabled.\n\n|cFFFFFF00-|r Few fixes on healing done from absorbs.\n\n|cFFFFFF00v2.1.6 (|cFFFFCC00Oct 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed death's tooltip which wasn't respecting tooltip's configuration set on options panel.\n\n|cFFFFFF00-|r Now when the window is close to the top of the screen, menus will anchor on bottom side of the menu icons.\n\n|cFFFFFF00-|r Added micro displays options on Window Settings bracket.\n\n|cFFFFFF00-|r Fixed the problem with bar's custom texts.\n\n|cFFFFFF00-|r Lua functions inside custom texts, Chart Data scripts and Custom Displays scripts are now protected calls and won't break the addon functionality if an error occurs. Unfortunately we still doesn't have a documentation for Details! API.\n\n|cFFFFFF00-|r Fixed an incomum bug with tank avoidance tables.\n\n|cFFFFFF00-|r Tiny Threat: added option to use class colors instead of green-to-red colors.\n\n|cFFFFFF00-|r Added option to enable shadows on toolbar's buttons.\n\n|cFFFFFF00-|r Added option to set the specing between each button on toolbar.\n\n|cFFFFFF00-|r Finally we merged the left and right menus into only one with 6 icons.\n\n|cFFFFFF00-|r Removed window button and added a new option bracket to manage windows under Mode Menu.\n\n|cFFFFFF00-|r Few changes on 'Default Skin', 'Minimalistic', 'Simple Gray' and 'ElvUI Frame Style BW' (need reaply)." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_combate.lua b/classes/classe_combate.lua index 457182f1..c19a5cd4 100644 --- a/classes/classe_combate.lua +++ b/classes/classe_combate.lua @@ -17,6 +17,7 @@ local _table_remove = table.remove -- lua local local _rawget = rawget local _math_max = math.max + local _GetTime = GetTime ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> constants @@ -31,7 +32,8 @@ local REACTION_HOSTILE = 0x00000040 local CONTROL_PLAYER = 0x00000100 - local _tempo = time() + --local _tempo = time() + local _tempo = _GetTime() ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> api functions @@ -108,11 +110,26 @@ if (self.end_time) then return _math_max (self.end_time - self.start_time, 0.1) elseif (self.start_time and _detalhes.in_combat) then - return _math_max (_tempo - self.start_time, 0.1) + --return _math_max (_tempo - self.start_time, 0.1) + return _math_max (_GetTime() - self.start_time, 0.1) else return 0.1 end end + + function combate:GetStartTime() + return self.start_time + end + function combate:SetStartTime (t) + self.start_time = t + end + + function combate:GetEndTime() + return self.end_time + end + function combate:SetEndTime (t) + self.end_time = t + end --return the total of a specific attribute local power_table = {0, 1, 3, 6} @@ -209,7 +226,8 @@ -- a tabela sem o tempo de inicio é a tabela descartavel do inicio do addon if (iniciada) then - esta_tabela.start_time = _tempo + --esta_tabela.start_time = _tempo + esta_tabela.start_time = _GetTime() esta_tabela.end_time = nil else esta_tabela.start_time = 0 @@ -314,9 +332,6 @@ jogador:TerminarTempo() jogador:Iniciar (false) --trava o dps do jogador else - - --print ("Tempo NAO Iniciando:", self.nome, self.start_time, self.end_time, self.delay, _tempo) - if (jogador.start_time == 0) then jogador.start_time = _tempo end @@ -337,16 +352,8 @@ end function combate:seta_tempo_decorrido() - if (self.playing_solo) then - local damage_actor = self (1, _detalhes.playername) - if (damage_actor) then - self.end_time = damage_actor.last_event or _tempo - else - self.end_time = _tempo - end - else - self.end_time = _tempo - end + --self.end_time = _tempo + self.end_time = _GetTime() end function _detalhes.refresh:r_combate (tabela_combate, shadow) @@ -402,7 +409,7 @@ combate1 [4].need_refresh = true --> reduz o tempo - combate1.start_time = combate1.start_time + (combate2.end_time - combate2.start_time) + combate1.start_time = combate1.start_time + combate2:GetCombatTime() --> apaga as mortes da luta diminuida local amt_mortes = #combate2.last_events_tables --> quantas mortes teve nessa luta diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index 49dd49b9..b549aaf8 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -1326,6 +1326,7 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, self.last_dps = dps end else + --print ("calculando dps") dps = damage_total / combat_time self.last_dps = dps end diff --git a/core/control.lua b/core/control.lua index 57927da0..73e73919 100644 --- a/core/control.lua +++ b/core/control.lua @@ -25,6 +25,7 @@ local _UnitExists = UnitExists --wow api local local _UnitGUID = UnitGUID --wow api local local _UnitName = UnitName --wow api local + local _GetTime = GetTime local _IsAltKeyDown = IsAltKeyDown local _IsShiftKeyDown = IsShiftKeyDown @@ -253,11 +254,13 @@ end --> conta o tempo na tabela overall -- start time at overall table - if (_detalhes.tabela_overall.end_time) then - _detalhes.tabela_overall.start_time = _tempo - (_detalhes.tabela_overall.end_time - _detalhes.tabela_overall.start_time) - _detalhes.tabela_overall.end_time = nil + if (_detalhes.tabela_overall:GetEndTime()) then + --_detalhes.tabela_overall:SetStartTime (_tempo - (_detalhes.tabela_overall.end_time - _detalhes.tabela_overall.start_time)) + _detalhes.tabela_overall:SetStartTime (_GetTime() - _detalhes.tabela_overall:GetCombatTime()) + _detalhes.tabela_overall:SetEndTime (nil) else - _detalhes.tabela_overall.start_time = _tempo + --_detalhes.tabela_overall.start_time = _tempo + _detalhes.tabela_overall:SetStartTime (_GetTime()) end --> re-lock nos tempos da tabela passada -- lock again last table times @@ -409,8 +412,8 @@ _detalhes.tabela_vigente:seta_data (_detalhes._detalhes_props.DATA_TYPE_END) --> salva hora, minuto, segundo do fim da luta _detalhes.tabela_overall:seta_data (_detalhes._detalhes_props.DATA_TYPE_END) --> salva hora, minuto, segundo do fim da luta - _detalhes.tabela_vigente:seta_tempo_decorrido() --> salva o end_time - _detalhes.tabela_overall:seta_tempo_decorrido() --seta o end_time + _detalhes.tabela_vigente:seta_tempo_decorrido() + _detalhes.tabela_overall:seta_tempo_decorrido() --> drop last events table to garbage collector _detalhes.tabela_vigente.player_last_events = {} @@ -485,7 +488,7 @@ end if (from_encounter_end) then - _detalhes.tabela_vigente.end_time = _detalhes.encounter_table ["end"] + _detalhes.tabela_vigente:SetEndTime (_detalhes.encounter_table ["end"]) end --> encounter boss function @@ -528,7 +531,7 @@ _detalhes.CloseSoloDebuffs() end - local tempo_do_combate = _detalhes.tabela_vigente.end_time - _detalhes.tabela_vigente.start_time + local tempo_do_combate = _detalhes.tabela_vigente:GetCombatTime() local invalid_combat --if ( tempo_do_combate >= _detalhes.minimum_combat_time) then --> tempo minimo precisa ser 5 segundos pra acrecentar a tabela ao historico @@ -542,9 +545,11 @@ invalid_combat = _detalhes.tabela_vigente _detalhes.tabela_vigente = _detalhes.tabela_historico.tabelas[1] --> pega a tabela do ultimo combate - if (_detalhes.tabela_vigente.start_time == 0) then - _detalhes.tabela_vigente.start_time = _detalhes._tempo - _detalhes.tabela_vigente.end_time = _detalhes._tempo + if (_detalhes.tabela_vigente:GetStartTime() == 0) then + --_detalhes.tabela_vigente.start_time = _detalhes._tempo + _detalhes.tabela_vigente:SetStartTime (_GetTime()) + --_detalhes.tabela_vigente.end_time = _detalhes._tempo + _detalhes.tabela_vigente:SetEndTime (_GetTime()) end _detalhes.tabela_vigente.resincked = true diff --git a/core/meta.lua b/core/meta.lua index 07b08535..3063eb01 100644 --- a/core/meta.lua +++ b/core/meta.lua @@ -78,8 +78,10 @@ end --> tempo padrao do overall - combate_overall.start_time = _tempo - combate_overall.end_time = _tempo + --combate_overall.start_time = _tempo + combate_overall.start_time = GetTime() + --combate_overall.end_time = _tempo + combate_overall.end_time = GetTime() --> inicia a recuperação das tabelas e montagem do overall if (#tabelas_do_historico > 0) then diff --git a/core/parser.lua b/core/parser.lua index c53c778c..bb2af47b 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -24,6 +24,7 @@ local _IsInGroup = IsInGroup --wow api local local _GetNumGroupMembers = GetNumGroupMembers --wow api local local _UnitGroupRolesAssigned = UnitGroupRolesAssigned --wow api local + local _GetTime = GetTime local _cstr = string.format --lua local local _table_insert = table.insert --lua local @@ -2206,7 +2207,7 @@ if (_hook_deaths) then --> send event to registred functions - local death_at = _tempo - _current_combat.start_time + local death_at = _tempo - _current_combat:GetStartTime() local max_health = _UnitHealthMax (alvo_name) for _, func in _ipairs (_hook_deaths_container) do @@ -2241,7 +2242,7 @@ esta_morte [#esta_morte+1] = t end - local decorrido = _tempo - _current_combat.start_time + local decorrido = _tempo - _current_combat:GetStartTime() local minutos, segundos = _math_floor (decorrido/60), _math_floor (decorrido%60) local t = {esta_morte, time, este_jogador.nome, este_jogador.classe, _UnitHealthMax (alvo_name), minutos.."m "..segundos.."s", ["dead"] = true, ["last_cooldown"] = este_jogador.last_cooldown, ["dead_at"] = decorrido} @@ -2548,7 +2549,7 @@ end _detalhes.latest_ENCOUNTER_END = _detalhes.latest_ENCOUNTER_END or 0 - if (_detalhes.latest_ENCOUNTER_END + 10 > _detalhes._tempo) then + if (_detalhes.latest_ENCOUNTER_END + 10 > _GetTime()) then return end @@ -2570,7 +2571,8 @@ --print (encounterID, encounterName, difficultyID, raidSize) _detalhes.encounter_table.phase = 1 - _detalhes.encounter_table ["start"] = time() + --_detalhes.encounter_table ["start"] = time() + _detalhes.encounter_table ["start"] = _GetTime() _detalhes.encounter_table ["end"] = nil _detalhes.encounter_table.id = encounterID @@ -2580,7 +2582,7 @@ _detalhes.encounter_table.zone = zoneName _detalhes.encounter_table.mapid = zoneMapID - if (dbm_mod and dbm_time == time()) then + if (dbm_mod and dbm_time == time()) then --pode ser time() é usado no start pra saber se foi no mesmo segundo. _detalhes.encounter_table.DBM_Mod = dbm_mod end @@ -2590,10 +2592,12 @@ if (type (encounter_start_table.delay) == "function") then local delay = encounter_start_table.delay() if (delay) then - _detalhes.encounter_table ["start"] = time() + delay + --_detalhes.encounter_table ["start"] = time() + delay + _detalhes.encounter_table ["start"] = _GetTime() + delay end else - _detalhes.encounter_table ["start"] = time() + encounter_start_table.delay + --_detalhes.encounter_table ["start"] = time() + encounter_start_table.delay + _detalhes.encounter_table ["start"] = _GetTime() + encounter_start_table.delay end end if (encounter_start_table.func) then @@ -2626,9 +2630,11 @@ if (_detalhes.latest_ENCOUNTER_END + 15 > _detalhes._tempo) then return end - _detalhes.latest_ENCOUNTER_END = _detalhes._tempo + --_detalhes.latest_ENCOUNTER_END = _detalhes._tempo + _detalhes.latest_ENCOUNTER_END = _GetTime() - _detalhes.encounter_table ["end"] = time() - 0.4 + --_detalhes.encounter_table ["end"] = time() - 0.4 + _detalhes.encounter_table ["end"] = _GetTime() - 0.4 local _, _, _, _, _, _, _, zoneMapID = _GetInstanceInfo() @@ -2641,9 +2647,8 @@ _detalhes:SairDoCombate (false, true) --wipe end else - if ((_detalhes.tabela_vigente.end_time or 0) + 2 >= _detalhes.encounter_table ["end"]) then - --_detalhes.tabela_vigente.start_time = _detalhes.encounter_table ["start"] - _detalhes.tabela_vigente.end_time = _detalhes.encounter_table ["end"] + if ((_detalhes.tabela_vigente:GetEndTime() or 0) + 2 >= _detalhes.encounter_table ["end"]) then + _detalhes.tabela_vigente:SetEndTime (_detalhes.encounter_table ["end"]) _detalhes:AtualizaGumpPrincipal (-1, true) end end @@ -2655,9 +2660,12 @@ local frase = _select (1, ...) --> reset combat timer if ( (frase:find ("The battle") and frase:find ("has begun!") ) and _current_combat.pvp) then - local tempo_do_combate = _tempo - _current_combat.start_time - _detalhes.tabela_overall.start_time = _detalhes.tabela_overall.start_time + tempo_do_combate - _current_combat.start_time = _tempo + --local tempo_do_combate = _tempo - _current_combat:GetStartTime() + local tempo_do_combate = _GetTime() - _current_combat:GetStartTime() + + _detalhes.tabela_overall:SetStartTime (_detalhes.tabela_overall:GetStartTime() + tempo_do_combate) + --_current_combat.start_time = _tempo + _current_combat:SetStartTime (_GetTime()) _detalhes.listener:UnregisterEvent ("CHAT_MSG_BG_SYSTEM_NEUTRAL") end end diff --git a/core/timemachine.lua b/core/timemachine.lua index 7b198c42..cc33de19 100644 --- a/core/timemachine.lua +++ b/core/timemachine.lua @@ -1,10 +1,3 @@ ---File Revision: 2 ---Last Modification: 12/09/2013 --- Change Log: - -- 27/07/2013: Finished alpha version. - -- 12/09/2013: Fixed some problems with garbage collector. - - ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes @@ -16,13 +9,17 @@ local _table_insert = table.insert --lua local local _ipairs = ipairs --lua local local _pairs = pairs --lua local + local _math_floor = math.floor --lua local local _time = time --lua local - local _math_floor = math.floor + + local _GetTime = GetTime --api local + local timeMachine = _detalhes.timeMachine --details local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> constants local _tempo = _time() + local _tempo = _time() ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> core diff --git a/core/windows.lua b/core/windows.lua index e9c0b81b..c478fca2 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -2317,8 +2317,10 @@ end - current_combat.start_time = time()-360 - current_combat.end_time = time() + --current_combat.start_time = time()-360 + current_combat.start_time = GetTime() - 360 + --current_combat.end_time = time() + current_combat.end_time = GetTime() current_combat.totals_grupo [1] = total_damage current_combat.totals_grupo [2] = total_heal diff --git a/functions/slash.lua b/functions/slash.lua index 5af769d7..697ae664 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -176,8 +176,8 @@ function SlashCmdList.DETAILS (msg, editbox) self.spells._ActorTable [122].total = 25000 end - combat.start_time = time()-30 - combat.end_time = time() + combat.start_time = GetTime()-30 + combat.end_time = GetTime() combat.totals_grupo [1] = 100000 combat.totals [1] = 100000 diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index d8984e70..3cc40715 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -4897,7 +4897,7 @@ local build_segment_list = function (self, elapsed) CoolTip:AddLine (Loc ["STRING_SEGMENT_ENEMY"] .. ":", enemy, 2, "white", "white") - local decorrido = (thisCombat.end_time or _detalhes._tempo) - thisCombat.start_time + local decorrido = thisCombat:GetCombatTime() local minutos, segundos = _math_floor (decorrido/60), _math_floor (decorrido%60) CoolTip:AddLine (Loc ["STRING_SEGMENT_TIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") @@ -4959,16 +4959,16 @@ local build_segment_list = function (self, elapsed) CoolTip:AddLine (Loc ["STRING_SEGMENT_ENEMY"] .. ":", enemy, 2, "white", "white") - if (not _detalhes.tabela_vigente.end_time) then + if (not _detalhes.tabela_vigente:GetEndTime()) then if (_detalhes.in_combat) then - local decorrido = _detalhes._tempo - _detalhes.tabela_vigente.start_time + local decorrido = _detalhes.tabela_vigente:GetCombatTime() local minutos, segundos = _math_floor (decorrido/60), _math_floor (decorrido%60) CoolTip:AddLine (Loc ["STRING_SEGMENT_TIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") else CoolTip:AddLine (Loc ["STRING_SEGMENT_TIME"] .. ":", "--x--x--", 2, "white", "white") end else - local decorrido = (_detalhes.tabela_vigente.end_time) - _detalhes.tabela_vigente.start_time + local decorrido = _detalhes.tabela_vigente:GetCombatTime() local minutos, segundos = _math_floor (decorrido/60), _math_floor (decorrido%60) CoolTip:AddLine (Loc ["STRING_SEGMENT_TIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") end @@ -4998,16 +4998,16 @@ local build_segment_list = function (self, elapsed) CoolTip:AddLine (Loc ["STRING_SEGMENT_ENEMY"] .. ":", "--x--x--", 2, "white", "white") - if (not _detalhes.tabela_overall.end_time) then + if (not _detalhes.tabela_overall:GetEndTime()) then if (_detalhes.in_combat) then - local decorrido = _detalhes._tempo - _detalhes.tabela_overall.start_time + local decorrido = _detalhes.tabela_overall:GetCombatTime() local minutos, segundos = _math_floor (decorrido/60), _math_floor (decorrido%60) CoolTip:AddLine (Loc ["STRING_SEGMENT_TIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") else CoolTip:AddLine (Loc ["STRING_SEGMENT_TIME"] .. ":", "--x--x--", 2, "white", "white") end else - local decorrido = (_detalhes.tabela_overall.end_time) - _detalhes.tabela_overall.start_time + local decorrido = _detalhes.tabela_overall:GetCombatTime() local minutos, segundos = _math_floor (decorrido/60), _math_floor (decorrido%60) CoolTip:AddLine (Loc ["STRING_SEGMENT_TIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") end