diff --git a/sim/core/item_swaps.go b/sim/core/item_swaps.go index cab1c886b5..9960876d0f 100644 --- a/sim/core/item_swaps.go +++ b/sim/core/item_swaps.go @@ -31,8 +31,9 @@ type ItemSwap struct { } /* - TODO All the extra parameters here and the code in multiple places for handling the Weapon struct is really messy, - we'll need to figure out something cleaner as this will be quite error-prone +TODO All the extra parameters here and the code in multiple places for handling the Weapon struct is really messy, + + we'll need to figure out something cleaner as this will be quite error-prone */ func (character *Character) EnableItemSwap(itemSwap *proto.ItemSwap, mhCritMultiplier float64, ohCritMultiplier float64, rangedCritMultiplier float64) { items := getItems(itemSwap) @@ -55,7 +56,7 @@ func (character *Character) RegisterOnItemSwap(callback OnSwapItem) { character.ItemSwap.onSwapCallbacks = append(character.ItemSwap.onSwapCallbacks, callback) } -//Helper for handling Effects that use PPMManager to toggle the aura on/off +// Helper for handling Effects that use PPMManager to toggle the aura on/off func (swap *ItemSwap) RegisterOnSwapItemForEffectWithPPMManager(effectID int32, ppm float64, ppmm *PPMManager, aura *Aura) { character := swap.character character.RegisterOnItemSwap(func(sim *Simulation) { @@ -74,7 +75,7 @@ func (swap *ItemSwap) RegisterOnSwapItemForEffectWithPPMManager(effectID int32, } -//Helper for handling Effects that use the effectID to toggle the aura on and off +// Helper for handling Effects that use the effectID to toggle the aura on and off func (swap *ItemSwap) ReigsterOnSwapItemForEffect(effectID int32, aura *Aura) { character := swap.character character.RegisterOnItemSwap(func(sim *Simulation) { diff --git a/sim/hunter/pet_abilities.go b/sim/hunter/pet_abilities.go index 46eb0a37cb..86936abd6e 100644 --- a/sim/hunter/pet_abilities.go +++ b/sim/hunter/pet_abilities.go @@ -75,7 +75,7 @@ func (ability *PetAbility) TryCast(sim *core.Simulation, target *core.Unit, hp * return false } - hp.SpendFocus(sim, ability.Cost * hp.PseudoStats.CostMultiplier, ability.ActionID) + hp.SpendFocus(sim, ability.Cost*hp.PseudoStats.CostMultiplier, ability.ActionID) ability.Cast(sim, target) return true } diff --git a/sim/paladin/exorcism.go b/sim/paladin/exorcism.go index 86b25a692b..099f4caec0 100644 --- a/sim/paladin/exorcism.go +++ b/sim/paladin/exorcism.go @@ -52,7 +52,7 @@ func (paladin *Paladin) registerExorcismSpell() { bonusCrit := core.TernaryFloat64( target.MobType == proto.MobType_MobTypeDemon || target.MobType == proto.MobType_MobTypeUndead, - 100 * core.CritRatingPerCritChance, + 100*core.CritRatingPerCritChance, 0) spell.BonusCritRating += bonusCrit diff --git a/sim/shaman/shaman.go b/sim/shaman/shaman.go index 465ff986fc..3863835728 100644 --- a/sim/shaman/shaman.go +++ b/sim/shaman/shaman.go @@ -125,7 +125,7 @@ type Shaman struct { FlameShockDot *core.Dot - MaelstromWeaponAura *core.Aura + MaelstromWeaponAura *core.Aura } // Implemented by each Shaman spec. diff --git a/ui/core/components/base_modal.ts b/ui/core/components/base_modal.ts index 46e8b07e6d..e500a474c2 100644 --- a/ui/core/components/base_modal.ts +++ b/ui/core/components/base_modal.ts @@ -3,41 +3,71 @@ import { Component } from './component'; import { Modal } from 'bootstrap'; +type ModalSize = 'sm' | 'md' | 'lg' | 'xl'; + type BaseModalConfig = { closeButton?: CloseButtonConfig, + // Whether or not to add a modal-footer element + footer?: boolean, + // Whether or not to add a modal-header element header?: boolean, + // Whether or not to allow modal contents to extend past the screen height. + // When true, the modal is fixed to the screen height and body contents will scroll. + scrollContents?: boolean, + // Specify the size of the modal + size?: ModalSize, + // A title for the modal + title?: string | null, }; const DEFAULT_CONFIG = { closeButton: {}, + footer: false, header: true, + scrollContents: false, + size: 'lg' as ModalSize, + title: null, } export class BaseModal extends Component { readonly config: BaseModalConfig; readonly modal: Modal; + readonly dialog: HTMLElement; readonly header: HTMLElement | undefined; readonly body: HTMLElement; + readonly footer: HTMLElement | undefined; - constructor(cssClass: string, config: BaseModalConfig = {}) { - super(document.body, 'modal'); + constructor(parent: HTMLElement, cssClass: string, config: BaseModalConfig = {}) { + super(parent, 'modal'); this.config = {...DEFAULT_CONFIG, ...config}; + const modalSizeKlass = this.config.size && this.config.size != 'md' ? `modal-${this.config.size}` : ''; + this.rootElem.classList.add('fade'); this.rootElem.innerHTML = ` -