Skip to content

Commit 5d7f490

Browse files
committed
small fixes
1 parent a7bc14d commit 5d7f490

File tree

3 files changed

+12
-21
lines changed

3 files changed

+12
-21
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ I love the game Factorio and I really like the look of factories after growing f
77

88
All factorio buildings and tiles with their bounding boxes and belt, pipe, rail, inserter, wire and electricity connections can be visualized. Everything is drawn in vector graphics (SVG) to be able to view it in any resolution.
99

10-
Use the [online demo](https://piebro.github.io/factorio-blueprint-visualizer/) to visualize your own blueprints. With the latest update, only Blueprints from Factorio 2.0 and later work correctly.
10+
Use the [online demo](https://piebro.github.io/factorio-blueprint-visualizer/) to visualize your own blueprints. With the latest update, Blueprints from Factorio before version 2.0 might not work correctly.
1111

1212
## Examples
1313

drawingSettings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const EXAMPLE_SETTINGS = [
99
["underground-belts", {'stroke': '#f3ffbd'}],
1010
["inserters", {'stroke': '#f3ffbd'}],
1111

12-
["bbox", {'fill': '#247ba0'}, {'deny': ["pipe", "pipe-to-ground", "belt", "inserter", "solar-panel", "accumulator", "asteroid-collector", "cargo-bay", "space-platform-hub", "thruster"]}],
12+
["bbox", {'fill': '#247ba0'}, {'deny': ["pipe", "pipe-to-ground", "belts", "inserters", "solar-panel", "accumulator", "asteroid-collector", "cargo-bay", "space-platform-hub", "thruster"]}],
1313
["bbox", {'fill': '#ff1654'}, {'allow': ["solar-panel"]}],
1414
["bbox", {'fill': '#436436'}, {'allow': ["accumulator"]}],
1515
["bbox", {'fill': '#70c1b3'}, {'allow': ["cargo-bay"]}],

index.html

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -134,24 +134,14 @@
134134

135135
getCurrentBlueprintEntityCount(currentBlueprint)
136136

137-
prevSelection = document.getElementById('blueprintSelection');
138-
if (prevSelection != null) {
139-
prevSelection.remove();
140-
}
141-
142-
if (currentBlueprintNames.length > 1){
143-
selection = document.createElement("select")
144-
selection.classList.add("btn")
145-
selection.setAttribute("id", "blueprintSelection")
146-
selection.setAttribute("style", "width: 160px;")
147-
selection.setAttribute("onChange", "blueprintSelectionOnChange(this)")
148-
for (i in currentBlueprintNames){
149-
option = document.createElement("option")
150-
option.setAttribute("value", i)
151-
option.innerHTML = currentBlueprintNames[i] || "unnamed"
152-
selection.appendChild(option)
153-
}
154-
document.getElementById("button-container").appendChild(selection)
137+
const selection = document.getElementById('blueprintSelection');
138+
selection.innerHTML = ''; // Clear existing options
139+
140+
for (i in currentBlueprintNames){
141+
option = document.createElement("option")
142+
option.setAttribute("value", i)
143+
option.innerHTML = currentBlueprintNames[i] || "unnamed"
144+
selection.appendChild(option)
155145
}
156146
}
157147

@@ -461,7 +451,8 @@ <h1 style="text-align: center; color: #04AA6D; margin: 5px 0;">Factorio Blueprin
461451
<div class="button-container" id="button-container">
462452
<button class="btn" id="uploadBtn" onclick="uploadBtnClick()">Upload Blueprint</button>
463453
<button class="btn" id="nextSettingBtn" onclick="nextSetting()">Random Drawing Setting</button>
464-
454+
<select class="btn" id="blueprintSelection" style="width: 160px;" onChange="blueprintSelectionOnChange(this)">
455+
</select>
465456
</div>
466457

467458
<div class="svg-container" id="svg-container"></div>

0 commit comments

Comments
 (0)