);
});
@@ -433,14 +453,34 @@ const PromptOptions = React.memo(props => {
const LetsPlay = React.memo(props => {
- const quorum = Math.round((props.num_players + 1) / 2);
+ const quorum = Math.max(0, props.num_players - props.prompts.length);
const max_votes = props.prompts.reduce(
(max_so_far, v) => Math.max(max_so_far, v.votes.length), 0);
- if (max_votes < quorum)
- return null;
+ if (max_votes < quorum) {
+ let text = `Before we play, we should collect a bit
+ more information about what category would
+ be interesting for this group. So, either
+ type a new category option above, or else`;
+ if (props.prompts.length) {
+ if (props.prompts.length > 1)
+ text += " vote on some of the categories below.";
+ else
+ text += " vote on the category below.";
+ } else {
+ text += " wait for others to submit, and then vote on them below.";
+ }
- const candidates = props.prompts.filter(p => p.votes.length >= quorum);
+ return (
+
- Click on each pair of answers that should be scored as equivalent,
- (and click any word twice to split it out from a group). Remember,
+ Click/tap on each pair of answers that should be scored as equivalent,
+ (or click a word twice to split it out from a group). Remember,
what goes around comes around, so it's best to be generous when
judging.
+
+ Also, for an especially fun or witty answer, you can give kudos
+ by clicking the star on the right. You may only do this for one
+ word/group.
+
{this.props.prompt.prompt}
{this.state.word_sets.map(set => {
return (
@@ -702,9 +750,15 @@ class Ambiguities extends React.PureComponent {
}
onClick={(event) => {
event.stopPropagation();
- this.setState({
- starred: set
- });
+ if (this.state.starred === set) {
+ this.setState({
+ starred: null
+ });
+ } else {
+ this.setState({
+ starred: set
+ });
+ }
}}
>
{this.state.starred === set ?
@@ -789,29 +843,6 @@ class ActivePrompt extends React.PureComponent {
}
render() {
- let move_on_button = null;
- if (this.props.idle) {
- move_on_button =(
-
- );
- }
let still_waiting = null;
const answering_players = Object.keys(this.props.players_answering);;
@@ -845,6 +876,32 @@ class ActivePrompt extends React.PureComponent {
);
}
+ let move_on_button = null;
+ if (this.props.idle) {
+ move_on_button =(
+
+ );
+ }
+
if (this.props.players_answered.has(this.props.player.name)) {
return (
@@ -951,9 +1008,16 @@ class Game extends React.PureComponent {
});
}
- remove_player(info) {
+ disable_player(info) {
+ const idx = this.state.other_players.findIndex(o => o.id === info.id);
+ if (idx < 0)
+ return;
+
+ const other_players_copy = [...this.state.other_players];
+ other_players_copy[idx].active = false;
+
this.setState({
- other_players: this.state.other_players.filter(o => o.id !== info.id)
+ other_players: other_players_copy
});
}
@@ -1192,10 +1256,11 @@ class Game extends React.PureComponent {
render() {
const state = this.state;
- const players_total = 1 + state.other_players.length;
if (state.scores) {
+ const players_total = state.players_answered.size;
+
let perfect_score = 0;
for (let i = 0;
i < state.active_prompt.items &&
@@ -1212,12 +1277,22 @@ class Game extends React.PureComponent {