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