@@ -224,13 +224,15 @@ async function askToUserCharaId(
224
224
right2 : null ,
225
225
right3 : null ,
226
226
} ;
227
+ let latestSelectUIPositionTargetIndex : number = 0 ;
227
228
while ( true ) {
228
229
const positionTargetIndex : number = (
229
230
await prompts (
230
231
{
231
232
type : 'select' ,
232
233
name : 'value' ,
233
234
message : `Map the chara to each position` ,
235
+ initial : latestSelectUIPositionTargetIndex ,
234
236
choices : ( ( ) => {
235
237
const _ = [
236
238
...availablePositionArray . map ( ( str , index ) => ( {
@@ -240,7 +242,7 @@ async function askToUserCharaId(
240
242
) +
241
243
' - ' +
242
244
( ! retObj [ str ]
243
- ? chalk . bold . red ( 'Chara not selected' )
245
+ ? ` ${ chalk . red ( '----' ) } : ${ chalk . bold . red ( 'Chara not selected' ) } `
244
246
: `${ chalk . green ( retObj [ str ] ) } : ${ chalk . bold . green (
245
247
db . masterDb . text_data . find (
246
248
( texEntry : any ) =>
@@ -267,6 +269,7 @@ async function askToUserCharaId(
267
269
} ,
268
270
)
269
271
) . value ;
272
+ latestSelectUIPositionTargetIndex = positionTargetIndex ;
270
273
process . stdout . write ( '\x1b[1A\x1b[2K' ) ;
271
274
if ( positionTargetIndex === - 1 ) {
272
275
break ;
@@ -275,7 +278,11 @@ async function askToUserCharaId(
275
278
await prompts ( {
276
279
type : 'select' ,
277
280
name : 'value' ,
278
- message : `Select singing chara for '${ availablePositionArray [ positionTargetIndex ] } ' position` ,
281
+ message : `Select singing chara for ${ chalk . bold . cyan ( availablePositionArray [ positionTargetIndex ] ) } position` ,
282
+ initial :
283
+ retObj [ availablePositionArray [ positionTargetIndex ] ! ] === null
284
+ ? 0
285
+ : liveCanUseCharaArray . findIndex ( ( el ) => el === retObj [ availablePositionArray [ positionTargetIndex ] ! ] ) ,
279
286
choices : [
280
287
...liveCanUseCharaArray
281
288
// .filter((entry) => selectedCharaArray.includes(entry) === false) // to eliminate duplicates
@@ -293,6 +300,10 @@ async function askToUserCharaId(
293
300
) . text ,
294
301
value : entry ,
295
302
} ) ) ,
303
+ {
304
+ title : '=== Back to position menu ===' ,
305
+ value : null ,
306
+ } ,
296
307
] ,
297
308
} )
298
309
) . value ;
@@ -341,7 +352,7 @@ async function processAudio(
341
352
} ,
342
353
selectedSingChara : Record < TypesAssetCsvStructure . MusicscorePartTrackString , number | null > ,
343
354
) {
344
- const isOkeCheers : boolean = false ;
355
+ const isOkeCheers : boolean = configUser . getConfig ( ) . audio . useCheersInst ;
345
356
const okeMetadataJsonPath = path . join (
346
357
argvUtils . getArgv ( ) . outputDir ,
347
358
configUser . getConfig ( ) . file . outputSubPath . assets ,
0 commit comments