Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions src/components/ActionCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Card, Elevation } from '@blueprintjs/core'

import clsx from 'clsx'
import { useAtomValue } from 'jotai'
import { FC, ReactNode } from 'react'
import { FCC } from 'types'

Expand All @@ -9,8 +10,12 @@ import { FactItem } from 'components/FactItem'
import { CopilotDocV1 } from 'models/copilot.schema'
import { findActionType } from 'models/types'

import { useTranslation } from '../i18n/i18n'
import { findOperatorDirection, getSkillUsageTitle } from '../models/operator'
import { languageAtom, useTranslation } from '../i18n/i18n'
import {
findOperatorDirection,
getLocalizedOperatorName,
getSkillUsageTitle,
} from '../models/operator'
import { formatDuration } from '../utils/times'

interface ActionCardProps {
Expand All @@ -25,6 +30,7 @@ export const ActionCard: FC<ActionCardProps> = ({
title,
}) => {
const t = useTranslation()
const language = useAtomValue(languageAtom)
const type = findActionType(action.type)

title ??= (
Expand All @@ -47,7 +53,7 @@ export const ActionCard: FC<ActionCardProps> = ({
{'name' in action && action.name && (
<FactItem
dense
title={action.name}
title={getLocalizedOperatorName(action.name, language)}
icon="mugshot"
className="font-bold"
/>
Expand Down
4 changes: 4 additions & 0 deletions src/components/editor2/LevelSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ export const LevelSelect: FC<LevelSelectProps> = ({
}}
popoverProps={{
minimal: true,
onClosed() {
// 关闭下拉框时重置输入框,防止用户在未手动选择关卡时,误以为已输入的内容就是已选择的关卡
updateQuery('', false)
},
}}
/>
<Tooltip2
Expand Down
42 changes: 25 additions & 17 deletions src/components/editor2/operator/OperatorItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,26 @@ export const OperatorItem: FC<OperatorItemProps> = memo(
: skillLevels[skillNumber] ??
getDefaultRequirements(info?.rarity).skillLevel

const selectSkill = () => {
if (operator.skill !== skillNumber) {
edit(() => {
onChange?.({
...operator,
skill: skillNumber,
requirements: {
...operator.requirements,
// override with the current skill level
skillLevel,
},
})
return {
action: 'set-operator-skill',
desc: i18n.actions.editor2.set_operator_skill,
}
})
}
}

return (
<li
key={index}
Expand All @@ -337,23 +357,11 @@ export const OperatorItem: FC<OperatorItemProps> = memo(
'!w-8 h-8 !p-0 !leading-8 !bg-transparent text-center font-bold text-xl !text-inherit !rounded-none !border-2 !border-current [&:not(:focus)]:cursor-pointer',
skillLevel > 7 && '!pl-4',
)}
onFocus={() => {
if (operator.skill !== skillNumber) {
edit(() => {
onChange?.({
...operator,
skill: skillNumber,
requirements: {
...operator.requirements,
// override with the current skill level
skillLevel,
},
})
return {
action: 'set-operator-skill',
desc: i18n.actions.editor2.set_operator_skill,
}
})
onClick={selectSkill}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault()
selectSkill()
}
}}
onValueChange={(_, valueStr) => {
Expand Down
138 changes: 127 additions & 11 deletions src/models/generated/operators.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"alias": "asikalun asikaguan asiqialun asiqiaguan esikalun esikaguan esiqialun esiqiaguan askl askg asql asqg eskl eskg esql esqg 阿斯卡綸",
"rarity": 6,
"alt_name": "Ascalon",
"modules": ["", "X"]
"modules": ["", "X", "Y"]
},
{
"id": "char_277_sqrrel",
Expand Down Expand Up @@ -329,7 +329,7 @@
"alias": "bailianjiaweier bljwe 百煉嘉維爾",
"rarity": 6,
"alt_name": "Gavial the Invincible",
"modules": ["", "X"]
"modules": ["", "X", "Y"]
},
{
"id": "char_128_plosis",
Expand Down Expand Up @@ -459,6 +459,16 @@
"rarity": 0,
"alt_name": "The Servant of Lament"
},
{
"id": "token_10054_phatm2_encdool",
"prof": "TOKEN",
"subProf": "notchar1",
"name_en": "Blood's whisper",
"name": "本能的召唤",
"alias": "bennengdezhaohuan bennengdeshaohuan bennengdizhaohuan bennengdishaohuan bennaidezhaohuan bennaideshaohuan bennaidizhaohuan bennaidishaohuan bndzh bndsh 本能的召喚",
"rarity": 0,
"alt_name": "Blood's whisper"
},
{
"id": "char_265_sophia",
"prof": "WARRIOR",
Expand Down Expand Up @@ -609,7 +619,7 @@
"alias": "chengshan dengshan cs ds 澄閃",
"rarity": 6,
"alt_name": "Goldenglow",
"modules": ["", "X"]
"modules": ["", "X", "Y"]
},
{
"id": "char_1027_greyy2",
Expand Down Expand Up @@ -772,6 +782,16 @@
"alt_name": "Delphine",
"modules": ["", "Y"]
},
{
"id": "token_10051_radian_tower1",
"prof": "TOKEN",
"subProf": "notchar1",
"name_en": "dive",
"name": "戴乌",
"alias": "daiwu dw 戴烏",
"rarity": 0,
"alt_name": "dive"
},
{
"id": "char_4032_provs",
"prof": "SUPPORT",
Expand Down Expand Up @@ -805,6 +825,16 @@
"alt_name": "Texas",
"modules": ["", "Y"]
},
{
"id": "char_4191_tippi",
"prof": "SPECIAL",
"subProf": "skywalker",
"name_en": "Tippi",
"name": "蒂比",
"alias": "dibi db 蒂比",
"rarity": 5,
"alt_name": "Tippi"
},
{
"id": "char_1034_jesca2",
"prof": "TANK",
Expand All @@ -827,6 +857,17 @@
"alt_name": "Earthspirit",
"modules": ["", "Y"]
},
{
"id": "char_4195_radian",
"prof": "SUPPORT",
"subProf": "summoner",
"name_en": "Raidian",
"name": "电弧",
"alias": "dianhu dh 電弧",
"rarity": 6,
"alt_name": "Raidian",
"modules": ["", "A"]
},
{
"id": "char_452_bstalk",
"prof": "PIONEER",
Expand Down Expand Up @@ -912,7 +953,7 @@
"alias": "duoluoxi dlx 多蘿西",
"rarity": 6,
"alt_name": "Dorothy",
"modules": ["", "Y"]
"modules": ["", "X", "Y"]
},
{
"id": "token_10036_lasher_mcbird",
Expand Down Expand Up @@ -1745,6 +1786,17 @@
"alt_name": "Nine-Colored Deer",
"modules": ["", "X"]
},
{
"id": "char_1042_phatm2",
"prof": "SUPPORT",
"subProf": "ritualist",
"name_en": "Tragodia",
"name": "酒神",
"alias": "jiushen js 酒神",
"rarity": 6,
"alt_name": "Tragodia",
"modules": ["", "X"]
},
{
"id": "char_328_cammou",
"prof": "CASTER",
Expand Down Expand Up @@ -2302,6 +2354,17 @@
"alt_name": "Lutonada",
"modules": ["", "X"]
},
{
"id": "char_4196_reckpr",
"prof": "MEDIC",
"subProf": "physician",
"name_en": "Record Keeper",
"name": "录武官",
"alias": "luwuguan lwg 錄武官",
"rarity": 5,
"alt_name": "Record Keeper",
"modules": ["", "X"]
},
{
"id": "char_433_windft",
"prof": "SUPPORT",
Expand Down Expand Up @@ -2476,6 +2539,16 @@
"rarity": 3,
"alt_name": "Beagle"
},
{
"id": "token_10055_phatm2_mndclv",
"prof": "TOKEN",
"subProf": "notchar1",
"name_en": "Cage of chaos",
"name": "迷狂牢笼",
"alias": "mikuanglaolong mkll 迷狂牢籠",
"rarity": 0,
"alt_name": "Cage of chaos"
},
{
"id": "char_344_beewax",
"prof": "CASTER",
Expand Down Expand Up @@ -2540,6 +2613,16 @@
"alt_name": "Misery",
"modules": ["", "X"]
},
{
"id": "char_4198_christ",
"prof": "CASTER",
"subProf": "primcaster",
"name_en": "Miss.Christine",
"name": "Miss.Christine",
"alias": "Miss.Christine",
"rarity": 5,
"alt_name": "Miss.Christine"
},
{
"id": "char_154_morgan",
"prof": "WARRIOR",
Expand Down Expand Up @@ -2957,6 +3040,16 @@
"alt_name": "Toddifons",
"modules": ["", "X"]
},
{
"id": "token_10052_radian_tower2",
"prof": "TOKEN",
"subProf": "notchar1",
"name_en": "cycle",
"name": "赛柯",
"alias": "saike sk 賽柯",
"rarity": 0,
"alt_name": "cycle"
},
{
"id": "char_202_demkni",
"prof": "TANK",
Expand All @@ -2979,6 +3072,16 @@
"alt_name": "Mulberry",
"modules": ["", "X"]
},
{
"id": "token_10053_radian_tower3",
"prof": "TOKEN",
"subProf": "notchar1",
"name_en": "centre",
"name": "桑特拉",
"alias": "sangtela stl 桑特拉",
"rarity": 0,
"alt_name": "centre"
},
{
"id": "char_416_zumama",
"prof": "TANK",
Expand Down Expand Up @@ -3030,7 +3133,7 @@
"alias": "shan s 山",
"rarity": 6,
"alt_name": "Mountain",
"modules": ["", "Y"]
"modules": ["", "X", "Y"]
},
{
"id": "char_457_blitz",
Expand Down Expand Up @@ -3354,7 +3457,19 @@
"name": "死芒",
"alias": "simang sm 死芒",
"rarity": 6,
"alt_name": "Necrass"
"alt_name": "Necrass",
"modules": ["", "X"]
},
{
"id": "char_1043_leizi2",
"prof": "WARRIOR",
"subProf": "librator",
"name_en": "Leizi the Thunderbringer",
"name": "司霆惊蛰",
"alias": "sitingjingzhe stjz 司霆驚蟄",
"rarity": 6,
"alt_name": "Leizi the Thunderbringer",
"modules": ["", "X"]
},
{
"id": "char_427_vigil",
Expand Down Expand Up @@ -3504,7 +3619,8 @@
"name": "特克诺",
"alias": "tekenuo tkn 特克諾",
"rarity": 5,
"alt_name": "Tecno"
"alt_name": "Tecno",
"modules": ["", "Y"]
},
{
"id": "char_411_tomimi",
Expand Down Expand Up @@ -3536,7 +3652,7 @@
"alias": "tifeng difeng tf df 提豐",
"rarity": 6,
"alt_name": "Typhon",
"modules": ["", "X"]
"modules": ["", "X", "Y"]
},
{
"id": "char_166_skfire",
Expand Down Expand Up @@ -3574,11 +3690,11 @@
"id": "token_10056_angel2_target",
"prof": "TOKEN",
"subProf": "notchar1",
"name_en": "临时命名",
"name_en": "Delivery coordinates",
"name": "投递坐标",
"alias": "toudizuobiao tdzb 投遞坐標",
"rarity": 0,
"alt_name": "临时命名"
"alt_name": "Delivery coordinates"
},
{
"id": "char_510_amedic",
Expand Down Expand Up @@ -4922,7 +5038,7 @@
{ "id": "chain", "name": "链术师", "name_en": "Chain Caster" },
{ "id": "blastcaster", "name": "轰击术师", "name_en": "Blast Caster" },
{ "id": "primcaster", "name": "本源术师", "name_en": "Primal Caster" },
{ "id": "soulcaster", "name": "塑灵术师", "name_en": "Soulcaster" }
{ "id": "soulcaster", "name": "塑灵术师", "name_en": "Shaper Caster" }
]
},
{
Expand Down