fix crafting bench filters
@@ -1,4 +1,5 @@
1
import {
1
import
2
{
2
3
itemDefinition,
3
4
itemDisplayName,
4
5
itemAssetPathForStack,
@@ -6,7 +7,8 @@ import {
6
7
ItemId
7
8
} from "/shared/definitions/items.js";
8
9
import { craftingStationDefinition, CraftingStationId } from "/shared/definitions/craftingStations.js";
9
import {
10
import
11
{
10
12
CRAFT_DURATION_MS,
11
13
canStartCraft,
12
14
countItemInSlots,
@@ -14,7 +16,8 @@ import {
14
16
recipesForStation
15
17
} from "/shared/crafting/recipes.js";
16
18
import { resolveTailorCraft } from "/shared/crafting/tailor.js";
17
import {
19
import
20
{
18
21
CLOTH_TIER_ORDER,
19
22
CLOTH_DISPLAY_NAME,
20
23
ClothTier,
@@ -23,7 +26,8 @@ import {
23
26
WOOD_TIER_ORDER,
24
27
WoodTier,
25
28
MaterialTier,
26
woodTierForMetal
29
woodTierForMetal,
30
clothTierForWood
27
31
} from "/shared/definitions/materialTiers.js";
28
32
import { craftDurationMs } from "/shared/definitions/gathering.js";
29
33
import { applyItemIcon } from "../render/potionIcon.js";
@@ -162,8 +166,11 @@ export function initCrafting ({
162
166
/** Map UI material selection to a recipe's xpMaterial tier. */
163
167
function recipeXpMaterialForSelection (recipe, material = selectedMaterial)
164
168
{
165
if (isCraftingBenchStation() && recipe.craftGroup === "bow")
169
if (isCraftingBenchStation()
170
&& (recipe.craftGroup === "bow" || recipe.craftGroup === "fishing-rod"))
166
171
{ return woodTierForMetal(material); }
172
if (isCraftingBenchStation() && recipe.craftGroup === "fishing-net")
173
{ return clothTierForWood(woodTierForMetal(material)); }
167
174
return material;
168
175
}
169
176
@@ -228,14 +235,17 @@ export function initCrafting ({
228
235
fallback: WoodTier.pine
229
236
};
230
237
}
231
// Crafting bench mixes metal tools and wood bows — show matched pairs.
238
// Crafting bench mixes metal tools, wood bows, and cloth fishing gear.
232
239
if (isCraftingBenchStation())
233
240
{
234
241
const names = {};
235
242
for (const metal of MATERIAL_TIER_ORDER)
236
243
{
237
244
const wood = woodTierForMetal(metal);
238
names[metal] = `${MATERIAL_DISPLAY_NAME[metal] ?? metal}/${MATERIAL_DISPLAY_NAME[wood] ?? wood}`;
245
const cloth = clothTierForWood(wood);
246
names[metal] = `${MATERIAL_DISPLAY_NAME[metal] ?? metal}/`
247
+ `${MATERIAL_DISPLAY_NAME[wood] ?? wood}/`
248
+ `${CLOTH_DISPLAY_NAME[cloth] ?? cloth}`;
239
249
}
240
250
return {
241
251
order: MATERIAL_TIER_ORDER,
@@ -308,7 +318,10 @@ export function initCrafting ({
308
318
if (!match)
309
319
{
310
320
match = variants[0];
311
if (match?.xpMaterial && !(isCraftingBenchStation() && match.craftGroup === "bow"))
321
if (match?.xpMaterial && !(isCraftingBenchStation()
322
&& (match.craftGroup === "bow"
323
|| match.craftGroup === "fishing-rod"
324
|| match.craftGroup === "fishing-net")))
312
325
{
313
326
selectedMaterial = match.xpMaterial;
314
327
if (materialTierSelect)
@@ -1,4 +1,5 @@1
import {1
import2
{2
itemDefinition,3
itemDefinition,3
itemDisplayName,4
itemDisplayName,4
itemAssetPathForStack,5
itemAssetPathForStack,@@ -6,7 +7,8 @@ import {6
ItemId7
ItemId7
} from "/shared/definitions/items.js";8
} from "/shared/definitions/items.js";8
import { craftingStationDefinition, CraftingStationId } from "/shared/definitions/craftingStations.js";9
import { craftingStationDefinition, CraftingStationId } from "/shared/definitions/craftingStations.js";9
import {10
import11
{10
CRAFT_DURATION_MS,12
CRAFT_DURATION_MS,11
canStartCraft,13
canStartCraft,12
countItemInSlots,14
countItemInSlots,@@ -14,7 +16,8 @@ import {14
recipesForStation16
recipesForStation15
} from "/shared/crafting/recipes.js";17
} from "/shared/crafting/recipes.js";16
import { resolveTailorCraft } from "/shared/crafting/tailor.js";18
import { resolveTailorCraft } from "/shared/crafting/tailor.js";17
import {19
import20
{18
CLOTH_TIER_ORDER,21
CLOTH_TIER_ORDER,19
CLOTH_DISPLAY_NAME,22
CLOTH_DISPLAY_NAME,20
ClothTier,23
ClothTier,@@ -23,7 +26,8 @@ import {23
WOOD_TIER_ORDER,26
WOOD_TIER_ORDER,24
WoodTier,27
WoodTier,25
MaterialTier,28
MaterialTier,26
woodTierForMetal29
woodTierForMetal,30
clothTierForWood27
} from "/shared/definitions/materialTiers.js";31
} from "/shared/definitions/materialTiers.js";28
import { craftDurationMs } from "/shared/definitions/gathering.js";32
import { craftDurationMs } from "/shared/definitions/gathering.js";29
import { applyItemIcon } from "../render/potionIcon.js";33
import { applyItemIcon } from "../render/potionIcon.js";@@ -162,8 +166,11 @@ export function initCrafting ({162
/** Map UI material selection to a recipe's xpMaterial tier. */166
/** Map UI material selection to a recipe's xpMaterial tier. */163
function recipeXpMaterialForSelection (recipe, material = selectedMaterial)167
function recipeXpMaterialForSelection (recipe, material = selectedMaterial)164
{168
{165
if (isCraftingBenchStation() && recipe.craftGroup === "bow")169
if (isCraftingBenchStation()170
&& (recipe.craftGroup === "bow" || recipe.craftGroup === "fishing-rod"))166
{ return woodTierForMetal(material); }171
{ return woodTierForMetal(material); }172
if (isCraftingBenchStation() && recipe.craftGroup === "fishing-net")173
{ return clothTierForWood(woodTierForMetal(material)); }167
return material;174
return material;168
}175
}169
176
@@ -228,14 +235,17 @@ export function initCrafting ({228
fallback: WoodTier.pine235
fallback: WoodTier.pine229
};236
};230
}237
}231
// Crafting bench mixes metal tools and wood bows — show matched pairs.238
// Crafting bench mixes metal tools, wood bows, and cloth fishing gear.232
if (isCraftingBenchStation())239
if (isCraftingBenchStation())233
{240
{234
const names = {};241
const names = {};235
for (const metal of MATERIAL_TIER_ORDER)242
for (const metal of MATERIAL_TIER_ORDER)236
{243
{237
const wood = woodTierForMetal(metal);244
const wood = woodTierForMetal(metal);238
names[metal] = `${MATERIAL_DISPLAY_NAME[metal] ?? metal}/${MATERIAL_DISPLAY_NAME[wood] ?? wood}`;245
const cloth = clothTierForWood(wood);246
names[metal] = `${MATERIAL_DISPLAY_NAME[metal] ?? metal}/`247
+ `${MATERIAL_DISPLAY_NAME[wood] ?? wood}/`248
+ `${CLOTH_DISPLAY_NAME[cloth] ?? cloth}`;239
}249
}240
return {250
return {241
order: MATERIAL_TIER_ORDER,251
order: MATERIAL_TIER_ORDER,@@ -308,7 +318,10 @@ export function initCrafting ({308
if (!match)318
if (!match)309
{319
{310
match = variants[0];320
match = variants[0];311
if (match?.xpMaterial && !(isCraftingBenchStation() && match.craftGroup === "bow"))321
if (match?.xpMaterial && !(isCraftingBenchStation()322
&& (match.craftGroup === "bow"323
|| match.craftGroup === "fishing-rod"324
|| match.craftGroup === "fishing-net")))312
{325
{313
selectedMaterial = match.xpMaterial;326
selectedMaterial = match.xpMaterial;314
if (materialTierSelect)327
if (materialTierSelect)