1 |
pcg |
1.25 |
#!/usr/bin/perl |
2 |
pcg |
1.1 |
|
3 |
pcg |
1.32 |
use Glib; |
4 |
|
|
use Gtk2; |
5 |
pcg |
1.1 |
|
6 |
|
|
use KGS::Protocol; |
7 |
|
|
use KGS::Listener::Debug; |
8 |
|
|
|
9 |
pcg |
1.16 |
use Audio::Data; |
10 |
|
|
use Audio::Play; |
11 |
|
|
|
12 |
pcg |
1.1 |
use IO::Socket::INET; |
13 |
pcg |
1.25 |
use List::Util; |
14 |
pcg |
1.1 |
use Errno; |
15 |
|
|
|
16 |
pcg |
1.32 |
use Storable; |
17 |
pcg |
1.40 |
use Carp; |
18 |
pcg |
1.32 |
|
19 |
|
|
init Gtk2; |
20 |
pcg |
1.40 |
|
21 |
|
|
$SIG{QUIT} = sub { Carp::confess "SIGQUIT" }; |
22 |
pcg |
1.1 |
|
23 |
pcg |
1.26 |
our $HACK = 1; # do NEVER enable. ;) |
24 |
pcg |
1.29 |
our $DEBUG_EXPOSE = 0; |
25 |
pcg |
1.3 |
|
26 |
pcg |
1.25 |
if ($HACK) { |
27 |
|
|
$KGS::debug = 1; |
28 |
|
|
} |
29 |
|
|
|
30 |
pcg |
1.26 |
our $VERSION = "0.1"; |
31 |
|
|
|
32 |
pcg |
1.2 |
our $config; |
33 |
pcg |
1.16 |
our $LIBDIR = "."; |
34 |
pcg |
1.32 |
our $APPDIR = "$LIBDIR/kgsueme"; |
35 |
pcg |
1.16 |
our $IMGDIR = "$LIBDIR/images"; |
36 |
|
|
our $SNDDIR = "$LIBDIR/sounds"; |
37 |
pcg |
1.7 |
|
38 |
pcg |
1.41 |
for (qw(util.pl gtk.pl image.pl sound.pl gamelist.pl userlist.pl challenge.pl |
39 |
|
|
board.pl game.pl room.pl roomlist.pl appwin.pl)) { |
40 |
pcg |
1.32 |
print "loading module $_\n"; |
41 |
|
|
require "$APPDIR/$_"; |
42 |
pcg |
1.7 |
} |
43 |
|
|
|
44 |
pcg |
1.32 |
our $appwin = new appwin; |
45 |
pcg |
1.1 |
|
46 |
pcg |
1.43 |
if (1) { |
47 |
pcg |
1.17 |
use KGS::Constants; |
48 |
|
|
|
49 |
pcg |
1.25 |
for (19) { |
50 |
pcg |
1.41 |
my $board = new game size => $_;# %{Storable::retrieve "testboard.storable"}; |
51 |
pcg |
1.26 |
|
52 |
pcg |
1.41 |
if (1) { |
53 |
|
|
$board->{cur_board} = new KGS::Game::Board; |
54 |
|
|
$board->{cur_board}{board}[0][0] = MARK_B; |
55 |
|
|
$board->{cur_board}{board}[1][1] = MARK_GRAY_B | MARK_SMALL_W; |
56 |
|
|
$board->{cur_board}{board}[2][2] = MARK_W | MARK_TRIANGLE; |
57 |
|
|
$board->{cur_board}{board}[1][2] = MARK_B | MARK_LABEL; |
58 |
|
|
$board->{cur_board}{label}[1][2] = "198"; |
59 |
|
|
$board->{cur_board}{board}[0][2] = MARK_W | MARK_LABEL; |
60 |
|
|
$board->{cur_board}{label}[0][2] = "AWA"; |
61 |
pcg |
1.26 |
} |
62 |
pcg |
1.25 |
$board->{window}->show_all; |
63 |
pcg |
1.41 |
$board->{board}->set_board ($board->{cur_board}); |
64 |
pcg |
1.25 |
} |
65 |
pcg |
1.12 |
} |
66 |
|
|
|
67 |
pcg |
1.32 |
main Gtk2; |
68 |
pcg |
1.1 |
|
69 |
pcg |
1.34 |
$appwin->destroy; |
70 |
|
|
|
71 |
|
|
Gtk2->main_iteration while Gtk2->events_pending; |
72 |
|
|
|
73 |
|
|
1; |
74 |
pcg |
1.1 |
|
75 |
|
|
|