diff --git a/play.pokemonshowdown.com/src/battle-team-editor.tsx b/play.pokemonshowdown.com/src/battle-team-editor.tsx index 6f7e220bc..c949a0e01 100644 --- a/play.pokemonshowdown.com/src/battle-team-editor.tsx +++ b/play.pokemonshowdown.com/src/battle-team-editor.tsx @@ -27,6 +27,12 @@ type SampleSets = { }; type SampleSetsTable = { dex?: SampleSets, stats?: SampleSets }; +function TypeIcon({ type, tera }: { type: string, tera?: boolean }) { + return {type}; +} + export class TeamEditorState extends PSModel { static clipboard: { teams: { @@ -913,8 +919,9 @@ export class TeamEditorState extends PSModel { export class TeamEditor extends preact.Component<{ team: Team, narrow?: boolean, onChange?: () => void, readOnly?: boolean, - children?: preact.ComponentChildren, resources?: preact.ComponentChildren, + tiny?: boolean, children?: preact.ComponentChildren, resources?: preact.ComponentChildren, }> { + static compactMetrics = true; wizard = true; editor!: TeamEditorState; setTab = (ev: Event) => { @@ -923,6 +930,11 @@ export class TeamEditor extends preact.Component<{ this.wizard = wizard; this.forceUpdate(); }; + changeCompactMetrics = (ev: Event) => { + TeamEditor.compactMetrics = (ev.currentTarget as HTMLInputElement).checked; + this.forceUpdate(); + window.PS?.update(); + }; static probablyMobile() { return document.body.offsetWidth < 500; } @@ -982,6 +994,8 @@ export class TeamEditor extends preact.Component<{ if (this.props.team.format !== editor.format) { editor.setFormat(this.props.team.format); } + const tiny = this.props.tiny ?? !!this.base?.closest('.tiny-layout'); + const compactMetrics = TeamEditor.compactMetrics && !tiny; return
{TeamEditorState.renderClipboard(this.cancelClipboard)} + {this.wizard && !tiny && !editor.innerFocus &&

+ +

} {this.wizard ? ( - + ) : ( )} @@ -1827,7 +1847,7 @@ class TeamTextbox extends preact.Component<{ } class TeamWizard extends preact.Component<{ - editor: TeamEditorState, onChange?: () => void, onUpdate: () => void, + editor: TeamEditorState, onChange?: () => void, onUpdate: () => void, compact: boolean, }> { setSearchBox: string | null = null; windowing = true; @@ -1993,7 +2013,7 @@ class TeamWizard extends preact.Component<{
@@ -2334,7 +2354,7 @@ class TeamWizard extends preact.Component<{ const cur = (i: number) => setIndex === i ? ' cur' : ''; const sampleSets = type === 'ability' ? editor.getSampleSets(set!) : []; const userSets = type === 'ability' ? editor.getUserSets(set!) : null; - return
+ return