Skip to content

Commit

Permalink
convert the xml copying script to handle translated but unmodded files
Browse files Browse the repository at this point in the history
  • Loading branch information
wchristian committed Jan 29, 2019
1 parent 5ae716f commit 531c857
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
2 changes: 1 addition & 1 deletion _build_translation_patch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sub run {
call "translate_utf8_binary.pl @opt";
call "modify_fonts_and_inject.pl";
call "mod_textures.pl";
call "copy_xml_to_modded.pl";
call "copy_unmodded_files.pl";
call "import_files_to_assets.pl";
try_copy();

Expand Down
27 changes: 27 additions & 0 deletions copy_unmodded_files.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
use 5.020;
use strictures 2;
use IO::All -binary;
use Capture::Tiny 'capture';

$|++;
run();

sub run {
say "copying translated unmodded files";
for my $set ( #
[ "xml", "en/Xml/tables/master", "Media/StreamingAssets/Xml/tables/master/" ],
[ "png", "en/sce_sys", "sce_sys/" ],
[ "png", "en/sce_sys/livearea/contents", "sce_sys/livearea/contents/" ],
)
{
my ( $ext, $src, $tgt ) = $set->@*;
my @files = grep /\.$ext$/, io($src)->all_files;
for my $file (@files) {
die "didn't find file '$file' in original game" if !-e "../kc_original/$tgt" . $file->filename;
my $target_file = "../kc_original_unpack_modded/$tgt" . $file->filename;
io( io->file($target_file)->filepath )->mkpath;
$file->copy($target_file);
}
}
say "done";
}
17 changes: 0 additions & 17 deletions copy_xml_to_modded.pl

This file was deleted.

2 changes: 1 addition & 1 deletion import_files_to_assets.pl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ sub run {
my $sub_path = "repatch/PCSG00684/";
say "moving to $sub_path";
io("$target_dir/$sub_path/")->mkpath;
io($media_dir)->rename("$target_dir/$sub_path/Media");
$_->rename( "$target_dir/$sub_path/" . $_->filename ) for io($target_dir)->all_dirs;

say "done";
return;
Expand Down

0 comments on commit 531c857

Please sign in to comment.