From ba76f934a84a1f9ac702fd2e903f27c21704c598 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 24 Jul 2018 13:34:29 +0200 Subject: [PATCH] Wire up Button for Random Order --- web/main.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web/main.dart b/web/main.dart index 1709bbc..476ac28 100644 --- a/web/main.dart +++ b/web/main.dart @@ -101,6 +101,7 @@ void activate(MouseEvent e) { void addControls(Example ex) { DivElement group = new DivElement(); + ButtonElement randomButton = new ButtonElement()..text = "Random/Ordered"; querySelector(ex.query).append(group ..append(new ButtonElement() ..text = "Start" @@ -123,11 +124,13 @@ void addControls(Example ex) { ..onClick.listen((e) { ex.loop.game.changeGridSize(false); })) - ); - + ..append(randomButton + ..onClick.listen((e) { + ex.loop.game.toggleRandomOrder(); + }))); // Don't add controls which don't work anyways (for simple examples) - if(examples.indexOf(ex) <= 1) return; + if (examples.indexOf(ex) <= 1) return; VariableUpdates loop = (ex.loop as VariableUpdates); // Update Speed Slider