Wire up Button for Random Order
This commit is contained in:
parent
994a008482
commit
ba76f934a8
1 changed files with 6 additions and 3 deletions
|
@ -101,6 +101,7 @@ void activate(MouseEvent e) {
|
||||||
|
|
||||||
void addControls(Example ex) {
|
void addControls(Example ex) {
|
||||||
DivElement group = new DivElement();
|
DivElement group = new DivElement();
|
||||||
|
ButtonElement randomButton = new ButtonElement()..text = "Random/Ordered";
|
||||||
querySelector(ex.query).append(group
|
querySelector(ex.query).append(group
|
||||||
..append(new ButtonElement()
|
..append(new ButtonElement()
|
||||||
..text = "Start"
|
..text = "Start"
|
||||||
|
@ -123,8 +124,10 @@ void addControls(Example ex) {
|
||||||
..onClick.listen((e) {
|
..onClick.listen((e) {
|
||||||
ex.loop.game.changeGridSize(false);
|
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)
|
// Don't add controls which don't work anyways (for simple examples)
|
||||||
if (examples.indexOf(ex) <= 1) return;
|
if (examples.indexOf(ex) <= 1) return;
|
||||||
|
|
Loading…
Reference in a new issue