… | |
… | |
62 | |
62 | |
63 | #$self->send ("setup sound 0"); # we use a different protocol |
63 | #$self->send ("setup sound 0"); # we use a different protocol |
64 | |
64 | |
65 | $self->send_exti_msg (fx_want => { |
65 | $self->send_exti_msg (fx_want => { |
66 | 3 => !!$::CFG->{bgm_enable}, # FT_MUSIC |
66 | 3 => !!$::CFG->{bgm_enable}, # FT_MUSIC |
67 | 5 => !!$::CFG->{audio_enable}, # FT_SOUND |
67 | #5 => !!$::CFG->{audio_enable}, # FT_SOUND |
68 | }); |
68 | }); |
69 | |
69 | |
70 | if (my $ts = $cap{tileset}) { |
70 | if (my $ts = $cap{tileset}) { |
71 | if (my ($default) = grep $_->[2] & 1, @$ts) { |
71 | if (my ($default) = grep $_->[2] & 1, @$ts) { |
72 | $self->{tileset} = $default; |
72 | $self->{tileset} = $default; |
… | |
… | |
762 | |
762 | |
763 | &::audio_music_set ($self->{songs}); |
763 | &::audio_music_set ($self->{songs}); |
764 | }; |
764 | }; |
765 | } |
765 | } |
766 | |
766 | |
|
|
767 | my $path = CFPlus::DB::path_of_res $face->{name}; |
|
|
768 | |
767 | if ($changed) { # new data |
769 | if ($changed) { # new data |
768 | my ($meta_json, $data) = unpack "(w/a*)*", delete $face->{data}; |
770 | my ($meta_json, $data) = unpack "(w/a*)*", delete $face->{data}; |
769 | my $path = CFPlus::DB::path_of_res $face->{name}; |
|
|
770 | |
771 | |
771 | CFPlus::DB::write_file $path, $data, sub { |
772 | CFPlus::DB::write_file $path, $data, sub { |
772 | CFPlus::DB::put "res-metadata" => $face->{name} => $meta_json, sub { |
773 | CFPlus::DB::put "res-metadata" => $face->{name} => $meta_json, sub { |
773 | $face->{meta} = $self->{json_coder}->decode ($meta_json); |
774 | $face->{meta} = $self->{json_coder}->decode ($meta_json); |
774 | $face->{path} = $path; |
775 | $face->{path} = $path; |
… | |
… | |
776 | $cb->(); |
777 | $cb->(); |
777 | }; |
778 | }; |
778 | }; |
779 | }; |
779 | } else { |
780 | } else { |
780 | $face->{meta} = $self->{json_coder}->decode (delete $face->{data}); |
781 | $face->{meta} = $self->{json_coder}->decode (delete $face->{data}); |
|
|
782 | $face->{path} = $path; |
781 | $cb->(); |
783 | $cb->(); |
782 | } |
784 | } |
783 | } |
785 | } |
784 | } |
786 | } |
785 | |
787 | |
… | |
… | |
893 | $self->{$type} = $text; |
895 | $self->{$type} = $text; |
894 | } else { |
896 | } else { |
895 | $self->logprint ("msg: ", $text); |
897 | $self->logprint ("msg: ", $text); |
896 | return if $color < 0; # negative color == ignore if not understood |
898 | return if $color < 0; # negative color == ignore if not understood |
897 | |
899 | |
898 | my $fg = $CF_COLOR[$color % @CF_COLOR]; |
900 | my $fg = $CF_COLOR[$color & 0x1f] || [1, 0, 0]; |
899 | |
901 | |
900 | ## try to create single paragraphs of multiple lines sent by the server |
902 | ## try to create single paragraphs of multiple lines sent by the server |
901 | # no longer neecssary with TRT servers |
903 | # no longer neecssary with TRT servers |
902 | #$text =~ s/(?<=\S)\n(?=\w)/ /g; |
904 | #$text =~ s/(?<=\S)\n(?=\w)/ /g; |
903 | |
905 | |