File tree Expand file tree Collapse file tree 6 files changed +16
-11
lines changed
Expand file tree Collapse file tree 6 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
2- import fs from 'fs' ;
3- import path from 'path' ;
42import { spawn } from 'child_process' ;
3+ import fs from 'fs' ;
54import { platform } from 'os' ;
5+ import path from 'path' ;
66
77const verbose = process . argv . indexOf ( '--verbose' ) != - 1 ;
88
@@ -48,12 +48,14 @@ async function createAssetPack(filename) {
4848 for ( let obj of root . objects ) {
4949 for ( let i = 0 ; i < obj . samples . length ; i ++ ) {
5050 const sample = obj . samples [ i ] ;
51- const newFilename = `${ sampleIndex } .ogg` ;
52- const srcPath = path . join ( dir , sample ) ;
53- const dstPath = path . join ( workDir , newFilename ) ;
54- await encodeMusicTrack ( dstPath , srcPath ) ;
55- obj . samples [ i ] = newFilename ;
56- sampleIndex ++ ;
51+ if ( sample != "" && ! sample . startsWith ( '$' ) ) {
52+ const newFilename = `${ sampleIndex } .ogg` ;
53+ const srcPath = path . join ( dir , sample ) ;
54+ const dstPath = path . join ( workDir , newFilename ) ;
55+ await encodeMusicTrack ( dstPath , srcPath ) ;
56+ obj . samples [ i ] = newFilename ;
57+ sampleIndex ++ ;
58+ }
5759 }
5860 }
5961
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 55 {
66 "id" : " rct2.music.ragtime" ,
77 "samples" : [
8- " cover/ragtime/searchlight_rag.flac"
8+ " cover/rct2.music. ragtime/searchlight_rag.flac"
99 ]
1010 },
1111 {
1212 "id" : " rct2.music.fairground" ,
1313 "samples" : [
14- " cover/openrct2.music.fairground/das_alpenhorn.flac" ,
15- " cover/openrct2.music.fairground/slavonic_dance.flac"
14+ " $[0..4]" ,
15+ " cover/rct2.music.fairground/slavonic_dance.flac" ,
16+ " $[0..0]" ,
17+ " cover/rct2.music.fairground/das_alpenhorn.flac" ,
18+ " $[0..4]"
1619 ]
1720 }
1821 ],
You can’t perform that action at this time.
0 commit comments