Don't wait for new game to be sent before defining the character

This commit is contained in:
Tissevert 2018-12-29 14:32:23 +01:00
parent 75417035f6
commit c05296fda4

View file

@ -111,14 +111,16 @@ function Automaton(async, cache, dom, messaging, screen, session, ui) {
ui.frame('GameInit'); ui.frame('GameInit');
messaging.send({tag: 'NewGame'}); messaging.send({tag: 'NewGame'});
async.run( async.run(
session.syncGame(), async.parallel(
async.bind( session.syncGame(),
askName(), async.bind(
set('name'), askName(),
askSkin, set('name'),
set('skin'), askSkin,
askGender, set('skin'),
set('gender') askGender,
set('gender')
),
), ),
async.apply(session.set, {character: character}), async.apply(session.set, {character: character}),
async.apply(screen.clear, 'text') async.apply(screen.clear, 'text')