diff --git a/Libs/DF/LibDFramework-1.0.toc b/Libs/DF/LibDFramework-1.0.toc index 872795608..5f5426ab1 100644 --- a/Libs/DF/LibDFramework-1.0.toc +++ b/Libs/DF/LibDFramework-1.0.toc @@ -1,4 +1,4 @@ -## Interface: 80000 +## Interface: 90001 ## Title: Lib: LibDFramework-1.0 ## Notes: Base Framework for many Addons diff --git a/Libs/DF/background.tga b/Libs/DF/background.tga deleted file mode 100644 index 8978d43dd..000000000 Binary files a/Libs/DF/background.tga and /dev/null differ diff --git a/Libs/DF/border_1.tga b/Libs/DF/border_1.tga deleted file mode 100644 index 0f84fce6c..000000000 Binary files a/Libs/DF/border_1.tga and /dev/null differ diff --git a/Libs/DF/border_2.tga b/Libs/DF/border_2.tga deleted file mode 100644 index 22b2c534a..000000000 Binary files a/Libs/DF/border_2.tga and /dev/null differ diff --git a/Libs/DF/border_3.tga b/Libs/DF/border_3.tga deleted file mode 100644 index 79e236bb8..000000000 Binary files a/Libs/DF/border_3.tga and /dev/null differ diff --git a/Libs/DF/button.lua b/Libs/DF/button.lua index f281d204e..a3fd71588 100644 --- a/Libs/DF/button.lua +++ b/Libs/DF/button.lua @@ -1071,8 +1071,6 @@ function DF:NewButton (parent, container, name, member, w, h, func, param1, para build_button (ButtonObject.button) ButtonObject.widget = ButtonObject.button - - --ButtonObject.button:SetBackdrop ({bgFile = DF.folder .. "background", tileSize = 64, edgeFile = DF.folder .. "border_2", edgeSize = 10, insets = {left = 1, right = 1, top = 1, bottom = 1}}) ButtonObject.button:SetBackdropColor (0, 0, 0, 0.4) ButtonObject.button:SetBackdropBorderColor (1, 1, 1, 1) diff --git a/Libs/DF/cooltip.lua b/Libs/DF/cooltip.lua index f7c4fb8e7..28952c027 100644 --- a/Libs/DF/cooltip.lua +++ b/Libs/DF/cooltip.lua @@ -289,11 +289,12 @@ function DF:CreateCoolTip() --> build widgets for frame build_main_frame (frame1) - GameCooltipFrame1_FrameBackgroundCenter:SetTexture (DF.folder .. "cooltip_background") + --is this still in use? + GameCooltipFrame1_FrameBackgroundCenter:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]]) GameCooltipFrame1_FrameBackgroundCenter:SetTexCoord (0.10546875, 0.89453125, 0, 1) - GameCooltipFrame1_FrameBackgroundLeft:SetTexture (DF.folder .. "cooltip_background") + GameCooltipFrame1_FrameBackgroundLeft:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]]) GameCooltipFrame1_FrameBackgroundLeft:SetTexCoord (0, 0.103515625, 0, 1) - GameCooltipFrame1_FrameBackgroundRight:SetTexture (DF.folder .. "cooltip_background") + GameCooltipFrame1_FrameBackgroundRight:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]]) GameCooltipFrame1_FrameBackgroundRight:SetTexCoord (0.896484375, 1, 0, 1) --> secondary frame @@ -319,11 +320,12 @@ function DF:CreateCoolTip() frame2:SetPoint ("bottomleft", frame1, "bottomright", 4, 0) - GameCooltipFrame2_FrameBackgroundCenter:SetTexture (DF.folder .. "cooltip_background") + --is this still in use? + GameCooltipFrame2_FrameBackgroundCenter:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]]) GameCooltipFrame2_FrameBackgroundCenter:SetTexCoord (0.10546875, 0.89453125, 0, 1) - GameCooltipFrame2_FrameBackgroundLeft:SetTexture (DF.folder .. "cooltip_background") + GameCooltipFrame2_FrameBackgroundLeft:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]]) GameCooltipFrame2_FrameBackgroundLeft:SetTexCoord (0, 0.103515625, 0, 1) - GameCooltipFrame2_FrameBackgroundRight:SetTexture (DF.folder .. "cooltip_background") + GameCooltipFrame2_FrameBackgroundRight:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]]) GameCooltipFrame2_FrameBackgroundRight:SetTexCoord (0.896484375, 1, 0, 1) CoolTip.frame1 = frame1 @@ -3335,23 +3337,23 @@ function DF:CreateCoolTip() end end - return ture + return true end --> all done CoolTip:ClearAllOptions() --- local preset2_backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = DF.folder .. "border_3", tile=true, --- edgeSize = 16, tileSize = 64, insets = {left = 3, right = 3, top = 4, bottom = 4}} - - local preset2_backdrop = {bgFile = DF.folder .. "background", edgeFile = [[Interface\Buttons\WHITE8X8]], tile = true, - edgeSize = 1, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}} + local preset2_backdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, + tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}} local default_backdrop_color = {0.09019, 0.09019, 0.18823, 0.8} local default_backdropborder_color = {1, 1, 1, 1} local gray_table = {0.37, 0.37, 0.37, 0.95} local white_table = {1, 1, 1, 1} local black_table = {0.2, 0.2, 0.2, 1} + + local backdropColorPreset2 = {.2, .2, .2, 1} + local borderColorPreset2 = {.2, .2, .2, 1} function CoolTip:Preset (number) self:Reset() @@ -3373,11 +3375,10 @@ function DF:CreateCoolTip() self:SetOption ("ButtonsYMod", -4) self:SetOption ("YSpacingMod", -4) self:SetOption ("IgnoreButtonAutoHeight", true) - self:SetColor (1, 0.5, 0.5, 0.5, 0) - self:SetBackdrop (1, preset2_backdrop, gray_table, black_table) - self:SetBackdrop (2, preset2_backdrop, gray_table, black_table) + self:SetBackdrop (1, preset2_backdrop, backdropColorPreset2, borderColorPreset2) + self:SetBackdrop (2, preset2_backdrop, backdropColorPreset2, borderColorPreset2) end end diff --git a/Libs/DF/cooltip_background.tga b/Libs/DF/cooltip_background.tga deleted file mode 100644 index 8c46e0de7..000000000 Binary files a/Libs/DF/cooltip_background.tga and /dev/null differ diff --git a/Libs/DF/feedback_sites.tga b/Libs/DF/feedback_sites.tga deleted file mode 100644 index cad38ed43..000000000 Binary files a/Libs/DF/feedback_sites.tga and /dev/null differ diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 934c0eefd..8f284ce72 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,5 +1,6 @@ -local dversion = 211 + +local dversion = 212 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary (major, minor) @@ -1445,7 +1446,7 @@ end line_widgets_created = 0 max_x = 0 end - + if widget_created then widget_created:Show() end @@ -2049,7 +2050,7 @@ end options_frame:SetPoint ("center", UIParent, "center") options_frame:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, - edgeFile = DF.folder .. "border_2", edgeSize = 32, + edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 1, right = 1, top = 1, bottom = 1}}) options_frame:SetBackdropColor (0, 0, 0, .7) diff --git a/Libs/DF/icons.tga b/Libs/DF/icons.tga deleted file mode 100644 index 4b34cb57a..000000000 Binary files a/Libs/DF/icons.tga and /dev/null differ diff --git a/Libs/DF/mail.tga b/Libs/DF/mail.tga deleted file mode 100644 index 817eb66d1..000000000 Binary files a/Libs/DF/mail.tga and /dev/null differ diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index aeb31d7f9..389cdf10d 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -1713,8 +1713,8 @@ function DF:IconPick (callback, close_when_select, param1, param2) self.icon:SetBlendMode ("BLEND") end - local backdrop = {bgFile = DF.folder .. "background", tile = true, tileSize = 16, - insets = {left = 0, right = 0, top = 0, bottom = 0}, edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], edgeSize = 10} + local backdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, + insets = {left = 0, right = 0, top = 0, bottom = 0}, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1} for i = 0, 9 do local newcheck = CreateFrame ("Button", "DetailsFrameworkIconPickFrameButton"..(i+1), DF.IconPickFrame, "BackdropTemplate") @@ -2033,12 +2033,14 @@ function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db) local close = CreateFrame ("button", name and name .. "CloseButton", title_bar) close:SetFrameLevel (DF.FRAMELEVEL_OVERLAY) close:SetSize (16, 16) - close:SetNormalTexture (DF.folder .. "icons") - close:SetHighlightTexture (DF.folder .. "icons") - close:SetPushedTexture (DF.folder .. "icons") - close:GetNormalTexture():SetTexCoord (0, 16/128, 0, 1) - close:GetHighlightTexture():SetTexCoord (0, 16/128, 0, 1) - close:GetPushedTexture():SetTexCoord (0, 16/128, 0, 1) + + close:SetNormalTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + close:SetHighlightTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + close:SetPushedTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + close:GetNormalTexture():SetDesaturated(true) + close:GetHighlightTexture():SetDesaturated(true) + close:GetPushedTexture():SetDesaturated(true) + close:SetAlpha (0.7) close:SetScript ("OnClick", simple_panel_close_click) f.Close = close @@ -2065,7 +2067,7 @@ function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db) end local Panel1PxBackdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 64, -edgeFile = DF.folder .. "border_3", edgeSize = 9, insets = {left = 2, right = 2, top = 3, bottom = 3}} +edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 2, right = 2, top = 3, bottom = 3}} local Panel1PxOnClickClose = function (self) self:GetParent():Hide() @@ -2075,9 +2077,9 @@ local Panel1PxOnToggleLock = function (self) self.IsLocked = false self:SetMovable (true) self:EnableMouse (true) - self.Lock:GetNormalTexture():SetTexCoord (32/128, 48/128, 0, 1) - self.Lock:GetHighlightTexture():SetTexCoord (32/128, 48/128, 0, 1) - self.Lock:GetPushedTexture():SetTexCoord (32/128, 48/128, 0, 1) + self.Lock:GetNormalTexture():SetTexCoord (16/64, 32/64, 0, 1) + self.Lock:GetHighlightTexture():SetTexCoord (16/32, 32/64, 0, 1) + self.Lock:GetPushedTexture():SetTexCoord (16/64, 32/64, 0, 1) if (self.OnUnlock) then self:OnUnlock() end @@ -2088,9 +2090,9 @@ local Panel1PxOnToggleLock = function (self) self.IsLocked = true self:SetMovable (false) self:EnableMouse (false) - self.Lock:GetNormalTexture():SetTexCoord (16/128, 32/128, 0, 1) - self.Lock:GetHighlightTexture():SetTexCoord (16/128, 32/128, 0, 1) - self.Lock:GetPushedTexture():SetTexCoord (16/128, 32/128, 0, 1) + self.Lock:GetNormalTexture():SetTexCoord (0/64, 16/64, 0, 1) + self.Lock:GetHighlightTexture():SetTexCoord (0/64, 16/64, 0, 1) + self.Lock:GetPushedTexture():SetTexCoord (0/64, 16/64, 0, 1) if (self.OnLock) then self:OnLock() end @@ -2205,22 +2207,28 @@ function DF:Create1PxPanel (parent, w, h, title, name, config, title_anchor, no_ local close = CreateFrame ("button", name and name .. "CloseButton", f, "BackdropTemplate") close:SetSize (16, 16) - close:SetNormalTexture (DF.folder .. "icons") - close:SetHighlightTexture (DF.folder .. "icons") - close:SetPushedTexture (DF.folder .. "icons") - close:GetNormalTexture():SetTexCoord (0, 16/128, 0, 1) - close:GetHighlightTexture():SetTexCoord (0, 16/128, 0, 1) - close:GetPushedTexture():SetTexCoord (0, 16/128, 0, 1) + close:SetNormalTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + close:SetHighlightTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + close:SetPushedTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + close:GetNormalTexture():SetDesaturated(true) + close:GetHighlightTexture():SetDesaturated(true) + close:GetPushedTexture():SetDesaturated(true) close:SetAlpha (0.7) local lock = CreateFrame ("button", name and name .. "LockButton", f, "BackdropTemplate") lock:SetSize (16, 16) - lock:SetNormalTexture (DF.folder .. "icons") - lock:SetHighlightTexture (DF.folder .. "icons") - lock:SetPushedTexture (DF.folder .. "icons") - lock:GetNormalTexture():SetTexCoord (32/128, 48/128, 0, 1) - lock:GetHighlightTexture():SetTexCoord (32/128, 48/128, 0, 1) - lock:GetPushedTexture():SetTexCoord (32/128, 48/128, 0, 1) + lock:SetNormalTexture ([[Interface\GLUES\CharacterSelect\Glues-AddOn-Icons]]) + lock:SetHighlightTexture ([[Interface\GLUES\CharacterSelect\Glues-AddOn-Icons]]) + lock:SetPushedTexture ([[Interface\GLUES\CharacterSelect\Glues-AddOn-Icons]]) + lock:GetNormalTexture():SetDesaturated(true) + lock:GetHighlightTexture():SetDesaturated(true) + lock:GetPushedTexture():SetDesaturated(true) + --lock:GetNormalTexture():SetBlendMode("ADD") + --lock:GetHighlightTexture():SetBlendMode("ADD") + --lock:GetPushedTexture():SetBlendMode("ADD") + --lock:GetNormalTexture():SetTexCoord(73/256, 105/256, 64/128, 110/) + --lock:GetHighlightTexture():SetTexCoord(73/256, 105/256, 64/128, 110/) + --lock:GetPushedTexture():SetTexCoord(73/256, 105/256, 64/128, 110/) lock:SetAlpha (0.7) close:SetPoint ("topright", f, "topright", -3, -3) @@ -2438,12 +2446,12 @@ function DF:CreateOptionsButton (parent, callback, name) local b = CreateFrame ("button", name, parent, "BackdropTemplate") b:SetSize (14, 14) - b:SetNormalTexture (DF.folder .. "icons") - b:SetHighlightTexture (DF.folder .. "icons") - b:SetPushedTexture (DF.folder .. "icons") - b:GetNormalTexture():SetTexCoord (48/128, 64/128, 0, 1) - b:GetHighlightTexture():SetTexCoord (48/128, 64/128, 0, 1) - b:GetPushedTexture():SetTexCoord (48/128, 64/128, 0, 1) + b:SetNormalTexture ([[Interface\GossipFrame\BinderGossipIcon]]) + b:SetHighlightTexture ([[Interface\GossipFrame\BinderGossipIcon]]) + b:SetPushedTexture ([[Interface\GossipFrame\BinderGossipIcon]]) + b:GetNormalTexture():SetDesaturated(true) + b:GetHighlightTexture():SetDesaturated(true) + b:GetPushedTexture():SetDesaturated(true) b:SetAlpha (0.7) b:SetScript ("OnClick", callback) @@ -2466,10 +2474,6 @@ end function DF:CreateFeedbackButton (parent, callback, name) local b = CreateFrame ("button", name, parent, "BackdropTemplate") b:SetSize (12, 13) - b:SetNormalTexture (DF.folder .. "mail") - b:SetPushedTexture (DF.folder .. "mail") - b:SetHighlightTexture (DF.folder .. "mail") - b:SetScript ("OnClick", callback) b:SetScript ("OnEnter", function (self) GameCooltip2:Reset() @@ -2479,12 +2483,14 @@ function DF:CreateFeedbackButton (parent, callback, name) b:SetScript ("OnLeave", function (self) GameCooltip2:Hide() end) + + print("Framework:CreateFeedbackButton() is deprecated.") return b end -local backdrop_fb_line = {bgFile = DF.folder .. "background", edgeFile = DF.folder .. "border_3", -tile = true, tileSize = 64, edgeSize = 8, insets = {left = 2, right = 2, top = 2, bottom = 2}} +local backdrop_fb_line = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, +tile = true, tileSize = 64, insets = {left = 2, right = 2, top = 2, bottom = 2}} local on_enter_feedback = function (self) self:SetBackdropColor (1, 1, 0, 0.5) @@ -5062,12 +5068,14 @@ function DF:CreateTitleBar (f, titleText) local closeButton = CreateFrame ("button", titleBar:GetName() and titleBar:GetName() .. "CloseButton" or nil, titleBar, "BackdropTemplate") closeButton:SetSize (16, 16) - closeButton:SetNormalTexture (DF.folder .. "icons") - closeButton:SetHighlightTexture (DF.folder .. "icons") - closeButton:SetPushedTexture (DF.folder .. "icons") - closeButton:GetNormalTexture():SetTexCoord (0, 16/128, 0, 1) - closeButton:GetHighlightTexture():SetTexCoord (0, 16/128, 0, 1) - closeButton:GetPushedTexture():SetTexCoord (0, 16/128, 0, 1) + + closeButton:SetNormalTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + closeButton:SetHighlightTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + closeButton:SetPushedTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + closeButton:GetNormalTexture():SetDesaturated(true) + closeButton:GetHighlightTexture():SetDesaturated(true) + closeButton:GetPushedTexture():SetDesaturated(true) + closeButton:SetAlpha (0.7) closeButton:SetScript ("OnClick", simple_panel_close_click) --upvalue from this file @@ -6387,7 +6395,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) GameCooltip2:SetColor (1, 0.5, 0.5, 0.5, 0) - local preset2_backdrop = {bgFile = DF.folder .. "background", edgeFile = [[Interface\Buttons\WHITE8X8]], tile = true, edgeSize = 1, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}} + local preset2_backdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Buttons\WHITE8X8]], tile = true, edgeSize = 1, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}} local gray_table = {0.37, 0.37, 0.37, 0.95} local black_table = {0.2, 0.2, 0.2, 1} GameCooltip2:SetBackdrop (1, preset2_backdrop, gray_table, black_table) @@ -6485,7 +6493,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) GameCooltip2:SetColor (1, 0.5, 0.5, 0.5, 0) - local preset2_backdrop = {bgFile = DF.folder .. "background", edgeFile = [[Interface\Buttons\WHITE8X8]], tile = true, edgeSize = 1, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}} + local preset2_backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeFile = [[Interface\Buttons\WHITE8X8]], tile = true, edgeSize = 1, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}} local gray_table = {0.37, 0.37, 0.37, 0.95} local black_table = {0.2, 0.2, 0.2, 1} GameCooltip2:SetBackdrop (1, preset2_backdrop, gray_table, black_table) diff --git a/Libs/DF/spells.lua b/Libs/DF/spells.lua index 45598f1aa..ca86db2d4 100644 --- a/Libs/DF/spells.lua +++ b/Libs/DF/spells.lua @@ -250,8 +250,10 @@ DF.CooldownsBySpec = { --DEMON HUNTER --havoc [577] = { + [200166] = 1, --Metamorphosis [198589] = 2, --Blur + [196555] = 2, --Netherwalk (talent) [196718] = 4, --Darkness [188501] = 5, --Spectral Sight @@ -633,8 +635,10 @@ DF.CooldownsInfo = { [221562] = {cooldown = 45, duration = 5, talent = false, charges = 1, class = "DEATHKNIGHT", type = 5}, --Asphyxiate --> demon hunter + [200166] = {cooldown = 240, duration = 30, talent = false, charges = 1, class = "DEMONHUNTER", type = 1}, --Metamorphosis [198589] = {cooldown = 60, duration = 10, talent = false, charges = 1, class = "DEMONHUNTER", type = 2}, --Blur + [196555] = {cooldown = 120, duration = 5, talent = 21865, charges = 1, class = "DEMONHUNTER", type = 2}, --Netherwalk (talent) [196718] = {cooldown = 180, duration = 8, talent = false, charges = 1, class = "DEMONHUNTER", type = 4}, --Darkness [187827] = {cooldown = 180, duration = 15, talent = false, charges = 1, class = "DEMONHUNTER", type = 2}, --Metamorphosis diff --git a/Libs/DF/textentry.lua b/Libs/DF/textentry.lua index 175326376..dfc9ae3e0 100644 --- a/Libs/DF/textentry.lua +++ b/Libs/DF/textentry.lua @@ -672,20 +672,19 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p TextEntryObject.enabled_text_color = {TextEntryObject.editbox:GetTextColor()} TextEntryObject.onleave_backdrop = {TextEntryObject.editbox:GetBackdropColor()} TextEntryObject.onleave_backdrop_border_color = {TextEntryObject.editbox:GetBackdropBorderColor()} - + TextEntryObject.func = func TextEntryObject.param1 = param1 TextEntryObject.param2 = param2 TextEntryObject.next = nil TextEntryObject.space = space TextEntryObject.tab_on_enter = false - + TextEntryObject.label = _G [name .. "_Desc"] - - TextEntryObject.editbox:SetBackdrop ({bgFile = DF.folder .. "background", tileSize = 64, edgeFile = DF.folder .. "border_2", edgeSize = 10, insets = {left = 1, right = 1, top = 1, bottom = 1}}) - + TextEntryObject.editbox:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 1, right = 1, top = 1, bottom = 1}}) + TextEntryObject.editbox:SetBackdropColor (.2, .2, .2, 1) + --> hooks - TextEntryObject.HookList = { OnEnter = {}, OnLeave = {}, diff --git a/boot.lua b/boot.lua index 02102e4d7..495c0d152 100644 --- a/boot.lua +++ b/boot.lua @@ -4,8 +4,8 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 7930 - _detalhes.alpha_build_counter = 7930 --if this is higher than the regular counter, use it instead + _detalhes.build_counter = 7932 + _detalhes.alpha_build_counter = 7932 --if this is higher than the regular counter, use it instead _detalhes.game_version = "v9.0.1" _detalhes.userversion = "v9.0.1." .. _detalhes.build_counter _detalhes.realversion = 143 --core version, this is used to check API version for scripts and plugins (see alias below) diff --git a/classes/class_custom.lua b/classes/class_custom.lua index 9d7cf23af..ab212a7cd 100644 --- a/classes/class_custom.lua +++ b/classes/class_custom.lua @@ -99,7 +99,7 @@ local top = 0 local amount = 0 - --> check if is a custom script + --> check if is a custom script (if has .script) if (custom_object:IsScripted()) then --> be save reseting the values on every refresh @@ -155,7 +155,7 @@ _detalhes:EndRefresh (instance, 0, combat, combat [1]) end - okey, total, top, amount = _pcall (func, combat, instance_container, instance) + local okey, total, top, amount = _pcall (func, combat, instance_container, instance) if (not okey) then _detalhes:Msg ("|cFFFF9900error on custom display function|r:", total) return _detalhes:EndRefresh (instance, 0, combat, combat [1]) @@ -165,10 +165,10 @@ top = top or 0 amount = amount or 0 - else + else --does not have a .script --> get the attribute - local attribute = custom_object:GetAttribute() - + local attribute = custom_object:GetAttribute() --"damagedone" + --> get the custom function (actor, source, target, spellid) local func = atributo_custom [attribute] @@ -317,8 +317,12 @@ end end - for _, actor in _ipairs (combat_container) do + for _, actor in _ipairs (combat_container) do if (actor.grupo) then + if (not func) then + Details:Msg("error on class_custom 'func' is invalid, backtrace:", debugstack()) + return + end local actortotal = func (_, actor, source, target, spellid, combat, instance_container) if (actortotal > 0) then diff --git a/classes/class_damage.lua b/classes/class_damage.lua index 7cda74c47..cd8c41e4b 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -876,7 +876,6 @@ new_custom_object.__index = Details.atributo_custom return instance:TrocaTabela (instance.segmento, 5, #Details.custom) - end local DTBS_format_name = function (player_name) return Details:GetOnlyName (player_name) end diff --git a/classes/custom_damagedone.lua b/classes/custom_damagedone.lua index 7b3c83b3e..6f72f78c8 100644 --- a/classes/custom_damagedone.lua +++ b/classes/custom_damagedone.lua @@ -4,15 +4,317 @@ --> customized display script - local _detalhes = _G._detalhes - local _ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> attributes functions for customs +--> DAMAGEDONE + +--> customized display script + +local _detalhes = _G._detalhes +local _ + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> local pointers + +local _cstr = string.format --lua local +local _math_floor = math.floor --lua local +local _table_sort = table.sort --lua local +local _table_insert = table.insert --lua local +local _table_size = table.getn --lua local +local _setmetatable = setmetatable --lua local +local _ipairs = ipairs --lua local +local _pairs = pairs --lua local +local _rawget= rawget --lua local +local _math_min = math.min --lua local +local _math_max = math.max --lua local +local _bit_band = bit.band --lua local +local _unpack = unpack --lua local +local _type = type --lua local - local atributo_custom = _detalhes.atributo_custom - local ToKFunctions = _detalhes.ToKFunctions +local _GetSpellInfo = _detalhes.getspellinfo -- api local +local _IsInRaid = IsInRaid -- api local +local _IsInGroup = IsInGroup -- api local +local _GetNumGroupMembers = GetNumGroupMembers -- api local +local _GetNumPartyMembers = GetNumPartyMembers or GetNumSubgroupMembers -- api local +local _GetNumRaidMembers = GetNumRaidMembers or GetNumGroupMembers -- api local +local _GetUnitName = GetUnitName -- api local - function atributo_custom:UpdateDamageDoneBracket() - SelectedToKFunction = ToKFunctions [_detalhes.ps_abbreviation] - FormatTooltipNumber = ToKFunctions [_detalhes.tooltip.abbreviation] - TooltipMaximizedMethod = _detalhes.tooltip.maximize_method +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> constants + +local atributo_custom = _detalhes.atributo_custom + +local ToKFunctions = _detalhes.ToKFunctions +local SelectedToKFunction = ToKFunctions [1] +local FormatTooltipNumber = ToKFunctions [8] +local TooltipMaximizedMethod = 1 + +function atributo_custom:UpdateDamageDoneBracket() + SelectedToKFunction = ToKFunctions [_detalhes.ps_abbreviation] + FormatTooltipNumber = ToKFunctions [_detalhes.tooltip.abbreviation] + TooltipMaximizedMethod = _detalhes.tooltip.maximize_method +end + +local temp_table = {} + +local target_func = function (main_table) + local i = 1 + for name, amount in _pairs (main_table) do + local t = temp_table [i] + if (not t) then + t = {"", 0} + temp_table [i] = t + end + + t[1] = name + t[2] = amount + + i = i + 1 + end +end + +local spells_used_func = function (main_table, target) + local i = 1 + for spellid, spell_table in _pairs (main_table) do + local target_amount = spell_table.targets [target] + if (target_amount) then + local t = temp_table [i] + if (not t) then + t = {"", 0} + temp_table [i] = t + end + + t[1] = spellid + t[2] = target_amount + + i = i + 1 + end end +end + +local function SortOrder (main_table, func, ...) + for i = 1, #temp_table do + temp_table [i][1] = "" + temp_table [i][2] = 0 + end + + func (main_table, ...) + + _table_sort (temp_table, _detalhes.Sort2) + + return temp_table +end + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> damagedone tooltip + +function atributo_custom:damagedoneTooltip (actor, target, spellid, combat, instance) + + if (spellid) then + + if (instance:GetCustomObject():IsSpellTarget()) then + local targetname = actor.nome + local this_actor = combat (1, targetname) + + if (this_actor) then + for name, _ in _pairs (this_actor.damage_from) do + local aggressor = combat (1, name) + if (aggressor) then + local spell = aggressor.spells._ActorTable [spellid] + if (spell) then + local on_me = spell.targets [targetname] + if (on_me) then + GameCooltip:AddLine (aggressor.nome, FormatTooltipNumber (_, on_me)) + _detalhes:AddTooltipBackgroundStatusbar() + end + end + end + end + end + + return + else + local name, _, icon = _GetSpellInfo (spellid) + GameCooltip:AddLine (name) + GameCooltip:AddIcon (icon, 1, 1, 14, 14) + + GameCooltip:AddLine (Loc ["STRING_DAMAGE"] .. ": ", spell.total) + GameCooltip:AddLine (Loc ["STRING_HITS"] .. ": ", spell.counter) + GameCooltip:AddLine (Loc ["STRING_CRITICAL_HITS"] .. ": ", spell.c_amt) + end + + elseif (target) then + + if (target == "[all]") then + SortOrder (actor.targets, target_func) + + for i = 1, #temp_table do + local t = temp_table [i] + if (t[2] < 1) then + break + end + + GameCooltip:AddLine (t[1], FormatTooltipNumber (_, t[2])) + _detalhes:AddTooltipBackgroundStatusbar() + GameCooltip:AddIcon ([[Interface\FriendsFrame\StatusIcon-Offline]], 1, 1, 14, 14) + end + + elseif (target == "[raid]") then + local roster = combat.raid_roster + + SortOrder (actor.targets, target_func) + + for i = 1, #temp_table do + local t = temp_table [i] + + if (t[2] < 1) then + break + end + + if (roster [t[1]]) then + GameCooltip:AddLine (t[1], FormatTooltipNumber (_, t[2])) + _detalhes:AddTooltipBackgroundStatusbar() + end + end + + elseif (target == "[player]") then + local target_amount = actor.targets [_detalhes.playername] + if (target_amount) then + GameCooltip:AddLine (targetactor.nome, FormatTooltipNumber (_, target_amount)) + _detalhes:AddTooltipBackgroundStatusbar() + end + else + SortOrder (actor.spells._ActorTable, spells_used_func, target) + + for i = 1, #temp_table do + local t = temp_table [i] + + if (t[2] < 1) then + break + end + + local name, _, icon = _GetSpellInfo (t[1]) + GameCooltip:AddLine (name, FormatTooltipNumber (_, t[2])) + _detalhes:AddTooltipBackgroundStatusbar() + GameCooltip:AddIcon (icon, 1, 1, 14, 14) + end + + --for index, pet_name in ipairs (actor.pets) do + + --end + end + + else + actor:ToolTip_DamageDone (instance) + end +end + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> damagedone search + +function atributo_custom:damagedone (actor, source, target, spellid, combat, instance_container) + + if (spellid) then --> spell is always damagedone + local spell = actor.spells._ActorTable [spellid] + if (spell) then + if (target) then + if (target == "[all]") then + for target_name, amount in _pairs (spell.targets) do + --> add amount + + --> we need to pass a object here in order to get name and class, so we just get the main damage actor from the combat + instance_container:AddValue (combat (1, target_name), amount, true) + -- + atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + amount + --> add to processed container + if (not atributo_custom._TargetActorsProcessed [target_name]) then + atributo_custom._TargetActorsProcessed [target_name] = true + atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 + end + end + return 0, true + + elseif (target == "[raid]") then + local roster = combat.raid_roster + for target_name, amount in _pairs (spell.targets) do + if (roster [target_name]) then + --> add amount + instance_container:AddValue (combat (1, target_name), amount, true) + atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + amount + --> add to processed container + if (not atributo_custom._TargetActorsProcessed [target_name]) then + atributo_custom._TargetActorsProcessed [target_name] = true + atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 + end + end + end + return 0, true + + elseif (target == "[player]") then + local target_amount = spell.targets [_detalhes.playername] + if (target_amount) then + --> add amount + instance_container:AddValue (combat (1, _detalhes.playername), target_amount, true) + atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + target_amount + --> add to processed container + if (not atributo_custom._TargetActorsProcessed [_detalhes.playername]) then + atributo_custom._TargetActorsProcessed [_detalhes.playername] = true + atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 + end + end + return 0, true + + else + local target_amount = actor.targets [target] + if (target_amount) then + --> add amount + instance_container:AddValue (combat (1, target), target_amount, true) + atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + target_amount + --> add to processed container + if (not atributo_custom._TargetActorsProcessed [target]) then + atributo_custom._TargetActorsProcessed [target] = true + atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 + end + end + return 0, true + end + else + return spell.total + end + else + return 0 + end + + elseif (target) then + + if (target == "[all]") then + local total = 0 + for target_name, amount in _pairs (actor.targets) do + total = total + amount + end + return total + + elseif (target == "[raid]") then + local total = 0 + for target_name, amount in _pairs (actor.targets) do + if (combat.raid_roster [target_name]) then + total = total + amount + end + end + return total + + elseif (target == "[player]") then + return actor.targets [_detalhes.playername] or 0 + + else + return actor.targets [target] or 0 + + end + else + return actor.total or 0 + + end + +end + diff --git a/classes/custom_healingdone.lua b/classes/custom_healingdone.lua index 14aa3e9b0..d6010d67a 100644 --- a/classes/custom_healingdone.lua +++ b/classes/custom_healingdone.lua @@ -1,11 +1,306 @@ + + + + + local _detalhes = _G._detalhes local _ + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> local pointers + + local _cstr = string.format --lua local + local _math_floor = math.floor --lua local + local _table_sort = table.sort --lua local + local _table_insert = table.insert --lua local + local _table_size = table.getn --lua local + local _setmetatable = setmetatable --lua local + local _ipairs = ipairs --lua local + local _pairs = pairs --lua local + local _rawget= rawget --lua local + local _math_min = math.min --lua local + local _math_max = math.max --lua local + local _bit_band = bit.band --lua local + local _unpack = unpack --lua local + local _type = type --lua local + + local _GetSpellInfo = _detalhes.getspellinfo -- api local + local _IsInRaid = IsInRaid -- api local + local _IsInGroup = IsInGroup -- api local + local _GetNumGroupMembers = GetNumGroupMembers -- api local + local _GetNumPartyMembers = GetNumPartyMembers or GetNumSubgroupMembers -- api local + local _GetNumRaidMembers = GetNumRaidMembers or GetNumGroupMembers -- api local + local _GetUnitName = GetUnitName -- api local + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> constants local atributo_custom = _detalhes.atributo_custom + local ToKFunctions = _detalhes.ToKFunctions + local SelectedToKFunction = ToKFunctions [1] + local FormatTooltipNumber = ToKFunctions [8] + local TooltipMaximizedMethod = 1 function atributo_custom:UpdateHealingDoneBracket() SelectedToKFunction = ToKFunctions [_detalhes.ps_abbreviation] FormatTooltipNumber = ToKFunctions [_detalhes.tooltip.abbreviation] TooltipMaximizedMethod = _detalhes.tooltip.maximize_method - end \ No newline at end of file + end + + local temp_table = {} + + local target_func = function (main_table) + local i = 1 + for name, amount in _pairs (main_table) do + local t = temp_table [i] + if (not t) then + t = {"", 0} + temp_table [i] = t + end + + t[1] = name + t[2] = amount + + i = i + 1 + end + end + + local spells_used_func = function (main_table, target) + local i = 1 + for spellid, spell_table in _pairs (main_table) do + local target_amount = spell_table.targets [target] + if (target_amount) then + local t = temp_table [i] + if (not t) then + t = {"", 0} + temp_table [i] = t + end + + t[1] = spellid + t[2] = target_amount + + i = i + 1 + end + end + end + + local function SortOrder (main_table, func, ...) + for i = 1, #temp_table do + temp_table [i][1] = "" + temp_table [i][2] = 0 + end + + func (main_table, ...) + + _table_sort (temp_table, _detalhes.Sort2) + + return temp_table + end + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> healing done tooltip + + + function atributo_custom:healdoneTooltip (actor, target, spellid, combat, instance) + + if (spellid) then + + if (instance:GetCustomObject():IsSpellTarget()) then + local targetname = actor.nome + local this_actor = combat (2, targetname) + + if (this_actor) then + for name, _ in _pairs (this_actor.healing_from) do + local healer = combat (2, name) + if (healer) then + local spell = healer.spells._ActorTable [spellid] + if (spell) then + local on_me = spell.targets [targetname] + if (on_me) then + GameCooltip:AddLine (healer.nome, FormatTooltipNumber (_, on_me)) + end + end + end + end + end + + return + else + local name, _, icon = _GetSpellInfo (spellid) + GameCooltip:AddLine (name) + GameCooltip:AddIcon (icon, 1, 1, 14, 14) + + GameCooltip:AddLine (Loc ["STRING_HEAL"] .. ": ", spell.total) + GameCooltip:AddLine (Loc ["STRING_HITS"] .. ": ", spell.counter) + GameCooltip:AddLine (Loc ["STRING_CRITICAL_HITS"] .. ": ", spell.c_amt) + end + + elseif (target) then + + if (target == "[all]") then + SortOrder (actor.targets, target_func) + + for i = 1, #temp_table do + local t = temp_table [i] + if (t[2] < 1) then + break + end + + GameCooltip:AddLine (t[1], FormatTooltipNumber (_, t[2])) + _detalhes:AddTooltipBackgroundStatusbar() + GameCooltip:AddIcon ([[Interface\FriendsFrame\StatusIcon-Offline]], 1, 1, 14, 14) + end + + elseif (target == "[raid]") then + local roster = combat.raid_roster + + SortOrder (actor.targets, target_func) + + for i = 1, #temp_table do + local t = temp_table [i] + + if (t[2] < 1) then + break + end + + if (roster [t[1]]) then + GameCooltip:AddLine (t[1], FormatTooltipNumber (_, t[2])) + end + end + + elseif (target == "[player]") then + local target_amount = actor.targets [_detalhes.playername] + if (target_amount) then + GameCooltip:AddLine (targetactor.nome, FormatTooltipNumber (_, target_amount)) + end + + else + SortOrder (actor.spells._ActorTable, spells_used_func, target) + + for i = 1, #temp_table do + + local t = temp_table [i] + + if (t[2] < 1) then + break + end + + local name, _, icon = _GetSpellInfo (t[1]) + GameCooltip:AddLine (name, FormatTooltipNumber (_, t[2])) + GameCooltip:AddIcon (icon, 1, 1, 14, 14) + end + end + + else + actor:ToolTip_HealingDone (instance) + end + end + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> healing done search + + function atributo_custom:healdone (actor, source, target, spellid, combat, instance_container) + + if (spellid) then --> spell is always healing done + local spell = actor.spells._ActorTable [spellid] + local melee = actor.spells._ActorTable [1] + if (spell) then + if (target) then + if (target == "[all]") then + for target_name, amount in _pairs (spell.targets) do + --> add amount + + --> we need to pass a object here in order to get name and class, so we just get the main heal actor from the combat + instance_container:AddValue (combat (1, target_name), amount, true) + -- + atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + amount + --> add to processed container + if (not atributo_custom._TargetActorsProcessed [target_name]) then + atributo_custom._TargetActorsProcessed [target_name] = true + atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 + end + end + return 0, true + + elseif (target == "[raid]") then + local roster = combat.raid_roster + for target_name, amount in _pairs (spell.targets) do + if (roster [target_name]) then + --> add amount + instance_container:AddValue (combat (1, target_name), amount, true) + atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + amount + --> add to processed container + if (not atributo_custom._TargetActorsProcessed [target_name]) then + atributo_custom._TargetActorsProcessed [target_name] = true + atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 + end + end + end + return 0, true + + elseif (target == "[player]") then + local target_amount = spell.targets [_detalhes.playername] + if (target_amount) then + --> add amount + instance_container:AddValue (combat (1, _detalhes.playername), target_amount, true) + atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + target_amount + --> add to processed container + if (not atributo_custom._TargetActorsProcessed [_detalhes.playername]) then + atributo_custom._TargetActorsProcessed [_detalhes.playername] = true + atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 + end + end + return 0, true + + else + local target_amount = actor.targets [target] + if (target_amount) then + --> add amount + instance_container:AddValue (combat (1, target), target_amount, true) + atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + target_amount + --> add to processed container + if (not atributo_custom._TargetActorsProcessed [target]) then + atributo_custom._TargetActorsProcessed [target] = true + atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 + end + end + return 0, true + end + else + return spell.total + end + else + return 0 + end + + elseif (target) then + + if (target == "[all]") then + local total = 0 + for target_name, amount in _pairs (actor.targets) do + total = total + amount + end + return total + + elseif (target == "[raid]") then + local total = 0 + for target_name, amount in _pairs (actor.targets) do + if (combat.raid_roster [target_name]) then + total = total + amount + end + end + return total + + elseif (target == "[player]") then + return actor.targets [_detalhes.playername] or 0 + + else + return actor.targets [targetactor] or 0 + end + else + return actor.total or 0 + + end + + end diff --git a/frames/window_options2.lua b/frames/window_options2.lua index f177fef9c..413647a55 100644 --- a/frames/window_options2.lua +++ b/frames/window_options2.lua @@ -177,14 +177,16 @@ function Details.options.InitializeOptionsWindow(instance) _detalhes:StopTestBarUpdate() end end - local fillbars = DF:NewButton (f, _, "$parentCreateExampleBarsButton", nil, 120, 20, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1) - fillbars:SetPoint ("bottomleft", f.widget, "bottomleft", 41, 12) + local fillbars = DF:NewButton (f, _, "$parentCreateExampleBarsButton", nil, 140, 20, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1) + fillbars:SetPoint ("bottomleft", f.widget, "bottomleft", 10, 10) fillbars:SetTemplate(options_button_template) + fillbars:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {323/512, 365/512, 42/512, 78/512}, {1, 1, 1, 0.6}, 4, 2) --change log - local changelog = DF:NewButton (f, _, "$parentOpenChangeLogButton", nil, 120, 20, _detalhes.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1) + local changelog = DF:NewButton (f, _, "$parentOpenChangeLogButton", nil, 140, 20, _detalhes.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1) changelog:SetPoint ("left", fillbars, "right", 10, 0) changelog:SetTemplate (options_button_template) + changelog:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {367/512, 399/512, 43/512, 76/512}, {1, 1, 1, 0.8}, 4, 2) local sectionsName = { --section names [1] = Loc ["STRING_OPTIONSMENU_DISPLAY"], diff --git a/frames/window_options2_sections.lua b/frames/window_options2_sections.lua index a9ab30009..49eeaf114 100644 --- a/frames/window_options2_sections.lua +++ b/frames/window_options2_sections.lua @@ -575,6 +575,16 @@ do name = "Reset Nickname", desc = "Reset Nickname", }, + {--ignore nicknames + type = "toggle", + get = function() return _detalhes.ignore_nicktag end, + set = function (self, fixedparam, value) + _detalhes.ignore_nicktag = value + afterUpdate() + end, + name = Loc ["STRING_OPTIONS_IGNORENICKNAME"], + desc = Loc ["STRING_OPTIONS_IGNORENICKNAME_DESC"], + }, {type = "blank"},