2024-05-05 16:30:00 +02:00
import BattleScene , { starterColors } from "../battle-scene" ;
2023-04-05 08:35:15 -04:00
import { Mode } from "./ui" ;
2023-12-20 19:19:23 -05:00
import UiHandler from "./ui-handler" ;
2023-04-06 11:30:22 -04:00
import * as Utils from "../utils" ;
2024-02-29 20:08:50 -05:00
import { PlayerPokemon } from "../field/pokemon" ;
2024-05-23 17:03:10 +02:00
import { getStarterValueFriendshipCap , speciesStarters } from "../data/pokemon-species" ;
2024-05-04 17:29:48 -05:00
import { argbFromRgba } from "@material/material-color-utilities" ;
2024-02-17 00:40:03 -05:00
import { Type , getTypeRgb } from "../data/type" ;
2024-05-23 17:03:10 +02:00
import { TextStyle , addBBCodeTextObject , addTextObject , getBBCodeFrag } from "./text" ;
2023-04-20 15:46:05 -04:00
import Move , { MoveCategory } from "../data/move" ;
import { getPokeballAtlasKey } from "../data/pokeball" ;
2024-03-19 23:39:43 -04:00
import { getGenderColor , getGenderSymbol } from "../data/gender" ;
2024-03-31 21:14:35 -04:00
import { getLevelRelExp , getLevelTotalExp } from "../data/exp" ;
2023-04-23 16:36:03 -04:00
import { Stat , getStatName } from "../data/pokemon-stat" ;
2023-04-23 18:40:21 -04:00
import { PokemonHeldItemModifier } from "../modifier/modifier" ;
2023-10-25 14:15:44 -04:00
import { StatusEffect } from "../data/status-effect" ;
2024-01-13 12:24:24 -05:00
import { getBiomeName } from "../data/biomes" ;
2024-01-05 22:24:05 -05:00
import { Nature , getNatureStatMultiplier } from "../data/nature" ;
2024-03-19 23:39:43 -04:00
import { loggedInUser } from "../account" ;
import { PlayerGender } from "../system/game-data" ;
2024-04-26 17:32:28 -04:00
import { Variant , getVariantTint } from "#app/data/variant" ;
2024-05-05 16:30:00 +02:00
import { Button } from "../enums/buttons" ;
2024-05-12 22:38:28 -05:00
import { Ability } from "../data/ability.js" ;
2024-05-27 10:39:18 +02:00
import i18next from "i18next" ;
2023-04-05 08:35:15 -04:00
2023-04-06 10:05:12 -04:00
enum Page {
PROFILE ,
2023-04-23 16:36:03 -04:00
STATS ,
2023-04-06 10:05:12 -04:00
MOVES
}
2023-04-06 22:24:13 -04:00
export enum SummaryUiMode {
DEFAULT ,
LEARN_MOVE
}
2024-05-12 22:38:28 -05:00
/** Holds all objects related to an ability for each iteration */
interface abilityContainer {
/** An image displaying the summary label */
labelImage : Phaser.GameObjects.Image ,
/** The ability object */
2024-05-24 01:45:04 +02:00
ability : Ability ,
2024-05-12 22:38:28 -05:00
/** The text object displaying the name of the ability */
nameText : Phaser.GameObjects.Text ,
2024-05-24 01:45:04 +02:00
/** The text object displaying the description of the ability */
descriptionText : Phaser.GameObjects.Text ,
2024-05-12 22:38:28 -05:00
}
2023-04-05 08:35:15 -04:00
export default class SummaryUiHandler extends UiHandler {
2023-04-06 22:24:13 -04:00
private summaryUiMode : SummaryUiMode ;
2023-04-05 08:35:15 -04:00
private summaryContainer : Phaser.GameObjects.Container ;
2023-04-23 18:40:21 -04:00
private tabSprite : Phaser.GameObjects.Sprite ;
2023-04-23 19:41:32 -04:00
private shinyOverlay : Phaser.GameObjects.Image ;
2023-04-08 20:35:45 -04:00
private numberText : Phaser.GameObjects.Text ;
2023-04-07 13:23:55 -04:00
private pokemonSprite : Phaser.GameObjects.Sprite ;
2023-04-08 20:35:45 -04:00
private nameText : Phaser.GameObjects.Text ;
2024-03-06 23:20:53 -05:00
private splicedIcon : Phaser.GameObjects.Sprite ;
2023-04-08 20:35:45 -04:00
private pokeball : Phaser.GameObjects.Sprite ;
private levelText : Phaser.GameObjects.Text ;
private genderText : Phaser.GameObjects.Text ;
2024-04-18 22:52:26 -04:00
private shinyIcon : Phaser.GameObjects.Image ;
2024-04-26 11:31:39 -04:00
private fusionShinyIcon : Phaser.GameObjects.Image ;
2024-05-04 17:29:48 -05:00
private candyShadow : Phaser.GameObjects.Sprite ;
private candyIcon : Phaser.GameObjects.Sprite ;
private candyOverlay : Phaser.GameObjects.Sprite ;
2024-05-08 12:01:05 -05:00
private candyCountText : Phaser.GameObjects.Text ;
private championRibbon : Phaser.GameObjects.Image ;
2023-10-25 14:15:44 -04:00
private statusContainer : Phaser.GameObjects.Container ;
private status : Phaser.GameObjects.Image ;
2024-05-12 22:38:28 -05:00
/** The pixel button prompt indicating a passive is unlocked */
private abilityPrompt : Phaser.GameObjects.Image ;
/** Object holding everything needed to display an ability */
private abilityContainer : abilityContainer ;
/** Object holding everything needed to display a passive */
private passiveContainer : abilityContainer ;
2023-04-06 11:30:22 -04:00
private summaryPageContainer : Phaser.GameObjects.Container ;
2023-04-06 22:24:13 -04:00
private movesContainer : Phaser.GameObjects.Container ;
2023-04-07 00:17:55 -04:00
private moveDescriptionText : Phaser.GameObjects.Text ;
2023-04-06 22:24:13 -04:00
private moveCursorObj : Phaser.GameObjects.Sprite ;
private selectedMoveCursorObj : Phaser.GameObjects.Sprite ;
2023-04-07 00:17:55 -04:00
private moveRowsContainer : Phaser.GameObjects.Container ;
2023-04-06 22:24:13 -04:00
private extraMoveRowContainer : Phaser.GameObjects.Container ;
2023-04-08 20:35:45 -04:00
private moveEffectContainer : Phaser.GameObjects.Container ;
private movePowerText : Phaser.GameObjects.Text ;
private moveAccuracyText : Phaser.GameObjects.Text ;
private moveCategoryIcon : Phaser.GameObjects.Sprite ;
2023-04-06 11:30:22 -04:00
private summaryPageTransitionContainer : Phaser.GameObjects.Container ;
2023-04-06 10:05:12 -04:00
2023-12-11 11:09:58 -05:00
private descriptionScrollTween : Phaser.Tweens.Tween ;
2023-04-07 00:17:55 -04:00
private moveCursorBlinkTimer : Phaser.Time.TimerEvent ;
2023-04-06 22:24:13 -04:00
private pokemon : PlayerPokemon ;
private newMove : Move ;
private moveSelectFunction : Function ;
2023-04-06 11:30:22 -04:00
private transitioning : boolean ;
2023-10-25 14:15:44 -04:00
private statusVisible : boolean ;
2023-04-08 20:35:45 -04:00
private moveEffectsVisible : boolean ;
2023-04-05 08:35:15 -04:00
2023-04-06 22:24:13 -04:00
private moveSelect : boolean ;
private moveCursor : integer ;
private selectedMoveIndex : integer ;
2023-04-05 08:35:15 -04:00
constructor ( scene : BattleScene ) {
super ( scene , Mode . SUMMARY ) ;
}
setup() {
const ui = this . getUi ( ) ;
this . summaryContainer = this . scene . add . container ( 0 , 0 ) ;
this . summaryContainer . setVisible ( false ) ;
ui . add ( this . summaryContainer ) ;
2024-05-23 17:03:10 +02:00
const summaryBg = this . scene . add . image ( 0 , 0 , "summary_bg" ) ;
2023-04-06 10:05:12 -04:00
summaryBg . setOrigin ( 0 , 1 ) ;
2023-04-05 08:35:15 -04:00
this . summaryContainer . add ( summaryBg ) ;
2024-05-23 17:03:10 +02:00
this . tabSprite = this . scene . add . sprite ( 134 , ( - summaryBg . displayHeight ) + 16 , "summary_tabs_1" ) ;
2023-04-23 18:40:21 -04:00
this . tabSprite . setOrigin ( 1 , 1 ) ;
this . summaryContainer . add ( this . tabSprite ) ;
2024-05-23 17:03:10 +02:00
const summaryLabel = addTextObject ( this . scene , 4 , - 165 , "Pokémon Info" , TextStyle . SUMMARY ) ;
2023-10-25 14:15:44 -04:00
summaryLabel . setOrigin ( 0 , 1 ) ;
this . summaryContainer . add ( summaryLabel ) ;
2024-05-23 17:03:10 +02:00
this . shinyOverlay = this . scene . add . image ( 6 , - 54 , "summary_overlay_shiny" ) ;
2023-04-23 19:41:32 -04:00
this . shinyOverlay . setOrigin ( 0 , 1 ) ;
2024-04-08 10:12:06 -04:00
this . shinyOverlay . setVisible ( false ) ;
2023-04-23 19:41:32 -04:00
this . summaryContainer . add ( this . shinyOverlay ) ;
2024-05-23 17:03:10 +02:00
this . numberText = addTextObject ( this . scene , 17 , - 149 , "0000" , TextStyle . SUMMARY ) ;
2023-04-08 20:35:45 -04:00
this . numberText . setOrigin ( 0 , 1 ) ;
this . summaryContainer . add ( this . numberText ) ;
2024-05-23 17:03:10 +02:00
this . pokemonSprite = this . scene . initPokemonSprite ( this . scene . add . sprite ( 56 , - 106 , "pkmn__sub" ) , null , false , true ) ;
2023-04-07 13:23:55 -04:00
this . summaryContainer . add ( this . pokemonSprite ) ;
2024-05-23 17:03:10 +02:00
this . nameText = addTextObject ( this . scene , 6 , - 54 , "" , TextStyle . SUMMARY ) ;
2023-11-04 00:32:12 -04:00
this . nameText . setOrigin ( 0 , 0 ) ;
2023-04-08 20:35:45 -04:00
this . summaryContainer . add ( this . nameText ) ;
2024-05-23 17:03:10 +02:00
this . splicedIcon = this . scene . add . sprite ( 0 , - 54 , "icon_spliced" ) ;
2024-03-06 23:20:53 -05:00
this . splicedIcon . setVisible ( false ) ;
this . splicedIcon . setOrigin ( 0 , 0 ) ;
this . splicedIcon . setScale ( 0.75 ) ;
this . splicedIcon . setInteractive ( new Phaser . Geom . Rectangle ( 0 , 0 , 12 , 15 ) , Phaser . Geom . Rectangle . Contains ) ;
this . summaryContainer . add ( this . splicedIcon ) ;
2024-05-24 01:45:04 +02:00
2024-05-23 17:03:10 +02:00
this . shinyIcon = this . scene . add . image ( 0 , - 54 , "shiny_star" ) ;
2024-04-18 22:52:26 -04:00
this . shinyIcon . setVisible ( false ) ;
this . shinyIcon . setOrigin ( 0 , 0 ) ;
this . shinyIcon . setScale ( 0.75 ) ;
this . shinyIcon . setInteractive ( new Phaser . Geom . Rectangle ( 0 , 0 , 12 , 15 ) , Phaser . Geom . Rectangle . Contains ) ;
this . summaryContainer . add ( this . shinyIcon ) ;
2024-03-06 23:20:53 -05:00
2024-05-23 17:03:10 +02:00
this . fusionShinyIcon = this . scene . add . image ( 0 , 0 , "shiny_star_2" ) ;
2024-04-26 11:31:39 -04:00
this . fusionShinyIcon . setVisible ( false ) ;
this . fusionShinyIcon . setOrigin ( 0 , 0 ) ;
2024-05-23 17:03:10 +02:00
this . fusionShinyIcon . setScale ( 0.75 ) ;
2024-04-26 11:31:39 -04:00
this . summaryContainer . add ( this . fusionShinyIcon ) ;
2024-05-23 17:03:10 +02:00
this . pokeball = this . scene . add . sprite ( 6 , - 19 , "pb" ) ;
2023-04-08 20:35:45 -04:00
this . pokeball . setOrigin ( 0 , 1 ) ;
this . summaryContainer . add ( this . pokeball ) ;
2024-05-23 17:03:10 +02:00
this . candyIcon = this . scene . add . sprite ( 13 , - 140 , "candy" ) ;
2024-05-04 17:29:48 -05:00
this . candyIcon . setScale ( 0.8 ) ;
this . summaryContainer . add ( this . candyIcon ) ;
2024-05-23 17:03:10 +02:00
this . candyOverlay = this . scene . add . sprite ( 13 , - 140 , "candy_overlay" ) ;
2024-05-04 17:29:48 -05:00
this . candyOverlay . setScale ( 0.8 ) ;
this . summaryContainer . add ( this . candyOverlay ) ;
2024-05-23 17:03:10 +02:00
this . candyShadow = this . scene . add . sprite ( 13 , - 140 , "candy" ) ;
2024-05-08 12:01:05 -05:00
this . candyShadow . setTint ( 0x000000 ) ;
this . candyShadow . setAlpha ( 0.50 ) ;
this . candyShadow . setScale ( 0.8 ) ;
this . candyShadow . setInteractive ( new Phaser . Geom . Rectangle ( 0 , 0 , 16 , 16 ) , Phaser . Geom . Rectangle . Contains ) ;
this . summaryContainer . add ( this . candyShadow ) ;
2024-05-23 17:03:10 +02:00
this . candyCountText = addTextObject ( this . scene , 20 , - 146 , "x0" , TextStyle . WINDOW_ALT , { fontSize : "76px" } ) ;
2024-05-08 12:01:05 -05:00
this . candyCountText . setOrigin ( 0 , 0 ) ;
this . summaryContainer . add ( this . candyCountText ) ;
2024-05-23 17:03:10 +02:00
this . championRibbon = this . scene . add . image ( 88 , - 146 , "champion_ribbon" ) ;
2024-05-08 12:01:05 -05:00
this . championRibbon . setOrigin ( 0 , 0 ) ;
//this.championRibbon.setScale(0.8);
this . championRibbon . setScale ( 1.25 ) ;
this . summaryContainer . add ( this . championRibbon ) ;
this . championRibbon . setVisible ( false ) ;
2024-05-23 17:03:10 +02:00
this . levelText = addTextObject ( this . scene , 36 , - 17 , "" , TextStyle . SUMMARY_ALT ) ;
2023-04-08 20:35:45 -04:00
this . levelText . setOrigin ( 0 , 1 ) ;
this . summaryContainer . add ( this . levelText ) ;
2024-05-23 17:03:10 +02:00
this . genderText = addTextObject ( this . scene , 96 , - 17 , "" , TextStyle . SUMMARY ) ;
2023-04-08 20:35:45 -04:00
this . genderText . setOrigin ( 0 , 1 ) ;
this . summaryContainer . add ( this . genderText ) ;
2023-10-25 14:15:44 -04:00
this . statusContainer = this . scene . add . container ( - 106 , - 16 ) ;
2024-05-23 17:03:10 +02:00
const statusBg = this . scene . add . image ( 0 , 0 , "summary_status" ) ;
2023-10-25 14:15:44 -04:00
statusBg . setOrigin ( 0 , 0 ) ;
this . statusContainer . add ( statusBg ) ;
2024-05-24 01:45:04 +02:00
2024-05-23 17:03:10 +02:00
const statusLabel = addTextObject ( this . scene , 3 , 0 , "Status" , TextStyle . SUMMARY ) ;
2023-10-25 14:15:44 -04:00
statusLabel . setOrigin ( 0 , 0 ) ;
this . statusContainer . add ( statusLabel ) ;
2024-05-23 17:03:10 +02:00
this . status = this . scene . add . sprite ( 91 , 4 , "statuses" ) ;
2023-10-25 14:15:44 -04:00
this . status . setOrigin ( 0.5 , 0 ) ;
this . statusContainer . add ( this . status ) ;
this . summaryContainer . add ( this . statusContainer ) ;
2023-04-08 20:35:45 -04:00
this . moveEffectContainer = this . scene . add . container ( 106 , - 62 ) ;
2023-10-18 18:01:15 -04:00
2023-04-08 20:35:45 -04:00
this . summaryContainer . add ( this . moveEffectContainer ) ;
2024-05-23 17:03:10 +02:00
const moveEffectBg = this . scene . add . image ( 0 , 0 , "summary_moves_effect" ) ;
2023-04-08 20:35:45 -04:00
moveEffectBg . setOrigin ( 0 , 0 ) ;
this . moveEffectContainer . add ( moveEffectBg ) ;
2024-05-23 17:03:10 +02:00
const moveEffectLabels = addTextObject ( this . scene , 8 , 12 , "Power\nAccuracy\nCategory" , TextStyle . SUMMARY ) ;
2023-10-18 18:01:15 -04:00
moveEffectLabels . setLineSpacing ( 9 ) ;
moveEffectLabels . setOrigin ( 0 , 0 ) ;
this . moveEffectContainer . add ( moveEffectLabels ) ;
2024-05-23 17:03:10 +02:00
this . movePowerText = addTextObject ( this . scene , 99 , 27 , "0" , TextStyle . WINDOW_ALT ) ;
2023-04-08 20:35:45 -04:00
this . movePowerText . setOrigin ( 1 , 1 ) ;
this . moveEffectContainer . add ( this . movePowerText ) ;
2024-05-23 17:03:10 +02:00
this . moveAccuracyText = addTextObject ( this . scene , 99 , 43 , "0" , TextStyle . WINDOW_ALT ) ;
2023-04-08 20:35:45 -04:00
this . moveAccuracyText . setOrigin ( 1 , 1 ) ;
this . moveEffectContainer . add ( this . moveAccuracyText ) ;
2024-05-23 17:03:10 +02:00
this . moveCategoryIcon = this . scene . add . sprite ( 99 , 57 , "categories" ) ;
2023-04-08 20:35:45 -04:00
this . moveCategoryIcon . setOrigin ( 1 , 1 ) ;
this . moveEffectContainer . add ( this . moveCategoryIcon ) ;
2023-04-06 11:30:22 -04:00
const getSummaryPageBg = ( ) = > {
const ret = this . scene . add . sprite ( 0 , 0 , this . getPageKey ( 0 ) ) ;
ret . setOrigin ( 0 , 1 ) ;
return ret ;
} ;
2023-04-06 22:24:13 -04:00
this . summaryContainer . add ( ( this . summaryPageContainer = this . scene . add . container ( 106 , 0 ) ) ) ;
this . summaryPageContainer . add ( getSummaryPageBg ( ) ) ;
this . summaryPageContainer . setVisible ( false ) ;
this . summaryContainer . add ( ( this . summaryPageTransitionContainer = this . scene . add . container ( 106 , 0 ) ) ) ;
this . summaryPageTransitionContainer . add ( getSummaryPageBg ( ) ) ;
this . summaryPageTransitionContainer . setVisible ( false ) ;
2023-04-06 10:05:12 -04:00
}
2023-04-06 11:30:22 -04:00
getPageKey ( page? : integer ) {
2024-05-23 17:03:10 +02:00
if ( page === undefined ) {
2023-04-06 11:30:22 -04:00
page = this . cursor ;
2024-05-23 17:03:10 +02:00
}
2023-04-06 11:30:22 -04:00
return ` summary_ ${ Page [ page ] . toLowerCase ( ) } ` ;
2023-04-05 08:35:15 -04:00
}
2023-12-30 18:41:25 -05:00
show ( args : any [ ] ) : boolean {
2023-04-05 08:35:15 -04:00
super . show ( args ) ;
2023-04-06 22:24:13 -04:00
this . pokemon = args [ 0 ] as PlayerPokemon ;
this . summaryUiMode = args . length > 1 ? args [ 1 ] as SummaryUiMode : SummaryUiMode.DEFAULT ;
2024-01-11 00:41:08 -05:00
this . scene . ui . bringToTop ( this . summaryContainer ) ;
2023-04-05 08:35:15 -04:00
this . summaryContainer . setVisible ( true ) ;
2023-04-06 11:30:22 -04:00
this . cursor = - 1 ;
2023-04-06 22:24:13 -04:00
2023-11-05 23:48:04 -05:00
this . shinyOverlay . setVisible ( this . pokemon . isShiny ( ) ) ;
2023-04-23 19:41:32 -04:00
2024-05-04 17:29:48 -05:00
const colorScheme = starterColors [ this . pokemon . species . getRootSpeciesId ( ) ] ;
this . candyIcon . setTint ( argbFromRgba ( Utils . rgbHexToRgba ( colorScheme [ 0 ] ) ) ) ;
this . candyOverlay . setTint ( argbFromRgba ( Utils . rgbHexToRgba ( colorScheme [ 1 ] ) ) ) ;
2024-02-12 16:38:46 -05:00
this . numberText . setText ( Utils . padInt ( this . pokemon . species . speciesId , 4 ) ) ;
2024-03-31 21:14:35 -04:00
this . numberText . setColor ( this . getTextColor ( ! this . pokemon . isShiny ( ) ? TextStyle.SUMMARY : TextStyle.SUMMARY_GOLD ) ) ;
this . numberText . setShadowColor ( this . getTextColor ( ! this . pokemon . isShiny ( ) ? TextStyle.SUMMARY : TextStyle.SUMMARY_GOLD , true ) ) ;
2023-04-08 20:35:45 -04:00
2023-10-29 01:28:56 -04:00
this . pokemonSprite . play ( this . pokemon . getSpriteKey ( true ) ) ;
2024-05-23 17:03:10 +02:00
this . pokemonSprite . setPipelineData ( "teraColor" , getTypeRgb ( this . pokemon . getTeraType ( ) ) ) ;
this . pokemonSprite . setPipelineData ( "ignoreTimeTint" , true ) ;
this . pokemonSprite . setPipelineData ( "spriteKey" , this . pokemon . getSpriteKey ( ) ) ;
this . pokemonSprite . setPipelineData ( "shiny" , this . pokemon . shiny ) ;
this . pokemonSprite . setPipelineData ( "variant" , this . pokemon . variant ) ;
[ "spriteColors" , "fusionSpriteColors" ] . map ( k = > {
2023-11-24 15:12:26 -05:00
delete this . pokemonSprite . pipelineData [ ` ${ k } Base ` ] ;
2024-05-23 17:03:10 +02:00
if ( this . pokemon . summonData ? . speciesForm ) {
k += "Base" ;
}
2023-11-24 15:12:26 -05:00
this . pokemonSprite . pipelineData [ k ] = this . pokemon . getSprite ( ) . pipelineData [ k ] ;
} ) ;
2023-04-06 22:24:13 -04:00
this . pokemon . cry ( ) ;
2023-12-01 17:23:26 -05:00
this . nameText . setText ( this . pokemon . name ) ;
2023-11-04 00:32:12 -04:00
2024-04-26 11:31:39 -04:00
const isFusion = this . pokemon . isFusion ( ) ;
2024-03-06 23:20:53 -05:00
this . splicedIcon . setPositionRelative ( this . nameText , this . nameText . displayWidth + 2 , 3 ) ;
2024-04-26 11:31:39 -04:00
this . splicedIcon . setVisible ( isFusion ) ;
2024-03-06 23:20:53 -05:00
if ( this . splicedIcon . visible ) {
2024-05-23 17:03:10 +02:00
this . splicedIcon . on ( "pointerover" , ( ) = > ( this . scene as BattleScene ) . ui . showTooltip ( null , ` ${ this . pokemon . species . getName ( this . pokemon . formIndex ) } / ${ this . pokemon . fusionSpecies . getName ( this . pokemon . fusionFormIndex ) } ` , true ) ) ;
this . splicedIcon . on ( "pointerout" , ( ) = > ( this . scene as BattleScene ) . ui . hideTooltip ( ) ) ;
2024-03-06 23:20:53 -05:00
}
2024-04-26 11:31:39 -04:00
2024-05-24 02:19:20 +02:00
if ( this . scene . gameData . starterData [ this . pokemon . species . getRootSpeciesId ( ) ] . classicWinCount > 0 && this . scene . gameData . starterData [ this . pokemon . species . getRootSpeciesId ( true ) ] . classicWinCount > 0 ) {
2024-05-08 12:01:05 -05:00
this . championRibbon . setVisible ( true ) ;
2024-05-23 17:03:10 +02:00
} else {
2024-05-08 12:35:27 -05:00
this . championRibbon . setVisible ( false ) ;
2024-05-23 17:03:10 +02:00
}
2024-05-08 12:01:05 -05:00
2024-05-23 17:03:10 +02:00
let currentFriendship = this . scene . gameData . starterData [ this . pokemon . species . getRootSpeciesId ( ) ] . friendship ;
if ( ! currentFriendship || currentFriendship === undefined ) {
2024-05-04 17:29:48 -05:00
currentFriendship = 0 ;
2024-05-23 17:03:10 +02:00
}
2024-05-04 17:29:48 -05:00
const friendshipCap = getStarterValueFriendshipCap ( speciesStarters [ this . pokemon . species . getRootSpeciesId ( ) ] ) ;
const candyCropY = 16 - ( 16 * ( currentFriendship / friendshipCap ) ) ;
if ( this . candyShadow . visible ) {
2024-05-23 17:03:10 +02:00
this . candyShadow . on ( "pointerover" , ( ) = > ( this . scene as BattleScene ) . ui . showTooltip ( null , ` ${ currentFriendship } / ${ friendshipCap } ` , true ) ) ;
this . candyShadow . on ( "pointerout" , ( ) = > ( this . scene as BattleScene ) . ui . hideTooltip ( ) ) ;
2024-05-04 17:29:48 -05:00
}
2024-05-08 12:01:05 -05:00
this . candyCountText . setText ( ` x ${ this . scene . gameData . starterData [ this . pokemon . species . getRootSpeciesId ( ) ] . candyCount } ` ) ;
this . candyShadow . setCrop ( 0 , 0 , 16 , candyCropY ) ;
2024-05-04 17:29:48 -05:00
2024-04-26 11:31:39 -04:00
const doubleShiny = isFusion && this . pokemon . shiny && this . pokemon . fusionShiny ;
const baseVariant = ! doubleShiny ? this . pokemon . getVariant ( ) : this . pokemon . variant ;
2024-05-24 01:45:04 +02:00
2024-04-18 22:52:26 -04:00
this . shinyIcon . setPositionRelative ( this . nameText , this . nameText . displayWidth + ( this . splicedIcon . visible ? this . splicedIcon . displayWidth + 1 : 0 ) + 1 , 3 ) ;
2024-05-23 17:03:10 +02:00
this . shinyIcon . setTexture ( ` shiny_star ${ doubleShiny ? "_1" : "" } ` ) ;
2024-04-18 22:52:26 -04:00
this . shinyIcon . setVisible ( this . pokemon . isShiny ( ) ) ;
2024-04-26 11:31:39 -04:00
this . shinyIcon . setTint ( getVariantTint ( baseVariant ) ) ;
2024-04-18 22:52:26 -04:00
if ( this . shinyIcon . visible ) {
2024-04-26 11:31:39 -04:00
const shinyDescriptor = doubleShiny || baseVariant ?
2024-05-23 17:03:10 +02:00
` ${ baseVariant === 2 ? "Epic" : baseVariant === 1 ? "Rare" : "Common" } ${ doubleShiny ? ` / ${ this . pokemon . fusionVariant === 2 ? "Epic" : this . pokemon . fusionVariant === 1 ? "Rare" : "Common" } ` : "" } `
: "" ;
this . shinyIcon . on ( "pointerover" , ( ) = > ( this . scene as BattleScene ) . ui . showTooltip ( null , ` Shiny ${ shinyDescriptor ? ` ( ${ shinyDescriptor } ) ` : "" } ` , true ) ) ;
this . shinyIcon . on ( "pointerout" , ( ) = > ( this . scene as BattleScene ) . ui . hideTooltip ( ) ) ;
2024-04-18 22:52:26 -04:00
}
2024-03-06 23:20:53 -05:00
2024-04-26 11:31:39 -04:00
this . fusionShinyIcon . setPosition ( this . shinyIcon . x , this . shinyIcon . y ) ;
this . fusionShinyIcon . setVisible ( doubleShiny ) ;
2024-05-23 17:03:10 +02:00
if ( isFusion ) {
2024-04-26 11:31:39 -04:00
this . fusionShinyIcon . setTint ( getVariantTint ( this . pokemon . fusionVariant ) ) ;
2024-05-23 17:03:10 +02:00
}
2024-04-26 11:31:39 -04:00
2023-04-08 20:35:45 -04:00
this . pokeball . setFrame ( getPokeballAtlasKey ( this . pokemon . pokeball ) ) ;
this . levelText . setText ( this . pokemon . level . toString ( ) ) ;
2023-10-29 01:28:56 -04:00
this . genderText . setText ( getGenderSymbol ( this . pokemon . getGender ( true ) ) ) ;
this . genderText . setColor ( getGenderColor ( this . pokemon . getGender ( true ) ) ) ;
this . genderText . setShadowColor ( getGenderColor ( this . pokemon . getGender ( true ) , true ) ) ;
2023-04-08 20:35:45 -04:00
2023-04-06 22:24:13 -04:00
switch ( this . summaryUiMode ) {
2024-05-23 17:03:10 +02:00
case SummaryUiMode . DEFAULT :
const page = args . length < 2 ? Page.PROFILE : args [ 2 ] as Page ;
this . hideMoveEffect ( true ) ;
this . setCursor ( page ) ;
break ;
case SummaryUiMode . LEARN_MOVE :
this . newMove = args [ 2 ] as Move ;
this . moveSelectFunction = args [ 3 ] as Function ;
this . showMoveEffect ( true ) ;
this . setCursor ( Page . MOVES ) ;
this . showMoveSelect ( ) ;
break ;
2023-04-06 22:24:13 -04:00
}
2023-10-25 14:15:44 -04:00
const fromSummary = args . length >= 2 ;
if ( this . pokemon . status || this . pokemon . pokerus ) {
this . showStatus ( ! fromSummary ) ;
2024-05-23 17:03:10 +02:00
this . status . setFrame ( this . pokemon . status ? StatusEffect [ this . pokemon . status . effect ] . toLowerCase ( ) : "pokerus" ) ;
} else {
2023-10-25 14:15:44 -04:00
this . hideStatus ( ! fromSummary ) ;
2024-05-23 17:03:10 +02:00
}
2023-12-30 18:41:25 -05:00
return true ;
2023-04-05 08:35:15 -04:00
}
2023-11-12 00:31:40 -05:00
processInput ( button : Button ) : boolean {
2024-05-23 17:03:10 +02:00
if ( this . transitioning ) {
2023-11-12 00:31:40 -05:00
return false ;
2024-05-23 17:03:10 +02:00
}
2023-04-06 11:30:22 -04:00
2023-04-05 08:35:15 -04:00
const ui = this . getUi ( ) ;
2023-04-06 10:05:12 -04:00
2023-04-06 11:30:22 -04:00
let success = false ;
2023-11-12 00:31:40 -05:00
let error = false ;
2023-04-06 11:30:22 -04:00
2023-04-06 22:24:13 -04:00
if ( this . moveSelect ) {
2023-04-11 00:24:55 -04:00
if ( button === Button . ACTION ) {
2023-04-06 22:24:13 -04:00
if ( this . moveCursor < this . pokemon . moveset . length ) {
2024-05-23 17:03:10 +02:00
if ( this . summaryUiMode === SummaryUiMode . LEARN_MOVE ) {
2023-04-06 22:24:13 -04:00
this . moveSelectFunction ( this . moveCursor ) ;
2024-05-23 17:03:10 +02:00
} else {
2023-04-07 13:23:55 -04:00
if ( this . selectedMoveIndex === - 1 ) {
2023-04-07 00:17:55 -04:00
this . selectedMoveIndex = this . moveCursor ;
2023-04-07 13:23:55 -04:00
this . setCursor ( this . moveCursor ) ;
} else {
2023-04-07 00:17:55 -04:00
if ( this . selectedMoveIndex !== this . moveCursor ) {
const tempMove = this . pokemon . moveset [ this . selectedMoveIndex ] ;
this . pokemon . moveset [ this . selectedMoveIndex ] = this . pokemon . moveset [ this . moveCursor ] ;
this . pokemon . moveset [ this . moveCursor ] = tempMove ;
2024-05-24 01:45:04 +02:00
2023-04-07 00:17:55 -04:00
const selectedMoveRow = this . moveRowsContainer . getAt ( this . selectedMoveIndex ) as Phaser . GameObjects . Container ;
const switchMoveRow = this . moveRowsContainer . getAt ( this . moveCursor ) as Phaser . GameObjects . Container ;
this . moveRowsContainer . moveTo ( selectedMoveRow , this . moveCursor ) ;
this . moveRowsContainer . moveTo ( switchMoveRow , this . selectedMoveIndex ) ;
selectedMoveRow . setY ( this . moveCursor * 16 ) ;
switchMoveRow . setY ( this . selectedMoveIndex * 16 ) ;
}
this . selectedMoveIndex = - 1 ;
if ( this . selectedMoveCursorObj ) {
this . selectedMoveCursorObj . destroy ( ) ;
this . selectedMoveCursorObj = null ;
}
}
}
2023-04-06 22:24:13 -04:00
success = true ;
2024-05-23 17:03:10 +02:00
} else if ( this . moveCursor === 4 ) {
2023-11-12 00:31:40 -05:00
return this . processInput ( Button . CANCEL ) ;
2024-05-23 17:03:10 +02:00
} else {
2023-11-12 00:31:40 -05:00
error = true ;
2024-05-23 17:03:10 +02:00
}
2023-04-11 00:24:55 -04:00
} else if ( button === Button . CANCEL ) {
2023-04-06 22:24:13 -04:00
this . hideMoveSelect ( ) ;
success = true ;
} else {
2023-04-11 00:24:55 -04:00
switch ( button ) {
2024-05-23 17:03:10 +02:00
case Button . UP :
success = this . setCursor ( this . moveCursor ? this . moveCursor - 1 : 4 ) ;
break ;
case Button . DOWN :
success = this . setCursor ( this . moveCursor < 4 ? this . moveCursor + 1 : 0 ) ;
break ;
case Button . LEFT :
this . moveSelect = false ;
2024-05-24 01:45:04 +02:00
this . setCursor ( Page . STATS ) ;
2024-05-24 02:19:20 +02:00
if ( this . summaryUiMode === SummaryUiMode . LEARN_MOVE ) {
2024-05-23 17:03:10 +02:00
this . hideMoveEffect ( ) ;
this . destroyBlinkCursor ( ) ;
success = true ;
2023-04-06 22:24:13 -04:00
break ;
2024-05-23 17:03:10 +02:00
} else {
this . hideMoveSelect ( ) ;
success = true ;
2023-04-06 22:24:13 -04:00
break ;
2024-05-23 17:03:10 +02:00
}
2023-04-06 22:24:13 -04:00
}
}
2023-04-06 11:30:22 -04:00
} else {
2023-04-11 00:24:55 -04:00
if ( button === Button . ACTION ) {
2023-04-06 22:24:13 -04:00
if ( this . cursor === Page . MOVES ) {
this . showMoveSelect ( ) ;
success = true ;
2024-05-23 17:03:10 +02:00
} else if ( this . cursor === Page . PROFILE && this . pokemon . hasPassive ( ) ) {
// if we're on the PROFILE page and this pokemon has a passive unlocked..
2024-05-24 01:45:04 +02:00
// Since abilities are displayed by default, all we need to do is toggle visibility on all elements to show passives
2024-05-12 22:38:28 -05:00
this . abilityContainer . nameText . setVisible ( ! this . abilityContainer . descriptionText . visible ) ;
this . abilityContainer . descriptionText . setVisible ( ! this . abilityContainer . descriptionText . visible ) ;
this . abilityContainer . labelImage . setVisible ( ! this . abilityContainer . labelImage . visible ) ;
this . passiveContainer . nameText . setVisible ( ! this . passiveContainer . descriptionText . visible ) ;
this . passiveContainer . descriptionText . setVisible ( ! this . passiveContainer . descriptionText . visible ) ;
this . passiveContainer . labelImage . setVisible ( ! this . passiveContainer . labelImage . visible ) ;
}
2023-04-11 00:24:55 -04:00
} else if ( button === Button . CANCEL ) {
2024-05-23 17:03:10 +02:00
if ( this . summaryUiMode === SummaryUiMode . LEARN_MOVE ) {
2024-04-27 15:52:21 -04:00
this . hideMoveSelect ( ) ;
2024-05-23 17:03:10 +02:00
} else {
2024-04-27 15:52:21 -04:00
ui . setMode ( Mode . PARTY ) ;
2024-05-23 17:03:10 +02:00
}
2023-04-06 22:24:13 -04:00
success = true ;
} else {
const pages = Utils . getEnumValues ( Page ) ;
2023-04-11 00:24:55 -04:00
switch ( button ) {
2024-05-23 17:03:10 +02:00
case Button . UP :
case Button . DOWN :
if ( this . summaryUiMode === SummaryUiMode . LEARN_MOVE ) {
2023-04-06 22:24:13 -04:00
break ;
2024-05-23 17:03:10 +02:00
}
const isDown = button === Button . DOWN ;
const party = this . scene . getParty ( ) ;
const partyMemberIndex = party . indexOf ( this . pokemon ) ;
if ( ( isDown && partyMemberIndex < party . length - 1 ) || ( ! isDown && partyMemberIndex ) ) {
const page = this . cursor ;
this . clear ( ) ;
this . show ( [ party [ partyMemberIndex + ( isDown ? 1 : - 1 ) ] , this . summaryUiMode , page ] ) ;
}
break ;
case Button . LEFT :
if ( this . cursor ) {
success = this . setCursor ( this . cursor - 1 ) ;
}
break ;
case Button . RIGHT :
if ( this . cursor < pages . length - 1 ) {
success = this . setCursor ( this . cursor + 1 ) ;
if ( this . summaryUiMode === SummaryUiMode . LEARN_MOVE && this . cursor === Page . MOVES ) {
this . moveSelect = true ;
2024-05-19 10:19:38 -07:00
}
2024-05-23 17:03:10 +02:00
}
break ;
2023-04-06 22:24:13 -04:00
}
2023-04-06 11:30:22 -04:00
}
2023-04-06 10:05:12 -04:00
}
2023-04-06 11:30:22 -04:00
2024-05-23 17:03:10 +02:00
if ( success ) {
2023-04-06 11:30:22 -04:00
ui . playSelect ( ) ;
2024-05-23 17:03:10 +02:00
} else if ( error ) {
2023-11-12 00:31:40 -05:00
ui . playError ( ) ;
2024-05-23 17:03:10 +02:00
}
2023-11-12 00:31:40 -05:00
return success || error ;
2023-04-05 08:35:15 -04:00
}
2024-04-24 23:18:23 -06:00
setCursor ( cursor : integer , overrideChanged : boolean = false ) : boolean {
2024-04-30 18:42:20 +02:00
let changed : boolean = overrideChanged || this . moveCursor !== cursor ;
2024-05-24 01:45:04 +02:00
2023-04-06 22:24:13 -04:00
if ( this . moveSelect ) {
2024-05-23 17:03:10 +02:00
this . moveCursor = cursor ;
2023-04-06 22:24:13 -04:00
2024-05-23 17:03:10 +02:00
const selectedMove = this . getSelectedMove ( ) ;
2023-04-07 00:17:55 -04:00
2024-05-23 17:03:10 +02:00
if ( selectedMove ) {
this . moveDescriptionText . setY ( 84 ) ;
this . movePowerText . setText ( selectedMove . power >= 0 ? selectedMove . power . toString ( ) : "---" ) ;
this . moveAccuracyText . setText ( selectedMove . accuracy >= 0 ? selectedMove . accuracy . toString ( ) : "---" ) ;
this . moveCategoryIcon . setFrame ( MoveCategory [ selectedMove . category ] . toLowerCase ( ) ) ;
this . showMoveEffect ( ) ;
} else {
this . hideMoveEffect ( ) ;
}
2023-04-08 20:35:45 -04:00
2024-05-23 17:03:10 +02:00
this . moveDescriptionText . setText ( selectedMove ? . effect || "" ) ;
const moveDescriptionLineCount = Math . floor ( this . moveDescriptionText . displayHeight / 14.83 ) ;
2023-04-07 13:23:55 -04:00
2024-05-23 17:03:10 +02:00
if ( this . descriptionScrollTween ) {
this . descriptionScrollTween . remove ( ) ;
this . descriptionScrollTween = null ;
}
2023-04-07 13:23:55 -04:00
2024-05-23 17:03:10 +02:00
if ( moveDescriptionLineCount > 3 ) {
this . descriptionScrollTween = this . scene . tweens . add ( {
targets : this.moveDescriptionText ,
delay : Utils.fixedInt ( 2000 ) ,
loop : - 1 ,
hold : Utils.fixedInt ( 2000 ) ,
duration : Utils.fixedInt ( ( moveDescriptionLineCount - 3 ) * 2000 ) ,
y : ` -= ${ 14.83 * ( moveDescriptionLineCount - 3 ) } `
} ) ;
}
2023-04-07 00:17:55 -04:00
if ( ! this . moveCursorObj ) {
2024-05-23 17:03:10 +02:00
this . moveCursorObj = this . scene . add . sprite ( - 2 , 0 , "summary_moves_cursor" , "highlight" ) ;
2023-04-07 00:17:55 -04:00
this . moveCursorObj . setOrigin ( 0 , 1 ) ;
this . movesContainer . add ( this . moveCursorObj ) ;
}
this . moveCursorObj . setY ( 16 * this . moveCursor + 1 ) ;
2024-05-23 17:03:10 +02:00
if ( this . moveCursorBlinkTimer ) {
2023-04-07 00:17:55 -04:00
this . moveCursorBlinkTimer . destroy ( ) ;
2024-05-23 17:03:10 +02:00
}
2023-04-07 13:23:55 -04:00
this . moveCursorObj . setVisible ( true ) ;
2023-04-07 00:17:55 -04:00
this . moveCursorBlinkTimer = this . scene . time . addEvent ( {
loop : true ,
2023-10-25 23:15:54 -04:00
delay : Utils.fixedInt ( 600 ) ,
2023-04-07 00:17:55 -04:00
callback : ( ) = > {
this . moveCursorObj . setVisible ( false ) ;
2023-10-25 23:15:54 -04:00
this . scene . time . delayedCall ( Utils . fixedInt ( 100 ) , ( ) = > {
2024-05-23 17:03:10 +02:00
if ( ! this . moveCursorObj ) {
2023-04-08 20:35:45 -04:00
return ;
2024-05-23 17:03:10 +02:00
}
2023-04-07 00:17:55 -04:00
this . moveCursorObj . setVisible ( true ) ;
} ) ;
2023-04-06 22:24:13 -04:00
}
2023-04-07 00:17:55 -04:00
} ) ;
if ( this . selectedMoveIndex > - 1 ) {
if ( ! this . selectedMoveCursorObj ) {
2024-05-23 17:03:10 +02:00
this . selectedMoveCursorObj = this . scene . add . sprite ( - 2 , 0 , "summary_moves_cursor" , "select" ) ;
2023-04-07 00:17:55 -04:00
this . selectedMoveCursorObj . setOrigin ( 0 , 1 ) ;
this . movesContainer . add ( this . selectedMoveCursorObj ) ;
this . movesContainer . moveBelow ( this . selectedMoveCursorObj , this . moveCursorObj ) ;
}
this . selectedMoveCursorObj . setY ( 16 * this . selectedMoveIndex + 1 ) ;
2023-04-06 22:24:13 -04:00
}
} else {
changed = this . cursor !== cursor ;
if ( changed ) {
const forward = this . cursor < cursor ;
this . cursor = cursor ;
2023-04-23 18:40:21 -04:00
this . tabSprite . setTexture ( ` summary_tabs_ ${ this . cursor + 1 } ` ) ;
2023-11-02 00:55:20 -04:00
this . getUi ( ) . hideTooltip ( ) ;
2023-04-06 22:24:13 -04:00
if ( this . summaryPageContainer . visible ) {
this . transitioning = true ;
this . populatePageContainer ( this . summaryPageTransitionContainer , forward ? cursor : cursor + 1 ) ;
2024-05-23 17:03:10 +02:00
if ( forward ) {
2023-04-06 22:24:13 -04:00
this . summaryPageTransitionContainer . x += 214 ;
2024-05-23 17:03:10 +02:00
} else {
2023-04-06 22:24:13 -04:00
this . populatePageContainer ( this . summaryPageContainer ) ;
2024-05-23 17:03:10 +02:00
}
2023-04-06 22:24:13 -04:00
this . scene . tweens . add ( {
targets : this.summaryPageTransitionContainer ,
2024-05-23 17:03:10 +02:00
x : forward ? "-=214" : "+=214" ,
2023-04-06 22:24:13 -04:00
duration : 250 ,
onComplete : ( ) = > {
2024-05-24 02:19:20 +02:00
if ( forward ) {
2024-05-24 01:45:04 +02:00
this . populatePageContainer ( this . summaryPageContainer ) ;
2024-05-19 10:19:38 -07:00
if ( this . cursor === Page . MOVES ) {
2024-05-24 01:45:04 +02:00
this . moveCursorObj = null ;
2024-04-30 18:42:20 +02:00
this . showMoveSelect ( ) ;
this . showMoveEffect ( ) ;
}
2024-05-23 17:03:10 +02:00
} else {
2023-04-06 22:24:13 -04:00
this . summaryPageTransitionContainer . x -= 214 ;
2024-05-23 17:03:10 +02:00
}
2023-04-06 22:24:13 -04:00
this . summaryPageTransitionContainer . setVisible ( false ) ;
this . transitioning = false ;
}
} ) ;
this . summaryPageTransitionContainer . setVisible ( true ) ;
} else {
2023-04-06 11:30:22 -04:00
this . populatePageContainer ( this . summaryPageContainer ) ;
2023-04-06 22:24:13 -04:00
this . summaryPageContainer . setVisible ( true ) ;
}
2023-04-06 11:30:22 -04:00
}
2023-04-05 08:35:15 -04:00
}
return changed ;
}
2023-04-06 11:30:22 -04:00
populatePageContainer ( pageContainer : Phaser.GameObjects.Container , page? : Page ) {
2024-05-23 17:03:10 +02:00
if ( page === undefined ) {
2023-04-06 11:30:22 -04:00
page = this . cursor ;
2024-05-23 17:03:10 +02:00
}
2023-04-06 11:30:22 -04:00
2023-04-06 22:24:13 -04:00
if ( pageContainer . getAll ( ) . length > 1 ) {
2023-04-23 16:36:03 -04:00
pageContainer . each ( ( o : Phaser.GameObjects.GameObject ) = > {
2024-05-23 17:03:10 +02:00
if ( o instanceof Phaser . GameObjects . Container ) {
2023-04-23 16:36:03 -04:00
o . removeAll ( true ) ;
2024-05-23 17:03:10 +02:00
}
2023-04-23 16:36:03 -04:00
} ) ;
2023-04-06 11:30:22 -04:00
pageContainer . removeBetween ( 1 , undefined , true ) ;
2023-04-06 22:24:13 -04:00
}
const pageBg = ( pageContainer . getAt ( 0 ) as Phaser . GameObjects . Sprite ) ;
pageBg . setTexture ( this . getPageKey ( page ) ) ;
2023-12-11 11:09:58 -05:00
if ( this . descriptionScrollTween ) {
this . descriptionScrollTween . remove ( ) ;
this . descriptionScrollTween = null ;
}
2024-05-24 01:45:04 +02:00
2023-04-06 11:30:22 -04:00
switch ( page ) {
2024-05-23 17:03:10 +02:00
case Page . PROFILE :
const profileContainer = this . scene . add . container ( 0 , - pageBg . height ) ;
pageContainer . add ( profileContainer ) ;
const trainerLabel = addTextObject ( this . scene , 7 , 12 , "OT/" , TextStyle . SUMMARY_ALT ) ;
trainerLabel . setOrigin ( 0 , 0 ) ;
profileContainer . add ( trainerLabel ) ;
const trainerText = addTextObject ( this . scene , 25 , 12 , loggedInUser ? . username || "Unknown" ,
this . scene . gameData . gender === PlayerGender . FEMALE ? TextStyle.SUMMARY_PINK : TextStyle.SUMMARY_BLUE ) ;
trainerText . setOrigin ( 0 , 0 ) ;
profileContainer . add ( trainerText ) ;
const trainerIdText = addTextObject ( this . scene , 174 , 12 , this . scene . gameData . trainerId . toString ( ) , TextStyle . SUMMARY_ALT ) ;
trainerIdText . setOrigin ( 0 , 0 ) ;
profileContainer . add ( trainerIdText ) ;
const typeLabel = addTextObject ( this . scene , 7 , 28 , "Type/" , TextStyle . WINDOW_ALT ) ;
typeLabel . setOrigin ( 0 , 0 ) ;
profileContainer . add ( typeLabel ) ;
const getTypeIcon = ( index : integer , type : Type , tera : boolean = false ) = > {
const xCoord = 39 + 34 * index ;
const typeIcon = ! tera
2024-05-27 10:39:18 +02:00
? this . scene . add . sprite ( xCoord , 42 , ` types ${ Utils . verifyLang ( i18next . language ) ? ` _ ${ i18next . language } ` : "" } ` , Type [ type ] . toLowerCase ( ) ) : this . scene . add . sprite ( xCoord , 42 , "type_tera" ) ;
2024-05-23 17:03:10 +02:00
if ( tera ) {
typeIcon . setScale ( 0.5 ) ;
const typeRgb = getTypeRgb ( type ) ;
typeIcon . setTint ( Phaser . Display . Color . GetColor ( typeRgb [ 0 ] , typeRgb [ 1 ] , typeRgb [ 2 ] ) ) ;
2024-04-26 17:32:28 -04:00
}
2024-05-23 17:03:10 +02:00
typeIcon . setOrigin ( 0 , 1 ) ;
return typeIcon ;
} ;
const types = this . pokemon . getTypes ( false , false , true ) ;
profileContainer . add ( getTypeIcon ( 0 , types [ 0 ] ) ) ;
if ( types . length > 1 ) {
profileContainer . add ( getTypeIcon ( 1 , types [ 1 ] ) ) ;
}
if ( this . pokemon . isTerastallized ( ) ) {
profileContainer . add ( getTypeIcon ( types . length , this . pokemon . getTeraType ( ) , true ) ) ;
}
2024-04-26 17:32:28 -04:00
2024-05-23 17:03:10 +02:00
if ( this . pokemon . getLuck ( ) ) {
const luckLabelText = addTextObject ( this . scene , 141 , 28 , "Luck:" , TextStyle . SUMMARY_ALT ) ;
luckLabelText . setOrigin ( 0 , 0 ) ;
profileContainer . add ( luckLabelText ) ;
2024-05-24 01:45:04 +02:00
2024-05-23 17:03:10 +02:00
const luckText = addTextObject ( this . scene , 141 + luckLabelText . displayWidth + 2 , 28 , this . pokemon . getLuck ( ) . toString ( ) , TextStyle . SUMMARY ) ;
luckText . setOrigin ( 0 , 0 ) ;
luckText . setTint ( getVariantTint ( ( Math . min ( this . pokemon . getLuck ( ) - 1 , 2 ) ) as Variant ) ) ;
profileContainer . add ( luckText ) ;
}
this . abilityContainer = {
labelImage : this.scene.add.image ( 0 , 0 , "summary_profile_ability" ) ,
2024-05-24 01:45:04 +02:00
ability : this.pokemon.getAbility ( true ) ,
nameText : null ,
2024-05-23 17:03:10 +02:00
descriptionText : null } ;
2024-05-24 01:45:04 +02:00
2024-05-23 17:03:10 +02:00
const allAbilityInfo = [ this . abilityContainer ] ; // Creates an array to iterate through
// Only add to the array and set up displaying a passive if it's unlocked
if ( this . pokemon . hasPassive ( ) ) {
this . passiveContainer = {
labelImage : this.scene.add.image ( 0 , 0 , "summary_profile_passive" ) ,
2024-05-24 01:45:04 +02:00
ability : this.pokemon.getPassiveAbility ( ) ,
nameText : null ,
descriptionText : null } ;
2024-05-23 17:03:10 +02:00
allAbilityInfo . push ( this . passiveContainer ) ;
// Sets up the pixel button prompt image
this . abilityPrompt = this . scene . add . image ( 0 , 0 , ! this . scene . gamepadSupport ? "summary_profile_prompt_z" : "summary_profile_prompt_a" ) ;
this . abilityPrompt . setPosition ( 8 , 43 ) ;
this . abilityPrompt . setVisible ( true ) ;
this . abilityPrompt . setOrigin ( 0 , 0 ) ;
profileContainer . add ( this . abilityPrompt ) ;
}
2024-01-05 11:29:34 -05:00
2024-05-24 01:45:04 +02:00
allAbilityInfo . forEach ( abilityInfo = > {
2024-05-23 17:03:10 +02:00
abilityInfo . labelImage . setPosition ( 17 , 43 ) ;
abilityInfo . labelImage . setVisible ( true ) ;
abilityInfo . labelImage . setOrigin ( 0 , 0 ) ;
profileContainer . add ( abilityInfo . labelImage ) ;
2024-05-12 22:38:28 -05:00
2024-05-23 17:03:10 +02:00
abilityInfo . nameText = addTextObject ( this . scene , 7 , 66 , abilityInfo . ability . name , TextStyle . SUMMARY_ALT ) ;
abilityInfo . nameText . setOrigin ( 0 , 1 ) ;
profileContainer . add ( abilityInfo . nameText ) ;
abilityInfo . descriptionText = addTextObject ( this . scene , 7 , 69 , abilityInfo . ability . description , TextStyle . WINDOW_ALT , { wordWrap : { width : 1224 } } ) ;
abilityInfo . descriptionText . setOrigin ( 0 , 0 ) ;
profileContainer . add ( abilityInfo . descriptionText ) ;
// Sets up the mask that hides the description text to give an illusion of scrolling
const descriptionTextMaskRect = this . scene . make . graphics ( { } ) ;
descriptionTextMaskRect . setScale ( 6 ) ;
descriptionTextMaskRect . fillStyle ( 0xFFFFFF ) ;
descriptionTextMaskRect . beginPath ( ) ;
descriptionTextMaskRect . fillRect ( 110 , 90.5 , 206 , 31 ) ;
const abilityDescriptionTextMask = descriptionTextMaskRect . createGeometryMask ( ) ;
abilityInfo . descriptionText . setMask ( abilityDescriptionTextMask ) ;
const abilityDescriptionLineCount = Math . floor ( abilityInfo . descriptionText . displayHeight / 14.83 ) ;
// Animates the description text moving upwards
if ( abilityDescriptionLineCount > 2 ) {
abilityInfo . descriptionText . setY ( 69 ) ;
this . descriptionScrollTween = this . scene . tweens . add ( {
targets : abilityInfo.descriptionText ,
delay : Utils.fixedInt ( 2000 ) ,
loop : - 1 ,
hold : Utils.fixedInt ( 2000 ) ,
duration : Utils.fixedInt ( ( abilityDescriptionLineCount - 2 ) * 2000 ) ,
y : ` -= ${ 14.83 * ( abilityDescriptionLineCount - 2 ) } `
} ) ;
}
} ) ;
// Turn off visibility of passive info by default
this . passiveContainer ? . labelImage . setVisible ( false ) ;
this . passiveContainer ? . nameText . setVisible ( false ) ;
this . passiveContainer ? . descriptionText . setVisible ( false ) ;
const memoString = ` ${ getBBCodeFrag ( Utils . toReadableString ( Nature [ this . pokemon . getNature ( ) ] ) , TextStyle . SUMMARY_RED ) } ${ getBBCodeFrag ( " nature," , TextStyle . WINDOW_ALT ) } \ n ${ getBBCodeFrag ( ` ${ this . pokemon . metBiome === - 1 ? "apparently " : "" } met at Lv ` , TextStyle . WINDOW_ALT ) } ${ getBBCodeFrag ( this . pokemon . metLevel . toString ( ) , TextStyle . SUMMARY_RED ) } ${ getBBCodeFrag ( "," , TextStyle . WINDOW_ALT ) } \ n ${ getBBCodeFrag ( getBiomeName ( this . pokemon . metBiome ) , TextStyle . SUMMARY_RED ) } ${ getBBCodeFrag ( "." , TextStyle . WINDOW_ALT ) } ` ;
2024-05-24 01:45:04 +02:00
2024-05-23 17:03:10 +02:00
const memoText = addBBCodeTextObject ( this . scene , 7 , 113 , memoString , TextStyle . WINDOW_ALT ) ;
memoText . setOrigin ( 0 , 0 ) ;
profileContainer . add ( memoText ) ;
break ;
case Page . STATS :
const statsContainer = this . scene . add . container ( 0 , - pageBg . height ) ;
pageContainer . add ( statsContainer ) ;
const stats = Utils . getEnumValues ( Stat ) as Stat [ ] ;
stats . forEach ( ( stat , s ) = > {
const statName = stat !== Stat . HP
? getStatName ( stat )
: "HP" ;
const rowIndex = s % 3 ;
const colIndex = Math . floor ( s / 3 ) ;
const natureStatMultiplier = getNatureStatMultiplier ( this . pokemon . getNature ( ) , s ) ;
const statLabel = addTextObject ( this . scene , 27 + 115 * colIndex + ( colIndex === 1 ? 5 : 0 ) , 56 + 16 * rowIndex , statName , natureStatMultiplier === 1 ? TextStyle.SUMMARY : natureStatMultiplier > 1 ? TextStyle.SUMMARY_PINK : TextStyle.SUMMARY_BLUE ) ;
statLabel . setOrigin ( 0.5 , 0 ) ;
statsContainer . add ( statLabel ) ;
const statValueText = stat !== Stat . HP
? Utils . formatStat ( this . pokemon . stats [ s ] )
: ` ${ Utils . formatStat ( this . pokemon . hp , true ) } / ${ Utils . formatStat ( this . pokemon . getMaxHp ( ) , true ) } ` ;
const statValue = addTextObject ( this . scene , 120 + 88 * colIndex , 56 + 16 * rowIndex , statValueText , TextStyle . WINDOW_ALT ) ;
statValue . setOrigin ( 1 , 0 ) ;
statsContainer . add ( statValue ) ;
} ) ;
2023-04-23 16:36:03 -04:00
2024-05-23 17:03:10 +02:00
const itemModifiers = this . scene . findModifiers ( m = > m instanceof PokemonHeldItemModifier
2023-04-23 18:40:21 -04:00
&& ( m as PokemonHeldItemModifier ) . pokemonId === this . pokemon . id , true ) as PokemonHeldItemModifier [ ] ;
2024-05-24 01:45:04 +02:00
2024-05-23 17:03:10 +02:00
itemModifiers . forEach ( ( item , i ) = > {
const icon = item . getIcon ( this . scene , true ) ;
2023-04-23 18:40:21 -04:00
2024-05-23 17:03:10 +02:00
icon . setPosition ( ( i % 17 ) * 12 + 3 , 14 * Math . floor ( i / 17 ) + 15 ) ;
statsContainer . add ( icon ) ;
2024-05-24 01:45:04 +02:00
2024-05-23 17:03:10 +02:00
icon . setInteractive ( new Phaser . Geom . Rectangle ( 0 , 0 , 32 , 32 ) , Phaser . Geom . Rectangle . Contains ) ;
icon . on ( "pointerover" , ( ) = > ( this . scene as BattleScene ) . ui . showTooltip ( item . type . name , item . type . getDescription ( this . scene ) , true ) ) ;
icon . on ( "pointerout" , ( ) = > ( this . scene as BattleScene ) . ui . hideTooltip ( ) ) ;
} ) ;
2023-04-23 18:40:21 -04:00
2024-05-23 17:03:10 +02:00
const relLvExp = getLevelRelExp ( this . pokemon . level + 1 , this . pokemon . species . growthRate ) ;
const expRatio = this . pokemon . level < this . scene . getMaxExpLevel ( ) ? this . pokemon . levelExp / relLvExp : 0 ;
2023-04-23 16:36:03 -04:00
2024-05-23 17:03:10 +02:00
const expLabel = addTextObject ( this . scene , 6 , 112 , "EXP. Points" , TextStyle . SUMMARY ) ;
expLabel . setOrigin ( 0 , 0 ) ;
statsContainer . add ( expLabel ) ;
2023-04-23 16:36:03 -04:00
2024-05-23 17:03:10 +02:00
const nextLvExpLabel = addTextObject ( this . scene , 6 , 128 , "Next Lv." , TextStyle . SUMMARY ) ;
nextLvExpLabel . setOrigin ( 0 , 0 ) ;
statsContainer . add ( nextLvExpLabel ) ;
2023-04-23 16:36:03 -04:00
2024-05-23 17:03:10 +02:00
const expText = addTextObject ( this . scene , 208 , 112 , this . pokemon . exp . toString ( ) , TextStyle . WINDOW_ALT ) ;
expText . setOrigin ( 1 , 0 ) ;
statsContainer . add ( expText ) ;
2023-04-23 16:36:03 -04:00
2024-05-23 17:03:10 +02:00
const nextLvExp = this . pokemon . level < this . scene . getMaxExpLevel ( )
? getLevelTotalExp ( this . pokemon . level + 1 , this . pokemon . species . growthRate ) - this . pokemon . exp
: 0 ;
const nextLvExpText = addTextObject ( this . scene , 208 , 128 , nextLvExp . toString ( ) , TextStyle . WINDOW_ALT ) ;
nextLvExpText . setOrigin ( 1 , 0 ) ;
statsContainer . add ( nextLvExpText ) ;
2023-04-23 16:36:03 -04:00
2024-05-23 17:03:10 +02:00
const expOverlay = this . scene . add . image ( 140 , 145 , "summary_stats_overlay_exp" ) ;
expOverlay . setOrigin ( 0 , 0 ) ;
statsContainer . add ( expOverlay ) ;
2023-04-23 16:36:03 -04:00
2024-05-23 17:03:10 +02:00
const expMaskRect = this . scene . make . graphics ( { } ) ;
expMaskRect . setScale ( 6 ) ;
expMaskRect . fillStyle ( 0xFFFFFF ) ;
expMaskRect . beginPath ( ) ;
expMaskRect . fillRect ( 140 + pageContainer . x , 145 + pageContainer . y + 21 , Math . floor ( expRatio * 64 ) , 3 ) ;
2023-04-23 16:36:03 -04:00
2024-05-23 17:03:10 +02:00
const expMask = expMaskRect . createGeometryMask ( ) ;
2023-04-23 16:36:03 -04:00
2024-05-23 17:03:10 +02:00
expOverlay . setMask ( expMask ) ;
break ;
case Page . MOVES :
this . movesContainer = this . scene . add . container ( 5 , - pageBg . height + 26 ) ;
pageContainer . add ( this . movesContainer ) ;
2023-04-06 22:24:13 -04:00
2024-05-23 17:03:10 +02:00
this . extraMoveRowContainer = this . scene . add . container ( 0 , 64 ) ;
this . extraMoveRowContainer . setVisible ( false ) ;
this . movesContainer . add ( this . extraMoveRowContainer ) ;
const extraRowOverlay = this . scene . add . image ( - 2 , 1 , "summary_moves_overlay_row" ) ;
extraRowOverlay . setOrigin ( 0 , 1 ) ;
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_PINK : TextStyle.SUMMARY ) ;
extraRowText . setOrigin ( 0 , 1 ) ;
this . extraMoveRowContainer . add ( extraRowText ) ;
if ( this . summaryUiMode === SummaryUiMode . LEARN_MOVE ) {
this . extraMoveRowContainer . setVisible ( true ) ;
const newMoveTypeIcon = this . scene . add . sprite ( 0 , 0 , "types" , Type [ this . newMove . type ] . toLowerCase ( ) ) ;
newMoveTypeIcon . setOrigin ( 0 , 1 ) ;
this . extraMoveRowContainer . add ( newMoveTypeIcon ) ;
const ppOverlay = this . scene . add . image ( 163 , - 1 , "summary_moves_overlay_pp" ) ;
ppOverlay . setOrigin ( 0 , 1 ) ;
this . extraMoveRowContainer . add ( ppOverlay ) ;
const pp = Utils . padInt ( this . newMove . pp , 2 , " " ) ;
const ppText = addTextObject ( this . scene , 173 , 1 , ` ${ pp } / ${ pp } ` , TextStyle . WINDOW ) ;
ppText . setOrigin ( 0 , 1 ) ;
this . extraMoveRowContainer . add ( ppText ) ;
}
2023-04-06 22:24:13 -04:00
2024-05-23 17:03:10 +02:00
this . moveRowsContainer = this . scene . add . container ( 0 , 0 ) ;
this . movesContainer . add ( this . moveRowsContainer ) ;
2023-04-06 22:24:13 -04:00
2024-05-23 17:03:10 +02:00
for ( let m = 0 ; m < 4 ; m ++ ) {
const move = m < this . pokemon . moveset . length ? this . pokemon . moveset [ m ] : null ;
const moveRowContainer = this . scene . add . container ( 0 , 16 * m ) ;
this . moveRowsContainer . add ( moveRowContainer ) ;
2023-04-06 22:24:13 -04:00
2024-05-23 17:03:10 +02:00
if ( move ) {
2024-05-27 10:39:18 +02:00
const typeIcon = this . scene . add . sprite ( 0 , 0 , ` types ${ Utils . verifyLang ( i18next . language ) ? ` _ ${ i18next . language } ` : "" } ` , Type [ move . getMove ( ) . type ] . toLowerCase ( ) ) ; typeIcon . setOrigin ( 0 , 1 ) ;
2024-05-23 17:03:10 +02:00
moveRowContainer . add ( typeIcon ) ;
2023-04-10 13:54:06 -04:00
}
2024-05-23 17:03:10 +02:00
const moveText = addTextObject ( this . scene , 35 , 0 , move ? move . getName ( ) : "-" , TextStyle . SUMMARY ) ;
moveText . setOrigin ( 0 , 1 ) ;
moveRowContainer . add ( moveText ) ;
2023-04-23 15:13:21 -04:00
2024-05-23 17:03:10 +02:00
const ppOverlay = this . scene . add . image ( 163 , - 1 , "summary_moves_overlay_pp" ) ;
ppOverlay . setOrigin ( 0 , 1 ) ;
moveRowContainer . add ( ppOverlay ) ;
2023-04-23 15:13:21 -04:00
2024-05-23 17:03:10 +02:00
const ppText = addTextObject ( this . scene , 173 , 1 , "--/--" , TextStyle . WINDOW ) ;
ppText . setOrigin ( 0 , 1 ) ;
2023-04-23 15:13:21 -04:00
2024-05-23 17:03:10 +02:00
if ( move ) {
const maxPP = move . getMovePp ( ) ;
const pp = maxPP - move . ppUsed ;
ppText . setText ( ` ${ Utils . padInt ( pp , 2 , " " ) } / ${ Utils . padInt ( maxPP , 2 , " " ) } ` ) ;
2023-04-06 22:24:13 -04:00
}
2023-04-07 00:17:55 -04:00
2024-05-23 17:03:10 +02:00
moveRowContainer . add ( ppText ) ;
}
this . moveDescriptionText = addTextObject ( this . scene , 2 , 84 , "" , TextStyle . WINDOW_ALT , { wordWrap : { width : 1212 } } ) ;
this . movesContainer . add ( this . moveDescriptionText ) ;
2023-04-07 00:17:55 -04:00
2024-05-23 17:03:10 +02:00
const moveDescriptionTextMaskRect = this . scene . make . graphics ( { } ) ;
moveDescriptionTextMaskRect . setScale ( 6 ) ;
moveDescriptionTextMaskRect . fillStyle ( 0xFFFFFF ) ;
moveDescriptionTextMaskRect . beginPath ( ) ;
moveDescriptionTextMaskRect . fillRect ( 112 , 130 , 202 , 46 ) ;
2023-04-07 00:17:55 -04:00
2024-05-23 17:03:10 +02:00
const moveDescriptionTextMask = moveDescriptionTextMaskRect . createGeometryMask ( ) ;
2023-04-07 00:17:55 -04:00
2024-05-23 17:03:10 +02:00
this . moveDescriptionText . setMask ( moveDescriptionTextMask ) ;
break ;
2023-04-06 11:30:22 -04:00
}
}
2023-10-25 14:15:44 -04:00
showStatus ( instant? : boolean ) {
2024-05-23 17:03:10 +02:00
if ( this . statusVisible ) {
2023-10-25 14:15:44 -04:00
return ;
2024-05-23 17:03:10 +02:00
}
2023-10-25 14:15:44 -04:00
this . statusVisible = true ;
this . scene . tweens . add ( {
targets : this.statusContainer ,
x : 0 ,
duration : instant ? 0 : 250 ,
2024-05-23 17:03:10 +02:00
ease : "Sine.easeOut"
2023-10-25 14:15:44 -04:00
} ) ;
}
hideStatus ( instant? : boolean ) {
2024-05-23 17:03:10 +02:00
if ( ! this . statusVisible ) {
2023-10-25 14:15:44 -04:00
return ;
2024-05-23 17:03:10 +02:00
}
2023-10-25 14:15:44 -04:00
this . statusVisible = false ;
this . scene . tweens . add ( {
targets : this.statusContainer ,
x : - 106 ,
duration : instant ? 0 : 250 ,
2024-05-23 17:03:10 +02:00
ease : "Sine.easeIn"
2023-10-25 14:15:44 -04:00
} ) ;
}
2023-04-07 00:17:55 -04:00
getSelectedMove ( ) : Move {
2024-05-23 17:03:10 +02:00
if ( this . cursor !== Page . MOVES ) {
2023-04-07 00:17:55 -04:00
return null ;
2024-05-23 17:03:10 +02:00
}
2023-04-07 00:17:55 -04:00
2024-05-23 17:03:10 +02:00
if ( this . moveCursor < 4 && this . moveCursor < this . pokemon . moveset . length ) {
2023-04-07 00:17:55 -04:00
return this . pokemon . moveset [ this . moveCursor ] . getMove ( ) ;
2024-05-23 17:03:10 +02:00
} else if ( this . summaryUiMode === SummaryUiMode . LEARN_MOVE && this . moveCursor === 4 ) {
2023-04-07 00:17:55 -04:00
return this . newMove ;
2024-05-23 17:03:10 +02:00
}
2023-04-07 00:17:55 -04:00
return null ;
}
2023-04-06 22:24:13 -04:00
showMoveSelect() {
this . moveSelect = true ;
2023-04-07 00:17:55 -04:00
this . extraMoveRowContainer . setVisible ( true ) ;
this . selectedMoveIndex = - 1 ;
2023-04-06 22:24:13 -04:00
this . setCursor ( 0 ) ;
2023-04-08 20:35:45 -04:00
this . showMoveEffect ( ) ;
2023-04-06 22:24:13 -04:00
}
hideMoveSelect() {
if ( this . summaryUiMode === SummaryUiMode . LEARN_MOVE ) {
this . moveSelectFunction ( 4 ) ;
return ;
}
this . moveSelect = false ;
2023-04-07 00:17:55 -04:00
this . extraMoveRowContainer . setVisible ( false ) ;
2024-05-23 17:03:10 +02:00
this . moveDescriptionText . setText ( "" ) ;
2024-05-24 01:45:04 +02:00
2024-04-30 18:42:20 +02:00
this . destroyBlinkCursor ( ) ;
this . hideMoveEffect ( ) ;
}
2024-05-24 02:19:20 +02:00
destroyBlinkCursor() {
2023-04-07 00:17:55 -04:00
if ( this . moveCursorBlinkTimer ) {
this . moveCursorBlinkTimer . destroy ( ) ;
this . moveCursorBlinkTimer = null ;
}
if ( this . moveCursorObj ) {
this . moveCursorObj . destroy ( ) ;
this . moveCursorObj = null ;
}
if ( this . selectedMoveCursorObj ) {
this . selectedMoveCursorObj . destroy ( ) ;
this . selectedMoveCursorObj = null ;
}
2023-04-08 20:35:45 -04:00
}
showMoveEffect ( instant? : boolean ) {
2024-05-23 17:03:10 +02:00
if ( this . moveEffectsVisible ) {
2023-04-08 20:35:45 -04:00
return ;
2024-05-23 17:03:10 +02:00
}
2023-04-08 20:35:45 -04:00
this . moveEffectsVisible = true ;
this . scene . tweens . add ( {
targets : this.moveEffectContainer ,
x : 6 ,
duration : instant ? 0 : 250 ,
2024-05-23 17:03:10 +02:00
ease : "Sine.easeOut"
2023-04-08 20:35:45 -04:00
} ) ;
}
hideMoveEffect ( instant? : boolean ) {
2024-05-23 17:03:10 +02:00
if ( ! this . moveEffectsVisible ) {
2023-04-08 20:35:45 -04:00
return ;
2024-05-23 17:03:10 +02:00
}
2023-04-08 20:35:45 -04:00
this . moveEffectsVisible = false ;
this . scene . tweens . add ( {
targets : this.moveEffectContainer ,
x : 106 ,
duration : instant ? 0 : 250 ,
2024-05-23 17:03:10 +02:00
ease : "Sine.easeIn"
2023-04-08 20:35:45 -04:00
} ) ;
2023-04-06 22:24:13 -04:00
}
2023-04-05 08:35:15 -04:00
clear() {
super . clear ( ) ;
2023-04-06 22:24:13 -04:00
this . pokemon = null ;
2023-04-06 11:30:22 -04:00
this . cursor = - 1 ;
2023-04-06 22:24:13 -04:00
this . newMove = null ;
2023-04-10 13:54:06 -04:00
if ( this . moveSelect ) {
this . moveSelect = false ;
this . moveSelectFunction = null ;
this . extraMoveRowContainer . setVisible ( false ) ;
if ( this . moveCursorBlinkTimer ) {
this . moveCursorBlinkTimer . destroy ( ) ;
this . moveCursorBlinkTimer = null ;
}
if ( this . moveCursorObj ) {
this . moveCursorObj . destroy ( ) ;
this . moveCursorObj = null ;
}
if ( this . selectedMoveCursorObj ) {
this . selectedMoveCursorObj . destroy ( ) ;
this . selectedMoveCursorObj = null ;
}
this . hideMoveEffect ( true ) ;
}
2023-04-05 08:35:15 -04:00
this . summaryContainer . setVisible ( false ) ;
2023-04-06 11:30:22 -04:00
this . summaryPageContainer . setVisible ( false ) ;
2023-04-05 08:35:15 -04:00
}
}