From 924eb1a2fd12a6149c55ef4ee5eb43ed44cb3dc1 Mon Sep 17 00:00:00 2001 From: nwjgit Date: Thu, 5 Oct 2023 14:36:59 -0500 Subject: [PATCH] Toggle for wilderness high peak time warning --- src/lib/constants.ts | 8 +++++++- src/mahoji/commands/config.ts | 4 ++++ src/mahoji/lib/abstracted_commands/minionKill.ts | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 203e8ae9f5..447f42a4f2 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -256,7 +256,8 @@ export enum BitField { UsedFrozenTablet = 34, CleanHerbsFarming = 35, SelfGamblingLocked = 36, - DisabledFarmingReminders = 37 + DisabledFarmingReminders = 37, + DisableHighPeakTimeWarning = 38 } interface BitFieldData { @@ -336,6 +337,11 @@ export const BitFieldData: Record = { name: 'Disable Farming Reminders', protected: false, userConfigurable: true + }, + [BitField.DisableHighPeakTimeWarning]: { + name: 'Disable Wilderness High Peak Time Warning', + protected: false, + userConfigurable: true } } as const; diff --git a/src/mahoji/commands/config.ts b/src/mahoji/commands/config.ts index 150c11f6a7..428c542d20 100644 --- a/src/mahoji/commands/config.ts +++ b/src/mahoji/commands/config.ts @@ -118,6 +118,10 @@ const toggles: UserConfigToggle[] = [ { name: 'Disable farming reminders', bit: BitField.DisabledFarmingReminders + }, + { + name: 'Disable wilderness high peak time warning', + bit: BitField.DisableHighPeakTimeWarning } ]; diff --git a/src/mahoji/lib/abstracted_commands/minionKill.ts b/src/mahoji/lib/abstracted_commands/minionKill.ts index 7f7db986f3..9fd0b84a0b 100644 --- a/src/mahoji/lib/abstracted_commands/minionKill.ts +++ b/src/mahoji/lib/abstracted_commands/minionKill.ts @@ -16,7 +16,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'; @@ -606,7 +606,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,