From bbac5481908c7dfd6af66bf392defdd88d176be7 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Fri, 15 Dec 2023 22:17:21 -0500 Subject: [PATCH 1/2] Update heatglow.js --- mods/heatglow.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/mods/heatglow.js b/mods/heatglow.js index 42d9b847..a32f16ff 100644 --- a/mods/heatglow.js +++ b/mods/heatglow.js @@ -1,11 +1,11 @@ const heatfunc = function(pixel){ - pixel.gethigh = (elements[pixel.element].tempHigh) - pixel.halftemp = ((20+pixel.gethigh)/2) - if (!pixel.ogR || !pixel.ogG || !pixel.ogB){ + if (pixel.ogR == null || pixel.ogG == null || pixel.ogB == null){ pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10) pixel.ogG = parseInt(pixel.color.slice(pixel.color.indexOf(',') + 1, pixel.color.lastIndexOf(',')), 10) pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10) - }else if (pixelTicks > pixel.start){ + }else{ + pixel.gethigh = (elements[pixel.element].tempHigh) + pixel.halftemp = ((20+pixel.gethigh)/2) if (pixel.temp <= (pixel.gethigh) - pixel.halftemp){ pixel.ctemp = 0; } else if (pixel.temp > (pixel.gethigh)-pixel.halftemp && pixel.temp <= pixel.gethigh){ @@ -17,7 +17,7 @@ const heatfunc = function(pixel){ pixel.newB = ((0-((2*pixel.ogB)*pixel.ctemp))+pixel.ogB); }else if (pixel.ctemp > 0.5){ pixel.newR = 255; - pixel.newG = ((510*pixel.ctemp)-256); + pixel.newG = ((510*pixel.ctemp)-255); pixel.newB= ((280*pixel.ctemp)-140); } pixel.color = "rgb(" + pixel.newR + "," + pixel.newG + "," + pixel.newB + ")"; @@ -36,3 +36,14 @@ metals.forEach(metal => { elements[metal].tick = modfunc; } }); +elements.color_baker = { + color: "#F61212", + tool: function(pixel) { + pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10) + pixel.ogG = parseInt(pixel.color.slice(pixel.color.indexOf(',') + 1, pixel.color.lastIndexOf(',')), 10) + pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10) + }, + category: "tools", + excludeRandom: true, + desc: "Use to bake a metals paint color into its 'true' color, for heating purposes.", +} From 47e392bd8853d6e39ea634b69447d92e28e5ba59 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Fri, 15 Dec 2023 23:09:23 -0500 Subject: [PATCH 2/2] Update heatglow.js --- mods/heatglow.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/heatglow.js b/mods/heatglow.js index a32f16ff..eb063be4 100644 --- a/mods/heatglow.js +++ b/mods/heatglow.js @@ -23,8 +23,9 @@ const heatfunc = function(pixel){ pixel.color = "rgb(" + pixel.newR + "," + pixel.newG + "," + pixel.newB + ")"; } }; - const metals = ["iron", "glass", "copper", "gold", "brass","steel","nickel","zinc","silver","aluminum","bronze","metal_scrap","oxidized_copper","tin","lead"]; -metals.forEach(metal => { + if (!eLists.metals) { eLists.metals = [] } + eLists.metals = eLists.metals.concat(["iron", "glass", "copper", "gold", "brass","steel","nickel","zinc","silver","aluminum","bronze","metal_scrap","oxidized_copper","tin","lead"]) +eLists.metals.forEach(metal => { const prefunc = elements[metal].tick; if (!prefunc){ elements[metal].tick = heatfunc;