Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local MiniBar = CreateFrame("Frame")
- MiniBar:RegisterEvent("PLAYER_ENTERING_WORLD")
- MiniBar:RegisterEvent("ADDON_LOADED")
- MiniBar:RegisterEvent("UPDATE_FACTION")
- MiniBar:SetScript("OnEvent", function()
- if event == "ADDON_LOADED" then
- hook()
- hide()
- elseif event == "PLAYER_ENTERING_WORLD" or "UPDATE_FACTION" then
- main()
- MBColor()
- ShapeShiftBarUpdate()
- ShapeShiftBarButtons()
- end
- end)
- function hook()
- --hook to allow moving Blizzard frames
- OLD_UIParent_ManageFramePositions = UIParent_ManageFramePositions
- function UIParent_ManageFramePositions()
- end
- -- changing standard blizzard functions by commenting out the petbar positioning parts so positioning does not get messed up
- function PetActionBarFrame_OnUpdate(elapsed)
- local yPos;
- if ( this.slideTimer and (this.slideTimer < this.timeToSlide) ) then
- this.completed = nil;
- if ( this.mode == "show" ) then
- yPos = (this.slideTimer/this.timeToSlide) * this.yTarget;
- --this:SetPoint("TOPLEFT", this:GetParent(), "BOTTOMLEFT", PETACTIONBAR_XPOS, yPos);
- this.state = "showing";
- this:Show();
- elseif ( this.mode == "hide" ) then
- yPos = (1 - (this.slideTimer/this.timeToSlide)) * this.yTarget;
- --this:SetPoint("TOPLEFT", this:GetParent(), "BOTTOMLEFT", PETACTIONBAR_XPOS, yPos);
- this.state = "hiding";
- end
- this.slideTimer = this.slideTimer + elapsed;
- else
- this.completed = 1;
- if ( this.mode == "show" ) then
- --this:SetPoint("TOPLEFT", this:GetParent(), "BOTTOMLEFT", PETACTIONBAR_XPOS, this.yTarget);
- this.state = "top";
- --Move the chat frame and edit box up a bit
- elseif ( this.mode == "hide" ) then
- --this:SetPoint("TOPLEFT", this:GetParent(), "BOTTOMLEFT", PETACTIONBAR_XPOS, 0);
- this.state = "bottom";
- this:Hide();
- --Move the chat frame and edit box back down to original position
- end
- this.mode = "none";
- end
- end
- function ShowPetActionBar()
- UIParent_ManageFramePositions();
- if ( PetHasActionBar() and PetActionBarFrame.showgrid == 0 and (PetActionBarFrame.mode ~= "show") and not PetActionBarFrame.locked and not PetActionBarFrame.ctrlPressed ) then
- PetActionBarFrame:Show();
- if ( PetActionBarFrame.completed ) then
- PetActionBarFrame.slideTimer = 0;
- end
- PetActionBarFrame.timeToSlide = PETACTIONBAR_SLIDETIME;
- PetActionBarFrame.yTarget = PETACTIONBAR_YPOS;
- PetActionBarFrame.mode = "show";
- -- Rare case
- --if ( GetNumShapeshiftForms() > 0 ) then
- -- PETACTIONBAR_XPOS = getglobal("ShapeshiftButton"..GetNumShapeshiftForms()):GetRight() +20;
- --else
- -- PETACTIONBAR_XPOS = 36
- --end
- if ( ChatFrameEditBox:IsShown() ) then
- ChatFrameEditBox:Raise();
- end
- end
- end
- end
- -- function will be passed frames to hide
- function hideFrame(frame)
- -- move frame off screen
- frame:ClearAllPoints()
- frame:SetPoint('BOTTOM', UIParent, 'TOP', 0, -200)
- local hideFrame = CreateFrame("Frame", "hideFrame", UIParent)
- -- set parent to the hideFrame and hide the frame
- frame:SetParent(hideFrame)
- frame:Hide()
- hideFrame:Hide()
- end
- -- function to hide frames
- function hide()
- hideFrame(MainMenuBarPageNumber)
- hideFrame(ActionBarUpButton)
- hideFrame(ActionBarDownButton)
- hideFrame(MainMenuXPBarTexture2)
- hideFrame(MainMenuXPBarTexture3)
- hideFrame(MainMenuBarTexture2)
- hideFrame(MainMenuBarTexture3)
- hideFrame(MainMenuMaxLevelBar2)
- hideFrame(MainMenuMaxLevelBar3)
- hideFrame(MainMenuBarPerformanceBarFrameButton)
- -- Rep
- hideFrame(ReputationXPBarTexture2)
- hideFrame(ReputationXPBarTexture3)
- hideFrame(ReputationWatchBarTexture2)
- hideFrame(ReputationWatchBarTexture3)
- hideFrame(ExhaustionTick)
- -- Micro Buttons
- hideFrame(CharacterMicroButton)
- hideFrame(SpellbookMicroButton)
- hideFrame(TalentMicroButton)
- hideFrame(QuestLogMicroButton)
- hideFrame(MainMenuMicroButton)
- hideFrame(SocialsMicroButton)
- hideFrame(WorldMapMicroButton)
- -- Bags
- hideFrame(CharacterBag3Slot)
- hideFrame(CharacterBag2Slot)
- hideFrame(CharacterBag1Slot)
- hideFrame(CharacterBag0Slot)
- hideFrame(MainMenuBarBackpackButton)
- hideFrame(KeyRingButton)
- -- PetAction
- SlidingActionBarTexture0:SetTexture("")
- SlidingActionBarTexture1:SetTexture("")
- -- Shapeshift
- hideFrame(ShapeshiftBarLeft)
- hideFrame(ShapeshiftBarMiddle)
- hideFrame(ShapeshiftBarRight)
- end
- function main()
- -- Setwidth
- local width = 512
- MainMenuBar:SetWidth(width)
- MainMenuExpBar:SetWidth(width)
- MainMenuBarMaxLevelBar:SetWidth(width)
- ReputationWatchBar:SetWidth(width)
- ReputationWatchStatusBar:SetWidth(width)
- MultiBarBottomLeft:SetWidth(width)
- MultiBarBottomRight:SetWidth(width)
- -- Setpoint
- local yOffset = 5
- -- HelpMicroButton
- HelpMicroButton:ClearAllPoints()
- HelpMicroButton:SetPoint("BOTTOM", "MainMenuBarRightEndCap", 0 , 11)
- -- XPBar
- MainMenuXPBarTexture0:SetPoint("LEFT", MainMenuExpBar, "LEFT", -2, 0)
- MainMenuXPBarTexture1:SetPoint("RIGHT", MainMenuExpBar, "RIGHT", -2, 0)
- --ExhaustionTick:Show()
- --ExhaustionTick:SetFrameStrata("MEDIUM")
- -- RepBar
- ReputationWatchBar:SetPoint("BOTTOM", MainMenuExpBar, "TOP", 0, 0)
- ReputationWatchBarTexture0:SetPoint("LEFT", ReputationWatchBar, "LEFT")
- ReputationWatchBarTexture1:SetPoint("RIGHT", ReputationWatchBar, "RIGHT")
- -- XPBarArt
- MainMenuMaxLevelBar0:SetPoint("LEFT", MainMenuBarArtFrame, "LEFT")
- MainMenuBarTexture0:SetPoint("LEFT", MainMenuBarArtFrame, "LEFT")
- MainMenuBarTexture1:SetPoint("RIGHT", MainMenuBarArtFrame, "RIGHT")
- -- Endcaps
- -- make sure that the strata level is right and the gryphons stay in the background of the other Actionbars
- MainMenuBarArtFrame:SetFrameStrata("LOW")
- MainMenuBar:SetFrameStrata("LOW")
- MainMenuBarLeftEndCap:SetPoint("RIGHT", MainMenuBarArtFrame, "LEFT", 30, 0)
- MainMenuBarRightEndCap:SetPoint("LEFT", MainMenuBarArtFrame, "RIGHT", -30, 0)
- -- MultiBarBottomLeft
- MultiBarBottomLeft:ClearAllPoints()
- -- Check if we are watching a reputation
- local name = GetWatchedFactionInfo()
- if name then
- MultiBarBottomLeft:SetPoint("BOTTOM", ReputationWatchBar, "TOP", 8, yOffset)
- else
- MultiBarBottomLeft:SetPoint("BOTTOM", MainMenuExpBar, "TOP", 8, yOffset)
- end
- -- MultiBarBottomRight
- MultiBarBottomRight:ClearAllPoints()
- MultiBarBottomRight:SetPoint("BOTTOM", MultiBarBottomLeft, "TOP", 0, yOffset)
- -- PetActionBarFrame
- PetActionBarFrame:ClearAllPoints()
- PetActionBarFrame:SetScale(0.73)
- local PetAction_yOffset = 3
- if MultiBarBottomRight:IsVisible() then
- PetActionBarFrame:SetPoint("BOTTOMRIGHT", MultiBarBottomRight, "TOPRIGHT", 65, PetAction_yOffset)
- elseif MultiBarBottomLeft:IsVisible() then
- PetActionBarFrame:SetPoint("BOTTOMRIGHT", MultiBarBottomLeft, "TOPRIGHT", 65, PetAction_yOffset)
- else
- PetActionBarFrame:SetPoint("BOTTOMRIGHT", MainMenuBarArtFrame, "TOPRIGHT", 65, PetAction_yOffset)
- end
- -- FramerateLabel
- FramerateLabel:ClearAllPoints()
- FramerateLabel:SetPoint("TOPRIGHT", MultiBarBottomLeft, "TOPRIGHT", 21,-0)
- -- MultiBars
- MultiBarLeft:SetScale(0.9)
- MultiBarRight:SetScale(0.9)
- MultiBarRight:ClearAllPoints()
- MultiBarRight:SetPoint("RIGHT", WorldFrame, "RIGHT", 0, 13)
- -- QuestTimerFrame
- QuestTimerFrame:ClearAllPoints()
- QuestTimerFrame:SetPoint("BOTTOMRIGHT", Worldframe, "BOTTOMRIGHT", -10, 10)
- -- GroupLootFrame
- GroupLootFrame1:ClearAllPoints()
- GroupLootFrame1:SetPoint("CENTER", Worldframe, "CENTER", 0, -100)
- -- ShapeshiftBarFrame
- -- fix icon borders
- function ShapeShiftBarButtons()
- ShapeshiftButton1:SetWidth(38);
- ShapeshiftButton1:SetHeight(38);
- ShapeshiftButton2:SetWidth(38);
- ShapeshiftButton2:SetHeight(38);
- ShapeshiftButton3:SetWidth(38);
- ShapeshiftButton3:SetHeight(38);
- ShapeshiftButton4:SetWidth(38);
- ShapeshiftButton4:SetHeight(38);
- ShapeshiftButton5:SetWidth(38);
- ShapeshiftButton5:SetHeight(38);
- ShapeshiftButton6:SetWidth(38);
- ShapeshiftButton6:SetHeight(38);
- ShapeshiftButton7:SetWidth(38);
- ShapeshiftButton7:SetHeight(38);
- end
- -- Reposition ShapeshiftBarFrame
- function ShapeShiftBarUpdate()
- local numForms = GetNumShapeshiftForms();
- local Shapeshift_xOffset = ""
- local Shapeshift_yOffset = 50
- if numForms == 1 then
- Shapeshift_xOffset = -28
- elseif numForms == 2 then
- Shapeshift_xOffset = -51
- elseif numForms == 3 then
- Shapeshift_xOffset = -74
- elseif numForms == 4 then
- Shapeshift_xOffset = -96
- elseif numForms == 5 then
- Shapeshift_xOffset = -119
- elseif numForms == 6 then
- Shapeshift_xOffset = -141
- elseif numForms == 7 then
- Shapeshift_xOffset = -164
- elseif numForms == 8 then
- end
- ShapeshiftBarFrame:ClearAllPoints()
- ShapeshiftBarFrame:SetScale(0.60)
- ShapeshiftBarFrame:SetFrameStrata("MEDIUM")
- if UnitClass("player") == "Hunter" then
- if MultiBarBottomRight:IsVisible() then
- ShapeshiftBarFrame:SetPoint("BOTTOMLEFT", MultiBarBottomRight, "TOPLEFT", 7, 2)
- elseif MultiBarBottomLeft:IsVisible() then
- ShapeshiftBarFrame:SetPoint("BOTTOMLEFT", MultiBarBottomLeft, "TOPLEFT", 7, 2)
- else
- ShapeshiftBarFrame:SetPoint("BOTTOMLEFT", ActionButton1, "TOPLEFT", 22, 23)
- end
- else
- if MultiBarBottomRight:IsVisible() then
- ShapeshiftBarFrame:SetPoint("CENTER", MultiBarBottomRight, "CENTER", Shapeshift_xOffset, Shapeshift_yOffset)
- elseif MultiBarBottomLeft:IsVisible() then
- ShapeshiftBarFrame:SetPoint("CENTER", MultiBarBottomLeft, "CENTER", Shapeshift_xOffset, Shapeshift_yOffset)
- else
- ShapeshiftBarFrame:SetPoint("CENTER", MultiBarBottomLeft, "CENTER", Shapeshift_xOffset, -20)
- end
- end
- -- CastingBarFrame
- CastingBarFrame:ClearAllPoints()
- local castBar_yOffset = 35
- local castBar_xOffset = -8
- if MultiBarBottomRight:IsVisible() then
- CastingBarFrame:SetPoint("BOTTOM", MultiBarBottomRight, "TOP", castBar_xOffset, castBar_yOffset)
- elseif MultiBarBottomLeft:IsVisible() then
- CastingBarFrame:SetPoint("BOTTOM", MultiBarBottomLeft, "TOP", castBar_xOffset, castBar_yOffset)
- else
- CastingBarFrame:SetPoint("BOTTOM", MainMenuBarArtFrame, "TOP", castBar_xOffset, castBar_yOffset)
- end
- end
- function MBColor()
- local MBr, MBg, MBb = 1, 1, 1
- if UnitClass("player") == "Mage" then
- MBr, MBg, MBb = 0.41, 0.80, 0.94 -- change these color codes for each class if you want another color for your ui
- elseif UnitClass("player") == "Warrior" then
- MBr, MBg, MBb = 0.78, 0.61, 0.43
- elseif UnitClass("player") == "Druid" then
- MBr, MBg, MBb = 1, 0.49, 0.04
- elseif UnitClass("player") == "Hunter" then
- MBr, MBg, MBb = 0.67, 0.83, 0.45
- elseif UnitClass("player") == "Paladin" then
- MBr, MBg, MBb = 0.96, 0.55, 0.73
- elseif UnitClass("player") == "Priest" then
- MBr, MBg, MBb = 1, 1, 1
- elseif UnitClass("player") == "Rogue" then
- MBr, MBg, MBb = 1, 0.96, 0.41
- elseif UnitClass("player") == "Shaman" then
- MBr, MBg, MBb = 0, 0.44, 0.87
- elseif UnitClass("player") == "Warlock" then
- MBr, MBg, MBb = 0.58, 0.51, 0.79
- else
- end
- -- Unit & Castbar
- PlayerFrameTexture:SetVertexColor(MBr, MBg, MBb)
- CastingBarBorder:SetVertexColor(MBr, MBg, MBb)
- -- Mainbar
- MainMenuBarTexture0:SetVertexColor(MBr, MBg, MBb)
- MainMenuBarTexture1:SetVertexColor(MBr, MBg, MBb)
- MainMenuBarTexture2:SetVertexColor(MBr, MBg, MBb)
- MainMenuBarTexture3:SetVertexColor(MBr, MBg, MBb)
- MainMenuMaxLevelBar0:SetVertexColor(MBr, MBg, MBb)
- MainMenuMaxLevelBar1:SetVertexColor(MBr, MBg, MBb)
- MainMenuMaxLevelBar2:SetVertexColor(MBr, MBg, MBb)
- MainMenuMaxLevelBar3:SetVertexColor(MBr, MBg, MBb)
- MainMenuXPBarTexture0:SetVertexColor(MBr, MBg, MBb)
- MainMenuXPBarTexture1:SetVertexColor(MBr, MBg, MBb)
- BonusActionBarTexture0:SetVertexColor(MBr, MBg, MBb)
- BonusActionBarTexture1:SetVertexColor(MBr, MBg, MBb)
- ReputationWatchBarTexture0:SetVertexColor(MBr, MBg, MBb)
- ReputationWatchBarTexture1:SetVertexColor(MBr, MBg, MBb)
- ReputationWatchBarTexture2:SetVertexColor(MBr, MBg, MBb)
- ReputationWatchBarTexture3:SetVertexColor(MBr, MBg, MBb)
- ReputationXPBarTexture0:SetVertexColor(MBr, MBg, MBb)
- ReputationXPBarTexture1:SetVertexColor(MBr, MBg, MBb)
- SlidingActionBarTexture0:SetVertexColor(MBr, MBg, MBb)
- SlidingActionBarTexture1:SetVertexColor(MBr, MBg, MBb)
- MainMenuBarLeftEndCap:SetVertexColor(MBr, MBg, MBb)
- MainMenuBarRightEndCap:SetVertexColor(MBr, MBg, MBb)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement