mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
quest update
This commit is contained in:
1 parent
5fbdcd5182
commit
65894f831a
14 files changed
+247
-309
No files matched your search
@@ -61,19 +61,21 @@ function printLine(content, delay, color) {
|
||||
|
||||
async function printResponses(responses, delay = 100) {
|
||||
console.log()
|
||||
console.log(colorize('-------------', 'white'))
|
||||
console.log(colorize('==============================', 'green'))
|
||||
for (const response of responses) {
|
||||
const { type, content, speaker, color } = response
|
||||
if (type === 'narrative') {
|
||||
for (const line of content) {
|
||||
await printLine(line, delay, color || 'white')
|
||||
await printLine(line, delay, color || 'cyan')
|
||||
}
|
||||
console.log()
|
||||
}
|
||||
if (type === 'dialogue') {
|
||||
console.log(`${speaker}:`)
|
||||
console.log(colorize(`${speaker}:`, 'green'))
|
||||
for (const line of content) {
|
||||
await printLine(` ${line}`, delay, color || 'green')
|
||||
await printLine(` ${line}`, delay, color || 'cyan')
|
||||
}
|
||||
console.log()
|
||||
}
|
||||
}
|
||||
rl.close()
|
||||
|
||||
Reference in new issue
Block a user