Advertisement
Guest User

Untitled

a guest
Jul 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.23 KB | None | 0 0
  1. local function UpdateMultiActionBar(frame, var, pageVar, cb)
  2. if (var and IsNormalActionBarState()) then
  3. frame:SetShown(true);
  4. VIEWABLE_ACTION_BAR_PAGES[pageVar] = nil;
  5. else
  6. frame:SetShown(false);
  7. VIEWABLE_ACTION_BAR_PAGES[pageVar] = 1;
  8. end
  9.  
  10. if (cb) then
  11. cb(var);
  12. end
  13. end
  14.  
  15. local function setupUIBars()
  16. MainMenuBarArtFrame.LeftEndCap:Hide();MainMenuBarArtFrame.RightEndCap:Hide()
  17.  
  18. MainMenuBarArtFrameBackground:Hide();
  19. MainMenuBarArtFrame.PageNumber:Hide();
  20. MicroButtonAndBagsBar.MicroBagBar:Hide();
  21. ActionBarUpButton:Hide()
  22. ActionBarDownButton:Hide()
  23. MultiBarBottomLeft:ClearAllPoints()
  24. MultiBarBottomLeft:SetScale(1)
  25. MultiBarBottomLeft:SetPoint("CENTER",1,85)
  26. MultiBarBottomLeft.SetPoint = function() end
  27. ActionButton1:ClearAllPoints()
  28. ActionButton1:SetScale(1)
  29. ActionButton1:SetPoint("CENTER",-230.625,45)
  30. ActionButton1.SetPoint = function() end
  31. MultiBarBottomRight:ClearAllPoints()
  32. MultiBarBottomRight:SetScale(1)
  33. MultiBarBottomRight:SetPoint("CENTER",-124,124)
  34. MultiBarBottomRight.SetPoint = function() end
  35. MultiBarBottomRightButton7:ClearAllPoints()
  36. MultiBarBottomRightButton7:SetPoint("RIGHT", "MultiBarBottomRight", "RIGHT", 38.5 , -1)
  37. MultiBarBottomRightButton7.SetPoint = function() end
  38. PetActionBarFrame:ClearAllPoints()
  39. PetActionBarFrame:SetScale(0.8)
  40. PetActionBarFrame:SetPoint("CENTER", -91.5, 12.5)
  41. PetActionBarFrame.SetPoint = function() end
  42.  
  43.  
  44.  
  45. CharacterBag3Slot:Hide()
  46. CharacterBag2Slot:Hide()
  47. CharacterBag1Slot:Hide()
  48. CharacterBag0Slot:Hide()
  49. MainMenuBarBackpackButton:ClearAllPoints()
  50. MainMenuBarBackpackButton:SetScale(0.88)
  51. MainMenuBarBackpackButton:SetPoint("RIGHT", "UIParent", -1, 255)
  52. MainMenuBarBackpackButton:Show()
  53.  
  54. StanceButton1:ClearAllPoints()
  55. StanceButton1:SetPoint("CENTER", "UIParent",-315,-330)
  56. StanceButton1:SetScale(0.75)
  57. StanceButton2:SetScale(0.75)
  58. StanceButton3:SetScale(0.75)
  59. StanceButton4:SetScale(0.75)
  60. StanceButton5:SetScale(0.75)
  61. StanceButton6:SetScale(0.75)
  62.  
  63.  
  64. CharacterMicroButton:ClearAllPoints()
  65. CharacterMicroButton:SetScale(0.85)
  66. CharacterMicroButton:SetPoint("BOTTOMLEFT","UIParent", -2, -8)
  67. EJMicroButton:ClearAllPoints()
  68. EJMicroButton:SetScale(0.85)
  69. EJMicroButton:SetPoint("BOTTOMLEFT","UIParent", 23, -8)
  70. SpellbookMicroButton:ClearAllPoints()
  71. SpellbookMicroButton:SetScale(0.85)
  72. SpellbookMicroButton:SetPoint("BOTTOMLEFT","UIParent", 48, -8)
  73. TalentMicroButton:ClearAllPoints()
  74. TalentMicroButton:SetScale(0.85)
  75. TalentMicroButton:SetPoint("BOTTOMLEFT","UIParent", 73, -8)
  76. GuildMicroButton:ClearAllPoints()
  77. GuildMicroButton:SetScale(0.85)
  78. GuildMicroButton:SetPoint("BOTTOMLEFT","UIParent", 98, -8)
  79. LFDMicroButton:ClearAllPoints()
  80. LFDMicroButton:SetScale(0.85)
  81. LFDMicroButton:SetPoint("BOTTOMLEFT","UIParent", 123, -8)
  82. MainMenuMicroButton:ClearAllPoints()
  83. MainMenuMicroButton:SetScale(0.85)
  84. MainMenuMicroButton:SetPoint("BOTTOMLEFT","UIParent", 148, -8)
  85. CollectionsMicroButton:ClearAllPoints()
  86. CollectionsMicroButton:SetScale(0.85)
  87. CollectionsMicroButton:SetPoint("BOTTOMLEFT","UIParent", 173, -8)
  88. AchievementMicroButton:ClearAllPoints()
  89. AchievementMicroButton:SetScale(0.85)
  90. AchievementMicroButton:SetPoint("BOTTOMLEFT","UIParent", 198, -8)
  91. QuestLogMicroButton:ClearAllPoints()
  92. QuestLogMicroButton:SetScale(0.85)
  93. QuestLogMicroButton:SetPoint("BOTTOMLEFT","UIParent", 223, -8)
  94. StoreMicroButton:ClearAllPoints()
  95. StoreMicroButton:SetScale(0.85)
  96. StoreMicroButton:SetPoint("BOTTOMLEFT","UIParent", 248, -8)
  97.  
  98.  
  99.  
  100. EJMicroButton:Show()
  101. CharacterMicroButton:Show()
  102. SpellbookMicroButton:Show()
  103. TalentMicroButton:Show()
  104. AchievementMicroButton:Show()
  105. QuestLogMicroButton:Show()
  106. GuildMicroButton:Show()
  107. MainMenuMicroButton:Show()
  108. StoreMicroButton:Show()
  109. LFDMicroButton:Show()
  110. CollectionsMicroButton:Show()
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117. end
  118.  
  119. setupUIBars()
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. local animationsCount, animations = 5, {}
  130. local animationNum = 1
  131. local frame, texture, alpha1, scale1, scale2, rotation2
  132. for i = 1, animationsCount do
  133. frame = CreateFrame("Frame")
  134. texture = frame:CreateTexture() texture:SetTexture('Interface\\Cooldown\\star4') texture:SetAlpha(0) texture:SetAllPoints() texture:SetBlendMode("ADD")
  135. animationGroup = texture:CreateAnimationGroup()
  136. alpha1 = animationGroup:CreateAnimation("Alpha") alpha1:SetFromAlpha(0) alpha1:SetToAlpha(1) alpha1:SetDuration(0) alpha1:SetOrder(1)
  137. scale1 = animationGroup:CreateAnimation("Scale") scale1:SetScale(1.0, 1.0) scale1:SetDuration(0) scale1:SetOrder(1)
  138. scale2 = animationGroup:CreateAnimation("Scale") scale2:SetScale(1.5, 1.5) scale2:SetDuration(0.3) scale2:SetOrder(2)
  139. rotation2 = animationGroup:CreateAnimation("Rotation") rotation2:SetDegrees(90) rotation2:SetDuration(0.3) rotation2:SetOrder(2)
  140. animations[i] = {frame = frame, animationGroup = animationGroup}
  141. end
  142. local AnimateButton = function(self)
  143. if not self:IsVisible() then return true end
  144. local animation = animations[animationNum]
  145. local frame = animation.frame
  146. local animationGroup = animation.animationGroup
  147. frame:SetFrameStrata("HIGH")
  148. frame:SetFrameLevel(20)
  149. frame:SetAllPoints(self)
  150. animationGroup:Stop()
  151. animationGroup:Play()
  152. animationNum = (animationNum % animationsCount) + 1
  153. return true
  154. end
  155.  
  156. hooksecurefunc('MultiActionButtonDown', function(bname, id)
  157. AnimateButton(_G[bname..'Button'..id])
  158. end)
  159.  
  160. hooksecurefunc('PetActionButtonDown', function(id)
  161. local button
  162. if PetActionBarFrame then
  163. if id > NUM_PET_ACTION_SLOTS then return end
  164. button = _G["PetActionButton"..id]
  165. if not button then return end
  166. end
  167. return
  168. AnimateButton(button)
  169. end)
  170.  
  171. hooksecurefunc('ActionButtonDown', function(id)
  172. local button
  173. if C_PetBattles.IsInBattle() then
  174. if PetBattleFrame then
  175. if id > NUM_BATTLE_PET_HOTKEYS then return end
  176. button = PetBattleFrame.BottomFrame.abilityButtons[id]
  177. if id == BATTLE_PET_ABILITY_SWITCH then
  178. button = PetBattleFrame.BottomFrame.SwitchPetButton;
  179. elseif id == BATTLE_PET_ABILITY_CATCH then
  180. button = PetBattleFrame.BottomFrame.CatchButton;
  181. end
  182. if not button then return end
  183. end
  184. return
  185. end
  186. if OverrideActionBar and OverrideActionBar:IsShown() then
  187. if id > NUM_OVERRIDE_BUTTONS then return end
  188. button = _G["OverrideActionBarButton"..id]
  189. else
  190. button = _G["ActionButton"..id]
  191. end
  192. if not button then return end
  193. AnimateButton(button)
  194. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement