mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 00:12:32 +02:00
Export command leaderboard on shutdown command
This commit is contained in:
@@ -58,7 +58,7 @@ module.exports = class ChiIdeaCommand extends Command {
|
||||
ctx.font = '15px Wild Words';
|
||||
let fontSize = 15;
|
||||
while (ctx.measureText(text).width > 500) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Wild Words`;
|
||||
}
|
||||
const lines = await wrapText(ctx, text, 83);
|
||||
|
||||
@@ -54,7 +54,7 @@ module.exports = class EddFactsBookCommand extends Command {
|
||||
ctx.font = '30px Noto';
|
||||
let fontSize = 30;
|
||||
while (ctx.measureText(fact).width > 458) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const lines = await wrapText(ctx, fact, 183);
|
||||
|
||||
@@ -55,7 +55,7 @@ module.exports = class GenieRulesCommand extends Command {
|
||||
ctx.font = '40px Noto';
|
||||
let fontSize = 40;
|
||||
while (ctx.measureText(text).width > 1143) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const lines = await wrapText(ctx, text, 381);
|
||||
|
||||
@@ -74,7 +74,7 @@ module.exports = class GruPlanCommand extends Command {
|
||||
const step = steps[i];
|
||||
let fontSize = 35;
|
||||
while (ctx.measureText(step).width > 1100) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const lines = await wrapText(ctx, step, 252);
|
||||
|
||||
@@ -62,7 +62,7 @@ module.exports = class IllegalCommand extends Command {
|
||||
let fontSize = 45;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
while (ctx.measureText(illegalText).width > 550) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const lines = await wrapText(ctx, illegalText, 200);
|
||||
|
||||
@@ -54,7 +54,7 @@ module.exports = class LisaPresentationCommand extends Command {
|
||||
ctx.font = '40px Noto';
|
||||
let fontSize = 40;
|
||||
while (ctx.measureText(text).width > 1320) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const lines = await wrapText(ctx, text, 330);
|
||||
|
||||
@@ -87,7 +87,7 @@ module.exports = class PhoebeTeachingJoeyCommand extends Command {
|
||||
if (step === incorrect && j === 0) step = correct.join(' ');
|
||||
let fontSize = 20;
|
||||
while (ctx.measureText(step).width > 260) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
ctx.strokeText(step, x, y, 260);
|
||||
|
||||
@@ -74,7 +74,7 @@ module.exports = class PlanktonPlanCommand extends Command {
|
||||
const step = steps[i];
|
||||
let fontSize = 35;
|
||||
while (ctx.measureText(step).width > 420) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const lines = await wrapText(ctx, step, 155);
|
||||
|
||||
@@ -54,7 +54,7 @@ module.exports = class ScrollOfTruthCommand extends Command {
|
||||
ctx.font = '60px Noto';
|
||||
let fontSize = 60;
|
||||
while (ctx.measureText(text).width > 542) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const lines = await wrapText(ctx, text, 217);
|
||||
|
||||
@@ -54,7 +54,7 @@ module.exports = class SosCommand extends Command {
|
||||
ctx.rotate(15 * (Math.PI / 180));
|
||||
let fontSize = 90;
|
||||
while (ctx.measureText(message).width > 140) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
ctx.fillText(message.toUpperCase(), 362, 522);
|
||||
|
||||
@@ -61,7 +61,7 @@ module.exports = class SpongebobBurnCommand extends Command {
|
||||
ctx.font = '35px Noto';
|
||||
let fontSize = 35;
|
||||
while (ctx.measureText(burn).width > 400) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const lines = await wrapText(ctx, burn, 180);
|
||||
|
||||
@@ -60,7 +60,7 @@ module.exports = class TwoButtonsCommand extends Command {
|
||||
ctx.font = '34px Noto';
|
||||
let fontSize = 34;
|
||||
while (ctx.measureText(first).width > 366) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const firstLines = await wrapText(ctx, first, 183);
|
||||
@@ -72,7 +72,7 @@ module.exports = class TwoButtonsCommand extends Command {
|
||||
ctx.font = '34px Noto';
|
||||
fontSize = 34;
|
||||
while (ctx.measureText(second).width > 244) {
|
||||
fontSize -= 1;
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const secondLines = await wrapText(ctx, second, 118);
|
||||
|
||||
Reference in New Issue
Block a user