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.68 by pcg, Mon Jul 21 01:41:02 2003 UTC vs.
Revision 1.69 by pcg, Tue Jul 22 21:24:50 2003 UTC

145 145
146 $self; 146 $self;
147} 147}
148 148
149sub configure { 149sub configure {
150 my ($self, $user, $rules) = @_; 150 my ($self, $app, $user, $rules) = @_;
151 151
152 if ($self->{name}->get_text ne $user->as_string) { 152 if ($self->{name}->get_text ne $user->as_string) {
153 $self->{name}->set_text ($user->as_string); 153 $self->{name}->set_text ($user->as_string);
154 154
155 $self->{imagebox}->remove ($_) for $self->{imagebox}->get_children; 155 $self->{imagebox}->remove ($_) for $self->{imagebox}->get_children;
156 $self->{imagebox}->add (gtk::image_from_data undef); 156 $self->{imagebox}->add (gtk::image_from_data undef);
157 $self->{imagebox}->show_all; 157 $self->{imagebox}->show_all;
158 158
159 if ($user->has_pic) { 159 if ($user->has_pic) {
160 # the big picture... 160 # the big picture...
161 appwin::userpic ($user->{name}, sub { 161 $app->userpic ($user->{name}, sub {
162 return unless $self->{imagebox}; 162 return unless $self->{imagebox};
163
163 if ($_[0]) { 164 if ($_[0]) {
164 $self->{imagebox}->remove ($_) for $self->{imagebox}->get_children; 165 $self->{imagebox}->remove ($_) for $self->{imagebox}->get_children;
165 $self->{imagebox}->add (gtk::image_from_data $_[0]); 166 $self->{imagebox}->add (gtk::image_from_data $_[0]);
166 $self->{imagebox}->show_all; 167 $self->{imagebox}->show_all;
167 } 168 }
479} 480}
480 481
481sub event_update_rules { 482sub event_update_rules {
482 my ($self, $rules) = @_; 483 my ($self, $rules) = @_;
483 484
484 $self->{userpanel}[$_]->configure ($self->{user}[$_], $rules) 485 $self->{userpanel}[$_]->configure ($self->{app}, $self->{user}[$_], $rules)
485 for BLACK, WHITE; 486 for BLACK, WHITE;
486 487
487 sound::play 3, "gamestart"; 488 sound::play 3, "gamestart";
488 489
489 my $text = "\n<header>Game Rules</header>"; 490 my $text = "\n<header>Game Rules</header>";
539sub destroy { 540sub destroy {
540 my ($self) = @_; 541 my ($self) = @_;
541 $self->{userpanel}[$_] && (delete $self->{userpanel}[$_])->destroy 542 $self->{userpanel}[$_] && (delete $self->{userpanel}[$_])->destroy
542 for BLACK, WHITE; 543 for BLACK, WHITE;
543 $self->SUPER::destroy; 544 $self->SUPER::destroy;
544 delete $appwin::gamelist->{game}{$self->{channel}}; 545 delete $self->{app}{gamelist}{game}{$self->{channel}};
545} 546}
546 547
5471; 5481;
548 549

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines