Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplified scrolling using game.shell.pointerLock #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

z3t0
Copy link

@z3t0 z3t0 commented Apr 15, 2015

Fixed changes mention in previous PR.

@z3t0 z3t0 mentioned this pull request Apr 15, 2015
@@ -134,7 +135,7 @@ class InventoryHotbarClient extends InventoryHotbarCommon
ever(document.body).on 'keydown', @keydown

super()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace

@deathcap
Copy link
Member

commit 8b47b320010b410020045600a5a7886c521dd90c
Author: Rafi Khan <[email protected]>
Date:   Tue Apr 14 20:53:39 2015 -0600

    Simplified scrolling using game.shell.pointerLock

diff --git a/hotbar.coffee b/hotbar.coffee
index 0269184..92ffae4 100644
--- a/hotbar.coffee
+++ b/hotbar.coffee
@@ -95,6 +95,7 @@ class InventoryHotbarClient extends InventoryHotbarCommon

     if @wheelEnable
       ever(document.body).on 'mousewheel', @mousewheel = (ev) => # TODO: also DOMScrollWheel for Firefox
+      if @game.shell.pointerLock
         console.log 'mousewheel',ev
         delta = ev.wheelDelta
         delta /= @wheelScale

I can't get scrolling to work at all with this change (with wheelEnable:true, and the now-default wheelScale:120) testing on latest voxelmetaverse, for unknown reasons. Even when pointer lock is acquired, scrolling the mouse does not change the inventory slots. If I remove the added "if @game.shell.pointerLock" line then scrolling works.

@z3t0
Copy link
Author

z3t0 commented Jan 1, 2016

@deathcap I removed the first whitespace, cant seem to remove the second (im using githubs edit button) as it seems to be added automatically...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants