Skip to content

Commit

Permalink
Merge pull request #898 from EmmaRamirez/release/1.14.0
Browse files Browse the repository at this point in the history
release: 1.14.0
  • Loading branch information
EmmaRamirez authored Feb 18, 2023
2 parents a864b0c + 0fd3856 commit d457160
Show file tree
Hide file tree
Showing 64 changed files with 207 additions and 974 deletions.
18 changes: 16 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuzlocke-generator",
"version": "1.13.0",
"version": "1.14.0",
"description": "A tool for generating nuzlocke team pics from data",
"main": "dist/bundle.js",
"type": "commonjs",
Expand Down Expand Up @@ -43,6 +43,7 @@
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.14.5",
"@blueprintjs/select": "^3.16.5",
"@builder.io/partytown": "^0.7.5",
"@emmaramirez/dom-to-image": "^3.0.2",
"@react-hook/debounce": "^3.0.0",
"@types/react-dnd-html5-backend": "^3.0.2",
Expand Down
Binary file removed src/assets/icons/.DS_Store
Binary file not shown.
Binary file added src/assets/icons/alpha-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/components/Credits/credits.json
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,21 @@
"role": "Roaring Moon",
"name": "kenkyu",
"link": "https://danbooru.donmai.us/posts?tags=eternal_kenkyu&z=1"
},
{
"role": "Garbodor-Gmax",
"name": "antoniodraws",
"link": "https://twitter.com/Antoniodraws/status/1382704655369711627/photo/1"
},
{
"role": "Grimmsnarl-Gmax",
"name": "innovator123",
"link": "https://www.deviantart.com/innovator123"
},
{
"role": "Charizard-Gmax",
"name": "irictran",
"link": "https://www.deviantart.com/irictran"
}
]
}
3 changes: 0 additions & 3 deletions src/components/Editor/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ html.bp3-dark {
.current-pokemon-gender {
width: 6rem;
}
.current-pokemon-status {
width: 5.5rem;
}
.current-pokemon-moves {
width: 80%;
}
Expand Down
121 changes: 83 additions & 38 deletions src/components/PokemonEditor/CurrentPokemonEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import {
PopoverInteractionKind,
Button,
Intent,
ButtonGroup,
Tooltip,
} from '@blueprintjs/core';
import { addPokemon } from 'actions';
import { State } from 'state';
Expand Down Expand Up @@ -95,7 +97,6 @@ const getEvos = (species): string[] | undefined => {
return EvolutionTree?.[species];
};


export function EvolutionSelection({ currentPokemon, onEvolve }) {
const evos = getEvos(currentPokemon?.species);

Expand All @@ -120,7 +121,13 @@ export function EvolutionSelection({ currentPokemon, onEvolve }) {
content={
<>
{evos.map((evo) => (
<div role='button' tabIndex={-2} className={Styles.evoMenuItem} key={evo} onClick={onEvolve(evo)} onKeyPress={onEvolve(evo)}>
<div
role="button"
tabIndex={-2}
className={Styles.evoMenuItem}
key={evo}
onClick={onEvolve(evo)}
onKeyPress={onEvolve(evo)}>
{evo}
</div>
))}
Expand All @@ -134,11 +141,9 @@ export function EvolutionSelection({ currentPokemon, onEvolve }) {
}
}



export class CurrentPokemonEditBase extends React.Component<
CurrentPokemonEditProps,
CurrentPokemonEditState
CurrentPokemonEditProps,
CurrentPokemonEditState
> {
public constructor(props: CurrentPokemonEditProps) {
super(props);
Expand Down Expand Up @@ -172,7 +177,7 @@ CurrentPokemonEditState
}

public componentDidMount() {
getImages().then(res => this.setState({ images: res, }));
getImages().then((res) => this.setState({ images: res }));
}

private copyPokemon = (e) => {
Expand Down Expand Up @@ -201,7 +206,20 @@ CurrentPokemonEditState
const pokemon = this.getCurrentPokemon();
const edit = {
species,
types: matchSpeciesToTypes(species, (pokemon?.forme || 'Normal') as keyof typeof Forme)
types: matchSpeciesToTypes(species, (pokemon?.forme || 'Normal') as keyof typeof Forme),
};

this.props.editPokemon(edit, this.state.selectedId);
};

// levelUp true = +1, false = -1
private levelPokemon = (levelUp?: boolean) => () => {
const pokemon = this.getCurrentPokemon();
// @ts-expect-error data from level can sometimes be a string... whoops
const level = Number.parseInt(pokemon?.level ?? '0');

const edit = {
level: (level ?? 0) + (levelUp ? 1 : -1)
};

this.props.editPokemon(edit, this.state.selectedId);
Expand All @@ -211,12 +229,14 @@ CurrentPokemonEditState

private getTypes(includeShadow = true) {
const { customTypes, editor } = this.props;
return getListOfTypes(customTypes, editor.temtemMode).filter(type => includeShadow ? true : type !== 'Shadow');
return getListOfTypes(customTypes, editor.temtemMode).filter((type) =>
includeShadow ? true : type !== 'Shadow',
);
}

public moreInputs(currentPokemon: Pokemon) {
const {editPokemon, selectPokemon} = this.props;
const imageNames = this.state.images?.map(img => img.name ?? '') ?? [];
const { editPokemon, selectPokemon } = this.props;
const imageNames = this.state.images?.map((img) => img.name ?? '') ?? [];
const pokemonForLink = this.props.pokemon.map((p) => ({
key: `${p.nickname} (${p.species})`,
value: p.id,
Expand All @@ -243,12 +263,14 @@ CurrentPokemonEditState
key={this.state.selectedId + 'types'}
/>
<span
className={'current-pokemon-input-wrapper current-pokemon-checklist current-pokemon-checkpoints'}>
<label htmlFor='checkpointsInputList'>Checkpoints</label>
className={
'current-pokemon-input-wrapper current-pokemon-checklist current-pokemon-checkpoints'
}>
<label htmlFor="checkpointsInputList">Checkpoints</label>
<CheckpointsInputList
checkpointsObtained={currentPokemon.checkpoints ?? []}
onChange={checkpoints => editPokemon({checkpoints}, currentPokemon.id)}
buttonText='Award Checkpoints'
onChange={(checkpoints) => editPokemon({ checkpoints }, currentPokemon.id)}
buttonText="Award Checkpoints"
/>
</span>
<CurrentPokemonLayoutItem checkboxes>
Expand Down Expand Up @@ -287,28 +309,39 @@ CurrentPokemonEditState
type="checkbox"
key={this.state.selectedId + 'gift'}
/>
<CurrentPokemonInput
labelName="Alpha"
inputName="alpha"
value={currentPokemon?.alpha}
type="checkbox"
key={this.state.selectedId + 'alpha'}
/>
</CurrentPokemonLayoutItem>
{feature.imageUploads ? <Autocomplete
items={imageNames}
name="customImage"
label="Custom Image"
placeholder="http://..."
value={currentPokemon.customImage || ''}
onChange={(e) => {
const edit = {
customImage: e.target.value,
};
editPokemon(edit, this.state.selectedId);
}}
key={this.state.selectedId + 'customimage'}
/> : <CurrentPokemonInput
labelName="Custom Image"
inputName="customImage"
placeholder="http://..."
value={currentPokemon.customImage}
type="text"
key={this.state.selectedId + 'customImage'}
/>}
{feature.imageUploads ? (
<Autocomplete
items={imageNames}
name="customImage"
label="Custom Image"
placeholder="http://..."
value={currentPokemon.customImage || ''}
onChange={(e) => {
const edit = {
customImage: e.target.value,
};
editPokemon(edit, this.state.selectedId);
}}
key={this.state.selectedId + 'customimage'}
/>
) : (
<CurrentPokemonInput
labelName="Custom Image"
inputName="customImage"
placeholder="http://..."
value={currentPokemon.customImage}
type="text"
key={this.state.selectedId + 'customImage'}
/>
)}
<CurrentPokemonInput
labelName="Custom Icon"
inputName="customIcon"
Expand Down Expand Up @@ -475,7 +508,15 @@ CurrentPokemonEditState
options={this.state.box.map((n) => n.name)}
key={this.state.selectedId + 'status'}
/>

<div className={cx(Styles.iconBar)}>
<Tooltip content="Level Up/Down">
<ButtonGroup>
<Button onClick={this.levelPokemon(false)} small>-1</Button>
<Button onClick={this.levelPokemon(true)} small>+1</Button>
</ButtonGroup>
</Tooltip>

<EvolutionSelection
currentPokemon={currentPokemon}
onEvolve={this.evolvePokemon}
Expand All @@ -496,7 +537,7 @@ CurrentPokemonEditState
items={(listOfPokemon as unknown) as string[]}
/>*/}
<Autocomplete
items={(listOfPokemon as unknown) as string[]}
items={listOfPokemon as unknown as string[]}
name="species"
label="Species"
disabled={currentPokemon.egg}
Expand Down Expand Up @@ -612,7 +653,11 @@ CurrentPokemonEditState
type="moves"
key={this.state.selectedId + 'moves'}
/>
<Button className={Styles.moveEditButton} intent={Intent.PRIMARY} onClick={this.toggleDialog} minimal>
<Button
className={Styles.moveEditButton}
intent={Intent.PRIMARY}
onClick={this.toggleDialog}
minimal>
Edit Moves
</Button>
</CurrentPokemonLayoutItem>
Expand Down
4 changes: 1 addition & 3 deletions src/components/PokemonEditor/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ export const iconBar = css`
align-items: center;
display: flex;
margin-left: auto;
* {
margin: 0.25rem;
}
gap: .25rem;
`;

export const copyButton = css`
Expand Down
2 changes: 1 addition & 1 deletion src/components/PokemonIcon/PokemonIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Dispatch } from 'redux';
import { State } from 'state';
import { Omit } from 'ramda';
import { Action } from 'actions';
import { normalizeSpeciesName } from 'utils/normalizeSpeciesName';
import { normalizeSpeciesName } from 'utils/getters/normalizeSpeciesName';
import { PokemonImage } from 'components/Shared/PokemonImage';

interface PokemonIconProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Result/Result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Button, Classes } from '@blueprintjs/core';
import { clamp } from 'ramda';
import { resultSelector } from 'selectors';
import { PokemonImage } from 'components/Shared/PokemonImage';
import { normalizeSpeciesName } from 'utils/normalizeSpeciesName';
import { normalizeSpeciesName } from 'utils/getters/normalizeSpeciesName';

async function load() {
const resource = await import('@emmaramirez/dom-to-image');
Expand Down
6 changes: 4 additions & 2 deletions src/components/Shared/ReleaseDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import * as React from 'react';
import { Dialog, Classes, Button, DialogProps } from '@blueprintjs/core';
import { css, cx } from 'emotion';
import * as styles from 'components/Result/styles';
import { Styles, classWithDarkTheme } from 'utils';
import { Styles, classWithDarkTheme, getPatchlessVersion } from 'utils';
const ReactMarkdown = require('react-markdown');
import { getPatchlessVersion } from 'utils/getPatchlessVersion';
import useSwr from 'swr';

const calyrex = require('assets/icons/pokemon/regular/calyrex.png');
Expand All @@ -22,9 +21,12 @@ const arceus = require('assets/icons/pokemon/regular/arceus.png');
const sprigatito = require('assets/icons/pokemon/regular/sprigatito.png');
const fuecoco = require('assets/icons/pokemon/regular/fuecoco.png');
const quaxly = require('assets/icons/pokemon/regular/quaxly.png');
const miraidon = require('assets/icons/pokemon/regular/miraidon.png');

export const getMascot = v => {
switch (v) {
case '1.14':
return miraidon.default;
case '1.13':
return quaxly.default;
case '1.12':
Expand Down
3 changes: 3 additions & 0 deletions src/components/TeamPokemon/TeamPokemon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ export class TeamPokemonInfo extends React.PureComponent<TeamPokemonInfoProps> {
? ` @ ${pokemon.item}`
: null}
</span>
{Boolean(pokemon.alpha) && <span className="pokemon-alpha">
<img alt={'alpha'} style={{ height: '1rem' }} src={'icons/alpha-icon.png'} />
</span>}
{Boolean(pokemon.teraType) && <span className="pokemon-teratype">
<img alt={`Tera: ${pokemon.teraType}`} style={{ height: '1rem' }} src={`icons/tera/${pokemon.teraType?.toLowerCase()}.png`} />
</span>}
Expand Down
3 changes: 1 addition & 2 deletions src/components/TopBar/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { Button, Classes, Spinner, Intent } from '@blueprintjs/core';
import { connect } from 'react-redux';
import * as styles from 'components/Result/styles';
import { classWithDarkTheme, isEmpty, Styles } from 'utils';
import { classWithDarkTheme, getPatchlessVersion, Styles } from 'utils';
import {
changeEditorSize,
editStyle,
Expand All @@ -16,7 +16,6 @@ import { Pokemon, Editor } from 'models';
import { ReleaseDialog } from 'components/Shared';
import { State } from 'state';
import { isMobile } from 'is-mobile';
import { getPatchlessVersion } from 'utils/getPatchlessVersion';

export interface TopBarProps {
onClickDownload: (e?: React.MouseEvent<HTMLElement>) => void;
Expand Down
1 change: 1 addition & 0 deletions src/components/TrainerEditor/BadgeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function CheckpointsInputList({
minimal={true}
content={
<Menu>
{checkpoints.length === 0 && <div style={{ width: '200px'}}>Select a game or configure custom checkpoints to see them here!</div>}
{Array.isArray(checkpoints) && checkpoints?.map((badge) => (
<Checkbox
onChange={(e: any) => {
Expand Down
Binary file added src/img/charizard-gigantamax.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/garbodor-gigantamax.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/grimmsnarl-gigantamax.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d457160

Please sign in to comment.