Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(13 Kb)
Download
Updated: 09-11-13 08:46 PM
Pictures
File Info
Compatibility:
Siege of Orgrimmar (5.4)
Escalation (5.3)
Thunder Isle (5.2)
Mists of Pandaria (5.0.4)
Updated:09-11-13 08:46 PM
Created:12-17-08 03:01 PM
Downloads:5,723
Favorites:21
MD5:
Movable Pet Bar  Popular! (More than 5000 hits)
Version: 5.4.0.0
by: kernighan, HolyCowChips
~ ~ ~ Changed the name to clear up some confusion (formerly Simple Pet Bar). ~ ~ ~


Description:

A simple addon that lets you hide the original Blizzard pet bar with an adjustable and movable pet bar. You can have the pet bar run horizontally or vertically and is movable over the entire playing screen.

* The individual item frames are locked/unlocked with the Blizzard action bar lock in the Interface > ActionBars > Lock ActionBars.



Slash Commands:

/mpb ------ help menu
/mpb on / off ------ enables or disables the addon
/mpb horz / vert --- aligns bar horizontally or vertically
/mpb lock / unlock -- locks or unlocks petbar movement
/mpb show / hide --- shows or hides the petbar



Installation:

Place this file into your World of Warcraft > Interface > Addons folder.



Misc Info:

Since starting a DK I was looking for a small addon to just move my pets action bar to the side. I searched high and low to no avail. I remember an old addon from years ago when I was a hunter and wanted the same thing then. So I dug up the addon, which I had maintained personally until I quit my hunter. I've reworked the code so the basics are there. I plan to try and make it resizable at a later date.

Unfortunately I don't remember who the original author was who wrote the majority of the code. But my hat is in hand to you whomever you are. Thank you sir and or madame for your hard work.
v5.4.0.0
Update TOC
Hide Pet bar during Battle Pet fights
Archived Files (8)
File Name
Version
Size
Author
Date
5.3.0.0
13kB
kernighan
08-05-13 04:34 PM
5.2.0.0
13kB
kernighan
03-10-13 08:21 PM
5.1.0.0
13kB
kernighan
11-27-12 07:39 PM
5.0.0.1
13kB
kernighan
08-30-12 04:26 PM
4.3.0.1
13kB
kernighan
12-03-11 11:10 PM
4.3.0
13kB
kernighan
11-30-11 01:00 PM
4.0.1
13kB
kernighan
11-09-10 07:48 PM
3.0
6kB
kernighan
12-17-08 03:01 PM


Post A Reply Comment Options
Unread 12-20-08, 07:27 PM  
Squiddy0
A Defias Bandit
 
Squiddy0's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 116
Uploads: 3
Hello

I'm going to try out your petbar, was using *CustomPetBar*, without any problems with wotlk but hasn't been updated in some time, you can Yahoo it, and check the Cache for Curse, as searching for it now, on Curse doesn't yield an addon.

I'll let ya know if it's funky with something or I'm sure someone else will.

Thanks for making and or updating cpb.
Squiddy0 is offline Report comment to moderator  
Reply With Quote
Unread 07-30-09, 08:00 PM  
Nightness
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 71
Uploads: 10
This mod works as stated, no bugs found. With one exception. I use a mod that hides the MainMenuBar, the PetActionBarFrame is a child of this frame and get hidden too, when I don't want it to be hidden. Here is a fix to the problem...

Code:
-- Changes the PetActionBarFrame parent to UIParent [NEW FUNCTION]
function ReleasePetBar()
	if (PetActionBarFrame:GetParent() ~= UIParent) then
		PetActionBarFrame:SetParent(UIParent);
		PetActionBarFrame:Show();
	end
end

-----------------------------------------------------------------------------------------------------------------

	function MovablePetBar_OnEvent(self, event, ...)
		ReleasePetBar(); -- NEW FUNCTION CALL
		if (event == "VARIABLES_LOADED") then
			if (MPB_PetBar == false) then
				MPB_HideBar("MPBPetBar");
			end
Nightness
Nightness is offline Report comment to moderator  
Reply With Quote
Unread 06-27-10, 08:22 AM  
rubyslipprz
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
Patch killed it! :(

Since the patch I cannot get this thing working right. The green dot is movable when I type /mpb unlock, but the actual pet bar doesn't move from right in the middle of my screen
Last edited by rubyslipprz : 06-27-10 at 08:22 AM.
rubyslipprz is offline Report comment to moderator  
Reply With Quote
Unread 11-08-10, 04:42 PM  
kernighan
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 69
Uploads: 3
Re: Patch killed it! :(

Originally posted by rubyslipprz
Since the patch I cannot get this thing working right. The green dot is movable when I type /mpb unlock, but the actual pet bar doesn't move from right in the middle of my screen
I have a working version I will be uploading to wowui.inggamers.com in the next day or so. I hope to be able to update it here as well.
kernighan is offline Report comment to moderator  
Reply With Quote
Unread 11-08-10, 05:52 PM  
kernighan
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 69
Uploads: 3
Re: Re: Patch killed it! :(

Originally posted by kernighan
I have a working version I will be uploading to wowui.inggamers.com in the next day or so. I hope to be able to update it here as well.
Until I am able to update it here, you can obtain it at http://www.wowinterface.com/download...blePetBar.html
kernighan is offline Report comment to moderator  
Reply With Quote
Unread 11-09-10, 08:11 PM  
kernighan
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 69
Uploads: 3
Re: Re: Re: Patch killed it! :(

Originally posted by kernighan
Until I am able to update it here, you can obtain it at http://www.wowinterface.com/download...blePetBar.html
New release is now available here as well.
kernighan is offline Report comment to moderator  
Reply With Quote
Unread 11-11-10, 05:57 PM  
mbernarr
An Aku'mai Servant

Forum posts: 32
File comments: 1
Uploads: 0
Is there a scaleing feature?

I used to use action pet bar b/c it enabled me to make the pet bar bigger as well as movable. I like bigger buttons.
mbernarr is offline Report comment to moderator  
Reply With Quote
Unread 11-15-10, 03:39 PM  
kernighan
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 69
Uploads: 3
Re: Is there a scaleing feature?

Originally posted by mbernarr
I used to use action pet bar b/c it enabled me to make the pet bar bigger as well as movable. I like bigger buttons.
Hi mbernarr,
I'll see what I can do.

--Kernighan
kernighan is offline Report comment to moderator  
Reply With Quote
Unread 08-31-12, 06:59 AM  
Scendera
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Re: Re: Is there a scaleing feature?

Originally Posted by mbernarr
I used to use action pet bar b/c it enabled me to make the pet bar bigger as well as movable. I like bigger buttons.
Seconded and thank you. Any chance of something similar to move/kill the aspect bar? I was a SemiStance/SemiPet user for several years for this combination of functions; now your addon is the clear winner for pets so I just need to kill/convert the aspect bar in similar fashion. Please and thank you. :-)
Last edited by Scendera : 08-31-12 at 07:00 AM.
Scendera is offline Report comment to moderator  
Reply With Quote
Unread 05-10-13, 02:06 PM  
wowinterfacemich
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
I change your addon

I change your addon for StanceBar
I copy functions with Stance and change common functions
thank you for this addon, semistancepetbar was broken and I missed it

Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
	
	<Script file="MovablePetBar.lua"/>
	
	<Frame name="MovablePetBarFrame">
		<Scripts>
			<OnLoad>
				MovablePetBar_OnLoad(self);
			</OnLoad>
			<OnEvent>
				MovablePetBar_OnEvent(self, event, ...);
			</OnEvent>
		</Scripts>
	</Frame>


        <Button name="MPBDragButtonTemplate" virtual="true" movable="true" frameStrata="DIALOG" toplevel="true">
		<Scripts>
			<OnMouseDown>
				self:StartMoving();
			</OnMouseDown>
			<OnMouseUp>
				self:StopMovingOrSizing();
			</OnMouseUp>
		</Scripts>
		
		<Size>
			<AbsDimension x="15" y="15"/>
		</Size>
		
		<NormalTexture file="Interface\AddOns\MovablePetBar\DragButton"/>
	</Button>        


	<Button name="MPBPetBarDragButton" inherits="MPBDragButtonTemplate" parent="PetActionBarFrame">
		<Anchors>
			<Anchor point="BOTTOM" relativeTo="UIParent">
				<Offset>
					<AbsDimension x="-180" y="294"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Frames>
			<Frame name="MPBPetBar"  frameStrata="BACKGROUND" parent="PetActionBarFrame">
				<Size>
					<AbsDimension x="330" y="33"/>
				</Size>
				<Scripts>
                                        <OnLoad>
				                MPB_LinkFrameToDragButton();
						MPB_ConstructPetBar();
                                        </OnLoad>
                                </Scripts>
			</Frame>		
		</Frames>
	</Button>
	<!-- -->
	 <Button name="MPBDragButtonTemplate2" virtual="true" movable="true" frameStrata="DIALOG" toplevel="true">
		<Scripts>
			<OnMouseDown>
				self:StartMoving();
			</OnMouseDown>
			<OnMouseUp>
				self:StopMovingOrSizing();
			</OnMouseUp>
		</Scripts>
		
		<Size>
			<AbsDimension x="15" y="15"/>
		</Size>
		
		<NormalTexture file="Interface\AddOns\MovablePetBar\DragButton"/>
	</Button>        
	
	<Button name="MPBStanceBarDragButton" inherits="MPBDragButtonTemplate2" parent="StanceBarFrame">
		<Anchors>
			<Anchor point="BOTTOM" relativeTo="UIParent">
				<Offset>
					<AbsDimension x="-180" y="294"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Frames>
			<Frame name="MPBStanceBar"  frameStrata="BACKGROUND" parent="StanceBarFrame">
				<Size>
					<AbsDimension x="330" y="33"/>
				</Size>
				<Scripts>
                                        <OnLoad>
				                MPB_LinkFrameToDragButton2();
						MPB_ConstructStanceBar();
                                        </OnLoad>
                                </Scripts>
			</Frame>		
		</Frames>
	</Button>
</Ui>
Code:
-----------------------------------------------------------------------------------------------------------------
-- Constants
-----------------------------------------------------------------------------------------------------------------

local Temped_PetAktionBarFrame_Update
local Temped_StanceBarFrame_Update
MPB_PetBar = true;
MPB_Locked = true;
Axis_Hor = true;
MPB_Locked = false;
MPB_IsOn = true;

-- Changes the PetActionBarFrame parent to UIParent
function ReleasePetBar()
	if (PetActionBarFrame:GetParent() ~= UIParent) then
		PetActionBarFrame:SetParent(UIParent);
		PetActionBarFrame:Show();
	end
end
-- Changes the StanceBarFrame parent to UIParent
function ReleaseStanceBar()
	if (StanceBarFrame:GetParent() ~= UIParent) then
		StanceBarFrame:SetParent(UIParent);
		StanceBarFrame:Show();
	end
end

-----------------------------------------------------------------------------------------------------------------
-- On_Load
-----------------------------------------------------------------------------------------------------------------

	function MovablePetBar_OnLoad(self)
		if( DEFAULT_CHAT_FRAME ) then
		DEFAULT_CHAT_FRAME:AddMessage("|cff00bfffMovable Pet Bar|r |cff00ff00- loaded.|r |cff00bfffType|r '|cffffd700/mpb|r' |cff00bffffor help menu.|r");
			end
		MovablePetBar_INI();
		MovableStanceBar_INI();

		SlashCmdList["MOVABLEPETBARCOMMAND"] = CustomHideBar_SlashHandler;
		SLASH_MOVABLEPETBARCOMMAND1 = "/mpb";

		self:RegisterEvent("VARIABLES_LOADED");

	end

-----------------------------------------------------------------------------------------------------------------
-- On_Event
-----------------------------------------------------------------------------------------------------------------

	function MovablePetBar_OnEvent(self, event, ...)
		ReleasePetBar();
		ReleaseStanceBar();
		if (event == "VARIABLES_LOADED") then
			if (MPB_PetBar == false) then
				MPB_HideBar("MPBPetBar");
				MPB_HideBar("MPBStanceBar");
			end
			if (MPB_Locked == true) then
				MPB_LockBars();
			end
			if (Axis_Hor == false) then
				MPB_ConstructPetBar_Vert();
				MPB_ConstructStanceBar_Vert();
			end
			if (MPB_IsOn == false) then
				MPB_Off();
			end
		end
	end


	function MovablePetBar_INI()
		Temped_PetActionBarFrame_Update = PetActionBarFrame_Update
		MPB_HidePetArt();

	end
	
	
	function MovableStanceBar_INI()
		Temped_StanceBarFrame_Update = StanceBarFrame_Update
		MPB_HideStanceArt();

	end


	function MPB_HidePetArt()
		PetActionBarFrame:EnableMouse("false")

		SlidingActionBarTexture0:SetAlpha(0)
		SlidingActionBarTexture1:SetAlpha(0)
	end
	
	
	function MPB_HideStanceArt()
		StanceBarFrame:EnableMouse("false")

		SlidingActionBarTexture0:SetAlpha(0)
		SlidingActionBarTexture1:SetAlpha(0)
	end

	
	function MPB_On()
		MPB_HidePetArt();
		MPB_ConstructPetBar();
		MPB_ShowBar("MPBPetBar");
		MPB_HideStanceArt();
		MPB_ConstructStanceBar();
		MPB_ShowBar2("MPBStanceBar");
	end

	
	function MPB_Off()

		SlidingActionBarTexture0:SetAlpha(1)
		SlidingActionBarTexture1:SetAlpha(1)

		PetActionBarFrame:EnableMouse("true")

		for i=1, 12 do
			pet_button = getglobal("PetActionButton"..i);
			if (pet_button ~= nil) then
				pet_button:ClearAllPoints();
				x_coord = 65 + ((i - 1) * 38);
				y_coord = 0;
				pet_button:SetPoint("BottomRIGHT", PetActionBarFrame, "BottomLEFT", x_coord, y_coord);
			end
		end
		MPBPetBarDragButton:Hide();
		
		StanceBarFrame:EnableMouse("true")

		for i=1, 12 do
			stance_button = getglobal("StanceButton"..i);
			if (stance_button ~= nil) then
				stance_button:ClearAllPoints();
				x_coord = 65 + ((i - 1) * 38);
				y_coord = 0;
				stance_button:SetPoint("BottomRIGHT", StanceBarFrame, "BottomLEFT", x_coord, y_coord);
			end
		end
		MPBStanceBarDragButton:Hide();
	end
	

	function MPB_ConstructPetBar()
		for i=1, 12 do
			pet_button = getglobal("PetActionButton"..i);
			if (pet_button ~= nil) then
				pet_button:ClearAllPoints();
				x_coord = 2 + ((i - 1) * 33);
				y_coord = -1;
				pet_button:SetPoint("BOTTOMLEFT", MPBPetBar, "TOPLEFT", x_coord, y_coord);
			end
		end
	end
	
	
	function MPB_ConstructStanceBar()
		for i=1, 12 do
			stance_button = getglobal("StanceButton"..i);
			if (stance_button ~= nil) then
				stance_button:ClearAllPoints();
				x_coord = 2 + ((i - 1) * 33);
				y_coord = -1;
				stance_button:SetPoint("BOTTOMLEFT", MPBStanceBar, "TOPLEFT", x_coord, y_coord);
			end
		end
	end
	

	function MPB_ConstructPetBar_Vert()
		for i=1, 12 do
			pet_button = getglobal("PetActionButton"..i);
			if (pet_button ~= nil) then
				pet_button:ClearAllPoints();					
				x_coord = -1;
				y_coord = -(2 + ((i - 1) * 33));
				pet_button:SetPoint("TOPRIGHT", MPBPetBar, "TOPLEFT", x_coord, y_coord);
			end
		end
	end

	
	function MPB_ConstructStanceBar_Vert()
		for i=1, 12 do
			stance_button = getglobal("StanceButton"..i);
			if (stance_button ~= nil) then
				stance_button:ClearAllPoints();					
				x_coord = -1;
				y_coord = -(2 + ((i - 1) * 33));
				stance_button:SetPoint("TOPRIGHT", MPBStanceBar, "TOPLEFT", x_coord, y_coord);
			end
		end
	end
	

	function MPB_LinkFrameToDragButton()
		MPBPetBar:ClearAllPoints();
		MPBPetBar:SetPoint("TOPLEFT", MPBPetBarDragButton, "TOPLEFT");
		
	end

	
	function MPB_LinkFrameToDragButton2()
		MPBStanceBar:ClearAllPoints();
		MPBStanceBar:SetPoint("TOPLEFT", MPBStanceBarDragButton, "TOPLEFT");
	end
	

	function MPB_ChatMessage(message)
		if( DEFAULT_CHAT_FRAME ) then
			DEFAULT_CHAT_FRAME:AddMessage(message);
		end
	end
-----------------------------------------------------------------------------------------------------------------
-- Slash Commands
-----------------------------------------------------------------------------------------------------------------

	function CustomHideBar_SlashHandler(msg)
		if (msg == "hide") then
			MPB_HideBar("MPBPetBar");
			MPB_HideBar("MPBStanceBar");
			MPB_PetBar = false;
		elseif (msg == "show") then
			MPB_ShowBar("MPBPetBar");
			MPB_ShowBar2("MPBStanceBar");
			MPB_PetBar = true;
		elseif (msg == "lock") then
			MPB_LockBars();
			MPB_Locked = true;
		elseif (msg == "unlock") then
			MPB_UnLockBars();
			MPB_Locked = false;
		elseif (msg == "on") then
			MPB_On();
			MPB_IsOn = true;
		elseif (msg == "off") then
			MPB_Off();
			MPB_IsOn = false;
		elseif (msg == "vert") then
			MPB_ConstructPetBar_Vert();
			MPB_ConstructStanceBar_Vert();
			Axis_Hor = false;
		elseif (msg == "horz") then
			MPB_ConstructPetBar();
			MPB_ConstructStanceBar();
			Axis_Hor = true;
		else
			mpb_PrintHelp();
		end
	end


	function MPB_HideBar(MPBPetBar)

		getglobal(MPBPetBar):ClearAllPoints();
		getglobal(MPBPetBar):SetPoint("LEFT", "PetActionBarFrame", "Top", 0, -150);
		MPBPetBarDragButton:Hide();

	end
	
	
	function MPB_HideBar(MPBStanceBar)

		getglobal(MPBStanceBar):ClearAllPoints();
		getglobal(MPBStanceBar):SetPoint("LEFT", "StanceBarFrame", "Top", 0, -150);
		MPBStanceBarDragButton:Hide();

	end
	

	function MPB_ShowBar(bar)

		MPB_LinkFrameToDragButton(bar.."DragButton", bar, "RIGHT");
		if (MPB_Locked == true) then
			MPB_LockBars();
		else
			MPB_UnLockBars();
		end
			
	end
	
	
	function MPB_ShowBar2(bar)

		MPB_LinkFrameToDragButton(bar.."DragButton", bar, "RIGHT");
		if (MPB_Locked == true) then
			MPB_LockBars();
		else
			MPB_UnLockBars();
		end
			
	end
	
	function MPB_LockBars()
        
	        MPBPetBarDragButton:Hide();
			MPBStanceBarDragButton:Hide();
		MPB_Locked = true;

	end        

	
	function MPB_UnLockBars()

	        MPBPetBarDragButton:Show();
			MPBStanceBarDragButton:Show();
		MPB_Locked = false;
        
	end
-----------------------------------------------------------------------------------------------------------------
-- Help Menu
-----------------------------------------------------------------------------------------------------------------        

	function mpb_PrintHelp()
	        MPB_ChatMessage(" /mpb |cff00ff00on|r / |cffff0000off|r  -------- enables or disables this addon.");
	        MPB_ChatMessage(" /mpb |cffffd700horz|r / |cff00BFFFvert|r ---- aligns petbar horizontally or vertically.");
	        MPB_ChatMessage(" /mpb |cff00BFFFshow|r / |cffffd700hide|r   -- shows or hides the petbar.");
	        MPB_ChatMessage(" /mpb |cffff0000lock|r / |cff00ff00unlock|r - locks or unlocks petbar");
	        MPB_ChatMessage(" ***|cffFFD700Individual frames are locked/unlocked with the interface actionbar lock.|r***")
	end
wowinterfacemich is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: