ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/kgsueme/game.pl
(Generate patch)

Comparing kgsueme/kgsueme/game.pl (file contents):
Revision 1.99 by pcg, Sun May 30 03:03:38 2004 UTC vs.
Revision 1.100 by pcg, Sun May 30 03:24:47 2004 UTC

251 251
252 $vbox->pack_start ((my $hbox = new Gtk2::HBox 1), 0, 1, 0); 252 $vbox->pack_start ((my $hbox = new Gtk2::HBox 1), 0, 1, 0);
253 253
254 $hbox->add ($self->{userpanel}[$_] = new game::userpanel colour => $_) 254 $hbox->add ($self->{userpanel}[$_] = new game::userpanel colour => $_)
255 for COLOUR_WHITE, COLOUR_BLACK; 255 for COLOUR_WHITE, COLOUR_BLACK;
256
257 $vbox->pack_start ((my $buttonbox = new Gtk2::HButtonBox), 0, 1, 0);
258
259 #$buttonbox->I#
256 260
257 $vbox->pack_start (($self->{chat} = new superchat), 1, 1, 0); 261 $vbox->pack_start (($self->{chat} = new superchat), 1, 1, 0);
258 262
259 $self->set_channel ($self->{channel}); 263 $self->set_channel ($self->{channel});
260 264
488 if ($self->is_inprogress) { 492 if ($self->is_inprogress) {
489 if (!$self->{boardbox}->parent) { 493 if (!$self->{boardbox}->parent) {
490 $self->{boardbox}->add ($self->{board} = new Gtk2::GoBoard size => $self->{size}); 494 $self->{boardbox}->add ($self->{board} = new Gtk2::GoBoard size => $self->{size});
491 $self->{left}->add ($self->{boardbox}); 495 $self->{left}->add ($self->{boardbox});
492 $self->{board}->signal_connect (button_release => sub { 496 $self->{board}->signal_connect (button_release => sub {
493 warn "XXX @_\n";#d#
494 if ($_[1] == 1) { 497 if ($_[1] == 1) {
495 $self->{board_click}->($_[2], $_[3]) if $self->{board_click}; 498 $self->{board_click}->($_[2], $_[3]) if $self->{board_click};
496 } 499 }
497 }); 500 });
498 } 501 }
580 sound::play 3, "gamestart"; 583 sound::play 3, "gamestart";
581 584
582 $self->{rules_inlay}->refresh; 585 $self->{rules_inlay}->refresh;
583} 586}
584 587
585sub inject_resign_game { 588sub event_resign_game {
586 my ($self, $msg) = @_; 589 my ($self, $player) = @_;
587 590
588 sound::play 3, "resign"; 591 sound::play 3, "resign";
589
590 $self->{chat}->append_text ("\n<infoblock><header>Resign</header>" 592 $self->{chat}->append_text ("\n<infoblock><header>Resign</header>"
591 . "\n<user>" 593 . "\n<user>"
592 . (util::toxml $self->{user}[$msg->{player}]->as_string) 594 . (util::toxml $self->{user}[$msg->{player}]->as_string)
593 . "</user> resigned.</infoblock>"); 595 . "</user> resigned.</infoblock>");
596}
597
598sub event_out_of_time {
599 my ($self, $player) = @_;
600
601 sound::play 3, "timewin";
602 $self->{chat}->append_text ("\n<infoblock><header>Time Over</header>"
603 . "\n<user>"
604 . (util::toxml $self->{user}[$msg->{player}]->as_string)
605 . "</user> ran out of time.</infoblock>");
594} 606}
595 607
596sub inject_final_result { 608sub inject_final_result {
597 my ($self, $msg) = @_; 609 my ($self, $msg) = @_;
598 610

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines