Skip to content

Commit

Permalink
warlock: cleanup ts elint hints/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharre committed Jul 21, 2023
1 parent 7333a00 commit 14e4b74
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 65 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"unused-imports"
Expand Down
2 changes: 1 addition & 1 deletion ui/warlock/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ const sim = new Sim();
const player = new Player<Spec.SpecWarlock>(Spec.SpecWarlock, sim);
sim.raid.setPlayer(TypedEvent.nextEventID(), 0, player);

const simUI = new WarlockSimUI(document.body, player);
new WarlockSimUI(document.body, player);
3 changes: 1 addition & 2 deletions ui/warlock/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Warlock_Options_Summon as Summon,
} from '../core/proto/warlock.js';

import { UnitReference, Spec, Glyphs, Debuffs, IndividualBuffs, RaidBuffs, ItemSwap, ItemSlot } from '../core/proto/common.js';
import { Spec, Glyphs, ItemSlot } from '../core/proto/common.js';
import { ActionId } from '../core/proto_utils/action_id.js';
import { Player } from '../core/player.js';
import { EventID, TypedEvent } from '../core/typed_event.js';
Expand Down Expand Up @@ -216,7 +216,6 @@ export const WarlockRotationConfig = {
}
}
newRotation.preset = newValue;
const raid = player.getRaid();
TypedEvent.freezeAllAndDo(() => {
if (newValue == RotationPreset.Automatic) {
player.setTalentsString(eventID, newTalents);
Expand Down
54 changes: 13 additions & 41 deletions ui/warlock/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
WarlockMinorGlyph as MinorGlyph,
} from '../core/proto/warlock.js';

import * as WarlockTooltips from './tooltips.js';
export const BIS_TOOLTIP = 'This gear preset is inspired from Zephan\'s Affliction guide: https://www.warcrafttavern.com/wotlk/guides/pve-affliction-warlock/';

// Default talents. Uses the wowhead calculator format, make the talents on
// https://wowhead.com/wotlk/talent-calc and copy the numbers in the url.
Expand Down Expand Up @@ -214,7 +214,7 @@ export const SWP_BIS = {
};
export const P1_PreBiS_11 = {
name: 'Pre-Raid Affliction',
tooltip: WarlockTooltips.BIS_TOOLTIP,
tooltip: BIS_TOOLTIP,
enableWhen: (player: Player<Spec.SpecWarlock>) => player.getRotation().type == RotationType.Affliction,
gear: EquipmentSpec.fromJsonString(`{"items": [
{"id":44910,"enchant":3820,"gems":[41285,39998]},
Expand All @@ -238,7 +238,7 @@ export const P1_PreBiS_11 = {
}
export const P1_Preset_Demo_Destro = {
name: 'P1 Demo / Destro',
tooltip: WarlockTooltips.BIS_TOOLTIP,
tooltip: BIS_TOOLTIP,
enableWhen: (player: Player<Spec.SpecWarlock>) => player.getRotation().type == RotationType.Demonology || player.getRotation().type == RotationType.Destruction,
gear: EquipmentSpec.fromJsonString(`{"items": [
{"id":40421,"enchant":3820,"gems":[41285,40014]},
Expand All @@ -265,7 +265,7 @@ export const P1_Preset_Demo_Destro = {
// will have only rare gems, but a Lightweave Embroidery on cloak.
export const P1_Preset_Affliction = {
name: 'P1 Affliction',
tooltip: WarlockTooltips.BIS_TOOLTIP,
tooltip: BIS_TOOLTIP,
enableWhen: (player: Player<Spec.SpecWarlock>) => player.getRotation().type == RotationType.Affliction,
gear: EquipmentSpec.fromJsonString(`{"items": [
{"id":40421,"enchant":3820,"gems":[41285,40051]},
Expand All @@ -291,7 +291,7 @@ export const P1_Preset_Affliction = {

export const P1_PreBiS_14 = {
name: 'Pre-Raid',
tooltip: WarlockTooltips.BIS_TOOLTIP,
tooltip: BIS_TOOLTIP,
enableWhen: (player: Player<Spec.SpecWarlock>) => player.getRotation().type == RotationType.Demonology || player.getRotation().type == RotationType.Destruction,
gear: EquipmentSpec.fromJsonString(`{"items": [
{"id":44910,"enchant":3820,"gems":[41285,39998]},
Expand All @@ -316,7 +316,7 @@ export const P1_PreBiS_14 = {

export const P2_Preset_Affliction = {
name: 'P2 Affliction',
tooltip: WarlockTooltips.BIS_TOOLTIP,
tooltip: BIS_TOOLTIP,
enableWhen: (player: Player<Spec.SpecWarlock>) => player.getRotation().type == RotationType.Affliction,
gear: EquipmentSpec.fromJsonString(`{"items": [
{"id":45497,"enchant":3820,"gems":[41285,45883]},
Expand All @@ -341,7 +341,7 @@ export const P2_Preset_Affliction = {

export const P2_Preset_Demo_Destro = {
name: 'P2 Demo / Destro',
tooltip: WarlockTooltips.BIS_TOOLTIP,
tooltip: BIS_TOOLTIP,
enableWhen: (player: Player<Spec.SpecWarlock>) => player.getRotation().type == RotationType.Demonology || player.getRotation().type == RotationType.Destruction,
gear: EquipmentSpec.fromJsonString(`{"items": [
{"id":45497,"enchant":3820,"gems":[41285,45883]},
Expand All @@ -366,7 +366,7 @@ export const P2_Preset_Demo_Destro = {

export const P3_Preset_Affliction_Horde = {
name: 'P3 Affliction H',
tooltip: WarlockTooltips.BIS_TOOLTIP,
tooltip: BIS_TOOLTIP,
enableWhen: (player: Player<Spec.SpecWarlock>) => player.getRotation().type == RotationType.Affliction && player.getFaction() == Faction.Horde,
gear: EquipmentSpec.fromJsonString(`{"items": [
{"id":47796,"enchant":3820,"gems":[41285,40133]},
Expand All @@ -391,7 +391,7 @@ export const P3_Preset_Affliction_Horde = {

export const P3_Preset_Affliction_Alliance = {
name: 'P3 Affliction A',
tooltip: WarlockTooltips.BIS_TOOLTIP,
tooltip: BIS_TOOLTIP,
enableWhen: (player: Player<Spec.SpecWarlock>) => player.getRotation().type == RotationType.Affliction && player.getFaction() == Faction.Alliance,
gear: EquipmentSpec.fromJsonString(`{"items": [
{"id":47789,"enchant":3820,"gems":[41285,40133]},
Expand All @@ -416,7 +416,7 @@ export const P3_Preset_Affliction_Alliance = {

export const P3_Preset_Demo_Horde = {
name: 'P3 Demo H',
tooltip: WarlockTooltips.BIS_TOOLTIP,
tooltip: BIS_TOOLTIP,
enableWhen: (player: Player<Spec.SpecWarlock>) => player.getRotation().type == RotationType.Demonology && player.getFaction() == Faction.Horde,
gear: EquipmentSpec.fromJsonString(`{"items": [
{"id":47796,"enchant":3820,"gems":[41285,40133]},
Expand All @@ -441,7 +441,7 @@ export const P3_Preset_Demo_Horde = {

export const P3_Preset_Demo_Alliance = {
name: 'P3 Demo A',
tooltip: WarlockTooltips.BIS_TOOLTIP,
tooltip: BIS_TOOLTIP,
enableWhen: (player: Player<Spec.SpecWarlock>) => player.getRotation().type == RotationType.Demonology && player.getFaction() == Faction.Alliance,
gear: EquipmentSpec.fromJsonString(`{"items": [
{"id":47789,"enchant":3820,"gems":[41285,40133]},
Expand All @@ -466,7 +466,7 @@ export const P3_Preset_Demo_Alliance = {

export const P3_Preset_Destro_Horde = {
name: 'P3 Destro H',
tooltip: WarlockTooltips.BIS_TOOLTIP,
tooltip: BIS_TOOLTIP,
enableWhen: (player: Player<Spec.SpecWarlock>) => player.getRotation().type == RotationType.Destruction && player.getFaction() == Faction.Horde,
gear: EquipmentSpec.fromJsonString(`{"items": [
{"id":47796,"enchant":3820,"gems":[41285,40133]},
Expand All @@ -491,7 +491,7 @@ export const P3_Preset_Destro_Horde = {

export const P3_Preset_Destro_Alliance = {
name: 'P3 Destro A',
tooltip: WarlockTooltips.BIS_TOOLTIP,
tooltip: BIS_TOOLTIP,
enableWhen: (player: Player<Spec.SpecWarlock>) => player.getRotation().type == RotationType.Destruction && player.getFaction() == Faction.Alliance,
gear: EquipmentSpec.fromJsonString(`{"items": [
{"id":47789,"enchant":3820,"gems":[41285,40133]},
Expand All @@ -513,31 +513,3 @@ export const P3_Preset_Destro_Alliance = {
{"id":45294,"gems":[40155]}
]}`),
}

export const Naked = {
name: 'The Naked Bolt',
gear: EquipmentSpec.fromJsonString(`
{"items":
[
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
]
}
`),
}

20 changes: 0 additions & 20 deletions ui/warlock/sim.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
import {
RaidBuffs,
PartyBuffs,
IndividualBuffs,
Debuffs,
Spec,
Stat,
TristateEffect,
Race,
} from '../core/proto/common.js';

import { Stats } from '../core/proto_utils/stats.js';
import { Player } from '../core/player.js';
import { IndividualSimUI } from '../core/individual_sim_ui.js';
import { TypedEvent } from '../core/typed_event.js';

import {
Warlock,
Warlock_Rotation as WarlockRotation,
WarlockTalents as WarlockTalents,
Warlock_Options as WarlockOptions,
Warlock_Options_Armor as Armor,
Warlock_Options_Summon as Summon,
Warlock_Options_WeaponImbue as WeaponImbue,
} from '../core/proto/warlock.js';

import * as IconInputs from '../core/components/icon_inputs.js';
import * as OtherInputs from '../core/components/other_inputs.js';
import * as Tooltips from '../core/constants/tooltips.js';

import * as WarlockInputs from './inputs.js';
import * as Presets from './presets.js';

Expand Down Expand Up @@ -158,7 +139,6 @@ export class WarlockSimUI extends IndividualSimUI<Spec.SpecWarlock> {
],
//Preset gear configurations that the user can quickly select.
gear: [
// Presets.Naked,
Presets.SWP_BIS,
Presets.P1_PreBiS_11,
Presets.P1_PreBiS_14,
Expand Down
1 change: 0 additions & 1 deletion ui/warlock/tooltips.ts

This file was deleted.

0 comments on commit 14e4b74

Please sign in to comment.