mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-17 05:42:18 +02:00
Add menu message support
This commit is contained in:
parent
a30fc9b82d
commit
33b6e79703
@ -12,6 +12,10 @@ import { Stat } from './data/pokemon-stat';
|
|||||||
import { PokeballCounts } from './battle-scene';
|
import { PokeballCounts } from './battle-scene';
|
||||||
import { PokeballType } from './data/pokeball';
|
import { PokeballType } from './data/pokeball';
|
||||||
|
|
||||||
|
|
||||||
|
export const MENU_MESSAGE: string = "";
|
||||||
|
export const MENU_MESSAGE_TEXT_COLOR: string = "";
|
||||||
|
export const MENU_MESSAGE_BACKGROUND_COLOR: string = "";
|
||||||
/**
|
/**
|
||||||
* Overrides for testing different in game situations
|
* Overrides for testing different in game situations
|
||||||
* if an override name starts with "STARTING", it will apply when a new run begins
|
* if an override name starts with "STARTING", it will apply when a new run begins
|
||||||
|
@ -6,6 +6,7 @@ import * as Utils from "../utils";
|
|||||||
import { TextStyle, addTextObject } from "./text";
|
import { TextStyle, addTextObject } from "./text";
|
||||||
import { getBattleCountSplashMessage, getSplashMessages } from "../data/splash-messages";
|
import { getBattleCountSplashMessage, getSplashMessages } from "../data/splash-messages";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
import { MENU_MESSAGE, MENU_MESSAGE_TEXT_COLOR, MENU_MESSAGE_BACKGROUND_COLOR } from "../overrides";
|
||||||
|
|
||||||
export default class TitleUiHandler extends OptionSelectUiHandler {
|
export default class TitleUiHandler extends OptionSelectUiHandler {
|
||||||
private titleContainer: Phaser.GameObjects.Container;
|
private titleContainer: Phaser.GameObjects.Container;
|
||||||
@ -42,6 +43,16 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
|||||||
this.playerCountLabel.setOrigin(1, 0);
|
this.playerCountLabel.setOrigin(1, 0);
|
||||||
this.titleContainer.add(this.playerCountLabel);
|
this.titleContainer.add(this.playerCountLabel);
|
||||||
|
|
||||||
|
if (MENU_MESSAGE !== "") {
|
||||||
|
this.menuMessage = addTextObject(this.scene, (this.scene.game.canvas.width / 6) - 2, (this.scene.game.canvas.height / 6) - 100, MENU_MESSAGE, TextStyle.MESSAGE, {
|
||||||
|
fontSize: '54px',
|
||||||
|
backgroundColor: MENU_MESSAGE_BACKGROUND_COLOR,
|
||||||
|
color: MENU_MESSAGE_TEXT_COLOR !== "" ? MENU_MESSAGE_TEXT_COLOR : "#FFFFFF"
|
||||||
|
});
|
||||||
|
this.menuMessage.setOrigin(1, 0);
|
||||||
|
this.titleContainer.add(this.menuMessage);
|
||||||
|
}
|
||||||
|
|
||||||
this.splashMessageText = addTextObject(this.scene, logo.x + 64, logo.y + logo.displayHeight - 8, '', TextStyle.MONEY, { fontSize: '54px' });
|
this.splashMessageText = addTextObject(this.scene, logo.x + 64, logo.y + logo.displayHeight - 8, '', TextStyle.MONEY, { fontSize: '54px' });
|
||||||
this.splashMessageText.setOrigin(0.5, 0.5);
|
this.splashMessageText.setOrigin(0.5, 0.5);
|
||||||
this.splashMessageText.setAngle(-20)
|
this.splashMessageText.setAngle(-20)
|
||||||
|
Loading…
Reference in New Issue
Block a user