BlueGit

timfa questward

Show fish names on cook recipes and fix tinderbox equip frames.

Cook UI labels use each species name; tinderbox-equip is registered as a single frame so firestarting can show it.

timfa Tim Falken · pushed by timfa

Authored 2026-08-31 · 2 months ago

Hash
fb5a4a892f4b0680217d98cadc00dddf4c942737
Parent
c41d8cda
4 files changed +28 −4
server/src/assets/spriteCatalog.js +9 −2
@@ -407,12 +407,19 @@ function scanLayer (layerDir, definitions, layer, urlFolder)
407 407 ...sheet
408 408 });
409 409 }
410 /** Worn/gather overlays are always single-frame (inventory sheets may differ). */
411 const equipSheet = {
412 subImgTotal: 1,
413 perRow: 1,
414 loop: false,
415 animationSpeed: 0
416 };
410 417 if (equips[state])
411 418 {
412 419 images.push({
413 420 name: equipImageName(layer, def.key, state),
414 421 url: `/assets/${urlFolder}/${def.key}/${state}-equip.png`,
415 ...sheet
422 ...equipSheet
416 423 });
417 424 }
418 425 if (equipBlooms[state])
@@ -420,7 +427,7 @@ function scanLayer (layerDir, definitions, layer, urlFolder)
420 427 images.push({
421 428 name: equipBloomImageName(layer, def.key, state),
422 429 url: `/assets/${urlFolder}/${def.key}/${state}-equip-bloom.png`,
423 ...sheet
430 ...equipSheet
424 431 });
425 432 }
426 433 }
@@ -407,12 +407,19 @@ function scanLayer (layerDir, definitions, layer, urlFolder)
407 ...sheet
407 ...sheet
408 });
408 });
409 }
409 }
410 /** Worn/gather overlays are always single-frame (inventory sheets may differ). */
411 const equipSheet = {
412 subImgTotal: 1,
413 perRow: 1,
414 loop: false,
415 animationSpeed: 0
416 };
410 if (equips[state])
417 if (equips[state])
411 {
418 {
412 images.push({
419 images.push({
413 name: equipImageName(layer, def.key, state),
420 name: equipImageName(layer, def.key, state),
414 url: `/assets/${urlFolder}/${def.key}/${state}-equip.png`,
421 url: `/assets/${urlFolder}/${def.key}/${state}-equip.png`,
415 ...sheet
422 ...equipSheet
416 });
423 });
417 }
424 }
418 if (equipBlooms[state])
425 if (equipBlooms[state])
@@ -420,7 +427,7 @@ function scanLayer (layerDir, definitions, layer, urlFolder)
420 images.push({
427 images.push({
421 name: equipBloomImageName(layer, def.key, state),
428 name: equipBloomImageName(layer, def.key, state),
422 url: `/assets/${urlFolder}/${def.key}/${state}-equip-bloom.png`,
429 url: `/assets/${urlFolder}/${def.key}/${state}-equip-bloom.png`,
423 ...sheet
430 ...equipSheet
424 });
431 });
425 }
432 }
426 }
433 }
server/tests/firestarting-cooking.test.js +10 −0
@@ -113,6 +113,16 @@ test("cook-venison recipe exists for oven and campfire with burnt output", () =>
113 113 assert.equal(recipe.inputs[0].itemId, CraftingItemId.rawMeat);
114 114 });
115 115
116 test("fish cook recipes use the species name as craft label", () =>
117 {
118 const trout = recipeDefinition("cook-trout");
119 assert.ok(trout);
120 assert.equal(trout.craftGroupLabel, "Trout");
121 assert.equal(trout.craftGroup, "cook-trout");
122 const minnow = recipeDefinition("cook-minnow");
123 assert.equal(minnow.craftGroupLabel, "Minnow");
124 });
125
116 126 test("start-fire places campfire and expiry drops ash", () =>
117 127 {
118 128 const harness = makeSimulation({ workerCount: 1 });
@@ -113,6 +113,16 @@ test("cook-venison recipe exists for oven and campfire with burnt output", () =>
113 assert.equal(recipe.inputs[0].itemId, CraftingItemId.rawMeat);
113 assert.equal(recipe.inputs[0].itemId, CraftingItemId.rawMeat);
114});
114});
115
115
116test("fish cook recipes use the species name as craft label", () =>
117{
118 const trout = recipeDefinition("cook-trout");
119 assert.ok(trout);
120 assert.equal(trout.craftGroupLabel, "Trout");
121 assert.equal(trout.craftGroup, "cook-trout");
122 const minnow = recipeDefinition("cook-minnow");
123 assert.equal(minnow.craftGroupLabel, "Minnow");
124});
125
116test("start-fire places campfire and expiry drops ash", () =>
126test("start-fire places campfire and expiry drops ash", () =>
117{
127{
118 const harness = makeSimulation({ workerCount: 1 });
128 const harness = makeSimulation({ workerCount: 1 });
server/tests/tile-states.test.js +7 −0
@@ -34,6 +34,13 @@ test("bloom companions are not visual states", () =>
34 34 const pigeon = catalog.images.find((image) => image.name === "mob:pigeon:pigeon-flying");
35 35 assert.equal(pigeon.subImgTotal, 2);
36 36 assert.equal(pigeon.perRow, 2);
37 const tinderEquip = catalog.images.find((image) => image.name === "item:tinderbox:tinderbox:equip");
38 assert.ok(tinderEquip);
39 assert.equal(tinderEquip.subImgTotal, 1);
40 assert.equal(tinderEquip.perRow, 1);
41 const tinderIcon = catalog.images.find((image) => image.name === "item:tinderbox:tinderbox");
42 assert.equal(tinderIcon.subImgTotal, 6);
43 assert.equal(tinderIcon.perRow, 3);
37 44 assert.ok(catalog.images.some((image) => image.name === "character:player-body-male:player-body-male"));
38 45 assert.ok(!catalog.blocks.torch.states.includes("torch-bloom"));
39 46 assert.ok(!catalog.blocks.torch.states.some((state) => state.includes("equip")));
@@ -34,6 +34,13 @@ test("bloom companions are not visual states", () =>
34 const pigeon = catalog.images.find((image) => image.name === "mob:pigeon:pigeon-flying");
34 const pigeon = catalog.images.find((image) => image.name === "mob:pigeon:pigeon-flying");
35 assert.equal(pigeon.subImgTotal, 2);
35 assert.equal(pigeon.subImgTotal, 2);
36 assert.equal(pigeon.perRow, 2);
36 assert.equal(pigeon.perRow, 2);
37 const tinderEquip = catalog.images.find((image) => image.name === "item:tinderbox:tinderbox:equip");
38 assert.ok(tinderEquip);
39 assert.equal(tinderEquip.subImgTotal, 1);
40 assert.equal(tinderEquip.perRow, 1);
41 const tinderIcon = catalog.images.find((image) => image.name === "item:tinderbox:tinderbox");
42 assert.equal(tinderIcon.subImgTotal, 6);
43 assert.equal(tinderIcon.perRow, 3);
37 assert.ok(catalog.images.some((image) => image.name === "character:player-body-male:player-body-male"));
44 assert.ok(catalog.images.some((image) => image.name === "character:player-body-male:player-body-male"));
38 assert.ok(!catalog.blocks.torch.states.includes("torch-bloom"));
45 assert.ok(!catalog.blocks.torch.states.includes("torch-bloom"));
39 assert.ok(!catalog.blocks.torch.states.some((state) => state.includes("equip")));
46 assert.ok(!catalog.blocks.torch.states.some((state) => state.includes("equip")));
shared/definitions/fishItems.js +2 −2
@@ -506,8 +506,8 @@ export function fishingCookRecipes ()
506 506 const species = FISH_SPECIES[speciesId];
507 507 return Object.freeze({
508 508 recipeId: `cook-${species.key}`,
509 craftGroup: "cook-fish",
510 craftGroupLabel: "Fish",
509 craftGroup: `cook-${species.key}`,
510 craftGroupLabel: species.displayName,
511 511 stationIds: [CraftingStationId.oven, CraftingStationId.fireplace],
512 512 output: { itemId: ids.cooked, quantity: 1 },
513 513 inputs: [{ itemId: ids.raw, quantity: 1 }],
@@ -506,8 +506,8 @@ export function fishingCookRecipes ()
506 const species = FISH_SPECIES[speciesId];
506 const species = FISH_SPECIES[speciesId];
507 return Object.freeze({
507 return Object.freeze({
508 recipeId: `cook-${species.key}`,
508 recipeId: `cook-${species.key}`,
509 craftGroup: "cook-fish",
509 craftGroup: `cook-${species.key}`,
510 craftGroupLabel: "Fish",
510 craftGroupLabel: species.displayName,
511 stationIds: [CraftingStationId.oven, CraftingStationId.fireplace],
511 stationIds: [CraftingStationId.oven, CraftingStationId.fireplace],
512 output: { itemId: ids.cooked, quantity: 1 },
512 output: { itemId: ids.cooked, quantity: 1 },
513 inputs: [{ itemId: ids.raw, quantity: 1 }],
513 inputs: [{ itemId: ids.raw, quantity: 1 }],