Check-in [db3405fee7]
Not logged in
Overview
SHA1 Hash:db3405fee706e3031058664c0b51b1a338cea288
Date: 2012-07-15 01:07:05
User: kinaba
Comment:Not to responde keyboard when auto-gui mode.
Timelines: family | ancestors | descendants | both | trunk
Diffs: redesign
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified src/gui.d from [bcbc7e6a97423060] to [6f9d0f82c55a2152].

6 class GUI(Solver) : Form, GameObserver 6 class GUI(Solver) : Form, GameObserver 7 { 7 { 8 this(in Game g) 8 this(in Game g) 9 { 9 { 10 this.solver = new Solver(g); 10 this.solver = new Solver(g); 11 setup_size(g.map.W, g.map.H); 11 setup_size(g.map.W, g.map.H); 12 setup_resources(); 12 setup_resources(); 13 setup_keyhandling(); < 14 draw(g); 13 draw(g); 15 } 14 } 16 15 17 private void delegate(char c) fn; 16 private void delegate(char c) fn; 18 void set_fn(F)(F f) { this.fn = f; } 17 void set_fn(F)(F f) { this.fn = f; } 19 18 20 void run(bool automate = false) 19 void run(bool automate = false) ................................................................................................................................................................................ 23 Timer t = new Timer; 22 Timer t = new Timer; 24 t.interval = 50; 23 t.interval = 50; 25 t.tick ~= (Timer sender, EventArgs ea){ 24 t.tick ~= (Timer sender, EventArgs ea){ 26 fn(solver.single_step()); 25 fn(solver.single_step()); 27 }; 26 }; 28 t.start(); 27 t.start(); 29 this.closing ~= (Form f,CancelEventArgs c){t.stop();}; 28 this.closing ~= (Form f,CancelEventArgs c){t.stop();}; > 29 } else { > 30 setup_keyhandling(); 30 } 31 } 31 Application.run(this); 32 Application.run(this); 32 } 33 } 33 34 34 override void on_game_changed(char c, in Game g, bool finished) 35 override void on_game_changed(char c, in Game g, bool finished) 35 { 36 { 36 draw(g); 37 draw(g);