Skip to content

Commit

Permalink
Display exotic armor by class and slot, in release order
Browse files Browse the repository at this point in the history
  • Loading branch information
gomander committed Oct 6, 2023
1 parent ec95510 commit 5429c2d
Show file tree
Hide file tree
Showing 10 changed files with 626 additions and 22 deletions.
5 changes: 1 addition & 4 deletions client/src/components/CreateGroupForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ const createGroup = () => {
</script>

<style scoped lang="sass">
.player-list
list-style-type: none
.min-width
width: fit-content
</style>
</style>
37 changes: 33 additions & 4 deletions client/src/components/DefinitionFetcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { isOldDuplicate, swapUniqueFrames } from 'src/utils/weapon-util'
import { filteredTriumphs } from 'src/utils/triumph-util'
import {
DestinyDamageTypeDefinition, DestinyInventoryItemDefinition,
DestinyItemSubType, DestinyPresentationNodeDefinition, DestinyRecordDefinition
DestinyItemSubType, DestinyItemType, DestinyPresentationNodeDefinition,
DestinyRecordDefinition,
TierType
} from 'bungie-api-ts/destiny2'
import {
BungieDamageType, BungieItemSubType, BungieAmmoType, BungieWeaponSlot,
Expand Down Expand Up @@ -102,6 +104,9 @@ const createWeapon = (item: DestinyInventoryItemDefinition): Weapon => {
const getInventoryItemDefinitions = async () => {
if (!definitionsStore.manifest) await getManifest()
if (!definitionsStore.manifest) return
if (gameStore.manifestVersion === definitionsStore.manifest.version) return
const items = await api.getDestinyManifestDefinition<DestinyInventoryItemDefinition>(
definitionsStore.manifest.jsonWorldComponentContentPaths.en.DestinyInventoryItemDefinition
)
Expand All @@ -111,14 +116,14 @@ const getInventoryItemDefinitions = async () => {
for (const key of Object.keys(items)) {
const item = items[Number(key)]
if (
item.itemType === 19 && // mod
item.itemType === DestinyItemType.Mod &&
item.itemCategoryHashes?.includes(2237038328) // intrinsic
) {
definitionsStore.weaponFrameDefinitions[key] = item
}
if (
item.itemType === 3 && // weapon
item.itemType === DestinyItemType.Weapon &&
item.itemCategoryHashes?.includes(1) && // weapon
item.quality?.currentVersion === item.quality!.versions.length - 1 && // newest version
item.quality.versions[item.quality.currentVersion].powerCapHash === 2759499571 // 999990
Expand All @@ -127,13 +132,22 @@ const getInventoryItemDefinitions = async () => {
}
if (
item.itemType === 26 && // bounty
item.itemType === DestinyItemType.Bounty &&
item.value.itemValue.filter(entry => xpHashes.includes(entry.itemHash)) // XP, XP+, or XP++
) {
definitionsStore.bountyDefinitions.set(key, item)
}
if (
item.itemType === DestinyItemType.Armor &&
item.inventory?.tierType === TierType.Exotic &&
item.collectibleHash // newest version
) {
definitionsStore.armorDefinitions.set(key, item)
}
}
gameStore.manifestVersion = definitionsStore.manifest.version
gameStore.weapons = []
gameStore.craftableWeapons = []
Expand Down Expand Up @@ -193,6 +207,21 @@ const getInventoryItemDefinitions = async () => {
hash: damageType.hash
})
}
gameStore.armor = []
definitionsStore.armorDefinitions.forEach(item => {
gameStore.armor.push({
name: item.displayProperties.name,
icon: 'https://www.bungie.net' + item.displayProperties.icon,
hash: item.hash,
slot: item.itemSubType,
class: item.classType,
rarity: item.inventory!.tierType,
ornaments: [],
seasonIcon: item.iconWatermark
})
})
}
const getPresentationNodeDefinitions = async () => {
Expand Down
5 changes: 4 additions & 1 deletion client/src/css/app.sass
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ table
height: 1px

tr
height: 100%
height: 100%

ul
list-style: none
Loading

0 comments on commit 5429c2d

Please sign in to comment.