Thread Tools Display Modes
10-19-13, 02:20 PM   #1
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
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?
  Reply With Quote
10-19-13, 08:02 PM   #2
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
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.
  Reply With Quote
10-19-13, 08:09 PM   #3
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
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.
  Reply With Quote
10-20-13, 04:18 AM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-20-13, 10:11 AM   #5
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Originally Posted by Phanx View Post
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?
  Reply With Quote
10-20-13, 10:30 AM   #6
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
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.
  Reply With Quote
10-20-13, 11:25 AM   #7
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Originally Posted by Dridzt View Post
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

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.

Last edited by bsmorgan : 10-20-13 at 11:28 AM.
  Reply With Quote
10-20-13, 12:16 PM   #8
elcius
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Sep 2011
Posts: 75
hook TurnOrActionStop and CameraOrSelectOrMoveStop
  Reply With Quote
10-20-13, 02:41 PM   #9
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Originally Posted by elcius View Post
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

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

Last edited by bsmorgan : 10-20-13 at 02:44 PM.
  Reply With Quote
10-20-13, 09:11 PM   #10
elcius
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Sep 2011
Posts: 75
you can use hooksecurefunc() to avoid tainting the functions
  Reply With Quote
10-21-13, 10:26 AM   #11
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Originally Posted by elcius View Post
you can use hooksecurefunc() to avoid tainting the functions
That's exactly what I did.
  Reply With Quote
10-24-13, 01:16 PM   #12
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
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.

Last edited by bsmorgan : 10-24-13 at 01:52 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Lock/Unlock Camera View


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