WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Lock/Unlock Camera View (https://www.wowinterface.com/forums/showthread.php?t=48384)

bsmorgan 10-19-13 02:20 PM

Lock/Unlock Camera View
 
I'm not sure why but after upgrading to Windows 8.1 I'm having a terrible time with the camera position changing when I click on things in the environment.

This is especially bad when doing the "Water, Water Everywhere" daily quest from Farmer Fung. I set the camera to a directly overhead view, turn off the UI (Alt-Z), and then use the "1" key to get a target reticule and left-click to drop the bucket. The camera used to stay where I put it but now, it will change the view (drastically) on some of my clicks.

Would it be possible to create an addon that locked and unlocked the camera? If so, any hints as to what I'd need to do?

Rainrider 10-19-13 08:02 PM

Don't know what's causing this, but maybe you could try those: http://wowprogramming.com/docs/api_categories#camera You could just try in a macro to see whether they solve your issues.

bsmorgan 10-19-13 08:09 PM

I've looked at the camera API functions but I think the problem is that left-click and right-click can both modify the camera position and I don't know how to stop that. None of the camera API functions seems to be appropriate.

Phanx 10-20-13 04:18 AM

Double-check your Camera settings in the game's Interface Options window. If you reinstalled WoW, you were given the game's current default settings -- even if you were using the default settings before, the default settings may have been changed since then. Try turning off the follow terrain, adjust while moving, and similar options and see if that helps.

bsmorgan 10-20-13 10:11 AM

Quote:

Originally Posted by Phanx (Post 286013)
Double-check your Camera settings in the game's Interface Options window. If you reinstalled WoW, you were given the game's current default settings.

I did not reinstall WoW, I just upgraded from Windows 8 to Windows 8.1. I did double-check the Interface Options Camera settings and as far as I can tell, nothing changed.

I moved to a different system with Windows 7 (64-bit) with exactly the same addons and it doesn't happen. BTW, this system is on a KVM with the 8.1 system so the exact same mouse and keyboard were used.

On the Windows 8.1 system, I turned on the Framestack and see nothing out of the ordinary when the camera is mysteriously moved. I disabled all addons and the mysterious camera movement still occurs.

All of this leads me to believe its a Windows 8.1 related problem but until either Blizzard and/or Microsoft make a change, I'm stuck with it. This system is a substantial upgrade from my previous system and for my day job I need to stay with 8.1. This brings me back to my original question, can I program around the problem with an addon?

Dridzt 10-20-13 10:30 AM

You can try positioning the camera as you want it then do
SaveView(5)
and SetView(5)
If the macro works to lock the camera you could make a small addon for it.

Could even go as far as making the SetView() auto-repeat while the interface is hidden or put a toggle to turn 'camera lock' mode on/off.

bsmorgan 10-20-13 11:25 AM

Quote:

Originally Posted by Dridzt (Post 286025)
You can try positioning the camera as you want it then do
SaveView(5)
and SetView(5)
If the macro works to lock the camera you could make a small addon for it.

I tried "/run SaveView(5)" and "/run SetView(5)" but that didn't "lock" the camera :mad:

I guess I need an addon... Looks like I want to do a SetView(5) after every left-click on the entire world frame (if that's the right terminology). Is that an OnClick handler for the frame? Something like:

Code:

local f = CreateFrame("Frame")
f:SetScript("OnClick", function(self,button,down)
        SetView(5)
end)
f:RegisterForClicks("LeftButtonDown") -- or "LeftButtonUp"

Obviously, I need some conditions to turn this on and off. I'm in a vehicle and on a specific quest (or any quest of the "bombing run" type). I'm pretty sure I need more than just CreateFrame("Frame") but I'm not sure what.

Additional hints or pointers to addons that I might "borrow from" would be appreciated.

elcius 10-20-13 12:16 PM

hook TurnOrActionStop and CameraOrSelectOrMoveStop

bsmorgan 10-20-13 02:41 PM

Quote:

Originally Posted by elcius (Post 286028)
hook TurnOrActionStop and CameraOrSelectOrMoveStop

I saw "This function is protected and can only be called by the Blizzard user interface" on the World of Warcraft Programming site and figured that was a dead end. After reading Secure Execution and Tainting I decided to try it anyway and it works!

I'll have to see how it goes with Water, Water Everywhere but I'm getting close. Thanks everyone :D

If anyone else has the problem under Windows 8.1, let me know and I'll make the code available.

elcius 10-20-13 09:11 PM

you can use hooksecurefunc() to avoid tainting the functions

bsmorgan 10-21-13 10:26 AM

Quote:

Originally Posted by elcius (Post 286044)
you can use hooksecurefunc() to avoid tainting the functions

That's exactly what I did.

bsmorgan 10-24-13 01:16 PM

Looks like I'm not the only one with this problem! It appears to be happening only on Windows 8.1.

http://us.battle.net/wow/en/forum/topic/10102720358

http://us.battle.net/wow/en/forum/topic/9499810106

I have uploaded my addon to WoWInterface. Camera is its name and it is pending approval.


All times are GMT -6. The time now is 06:39 PM.

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