Skip to content

Commit

Permalink
Added quest search by enemy name
Browse files Browse the repository at this point in the history
  • Loading branch information
squaresmile committed Aug 29, 2023
1 parent 9020972 commit 06cc5e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/api-connector/src/Schema/Quest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export type QuestPhaseSearchOptions = {
bgmId?: number;
fieldAiId?: number;
enemySvtId?: number;
enemyName?: string;
enemySvtAiId?: number;
enemyTrait?: number[];
enemyClassName?: ClassName[];
Expand Down
17 changes: 17 additions & 0 deletions packages/db/src/Page/QuestsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ interface IState {
bgmId?: number;
fieldAiId?: number;
enemySvtId?: number;
enemyName?: string;
enemySvtAiId?: number;
enemyTrait: number[];
enemyClassName: ClassName[];
Expand Down Expand Up @@ -84,6 +85,7 @@ class QuestsPage extends React.Component<IProps, IState> {
bgmId: getNumParam(searchParams, "bgmId"),
fieldAiId: getNumParam(searchParams, "fieldAiId"),
enemySvtId: getNumParam(searchParams, "enemySvtId"),
enemyName: searchParams.get("enemyName") ?? undefined,
enemySvtAiId: getNumParam(searchParams, "enemySvtAiId"),
enemyTrait: getQueryNums("enemyTrait"),
enemyClassName: searchParams.getAll("enemyClassName") as ClassName[],
Expand Down Expand Up @@ -136,6 +138,7 @@ class QuestsPage extends React.Component<IProps, IState> {
bgmId: this.state.bgmId,
fieldAiId: this.state.fieldAiId,
enemySvtId: this.state.enemySvtId,
enemyName: this.state.enemyName,
enemySvtAiId: this.state.enemySvtAiId,
enemyTrait: this.state.enemyTrait,
enemyClassName: this.state.enemyClassName,
Expand All @@ -161,6 +164,7 @@ class QuestsPage extends React.Component<IProps, IState> {
this.state.bgmId === undefined &&
this.state.fieldAiId === undefined &&
this.state.enemySvtId === undefined &&
this.state.enemyName === undefined &&
this.state.enemySvtAiId === undefined &&
this.state.enemyTrait.length === 0 &&
this.state.enemyClassName.length === 0 &&
Expand All @@ -186,6 +190,7 @@ class QuestsPage extends React.Component<IProps, IState> {
bgmId: this.state.bgmId,
fieldAiId: this.state.fieldAiId,
enemySvtId: this.state.enemySvtId,
enemyName: this.state.enemyName,
enemySvtAiId: this.state.enemySvtAiId,
enemyTrait: this.state.enemyTrait,
enemyClassName: this.state.enemyClassName,
Expand Down Expand Up @@ -336,6 +341,18 @@ class QuestsPage extends React.Component<IProps, IState> {
{this.getNumberForm("bgmId", t("BGM ID"))}
{this.getNumberForm("fieldAiId", t("Field AI ID"))}
{this.getNumberForm("enemySvtId", t("Enemy svt ID"))}
<Form.Group>
<Form.Label>{t("Enemy Name")}</Form.Label>
<Form.Control
value={this.state.enemyName ?? ""}
onChange={(ev: ChangeEvent) => {
this.setState({
enemyName: ev.target.value !== "" ? ev.target.value : undefined,
});
}}
lang={lang(this.props.region)}
/>
</Form.Group>
{this.getNumberForm("enemySvtAiId", t("Enemy Servant AI ID"))}
<Form.Group>
<Form.Label>{t("Enemy Trait")}</Form.Label>
Expand Down

0 comments on commit 06cc5e8

Please sign in to comment.