From fdcbecf5278411e46f2154aebae96960e6b25221 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Thu, 25 Jan 2024 02:49:39 -0800 Subject: [PATCH] Change image for transcended weapons --- components/reps/GridRep/index.tsx | 29 ++++++++++++++++++++++++-- components/weapon/WeaponUnit/index.tsx | 15 +++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/components/reps/GridRep/index.tsx b/components/reps/GridRep/index.tsx index be2ba250..5bc83389 100644 --- a/components/reps/GridRep/index.tsx +++ b/components/reps/GridRep/index.tsx @@ -209,10 +209,23 @@ const GridRep = ({ party, loading, onClick, onSave }: Props) => { (w) => w && w.object.id === mainhand.id ) + let suffix = '' + if ( + weapon && + weapon.object.uncap.transcendence && + weapon.uncap_level == 6 + ) { + if (weapon.transcendence_step >= 1 && weapon.transcendence_step < 5) { + suffix = '_02' + } else if (weapon.transcendence_step === 5) { + suffix = '_03' + } + } + if (mainhand.element == 0 && weapon && weapon.element) { url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-main/${mainhand.granblue_id}_${weapon.element}.jpg` } else { - url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-main/${mainhand.granblue_id}.jpg` + url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-main/${mainhand.granblue_id}${suffix}.jpg` } } @@ -230,10 +243,22 @@ const GridRep = ({ party, loading, onClick, onSave }: Props) => { const gridWeapon = weaponGrid[position] if (weapon && gridWeapon) { + let suffix = '' + if (weapon.uncap.transcendence && gridWeapon.uncap_level == 6) { + if ( + gridWeapon.transcendence_step >= 1 && + gridWeapon.transcendence_step < 5 + ) { + suffix = '_02' + } else if (gridWeapon.transcendence_step === 5) { + suffix = '_03' + } + } + if (weapon.element == 0 && gridWeapon.element) { url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}_${gridWeapon.element}.jpg` } else { - url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}.jpg` + url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}${suffix}.jpg` } } diff --git a/components/weapon/WeaponUnit/index.tsx b/components/weapon/WeaponUnit/index.tsx index 41e9f1e3..b3d2f818 100644 --- a/components/weapon/WeaponUnit/index.tsx +++ b/components/weapon/WeaponUnit/index.tsx @@ -201,16 +201,27 @@ const WeaponUnit = ({ if (gridWeapon) { const weapon = gridWeapon.object! + let suffix = '' + if (weapon.uncap.transcendence && gridWeapon.uncap_level == 6) { + if ( + gridWeapon.transcendence_step >= 1 && + gridWeapon.transcendence_step < 5 + ) { + suffix = '_02' + } else if (gridWeapon.transcendence_step === 5) { + suffix = '_03' + } + } if (unitType == 0) { if (gridWeapon.object.element == 0 && gridWeapon.element) imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-main/${weapon.granblue_id}_${gridWeapon.element}.jpg` else - imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-main/${weapon.granblue_id}.jpg` + imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-main/${weapon.granblue_id}${suffix}.jpg` } else { if (gridWeapon.object.element == 0 && gridWeapon.element) imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}_${gridWeapon.element}.jpg` else - imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}.jpg` + imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}${suffix}.jpg` } }