H-uru / Plasma

Cyan Worlds's Plasma game engine
http://h-uru.github.io/Plasma/
GNU General Public License v3.0
205 stars 80 forks source link

Add popup quit when sitting at heek table #1446

Closed Hazado closed 1 year ago

Hazado commented 1 year ago

Stops the mouse movement keys when sitting at the heek table to prevent misclicking and leaving the game unintentionally.

Keyboard movement still works and allows you to leave the game still. Closing the KI will also re-enable mouse movement keys. Mouse movement key is re-enabled after standing back up.

DamnBriggsy commented 1 year ago

If someone exclusively uses the mouse to navigate, it may not be obvious how to stand up again. What about modifying the chat message on sit-down to include the tip to use the movement keys on the keyboard to stand up? Adding hotspots to the heek table itself to allow for standing might work, but I imagine would be considerably more difficult to implement.

dpogue commented 1 year ago

From Scharminius in Discord:

What if mouse movement [keys] were disabled for all forms of sitting? I find it likewise annoying when clicking through chatlines or the playerlist, and missing the button by a hair and thus doing a stand-up routine in front of everyone.

Deledrius commented 1 year ago

Maybe this makes sense as a universal preference "Enable Click-to-Stand mouse controls when sitting."?

DamnBriggsy commented 1 year ago

Maybe this makes sense as a universal preference "Disable Click-to-Stand mouse controls when sitting."?

This would be ideal, in my opinion. Edit: to be clear, because adding it as an option is significantly larger in scope, I wouldn't be opposed to a smaller implementation just for Heek.

Hazado commented 1 year ago

This would be ideal, in my opinion. Edit: to be clear, because adding it as an option is significantly larger in scope, I wouldn't be opposed to a smaller implementation just for Heek.

Yes, I agree its a large scope creep for this request. I'm not opposed to adding another checkbox in an option GUI somewhere for another pull request. I will be honest that i am not sure how to implement the disable mouse movement keys, but Im pretty sure it will need to be done in the client and not in the python scripts. Maybe the sitting modifier message?

Hoikas commented 1 year ago

@DamnBriggsy raises a good point. I've always thought it would be better, honestly, for any attempt to leave the heek game, whether via movement keys or mouse clicks, pop up a yes/no confirmation dialog asking something to the effect of "Are you sure you want to leave and forfeit this game?" This will better defeat accidental leaves, which would still be possible with the options menu checkbox and will prevent accidental keypress quits as well.

Hazado commented 1 year ago

@DamnBriggsy raises a good point. I've always thought it would be better, honestly, for any attempt to leave the heek game, whether via movement keys or mouse clicks, pop up a yes/no confirmation dialog asking something to the effect of "Are you sure you want to leave and forfeit this game?" This will better defeat accidental leaves, which would still be possible with the options menu checkbox and will prevent accidental keypress quits as well.

I also wanted this, but I dont see any movement keys being sent to the script Right now the heek script only gets messages for the sit/stand animation completion

Hoikas commented 1 year ago

We can start off with the incremental improvement for mouse clicking, the, and figure out keypresses in time.

Deledrius commented 1 year ago

@DamnBriggsy raises a good point. I've always thought it would be better, honestly, for any attempt to leave the heek game, whether via movement keys or mouse clicks, pop up a yes/no confirmation dialog asking something to the effect of "Are you sure you want to leave and forfeit this game?" This will better defeat accidental leaves, which would still be possible with the options menu checkbox and will prevent accidental keypress quits as well.

I was thinking about this, and the main issue here is that it would break one of the deliberate core UX elements of Uru when it comes to keeping nearly everything IC. Of course, there's always a balance of pushing that too far one way or the other. What would the "Uru way" be in this case? All options seem strange and tedious, and hardly more realistic. It might be an instance where a simple confirmation dialog, despite breaking "the rules", would be relatively invisible compared to the more IC alternatives.

DamnBriggsy commented 1 year ago

I was thinking about this, and the main issue here is that it would break one of the deliberate core UX elements of Uru when it comes to keeping nearly everything IC. Of course, there's always a balance of pushing that too far one way or the other. What would the "Uru way" be in this case? All options seem strange and tedious, and hardly more realistic. It might be an instance where a simple confirmation dialog, despite breaking "the rules", would be relatively invisible compared to the more IC alternatives.

One spot I can think of where this confirmation dialog happens is for deleting a book from the Relto bookshelf. While I agree that the gamey-ness should be reduced as often as possible, there's some precedent for this already. I think accidental quits in Heek are pretty common, so this would be a good place to break from realism and enter video game territory.

Deledrius commented 1 year ago

That's the one that came to mind as well. It's exceptionally rare, but worthwhile when preventing loss, IMO.

For most other situations, however, I think a passive preference makes more sense. A confirmation dialog to stand from sitting on a park bench is definitely overkill.

dgelessus commented 1 year ago

I just tested a bit. It seems that sitting at a Heek table (or the Teledahn control panel, etc.) handles mouse input a bit differently than "just sitting", e. g. with /sit or on a bench. When you are "just sitting", then any left click will make you stand up immediately. But when sitting at a heek table, a left click alone won't do anything - you also have to drag the mouse a little bit. I wonder if there's an easy way to make that less sensitive, so that you won't get up by accident because you clicked a bit too long, but you can still stand up if you clearly drag the mouse a big enough distance.

That said, perhaps it would be a good idea to make all sitting work like heek tables, etc. and ignore simple mouse clicks. Even though you don't lose anything there, it is annoying to stand up by accident just because you misclicked.

DamnBriggsy commented 1 year ago

Are you sure it's just click and drag? What about click and hold? Everywhere else in the game a click is going to move the avatar forward unless you're on a hotspot. It does make sense to stand up when you click because you are moving forward, though this can be annoying when using the UI and in other situations. I'd hesitate before changing how mouse movement works globally, as it could change the "feel" of the game for those who are used to mouse controls.

Hazado commented 1 year ago

Im going to set this to draft for the moment. I want to do the popup when you try to stand during an active game. It currently requires converting all the seats to multibeh instead of the standard sitting modifier.

Hazado commented 1 year ago

Okay, so multibeh plan was causing me headaches.

You get a popup now when you attempt to leave, asking if you want to leave the game. placeholder text there for the moment. You can use the mouse to leave as well as the keyboard keys. Test it a let me know if this is close to what everyone is looking for.

Hazado commented 1 year ago

Quit message with localized strings now. https://github.com/H-uru/moul-assets/pull/240

Hazado commented 1 year ago

@Hoikas Hoping these changes do what you requested

Set it up so the quit message popup only happens once your playing an active game using the self._round_played variable at line 388 Easy enough to remove that and have the popup quit message happen anytime you sit down instead.

Hazado commented 1 year ago

Added comments and suggested change. Let me know if this needs further explanation