diff --git a/ui/balance_druid/sim.ts b/ui/balance_druid/sim.ts index 040232ebde..b82f98d26d 100644 --- a/ui/balance_druid/sim.ts +++ b/ui/balance_druid/sim.ts @@ -108,8 +108,6 @@ export class BalanceDruidSimUI extends IndividualSimUI { // Inputs to include in the 'Other' section on the settings tab. otherInputs: { inputs: [ - OtherInputs.PrepopPotion, - OtherInputs.TankAssignment, ], }, diff --git a/ui/core/components/icon_inputs.ts b/ui/core/components/icon_inputs.ts index ae70d36812..9f82782f74 100644 --- a/ui/core/components/icon_inputs.ts +++ b/ui/core/components/icon_inputs.ts @@ -348,22 +348,26 @@ function makeMultistateIndividualBuffInput(id: ActionId, numStates: number, fiel // Custom buffs that don't fit into any of the helper functions above. ////////////////////////////////////////////////////////////////////// -export const makePotionsInput = makeConsumeInputFactory('defaultPotion', [ - { actionId: ActionId.fromItemId(33447), value: Potions.RunicHealingPotion }, - { actionId: ActionId.fromItemId(33448), value: Potions.RunicManaPotion }, - { actionId: ActionId.fromItemId(40093), value: Potions.IndestructiblePotion }, - { actionId: ActionId.fromItemId(40211), value: Potions.PotionOfSpeed }, - { actionId: ActionId.fromItemId(40212), value: Potions.PotionOfWildMagic }, - - { actionId: ActionId.fromItemId(22839), value: Potions.DestructionPotion }, - { actionId: ActionId.fromItemId(22838), value: Potions.HastePotion }, - { actionId: ActionId.fromItemId(13442), value: Potions.MightyRagePotion }, - { actionId: ActionId.fromItemId(22832), value: Potions.SuperManaPotion }, - { actionId: ActionId.fromItemId(31677), value: Potions.FelManaPotion }, - { actionId: ActionId.fromItemId(22828), value: Potions.InsaneStrengthPotion }, - { actionId: ActionId.fromItemId(22849), value: Potions.IronshieldPotion }, - { actionId: ActionId.fromItemId(22837), value: Potions.HeroicPotion }, -] as Array, Potions>>); +function makePotionInputFactory(consumesFieldName: keyof Consumes): (options: Array) => InputHelpers.TypedIconEnumPickerConfig, Potions> { + return makeConsumeInputFactory(consumesFieldName, [ + { actionId: ActionId.fromItemId(33447), value: Potions.RunicHealingPotion }, + { actionId: ActionId.fromItemId(33448), value: Potions.RunicManaPotion }, + { actionId: ActionId.fromItemId(40093), value: Potions.IndestructiblePotion }, + { actionId: ActionId.fromItemId(40211), value: Potions.PotionOfSpeed }, + { actionId: ActionId.fromItemId(40212), value: Potions.PotionOfWildMagic }, + + { actionId: ActionId.fromItemId(22839), value: Potions.DestructionPotion }, + { actionId: ActionId.fromItemId(22838), value: Potions.HastePotion }, + { actionId: ActionId.fromItemId(13442), value: Potions.MightyRagePotion }, + { actionId: ActionId.fromItemId(22832), value: Potions.SuperManaPotion }, + { actionId: ActionId.fromItemId(31677), value: Potions.FelManaPotion }, + { actionId: ActionId.fromItemId(22828), value: Potions.InsaneStrengthPotion }, + { actionId: ActionId.fromItemId(22849), value: Potions.IronshieldPotion }, + { actionId: ActionId.fromItemId(22837), value: Potions.HeroicPotion }, + ] as Array, Potions>>); +} +export const makePotionsInput = makePotionInputFactory('defaultPotion'); +export const makePrepopPotionsInput = makePotionInputFactory('prepopPotion'); export const makeConjuredInput = makeConsumeInputFactory('defaultConjured', [ { actionId: ActionId.fromItemId(12662), value: Conjured.ConjuredDarkRune }, diff --git a/ui/core/components/other_inputs.ts b/ui/core/components/other_inputs.ts index 128c2cc827..12134737f0 100644 --- a/ui/core/components/other_inputs.ts +++ b/ui/core/components/other_inputs.ts @@ -1,7 +1,6 @@ import { BooleanPicker } from '../components/boolean_picker.js'; import { EnumPicker, EnumPickerConfig } from '../components/enum_picker.js'; import { Conjured } from '../proto/common.js'; -import { Potions } from '../proto/common.js'; import { RaidTarget } from '../proto/common.js'; import { TristateEffect } from '../proto/common.js'; import { Party } from '../party.js'; @@ -77,25 +76,6 @@ export function makePhaseSelector(parent: HTMLElement, sim: Sim): EnumPicker) => player.consumesChangeEmitter, - getValue: (player: Player) => player.getConsumes().prepopPotion, - setValue: (eventID: EventID, player: Player, newValue: number) => { - const newConsumes = player.getConsumes(); - newConsumes.prepopPotion = newValue; - player.setConsumes(eventID, newConsumes); - }, -}; - export const StartingConjured = { type: 'enum' as const, label: 'Starting Conjured', diff --git a/ui/core/individual_sim_ui.ts b/ui/core/individual_sim_ui.ts index ede4395a97..7f62fe294a 100644 --- a/ui/core/individual_sim_ui.ts +++ b/ui/core/individual_sim_ui.ts @@ -460,6 +460,7 @@ export abstract class IndividualSimUI extends SimUI {
Potions
+
@@ -644,6 +645,22 @@ export abstract class IndividualSimUI extends SimUI { }, this); } + const prepopPotionOptions = this.splitRelevantOptions([ + // This list is smaller because some potions don't make sense to use as prepot. + // E.g. healing/mana potions. + { item: Potions.IndestructiblePotion, stats: [Stat.StatArmor] }, + { item: Potions.PotionOfSpeed, stats: [Stat.StatMeleeHaste, Stat.StatSpellHaste] }, + { item: Potions.PotionOfWildMagic, stats: [Stat.StatMeleeCrit, Stat.StatSpellCrit, Stat.StatSpellPower] }, + ]); + if (prepopPotionOptions.length) { + const elem = this.rootElem.getElementsByClassName('consumes-prepot')[0] as HTMLElement; + new IconEnumPicker(elem, this.player, IconInputs.makePrepopPotionsInput(prepopPotionOptions)); + tippy(elem, { + 'content': 'Prepop Potion (1s before combat)', + 'allowHTML': true, + }); + } + const potionOptions = this.splitRelevantOptions([ { item: Potions.RunicHealingPotion, stats: [Stat.StatStamina] }, { item: Potions.RunicManaPotion, stats: [Stat.StatIntellect] }, @@ -654,9 +671,14 @@ export abstract class IndividualSimUI extends SimUI { if (potionOptions.length) { const elem = this.rootElem.getElementsByClassName('consumes-potions')[0] as HTMLElement; new IconEnumPicker(elem, this.player, IconInputs.makePotionsInput(potionOptions)); + tippy(elem, { + 'content': 'Combat Potion', + 'allowHTML': true, + }); } const conjuredOptions = this.splitRelevantOptions([ + this.player.getClass() == Class.ClassRogue ? { item: Conjured.ConjuredRogueThistleTea, stats: [] } : null, { item: Conjured.ConjuredHealthstone, stats: [Stat.StatStamina] }, { item: Conjured.ConjuredDarkRune, stats: [Stat.StatIntellect] }, { item: Conjured.ConjuredFlameCap, stats: [Stat.StatStrength, Stat.StatAgility, Stat.StatFireSpellPower] }, @@ -1195,15 +1217,16 @@ export abstract class IndividualSimUI extends SimUI { }); } - splitRelevantOptions(options: Array>): Array { + splitRelevantOptions(options: Array | null>): Array { return options + .filter(option => option != null) .filter(option => - this.individualConfig.includeBuffDebuffInputs.includes(option.item) || - option.stats.length == 0 || - option.stats.some(stat => this.individualConfig.epStats.includes(stat))) + this.individualConfig.includeBuffDebuffInputs.includes(option!.item) || + option!.stats.length == 0 || + option!.stats.some(stat => this.individualConfig.epStats.includes(stat))) .filter(option => - !this.individualConfig.excludeBuffDebuffInputs.includes(option.item)) - .map(option => option.item); + !this.individualConfig.excludeBuffDebuffInputs.includes(option!.item)) + .map(option => option!.item); } } diff --git a/ui/deathknight/sim.ts b/ui/deathknight/sim.ts index 443b947263..c2107375bc 100644 --- a/ui/deathknight/sim.ts +++ b/ui/deathknight/sim.ts @@ -151,8 +151,6 @@ export class DeathknightSimUI extends IndividualSimUI { DeathKnightInputs.PrecastGhoulFrenzy, DeathKnightInputs.PrecastHornOfWinter, - OtherInputs.PrepopPotion, - OtherInputs.TankAssignment, OtherInputs.InFrontOfTarget, ], diff --git a/ui/elemental_shaman/sim.ts b/ui/elemental_shaman/sim.ts index f747b9922b..60873d356c 100644 --- a/ui/elemental_shaman/sim.ts +++ b/ui/elemental_shaman/sim.ts @@ -138,7 +138,6 @@ export class ElementalShamanSimUI extends IndividualSimUI { otherInputs: { inputs: [ DruidInputs.LatencyMs, - OtherInputs.PrepopPotion, OtherInputs.TankAssignment, OtherInputs.InFrontOfTarget, ], diff --git a/ui/feral_tank_druid/sim.ts b/ui/feral_tank_druid/sim.ts index d09b8275ce..8a65730391 100644 --- a/ui/feral_tank_druid/sim.ts +++ b/ui/feral_tank_druid/sim.ts @@ -150,7 +150,6 @@ export class FeralTankDruidSimUI extends IndividualSimUI { inputs: [ HunterInputs.PetUptime, HunterInputs.SniperTrainingUptime, - OtherInputs.PrepopPotion, OtherInputs.TankAssignment, OtherInputs.InFrontOfTarget, ], diff --git a/ui/mage/sim.ts b/ui/mage/sim.ts index 5b8354ebd7..0c3748eead 100644 --- a/ui/mage/sim.ts +++ b/ui/mage/sim.ts @@ -136,7 +136,6 @@ export class MageSimUI extends IndividualSimUI { inputs: [ MageInputs.EvocationTicks, MageInputs.FocusMagicUptime, - OtherInputs.PrepopPotion, OtherInputs.DistanceFromTarget, OtherInputs.TankAssignment, diff --git a/ui/retribution_paladin/sim.ts b/ui/retribution_paladin/sim.ts index a4b7893394..99b57c8694 100644 --- a/ui/retribution_paladin/sim.ts +++ b/ui/retribution_paladin/sim.ts @@ -168,7 +168,6 @@ export class RetributionPaladinSimUI extends IndividualSimUI { otherInputs: { inputs: [ OtherInputs.StartingConjured, - OtherInputs.PrepopPotion, OtherInputs.TankAssignment, OtherInputs.InFrontOfTarget, ], diff --git a/ui/shadow_priest/sim.ts b/ui/shadow_priest/sim.ts index 7e8cba5506..8302c0dad8 100644 --- a/ui/shadow_priest/sim.ts +++ b/ui/shadow_priest/sim.ts @@ -124,7 +124,6 @@ export class ShadowPriestSimUI extends IndividualSimUI { // Inputs to include in the 'Other' section on the settings tab. otherInputs: { inputs: [ - OtherInputs.PrepopPotion, OtherInputs.TankAssignment, ], }, diff --git a/ui/smite_priest/sim.ts b/ui/smite_priest/sim.ts index ade17da3a9..5aca114d1a 100644 --- a/ui/smite_priest/sim.ts +++ b/ui/smite_priest/sim.ts @@ -131,7 +131,6 @@ export class SmitePriestSimUI extends IndividualSimUI { // Inputs to include in the 'Other' section on the settings tab. otherInputs: { inputs: [ - OtherInputs.PrepopPotion, OtherInputs.TankAssignment, ], }, diff --git a/ui/tank_deathknight/sim.ts b/ui/tank_deathknight/sim.ts index da23a6cc63..e6d496f7f2 100644 --- a/ui/tank_deathknight/sim.ts +++ b/ui/tank_deathknight/sim.ts @@ -152,8 +152,6 @@ export class TankDeathknightSimUI extends IndividualSimUI { // Inputs to include in the 'Other' section on the settings tab. otherInputs: { inputs: [ - OtherInputs.PrepopPotion, OtherInputs.DistanceFromTarget, OtherInputs.TankAssignment, ],