WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   How can i move DurabilityFrame and others things? (https://www.wowinterface.com/forums/showthread.php?t=44043)

Basso 08-30-12 12:56 PM

How can i move DurabilityFrame and others things?
 
All the things wich are usually attached to the minimap cluster, im trying to move them and im really fustrated now....

Lua Code:
  1. DurabilityFrame:Hide()
  2. DurabilityFrame:Alpha(0)
  3. DurabilityFrame:SetOwner(WorldFrame, "ANCHOR_NONE")
  4. DurabilityFrame:SetPoint("CENTER", 0, 0)
  5. VehicleSeatIndicator:SetPoint("TOP", UIParent, "TOP", 0, 350)

tried everthing but nothing works, the only thing i was able to to move them up and down nothing more.

what do i need to do to move them like all the other frames, i looked in some other addons to get an idea but i didnt found a clue why i cant move them, i mean i cant even hide it....

i simply want to set the position of these things in a lua file, can anybody help me ?

Haleth 08-30-12 01:13 PM

You might be able to use this:

Code:

DurabilityFrame.ignoreFramePositionManager = true
Pretty much any frame on the right/top side of the screen is managed using the UIParent's frame position manager.

Basso 08-30-12 01:32 PM

tried to put it before or after the rest of the code nothing happens, i mean what the hell is that?
every other frame is easily moved.......

but thank you for your advice......

Phanx 08-30-12 02:11 PM

Look at Smooth Durability or other addons that move the durability frame to see how they bypass Blizzard's frame positioning.

Basso 08-30-12 02:43 PM

sadly i dont understand what smooth durability is doing...

i understand how smooth durability makes it dragbale but i dont have a clue how he saves the position or how i would do it with a simple little permanent lua edit......

because of that im asking for advice from someone who understands it better......

Seerah 08-30-12 03:00 PM

Did you call :ClearAllPoints() to erase their previous locations?

Otherwise, you're just *adding* to how they're anchored.

Basso 08-30-12 03:19 PM

Lua Code:
  1. DurabilityFrame:ClearAllPoints()
  2. DurabilityFrame.ignoreFramePositionManager = true
  3. DurabilityFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 0)

I've tried many different things, no one of them works........

It seems to me that all the elements wich are usually anchored to the minimap cluster frame are something special, but since now i dont know what is special and how i can change it, i can anchor it to other frame and it sticks to this frame then, but i can move it only up an down not left not right.

the last solution would be creating an empty frame and sticking it to that frame but in my opinion there must be an easier way then creating 5-10 extra frames for each elemrnt i want to move.

Lua Code:
  1. local event = CreateFrame('Frame')
  2. local x = 0
  3. local y = 0
  4.  
  5. local move = function(self)
  6.     DurabilityFrame:ClearAllPoints()
  7.     DurabilityFrame:SetPoint("CENTER", UIParent, 'CENTER', x, y)
  8. end
  9.  
  10. event.PLAYER_LOGIN = function()
  11.     hooksecurefunc('UIParent_ManageFramePositions', move)
  12. end
  13.  
  14. event:SetScript("OnEvent", function(self, event, ...)
  15.     self[event](self, event, ...)
  16. end)
  17. event:RegisterEvent("PLAYER_LOGIN")

This one does work sometimes, but more often i doesnt work, for about 5 seconds then it moves back to it usual position....
got it out of some other post, even with the IgnoreFramePosition thing....

Phanx 08-30-12 08:06 PM

Look in the ClaimDurabilityFrame function in SmoothDurability. You also need to hook the frame's SetPoint method, at least.


All times are GMT -6. The time now is 12:04 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI