Auralin Viewport

Auralin Viewport

96 Downloads

WorldFrame resetting after certain cut scenes

sp00n opened this issue ยท 9 comments

commented

This also seems to suffer from resetting the WorldFrame / ViewPort after certain cut scenes have finished playing.

Not all of them though, I just had two cut scenes in short succession (the ones where you first meet the Arbiter in the Shadowlands campaign), and while the first one did not trigger a reset, the second one did.

commented

v1.0.2 has been pushed, this issue has been closed. Thank you sp00n for supporting the project.

commented

Maybe registering to CINEMATIC_STOP could help. It's been literally a decade since I last played WoW and messed with addons, so I'm a bit rusty.

commented

I will definitely take this under consideration. I have noticed the issue before and a reload has always resolved it. But avoiding it in the first place would be preferable. Thank you for the suggestion.

commented

I've modified the EventHandling.lua now like this, let's see if this does fix it.

local eventFrame = CreateFrame("Frame")

-- Register the PLAYER_ENTERING_WORLD event
eventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")

-- Register the ADDON_LOADED event
eventFrame:RegisterEvent("ADDON_LOADED")

-- Register to when a Cinematic ends
eventFrame:RegisterEvent("CINEMATIC_STOP")


eventFrame:SetScript("OnEvent", function(self, event)
    if event == "PLAYER_ENTERING_WORLD" then
        -- Call a function to update the sliders.
        UpdateSlidersWithCurrentSettings()
    
    elseif event == "CINEMATIC_STOP" then
        -- We may have to restore the viewport, it breaks after some cinematics
        UpdateWorldFrame()
    end
end)

I thought about making a check first if we actually need to update the world frame, but the operation probably isn't very costly, so I just went with it.

commented

Do you remember specifically which cinematics created the issue? I can do a quick play through the shadowlands opening to test it.

The two where you are introduced to the Arbiter in Oribos after you completed the initial stuff in the Maw. Possibly earlier ones would've broken it as well, but I only installed it when I was already in Oribos after I noticed that the /script I was using didn't work and neither did the old LightViewPorter addon (after removing the addition frame it creates to make it work at all).

commented

Do you remember specifically which cinematics created the issue? I can do a quick play through the shadowlands opening to test it.

commented

I have pushed an update with debug statements and have tested through several cut scenes in the maw. I believe your suggestion fixed the issue, but I'll continue to test out up till the Arbiter's introduction. Thank you for your help. So long as I don't encounter any further issues I'll push a new release version without the debug comments and close this out.

commented

Hmm. Actually I think the first OnEvent handler where I added the check for CINEMATIC_STOP never fires, since the handler is being overwritten by the second one at the bottom of the file.

And that second one always executes the UpdateWorldFrame() function without further checks for all the registered events anyway.
Which also means that it is executed for every ADDON_LOADED event, not just yours. Probably not a huge problem, but not the best practice I assume.

Also I noticed that you're using a a global ViewPort variable, which could bug out if any other addon uses a global variable with the same name.

And third, do you actually need the call to GetPhysicalScreenSize() in the UpdateWorldFrame() function? The variables aren't used (but maybe to force some sort of screen update?).

commented

By the way, scripted cut scenes seems to trigger this, I have made some debug statements as well:
image

With the CINEMATIC_STOP event listener I have not yet encountered a (visible) reset of the viewport.

I may create a pull request with the changes I've made to the files, where I replaced the ViewPort global variable with Auralin_Current_Viewport and have merged the two event handlers into one.