… | |
… | |
2865 | # TODO: for gcfclient pleasure, we should give resources |
2865 | # TODO: for gcfclient pleasure, we should give resources |
2866 | # that gcfclient doesn't grok a >10000 face index. |
2866 | # that gcfclient doesn't grok a >10000 face index. |
2867 | my $res = $facedata->{resource}; |
2867 | my $res = $facedata->{resource}; |
2868 | my $enc = JSON::XS->new->utf8->canonical; |
2868 | my $enc = JSON::XS->new->utf8->canonical; |
2869 | |
2869 | |
2870 | if (my $soundconf = delete $res->{"res/sound.conf"}) { |
2870 | my $soundconf = delete $res->{"res/sound.conf"}; |
2871 | $soundconf = $enc->decode (delete $soundconf->{data}); |
|
|
2872 | # todo |
|
|
2873 | } |
|
|
2874 | |
2871 | |
2875 | while (my ($name, $info) = each %$res) { |
2872 | while (my ($name, $info) = each %$res) { |
2876 | my $meta = $enc->encode ({ |
2873 | my $meta = $enc->encode ({ |
2877 | name => $name, |
2874 | name => $name, |
2878 | %{ $info->{meta} || {} }, |
2875 | %{ $info->{meta} || {} }, |
… | |
… | |
2892 | } |
2889 | } |
2893 | |
2890 | |
2894 | cf::face::set_type $idx, $info->{type}; |
2891 | cf::face::set_type $idx, $info->{type}; |
2895 | |
2892 | |
2896 | cf::cede_to_tick; |
2893 | cf::cede_to_tick; |
|
|
2894 | } |
|
|
2895 | |
|
|
2896 | if ($soundconf) { |
|
|
2897 | $soundconf = $enc->decode (delete $soundconf->{data}); |
|
|
2898 | |
|
|
2899 | for (0 .. SOUND_CAST_SPELL_0 - 1) { |
|
|
2900 | my $sound = $soundconf->{compat}[$_] |
|
|
2901 | or next; |
|
|
2902 | |
|
|
2903 | my $face = cf::face::find "sound/$sound->[1]"; |
|
|
2904 | warn "$sound->[0]: $face\n";#d# |
|
|
2905 | |
|
|
2906 | cf::sound::set $sound->[0] => $face; |
|
|
2907 | cf::sound::old_sound_index $_, $face; # gcfclient-compat |
|
|
2908 | } |
|
|
2909 | |
|
|
2910 | #TODO |
2897 | } |
2911 | } |
2898 | } |
2912 | } |
2899 | |
2913 | |
2900 | 1 |
2914 | 1 |
2901 | } |
2915 | } |