diff --git a/ui/core/components/individual_sim_ui/apl_rotation_picker.ts b/ui/core/components/individual_sim_ui/apl_rotation_picker.ts index babc7852cc..ba957a3fec 100644 --- a/ui/core/components/individual_sim_ui/apl_rotation_picker.ts +++ b/ui/core/components/individual_sim_ui/apl_rotation_picker.ts @@ -60,10 +60,8 @@ class APLListItemPicker extends Input, APLListItem> { } constructor(parent: HTMLElement, player: Player, config: ListItemPickerConfig, APLListItem>, index: number) { - super(parent, 'apl-list-item-picker-root', player, { - ...config, - enableWhen: () => !this.getItem().hide, - }); + config.enableWhen = () => !this.getItem().hide; + super(parent, 'apl-list-item-picker-root', player, config); this.player = player; this.index = index; diff --git a/ui/core/components/individual_sim_ui/rotation_tab.ts b/ui/core/components/individual_sim_ui/rotation_tab.ts index d45765b5a5..05fa4edbe8 100644 --- a/ui/core/components/individual_sim_ui/rotation_tab.ts +++ b/ui/core/components/individual_sim_ui/rotation_tab.ts @@ -167,13 +167,13 @@ export class RotationTab extends SimTab { header: {title: 'Saved Rotations'}, storageKey: this.simUI.getSavedRotationStorageKey(), getData: (player: Player) => SavedRotation.create({ - rotation: player.aplRotation, + rotation: APLRotation.clone(player.aplRotation), specRotationOptionsJson: JSON.stringify(player.specTypeFunctions.rotationToJson(player.getRotation())), cooldowns: player.getCooldowns(), }), setData: (eventID: EventID, player: Player, newRotation: SavedRotation) => { TypedEvent.freezeAllAndDo(() => { - player.aplRotation = newRotation.rotation || APLRotation.create(); + player.setAplRotation(eventID, newRotation.rotation || APLRotation.create()); if (newRotation.specRotationOptionsJson) { try { const json = JSON.parse(newRotation.specRotationOptionsJson); @@ -209,5 +209,5 @@ export class RotationTab extends SimTab { }); }); }); - } + } } diff --git a/ui/core/components/individual_sim_ui/settings_tab.ts b/ui/core/components/individual_sim_ui/settings_tab.ts index 56bfde4eae..58f1da218f 100644 --- a/ui/core/components/individual_sim_ui/settings_tab.ts +++ b/ui/core/components/individual_sim_ui/settings_tab.ts @@ -392,8 +392,8 @@ export class SettingsTab extends SimTab { debuffs: simUI.sim.raid.getDebuffs(), consumes: player.getConsumes(), race: player.getRace(), - cooldowns: player.getCooldowns(), - rotationJson: JSON.stringify(player.specTypeFunctions.rotationToJson(player.getRotation())), + cooldowns: aplLaunchStatuses[simUI.player.spec] == LaunchStatus.Unlaunched ? player.getCooldowns() : undefined, + rotationJson: aplLaunchStatuses[simUI.player.spec] == LaunchStatus.Unlaunched ? JSON.stringify(player.specTypeFunctions.rotationToJson(player.getRotation())) : undefined, }); }, setData: (eventID: EventID, simUI: IndividualSimUI, newSettings: SavedSettings) => { @@ -407,9 +407,11 @@ export class SettingsTab extends SimTab { simUI.player.setBuffs(eventID, newSettings.playerBuffs || IndividualBuffs.create()); simUI.player.setConsumes(eventID, newSettings.consumes || Consumes.create()); simUI.player.setRace(eventID, newSettings.race); - simUI.player.setCooldowns(eventID, newSettings.cooldowns || Cooldowns.create()); - if (newSettings.rotationJson) { - simUI.player.setRotation(eventID, simUI.player.specTypeFunctions.rotationFromJson(JSON.parse(newSettings.rotationJson))); + if (aplLaunchStatuses[simUI.player.spec] == LaunchStatus.Unlaunched) { + simUI.player.setCooldowns(eventID, newSettings.cooldowns || Cooldowns.create()); + if (newSettings.rotationJson) { + simUI.player.setRotation(eventID, simUI.player.specTypeFunctions.rotationFromJson(JSON.parse(newSettings.rotationJson))); + } } }); }, @@ -420,9 +422,10 @@ export class SettingsTab extends SimTab { this.simUI.player.buffsChangeEmitter, this.simUI.player.consumesChangeEmitter, this.simUI.player.raceChangeEmitter, + ].concat(aplLaunchStatuses[this.simUI.player.spec] == LaunchStatus.Unlaunched ? [ this.simUI.player.cooldownsChangeEmitter, this.simUI.player.rotationChangeEmitter, - ], + ] : []), equals: (a: SavedSettings, b: SavedSettings) => SavedSettings.equals(a, b), toJson: (a: SavedSettings) => SavedSettings.toJson(a), fromJson: (obj: any) => SavedSettings.fromJson(obj), @@ -432,7 +435,7 @@ export class SettingsTab extends SimTab { savedEncounterManager.loadUserData(); savedSettingsManager.loadUserData(); }); - } + } private configureInputSection(sectionElem: HTMLElement, sectionConfig: InputSection) { sectionConfig.inputs.forEach(inputConfig => { diff --git a/ui/core/player.ts b/ui/core/player.ts index e6db954581..ae07b9d244 100644 --- a/ui/core/player.ts +++ b/ui/core/player.ts @@ -578,7 +578,7 @@ export class Player { if (APLRotation.equals(newRotation, this.aplRotation)) return; - this.aplRotation = newRotation; + this.aplRotation = APLRotation.clone(newRotation); this.rotationChangeEmitter.emit(eventID); } diff --git a/ui/scss/core/components/individual_sim_ui/_apl_rotation_picker.scss b/ui/scss/core/components/individual_sim_ui/_apl_rotation_picker.scss index 8f72cc1ea7..95a70938dc 100644 --- a/ui/scss/core/components/individual_sim_ui/_apl_rotation_picker.scss +++ b/ui/scss/core/components/individual_sim_ui/_apl_rotation_picker.scss @@ -3,7 +3,7 @@ @import "./apl_helpers"; .apl-rotation-picker-root { - .input-root.apl-list-item-picker { + .apl-list-item-picker { flex-wrap: wrap; align-items: flex-start !important; @@ -13,15 +13,20 @@ border: 0; } - .list-picker-items { - width: unset; - } - .list-picker-new-button { width: 100%; } } + .apl-list-item-picker > * > .list-picker-item-container { + background-color: rgba(21, 23, 30, 0.8); + padding: 5px; + } + + .apl-list-item-picker > * > * > .list-picker-item { + flex-grow: 1; + } + .adaptive-string-picker-root > input { text-align: center; } @@ -76,10 +81,6 @@ } } -.apl-list-item-picker > * > * > .list-picker-item { - flex-grow: 1; -} - .apl-action-picker-action { display: flex; flex-direction: row;