Merge branch 'main' of https://github.com/JustAGenericUsername/sandboxelsmodding
This commit is contained in:
commit
8ec10e41d6
|
|
@ -0,0 +1 @@
|
||||||
|
elements.gray_goo.behavior = [ ["XX", "CH:gray_goo%25", "XX"], ["M2%5 AND CH:gray_goo0%25","XX","M2%5 AND CH:gray_goo%25"], ["XX","CH:gray_goo0%25 AND M1","XX"] ]
|
||||||
|
|
@ -120,7 +120,7 @@
|
||||||
"freezer":"zamrażarka",
|
"freezer":"zamrażarka",
|
||||||
"pipe":"rura",
|
"pipe":"rura",
|
||||||
"pipe_wall":"ściana_rury",
|
"pipe_wall":"ściana_rury",
|
||||||
"ewall":"ściana_elektryczna",
|
"ewall":"e-ściana",
|
||||||
"torch":"pochodnia",
|
"torch":"pochodnia",
|
||||||
"spout":"kran",
|
"spout":"kran",
|
||||||
"udder":"wymię",
|
"udder":"wymię",
|
||||||
|
|
@ -532,12 +532,12 @@
|
||||||
"magnesium": "magnez",
|
"magnesium": "magnez",
|
||||||
"molten_magnesium": "stopiony_magnez",
|
"molten_magnesium": "stopiony_magnez",
|
||||||
"sandstorm": "burza_piaskowa",
|
"sandstorm": "burza_piaskowa",
|
||||||
"caustic_potash": "",
|
"caustic_potash": "potaż_żrący",
|
||||||
"antibomb": "antybomba",
|
"antibomb": "antybomba",
|
||||||
"tornado": "tornado",
|
"tornado": "tornado",
|
||||||
"earthquake": "trzęsienie_ziemi",
|
"earthquake": "trzęsienie_ziemi",
|
||||||
"tsunami": "tsunami",
|
"tsunami": "tsunami",
|
||||||
"blaster": "promień",
|
"blaster": "promień",
|
||||||
"propane_ice": "lód_propanowy",
|
"propane_ice": "lód_propanowy",
|
||||||
"molten_caustic_potash": ""
|
"molten_caustic_potash": "stopiony_potaż_żrący"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,77 @@
|
||||||
|
// RedBirdly's mod to draw lines between transmitters/receivers
|
||||||
|
// logicgates.js required
|
||||||
|
|
||||||
|
let logicReceivers = [];
|
||||||
|
let logicTransmitters = [];
|
||||||
|
// let receivers = [];
|
||||||
|
// let transmitters = [];
|
||||||
|
|
||||||
|
function updateLogicLists() {
|
||||||
|
// receivers = [];
|
||||||
|
// transmitters = [];
|
||||||
|
logicReceivers = [];
|
||||||
|
logicTransmitters = [];
|
||||||
|
|
||||||
|
for (let i = 0; i < currentPixels.length; i++) {
|
||||||
|
const pixel = currentPixels[i];
|
||||||
|
if (pixel.element === "logic_receiver") {
|
||||||
|
logicReceivers.push(pixel);
|
||||||
|
} else if (pixel.element === "logic_transmitter") {
|
||||||
|
logicTransmitters.push(pixel);
|
||||||
|
} /*else if (pixel.element === "receiver") {
|
||||||
|
receivers.push(pixel);
|
||||||
|
} else if (pixel.element === "transmitter") {
|
||||||
|
transmitters.push(pixel);
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to draw lines between linked transmitters and receivers
|
||||||
|
function drawLinks() {
|
||||||
|
// Iterate through transmitters and receivers to draw lines for linked channels
|
||||||
|
for (const transmitter of logicTransmitters) {
|
||||||
|
for (const receiver of logicReceivers) {
|
||||||
|
if (transmitter.channel === receiver.channel) {
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.moveTo(transmitter.x * pixelSize + pixelSizeHalf, transmitter.y * pixelSize + pixelSizeHalf);
|
||||||
|
ctx.lineTo(receiver.x * pixelSize + pixelSizeHalf, receiver.y * pixelSize + pixelSizeHalf);
|
||||||
|
ctx.strokeStyle = "RGBA(255,255,255,0.2)";
|
||||||
|
|
||||||
|
const neighbors = [
|
||||||
|
{ x: transmitter.x, y: transmitter.y - 1 }, // Top
|
||||||
|
{ x: transmitter.x, y: transmitter.y + 1 }, // Bottom
|
||||||
|
{ x: transmitter.x - 1, y: transmitter.y }, // Left
|
||||||
|
{ x: transmitter.x + 1, y: transmitter.y } // Right
|
||||||
|
];
|
||||||
|
|
||||||
|
let highlight = false;
|
||||||
|
for (const neighbor of neighbors) {
|
||||||
|
if (
|
||||||
|
neighbor.x >= 0 && neighbor.x < width &&
|
||||||
|
neighbor.y >= 0 && neighbor.y < height
|
||||||
|
) {
|
||||||
|
const neighborPixel = pixelMap[neighbor.x][neighbor.y];
|
||||||
|
if (neighborPixel && neighborPixel.lstate > 0) {
|
||||||
|
highlight = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (highlight) {
|
||||||
|
ctx.strokeStyle = "RGBA(255,200,0,0.4)";
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.lineWidth = 2;
|
||||||
|
ctx.stroke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var originalDrawPixels2 = drawPixels;
|
||||||
|
drawPixels = function() {
|
||||||
|
originalDrawPixels2();
|
||||||
|
updateLogicLists();
|
||||||
|
drawLinks();
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue