Open rizen opened 8 months ago
Interestingly, if I change the code to this:
solve: player => action({ prompt: 'Solve the puzzle' })
.chooseFrom('yes', ['Solve the Puzzle'], { skipIf: 'never' })
.enterText('guess', { prompt: 'Solve the puzzle', initial: '' })
.do(({ guess }) => {
if (guess.toLowerCase() == game.solution.toLowerCase())
game.finish(player)
else
game.message(`${player} guessed ${guess} which was wrong`)
}),
Then on the subsequent after hitting the "solve the puzzle" button, it shows both prompts:
Whereas before it looked like this:
So apparently it should already work as I expected, but just doesn't
given:
Note how you have to define the prompt twice? The prompt inside the
action
is ignored and just the text box is displayed until you fill in the prompt in the options forenterText
.I'm thinking maybe enterText should inherit the prompt from the action, or just use the one from the action and get rid of the option. This eliminates redundancy.