Add rich presence support
parent
5d62d0bb25
commit
7bdb969a73
|
@ -53,7 +53,7 @@ import PokemonSpriteSparkleHandler from './field/pokemon-sprite-sparkle-handler'
|
|||
import CharSprite from './ui/char-sprite';
|
||||
import DamageNumberHandler from './field/damage-number-handler';
|
||||
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 { SceneBase } from './scene-base';
|
||||
import CandyBar from './ui/candy-bar';
|
||||
|
@ -200,6 +200,7 @@ export default class BattleScene extends SceneBase {
|
|||
this.phaseQueuePrepend = [];
|
||||
this.phaseQueuePrependSpliceIndex = -1;
|
||||
this.nextCommandPhaseQueue = [];
|
||||
this.updateGameInfo();
|
||||
}
|
||||
|
||||
loadPokemonAtlas(key: string, atlasPath: string, experimental?: boolean) {
|
||||
|
@ -770,6 +771,8 @@ export default class BattleScene extends SceneBase {
|
|||
this.trainer.setPosition(406, 186);
|
||||
this.trainer.setVisible(true);
|
||||
|
||||
this.updateGameInfo();
|
||||
|
||||
if (reloadI18n) {
|
||||
const localizable: Localizable[] = [
|
||||
...allSpecies,
|
||||
|
@ -1963,4 +1966,16 @@ export default class BattleScene extends SceneBase {
|
|||
|
||||
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() {
|
||||
super.start();
|
||||
|
||||
this.scene.updateGameInfo();
|
||||
|
||||
this.scene.initSession();
|
||||
|
||||
const loadEnemyAssets = [];
|
||||
|
|
Loading…
Reference in New Issue