yurp
This commit is contained in:
25
index.html
25
index.html
@@ -529,7 +529,7 @@
|
|||||||
<div id="steps-modal" class="modal">
|
<div id="steps-modal" class="modal">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
Assembly Instructions
|
Synthesis Instructions
|
||||||
<button class="close-btn" onclick="closeSteps()">×</button>
|
<button class="close-btn" onclick="closeSteps()">×</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body" id="steps-list">
|
<div class="modal-body" id="steps-list">
|
||||||
@@ -849,7 +849,8 @@
|
|||||||
id: id,
|
id: id,
|
||||||
recipe: recipe,
|
recipe: recipe,
|
||||||
batches: batches,
|
batches: batches,
|
||||||
amountProduced: batches * yieldAmt
|
amountProduced: batches * yieldAmt,
|
||||||
|
depth: depth
|
||||||
});
|
});
|
||||||
|
|
||||||
// 5. Produce Byproducts
|
// 5. Produce Byproducts
|
||||||
@@ -939,6 +940,12 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Sort by depth
|
||||||
|
merged.sort((a, b) => a.depth - b.depth);
|
||||||
|
|
||||||
|
// Reverse to get topological order (Dependencies first)
|
||||||
|
merged.reverse();
|
||||||
|
|
||||||
return merged;
|
return merged;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1113,7 +1120,7 @@
|
|||||||
const rIdx = selectedRecipes[node.id] !== undefined ? selectedRecipes[node.id] : 0;
|
const rIdx = selectedRecipes[node.id] !== undefined ? selectedRecipes[node.id] : 0;
|
||||||
const hasRecipe = recipeList.length > 0 && rIdx !== -1 && node.type !== 'surplus';
|
const hasRecipe = recipeList.length > 0 && rIdx !== -1 && node.type !== 'surplus';
|
||||||
const currentRecipe = hasRecipe ? recipeList[rIdx] : null;
|
const currentRecipe = hasRecipe ? recipeList[rIdx] : null;
|
||||||
|
console.log(node.id, recipeList, rIdx, hasRecipe, currentRecipe);
|
||||||
let content = '';
|
let content = '';
|
||||||
if (node.type === 'surplus') {
|
if (node.type === 'surplus') {
|
||||||
content = `<div style="color: var(--accent-orange); font-size: 0.8rem;">[ FROM BYPRODUCTS ]</div>`;
|
content = `<div style="color: var(--accent-orange); font-size: 0.8rem;">[ FROM BYPRODUCTS ]</div>`;
|
||||||
@@ -1133,8 +1140,18 @@
|
|||||||
</div>
|
</div>
|
||||||
`).join('')}
|
`).join('')}
|
||||||
</div>`;
|
</div>`;
|
||||||
} else {
|
} else if (recipeList.length == 0) {
|
||||||
content = `<div style="color: var(--accent-cyan); font-size: 0.8rem; font-weight: bold;">[ RAW MATERIAL ]</div>`;
|
content = `<div style="color: var(--accent-cyan); font-size: 0.8rem; font-weight: bold;">[ RAW MATERIAL ]</div>`;
|
||||||
|
} else {
|
||||||
|
content = `
|
||||||
|
<select class="recipe-select" onchange="changeRecipe('${node.id}', this.value)">
|
||||||
|
<option value="-1" ${rIdx == -1 ? 'selected' : ''}>[ Already Have ]</option>
|
||||||
|
${recipeList.map((r, i) => {
|
||||||
|
if (document.getElementById('hide-grind').checked && isGrindRecipe(r) && rIdx !== i) return '';
|
||||||
|
return `<option value="${i}" ${rIdx == i ? 'selected' : ''}>${r.id}</option>`;
|
||||||
|
}).join('')}
|
||||||
|
</select>
|
||||||
|
<div style="color: var(--accent-cyan); font-size: 0.8rem; font-weight: bold;">[ TREATED AS RAW MATERIAL ]</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.innerHTML = `
|
div.innerHTML = `
|
||||||
|
|||||||
Reference in New Issue
Block a user