… | |
… | |
30 | BEGIN { |
30 | BEGIN { |
31 | our $VERSION = "0.1"; |
31 | our $VERSION = "0.1"; |
32 | |
32 | |
33 | our $config; |
33 | our $config; |
34 | our $LIBDIR = "."; |
34 | our $LIBDIR = "."; |
35 | our $APPDIR = "$LIBDIR/kgsueme"; |
|
|
36 | our $IMGDIR = "$LIBDIR/images"; |
|
|
37 | our $SNDDIR = "$LIBDIR/sounds"; |
|
|
38 | |
35 | |
|
|
36 | use KGS::Constants; |
|
|
37 | |
39 | for (qw(util.pl gtk.pl chat.pl image.pl sound.pl user.pl gamelist.pl userlist.pl challenge.pl |
38 | for (qw(util.pl gtk.pl chat.pl superchat.pl sound.pl user.pl gamelist.pl userlist.pl challenge.pl |
40 | board.pl game.pl room.pl roomlist.pl app.pl)) { |
39 | game.pl room.pl roomlist.pl app.pl)) { |
41 | require "$APPDIR/$_"; |
40 | require (KGS::Constants::findfile "KGS/kgsueme/$_"); |
|
|
41 | die if $@; |
42 | } |
42 | } |
43 | } |
43 | } |
44 | |
44 | |
45 | our $app = new app; |
45 | if ($ENV{KGSUEME_DEBUG}) { |
|
|
46 | my $window = new Gtk2::Window 'toplevel'; |
|
|
47 | my $chat = new superchat; |
46 | |
48 | |
47 | if (0) { |
49 | $window->add ($chat); |
|
|
50 | show_all $window; |
|
|
51 | |
|
|
52 | $chat->append_text ("A\n"); |
|
|
53 | $chat->append_text ("B\n"); |
|
|
54 | $chat->append_text ("C\n"); |
|
|
55 | $chat->append_text ("D\n"); |
|
|
56 | |
|
|
57 | $chat->{full}->clear; |
|
|
58 | |
|
|
59 | $chat->append_text ("F\n"); |
|
|
60 | $chat->append_text ("G\n"); |
|
|
61 | |
|
|
62 | main Gtk2; |
|
|
63 | |
48 | use KGS::Constants; |
64 | use KGS::Constants; |
49 | |
65 | |
50 | for (19) { |
66 | for (19) { |
51 | my $game = new game size => $_; |
67 | my $game = new game size => $_; |
52 | |
68 | |
53 | if (1) { |
69 | if (1) { |
54 | my $data = Storable::retrieve "board1.dat"; |
70 | my $data = Storable::retrieve "board2.dat"; |
55 | while (my ($k, $v) = each %$data) { |
71 | while (my ($k, $v) = each %$data) { |
56 | $game->{$k} = $v; |
72 | $game->{$k} = $v; |
57 | } |
73 | } |
58 | $game->event_update_tree; |
74 | $game->event_update_tree; |
59 | } |
75 | } |
… | |
… | |
86 | } |
102 | } |
87 | $game->{window}->show_all; |
103 | $game->{window}->show_all; |
88 | } |
104 | } |
89 | } |
105 | } |
90 | |
106 | |
|
|
107 | our $app = new app; |
|
|
108 | |
91 | main Gtk2; |
109 | main Gtk2; |
92 | |
110 | |
93 | $app->destroy; |
111 | $app->destroy; |
94 | |
112 | |
95 | Gtk2->main_iteration while Gtk2->events_pending; |
113 | Gtk2->main_iteration while Gtk2->events_pending; |