Skip to content

Commit c9569b3

Browse files
committed
fix: audio setting bugs
1 parent 88f5355 commit c9569b3

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# UnderScript Changelog
22

3+
## Version 0.62.3 (2025-04-09)
4+
1. Fixed bugs with game sounds (including April fools)
5+
36
## Version 0.62.2 (2025-04-09)
47
1. Fixed April Fools setting being too aggressive
58
1. Fixed April Fools messing up persistent background

src/base/game/sound.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import eventManager from '../../utils/eventManager.js';
22
import * as settings from '../../utils/settings/index.js';
33
import { global, globalSet } from '../../utils/global.js';
44
import { isApril, AUDIO } from '../../utils/isApril.js';
5+
import { isSoftDisabled } from '../vanilla/aprilFools.js';
56

67
const baseVolumeSettings = { type: 'slider', page: 'Audio', max: 0.5, step: 0.01, default: 0.2, reset: true };
78
let active = false;
@@ -24,7 +25,7 @@ const aprilFoolsMusic = settings.register({
2425
name: 'Enable April Fools Music',
2526
key: 'underscript.audio.override.aprilFools',
2627
default: true,
27-
hidden: () => !isApril(),
28+
hidden: () => !isApril() || isSoftDisabled(),
2829
page: 'Audio',
2930
});
3031

@@ -98,7 +99,7 @@ function pauseMusic() {
9899
}
99100

100101
function enableAprilFools() {
101-
return isApril() && aprilFoolsMusic.value;
102+
return isApril() && aprilFoolsMusic.value() && !isSoftDisabled();
102103
}
103104

104105
function musicPath() {
@@ -110,7 +111,7 @@ function overrideResult(name) {
110111
const event = eventManager.cancelable.emit('playMusic', data);
111112
if (!resultEnabled.value() || !data.name || event.canceled) return;
112113
pauseMusic();
113-
if (!enable.value) {
114+
if (!enable.value()) {
114115
this.super(data.name);
115116
return;
116117
}
@@ -125,7 +126,7 @@ function overrideMusic(name) {
125126
const event = eventManager.cancelable.emit('playBackgroundMusic', data);
126127
if (!bgmEnabled.value() || !data.name || event.canceled) return;
127128
pauseMusic();
128-
if (!enable.value) {
129+
if (!enable.value()) {
129130
this.super(data.name);
130131
return;
131132
}
@@ -139,7 +140,7 @@ function overrideSound(name) {
139140
const data = { name, origin: name };
140141
const event = eventManager.cancelable.emit('playSound', data);
141142
if (!soundEnabled.value() || !data.name || event.canceled) return;
142-
if (!enable.value) {
143+
if (!enable.value()) {
143144
this.super(data.name);
144145
return;
145146
}
@@ -153,7 +154,7 @@ function overrideJingle(name = '') {
153154
const event = eventManager.cancelable.emit('playJingle', data);
154155
if (!jingleEnabled.value() || !data.name || event.canceled) return;
155156
pauseMusic();
156-
if (!enable.value) {
157+
if (!enable.value()) {
157158
this.super(data.name);
158159
return;
159160
}

0 commit comments

Comments
 (0)