From d7f2516a1b815b53662b2eb98f0b636bbd713fac Mon Sep 17 00:00:00 2001 From: James Tanner Date: Sat, 23 Dec 2023 16:10:31 +0900 Subject: [PATCH] Reimplement #4088 (reverted in #4091) with bugfix --- sim/core/apl.go | 2 +- sim/core/character.go | 5 ++++- ui/core/player.ts | 10 +++++++--- ui/feral_druid/sim.ts | 8 ++------ 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/sim/core/apl.go b/sim/core/apl.go index fe2dd4a6ac..421c2b968d 100644 --- a/sim/core/apl.go +++ b/sim/core/apl.go @@ -54,7 +54,7 @@ func (rot *APLRotation) doAndRecordWarnings(warningsList *[]string, isPrepull bo } func (unit *Unit) newAPLRotation(config *proto.APLRotation) *APLRotation { - if config == nil || config.Type != proto.APLRotation_TypeAPL { + if config == nil || !unit.IsUsingAPL { return nil } diff --git a/sim/core/character.go b/sim/core/character.go index fcc7adf7e9..a509265df4 100644 --- a/sim/core/character.go +++ b/sim/core/character.go @@ -106,7 +106,10 @@ func NewCharacter(party *Party, partyIndex int, player *proto.Player) Character ChannelClipDelay: max(0, time.Duration(player.ChannelClipDelayMs)*time.Millisecond), DistanceFromTarget: player.DistanceFromTarget, NibelungAverageCasts: player.NibelungAverageCasts, - IsUsingAPL: player.Rotation != nil && player.Rotation.Type == proto.APLRotation_TypeAPL, + IsUsingAPL: player.Rotation != nil && + (player.Rotation.Type == proto.APLRotation_TypeAPL || + player.Rotation.Type == proto.APLRotation_TypeAuto || + player.Rotation.Type == proto.APLRotation_TypeSimple), }, Name: player.Name, diff --git a/ui/core/player.ts b/ui/core/player.ts index e0a86fa4c3..f6a9d26245 100644 --- a/ui/core/player.ts +++ b/ui/core/player.ts @@ -822,11 +822,15 @@ export class Player { const type = this.getRotationType(); if (type == APLRotationType.TypeAuto && this.autoRotationGenerator) { // Clone to avoid modifying preset rotations, which are often returned directly. - return APLRotation.clone(this.autoRotationGenerator(this)); + const rot = APLRotation.clone(this.autoRotationGenerator(this)); + rot.type = APLRotationType.TypeAuto; + return rot; } else if (type == APLRotationType.TypeSimple && this.simpleRotationGenerator) { // Clone to avoid modifying preset rotations, which are often returned directly. - const rot = APLRotation.clone(this.simpleRotationGenerator(this, this.getRotation(), this.getCooldowns())); - rot.type = APLRotationType.TypeAPL; // Set this here for convenience, so the generator functions don't need to. + const simpleRot = this.getRotation(); + const rot = APLRotation.clone(this.simpleRotationGenerator(this, simpleRot, this.getCooldowns())); + rot.simple = this.aplRotation.simple; + rot.type = APLRotationType.TypeSimple; return rot; } else { return this.aplRotation; diff --git a/ui/feral_druid/sim.ts b/ui/feral_druid/sim.ts index ed483191f3..ea429b1a75 100644 --- a/ui/feral_druid/sim.ts +++ b/ui/feral_druid/sim.ts @@ -2,11 +2,8 @@ import { Class, Debuffs, Faction, - GemColor, IndividualBuffs, - ItemSlot, PartyBuffs, - Profession, PseudoStat, Race, RaidBuffs, @@ -19,7 +16,6 @@ import { Gear } from '../core/proto_utils/gear.js'; import { PhysicalDPSGemOptimizer } from '../core/components/suggest_gems_action.js'; import { Stats } from '../core/proto_utils/stats.js'; import { getSpecIcon, specNames } from '../core/proto_utils/utils.js'; -import { TypedEvent } from '../core/typed_event.js'; import { Player } from '../core/player.js'; import * as IconInputs from '../core/components/icon_inputs.js'; @@ -171,7 +167,7 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecFeralDruid, { }, autoRotation: (_player: Player): APLRotation => { - return Presets.ROTATION_PRESET_LEGACY_DEFAULT.rotation.rotation!; + return Presets.APL_ROTATION_DEFAULT.rotation.rotation!; }, raidSimPresets: [ @@ -212,7 +208,7 @@ export class FeralDruidSimUI extends IndividualSimUI { constructor(parentElem: HTMLElement, player: Player) { super(parentElem, player, SPEC_CONFIG); - const gemOptimizer = new FeralGemOptimizer(this); + const _gemOptimizer = new FeralGemOptimizer(this); } }