Skip to content

Commit

Permalink
jobs: countdown volume option (#5834)
Browse files Browse the repository at this point in the history
  • Loading branch information
g0shu authored Oct 6, 2023
1 parent a702f26 commit 19bee72
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ui/jobs/bars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ export class Bars {
this.o.pullCountdown.duration = seconds;
if (inCountdown && this.options.PlayCountdownSound) {
const audio = new Audio('../../resources/sounds/freesound/sonar.webm');
audio.volume = 0.3;
audio.volume = this.options.CountdownSoundVolume;
void audio.play();
}
}
Expand Down
8 changes: 8 additions & 0 deletions ui/jobs/jobs_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ UserConfig.registerOptions('jobs', {
type: 'checkbox',
default: true,
},
{
id: 'CountdownSoundVolume',
name: {
en: 'Countdown sound volume',
},
type: 'float',
default: 0.3,
},
{
id: 'HideWellFedAboveSeconds',
name: {
Expand Down
2 changes: 2 additions & 0 deletions ui/jobs/jobs_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface JobsNonConfigOptions {
LowerOpacityOutOfCombat: boolean;
OpacityOutOfCombat: number;
PlayCountdownSound: boolean;
CountdownSoundVolume: number;
HideWellFedAboveSeconds: number;
ShowMPTickerOutOfCombat: boolean;
MidHealthThresholdPercent: number;
Expand Down Expand Up @@ -53,6 +54,7 @@ const defaultJobsNonConfigOptions: JobsNonConfigOptions = {
LowerOpacityOutOfCombat: true,
OpacityOutOfCombat: 0.5,
PlayCountdownSound: true,
CountdownSoundVolume: 0.3,
HideWellFedAboveSeconds: 15 * 60,
ShowMPTickerOutOfCombat: false,
MidHealthThresholdPercent: 0.8,
Expand Down

0 comments on commit 19bee72

Please sign in to comment.