diff --git a/kc.po b/kc.po index 809ae6b..a4b5565 100644 --- a/kc.po +++ b/kc.po @@ -35382,7 +35382,7 @@ msgstr "Admiral Cmds" # button explainer popup main screen msgctxt "level4_00110.-15|-1" msgid "提督コマンド" -msgstr "Admiral Cmds" +msgstr "----------" # left hand admiral commands popup menu title msgctxt "level4_00210.-15|-1" @@ -35441,7 +35441,7 @@ msgstr "----------" # button explainer popup main screen from office msgctxt "sharedassets5_01354.-4|-1" msgid "提督コマンド" -msgstr "Admiral Cmds" +msgstr "----------" msgctxt "Assembly-CSharp.dll|4595039" msgid "提督レベル:" diff --git a/label.pm b/label.pm index 6bde688..fcac7b1 100644 --- a/label.pm +++ b/label.pm @@ -3,11 +3,16 @@ use strictures 2; use parent 'Parse::Binary'; use parsehelper qw' string '; use constant FORMAT => ( - magic => 'a136', - width => 'L', - height => 'L', - eh => 'a48', - text => string(), - tail => 'a*', + magic => 'a136', + width => 'L', + height => 'L', + eh => 'a48', + text => string(), + font_size => 'L', + font_style => 'L', + eh2 => 'a116', + shrink_to_fit => 'L', + eh3 => 'a12', + multi_line => 'L', ); 1; diff --git a/labelprop_mods.cache b/labelprop_mods.cache new file mode 100644 index 0000000..476cb1b --- /dev/null +++ b/labelprop_mods.cache @@ -0,0 +1,42 @@ +{ + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/level4/level4_00110.-15" : + { "font_size" : 15 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_01354.-4" : + { "font_size" : 15 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00900.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00948.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00762.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00672.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00886.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00725.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00835.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00061.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00636.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00171.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_01051.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00802.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00178.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00264.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00688.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00987.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00983.-4" : + { "font_size" : 10 }, + "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/sharedassets5/sharedassets5_00533.-4" : + { "font_size" : 10 } +} diff --git a/translate_utf8_binary.pl b/translate_utf8_binary.pl index 5634787..37a8287 100644 --- a/translate_utf8_binary.pl +++ b/translate_utf8_binary.pl @@ -44,6 +44,10 @@ =head1 DESCRIPTION my $carriagereturn_file = "carriagereturn.cache"; my $jp_qr = qr/[\p{Hiragana}\p{Katakana}\p{Han}]/; my $generic_ctxt = "███ generic translation ███"; +my $label_prop_file = "labelprops.cache"; +my $label_properties; +my $label_prop_mods; +my $label_prop_mods_file = "labelprop_mods.cache"; run(); @@ -433,6 +437,18 @@ sub presetdeck_meths { sub value_pairs_for_type { my ( $type, $file ) = @_; my $obj = $file->{obj} ||= $type->new( $file->{file} ); + if ( $type eq "label" ) { + my @props = qw( width height font_size font_style text shrink_to_fit multi_line ); + $label_properties->{ $file->{file} } ||= { map +( $_, $_ eq "text" ? decode "UTF-8", $obj->$_ : $obj->$_ ), @props }; + if ( $label_prop_mods->{ $file->{file} } ) { + for my $prop (@props) { + next unless # + my $val = $label_prop_mods->{ $file->{file} }{$prop}; + $obj->${ \"Set$prop" }($val); + store_file_as_modded $file, 1, $file->{obj}->dump; + } + } + } return $type eq "motionlist" ? map [ name => $_ ], $obj->field_children("motionship") : $type eq "presetdata" ? map [ "preset_${_}_name" => $obj ], 1 .. $obj->obj_count @@ -812,6 +828,8 @@ sub run { duplicate_check; my %tr = binary_translations->data; delete $_->{tr} for values %tr; + $label_properties = { load_cache $label_prop_file}; + $label_prop_mods = { load_cache $label_prop_mods_file}; say "loading po file"; my ( $pofile, $unused_ctxt_marker ) = qw( kc.po ---------- ); @@ -1040,6 +1058,8 @@ sub run { $po_contents =~ s/\r?\n$//; io($pofile)->print($po_contents); + store_cache $label_prop_file, $label_properties; + say "preparing reports"; my @maybe = map sprintf( " %-" . ( 30 - length $_ ) . "s %-30s hit x %3s, nomatch x %3s, match x %3s", $_, $tr{$_}{ctxt_tr}{""}, $hit{$_}, $unmatched{$_}, $hit{$_} - $unmatched{$_} ), reverse sort { length $a <=> length $b } sort keys %unmatched;