From 014c88cb58124bd1e929899bff5abcf73c57b73d Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Sun, 16 Feb 2025 18:15:40 -0500 Subject: [PATCH 1/2] yea --- mods/nousersthings.js | 45 +++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index dddd9106..1443a631 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -1575,8 +1575,6 @@ elements.blackhole_storage = { tick: function(pixel) { if (!pixel.bhcontents){ pixel.bhcontents = []; - } else { - pixel.decidedcontent = pixel.bhcontents[Math.floor(Math.random()*pixel.bhcontents.length)]; } for (var i = 0; i < squareCoords.length; i++) { var coord = squareCoords[i]; @@ -1588,15 +1586,15 @@ elements.blackhole_storage = { pixel.bhcontents.push(otherPixel); deletePixel(otherPixel.x, otherPixel.y); } - } else if (pixel.charge && isEmpty(x,y) && pixel.decidedcontent){ - var otherPixel = pixelMap[x][y]; - pixel.decidedcontent.x = x; - pixel.decidedcontent.y = y; - delete pixel.decidedcontent.del; - otherPixel = pixel.decidedcontent; - currentPixels.push(pixel.decidedcontent); - pixel.bhcontents.splice(pixel.bhcontents.indexOf(pixel.decidedcontent), 1); - pixel.decidedcontent = pixel.bhcontents[Math.floor(Math.random()*pixel.bhcontents.length)]; + } else if (pixel.charge && isEmpty(x,y) && pixel.bhcontents.length){ + let randomindex = Math.floor(Math.random()*pixel.bhcontents.length); + let releasedPixel = pixel.bhcontents[randomindex] + pixel.bhcontents.splice(randomindex, 1) + delete releasedPixel.del + releasedPixel.x = x + releasedPixel.y = y + pixelMap[x][y] = releasedPixel + currentPixels.push(releasedPixel) } } }, @@ -3905,4 +3903,27 @@ elements.false_vacuum = { }, movable: false, hardness: 1 -} \ No newline at end of file +} +let signInput = "Hello World!"; +elements.sign = { + color: "#FFFFFF", + darkText: true, + category: "special", + onSelect: function(){ + let signi = prompt("What text should the sign display?", signInput||"Hello World!") + signInput = signi; + }, + renderer: function(pixel, ctx){ + if (!pixel.sign){pixel.sign = signInput} + }, + movable: false +} +renderPostPixel(function(ctx){ + for (pixel of currentPixels){ + if (pixel.element == "sign" && pixel.sign){ + ctx.font = `12pt PressStart2P` + ctx.fillStyle = pixel.color; + ctx.fillText(pixel.sign, canvasCoord(pixel.x), canvasCoord(pixel.y)) + } + } +}) \ No newline at end of file From 520b20612967bb9dfadffa6dff004cf3d73dfdc2 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Sun, 16 Feb 2025 18:18:21 -0500 Subject: [PATCH 2/2] f --- mods/nousersthings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 1443a631..5185528b 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -3921,7 +3921,7 @@ elements.sign = { renderPostPixel(function(ctx){ for (pixel of currentPixels){ if (pixel.element == "sign" && pixel.sign){ - ctx.font = `12pt PressStart2P` + ctx.font = `12pt Arial` ctx.fillStyle = pixel.color; ctx.fillText(pixel.sign, canvasCoord(pixel.x), canvasCoord(pixel.y)) }