WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Having trouble with SetPoint (WoW Classic) (https://www.wowinterface.com/forums/showthread.php?t=57334)

sknilegap 08-08-19 09:06 PM

Having trouble with SetPoint (WoW Classic)
 
I can move the right action bars down above my bottom action bars when I manually put these in with /run in game, in order.
When I put the first command in it move both bars (like they are anchored to one another).

Then the second line when manually put in move the other bar in place.
When I have them together in this code it only loads the first command only and I need to manually put in the second command.

This is my current code.
Code:

local Frame = CreateFrame("Frame")
Frame:RegisterEvent("PLAYER_LOGIN")

Frame:SetScript("OnEvent", function(...)
        --Your hiding code goes between this line
MultiBarRight:ClearAllPoints(); MultiBarRight:SetPoint("BOTTOMLEFT", relativeframe); MultiBarRight:SetWidth(1019); MultiBarRight:SetHeight(140);
MultiBarLeft:ClearAllPoints(); MultiBarLeft:SetPoint("BOTTOMLEFT", relativeframe); MultiBarLeft:SetWidth(509); MultiBarLeft:SetHeight(140);
        --And this one
end)


Does anyone know why its stopping before the second one finished?

It does run this portion,

Code:

MultiBarLeft:SetWidth(509); MultiBarLeft:SetHeight(140);
because when the addon loads I only have to manually type this code:

Code:

/run MultiBarLeft:ClearAllPoints(); MultiBarLeft:SetPoint("BOTTOMLEFT", relativeframe);
I tried doing these in different orders (every one I could think of). But the bars definitely seem tethered to one another like one is the master but not vice versa.

Vrul 08-09-19 06:06 AM

Are you sure it is not running? It is probably moving and then other code is calling SetPoint to override your call. You could try delaying your code or hooking that bar's SetPoint method so that you will know when it has been moved and move it back again.

SDPhantom 08-09-19 01:41 PM

UIParent dynamically moves some frames around depending on what's shown or not. There are a few ways around this, each with their own issues.
  1. Hook UIParent_ManageFramePositions() and reset your anchors afterwards. Note this can't be done in combat since the action bars are protected frames.
  2. Remove their entry from the UIPARENT_MANAGED_FRAME_POSITIONS table. This may cause taint.
  3. Set the ignoreFramePositionManager entry in each ActionBar to true. Apparently, this is checked when UIParent considers repositioning a frame and if set, this frame is skipped. I would be wary of this value randomly changing as it is a feature in the default UI and may be in use.

All of these options carry the additional effect of having other managed frames position strangely based on visibility state. This is hard-coded, but may be mitigated by removing any occurrence of rightRight and rightActionBarsX from all entries in UIPARENT_MANAGED_FRAME_POSITIONS if taint isn't an issue.

sknilegap 08-10-19 07:54 PM

I got it working!

I legit just added

Code:

Frame:RegisterEvent("PLAYER_ENTERING_WORLD")
as an additional event. I don't know enough about this stuff yet to know everything I'm doing but I assume the player login was happening before character selection and player entering world happened after. SO maybe something in wow's code overwrote my stuff from login?

Thanks for your help guys. You got me thinking about it in a different way. Hopefully this helps someone.


All times are GMT -6. The time now is 04:49 PM.

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