Work order slots link to the recipe when empty

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-28 12:51:40 +00:00
parent 70be493558
commit ece0f101aa
2 changed files with 5 additions and 2 deletions

View file

@ -2459,8 +2459,10 @@ function orderSlots(o) {
const give = Math.min(have, need - pool);
// What putting them in pays you once they're crafted: your value's slice of the reagents' share.
const share = o.by === S.uid ? 0 : Math.round(o.reward / o.qty * out * C.input_share * item(id).value / worth * give);
const fill = give ? `${tip} · +${fmt(give)}${share ? ` → ${fmt(share)} gold` : ""}` : `${tip} · 🎒 0`;
return `<div class="ro-slot open"><button class="doll-slot empty-req" data-order-fill="${o.id}" data-item="${id}" ${give ? "" : "disabled"} title="${esc(fill)}">${item(id).icon}</button>
const fill = give ? `${tip} · +${fmt(give)}${share ? ` → ${fmt(share)} gold` : ""}` : `${tip} · 🎒 0${gotoTip(id)}`;
// None to give: the slot links to where it's made instead.
const click = give ? `data-order-fill="${o.id}" data-item="${id}"` : sourceOf(id) ? goto(id) : "disabled";
return `<div class="ro-slot open"><button class="doll-slot empty-req" ${click} title="${esc(fill)}">${item(id).icon}</button>
<span class="ro-have ${pool + have < need ? "bad" : "good"}">${fmt(pool)} / ${fmt(need)}</span><span class="ro-name">${esc(name)}</span></div>`;
}).join("");
}