mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-18 13:29:25 +02:00
Partially fixed some private property issues
Left some mocks alone because IDFK what they mean
This commit is contained in:
parent
618a4b5fc3
commit
d06eb1bcc7
@ -10,19 +10,12 @@ export class CommonAnimPhase extends PokemonPhase {
|
|||||||
public readonly phaseName: "CommonAnimPhase" | "PokemonHealPhase" | "WeatherEffectPhase" = "CommonAnimPhase";
|
public readonly phaseName: "CommonAnimPhase" | "PokemonHealPhase" | "WeatherEffectPhase" = "CommonAnimPhase";
|
||||||
private anim: CommonAnim | null;
|
private anim: CommonAnim | null;
|
||||||
private targetIndex?: BattlerIndex;
|
private targetIndex?: BattlerIndex;
|
||||||
private playOnEmptyField: boolean;
|
|
||||||
|
|
||||||
constructor(
|
constructor(battlerIndex?: BattlerIndex, targetIndex?: BattlerIndex, anim: CommonAnim | null = null) {
|
||||||
battlerIndex?: BattlerIndex,
|
|
||||||
targetIndex?: BattlerIndex,
|
|
||||||
anim: CommonAnim | null = null,
|
|
||||||
playOnEmptyField = false,
|
|
||||||
) {
|
|
||||||
super(battlerIndex);
|
super(battlerIndex);
|
||||||
|
|
||||||
this.anim = anim;
|
this.anim = anim;
|
||||||
this.targetIndex = targetIndex;
|
this.targetIndex = targetIndex;
|
||||||
this.playOnEmptyField = playOnEmptyField;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setAnimation(anim: CommonAnim) {
|
setAnimation(anim: CommonAnim) {
|
||||||
|
@ -17,8 +17,6 @@ export class AdminUiHandler extends FormModalUiHandler {
|
|||||||
private config: ModalConfig;
|
private config: ModalConfig;
|
||||||
|
|
||||||
private readonly buttonGap = 10;
|
private readonly buttonGap = 10;
|
||||||
// http response from the server when a username isn't found in the server
|
|
||||||
private readonly httpUserNotFoundErrorCode: number = 404;
|
|
||||||
private readonly ERR_REQUIRED_FIELD = (field: string) => {
|
private readonly ERR_REQUIRED_FIELD = (field: string) => {
|
||||||
if (field === "username") {
|
if (field === "username") {
|
||||||
return `${toTitleCase(field)} is required`;
|
return `${toTitleCase(field)} is required`;
|
||||||
|
@ -24,14 +24,12 @@ export class FilterText extends Phaser.GameObjects.Container {
|
|||||||
private rows: FilterTextRow[] = [];
|
private rows: FilterTextRow[] = [];
|
||||||
public cursorObj: Phaser.GameObjects.Image;
|
public cursorObj: Phaser.GameObjects.Image;
|
||||||
public numFilters = 0;
|
public numFilters = 0;
|
||||||
private lastCursor = -1;
|
|
||||||
private uiTheme: UiTheme;
|
private uiTheme: UiTheme;
|
||||||
|
|
||||||
private menuMessageBoxContainer: Phaser.GameObjects.Container;
|
private menuMessageBoxContainer: Phaser.GameObjects.Container;
|
||||||
private dialogueMessageBox: Phaser.GameObjects.NineSlice;
|
private dialogueMessageBox: Phaser.GameObjects.NineSlice;
|
||||||
message: any;
|
message: any;
|
||||||
private readonly textPadding = 8;
|
private readonly textPadding = 8;
|
||||||
private readonly defaultWordWrapWidth = 1224;
|
|
||||||
|
|
||||||
private onChange: () => void;
|
private onChange: () => void;
|
||||||
|
|
||||||
@ -158,7 +156,6 @@ export class FilterText extends Phaser.GameObjects.Container {
|
|||||||
const cursorOffset = 8;
|
const cursorOffset = 8;
|
||||||
|
|
||||||
this.cursorObj.setPosition(cursorOffset, this.labels[cursor].y + 3);
|
this.cursorObj.setPosition(cursorOffset, this.labels[cursor].y + 3);
|
||||||
this.lastCursor = cursor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,8 +41,6 @@ const GLOBAL_SCALE = 6;
|
|||||||
export class MoveInfoOverlay extends Phaser.GameObjects.Container implements InfoToggle {
|
export class MoveInfoOverlay extends Phaser.GameObjects.Container implements InfoToggle {
|
||||||
public active = false;
|
public active = false;
|
||||||
|
|
||||||
private move: Move;
|
|
||||||
|
|
||||||
private desc: Phaser.GameObjects.Text;
|
private desc: Phaser.GameObjects.Text;
|
||||||
private descScroll: Phaser.Tweens.Tween | null = null;
|
private descScroll: Phaser.Tweens.Tween | null = null;
|
||||||
|
|
||||||
@ -177,7 +175,6 @@ export class MoveInfoOverlay extends Phaser.GameObjects.Container implements Inf
|
|||||||
if (!globalScene.enableMoveInfo) {
|
if (!globalScene.enableMoveInfo) {
|
||||||
return false; // move infos have been disabled // TODO:: is `false` correct? i used to be `undeefined`
|
return false; // move infos have been disabled // TODO:: is `false` correct? i used to be `undeefined`
|
||||||
}
|
}
|
||||||
this.move = move;
|
|
||||||
this.pow.setText(move.power >= 0 ? move.power.toString() : "---");
|
this.pow.setText(move.power >= 0 ? move.power.toString() : "---");
|
||||||
this.acc.setText(move.accuracy >= 0 ? move.accuracy.toString() : "---");
|
this.acc.setText(move.accuracy >= 0 ? move.accuracy.toString() : "---");
|
||||||
this.pp.setText(move.pp >= 0 ? move.pp.toString() : "---");
|
this.pp.setText(move.pp >= 0 ? move.pp.toString() : "---");
|
||||||
|
@ -259,8 +259,6 @@ export class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
private instructionRowX = 0;
|
private instructionRowX = 0;
|
||||||
private instructionRowY = 0;
|
private instructionRowY = 0;
|
||||||
private instructionRowTextOffset = 9;
|
private instructionRowTextOffset = 9;
|
||||||
private filterInstructionRowX = 0;
|
|
||||||
private filterInstructionRowY = 0;
|
|
||||||
|
|
||||||
private starterAttributes: StarterAttributes;
|
private starterAttributes: StarterAttributes;
|
||||||
private savedStarterAttributes: StarterAttributes;
|
private savedStarterAttributes: StarterAttributes;
|
||||||
@ -2200,8 +2198,6 @@ export class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
updateInstructions(): void {
|
updateInstructions(): void {
|
||||||
this.instructionRowX = 0;
|
this.instructionRowX = 0;
|
||||||
this.instructionRowY = 0;
|
this.instructionRowY = 0;
|
||||||
this.filterInstructionRowX = 0;
|
|
||||||
this.filterInstructionRowY = 0;
|
|
||||||
this.hideInstructions();
|
this.hideInstructions();
|
||||||
this.instructionsContainer.removeAll();
|
this.instructionsContainer.removeAll();
|
||||||
this.filterInstructionsContainer.removeAll();
|
this.filterInstructionsContainer.removeAll();
|
||||||
|
@ -32,8 +32,6 @@ export class RunHistoryUiHandler extends MessageUiHandler {
|
|||||||
private runsContainer: Phaser.GameObjects.Container;
|
private runsContainer: Phaser.GameObjects.Container;
|
||||||
private runs: RunEntryContainer[];
|
private runs: RunEntryContainer[];
|
||||||
|
|
||||||
private runSelectCallback: RunSelectCallback | null;
|
|
||||||
|
|
||||||
private scrollCursor = 0;
|
private scrollCursor = 0;
|
||||||
|
|
||||||
private cursorObj: Phaser.GameObjects.NineSlice | null;
|
private cursorObj: Phaser.GameObjects.NineSlice | null;
|
||||||
@ -118,7 +116,6 @@ export class RunHistoryUiHandler extends MessageUiHandler {
|
|||||||
success = true;
|
success = true;
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
this.runSelectCallback = null;
|
|
||||||
success = true;
|
success = true;
|
||||||
globalScene.ui.revertMode();
|
globalScene.ui.revertMode();
|
||||||
} else if (this.runs.length > 0) {
|
} else if (this.runs.length > 0) {
|
||||||
@ -235,7 +232,6 @@ export class RunHistoryUiHandler extends MessageUiHandler {
|
|||||||
this.runSelectContainer.setVisible(false);
|
this.runSelectContainer.setVisible(false);
|
||||||
this.setScrollCursor(0);
|
this.setScrollCursor(0);
|
||||||
this.clearCursor();
|
this.clearCursor();
|
||||||
this.runSelectCallback = null;
|
|
||||||
this.clearRuns();
|
this.clearRuns();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,13 +254,11 @@ export class RunHistoryUiHandler extends MessageUiHandler {
|
|||||||
* entryData: the data of an individual run
|
* entryData: the data of an individual run
|
||||||
*/
|
*/
|
||||||
class RunEntryContainer extends Phaser.GameObjects.Container {
|
class RunEntryContainer extends Phaser.GameObjects.Container {
|
||||||
private slotId: number;
|
|
||||||
public entryData: RunEntry;
|
public entryData: RunEntry;
|
||||||
|
|
||||||
constructor(entryData: RunEntry, slotId: number) {
|
constructor(entryData: RunEntry, slotId: number) {
|
||||||
super(globalScene, 0, slotId * 56);
|
super(globalScene, 0, slotId * 56);
|
||||||
|
|
||||||
this.slotId = slotId;
|
|
||||||
this.entryData = entryData;
|
this.entryData = entryData;
|
||||||
|
|
||||||
this.setup(this.entryData);
|
this.setup(this.entryData);
|
||||||
|
@ -34,8 +34,6 @@ export class AbstractSettingsUiHandler extends MessageUiHandler {
|
|||||||
protected navigationIcons: InputsIcons;
|
protected navigationIcons: InputsIcons;
|
||||||
|
|
||||||
private cursorObj: Phaser.GameObjects.NineSlice | null;
|
private cursorObj: Phaser.GameObjects.NineSlice | null;
|
||||||
|
|
||||||
private reloadSettings: Array<Setting>;
|
|
||||||
private reloadRequired: boolean;
|
private reloadRequired: boolean;
|
||||||
|
|
||||||
protected rowsToDisplay: number;
|
protected rowsToDisplay: number;
|
||||||
@ -107,8 +105,6 @@ export class AbstractSettingsUiHandler extends MessageUiHandler {
|
|||||||
this.settingLabels = [];
|
this.settingLabels = [];
|
||||||
this.optionValueLabels = [];
|
this.optionValueLabels = [];
|
||||||
|
|
||||||
this.reloadSettings = this.settings.filter(s => s?.requireReload);
|
|
||||||
|
|
||||||
let anyReloadRequired = false;
|
let anyReloadRequired = false;
|
||||||
this.settings.forEach((setting, s) => {
|
this.settings.forEach((setting, s) => {
|
||||||
let settingName = setting.label;
|
let settingName = setting.label;
|
||||||
|
@ -10,7 +10,6 @@ import { removeCookie } from "#utils/cookies";
|
|||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export class UnavailableModalUiHandler extends ModalUiHandler {
|
export class UnavailableModalUiHandler extends ModalUiHandler {
|
||||||
private reconnectTimer: NodeJS.Timeout | null;
|
|
||||||
private reconnectDuration: number;
|
private reconnectDuration: number;
|
||||||
private reconnectCallback: () => void;
|
private reconnectCallback: () => void;
|
||||||
|
|
||||||
@ -62,7 +61,6 @@ export class UnavailableModalUiHandler extends ModalUiHandler {
|
|||||||
tryReconnect(): void {
|
tryReconnect(): void {
|
||||||
updateUserInfo().then(response => {
|
updateUserInfo().then(response => {
|
||||||
if (response[0] || [200, 400].includes(response[1])) {
|
if (response[0] || [200, 400].includes(response[1])) {
|
||||||
this.reconnectTimer = null;
|
|
||||||
this.reconnectDuration = this.minTime;
|
this.reconnectDuration = this.minTime;
|
||||||
globalScene.playSound("se/pb_bounce_1");
|
globalScene.playSound("se/pb_bounce_1");
|
||||||
this.reconnectCallback();
|
this.reconnectCallback();
|
||||||
@ -71,7 +69,7 @@ export class UnavailableModalUiHandler extends ModalUiHandler {
|
|||||||
globalScene.reset(true, true);
|
globalScene.reset(true, true);
|
||||||
} else {
|
} else {
|
||||||
this.reconnectDuration = Math.min(this.reconnectDuration * 2, this.maxTime); // Set a max delay so it isn't infinite
|
this.reconnectDuration = Math.min(this.reconnectDuration * 2, this.maxTime); // Set a max delay so it isn't infinite
|
||||||
this.reconnectTimer = setTimeout(
|
setTimeout(
|
||||||
() => this.tryReconnect(),
|
() => this.tryReconnect(),
|
||||||
// Adds a random factor to avoid pendulum effect during long total breakdown
|
// Adds a random factor to avoid pendulum effect during long total breakdown
|
||||||
this.reconnectDuration + Math.random() * this.randVarianceTime,
|
this.reconnectDuration + Math.random() * this.randVarianceTime,
|
||||||
@ -88,7 +86,7 @@ export class UnavailableModalUiHandler extends ModalUiHandler {
|
|||||||
|
|
||||||
this.reconnectCallback = args[0];
|
this.reconnectCallback = args[0];
|
||||||
this.reconnectDuration = this.minTime;
|
this.reconnectDuration = this.minTime;
|
||||||
this.reconnectTimer = setTimeout(() => this.tryReconnect(), this.reconnectDuration);
|
setTimeout(() => this.tryReconnect(), this.reconnectDuration);
|
||||||
|
|
||||||
return super.show([config]);
|
return super.show([config]);
|
||||||
}
|
}
|
||||||
|
@ -17,16 +17,12 @@ export class MenuManip {
|
|||||||
private config;
|
private config;
|
||||||
private settingName;
|
private settingName;
|
||||||
private keycode;
|
private keycode;
|
||||||
private icon;
|
|
||||||
private iconDisplayed;
|
private iconDisplayed;
|
||||||
private specialCaseIcon;
|
|
||||||
|
|
||||||
constructor(config) {
|
constructor(config) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.settingName = null;
|
this.settingName = null;
|
||||||
this.icon = null;
|
|
||||||
this.iconDisplayed = null;
|
this.iconDisplayed = null;
|
||||||
this.specialCaseIcon = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Review this
|
// TODO: Review this
|
||||||
|
@ -2,10 +2,8 @@
|
|||||||
* Class will intercept any text or dialogue message calls and log them for test purposes
|
* Class will intercept any text or dialogue message calls and log them for test purposes
|
||||||
*/
|
*/
|
||||||
export class TextInterceptor {
|
export class TextInterceptor {
|
||||||
private scene;
|
|
||||||
public logs: string[] = [];
|
public logs: string[] = [];
|
||||||
constructor(scene) {
|
constructor(scene) {
|
||||||
this.scene = scene;
|
|
||||||
scene.messageWrapper = this;
|
scene.messageWrapper = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user