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 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';
|
||||||
|
@ -200,6 +200,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) {
|
||||||
|
@ -770,6 +771,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,
|
||||||
|
@ -1963,4 +1966,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