The Wayback Machine - https://web.archive.org/web/20200825063401/https://github.com/boardgameio/boardgame.io/issues/771
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

Debug panel keyboard shortcuts for selecting among activePlayers and end turn/end phase/end stage #771

Open
shenker opened this issue Aug 9, 2020 · 2 comments

Comments

@shenker
Copy link

@shenker shenker commented Aug 9, 2020

  1. As far as I can tell, the debug panel cannot issue moves for activePlayers other than currentPlayer (even though it seems like you should be able to click on the numbered boxes under “Players” to select other players). It would be nice to have this capability, and also to have keyboard shortcuts to select amongst these activePlayers.

  2. It would be great to have keyboard shortcuts for end turn/end phase/end stage. The debug panel has been super helpful for learning bgio, and keyboard shortcuts would make experience even more efficient.

@delucis delucis added the feature label Aug 9, 2020
@nicolodavis
Copy link
Member

@nicolodavis nicolodavis commented Aug 10, 2020

Good idea!

@delucis
Copy link
Contributor

@delucis delucis commented Aug 10, 2020

For some context re: 2, if someone would like to pick this up, this is where the event buttons in the debug panel are currently declared:

<div class="events">
{#if client.events.endTurn}
<button on:click={() => client.events.endTurn()}>End Turn</button>
{/if}
{#if ctx.phase && client.events.endPhase}
<button on:click={() => client.events.endPhase()}>End Phase</button>
{/if}
{#if ctx.activePlayers && client.events.endStage}
<button on:click={() => client.events.endStage()}>End Stage</button>
{/if}
</div>

We are already reserving a keyboard shortcut for the events, so we should be able to wire them up without too many complications. We could potentially use the <Move> component to render them as interactive functions like the moves are, or alternatively the <Hotkey> component to render them like the reset/save/restore controls.

<Move> component in use:

<Move shortcut={shortcuts[name]} {fn} {name} />

<Hotkey> component in use:

<Hotkey value="1" onPress={client.reset} label="reset" />

Would also be cool to fix 1 — I’ll see if I can figure out why that’s happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.