mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-13 11:52:18 +02:00
Add rich presence support
This commit is contained in:
parent
97b50707a0
commit
1cdd6a807d
@ -53,7 +53,7 @@ import PokemonSpriteSparkleHandler from './field/pokemon-sprite-sparkle-handler'
|
|||||||
import CharSprite from './ui/char-sprite';
|
import CharSprite from './ui/char-sprite';
|
||||||
import DamageNumberHandler from './field/damage-number-handler';
|
import DamageNumberHandler from './field/damage-number-handler';
|
||||||
import PokemonInfoContainer from './ui/pokemon-info-container';
|
import PokemonInfoContainer from './ui/pokemon-info-container';
|
||||||
import { biomeDepths } from './data/biomes';
|
import { biomeDepths, getBiomeName } from './data/biomes';
|
||||||
import { UiTheme } from './enums/ui-theme';
|
import { UiTheme } from './enums/ui-theme';
|
||||||
import { SceneBase } from './scene-base';
|
import { SceneBase } from './scene-base';
|
||||||
import CandyBar from './ui/candy-bar';
|
import CandyBar from './ui/candy-bar';
|
||||||
@ -188,6 +188,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
this.phaseQueuePrepend = [];
|
this.phaseQueuePrepend = [];
|
||||||
this.phaseQueuePrependSpliceIndex = -1;
|
this.phaseQueuePrependSpliceIndex = -1;
|
||||||
this.nextCommandPhaseQueue = [];
|
this.nextCommandPhaseQueue = [];
|
||||||
|
this.updateGameInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadPokemonAtlas(key: string, atlasPath: string, experimental?: boolean) {
|
loadPokemonAtlas(key: string, atlasPath: string, experimental?: boolean) {
|
||||||
@ -758,6 +759,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
this.trainer.setPosition(406, 186);
|
this.trainer.setPosition(406, 186);
|
||||||
this.trainer.setVisible(true);
|
this.trainer.setVisible(true);
|
||||||
|
|
||||||
|
this.updateGameInfo();
|
||||||
|
|
||||||
if (reloadI18n) {
|
if (reloadI18n) {
|
||||||
const localizable: Localizable[] = [
|
const localizable: Localizable[] = [
|
||||||
...allSpecies,
|
...allSpecies,
|
||||||
@ -1951,4 +1954,16 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateGameInfo(): void {
|
||||||
|
const gameInfo = {
|
||||||
|
gameMode: this.currentBattle ? this.gameMode.getName() : 'Title',
|
||||||
|
biome: this.currentBattle ? getBiomeName(this.arena.biomeType) : '',
|
||||||
|
wave: this.currentBattle?.waveIndex || 0,
|
||||||
|
party: this.party ? this.party.map(p => {
|
||||||
|
return { name: p.name, level: p.level };
|
||||||
|
}) : []
|
||||||
|
};
|
||||||
|
(window as any).gameInfo = gameInfo;
|
||||||
|
}
|
||||||
}
|
}
|
@ -680,6 +680,8 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
start() {
|
start() {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
|
this.scene.updateGameInfo();
|
||||||
|
|
||||||
this.scene.initSession();
|
this.scene.initSession();
|
||||||
|
|
||||||
const loadEnemyAssets = [];
|
const loadEnemyAssets = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user