This commit is contained in:
JustAGenericUsername 2025-03-30 16:56:08 -04:00
parent 7a48177ce6
commit 5c1117944b
1 changed files with 14 additions and 6 deletions

View File

@ -3939,17 +3939,25 @@ renderPostPixel(function(ctx){
if ((pixel.element == "sign") && pixel.sign){
ctx.font = `12pt Arial`
ctx.fillStyle = pixel.color;
ctx.fillText(pixel.sign.replace(/\$\{([\w.]+)\}/g, (_, path) => {
const value = path.split('.').reduce((obj, key) => obj?.[key], globalThis);
return typeof value === 'object' ? JSON.stringify(value) : value ?? '';
ctx.fillText(pixel.sign = pixel.sign.replace(/\$\{([\w.\[\]]+)\}/g, (_, path) => {
try {
const value = new Function('return globalThis.' + path)();
return typeof value === 'object' ? JSON.stringify(value) : value ?? '';
} catch {
return '';
}
}), canvasCoord(pixel.x), canvasCoord(pixel.y))
} else if (pixel.element == "e_sign" && pixel.sign){
if (pixel.charge || pixel.chargeCD){
ctx.font = `12pt Arial`
ctx.fillStyle = pixel.color;
ctx.fillText(pixel.sign.replace(/\$\{([\w.]+)\}/g, (_, path) => {
const value = path.split('.').reduce((obj, key) => obj?.[key], globalThis);
return typeof value === 'object' ? JSON.stringify(value) : value ?? '';
ctx.fillText(pixel.sign = pixel.sign.replace(/\$\{([\w.\[\]]+)\}/g, (_, path) => {
try {
const value = new Function('return globalThis.' + path)();
return typeof value === 'object' ? JSON.stringify(value) : value ?? '';
} catch {
return '';
}
}), canvasCoord(pixel.x), canvasCoord(pixel.y))
} else {
drawSquare(ctx, pixel.color, pixel.x, pixel.y)