--- kgsueme/kgsueme/game.pl 2003/06/03 18:47:43 1.43
+++ kgsueme/kgsueme/game.pl 2003/07/22 21:24:50 1.69
@@ -54,7 +54,7 @@
} else {
my $time = int (($_[0] - 1) % $interval + 1);
- sprintf "%s/%d {%d}",
+ sprintf "%s/%d =%d",
util::format_time $time,
$self->{moves},
$time / ($self->{moves} || 1);
@@ -147,7 +147,7 @@
}
sub configure {
- my ($self, $user, $rules) = @_;
+ my ($self, $app, $user, $rules) = @_;
if ($self->{name}->get_text ne $user->as_string) {
$self->{name}->set_text ($user->as_string);
@@ -156,15 +156,18 @@
$self->{imagebox}->add (gtk::image_from_data undef);
$self->{imagebox}->show_all;
- # the big picture...
- appwin::userpic ($user->{name}, sub {
- return unless $self->{imagebox};
- if ($_[0]) {
- $self->{imagebox}->remove ($_) for $self->{imagebox}->get_children;
- $self->{imagebox}->add (gtk::image_from_data $_[0]);
- $self->{imagebox}->show_all;
- }
- });
+ if ($user->has_pic) {
+ # the big picture...
+ $app->userpic ($user->{name}, sub {
+ return unless $self->{imagebox};
+
+ if ($_[0]) {
+ $self->{imagebox}->remove ($_) for $self->{imagebox}->get_children;
+ $self->{imagebox}->add (gtk::image_from_data $_[0]);
+ $self->{imagebox}->show_all;
+ }
+ });
+ }
}
$self->{clock}->configure (@{$rules}{qw(timesys time interval count)});
@@ -199,8 +202,6 @@
$self->listen($self->{conn});
$self->{window} = new Gtk2::Window 'toplevel';
- my $title = $self->{channel} ? $self->owner->as_string." ".$self->opponent_string : "Game Window";
- $self->{window}->set_title("KGS Game $title");
gtk::state $self->{window}, "game::window", undef, window_size => [600, 500];
$self->{window}->signal_connect(delete_event => sub {
@@ -229,27 +230,23 @@
$self->{boardbox}->pack_start((my $frame = new Gtk2::Frame), 0, 1, 0);
{
- $frame->add(my $vbox = new Gtk2::VBox);
- $vbox->add($self->{title} = new Gtk2::Label $title);
+ $frame->add (my $vbox = new Gtk2::VBox);
+ $vbox->add ($self->{title} = new Gtk2::Label $title);
- $self->{moveadj} = new Gtk2::Adjustment 0, 0, 0, 1, 1, 0;
+ $vbox->add (my $hbox = new Gtk2::HBox);
- $vbox->add(my $scale = new Gtk2::HScale $self->{moveadj});
+ $hbox->pack_start (($self->{board_label} = new Gtk2::Label), 0, 1, 0);
+
+ $self->{moveadj} = new Gtk2::Adjustment 1, 1, 1, 1, 5, 0;
+
+ $hbox->pack_start ((my $scale = new Gtk2::HScale $self->{moveadj}), 1, 1, 0);
$scale->set_draw_value (0);
$scale->set_digits (0);
$self->{moveadj}->signal_connect (value_changed => sub { $self->update_board });
}
- $self->{boardbox}->pack_start((my $aspect_frame = new Gtk2::AspectFrame "", 0.5, 0.5, 1, 0), 1, 1, 0);
- $aspect_frame->set (border_width => 0, shadow_type => 'none', label_xalign => 0.5);
- $self->{board_label} = $aspect_frame->get_label_widget;
-
- $aspect_frame->add($self->{canvas} = new Gtk2::DrawingArea);
- $self->{canvas}->double_buffered (0) if $::config->{conserve_memory};
-
- $self->{canvas}->signal_connect(configure_event => \&configure_event, $self);
- $self->{canvas}->signal_connect(expose_event => \&expose_event, $self);
+ $self->{boardbox}->add ($self->{board} = new Gtk2::GoBoard size => $self->{size});
# RIGHT PANE
@@ -285,6 +282,21 @@
my ($self, $add, $update, $remove) = @_;
$self->{userlist}->update ($add, $update, $remove);
+
+ my %important;
+ $important{$self->{user1}{name}}++;
+ $important{$self->{user2}{name}}++;
+ $important{$self->{user3}{name}}++;
+
+ if (my @users = grep $important{$_->{name}}, @$add) {
+ $self->{text}->append_text ("\n");
+ $self->{text}->append_text (" " . $_->as_string . "") for @users;
+ }
+ if (my @users = grep $important{$_->{name}}, @$remove) {
+ $self->{text}->append_text ("\n");
+ $self->{text}->append_text (" " . $_->as_string . "") for @users;
+ }
+
}
sub join {
@@ -303,347 +315,6 @@
$self->destroy;
}
-sub configure_event {
- my ($widget, $event, $self) = @_;
- delete $self->{stack};
- delete $self->{pixbuf};
- delete $self->{board_shown};
- delete $self->{background};
- $self->repaint_board;
- 0;
-}
-
-sub expose_event {
- my ($widget, $event, $self) = @_;
-
- $self->{pixbuf} or return;
-
- my $area = $event->area;
-
- $self->redraw ($area);
-
- 0;
-}
-
-# something Gtk2 fixed
-sub INTERP_NEAREST (){ 'nearest' }
-sub INTERP_TILES (){ 'tiles' }
-sub INTERP_BILINEAR (){ 'bilinear' }
-sub INTERP_HYPER (){ 'hyper' }
-
-sub new_pixbuf {
- my ($w, $h, $alpha, $fill) = @_;
-
- my $pixbuf = new Gtk2::Gdk::Pixbuf 'rgb', $alpha, 8, $w, $h;
- $pixbuf->fill ($fill) if defined $fill;
-
- $pixbuf;
-}
-
-sub scale_pixbuf {
- my ($src, $w, $h, $mode) = @_;
-
- my $dst = new_pixbuf $w, $h, 1;
-
- $src->scale(
- $dst, 0, 0, $w, $h, 0, 0,
- $w / $src->get_width, $h / $src->get_height,
- $mode,
- );
-
- $dst;
-}
-
-# create a stack of stones
-sub create_stack {
- my ($self, $mark, $size, $rand) = @_;
-
- my $shadow = $size * 0.05;
-
- my $c = \$self->{stack}{$mark};
- unless ($$c) {
- for my $stone ($mark & (MARK_W | MARK_GRAY_W) ? @::white_img : @::black_img) {
- my $base = new_pixbuf $size + $shadow, $size + $shadow, 1, 0x00000000;
-
- # zeroeth the shadow
- if ($mark & (MARK_B | MARK_W)) {
- # the -0.5's are a mystery to me
- $::shadow_img->composite (
- $base, $shadow, $shadow, $size, $size, $shadow - 0.5, $shadow - 0.5,
- $size / $::shadow_img->get_width, $size / $::shadow_img->get_height,
- $::config->{speed} ? INTERP_NEAREST : INTERP_BILINEAR, 192
- );
- }
-
- # first the big stones (handicap stones could be different)
- for ([MARK_B, $mark & MARK_MOVE ? 255 : 255],
- [MARK_W, $mark & MARK_MOVE ? 255 : 255],
- [MARK_GRAY_B, 128],
- [MARK_GRAY_W, 128]) {
- my ($mask, $alpha) = @$_;
- if ($mark & $mask) {
- $stone->composite (
- $base, 0, 0, $size, $size, 0, 0,
- $size / $stone->get_width, $size / $stone->get_height,
- $::config->{speed} ? INTERP_NEAREST : INTERP_BILINEAR, $alpha
- );
- }
- }
-
- # then the small stones
- for ([MARK_SMALL_B, $::black_img[$rand % @::black_img]],
- [MARK_SMALL_W, $::white_img[$rand % @::white_img]]) {
- my ($mask, $img) = @$_;
- if ($mark & $mask) {
- $img->composite (
- $base, (int ($size / 4)) x2, (ceil ($size / 2 + 1)) x2, ($size / 4) x2,
- $size / $img->get_width / 2, $size / $img->get_height / 2,
- $::config->{speed} ? INTERP_NEAREST : INTERP_BILINEAR, 224
- );
- }
- }
-
- # and lastly any markers
- my $dark_bg = ! ! ($mark & (MARK_B | MARK_GRAY_B));
-
- for ([MARK_CIRCLE, $::circle_img[$dark_bg]],
- [MARK_TRIANGLE, $::triangle_img[$dark_bg]],
- [MARK_SQUARE, $::square_img[$dark_bg]]) {
- my ($mask, $img) = @$_;
- if ($mark & $mask) {
- $img->composite (
- $base, 0, 0, $size, $size, 0, 0,
- $size / $img->get_width, $size / $img->get_height,
- $::config->{speed} ? INTERP_NEAREST : INTERP_BILINEAR, 192
- );
- }
- }
-
- push @$$c, $base;
- }
- }
-
- $$c->[$rand % @$$c];
-}
-
-sub pixbuf_text {
- my ($pixbuf, $colour, $x, $y, $height, $text) = @_;
-
- my @c = grep $_,
- map $::font[$colour][$::fontmap{$_}],
- split //, $text;
-
- if (@c) {
- my $spacing = $height * 0.1;
- my $s = $height / List::Util::max map $_->get_height, @c;
- my $W = List::Util::sum map $_->get_width, @c;
-
- $x -= ($W * $s + $spacing * (@c - 1)) * 0.5;
- $y -= $height * 0.5;
-
- for (@c) {
- my $w = $_->get_width * $s;
- # +2 == don't fight the rounding
- $_->composite ($pixbuf,
- $x, $y, $w+2, $height+2, $x, $y, $s, $s,
- $::config->{speed} ? INTERP_NEAREST : INTERP_BILINEAR, 255);
-
- $x += $w + $spacing;
- }
- }
-}
-
-sub pixbuf_rect {
- my ($pb, $colour, $x1, $y1, $x2, $y2, $alpha) = @_;
- # we fake lines by... a horrible method :/
- my $colour_pb = new_pixbuf 1, 1, 0, $colour;
- $colour_pb->composite ($pb, $x1, $y1, $x2 - $x1 + 1, $y2 - $y1 + 1, $x1, $y1, $x2 + 1, $y2 + 1,
- INTERP_NEAREST, $alpha);
-}
-
-sub repaint_board {
- my ($self) = @_;
- my $canvas = $self->{canvas};
- my $expose_area = undef;
-
- return $expose_area unless $self->{board};
-
- my ($w, $h) = ($canvas->allocation->values)[2,3];
-
- die "FATAL: board aspect ratio != 1" unless $w == $h;
-
- my $s = $w;
-
- return unless $s >= 200;
-
- my $size = $self->{size};
-
- # we leave enough space for the shadows.. I like smaller stones, and we
- # do no need to do the nifty recursive screen updates that goban2 does
- my $border = int ($s / ($size + 3) * 0.5);
- my $s2 = $s - $border * 2;
- my $edge = int ($s2 / ($size + 1) * 0.96) - ($::config->{randomize} ? 3 : 0);
- my $ofs = int ($edge / 2);
-
- my @k = map int ($s2 * $_ / ($size+1) + $border + 0.5), 0 .. $size;
-
- my $pixbuf;
-
- my $oldboard;
-
- if ($self->{background}) {
- if ($oldboard = $self->{board_shown}) {
- $pixbuf = $self->{pixbuf};
- } else {
- $pixbuf = $self->{background}->copy;
- $expose_area = new Gtk2::Gdk::Rectangle 0, 0, $s, $s;
- }
- } else {
- $expose_area = new Gtk2::Gdk::Rectangle 0, 0, $s, $s;
-
- my ($bw, $bh) = ($::board_img->get_width, $::board_img->get_height);
-
- if ($s < $bw && $s < $bh) {
- $pixbuf = new_pixbuf $s, $s, 0;
- $::board_img->copy_area (0, 0, $s, $s, $pixbuf, 0, 0);
- } else {
- $pixbuf = scale_pixbuf $::board_img, $s, $s, $::config->{speed} ? INTERP_NEAREST : INTERP_TILES;
- }
-
- my $linew = int ($s / 40 / $size);
-
- # ornamental border... we have time to waste :/
- pixbuf_rect $pixbuf, 0xffcc7700, 0, 0, $s-1, $linew, 255;
- pixbuf_rect $pixbuf, 0xffcc7700, 0, 0, $linew, $s-1, 255;
- pixbuf_rect $pixbuf, 0xffcc7700, $s-$linew-1, 0, $s-1, $s-1, 255;
- pixbuf_rect $pixbuf, 0xffcc7700, 0, $s-$linew-1, $s-1, $s-1, 255;
-
- for my $i (1 .. $size) {
- pixbuf_rect $pixbuf, 0x44111100, $k[$i] - $linew, $k[1] - $linew, $k[$i] + $linew, $k[$size] + $linew, 192;
- pixbuf_rect $pixbuf, 0x44111100, $k[1] - $linew, $k[$i] - $linew, $k[$size] + $linew, $k[$i] + $linew, 192;
-
- # 38 max, but we allow a bit more
- my $label = (qw(- A B C D E F G H J K L M N O P Q R S T U V W X Y Z
- AA BB CC DD EE FF GG HH JJ KK LL MM NN OO PP QQ RR SS TT UU VV WW XX YY ZZ))[$i];
-
- pixbuf_text $pixbuf, 0, $k[$i], $border, $ofs, $label;
- pixbuf_text $pixbuf, 0, $k[$i], $s2 + $border, $ofs, $label;
- pixbuf_text $pixbuf, 0, $border, $k[$i], $ofs, $size - $i + 1;
- pixbuf_text $pixbuf, 0, $s2 + $border, $k[$i], $ofs, $size - $i + 1;
-
- $a++;
- $a++ if $a eq "I"; # not correct, instead of AA AB, we should get HH JJ KK...
- }
-
- # hoshi points
- my $hoshi = sub {
- my ($x, $y) = @_;
- my $hs = int ($edge / 4) | 1;
- $x = $k[$x] - $hs / 2; $y = $k[$y] - $hs / 2;
-
- # we use the shadow mask... not perfect, but I want to finish this
- $::shadow_img->composite ($pixbuf,
- $x, $y, $hs + 1, $hs + 1, $x, $y,
- $hs / $::shadow_img->get_width, $hs / $::shadow_img->get_height,
- $::config->{speed} ? INTERP_NEAREST : INTERP_BILINEAR, 255);
- };
-
- my $h1 = $size < 10 ? 3 : 4; # corner / edge offset
- $hoshi->($h1, $h1);
- $hoshi->($size - $h1 + 1, $h1);
- $hoshi->($h1, $size - $h1 + 1);
- $hoshi->($size - $h1 + 1, $size - $h1 + 1);
-
- if ($size % 2) { # on odd boards, also the remaining 5
- my $h2 = ($size + 1) / 2;
- if ($size > 10) {
- $hoshi->($h1, $h2);
- $hoshi->($size - $h1 + 1, $h2);
- $hoshi->($h2, $size - $h1 + 1);
- $hoshi->($h2, $h1);
- }
- # the tengen
- $hoshi->($h2, $h2);
- }
-
- unless ($::config->{conserve_memory} > 1) {
- $self->{background} = $pixbuf;
- $pixbuf = $pixbuf->copy;
- }
- }
-
- $self->{pixbuf} = $pixbuf;
-
- for my $x (1 .. $size) {
- for my $y (1 .. $size) {
- my $rand = ($x ^ $y ^ 0x5555);
-
- my ($dx, $dy) = ($k[$x] - $ofs, $k[$y] - $ofs);
-
- if ($::config->{randomize}) {
- $dx += ($rand % 7) - 3;
- $dy += ($rand / 3 % 7) - 3;
- }
-
- my $shadow = $edge * 0.05;
- my $area = [$dx, $dy, $edge + $shadow, $edge + $shadow];
-
- my $mark = $self->{board}{board}[$x-1][$y-1];
- my $old = $oldboard ? $oldboard->{board}[$x-1][$y-1] : 0;
-
- if ($oldboard) {
- next if $old == $mark; # no change
-
- $self->{background}->copy_area (@$area, $pixbuf, $dx, $dy);
- $expose_area = $expose_area
- ? $expose_area->union (new Gtk2::Gdk::Rectangle @$area)
- : new Gtk2::Gdk::Rectangle @$area;
- }
-
- if ($mark) {
- my $pb = $self->create_stack($mark, $edge, $rand);
-
- $pb->composite ($pixbuf, @$area,
- $dx, $dy, 1, 1, $::config->{speed} ? INTERP_NEAREST : INTERP_NEAREST, 255);
-
- # labels are handled here because they are quite rare
- if ($mark & MARK_LABEL) {
- my $white = $mark & (MARK_W | MARK_GRAY_W) ? 0 : 1;
-
- if ($white) {
- pixbuf_text $pixbuf, 0,
- $k[$x] + $ofs * 0.1, $k[$y] + $ofs * 0.1, $ofs * 0.7,
- $self->{board}{label}[$x-1][$y-1];
- }
- pixbuf_text $pixbuf, $white,
- $k[$x], $k[$y], $ofs * 0.7,
- $self->{board}{label}[$x-1][$y-1];
- }
- }
- }
- }
-
- $self->{board_shown} = Storable::dclone $self->{board};
- #d# save
- #Storable::nstore { board => $self->{board}, size => $self->{size}, path => $self->{path}}, "testboard.storable";
-
- $expose_area;
-}
-
-sub redraw {
- my ($self, $area) = @_;
-
- if ($area && $self->{pixbuf}) {
- my ($x, $y, $w, $h) = $area->values;
-
- $self->{canvas}->window->draw_pixbuf ($self->{canvas}->style->white_gc, $self->{pixbuf},
- $x, $y, $x, $y, $w, $h,
- "normal", 0, 0);
- $self->{canvas}->window->draw_rectangle ($self->{canvas}->style->black_gc, 0,
- $x - 1, $y - 1, $w + 2, $h + 2) if $::DEBUG_EXPOSE;
- }
-}
-
sub update_board {
my ($self) = @_;
return unless $self->{path};
@@ -652,21 +323,21 @@
my $running = $move == @{$self->{path}};
- $self->{board_label}->set_text ("Move $move");
+ $self->{board_label}->set_text ("Move " . ($move - 1));
- $self->{board} = new KGS::Game::Board $self->{size};
- $self->{board}->interpret_path ([@{$self->{path}}[0 .. $move - 1]]);
+ $self->{cur_board} = new KGS::Game::Board $self->{size};
+ $self->{cur_board}->interpret_path ([@{$self->{path}}[0 .. $move - 1]]);
for my $colour (WHITE, BLACK) {
$self->{userpanel}[$colour]->set_state (
- $self->{board}{captures}[$colour],
- $self->{board}{timer}[$colour],
+ $self->{cur_board}{captures}[$colour],
+ $self->{cur_board}{timer}[$colour],
($running && $self->{lastmove_colour} == !$colour)
? $self->{lastmove_time} : 0
);
}
- $self->redraw ($self->repaint_board);
+ $self->{board}->set_board ($self->{cur_board});
}
sub event_update_tree {
@@ -677,14 +348,13 @@
if ($self->{moveadj}) {
my $upper = $self->{moveadj}->upper;
my $pos = $self->{moveadj}->get_value;
+ my $move = scalar @{$self->{path}};
- $self->{moveadj}->upper (scalar @{$self->{path}});
+ $self->{moveadj}->upper ($move);
- warn "UPDATE_TREE $pos,$upper";#d#
$self->{moveadj}->changed;
if ($pos == $upper) {
- $self->{moveadj}->set_value (scalar @{$self->{path}});
- } else {
+ $self->{moveadj}->value ($move);
$self->{moveadj}->value_changed;
}
}
@@ -735,6 +405,7 @@
sub event_part {
my ($self) = @_;
$self->SUPER::event_part;
+ $self->destroy;
}
sub event_move {
@@ -746,11 +417,17 @@
my ($self) = @_;
$self->SUPER::event_update_game;
+ my $title = defined $self->{channel}
+ ? $self->owner->as_string . " " . $self->opponent_string
+ : "Game Window";
+ $self->{window}->set_title("KGS Game $title");
+ $self->{title}->set_text ($title);
+
$self->{user}[BLACK] = $self->{user1};
$self->{user}[WHITE] = $self->{user2};
# show board
-
+
$self->{left}->remove ($_) for $self->{left}->get_children;
if ($self->is_valid) {
$self->{left}->add ($self->{boardbox});
@@ -762,35 +439,54 @@
# view text
- $text = "\n";
-
- $text .= "\nType: " . (util::toxml $gametype{$self->type})
- . " (" . (util::toxml $gameopt{$self->option}) . ")";
- $text .= "\nFlags:";
- $text .= " valid" if $self->is_valid;
- $text .= " adjourned" if $self->is_adjourned;
- $text .= " scored" if $self->is_scored;
- $text .= " saved" if $self->is_saved;
-
- $text .= "\nWhite: " . (util::toxml $self->{user2}->as_string) . "";
- $text .= "\nBlack: " . (util::toxml $self->{user1}->as_string) . "";
- $text .= "\nOwner: " . (util::toxml $self->{user3}->as_string) . "" if $self->{user3}->is_valid;
+ eval { #d#
+ my @ga;
+ $ga[0] = "\nType: " . (util::toxml $gametype{$self->type})
+ . " (" . (util::toxml $gameopt{$self->option}) . ")";
+ $ga[1] = "\nFlags:";
+ $ga[1] .= " valid" if $self->is_valid;
+ $ga[1] .= " adjourned" if $self->is_adjourned;
+ $ga[1] .= " scored" if $self->is_scored;
+ $ga[1] .= " saved" if $self->is_saved;
+
+ $ga[2] = "\nOwner: " . (util::toxml $self->{user3}->as_string) . "" if $self->{user3}->is_valid;
+
+ $ga[3] = "\nPlayers: " . (util::toxml $self->{user2}->as_string) . ""
+ . " vs. " . (util::toxml $self->{user1}->as_string) . ""
+ if $self->is_valid;
if ($self->is_valid) {
- $text .= "\nHandicap: " . $self->{handicap};
- $text .= "\nKomi: " . $self->{komi};
- $text .= "\nSize: " . $self->size_string;
+ $ga[4] = "\nHandicap: " . $self->{handicap};
+ $ga[5] = "\nKomi: " . $self->{komi};
+ $ga[6] = "\nSize: " . $self->size_string;
}
- $self->{text}->append_text ("$text");
+ if ($self->is_scored) {
+ $ga[7] = "\nResult: " . $self->score_string;
+ }
+
+ $text = "\n";
+ for (0..7) {
+ if ($self->{gatext}[$_] ne $ga[$_]) {
+ $text .= $ga[$_];
+ }
+ }
+ $text .= "";
+
+ $self->{gatext} = \@ga;
+ };
+
+ $self->{text}->append_text ($text);
}
sub event_update_rules {
my ($self, $rules) = @_;
- $self->{userpanel}[$_]->configure ($self->{user}[$_], $rules)
+ $self->{userpanel}[$_]->configure ($self->{app}, $self->{user}[$_], $rules)
for BLACK, WHITE;
+ sound::play 3, "gamestart";
+
my $text = "\n";
$text .= "\nRuleset: " . $ruleset{$rules->{ruleset}};
@@ -798,15 +494,16 @@
$text .= "\nTime: ";
if ($rules->{timesys} == TIMESYS_NONE) {
- $text .= "infinite";
+ $text .= "UNLIMITED";
} elsif ($rules->{timesys} == TIMESYS_ABSOLUTE) {
$text .= util::format_time $rules->{time};
+ $text .= " ABS";
} elsif ($rules->{timesys} == TIMESYS_BYO_YOMI) {
$text .= util::format_time $rules->{time} - $rules->{interval} * $rules->{count};
- $text .= sprintf " + %s (%d)", util::format_time $rules->{interval}, $rules->{count};
+ $text .= sprintf " + %s (%d) BY", util::format_time $rules->{interval}, $rules->{count};
} elsif ($rules->{timesys} == TIMESYS_CANADIAN) {
$text .= util::format_time $rules->{time};
- $text .= sprintf " + %s/%d", util::format_time $rules->{interval}, $rules->{count};
+ $text .= sprintf " + %s/%d CAN", util::format_time $rules->{interval}, $rules->{count};
}
$self->{text}->append_text ("$text");
@@ -815,6 +512,8 @@
sub inject_resign_game {
my ($self, $msg) = @_;
+ sound::play 3, "resign";
+
$self->{text}->append_text ("\n"
. "\n"
. (util::toxml $self->{user}[$msg->{player}]->as_string)
@@ -831,12 +530,19 @@
);
}
+sub event_challenge {
+ my ($self, $challenge) = @_;
+
+ use KGS::Listener::Debug;
+ $self->{text}->append_text ("\n".KGS::Listener::Debug::dumpval($challenge));
+}
+
sub destroy {
my ($self) = @_;
$self->{userpanel}[$_] && (delete $self->{userpanel}[$_])->destroy
for BLACK, WHITE;
$self->SUPER::destroy;
- delete $appwin::gamelist->{game}{$self->{channel}};
+ delete $self->{app}{gamelist}{game}{$self->{channel}};
}
1;