From c853db31fe942fd013516bf383e2e95608331c69 Mon Sep 17 00:00:00 2001 From: Nigel Breslaw Date: Wed, 24 Jul 2024 14:49:00 +0300 Subject: [PATCH] refactor: Simplify setting up Bungie definitions (#2141) --- .../inventory/sections/GuardianDetails.tsx | 3 ++- native/app/inventory/sections/SeparatorUI.tsx | 3 ++- native/app/utilities/Constants.ts | 24 ------------------- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/native/app/inventory/sections/GuardianDetails.tsx b/native/app/inventory/sections/GuardianDetails.tsx index 4a58c3c29..c08b8fe20 100644 --- a/native/app/inventory/sections/GuardianDetails.tsx +++ b/native/app/inventory/sections/GuardianDetails.tsx @@ -1,8 +1,9 @@ import { useGGStore } from "@/app/store/GGStore.ts"; import { StyleSheet, View, Text } from "react-native"; import { Image } from "expo-image"; -import { DESTINY_TEXT, POWER_LEVEL, VAULT_CHARACTER_ID } from "@/app/utilities/Constants.ts"; +import { POWER_LEVEL, VAULT_CHARACTER_ID } from "@/app/utilities/Constants.ts"; import { getGuardianClassType, getGuardianRaceType } from "@/app/utilities/Helpers.ts"; +import { DESTINY_TEXT } from "@/app/store/Definitions.ts"; const styles = StyleSheet.create({ root: { diff --git a/native/app/inventory/sections/SeparatorUI.tsx b/native/app/inventory/sections/SeparatorUI.tsx index 05a80cc84..fc99670e7 100644 --- a/native/app/inventory/sections/SeparatorUI.tsx +++ b/native/app/inventory/sections/SeparatorUI.tsx @@ -2,7 +2,8 @@ import { StyleSheet, View, Text } from "react-native"; import { SEPARATOR_HEIGHT, DEFAULT_MARGIN } from "@/app/utilities/UISize.ts"; import { useGGStore } from "@/app/store/GGStore.ts"; -import { BUCKET_SIZES, VAULT_CHARACTER_ID } from "@/app/utilities/Constants.ts"; +import { VAULT_CHARACTER_ID } from "@/app/utilities/Constants.ts"; +import { BUCKET_SIZES } from "@/app/store/Definitions.ts"; import type { BucketHash, CharacterId } from "@/app/core/GetProfile.ts"; import { vaultItemBuckets } from "@/app/inventory/logic/Helpers.ts"; import { useEffect, useState } from "react"; diff --git a/native/app/utilities/Constants.ts b/native/app/utilities/Constants.ts index 45a990b4d..4683222aa 100644 --- a/native/app/utilities/Constants.ts +++ b/native/app/utilities/Constants.ts @@ -1,20 +1,7 @@ import { DestinyClass, ItemSubType, SectionBuckets, DamageType } from "@/app/bungie/Enums.ts"; import type { CharacterId } from "@/app/core/GetProfile.ts"; -import { DestinyInventoryBucketDefinition, DestinyStatDefinition } from "@/app/store/Definitions.ts"; import type { DestinyItem } from "@/app/inventory/logic/Types.ts"; -export function updateBucketSizes() { - BUCKET_SIZES[SectionBuckets.Consumables] = - DestinyInventoryBucketDefinition?.[SectionBuckets.Consumables]?.itemCount ?? 5; - BUCKET_SIZES[SectionBuckets.Mods] = DestinyInventoryBucketDefinition?.[SectionBuckets.Mods]?.itemCount ?? 5; - BUCKET_SIZES[SectionBuckets.LostItem] = DestinyInventoryBucketDefinition?.[SectionBuckets.LostItem]?.itemCount ?? 5; - BUCKET_SIZES[SectionBuckets.Vault] = DestinyInventoryBucketDefinition?.[SectionBuckets.Vault]?.itemCount ?? 5; -} - -export function updateDestinyText() { - DESTINY_TEXT.POWER = DestinyStatDefinition?.[1935470627]?.displayProperties.name ?? ""; -} - export const VAULT_CHARACTER_ID = "VAULT" as CharacterId; export const GLOBAL_MODS_CHARACTER_ID = "GLOBAL_MODS_CHARACTER_ID" as CharacterId; export const GLOBAL_CONSUMABLES_CHARACTER_ID = "GLOBAL_CONSUMABLES_CHARACTER_ID" as CharacterId; @@ -26,17 +13,6 @@ export const GLOBAL_INVENTORY_NAMES = [ GLOBAL_LOST_ITEMS_CHARACTER_ID, ]; -export const BUCKET_SIZES = { - [SectionBuckets.Consumables]: 50, - [SectionBuckets.Mods]: 50, - [SectionBuckets.LostItem]: 21, - [SectionBuckets.Vault]: 500, -}; - -export const DESTINY_TEXT = { - POWER: "", -}; - export const DEFAULT_OVERLAP_COLOR = "#242429CC"; export const LOGO_DARK = require("../../images/gg-logo-dark.webp");