1. So last year I took over an action bar addon called Roath. Very simple, just centers the multibar on the bottom middle of world frame and stacks the other action bars on top of it. Does a few other things as well, some of which i've added since I took over, like set a vertical offset to allow for addons like infopanel and fubar to not be covered up across the bottom of the world frame.

    But one thing that has always happened and I dont know why is when i enter or leave an instance, the bars are dead center bottom of world frame, ignoring the vertical offset. A reloadui properly places it back where it should be, as it is anytime upon login. After hours of pouring through code the only thing i can do is set a condition to refresh after changing targets or scrolling or some other action, in which it refreshes and everythign is back where it should be.

    But this is no solution. Can anyone suggest anything please?

  2. You've got some code that is responding to either PLAYER_ENTERING_WORLD or PLAYER_LEAVING_WORLD. Some authors used to believe these events only happened when the user was logging in, but in reality they happen anytime you zone as well. I'd start by looking there and find out what code is responsible for moving your frame.

    Alternatively, if that doesn't give you anything you can always hook the :SetPoint() method on your frame and display a stack traceback inside the call. Something like this:

     local oldSetPoint = frame.SetPoint
     function frame:SetPoint(...)
       print(debugstack())
       return oldSetPoint(...)
     end
    
  3. thank you very much for looking. i used to think it was the Roath addon loading before Infobar causing the mess, so i changed that condition to a set value I could control (called RoathOffset) but to my surprise it didnt change anything. I've uploaded that version with te offset changes but it hasnt posted yet. might be available here

    Again, thank you!

  4. Ok with v05 to reproduce the issue i'm having, type "/roath offset 25" to set the bars 25 units above the bottom of the world frame. this automatically saves to the variables file. a relog or a reloadui proves that the value of the RoathOffset stays at 25 (or whatever you put). Well upon entering or leaving an instance, the bars go to the very bottom of the world frame again, while the offset remains 25 !!!! Another relog or reloadui fixes this, also i added "PLAYER TARGET CHANGED" to the list of events that rearrange the action bars so that it'll refresh the bars easily, but this is a sloppy solution.

    Thank you for helping me!

  5. It's as I said before. Uncomment the line that register for PLAYER_ENTERING_WORLD. I'm not sure why you're using that event in the first place. With it commented out, I no longer experience this issue.

  6. It's as I said before. Uncomment the line that register for PLAYER_ENTERING_WORLD. I'm not sure why you're using that event in the first place. With it commented out, I no longer experience this issue.

    Well I've tried that! But just to see, I commented out "frame:RegisterEvent("PLAYER ENTERING WORLD");" but still experience the issue. Was there something else you did also?

    It'd be great if it were that easy!

  7. No, that's all I changed. You'll need to do some troubleshooting. Do the following:

     local old = {}
     function wrapFrame(frame)
       frame[old] = frame.SetPoint
       function frame.SetPoint(...) 
         print("SetPoint: ", ...)
         print(debugstack())
         return frame[old](...)
       end
     end
    

    Then just wrapFrame(YourFrameName). You will get a message in the chat frame everytime SOME code change the position of your bar. It will even give you line numbers of what code is calling it. This should help you get to the bottom of it.

  8. No, that's all I changed. You'll need to do some troubleshooting. Do the following:

     local old = {}
     function wrapFrame(frame)
       frame[old] = frame.SetPoint
       function frame.SetPoint(...) 
         print("SetPoint: ", ...)
         print(debugstack())
         return frame[old](...)
       end
     end
    

    Then just wrapFrame(YourFrameName). You will get a message in the chat frame everytime SOME code change the position of your bar. It will even give you line numbers of what code is calling it. This should help you get to the bottom of it.

    Okay I added the first code block you suggested exactly like it is, but i dont know where to put the wrapFrame(RoathFrame) line, and when i /script wrapFrame(RoathFrame) in-game it does nothing, both before and after the bug occurs.

    I doubt my root issue is another addon, because i still experience the problem when Roath is the only addon loaded. Just changing instances, portaling, or dying (any time there's a loading screen) messes up the bar position. If you aren't experiencing the issue, maybe you arent understanding what issue i'm having. I've uploaded some ss:

    • Roath bars properly placed at 25 units vertical offset (using /roath offset 25) here
    • immediately after entering instance (or any loading screen) the action bars move to bottom of screen, as seen here. (Notice the bags and whatnot to the right are still in the correct position? Odd...)
    • bars re-adjust with a target change or menubar scroll here

    I hope this clears things up a bit! Thanks again for the efforts!

  9. I'm not sure why you were using RoathFrame in the wrapper.. that frame doesn't even exist and the frame we are concerned about is the MainMenuBar. After running that and looking into it the reason your main menu is going back to the bottom is the default user interface puts it there. The following code gets run on PLAYER_ENTERING_WORLD:

    elseif ( event == "PLAYER_ENTERING_WORLD" ) then
        MainMenuBar_UpdateKeyRing();
        if ( not firstEnteringWorld ) then
            MainMenuBar_ToPlayerArt();
        end
        firstEnteringWorld = false;
    

    The MainMenuBar_ToPlayerArt() function sets up an animation that slides the frame into position from off the screen. This obviously does not respect your offset. There's a few different ways to fix it, but that's something for you to decide.

  10. I'm not sure why you were using RoathFrame in the wrapper.. that frame doesn't even exist and the frame we are concerned about is the MainMenuBar. After running that and looking into it the reason your main menu is going back to the bottom is the default user interface puts it there. The following code gets run on PLAYER_ENTERING_WORLD:

    elseif ( event == "PLAYERENTERINGWORLD" ) then

      MainMenuBar_UpdateKeyRing();
      if ( not firstEnteringWorld ) then
          MainMenuBar_ToPlayerArt();
      end
      firstEnteringWorld = false;
    

    The MainMenuBar_ToPlayerArt() function sets up an animation that slides the frame into position from off the screen. This obviously does not respect your offset. There's a few different ways to fix it, but that's something for you to decide.

    Okay great, that's starting to make sense! Now, as for those few different ways to fix it (something for me to decide) I was thinking I have no idea of a single way to fix it (therefor the purpose of this thread) let alone multiple ways.

    Anyone have a suggestion?

  11. I would suggest starting a timer at PLAYER_ENTERING_WORLD and wait x seconds before manually setting the position. That's probably one of the cleanest and easiest ways to do it.

  12. I would suggest starting a timer at PLAYER_ENTERING_WORLD and wait x seconds before manually setting the position. That's probably one of the cleanest and easiest ways to do it.

    Hey now that's a pretty good idea! I found a timer code that works off of onUpdate, which fires every second after loading screens, so that seems to be working fine, except the nagging feeling that i have a script running every single second i'm playing, doing nothing 99.99% of the time.

    On another thought... I was wondering if there was any way to hook onto that animation function, or the MainMenuBar_ToPlayerArt() so that once it completes, my repositioning script runs again?

  13. Not easily. This is the best way. I explain OnUpdates pretty heavily in the book. It does not need to run every second that your code is running, as I said. You should start it at PLAYER_ENTERING_WORLD and then stop it when its done its work. However, you're going to have issues with vehicles, etc.

     local delay = 2.0                  -- delay 2.0 seconds
     local frame = CreateFrame("Frame")
     frame:Hide()
     frame:RegisterEvent("PLAYER_ENTERING_WORLD")
    
     local counter = 0
     frame:SetScript("OnUpdate", function(self, elapsed)
       counter = counter + elapsed
       if counter >= delay then
         -- Re-anchor the MainMenuBar here
         counter = 0
         self:Hide()
       end
     end)
    
     frame:SetScript("OnEvent", function(self, event, ...)
       self:Show()
     end)
    

    OnUpdate ONLY fires when the frame is shown. Therefore hiding it stops the timer and resetting the counter and showing it starts the timer.

  14. Awesome! thank you!