diff --git a/src/ui/dropdown.ts b/src/ui/dropdown.ts index e16efe17036..6c0d2d66318 100644 --- a/src/ui/dropdown.ts +++ b/src/ui/dropdown.ts @@ -28,7 +28,8 @@ export enum SortCriteria { COST = 1, CANDY = 2, IV = 3, - NAME = 4 + NAME = 4, + GROWTH = 5 } export class DropDownLabel { diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 3a29f9431e7..df8c886f237 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -490,6 +490,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { new DropDownOption(this.scene, SortCriteria.CANDY, new DropDownLabel(i18next.t("filterBar:sortByCandies"))), new DropDownOption(this.scene, SortCriteria.IV, new DropDownLabel(i18next.t("filterBar:sortByIVs"))), new DropDownOption(this.scene, SortCriteria.NAME, new DropDownLabel(i18next.t("filterBar:sortByName"))) + new DropDownOption(this.scene, SortCriteria.GROWTH, new DropDownLabel(i18next.t("filterBar:sortByGrowth"))) ]; this.filterBar.addFilter(DropDownColumn.SORT, i18next.t("filterBar:sortFilter"), new DropDown(this.scene, 0, 0, sortOptions, this.updateStarters, DropDownType.SINGLE)); this.filterBarContainer.add(this.filterBar); @@ -2555,6 +2556,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler { return (avgIVsA - avgIVsB) * -sort.dir; case SortCriteria.NAME: return a.species.name.localeCompare(b.species.name) * -sort.dir; + case SortCriteria.GROWTH: + return (a.species.growthRate - b.species.growthRate) * -sort.dir; } return 0; });