Advertisement
Guest User

Untitled

a guest
Feb 11th, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.01 KB | None | 0 0
  1. local S,C,L = unpack(SanUI)
  2. S["UnitFrames"].Enable = function() return end
  3.  
  4.  
  5. local S,C,L = unpack(SanUI)
  6.  
  7. -- Minimap
  8. hooksecurefunc(S["Maps"]["Minimap"],"Enable",function()
  9. Minimap:ClearAllPoints()
  10. Minimap:SetPoint("TOPLEFT",UIParent,"TOPLEFT",5,-5)
  11. QueueStatusMinimapButton:ClearAllPoints()
  12. QueueStatusMinimapButton:Point("BOTTOMRIGHT",Minimap,"BOTTOMRIGHT")
  13. end)
  14.  
  15. hooksecurefunc(S["ActionBars"],"Enable",function()
  16.  
  17. local TukuiBar1 = S["Panels"].ActionBar1
  18. local TukuiBar2 = S["Panels"].ActionBar2
  19. local TukuiBar3 = S["Panels"].ActionBar3
  20. local TukuiBar4 = S["Panels"].ActionBar4
  21. local TukuiBar5 = S["Panels"].ActionBar5
  22.  
  23. -- Bars: Bar 1 will contain all main Buttons, Bar 2 is just moved on top of it, background made invisible,
  24. -- 3 and 4 must go, Bar 5 stays at the rigt, 6 & 7 anchor to it
  25.  
  26. TukuiBar1:ClearAllPoints()
  27. TukuiBar1:Point("BOTTOM", UIParent, "BOTTOM", 0, 3)
  28. TukuiBar1:SetWidth((C["ActionBars"].NormalButtonSize * 24) + (C["ActionBars"].ButtonSpacing * 27))
  29. RegisterStateDriver(TukuiBar1, "visibility", "[petbattle] hide; show")
  30.  
  31. -- Rearrange buttons of bar 2
  32. for i=1, 12 do
  33. local b = _G["MultiBarBottomLeftButton"..i]
  34. local b2 = _G["MultiBarBottomLeftButton"..i-1]
  35. b:Size(C["ActionBars"].NormalButtonSize, C["ActionBars"].NormalButtonSize)
  36. b:ClearAllPoints()
  37. b:SetFrameStrata("BACKGROUND")
  38. b:SetFrameLevel(15)
  39. b:ClearAllPoints()
  40.  
  41. if i == 1 then
  42. b:SetPoint("LEFT", TukuiBar1, "LEFT",(C["ActionBars"].NormalButtonSize*12)+(C["ActionBars"].ButtonSpacing*14), 0)
  43. else
  44. b:SetPoint("LEFT", b2, "RIGHT", C["ActionBars"].ButtonSpacing, 0)
  45. end
  46. end
  47.  
  48. MultiBarBottomLeft:SetParent(TukuiBar1)
  49.  
  50. RegisterStateDriver(TukuiBar2,"visibility","hide")
  51. --Here we put bar3 and bar4 above cooline, showing on mouseover
  52. TukuiBar3:ClearAllPoints()
  53. TukuiBar3:Point("BOTTOM", TukuiBar1, "TOP", 0, 2+C["ActionBars"].NormalButtonSize+C["ActionBars"].ButtonSpacing)
  54. TukuiBar3:SetWidth(C["ActionBars"].NormalButtonSize * 24 + C["ActionBars"].ButtonSpacing* 27)
  55. TukuiBar3:SetHeight(C["ActionBars"].NormalButtonSize + 2*C["ActionBars"].ButtonSpacing)
  56.  
  57. TukuiBar4:ClearAllPoints()
  58. TukuiBar4:SetAllPoints(TukuiBar3)
  59.  
  60. local function mOverBars(alpha)
  61. TukuiBar3:SetAlpha(alpha)
  62. TukuiBar4:SetAlpha(alpha)
  63. end
  64.  
  65. TukuiBar3:SetScript("OnEnter", function(self) mOverBars(1) end)
  66. TukuiBar3:SetScript("OnLeave", function(self) mOverBars(0) end)
  67.  
  68. -- Rearrange buttons of bar 3
  69. for i=1, 12 do
  70. local b = _G["MultiBarBottomRightButton"..i]
  71. local b2 = _G["MultiBarBottomRightButton"..i-1]
  72. b:Size(C["ActionBars"].NormalButtonSize,C["ActionBars"].NormalButtonSize)
  73. b:ClearAllPoints()
  74. b:SetFrameStrata("BACKGROUND")
  75. b:SetFrameLevel(15)
  76. b:ClearAllPoints()
  77.  
  78. if i == 1 then
  79. b:SetPoint("LEFT", TukuiBar3, "LEFT",4, 0)
  80. else
  81. b:SetPoint("LEFT", b2, "RIGHT", C["ActionBars"].ButtonSpacing, 0)
  82. end
  83.  
  84. b:SetScript("OnEnter", function(self) mOverBars(1) end)
  85. b:SetScript("OnLeave", function(self) mOverBars(0) end)
  86. end
  87.  
  88.  
  89. -- Rearrange buttons of bar 4
  90. for i=1, 12 do
  91. local b = _G["MultiBarRightButton"..i]
  92. local b2 = _G["MultiBarRightButton"..i-1]
  93. b:Size(C["ActionBars"].NormalButtonSize,C["ActionBars"].NormalButtonSize)
  94. b:ClearAllPoints()
  95. b:SetFrameStrata("BACKGROUND")
  96. b:SetFrameLevel(15)
  97. b:ClearAllPoints()
  98.  
  99. if i == 1 then
  100. b:SetPoint("LEFT", TukuiBar4, "LEFT",(C["ActionBars"].NormalButtonSize*12)+(C["ActionBars"].ButtonSpacing*14), 0)
  101. else
  102. b:SetPoint("LEFT", b2, "RIGHT", C["ActionBars"].ButtonSpacing, 0)
  103. end
  104.  
  105. b:SetScript("OnEnter", function(self) mOverBars(1) end)
  106. b:SetScript("OnLeave", function(self) mOverBars(0) end)
  107. end
  108.  
  109. mOverBars(0)
  110.  
  111. TukuiBar5:SetPoint("RIGHT", UIParent, "RIGHT", -5, -14)
  112. TukuiBar5:SetHeight((C["ActionBars"].NormalButtonSize*12)+(C["ActionBars"].ButtonSpacing*14))
  113.  
  114. S["Panels"].BottomLine:ClearAllPoints()
  115. S["Panels"].BottomLine:Point("BOTTOMLEFT",UIParent,10,20)
  116. S["Panels"].BottomLine:Point("BOTTOMRIGHT",UIParent,-10,20)
  117.  
  118. S.Panels["ActionBar" .. 2 .. "ToggleButton"]:Kill()
  119. S.Panels["ActionBar" .. 3 .. "ToggleButton"]:Kill()
  120. end)
  121.  
  122. S["ActionBars"].AddHooks = function(self)
  123. hooksecurefunc("ActionButton_Update", self.SkinButton)
  124. hooksecurefunc("ActionButton_UpdateFlyout", self.StyleFlyout)
  125. hooksecurefunc("SpellButton_OnClick", self.StyleFlyout)
  126. --hooksecurefunc("ActionButton_ShowOverlayGlow", self.StartButtonHighlight)
  127. --hooksecurefunc("ActionButton_HideOverlayGlow", self.StopButtonHighlight)
  128. hooksecurefunc("ActionButton_UpdateHotkeys", self.UpdateHotKey)
  129. hooksecurefunc(ExtraActionButton1.style, "SetTexture", self.DisableExtraButtonTexture)
  130. hooksecurefunc("PetActionButton_SetHotkeys", self.UpdateHotKey)
  131. end
  132.  
  133. --ChatFrame 4 is where skada resides, so we move it to the left
  134. local ChangeDefaultChatPosition = function(frame)
  135.  
  136. if frame then
  137.  
  138. local id = frame:GetID()
  139. local name = FCF_GetChatWindowInfo(id)
  140.  
  141. if id == 4 and name == LOOT then
  142. if not frame.isDocked then
  143. if frame.isLocked then FCF_SetLocked(frame, 0) else print("NOT LOCKED") end
  144. frame:ClearAllPoints()
  145. frame:Point("BOTTOMLEFT", TukuiInfoLeft, "TOPLEFT", 0, 6)
  146. frame:SetJustifyH("LEFT")
  147. FCF_DockFrame(ChatFrame4)
  148. end
  149. end
  150. end
  151. end
  152. hooksecurefunc("FCF_RestorePositionAndDimensions", ChangeDefaultChatPosition)
  153.  
  154. -- put a 'c' on cubeleft, since clicking on it opens the chat menu
  155. hooksecurefunc(S["Panels"],"Enable",function()
  156. local cubeleft = S.Panels["CubeLeft"]
  157.  
  158. if cubeleft then
  159. local Text = cubeleft:CreateFontString(nil, "OVERLAY")
  160. Text:SetFont(C.Medias.Font, 10)
  161. Text:SetText("c")
  162. Text:SetJustifyH("CENTER")
  163. Text:SetJustifyV("MIDDLE")
  164. Text:Point("CENTER",cubeleft)
  165. Text:Show()
  166.  
  167. cubeleft.text = Text
  168. end
  169. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement