diff --git a/Libs/DF/button.lua b/Libs/DF/button.lua index 97e9a39d..801c1f89 100644 --- a/Libs/DF/button.lua +++ b/Libs/DF/button.lua @@ -394,7 +394,7 @@ local ButtonMetaFunctions = _G [DF.GlobalWidgetControlNames ["button"]] end -- icon - function ButtonMetaFunctions:SetIcon (texture, width, height, layout, texcoord, overlay, textdistance, leftpadding, textheight) + function ButtonMetaFunctions:SetIcon (texture, width, height, layout, texcoord, overlay, textdistance, leftpadding, textheight, short_method) if (not self.icon) then self.icon = self:CreateTexture (nil, "artwork") self.icon:SetSize (self.height*0.8, self.height*0.8) @@ -427,9 +427,13 @@ local ButtonMetaFunctions = _G [DF.GlobalWidgetControlNames ["button"]] local iconw = self.icon:GetWidth() local text_width = self.button.text:GetStringWidth() if (text_width > w-15-iconw) then - if (not short_method) then + + if (short_method == false) then + + elseif (not short_method) then local new_width = text_width+15+iconw self.button:SetWidth (new_width) + elseif (short_method == 1) then local loop = true local textsize = 11 @@ -443,6 +447,7 @@ local ButtonMetaFunctions = _G [DF.GlobalWidgetControlNames ["button"]] textsize = textsize - 1 end end + end end @@ -1015,6 +1020,9 @@ function DF:NewButton (parent, container, name, member, w, h, func, param1, para textsize = textsize - 1 end end + + elseif (short_method == 2) then + end end diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index facb0527..74c922bc 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,5 +1,5 @@ -local dversion = 50 +local dversion = 52 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary (major, minor) @@ -304,10 +304,18 @@ function DF:GetFontFace (fontString) return fontface end +local ValidOutlines = { + ["NONE"] = true, + ["MONOCHROME"] = true, + ["OUTLINE"] = true, + ["THICKOUTLINE"] = true, +} function DF:SetFontOutline (fontString, outline) local fonte, size = fontString:GetFont() if (outline) then - if (_type (outline) == "boolean" and outline) then + if (ValidOutlines [outline]) then + outline = outline + elseif (_type (outline) == "boolean" and outline) then outline = "OUTLINE" elseif (outline == 1) then outline = "OUTLINE" @@ -650,7 +658,7 @@ end elseif (widget_table.type == "execute" or widget_table.type == "button") then - local button = DF:NewButton (parent, nil, "$parentWidget" .. index, nil, 120, 18, widget_table.func, widget_table.param1, widget_table.param2, nil, widget_table.name, nil, button_template) + local button = DF:NewButton (parent, nil, "$parentWidget" .. index, nil, 120, 18, widget_table.func, widget_table.param1, widget_table.param2, nil, widget_table.name, nil, button_template, text_template) if (not button_template) then button:InstallCustomTexture() end @@ -667,6 +675,28 @@ end tinsert (parent.widget_list, button) widget_created = button + + elseif (widget_table.type == "textentry") then + local textentry = DF:CreateTextEntry (parent, widget_table.func, 120, 18, nil, "$parentWidget" .. index, nil, button_template) + textentry.tooltip = widget_table.desc + textentry.text = widget_table.get() + textentry._get = widget_table.get + textentry.widget_type = "textentry" + textentry:SetHook ("OnEnterPressed", widget_table.set) + textentry:SetHook ("OnEditFocusLost", widget_table.set) + + local label = DF:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name .. (use_two_points and ": " or ""), "GameFontNormal", widget_table.text_template or text_template or 12) + textentry:SetPoint ("left", label, "right", 2) + label:SetPoint (cur_x, cur_y) + + local size = label.widget:GetStringWidth() + 60 + 4 + if (size > max_x) then + max_x = size + end + + tinsert (parent.widget_list, textentry) + widget_created = textentry + end if (widget_table.nocombat) then @@ -840,6 +870,8 @@ end widget:Select (widget._get()) elseif (widget.widget_type == "toggle" or widget.widget_type == "range") then widget:SetValue (widget._get()) + elseif (widget.widget_type == "textentry") then + widget:SetText (widget._get()) elseif (widget.widget_type == "color") then local default_value, g, b, a = widget._get() if (type (default_value) == "table") then diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index 78d384f0..946395d0 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -1526,7 +1526,7 @@ end local no_options = {} function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db) - + if (db and name and not db [name]) then db [name] = {scale = 1} end @@ -1540,7 +1540,7 @@ function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db) end panel_options = panel_options or no_options - + local f = CreateFrame ("frame", name, UIParent) f:SetSize (w or 400, h or 250) f:SetPoint ("center", UIParent, "center", 0, 0) diff --git a/Libs/DF/pictureedit.lua b/Libs/DF/pictureedit.lua index 7435527f..07e03b34 100644 --- a/Libs/DF/pictureedit.lua +++ b/Libs/DF/pictureedit.lua @@ -12,7 +12,7 @@ local _ window:SetMovable (true) tinsert (UISpecialFrames, "DetailsFrameworkImageEdit") window:SetFrameStrata ("TOOLTIP") - window:SetMaxResize (266, 226) + window:SetMaxResize (650, 500) window.hooks = {} @@ -20,13 +20,13 @@ local _ background:SetAllPoints() background:SetTexture (0, 0, 0, .8) - local edit_texture = DF:NewImage (window, nil, 300, 250, "artwork", nil, nil, "$parentImage") + local edit_texture = DF:NewImage (window, nil, 650, 500, "artwork", nil, nil, "$parentImage") edit_texture:SetAllPoints() local background_frame = CreateFrame ("frame", "DetailsFrameworkImageEditBackground", DetailsFrameworkImageEdit) background_frame:SetPoint ("topleft", DetailsFrameworkImageEdit, "topleft", -10, 12) background_frame:SetFrameStrata ("DIALOG") - background_frame:SetSize (400, 252) + background_frame:SetSize (800, 540) background_frame:SetResizable (true) background_frame:SetMovable (true) @@ -50,7 +50,7 @@ local _ local topCoordTexture = DF:NewImage (window, nil, nil, nil, "overlay", nil, nil, "$parentImageTopCoord") topCoordTexture:SetPoint ("topleft", window, "topleft") topCoordTexture:SetPoint ("topright", window, "topright") - topCoordTexture.color = "red" + topCoordTexture:SetColorTexture (1, 0, 0) topCoordTexture.height = 1 topCoordTexture.alpha = .2 @@ -63,9 +63,9 @@ local _ topSlider:SetHook ("OnLeave", function() return true end) local topSliderThumpTexture = topSlider:CreateTexture (nil, "overlay") - topSliderThumpTexture:SetTexture (1, 1, 1) + topSliderThumpTexture:SetColorTexture (1, 1, 1) topSliderThumpTexture:SetWidth (512) - topSliderThumpTexture:SetHeight (3) + topSliderThumpTexture:SetHeight (1) topSlider:SetThumbTexture (topSliderThumpTexture) topSlider:SetHook ("OnValueChange", function (_, _, value) @@ -82,7 +82,7 @@ local _ local bottomCoordTexture = DF:NewImage (window, nil, nil, nil, "overlay", nil, nil, "$parentImageBottomCoord") bottomCoordTexture:SetPoint ("bottomleft", window, "bottomleft", 0, 0) bottomCoordTexture:SetPoint ("bottomright", window, "bottomright", 0, 0) - bottomCoordTexture.color = "red" + bottomCoordTexture:SetColorTexture (1, 0, 0) bottomCoordTexture.height = 1 bottomCoordTexture.alpha = .2 @@ -95,9 +95,9 @@ local _ bottomSlider:SetHook ("OnLeave", function() return true end) local bottomSliderThumpTexture = bottomSlider:CreateTexture (nil, "overlay") - bottomSliderThumpTexture:SetTexture (1, 1, 1) + bottomSliderThumpTexture:SetColorTexture (1, 1, 1) bottomSliderThumpTexture:SetWidth (512) - bottomSliderThumpTexture:SetHeight (3) + bottomSliderThumpTexture:SetHeight (1) bottomSlider:SetThumbTexture (bottomSliderThumpTexture) bottomSlider:SetHook ("OnValueChange", function (_, _, value) @@ -115,7 +115,7 @@ local _ local leftCoordTexture = DF:NewImage (window, nil, nil, nil, "overlay", nil, nil, "$parentImageLeftCoord") leftCoordTexture:SetPoint ("topleft", window, "topleft", 0, 0) leftCoordTexture:SetPoint ("bottomleft", window, "bottomleft", 0, 0) - leftCoordTexture.color = "red" + leftCoordTexture:SetColorTexture (1, 0, 0) leftCoordTexture.width = 1 leftCoordTexture.alpha = .2 @@ -127,8 +127,8 @@ local _ leftSlider:SetHook ("OnLeave", function() return true end) local leftSliderThumpTexture = leftSlider:CreateTexture (nil, "overlay") - leftSliderThumpTexture:SetTexture (1, 1, 1) - leftSliderThumpTexture:SetWidth (3) + leftSliderThumpTexture:SetColorTexture (1, 1, 1) + leftSliderThumpTexture:SetWidth (1) leftSliderThumpTexture:SetHeight (512) leftSlider:SetThumbTexture (leftSliderThumpTexture) @@ -146,7 +146,7 @@ local _ local rightCoordTexture = DF:NewImage (window, nil, nil, nil, "overlay", nil, nil, "$parentImageRightCoord") rightCoordTexture:SetPoint ("topright", window, "topright", 0, 0) rightCoordTexture:SetPoint ("bottomright", window, "bottomright", 0, 0) - rightCoordTexture.color = "red" + rightCoordTexture:SetColorTexture (1, 0, 0) rightCoordTexture.width = 1 rightCoordTexture.alpha = .2 @@ -158,8 +158,8 @@ local _ rightSlider:SetHook ("OnLeave", function() return true end) --[ local rightSliderThumpTexture = rightSlider:CreateTexture (nil, "overlay") - rightSliderThumpTexture:SetTexture (1, 1, 1) - rightSliderThumpTexture:SetWidth (3) + rightSliderThumpTexture:SetColorTexture (1, 1, 1) + rightSliderThumpTexture:SetWidth (1) rightSliderThumpTexture:SetHeight (512) rightSlider:SetThumbTexture (rightSliderThumpTexture) --]] @@ -399,9 +399,98 @@ local _ flipButtonH:SetPoint ("topright", buttonsBackground, "topright", -8, -140) flipButtonH:InstallCustomTexture() -- - local flipButtonV = DF:NewButton (buttonsBackground, nil, "$parentFlipButton2", nil, 100, 20, flip, 2, nil, nil, "Flip V", 1) - flipButtonV:SetPoint ("topright", buttonsBackground, "topright", -8, -160) - flipButtonV:InstallCustomTexture() + + + --> select area to crop + local DragFrame = CreateFrame ("frame", nil, background_frame) + DragFrame:EnableMouse (false) + DragFrame:SetFrameStrata ("TOOLTIP") + DragFrame:SetPoint ("topleft", edit_texture.widget, "topleft") + DragFrame:SetPoint ("bottomright", edit_texture.widget, "bottomright") + DragFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Worldmap\UI-QuestBlob-Inside]], tileSize = 256, tile = true}) + DragFrame:SetBackdropColor (1, 1, 1, .2) + DragFrame:Hide() + + local SelectionBox_Up = DragFrame:CreateTexture (nil, "overlay") + SelectionBox_Up:SetHeight (1) + SelectionBox_Up:SetColorTexture (1, 1, 1) + local SelectionBox_Down = DragFrame:CreateTexture (nil, "overlay") + SelectionBox_Down:SetHeight (1) + SelectionBox_Down:SetColorTexture (1, 1, 1) + local SelectionBox_Left = DragFrame:CreateTexture (nil, "overlay") + SelectionBox_Left:SetWidth (1) + SelectionBox_Left:SetColorTexture (1, 1, 1) + local SelectionBox_Right = DragFrame:CreateTexture (nil, "overlay") + SelectionBox_Right:SetWidth (1) + SelectionBox_Right:SetColorTexture (1, 1, 1) + + function DragFrame.ClearSelectionBoxPoints() + SelectionBox_Up:ClearAllPoints() + SelectionBox_Down:ClearAllPoints() + SelectionBox_Left:ClearAllPoints() + SelectionBox_Right:ClearAllPoints() + end + + local StartCrop = function() + DragFrame:Show() + DragFrame:EnableMouse (true) + end + + local CropSelection = DF:NewButton (buttonsBackground, nil, "$parentCropSelection", nil, 100, 20, StartCrop, 2, nil, nil, "Crop Selection", 1) + --CropSelection:SetPoint ("topright", buttonsBackground, "topright", -8, -260) + CropSelection:InstallCustomTexture() + + DragFrame.OnTick = function (self, deltaTime) + local x1, y1 = unpack (self.ClickedAt) + local x2, y2 = GetCursorPosition() + DragFrame.ClearSelectionBoxPoints() + + print (x1, y1, x2, y2) + + if (x2 > x1) then + --right + if (y1 > y2) then + --top + SelectionBox_Up:SetPoint ("topleft", UIParent, "bottomleft", x1, y1) + SelectionBox_Up:SetPoint ("topright", UIParent, "bottomleft", x2, y1) + + SelectionBox_Left:SetPoint ("topleft", UIParent, "bottomleft", x1, y1) + SelectionBox_Left:SetPoint ("bottomleft", UIParent, "bottomleft", x1, y2) + + print (1) + else + --bottom + + end + else + --left + if (y2 > y1) then + --top + + else + --bottom + + end + end + + end + + DragFrame:SetScript ("OnMouseDown", function (self, MouseButton) + if (MouseButton == "LeftButton") then + self.ClickedAt = {GetCursorPosition()} + DragFrame:SetScript ("OnUpdate", DragFrame.OnTick) + + end + end) + DragFrame:SetScript ("OnMouseUp", function (self, MouseButton) + if (MouseButton == "LeftButton") then + self.ReleaseAt = {GetCursorPosition()} + DragFrame:EnableMouse (false) + DragFrame:Hide() + DragFrame:SetScript ("OnUpdate", nil) + print (self.ClickedAt[1], self.ClickedAt[2], self.ReleaseAt[1], self.ReleaseAt[2]) + end + end) --> accept window.accept = function (self, b, keep_editing) diff --git a/Libs/DF/textentry.lua b/Libs/DF/textentry.lua index ca004ad7..855d24cc 100644 --- a/Libs/DF/textentry.lua +++ b/Libs/DF/textentry.lua @@ -369,7 +369,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 local OnEnterPressed = function (textentry, byScript) local capsule = textentry.MyObject - local kill = capsule:RunHooksForWidget ("OnEnterPressed", textentry, capsule) + local kill = capsule:RunHooksForWidget ("OnEnterPressed", textentry, capsule, capsule.text) if (kill) then return end @@ -398,7 +398,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 local OnEscapePressed = function (textentry) local capsule = textentry.MyObject - local kill = capsule:RunHooksForWidget ("OnEscapePressed", textentry, capsule) + local kill = capsule:RunHooksForWidget ("OnEscapePressed", textentry, capsule, capsule.text) if (kill) then return end @@ -422,7 +422,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 if (textentry:IsShown()) then - local kill = capsule:RunHooksForWidget ("OnEditFocusLost", textentry, capsule) + local kill = capsule:RunHooksForWidget ("OnEditFocusLost", textentry, capsule, capsule.text) if (kill) then return end diff --git a/boot.lua b/boot.lua index b27615de..c9cda9af 100644 --- a/boot.lua +++ b/boot.lua @@ -3,9 +3,9 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 3797 - _detalhes.userversion = "v7.2.0." .. _detalhes.build_counter - _detalhes.realversion = 119 --core version + _detalhes.build_counter = 3902 + _detalhes.userversion = "v7.2.5." .. _detalhes.build_counter + _detalhes.realversion = 120 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -21,14 +21,22 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v7.2.0.3797.119 (|cFFFFCC00June 04th, 2017|r|cFFFFFF00)|r:\n\n +|cFFFFFF00v7.2.5.3902.120 (|cFFFFCC00June 20th, 2017|r|cFFFFFF00)|r:\n\n |cFFFFFF00-|r New Death Recap implemented! replaces the default from Blizzard and can be configured at Options > Raid Tools.\n\n +|cFFFFFF00-|r New Guild Damage and Heal rank on '/details ranking' panel.\n\n +|cFFFFFF00-|r Added a Guild Sync button on the Details! Ranking Panel.\n\n +|cFFFFFF00-|r Added Custom display 'Damage on Shields', useful for encounter like Maiden of Vigilance where there's big shields to be removed and you want to know who is doing more damage to it.\n\n +|cFFFFFF00-|r Added Heal Absorbed display under Heal bracket.\n\nHeal Absorb are the heal denied by abilities such like DK's Necrotic Strike or raid boss Sisters of the Moon 'Embrace of the Eclipse' ability.\nThe tooltip of this display shows which players got heal denied, which abilities absorbed the heal, which abilities tried to heal but got the heal denied.\n\n +|cFFFFFF00-|r Added Alternate Power display under Energy bracket, it shows the total of alternate power gain from each player, useful for encounters such as Demonic Inquisition.\n\n |cFFFFFF00-|r Fixed Paladin 'Light of the Martyr' damage to self.\n\n - --]] -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v7.2.0.3797.119 (|cFFFFCC00June 04th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r New Death Recap implemented! replaces the default from Blizzard and can be configured at Options > Raid Tools.\n\n|cFFFFFF00-|r Fixed Paladin 'Light of the Martyr' damage to self.\n\n|cFFFFFF00v7.2.0.3703.119 (|cFFFFCC00May 29th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an error while killing low level mobs with warrior class.\n\n|cFFFFFF00-|r Added custom display 'Damage on Shields', useful for encounter like Maiden of Vigilance where there's big shields to be removed and you want to know who is doing more damage to it.\n\n|cFFFFFF00v7.2.0.3693.118 (|cFFFFCC00May 25th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fury Warrior shouldn't be assigned as Protection any more.\n\n|cFFFFFF00-|r Some parser fixes.\n\n|cFFFFFF00v7.2.0.3673.118 (|cFFFFCC00May 09th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Heal Absorbed display under Heal bracket.\n\nHeal Absoorb are the heal denied by abilities such like DK's Necrotic Strike or raid boss Chromatic Anomaly's 'Time Release' ability.\nThe tooltip of this display shows which players got heal denied, which abilities absorbed the heal, which abilities tried to heal but got the heal denied.\n\n|cFFFFFF00-|r Added Alternate Power display under Energy bracket.\n\n|cFFFFFF00-|r Ticket #187: Fixed an issue when comparing hunter pets on the player detail window.\n\n|cFFFFFF00-|r Ticket #189 #186: Fixed a taint issue for some classes when using friendly nameplates on.\n\n|cFFFFFF00v7.2.0.3512.116 (|cFFFFCC00April 27th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Havoc Demon Hunter: your fury energy is being shown under Mana Restored (don't ask me why, the combat log is telling us it's mana).\n\n|cFFFFFF00-|r Pets now are shown on damage tooltips.\n\n|cFFFFFF00-|r Pets are now also shown on the comparison panel.\n\n|cFFFFFF00v7.2.0.3474.116 (|cFFFFCC00April 20th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin: Raid Check > added some food buffs which wasn't being tracked.\n\n|cFFFFFF00v7.2.0.3467.116 (|cFFFFCC00April 07th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the custom display window where apply and cancel buttons where over the edit window.\n\n|cFFFFFF00-|r Fix for an issue on editing a bookmark.\n\n|cFFFFFF00v7.1.5.3459.116 (|cFFFFCC00Mar 21th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue on dynamic overall data where it wasn't showing DPS.\n\n|cFFFFFF00-|r Fixed an issue with Apply, Save and Cancel buttons when editing a custom display.\n\n|cFFFFFF00-|r Removed the Damage and Healing presets for custom displays, now is only possible create custom displays by scripting them.\n\n|cFFFFFF00v7.1.5.3431.116 (|cFFFFCC00Mar 15th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with bar orientation right to left where fixed bar color isn't working.\n\n|cFFFFFF00-|r The nickname field now use FrizQuadrataTT font and shall be compatible with Cyrillic.\n\n|cFFFFFF00v7.1.5.3418.116 (|cFFFFCC00Mar 1st, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #167 fix: Light of the Martyr self-damage now does reduce the healing done (following WCL method).\n\n|cFFFFFF00-|r Ticket #169 fix: Damage Prevented is now working for new segments.\n\n|cFFFFFF00-|r Fixed an issue where sometimes BeastMaster's Hati pet wasn't detected correctly.\n\n|cFFFFFF00v7.1.5.3369.116 (|cFFFFCC00Feb 07th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'Dynamic Overall Damage' for mythic dungeons.\n\n|cFFFFFF00-|r Fix for Ticket #168: 'Auto Hide While [Not] Inside Instance is broken'.\n\n|cFFFFFF00-|r The bar truncate frame 'DetailsLeftTextAntiTruncate' is now created on Details! load instead on demand.\n\n|cFFFFFF00v7.1.5.3315.116 (|cFFFFCC00Jan 23th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #162: 'no Monochrome font' available, added an experimental slash command: /run _detalhes:UseOutline ('MONOCHROME').\n\n|cFFFFFF00-|r Ticket #158: 'no elapsed time shown on report to chat', added the elapsed time when reporting a segment.\n\n|cFFFFFF00-|r Ticket #164: 'error when browsing segments', an attempt to fix the problem has been made.\n\n|cFFFFFF00v7.1.5.3305.116 (|cFFFFCC00Jan 15th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Another fix for mythic dungeons overall data reset (thanks Tharai @ Curseforge).\n\n|cFFFFFF00-|r Fix for spec detection on PvP Arenas (thanks Pas06 @ Curseforge).\n\n|cFFFFFF00v7.1.0.3276.115 (|cFFFFCC00Jan 08th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the overall data not reseting when starting a new mythic+ dungeon.\n\n|cFFFFFF00v7.1.0.3266.115 (|cFFFFCC00Dec 29th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data not updating correctly at the end of the combat.\n\n|cFFFFFF00-|r Added a tutorial line on the window when the user access overall data.\n\n|cFFFFFF00v7.1.0.3236.115 (|cFFFFCC00Dec 19th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Integration with BigWigs should be working okay now.\n\n|cFFFFFF00v7.1.0.3231.115 (|cFFFFCC00Dec 15th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Disabled the link with BigWigs to avoid the 'RegisterMessage' error on every login.\n\n|cFFFFFF00v7.1.0.3229.115 (|cFFFFCC00Dec 09th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r When a window is locked, resize grips shouldn't be enabled messing with bar mouse over.\n\n|cFFFFFF00v7.0.3.3222.115 (|cFFFFCC00November 28th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Unstable Affliction to common spells with the same name.\n\n|cFFFFFF00-|r Fixed few issues with built-in plugins.\n\n|cFFFFFF00v7.0.3.3202.115 (|cFFFFCC00November 08th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Weakauras creator from the Encounter Details plugin and '/details forge' shall work correctly now with Trials of Valor.\n\n|cFFFFFF00-|r Raid history should now be recording your Trials of Valor kills.\n\n|cFFFFFF00-|r Added Trials of Valor raid info, good luck and have fun!.\n\n|cFFFFFF00v7.0.3.3201.115 (|cFFFFCC00November 04th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Paladin holy icon.\n\n|cFFFFFF00-|r Fix for Rogue outlaw icon.\n\n|cFFFFFF00-|r Fixed misc displays with bar sorted by ascending order.\n\n|cFFFFFF00-|r Fix for '/details show' command while the window is on auto hide.\n\n|cFFFFFF00v7.0.3.3114.115 (|cFFFFCC00October 26th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): tooltip tutorial is now clamped to screen and its close button should be visible.\n\n|cFFFFFF00-|r Raid Check (plugin): now also works on dungeons.\n\n|cFFFFFF00-|r Added Potion of the Prolongued Power to the tracker.\n\n|cFFFFFF00v7.1.0.3097.115 (|cFFFFCC00October 25th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r renamed 'report history' to 'latest reports'.\n\n|cFFFFFF00-|r attempt to make all Details! users on the party or raid to track rogue's akaari's soul." +--|cFFFFFF00v7.2.5.3902.120 (|cFFFFCC00June 20th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r New Death Recap implemented! replaces the default from Blizzard and can be configured at Options > Raid Tools.\n\n|cFFFFFF00-|r New Guild Damage and Heal rank on '/details ranking' panel.\n\n|cFFFFFF00-|r Added a Guild Sync button on the Details! Ranking Panel.\n\n|cFFFFFF00-|r Added Custom display 'Damage on Shields', useful for encounter like Maiden of Vigilance where there's big shields to be removed and you want to know who is doing more damage to it.\n\n|cFFFFFF00-|r Added Heal Absorbed display under Heal bracket.\n\nHeal Absorb are the heal denied by abilities such like DK's Necrotic Strike or raid boss Sisters of the Moon 'Embrace of the Eclipse' ability.\nThe tooltip of this display shows which players got heal denied, which abilities absorbed the heal, which abilities tried to heal but got the heal denied.\n\n|cFFFFFF00-|r Added Alternate Power display under Energy bracket, it shows the total of alternate power gain from each player, useful for encounters such as Demonic Inquisition.\n\n|cFFFFFF00-|r Fixed Paladin 'Light of the Martyr' damage to self.\n\n + +-- + + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v7.2.5.3902.120 (|cFFFFCC00June 20th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r New Death Recap implemented! replaces the default from Blizzard and can be configured at Options > Raid Tools.\n\n|cFFFFFF00-|r New Guild Damage and Heal rank on '/details ranking' panel.\n\n|cFFFFFF00-|r Added a Guild Sync button on the Details! Ranking Panel.\n\n|cFFFFFF00-|r Added Custom display 'Damage on Shields', useful for encounter like Maiden of Vigilance where there's big shields to be removed and you want to know who is doing more damage to it.\n\n|cFFFFFF00-|r Added Heal Absorbed display under Heal bracket.\n\nHeal Absorb are the heal denied by abilities such like DK's Necrotic Strike or raid boss Sisters of the Moon 'Embrace of the Eclipse' ability.\nThe tooltip of this display shows which players got heal denied, which abilities absorbed the heal, which abilities tried to heal but got the heal denied.\n\n|cFFFFFF00-|r Added Alternate Power display under Energy bracket, it shows the total of alternate power gain from each player, useful for encounters such as Demonic Inquisition.\n\n|cFFFFFF00-|r Fixed Paladin 'Light of the Martyr' damage to self.\n\n|cFFFFFF00v7.2.0.3703.119 (|cFFFFCC00May 29th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an error while killing low level mobs with warrior class.\n\n|cFFFFFF00v7.2.0.3693.118 (|cFFFFCC00May 25th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fury Warrior shouldn't be assigned as Protection any more.\n\n|cFFFFFF00-|r Some parser fixes.\n\n|cFFFFFF00v7.2.0.3673.118 (|cFFFFCC00May 09th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #187: Fixed an issue when comparing hunter pets on the player detail window.\n\n|cFFFFFF00-|r Ticket #189 #186: Fixed a taint issue for some classes when using friendly nameplates on.\n\n|cFFFFFF00v7.2.0.3512.116 (|cFFFFCC00April 27th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Havoc Demon Hunter: your fury energy is being shown under Mana Restored (don't ask me why, the combat log is telling us it's mana).\n\n|cFFFFFF00-|r Pets now are shown on damage tooltips.\n\n|cFFFFFF00-|r Pets are now also shown on the comparison panel.\n\n|cFFFFFF00v7.2.0.3474.116 (|cFFFFCC00April 20th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin: Raid Check > added some food buffs which wasn't being tracked.\n\n|cFFFFFF00v7.2.0.3467.116 (|cFFFFCC00April 07th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the custom display window where apply and cancel buttons where over the edit window.\n\n|cFFFFFF00-|r Fix for an issue on editing a bookmark.\n\n|cFFFFFF00v7.1.5.3459.116 (|cFFFFCC00Mar 21th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue on dynamic overall data where it wasn't showing DPS.\n\n|cFFFFFF00-|r Fixed an issue with Apply, Save and Cancel buttons when editing a custom display.\n\n|cFFFFFF00-|r Removed the Damage and Healing presets for custom displays, now is only possible create custom displays by scripting them.\n\n|cFFFFFF00v7.1.5.3431.116 (|cFFFFCC00Mar 15th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with bar orientation right to left where fixed bar color isn't working.\n\n|cFFFFFF00-|r The nickname field now use FrizQuadrataTT font and shall be compatible with Cyrillic.\n\n|cFFFFFF00v7.1.5.3418.116 (|cFFFFCC00Mar 1st, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #167 fix: Light of the Martyr self-damage now does reduce the healing done (following WCL method).\n\n|cFFFFFF00-|r Ticket #169 fix: Damage Prevented is now working for new segments.\n\n|cFFFFFF00-|r Fixed an issue where sometimes BeastMaster's Hati pet wasn't detected correctly.\n\n|cFFFFFF00v7.1.5.3369.116 (|cFFFFCC00Feb 07th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'Dynamic Overall Damage' for mythic dungeons.\n\n|cFFFFFF00-|r Fix for Ticket #168: 'Auto Hide While [Not] Inside Instance is broken'.\n\n|cFFFFFF00-|r The bar truncate frame 'DetailsLeftTextAntiTruncate' is now created on Details! load instead on demand.\n\n|cFFFFFF00v7.1.5.3315.116 (|cFFFFCC00Jan 23th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #162: 'no Monochrome font' available, added an experimental slash command: /run _detalhes:UseOutline ('MONOCHROME').\n\n|cFFFFFF00-|r Ticket #158: 'no elapsed time shown on report to chat', added the elapsed time when reporting a segment.\n\n|cFFFFFF00-|r Ticket #164: 'error when browsing segments', an attempt to fix the problem has been made.\n\n|cFFFFFF00v7.1.5.3305.116 (|cFFFFCC00Jan 15th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Another fix for mythic dungeons overall data reset (thanks Tharai @ Curseforge).\n\n|cFFFFFF00-|r Fix for spec detection on PvP Arenas (thanks Pas06 @ Curseforge).\n\n|cFFFFFF00v7.1.0.3276.115 (|cFFFFCC00Jan 08th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the overall data not reseting when starting a new mythic+ dungeon.\n\n|cFFFFFF00v7.1.0.3266.115 (|cFFFFCC00Dec 29th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data not updating correctly at the end of the combat.\n\n|cFFFFFF00-|r Added a tutorial line on the window when the user access overall data.\n\n|cFFFFFF00v7.1.0.3236.115 (|cFFFFCC00Dec 19th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Integration with BigWigs should be working okay now.\n\n|cFFFFFF00v7.1.0.3231.115 (|cFFFFCC00Dec 15th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Disabled the link with BigWigs to avoid the 'RegisterMessage' error on every login.\n\n|cFFFFFF00v7.1.0.3229.115 (|cFFFFCC00Dec 09th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r When a window is locked, resize grips shouldn't be enabled messing with bar mouse over.\n\n|cFFFFFF00v7.0.3.3222.115 (|cFFFFCC00November 28th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Unstable Affliction to common spells with the same name.\n\n|cFFFFFF00-|r Fixed few issues with built-in plugins.\n\n|cFFFFFF00v7.0.3.3202.115 (|cFFFFCC00November 08th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Weakauras creator from the Encounter Details plugin and '/details forge' shall work correctly now with Trials of Valor.\n\n|cFFFFFF00-|r Raid history should now be recording your Trials of Valor kills.\n\n|cFFFFFF00-|r Added Trials of Valor raid info, good luck and have fun!.\n\n|cFFFFFF00v7.0.3.3201.115 (|cFFFFCC00November 04th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Paladin holy icon.\n\n|cFFFFFF00-|r Fix for Rogue outlaw icon.\n\n|cFFFFFF00-|r Fixed misc displays with bar sorted by ascending order.\n\n|cFFFFFF00-|r Fix for '/details show' command while the window is on auto hide.\n\n|cFFFFFF00v7.0.3.3114.115 (|cFFFFCC00October 26th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): tooltip tutorial is now clamped to screen and its close button should be visible.\n\n|cFFFFFF00-|r Raid Check (plugin): now also works on dungeons.\n\n|cFFFFFF00-|r Added Potion of the Prolongued Power to the tracker.\n\n|cFFFFFF00v7.1.0.3097.115 (|cFFFFCC00October 25th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r renamed 'report history' to 'latest reports'.\n\n|cFFFFFF00-|r attempt to make all Details! users on the party or raid to track rogue's akaari's soul." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " @@ -49,6 +57,17 @@ do _detalhes.parser_frame = CreateFrame ("Frame") _detalhes.pvp_parser_frame = CreateFrame ("Frame") _detalhes.parser_frame:Hide() + --> quais raides devem ser guardadas no histórico + _detalhes.InstancesToStoreData = { + [1520] = true, --Emerald Nightmare + [1648] = true, --Trial of Valor + [1530] = true, --Nighthold + + --[1448] = true, --Hellfire Citadel + --[1205] = true, --Blackrock Foundry + --[1228] = true, --Highmaul + --[1136] = true, --SoO + } --> armazena os escudos - Shields information for absorbs _detalhes.escudos = {} --> armazena as funções dos frames - Frames functions @@ -113,6 +132,7 @@ do --"LoadScreenOrgrimmarArena", --Ring of Valor } + function _detalhes:GetArenaInfo (mapid) local t = _detalhes.arena_info [mapid] if (t) then diff --git a/classes/container_combatentes.lua b/classes/container_combatentes.lua index 3fb0be23..56cf1dea 100644 --- a/classes/container_combatentes.lua +++ b/classes/container_combatentes.lua @@ -206,7 +206,7 @@ novo_objeto.displayName = nome:gsub (("%-.*"), "") elseif (_detalhes.remove_realm_from_name) then - novo_objeto.displayName = nome:gsub (("%-.*"), "%*") + novo_objeto.displayName = nome:gsub (("%-.*"), "%*") --nome = nil else novo_objeto.displayName = nome diff --git a/core/gears.lua b/core/gears.lua index 90ba5ed6..21dceeea 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -11,6 +11,9 @@ local GetNumGroupMembers = GetNumGroupMembers local ItemUpgradeInfo = LibStub ("LibItemUpgradeInfo-1.0") local LibGroupInSpecT = LibStub ("LibGroupInSpecT-1.1") +local storageDebug = false +local store_instances = _detalhes.InstancesToStoreData + function _detalhes:UpdateGears() _detalhes:UpdateParser() @@ -686,6 +689,46 @@ function _detalhes.storage:OpenRaidStorage() return db end +function _detalhes.storage:GetBestFromGuild (diff, encounter_id, role) + local db = _detalhes.storage:OpenRaidStorage() + + local best = 0 + local bestplayername + local onencounter + + if (not role) then + role = "damage" + end + role = string.lower (role) + if (role == "damager") then + role = "damage" + elseif (role == "healer") then + role = "healing" + end + + local table = db [diff] + if (table) then + local encounters = table [encounter_id] + if (encounters) then + for index, encounter in ipairs (encounters) do + + local players = encounter [role] + if (players) then + for playername, t in pairs (players) do + if (t[1] > best) then + best = t [1] + bestplayername = playername + onencounter = encounter + end + end + end + end + end + end + + return best, bestplayername, onencounter +end + function _detalhes.storage:GetBestFromPlayer (diff, encounter_id, role, playername) local db = _detalhes.storage:OpenRaidStorage() @@ -726,6 +769,210 @@ function _detalhes.storage:GetBestFromPlayer (diff, encounter_id, role, playerna return best, onencounter end +function _detalhes.storage:DBGuildSync() + + _detalhes:SendGuildData ("GS", "R") + +end + +--remote call RoS +function _detalhes.storage:GetIDsToGuildSync() + local db = _detalhes.storage:OpenRaidStorage() + local IDs = {} + + --build the encounter ID list + + for diff, diffTable in pairs (db or {}) do + if (type (diffTable) == "table") then + for encounterID, encounterTable in pairs (diffTable) do + for index, encounter in ipairs (encounterTable) do + tinsert (IDs, encounter.time) + end + end + end + end + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) [RoS-EncounterSync] sending " .. #IDs .. " IDs.") + end + + return IDs +end + +--local call RoC - received the encounter IDS - need to know which fights is missing +function _detalhes.storage:CheckMissingIDsToGuildSync (IDsList) + local db = _detalhes.storage:OpenRaidStorage() + + if (type (IDsList) ~= "table") then + if (_detalhes.debug) then + _detalhes:Msg ("(debug) [RoS-EncounterSync] RoC IDsList isn't a table.") + end + return + end + + --this will prevent to request the same fight from multiple people + _detalhes.RecentRequestedIDs = _detalhes.RecentRequestedIDs or {} + + --store the IDs which need to be sync + local RequestIDs = {} + + --check missing IDs + for index, ID in ipairs (IDsList) do + local found = false + + for diff, diffTable in pairs (db or {}) do + if (type (diffTable) == "table") then + for encounterID, encounterTable in pairs (diffTable) do + for index, encounter in ipairs (encounterTable) do + if (ID == encounter.time) then + found = true + break + end + end + end + end + end + + if (not found) then + if (not _detalhes.RecentRequestedIDs [ID]) then + tinsert (RequestIDs, ID) + _detalhes.RecentRequestedIDs [ID] = true + end + end + end + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) [RoC-EncounterSync] RoS found " .. #RequestIDs .. " encounters out dated.") + end + + return RequestIDs +end + +--remote call RoS - build the encounter list from the IDsList +function _detalhes.storage:BuildEncounterDataToGuildSync (IDsList) + local db = _detalhes.storage:OpenRaidStorage() + + if (type (IDsList) ~= "table") then + if (_detalhes.debug) then + _detalhes:Msg ("(debug) [RoS-EncounterSync] IDsList isn't a table.") + end + return + end + + local EncounterList = {} + local CurrentTable = {} + tinsert (EncounterList, CurrentTable) + + local AmtToSend = 0 + local MaxAmount = 0 + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) [RoS-EncounterSync] the client requested " .. #IDsList .. " encounters.") + end + + for index, ID in ipairs (IDsList) do + + for diff, diffTable in pairs (db or {}) do + if (type (diffTable) == "table") then + for encounterID, encounterTable in pairs (diffTable) do + for index, encounter in ipairs (encounterTable) do + if (ID == encounter.time) then + --send this encounter + CurrentTable [diff] = CurrentTable [diff] or {} + CurrentTable [diff] [encounterID] = CurrentTable [diff] [encounterID] or {} + + tinsert (CurrentTable [diff] [encounterID], encounter) + + AmtToSend = AmtToSend + 1 + MaxAmount = MaxAmount + 1 + + if (MaxAmount == 3) then + CurrentTable = {} + tinsert (EncounterList, CurrentTable) + MaxAmount = 0 + end + end + end + end + end + end + + end + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) [RoS-EncounterSync] sending " .. AmtToSend .. " encounters.") + end + + return EncounterList +end + +local have_encounter = function (db, ID) + for diff, diffTable in pairs (db or {}) do + if (type (diffTable) == "table") then + for encounterID, encounterTable in pairs (diffTable) do + for index, encounter in ipairs (encounterTable) do + if (ID == encounter.time) then + return true + end + end + end + end + end + return false +end + +--local call RoC - add the fights to the client db +function _detalhes.storage:AddGuildSyncData (data) + local db = _detalhes.storage:OpenRaidStorage() + + local AddedAmount = 0 + _detalhes.LastGuildSyncReceived = GetTime() + + for diff, diffTable in pairs (data) do + if (type (diff) == "number" and type (diffTable) == "table") then + for encounterID, encounterTable in pairs (diffTable) do + if (type (encounterID) == "number" and type (encounterTable) == "table") then + for index, encounter in ipairs (encounterTable) do + --validate the encounter + if (type (encounter.time) == "number" and type (encounter.guild) == "string" and type (encounter.date) == "string" and type (encounter.healing) == "table" and type (encounter.elapsed) == "number" and type (encounter.damage) == "table") then + --check if this encounter already has been added from another sync + if (not have_encounter (db, encounter.time)) then + db [diff] = db [diff] or {} + db [diff] [encounterID] = db [diff] [encounterID] or {} + + tinsert (db [diff] [encounterID], encounter) + + if (_G.DetailsRaidHistoryWindow and _G.DetailsRaidHistoryWindow:IsShown()) then + _G.DetailsRaidHistoryWindow:Refresh() + end + + AddedAmount = AddedAmount + 1 + else + if (_detalhes.debug) then + _detalhes:Msg ("(debug) [RoS-EncounterSync] received a duplicated encounter table.") + end + end + else + if (_detalhes.debug) then + _detalhes:Msg ("(debug) [RoS-EncounterSync] received an invalid encounter table.") + end + end + end + end + end + end + end + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) [RoS-EncounterSync] added " .. AddedAmount .. " to database.") + end + + if (_G.DetailsRaidHistoryWindow and _G.DetailsRaidHistoryWindow:IsShown()) then + _G.DetailsRaidHistoryWindow:UpdateDropdowns() + _G.DetailsRaidHistoryWindow:Refresh() + end +end + function _detalhes.storage:ListDiffs() local db = _detalhes.storage:OpenRaidStorage() local t = {} @@ -855,24 +1102,23 @@ function _detalhes.storage:GetEncounterData (diff, encounter_id, guild) return t end -local store_instances = { - [1448] = true, --Hellfire Citadel - [1205] = true, --Blackrock Foundry - [1228] = true, --Highmaul - --[1136] = true, --SoO -} - function _detalhes:StoreEncounter (combat) combat = combat or _detalhes.tabela_vigente if (not combat) then + if (_detalhes.debug) then + print ("|cFFFFFF00Details! Storage|r: combat not found.") + end return end local name, type, difficulty, difficultyName, maxPlayers, playerDifficulty, isDynamicInstance, mapID, instanceGroupSize = GetInstanceInfo() if (not store_instances [mapID]) then + if (_detalhes.debug) then + print ("|cFFFFFF00Details! Storage|r: instance not allowed.") + end return end @@ -880,13 +1126,16 @@ function _detalhes:StoreEncounter (combat) local encounter_id = boss_info and boss_info.id if (not encounter_id) then + if (_detalhes.debug) then + print ("|cFFFFFF00Details! Storage|r: encounter ID not found.") + end return end local diff = combat:GetDifficulty() --> check for heroic and mythic - if (diff == 15 or diff == 16) then --test on raid finder ' or diff == 17' -- normal mode: diff == 14 or + if (storageDebug or (diff == 15 or diff == 16)) then --test on raid finder ' or diff == 17' -- normal mode: diff == 14 or --> check the guild name local match = 0 @@ -901,12 +1150,16 @@ function _detalhes:StoreEncounter (combat) end end - if (match < raid_size * 0.75) then - print ("|cFFFFFF00Details! Storage|r: can't save the encounter, need at least 75% of players be from your guild.") + if (match < raid_size * 0.75 and not storageDebug) then + if (_detalhes.debug) then + print ("|cFFFFFF00Details! Storage|r: can't save the encounter, need at least 75% of players be from your guild.") + end return end else - print ("|cFFFFFF00Details! Storage|r: can't save the encounter, need at least 75% of players be from your guild.") + if (_detalhes.debug) then + print ("|cFFFFFF00Details! Storage|r: can't save the encounter, need at least 75% of players be from your guild.") + end return end @@ -914,7 +1167,9 @@ function _detalhes:StoreEncounter (combat) if (not IsAddOnLoaded ("Details_DataStorage")) then local loaded, reason = LoadAddOn ("Details_DataStorage") if (not loaded) then - print ("|cFFFFFF00Details! Storage|r: can't save the encounter, couldn't load DataStorage, may be the addon is disabled.") + if (_detalhes.debug) then + print ("|cFFFFFF00Details! Storage|r: can't save the encounter, couldn't load DataStorage, may be the addon is disabled.") + end return end end @@ -962,34 +1217,35 @@ function _detalhes:StoreEncounter (combat) local role = UnitGroupRolesAssigned ("raid" .. i) - if (role == "DAMAGER" or role == "TANK") then - local player_name, player_realm = UnitName ("raid" .. i) - if (player_realm and player_realm ~= "") then - player_name = player_name .. "-" .. player_realm - end - - local _, _, class = UnitClass (player_name) - - local damage_actor = damage_container_pool [damage_container_hash [player_name]] - if (damage_actor) then - local guid = UnitGUID (player_name) or UnitGUID (UnitName ("raid" .. i)) - this_combat_data.damage [player_name] = {floor (damage_actor.total), _detalhes.item_level_pool [guid] and _detalhes.item_level_pool [guid].ilvl or 0, class or 0} - end - elseif (role == "HEALER") then - local player_name, player_realm = UnitName ("raid" .. i) - if (player_realm and player_realm ~= "") then - player_name = player_name .. "-" .. player_realm - end - - local _, _, class = UnitClass (player_name) - - local heal_actor = healing_container_pool [healing_container_hash [player_name]] - if (heal_actor) then - local guid = UnitGUID (player_name) or UnitGUID (UnitName ("raid" .. i)) - this_combat_data.healing [player_name] = {floor (heal_actor.total), _detalhes.item_level_pool [guid] and _detalhes.item_level_pool [guid].ilvl or 0, class or 0} + if (UnitIsInMyGuild ("raid" .. i)) then + if (role == "DAMAGER" or role == "TANK") then + local player_name, player_realm = UnitName ("raid" .. i) + if (player_realm and player_realm ~= "") then + player_name = player_name .. "-" .. player_realm + end + + local _, _, class = UnitClass (player_name) + + local damage_actor = damage_container_pool [damage_container_hash [player_name]] + if (damage_actor) then + local guid = UnitGUID (player_name) or UnitGUID (UnitName ("raid" .. i)) + this_combat_data.damage [player_name] = {floor (damage_actor.total), _detalhes.item_level_pool [guid] and _detalhes.item_level_pool [guid].ilvl or 0, class or 0} + end + elseif (role == "HEALER") then + local player_name, player_realm = UnitName ("raid" .. i) + if (player_realm and player_realm ~= "") then + player_name = player_name .. "-" .. player_realm + end + + local _, _, class = UnitClass (player_name) + + local heal_actor = healing_container_pool [healing_container_hash [player_name]] + if (heal_actor) then + local guid = UnitGUID (player_name) or UnitGUID (UnitName ("raid" .. i)) + this_combat_data.healing [player_name] = {floor (heal_actor.total), _detalhes.item_level_pool [guid] and _detalhes.item_level_pool [guid].ilvl or 0, class or 0} + end end end - end tinsert (encounter_database, this_combat_data) @@ -1016,6 +1272,13 @@ function _detalhes:StoreEncounter (combat) end end + --guild best + local amount, playerName, encounterObject = _detalhes.storage:GetBestFromGuild (diff, encounter_id, myrole) + if (amount > 0) then + --> player got the high score on his guild + + end + local lower_instance = _detalhes:GetLowerInstanceNumber() if (lower_instance) then local instance = _detalhes:GetInstance (lower_instance) @@ -1030,6 +1293,10 @@ function _detalhes:StoreEncounter (combat) instance:InstanceAlert ("Boss Defeated, Open History! ", icon, 40, func, true) end end + else + if (_detalhes.debug) then + print ("|cFFFFFF00Details! Storage|r: raid difficulty must be heroic or mythic.") + end end end diff --git a/core/network.lua b/core/network.lua index 0643df98..68616636 100644 --- a/core/network.lua +++ b/core/network.lua @@ -35,6 +35,8 @@ local CONST_WIPE_CALL = "WI" + local CONST_GUILD_SYNC = "GS" + local CONST_CLOUD_REQUEST = "CR" local CONST_CLOUD_FOUND = "CF" local CONST_CLOUD_DATARQ = "CD" @@ -56,6 +58,8 @@ ["WIPE_CALL"] = CONST_WIPE_CALL, + ["GUILD_SYNC"] = CONST_GUILD_SYNC, + ["MISSDATA_ROGUE_SOULRIP"] = CONST_ROGUE_SR, --soul rip from akaari's soul (LEGION ONLY) } @@ -263,6 +267,90 @@ end end + --guild sync R = someone pressed the sync button + --guild sync L = list of fights IDs + --guild sync G = requested a list of encounters + --guild sync A = received missing encounters, add them + + function _detalhes.network.GuildSync (player, realm, core_version, type, data) + local chr_name = Ambiguate (player .. "-" .. realm, "none") + + if (UnitName ("player") == chr_name) then + return + end + + if (core_version ~= _detalhes.realversion) then + if (core_version > _detalhes.realversion) then + --_detalhes:Msg ("your Details! is out dated and cannot perform the action, please update it.") + end + return false + end + + if (type == "R") then --RoS + _detalhes.LastGuildSyncDataTime1 = _detalhes.LastGuildSyncDataTime1 or 0 + + --build our table and send to the player + if (_detalhes.LastGuildSyncDataTime1 > GetTime()) then + --return false + end + + local IDs = _detalhes.storage:GetIDsToGuildSync() + + if (IDs [1]) then + local from = UnitName ("player") + local realm = GetRealmName() + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (CONST_GUILD_SYNC, from, realm, _detalhes.realversion, "L", IDs), "WHISPER", chr_name) + end + + _detalhes.LastGuildSyncDataTime1 = GetTime() + 60 + return true + + elseif (type == "L") then --RoC + local MissingIDs = _detalhes.storage:CheckMissingIDsToGuildSync (data) + + if (MissingIDs [1]) then + local from = UnitName ("player") + local realm = GetRealmName() + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (CONST_GUILD_SYNC, from, realm, _detalhes.realversion, "G", MissingIDs), "WHISPER", chr_name) + end + return true + + elseif (type == "G") then --RoS + local EncounterData = _detalhes.storage:BuildEncounterDataToGuildSync (data) + + if (EncounterData [1]) then + local task = C_Timer.NewTicker (4, function (task) + task.TickID = task.TickID + 1 + local data = task.EncounterData [task.TickID] + + if (not data) then + task:Cancel() + return + end + + local from = UnitName ("player") + local realm = GetRealmName() + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (CONST_GUILD_SYNC, from, realm, _detalhes.realversion, "A", data), "WHISPER", task.Target) + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) [RoS-EncounterSync] send-task sending data #" .. task.TickID .. ".") + end + end) + + task.TickID = 0 + task.EncounterData = EncounterData + task.Target = chr_name + end + return true + + elseif (type == "A") then --RoC + _detalhes.storage:AddGuildSyncData (data) + return true + + end + + end + function _detalhes.network.HandleMissData (player, realm, core_version, data) -- [1] - container @@ -299,6 +387,8 @@ [CONST_CLOUD_EQUALIZE] = _detalhes.network.Cloud_Equalize, [CONST_WIPE_CALL] = _detalhes.network.Wipe_Call, + [CONST_GUILD_SYNC] = _detalhes.network.GuildSync, + [CONST_ROGUE_SR] = _detalhes.network.HandleMissData, --soul rip from akaari's soul (LEGION ONLY) } diff --git a/core/parser.lua b/core/parser.lua index f466b7d2..e92b1593 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -316,7 +316,23 @@ else link = GetSpellLink (spellid) end - _detalhes:Msg ("First hit: " .. (link or "") .. " from " .. (who_name or "Unknown")) + + --check boss targets + local gotTarget = false + for i = 1, 5 do + local boss = UnitExists ("boss" .. i) + if (boss) then + local target = UnitName ("boss" .. i .. "target") + if (target and type (target) == "string" and not gotTarget) then + _detalhes:Msg ("|cFFFFFF00First hit|r: " .. (link or "") .. " from " .. (who_name or "Unknown") .. " |cFFFFFF00First Boss Target|r: " .. target) + gotTarget = true + end + end + end + + if (not gotTarget) then + _detalhes:Msg ("First hit: " .. (link or "") .. " from " .. (who_name or "Unknown")) + end end _detalhes:EntrarEmCombate (who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags) else @@ -3928,7 +3944,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 for i = #_detalhes.schedule_add_to_overall, 1, -1 do local CombatToAdd = tremove (_detalhes.schedule_add_to_overall, i) - _detalhes.historico:adicionar_overall (CombatToAdd) + if (CombatToAdd) then + _detalhes.historico:adicionar_overall (CombatToAdd) + end end end diff --git a/core/windows.lua b/core/windows.lua index ceb7fe0c..cf18da2e 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -1096,7 +1096,7 @@ local db = _detalhes.storage:OpenRaidStorage() if (not db) then - return _detalhes:Msg ("Fail to open raid storage, may be the addon is disabled.") + return _detalhes:Msg ("Fail to open 'Details Storage', maybe the addon is disabled?") end local f = CreateFrame ("frame", "DetailsRaidHistoryWindow", UIParent, "ButtonFrameTemplate") @@ -1109,17 +1109,115 @@ f:SetHeight (500) tinsert (UISpecialFrames, "DetailsRaidHistoryWindow") + f.Mode = 1 + + --wallpaper local background = f:CreateTexture (nil, "border") background:SetAlpha (0.3) background:SetPoint ("topleft", f, "topleft", 6, -65) background:SetPoint ("bottomright", f, "bottomright", -10, 28) + --separate menu and main list local div = f:CreateTexture (nil, "artwork") div:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-MetalBorder-Left]]) div:SetAlpha (0.3) div:SetPoint ("topleft", f, "topleft", 180, -64) div:SetHeight (460) + --select history or guild rank + local options_switch_template = _detalhes.gump:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") + local options_text_template = _detalhes.gump:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") + local options_button_template = _detalhes.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + + local select_history = function() + f.GuildRankCheckBox:SetValue (false) + f.HistoryCheckBox:SetValue (true) + f.Mode = 1 + _G.DetailsRaidHistoryWindow:Refresh() + end + local select_guildrank = function() + f.HistoryCheckBox:SetValue (false) + f.GuildRankCheckBox:SetValue (true) + DetailsRaidHistoryWindow.select_player:Select (1, true) + f.select_player2:Hide() + f.select_player2_label:Hide() + f.Mode = 2 + _G.DetailsRaidHistoryWindow:Refresh() + end + + local HistoryCheckBox, HistoryLabel = _detalhes.gump:CreateSwitch (f, select_history, true, 18, 18, "", "", "HistoryCheckBox", nil, nil, nil, nil, "Show History", options_switch_template) --, options_text_template + HistoryLabel:ClearAllPoints() + HistoryCheckBox:ClearAllPoints() + HistoryCheckBox:SetPoint ("topleft", f, "topleft", 100, -34) + HistoryLabel:SetPoint ("left", HistoryCheckBox, "right", 2, 0) + HistoryCheckBox:SetAsCheckBox() + + local GuildRankCheckBox, GuildRankLabel = _detalhes.gump:CreateSwitch (f, select_guildrank, false, 18, 18, "", "", "GuildRankCheckBox", nil, nil, nil, nil, "Show Guild Rank", options_switch_template) --, options_text_template + GuildRankLabel:ClearAllPoints() + GuildRankCheckBox:ClearAllPoints() + GuildRankCheckBox:SetPoint ("topleft", f, "topleft", 240, -34) + GuildRankLabel:SetPoint ("left", GuildRankCheckBox, "right", 2, 0) + GuildRankCheckBox:SetAsCheckBox() + + local guild_sync = function() + _detalhes.storage:DBGuildSync() + f.GuildSyncButton:Disable() + + if (not f.SyncTexture) then + local workingFrame = CreateFrame ("frame", nil, f) + f.WorkingFrame = workingFrame + workingFrame:SetSize (1, 1) + f.SyncTextureBackground = workingFrame:CreateTexture (nil, "border") + f.SyncTextureBackground:SetPoint ("bottomright", f, "bottomright", -5, -1) + f.SyncTextureBackground:SetTexture ([[Interface\COMMON\StreamBackground]]) + f.SyncTextureBackground:SetSize (32, 32) + f.SyncTextureCircle = workingFrame:CreateTexture (nil, "artwork") + f.SyncTextureCircle:SetPoint ("center", f.SyncTextureBackground, "center", 0, 0) + f.SyncTextureCircle:SetTexture ([[Interface\COMMON\StreamCircle]]) + f.SyncTextureCircle:SetSize (32, 32) + f.SyncTextureGrade = workingFrame:CreateTexture (nil, "overlay") + f.SyncTextureGrade:SetPoint ("center", f.SyncTextureBackground, "center", 0, 0) + f.SyncTextureGrade:SetTexture ([[Interface\COMMON\StreamFrame]]) + f.SyncTextureGrade:SetSize (32, 32) + + local animationHub = _detalhes.gump:CreateAnimationHub (workingFrame) + animationHub:SetLooping ("Repeat") + f.WorkingAnimation = animationHub + + local rotation = _detalhes.gump:CreateAnimation (animationHub, "ROTATION", 1, 3, -360) + rotation:SetTarget (f.SyncTextureCircle) + --_detalhes.gump:CreateAnimation (animationHub, "ALPHA", 1, 0.5, 0, 1) + + f.SyncText = workingFrame:CreateFontString (nil, "border", "GameFontNormal") + f.SyncText:SetPoint ("right", f.SyncTextureBackground, "left", 0, 0) + f.SyncText:SetText ("working") + + local endAnimationHub = _detalhes.gump:CreateAnimationHub (workingFrame, nil, function() workingFrame:Hide() end) + _detalhes.gump:CreateAnimation (endAnimationHub, "ALPHA", 1, 0.5, 1, 0) + f.EndAnimationHub = endAnimationHub + end + + f.WorkingFrame:Show() + f.WorkingAnimation:Play() + + C_Timer.NewTicker (10, function (self) + if (not _detalhes.LastGuildSyncReceived) then + f.GuildSyncButton:Enable() + f.EndAnimationHub:Play() + elseif (_detalhes.LastGuildSyncReceived+10 < GetTime()) then + f.GuildSyncButton:Enable() + f.EndAnimationHub:Play() + self:Cancel() + end + end) + + end + + local GuildSyncButton = _detalhes.gump:CreateButton (f, guild_sync, 130, 20, "Sync With Guild", nil, nil, nil, "GuildSyncButton", nil, nil, options_button_template, options_text_template) + GuildSyncButton:SetPoint ("topright", f, "topright", -20, -34) + GuildSyncButton:SetIcon ([[Interface\GLUES\CharacterSelect\RestoreButton]], 12, 12, "overlay", {0.2, .8, 0.2, .8}, nil, 4) + + -- function f:SetBackgroundImage (encounterId) local instanceId = _detalhes:GetInstanceIdFromEncounterId (encounterId) if (instanceId) then @@ -1147,7 +1245,7 @@ end end) - f.TitleText:SetText ("Raid History") + f.TitleText:SetText ("Details! Raid Ranking") f.portrait:SetTexture ([[Interface\AddOns\Details\images\icons2]]) f.portrait:SetTexCoord (192/512, 258/512, 322/512, 388/512) @@ -1170,6 +1268,7 @@ --> select raid: local on_raid_select = function (_, _, raid) + f:UpdateDropdowns (true) on_select() end local build_raid_list = function() @@ -1265,7 +1364,7 @@ local player2_dropdown = gump:CreateDropDown (f, build_player2_list, 1, dropdown_size, 20, "select_player2") local player2_string = gump:CreateLabel (f, "Player:", _, _, "GameFontNormal", "select_player2_label") - function f:UpdateDropdowns() + function f:UpdateDropdowns (DoNotSelectRaid) --difficulty wipe (diff_list) @@ -1277,6 +1376,8 @@ local raid_repeated = {} local guild_repeated = {} + local raidSelected = DetailsRaidHistoryWindow.select_raid:GetValue() + for difficulty, encounterIdTable in pairs (db) do if (type (difficulty) == "number") then @@ -1292,13 +1393,18 @@ if (not boss_repeated [encounterId]) then local encounter, instance = _detalhes:GetBossEncounterDetailsFromEncounterId (_, encounterId) if (encounter) then - tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = icon, onclick = on_boss_select}) - boss_repeated [encounterId] = true + + local InstanceID = _detalhes:GetInstanceIdFromEncounterId (encounterId) + if (raidSelected == InstanceID) then + tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = icon, onclick = on_boss_select}) + boss_repeated [encounterId] = true + end if (not raid_repeated [instance.name]) then tinsert (raid_list, {value = instance.id, label = instance.name, icon = icon, onclick = on_raid_select}) raid_repeated [instance.name] = true end + end end @@ -1317,13 +1423,49 @@ diff_dropdown:Select (1, true) boss_dropdown:Refresh() boss_dropdown:Select (1, true) - raid_dropdown:Refresh() - raid_dropdown:Select (1, true) + if (not DoNotSelectRaid) then + raid_dropdown:Refresh() + raid_dropdown:Select (1, true) + end guild_dropdown:Refresh() guild_dropdown:Select (1, true) end + function f.UpdateBossDropdown() + + local raidSelected = DetailsRaidHistoryWindow.select_raid:GetValue() + local boss_repeated = {} + wipe (boss_list) + + for difficulty, encounterIdTable in pairs (db) do + if (type (difficulty) == "number") then + if (difficulty == 14) then + tinsert (diff_list, {value = 14, label = "Normal", icon = icon, onclick = on_diff_select}) + elseif (difficulty == 15) then + tinsert (diff_list, {value = 15, label = "Heroic", icon = icon, onclick = on_diff_select}) + elseif (difficulty == 16) then + tinsert (diff_list, {value = 16, label = "Mythic", icon = icon, onclick = on_diff_select}) + end + + for encounterId, encounterTable in pairs (encounterIdTable) do + if (not boss_repeated [encounterId]) then + local encounter, instance = _detalhes:GetBossEncounterDetailsFromEncounterId (_, encounterId) + if (encounter) then + local InstanceID = _detalhes:GetInstanceIdFromEncounterId (encounterId) + if (raidSelected == InstanceID) then + tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = icon, onclick = on_boss_select}) + boss_repeated [encounterId] = true + end + end + end + end + end + end + + boss_dropdown:Refresh() + end + --> anchors: raid_string:SetPoint ("topleft", f, "topleft", 10, -70) raid_dropdown:SetPoint ("topleft", f, "topleft", 10, -85) @@ -1421,11 +1563,86 @@ local fillpanel = gump:NewFillPanel (f, {}, "$parentFP", "fillpanel", 630, 400, false, false, true, nil) fillpanel:SetPoint ("topleft", f, "topleft", 200, -65) + function f:BuildGuildRankTable (encounterTable, guild, role) + + local header = {{name = "Player Name", type = "text"}, {name = "Total", type = "text"}, {name = "Per Second", type = "text"}, {name = "Length", type = "text"}, {name = "Item Level", type = "text"}, {name = "Date", type = "text"}} + local players = {} + local players_index = {} + + local playerScore = {} + + --get the best of each player + for encounterIndex, encounter in ipairs (encounterTable) do + if (encounter.guild == guild) then + local roleTable = encounter [role] + + local date = encounter.date + date = date:gsub (".*%s", "") + date = date:sub (1, -4) + + for playerName, playerTable in pairs (roleTable) do + + if (not playerScore [playerName]) then + playerScore [playerName] = { + total = 0, + ps = 0, + ilvl = 0, + date = 0, + class = 0, + length = 0, + } + end + + local total = playerTable [1] + if (total > playerScore [playerName].total) then + playerScore [playerName].total = total + playerScore [playerName].ps = total / encounter.elapsed + playerScore [playerName].ilvl = playerTable [2] + playerScore [playerName].length = encounter.elapsed + playerScore [playerName].date = date + playerScore [playerName].class = playerTable [3] + end + end + end + end + + local sortTable = {} + for playerName, t in pairs (playerScore) do + local className = select (2, GetClassInfo (t.class or 0)) + local classColor = "FFFFFFFF" + if (className) then + classColor = RAID_CLASS_COLORS [className] and RAID_CLASS_COLORS [className].colorStr + end + + tinsert (sortTable, { + "|c" .. classColor .. playerName .. "|r", + _detalhes:comma_value (t.total), + _detalhes:ToK2 (t.ps), + _detalhes.gump:IntegerToTimer (t.length), + floor (t.ilvl), + t.date, + t.total, + }) + end + table.sort (sortTable, function(a, b) return a[7] > b[7] end) + + fillpanel:SetFillFunction (function (index) return sortTable [index] end) + fillpanel:SetTotalFunction (function() return #sortTable end) + fillpanel:UpdateRows (header) + fillpanel:Refresh() + end + function f:BuildRaidTable (encounterTable, guild, role) + if (f.Mode == 2) then + f:BuildGuildRankTable (encounterTable, guild, role) + return + end + local header = {{name = "Player Name", type = "text"}} -- , width = 90 local players = {} local players_index = {} + local player_class = {} local amt_encounters = 0 for encounterIndex, encounter in ipairs (encounterTable) do @@ -1445,6 +1662,7 @@ if (not index) then player = {playerName} + player_class [playerName] = playerTable [3] for i = 1, amt_encounters-1 do tinsert (player, "") end @@ -1469,19 +1687,20 @@ for i = #playerTable, amt_encounters do tinsert (playerTable, "") end + + local className = select (2, GetClassInfo (player_class [playerTable [1]] or 0)) + if (className) then + local classColor = RAID_CLASS_COLORS [className] and RAID_CLASS_COLORS [className].colorStr + playerTable [1] = "|c" .. classColor .. playerTable [1] .. "|r" + end end - --_detalhes:DumpTable (players, true) - - --table.sort (players, sort_alphabetical) - fillpanel:SetFillFunction (function (index) return players [index] end) fillpanel:SetTotalFunction (function() return #players end) fillpanel:UpdateRows (header) fillpanel:Refresh() - end function f:Refresh (player_name) @@ -1495,6 +1714,7 @@ local diffTable = db [diff] f:SetBackgroundImage (boss) + --_detalhes:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild, _player_base, _player_name) if (diffTable) then local encounters = diffTable [boss] @@ -1555,12 +1775,15 @@ end _G.DetailsRaidHistoryWindow:UpdateDropdowns() + _G.DetailsRaidHistoryWindow:UpdateDropdowns() + _G.DetailsRaidHistoryWindow:Refresh() _G.DetailsRaidHistoryWindow:Show() if (_raid) then DetailsRaidHistoryWindow.select_raid:Select (_raid) _G.DetailsRaidHistoryWindow:Refresh() + DetailsRaidHistoryWindow.UpdateBossDropdown() end if (_boss) then DetailsRaidHistoryWindow.select_boss:Select (_boss) diff --git a/functions/link.lua b/functions/link.lua index d1fcc6d7..ff46a2eb 100644 --- a/functions/link.lua +++ b/functions/link.lua @@ -3096,7 +3096,7 @@ local create_deathrecap_line = function (parent, n) lifePercent:SetAlpha (textAlpha) --text setup - amount:SetWidth (75) + amount:SetWidth (85) amount:SetJustifyH ("right") lifePercent:SetWidth (36) lifePercent:SetJustifyH ("right") diff --git a/functions/slash.lua b/functions/slash.lua index 004dbe4e..bc4f359a 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -25,7 +25,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (command == Loc ["STRING_SLASH_NEW"] or command == "new") then _detalhes:CriarInstancia (nil, true) - elseif (command == Loc ["STRING_SLASH_HISTORY"] or command == "history") then + elseif (command == Loc ["STRING_SLASH_HISTORY"] or command == "history" or command == "score" or command == "rank" or command == "ranking") then _detalhes:OpenRaidHistoryWindow() elseif (command == Loc ["STRING_SLASH_TOGGLE"] or command == "toggle") then @@ -1285,6 +1285,34 @@ function SlashCmdList.DETAILS (msg, editbox) instance:InstanceAlert ("Boss Defeated, Open History! ", {[[Interface\AddOns\Details\images\icons]], 16, 16, false, 434/512, 466/512, 243/512, 273/512}, 40, func, true) end end + + elseif (msg == "teste1") then -- /de teste1 + _detalhes:OpenRaidHistoryWindow (1530, 1886, 15, "damage", "Rock Lobster", 2, "Keyspell") --, _role, _guild, _player_base, _player_name) + + elseif (msg == "recordtest") then + + local f = DetailsRecordFrameAnimation + if (not f) then + f = CreateFrame ("frame", "DetailsRecordFrameAnimation", UIParent) + + --estrela no inicio dando um giro + --Interface\Cooldown\star4 + --efeito de batida? + --Interface\Artifacts\ArtifactAnim2 + + + + local DF = _detalhes.gump + + local animationHub = DF:CreateAnimationHub (f, function() f:Show() end) + + DF:CreateAnimation (animationHub, "Scale", 1, .10, .9, .9, 1.1, 1.1) + DF:CreateAnimation (animationHub, "Scale", 2, .10, 1.2, 1.2, 1, 1) + + + end + + else @@ -1383,4 +1411,5 @@ function _detalhes:CreateListPanel() return _detalhes.ListPanel end +--doe --endd elsee \ No newline at end of file diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 30fa65f1..7e25763e 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -272,7 +272,7 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section) forge_button:SetIcon ([[Interface\AddOns\Details\images\icons]], nil, nil, nil, {396/512, 428/512, 243/512, 273/512}, nil, nil, 2) forge_button:SetPoint ("topleft", 80, -61) - local history_button = g:NewButton (window, _, "$parentHistoryButton", "HistoryButton", 90, 20, function() _detalhes:OpenRaidHistoryWindow(); window:Hide() end, nil, nil, nil, "Open History", 1) --, g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local history_button = g:NewButton (window, _, "$parentHistoryButton", "HistoryButton", 90, 20, function() _detalhes:OpenRaidHistoryWindow(); window:Hide() end, nil, nil, nil, "Guild Rank", 1) --, g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") history_button:SetIcon ([[Interface\AddOns\Details\images\icons]], nil, nil, nil, {434/512, 466/512, 243/512, 273/512}, nil, nil, 2) history_button:SetPoint ("topleft", 180, -61)