--- deliantra/Deliantra-Client/DC/Protocol.pm 2007/07/24 05:13:23 1.132 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2007/07/28 16:48:45 1.138 @@ -60,9 +60,11 @@ $self->connect_ext (capabilities => sub { my (%cap) = @_; + #$self->send ("setup sound 0"); # we use a different protocol + $self->send_exti_msg (fx_want => { 3 => !!$::CFG->{bgm_enable}, # FT_MUSIC - 5 => !!$::CFG->{audio_enable}, # FT_SOUND + #5 => !!$::CFG->{audio_enable}, # FT_SOUND }); if (my $ts = $cap{tileset}) { @@ -187,6 +189,13 @@ $self->send_exti_msg (w_r => $rid, [map $w->{$_}, @$attr]); }); + # message window + $self->connect_ext (channel_info => sub { + my ($info) = @_; + $self->{channels}->{$info->{id}} = $info; + $::MESSAGE_WINDOW->add_channel ($info); + }); + # destroy widgets on logout $self->{on_stop_game_guard} = $self->{map_widget}{root}->connect (stop_game => sub { for my $ws (values %{delete $self->{widgetset} || {}}) { @@ -755,9 +764,10 @@ }; } + my $path = CFPlus::DB::path_of_res $face->{name}; + if ($changed) { # new data my ($meta_json, $data) = unpack "(w/a*)*", delete $face->{data}; - my $path = CFPlus::DB::path_of_res $face->{name}; CFPlus::DB::write_file $path, $data, sub { CFPlus::DB::put "res-metadata" => $face->{name} => $meta_json, sub { @@ -769,6 +779,7 @@ }; } else { $face->{meta} = $self->{json_coder}->decode (delete $face->{data}); + $face->{path} = $path; $cb->(); } } @@ -809,8 +820,9 @@ sub sound_play { my ($self, $x, $y, $soundnum, $type) = @_; + warn "sound play <@_>\n";#d# - $self->{sound_play}->($x, $y, $soundnum, $type); + #$self->{sound_play}->($x, $y, $soundnum, $type); } my $LAST_QUERY; # server is stupid, stupid, stupid @@ -885,13 +897,13 @@ $self->logprint ("msg: ", $text); return if $color < 0; # negative color == ignore if not understood - my $fg = $CF_COLOR[$color % @CF_COLOR]; + my $fg = $CF_COLOR[$color & 0x1f] || [1, 0, 0]; ## try to create single paragraphs of multiple lines sent by the server # no longer neecssary with TRT servers #$text =~ s/(?<=\S)\n(?=\w)/ /g; - ::message ({ fg => $fg, markup => $_ }) + ::message ({ fg => $fg, markup => $_, type => $type, extra => [@extra] }) for split /\n/, $text; $self->{statusbox}->add ($text, @@ -1157,7 +1169,6 @@ . "map size $self->{mapw}×$self->{maph}\n" ); - ::setup_build_button ($self->{editor_support}->{builder_ui}); } sub logged_in { @@ -1189,14 +1200,6 @@ $self->send_command ("pickup $::CFG->{pickup}"); } -sub buildat { - my ($self, $builditem, $x, $y) = @_; - - if ($self->{cfplus_ext}) { - $self->send_ext_msg (builder_build => dx => $x, dy => $y, (ref ($builditem) eq 'HASH') ? %$builditem : (item => $builditem)); - } -} - sub lookat { my ($self, $x, $y) = @_;