From e70a7afab7d884e4daf4dc1c11dfc9b186df0465 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 1 Feb 2022 01:47:27 -0800 Subject: [PATCH] Pull weapon uncap level from server --- components/WeaponUnit/index.tsx | 2 +- pages/p/[party].tsx | 7 +++++-- types/GridWeapon.d.ts | 1 + types/Weapon.d.ts | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/components/WeaponUnit/index.tsx b/components/WeaponUnit/index.tsx index adf5e5b5..9bf3249e 100644 --- a/components/WeaponUnit/index.tsx +++ b/components/WeaponUnit/index.tsx @@ -59,7 +59,7 @@ const WeaponUnit = (props: Props) => { type="weapon" ulb={weapon?.uncap.ulb || false} flb={weapon?.uncap.flb || false} - uncapLevel={3} + uncapLevel={weapon?.uncap_level!} /> diff --git a/pages/p/[party].tsx b/pages/p/[party].tsx index 8be0e297..a47a8c12 100644 --- a/pages/p/[party].tsx +++ b/pages/p/[party].tsx @@ -87,10 +87,13 @@ const PartyRoute: React.FC = () => { let weapons: GridArray = {} list.forEach((object: GridWeapon) => { + const weapon = object.weapon + weapon.uncap_level = object.uncapLevel + if (object.mainhand) - setMainWeapon(object.weapon) + setMainWeapon(weapon) else if (!object.mainhand && object.position != null) - weapons[object.position] = object.weapon + weapons[object.position] = weapon }) return weapons diff --git a/types/GridWeapon.d.ts b/types/GridWeapon.d.ts index 2c329833..af920b85 100644 --- a/types/GridWeapon.d.ts +++ b/types/GridWeapon.d.ts @@ -3,4 +3,5 @@ interface GridWeapon { mainhand: boolean position: number | null weapon: Weapon + uncapLevel: number | null } \ No newline at end of file diff --git a/types/Weapon.d.ts b/types/Weapon.d.ts index 295543ef..4e8baf58 100644 --- a/types/Weapon.d.ts +++ b/types/Weapon.d.ts @@ -25,5 +25,6 @@ interface Weapon { flb: boolean ulb: boolean } + uncap_level: number | null position?: number } \ No newline at end of file