diff --git a/source/FinishSubState.hx b/source/FinishSubState.hx index 7cebbd0..b5ee467 100644 --- a/source/FinishSubState.hx +++ b/source/FinishSubState.hx @@ -173,27 +173,28 @@ class FinishSubState extends MusicBeatSubstate pauseGame = true; autoEnd = true; FlxG.sound.pause(); - - if(endingMusic == null){ - music = new FlxSound().loadEmbedded(SELoader.cache.loadSound( win ? 'assets/shared/music/resultsNORMAL.ogg' : 'assets/shared/music/resultsSHIT.ogg' ), true, true); + if(win && SESave.data.resultsInst){ + FlxG.sound.music.play(); }else{ - music = new FlxSound().loadEmbedded(endingMusic , true, true); + music = new FlxSound().loadEmbedded(endingMusic ?? SELoader.cache.loadSound( win ? 'assets/shared/music/resultsNORMAL.ogg' : 'assets/shared/music/resultsSHIT.ogg' ), true, true); + music.play(false); + + if(!win && endingMusic == null){ + music.looped = false; + music.onComplete = function(){ + music = new FlxSound().loadEmbedded(SELoader.cache.loadSound('assets/shared/music/breakfast.ogg'), true, true); + music.play(false); + FlxG.sound.list.add(music); + } + } + FlxG.sound.list.add(music); } - music.play(false); - if(!win && endingMusic == null){ - music.looped = false; - music.onComplete = function(){ - music = new FlxSound().loadEmbedded(SELoader.cache.loadSound('assets/shared/music/breakfast.ogg'), true, true); - music.play(false); - FlxG.sound.list.add(music); - } + - } endingMusic = null; shownResults = true; - FlxG.sound.list.add(music); if(isError){ var finishedText:FlxText = new FlxText(20,-55,0, "Error caught!" ); finishedText.size = 32; diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index 0235bd3..0f3df5e 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -149,7 +149,7 @@ class MainMenuState extends SickMenuState { 32,(nightly==""?FlxColor.RED:FlxColor.WHITE),CENTER); outdatedLMAO.screenCenter(FlxAxes.X); add(outdatedLMAO); - }else + } // Whole bunch of checks to prevent crashing if (TitleState.retChar(SESave.data.playerChar) == "" && SESave.data.playerChar != "automatic"){ errorMessage += '\n${SESave.data.playerChar} is an invalid player! Reset back to BF!'; diff --git a/source/MusicBeatState.hx b/source/MusicBeatState.hx index 7f96caa..5590a32 100644 --- a/source/MusicBeatState.hx +++ b/source/MusicBeatState.hx @@ -368,9 +368,12 @@ class MusicBeatState extends FlxUIState { public static function switchState(nextState:FlxState){ return FlxG.switchState(nextState); } + public var shouldTransitionIn:Bool = true; + public var shouldTransitionOut:Bool = true; function tranIn(){ // Replace with empty functions to disable - + LoadingScreen.hide(); + if(!shouldTransitionIn) return; var oldY = FlxG.camera.x; FlxG.camera.x -= 300; FlxTween.tween(FlxG.camera, {x:oldY},0.7,{ease: FlxEase.expoOut}); @@ -378,12 +381,10 @@ class MusicBeatState extends FlxUIState { FlxG.camera.zoom += 1; FlxTween.tween(FlxG.camera, {zoom:oldZoom},0.7,{ease: FlxEase.expoOut}); - LoadingScreen.hide(); } function tranOut(){ - // active = false; - + if(!shouldTransitionOut) return; if(loading) LoadingScreen.show(); diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index a374722..c49b88b 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -219,6 +219,7 @@ class OptionsMenu extends MusicBeatState new VolumeOption("se.options.volume.other","other"), new HCBoolOption("Animation debug Music","Whether to play music for animation debug or continue playing the current song","animDebugMusic"), new HCBoolOption("Options Menu Music","Whether to play music for the options menu or continue playing the current song","optionsMusic"), + new HCBoolOption("Use current song for results","Loops the current playing song for results","resultsInst"), new HCBoolOption("Miss Sounds","Play a sound when you miss",'playMisses'), new HCBoolOption("Hit Sounds","Play a click when you hit a note. Uses osu!'s sounds or your mods/hitsound.ogg",'hitSound'), new HCBoolOption("Play Character Voices","Plays the voices a character has when you press a note.","playVoices"), diff --git a/source/PlayState.hx b/source/PlayState.hx index 11c76b3..c2992af 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2746,8 +2746,7 @@ class PlayState extends ScriptMusicBeatState } - private function keyShit():Void - {try{doKeyShit();}catch(e){handleError('Error during keyshit: ${e.message}\n ${e.stack}');}} + private function keyShit():Void {try{doKeyShit();}catch(e){handleError('Error during keyshit: ${e.message}\n ${e.stack}');}} public var doKeyShit:()->Void = function():Void{throw("I can't handle key inputs? Please report this!");}; public var noteShit:()->Void = function():Void{throw("I can't handle input for some reason, Please report this!");}; public var goodNoteHit:(Note, ?Bool)->Void = function(note:Note, ?resetMashViolation:Bool = true):Void{throw("I cant register any note hits!");}; diff --git a/source/SickMenuState.hx b/source/SickMenuState.hx index 282f46e..c063d19 100644 --- a/source/SickMenuState.hx +++ b/source/SickMenuState.hx @@ -163,30 +163,32 @@ class SickMenuState extends ScriptMusicBeatState trace('${e.stack}'); } } - - override function create() { - // if (ChartingState.charting) ChartingState.charting = false; - SearchMenuState.resetVars(); - // if (SESave.data.songUnload && PlayState.SONG != null) {PlayState.SONG = null;} - // PlayState.songScript = "";PlayState.hsBrTools = null; + override function new(){ if(SearchMenuState.background == null){ try{ - - SearchMenuState.background = if(SELoader.exists("mods/bg.png")) SELoader.loadGraphic("mods/bg.png",true); else SELoader.loadGraphic("assets/images/menuDesat.png",true); - SearchMenuState.backgroundOver = if(SELoader.exists("mods/fg.png")) SELoader.loadGraphic("mods/fg.png",true); else FlxGraphic.fromRectangle(0,0,0x00000000); + SearchMenuState.background = SELoader.exists("mods/bg.png") ? SELoader.loadGraphic("mods/bg.png",true) : SELoader.loadGraphic("assets/images/menuDesat.png",true); + SearchMenuState.backgroundOver = SELoader.exists("mods/fg.png") ? SELoader.loadGraphic("mods/fg.png",true) : FlxGraphic.fromRectangle(0,0,0); }catch(e){trace('Unable to load background! ${e.message}');} if(SearchMenuState.background == null) SearchMenuState.background = FlxGraphic.fromRectangle(0,0,0xff110015); SearchMenuState.background.persist = SearchMenuState.backgroundOver.persist = true; SearchMenuState.background.destroyOnNoUse = SearchMenuState.backgroundOver.destroyOnNoUse = false; } - - if(bg == null){ - bg = new FlxSprite().loadGraphic(SearchMenuState.background); bg.color = 0xFFFF6E6E; } bg.scrollFactor.set(0.01,0.01); + super(); + } + override function create() { + // if (ChartingState.charting) ChartingState.charting = false; + SearchMenuState.resetVars(); + // if (SESave.data.songUnload && PlayState.SONG != null) {PlayState.SONG = null;} + // PlayState.songScript = "";PlayState.hsBrTools = null; + + + + add(bg); if(SearchMenuState.backgroundOver != null){ diff --git a/source/TitleState.hx b/source/TitleState.hx index d693d5a..92c095e 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -1143,7 +1143,7 @@ class TitleState extends MusicBeatState android.widget.Toast.makeText('Update check skipped due to lack of internet permissions',20); } #end - FlxG.switchState(if(FlxG.keys.pressed.SHIFT) new OptionsMenu() else new MainMenuState()); + FlxG.switchState(FlxG.keys.pressed.SHIFT ? new OptionsMenu() : new MainMenuState()); }else{ new FlxTimer().start(0.5,function(_){try{updateCheck = true;}catch(e){}}); @@ -1201,9 +1201,21 @@ class TitleState extends MusicBeatState // if(superLogo != null && superLogo is FlxSprite)(cast superLogo).graphic.destroy(); if(superLogo != null) superLogo.destroy(); // FlxTween.tween(FlxG.camera.scroll,{y:-300},4,{ease:FlxEase.cubeOut}); - FlxTween.tween(logoBl,{y:-300},4,{ease:FlxEase.cubeOut}); - FlxTween.tween(titleText,{y:740},4,{ease:FlxEase.cubeOut}); - FlxG.switchState(if(FlxG.keys.pressed.SHIFT) new OptionsMenu() else new MainMenuState()); + if(FlxG.keys.pressed.SHIFT){ + FlxG.switchState(new OptionsMenu()); + return; + } + var state = new MainMenuState(); + state.shouldTransitionIn = false; + FlxTween.tween(logoBl,{y:-300,alpha:0},0.5,{ease:FlxEase.cubeOut}); + FlxTween.tween(titleText,{y:740,alpha:0},0.5,{ease:FlxEase.cubeOut,onComplete:(_)->{ + + FlxG.camera.alpha = 0; + FlxG.switchState(state); + + }}); + + } function createCoolText(textArray:Array,yOffset:Int = 200) @@ -1238,6 +1250,8 @@ class TitleState extends MusicBeatState textGroup.remove(textGroup.members[0], true); } } + var tweensy:FlxTween; + var tweenr:FlxTween; var tweeny:FlxTween; var ttBounce:FlxTween; var cachingText:Alphabet; @@ -1250,11 +1264,14 @@ class TitleState extends MusicBeatState if(beatAmounts.exists(curBeat)) beatIntensity = beatAmounts[curBeat]; if (logoBl != null){ + if(tweensy != null)tweensy.cancel(); if(tweeny != null)tweeny.cancel(); + if(tweenr != null)tweenr.cancel(); var amount = 0.9 + beatIntensity; logoBl.scale.set(amount,amount); // FlxTween.tween(logoBl.scale,{x:1,y:1},0.1); - tweeny = FlxTween.tween(logoBl.scale,{x:0.9,y:0.9},(60 / Conductor.bpm),{ease:FlxEase.expoOut}); + tweensy = FlxTween.tween(logoBl.scale,{x:0.9,y:0.9},(60 / Conductor.bpm),{ease:FlxEase.expoOut}); + tweenr = FlxTween.tween(logoBl,{angle:curBeat % 2 == 0 ? 15 : -15},(60 / Conductor.bpm),{ease:FlxEase.expoOut}); if(ttBounce != null)ttBounce.cancel(); titleText.scale.set(0.1 + amount,0.1 + amount); ttBounce = FlxTween.tween(titleText.scale,{x:1,y:1},(60 / Conductor.bpm),{ease:FlxEase.expoOut}); @@ -1375,7 +1392,7 @@ class TitleState extends MusicBeatState FlxG.camera.flash(FlxColor.WHITE, 2); remove(credGroup); skippedIntro = true; - FlxG.camera.scroll.x += 100; + // FlxG.camera.scroll.x += 100; FlxG.camera.scroll.y += 100; logoBl.screenCenter(); logoBl.y -= 100; @@ -1390,7 +1407,7 @@ class TitleState extends MusicBeatState titleText.color=0xffff8b0f; } - FlxTween.tween(FlxG.camera.scroll,{x: 0,y:0},1,{ease:FlxEase.cubeOut}); + FlxTween.tween(FlxG.camera.scroll,{y:0},1,{ease:FlxEase.cubeOut}); } override function stepHit(){ @@ -1418,9 +1435,8 @@ class TitleState extends MusicBeatState function showHaxe(){ _times = [0.041, 0.184, 0.334, 0.495, 0.636,1]; _colors = [0x00b922, 0xffc132, 0xf5274e, 0x3641ff, 0x04cdfb,0xFFFFFF,0xFFFFFF]; - _functions = [drawGreen, drawYellow, drawRed, drawBlue, drawLightBlue,function(){return;}]; - _sprite = new Sprite(); - FlxG.stage.addChild(_sprite); + _functions = [drawGreen, drawYellow, drawRed, drawBlue, drawLightBlue,()->{}]; + FlxG.stage.addChild(_sprite = new Sprite()); _gfx = _sprite.graphics; _sprite.filters = [new flash.filters.GlowFilter(0xFFFFFF,1,6,6,1,1)]; diff --git a/source/multi/MultiMenuState.hx b/source/multi/MultiMenuState.hx index 0ba8d6f..298820b 100644 --- a/source/multi/MultiMenuState.hx +++ b/source/multi/MultiMenuState.hx @@ -158,9 +158,15 @@ class MultiMenuState extends onlinemod.OfflineMenuState { function favChart(){ var songInfo = grpSongs.members[curSelected].menuValue; if(songInfo == null) return showTempmessage('This is not a song!',FlxColor.RED); - if(!SESave.data.favourites.remove(songInfo)){ + if(songInfo.favouriteID > 0){ + SESave.data.favourites.remove(SESave.data.favourites[songInfo.favouriteID-1]); + curSelected = 0; + }else{ SESave.data.favourites.push(songInfo); } + // if(!SESave.data.favourites.remove(songInfo)){ + // SESave.data.favourites.push(songInfo); + // } SEFlxSaveWrapper.save(); reloadList(false,''); reloadList(true,searchField.text); @@ -285,12 +291,13 @@ class MultiMenuState extends onlinemod.OfflineMenuState { var containsSong = false; var missingSongs:Array = []; _packCount++; - for (osong in SESave.data.favourites){ + for (i => osong in SESave.data.favourites){ var song:SongInfo = null; var worked:Bool = false; try{ song = new SongInfo(osong.name, osong.charts,osong.path,osong.namespace,osong.isCategory,osong.categoryID); worked = CoolUtil.applyAnonToObject(song,osong); + song.favouriteID = i+1; }catch(e){ trace('$osong is an invalid song!'); missingSongs.push(osong); diff --git a/source/se/SESave.hx b/source/se/SESave.hx index dcc2f7b..c3190b2 100644 --- a/source/se/SESave.hx +++ b/source/se/SESave.hx @@ -115,6 +115,7 @@ typedef YourMother = Dynamic; var persistGF:Bool = false; var menuScripts:Bool = false; var easterEggs:Bool = true; + var resultsInst:Bool = false; var profiler(default,set):Bool = false; function set_profiler(v){ diff --git a/source/se/formats/SongInfo.hx b/source/se/formats/SongInfo.hx index de60a45..8d674a8 100644 --- a/source/se/formats/SongInfo.hx +++ b/source/se/formats/SongInfo.hx @@ -36,4 +36,5 @@ package se.formats; this.isCategory = isCategory; this.categoryID=categoryID; } + var favouriteID:Int = 0; } diff --git a/source/se/objects/SEJoinedSound.hx b/source/se/objects/SEJoinedSound.hx index 28c64eb..967715b 100644 --- a/source/se/objects/SEJoinedSound.hx +++ b/source/se/objects/SEJoinedSound.hx @@ -105,11 +105,13 @@ import flixel.FlxG; sounds.remove(sound); return sound; } - function setVolume(index:Int,volume:Float){ + function setVolume(index:Int,volume:Float):Float{ + if(length == 0) return 0; return (sounds[index] is FlxSound ? sounds[index] : sound).volume = volume; } - function getVolume(index:Int){ + function getVolume(index:Int):Float{ + if(length == 0) return 0; return (sounds[index] is FlxSound ? sounds[index] : sound).volume; } @@ -117,15 +119,18 @@ import flixel.FlxG; // Shadowed Variables/Functions. This shit is dumb tbh function stop() { + if(length == 0) return; for(sound in sounds) sound.stop(); sync(); } // function start() for(sound in sounds) sound.start();s function play() { + if(length == 0) return; for(sound in sounds) sound.play(); sync(); } function pause() { + if(length == 0) return; for(sound in sounds) sound.pause(); sync(); } diff --git a/version.downloadMe b/version.downloadMe index bf117e9..787fa2d 100644 --- a/version.downloadMe +++ b/version.downloadMe @@ -1,4 +1,4 @@ -24.08.23.2304; +24.09.10.2241; * Better Psych character support(Still kinda experimental but should be more stable) * Fix some small errors * Fix characters not loading due to using ID instead of folderName