mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
feat: remove wait for enter in dialogue
This commit is contained in:
1 parent
8782048334
commit
51bf06e2a7
1 file changed
+3
-2
@@ -45,7 +45,8 @@ function printLine(content, delay, color) {
|
|||||||
i += 1
|
i += 1
|
||||||
if (i >= printContent.length) {
|
if (i >= printContent.length) {
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
waitForEnter().then(resolve)
|
process.stdout.write('\n')
|
||||||
|
resolve()
|
||||||
}
|
}
|
||||||
}, delay)
|
}, delay)
|
||||||
|
|
||||||
@@ -71,7 +72,7 @@ async function printResponses(responses, delay = 100) {
|
|||||||
if (type === 'dialogue') {
|
if (type === 'dialogue') {
|
||||||
console.log(`${speaker}:`)
|
console.log(`${speaker}:`)
|
||||||
for (const line of content) {
|
for (const line of content) {
|
||||||
await printLine(`\t${line}`, delay, color || 'green')
|
await printLine(` ${line}`, delay, color || 'green')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user