Advertisement
Guest User

actionbars.lua

a guest
Jul 18th, 2012
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.42 KB | None | 0 0
  1.  
  2. -- CONFIGURATION ----------------------------------
  3.  
  4.  
  5. local show_all_bags = false
  6.  
  7.  
  8. -- END OF CONFIG ----------------------------------
  9.  
  10.  
  11.  
  12.  
  13. local level = UnitLevel("player")
  14.  
  15.  
  16. -- ACTIONBARS -------------------------------------
  17. ---------------------------------------------------
  18.  
  19. UIPARENT_MANAGED_FRAME_POSITIONS['MultiBarBottomRight'] = nil
  20. UIPARENT_MANAGED_FRAME_POSITIONS['MultiBarRight'] = nil
  21. UIPARENT_MANAGED_FRAME_POSITIONS['MultiBarLeft'] = nil
  22. UIPARENT_MANAGED_FRAME_POSITIONS['ContainerFrame1'] = nil
  23. UIPARENT_MANAGED_FRAME_POSITIONS['ContainerFrame2'] = nil
  24. UIPARENT_MANAGED_FRAME_POSITIONS['ContainerFrame3'] = nil
  25. UIPARENT_MANAGED_FRAME_POSITIONS['ContainerFrame4'] = nil
  26. UIPARENT_MANAGED_FRAME_POSITIONS['ContainerFrame5'] = nil
  27.  
  28.  
  29. -- Hide textures
  30. for _, texture in ipairs({
  31.  
  32.  
  33.     -- End caps
  34.     MainMenuBarLeftEndCap,
  35.     MainMenuBarRightEndCap,
  36.  
  37.  
  38.     -- Pet actionbar
  39.     SlidingActionBarTexture0,
  40.     SlidingActionBarTexture1,
  41.  
  42.  
  43.     -- Shapeshift bar
  44.     ShapeshiftBarLeft,
  45.     ShapeshiftBarRight,
  46.     ShapeshiftBarMiddle,
  47.  
  48.  
  49.     -- Experience bar
  50.     MainMenuXPBarTextureLeftCap,
  51.     MainMenuXPBarTextureMid,
  52.     MainMenuXPBarTextureRightCap,
  53.  
  54.  
  55.     -- Experience bar, max level
  56.     MainMenuMaxLevelBar0,
  57.     MainMenuMaxLevelBar1,
  58.     MainMenuMaxLevelBar2,
  59.     MainMenuMaxLevelBar3,
  60.  
  61.  
  62.     -- Reputation bar
  63.     ReputationWatchBarTexture0,
  64.     ReputationWatchBarTexture1,
  65.     ReputationWatchBarTexture2,
  66.     ReputationWatchBarTexture3,
  67.  
  68.  
  69.     -- Reputation bar, max level
  70.     ReputationXPBarTexture0,
  71.     ReputationXPBarTexture1,
  72.     ReputationXPBarTexture2,
  73.     ReputationXPBarTexture3,
  74.  
  75.  
  76.     -- Experience bar, divs
  77.     MainMenuXPBarDiv1,
  78.     MainMenuXPBarDiv2,
  79.     MainMenuXPBarDiv3,
  80.     MainMenuXPBarDiv4,
  81.     MainMenuXPBarDiv5,
  82.     MainMenuXPBarDiv6,
  83.     MainMenuXPBarDiv7,
  84.     MainMenuXPBarDiv8,
  85.     MainMenuXPBarDiv9,
  86.     MainMenuXPBarDiv10,
  87.     MainMenuXPBarDiv11,
  88.     MainMenuXPBarDiv12,
  89.     MainMenuXPBarDiv13,
  90.     MainMenuXPBarDiv14,
  91.     MainMenuXPBarDiv15,
  92.     MainMenuXPBarDiv16,
  93.     MainMenuXPBarDiv17,
  94.     MainMenuXPBarDiv18,
  95.     MainMenuXPBarDiv19,
  96.  
  97.     }) do
  98.     texture:SetTexture(nil)
  99. end
  100.  
  101.  
  102. -- Hide frames
  103. for _, frame in ipairs({
  104.  
  105.  
  106.     -- Boncus action bar
  107.     BonusActionBarFrameTexture1,
  108.     BonusActionBarFrameTexture2,
  109.     BonusActionBarFrameTexture3,
  110.     BonusActionBarFrameTexture4,
  111.  
  112.  
  113.     -- Main menu bar
  114.     MainMenuBarTexture0,
  115.     MainMenuBarTexture1,
  116.     MainMenuBarTexture2,
  117.     MainMenuBarTexture3,
  118.  
  119.  
  120.     -- Exhaustion tick
  121.     ExhaustionTick,
  122.  
  123.     }) do
  124.     frame:SetAlpha(0)
  125. end
  126.  
  127.  
  128. -- Move "bottom right" actionbar
  129. MultiBarBottomRight:ClearAllPoints()
  130. MultiBarBottomRight:SetPoint("BOTTOM", 250, 4)
  131.  
  132.  
  133. -- Move "multibar right" and make it horizontal
  134. for i=1,12 do
  135.     _G["MultiBarRightButton"..i]:ClearAllPoints()
  136.     _G["MultiBarRightButton"..i]:SetPoint("BOTTOM", MultiBarBottomLeft, "BOTTOM", 230+i*42, 0)
  137. end
  138.  
  139.  
  140. -- Move "multibar left" to replace "multibar right"
  141. MultiBarLeft:ClearAllPoints()
  142. MultiBarLeft:SetPoint("RIGHT", UIParent, "RIGHT", 0, -50)
  143.  
  144.  
  145. -- Move main actionbar paging buttons
  146. ActionBarUpButton:SetPoint("LEFT", -22, 5)
  147. ActionBarDownButton:SetPoint("LEFT", -22, -14)
  148. MainMenuBarPageNumber:SetPoint("TOP", ActionBarUpButton, "TOP", 0, 8)
  149. ActionBarDownButton:SetParent(ActionBarUpButton)    -- For mouseover
  150. MainMenuBarPageNumber:SetParent(ActionBarUpButton)  -- For mouseover
  151.  
  152.  
  153. -- Vehicle bar
  154. VehicleMenuBar:SetScale(0.85)
  155. VehicleMenuBarArtFrame:Hide()
  156.  
  157.  
  158. -- Move XP and reputation bars
  159. local xpBarsFix = CreateFrame("Frame")
  160.  
  161. xpBarsFix:SetScript("OnEvent", function(xpBarsFix, event, addon)
  162.     if level == 85 then
  163.         ReputationWatchBar:SetParent(MainMenuBar)
  164.         ReputationWatchBar:SetPoint("TOPLEFT", MainMenuBar, "TOPLEFT", 6, 3)
  165.         ReputationWatchBar.SetPoint = function() end
  166.         ReputationWatchBar:SetScale(0.982)
  167.     else
  168.         MainMenuExpBar:SetParent(MainMenuBar)
  169.         MainMenuExpBar:SetPoint("TOPLEFT", MainMenuBar, "TOPLEFT", 6, 2)
  170.         MainMenuExpBar:SetWidth(1005)
  171.         ReputationWatchBar:SetParent(MainMenuBar)
  172.         ReputationWatchBar:SetPoint("TOPLEFT", MainMenuBar, "TOPLEFT", 6, 10)
  173.         ReputationWatchBar.SetPoint = function() end
  174.         ReputationWatchBar:SetScale(0.982)
  175.     end
  176. end)
  177.  
  178. xpBarsFix:RegisterEvent("PLAYER_ENTERING_WORLD")
  179. xpBarsFix:RegisterEvent("PLAYER_LEVEL_UP")
  180. xpBarsFix:RegisterEvent("PLAYER_XP_UPDATE")
  181. xpBarsFix:RegisterEvent("PLAYER_TALENT_UPDATE")
  182. xpBarsFix:RegisterEvent("UNIT_EXITED_VEHICLE")
  183.  
  184.  
  185. -- Fix for Blizzards disappearing action button textures >_>
  186. hooksecurefunc("ActionButton_ShowGrid", function(btn)
  187.     _G[btn:GetName().."NormalTexture"]:SetVertexColor(1, 1, 1, 1)
  188. end)
  189.  
  190.  
  191.  
  192.  
  193. -- BAGS -------------------------------------------
  194. ---------------------------------------------------
  195.  
  196. -- Create holder frame to prevent glitchy mouseover
  197. local BagHolder = CreateFrame("Frame", "BagHolder", UIParent)
  198. BagHolder:SetHeight(35)
  199. BagHolder:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0)
  200.  
  201.  
  202. -- Show all bags
  203. if show_all_bags then
  204.     BagHolder:SetWidth(160)
  205.     MainMenuBarBackpackButton:ClearAllPoints()
  206.     MainMenuBarBackpackButton:SetPoint("BOTTOMRIGHT", BagHolder, "BOTTOMRIGHT", -4, 4)
  207.     MainMenuBarBackpackButton:SetScale(0.7)
  208.     MainMenuBarBackpackButton:SetParent(BagHolder)
  209.     KeyRingButton:SetParent(BagHolder)
  210.     KeyRingButton:SetScale(0.7)
  211.  
  212.     for i=0,3 do
  213.         _G["CharacterBag"..i.."Slot"]:SetParent(BagHolder)
  214.         _G["CharacterBag"..i.."Slot"]:SetScale(0.8)
  215.     end
  216. end
  217.  
  218.  
  219. -- Show only backpack
  220. if not show_all_bags then
  221.     BagHolder:SetWidth(50)
  222.     MainMenuBarBackpackButton:ClearAllPoints()
  223.     MainMenuBarBackpackButton:SetPoint("BOTTOMRIGHT", BagHolder, "BOTTOMRIGHT", -4, 4)
  224.     MainMenuBarBackpackButton:SetScale(0.7)
  225.     MainMenuBarBackpackButton:SetParent(BagHolder)
  226.  
  227.     for i=0,3 do
  228.         _G["CharacterBag"..i.."Slot"]:Hide()
  229.     end
  230.  
  231.     -- Open all bags when clicking on the backpack
  232.     MainMenuBarBackpackButton:SetScript("OnClick", function(self)
  233.         OpenAllBags()
  234.     end)
  235. end
  236.  
  237.  
  238. -- Scale bag container frames
  239. for i=1,6 do
  240.     _G["ContainerFrame"..i]:SetScale(0.9)
  241.     _G["ContainerFrame"..i].SetScale = function() end
  242. end
  243.  
  244.  
  245.  
  246.  
  247. -- MICRO MENU -------------------------------------
  248. -- Credit: Roth -----------------------------------
  249.  
  250. -- Holder frame
  251. local fmicro = CreateFrame("Frame", "MicroMenuHolder", MinimapCluster)
  252. fmicro:SetWidth(255)
  253. fmicro:SetHeight(40)
  254. fmicro:SetPoint("BOTTOM", Minimap, -2, -58)
  255. fmicro:SetScale(0.7)
  256.  
  257.  
  258. -- Move the micro menu
  259. local MicroButtons = {
  260.     CharacterMicroButton,
  261.     SpellbookMicroButton,
  262.     TalentMicroButton,
  263.     AchievementMicroButton,
  264.     QuestLogMicroButton,
  265.     GuildMicroButton,
  266.     PVPMicroButton,
  267.     LFDMicroButton,
  268.     MainMenuMicroButton,
  269.     HelpMicroButton,
  270. }
  271.  
  272. local function MoveMicroMenu()
  273.     for _, f in pairs(MicroButtons) do
  274.         f:SetParent(fmicro)
  275.     end
  276.     CharacterMicroButton:ClearAllPoints()
  277.     CharacterMicroButton:SetPoint("BOTTOMLEFT", 2, 2)
  278.     GuildMicroButton:ClearAllPoints()
  279.     GuildMicroButton:SetPoint("BOTTOMRIGHT", QuestLogMicroButton, 24, 0)
  280. end
  281.  
  282.  
  283. -- Hook into Blizzard functions to keep my frame position when entering a vehicle
  284. hooksecurefunc("VehicleMenuBar_MoveMicroButtons", MoveMicroMenu)
  285. MoveMicroMenu()
  286.  
  287.  
  288.  
  289.  
  290. -- MINIMAP ----------------------------------------
  291. ---------------------------------------------------
  292.  
  293. MinimapCluster:ClearAllPoints()
  294. MinimapCluster:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -4, 4)
  295.  
  296.  
  297.  
  298.  
  299. -- WATCH FRAME (QUEST TRACKER) --------------------
  300. ---------------------------------------------------
  301.  
  302. -- Ghetto fix to move Watch Frame without taint
  303. MinimapCluster:SetHeight(225)
  304. MinimapBorder:ClearAllPoints()
  305. MinimapBorder:SetPoint("TOP", 0, 18)
  306. MinimapBorder:SetSize(192, 192)
  307.  
  308.  
  309. -- target dead text font
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement