# HG changeset patch # User Tercio # Date 1472684114 10800 # Node ID a960d5372b0cbcae5f856a10ae4fdad8fc14f569 # Parent 7944c081e5b4c37f9c09874eae73365a9aee017a - framework update from v22 to v44. diff -r 7944c081e5b4 -r a960d5372b0c Libs/DF/colors.lua --- a/Libs/DF/colors.lua Tue Jul 19 13:23:40 2016 -0300 +++ b/Libs/DF/colors.lua Wed Aug 31 19:55:14 2016 -0300 @@ -18,7 +18,8 @@ ["WARRIOR"] = {0.78, 0.61, 0.43}, ["DEATHKNIGHT"] = {0.77, 0.12, 0.23}, ["MONK"] = {0.0, 1.00, 0.59}, - + ["DEMONHUNTER"] = {0.64, 0.19, 0.79}, + ["aliceblue"] = {0.941176, 0.972549, 1, 1}, ["antiquewhite"] = {0.980392, 0.921569, 0.843137, 1}, ["aqua"] = {0, 1, 1, 1}, diff -r 7944c081e5b4 -r a960d5372b0c Libs/DF/cooltip.lua --- a/Libs/DF/cooltip.lua Tue Jul 19 13:23:40 2016 -0300 +++ b/Libs/DF/cooltip.lua Wed Aug 31 19:55:14 2016 -0300 @@ -156,6 +156,10 @@ frame1 = CreateFrame ("Frame", "GameCooltipFrame1", UIParent, "DFCooltipMainFrameTemplate") tinsert (UISpecialFrames, "GameCooltipFrame1") DF:CreateFlashAnimation (frame1) + + if (DF.CreateBorder) then + DF:CreateBorder (frame1, .3, .1, .03) + end else frame1 = GameCooltipFrame1 end @@ -174,11 +178,15 @@ tinsert (UISpecialFrames, "GameCooltipFrame2") DF:CreateFlashAnimation (frame2) frame2:SetClampedToScreen (true) + + if (DF.CreateBorder) then + DF:CreateBorder (frame2, .3, .1, .03) + end else frame2 = GameCooltipFrame2 end - frame2:SetPoint ("bottomleft", frame1, "bottomright") + frame2:SetPoint ("bottomleft", frame1, "bottomright", 4, 0) GameCooltipFrame2_FrameBackgroundCenter:SetTexture (DF.folder .. "cooltip_background") GameCooltipFrame2_FrameBackgroundCenter:SetTexCoord (0.10546875, 0.89453125, 0, 1) @@ -593,16 +601,16 @@ frame.selectedTop:ClearAllPoints() frame.selectedBottom:ClearAllPoints() - frame.selectedTop:SetPoint ("topleft", button, "topleft", left, top) -- - frame.selectedTop:SetPoint ("topright", button, "topright", right, top) -- + frame.selectedTop:SetPoint ("topleft", button, "topleft", left+1, top) -- + frame.selectedTop:SetPoint ("topright", button, "topright", right-1, top) -- - frame.selectedBottom:SetPoint ("bottomleft", button, "bottomleft", left, bottom) -- - frame.selectedBottom:SetPoint ("bottomright", button, "bottomright", right, bottom) -- + frame.selectedBottom:SetPoint ("bottomleft", button, "bottomleft", left+1, bottom) -- + frame.selectedBottom:SetPoint ("bottomright", button, "bottomright", right-1, bottom) -- CoolTip:ShowSelectedTexture (frame) end - local OnClickFunctionButtonPrincipal = function (self) + local OnClickFunctionButtonPrincipal = function (self, button) if (CoolTip.IndexesSub [self.index] and CoolTip.IndexesSub [self.index] > 0) then CoolTip:ShowSub (self.index) CoolTip.last_button = self.index @@ -619,18 +627,18 @@ if (CoolTip.FunctionsTableMain [self.index]) then local parameterTable = CoolTip.ParametersTableMain [self.index] - CoolTip.FunctionsTableMain [self.index] (_, CoolTip.FixedValue, parameterTable [1], parameterTable [2], parameterTable [3]) + CoolTip.FunctionsTableMain [self.index] (_, CoolTip.FixedValue, parameterTable [1], parameterTable [2], parameterTable [3], button) end end - local OnClickFunctionButtonSecundario = function (self) + local OnClickFunctionButtonSecundario = function (self, button) CoolTip.buttonClicked = true CoolTip:SetSelectedAnchor (frame2, self) if (CoolTip.FunctionsTableSub [self.mainIndex] and CoolTip.FunctionsTableSub [self.mainIndex] [self.index]) then local parameterTable = CoolTip.ParametersTableSub [self.mainIndex] [self.index] - CoolTip.FunctionsTableSub [self.mainIndex] [self.index] (_, CoolTip.FixedValue, parameterTable [1], parameterTable [2], parameterTable [3]) + CoolTip.FunctionsTableSub [self.mainIndex] [self.index] (_, CoolTip.FixedValue, parameterTable [1], parameterTable [2], parameterTable [3], button) end local botao_p = frame1.Lines [self.mainIndex] @@ -757,12 +765,6 @@ menuButton.rightText:SetWidth (0) end - if (CoolTip.OptionsTable.RightTextHeight) then - menuButton.rightText:SetHeight (CoolTip.OptionsTable.RightTextHeight) - else - menuButton.rightText:SetHeight (0) - end - if (CoolTip.OptionsTable.TextFont and not rightTextTable [7]) then if (_G [CoolTip.OptionsTable.TextFont]) then menuButton.rightText:SetFontObject (CoolTip.OptionsTable.TextFont) @@ -852,9 +854,18 @@ menuButton.rightIcon:SetHeight (CoolTip.OptionsTable.IconSize) end + menuButton.leftText:SetHeight (0) + menuButton.rightText:SetHeight (0) + if (CoolTip.Type == 2) then CoolTip:LeftTextSpace (menuButton) end + if (CoolTip.OptionsTable.LeftTextHeight) then + menuButton.leftText:SetHeight (CoolTip.OptionsTable.LeftTextHeight) + end + if (CoolTip.OptionsTable.RightTextHeight) then + menuButton.rightText:SetHeight (CoolTip.OptionsTable.RightTextHeight) + end --> string length if (not isSub) then --> main frame @@ -866,7 +877,7 @@ end end else - menuButton.leftText:SetWidth (CoolTip.OptionsTable.FixedWidth - menuButton.leftIcon:GetWidth() - menuButton.rightText:GetStringWidth() - menuButton.rightIcon:GetWidth() - 30) + menuButton.leftText:SetWidth (CoolTip.OptionsTable.FixedWidth - menuButton.leftIcon:GetWidth() - menuButton.rightText:GetStringWidth() - menuButton.rightIcon:GetWidth() - 22) end else if (not CoolTip.OptionsTable.FixedWidthSub) then @@ -877,7 +888,7 @@ end end else - menuButton.leftText:SetWidth (CoolTip.OptionsTable.FixedWidthSub - menuButton.leftIcon:GetWidth() - 20) + menuButton.leftText:SetWidth (CoolTip.OptionsTable.FixedWidthSub - menuButton.leftIcon:GetWidth() - 12) end end @@ -1011,15 +1022,14 @@ --> setup statusbar CoolTip:StatusBar (menuButton, CoolTip.StatusBarTableSub [mainMenuIndex] and CoolTip.StatusBarTableSub [mainMenuIndex] [index]) - --> click menuButton:RegisterForClicks ("LeftButtonDown") menuButton:ClearAllPoints() menuButton:SetPoint ("center", frame2, "center") menuButton:SetPoint ("top", frame2, "top", 0, (((index-1)*20)*-1)-3) - menuButton:SetPoint ("left", frame2, "left") - menuButton:SetPoint ("right", frame2, "right") + menuButton:SetPoint ("left", frame2, "left", -4, 0) + menuButton:SetPoint ("right", frame2, "right", 4, 0) DF:FadeFrame (menuButton, 0) @@ -1160,8 +1170,8 @@ menuButton:ClearAllPoints() menuButton:SetPoint ("center", frame2, "center") - menuButton:SetPoint ("left", frame2, "left") - menuButton:SetPoint ("right", frame2, "right") + menuButton:SetPoint ("left", frame2, "left", -4, 0) + menuButton:SetPoint ("right", frame2, "right", 4, 0) menuButton.rightText:SetText ("") @@ -1204,8 +1214,8 @@ if (CoolTip.OptionsTable.YSpacingModSub) then spacing = spacing + CoolTip.OptionsTable.YSpacingModSub end - menuButton:SetPoint ("left", frame2, "left") - menuButton:SetPoint ("right", frame2, "right") + menuButton:SetPoint ("left", frame2, "left", -4, 0) + menuButton:SetPoint ("right", frame2, "right", 4, 0) if (menuButton.divbar) then menuButton.divbar:Hide() @@ -1248,21 +1258,21 @@ local button = frame1.Lines [index] frame2:ClearAllPoints() - frame2:SetPoint ("left", button, "right") + frame2:SetPoint ("left", button, "right", 4, 0) elseif (CoolTip.OptionsTable.SubFollowButton and CoolTip.frame2_leftside) then local button = frame1.Lines [index] frame2:ClearAllPoints() - frame2:SetPoint ("right", button, "left") + frame2:SetPoint ("right", button, "left", -4, 0) elseif (CoolTip.frame2_leftside) then frame2:ClearAllPoints() - frame2:SetPoint ("bottomright", frame1, "bottomleft") + frame2:SetPoint ("bottomright", frame1, "bottomleft", -4, 0) else frame2:ClearAllPoints() - frame2:SetPoint ("bottomleft", frame1, "bottomright") + frame2:SetPoint ("bottomleft", frame1, "bottomright", 4, 0) end end @@ -1339,8 +1349,8 @@ menuButton:ClearAllPoints() menuButton:SetPoint ("center", frame1, "center") - menuButton:SetPoint ("left", frame1, "left") - menuButton:SetPoint ("right", frame1, "right") + menuButton:SetPoint ("left", frame1, "left", -4, 0) + menuButton:SetPoint ("right", frame1, "right", 4, 0) --> height if (CoolTip.OptionsTable.AlignAsBlizzTooltip) then @@ -1531,8 +1541,8 @@ menuButton:SetHeight (4) --> points menuButton:ClearAllPoints() - menuButton:SetPoint ("left", frame1, "left") - menuButton:SetPoint ("right", frame1, "right") + menuButton:SetPoint ("left", frame1, "left", -4, 0) + menuButton:SetPoint ("right", frame1, "right", 4, 0) menuButton:SetPoint ("center", frame1, "center") local div_size_up = tonumber (CoolTip.LeftTextTable [i] [2]) @@ -1574,8 +1584,8 @@ if (CoolTip.OptionsTable.YSpacingMod) then spacing = spacing + CoolTip.OptionsTable.YSpacingMod end - menuButton:SetPoint ("left", frame1, "left") - menuButton:SetPoint ("right", frame1, "right") + menuButton:SetPoint ("left", frame1, "left", -4, 0) + menuButton:SetPoint ("right", frame1, "right", 4, 0) if (menuButton.divbar) then menuButton.divbar:Hide() @@ -1711,7 +1721,7 @@ CoolTip.overlap_checked = true frame2:ClearAllPoints() - frame2:SetPoint ("bottomright", frame1, "bottomleft") + frame2:SetPoint ("bottomright", frame1, "bottomleft", 4, 0) CoolTip.frame2_leftside = true --> diff return CoolTip:SetMyPoint (host, CoolTip.internal_x_mod , CoolTip.internal_y_mod) @@ -1743,7 +1753,7 @@ local diff = f2_start_point - f1_end_point frame2:ClearAllPoints() - frame2:SetPoint ("bottomright", frame1, "bottomleft") + frame2:SetPoint ("bottomright", frame1, "bottomleft", 4, 0) CoolTip.frame2_leftside = true end @@ -1971,8 +1981,13 @@ function CoolTip:Reset() frame2:ClearAllPoints() - frame2:SetPoint ("bottomleft", frame1, "bottomright") - + frame2:SetPoint ("bottomleft", frame1, "bottomright", 4, 0) + + frame1:SetParent (UIParent) + frame2:SetParent (UIParent) + frame1:SetFrameStrata ("TOOLTIP") + frame2:SetFrameStrata ("TOOLTIP") + CoolTip:HideSelectedTexture (frame1) CoolTip:HideSelectedTexture (frame2) @@ -2846,6 +2861,11 @@ function CoolTip:ShowCooltip (frame, menuType, color) + frame1:SetFrameStrata ("TOOLTIP") + frame2:SetFrameStrata ("TOOLTIP") + frame1:SetParent (UIParent) + frame2:SetParent (UIParent) + CoolTip.had_interaction = false if (frame) then @@ -3066,10 +3086,10 @@ self:SetOption ("YSpacingMod", -4) self:SetOption ("IgnoreButtonAutoHeight", true) - --self:SetColor (1, 0.5, 0.5, 0.5, 0.5) 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) end end diff -r 7944c081e5b4 -r a960d5372b0c Libs/DF/cooltip.xml --- a/Libs/DF/cooltip.xml Tue Jul 19 13:23:40 2016 -0300 +++ b/Libs/DF/cooltip.xml Wed Aug 31 19:55:14 2016 -0300 @@ -69,8 +69,8 @@ - - + + diff -r 7944c081e5b4 -r a960d5372b0c Libs/DF/dropdown.lua --- a/Libs/DF/dropdown.lua Tue Jul 19 13:23:40 2016 -0300 +++ b/Libs/DF/dropdown.lua Wed Aug 31 19:55:14 2016 -0300 @@ -592,7 +592,8 @@ local name = button:GetName() .. "Row" .. i local parent = scrollChild - _this_row = CreateFrame ("Button", name, parent, "DetailsFrameworkDropDownOptionTemplate") + --_this_row = CreateFrame ("Button", name, parent, "DetailsFrameworkDropDownOptionTemplate") + _this_row = DF:CreateDropdownButton (parent, name) local anchor_i = i-1 _this_row:SetPoint ("topleft", parent, "topleft", 5, (-anchor_i*20)-5) _this_row:SetPoint ("topright", parent, "topright", -5, (-anchor_i*20)-5) @@ -600,6 +601,9 @@ object.menus [i] = _this_row end + _this_row:SetFrameStrata (_this_row:GetParent():GetFrameStrata()) + _this_row:SetFrameLevel (_this_row:GetParent():GetFrameLevel()+10) + _this_row.icon:SetTexture (_table.icon) if (_table.icon) then @@ -697,8 +701,8 @@ scrollFrame:SetWidth (frame_witdh+20) scrollChild:SetWidth (frame_witdh+20) --height - scrollBorder:SetHeight (size+20) - scrollFrame:SetHeight (size) + scrollBorder:SetHeight (size+2) + scrollFrame:SetHeight (size+2) scrollChild:SetHeight ((showing*20)+20) --mouse over texture mouseOverTexture:SetWidth (frame_witdh-7) @@ -718,8 +722,8 @@ scrollFrame:SetWidth (frame_witdh) scrollChild:SetWidth (frame_witdh) --height - scrollBorder:SetHeight ((showing*20) + 25) - scrollFrame:SetHeight ((showing*20) + 25) + scrollBorder:SetHeight ((showing*20) + 10) + scrollFrame:SetHeight ((showing*20) + 10) --mouse over texture mouseOverTexture:SetWidth (frame_witdh-10) --selected @@ -933,7 +937,9 @@ --> misc DropDownObject.container = container - DropDownObject.dropdown = CreateFrame ("Button", name, parent, "DetailsFrameworkDropDownTemplate") + --DropDownObject.dropdown = CreateFrame ("Button", name, parent, "DetailsFrameworkDropDownTemplate") + DropDownObject.dropdown = DF:CreateNewDropdownFrame (parent, name) + DropDownObject.widget = DropDownObject.dropdown DropDownObject.__it = {nil, nil} @@ -1022,4 +1028,135 @@ return DropDownObject -end \ No newline at end of file +end + +local default_backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], +edgeSize = 1, tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}} +local border_backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 0, right = 0, top = 0, bottom = 0}} +local child_backdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 256, insets = {left = 0, right = 0, top = 0, bottom = 0}} + +function DF:CreateNewDropdownFrame (parent, name) + local f = CreateFrame ("button", name, parent) + f:SetBackdrop (default_backdrop) + f:SetSize (150, 20) + + local statusbar = f:CreateTexture ("$parent_StatusBarTexture", "BACKGROUND") + statusbar:SetPoint ("topleft", f, "topleft", 3, -3) + statusbar:SetPoint ("bottomright", f, "bottomright", -3, 3) + f.statusbar = statusbar + + local icon = f:CreateTexture ("$parent_IconTexture", "ARTWORK") + icon:SetPoint ("left", f, "left", 2, 0) + icon:SetSize (20, 20) + icon:SetTexture ([[Interface\COMMON\UI-ModelControlPanel]]) + icon:SetTexCoord (0.625, 0.78125, 0.328125, 0.390625) + icon:SetVertexColor (1, 1, 1, 0.4) + f.icon = icon + + local text = f:CreateFontString ("$parent_Text", "ARTWORK", "GameFontHighlightSmall") + text:SetPoint ("left", icon, "right", 5, 0) + text:SetJustifyH ("left") + text:SetText ("no option selected") + text:SetTextColor (1, 1, 1, 0.4) + DF:SetFontSize (text, 10) + f.text = text + + local arrow = f:CreateTexture ("$parent_ArrowTexture2", "OVERLAY") + arrow:SetPoint ("right", f, "right", 5, -1) + arrow:SetBlendMode ("ADD") + arrow:SetTexture ([[Interface\Buttons\UI-ScrollBar-ScrollDownButton-Highlight]]) + arrow:Hide() + arrow:SetSize (32, 28) + f.arrowTexture2 = arrow + + local buttonTexture = f:CreateTexture ("$parent_ArrowTexture", "OVERLAY") + buttonTexture:SetPoint ("right", f, "right", 5, -1) + buttonTexture:SetTexture ([[Interface\Buttons\UI-ScrollBar-ScrollDownButton-Up]]) + buttonTexture:SetSize (32, 28) + f.arrowTexture = buttonTexture + + --scripts + f:SetScript ("OnSizeChanged", DetailsFrameworkDropDownOnSizeChanged) + f:SetScript ("OnMouseDown", DetailsFrameworkDropDownOnMouseDown) + + --on load + f:SetBackdropColor (1, 1, 1, .5) + f.arrowTexture:SetDrawLayer ("OVERLAY", 1) + f.arrowTexture2:SetDrawLayer ("OVERLAY", 2) + + --dropdown + local border = CreateFrame ("frame", "$Parent_Border", f) + border:Hide() + border:SetFrameStrata ("FULLSCREEN") + border:SetSize (150, 150) + border:SetPoint ("topleft", f, "bottomleft") + border:SetBackdrop (border_backdrop) + border:SetScript ("OnHide", DetailsFrameworkDropDownOptionsFrameOnHide) + border:SetBackdropColor (0, 0, 0, 0.92) + border:SetBackdropBorderColor (0, 0, 0, 1) + f.dropdownborder = border + + local scroll = CreateFrame ("ScrollFrame", "$Parent_ScrollFrame", f) + scroll:Hide() + scroll:SetFrameStrata ("FULLSCREEN") + scroll:SetSize (150, 150) + scroll:SetPoint ("topleft", f, "bottomleft", 0, 0) + f.dropdownframe = scroll + + local child = CreateFrame ("frame", "$Parent_ScrollChild", scroll) + child:SetSize (150, 150) + child:SetPoint ("topleft", scroll, "topleft", 0, 0) + child:SetBackdrop (child_backdrop) + child:SetBackdropColor (0, 0, 0, 1) + + local selected = child:CreateTexture ("$parent_SelectedTexture", "BACKGROUND") + selected:SetSize (150, 16) + selected:Hide() + selected:SetPoint ("left", child, "left", 2, 0) + selected:SetTexture ([[Interface\RAIDFRAME\Raid-Bar-Hp-Fill]]) + child.selected = selected + + local mouseover = child:CreateTexture ("$parent_MouseOverTexture", "ARTWORK") + mouseover:SetBlendMode ("ADD") + mouseover:Hide() + mouseover:SetTexture ([[Interface\Buttons\UI-Listbox-Highlight]]) + mouseover:SetSize (150, 15) + mouseover:SetPoint ("left", child, "left", 2, 0) + child.mouseover = mouseover + + scroll:SetScrollChild (child) + tinsert (UISpecialFrames, f.dropdownborder:GetName()) + tinsert (UISpecialFrames, f.dropdownframe:GetName()) + + return f +end + +function DF:CreateDropdownButton (parent, name) + + local f = CreateFrame ("button", name, parent) + f:SetSize (150, 20) + + local statusbar = f:CreateTexture ("$parent_StatusBarTexture", "ARTWORK") + statusbar:SetPoint ("left", f, "left", 1, 0) + statusbar:SetPoint ("right", f, "right", -10, 0) + statusbar:SetSize (150, 20) + f.statusbar = statusbar + + local icon = f:CreateTexture ("$parent_IconTexture", "OVERLAY") + icon:SetPoint ("left", f, "left", 2, 0) + icon:SetSize (20, 20) + icon:SetTexture ([[Interface\ICONS\Spell_ChargePositive]]) + f.icon = icon + + local text = f:CreateFontString ("$parent_Text", "OVERLAY", "GameFontHighlightSmall") + text:SetPoint ("left", icon, "right", 5, 0) + text:SetJustifyH ("left") + DF:SetFontSize (text, 10) + f.label = text + + f:SetScript ("OnMouseDown", DetailsFrameworkDropDownOptionClick) + f:SetScript ("OnEnter", DetailsFrameworkDropDownOptionOnEnter) + f:SetScript ("OnLeave", DetailsFrameworkDropDownOptionOnLeave) + + return f +end diff -r 7944c081e5b4 -r a960d5372b0c Libs/DF/dropdown.xml --- a/Libs/DF/dropdown.xml Tue Jul 19 13:23:40 2016 -0300 +++ b/Libs/DF/dropdown.xml Wed Aug 31 19:55:14 2016 -0300 @@ -79,13 +79,10 @@ - + - - - @@ -104,7 +101,7 @@