From 27e5823572805c5acddea389ea568a1573023a46 Mon Sep 17 00:00:00 2001 From: Tercio Date: Sat, 19 Sep 2015 23:32:09 -0300 Subject: [PATCH] - Fixed a rare bug where the window for Encounter Details Plugin won't open when clicking on its icon. - Fixed death display color when not using colored by the player class. - Added officer channel to 'Announce Death' feature. --- Libs/DF/fw.lua | 8 ++++++- Libs/DF/normal_bar.lua | 49 +++++++++++++++++++++++++++----------- boot.lua | 9 ++++--- classes/classe_custom.lua | 14 +++++------ classes/classe_damage.lua | 4 ++-- classes/classe_others.lua | 3 ++- core/plugins.lua | 28 +++++++++++++++++++++- core/plugins_raid.lua | 4 ++++ core/util.lua | 2 +- functions/events.lua | 4 ++-- functions/slash.lua | 20 ++++++++++++++++ gumps/janela_options.lua | 3 +++ gumps/janela_principal.lua | 34 ++++++++++++++++---------- gumps/janela_report.lua | 2 +- 14 files changed, 138 insertions(+), 46 deletions(-) diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 39c7dc75..e6d40211 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,5 +1,6 @@ -local major, minor = "DetailsFramework-1.0", 10 +local dversion = 10 +local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary (major, minor) if (not DF) then @@ -24,6 +25,11 @@ DF.ButtonCounter = 1 DF.SliderCounter = 1 DF.SplitBarCounter = 1 +DF.FrameWorkVersion = tostring (dversion) +function DF:PrintVersion() + print ("Details! Framework Version:", DF.FrameWorkVersion) +end + LibStub:GetLibrary("AceTimer-3.0"):Embed (DF) do diff --git a/Libs/DF/normal_bar.lua b/Libs/DF/normal_bar.lua index b46b269c..949bedd9 100644 --- a/Libs/DF/normal_bar.lua +++ b/Libs/DF/normal_bar.lua @@ -528,6 +528,24 @@ local APIBarFunctions self.timer = false end + function BarMetaFunctions:CancelTimerBar (no_timer_end) + if (not self.HasTimer) then + return + end + if (self.TimerScheduled) then + DF:CancelTimer (self.TimerScheduled) + self.TimerScheduled = nil + else + if (self.statusbar:GetScript ("OnUpdate")) then + self.statusbar:SetScript ("OnUpdate", nil) + end + end + self.righttext = "" + if (not no_timer_end) then + self:OnTimerEnd() + end + end + local OnUpdate = function (self, elapsed) --> percent of elapsed local pct = abs (self.end_timer - GetTime() - self.tempo) / self.tempo @@ -548,23 +566,24 @@ local APIBarFunctions if (pct >= 1) then self.righttext:SetText ("") self:SetScript ("OnUpdate", nil) + self.MyObject.HasTimer = nil self.MyObject:OnTimerEnd() end end - function BarMetaFunctions:SetTimer (tempo) - - -- o que é inverso - -- barra cheia - -- barra vazia - -- o que é left to right - -- barra que faz da direita pra esquerda - -- contrário - - self.statusbar.tempo = tempo - self.statusbar.remaining = tempo + function BarMetaFunctions:SetTimer (tempo, end_at) + + if (end_at) then + self.statusbar.tempo = end_at - tempo + self.statusbar.remaining = end_at - GetTime() + self.statusbar.end_timer = end_at + else + self.statusbar.tempo = tempo + self.statusbar.remaining = tempo + self.statusbar.end_timer = GetTime() + tempo + end + self.statusbar.total_size = self.statusbar:GetWidth() - self.statusbar.end_timer = GetTime() + tempo self.statusbar.inverse = self.BarIsInverse self (0) @@ -597,10 +616,12 @@ local APIBarFunctions self.timer = true - DF:ScheduleTimer ("StartTimeBarAnimation", 0.1, self) + self.HasTimer = true + self.TimerScheduled = DF:ScheduleTimer ("StartTimeBarAnimation", 0.1, self) end function DF:StartTimeBarAnimation (timebar) + timebar.TimerScheduled = nil timebar.statusbar:SetScript ("OnUpdate", OnUpdate) end @@ -723,4 +744,4 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name) end return BarObject -end +end --endd diff --git a/boot.lua b/boot.lua index 8c96733a..0ad6809d 100644 --- a/boot.lua +++ b/boot.lua @@ -3,8 +3,8 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 1940 --it's 1940 for release - _detalhes.userversion = "v4.0f" + _detalhes.build_counter = 1946 --it's 1946 for release + _detalhes.userversion = "v4.0h" _detalhes.realversion = 75 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -30,7 +30,10 @@ do |cFFFFFF00-|r Fixed some issues on the Player Detail Window.\n\n |cFFFFFF00-|r Healing for battleground enemies is now placed on healing done instead of enemy healing done.\n\n +|cFFFFFF00-|r Fixed a rare bug where the window for Encounter Details Plugin won't open when clicking on its icon.\n\n +|cFFFFFF00-|r Fixed death display color when not using colored by the player class.\n\n |cFFFFFF00-|r Fixed encounter time on title bar text.\n\n +|cFFFFFF00-|r Added officer channel to 'Announce Death' feature.\n\n |cFFFFFF00-|r Solo Plugins now has a close button on their panels.\n\n |cFFFFFF00-|r Added a custom display for Crowd Control Received.\n\n @@ -45,7 +48,7 @@ do -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v4.0f (|cFFFFCC00Set 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the title bar encounter timer.\n\n|cFFFFFF00v4.0e (|cFFFFCC00Set 14, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a custom display for Crowd Control Received.\n\n|cFFFFFF00-|r Weak Aura Creator Tool, now has full support for BigWigs and Dbm time bars.\n\n|cFFFFFF00-|r Auras for interrupt and dispelling has been added on the Weak Aura Creator Tool.\n\n|cFFFFFF00-|r Details! Forge now has support for DBM and BigWigs time bars.\n\n|cFFFFFF00-|r Solo Plugins now has a close button on their panels.\n\n|cFFFFFF00-|r Fixed damage/healing score message after a boss kill.\n\n|cFFFFFF00-|r Now, an alert to open the history panel is shown after killing a boss.\n\n|cFFFFFF00-|r Added a 'all-displays' menu when right clicking title bar.\n\n|cFFFFFF00-|r Removed few texture from bookmarks panel, now it has a more clean appearance.\n\n|cFFFFFF00-|r Updated Details! Framework.\n\n|cFFFFFF00-|r Added option in order to change the bar orientation.\n\n|cFFFFFF00-|r Added an option to make the menus on title bar work with clicks instead of hovering over them.\n\n|cFFFFFF00-|r Healing for battleground enemies is now placed on healing done instead of enemy healing done.\n\n|cFFFFFF00-|r Improvements on our support for Arena battles.\n\n|cFFFFFF00-|r Fixed some issues on the Player Detail Window.\n\n|cFFFFFF00-|r Fixed encounter time on title bar text.\n\n|cFFFFFF00-|r Fixed death display tooltip, wasn't respecting the font and size set on options panel.\n\n|cFFFFFF00v3.18.5 (|cFFFFCC00Aug 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improvements on Weakauras creation from Encounter Details plugin.\n\n|cFFFFFF00-|r Improvements on 'Auto Switch to Current' feature. Details! windows are now more responsible about auto changing a segment while the player, for instance, has the report window opened.\n\n|cFFFFFF00-|r Added slash command '/de wipe'. It ends the raid encounter segment and stop capturing data.\nIf you are the raid leader, all other users of Details! will also stop.\nWorks great for players not make damage padding after a wipe call.\n\n|cFFFFFF00-|r Added the overheal made by pets on tooltip and player details window.\n\n|cFFFFFF00-|r Added an option to disable stretch button and bar highlight.\n\n|cFFFFFF00-|r Disabling nicknames now also disable avatars.\n\n|cFFFFFF00-|r Added 'spinal healing injector' on custom display 'Health Potion & Stone' used.\n\n|cFFFFFF00-|r Fixed title text width when auto-hide menu buttons is enabled.\n\n|cFFFFFF00-|r Fixed item level of timewarped items.\n\n|cFFFFFF00-|r Fixed report for custom display Crowd Control.\n\n|cFFFFFF00-|r Fixed role icons on custom displays.\n\n|cFFFFFF00-|r Fixed an issue with dropdown boxes where wasn't showing all options.\n\n|cFFFFFF00-|r Fixed Ticket #53: background alpha after stretching which wasn't correctly coming back to original color.\n\n|cFFFFFF00-|r Fixed ticket #51: API Call 'GetCombat('overall')' wasn't returning the overall combat object.\n\n|cFFFFFF00-|r Fixed ticket #50: issue opening icon selection frame.\n\n|cFFFFFF00v3.17.12 (|cFFFFCC00Aug 05, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for lock micro displays. When locked they don't interact with mouse or stay on top of menus.\n\n|cFFFFFF00-|r Fixed ticket #49: death display not working correctly with sort direction bottom-to-top.\n\n|cFFFFFF00-|r Fixed an issue with death display where the text wasn't updating their width correctly.\n\n|cFFFFFF00-|r Fixed an issue with energy and miscellaneous displays type not working correctly with bar animations.\n\n|cFFFFFF00-|r Fixed an issue while loading old profiles wans't updating their values for newer versions of the addon.\n\n|cFFFFFF00-|r Fixed an issue with bookmarks panel not opening correctly.\n\n|cFFFFFF00v3.17.10 (|cFFFFCC00Aug 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed ticket #47: Title bar font resets with UI reload / relog.\n\n|cFFFFFF00-|r Fixed ticket #46: Icon select panel wasn't opening.\n\n|cFFFFFF00-|r Fixed ticket #45: Windwalker icon for Mistweaver monks.\n\n|cFFFFFF00-|r Fixed issue with vehicles exchanging ownership, e.g. Soulbound Constructor on HFC raid.\n\n|cFFFFFF00v3.17.6 (|cFFFFCC00Jul 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major improvements on the aura tool creation for WeakAuras.\n\n|cFFFFFF00-|r Fixed some issues with spec icons where sometimes it shows four small icons.\n\n|cFFFFFF00-|r Added an option to show a stopwatch on the title text showing the elapsed time of an encounter.\n\n|cFFFFFF00-|r Window title text now shrinks correctly when isn't enough space for it.\n\n|cFFFFFF00-|r For some special cases, left click now open the report window and shift+click shows the tooltip content in the window.\n\n|cFFFFFF00-|r Damage Taken by Spells now are a part of Damage bracket (no more on custom).\n\n|cFFFFFF00-|r Fixed custom functions for the customized bar left text.\n\n|cFFFFFF00-|r Improvements on report text format and also reverse option now works as intended.\n\n|cFFFFFF00-|r Removed the option for report only what is shown in the window.\n\n|cFFFFFF00-|r Added skins for report panel, the skin follow the skin selected for Player Detail Window.\n\n|cFFFFFF00v3.16.0c (|cFFFFCC00Jul 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with Encounter Details graphic for Archimonde encounter.\n\n|cFFFFFF00-|r Numbers format on Player Detail Window now respect the format chosen on options panel.\n\n|cFFFFFF00-|r Removed pet icons on Player Detail Window.\n\n|cFFFFFF00-|r Fixed some wrong textures on spec icons.\n\n|cFFFFFF00-|r Improvements on all skins for the Player Detail Window.\n\n|cFFFFFF00v3.15.8b (|cFFFFCC00Jul 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Soul Capacitor trinket fix.\n\n|cFFFFFF00-|r Fixed several small bugs from 6.2 patch.\n\n|cFFFFFF00-|r Disabled the special behavior for Tyrant Velhari encounter.\n\n|cFFFFFF00v3.15.7 (|cFFFFCC00Jun 23, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for Hellfire Citadel raid.\n\n|cFFFFFF00-|r Added support for custom CLEU parser functions.\n\n|cFFFFFF00-|r Tyrant Velhari encounter now has a custom CLEU parser function for healing where the heal absorbed by Aura of Contempt will count towards overheal and not healing done.\n\n|cFFFFFF00-|r Added support for embed on Chat Tabs.\n\n|cFFFFFF00-|r |cFFAAFFAAPS: We've made an addon for Shadow-Lord Iskar encounter called 'Iskar Assist' check it out|r.\n\n|cFFFFFF00v3.15.5a (|cFFFFCC00Jun 12, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue where sometimes tooltips wasn't being shown.\n\n|cFFFFFF00-|r Fixed a problem with overall data where it was using, even on dungoens, the raid-only 30 delay rule.\n\n|cFFFFFF00-|r Fixed an issue with spec detection (now it may detect even faster).\n\n|cFFFFFF00v3.15.5 (|cFFFFCC00Jun 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a problem with auto hide feature not hiding plugins hosted by the window.\n\n|cFFFFFF00-|r Fixed an issue with stretch feature when the anchor button was anchored at the bottom side of the window." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v4.0h (|cFFFFCC00Set 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created new plugin 'Target Caller' for RBGs, it's available at Curse.com.\n\n|cFFFFFF00-|r Fixed death display color when not using colored by the player class.\n\n|cFFFFFF00-|r Fixed a rare bug where the window for Encounter Details Plugin won't open when clicking on its icon.\n\n|cFFFFFF00-|r Added officer channel to 'Announce Death' feature.\n\n|cFFFFFF00v4.0f (|cFFFFCC00Set 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the title bar encounter timer.\n\n|cFFFFFF00v4.0e (|cFFFFCC00Set 14, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a custom display for Crowd Control Received.\n\n|cFFFFFF00-|r Weak Aura Creator Tool, now has full support for BigWigs and Dbm time bars.\n\n|cFFFFFF00-|r Auras for interrupt and dispelling has been added on the Weak Aura Creator Tool.\n\n|cFFFFFF00-|r Details! Forge now has support for DBM and BigWigs time bars.\n\n|cFFFFFF00-|r Solo Plugins now has a close button on their panels.\n\n|cFFFFFF00-|r Fixed damage/healing score message after a boss kill.\n\n|cFFFFFF00-|r Now, an alert to open the history panel is shown after killing a boss.\n\n|cFFFFFF00-|r Added a 'all-displays' menu when right clicking title bar.\n\n|cFFFFFF00-|r Removed few texture from bookmarks panel, now it has a more clean appearance.\n\n|cFFFFFF00-|r Updated Details! Framework.\n\n|cFFFFFF00-|r Added option in order to change the bar orientation.\n\n|cFFFFFF00-|r Added an option to make the menus on title bar work with clicks instead of hovering over them.\n\n|cFFFFFF00-|r Healing for battleground enemies is now placed on healing done instead of enemy healing done.\n\n|cFFFFFF00-|r Improvements on our support for Arena battles.\n\n|cFFFFFF00-|r Fixed some issues on the Player Detail Window.\n\n|cFFFFFF00-|r Fixed encounter time on title bar text.\n\n|cFFFFFF00-|r Fixed death display tooltip, wasn't respecting the font and size set on options panel.\n\n|cFFFFFF00v3.18.5 (|cFFFFCC00Aug 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improvements on Weakauras creation from Encounter Details plugin.\n\n|cFFFFFF00-|r Improvements on 'Auto Switch to Current' feature. Details! windows are now more responsible about auto changing a segment while the player, for instance, has the report window opened.\n\n|cFFFFFF00-|r Added slash command '/de wipe'. It ends the raid encounter segment and stop capturing data.\nIf you are the raid leader, all other users of Details! will also stop.\nWorks great for players not make damage padding after a wipe call.\n\n|cFFFFFF00-|r Added the overheal made by pets on tooltip and player details window.\n\n|cFFFFFF00-|r Added an option to disable stretch button and bar highlight.\n\n|cFFFFFF00-|r Disabling nicknames now also disable avatars.\n\n|cFFFFFF00-|r Added 'spinal healing injector' on custom display 'Health Potion & Stone' used.\n\n|cFFFFFF00-|r Fixed title text width when auto-hide menu buttons is enabled.\n\n|cFFFFFF00-|r Fixed item level of timewarped items.\n\n|cFFFFFF00-|r Fixed report for custom display Crowd Control.\n\n|cFFFFFF00-|r Fixed role icons on custom displays.\n\n|cFFFFFF00-|r Fixed an issue with dropdown boxes where wasn't showing all options.\n\n|cFFFFFF00-|r Fixed Ticket #53: background alpha after stretching which wasn't correctly coming back to original color.\n\n|cFFFFFF00-|r Fixed ticket #51: API Call 'GetCombat('overall')' wasn't returning the overall combat object.\n\n|cFFFFFF00-|r Fixed ticket #50: issue opening icon selection frame.\n\n|cFFFFFF00v3.17.12 (|cFFFFCC00Aug 05, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for lock micro displays. When locked they don't interact with mouse or stay on top of menus.\n\n|cFFFFFF00-|r Fixed ticket #49: death display not working correctly with sort direction bottom-to-top.\n\n|cFFFFFF00-|r Fixed an issue with death display where the text wasn't updating their width correctly.\n\n|cFFFFFF00-|r Fixed an issue with energy and miscellaneous displays type not working correctly with bar animations.\n\n|cFFFFFF00-|r Fixed an issue while loading old profiles wans't updating their values for newer versions of the addon.\n\n|cFFFFFF00-|r Fixed an issue with bookmarks panel not opening correctly.\n\n|cFFFFFF00v3.17.10 (|cFFFFCC00Aug 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed ticket #47: Title bar font resets with UI reload / relog.\n\n|cFFFFFF00-|r Fixed ticket #46: Icon select panel wasn't opening.\n\n|cFFFFFF00-|r Fixed ticket #45: Windwalker icon for Mistweaver monks.\n\n|cFFFFFF00-|r Fixed issue with vehicles exchanging ownership, e.g. Soulbound Constructor on HFC raid.\n\n|cFFFFFF00v3.17.6 (|cFFFFCC00Jul 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major improvements on the aura tool creation for WeakAuras.\n\n|cFFFFFF00-|r Fixed some issues with spec icons where sometimes it shows four small icons.\n\n|cFFFFFF00-|r Added an option to show a stopwatch on the title text showing the elapsed time of an encounter.\n\n|cFFFFFF00-|r Window title text now shrinks correctly when isn't enough space for it.\n\n|cFFFFFF00-|r For some special cases, left click now open the report window and shift+click shows the tooltip content in the window.\n\n|cFFFFFF00-|r Damage Taken by Spells now are a part of Damage bracket (no more on custom).\n\n|cFFFFFF00-|r Fixed custom functions for the customized bar left text.\n\n|cFFFFFF00-|r Improvements on report text format and also reverse option now works as intended.\n\n|cFFFFFF00-|r Removed the option for report only what is shown in the window.\n\n|cFFFFFF00-|r Added skins for report panel, the skin follow the skin selected for Player Detail Window.\n\n|cFFFFFF00v3.16.0c (|cFFFFCC00Jul 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with Encounter Details graphic for Archimonde encounter.\n\n|cFFFFFF00-|r Numbers format on Player Detail Window now respect the format chosen on options panel.\n\n|cFFFFFF00-|r Removed pet icons on Player Detail Window.\n\n|cFFFFFF00-|r Fixed some wrong textures on spec icons.\n\n|cFFFFFF00-|r Improvements on all skins for the Player Detail Window.\n\n|cFFFFFF00v3.15.8b (|cFFFFCC00Jul 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Soul Capacitor trinket fix.\n\n|cFFFFFF00-|r Fixed several small bugs from 6.2 patch.\n\n|cFFFFFF00-|r Disabled the special behavior for Tyrant Velhari encounter.\n\n|cFFFFFF00v3.15.7 (|cFFFFCC00Jun 23, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for Hellfire Citadel raid.\n\n|cFFFFFF00-|r Added support for custom CLEU parser functions.\n\n|cFFFFFF00-|r Tyrant Velhari encounter now has a custom CLEU parser function for healing where the heal absorbed by Aura of Contempt will count towards overheal and not healing done.\n\n|cFFFFFF00-|r Added support for embed on Chat Tabs.\n\n|cFFFFFF00-|r |cFFAAFFAAPS: We've made an addon for Shadow-Lord Iskar encounter called 'Iskar Assist' check it out|r.\n\n|cFFFFFF00v3.15.5a (|cFFFFCC00Jun 12, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue where sometimes tooltips wasn't being shown.\n\n|cFFFFFF00-|r Fixed a problem with overall data where it was using, even on dungoens, the raid-only 30 delay rule.\n\n|cFFFFFF00-|r Fixed an issue with spec detection (now it may detect even faster).\n\n|cFFFFFF00v3.15.5 (|cFFFFCC00Jun 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a problem with auto hide feature not hiding plugins hosted by the window.\n\n|cFFFFFF00-|r Fixed an issue with stretch feature when the anchor button was anchored at the bottom side of the window." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_custom.lua b/classes/classe_custom.lua index 45099ab5..8e047579 100644 --- a/classes/classe_custom.lua +++ b/classes/classe_custom.lua @@ -755,7 +755,7 @@ local icon_cache = {} function atributo_custom:GetActorTable (actor, name_complement) - local index = self._NameIndexTable [actor.nome] + local index = self._NameIndexTable [actor.nome or actor.name] if (index) then return self._ActorTable [index] @@ -779,10 +779,10 @@ end else - class = actor.classe + class = actor.classe or actor.class if (class == "UNKNOW") then --> try once again - class = _detalhes:GetClass (actor.nome) + class = _detalhes:GetClass (actor.nome or actor.name) if (class and class ~= "UNKNOW") then actor.classe = class end @@ -790,9 +790,9 @@ end local new_actor = _setmetatable ({ - nome = actor.nome, + nome = actor.nome or actor.name, classe = class, - value = _detalhes:GetOrderNumber (actor.nome), + value = _detalhes:GetOrderNumber(), is_custom = true, }, atributo_custom.mt) @@ -820,7 +820,7 @@ end else if (not new_actor.classe) then - new_actor.classe = _detalhes:GetClass (actor.nome) or "UNKNOW" + new_actor.classe = _detalhes:GetClass (actor.nome or actor.name) or "UNKNOW" end if (new_actor.classe == "UNGROUPPLAYER") then atributo_custom:ScheduleTimer ("UpdateClass", 5, {new_actor = new_actor, actor = actor}) @@ -830,7 +830,7 @@ index = #self._ActorTable+1 self._ActorTable [index] = new_actor - self._NameIndexTable [actor.nome] = index + self._NameIndexTable [actor.nome or actor.name] = index return new_actor end end diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index 2efe4148..a5021380 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -299,7 +299,7 @@ return _unpack (_detalhes.class_colors.ENEMY) elseif (actor.owner) then - return _unpack (_detalhes.class_colors [actor.owner.classe]) + return _unpack (_detalhes.class_colors [actor.owner.classe or "UNKNOW"]) elseif (actor.arena_team) then if (actor.arena_team == 0) then @@ -313,7 +313,7 @@ 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]) + return _unpack (_detalhes.class_colors [actor.classe or "UNKNOW"]) end end diff --git a/classes/classe_others.lua b/classes/classe_others.lua index b17e551d..57b9b32f 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -518,8 +518,9 @@ function atributo_misc:DeadAtualizarBarra (morte, qual_barra, colocacao, instanc gump:Fade (esta_barra, "out") end + --> seta a cor da barra e a cor do texto caso eles esteja mostrando com a cor da classe local r, g, b, a = _unpack (_detalhes.class_colors [morte[4]]) - esta_barra.textura:SetVertexColor (r, g, b, 1) + _detalhes:SetBarColors (esta_barra, instancia, r, g, b, a) if (instancia.row_info.use_spec_icons) then local nome = morte[3] diff --git a/core/plugins.lua b/core/plugins.lua index c0b85e78..671bb736 100644 --- a/core/plugins.lua +++ b/core/plugins.lua @@ -15,6 +15,25 @@ return _detalhes.plugin_database [PluginAbsoluteName] end + function _detalhes:UpdatePluginBarsConfig() + local instance = self:GetPluginInstance() + if (instance) then + self.row_info = self.row_info or {} + _detalhes.table.copy (self.row_info, instance.row_info) + self.bars_grow_direction = instance.bars_grow_direction + self.row_height = instance.row_height + self:SetBarGrowDirection() + end + end + + function _detalhes:AttachToInstance() + local instance = self:GetPluginInstance() + if (instance) then + local w, h = instance:GetSize() + self.Frame:SetSize (w, h) + end + end + function _detalhes:GetPluginInstance (PluginAbsoluteName) local plugin = self if (PluginAbsoluteName) then @@ -240,10 +259,17 @@ print ("Thank You Sir!===================") end + local register_event_func = function (self, event) + self.Frame:RegisterEvent (event) + end + local unregister_event_func = function (self, event) + self.Frame:UnregisterEvent (event) + end + function _detalhes:NewPluginObject (FrameName, PluginOptions, PluginType) PluginOptions = PluginOptions or 0x0 - local NewPlugin = {__options = PluginOptions, __enabled = true} + local NewPlugin = {__options = PluginOptions, __enabled = true, RegisterEvent = register_event_func, UnregisterEvent = unregister_event_func} local Frame = CreateFrame ("Frame", FrameName, UIParent) Frame:RegisterEvent ("ADDON_LOADED") diff --git a/core/plugins_raid.lua b/core/plugins_raid.lua index 74d70c84..001aea0d 100644 --- a/core/plugins_raid.lua +++ b/core/plugins_raid.lua @@ -520,6 +520,10 @@ end channel = "PRINT" + elseif (where == 5) then --> officers + if (IsInGuild()) then + channel = "OFFICER" + end end local only_first = _detalhes.announce_deaths.only_first diff --git a/core/util.lua b/core/util.lua index b82656ae..a74ea715 100644 --- a/core/util.lua +++ b/core/util.lua @@ -247,7 +247,7 @@ if (type (value) == "table") then t1 [key] = t1 [key] or {} _detalhes.table.deploy (t1 [key], t2 [key]) - else + elseif (t1 [key] == nil) then t1 [key] = value end end diff --git a/functions/events.lua b/functions/events.lua index 69512ed8..c1292a3b 100644 --- a/functions/events.lua +++ b/functions/events.lua @@ -110,9 +110,9 @@ local common_events = { if (not _detalhes.RegistredEvents [event]) then if (object.Msg) then - object:DelayMsg ("(debug) unknown event", event) + object:DelayMsg ("[debug] unknown event:", event, object.__name) else - _detalhes:DelayMsg ("(debug) unknown event", event) + _detalhes:DelayMsg ("[debug] unknown event:", event, object.__name) end return end diff --git a/functions/slash.lua b/functions/slash.lua index b7503397..9acfdfe7 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -1063,6 +1063,26 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes:OpenRaidHistoryWindow ("Hellfire Citadel", 1800, 15, "DAMAGER", "Rock Lobster", 2, "Keyspell") + elseif (msg == "bar") then + local bar = _G.DetailsTestBar + if (not bar) then + bar = Details.gump:CreateBar (UIParent, nil, 600, 200, 100, nil, "DetailsTestBar") + _G.DetailsTestBar = bar + bar:SetPoint ("center", 0, 0) + bar.RightTextIsTimer = true + bar.BarIsInverse = true + end + + bar.color = "HUNTER" + + local start = GetTime()-45 + local fim = GetTime()+5 + + bar:SetTimer (start, fim) + + --C_Timer.After (5, function() bar:CancelTimerBar() end) + + elseif (msg == "alert") then --local instancia = _detalhes.tabela_instancias [1] local f = function (a, b, c, d, e, f, g) print (a, b, c, d, e, f, g) end diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index e73ec82e..62979f10 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -9653,11 +9653,14 @@ function window:CreateFrame11() _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) end + local officer = _detalhes.GetReportIconAndColor ("OFFICER") + local channel_list = { {value = 1, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0, 1}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_OPTIONS_RT_DEATHS_WHERE1"], onclick = on_select_channel}, {value = 2, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0.49, 0}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_OPTIONS_RT_DEATHS_WHERE2"], onclick = on_select_channel}, {value = 3, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {0.66, 0.65, 1}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_OPTIONS_RT_DEATHS_WHERE3"], onclick = on_select_channel}, {value = 4, icon = [[Interface\LFGFRAME\BattlenetWorking2]], iconsize = {14, 14}, iconcolor = {1, 1, 1, 1}, texcoord = {12/64, 53/64, 11/64, 53/64}, label = Loc ["STRING_CHANNEL_PRINT"], onclick = on_select_channel}, + {value = 5, icon = officer.icon, iconsize = {14, 14}, iconcolor = officer.color, texcoord = officer.coords, label = officer.label, onclick = on_select_channel}, } local build_channel_menu = function() return channel_list diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index cb9b8bb7..df5ef3bf 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -3776,32 +3776,34 @@ function _detalhes:SetBarGrowDirection (direction) self.bars_grow_direction = direction local x = self.row_info.space.left + local bars = self.barras or self.Bars --> .Bars for third-party plugins + local baseframe = self.baseframe or self.Frame --> .Frame for plugins + local height = self.row_height + if (direction == 1) then --> top to bottom - for index, row in _ipairs (self.barras) do - local y = self.row_height * (index - 1) + for index, row in _ipairs (bars) do + local y = height * (index - 1) y = y * -1 row:ClearAllPoints() - row:SetPoint ("topleft", self.baseframe, "topleft", x, y) - + row:SetPoint ("topleft", baseframe, "topleft", x, y) end - elseif (direction == 2) then --> bottom to top - for index, row in _ipairs (self.barras) do - local y = self.row_height * (index - 1) + for index, row in _ipairs (bars) do + local y = height * (index - 1) row:ClearAllPoints() - row:SetPoint ("bottomleft", self.baseframe, "bottomleft", x, y + 2) + row:SetPoint ("bottomleft", baseframe, "bottomleft", x, y + 2) end - end --> update all row width if (self.bar_mod and self.bar_mod ~= 0) then - for index = 1, #self.barras do - self.barras [index]:SetWidth (self.baseframe:GetWidth() + self.bar_mod) + for index = 1, #bars do + bars [index]:SetWidth (baseframe:GetWidth() + self.bar_mod) end else - for index = 1, #self.barras do - self.barras [index]:SetWidth (self.baseframe:GetWidth()+self.row_info.space.right) + for index = 1, #bars do + bars [index]:SetWidth (baseframe:GetWidth() + self.row_info.space.right) + --print (bars [index]:GetWidth(), baseframe:GetWidth()) end end end @@ -6621,6 +6623,12 @@ function _detalhes:TitleTextTickTimer (instance) end end +function _detalhes:SetTitleBarText (text) + if (self.attribute_text.enabled and self.menu_attribute_string) then + self.menu_attribute_string:SetText (text) + end +end + function _detalhes:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side, shadow, timer_encounter, timer_bg, timer_arena) if (type (enabled) ~= "boolean") then diff --git a/gumps/janela_report.lua b/gumps/janela_report.lua index d760d567..9bc1736c 100644 --- a/gumps/janela_report.lua +++ b/gumps/janela_report.lua @@ -322,7 +322,7 @@ local icons_and_colors = { ["PARTY"] = {icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.53125, 0.7265625, 0.078125, 0.40625}, color = {0.66, 0.65, 1}}, ["RAID"] = {icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.53125, 0.7265625, 0.078125, 0.40625}, color = {1, 0.49, 0}}, ["GUILD"] = {icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.8046875, 0.96875, 0.125, 0.390625}, color = {0.25, 0.98, 0.25}}, - ["OFFICER"] = {icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.8046875, 0.96875, 0.125, 0.390625}, color = {0.25, 0.74, 0.25}}, + ["OFFICER"] = {label = Loc ["STRING_REPORTFRAME_OFFICERS"], icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.8046875, 0.96875, 0.125, 0.390625}, color = {0.25, 0.74, 0.25}}, ["WHISPER"] = {icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.0546875, 0.1953125, 0.625, 0.890625}, color = {1, 0.49, 1}}, ["SAY"] = {icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.0390625, 0.203125, 0.09375, 0.375}, color = {1, 1, 1}}, ["COPY"] = {icon = [[Interface\Buttons\UI-GuildButton-PublicNote-Disabled]], coords = {0, 1, 0, 1}, color = {1, 1, 1}},