mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-21 07:42:25 +02:00
Specific reset behavior for caught filter in starter select menu
This commit is contained in:
parent
382e8beaf9
commit
7bd18223b5
@ -1059,9 +1059,17 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
* Set the selections for all filters to their default starting value
|
* Set the selections for all filters to their default starting value
|
||||||
*/
|
*/
|
||||||
resetFilters() : void {
|
resetFilters() : void {
|
||||||
|
this.filterBar.setValsToDefault();
|
||||||
|
this.resetCaughtDropdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set default value for the caught dropdown, which only shows caught mons
|
||||||
|
*/
|
||||||
|
resetCaughtDropdown(): void {
|
||||||
const caughtDropDown: DropDown = this.filterBar.getFilter(DropDownColumn.CAUGHT);
|
const caughtDropDown: DropDown = this.filterBar.getFilter(DropDownColumn.CAUGHT);
|
||||||
|
|
||||||
this.filterBar.setValsToDefault();
|
caughtDropDown.resetToDefault();
|
||||||
|
|
||||||
// initial setting, in caught filter, select the options excluding the uncaught option
|
// initial setting, in caught filter, select the options excluding the uncaught option
|
||||||
for (let i = 0; i < caughtDropDown.options.length; i++) {
|
for (let i = 0; i < caughtDropDown.options.length; i++) {
|
||||||
@ -1302,8 +1310,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
// CANCEL with a filter menu open > close it
|
// CANCEL with a filter menu open > close it
|
||||||
this.filterBar.toggleDropDown(this.filterBarCursor);
|
this.filterBar.toggleDropDown(this.filterBarCursor);
|
||||||
success = true;
|
success = true;
|
||||||
} else if (this.filterMode && !this.filterBar.getFilter(this.filterBarCursor).hasDefaultValues()) {
|
} else if (this.filterMode && !this.filterBar.getFilter(this.filterBar.getColumn(this.filterBarCursor)).hasDefaultValues()) {
|
||||||
|
if (this.filterBar.getColumn(this.filterBarCursor) === DropDownColumn.CAUGHT) {
|
||||||
|
this.resetCaughtDropdown();
|
||||||
|
} else {
|
||||||
this.filterBar.resetSelection(this.filterBarCursor);
|
this.filterBar.resetSelection(this.filterBarCursor);
|
||||||
|
}
|
||||||
this.updateStarters;
|
this.updateStarters;
|
||||||
success = true;
|
success = true;
|
||||||
} else if (this.statsMode) {
|
} else if (this.statsMode) {
|
||||||
|
Loading…
Reference in New Issue
Block a user