Skip to content

Commit c6b0682

Browse files
committed
Fix HTML5 Compiling Issues
1 parent c233ac7 commit c6b0682

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

source/funkin/Preferences.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ class Preferences
415415
return value;
416416
}
417417

418+
#if desktop
418419
/**
419420
* What audio device should it playback sounds to.
420421
* @default Default
@@ -438,6 +439,7 @@ class Preferences
438439

439440
return value;
440441
}
442+
#end
441443

442444
/**
443445
* If enabled, the game will hide the mouse when taking a screenshot.
@@ -508,6 +510,7 @@ class Preferences
508510
setDebugDisplayMode(Preferences.debugDisplay);
509511
setDebugDisplayBGOpacity(Preferences.debugDisplayBGOpacity / 100);
510512

513+
#if desktop
511514
// Apply audio device preference, if failed, fallback to Default.
512515
FlxG.sound.deviceName = Preferences.audioDevice;
513516
if (FlxG.sound.deviceName == Preferences.audioDevice)
@@ -519,6 +522,7 @@ class Preferences
519522
Preferences.audioDevice = "Default";
520523
FlxG.sound.automaticDefaultDevice = true;
521524
}
525+
#end
522526

523527
#if web
524528
toggleFramerateCap(Preferences.unlockedFramerate);

source/funkin/ui/options/PreferencesMenu.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,11 @@ class PreferencesMenu extends Page<OptionsState.OptionsMenuPageName>
382382
{
383383
camFollow.setPosition(640, 30);
384384
menuCamera.snapToTarget();
385+
#if desktop
385386
FlxG.sound.onDefaultDeviceChanged.remove(refreshAudioDeviceItem);
386387
FlxG.sound.onDeviceAdded.remove(refreshAudioDeviceItem);
387388
FlxG.sound.onDeviceRemoved.remove(refreshAudioDeviceItem);
389+
#end
388390
super.exit();
389391
}
390392
}

0 commit comments

Comments
 (0)