… | |
… | |
187 | $self->send_exti_msg (w_r => $rid, [map $w->{$_}, @$attr]); |
187 | $self->send_exti_msg (w_r => $rid, [map $w->{$_}, @$attr]); |
188 | }); |
188 | }); |
189 | |
189 | |
190 | # message window |
190 | # message window |
191 | $self->connect_ext (channel_info => sub { |
191 | $self->connect_ext (channel_info => sub { |
|
|
192 | my ($info) = @_; |
|
|
193 | $self->{channels}->{$info->{id}} = $info; |
192 | $::MESSAGE_WINDOW->add_channel ($_[0]); |
194 | $::MESSAGE_WINDOW->add_channel ($info); |
193 | }); |
195 | }); |
194 | |
196 | |
195 | # destroy widgets on logout |
197 | # destroy widgets on logout |
196 | $self->{on_stop_game_guard} = $self->{map_widget}{root}->connect (stop_game => sub { |
198 | $self->{on_stop_game_guard} = $self->{map_widget}{root}->connect (stop_game => sub { |
197 | for my $ws (values %{delete $self->{widgetset} || {}}) { |
199 | for my $ws (values %{delete $self->{widgetset} || {}}) { |
… | |
… | |
894 | |
896 | |
895 | ## try to create single paragraphs of multiple lines sent by the server |
897 | ## try to create single paragraphs of multiple lines sent by the server |
896 | # no longer neecssary with TRT servers |
898 | # no longer neecssary with TRT servers |
897 | #$text =~ s/(?<=\S)\n(?=\w)/ /g; |
899 | #$text =~ s/(?<=\S)\n(?=\w)/ /g; |
898 | |
900 | |
899 | ::message ({ fg => $fg, markup => $_, type => $type }) |
901 | ::message ({ fg => $fg, markup => $_, type => $type, extra => [@extra] }) |
900 | for split /\n/, $text; |
902 | for split /\n/, $text; |
901 | |
903 | |
902 | $self->{statusbox}->add ($text, |
904 | $self->{statusbox}->add ($text, |
903 | group => $text, |
905 | group => $text, |
904 | fg => $fg, |
906 | fg => $fg, |
… | |
… | |
1160 | . "cfplus support $yesno[$self->{cfplus_ext} > 0]" |
1162 | . "cfplus support $yesno[$self->{cfplus_ext} > 0]" |
1161 | . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" |
1163 | . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" |
1162 | . "map size $self->{mapw}×$self->{maph}\n" |
1164 | . "map size $self->{mapw}×$self->{maph}\n" |
1163 | ); |
1165 | ); |
1164 | |
1166 | |
1165 | ::setup_build_button ($self->{editor_support}->{builder_ui}); |
|
|
1166 | } |
1167 | } |
1167 | |
1168 | |
1168 | sub logged_in { |
1169 | sub logged_in { |
1169 | my ($self) = @_; |
1170 | my ($self) = @_; |
1170 | |
1171 | |
… | |
… | |
1190 | |
1191 | |
1191 | $self->send_command ("output-sync $::CFG->{output_sync}"); |
1192 | $self->send_command ("output-sync $::CFG->{output_sync}"); |
1192 | $self->send_command ("output-count $::CFG->{output_count}"); |
1193 | $self->send_command ("output-count $::CFG->{output_count}"); |
1193 | $self->send_command ("output-rate $::CFG->{output_rate}") if $::CFG->{output_rate} > 0; |
1194 | $self->send_command ("output-rate $::CFG->{output_rate}") if $::CFG->{output_rate} > 0; |
1194 | $self->send_command ("pickup $::CFG->{pickup}"); |
1195 | $self->send_command ("pickup $::CFG->{pickup}"); |
1195 | } |
|
|
1196 | |
|
|
1197 | sub buildat { |
|
|
1198 | my ($self, $builditem, $x, $y) = @_; |
|
|
1199 | |
|
|
1200 | if ($self->{cfplus_ext}) { |
|
|
1201 | $self->send_ext_msg (builder_build => dx => $x, dy => $y, (ref ($builditem) eq 'HASH') ? %$builditem : (item => $builditem)); |
|
|
1202 | } |
|
|
1203 | } |
1196 | } |
1204 | |
1197 | |
1205 | sub lookat { |
1198 | sub lookat { |
1206 | my ($self, $x, $y) = @_; |
1199 | my ($self, $x, $y) = @_; |
1207 | |
1200 | |