pokerogue/src/ui/achv-bar.ts

129 lines
4.0 KiB
TypeScript
Raw Normal View History

import BattleScene from "../battle-scene";
import { Achv, getAchievementDescription } from "../system/achv";
import { Voucher } from "../system/voucher";
import { TextStyle, addTextObject } from "./text";
import { PlayerGender } from "#enums/player-gender";
export default class AchvBar extends Phaser.GameObjects.Container {
private defaultWidth: number;
private defaultHeight: number;
private bg: Phaser.GameObjects.NineSlice;
private icon: Phaser.GameObjects.Sprite;
private titleText: Phaser.GameObjects.Text;
private scoreText: Phaser.GameObjects.Text;
private descriptionText: Phaser.GameObjects.Text;
private queue: (Achv | Voucher)[] = [];
[Localization] Achievements are now based on Player Gender (because some languages differ based on that). (#1721) * Achivments(localization of name and description) now depend on the player gender * Fixed Name in ptBr config * Now the achivments are also shown with a gender specific title * Changed it so it checks if PlayerGender is undefined first * Update src/locales/de/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/en/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/es/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/fr/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/it/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/ko/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/pt_BR/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/voucher.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/zh_CN/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/zh_TW/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * instantiate player gender on in AchvBar constructor * Reverted the change made only for the tests. And adjusted the import to use the new enum file * Changed a import to make vite build it again correctly * Again some changes to the imports for the github docs that was complaining * The new challenges are also now localized and gender based * Readded getDescription --------- Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
2024-06-09 18:40:23 +02:00
private playerGender: PlayerGender;
public shown: boolean;
constructor(scene: BattleScene) {
super(scene, scene.game.canvas.width / 6, 0);
[Localization] Achievements are now based on Player Gender (because some languages differ based on that). (#1721) * Achivments(localization of name and description) now depend on the player gender * Fixed Name in ptBr config * Now the achivments are also shown with a gender specific title * Changed it so it checks if PlayerGender is undefined first * Update src/locales/de/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/en/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/es/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/fr/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/it/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/ko/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/pt_BR/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/voucher.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/zh_CN/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/zh_TW/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * instantiate player gender on in AchvBar constructor * Reverted the change made only for the tests. And adjusted the import to use the new enum file * Changed a import to make vite build it again correctly * Again some changes to the imports for the github docs that was complaining * The new challenges are also now localized and gender based * Readded getDescription --------- Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
2024-06-09 18:40:23 +02:00
this.playerGender = scene.gameData.gender;
}
setup(): void {
this.defaultWidth = 160;
this.defaultHeight = 40;
[Refactor] use typescript `strict-null` (#3259) * TS: enable strict-null * fix battle-scene.ts * fix voucher.ts * adapt more files to strict-null * adapt more files to strict-null ( 2) * adapt ability.ts to strict-null * adapt `arena.ts` to strict-null * adapt TagAddedEvent constructor to strict-null * adapt phases.ts.to strict-null * adapt status-effect.ts to strict-null * adapt `account.ts` to strict-null * adapt `configHandler.ts` to strict-null * adapt `ability.ts` to strict-null * adapt `biomes.ts` to strict-null * adapt `challenge.ts` to strict-null * adapt `daily-run.ts` to strict-null * adapt `nature.ts` to strict-null * adapt `pokemon-forms.ts` to strict-null * adapt `tainer-names.ts` to strict-null * adapt `types.ts` to strict-null * adapt `weather.ts` to strict-null * adapt `egg-hatch-phase.ts` to strict-null * adapt `evolution-phase.ts` to strict-null * adapt `pokemon-sprite-sparkle-handler.ts` to strict-null * adapt `evolution-phase.ts` to strict-null * adapt `game-mode.ts` to strict-null * adapt `utils.ts` to strict-null * adapt `voucher-ui-handler.ts` to strict-null * adapt `src/ui/unavailable-modal-ui-handler.ts` to strict-null * adapt `src/ui/ui.ts` to strict-null * adapt `src/ui/ui-theme.ts` to strict-null * adapt `src/ui/title-ui-handler.ts` to strict-null * adapt `src/ui/time-of-day-widget.ts` to strict-null * adapt `src/ui/text.ts` to strict-null * adapt `src/ui/target-select-ui-handler.ts` to strict-null * adapt `src/ui/settings/settings-keyboard-ui-handler.ts` to strict-null * adapt more files to strict-null (3) * adapt more files to strict-null (4) * adapt more files (mostly tests) to strict-null (5) * adapt more files to strict-null (6) * adapt more files to strict-null (7) * Update `src/data/pokemon-evolutions.ts` for strict-null Partial update `src/data/pokemon-species.ts` for strict-null * adapt more files to strict-null (8) * adapt more files to strict-null (9) * Strict some more nulls (still a few errors remaining) * adapt rest of the files to strict-null (9) * fix tests (check for null instead of undefined) * repalce a lot of `??` with bangs And added TODO notice as usual * fix more tests * all tests pass now * fix broken game-loop after trainer battle add some console.warn for missing cases and falling back to default * remove guessed fallback from utils.rgbHexToRgba * add TODO for this.currentBattle = null * adjust getPokemonById() return to include `null` * fix compilation errors * add test for pokemon.trySetStatus * `chanceMultiplier` shouldn't be optional * allow `null` for currentPhase * adjust hasExpSprite logic for no keymatch found * reduce bang usage in account.updateUserInfo() * fix new strict-null issues after merge * fix `strict-null` issues in dropdown.ts and sand_spit.test.ts * fix egg-gacha * adapt gul_missile.test.ts to strict-null * fix move.ts strict-null * fix i18n.ts strict-null * fix strict-null issues * fix baton_pass test after accidentially breaking it * chore: fix compiler errors * revert accidential changes in baton_pass.test.ts --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-08-07 09:23:12 -07:00
this.bg = this.scene.add.nineslice(0, 0, "achv_bar", undefined, this.defaultWidth, this.defaultHeight, 41, 6, 16, 4);
this.bg.setOrigin(0, 0);
this.add(this.bg);
this.icon = this.scene.add.sprite(4, 4, "items");
this.icon.setOrigin(0, 0);
this.add(this.icon);
this.titleText = addTextObject(this.scene, 40, 3, "", TextStyle.MESSAGE, { fontSize: "72px" });
this.titleText.setOrigin(0, 0);
this.add(this.titleText);
this.scoreText = addTextObject(this.scene, 150, 3, "", TextStyle.MESSAGE, { fontSize: "72px" });
this.scoreText.setOrigin(1, 0);
this.add(this.scoreText);
this.descriptionText = addTextObject(this.scene, 43, 16, "", TextStyle.WINDOW_ALT, { fontSize: "72px" });
this.descriptionText.setOrigin(0, 0);
this.add(this.descriptionText);
this.descriptionText.setWordWrapWidth(664);
this.descriptionText.setLineSpacing(-5);
this.setScale(0.5);
this.shown = false;
}
showAchv(achv: Achv | Voucher): void {
if (this.shown) {
this.queue.push(achv);
return;
}
const tier = achv.getTier();
this.bg.setTexture(`achv_bar${tier ? `_${tier + 1}` : ""}`);
this.icon.setFrame(achv.getIconImage());
[Localization] Achievements are now based on Player Gender (because some languages differ based on that). (#1721) * Achivments(localization of name and description) now depend on the player gender * Fixed Name in ptBr config * Now the achivments are also shown with a gender specific title * Changed it so it checks if PlayerGender is undefined first * Update src/locales/de/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/en/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/es/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/fr/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/it/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/ko/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/pt_BR/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/voucher.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/zh_CN/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/zh_TW/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * instantiate player gender on in AchvBar constructor * Reverted the change made only for the tests. And adjusted the import to use the new enum file * Changed a import to make vite build it again correctly * Again some changes to the imports for the github docs that was complaining * The new challenges are also now localized and gender based * Readded getDescription --------- Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
2024-06-09 18:40:23 +02:00
this.titleText.setText(achv.getName(this.playerGender));
2024-03-28 14:36:39 -04:00
this.scoreText.setVisible(achv instanceof Achv);
if (achv instanceof Achv) {
this.descriptionText.setText(getAchievementDescription((achv as Achv).localizationKey));
} else if (achv instanceof Voucher) {
this.descriptionText.setText((achv as Voucher).description);
}
if (achv instanceof Achv) {
this.scoreText.setText(`+${(achv as Achv).score}pt`);
}
// Take the width of the default interface or the title if longest
this.bg.width = Math.max(this.defaultWidth, this.icon.displayWidth + this.titleText.displayWidth + this.scoreText.displayWidth + 16);
this.scoreText.x = this.bg.width - 2;
this.descriptionText.width = this.bg.width - this.icon.displayWidth - 16;
this.descriptionText.setWordWrapWidth(this.descriptionText.width * 6);
// Take the height of the default interface or the description if longest
this.bg.height = Math.max(this.defaultHeight, this.titleText.displayHeight + this.descriptionText.displayHeight + 8);
this.icon.y = (this.bg.height / 2) - (this.icon.height / 2);
(this.scene as BattleScene).playSound("achv");
this.scene.tweens.add({
targets: this,
x: (this.scene.game.canvas.width / 6) - (this.bg.width / 2),
duration: 500,
ease: "Sine.easeOut"
});
[Localization] Achievements are now based on Player Gender (because some languages differ based on that). (#1721) * Achivments(localization of name and description) now depend on the player gender * Fixed Name in ptBr config * Now the achivments are also shown with a gender specific title * Changed it so it checks if PlayerGender is undefined first * Update src/locales/de/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/en/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/es/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/fr/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/it/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/ko/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/pt_BR/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/voucher.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/zh_CN/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/zh_TW/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * instantiate player gender on in AchvBar constructor * Reverted the change made only for the tests. And adjusted the import to use the new enum file * Changed a import to make vite build it again correctly * Again some changes to the imports for the github docs that was complaining * The new challenges are also now localized and gender based * Readded getDescription --------- Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
2024-06-09 18:40:23 +02:00
this.scene.time.delayedCall(10000, () => this.hide(this.playerGender));
2024-05-24 01:45:04 +02:00
this.setVisible(true);
this.shown = true;
}
[Localization] Achievements are now based on Player Gender (because some languages differ based on that). (#1721) * Achivments(localization of name and description) now depend on the player gender * Fixed Name in ptBr config * Now the achivments are also shown with a gender specific title * Changed it so it checks if PlayerGender is undefined first * Update src/locales/de/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/en/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/es/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/fr/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/it/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/ko/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/pt_BR/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/voucher.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/zh_CN/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/zh_TW/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * instantiate player gender on in AchvBar constructor * Reverted the change made only for the tests. And adjusted the import to use the new enum file * Changed a import to make vite build it again correctly * Again some changes to the imports for the github docs that was complaining * The new challenges are also now localized and gender based * Readded getDescription --------- Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
2024-06-09 18:40:23 +02:00
protected hide(playerGender: PlayerGender): void {
if (!this.shown) {
return;
}
this.scene.tweens.add({
targets: this,
x: (this.scene.game.canvas.width / 6),
duration: 500,
ease: "Sine.easeIn",
onComplete: () => {
this.shown = false;
this.setVisible(false);
if (this.queue.length) {
[Refactor] use typescript `strict-null` (#3259) * TS: enable strict-null * fix battle-scene.ts * fix voucher.ts * adapt more files to strict-null * adapt more files to strict-null ( 2) * adapt ability.ts to strict-null * adapt `arena.ts` to strict-null * adapt TagAddedEvent constructor to strict-null * adapt phases.ts.to strict-null * adapt status-effect.ts to strict-null * adapt `account.ts` to strict-null * adapt `configHandler.ts` to strict-null * adapt `ability.ts` to strict-null * adapt `biomes.ts` to strict-null * adapt `challenge.ts` to strict-null * adapt `daily-run.ts` to strict-null * adapt `nature.ts` to strict-null * adapt `pokemon-forms.ts` to strict-null * adapt `tainer-names.ts` to strict-null * adapt `types.ts` to strict-null * adapt `weather.ts` to strict-null * adapt `egg-hatch-phase.ts` to strict-null * adapt `evolution-phase.ts` to strict-null * adapt `pokemon-sprite-sparkle-handler.ts` to strict-null * adapt `evolution-phase.ts` to strict-null * adapt `game-mode.ts` to strict-null * adapt `utils.ts` to strict-null * adapt `voucher-ui-handler.ts` to strict-null * adapt `src/ui/unavailable-modal-ui-handler.ts` to strict-null * adapt `src/ui/ui.ts` to strict-null * adapt `src/ui/ui-theme.ts` to strict-null * adapt `src/ui/title-ui-handler.ts` to strict-null * adapt `src/ui/time-of-day-widget.ts` to strict-null * adapt `src/ui/text.ts` to strict-null * adapt `src/ui/target-select-ui-handler.ts` to strict-null * adapt `src/ui/settings/settings-keyboard-ui-handler.ts` to strict-null * adapt more files to strict-null (3) * adapt more files to strict-null (4) * adapt more files (mostly tests) to strict-null (5) * adapt more files to strict-null (6) * adapt more files to strict-null (7) * Update `src/data/pokemon-evolutions.ts` for strict-null Partial update `src/data/pokemon-species.ts` for strict-null * adapt more files to strict-null (8) * adapt more files to strict-null (9) * Strict some more nulls (still a few errors remaining) * adapt rest of the files to strict-null (9) * fix tests (check for null instead of undefined) * repalce a lot of `??` with bangs And added TODO notice as usual * fix more tests * all tests pass now * fix broken game-loop after trainer battle add some console.warn for missing cases and falling back to default * remove guessed fallback from utils.rgbHexToRgba * add TODO for this.currentBattle = null * adjust getPokemonById() return to include `null` * fix compilation errors * add test for pokemon.trySetStatus * `chanceMultiplier` shouldn't be optional * allow `null` for currentPhase * adjust hasExpSprite logic for no keymatch found * reduce bang usage in account.updateUserInfo() * fix new strict-null issues after merge * fix `strict-null` issues in dropdown.ts and sand_spit.test.ts * fix egg-gacha * adapt gul_missile.test.ts to strict-null * fix move.ts strict-null * fix i18n.ts strict-null * fix strict-null issues * fix baton_pass test after accidentially breaking it * chore: fix compiler errors * revert accidential changes in baton_pass.test.ts --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-08-07 09:23:12 -07:00
const shifted = this.queue.shift();
shifted && this.showAchv(shifted);
}
}
});
}
}