Skip to content

Commit 047b679

Browse files
committed
fix: april fools background image
1 parent 6c93095 commit 047b679

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
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 April Fools messing up persistent background
5+
36
## Version 0.62.2 (2025-04-09)
47
1. Fixed April Fools setting being too aggressive
58

src/base/game/persistBGM.js

Lines changed: 2 additions & 1 deletion
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 } from '../../utils/global.js';
44
import { isApril, IMAGES } from '../../utils/isApril.js';
5+
import { aprilFools } from '../vanilla/aprilFools.js';
56

67
const setting = settings.register({
78
name: 'Persist Arena (Background and Music)',
@@ -15,7 +16,7 @@ eventManager.on('GameStart', () => {
1516
eventManager.on('connect', (data) => {
1617
const val = sessionStorage.getItem(`underscript.bgm.${data.gameId}`);
1718
if (setting.value() && val) {
18-
const path = isApril() ? IMAGES : 'images';
19+
const path = isApril() && !aprilFools.value() ? IMAGES : 'images';
1920
$('body').css('background-image', `url('${path}/backgrounds/${val}.png')`);
2021
// Check special skins
2122
if (data.gameType !== 'BOSS' && global('profileSkinsEnabled')) {

src/base/vanilla/aprilFools.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as settings from '../../utils/settings/index.js';
33
import { isApril, IMAGES } from '../../utils/isApril.js';
44

55
const year = `${new Date().getFullYear()}`;
6-
const aprilFools = settings.register({
6+
export const aprilFools = settings.register({
77
name: 'Disable April Fools Jokes',
88
key: 'underscript.disable.fishday',
99
note: 'Disables *almost* everything.',
@@ -13,7 +13,8 @@ const aprilFools = settings.register({
1313
toggleFish($('body'));
1414
},
1515
});
16-
function isSoftDisabled() {
16+
17+
export function isSoftDisabled() {
1718
return localStorage.getItem(aprilFools.key) === year;
1819
}
1920

@@ -26,10 +27,10 @@ function toggleFish($el) {
2627

2728
$el.find(`img[src*="undercards.net/${search}/"],img[src^="/${search}/"],img[src^="${search}/"]`).each((_, img) => {
2829
img.src = img.src.replace(search, replace);
29-
}).on('error', () => aprilFools.set(year));
30+
}).one('error', () => aprilFools.set(year));
3031
$el.find(`[style*="url(\\"${search}/"]`).each((i, img) => {
3132
img.style.background = img.style.background.replace(search, replace);
32-
}).on('error', () => aprilFools.set(year));
33+
}).one('error', () => aprilFools.set(year));
3334
}
3435

3536
eventManager.on('undercards:season', () => {

0 commit comments

Comments
 (0)