Add summary memo text
This commit is contained in:
1 parent
39b31e7d6f
commit
6dc868272f
9 files changed
+65
-39
No files matched your search
@@ -65,8 +65,8 @@ export abstract class FormModalUiHandler extends ModalUiHandler {
|
||||
});
|
||||
|
||||
this.errorMessage = addTextObject(this.scene, 10, (hasTitle ? 31 : 5) + 20 * (fields.length - 1) + 16, '', TextStyle.TOOLTIP_CONTENT);
|
||||
this.errorMessage.setColor(getTextColor(TextStyle.SUMMARY_RED));
|
||||
this.errorMessage.setShadowColor(getTextColor(TextStyle.SUMMARY_RED, true));
|
||||
this.errorMessage.setColor(getTextColor(TextStyle.SUMMARY_PINK));
|
||||
this.errorMessage.setShadowColor(getTextColor(TextStyle.SUMMARY_PINK, true));
|
||||
this.errorMessage.setVisible(false);
|
||||
this.modalContainer.add(this.errorMessage);
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||
this.pokemonGrowthRateLabelText.setVisible(false);
|
||||
this.starterSelectContainer.add(this.pokemonGrowthRateLabelText);
|
||||
|
||||
this.pokemonGrowthRateText = addTextObject(this.scene, 44, 103, '', TextStyle.SUMMARY_RED, { fontSize: '48px' });
|
||||
this.pokemonGrowthRateText = addTextObject(this.scene, 44, 103, '', TextStyle.SUMMARY_PINK, { fontSize: '48px' });
|
||||
this.pokemonGrowthRateText.setOrigin(0, 0);
|
||||
this.starterSelectContainer.add(this.pokemonGrowthRateText);
|
||||
|
||||
@@ -796,8 +796,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||
const newValue = value + (add || 0);
|
||||
const overLimit = newValue > 10;
|
||||
this.valueLimitLabel.setText(`${newValue}/10`);
|
||||
this.valueLimitLabel.setColor(getTextColor(!overLimit ? TextStyle.TOOLTIP_CONTENT : TextStyle.SUMMARY_RED));
|
||||
this.valueLimitLabel.setShadowColor(getTextColor(!overLimit ? TextStyle.TOOLTIP_CONTENT : TextStyle.SUMMARY_RED, true));
|
||||
this.valueLimitLabel.setColor(getTextColor(!overLimit ? TextStyle.TOOLTIP_CONTENT : TextStyle.SUMMARY_PINK));
|
||||
this.valueLimitLabel.setShadowColor(getTextColor(!overLimit ? TextStyle.TOOLTIP_CONTENT : TextStyle.SUMMARY_PINK, true));
|
||||
if (overLimit) {
|
||||
this.scene.time.delayedCall(Utils.fixedInt(500), () => this.tryUpdateValue());
|
||||
return false;
|
||||
|
||||
@@ -71,7 +71,7 @@ export class StatsContainer extends Phaser.GameObjects.Container {
|
||||
let label = ivs[i].toString();
|
||||
if (this.showDiff && originalIvs) {
|
||||
if (originalIvs[i] < ivs[i])
|
||||
label += ` ([color=${getGenderColor(Gender.MALE)}]+${ivs[i] - originalIvs[i]}[/color])`;
|
||||
label += ` ([color=${getGenderColor(Gender.MALE)}][shadow=${getGenderColor(Gender.MALE, true)}]+${ivs[i] - originalIvs[i]}[/shadow][/color])`;
|
||||
else
|
||||
label += ' (-)';
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import UiHandler from "./ui-handler";
|
||||
import * as Utils from "../utils";
|
||||
import { PlayerPokemon } from "../pokemon";
|
||||
import { Type } from "../data/type";
|
||||
import { TextStyle, addTextObject, getTextColor } from "./text";
|
||||
import { TextStyle, addBBCodeTextObject, addTextObject, getBBCodeFrag, getTextColor } from "./text";
|
||||
import Move, { MoveCategory } from "../data/move";
|
||||
import { getPokeballAtlasKey } from "../data/pokeball";
|
||||
import { getGenderColor, getGenderSymbol } from "../data/gender";
|
||||
@@ -12,6 +12,7 @@ import { getLevelTotalExp } from "../data/exp";
|
||||
import { Stat, getStatName } from "../data/pokemon-stat";
|
||||
import { PokemonHeldItemModifier } from "../modifier/modifier";
|
||||
import { StatusEffect } from "../data/status-effect";
|
||||
import { getBiomeName } from "../data/biome";
|
||||
|
||||
enum Page {
|
||||
PROFILE,
|
||||
@@ -529,6 +530,12 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
y: `-=${14.83 * (abilityDescriptionLineCount - 2)}`
|
||||
});
|
||||
}
|
||||
|
||||
let memoString = `${getBBCodeFrag(`${this.pokemon.metBiome === -1 ? 'apparently ' : ''}met at Lv`, TextStyle.WINDOW)}${getBBCodeFrag(this.pokemon.metLevel.toString(), TextStyle.SUMMARY_RED)}${getBBCodeFrag(',', TextStyle.WINDOW)}\n${getBBCodeFrag(getBiomeName(this.pokemon.metBiome), TextStyle.SUMMARY_RED)}${getBBCodeFrag('.', TextStyle.WINDOW)}`;
|
||||
|
||||
const memoText = addBBCodeTextObject(this.scene, 7, 113, memoString, TextStyle.WINDOW);
|
||||
memoText.setOrigin(0, 0);
|
||||
profileContainer.add(memoText);
|
||||
break;
|
||||
case Page.STATS:
|
||||
const statsContainer = this.scene.add.container(0, -pageBg.height);
|
||||
@@ -619,7 +626,7 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
this.extraMoveRowContainer.add(extraRowOverlay);
|
||||
|
||||
const extraRowText = addTextObject(this.scene, 35, 0, this.summaryUiMode === SummaryUiMode.LEARN_MOVE ? this.newMove.name : 'Cancel',
|
||||
this.summaryUiMode === SummaryUiMode.LEARN_MOVE ? TextStyle.SUMMARY_RED : TextStyle.SUMMARY);
|
||||
this.summaryUiMode === SummaryUiMode.LEARN_MOVE ? TextStyle.SUMMARY_PINK : TextStyle.SUMMARY);
|
||||
extraRowText.setOrigin(0, 1);
|
||||
this.extraMoveRowContainer.add(extraRowText);
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ export enum TextStyle {
|
||||
PARTY_RED,
|
||||
SUMMARY,
|
||||
SUMMARY_RED,
|
||||
SUMMARY_PINK,
|
||||
SUMMARY_GOLD,
|
||||
MONEY,
|
||||
SETTINGS_LABEL,
|
||||
@@ -68,6 +69,7 @@ function getTextStyleOptions(style: TextStyle, extraStyleOptions?: Phaser.Types.
|
||||
switch (style) {
|
||||
case TextStyle.SUMMARY:
|
||||
case TextStyle.SUMMARY_RED:
|
||||
case TextStyle.SUMMARY_PINK:
|
||||
case TextStyle.SUMMARY_GOLD:
|
||||
case TextStyle.WINDOW:
|
||||
case TextStyle.MESSAGE:
|
||||
@@ -105,6 +107,10 @@ function getTextStyleOptions(style: TextStyle, extraStyleOptions?: Phaser.Types.
|
||||
return [ styleOptions, shadowColor, shadowSize ];
|
||||
}
|
||||
|
||||
export function getBBCodeFrag(content: string, textStyle: TextStyle): string {
|
||||
return `[color=${getTextColor(textStyle)}][shadow=${getTextColor(textStyle, true)}]${content}[/shadow][/color]`;
|
||||
}
|
||||
|
||||
export function getTextColor(textStyle: TextStyle, shadow?: boolean): string {
|
||||
switch (textStyle) {
|
||||
case TextStyle.MESSAGE:
|
||||
@@ -122,6 +128,8 @@ export function getTextColor(textStyle: TextStyle, shadow?: boolean): string {
|
||||
return !shadow ? '#ffffff' : '#636363';
|
||||
case TextStyle.SUMMARY_RED:
|
||||
case TextStyle.TOOLTIP_TITLE:
|
||||
return !shadow ? '#e70808' : '#ffbd73';
|
||||
case TextStyle.SUMMARY_PINK:
|
||||
return !shadow ? '#f89890' : '#984038';
|
||||
case TextStyle.SUMMARY_GOLD:
|
||||
case TextStyle.MONEY:
|
||||
|
||||
Reference in new issue
Block a user