diff --git a/assets/preload/music/flyAgainBro.mp3 b/assets/preload/music/flyAgainBro.mp3 new file mode 100644 index 00000000..782f7ed4 Binary files /dev/null and b/assets/preload/music/flyAgainBro.mp3 differ diff --git a/assets/preload/music/flyAgainBro.ogg b/assets/preload/music/flyAgainBro.ogg new file mode 100644 index 00000000..dd919e7e Binary files /dev/null and b/assets/preload/music/flyAgainBro.ogg differ diff --git a/source/ClientPrefs.hx b/source/ClientPrefs.hx index 50639844..b1049459 100644 --- a/source/ClientPrefs.hx +++ b/source/ClientPrefs.hx @@ -39,6 +39,7 @@ class ClientPrefs { public static var crazycounter:Bool = false; // The reason it is called like that is bc it can mess with some things public static var camfollow:Bool = true; // No other name cuz it can mess with some others things public static var multiplicativeValue:Float = 0; + public static var musicSelected:String = 'freakyMenu'; public static var gameplaySettings:Map = [ 'scrollspeed' => 1.0, 'scrolltype' => 'multiplicative', @@ -107,6 +108,7 @@ class ClientPrefs { FlxG.save.data.middleScroll = middleScroll; FlxG.save.data.showFPS = showFPS; FlxG.save.data.flashing = flashing; + FlxG.save.data.musicSelected = musicSelected; FlxG.save.data.globalAntialiasing = globalAntialiasing; FlxG.save.data.noteSplashes = noteSplashes; FlxG.save.data.lowQuality = lowQuality; @@ -167,6 +169,9 @@ class ClientPrefs { if(FlxG.save.data.middleScroll != null) { middleScroll = FlxG.save.data.middleScroll; } + if(FlxG.save.data.musicSelected != null) { + musicSelected = FlxG.save.data.musicSelected; + } if(FlxG.save.data.iconBounce != null) { iconBounce = FlxG.save.data.iconBounce; } diff --git a/source/TitleState.hx b/source/TitleState.hx index 4f148ba3..10fe8147 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -253,7 +253,7 @@ class TitleState extends MusicBeatState // music.play(); if(FlxG.sound.music == null) { - FlxG.sound.playMusic(Paths.music('freakyMenu'), 0); + FlxG.sound.playMusic(Paths.music(ClientPrefs.musicSelected), 0); FlxG.sound.music.fadeIn(4, 0, 0.7); } @@ -736,7 +736,7 @@ class TitleState extends MusicBeatState skippedIntro = true; playJingle = false; - FlxG.sound.playMusic(Paths.music('freakyMenu'), 0); + FlxG.sound.playMusic(Paths.music(ClientPrefs.musicSelected), 0); FlxG.sound.music.fadeIn(4, 0, 0.7); return; } @@ -756,7 +756,7 @@ class TitleState extends MusicBeatState removeThings(); FlxG.camera.flash(FlxColor.WHITE, 3); sound.onComplete = function() { - FlxG.sound.playMusic(Paths.music('freakyMenu'), 0); + FlxG.sound.playMusic(Paths.music(ClientPrefs.musicSelected), 0); FlxG.sound.music.fadeIn(4, 0, 0.7); transitioning = false; }; diff --git a/source/options/GameplaySettingsSubState.hx b/source/options/GameplaySettingsSubState.hx index 09ae1e44..5696675b 100644 --- a/source/options/GameplaySettingsSubState.hx +++ b/source/options/GameplaySettingsSubState.hx @@ -81,25 +81,6 @@ class GameplaySettingsSubState extends BaseOptionsMenu false); addOption(option); - var option:Option = new Option('Hitsound Volume', - 'Funny notes does \"Tick!\" when you hit them."', - 'hitsoundVolume', - 'percent', - 0); - addOption(option); - option.scrollSpeed = 1.6; - option.minValue = 0.0; - option.maxValue = 1; - if(FlxG.keys.pressed.SHIFT) { - if(ClientPrefs.multiplicativeValue > 0) { - option.changeValue = ClientPrefs.multiplicativeValue; - } else { - option.changeValue = 0.5; - } - } else { - option.changeValue = 0.1; - } - option.decimals = 1; var option:Option = new Option('Rating Offset', 'Changes how late/early you have to hit for a "Sick!"\nHigher values mean you have to hit later.', diff --git a/source/options/MusicSettingsSubState.hx b/source/options/MusicSettingsSubState.hx new file mode 100644 index 00000000..cb44b672 --- /dev/null +++ b/source/options/MusicSettingsSubState.hx @@ -0,0 +1,117 @@ +package options; + +#if desktop +import Discord.DiscordClient; +#end +import flash.text.TextField; +import flixel.FlxCamera; +import flixel.FlxG; +import flixel.FlxSprite; +import flixel.addons.display.FlxGridOverlay; +import flixel.group.FlxGroup.FlxTypedGroup; +import flixel.math.FlxMath; +import flixel.text.FlxText; +import flixel.util.FlxColor; +import lime.utils.Assets; +import flixel.FlxSubState; +import flash.text.TextField; +import flixel.FlxG; +import flixel.FlxSprite; +import flixel.util.FlxSave; +import haxe.Json; +import flixel.tweens.FlxEase; +import flixel.tweens.FlxTween; +import flixel.util.FlxTimer; +import flixel.input.keyboard.FlxKey; +import flixel.graphics.FlxGraphic; +import Controls; +import openfl.Lib; + +using StringTools; + +class MusicSettingsSubState extends BaseOptionsMenu +{ + public function new() + { + title = 'Music'; + rpcTitle = 'Music Settings Menu'; //for Discord Rich Presence + + //I'd suggest using "Low Quality" as an example for making your own option since it is the simplest here + /*var option:Option = new Option('Low Quality', //Name + 'If checked, disables some background details,\ndecreases loading times and improves performance.', //Description + 'lowQuality', //Save data variable name + 'bool', //Variable type + false); //Default value + addOption(option);*/ + + /* + var option:Option = new Option('Persistent Cached Data', + 'If checked, images loaded will stay in memory\nuntil the game is closed, this increases memory usage,\nbut basically makes reloading times instant.', + 'imagesPersist', + 'bool', + false); + option.onChange = onChangePersistentData; //Persistent Cached Data changes FlxGraphic.defaultPersist + addOption(option); + */ + + /*var option:Option = new Option('Music', + 'What music you want to play', + 'musicSelected', + 'String', + 'freakyMenu', + ['freakyMenu', 'offsetSong', 'breakfast', 'tea-time', 'flyAgainBro']); + addOption(option);*/ + + var option:Option = new Option('Hitsound Volume', + 'Funny notes does \"Tick!\" when you hit them."', + 'hitsoundVolume', + 'percent', + 0); + addOption(option); + option.scrollSpeed = 1.6; + option.minValue = 0.0; + option.maxValue = 1; + if(FlxG.keys.pressed.SHIFT) { + if(ClientPrefs.multiplicativeValue > 0) { + option.changeValue = ClientPrefs.multiplicativeValue; + } else { + option.changeValue = 0.5; + } + } else { + option.changeValue = 0.1; + } + option.decimals = 1; + + + var option:Option = new Option('Pause Screen Song:', + "What song do you prefer for the Pause Screen?", + 'pauseMusic', + 'string', + 'Tea Time', + ['None', 'Breakfast', 'Tea Time']); + addOption(option); + option.onChange = onChangePauseMusic; + + + super(); + } + + var changedMusic:Bool = false; + function onChangePauseMusic() + { + if(ClientPrefs.pauseMusic == 'None') { + FlxG.sound.music.volume = 0; + } else { + FlxG.sound.playMusic(Paths.music(Paths.formatToSongPath(ClientPrefs.pauseMusic))); + } + + changedMusic = true; + } + + override function destroy() + { + if(changedMusic) FlxG.sound.playMusic(Paths.music('freakyMenu')); + super.destroy(); + } + +} diff --git a/source/options/OptionsState.hx b/source/options/OptionsState.hx index e6cc29ec..b73f50ed 100644 --- a/source/options/OptionsState.hx +++ b/source/options/OptionsState.hx @@ -30,7 +30,7 @@ using StringTools; class OptionsState extends MusicBeatState { - var options:Array = ['Note Colors', 'Controls', 'Adjust Delay and Combo', 'Graphics', 'Visuals and UI', 'Gameplay']; + var options:Array = ['Note Colors', 'Controls', 'Adjust Delay and Combo', 'Graphics', 'Visuals and UI', 'Gameplay', 'Music']; private var grpOptions:FlxTypedGroup; private static var curSelected:Int = 0; public static var menuBG:FlxSprite; @@ -47,6 +47,8 @@ class OptionsState extends MusicBeatState openSubState(new options.VisualsUISubState()); case 'Gameplay': openSubState(new options.GameplaySettingsSubState()); + case 'Music': + openSubState(new options.MusicSettingsSubState()); case 'Adjust Delay and Combo': LoadingState.loadAndSwitchState(new options.NoteOffsetState()); } diff --git a/source/options/VisualsUISubState.hx b/source/options/VisualsUISubState.hx index 4ff2a09b..90d901d6 100644 --- a/source/options/VisualsUISubState.hx +++ b/source/options/VisualsUISubState.hx @@ -158,35 +158,10 @@ class VisualsUISubState extends BaseOptionsMenu option.onChange = onChangeFPSCounter; #end - var option:Option = new Option('Pause Screen Song:', - "What song do you prefer for the Pause Screen?", - 'pauseMusic', - 'string', - 'Tea Time', - ['None', 'Breakfast', 'Tea Time']); - addOption(option); - option.onChange = onChangePauseMusic; super(); } - var changedMusic:Bool = false; - function onChangePauseMusic() - { - if(ClientPrefs.pauseMusic == 'None') - FlxG.sound.music.volume = 0; - else - FlxG.sound.playMusic(Paths.music(Paths.formatToSongPath(ClientPrefs.pauseMusic))); - - changedMusic = true; - } - - override function destroy() - { - if(changedMusic) FlxG.sound.playMusic(Paths.music('freakyMenu')); - super.destroy(); - } - #if !mobile