From 5b397756fb5b562165c913d40f419037be851538 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Sat, 16 Sep 2023 22:50:46 -0700 Subject: [PATCH] Fix bug with loading simple CD settings --- ui/core/components/individual_sim_ui/rotation_tab.ts | 3 +++ ui/core/components/settings_menu.ts | 2 +- ui/core/proto_utils/apl_utils.ts | 2 +- ui/hunter/sim.ts | 10 +++++----- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ui/core/components/individual_sim_ui/rotation_tab.ts b/ui/core/components/individual_sim_ui/rotation_tab.ts index 9a6a36ee3b..e2d4300b86 100644 --- a/ui/core/components/individual_sim_ui/rotation_tab.ts +++ b/ui/core/components/individual_sim_ui/rotation_tab.ts @@ -135,6 +135,9 @@ export class RotationTab extends SimTab { } private buildSimpleOrLegacyContent(isSimple: boolean) { + if (!isSimple && aplLaunchStatuses[this.simUI.player.spec] == LaunchStatus.Launched) { + return; + } const cssClass = isSimple ? 'rotation-tab-simple' : 'rotation-tab-legacy'; const contentBlock = new ContentBlock(this.leftPanel, 'rotation-settings', { diff --git a/ui/core/components/settings_menu.ts b/ui/core/components/settings_menu.ts index fae725e6c0..1219f8aafe 100644 --- a/ui/core/components/settings_menu.ts +++ b/ui/core/components/settings_menu.ts @@ -32,7 +32,7 @@ export class SettingsMenu extends BaseModal { ` diff --git a/ui/core/proto_utils/apl_utils.ts b/ui/core/proto_utils/apl_utils.ts index 718c9e6c89..fcd3b37d12 100644 --- a/ui/core/proto_utils/apl_utils.ts +++ b/ui/core/proto_utils/apl_utils.ts @@ -21,7 +21,7 @@ export function autocastCooldownsAction(startAt?: string): APLAction { } export function scheduledCooldownAction(schedule: string, actionId: ActionIdProto): APLAction { - return APLAction.fromJsonString(`{"schedule":{"schedule":"${schedule}","innerAction":{"castSpell":{"spellId":${ActionIdProto.toJson(actionId)}}}}}`); + return APLAction.fromJsonString(`{"schedule":{"schedule":"${schedule}","innerAction":{"castSpell":{"spellId":${ActionIdProto.toJsonString(actionId)}}}}}`); } export function simpleCooldownActions(cooldowns: Cooldowns): Array { diff --git a/ui/hunter/sim.ts b/ui/hunter/sim.ts index d656518b97..365a7b2866 100644 --- a/ui/hunter/sim.ts +++ b/ui/hunter/sim.ts @@ -288,7 +288,7 @@ export class HunterSimUI extends IndividualSimUI { simpleRotation: (player: Player, simple: HunterRotation, cooldowns: Cooldowns): APLRotation => { let [prepullActions, actions] = AplUtils.standardCooldownDefaults(cooldowns); - const multiDotSerpentSting = (numTargets: number) => APLAction.fromJsonString(`{"condition":{"cmp":{"op":"OpGt","lhs":{"remainingTime":{}},"rhs":{"const":{"val":"6s"}}}},"multidot":{"spellId":{"spellId":49001},"maxDots":${numTargets},"maxOverlap":{"const":{"val":"0ms"}}}}`); + const serpentSting = APLAction.fromJsonString(`{"condition":{"cmp":{"op":"OpGt","lhs":{"remainingTime":{}},"rhs":{"const":{"val":"6s"}}}},"multidot":{"spellId":{"spellId":49001},"maxDots":${simple.multiDotSerpentSting ? 3 : 1},"maxOverlap":{"const":{"val":"0ms"}}}}`); const scorpidSting = APLAction.fromJsonString(`{"condition":{"auraShouldRefresh":{"auraId":{"spellId":3043},"maxOverlap":{"const":{"val":"0ms"}}}},"castSpell":{"spellId":{"spellId":3043}}}`); const trapWeave = APLAction.fromJsonString(`{"condition":{"not":{"val":{"dotIsActive":{"spellId":{"spellId":49067}}}}},"castSpell":{"spellId":{"tag":1,"spellId":49067}}}`); const volley = APLAction.fromJsonString(`{"castSpell":{"spellId":{"spellId":58434}}}`); @@ -314,7 +314,7 @@ export class HunterSimUI extends IndividualSimUI { if (simple.type == Hunter_Rotation_RotationType.Aoe) { actions.push(...[ simple.sting == StingType.ScorpidSting ? scorpidSting : null, - simple.sting == StingType.SerpentSting ? (simple.multiDotSerpentSting ? multiDotSerpentSting(3) : multiDotSerpentSting(1)) : null, + simple.sting == StingType.SerpentSting ? serpentSting : null, simple.trapWeave ? trapWeave : null, volley, ].filter(a => a) as Array) @@ -323,7 +323,7 @@ export class HunterSimUI extends IndividualSimUI { killShot, simple.trapWeave ? trapWeave : null, simple.sting == StingType.ScorpidSting ? scorpidSting : null, - simple.sting == StingType.SerpentSting ? (simple.multiDotSerpentSting ? multiDotSerpentSting(3) : multiDotSerpentSting(1)) : null, + simple.sting == StingType.SerpentSting ? serpentSting : null, aimedShot, multiShot, steadyShot, @@ -333,7 +333,7 @@ export class HunterSimUI extends IndividualSimUI { silencingShot, killShot, simple.sting == StingType.ScorpidSting ? scorpidSting : null, - simple.sting == StingType.SerpentSting ? (simple.multiDotSerpentSting ? multiDotSerpentSting(3) : multiDotSerpentSting(1)) : null, + simple.sting == StingType.SerpentSting ? serpentSting : null, simple.trapWeave ? trapWeave : null, chimeraShot, aimedShot, @@ -347,7 +347,7 @@ export class HunterSimUI extends IndividualSimUI { simple.allowExplosiveShotDownrank ? explosiveShot3 : null, simple.trapWeave ? trapWeave : null, simple.sting == StingType.ScorpidSting ? scorpidSting : null, - simple.sting == StingType.SerpentSting ? (simple.multiDotSerpentSting ? multiDotSerpentSting(3) : multiDotSerpentSting(1)) : null, + simple.sting == StingType.SerpentSting ? serpentSting : null, blackArrow, aimedShot, multiShot,