mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-12-13 08:55:29 +00:00
Merge branch 'rewrite/master' into bugfix/song-delay+volume-fixes
This commit is contained in:
commit
ce53e46510
|
@ -1,17 +1,18 @@
|
||||||
package funkin.audio;
|
package funkin.audio;
|
||||||
|
|
||||||
import flixel.sound.FlxSound;
|
|
||||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||||
import flixel.util.FlxSignal.FlxTypedSignal;
|
import flixel.math.FlxMath;
|
||||||
|
import flixel.sound.FlxSound;
|
||||||
import flixel.system.FlxAssets.FlxSoundAsset;
|
import flixel.system.FlxAssets.FlxSoundAsset;
|
||||||
import funkin.util.tools.ICloneable;
|
import flixel.tweens.FlxTween;
|
||||||
|
import flixel.util.FlxSignal.FlxTypedSignal;
|
||||||
|
import funkin.audio.waveform.WaveformData;
|
||||||
|
import funkin.audio.waveform.WaveformDataParser;
|
||||||
import funkin.data.song.SongData.SongMusicData;
|
import funkin.data.song.SongData.SongMusicData;
|
||||||
import funkin.data.song.SongRegistry;
|
import funkin.data.song.SongRegistry;
|
||||||
import funkin.audio.waveform.WaveformData;
|
import funkin.util.tools.ICloneable;
|
||||||
import openfl.media.SoundMixer;
|
|
||||||
import funkin.audio.waveform.WaveformDataParser;
|
|
||||||
import flixel.math.FlxMath;
|
|
||||||
import openfl.Assets;
|
import openfl.Assets;
|
||||||
|
import openfl.media.SoundMixer;
|
||||||
#if (openfl >= "8.0.0")
|
#if (openfl >= "8.0.0")
|
||||||
import openfl.utils.AssetType;
|
import openfl.utils.AssetType;
|
||||||
#end
|
#end
|
||||||
|
@ -325,6 +326,7 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||||
|
|
||||||
if (FlxG.sound.music != null)
|
if (FlxG.sound.music != null)
|
||||||
{
|
{
|
||||||
|
FlxG.sound.music.fadeTween?.cancel();
|
||||||
FlxG.sound.music.stop();
|
FlxG.sound.music.stop();
|
||||||
FlxG.sound.music.kill();
|
FlxG.sound.music.kill();
|
||||||
}
|
}
|
||||||
|
@ -401,6 +403,8 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||||
{
|
{
|
||||||
// trace('[FunkinSound] Destroying sound "${this._label}"');
|
// trace('[FunkinSound] Destroying sound "${this._label}"');
|
||||||
super.destroy();
|
super.destroy();
|
||||||
|
FlxTween.cancelTweensOf(this);
|
||||||
|
this._label = 'unknown';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -152,9 +152,12 @@ class SoundGroup extends FlxTypedGroup<FunkinSound>
|
||||||
*/
|
*/
|
||||||
public function stop()
|
public function stop()
|
||||||
{
|
{
|
||||||
forEachAlive(function(sound:FunkinSound) {
|
if (members != null)
|
||||||
sound.stop();
|
{
|
||||||
});
|
forEachAlive(function(sound:FunkinSound) {
|
||||||
|
sound.stop();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override function destroy()
|
public override function destroy()
|
||||||
|
|
|
@ -160,7 +160,9 @@ class VoicesGroup extends SoundGroup
|
||||||
public override function destroy():Void
|
public override function destroy():Void
|
||||||
{
|
{
|
||||||
playerVoices.destroy();
|
playerVoices.destroy();
|
||||||
|
playerVoices = null;
|
||||||
opponentVoices.destroy();
|
opponentVoices.destroy();
|
||||||
|
opponentVoices = null;
|
||||||
super.destroy();
|
super.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1925,14 +1925,14 @@ class PlayState extends MusicBeatSubState
|
||||||
FlxG.sound.music.play(true, startTimestamp - Conductor.instance.instrumentalOffset);
|
FlxG.sound.music.play(true, startTimestamp - Conductor.instance.instrumentalOffset);
|
||||||
FlxG.sound.music.pitch = playbackRate;
|
FlxG.sound.music.pitch = playbackRate;
|
||||||
|
|
||||||
// I am going insane.
|
// Prevent the volume from being wrong.
|
||||||
FlxG.sound.music.volume = 1.0;
|
FlxG.sound.music.volume = 1.0;
|
||||||
|
|
||||||
FlxG.sound.music.fadeTween?.cancel();
|
FlxG.sound.music.fadeTween?.cancel();
|
||||||
|
|
||||||
trace('Playing vocals...');
|
trace('Playing vocals...');
|
||||||
add(vocals);
|
add(vocals);
|
||||||
vocals.play();
|
vocals.play();
|
||||||
|
vocals.volume = 1.0;
|
||||||
vocals.pitch = playbackRate;
|
vocals.pitch = playbackRate;
|
||||||
resyncVocals();
|
resyncVocals();
|
||||||
|
|
||||||
|
@ -2927,6 +2927,9 @@ class PlayState extends MusicBeatSubState
|
||||||
// If the camera is being tweened, stop it.
|
// If the camera is being tweened, stop it.
|
||||||
cancelAllCameraTweens();
|
cancelAllCameraTweens();
|
||||||
|
|
||||||
|
// Dispatch the destroy event.
|
||||||
|
dispatchEvent(new ScriptEvent(DESTROY, false));
|
||||||
|
|
||||||
if (currentConversation != null)
|
if (currentConversation != null)
|
||||||
{
|
{
|
||||||
remove(currentConversation);
|
remove(currentConversation);
|
||||||
|
@ -2970,7 +2973,6 @@ class PlayState extends MusicBeatSubState
|
||||||
{
|
{
|
||||||
remove(currentStage);
|
remove(currentStage);
|
||||||
currentStage.kill();
|
currentStage.kill();
|
||||||
dispatchEvent(new ScriptEvent(DESTROY, false));
|
|
||||||
currentStage = null;
|
currentStage = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -438,6 +438,8 @@ class StoryMenuState extends MusicBeatState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4);
|
||||||
|
|
||||||
updateText();
|
updateText();
|
||||||
updateBackground(previousLevelId);
|
updateBackground(previousLevelId);
|
||||||
updateProps();
|
updateProps();
|
||||||
|
@ -481,6 +483,7 @@ class StoryMenuState extends MusicBeatState
|
||||||
if (hasChanged)
|
if (hasChanged)
|
||||||
{
|
{
|
||||||
buildDifficultySprite();
|
buildDifficultySprite();
|
||||||
|
FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4);
|
||||||
// Disable the funny music thing for now.
|
// Disable the funny music thing for now.
|
||||||
// funnyMusicThing();
|
// funnyMusicThing();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue