Fittings tab marks what the town already has
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e6702871ff
commit
2996d7a9d7
2 changed files with 13 additions and 1 deletions
|
|
@ -882,6 +882,15 @@ function needTag(id) {
|
|||
return n ? `<span class="tag gold" title="${esc(`City needs ${fmt(n.qty)} ${item(id).name}\n${n.why.join("\n")}`)}">🏘️ ${fmt(n.qty)}</span>` : "";
|
||||
}
|
||||
|
||||
// A fitting the town already has: working, or paused while its building is damaged.
|
||||
function fittedTag(id) {
|
||||
const f = C.fittings.find((x) => x.id === id), b = f && S.city.buildings[f.building];
|
||||
if (!b?.fittings.includes(id)) return "";
|
||||
const where = `${C.buildings[f.building].icon} ${C.buildings[f.building].name}`;
|
||||
return b.damaged ? `<span class="tag bad" title="${esc(`Fitted in the ${where}, paused until it's repaired`)}">✓ Paused</span>`
|
||||
: `<span class="tag good" title="${esc(`Fitted in the ${where}`)}">✓ Fitted</span>`;
|
||||
}
|
||||
|
||||
// --- skill pages ----------------------------------------------------------
|
||||
|
||||
function skillPage(id) {
|
||||
|
|
@ -1695,7 +1704,7 @@ function actionCard(a) {
|
|||
return `
|
||||
<div class="action ${active || second ? "active" : ""} ${locked ? "locked" : ""}">
|
||||
<div class="top"><div class="ico">${icon}</div><div>
|
||||
<div class="name">${esc(a.name)} ${Object.keys(a.outputs).map(needTag).join("")}</div>
|
||||
<div class="name">${esc(a.name)} ${Object.keys(a.outputs).map((id) => needTag(id) + fittedTag(id)).join("")}</div>
|
||||
<div class="sub">Level ${a.level} · ${dur(time)} · ${a.xp} XP</div>
|
||||
</div>${Object.keys(a.inputs).length ? `<button class="pin ${me.tracked === a.id ? "on" : ""}" data-track="${a.id}" title="${me.tracked === a.id ? "Untrack" : "Track"}">📌</button>` : ""}</div>
|
||||
${io ? `<div class="io">${io}</div>` : ""}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue