1. #1

    Question Move the mainmenubar and vehiclemenubar up 30 pixels

    I'm trying to put my datapanel below the mainmenubar and vehiclebar. I've found a code that works but other have said that a OnUpdate Event is a bad event to use to move something.

    So below is my current code I'm using if somone here could help me find a better way to write it that would be great.

    Thanks
    Coke

    Here it is:
    Code:
    	local Movebar = CreateFrame("Frame")
    	local NeedsUpdate = false
    	local function RaiseBars(self)
    		-- Check if in combat lockdown, and set NeedsUpdate
    		if InCombatLockdown() then
    			NeedsUpdate = true
    			return
    		end
    
    		--Update bars
    		MainMenuBar:ClearAllPoints()
    		MainMenuBar:SetPoint('BOTTOM', DataPanel, 0, 32)
    		VehicleMenuBar:ClearAllPoints()
    		VehicleMenuBar:SetPoint('BOTTOM', DataPanel, 0, 40)
    
    	end
    	Movebar:SetScript("OnUpdate", function(MainMenuBar) RaiseBars(); end)
    	RaiseBars()

  2. #2
    Don't have a clue about code, sorry... Could you do it with MoveAnything?

  3. #3
    Deleted
    Why not simply use
    Code:
    MainMenuBar:ClearAllPoints() MainMenuBar:SetPoint("BOTTOM",DataPanel,"TOP")
    VehicleMenuBar:ClearAllPoints() VehicleMenuBar:SetPoint("BOTTOM",DataPanel,"TOP",0,8)

  4. #4
    Quote Originally Posted by Treeston View Post
    Why not simply use
    Code:
    MainMenuBar:ClearAllPoints() MainMenuBar:SetPoint("BOTTOM",DataPanel,"TOP")
    VehicleMenuBar:ClearAllPoints() VehicleMenuBar:SetPoint("BOTTOM",DataPanel,"TOP",0,8)
    ive tried that but when i et in or out of a vehicle then the i want to say slide effect of default frames covers the actionbar up. Ill take some screen shots to show you what i mean.

  5. #5
    Deleted
    Code:
    local dummy = function() end
    MainMenuBar:ClearAllPoints() MainMenuBar:SetPoint("BOTTOM",DataPanel,"TOP") MainMenuBar.ClearAllPoints = dummy MainMenuBar.SetPoint = dummy
    VehicleMenuBar:ClearAllPoints() VehicleMenuBar:SetPoint("BOTTOM",DataPanel,"TOP",0,8) VehicleMenuBar.ClearAllPoints = dummy VehicleMenuBar.SetPoint = dummy

  6. #6
    ok so here are the screenshots.

    The code you gave me after a /reload:
    imageshack.us/photo/my-images/690/thiscodeafterreload.jpg/

    The code you gave me after i get on a vehicle in icecrown:
    imageshack.us/photo/my-images/801/thiscodeafterenteringav.jpg/

    The code you gave me after i exit the vehicle in icecrown:
    imageshack.us/photo/my-images/717/thiscodeafterexitingveh.jpg/

    With my original code the menubar and vehiclebar stay above my datapanel even after entering or exiting a vehicle.

  7. #7
    Deleted
    Is that with the first or the second code?

  8. #8
    first code.. your to fast LOL second one works great ty.

    ---------- Post added 2011-09-12 at 09:15 PM ----------

    so i'm not creating new posts for all thing ill just post my question here.

    When i put my datapanel at the bottom of the screen i have to also move the bags up 20-30 pixels also right now the code im using for this process is kinda the default container code with a few number changes. Its a rather big code and i would like to make it smaller.

    Code:
    	 -- Move the Bags above the Actionbar
    	CONTAINER_WIDTH = 192;
    	CONTAINER_SPACING = 5;
    	VISIBLE_CONTAINER_SPACING = 3;
    	CONTAINER_OFFSET_Y = 70;
    	CONTAINER_OFFSET_X = 0;
    
    	 
    	function updateContainerFrameAnchors()
    		local _, xOffset, yOffset, _, _, _, _;
    		local containerScale = 1;
    		screenHeight = GetScreenHeight() / containerScale;
    		-- Adjust the start anchor for bags depending on the multibars
    		xOffset = CONTAINER_OFFSET_X / containerScale;
    		yOffset = CONTAINER_OFFSET_Y / containerScale + 25;
    		-- freeScreenHeight determines when to start a new column of bags
    		freeScreenHeight = screenHeight - yOffset;
    		column = 0;
    		for index, frameName in ipairs(ContainerFrame1.bags) do
    			frame = _G[frameName];
    			frame:SetScale(containerScale);
    			if ( index == 1 ) then
    				-- First bag
    				frame:SetPoint('BOTTOMRIGHT', frame:GetParent(), 'BOTTOMRIGHT', -xOffset, yOffset );
    			elseif ( freeScreenHeight < frame:GetHeight() ) then
    				-- Start a new column
    				column = column + 1;
    				freeScreenHeight = screenHeight - yOffset;
    				frame:SetPoint('BOTTOMRIGHT', frame:GetParent(), 'BOTTOMRIGHT', -(column * CONTAINER_WIDTH) - xOffset, yOffset );
    			else
    				-- Anchor to the previous bag
    				frame:SetPoint('BOTTOMRIGHT', ContainerFrame1.bags[index - 1], 'TOPRIGHT', 0, CONTAINER_SPACING);   
    			end
    			freeScreenHeight = freeScreenHeight - frame:GetHeight() - VISIBLE_CONTAINER_SPACING;
    		end
    	end
    The red code is the only change i need made.

    Thanks

  9. #9
    Looking for the new Battle Pet Bar name so far i know OverrideActionBar and MainMenuBar now I just need the new Battlepet one... anyone know the name of this??

  10. #10
    Type /fstack and hover over the frame. It will tell you the names of all the frames your mouse is currently over, in a tooltip. Type /fstack again to turn it off.

  11. #11
    Quote Originally Posted by Woogs View Post
    Type /fstack and hover over the frame. It will tell you the names of all the frames your mouse is currently over, in a tooltip. Type /fstack again to turn it off.
    Thank You this worked great.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •