From 3e064be8020ed1eccc5cddcac5ab355320ebccb5 Mon Sep 17 00:00:00 2001 From: Minteck Date: Thu, 7 Jul 2022 11:06:12 +0200 Subject: m. working on features scoots doesn't want to work on --- Library/SDK/Modules/Strawberry.Dialog.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'Library/SDK/Modules/Strawberry.Dialog.js') diff --git a/Library/SDK/Modules/Strawberry.Dialog.js b/Library/SDK/Modules/Strawberry.Dialog.js index 95b0d9d..c5d2bac 100644 --- a/Library/SDK/Modules/Strawberry.Dialog.js +++ b/Library/SDK/Modules/Strawberry.Dialog.js @@ -10,11 +10,11 @@ let self = { process.stdout.write("\n"); } - console.log(" ".repeat(horizontal) + color.bgWhite[col]("╭───" + "─".repeat(message.length) + "───╮")); - console.log(" ".repeat(horizontal) + color.bgWhite[col]("│ " + " ".repeat(message.length) + " │")); - console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("│") + " " + message + " " + color[col]("│"))); - console.log(" ".repeat(horizontal) + color.bgWhite[col]("│ " + " ".repeat(message.length) + " │")); - console.log(" ".repeat(horizontal) + color.bgWhite[col]("╰───" + "─".repeat(message.length) + "───╯")); + console.log(" ".repeat(horizontal) + color.bgWhite[col]("┏━━━" + "━".repeat(message.length) + "━━━┓")); + console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(message.length) + " ┃")); + console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("┃") + " " + message + " " + color[col]("┃"))); + console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(message.length) + " ┃")); + console.log(" ".repeat(horizontal) + color.bgWhite[col]("┗━━━" + "─".repeat(message.length) + "━━━┛")); for (let n = 0; n < (vertical - 3); n++) { process.stdout.write("\n"); @@ -27,7 +27,7 @@ let self = { return a.length > b.length ? a : b }, ''); - global.vertical = Math.round(process.stdout.rows / 2 + 1) - 5; + global.vertical = Math.round(process.stdout.rows / 2 + 1) - 5 - (lines.length / 2); let horizontal = Math.round(process.stdout.columns / 2 - (1 + ((longest.length + 8) / 2))); for (let n = 0; n < vertical; n++) { @@ -37,8 +37,15 @@ let self = { console.log(" ".repeat(horizontal) + color.bgWhite[col]("┏━━━" + "━".repeat(longest.length) + "━━━┓")); console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(longest.length) + " ┃")); + let index = 0; for (let line of lines) { - console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("┃") + " " + line + " ".repeat(longest.length - line.length) + " " + color[col]("┃"))); + if (index === 0) { + console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("┃") + " " + chalk.underline(line) + " ".repeat(longest.length - line.length) + " " + color[col]("┃"))); + } else { + console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("┃") + " " + line + " ".repeat(longest.length - line.length) + " " + color[col]("┃"))); + } + + index++; } console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(longest.length) + " ┃")); @@ -46,7 +53,7 @@ let self = { console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(longest.length) + " ┃")); console.log(" ".repeat(horizontal) + color.bgWhite[col]("┗━━━" + "━".repeat(longest.length) + "━━━┛")); - for (let n = 0; n < (vertical - 3); n++) { + for (let n = 0; n < (vertical - 3 - lines.length); n++) { process.stdout.write("\n"); } -- cgit