Skip to content

Commit

Permalink
Merge pull request #4057 from jarveson/jake/ui-fixes
Browse files Browse the repository at this point in the history
Jake/UI fixes
  • Loading branch information
jarveson authored Nov 22, 2023
2 parents 7f8c869 + f6f75d5 commit 804beb1
Show file tree
Hide file tree
Showing 9 changed files with 276 additions and 276 deletions.
460 changes: 230 additions & 230 deletions sim/rogue/TestSubtlety.results

Large diffs are not rendered by default.

69 changes: 28 additions & 41 deletions sim/rogue/hemorrhage.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,35 @@ func (rogue *Rogue) registerHemorrhageSpell() {

actionID := core.ActionID{SpellID: 48660}

var numPlayers int
for _, u := range rogue.Env.Raid.AllUnits {
if u.Type == core.PlayerUnit {
numPlayers++
}
bonusDamage := 75.0
if rogue.HasMajorGlyph(proto.RogueMajorGlyph_GlyphOfHemorrhage) {
bonusDamage *= 1.4
}

var hemoAuras core.AuraArray

if numPlayers >= 2 {
bonusDamage := 75.0
if rogue.HasMajorGlyph(proto.RogueMajorGlyph_GlyphOfHemorrhage) {
bonusDamage *= 1.4
}

hemoAuras = rogue.NewEnemyAuraArray(func(target *core.Unit) *core.Aura {
return target.GetOrRegisterAura(core.Aura{
Label: "Hemorrhage",
ActionID: actionID,
Duration: time.Second * 15,
MaxStacks: 10,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.PseudoStats.BonusPhysicalDamageTaken += bonusDamage
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.PseudoStats.BonusPhysicalDamageTaken -= bonusDamage
},
OnSpellHitTaken: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if spell.SpellSchool != core.SpellSchoolPhysical {
return
}
if !result.Landed() || result.Damage == 0 {
return
}
hemoAuras := rogue.NewEnemyAuraArray(func(target *core.Unit) *core.Aura {
return target.GetOrRegisterAura(core.Aura{
Label: "Hemorrhage",
ActionID: actionID,
Duration: time.Second * 15,
MaxStacks: 10,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.PseudoStats.BonusPhysicalDamageTaken += bonusDamage
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.PseudoStats.BonusPhysicalDamageTaken -= bonusDamage
},
OnSpellHitTaken: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if spell.SpellSchool != core.SpellSchoolPhysical {
return
}
if !result.Landed() || result.Damage == 0 {
return
}

aura.RemoveStack(sim)
},
})
aura.RemoveStack(sim)
},
})
}
})

rogue.Hemorrhage = rogue.RegisterSpell(core.SpellConfig{
ActionID: actionID,
Expand Down Expand Up @@ -92,11 +81,9 @@ func (rogue *Rogue) registerHemorrhageSpell() {

if result.Landed() {
rogue.AddComboPoints(sim, 1, spell.ComboPointMetrics())
if len(hemoAuras) > 0 {
hemoAura := hemoAuras.Get(target)
hemoAura.Activate(sim)
hemoAura.SetStacks(sim, 10)
}
hemoAura := hemoAuras.Get(target)
hemoAura.Activate(sim)
hemoAura.SetStacks(sim, 10)
} else {
spell.IssueRefund(sim)
}
Expand Down
2 changes: 1 addition & 1 deletion ui/core/launched_sims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const simLaunchStatuses: Record<Spec, LaunchStatus> = {
// Alpha and Beta show an info notice at the top of the page.
export const aplLaunchStatuses: Record<Spec, LaunchStatus> = {
[Spec.SpecBalanceDruid]: LaunchStatus.Beta,
[Spec.SpecFeralDruid]: LaunchStatus.Alpha,
[Spec.SpecFeralDruid]: LaunchStatus.Beta,
[Spec.SpecFeralTankDruid]: LaunchStatus.Launched,
[Spec.SpecRestorationDruid]: LaunchStatus.Launched,
[Spec.SpecElementalShaman]: LaunchStatus.Beta,
Expand Down
2 changes: 1 addition & 1 deletion ui/core/sim_ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export abstract class SimUI extends Component {
<div class="sim-container">
<aside class="sim-sidebar">
<div class="sim-title"></div>
<div class="sim-sidebar-content">
<div class="sim-sidebar-content ${config.noticeText ? 'smaller' : ''}">
<div class="sim-sidebar-actions within-raid-sim-hide"></div>
<div class="sim-sidebar-results within-raid-sim-hide"></div>
<div class="sim-sidebar-footer"></div>
Expand Down
2 changes: 2 additions & 0 deletions ui/feral_druid/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import P1Gear from './gear_sets/p1.gear.json';
import P2Gear from './gear_sets/p2.gear.json';
import P3Gear from './gear_sets/p3.gear.json';
import P4Gear from './gear_sets/p4.gear.json';
import DefaultApl from './apls/default.apl.json';

// Preset options for this spec.
// Eventually we will import these values for the raid sim too, so its good to
Expand All @@ -35,6 +36,7 @@ export const P1_PRESET = PresetUtils.makePresetGear('P1 Preset', P1Gear);
export const P2_PRESET = PresetUtils.makePresetGear('P2 Preset', P2Gear);
export const P3_PRESET = PresetUtils.makePresetGear('P3 Preset', P3Gear);
export const P4_PRESET = PresetUtils.makePresetGear('P4 Preset', P4Gear);
export const APL_ROTATION_DEFAULT = PresetUtils.makePresetAPLRotation('APL Default', DefaultApl);

export const DefaultRotation = FeralDruidRotation.create({
rotationType: FeralDruid_Rotation_AplType.SingleTarget,
Expand Down
6 changes: 6 additions & 0 deletions ui/feral_druid/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import * as Tooltips from '../core/constants/tooltips.js';

import * as DruidInputs from './inputs.js';
import * as Presets from './presets.js';
import { APLRotation } from 'ui/core/proto/apl.js';

export class FeralDruidSimUI extends IndividualSimUI<Spec.SpecFeralDruid> {
constructor(parentElem: HTMLElement, player: Player<Spec.SpecFeralDruid>) {
Expand Down Expand Up @@ -152,6 +153,7 @@ export class FeralDruidSimUI extends IndividualSimUI<Spec.SpecFeralDruid> {
],
rotations: [
Presets.ROTATION_PRESET_LEGACY_DEFAULT,
Presets.APL_ROTATION_DEFAULT,
],
// Preset gear configurations that the user can quickly select.
gear: [
Expand All @@ -162,6 +164,10 @@ export class FeralDruidSimUI extends IndividualSimUI<Spec.SpecFeralDruid> {
Presets.P4_PRESET,
],
},

autoRotation: (player: Player<Spec.SpecFeralDruid>): APLRotation => {
return Presets.ROTATION_PRESET_LEGACY_DEFAULT.rotation.rotation!;
}
});

this.addOptimizeGemsAction();
Expand Down
3 changes: 2 additions & 1 deletion ui/scss/core/components/_character_stats.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

.character-stats-root {
width: 100%;

padding-bottom: .8rem;

.character-stats-label {
margin-bottom: map.get($spacers, 2);
}
Expand Down
2 changes: 1 addition & 1 deletion ui/scss/core/sim_ui/_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ td, th {
.sim-ui {
// Allow for styled scrolling
max-height: 100vh;
overflow-y: scroll;
overflow-y: auto;
scrollbar-color: var(--bs-primary) $body-bg;
scrollbar-width: thin;

Expand Down
6 changes: 5 additions & 1 deletion ui/scss/core/sim_ui/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@
@include media-breakpoint-up(md) {
.sim-sidebar {
// Allow the stats to align to the bottom of the viewport if the section is small enough to avoid scrolling
// 'Smaller' is set when banner is displayed
.sim-sidebar-content.smaller {
min-height: calc(100vh - calc($sim-header-height + 3.5rem));
}
.sim-sidebar-content {
min-height: calc(100vh - $sim-header-height);
min-height: calc(100vh - calc($sim-header-height + 0.2rem));

.sim-sidebar-footer {
flex: 1;
Expand Down

0 comments on commit 804beb1

Please sign in to comment.