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