Skip to content

Commit 6b58a36

Browse files
Bug fix; Improve chara sel logic
1 parent 642a7e8 commit 6b58a36

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uma-db-stuff",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "A set of experimental scripts to process Umamusume Pretty Derby game assets and database files",
55
"author": "daydreamer-json <[email protected]> (https://github.com/daydreamer-json)",
66
"license": "AGPL-3.0-or-later",

src/utils/audioGenerate.ts

+14-3
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,15 @@ async function askToUserCharaId(
224224
right2: null,
225225
right3: null,
226226
};
227+
let latestSelectUIPositionTargetIndex: number = 0;
227228
while (true) {
228229
const positionTargetIndex: number = (
229230
await prompts(
230231
{
231232
type: 'select',
232233
name: 'value',
233234
message: `Map the chara to each position`,
235+
initial: latestSelectUIPositionTargetIndex,
234236
choices: (() => {
235237
const _ = [
236238
...availablePositionArray.map((str, index) => ({
@@ -240,7 +242,7 @@ async function askToUserCharaId(
240242
) +
241243
' - ' +
242244
(!retObj[str]
243-
? chalk.bold.red('Chara not selected')
245+
? `${chalk.red('----')}: ${chalk.bold.red('Chara not selected')}`
244246
: `${chalk.green(retObj[str])}: ${chalk.bold.green(
245247
db.masterDb.text_data.find(
246248
(texEntry: any) =>
@@ -267,6 +269,7 @@ async function askToUserCharaId(
267269
},
268270
)
269271
).value;
272+
latestSelectUIPositionTargetIndex = positionTargetIndex;
270273
process.stdout.write('\x1b[1A\x1b[2K');
271274
if (positionTargetIndex === -1) {
272275
break;
@@ -275,7 +278,11 @@ async function askToUserCharaId(
275278
await prompts({
276279
type: 'select',
277280
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]!]),
279286
choices: [
280287
...liveCanUseCharaArray
281288
// .filter((entry) => selectedCharaArray.includes(entry) === false) // to eliminate duplicates
@@ -293,6 +300,10 @@ async function askToUserCharaId(
293300
).text,
294301
value: entry,
295302
})),
303+
{
304+
title: '=== Back to position menu ===',
305+
value: null,
306+
},
296307
],
297308
})
298309
).value;
@@ -341,7 +352,7 @@ async function processAudio(
341352
},
342353
selectedSingChara: Record<TypesAssetCsvStructure.MusicscorePartTrackString, number | null>,
343354
) {
344-
const isOkeCheers: boolean = false;
355+
const isOkeCheers: boolean = configUser.getConfig().audio.useCheersInst;
345356
const okeMetadataJsonPath = path.join(
346357
argvUtils.getArgv().outputDir,
347358
configUser.getConfig().file.outputSubPath.assets,

src/utils/configEmbed.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import semver from 'semver';
22

33
export default {
44
APPLICATION_NAME: 'uma-db-stuff',
5-
VERSION_NUMBER: semver.valid('0.2.0'),
5+
VERSION_NUMBER: semver.valid('0.2.1'),
66
};

0 commit comments

Comments
 (0)