Added options to not show while in Battlegrounds

This commit is contained in:
Tercio Jose
2020-05-23 12:43:44 -03:00
parent 8350ea2054
commit 7a2d7ee6dd
4 changed files with 163 additions and 26 deletions
+50 -14
View File
@@ -510,7 +510,7 @@ end
function DropDownMetaFunctions:Open()
self.dropdown.dropdownframe:Show()
self.dropdown.dropdownborder:Show()
self.dropdown.arrowTexture:SetTexture ("Interface\\Buttons\\UI-ScrollBar-ScrollDownButton-Down")
--self.dropdown.arrowTexture:SetTexture ("Interface\\Buttons\\UI-ScrollBar-ScrollDownButton-Down")
self.opened = true
if (last_opened) then
last_opened:Close()
@@ -525,7 +525,7 @@ function DropDownMetaFunctions:Close()
return
end
self.dropdown.dropdownframe:Hide()
self.dropdown.arrowTexture:SetTexture ("Interface\\Buttons\\UI-ScrollBar-ScrollDownButton-Up")
--self.dropdown.arrowTexture:SetTexture ("Interface\\Buttons\\UI-ScrollBar-ScrollDownButton-Up")
local selectedTexture = _G [self:GetName() .. "_ScrollFrame_ScrollChild_SelectedTexture"]
selectedTexture:Hide()
@@ -614,8 +614,8 @@ function DetailsFrameworkDropDownOnMouseDown (button)
_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)
_this_row:SetPoint ("topleft", parent, "topleft", 1, (-anchor_i*20)-0)
_this_row:SetPoint ("topright", parent, "topright", 0, (-anchor_i*20)-0)
_this_row.object = object
object.menus [i] = _this_row
end
@@ -730,7 +730,7 @@ function DetailsFrameworkDropDownOnMouseDown (button)
object:ShowScroll()
scrollFrame:EnableMouseWheel (true)
object.scroll:Altura (size-35)
object.scroll:SetMinMaxValues (0, (showing*20) - size + 20)
object.scroll:SetMinMaxValues (0, (showing*20) - size + 2)
--width
scrollBorder:SetWidth (frame_witdh+20)
scrollFrame:SetWidth (frame_witdh+20)
@@ -757,12 +757,12 @@ function DetailsFrameworkDropDownOnMouseDown (button)
scrollFrame:SetWidth (frame_witdh)
scrollChild:SetWidth (frame_witdh)
--height
scrollBorder:SetHeight ((showing*20) + 10)
scrollFrame:SetHeight ((showing*20) + 10)
scrollBorder:SetHeight ((showing*20) + 1)
scrollFrame:SetHeight ((showing*20) + 1)
--mouse over texture
mouseOverTexture:SetWidth (frame_witdh-10)
mouseOverTexture:SetWidth (frame_witdh - 1)
--selected
selectedTexture:SetWidth (frame_witdh - 9)
selectedTexture:SetWidth (frame_witdh - 1)
for index, row in ipairs (object.menus) do
row:SetPoint ("topright", scrollChild, "topright", -5, ((-index-1)*20)-5)
@@ -883,6 +883,8 @@ end
------------------------------------------------------------------------------------------------------------
function DropDownMetaFunctions:SetTemplate (template)
self.template = template
if (template.width) then
self:SetWidth (template.width)
end
@@ -923,7 +925,41 @@ function DropDownMetaFunctions:SetTemplate (template)
local r, g, b, a = DF:ParseColors (template.onleavebordercolor)
self.onleave_backdrop_border_color = {r, g, b, a}
end
self:RefreshDropIcon()
end
function DropDownMetaFunctions:RefreshDropIcon()
local template = self.template
if (not template) then
return
end
if (template.dropicon) then
self.dropdown.arrowTexture:SetTexture(template.dropicon)
self.dropdown.arrowTexture2:SetTexture(template.dropicon)
if (template.dropiconsize) then
self.dropdown.arrowTexture:SetSize(unpack(template.dropiconsize))
self.dropdown.arrowTexture2:SetSize(unpack(template.dropiconsize))
end
if (template.dropiconcoords) then
self.dropdown.arrowTexture:SetTexCoord(unpack(template.dropiconcoords))
else
self.dropdown.arrowTexture:SetTexCoord(0, 1, 0, 1)
end
if (template.dropiconpoints) then
self.dropdown.arrowTexture:ClearAllPoints()
self.dropdown.arrowTexture2:ClearAllPoints()
self.dropdown.arrowTexture:SetPoint("right", self.dropdown, "right", unpack(template.dropiconpoints))
self.dropdown.arrowTexture2:SetPoint("right", self.dropdown, "right", unpack(template.dropiconpoints))
end
end
end
------------------------------------------------------------------------------------------------------------
@@ -1074,8 +1110,8 @@ function DF:CreateNewDropdownFrame (parent, name)
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)
statusbar:SetPoint ("topleft", f, "topleft", 0, 0)
statusbar:SetPoint ("bottomright", f, "bottomright", 0, 0)
f.statusbar = statusbar
local icon = f:CreateTexture ("$parent_IconTexture", "ARTWORK")
@@ -1172,8 +1208,8 @@ function DF:CreateDropdownButton (parent, name)
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:SetPoint ("topleft", f, "topleft", 0, 0)
statusbar:SetPoint ("bottomright", f, "bottomright", 0, 0)
statusbar:SetSize (150, 20)
statusbar:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]])
f.statusbar = statusbar