Skip to content
This repository has been archived by the owner on Mar 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #172 from RaenonX-DL/dev
Browse files Browse the repository at this point in the history
v2.9.0 Release
  • Loading branch information
RaenonX authored Jun 30, 2021
2 parents dcd5f20 + facb4d1 commit 0e8de77
Show file tree
Hide file tree
Showing 163 changed files with 6,151 additions and 2,095 deletions.
2 changes: 2 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ engines:
exclude_paths:
# Test files
- "**.test.ts"
# Test data
- "test/data/**"
8 changes: 6 additions & 2 deletions doc/markdown.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Markdown Cheatsheet

Syntax below can be seen immediately in markdown input preview.

However, there are some syntax that will only process after the form submission,
such as [quick reference](/doc/quickReference.md).

## Common usage

[Cheatsheet](https://www.markdownguide.org/cheat-sheet/)

## Customized syntax

`[R]` means required.
`[O]` means optional.
`[R]` means required; `[O]` means optional.

### Text coloring

Expand Down
36 changes: 36 additions & 0 deletions doc/quickReference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Quick Reference cheatsheet

These are available in some fields.

Usually, all markdown input fields support such transformations after form submission.

## Usages

`[R]` means required; `[O]` means optional.

### Quest Post / Miscellaneous Post

For quest post:

```
#Q<pid>
```

For miscellaneous post:

```
#M<pid>
```

- `[R]` `<pid>` is the post ID.

### Unit analysis

```
:<UnitName>:
```

- `[R]` `<UnitName>` is the analysis unit name.
- This can be either the name of a character or a dragon.
- This can be in either one of the supported languages (CHT, EN, JP).
- There are some commonly-seen names available.
87 changes: 1 addition & 86 deletions pages/[lang]/skill/atk.tsx
Original file line number Diff line number Diff line change
@@ -1,89 +1,4 @@
import React from 'react';
import {AttackingSkillLookup} from '../../../src/components/elements/gameData/skillAtk/main';

import Col from 'react-bootstrap/Col';
import Row from 'react-bootstrap/Row';

import {ConditionEnumMap} from '../../../src/api-def/resources/types/export/enums';
import {ElementBonus, ElementBonusData} from '../../../src/api-def/resources/types/export/misc';
import {AttackingSkillData} from '../../../src/api-def/resources/types/skillAtk';
import {SkillIdentifierInfo} from '../../../src/api-def/resources/types/skillIdentifier';
import {useFetchState, useFetchStateProcessed} from '../../../src/components/elements/common/fetch';
import {AttackingSkillInput} from '../../../src/components/elements/gameData/skillAtk/in/main';
import {InputData} from '../../../src/components/elements/gameData/skillAtk/in/types';
import {AttackingSkillOutput} from '../../../src/components/elements/gameData/skillAtk/out/main';
import {scrollRefToTop} from '../../../src/utils/scroll';
import {GoogleAnalytics} from '../../../src/utils/services/ga';
import {ResourceLoader} from '../../../src/utils/services/resources/loader';


const AttackingSkillLookup = () => {
const [inputDataForward, setInputDataForward] = React.useState<InputData>();
const entryCol = React.useRef<HTMLDivElement>(null);

const {
fetchStatus: elementBonuses,
fetchFunction: fetchElementBonuses,
} = useFetchStateProcessed<ElementBonusData, ElementBonus>(
new ElementBonusData(),
ResourceLoader.getElementBonusData,
'Failed to fetch element bonus data.',
(response) => new ElementBonusData(response),
);
const {
fetchStatus: conditionEnums,
fetchFunction: fetchConditionEnums,
} = useFetchState<ConditionEnumMap>(
{},
ResourceLoader.getEnumAllConditions,
'Failed to fetch condition enums.',
);
const {
fetchStatus: skillIdentifiers,
fetchFunction: fetchSkillIdentifiers,
} = useFetchState<SkillIdentifierInfo>(
{},
ResourceLoader.getSkillIdentifierInfo,
'Failed to fetch skill identifiers.',
);
const {
fetchStatus: attackingSkillEntries,
fetchFunction: fetchAttackingSkillEntries,
} = useFetchState<Array<AttackingSkillData>>(
[],
ResourceLoader.getAttackingSkillEntries,
'Failed to fetch attacking skill entries.',
);

fetchElementBonuses();
fetchConditionEnums();
fetchSkillIdentifiers();
fetchAttackingSkillEntries();

return (
<Row>
<Col lg={4} className="rounded bg-black-32 p-3 mb-3">
<AttackingSkillInput
onSearchRequested={(inputData: InputData) => () => {
GoogleAnalytics.damageCalc('search', inputData);

scrollRefToTop(entryCol);

// This function is expensive, scroll first
setInputDataForward(inputData);
}}
/>
</Col>
<Col ref={entryCol} lg={8} className="px-0 px-lg-3">
<AttackingSkillOutput
inputData={inputDataForward}
allConditionEnums={conditionEnums.data}
elementBonusData={elementBonuses.data}
skillIdentifierInfo={skillIdentifiers.data}
atkSkillEntries={attackingSkillEntries.data}
/>
</Col>
</Row>
);
};

export default AttackingSkillLookup;
1 change: 1 addition & 0 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class Document extends NextDocument<Props> {
{/* Global site tag (gtag.js) - Google Analytics */}
{
process.env.NODE_ENV === 'production' &&
!process.env.CI &&
<>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-796E69CFJG"/>
<script dangerouslySetInnerHTML={{
Expand Down
Loading

0 comments on commit 0e8de77

Please sign in to comment.