Advertisement
Aldarana

BigWigs Profile

Jan 15th, 2018
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. do
  2. -- AldaranaUI
  3. local E = AldaranaUI and AldaranaUI[1]
  4. local backdropBorder = {
  5. bgFile = "Interface\\Buttons\\WHITE8X8",
  6. edgeFile = "Interface\\AddOns\\Redtuzk's Pixelborder\\Pixelborder",
  7. tile = false, tileSize = 0, edgeSize = .5,
  8. insets = {left = 0, right = 0, top = 0, bottom = 0}
  9. }
  10.  
  11. local function removeStyle(bar)
  12. bar:SetHeight(14)
  13.  
  14. local bd = bar.candyBarBackdrop
  15. bd:Hide()
  16. if bd.iborder then
  17. bd.iborder:Hide()
  18. bd.oborder:Hide()
  19. end
  20.  
  21. local tex = bar:Get("bigwigs:restoreicon")
  22. if tex then
  23. local icon = bar.candyBarIconFrame
  24. icon:ClearAllPoints()
  25. icon:SetPoint("TOPLEFT")
  26. icon:SetPoint("BOTTOMLEFT")
  27. bar:SetIcon(tex)
  28.  
  29. local iconBd = bar.candyBarIconFrameBackdrop
  30. iconBd:Hide()
  31. if iconBd.iborder then
  32. iconBd.iborder:Hide()
  33. iconBd.oborder:Hide()
  34. end
  35. end
  36. end
  37.  
  38. local function styleBar(bar)
  39. bar:SetHeight(20)
  40.  
  41. local bd = bar.candyBarBackdrop
  42.  
  43. if E then
  44. bd:SetTemplate("Transparent")
  45. bd:SetOutside(bar)
  46. if not E.PixelMode and bd.iborder then
  47. bd.iborder:Show()
  48. bd.oborder:Show()
  49. end
  50. else
  51. bd:SetBackdrop(backdropBorder)
  52. bd:SetBackdropColor(0, 0, 0, 1)
  53. bd:SetBackdropBorderColor(0, 0, 0)
  54.  
  55. bd:ClearAllPoints()
  56. bd:SetPoint("TOPLEFT", bar, "TOPLEFT", -1, 1)
  57. bd:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", 1, -1)
  58. end
  59.  
  60. if plugin.db.profile.icon then
  61. local icon = bar.candyBarIconFrame
  62. local tex = icon.icon
  63. bar:SetIcon(nil)
  64. icon:SetTexture(tex)
  65. icon:ClearAllPoints()
  66. icon:SetPoint("BOTTOMRIGHT", bar, "BOTTOMLEFT", E and (E.PixelMode and -1 or -5) or -1, 0)
  67. icon:SetSize(20, 20)
  68. bar:Set("bigwigs:restoreicon", tex)
  69.  
  70. local iconBd = bar.candyBarIconFrameBackdrop
  71.  
  72. if E then
  73. iconBd:SetTemplate("Transparent")
  74. iconBd:SetOutside(bar.candyBarIconFrame)
  75. if not E.PixelMode and iconBd.iborder then
  76. iconBd.iborder:Show()
  77. iconBd.oborder:Show()
  78. end
  79. else
  80. iconBd:SetBackdrop(backdropBorder)
  81. iconBd:SetBackdropColor(0, 0, 0, 1)
  82. iconBd:SetBackdropBorderColor(0, 0, 0)
  83.  
  84. iconBd:ClearAllPoints()
  85. iconBd:SetPoint("TOPLEFT", icon, "TOPLEFT", -1, 1)
  86. iconBd:SetPoint("BOTTOMRIGHT", icon, "BOTTOMRIGHT", 1, -1)
  87. end
  88. iconBd:Show()
  89. end
  90.  
  91. bd:Show()
  92. end
  93.  
  94. barStyles.AldaranaUI = {
  95. apiVersion = 1,
  96. version = 2,
  97. GetSpacing = function() return E and (E.PixelMode and 3 or 3) or 3 end,
  98. ApplyStyle = styleBar,
  99. BarStopped = removeStyle,
  100. GetStyleName = function() return "AldaranaUI" end,
  101. }
  102. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement