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

Improved advantage selection? #81

Closed
TheSHEEEP opened this issue Jan 11, 2020 · 7 comments
Closed

Improved advantage selection? #81

TheSHEEEP opened this issue Jan 11, 2020 · 7 comments
Milestone

Comments

@TheSHEEEP
Copy link

TheSHEEEP commented Jan 11, 2020

Hey,

really love the extension so far.

One thing that bugs me (a little) is that you basically have to set the advantage to "always ask" in order to react to all kinds of situations.
You're always navigating menus for this.

It would be much easier if you could do something like adding another button next to the beyond20 button for rolling, one for a normal roll, one for advantage roll, one for disadvantage roll, etc.
That way, only one click would be necessary for each roll instead of having to navigate menus each time.

Alternatively, something like holding shift/control/alt while clicking the button could lead to different rolls.

Or right-clicking the roll-button (not sure if that is doable, might be a bit intrusive).

@kakaroto
Copy link
Owner

Hi,
Thanks for the suggestion! I don't want to overcrowd the interface with many buttons, so I don't want to add one for advantage/disadvantage/normal. Usually, my players just have it set to always roll twice, and we always use the first number rolled, unless there's an advantage or disadvantage.

The idea of having the modifers with Shift/Control/Alt is great and will definitely be adding that. I'll need to find a way to make it obvious because rare are those who read the documentation! Perhaps a tooltip would be enough.

Thanks!

@TheSHEEEP
Copy link
Author

I agree modifier keys are better.
I'd probably put a note in the configuration menu for it (like, "btw. did you know that you can press shift/control/alt while pressing to do XYZ...").
And maybe a notification when a roll button is pressed for the first time? Just shoving it into people's faces a single time.
Changing the icon of the roll button (its color?) while you press any of the modifiers?

Many methods here to convey that something is happening, but I don't know if some of them wouldn't be too much.

In the end, when it comes to modifier keys, you'll never be able to make it perfectly clear and obvious to everyone all the time. Not even high-profile games manage to do that.

@kakaroto
Copy link
Owner

I think it would be a bigger issue if the only way to do advantage was with modifiers, but most people will still just the options from the quick settings menu. Having the modifiers is just a little plus.
It's a good idea to have a visual indication on the button when there's advantage/disadvantage. I think I'll do that everytime (A little + and - for adv/disadvantage that shows up according to the settings option and appears when modifier is pressed.
Thanks for the suggestion!

@TheSHEEEP
Copy link
Author

Since I'm an impatient guy (and wanted this for an upcoming session), I just went ahead and created a completely bare-bones variant of this for myself in a few minutes.
(posting this here just in case someone wants to do it themselves before the official version is done)

Adding this near the top of dndbeyond.pyj:

# Listen to modifier keys
modifierStatus = [False, False, False]
$(document).keydown( def(event):
    # ctrl
    if event.which == 17:
        modifierStatus[0] = True
    # shift
    if event.which == 16:
        modifierStatus[1] = True
    # lalt
    if event.which == 18:
        modifierStatus[2] = True
)
$(document).keyup( def(event):
    # ctrl
    if event.which == 17:
        modifierStatus[0] = False
    # shift
    if event.which == 16:
        modifierStatus[1] = False
    # lalt
    if event.which == 18:
        modifierStatus[2] = False
)

And this in def sendRoll in the same file (after the advantage is read from settings):

    advantage = int(character.getGlobalSetting("roll-type", RollType.NORMAL))

    # Do we have modifiers pressed to change the type of roll?
    if modifierStatus[0] == True:
        advantage = RollType.ADVANTAGE
    elif modifierStatus[1] == True:
        advantage = RollType.DISADVANTAGE

As I said, totally bare-bones, no changes to buttons or anything. Just advantage on Ctrl and Disadvantage on Shift. But it does work.

@kakaroto kakaroto added this to the 0.9 milestone Feb 7, 2020
@kakaroto
Copy link
Owner

Hey, thanks for the code. I was going to do it differently, but it ended up being needlessly complex so I used your method.
I've now released v0.9 (immediate on firefox, but as always 'pending review' on chrome).
Thanks again for the great idea.

@Rarst
Copy link

Rarst commented Apr 30, 2020

This is very handy! But might need surfacing in the interface and/or documentation, only found this by digging in the issue tracker here. :)

@kakaroto
Copy link
Owner

It was in the release notes :p but yes, I need to make it more clear for people.
Also, people are raging about it, figuring it out on their own in here :
https://www.dndbeyond.com/forums/d-d-beyond-general/general-discussion/38455-beyond20-integrating-d-d-beyond-with-roll20?page=9 :)

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

No branches or pull requests

3 participants