Logic updates for Draconic Weapons Providence (#389)
This commit is contained in:
parent
5449297a48
commit
3347d47eeb
12 changed files with 58 additions and 20 deletions
|
|
@ -40,6 +40,7 @@
|
||||||
.title {
|
.title {
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
font-size: $font-xlarge;
|
font-size: $font-xlarge;
|
||||||
|
line-height: 1.3;
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import type { SearchableObject, SearchableObjectArray } from '~types'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import CrossIcon from '~public/icons/Cross.svg'
|
import CrossIcon from '~public/icons/Cross.svg'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
|
import useDidMountEffect from '~utils/useDidMountEffect'
|
||||||
|
|
||||||
interface Props extends DialogProps {
|
interface Props extends DialogProps {
|
||||||
send: (object: SearchableObject, position: number) => any
|
send: (object: SearchableObject, position: number) => any
|
||||||
|
|
@ -80,6 +81,23 @@ const SearchModal = (props: Props) => {
|
||||||
if (props.open !== undefined) setOpen(props.open)
|
if (props.open !== undefined) setOpen(props.open)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
useDidMountEffect(() => {
|
||||||
|
// Only show extra or subaura objects if invoked from those positions
|
||||||
|
if (extraPositions().includes(props.fromPosition)) {
|
||||||
|
if (props.object === 'weapons') {
|
||||||
|
setFilters({
|
||||||
|
extra: true,
|
||||||
|
...filters,
|
||||||
|
})
|
||||||
|
} else if (props.object === 'summons') {
|
||||||
|
setFilters({
|
||||||
|
subaura: true,
|
||||||
|
...filters,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [open])
|
||||||
|
|
||||||
function inputChanged(event: React.ChangeEvent<HTMLInputElement>) {
|
function inputChanged(event: React.ChangeEvent<HTMLInputElement>) {
|
||||||
const text = event.target.value
|
const text = event.target.value
|
||||||
if (text.length) {
|
if (text.length) {
|
||||||
|
|
@ -185,8 +203,17 @@ const SearchModal = (props: Props) => {
|
||||||
|
|
||||||
// Only show extra or subaura objects if invoked from those positions
|
// Only show extra or subaura objects if invoked from those positions
|
||||||
if (extraPositions().includes(props.fromPosition)) {
|
if (extraPositions().includes(props.fromPosition)) {
|
||||||
if (props.object === 'weapons') filters.extra = true
|
if (props.object === 'weapons') {
|
||||||
else if (props.object === 'summons') filters.subaura = true
|
setFilters({
|
||||||
|
extra: true,
|
||||||
|
...filters,
|
||||||
|
})
|
||||||
|
} else if (props.object === 'summons') {
|
||||||
|
setFilters({
|
||||||
|
subaura: true,
|
||||||
|
...filters,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setFilters(filters)
|
setFilters(filters)
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ const WeaponConflictModal = (props: Props) => {
|
||||||
const series = props.incomingWeapon.series
|
const series = props.incomingWeapon.series
|
||||||
const seriesSlug = t(`series.${mapWeaponSeries(series)}`)
|
const seriesSlug = t(`series.${mapWeaponSeries(series)}`)
|
||||||
|
|
||||||
return [2, 3].includes(series) ? (
|
return [2, 3, 34].includes(series) ? (
|
||||||
<Trans i18nKey="modals.conflict.weapon.opus-draconic"></Trans>
|
<Trans i18nKey="modals.conflict.weapon.opus-draconic"></Trans>
|
||||||
) : (
|
) : (
|
||||||
<Trans i18nKey="modals.conflict.weapon.generic">
|
<Trans i18nKey="modals.conflict.weapon.generic">
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,12 @@ const gauphNames = [
|
||||||
{ en: 'Ultima Key', jp: 'ガフスキーΩ' },
|
{ en: 'Ultima Key', jp: 'ガフスキーΩ' },
|
||||||
{ en: 'Gate of Omnipotence', jp: 'ガフスキー' },
|
{ en: 'Gate of Omnipotence', jp: 'ガフスキー' },
|
||||||
]
|
]
|
||||||
|
const providenceNames = [{ en: 'Providence Teluma', jp: 'オリジンステルマ' }]
|
||||||
|
|
||||||
const emptyWeaponKey: WeaponKey = {
|
const emptyWeaponKey: WeaponKey = {
|
||||||
id: 'no-key',
|
id: 'no-key',
|
||||||
granblue_id: '-1',
|
granblue_id: '-1',
|
||||||
series: 0,
|
series: [0],
|
||||||
slot: 0,
|
slot: 0,
|
||||||
slug: '',
|
slug: '',
|
||||||
group: 0,
|
group: 0,
|
||||||
|
|
@ -71,7 +72,7 @@ const WeaponKeySelect = React.forwardRef<HTMLButtonElement, Props>(
|
||||||
function filterWeaponKeys(weaponKeys: WeaponKey[]) {
|
function filterWeaponKeys(weaponKeys: WeaponKey[]) {
|
||||||
// Filter weapon keys based on the series and slot provided
|
// Filter weapon keys based on the series and slot provided
|
||||||
return weaponKeys.filter(
|
return weaponKeys.filter(
|
||||||
(key) => key.series == series && key.slot == slot
|
(key) => key.series.includes(series) && key.slot == slot
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,7 +115,7 @@ const WeaponKeySelect = React.forwardRef<HTMLButtonElement, Props>(
|
||||||
let name: { [key: string]: string } = {}
|
let name: { [key: string]: string } = {}
|
||||||
if (series == 2 && index == 0) name = pendulumNames[0]
|
if (series == 2 && index == 0) name = pendulumNames[0]
|
||||||
else if (series == 2 && slot == 1 && index == 1) name = pendulumNames[1]
|
else if (series == 2 && slot == 1 && index == 1) name = pendulumNames[1]
|
||||||
else if (series === 3) name = telumaNames[0]
|
else if (series === 3 || series === 34) name = telumaNames[0]
|
||||||
else if (series === 17) name = gauphNames[slot]
|
else if (series === 17) name = gauphNames[slot]
|
||||||
else if (series === 24) name = emblemNames[index]
|
else if (series === 24) name = emblemNames[index]
|
||||||
|
|
||||||
|
|
@ -139,7 +140,7 @@ const WeaponKeySelect = React.forwardRef<HTMLButtonElement, Props>(
|
||||||
const emptyOption = () => {
|
const emptyOption = () => {
|
||||||
let name = ''
|
let name = ''
|
||||||
if (series === 2) name = pendulumNames[0].en
|
if (series === 2) name = pendulumNames[0].en
|
||||||
else if (series === 3) name = telumaNames[0].en
|
else if (series === 3 || series === 34) name = telumaNames[0].en
|
||||||
else if (series === 17) name = gauphNames[slot].en
|
else if (series === 17) name = gauphNames[slot].en
|
||||||
else if (series === 24) name = emblemNames[0].en
|
else if (series === 24) name = emblemNames[0].en
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -155,11 +155,11 @@ const WeaponModal = ({
|
||||||
|
|
||||||
if (gridWeapon.object.element == 0) object.weapon.element = element
|
if (gridWeapon.object.element == 0) object.weapon.element = element
|
||||||
|
|
||||||
if ([2, 3, 17, 24].includes(gridWeapon.object.series) && weaponKey1) {
|
if ([2, 3, 17, 24, 34].includes(gridWeapon.object.series) && weaponKey1) {
|
||||||
object.weapon.weapon_key1_id = weaponKey1.id
|
object.weapon.weapon_key1_id = weaponKey1.id
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([2, 3, 17].includes(gridWeapon.object.series) && weaponKey2)
|
if ([2, 3, 17, 34].includes(gridWeapon.object.series) && weaponKey2)
|
||||||
object.weapon.weapon_key2_id = weaponKey2.id
|
object.weapon.weapon_key2_id = weaponKey2.id
|
||||||
|
|
||||||
if (gridWeapon.object.series == 17 && weaponKey3)
|
if (gridWeapon.object.series == 17 && weaponKey3)
|
||||||
|
|
@ -353,7 +353,7 @@ const WeaponModal = ({
|
||||||
const keySelect = (
|
const keySelect = (
|
||||||
<section>
|
<section>
|
||||||
<h3>{t('modals.weapon.subtitles.weapon_keys')}</h3>
|
<h3>{t('modals.weapon.subtitles.weapon_keys')}</h3>
|
||||||
{[2, 3, 17, 22].includes(gridWeapon.object.series) ? (
|
{[2, 3, 17, 22, 34].includes(gridWeapon.object.series) ? (
|
||||||
<WeaponKeySelect
|
<WeaponKeySelect
|
||||||
open={weaponKey1Open}
|
open={weaponKey1Open}
|
||||||
weaponKey={weaponKey1}
|
weaponKey={weaponKey1}
|
||||||
|
|
@ -367,7 +367,7 @@ const WeaponModal = ({
|
||||||
''
|
''
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{[2, 3, 17].includes(gridWeapon.object.series) ? (
|
{[2, 3, 17, 34].includes(gridWeapon.object.series) ? (
|
||||||
<WeaponKeySelect
|
<WeaponKeySelect
|
||||||
open={weaponKey2Open}
|
open={weaponKey2Open}
|
||||||
weaponKey={weaponKey2}
|
weaponKey={weaponKey2}
|
||||||
|
|
@ -381,7 +381,7 @@ const WeaponModal = ({
|
||||||
''
|
''
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{gridWeapon.object.series == 17 ? (
|
{[17, 34].includes(gridWeapon.object.series) ? (
|
||||||
<WeaponKeySelect
|
<WeaponKeySelect
|
||||||
open={weaponKey3Open}
|
open={weaponKey3Open}
|
||||||
weaponKey={weaponKey3}
|
weaponKey={weaponKey3}
|
||||||
|
|
@ -477,7 +477,7 @@ const WeaponModal = ({
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
ref={headerRef}
|
ref={headerRef}
|
||||||
title={gridWeapon.object.name[locale]}
|
title={gridWeapon.object.name[locale]}
|
||||||
subtitle={t('modals.characters.title')}
|
subtitle={t('modals.weapon.title')}
|
||||||
image={{
|
image={{
|
||||||
src: `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-square/${gridWeapon.object.granblue_id}.jpg`,
|
src: `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-square/${gridWeapon.object.granblue_id}.jpg`,
|
||||||
alt: gridWeapon.object.name[locale],
|
alt: gridWeapon.object.name[locale],
|
||||||
|
|
@ -485,7 +485,7 @@ const WeaponModal = ({
|
||||||
/>
|
/>
|
||||||
<section className={styles.mods}>
|
<section className={styles.mods}>
|
||||||
{gridWeapon.object.element == 0 && elementSelect}
|
{gridWeapon.object.element == 0 && elementSelect}
|
||||||
{[2, 3, 17, 24].includes(gridWeapon.object.series) && keySelect}
|
{[2, 3, 17, 24, 34].includes(gridWeapon.object.series) && keySelect}
|
||||||
{gridWeapon.object.ax && axSelect}
|
{gridWeapon.object.ax && axSelect}
|
||||||
{gridWeapon.object.awakenings && awakeningSelect}
|
{gridWeapon.object.awakenings && awakeningSelect}
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ const WeaponUnit = ({
|
||||||
return (
|
return (
|
||||||
weapon.ax ||
|
weapon.ax ||
|
||||||
weapon.awakenings ||
|
weapon.awakenings ||
|
||||||
(weapon.series && [2, 3, 17, 22, 24].includes(weapon.series))
|
(weapon.series && [2, 3, 17, 22, 24, 34].includes(weapon.series))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,4 +49,12 @@ export const weaponKeyGroups: WeaponKeyGroup[] = [
|
||||||
ja: 'エンブレム',
|
ja: 'エンブレム',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
slug: 'providence',
|
||||||
|
name: {
|
||||||
|
en: 'Providence Teluma',
|
||||||
|
ja: 'オリジンステルマ',
|
||||||
|
},
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@
|
||||||
"title": "Changelog"
|
"title": "Changelog"
|
||||||
},
|
},
|
||||||
"characters": {
|
"characters": {
|
||||||
"title": "Character",
|
"title": "Modify character",
|
||||||
"subtitles": {
|
"subtitles": {
|
||||||
"ring": "Over Mastery",
|
"ring": "Over Mastery",
|
||||||
"earring": "Aetherial Mastery",
|
"earring": "Aetherial Mastery",
|
||||||
|
|
@ -434,7 +434,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"weapon": {
|
"weapon": {
|
||||||
"title": "Modify Weapon",
|
"title": "Modify weapon",
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"confirm": "Save weapon",
|
"confirm": "Save weapon",
|
||||||
"remove": "Remove weapon"
|
"remove": "Remove weapon"
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@
|
||||||
"title": "変更ログ"
|
"title": "変更ログ"
|
||||||
},
|
},
|
||||||
"characters": {
|
"characters": {
|
||||||
"title": "キャラクター",
|
"title": "キャラクター変更",
|
||||||
"subtitles": {
|
"subtitles": {
|
||||||
"ring": "EXリミットボーナス",
|
"ring": "EXリミットボーナス",
|
||||||
"earring": "エーテリアルプラス",
|
"earring": "エーテリアルプラス",
|
||||||
|
|
|
||||||
2
types/WeaponKey.d.ts
vendored
2
types/WeaponKey.d.ts
vendored
|
|
@ -7,7 +7,7 @@ interface WeaponKey {
|
||||||
ja: string
|
ja: string
|
||||||
}
|
}
|
||||||
slug: string
|
slug: string
|
||||||
series: integer
|
series: integer[]
|
||||||
slot: integer
|
slot: integer
|
||||||
group: integer
|
group: integer
|
||||||
order: integer
|
order: integer
|
||||||
|
|
|
||||||
1
types/index.d.ts
vendored
1
types/index.d.ts
vendored
|
|
@ -39,7 +39,6 @@ export type DetailsObject = {
|
||||||
description?: string
|
description?: string
|
||||||
raid?: Raid
|
raid?: Raid
|
||||||
job?: Job
|
job?: Job
|
||||||
extra?: boolean
|
|
||||||
guidebooks?: string[]
|
guidebooks?: string[]
|
||||||
visibility?: number
|
visibility?: number
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ export type GroupedWeaponKeys = {
|
||||||
teluma: WeaponKey[]
|
teluma: WeaponKey[]
|
||||||
gauph: WeaponKey[]
|
gauph: WeaponKey[]
|
||||||
emblem: WeaponKey[]
|
emblem: WeaponKey[]
|
||||||
|
providence: WeaponKey[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export function groupWeaponKeys(keys: WeaponKey[]) {
|
export function groupWeaponKeys(keys: WeaponKey[]) {
|
||||||
|
|
@ -21,6 +22,7 @@ export function groupWeaponKeys(keys: WeaponKey[]) {
|
||||||
teluma: [],
|
teluma: [],
|
||||||
gauph: [],
|
gauph: [],
|
||||||
emblem: [],
|
emblem: [],
|
||||||
|
providence: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i <= numGroups; i++) {
|
for (let i = 0; i <= numGroups; i++) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue