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

Fixed scrolling #10

Closed
wants to merge 0 commits into from
Closed

Fixed scrolling #10

wants to merge 0 commits into from

Conversation

z3t0
Copy link

@z3t0 z3t0 commented Apr 12, 2015

Fixed #9

@z3t0
Copy link
Author

z3t0 commented Apr 12, 2015

Uses inventoryWidth

@z3t0 z3t0 closed this Apr 12, 2015
@z3t0 z3t0 reopened this Apr 12, 2015
@z3t0
Copy link
Author

z3t0 commented Apr 12, 2015

accidentally close

@z3t0
Copy link
Author

z3t0 commented Apr 12, 2015

@deathcap could you merge this so we can continue updating the package.json in voxelmetaverse

@z3t0
Copy link
Author

z3t0 commented Apr 12, 2015

Only scrolls when chat bar is not open

@@ -47,6 +47,8 @@ class InventoryHotbarClient extends InventoryHotbarCommon
@keys = game.plugins.get('voxel-keys') ? throw new Error('voxel-inventory-hotbar requires voxel-keys plugin')
@wheelEnable = opts.wheelEnable ? false # enable scroll wheel to change slots?
@wheelScale = opts.wheelScale ? 1.0 # mouse wheel scrolling sensitivity
@console = game.plugins.get('voxel-console')
@scrollLock = true; # allows scrolling on true
Copy link
Member

Choose a reason for hiding this comment

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

Unnecessary semicolon; not required and should not normally be used in CoffeeScript

Copy link
Author

Choose a reason for hiding this comment

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

My bad.

@z3t0
Copy link
Author

z3t0 commented Apr 15, 2015

Removed ;

@@ -92,16 +94,28 @@ class InventoryHotbarClient extends InventoryHotbarCommon
enable: () ->
@inventoryWindow.container.style.visibility = ''
@onSlots = {}
@console.on 'open', =>
@scrollLock = false;
Copy link
Member

Choose a reason for hiding this comment

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

Actually, I think there's a better way to do this. Try replacing your @scrollLock and voxel-console events with @game.shell.pointerLock - it seems to already do what you want here, and is more general than just having the console open. For example, it also takes into account when another modal dialog is open (e.g., inventory) - it is only true when the browser has acquired pointer lock (to interact with the game with mouse look).

@deathcap
Copy link
Member

Tested this change (with a few modifications: removing voxel-console dependency, setting wheelEnable) but with the mouse I'm using (Apple Magic Mouse), scrolling the mouse still uncontrollably flips through the slots. This may be an inherent problem with this mouse, I know Minecraft has the same problem with it: https://bugs.mojang.com/browse/MC-42367 - so all I've been able to do is disable scrolling, but it does work with a Microsoft IntelliSense mouse (with a discrete scroll wheel instead of the touch-sensitive interface).

@z3t0
Copy link
Author

z3t0 commented Apr 15, 2015

It worked for me with a normal mouse as well. I'll see if I can find some
way to make it work with the Magic Mouse.

On Tue, Apr 14, 2015 at 8:59 PM, deathcap [email protected] wrote:

Tested this change (with a few modifications: removing voxel-console
dependency, setting wheelEnable) but with the mouse I'm using (Apple Magic
Mouse), scrolling the mouse still uncontrollably flips through the slots.
This may be an inherent problem with this mouse, I know Minecraft has the
same problem with it: https://bugs.mojang.com/browse/MC-42367 - so all
I've been able to do is disable scrolling, but it does work with a
Microsoft IntelliSense mouse (with a discrete scroll wheel instead of the
touch-sensitive interface).


Reply to this email directly or view it on GitHub
#10 (comment)
.

Thanks,
Rafi Khan

@z3t0
Copy link
Author

z3t0 commented Apr 15, 2015

@deathcap Are you talking about #11 working for you?

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.

Scrolling wheelScale
2 participants