Partially fixed some private property issues

Left some mocks alone because IDFK what they mean
This commit is contained in:
Bertie690 2025-08-14 00:18:47 -04:00
parent 618a4b5fc3
commit d06eb1bcc7
10 changed files with 3 additions and 40 deletions

View File

@ -10,19 +10,12 @@ export class CommonAnimPhase extends PokemonPhase {
public readonly phaseName: "CommonAnimPhase" | "PokemonHealPhase" | "WeatherEffectPhase" = "CommonAnimPhase";
private anim: CommonAnim | null;
private targetIndex?: BattlerIndex;
private playOnEmptyField: boolean;
constructor(
battlerIndex?: BattlerIndex,
targetIndex?: BattlerIndex,
anim: CommonAnim | null = null,
playOnEmptyField = false,
) {
constructor(battlerIndex?: BattlerIndex, targetIndex?: BattlerIndex, anim: CommonAnim | null = null) {
super(battlerIndex);
this.anim = anim;
this.targetIndex = targetIndex;
this.playOnEmptyField = playOnEmptyField;
}
setAnimation(anim: CommonAnim) {

View File

@ -17,8 +17,6 @@ export class AdminUiHandler extends FormModalUiHandler {
private config: ModalConfig;
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) => {
if (field === "username") {
return `${toTitleCase(field)} is required`;

View File

@ -24,14 +24,12 @@ export class FilterText extends Phaser.GameObjects.Container {
private rows: FilterTextRow[] = [];
public cursorObj: Phaser.GameObjects.Image;
public numFilters = 0;
private lastCursor = -1;
private uiTheme: UiTheme;
private menuMessageBoxContainer: Phaser.GameObjects.Container;
private dialogueMessageBox: Phaser.GameObjects.NineSlice;
message: any;
private readonly textPadding = 8;
private readonly defaultWordWrapWidth = 1224;
private onChange: () => void;
@ -158,7 +156,6 @@ export class FilterText extends Phaser.GameObjects.Container {
const cursorOffset = 8;
this.cursorObj.setPosition(cursorOffset, this.labels[cursor].y + 3);
this.lastCursor = cursor;
}
/**

View File

@ -41,8 +41,6 @@ const GLOBAL_SCALE = 6;
export class MoveInfoOverlay extends Phaser.GameObjects.Container implements InfoToggle {
public active = false;
private move: Move;
private desc: Phaser.GameObjects.Text;
private descScroll: Phaser.Tweens.Tween | null = null;
@ -177,7 +175,6 @@ export class MoveInfoOverlay extends Phaser.GameObjects.Container implements Inf
if (!globalScene.enableMoveInfo) {
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.acc.setText(move.accuracy >= 0 ? move.accuracy.toString() : "---");
this.pp.setText(move.pp >= 0 ? move.pp.toString() : "---");

View File

@ -259,8 +259,6 @@ export class PokedexPageUiHandler extends MessageUiHandler {
private instructionRowX = 0;
private instructionRowY = 0;
private instructionRowTextOffset = 9;
private filterInstructionRowX = 0;
private filterInstructionRowY = 0;
private starterAttributes: StarterAttributes;
private savedStarterAttributes: StarterAttributes;
@ -2200,8 +2198,6 @@ export class PokedexPageUiHandler extends MessageUiHandler {
updateInstructions(): void {
this.instructionRowX = 0;
this.instructionRowY = 0;
this.filterInstructionRowX = 0;
this.filterInstructionRowY = 0;
this.hideInstructions();
this.instructionsContainer.removeAll();
this.filterInstructionsContainer.removeAll();

View File

@ -32,8 +32,6 @@ export class RunHistoryUiHandler extends MessageUiHandler {
private runsContainer: Phaser.GameObjects.Container;
private runs: RunEntryContainer[];
private runSelectCallback: RunSelectCallback | null;
private scrollCursor = 0;
private cursorObj: Phaser.GameObjects.NineSlice | null;
@ -118,7 +116,6 @@ export class RunHistoryUiHandler extends MessageUiHandler {
success = true;
return success;
}
this.runSelectCallback = null;
success = true;
globalScene.ui.revertMode();
} else if (this.runs.length > 0) {
@ -235,7 +232,6 @@ export class RunHistoryUiHandler extends MessageUiHandler {
this.runSelectContainer.setVisible(false);
this.setScrollCursor(0);
this.clearCursor();
this.runSelectCallback = null;
this.clearRuns();
}
@ -258,13 +254,11 @@ export class RunHistoryUiHandler extends MessageUiHandler {
* entryData: the data of an individual run
*/
class RunEntryContainer extends Phaser.GameObjects.Container {
private slotId: number;
public entryData: RunEntry;
constructor(entryData: RunEntry, slotId: number) {
super(globalScene, 0, slotId * 56);
this.slotId = slotId;
this.entryData = entryData;
this.setup(this.entryData);

View File

@ -34,8 +34,6 @@ export class AbstractSettingsUiHandler extends MessageUiHandler {
protected navigationIcons: InputsIcons;
private cursorObj: Phaser.GameObjects.NineSlice | null;
private reloadSettings: Array<Setting>;
private reloadRequired: boolean;
protected rowsToDisplay: number;
@ -107,8 +105,6 @@ export class AbstractSettingsUiHandler extends MessageUiHandler {
this.settingLabels = [];
this.optionValueLabels = [];
this.reloadSettings = this.settings.filter(s => s?.requireReload);
let anyReloadRequired = false;
this.settings.forEach((setting, s) => {
let settingName = setting.label;

View File

@ -10,7 +10,6 @@ import { removeCookie } from "#utils/cookies";
import i18next from "i18next";
export class UnavailableModalUiHandler extends ModalUiHandler {
private reconnectTimer: NodeJS.Timeout | null;
private reconnectDuration: number;
private reconnectCallback: () => void;
@ -62,7 +61,6 @@ export class UnavailableModalUiHandler extends ModalUiHandler {
tryReconnect(): void {
updateUserInfo().then(response => {
if (response[0] || [200, 400].includes(response[1])) {
this.reconnectTimer = null;
this.reconnectDuration = this.minTime;
globalScene.playSound("se/pb_bounce_1");
this.reconnectCallback();
@ -71,7 +69,7 @@ export class UnavailableModalUiHandler extends ModalUiHandler {
globalScene.reset(true, true);
} else {
this.reconnectDuration = Math.min(this.reconnectDuration * 2, this.maxTime); // Set a max delay so it isn't infinite
this.reconnectTimer = setTimeout(
setTimeout(
() => this.tryReconnect(),
// Adds a random factor to avoid pendulum effect during long total breakdown
this.reconnectDuration + Math.random() * this.randVarianceTime,
@ -88,7 +86,7 @@ export class UnavailableModalUiHandler extends ModalUiHandler {
this.reconnectCallback = args[0];
this.reconnectDuration = this.minTime;
this.reconnectTimer = setTimeout(() => this.tryReconnect(), this.reconnectDuration);
setTimeout(() => this.tryReconnect(), this.reconnectDuration);
return super.show([config]);
}

View File

@ -17,16 +17,12 @@ export class MenuManip {
private config;
private settingName;
private keycode;
private icon;
private iconDisplayed;
private specialCaseIcon;
constructor(config) {
this.config = config;
this.settingName = null;
this.icon = null;
this.iconDisplayed = null;
this.specialCaseIcon = null;
}
// TODO: Review this

View File

@ -2,10 +2,8 @@
* Class will intercept any text or dialogue message calls and log them for test purposes
*/
export class TextInterceptor {
private scene;
public logs: string[] = [];
constructor(scene) {
this.scene = scene;
scene.messageWrapper = this;
}