Add support for weapon transcendence images (#404)
Also adds new content from 2024/01 Flash Gala and My Hero Academia collab.
This commit is contained in:
parent
74077a0501
commit
5a5457f10d
7 changed files with 145 additions and 6 deletions
|
|
@ -71,10 +71,16 @@ const ChangelogUnit = ({ id, type, image }: Props) => {
|
|||
src = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/character-grid/${id}_${image}.jpg`
|
||||
break
|
||||
case 'weapon':
|
||||
src = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${id}.jpg`
|
||||
src =
|
||||
image === '03'
|
||||
? `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${id}_${image}.jpg`
|
||||
: `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${id}.jpg`
|
||||
break
|
||||
case 'summon':
|
||||
src = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/summon-grid/${id}.jpg`
|
||||
src =
|
||||
image === '04'
|
||||
? `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/summon-grid/${id}_${image}.jpg`
|
||||
: `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/summon-grid/${id}.jpg`
|
||||
break
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ interface Props {
|
|||
event: string
|
||||
newItems?: UpdateObject
|
||||
uncappedItems?: UpdateObject
|
||||
transcendedItems?: UpdateObject
|
||||
numNotes: number
|
||||
}
|
||||
const ContentUpdate = ({
|
||||
|
|
@ -25,6 +26,7 @@ const ContentUpdate = ({
|
|||
event,
|
||||
newItems,
|
||||
uncappedItems,
|
||||
transcendedItems,
|
||||
numNotes,
|
||||
}: Props) => {
|
||||
const { t: updates } = useTranslation('updates')
|
||||
|
|
@ -100,6 +102,42 @@ const ContentUpdate = ({
|
|||
return section
|
||||
}
|
||||
|
||||
function transcendItemElements(key: 'character' | 'weapon' | 'summon') {
|
||||
let elements: React.ReactNode[] = []
|
||||
if (transcendedItems && transcendedItems[key]) {
|
||||
const items = transcendedItems[key]
|
||||
elements = items
|
||||
? items.map((id) => {
|
||||
return key === 'character' || key === 'summon' ? (
|
||||
<ChangelogUnit id={id} type={key} key={id} image="04" />
|
||||
) : (
|
||||
<ChangelogUnit id={id} type={key} key={id} image="03" />
|
||||
)
|
||||
})
|
||||
: []
|
||||
}
|
||||
return elements
|
||||
}
|
||||
|
||||
function transcendItemSection(key: 'character' | 'weapon' | 'summon') {
|
||||
let section: React.ReactNode = ''
|
||||
|
||||
if (transcendedItems && transcendedItems[key]) {
|
||||
const items = transcendedItems[key]
|
||||
section =
|
||||
items && items.length > 0 ? (
|
||||
<section className={styles[`${key}s`]}>
|
||||
<h4>{updates(`labels.transcends.${key}s`)}</h4>
|
||||
<div className={styles.items}>{transcendItemElements(key)}</div>
|
||||
</section>
|
||||
) : (
|
||||
''
|
||||
)
|
||||
}
|
||||
|
||||
return section
|
||||
}
|
||||
|
||||
return (
|
||||
<section
|
||||
className={classNames({
|
||||
|
|
@ -118,10 +156,13 @@ const ContentUpdate = ({
|
|||
<div className={styles.contents}>
|
||||
{newItemSection('character')}
|
||||
{uncapItemSection('character')}
|
||||
{transcendItemSection('character')}
|
||||
{newItemSection('weapon')}
|
||||
{uncapItemSection('weapon')}
|
||||
{transcendItemSection('weapon')}
|
||||
{newItemSection('summon')}
|
||||
{uncapItemSection('summon')}
|
||||
{transcendItemSection('summon')}
|
||||
</div>
|
||||
{numNotes > 0 ? (
|
||||
<div className={styles.notes}>
|
||||
|
|
|
|||
|
|
@ -78,6 +78,52 @@ const UpdatesPage = () => {
|
|||
return (
|
||||
<div className={classes}>
|
||||
<h1>{common('about.segmented_control.updates')}</h1>
|
||||
<ContentUpdate
|
||||
version="2024-01U3"
|
||||
dateString="2024/01/18"
|
||||
event="events.content"
|
||||
newItems={{
|
||||
character: ['3040506000'],
|
||||
}}
|
||||
uncappedItems={{
|
||||
character: ['3040313000'],
|
||||
}}
|
||||
/>
|
||||
<ContentUpdate
|
||||
version="2024-01F"
|
||||
dateString="2024/01/15"
|
||||
event="events.flash"
|
||||
newItems={{
|
||||
character: ['3040508000', '3040507000'],
|
||||
weapon: ['1040422400', '1040219000'],
|
||||
}}
|
||||
transcendedItems={{
|
||||
weapon: [
|
||||
'1040212600',
|
||||
'1040212500',
|
||||
'1040310700',
|
||||
'1040310600',
|
||||
'1040415100',
|
||||
'1040415000',
|
||||
'1040809500',
|
||||
'1040809400',
|
||||
'1040911100',
|
||||
'1040911000',
|
||||
'1040017100',
|
||||
'1040017000',
|
||||
],
|
||||
}}
|
||||
/>
|
||||
<ContentUpdate
|
||||
version="2024-01U2"
|
||||
dateString="2024/01/12"
|
||||
event="events.content"
|
||||
newItems={{
|
||||
character: ['3040504000', '3040505000'],
|
||||
weapon: ['1040618300'],
|
||||
summon: ['2040426000'],
|
||||
}}
|
||||
/>
|
||||
<ContentUpdate
|
||||
version="2024-01U"
|
||||
dateString="2024/01/05"
|
||||
|
|
|
|||
|
|
@ -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`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,11 @@
|
|||
"weapons": "New weapon uncaps",
|
||||
"summons": "New summon uncaps"
|
||||
},
|
||||
"transcends": {
|
||||
"characters": "New character transcendence",
|
||||
"weapons": "New weapon transcendence",
|
||||
"summons": "New summon transcendence"
|
||||
},
|
||||
"features": "New features",
|
||||
"updates": "Other updates"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -8,6 +8,11 @@
|
|||
"weapons": "武器の新上限解放",
|
||||
"summons": "召喚石の新上限解放"
|
||||
},
|
||||
"transcends": {
|
||||
"characters": "キャラクターの新限界超越",
|
||||
"weapons": "武器の新限界超越",
|
||||
"summons": "召喚石の新限界超越"
|
||||
},
|
||||
"features": "新機能",
|
||||
"updates": "その他の更新"
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue