Skip to content

Commit

Permalink
Toggle for wilderness high peak time warning (#5411)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwjgit authored Feb 13, 2024
1 parent 4af59ed commit 3267641
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ export enum BitField {
SelfGamblingLocked = 36,
DisabledFarmingReminders = 37,
DisableClueButtons = 38,
DisableAutoSlayButton = 39
DisableAutoSlayButton = 39,
DisableHighPeakTimeWarning = 40
}

interface BitFieldData {
Expand Down Expand Up @@ -350,6 +351,11 @@ export const BitFieldData: Record<BitField, BitFieldData> = {
name: 'Disable Auto Slay Button',
protected: false,
userConfigurable: true
},
[BitField.DisableHighPeakTimeWarning]: {
name: 'Disable Wilderness High Peak Time Warning',
protected: false,
userConfigurable: true
}
} as const;

Expand Down
4 changes: 4 additions & 0 deletions src/mahoji/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ const toggles: UserConfigToggle[] = [
{
name: 'Disable Clue Buttons',
bit: BitField.DisableClueButtons
},
{
name: 'Disable wilderness high peak time warning',
bit: BitField.DisableHighPeakTimeWarning
}
];

Expand Down
4 changes: 2 additions & 2 deletions src/mahoji/lib/abstracted_commands/minionKill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Bank, Monsters } from 'oldschooljs';
import { MonsterAttribute } from 'oldschooljs/dist/meta/monsterData';
import { itemID } from 'oldschooljs/dist/util';

import { PeakTier, PvMMethod } from '../../../lib/constants';
import { BitField, PeakTier, PvMMethod } from '../../../lib/constants';
import { Eatables } from '../../../lib/data/eatables';
import { getSimilarItems } from '../../../lib/data/similarItems';
import { checkUserCanUseDegradeableItem, degradeablePvmBoostItems, degradeItem } from '../../../lib/degradeableItems';
Expand Down Expand Up @@ -689,7 +689,7 @@ export async function minionKillCommand(
break;
}
}
if (wildyPeak?.peakTier === PeakTier.High) {
if (wildyPeak?.peakTier === PeakTier.High && !user.bitfield.includes(BitField.DisableHighPeakTimeWarning)) {
if (interaction) {
await handleMahojiConfirmation(
interaction,
Expand Down

0 comments on commit 3267641

Please sign in to comment.