Fix recipe paper title, author, and bag description.
Saved recipes show the potion name as the read title, attribute authorship like letters, and use a recipe-paper sprite so the client no longer 404s the asset.
The contents of this binary file are not shown.
@@ -273,8 +273,9 @@ export function initInventory ({
273
273
mode: "read",
274
274
slotIndex,
275
275
instance: {
276
documentTitle: slot.instance.displayName ?? "Recipe",
276
277
body: slot.instance.body ?? "",
277
authorDisplayName: slot.instance.displayName ?? "Alchemy recipe"
278
authorDisplayName: slot.instance.authorDisplayName ?? "Unknown"
278
279
}
279
280
})
280
281
});
@@ -696,7 +697,8 @@ export function initInventory ({
696
697
function openLetter ({ mode, slotIndex, instance })
697
698
{
698
699
letterState = { mode, slotIndex, readOnly: mode === "read", instance: instance ?? null };
699
letterTitle.textContent = mode === "write" ? "Write letter" : mode === "edit" ? "Edit letter" : "Letter";
700
letterTitle.textContent = instance?.documentTitle
701
?? (mode === "write" ? "Write letter" : mode === "edit" ? "Edit letter" : "Letter");
700
702
letterBody.value = instance?.body ?? "";
701
703
letterBody.readOnly = letterState.readOnly;
702
704
letterBody.maxLength = LETTER_MAX_BODY_CHARS;
@@ -273,8 +273,9 @@ export function initInventory ({273
mode: "read",273
mode: "read",274
slotIndex,274
slotIndex,275
instance: {275
instance: {276
documentTitle: slot.instance.displayName ?? "Recipe",276
body: slot.instance.body ?? "",277
body: slot.instance.body ?? "",277
authorDisplayName: slot.instance.displayName ?? "Alchemy recipe"278
authorDisplayName: slot.instance.authorDisplayName ?? "Unknown"278
}279
}279
})280
})280
});281
});@@ -696,7 +697,8 @@ export function initInventory ({696
function openLetter ({ mode, slotIndex, instance })697
function openLetter ({ mode, slotIndex, instance })697
{698
{698
letterState = { mode, slotIndex, readOnly: mode === "read", instance: instance ?? null };699
letterState = { mode, slotIndex, readOnly: mode === "read", instance: instance ?? null };699
letterTitle.textContent = mode === "write" ? "Write letter" : mode === "edit" ? "Edit letter" : "Letter";700
letterTitle.textContent = instance?.documentTitle701
?? (mode === "write" ? "Write letter" : mode === "edit" ? "Edit letter" : "Letter");700
letterBody.value = instance?.body ?? "";702
letterBody.value = instance?.body ?? "";701
letterBody.readOnly = letterState.readOnly;703
letterBody.readOnly = letterState.readOnly;702
letterBody.maxLength = LETTER_MAX_BODY_CHARS;704
letterBody.maxLength = LETTER_MAX_BODY_CHARS;@@ -609,7 +609,9 @@ function saveRecipe (world, sessionId, command)
609
609
kind: "recipe-paper",
610
610
recipeId: randomUUID(),
611
611
potionKey: recipe.potionKey,
612
displayName: `${recipe.displayName} recipe`,
612
displayName: `${recipe.displayName} Recipe`,
613
authorCharacterId: command.characterId,
614
authorDisplayName: characterDisplayName(world, handle),
613
615
minAlchemyLevel: recipe.minAlchemyLevel ?? 1,
614
616
body: recipePaperBody(recipe),
615
617
writtenAt: Date.now()
@@ -609,7 +609,9 @@ function saveRecipe (world, sessionId, command)609
kind: "recipe-paper",609
kind: "recipe-paper",610
recipeId: randomUUID(),610
recipeId: randomUUID(),611
potionKey: recipe.potionKey,611
potionKey: recipe.potionKey,612
displayName: `${recipe.displayName} recipe`,612
displayName: `${recipe.displayName} Recipe`,613
authorCharacterId: command.characterId,614
authorDisplayName: characterDisplayName(world, handle),613
minAlchemyLevel: recipe.minAlchemyLevel ?? 1,615
minAlchemyLevel: recipe.minAlchemyLevel ?? 1,614
body: recipePaperBody(recipe),616
body: recipePaperBody(recipe),615
writtenAt: Date.now()617
writtenAt: Date.now()@@ -150,6 +150,8 @@ test("cauldron bottles lesser health tonic when steps and ratios match", () =>
150
150
const recipe = after.inventory.find((slot) => slot?.itemId === ItemId.recipePaper);
151
151
assert.match(recipe.instance?.body ?? "", /Lesser health tonic/);
152
152
assert.match(recipe.instance?.body ?? "", /Alchemy level required/);
153
assert.equal(recipe.instance?.displayName, "Lesser health tonic Recipe");
154
assert.equal(recipe.instance?.authorDisplayName, `${character.first_name} ${character.last_name}`);
153
155
}
154
156
finally
155
157
{ harness.close(); }
@@ -150,6 +150,8 @@ test("cauldron bottles lesser health tonic when steps and ratios match", () =>150
const recipe = after.inventory.find((slot) => slot?.itemId === ItemId.recipePaper);150
const recipe = after.inventory.find((slot) => slot?.itemId === ItemId.recipePaper);151
assert.match(recipe.instance?.body ?? "", /Lesser health tonic/);151
assert.match(recipe.instance?.body ?? "", /Lesser health tonic/);152
assert.match(recipe.instance?.body ?? "", /Alchemy level required/);152
assert.match(recipe.instance?.body ?? "", /Alchemy level required/);153
assert.equal(recipe.instance?.displayName, "Lesser health tonic Recipe");154
assert.equal(recipe.instance?.authorDisplayName, `${character.first_name} ${character.last_name}`);153
}155
}154
finally156
finally155
{ harness.close(); }157
{ harness.close(); }