ArnoldSmith86 / virtualtabletop

a virtual surface in the browser on which you can play board, dice and card games
https://virtualtabletop.io
GNU General Public License v3.0
172 stars 31 forks source link

Option to not see red circles for other peoples' pointing devices #111

Closed rogerl50 closed 3 years ago

rogerl50 commented 3 years ago

I'd like to be able to turn off the little red dots that show you what other people are doing with their mice. In our poker game, it's not uncommon for people to rest their mouse on top of a card or chip denomination when considering whether to do something with that item, which gives away information. It's totally unconscious behavior, of course, and difficult to stop doing.

robartsd commented 3 years ago

Initially I wanted other player's cursors to be hidden within the hand area (this can be annoying when everyone is sorting their cards). I've looked at the code. It seems this would be difficult to implement for touchscreens (no mouseenter, mouseexit events to trigger) and the code for updating other player cursors doesn't really interact with other elements.

One option would be to have cursors below a certain layer, then game designers could set some things above the cursors. This would require changing the DOM structure so that cursors are inside the room element.

A reasonable alternative that we would have events to easily implement would be to hide the cursor except when the player is interacting with items that other players can see. Touch users don't have a cursor indicating where they have their finger until they touch the screen (their cursor remails at the last place they touched); so hiding a pointing device cursor except when it is moving something would be reasonably equivalent. The code handling mouse events could check if the current target is owned and only send position updates to the server if the target is not owned. When receiving cursor updates from the server, the code could add a class to the cursor, and set a callback to remove the class after a short delay. CSS opacity and transitions could be used to have the cursor visible for a few seconds after movement.

Casbuild commented 3 years ago

Initially I wanted other player's cursors to be hidden within the hand area (this can be annoying when everyone is sorting their cards)

Adding buttons to sort hands is a good way to mitigate this.

robartsd commented 3 years ago

Initially I wanted other player's cursors to be hidden within the hand area (this can be annoying when everyone is sorting their cards)

Adding buttons to sort hands is a good way to mitigate this.

Certainly helps quite a bit in most games, but it can't solve all situations where multiple players would want to sort their hand simultaneously.

ThePropagandaPanda commented 3 years ago

I encountered this problem myself, and there is an easy albeit not perfect workaround: Everyone has to change their cursor to the same color, preferably the background color of the board.

The downside is obviously that this prevents the cursor dots from being visible at all, but in games like poker, this seems hardly important.

larkob commented 3 years ago

I second the need for turning off cursor movements. Depending on the cursor's color and the game's colors, the cursor is hard to see anyhow and with mobile users, there's only the dragging movements to see.

I propose we add an option to the player's list to turn on/off cursor movements for all players in the room. That feels the natural place for me to look for such a setting.

robartsd commented 3 years ago

Quoting my comment from Issue #94

I think that the DOM element representing other players' cursors should have these classes dynamically assigned:

  • moving (automatically removed by client 100ms after last update to the cursor from server)
  • dragging (persists until delta from server indicates that the objects were released)
  • foreign (added by client when owners[] provided by server is not empty and the current player is not in the list)

I'd want players to have four options for display of other player's cursors: always, never, only when handling widgets (that the player can see), or any movement. With an additional option to show or hide player name with cursor when handling widgets. Player preference could be implemented by adding a class to the page that triggers appropriate stylesheet rules. I'd love to have games be able to also define stylesheet rules which could set the default cursor settings for the game.

Perhaps dragging should be renamed, as I'd also want the interaction rules to apply when clicking objects.