diff --git a/boot.lua b/boot.lua index 40042de6..8e586253 100644 --- a/boot.lua +++ b/boot.lua @@ -4,7 +4,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 1209 --it's 1209 for release - _detalhes.userversion = "v3.16.0c" + _detalhes.userversion = "v3.17.0" _detalhes.realversion = 72 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -21,17 +21,13 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v3.16.0 (|cFFFFCC00Jul 03, 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.17.0 (|cFFFFCC00Jul 07, 2015|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Added skins for report panel, the skin follow the skin selected for Player Detail Window.\n\n --]] -- - Loc ["STRING_VERSION_LOG"] = "|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.\n\n|cFFFFFF00-|r Small interface tweaks on tooltips, bookmark and player detail window.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show amount of casts and uptime.\n\n|cFFFFFF00-|r Added an extra tooltip for the class icon at the player's bar.\n\n|cFFFFFF00-|r Activity time now has only 3 seconds inactivity tolerance on battlegrounds and arenas.\n\n|cFFFFFF00-|r Effective time will automatically be used when inside a battleground and using sync from the score board.\n\n|cFFFFFF00-|r Added 'hide all' option on the minimap menu.\n\n|cFFFFFF00-|r Added support for battlegrounds.\n\n|cFFFFFF00-|r Added option for disable showing battleground enemies when the window is in group mode.\n\n|cFFFFFF00-|r Added option to disable the sync from battleground score board.\n\n|cFFFFFF00-|r Enemies from a battleground match segment won't be erased when the player logout.\n\n|cFFFFFF00v3.14.4 (|cFFFFCC00May 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r TimeLine (plugin): now also shows marks symbolizing the player death.\n\n|cFFFFFF00-|r Added raid history panel. Open it through bookmark or /details history.\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n|cFFFFFF00-|r Added report history on report button.\n\n|cFFFFFF00-|r Added key bindings settings for report what is shown on window #1 or #2.\n\n|cFFFFFF00v3.14.0b (|cFFFFCC00May 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several texture changes for a smaller download size.\n\n|cFFFFFF00v3.13.4a (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created 'Details! Forge' but is still under development: /details forge.\n\n|cFFFFFF00-|r Several improvements on combatlog reader and custom displays.\n\n|cFFFFFF00-|r Improvements on enemies damage taken tooltip.\n\n|cFFFFFF00v3.13.1 (|cFFFFCC00April 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added casted amount for healing and damage spells. The result is shown on Player Detail Window and Comparison Panel.\n\n|cFFFFFF00-|r Added uptime amount for healing spells on Player Detail Window.\n\n|cFFFFFF00-|r Added an option to disable lock/resize/ungroup buttons. It's under miscellaneous bracket on Options Panel.\n\n|cFFFFFF00-|r Wallpaper for menus on title bar got a customization option under tooltips bracket on Options Panel.\n\n|cFFFFFF00-|r Updated spell list for Crowd Control and class detection.\n\n|cFFFFFF00-|r Improved Weakaura creation tool under Encounter Details Plugin.\n\n|cFFFFFF00v3.12.10 (|cFFFFCC00April 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added the spell uptime on damage player detail window.\n\n|cFFFFFF00-|r Added Rune Tap as cooldown.\n\n|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n|cFFFFFF00v3.12.7 (|cFFFFCC00April 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n|cFFFFFF00v3.12.6 (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): added a report button on Emotes tab.\n\n|cFFFFFF00-|r Encounter Details (plugin): improved Weakauras creation.\n\n|cFFFFFF00-|r Encounter Details (plugin): fixed the report text for interrupts and dispells.\n\n|cFFFFFF00-|r Crowd control by Pets now is merged with its owner.\n\n|cFFFFFF00-|r Truncated left text on bars now shows the entire text when hover over the bar.\n\n|cFFFFFF00-|r Added an extra option on minimap menu to disable the minimap icon.\n\n|cFFFFFF00-|r Fixed a problem when disabling the minimap icon through options panel.\n\n|cFFFFFF00-|r Fixed an issue with item level tracker feature.\n\n|cFFFFFF00v3.12.2 (|cFFFFCC00Mar 30, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Raid Check (plugin): added item level.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): bug fixes, it's important to update it.\n\n|cFFFFFF00-|r Time Line (plugin): bug fixes.\n\n|cFFFFFF00-|r Added option to disabled th eitem level tracker.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel.\n\n|cFFFFFF00-|r Fixed issue with Dps/Hps data broker which wasn't respecting the type of time (effective/activity) selected.\n\n|cFFFFFF00-|r Fixed few bugs when using the key bind to toggle windows." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.17.0 (|cFFFFCC00Jul 07, 2015|r|cFFFFFF00)|r:\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.\n\n|cFFFFFF00-|r Small interface tweaks on tooltips, bookmark and player detail window.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show amount of casts and uptime.\n\n|cFFFFFF00-|r Added an extra tooltip for the class icon at the player's bar.\n\n|cFFFFFF00-|r Activity time now has only 3 seconds inactivity tolerance on battlegrounds and arenas.\n\n|cFFFFFF00-|r Effective time will automatically be used when inside a battleground and using sync from the score board.\n\n|cFFFFFF00-|r Added 'hide all' option on the minimap menu.\n\n|cFFFFFF00-|r Added support for battlegrounds.\n\n|cFFFFFF00-|r Added option for disable showing battleground enemies when the window is in group mode.\n\n|cFFFFFF00-|r Added option to disable the sync from battleground score board.\n\n|cFFFFFF00-|r Enemies from a battleground match segment won't be erased when the player logout.\n\n|cFFFFFF00v3.14.4 (|cFFFFCC00May 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r TimeLine (plugin): now also shows marks symbolizing the player death.\n\n|cFFFFFF00-|r Added raid history panel. Open it through bookmark or /details history.\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n|cFFFFFF00-|r Added report history on report button.\n\n|cFFFFFF00-|r Added key bindings settings for report what is shown on window #1 or #2.\n\n|cFFFFFF00v3.14.0b (|cFFFFCC00May 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several texture changes for a smaller download size.\n\n|cFFFFFF00v3.13.4a (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created 'Details! Forge' but is still under development: /details forge.\n\n|cFFFFFF00-|r Several improvements on combatlog reader and custom displays.\n\n|cFFFFFF00-|r Improvements on enemies damage taken tooltip.\n\n|cFFFFFF00v3.13.1 (|cFFFFCC00April 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added casted amount for healing and damage spells. The result is shown on Player Detail Window and Comparison Panel.\n\n|cFFFFFF00-|r Added uptime amount for healing spells on Player Detail Window.\n\n|cFFFFFF00-|r Added an option to disable lock/resize/ungroup buttons. It's under miscellaneous bracket on Options Panel.\n\n|cFFFFFF00-|r Wallpaper for menus on title bar got a customization option under tooltips bracket on Options Panel.\n\n|cFFFFFF00-|r Updated spell list for Crowd Control and class detection.\n\n|cFFFFFF00-|r Improved Weakaura creation tool under Encounter Details Plugin.\n\n|cFFFFFF00v3.12.10 (|cFFFFCC00April 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added the spell uptime on damage player detail window.\n\n|cFFFFFF00-|r Added Rune Tap as cooldown.\n\n|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n|cFFFFFF00v3.12.7 (|cFFFFCC00April 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n|cFFFFFF00v3.12.6 (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): added a report button on Emotes tab.\n\n|cFFFFFF00-|r Encounter Details (plugin): improved Weakauras creation.\n\n|cFFFFFF00-|r Encounter Details (plugin): fixed the report text for interrupts and dispells.\n\n|cFFFFFF00-|r Crowd control by Pets now is merged with its owner.\n\n|cFFFFFF00-|r Truncated left text on bars now shows the entire text when hover over the bar.\n\n|cFFFFFF00-|r Added an extra option on minimap menu to disable the minimap icon.\n\n|cFFFFFF00-|r Fixed a problem when disabling the minimap icon through options panel.\n\n|cFFFFFF00-|r Fixed an issue with item level tracker feature.\n\n|cFFFFFF00v3.12.2 (|cFFFFCC00Mar 30, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Raid Check (plugin): added item level.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): bug fixes, it's important to update it.\n\n|cFFFFFF00-|r Time Line (plugin): bug fixes.\n\n|cFFFFFF00-|r Added option to disabled th eitem level tracker.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel.\n\n|cFFFFFF00-|r Fixed issue with Dps/Hps data broker which wasn't respecting the type of time (effective/activity) selected.\n\n|cFFFFFF00-|r Fixed few bugs when using the key bind to toggle windows." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index 0449aa56..26065753 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -2779,7 +2779,12 @@ function _detalhes:monta_relatorio (este_relatorio, custom) tinsert (_detalhes.latest_report_table, 1, t) end else - tinsert (_detalhes.latest_report_table, 1, {self.meu_id, self.atributo, self.sub_atributo, amt, _detalhes.report_where}) + if (self.atributo == 5) then + local custom_name = self:GetCustomObject():GetName() + tinsert (_detalhes.latest_report_table, 1, {self.meu_id, self.atributo, self.sub_atributo, amt, _detalhes.report_where, custom_name}) + else + tinsert (_detalhes.latest_report_table, 1, {self.meu_id, self.atributo, self.sub_atributo, amt, _detalhes.report_where}) + end end tremove (_detalhes.latest_report_table, 11) end @@ -3224,6 +3229,8 @@ function _detalhes:envia_relatorio (linhas, custom) editbox:ClearFocus() end + _detalhes:DelayUpdateReportWindowRecentlyReported() + if (_detalhes.report_where == "COPY") then return _detalhes:SendReportTextWindow (linhas) end diff --git a/core/control.lua b/core/control.lua index eab2cbe6..bfde37e7 100644 --- a/core/control.lua +++ b/core/control.lua @@ -1067,7 +1067,7 @@ end function _detalhes:PostponeInstanceToCurrent (instance) - if ((instance.last_interaction+6 < _detalhes._tempo) and (not DetailsReportWindow or not DetailsReportWindow:IsShown())) then + if (not instance.last_interaction or ((instance.last_interaction+6 < _detalhes._tempo) and (not DetailsReportWindow or not DetailsReportWindow:IsShown()))) then if (instance.segmento == 0) then return _detalhes:TrocaSegmentoAtual (instance) end @@ -1077,7 +1077,6 @@ function _detalhes:TrocaSegmentoAtual (instancia) if (instancia.segmento == 0) then --> esta mostrando a tabela Atual - if ((instancia.last_interaction and (instancia.last_interaction+6 > _detalhes._tempo)) or (DetailsReportWindow and DetailsReportWindow:IsShown())) then --> postpone return _detalhes:ScheduleTimer ("PostponeInstanceToCurrent", 2, instancia) diff --git a/functions/attributes.lua b/functions/attributes.lua index 90eec933..50b8c8f2 100644 --- a/functions/attributes.lua +++ b/functions/attributes.lua @@ -233,13 +233,28 @@ do return _detalhes.atributos.lista [attribute] end - function _detalhes:GetSubAttributeName (attribute, subAttribute) + function _detalhes:GetSubAttributeName (attribute, subAttribute, customName) if (attribute == 5) then + local CustomObject = _detalhes.custom [subAttribute] + + if (CustomObject and customName and CustomObject.name == customName) then + return CustomObject.name + + elseif (CustomObject and customName and CustomObject.name ~= customName) then + for _, custom in ipairs (_detalhes.custom) do + if (custom.name == customName) then + return custom.name + end + end + return "--x--x--" + elseif (CustomObject and not customName) then + return CustomObject.name + end + if (not CustomObject) then return "--x--x--" end - return CustomObject.name end return _detalhes.sub_atributos [attribute].lista [subAttribute] end diff --git a/gumps/janela_info.lua b/gumps/janela_info.lua index 47bedb2d..048deea9 100644 --- a/gumps/janela_info.lua +++ b/gumps/janela_info.lua @@ -833,6 +833,8 @@ function _detalhes:ApplyPDWSkin (skin_name) if (info and info:IsShown() and info.jogador and info.jogador.classe) then info.SetClassIcon (info.jogador, info.jogador.classe) end + + _detalhes:ApplyRPSkin (skin_name) end function _detalhes:SetPlayerDetailsWindowTexture (texture) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index 238ab615..15c2c2da 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -7477,7 +7477,11 @@ function gump:CriaCabecalho (baseframe, instancia) --> SELEÇÃO DO MODO ---------------------------------------------------------------------------------------------------------------------------------------------------- - baseframe.cabecalho.modo_selecao = gump:NewButton (baseframe, nil, "DetailsModeButton"..instancia.meu_id, nil, 16, 16, _detalhes.empty_function, nil, nil, [[Interface\AddOns\Details\images\modo_icone]]) + local open_options_panel = function() + _detalhes:OpenOptionsWindow (instancia) + end + + baseframe.cabecalho.modo_selecao = gump:NewButton (baseframe, nil, "DetailsModeButton"..instancia.meu_id, nil, 16, 16, open_options_panel, nil, nil, [[Interface\AddOns\Details\images\modo_icone]]) baseframe.cabecalho.modo_selecao:SetPoint ("bottomleft", baseframe.cabecalho.ball, "bottomright", instancia.menu_anchor [1], instancia.menu_anchor [2]) baseframe.cabecalho.modo_selecao:SetFrameLevel (baseframe:GetFrameLevel()+5) @@ -7762,13 +7766,15 @@ function gump:CriaCabecalho (baseframe, instancia) GameCooltip:SetOption ("ButtonsYMod", -7) GameCooltip:SetOption ("HeighMod", 8) + _detalhes:CheckLastReportsIntegrity() + local last_reports = _detalhes.latest_report_table if (#last_reports > 0) then for index = #last_reports, 1, -1 do local report = last_reports [index] - local instance_number, attribute, subattribute, amt, report_where = unpack (report) + local instance_number, attribute, subattribute, amt, report_where, custom_name = unpack (report) - local name = _detalhes:GetSubAttributeName (attribute, subattribute) + local name = _detalhes:GetSubAttributeName (attribute, subattribute, custom_name) local artwork = _detalhes.GetReportIconAndColor (report_where) diff --git a/gumps/janela_report.lua b/gumps/janela_report.lua index dfdde09e..2c215dde 100644 --- a/gumps/janela_report.lua +++ b/gumps/janela_report.lua @@ -18,8 +18,6 @@ local _IsInGuild = IsInGuild --> wow api locals local _GetChannelList = GetChannelList --> wow api locals local _UIParent = UIParent --> wow api locals -local _UISpecialFrames = UISpecialFrames --> wow api locals - --> details API functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function _detalhes:FastReportWindow (window) @@ -280,6 +278,13 @@ local _UISpecialFrames = UISpecialFrames --> wow api locals if (botao == "LeftButton") then self:StartMoving() self.isMoving = true + elseif (botao == "RightButton") then + if (self.isMoving) then + self:StopMovingOrSizing() + savepos (self) + self.isMoving = false + end + self:Hide() end end) @@ -378,6 +383,7 @@ local function cria_drop_down (este_gump) local select_output = gump:NewDropDown (este_gump, _, "$parentOutputDropdown", "select", 185, 20, build_list, 1) select_output:SetPoint ("topleft", este_gump, "topleft", 107, -55) este_gump.select = select_output.widget + este_gump.dropdown = select_output function select_output:CheckValid() @@ -502,7 +508,7 @@ local function cria_drop_down (este_gump) editbox:SetHeight (14) editbox:SetWidth (120) - editbox:SetJustifyH ("LEFT") + editbox:SetJustifyH ("center") editbox:EnableMouse(true) editbox:SetBackdrop ({ bgFile = "Interface\\ChatFrame\\ChatFrameBackground", @@ -540,7 +546,7 @@ local function cria_drop_down (este_gump) editbox:SetScript ("OnEnter", function() editbox.mouse_over = true - editbox:SetBackdropColor(0.1, 0.1, 0.1, 0.7) + --editbox:SetBackdropColor(0.1, 0.1, 0.1, 0.7) if (editbox:GetText() == "" and not editbox.focus) then editbox:SetText (Loc ["STRING_REPORTFRAME_INSERTNAME"]) end @@ -548,7 +554,7 @@ local function cria_drop_down (este_gump) editbox:SetScript ("OnLeave", function() editbox.mouse_over = false - editbox:SetBackdropColor(0.0, 0.0, 0.0, 0.0) + --editbox:SetBackdropColor(0.0, 0.0, 0.0, 0.0) if (not editbox:HasFocus()) then if (editbox:GetText() == Loc ["STRING_REPORTFRAME_INSERTNAME"]) then editbox:SetText("") @@ -606,120 +612,479 @@ local function cria_drop_down (este_gump) --> frame creation function + + local elvui_skin = function() + + local window = DetailsReportWindow + + local b_onenter = function (self) + self:SetBackdropColor (0.4, 0.4, 0.4, 0.6) + self.icon:SetBlendMode ("ADD") + _detalhes:SetFontColor (self.text, "yellow") + end + local b_onleave = function (self) + self:SetBackdropColor (0, 0, 0, 0.3) + self.icon:SetBlendMode ("BLEND") + _detalhes:SetFontColor (self.text, "white") + end + + for i = 1, 9 do --window.max_last_buttons + local b = window.recently_report_buttons [i] + + b:SetSize (120, 16) + b:SetPoint ("topleft", window, "topleft", 10, -12 + (i*17*-1)) + b:Show() + b:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, + insets = {left = 0, right = 0, top = 0, bottom = 0}}) + b:SetBackdropColor (0, 0, 0, 0.3) + b.text:SetTextColor (1, 1, 1, 1) + _detalhes:SetFontSize (b.text, 9) + + b:SetScript ("OnEnter", b_onenter) + b:SetScript ("OnLeave", b_onleave) + end + + window.fechar:SetWidth (20) + window.fechar:SetHeight (20) + window.fechar:SetPoint ("TOPRIGHT", window, "TOPRIGHT", 0, -3) + window.fechar:Show() + window.fechar:GetNormalTexture():SetDesaturated (true) + + local b = window.recently_report_buttons [10] + b:Hide() + + Details_Report_CB_1:Hide() + Details_Report_CB_2:Hide() + + window.dropdown:ClearAllPoints() + window.dropdown:SetWidth (155) + window.dropdown:SetPoint ("topleft", window, "topleft", 160, -30) + window.dropdown:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, tile=true, + tileSize = 64, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + window.dropdown:SetBackdropBorderColor (0, 0, 0, 0.5) + window.dropdown:SetBackdropColor (0, 0, 0, 0.1) + + window.wisp_who:ClearAllPoints() + window.editbox:ClearAllPoints() + window.wisp_who:SetPoint ("topleft", window.dropdown.widget, "bottomleft", 0, -11) + window.editbox:SetPoint ("topleft", window.wisp_who, "bottomleft", 0, -3) + window.editbox:SetWidth (155) + window.editbox:SetHeight (20) + window.editbox:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, tile=true, + tileSize = 64, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + window.editbox:SetBackdropBorderColor (0, 0, 0, 0.5) + window.editbox:SetBackdropColor (0, 0, 0, 0.3) + + window.linhas_amt:ClearAllPoints() + window.linhas_amt:SetPoint ("topleft", window.editbox, "bottomleft", 0, -11) + window.slider:ClearAllPoints() + window.slider:SetWidth (155) + window.slider:SetPoint ("topleft", window.linhas_amt, "bottomleft", 0, -3) + window.slider:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, tile=true, + tileSize = 64, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + window.slider:SetBackdropBorderColor (0, 0, 0, 0.5) + window.slider:SetBackdropColor (0, 0, 0, 0.3) + + window.slider.thumb:SetTexture ([[Interface\AddOns\Details\images\icons2]]) + window.slider.thumb:SetTexCoord (482/512, 492/512, 104/512, 120/512) + window.slider.thumb:SetSize (16, 16) + window.slider.thumb:SetVertexColor (0.6, 0.6, 0.6, 0.95) + + window.enviar:ClearAllPoints() + window.enviar:SetPoint ("topleft", window.slider, "bottomleft", 0, -15) + window.enviar:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, tile=true, + tileSize = 64, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + window.enviar:SetBackdropBorderColor (0, 0, 0, 0.5) + window.enviar:SetBackdropColor (0, 0, 0, 0.3) + window.enviar.Left:Hide() + window.enviar.Middle:Hide() + window.enviar.Right:Hide() + + window:SetWidth (342) + window:SetHeight (190) + window:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) + window:SetBackdropColor (1, 1, 1, 1) + window:SetBackdropBorderColor (0, 0, 0, 1) + + if (not window.elvui_widgets) then + window.elvui_widgets = {} + + local titlebar = CreateFrame ("frame", window:GetName() .. "ElvUITitleBar", window) + titlebar:SetPoint ("topleft", window, "topleft", 2, -3) + titlebar:SetPoint ("topright", window, "topright", -2, -3) + titlebar:SetHeight (20) + titlebar:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + titlebar:SetBackdropColor (.5, .5, .5, 1) + titlebar:SetBackdropBorderColor (0, 0, 0, 1) + + local bg1 = window:CreateTexture (nil, "background") + bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true) + bg1:SetAlpha (0.7) + bg1:SetVertexColor (0.27, 0.27, 0.27) + bg1:SetVertTile (true) + bg1:SetHorizTile (true) + bg1:SetAllPoints() + + tinsert (window.all_widgets, bg1) + tinsert (window.elvui_widgets, bg1) + tinsert (window.all_widgets, titlebar) + tinsert (window.elvui_widgets, titlebar) + end + + window.title:ClearAllPoints() + window.title:SetPoint ("center", window, "center") + window.title:SetPoint ("top", window, "top", 0, -7) + window.title:SetParent (_G [window:GetName() .. "ElvUITitleBar"]) + window.title:SetTextColor (.8, .8, .8, 1) + window.title:Show() + + for _, widget in ipairs (window.elvui_widgets) do + widget:Show() + end + + end + + local classic_skin = function() + + local window = DetailsReportWindow + + local b_onenter = function (self) + self:SetBackdropColor (0.4, 0.4, 0.4, 0.6) + self.icon:SetBlendMode ("ADD") + _detalhes:SetFontColor (self.text, "yellow") + end + local b_onleave = function (self) + self:SetBackdropColor (0, 0, 0, 0.3) + self.icon:SetBlendMode ("BLEND") + _detalhes:SetFontColor (self.text, "white") + end + + for i = 1, 9 do --window.max_last_buttons + local b = window.recently_report_buttons [i] + + b:SetSize (120, 16) + b:SetPoint ("topleft", window, "topleft", 10, -50 + (i*17*-1)) + b:Show() + b:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, + insets = {left = 0, right = 0, top = 0, bottom = 0}}) + b:SetBackdropColor (0, 0, 0, 0.3) + b.text:SetTextColor (1, 1, 1, 1) + _detalhes:SetFontSize (b.text, 9) + + b:SetScript ("OnEnter", b_onenter) + b:SetScript ("OnLeave", b_onleave) + end + + local b = window.recently_report_buttons [10] + b:Hide() + + Details_Report_CB_1:Hide() + Details_Report_CB_2:Hide() + + window.dropdown:ClearAllPoints() + window.dropdown:SetWidth (145) + window.dropdown:SetPoint ("topleft", window, "topleft", 160, -68) + + + window.wisp_who:ClearAllPoints() + window.editbox:ClearAllPoints() + window.wisp_who:SetPoint ("topleft", window.dropdown.widget, "bottomleft", 0, -11) + window.editbox:SetPoint ("topleft", window.wisp_who, "bottomleft", 0, -3) + window.editbox:SetWidth (145) + window.editbox:SetHeight (20) + window.editbox:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\AddOns\Details\images\border_3]], tile=true, + edgeSize = 15, tileSize = 64, insets = {left = 3, right = 3, top = 4, bottom = 4}}) + + window.linhas_amt:ClearAllPoints() + window.linhas_amt:SetPoint ("topleft", window.editbox, "bottomleft", 0, -11) + window.slider:ClearAllPoints() + window.slider :SetWidth (145) + window.slider:SetPoint ("topleft", window.linhas_amt, "bottomleft", 0, -3) + window.slider:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\AddOns\Details\images\border_3]], tile=true, + edgeSize = 15, tileSize = 64, insets = {left = 3, right = 3, top = 4, bottom = 4}}) + + window.slider.thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob") + window.slider.thumb:SetSize (30, 24) + window.slider.thumb:SetAlpha (0.7) + + window.enviar:ClearAllPoints() + window.enviar:SetPoint ("topleft", window.slider, "bottomleft", 0, -11) + window.enviar.Left:Show() + window.enviar.Middle:Show() + window.enviar.Right:Show() + + window:SetWidth (342) + window:SetHeight (255) + window:SetBackdrop (nil) + + window.fechar:Hide() + window.title:Hide() + + if (not window.classic_widgets) then + window.classic_widgets = {} + + local f = CreateFrame ("frame", window:GetName() .. "F", window, "ButtonFrameTemplate") + f:SetAllPoints() + + f.portrait:SetTexture ("Interface\\AddOns\\Details\\images\\report_frame_icons") + f.portrait:SetTexCoord (1/256, 64/256, 1/256, 64/256) + + f.TitleText:SetText (Loc ["STRING_REPORTFRAME_WINDOW_TITLE"]) + f:SetFrameLevel (window:GetFrameLevel()-1) + + _G [window:GetName() .. "FCloseButton"]:SetFrameLevel (window:GetFrameLevel()+1) + _G [window:GetName() .. "FCloseButton"]:SetScript ("OnClick", function() + window:Hide() + end) + + tinsert (window.classic_widgets, f) + tinsert (window.all_widgets, f) + end + + for _, widget in ipairs (window.classic_widgets) do + widget:Show() + end + + end + + + function _detalhes:UpdateRecentlyReported() + DetailsReportWindow:RefreshRecentlyReported() + end + function _detalhes:DelayUpdateReportWindowRecentlyReported() + if (DetailsReportWindow) then + _detalhes:ScheduleTimer ("UpdateRecentlyReported", 0.5) + end + end + + function _detalhes:CheckLastReportsIntegrity() + local last_reports = _detalhes.latest_report_table or {} + if (#last_reports > 0) then + local i = 1 + for index = #last_reports, 1, -1 do + local report = last_reports [index] + local instance_id, atributo, sub_atributo, amt, where, custom_name = unpack (report) + if (atributo == 5) then + if (not custom_name) then + tremove (last_reports, index) + else + local found + for _, custom in ipairs (_detalhes.custom) do + if (custom.name == custom_name) then + found = true + break + end + end + if (not found) then + tremove (last_reports, index) + end + end + end + end + end + end + function gump:CriaJanelaReport() - - local este_gump = _CreateFrame ("Frame", "DetailsReportWindow", _UIParent) - este_gump:SetPoint ("CENTER", UIParent, "CENTER") - este_gump:SetFrameStrata ("DIALOG") - - este_gump:SetScript ("OnShow", function (self) - local dropdown = este_gump.select.MyObject - local where = _detalhes.report_where + + --> window + local window = _CreateFrame ("Frame", "DetailsReportWindow", _UIParent) + tinsert (UISpecialFrames, "DetailsReportWindow") + window:SetPoint ("CENTER", UIParent, "CENTER") + window:SetFrameStrata ("DIALOG") + window.skins = {} + window.all_widgets = {} + window.max_last_buttons = 10 - local list = este_gump.dropdown_func() - local found + window:EnableMouse (true) + window:SetResizable (false) + window:SetMovable (true) + restorepos (window) + + _detalhes.janela_report = window + + _detalhes:InstallRPSkin ("WoWClassic", classic_skin) + _detalhes:InstallRPSkin ("ElvUI", elvui_skin) + + --> all new widgets: - for index, option in ipairs (list) do - if (option.value == where) then - dropdown:Select (where) - found = true - break + --recently reported: + window.recently_report_buttons = {} + + function window:RefreshRecentlyReported() + for i = 1, window.max_last_buttons do + local b = window.recently_report_buttons [i] + b.icon:SetTexture (nil) + b:Hide() + end + + _detalhes:CheckLastReportsIntegrity() + + local last_reports = _detalhes.latest_report_table + if (#last_reports > 0) then + local i = 1 + for index = 1, min (#last_reports, 10) do + local b = window.recently_report_buttons [i] + local report = last_reports [index] + local instance_number, attribute, subattribute, amt, report_where = unpack (report) + local name = _detalhes:GetSubAttributeName (attribute, subattribute) + local artwork = _detalhes.GetReportIconAndColor (report_where) + + b.text:SetText (name .. " (#" .. amt .. ")") + b.index = index + if (artwork) then + b.icon:SetTexture (artwork.icon) + b.icon:SetTexCoord (artwork.coords[1], artwork.coords[2], artwork.coords[3], artwork.coords[4]) + b.icon:SetVertexColor (unpack (artwork.color or {})) + end + + b:Show() + i = i + 1 + end end end - if (not found) then - if (_IsInRaid()) then - dropdown:Select ("RAID") - _detalhes.report_where = "RAID" - - elseif (GetNumSubgroupMembers() > 0) then - dropdown:Select ("PARTY") - _detalhes.report_where = "PARTY" - - elseif (_IsInGuild()) then - dropdown:Select ("GUILD") - _detalhes.report_where = "GUILD" - - else - dropdown:Select ("SAY") - _detalhes.report_where = "SAY" + local recently_on_click = function (self) + if (self.index) then + return _detalhes.ReportFromLatest (_, _, self.index) + end + end + + for i = 1, window.max_last_buttons do + local b = CreateFrame ("button", "DetailsReportWindowRRB" .. i, window) + local icon = b:CreateTexture (nil, "overlay") + icon:SetPoint ("left", b, "left") + icon:SetSize (16, 16) + local text = b:CreateFontString (nil, "overlay", "GameFontNormal") + text:SetPoint ("left", icon, "right", 2, 0) + b.icon = icon + b.text = text + b:SetScript ("OnClick", recently_on_click) + tinsert (window.recently_report_buttons, b) + end + + --> scritps + window:SetScript ("OnShow", function (self) + local dropdown = window.select.MyObject + local where = _detalhes.report_where + + local list = window.dropdown_func() + local found + + for index, option in ipairs (list) do + if (option.value == where) then + dropdown:Select (where) + found = true + break + end end - end - - end) - - _tinsert (_UISpecialFrames, este_gump:GetName()) - - este_gump:SetScript ("OnHide", function (self) - _detalhes.janela_report.ativa = false - _detalhes.last_report_id = nil - - if (_detalhes.delay_CheckSwitchToCurrent) then - _detalhes.delay_CheckSwitchToCurrent = nil - _detalhes:CheckSwitchToCurrent() - end - end) - - este_gump:SetWidth (320) - este_gump:SetHeight (128) - este_gump:EnableMouse (true) - este_gump:SetResizable (false) - este_gump:SetMovable (true) - restorepos (este_gump) - - _detalhes.janela_report = este_gump - - --> icone - este_gump.icone = este_gump:CreateTexture (nil, "BACKGROUND") - este_gump.icone:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 40, -10) - este_gump.icone:SetTexture ("Interface\\AddOns\\Details\\images\\report_frame_icons") --> top left - este_gump.icone:SetWidth (64) - este_gump.icone:SetHeight (64) - este_gump.icone:SetTexCoord (1/256, 64/256, 1/256, 64/256) --left right top bottom - - --> cria as 2 partes do fundo da janela - este_gump.bg1 = este_gump:CreateTexture (nil, "BORDER") - este_gump.bg1:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 0, 0) - este_gump.bg1:SetTexture ("Interface\\AddOns\\Details\\images\\report_frame1") --> top left - - este_gump.bg2 = este_gump:CreateTexture (nil, "BORDER") - este_gump.bg2:SetPoint ("TOPRIGHT", este_gump, "TOPRIGHT", 0, 0) - este_gump.bg2:SetTexture ("Interface\\AddOns\\Details\\images\\report_frame2") --> top right + + if (not found) then + if (_IsInRaid()) then + dropdown:Select ("RAID") + _detalhes.report_where = "RAID" + + elseif (GetNumSubgroupMembers() > 0) then + dropdown:Select ("PARTY") + _detalhes.report_where = "PARTY" + + elseif (_IsInGuild()) then + dropdown:Select ("GUILD") + _detalhes.report_where = "GUILD" + + else + dropdown:Select ("SAY") + _detalhes.report_where = "SAY" + end + end + + window:RefreshRecentlyReported() + + end) + window:SetScript ("OnHide", function (self) + _detalhes.janela_report.ativa = false + _detalhes.last_report_id = nil + + if (_detalhes.delay_CheckSwitchToCurrent) then + _detalhes.delay_CheckSwitchToCurrent = nil + _detalhes:CheckSwitchToCurrent() + end + end) + --> botão de fechar - este_gump.fechar = CreateFrame ("Button", nil, este_gump, "UIPanelCloseButton") - este_gump.fechar:SetWidth (32) - este_gump.fechar:SetHeight (32) - este_gump.fechar:SetPoint ("TOPRIGHT", este_gump, "TOPRIGHT", -20, -23) - este_gump.fechar:SetText ("X") - este_gump.fechar:SetScript ("OnClick", function() - gump:Fade (este_gump, 1) + window.fechar = CreateFrame ("Button", nil, window, "UIPanelCloseButton") + window.fechar:SetScript ("OnClick", function() + gump:Fade (window, 1) _detalhes.janela_report.ativa = false end) - este_gump.titulo = este_gump:CreateFontString (nil, "OVERLAY", "GameFontHighlightLeft") - este_gump.titulo:SetText (Loc ["STRING_REPORTFRAME_WINDOW_TITLE"]) - este_gump.titulo:SetTextColor (0.999, 0.819, 0, 1) - este_gump.titulo:SetPoint ("topleft", este_gump, "topleft", 120, -33) + --> title + window.title = window:CreateFontString (nil, "OVERLAY", "GameFontHighlightLeft") + window.title:SetText (Loc ["STRING_REPORTFRAME_WINDOW_TITLE"]) - seta_scripts (este_gump) + seta_scripts (window) + cria_drop_down (window) + cria_slider (window) + cria_wisper_field (window) + cria_check_buttons (window) - cria_drop_down (este_gump) - cria_slider (este_gump) - cria_wisper_field (este_gump) - cria_check_buttons (este_gump) + window.enviar = _CreateFrame ("Button", nil, window, "OptionsButtonTemplate") + window.enviar:SetPoint ("topleft", window.editbox, "topleft", 61, -19) + window.enviar:SetWidth (60) + window.enviar:SetHeight (15) + window.enviar:SetText (Loc ["STRING_REPORTFRAME_SEND"]) - este_gump.enviar = _CreateFrame ("Button", nil, este_gump, "OptionsButtonTemplate") + gump:Fade (window, 1) + gump:CreateFlashAnimation (window) - este_gump.enviar:SetPoint ("topleft", este_gump.editbox, "topleft", 61, -19) + --apply the current skin + _detalhes:ApplyRPSkin() - este_gump.enviar:SetWidth (60) - este_gump.enviar:SetHeight (15) - este_gump.enviar:SetText (Loc ["STRING_REPORTFRAME_SEND"]) - - gump:Fade (este_gump, 1) - gump:CreateFlashAnimation (este_gump) + return window - return este_gump + end + + function _detalhes:InstallRPSkin (skin_name, func) + if (not DetailsReportWindow) then + gump:CriaJanelaReport() + DetailsReportWindow:Hide() + end + + if (not skin_name) then + return false -- sem nome + elseif (DetailsReportWindow.skins [skin_name]) then + return false -- ja existe + end - end \ No newline at end of file + DetailsReportWindow.skins [skin_name] = func + return true + end + + function _detalhes:ApplyRPSkin (skin_name) + + if (not DetailsReportWindow) then + gump:CriaJanelaReport() + DetailsReportWindow:Hide() + end + + if (not skin_name) then + skin_name = _detalhes.player_details_window.skin + if (not DetailsReportWindow.skins [skin_name]) then + skin_name = "ElvUI" + end + end + + local skin = DetailsReportWindow.skins [skin_name] + if (skin) then + + for _, widget in ipairs (DetailsReportWindow.all_widgets) do + widget:Hide() + end + + local successful, errortext = pcall (skin) + if (not successful) then + _detalhes:Msg ("error occurred on report window skin call():", errortext) + pcall (DetailsReportWindow.skins["ElvUI"]) + end + end + end \ No newline at end of file diff --git a/images/report_frame1.tga b/images/report_frame1.tga deleted file mode 100644 index e675d8fb..00000000 Binary files a/images/report_frame1.tga and /dev/null differ diff --git a/images/report_frame2.tga b/images/report_frame2.tga deleted file mode 100644 index 53db2611..00000000 Binary files a/images/report_frame2.tga and /dev/null differ diff --git a/images/report_frame_icons.tga b/images/report_frame_icons.tga index 77dfe97e..f85fb7f7 100644 Binary files a/images/report_frame_icons.tga and b/images/report_frame_icons.tga differ