mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-12 19:32:17 +02:00
Remove unneeded fields from src/ui/filter-text.ts
This commit is contained in:
parent
b89b945b11
commit
49d8874433
@ -20,7 +20,6 @@ export class FilterText extends Phaser.GameObjects.Container {
|
|||||||
private window: Phaser.GameObjects.NineSlice;
|
private window: Phaser.GameObjects.NineSlice;
|
||||||
private labels: Phaser.GameObjects.Text[] = [];
|
private labels: Phaser.GameObjects.Text[] = [];
|
||||||
private selections: Phaser.GameObjects.Text[] = [];
|
private selections: Phaser.GameObjects.Text[] = [];
|
||||||
private selectionStrings: string[] = [];
|
|
||||||
private rows: FilterTextRow[] = [];
|
private rows: FilterTextRow[] = [];
|
||||||
public cursorObj: Phaser.GameObjects.Image;
|
public cursorObj: Phaser.GameObjects.Image;
|
||||||
public numFilters = 0;
|
public numFilters = 0;
|
||||||
@ -112,8 +111,6 @@ export class FilterText extends Phaser.GameObjects.Container {
|
|||||||
this.selections.push(filterTypesSelection);
|
this.selections.push(filterTypesSelection);
|
||||||
this.add(filterTypesSelection);
|
this.add(filterTypesSelection);
|
||||||
|
|
||||||
this.selectionStrings.push("");
|
|
||||||
|
|
||||||
this.calcFilterPositions();
|
this.calcFilterPositions();
|
||||||
this.numFilters++;
|
this.numFilters++;
|
||||||
|
|
||||||
@ -122,7 +119,6 @@ export class FilterText extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
resetSelection(index: number): void {
|
resetSelection(index: number): void {
|
||||||
this.selections[index].setText(this.defaultText);
|
this.selections[index].setText(this.defaultText);
|
||||||
this.selectionStrings[index] = "";
|
|
||||||
this.onChange();
|
this.onChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,6 +200,17 @@ export class FilterText extends Phaser.GameObjects.Container {
|
|||||||
return this.selections[row].getWrappedText()[0];
|
return this.selections[row].getWrappedText()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Forcibly set the selection text for a specific filter row and then call the `onChange` function
|
||||||
|
*
|
||||||
|
* @param row the filter row to set the text for
|
||||||
|
* @param value the text to set for the filter row
|
||||||
|
*/
|
||||||
|
setValue(row: FilterTextRow, value: string) {
|
||||||
|
this.selections[row].setText(value);
|
||||||
|
this.onChange();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the nearest filter to the provided container on the y-axis
|
* Find the nearest filter to the provided container on the y-axis
|
||||||
* @param container the StarterContainer to compare position against
|
* @param container the StarterContainer to compare position against
|
||||||
|
Loading…
Reference in New Issue
Block a user