Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT]: Miss Sound Preference #3869

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions source/funkin/Preferences.hx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,25 @@ class Preferences
return value;
}

/**
* If enabled, the miss sound will play when the player misses a note.
* @default `true`
*/
public static var playMissSound(get, set):Bool;

static function get_playMissSound():Bool
{
return Save?.instance?.options?.playMissSound;
}

static function set_playMissSound(value:Bool):Bool
{
var save:Save = Save.instance;
save.options.playMissSound = value;
save.flush();
return value;
}

/**
* If disabled, flashing lights in the main menu and other areas will be less intense.
* @default `true`
Expand Down
5 changes: 4 additions & 1 deletion source/funkin/play/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2638,7 +2638,10 @@ class PlayState extends MusicBeatSubState
if (playSound)
{
vocals.playerVolume = 0;
FunkinSound.playOnce(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.5, 0.6));
if (Preferences.playMissSound)
{
FunkinSound.playOnce(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.5, 0.6));
}
}
}

Expand Down
7 changes: 7 additions & 0 deletions source/funkin/save/Save.hx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class Save
downscroll: false,
flashingLights: true,
zoomCamera: true,
playMissSound: false,
debugDisplay: false,
autoPause: true,
inputOffset: 0,
Expand Down Expand Up @@ -1299,6 +1300,12 @@ typedef SaveDataOptions =
*/
var zoomCamera:Bool;

/**
* If enabled, the miss sound will play when the player misses a note.
* @default `true`
*/
var playMissSound:Bool;

/**
* If enabled, an FPS and memory counter will be displayed even if this is not a debug build.
* @default `false`
Expand Down
15 changes: 9 additions & 6 deletions source/funkin/ui/options/PreferencesMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,25 @@ class PreferencesMenu extends Page
*/
function createPrefItems():Void
{
createPrefItemCheckbox('Naughtyness', 'Toggle displaying raunchy content', function(value:Bool):Void {
createPrefItemCheckbox('Naughtyness', 'Toggle displaying raunchy content.', function(value:Bool):Void {
Preferences.naughtyness = value;
}, Preferences.naughtyness);
createPrefItemCheckbox('Downscroll', 'Enable to make notes move downwards', function(value:Bool):Void {
createPrefItemCheckbox('Downscroll', 'Enable to make notes move downwards.', function(value:Bool):Void {
Preferences.downscroll = value;
}, Preferences.downscroll);
createPrefItemCheckbox('Flashing Lights', 'Disable to dampen flashing effects', function(value:Bool):Void {
createPrefItemCheckbox('Flashing Lights', 'Disable to dampen flashing effects.', function(value:Bool):Void {
Preferences.flashingLights = value;
}, Preferences.flashingLights);
createPrefItemCheckbox('Camera Zooming on Beat', 'Disable to stop the camera bouncing to the song', function(value:Bool):Void {
createPrefItemCheckbox('Camera Zooming on Beat', 'Disable to stop the camera bouncing to the song.', function(value:Bool):Void {
Preferences.zoomCamera = value;
}, Preferences.zoomCamera);
createPrefItemCheckbox('Debug Display', 'Enable to show FPS and other debug stats', function(value:Bool):Void {
createPrefItemCheckbox('Play Miss Sound', 'Disable to stop the miss sound from playing when a miss happens.', function(value:Bool):Void {
Preferences.playMissSound = value;
}, Preferences.playMissSound);
createPrefItemCheckbox('Debug Display', 'Enable to show FPS and other debug stats.', function(value:Bool):Void {
Preferences.debugDisplay = value;
}, Preferences.debugDisplay);
createPrefItemCheckbox('Auto Pause', 'Automatically pause the game when it loses focus', function(value:Bool):Void {
createPrefItemCheckbox('Auto Pause', 'Automatically pause the game when it loses focus.', function(value:Bool):Void {
Preferences.autoPause = value;
}, Preferences.autoPause);

Expand Down
Loading