Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI/UX] Internal pokedex #5083

Open
wants to merge 89 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
6cb2d71
Working ui, missing logic, logs
Wlowscha Dec 29, 2024
3009de7
Filtering starters by name is working
Wlowscha Dec 30, 2024
0167dc7
Filtering moves and abilities correctly
Wlowscha Dec 30, 2024
1d93ade
Opening starter page on button.action
Wlowscha Dec 30, 2024
a24d217
Removed ugly leftover from title
Wlowscha Dec 30, 2024
c242e57
Added container for text with different colors and titles
Wlowscha Dec 31, 2024
06ed8bc
Showing all species in pokedex with no decorations and shinies
Wlowscha Jan 1, 2025
e8d15a4
Filtering includes extra forms; moving cursor from filterText to star…
Wlowscha Jan 1, 2025
3d0b448
Can access evolution page
Wlowscha Jan 2, 2025
dcf3399
Abilities are colored properly (still missing info overlay)
Wlowscha Jan 2, 2025
8b173ba
Biome filter; displays for baseStats, biomes and evolutions
Wlowscha Jan 3, 2025
d3067d1
Removed lockable select ui handler, replaced by changes to standard u…
Wlowscha Jan 3, 2025
955af4b
Evolutions are selectable from list and displayed properly
Wlowscha Jan 3, 2025
657fdf0
Keeps shiny variant, gender and form when switching to evolutions; sh…
Wlowscha Jan 4, 2025
f042314
Listing prevolutions and base forms
Wlowscha Jan 4, 2025
5f5a05c
Fixed filtering of baby forms with no biome assigned; Caught filter i…
Wlowscha Jan 4, 2025
fcc9ec5
Highlighting text filters, resetting all filters when starting up
Wlowscha Jan 4, 2025
b3bda1a
No error messag when cursor on uncaught species, showing sprite again…
Wlowscha Jan 4, 2025
bb2aea4
Simplified Pokemon Scan logic, accepts separate words as input
Wlowscha Jan 4, 2025
25e23de
Dynamically resizing ability box, showing ability description on firs…
Wlowscha Jan 4, 2025
52e2a67
Removed some more debug messages.
Wlowscha Jan 4, 2025
fbcd142
Filter bar can adjust cursorOffset and x padding
Wlowscha Jan 4, 2025
01c2916
Fixed some type definitions
Wlowscha Jan 4, 2025
4316e12
Merge branch 'beta' into internal-pokedex
Adri1 Jan 4, 2025
345f743
Fixed more warnings; added localization strings in the pokedex scan o…
Wlowscha Jan 5, 2025
7a4bc15
Merge branch 'internal-pokedex' of https://github.com/Wlowscha/pokero…
Wlowscha Jan 5, 2025
14b012c
Fixed fatal bug due to using Object.keys
Wlowscha Jan 5, 2025
2fc436f
Removed debug messages
Wlowscha Jan 5, 2025
5e565af
Added try catch construct to prevent error that was breaking reloadHe…
Wlowscha Jan 5, 2025
54d7ca8
Added filter for starters / evolutions
Wlowscha Jan 5, 2025
d49837c
Merge branch 'beta' into internal-pokedex
Adri1 Jan 5, 2025
ed826ad
Biome filter option for uncatchable mons
Wlowscha Jan 5, 2025
2b81bab
Merge branch 'internal-pokedex' of https://github.com/Wlowscha/pokero…
Wlowscha Jan 5, 2025
0b53fde
C and V buttons snap cursor to filters
Wlowscha Jan 5, 2025
76fa8e2
Changing background to make instructions visible
Wlowscha Jan 5, 2025
717a2c3
Can buy candy upgrades through pokedex
Wlowscha Jan 5, 2025
82bccd4
Displaying base stats as bars in an overlay
Wlowscha Jan 6, 2025
1d90bff
Including baby forms among uncatchable mons
Wlowscha Jan 6, 2025
c78ea78
Including evolutions when filtering by biome
Wlowscha Jan 6, 2025
cedc020
Working logic for select ui handler with skips and scroll
Wlowscha Jan 6, 2025
08b9a36
-Pokedex page showing biomes from prevolutions; displaying correct bi…
Wlowscha Jan 6, 2025
c722961
Fixed bug in base stats overlay
Wlowscha Jan 6, 2025
d529bb7
Regional forms display name of region in evolutions and prevolutions
Wlowscha Jan 6, 2025
44b2cb6
Better messages for evolution conditions
Wlowscha Jan 6, 2025
e04a8f1
Showing proper descriptions for menu
Wlowscha Jan 6, 2025
8e9d7f9
Adding sound effects to menu, and pokemon cry when opening page
Wlowscha Jan 6, 2025
3597d34
Changing menu colors to textstyle options supporting a legacy version.
Wlowscha Jan 6, 2025
41841ac
Fix to getStarterSpeciesId to work with all-unlocks files
Wlowscha Jan 6, 2025
8d27907
Passing a TextStyle to option select ui handler to allow for shadowed…
Wlowscha Jan 6, 2025
125b8ba
Fixed bug of overlapping labels in text filters
Wlowscha Jan 6, 2025
fb6454b
Fixed bug with supportHover and skipped indices in option select ui h…
Wlowscha Jan 6, 2025
aac5e2f
Localization of pokemon number label
Wlowscha Jan 6, 2025
b5a3afd
Fix to pokemon number localization
Wlowscha Jan 6, 2025
36b41fe
Fix to pokemon number localization
Wlowscha Jan 6, 2025
cc3d518
Adding some comments, removing useless elements
Wlowscha Jan 7, 2025
f86ab7b
More cleanup
Wlowscha Jan 7, 2025
c340b8b
Removed candy upgrade instructions from evolved pokemon; attempting t…
Wlowscha Jan 7, 2025
a53195f
Attempting to exit from filter text is now allowed if current option …
Wlowscha Jan 7, 2025
113d134
UI changes to make dex pages work in legacy style
Wlowscha Jan 8, 2025
215f9e8
Pokemon name shown while in alt form is no more capitalized
Wlowscha Jan 9, 2025
726b975
Handling uncaught pokemon
Wlowscha Jan 9, 2025
47cb203
Showing types on Pokémon page
Wlowscha Jan 9, 2025
13177ae
Merge remote-tracking branch 'origin/beta' into internal-pokedex
Wlowscha Jan 15, 2025
70f7ab8
Introducing globalScene everywhere
Wlowscha Jan 15, 2025
9e5ebb6
Showing evolution requirements in message box
Wlowscha Jan 15, 2025
918fa7e
Displaying form changing items; now using pokemonFormChanges to only …
Wlowscha Jan 15, 2025
3e6b804
Playing correct cry
Wlowscha Jan 15, 2025
f69666a
Pokemon cry in setSpeciesDetails
Wlowscha Jan 16, 2025
060619e
Left and right buttons to turn previous or next pokedex page
Wlowscha Jan 16, 2025
8174e12
Cleaned up "last" from this.species; turning pages now preserves memo…
Wlowscha Jan 16, 2025
05e9780
Pokerus cursor is now treated as decoration
Wlowscha Jan 16, 2025
07010dd
Correctly displaying prevolutions for Pikachu and Gholdengo
Wlowscha Jan 16, 2025
db3e3f4
Uncaught forms can be cycled through (with black sprite and no option…
Wlowscha Jan 17, 2025
dee1db9
Filtering by moves now shows icons to distinguish egg and tm moves
Wlowscha Jan 17, 2025
ea7dfe2
Added icons for passive abilities
Wlowscha Jan 17, 2025
47ae281
Added icons to legacy mode; fixed bug that caused game to hang when s…
Wlowscha Jan 17, 2025
0efad16
Merge branch 'beta' into internal-pokedex
Wlowscha Jan 17, 2025
3030755
Pokedex entries are accessible through party screen
Wlowscha Jan 20, 2025
98bb98e
Merge branch 'beta' into internal-pokedex
Wlowscha Jan 20, 2025
6c34c82
Adding sort criteria for consistency with starter select screen
Wlowscha Jan 21, 2025
379f197
Added options to cost reduction filter for consistency with starter s…
Wlowscha Jan 21, 2025
1d234c7
Updating optionSelectUiHandler to simplify logic and fix bug of autoc…
Wlowscha Jan 21, 2025
05d11b4
Adding Pokedéx option in starter select screen
Wlowscha Jan 21, 2025
a71015e
Prevolutions are shown properly again; battle forms are considered ca…
Wlowscha Jan 21, 2025
df03eb9
Merge branch 'beta' into internal-pokedex
Wlowscha Jan 22, 2025
b97e890
Small fixes to evolution and form change descriptions
Wlowscha Jan 22, 2025
ec03439
Reworked evolutions menu to incorporate condition descriptions
Wlowscha Jan 22, 2025
2777cff
Moving evolution condition description logic entirely to the SpeciesE…
Wlowscha Jan 22, 2025
cc9a636
Merge branch 'beta' into internal-pokedex
Wlowscha Jan 22, 2025
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
Binary file added public/images/ui/legacy/mystery_egg.png
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 public/images/ui/legacy/normal_memory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 public/images/ui/mystery_egg.png
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 public/images/ui/normal_memory.png
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 public/images/ui/pokedex_summary_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/data/balance/biomes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ export interface BiomePokemonPools {
[key: integer]: BiomeTierPokemonPools
}

export interface BiomeTierTod {
biome: Biome,
tier: BiomePoolTier,
tod: TimeOfDay[]
}

export interface CatchableSpecies{
[key: integer]: BiomeTierTod[]
}

export const catchableSpecies: CatchableSpecies = {};

export interface BiomeTierTrainerPools {
[key: integer]: TrainerType[]
}
Expand Down Expand Up @@ -7716,6 +7728,10 @@ export function initBiomes() {
uncatchableSpecies.push(speciesId);
}

// prepares new array in catchableSpecies to host available biomes
//TODO: this must be improved to only make arrays for starters
catchableSpecies[speciesId] = [];

for (const b of biomeEntries) {
const biome = b[0];
const tier = b[1];
Expand All @@ -7725,6 +7741,12 @@ export function initBiomes() {
: [ b[2] ]
: [ TimeOfDay.ALL ];

catchableSpecies[speciesId].push({
biome: biome as Biome,
tier: tier as BiomePoolTier,
tod: timesOfDay as TimeOfDay[]
});

for (const tod of timesOfDay) {
if (!biomePokemonPools.hasOwnProperty(biome) || !biomePokemonPools[biome].hasOwnProperty(tier) || !biomePokemonPools[biome][tier].hasOwnProperty(tod)) {
continue;
Expand Down
19 changes: 19 additions & 0 deletions src/data/balance/pokemon-evolutions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export class SpeciesFormEvolution {
public item: EvolutionItem | null;
public condition: SpeciesEvolutionCondition | null;
public wildDelay: SpeciesWildEvolutionDelay;
public description: string = "";

constructor(speciesId: Species, preFormKey: string | null, evoFormKey: string | null, level: integer, item: EvolutionItem | null, condition: SpeciesEvolutionCondition | null, wildDelay?: SpeciesWildEvolutionDelay) {
this.speciesId = speciesId;
Expand All @@ -101,6 +102,23 @@ export class SpeciesFormEvolution {
this.item = item || EvolutionItem.NONE;
this.condition = condition;
this.wildDelay = wildDelay ?? SpeciesWildEvolutionDelay.NONE;

const strings: string[] = [];
if (this.level > 1) {
strings.push(i18next.t("pokemonEvolutions:level") + ` ${this.level}`);
}
if (this.item) {
const itemDescription = i18next.t(`modifierType:EvolutionItem.${EvolutionItem[this.item].toUpperCase()}`);
const rarity = this.item > 50 ? i18next.t("pokemonEvolutions:ULTRA") : i18next.t("pokemonEvolutions:GREAT");
strings.push(i18next.t("pokemonEvolutions:using") + itemDescription + ` (${rarity})`);
}
if (this.condition) {
strings.push(this.condition.description);
}
this.description = strings
.filter(str => str !== "")
.map((str, index) => index > 0 ? str[0].toLowerCase() + str.slice(1) : str)
.join(i18next.t("pokemonEvolutions:connector"));
}
}

Expand Down Expand Up @@ -237,6 +255,7 @@ class WeatherEvolutionCondition extends SpeciesEvolutionCondition {
constructor(weatherTypes: WeatherType[]) {
super(() => weatherTypes.indexOf(globalScene.arena.weather?.weatherType || WeatherType.NONE) > -1);
this.weatherTypes = weatherTypes;
this.description = i18next.t("pokemonEvolutions:weather");
}
}

Expand Down
25 changes: 25 additions & 0 deletions src/data/balance/tms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68433,6 +68433,31 @@ export const tmSpecies: TmSpecies = {
],
};

interface SpeciesTmMoves {
[key: integer]: Moves[]
}

function flipTmSpecies(tmSpecies: TmSpecies): SpeciesTmMoves {
const flipped: SpeciesTmMoves = {};

for (const move in tmSpecies) {
const moveKey = Number(move);
const speciesList = tmSpecies[move];

for (const species of speciesList) {
const speciesKey = Number(species);
if (!flipped[speciesKey]) {
flipped[speciesKey] = [];
}
flipped[speciesKey].push(moveKey);
}
}
return flipped;
}

export const speciesTmMoves: SpeciesTmMoves = flipTmSpecies(tmSpecies);


interface TmPoolTiers {
[key: integer]: ModifierTier
}
Expand Down
3 changes: 2 additions & 1 deletion src/data/pokemon-forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ export class SpeciesFormChangeMoveLearnedTrigger extends SpeciesFormChangeTrigge
this.move = move;
this.known = known;
const moveKey = Moves[this.move].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join("") as unknown as string;
this.description = i18next.t("pokemonEvolutions:Forms.moveLearned", { move: i18next.t(`move:${moveKey}.name`) });
this.description = known ? i18next.t("pokemonEvolutions:Forms.moveLearned", { move: i18next.t(`move:${moveKey}.name`) }) :
i18next.t("pokemonEvolutions:Forms.moveForgotten", { move: i18next.t(`move:${moveKey}.name`) });
}

canChange(pokemon: Pokemon): boolean {
Expand Down
6 changes: 5 additions & 1 deletion src/loading-scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SceneBase } from "#app/scene-base";
import { WindowVariant, getWindowVariantSuffix } from "#app/ui/ui-theme";
import { isMobile } from "#app/touch-controls";
import * as Utils from "#app/utils";
import { initPokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
import { initPokemonPrevolutions, initPokemonStarters } from "#app/data/balance/pokemon-evolutions";
import { initBiomes } from "#app/data/balance/biomes";
import { initEggMoves } from "#app/data/balance/egg-moves";
import { initPokemonForms } from "#app/data/pokemon-forms";
Expand Down Expand Up @@ -103,6 +103,8 @@ export class LoadingScene extends SceneBase {
this.loadImage("icon_tera", "ui");
this.loadImage("type_tera", "ui");
this.loadAtlas("type_bgs", "ui");
this.loadImage("mystery_egg", "ui");
this.loadImage("normal_memory", "ui");

this.loadImage("dawn_icon_fg", "ui");
this.loadImage("dawn_icon_mg", "ui");
Expand Down Expand Up @@ -154,6 +156,7 @@ export class LoadingScene extends SceneBase {
this.loadImage("scroll_bar_handle", "ui");
this.loadImage("starter_container_bg", "ui");
this.loadImage("starter_select_bg", "ui");
this.loadImage("pokedex_summary_bg", "ui");
this.loadImage("select_cursor", "ui");
this.loadImage("select_cursor_highlight", "ui");
this.loadImage("select_cursor_highlight_thick", "ui");
Expand Down Expand Up @@ -354,6 +357,7 @@ export class LoadingScene extends SceneBase {
initVouchers();
initStatsKeys();
initPokemonPrevolutions();
initPokemonStarters();
initBiomes();
initEggMoves();
initPokemonForms();
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export async function initI18n(): Promise<void> {
"egg",
"fightUiHandler",
"filterBar",
"filterText",
"gameMode",
"gameStatsUiHandler",
"growth",
Expand All @@ -203,6 +204,7 @@ export async function initI18n(): Promise<void> {
"move",
"nature",
"pokeball",
"pokedexUiHandler",
"pokemon",
"pokemonEvolutions",
"pokemonForm",
Expand Down
1 change: 1 addition & 0 deletions src/tutorial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export enum Tutorial {
Access_Menu = "ACCESS_MENU",
Menu = "MENU",
Starter_Select = "STARTER_SELECT",
Pokedex = "POKEDEX",
Pokerus = "POKERUS",
Stat_Change = "STAT_CHANGE",
Select_Item = "SELECT_ITEM",
Expand Down
7 changes: 5 additions & 2 deletions src/ui-inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { globalScene } from "#app/global-scene";
import SettingsDisplayUiHandler from "./ui/settings/settings-display-ui-handler";
import SettingsAudioUiHandler from "./ui/settings/settings-audio-ui-handler";
import RunInfoUiHandler from "./ui/run-info-ui-handler";
import PokedexUiHandler from "./ui/pokedex-ui-handler";
import PokedexPageUiHandler from "./ui/pokedex-page-ui-handler";

type ActionKeys = Record<Button, () => void>;

Expand Down Expand Up @@ -140,7 +142,7 @@ export class UiInputs {
}

buttonGoToFilter(button: Button): void {
const whitelist = [ StarterSelectUiHandler ];
const whitelist = [ StarterSelectUiHandler, PokedexUiHandler, PokedexPageUiHandler ];
const uiHandler = globalScene.ui?.getHandler();
if (whitelist.some(handler => uiHandler instanceof handler)) {
globalScene.ui.processInput(button);
Expand Down Expand Up @@ -178,6 +180,7 @@ export class UiInputs {
globalScene.ui.setOverlayMode(Mode.MENU);
break;
case Mode.STARTER_SELECT:
case Mode.POKEDEX_PAGE:
this.buttonTouch();
break;
case Mode.MENU:
Expand All @@ -190,7 +193,7 @@ export class UiInputs {
}

buttonCycleOption(button: Button): void {
const whitelist = [ StarterSelectUiHandler, SettingsUiHandler, RunInfoUiHandler, SettingsDisplayUiHandler, SettingsAudioUiHandler, SettingsGamepadUiHandler, SettingsKeyboardUiHandler ];
const whitelist = [ StarterSelectUiHandler, PokedexUiHandler, PokedexPageUiHandler, SettingsUiHandler, RunInfoUiHandler, SettingsDisplayUiHandler, SettingsAudioUiHandler, SettingsGamepadUiHandler, SettingsKeyboardUiHandler ];
const uiHandler = globalScene.ui?.getHandler();
if (whitelist.some(handler => uiHandler instanceof handler)) {
globalScene.ui.processInput(button);
Expand Down
Loading
Loading