Thread Tools Display Modes
08-08-19, 09:06 PM   #1
sknilegap
A Defias Bandit
Join Date: Aug 2019
Posts: 2
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.
  Reply With Quote
08-09-19, 06:06 AM   #2
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
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.
  Reply With Quote
08-09-19, 01:41 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
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.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-09-19 at 02:13 PM.
  Reply With Quote
08-10-19, 07:54 PM   #4
sknilegap
A Defias Bandit
Join Date: Aug 2019
Posts: 2
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.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Having trouble with SetPoint (WoW Classic)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off