Work orders: hammer on recipe and gathering cards

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-11-03 20:07:42 +00:00
parent b3d0645d55
commit 5606267df5
3 changed files with 13 additions and 2 deletions

View file

@ -6854,6 +6854,7 @@ ORDER_RECIPES, ORDER_RAW = _order_sources()
PATCH_NOTES = [
{"date": "2026-11-03", "title": "Combat materials on order", "notes": [
("new", "Work orders: relics, reagents and trophies under Materials ⚔️, by area."),
("new", "Work orders: 🔨 on recipes and gathering, opens the order."),
]},
{"date": "2026-11-02", "title": "Militia drilling", "notes": [
("fix", "Drilling the militia is no longer wiped before a raid is calculated. Last raid losses recalculated."),

View file

@ -1846,6 +1846,7 @@ function actionCard(a) {
: why || "Make this many, then queue more behind it";
const queued = me.queue.map((q, i) => q.id === a.id ? i + 1 : 0).filter(Boolean);
const out = Object.keys(a.outputs)[0];
const orderable = out && (C.order_recipes[out] || C.order_raw[out]);
const icon = a.icon;
const time = me.times[a.id];
let io = "";
@ -1900,7 +1901,7 @@ function actionCard(a) {
<div class="top"><div class="ico">${icon}</div><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>
</div><span class="tools">${orderable ? `<button class="order-it" data-order-item="${out}" title="${esc(`Work order: ${item(out).name}`)}">${glyph("claw-hammer", "#e3c060")}</button>` : ""}${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>` : ""}</span></div>
${io ? `<div class="io">${io}</div>` : ""}
${extra}
${me.action?.plot2 && (active || second) ? `<div class="small muted">Plot ${active ? 1 : 2}${growingNow ? " · growing now" : " · next"}</div>` : ""}
@ -3216,6 +3217,12 @@ document.addEventListener("click", (e) => {
draft.fund = d.forFund;
return go("orders");
}
if (d.orderItem) {
// From a recipe or gathering card: a work order for that item, ready to price and post.
draft = { kind: C.order_recipes[d.orderItem] ? "craft" : "gather", item: "", qty: 1, provide: [], reward: 0 };
pickOrderItem(d.orderItem);
return go("orders");
}
if ("orderShow" in d) { orderTab = "open"; return go("orders"); }
if ("orderNew" in d) {
draft = draft ? null : { kind: "craft", item: "", qty: 1, provide: [], reward: 0 };

View file

@ -196,7 +196,10 @@ textarea { width: 100%; resize: vertical; min-height: 60px; }
filter: grayscale(1); opacity: .35; }
.pin:hover { opacity: .7; }
.pin.on { filter: none; opacity: 1; }
.action .top .pin { margin-left: auto; align-self: flex-start; font-size: 14px; }
.action .top .tools { margin-left: auto; align-self: flex-start; display: flex; align-items: center; gap: 6px; flex: none; }
.action .top .pin { font-size: 14px; }
.order-it { background: none; border: 0; padding: 0 4px; font-size: 15px; line-height: 1; cursor: pointer; opacity: .55; }
.order-it:hover { opacity: 1; }
.action {
background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);