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
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,10 @@ public void controllerHighlightSurvivesRepeatedMainMenuNavigation() throws Excep
KeyEvent.KEYCODE_DPAD_DOWN,
controllerHighlightExpression("main-menu-entry-1")
);
pressGamepadKey(
KeyEvent.KEYCODE_DPAD_DOWN,
controllerHighlightExpression("main-menu-entry-2")
);
pressGamepadKey(
KeyEvent.KEYCODE_BUTTON_A,
"location.pathname.endsWith('/trainer')"
Expand Down
9 changes: 9 additions & 0 deletions engine/Pksx.Pkhex.Engine/EngineContracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static SaveSummary From(SaveFile save, string? fileName) =>
public sealed record PartySlotSummary(
int Slot,
ushort SpeciesId,
string SpeciesName,
byte Form,
byte Format,
int Level,
Expand Down Expand Up @@ -92,6 +93,7 @@ public static PartySlotSummary From(PKM pokemon, SaveFile save, int slot) =>
new(
slot,
pokemon.Species,
SlotDetailProjection.SpeciesName(pokemon),
pokemon.Form,
pokemon.Format,
pokemon.Species == 0 ? 0 : pokemon.CurrentLevel,
Expand Down Expand Up @@ -127,6 +129,7 @@ public sealed record BoxSlotSummary(
int Box,
int Slot,
ushort SpeciesId,
string SpeciesName,
byte Form,
byte Format,
int Level,
Expand Down Expand Up @@ -162,6 +165,7 @@ public static BoxSlotSummary From(PKM pokemon, SaveFile save, int box, int slot)
box,
slot,
pokemon.Species,
SlotDetailProjection.SpeciesName(pokemon),
pokemon.Form,
pokemon.Format,
pokemon.Species == 0 ? 0 : pokemon.CurrentLevel,
Expand Down Expand Up @@ -874,6 +878,11 @@ internal static class SlotDetailProjection
0.16, 0.15, 0.17, 0.16, 0.20, 0.07, 0.21, 0.05, 0.11
];

public static string SpeciesName(PKM pokemon) => SpeciesName(pokemon.Species);

public static string SpeciesName(ushort speciesId) =>
speciesId == 0 ? "" : NameAt(GameInfo.Strings.Species, speciesId) ?? $"Species {speciesId}";

public static string? Gender(PKM pokemon) =>
pokemon.Species == 0 ? null : pokemon.Gender switch
{
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/pksx/MainMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export const MAIN_MENU_SEARCH_INSERTION_INDEX = 1;

export type MainMenuEntry = {
key: 'boxes' | 'trainer' | 'bag' | 'saves' | 'settings' | 'backup-browser';
key: 'boxes' | 'search' | 'trainer' | 'bag' | 'saves' | 'settings' | 'backup-browser';
label: string;
description: string;
};
Expand All @@ -13,7 +13,7 @@

interface Props {
entries: MainMenuEntry[];
activeDestination: Exclude<MainMenuEntry['key'], 'backup-browser'>;
activeDestination: Exclude<MainMenuEntry['key'], 'search' | 'backup-browser'>;
activeIndex: number;
onFocusEntry: (index: number) => void;
onSelectEntry: (entry: MainMenuEntry) => void;
Expand Down
Loading