Townsfolk: food variety icons, plain labels
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a8a3a45846
commit
b385012c45
3 changed files with 16 additions and 4 deletions
|
|
@ -2362,7 +2362,13 @@ function reqRow(r) {
|
|||
const link = goto(r.item, Boolean(r.any || r.kinds)), tip = link ? ` title="${esc(gotoTip(r.item).trim())}"` : "";
|
||||
return `<div class="req ${r.next ? "dim" : ""}"><span${link}${tip}>${item(r.item).icon}</span><span><span${link}${tip}>${esc(r.label)}</span> <span class="muted small">${fmt(r.have)} / ${fmt(r.want)}</span></span>
|
||||
${mine ? `<button class="btn sm gold" data-donate="${r.item}" data-qty="all">Give ${fmt(mine)}</button>` : "<span></span>"}
|
||||
<div class="bar"><span style="width:${r.want ? Math.min(100, r.have / r.want * 100) : 100}%"></span></div></div>`;
|
||||
${r.foods ? foodKinds(r) : `<div class="bar"><span style="width:${r.want ? Math.min(100, r.have / r.want * 100) : 100}%"></span></div>`}</div>`;
|
||||
}
|
||||
|
||||
// Every kind of food: lit when the stockpile holds a day of it, faded red when it doesn't.
|
||||
function foodKinds(r) {
|
||||
return `<div class="food-kinds">${Object.entries(r.foods).map(([id, meals]) =>
|
||||
`<span class="${meals >= r.day ? "" : "missing"}" title="${esc(`${item(id).name} · ${fmt(meals)} / ${fmt(r.day)} meals`)}">${item(id).icon}</span>`).join("")}</div>`;
|
||||
}
|
||||
|
||||
function raidPrep(ev) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue