Jump to content
Sign in to follow this  
Swagkhalifa

[Help] Moving the FPS display/meter *SOLVED*

Recommended Posts

Hello!

So i'm trying to make an addon that will move the FPS display to the lower left corner of my screen. This is the core script for my addon:

local x = -650
local y = -375
local FPSDisplay = CreateFrame("Frame")
FPSDisplay:RegisterEvent("PLAYER_LOGIN")
FPSDisplay:RegisterEvent("PLAYER_ENTERING_WORLD")
FPSDisplay:RegisterEvent("ZONE_CHANGED")
FPSDisplay:RegisterEvent("ZONE_CHANGED_INDOORS")
FPSDisplay:RegisterEvent("ZONE_CHANGED_NEW_AREA")


FPSDisplay:SetScript("OnEvent", function(...)
  FramerateLabel:ClearAllPoints()
  FramerateText:ClearAllPoints()
  FramerateLabel:SetPoint("RIGHT",UIParent,"CENTER",x,y)
  FramerateText:SetPoint("LEFT",FramerateLabel,"RIGHT")
  
  if not FramerateLabel:IsVisible() then
  ToggleFramerate()
  end
end)

It is almost working, but for some reason it won't stay there. Everytime I enter a different zone or simply go from Durotar in to Orgrimmar, the y-variable will automatically change to something around -270 and then it will just be stuck there. 
I don't know whats causing this. I've tried to disable every other addon I use but it still happens.
As you can see in the script, I've also tried to apply trigger events for the addon such as ZONE_CHANGING etc. but that doesn't seem to work either. 

I hope someone can help me out. 

Cheers!

Share this post


Link to post
Share on other sites

After some research I think I've found what causes the issue but I still haven't found a solution for it.
FramerateLabel is listed in UIPARENT_MANAGED_FRAME_POSITIONS in UIParent.lua, which means the default UI moves it around.

I've tried to use the following API's:

UIPARENT_MANAGED_FRAME_POSITIONS.FramerateLabel = nil
FramerateLabel.ignoreFramePositionManager = true
FramerateText.ignoreFramePositionManager = true

it works somewhat; it still changes the y-variable but not as much as before.

I've also tried

UIPARENT_MANAGED_FRAME_POSITIONS.FramerateLabel["CONTAINER_OFFSET_Y"] = nil

 

UIPARENT_ALTERNATE_FRAME_POSITIONS.FramerateLabel = nil


The first one wasn't different to the API's above and the second one just gave me an error and I couldn't get it to work. My guess is that the API simply doesn't exsist in vanilla but not sure.

I found this thread: https://forums.wowace.com/showthread.php?t=21092
where the OP had the exact same problem as I do and he seem to have fixed it, but and can't really tell what he did. Maybe someone with a bit more knowledge for scripting can tell me what he did?

Thanks in advance

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×