Android build v1.0.43
This commit is contained in:
+631
-307
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,26 @@ const CRAFTING_LIST_PAGE_SIZE = 3
|
||||
const CRAFTING_FILTER_SLOTS = (Object.keys(SLOT_LABELS) as EquipmentSlot[])
|
||||
.filter((slot) => slot !== 'component')
|
||||
const DIRECT_CRAFT_ITEM_LEVELS = new Set([1, 10, 20, 25])
|
||||
type CraftingRecipe = CharacterProfile['craftingRecipes'][number]
|
||||
|
||||
function selectUpgradeRecipe(
|
||||
paths: CharacterProfile['gearUpgradePaths'],
|
||||
recipes: CraftingRecipe[],
|
||||
item: Pick<Item, 'id' | 'slot' | 'itemLevel'>,
|
||||
) {
|
||||
const path = paths.find((candidate) => candidate.fromItemId === item.id)
|
||||
if (path) {
|
||||
const pathRecipe = recipes.find((recipe) => recipe.item.id === path.toItemId)
|
||||
if (pathRecipe) return pathRecipe
|
||||
}
|
||||
const candidates = recipes.filter((recipe) =>
|
||||
recipe.item.slot === item.slot
|
||||
&& recipe.item.itemLevel > item.itemLevel
|
||||
)
|
||||
const nextItemLevel = Math.min(...candidates.map((recipe) => recipe.item.itemLevel))
|
||||
if (!Number.isFinite(nextItemLevel)) return undefined
|
||||
return candidates.find((recipe) => recipe.item.itemLevel === nextItemLevel)
|
||||
}
|
||||
|
||||
type Props = {
|
||||
profile: CharacterProfile
|
||||
@@ -85,13 +105,7 @@ export function EquipmentScreen({
|
||||
? profile.craftingRecipes.find((recipe) => recipe.item.id === selectedItem.id)
|
||||
: undefined
|
||||
const upgradeRecipe = selectedItem && selectedItemRecipe
|
||||
? profile.craftingRecipes
|
||||
.filter((recipe) =>
|
||||
recipe.sourceEncounterId === selectedItemRecipe.sourceEncounterId
|
||||
&& recipe.item.slot === selectedItem.slot
|
||||
&& recipe.item.itemLevel > selectedItem.itemLevel,
|
||||
)
|
||||
.sort((left, right) => left.item.itemLevel - right.item.itemLevel)[0]
|
||||
? selectUpgradeRecipe(profile.gearUpgradePaths ?? [], profile.craftingRecipes, selectedItem)
|
||||
: undefined
|
||||
const equippedBySlot = useMemo(
|
||||
() => new Map(
|
||||
|
||||
Reference in New Issue
Block a user