Skip to content

Commit

Permalink
Merge pull request #3777 from 1337LutZ/feature/move-disable-expertise…
Browse files Browse the repository at this point in the history
…-gemming-to-warrior-ui

Feature/move disable expertise gemming to warrior UI
  • Loading branch information
TheGroxEmpire authored Oct 1, 2023
2 parents 562ecd8 + b91c60c commit ba92548
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 28 deletions.
1 change: 1 addition & 0 deletions proto/warrior.proto
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ message Warrior {
bool use_shattering_throw = 4;
WarriorShout shout = 3;
bool stance_snapshot = 6;
bool disable_expertise_gemming = 7;
}
Options options = 3;
}
Expand Down
15 changes: 0 additions & 15 deletions ui/core/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ export class Player<SpecType extends Spec> {
private distanceFromTarget: number = 0;
private healingModel: HealingModel = HealingModel.create();
private healingEnabled: boolean = false;
private disableExpertiseGemming: boolean = false;

private autoRotationGenerator: AutoRotationGenerator<SpecType> | null = null;
private simpleRotationGenerator: SimpleRotationGenerator<SpecType> | null = null;
Expand Down Expand Up @@ -254,7 +253,6 @@ export class Player<SpecType extends Spec> {
readonly inFrontOfTargetChangeEmitter = new TypedEvent<void>('PlayerInFrontOfTarget');
readonly distanceFromTargetChangeEmitter = new TypedEvent<void>('PlayerDistanceFromTarget');
readonly healingModelChangeEmitter = new TypedEvent<void>('PlayerHealingModel');
readonly disableExpertiseGemmingChangeEmitter = new TypedEvent<void>('DisableExpertiseGemming');
readonly epWeightsChangeEmitter = new TypedEvent<void>('PlayerEpWeights');
readonly miscOptionsChangeEmitter = new TypedEvent<void>('PlayerMiscOptions');

Expand Down Expand Up @@ -297,7 +295,6 @@ export class Player<SpecType extends Spec> {
this.inFrontOfTargetChangeEmitter,
this.distanceFromTargetChangeEmitter,
this.healingModelChangeEmitter,
this.disableExpertiseGemmingChangeEmitter,
this.epWeightsChangeEmitter,
this.epRatiosChangeEmitter,
this.epRefStatChangeEmitter,
Expand Down Expand Up @@ -908,18 +905,6 @@ export class Player<SpecType extends Spec> {
this.healingModelChangeEmitter.emit(eventID);
}

getDisableExpertiseGemming(): boolean {
return this.disableExpertiseGemming;
}

setDisableExpertiseGemming(eventID: EventID, newDisableExpertiseGemming: boolean) {
if (newDisableExpertiseGemming == this.disableExpertiseGemming)
return;

this.disableExpertiseGemming = newDisableExpertiseGemming;
this.disableExpertiseGemmingChangeEmitter.emit(eventID);
}

computeStatsEP(stats?: Stats): number {
if (stats == undefined) {
return 0;
Expand Down
20 changes: 8 additions & 12 deletions ui/warrior/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,21 @@ export const StartingRage = InputHelpers.makeSpecOptionsNumberInput<Spec.SpecWar
labelTooltip: 'Initial rage at the start of each iteration.',
});

// Allows for auto gemming whilst ignoring expertise cap
// (Useful for Arms)
export const DisableExpertiseGemming = {
type: 'boolean' as const,
label: 'Disable expertise gemming',
labelTooltip: 'Disables auto gemming for expertise',
changedEvent: (player: Player<any>) => player.disableExpertiseGemmingChangeEmitter,
getValue: (player: Player<any>) => player.getDisableExpertiseGemming(),
setValue: (eventID: EventID, player: Player<any>, newValue: boolean) => {
player.setDisableExpertiseGemming(eventID, newValue);
},
};

export const StanceSnapshot = InputHelpers.makeSpecOptionsBooleanInput<Spec.SpecWarrior>({
fieldName: 'stanceSnapshot',
label: 'Stance Snapshot',
labelTooltip: 'Ability that is cast at the same time as stance swap will benefit from the bonus of the stance before the swap.',
});

// Allows for auto gemming whilst ignoring expertise cap
// (Useful for Arms)
export const DisableExpertiseGemming = InputHelpers.makeSpecOptionsBooleanInput<Spec.SpecWarrior>({
fieldName: 'disableExpertiseGemming',
label: 'Disable expertise gemming',
labelTooltip: 'Disables auto gemming for expertise',
});

export const ShoutPicker = InputHelpers.makeSpecOptionsEnumIconInput<Spec.SpecWarrior, WarriorShout>({
fieldName: 'shout',
values: [
Expand Down
1 change: 1 addition & 0 deletions ui/warrior/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export const DefaultOptions = WarriorOptions.create({
startingRage: 0,
useRecklessness: true,
useShatteringThrow: true,
disableExpertiseGemming: false,
shout: WarriorShout.WarriorShoutCommanding,
});

Expand Down
3 changes: 2 additions & 1 deletion ui/warrior/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class WarriorSimUI extends IndividualSimUI<Spec.SpecWarrior> {
const redGemCaps = new Array<[number, Stats]>();
redGemCaps.push([40117, this.calcArpCap(optimizedGear)]);
// Should we gem expertise?
const enableExpertiseGemming = !this.player.getDisableExpertiseGemming()
const enableExpertiseGemming = !this.player.getSpecOptions().disableExpertiseGemming
const expCap = this.calcExpCap();
if(enableExpertiseGemming){
redGemCaps.push([40118, expCap]);
Expand All @@ -238,6 +238,7 @@ export class WarriorSimUI extends IndividualSimUI<Spec.SpecWarrior> {
yellowGemCaps.push([40125, hitCap]);
if(enableExpertiseGemming){
yellowGemCaps.push([40162, hitCap.add(expCap)]);
yellowGemCaps.push([40118, expCap]);
}
yellowGemCaps.push([40143, hitCap]);
yellowGemCaps.push([40142, critCap]);
Expand Down

0 comments on commit ba92548

Please sign in to comment.