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.138 by root, Sat Jul 10 21:07:37 2004 UTC vs.
Revision 1.139 by root, Mon Aug 9 21:59:37 2004 UTC

325sub set_channel { 325sub set_channel {
326 my ($self, $channel) = @_; 326 my ($self, $channel) = @_;
327 327
328 $self->{channel} = $channel; 328 $self->{channel} = $channel;
329 329
330 if ($self->{channel} > 0) { 330 if (defined $self->{channel}) {
331 $self->listen ($self->{conn}); 331 $self->listen ($self->{conn});
332 332
333 $self->{rules_inlay} = $self->{chat}->new_switchable_inlay ("Game Setup:", sub { $self->draw_setup (@_) }, 1); 333 $self->{rules_inlay} = $self->{chat}->new_switchable_inlay ("Game Setup:", sub { $self->draw_setup (@_) }, 1);
334 $self->{users_inlay} = $self->{chat}->new_switchable_inlay ("Users:", sub { $self->draw_users (@_) }, 1); 334 $self->{users_inlay} = $self->{chat}->new_switchable_inlay ("Users:", sub { $self->draw_users (@_) }, 1);
335 335
905 my $as_black = $info->{black}{name} eq $self->{conn}{name} ? 1 : 0;; 905 my $as_black = $info->{black}{name} eq $self->{conn}{name} ? 1 : 0;;
906 my $opponent = $as_black ? $info->{white} : $info->{black}; 906 my $opponent = $as_black ? $info->{white} : $info->{black};
907 907
908 my ($size, $time, $interval, $count, $type); 908 my ($size, $time, $interval, $count, $type);
909 909
910 if (!$self->{channel}) { 910 if (!defined $self->{channel}) {
911 $inlay->append_text ("\nNotes: "); 911 $inlay->append_text ("\nNotes: ");
912 $inlay->append_widget (gtk::textentry \$info->{notes}, 20, ""); 912 $inlay->append_widget (gtk::textentry \$info->{notes}, 20, "");
913 $inlay->append_text ("\nGlobal Offer: "); 913 $inlay->append_text ("\nGlobal Offer: ");
914 $inlay->append_optionmenu (\$info->{flags}, 914 $inlay->append_optionmenu (\$info->{flags},
915 0 => "No", 915 0 => "No",
932 sub { 932 sub {
933 $size->set_history (2) if $_[0] eq GAMETYPE_RATED; 933 $size->set_history (2) if $_[0] eq GAMETYPE_RATED;
934 }, 934 },
935 ); 935 );
936 936
937 if ($self->{channel}) { 937 if (defined $self->{channel}) {
938 $inlay->append_text ("\nMy Colour: "); 938 $inlay->append_text ("\nMy Colour: ");
939 $inlay->append_optionmenu ( 939 $inlay->append_optionmenu (
940 \$as_black, 940 \$as_black,
941 0 => "White", 941 0 => "White",
942 1 => "Black", 942 1 => "Black",
965 $type->set_history (5) # reset to free 965 $type->set_history (5) # reset to free
966 if $_[0] != 19 && $info->{gametype} == GAMETYPE_RATED; 966 if $_[0] != 19 && $info->{gametype} == GAMETYPE_RATED;
967 }, 967 },
968 ); 968 );
969 969
970 if ($self->{channel}) { 970 if (defined $self->{channel}) {
971 $inlay->append_text ("\nHandicap: "); 971 $inlay->append_text ("\nHandicap: ");
972 $inlay->append_optionmenu (\$info->{rules}{handicap}, map +($_, $_), 0..9); 972 $inlay->append_optionmenu (\$info->{rules}{handicap}, map +($_, $_), 0..9);
973 973
974 $inlay->append_text ("\nKomi: "); 974 $inlay->append_text ("\nKomi: ");
975 $inlay->append_widget (gtk::numentry \$info->{rules}{komi}, 5); 975 $inlay->append_widget (gtk::numentry \$info->{rules}{komi}, 5);
1017 $inlay->append_text ("\nPeriods/Stones: "); 1017 $inlay->append_text ("\nPeriods/Stones: ");
1018 $count = $inlay->append_widget (gtk::numentry \$info->{rules}{count}, 5); 1018 $count = $inlay->append_widget (gtk::numentry \$info->{rules}{count}, 5);
1019 1019
1020 $inlay->append_text ("\n"); 1020 $inlay->append_text ("\n");
1021 1021
1022 if (!$self->{channel}) { 1022 if (!defined $self->{channel}) {
1023 $inlay->append_button ("Create Challenge", sub { 1023 $inlay->append_button ("Create Challenge", sub {
1024 $inlay->clear; 1024 $inlay->clear;
1025 $self->{cid} = $self->{conn}->alloc_clientid; 1025 $self->{cid} = $self->{conn}->alloc_clientid;
1026 $self->send (new_game => 1026 $self->send (new_game =>
1027 channel => delete $self->{roomid}, 1027 channel => delete $self->{roomid},

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines