mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-03-13 16:43:57 -04:00
Deprecation warning fixes (no actual logic changes tho)
This commit is contained in:
parent
7fabdf59d5
commit
317c127730
19 changed files with 223 additions and 122 deletions
|
@ -46,8 +46,7 @@ enum Control
|
|||
#end
|
||||
}
|
||||
|
||||
@:enum
|
||||
abstract Action(String) to String from String
|
||||
enum abstract Action(String) to String from String
|
||||
{
|
||||
var UI_UP = "ui_up";
|
||||
var UI_LEFT = "ui_left";
|
||||
|
|
|
@ -882,10 +882,10 @@ class FreeplayState extends MusicBeatSubstate
|
|||
}
|
||||
}
|
||||
|
||||
override function switchTo(nextState:FlxState):Bool
|
||||
override function startOutro(onComplete:() -> Void):Void
|
||||
{
|
||||
clearDaCache(songs[curSelected].songName);
|
||||
return super.switchTo(nextState);
|
||||
super.startOutro(onComplete);
|
||||
}
|
||||
|
||||
function changeDiff(change:Int = 0)
|
||||
|
|
|
@ -144,7 +144,7 @@ class InputFormatter
|
|||
}
|
||||
|
||||
@:forward
|
||||
@:enum abstract ControllerName(String) from String to String
|
||||
enum abstract ControllerName(String) from String to String
|
||||
{
|
||||
var OUYA = "Ouya";
|
||||
var PS4 = "PS4";
|
||||
|
|
|
@ -5,7 +5,7 @@ import flixel.FlxSubState;
|
|||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.group.FlxGroup;
|
||||
import flixel.math.FlxMath;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.sound.FlxSound;
|
||||
import flixel.system.debug.stats.StatsGraph;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.util.FlxColor;
|
||||
|
@ -52,8 +52,7 @@ class LatencyState extends MusicBeatSubstate
|
|||
FlxG.addChildBelowMouse(realStats);
|
||||
#end
|
||||
|
||||
FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, key ->
|
||||
{
|
||||
FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, key -> {
|
||||
trace(key.charCode);
|
||||
|
||||
if (key.charCode == 120) generateBeatStuff();
|
||||
|
@ -154,8 +153,7 @@ class LatencyState extends MusicBeatSubstate
|
|||
|
||||
override function beatHit():Bool
|
||||
{
|
||||
if (curBeat % 8 == 0) blocks.forEach(blok ->
|
||||
{
|
||||
if (curBeat % 8 == 0) blocks.forEach(blok -> {
|
||||
blok.alpha = 0;
|
||||
});
|
||||
|
||||
|
@ -248,8 +246,7 @@ class LatencyState extends MusicBeatSubstate
|
|||
FlxG.resetState();
|
||||
}*/
|
||||
|
||||
noteGrp.forEach(function(daNote:Note)
|
||||
{
|
||||
noteGrp.forEach(function(daNote:Note) {
|
||||
daNote.y = (strumLine.y - ((Conductor.songPosition - Conductor.audioOffset) - daNote.data.strumTime) * 0.45);
|
||||
daNote.x = strumLine.x + 30;
|
||||
|
||||
|
|
|
@ -146,15 +146,20 @@ class MusicBeatState extends FlxUIState
|
|||
sort(SortUtil.byZIndex, FlxSort.ASCENDING);
|
||||
}
|
||||
|
||||
override function switchTo(nextState:FlxState):Bool
|
||||
override function startOutro(onComplete:() -> Void):Void
|
||||
{
|
||||
var event = new StateChangeScriptEvent(ScriptEvent.STATE_CHANGE_BEGIN, nextState, true);
|
||||
var event = new StateChangeScriptEvent(ScriptEvent.STATE_CHANGE_BEGIN, null, true);
|
||||
|
||||
dispatchEvent(event);
|
||||
|
||||
if (event.eventCanceled) return false;
|
||||
|
||||
return super.switchTo(nextState);
|
||||
if (event.eventCanceled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
onComplete();
|
||||
}
|
||||
}
|
||||
|
||||
public override function openSubState(targetSubstate:FlxSubState):Void
|
||||
|
|
|
@ -3,7 +3,7 @@ package funkin;
|
|||
import flixel.FlxSprite;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.sound.FlxSound;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.tweens.FlxTween;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package funkin;
|
||||
|
||||
import flixel.FlxSprite;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.sound.FlxSound;
|
||||
|
||||
class TankCutscene extends FlxSprite
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ package funkin.audio.visualize;
|
|||
|
||||
import flixel.math.FlxMath;
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.sound.FlxSound;
|
||||
import flixel.util.FlxColor;
|
||||
import funkin.audiovis.VisShit;
|
||||
import funkin.graphics.rendering.MeshRender;
|
||||
|
|
|
@ -6,7 +6,7 @@ import flixel.addons.plugin.taskManager.FlxTask;
|
|||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup;
|
||||
import flixel.math.FlxMath;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.sound.FlxSound;
|
||||
import funkin.ui.PreferencesMenu.CheckboxThingie;
|
||||
|
||||
using Lambda;
|
||||
|
@ -86,8 +86,7 @@ class ABotVis extends FlxTypedSpriteGroup<FlxSprite>
|
|||
|
||||
for (i in 0...group.members.length)
|
||||
{
|
||||
var getSliceShit = function(s:Int)
|
||||
{
|
||||
var getSliceShit = function(s:Int) {
|
||||
var powShit = FlxMath.remapToRange(s, 0, group.members.length, 0, CoolUtil.coolBaseLog(10, freqShit[0].length));
|
||||
return Math.round(Math.pow(10, powShit));
|
||||
};
|
||||
|
|
|
@ -5,7 +5,7 @@ import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup;
|
|||
import flixel.math.FlxMath;
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.math.FlxVector;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.sound.FlxSound;
|
||||
import flixel.util.FlxColor;
|
||||
import funkin.audio.visualize.PolygonSpectogram.VISTYPE;
|
||||
import funkin.audiovis.VisShit.CurAudioInfo;
|
||||
|
@ -75,8 +75,7 @@ class SpectogramSprite extends FlxTypedSpriteGroup<FlxSprite>
|
|||
default:
|
||||
}
|
||||
|
||||
forEach(spr ->
|
||||
{
|
||||
forEach(spr -> {
|
||||
spr.visible = spr.ID % wavOptimiz == 0;
|
||||
});
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package funkin.audiovis;
|
||||
|
||||
import flixel.math.FlxMath;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.sound.FlxSound;
|
||||
import funkin.audiovis.dsp.FFT;
|
||||
import haxe.Timer;
|
||||
import lime.system.ThreadPool;
|
||||
|
@ -41,8 +41,7 @@ class VisShit
|
|||
|
||||
// helpers, note that spectrum indexes suppose non-negative frequencies
|
||||
final binSize = fs / fftN;
|
||||
final indexToFreq = function(k:Int)
|
||||
{
|
||||
final indexToFreq = function(k:Int) {
|
||||
var powShit:Float = FlxMath.remapToRange(k, 0, halfN, 0, CoolUtil.coolBaseLog(10, halfN)); // 4.3 is almost the log of 20Khz or so. Close enuf lol
|
||||
|
||||
return 1.0 * (Math.pow(10, powShit)); // we need the `1.0` to avoid overflows
|
||||
|
@ -51,8 +50,7 @@ class VisShit
|
|||
// "melodic" band-pass filter
|
||||
final minFreq = 20.70;
|
||||
final maxFreq = 4000.01;
|
||||
final melodicBandPass = function(k:Int, s:Float)
|
||||
{
|
||||
final melodicBandPass = function(k:Int, s:Float) {
|
||||
final freq = indexToFreq(k);
|
||||
final filter = freq > minFreq - binSize && freq < maxFreq + binSize ? 1 : 0;
|
||||
return s;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package funkin.charting;
|
||||
|
||||
import flixel.FlxSprite;
|
||||
import flixel.addons.display.FlxGridOverlay;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.addons.ui.FlxInputText;
|
||||
|
@ -10,22 +9,24 @@ import flixel.addons.ui.FlxUIDropDownMenu;
|
|||
import flixel.addons.ui.FlxUIInputText;
|
||||
import flixel.addons.ui.FlxUINumericStepper;
|
||||
import flixel.addons.ui.FlxUITabMenu;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.group.FlxGroup;
|
||||
import flixel.math.FlxMath;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.sound.FlxSound;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.ui.FlxButton;
|
||||
import flixel.util.FlxColor;
|
||||
import funkin.Conductor.BPMChangeEvent;
|
||||
import funkin.Section.SwagSection;
|
||||
import funkin.SongLoad.SwagSong;
|
||||
import funkin.audio.visualize.PolygonSpectogram;
|
||||
import funkin.audiovis.ABotVis;
|
||||
import funkin.audiovis.SpectogramSprite;
|
||||
import funkin.Conductor.BPMChangeEvent;
|
||||
import funkin.graphics.rendering.MeshRender;
|
||||
import funkin.noteStuff.NoteBasic.NoteData;
|
||||
import funkin.play.HealthIcon;
|
||||
import funkin.play.PlayState;
|
||||
import funkin.Section.SwagSection;
|
||||
import funkin.SongLoad.SwagSong;
|
||||
import funkin.audio.VoicesGroup;
|
||||
import haxe.Json;
|
||||
import lime.media.AudioBuffer;
|
||||
import lime.utils.Assets;
|
||||
|
@ -193,16 +194,14 @@ class ChartingState extends MusicBeatState
|
|||
var check_voices = new FlxUICheckBox(10, 25, null, null, "Has voice track", 100);
|
||||
check_voices.checked = _song.needsVoices;
|
||||
// _song.needsVoices = check_voices.checked;
|
||||
check_voices.callback = function()
|
||||
{
|
||||
check_voices.callback = function() {
|
||||
_song.needsVoices = check_voices.checked;
|
||||
trace('CHECKED!');
|
||||
};
|
||||
|
||||
var check_mute_inst = new FlxUICheckBox(10, 200, null, null, "Mute Instrumental (in editor)", 100);
|
||||
check_mute_inst.checked = false;
|
||||
check_mute_inst.callback = function()
|
||||
{
|
||||
check_mute_inst.callback = function() {
|
||||
var vol:Float = 1;
|
||||
|
||||
if (check_mute_inst.checked) vol = 0;
|
||||
|
@ -210,23 +209,19 @@ class ChartingState extends MusicBeatState
|
|||
FlxG.sound.music.volume = vol;
|
||||
};
|
||||
|
||||
var saveButton:FlxButton = new FlxButton(110, 8, "Save", function()
|
||||
{
|
||||
var saveButton:FlxButton = new FlxButton(110, 8, "Save", function() {
|
||||
saveLevel();
|
||||
});
|
||||
|
||||
var saveCompiler:FlxButton = new FlxButton(110, 30, "Save compile", function()
|
||||
{
|
||||
var saveCompiler:FlxButton = new FlxButton(110, 30, "Save compile", function() {
|
||||
saveLevel(true);
|
||||
});
|
||||
|
||||
var reloadSong:FlxButton = new FlxButton(saveButton.x + saveButton.width + 10, saveButton.y, "Reload Audio", function()
|
||||
{
|
||||
var reloadSong:FlxButton = new FlxButton(saveButton.x + saveButton.width + 10, saveButton.y, "Reload Audio", function() {
|
||||
loadSong(_song.song);
|
||||
});
|
||||
|
||||
var reloadSongJson:FlxButton = new FlxButton(reloadSong.x, saveButton.y + 30, "Reload JSON", function()
|
||||
{
|
||||
var reloadSongJson:FlxButton = new FlxButton(reloadSong.x, saveButton.y + 30, "Reload JSON", function() {
|
||||
FlxTransitionableState.skipNextTransIn = true;
|
||||
FlxTransitionableState.skipNextTransOut = true;
|
||||
loadJson(_song.song.toLowerCase());
|
||||
|
@ -245,22 +240,19 @@ class ChartingState extends MusicBeatState
|
|||
|
||||
var characters:Array<String> = CoolUtil.coolTextFile(Paths.txt('characterList'));
|
||||
|
||||
var player1DropDown = new FlxUIDropDownMenu(10, 100, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String)
|
||||
{
|
||||
var player1DropDown = new FlxUIDropDownMenu(10, 100, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String) {
|
||||
_song.player1 = characters[Std.parseInt(character)];
|
||||
updateHeads();
|
||||
});
|
||||
player1DropDown.selectedLabel = _song.player1;
|
||||
|
||||
var player2DropDown = new FlxUIDropDownMenu(140, 100, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String)
|
||||
{
|
||||
var player2DropDown = new FlxUIDropDownMenu(140, 100, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String) {
|
||||
_song.player2 = characters[Std.parseInt(character)];
|
||||
updateHeads();
|
||||
});
|
||||
player2DropDown.selectedLabel = _song.player2;
|
||||
|
||||
var difficultyDropDown = new FlxUIDropDownMenu(10, 230, FlxUIDropDownMenu.makeStrIdLabelArray(_song.difficulties, true), function(diff:String)
|
||||
{
|
||||
var difficultyDropDown = new FlxUIDropDownMenu(10, 230, FlxUIDropDownMenu.makeStrIdLabelArray(_song.difficulties, true), function(diff:String) {
|
||||
SongLoad.curDiff = _song.difficulties[Std.parseInt(diff)];
|
||||
SongLoad.checkAndCreateNotemap(SongLoad.curDiff);
|
||||
|
||||
|
@ -273,8 +265,7 @@ class ChartingState extends MusicBeatState
|
|||
|
||||
var difficultyAdder = new FlxUIInputText(130, 230, 100, "", 12);
|
||||
|
||||
var addDiff:FlxButton = new FlxButton(130, 250, "Add Difficulty", function()
|
||||
{
|
||||
var addDiff:FlxButton = new FlxButton(130, 250, "Add Difficulty", function() {
|
||||
difficultyAdder.text = "";
|
||||
// something to regenerate difficulties
|
||||
});
|
||||
|
@ -325,15 +316,13 @@ class ChartingState extends MusicBeatState
|
|||
|
||||
var stepperCopy:FlxUINumericStepper = new FlxUINumericStepper(110, 130, 1, 1, -999, 999, 0);
|
||||
|
||||
var copyButton:FlxButton = new FlxButton(10, 130, "Copy last section", function()
|
||||
{
|
||||
var copyButton:FlxButton = new FlxButton(10, 130, "Copy last section", function() {
|
||||
copySection(Std.int(stepperCopy.value));
|
||||
});
|
||||
|
||||
var clearSectionButton:FlxButton = new FlxButton(10, 150, "Clear", clearSection);
|
||||
|
||||
var swapSection:FlxButton = new FlxButton(10, 170, "Swap section", function()
|
||||
{
|
||||
var swapSection:FlxButton = new FlxButton(10, 170, "Swap section", function() {
|
||||
for (i in 0...SongLoad.getSong()[curSection].sectionNotes.length)
|
||||
{
|
||||
var note:Note = new Note(0, 0);
|
||||
|
@ -417,8 +406,7 @@ class ChartingState extends MusicBeatState
|
|||
// @:privateAccess
|
||||
// library.pathGroups.set(symbolPath, [library.__cacheBreak(symbolPath)]);
|
||||
// var callback = callbacks.add("song:" + pathShit);
|
||||
openfl.utils.Assets.loadSound(pathShit).onComplete(function(_)
|
||||
{
|
||||
openfl.utils.Assets.loadSound(pathShit).onComplete(function(_) {
|
||||
// callback();
|
||||
});
|
||||
}
|
||||
|
@ -443,7 +431,7 @@ class ChartingState extends MusicBeatState
|
|||
add(playheadTest);
|
||||
|
||||
// WONT WORK FOR TUTORIAL OR TEST SONG!!! REDO LATER
|
||||
vocals = VoicesGroup.build(daSong, _song.voiceList);
|
||||
vocals = new VoicesGroup();
|
||||
// vocals = new FlxSound().loadEmbedded(Paths.voices(daSong));
|
||||
// FlxG.sound.list.add(vocals);
|
||||
|
||||
|
@ -477,8 +465,7 @@ class ChartingState extends MusicBeatState
|
|||
|
||||
vocals.pause();
|
||||
|
||||
FlxG.sound.music.onComplete = function()
|
||||
{
|
||||
FlxG.sound.music.onComplete = function() {
|
||||
vocals.pause();
|
||||
vocals.time = 0;
|
||||
FlxG.sound.music.pause();
|
||||
|
@ -742,8 +729,7 @@ class ChartingState extends MusicBeatState
|
|||
|
||||
if (FlxG.mouse.overlaps(curRenderedNotes))
|
||||
{
|
||||
curRenderedNotes.forEach(function(note:Note)
|
||||
{
|
||||
curRenderedNotes.forEach(function(note:Note) {
|
||||
if (FlxG.mouse.overlaps(note))
|
||||
{
|
||||
selectNote(note);
|
||||
|
@ -766,8 +752,7 @@ class ChartingState extends MusicBeatState
|
|||
{
|
||||
if (FlxG.mouse.overlaps(curRenderedNotes))
|
||||
{
|
||||
curRenderedNotes.forEach(function(note:Note)
|
||||
{
|
||||
curRenderedNotes.forEach(function(note:Note) {
|
||||
if (FlxG.mouse.overlaps(note))
|
||||
{
|
||||
trace('tryin to delete note...');
|
||||
|
@ -1151,8 +1136,7 @@ class ChartingState extends MusicBeatState
|
|||
// null if checks jus cuz i put updateGrid() in some weird places!
|
||||
if (staticSpecGrp != null)
|
||||
{
|
||||
staticSpecGrp.forEach(function(spec)
|
||||
{
|
||||
staticSpecGrp.forEach(function(spec) {
|
||||
if (spec != null) spec.generateSection(sectionStartTime(), (Conductor.stepCrochet * 32) / 1000);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package funkin.play;
|
|||
|
||||
import flixel.FlxObject;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.sound.FlxSound;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.util.FlxTimer;
|
||||
import funkin.modding.events.ScriptEvent;
|
||||
|
@ -208,11 +208,9 @@ class GameOverSubstate extends MusicBeatSubstate
|
|||
boyfriend.playAnimation('deathConfirm' + animationSuffix, true);
|
||||
|
||||
// After the animation finishes...
|
||||
new FlxTimer().start(0.7, function(tmr:FlxTimer)
|
||||
{
|
||||
new FlxTimer().start(0.7, function(tmr:FlxTimer) {
|
||||
// ...fade out the graphics. Then after that happens...
|
||||
FlxG.camera.fade(FlxColor.BLACK, 2, false, function()
|
||||
{
|
||||
FlxG.camera.fade(FlxColor.BLACK, 2, false, function() {
|
||||
// ...close the GameOverSubstate.
|
||||
FlxG.camera.fade(FlxColor.BLACK, 1, true, null, true);
|
||||
PlayState.needsReset = true;
|
||||
|
@ -276,8 +274,7 @@ class GameOverSubstate extends MusicBeatSubstate
|
|||
|
||||
if (PreferencesMenu.getPref('censor-naughty')) randomCensor = [1, 3, 8, 13, 17, 21];
|
||||
|
||||
FlxG.sound.play(Paths.sound('jeffGameover/jeffGameover-' + FlxG.random.int(1, 25, randomCensor)), 1, false, null, true, function()
|
||||
{
|
||||
FlxG.sound.play(Paths.sound('jeffGameover/jeffGameover-' + FlxG.random.int(1, 25, randomCensor)), 1, false, null, true, function() {
|
||||
// Once the quote ends, fade in the game over music.
|
||||
if (!isEnding && gameOverMusic != null)
|
||||
{
|
||||
|
|
|
@ -25,8 +25,8 @@ typedef AnimateAtlasAnimation =
|
|||
{
|
||||
name:String,
|
||||
prefix:String,
|
||||
offset:Null<Array<Float>>,
|
||||
loop:Bool,
|
||||
offsets:Null<Array<Float>>,
|
||||
looped:Bool,
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -107,7 +107,7 @@ class AnimateAtlasCharacter extends BaseCharacter
|
|||
{
|
||||
super.onAnimationFinished(prefix);
|
||||
|
||||
if (getAnimationData() != null && getAnimationData().loop)
|
||||
if (getAnimationData() != null && getAnimationData().looped)
|
||||
{
|
||||
playAnimation(prefix, true, false);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package funkin.play.song;
|
||||
|
||||
import funkin.VoicesGroup;
|
||||
import funkin.play.event.SongEvent;
|
||||
import flixel.sound.FlxSound;
|
||||
import openfl.utils.Assets;
|
||||
import funkin.modding.events.ScriptEvent;
|
||||
import funkin.modding.IScriptedClass;
|
||||
import funkin.audio.VoicesGroup;
|
||||
import funkin.play.song.SongData.SongChartData;
|
||||
import funkin.play.song.SongData.SongDataParser;
|
||||
import funkin.play.song.SongData.SongEventData;
|
||||
|
@ -20,7 +23,7 @@ import funkin.play.song.SongData.SongTimeFormat;
|
|||
* It also receives script events; scripted classes which extend this class
|
||||
* can be used to perform custom gameplay behaviors only on specific songs.
|
||||
*/
|
||||
class Song // implements IPlayStateScriptedClass
|
||||
class Song implements IPlayStateScriptedClass
|
||||
{
|
||||
public final songId:String;
|
||||
|
||||
|
@ -29,6 +32,11 @@ class Song // implements IPlayStateScriptedClass
|
|||
final variations:Array<String>;
|
||||
final difficulties:Map<String, SongDifficulty>;
|
||||
|
||||
/**
|
||||
* Set to false if the song was edited in the charter and should not be saved as a high score.
|
||||
*/
|
||||
public var validScore:Bool = true;
|
||||
|
||||
public function new(id:String)
|
||||
{
|
||||
this.songId = id;
|
||||
|
@ -59,6 +67,9 @@ class Song // implements IPlayStateScriptedClass
|
|||
// Variations may have different artist, time format, generatedBy, etc.
|
||||
for (metadata in _metadata)
|
||||
{
|
||||
// There may be more difficulties in the chart file than in the metadata,
|
||||
// (i.e. non-playable charts like the one used for Pico on the speaker in Stress)
|
||||
// but all the difficulties in the metadata must be in the chart file.
|
||||
for (diffId in metadata.playData.difficulties)
|
||||
{
|
||||
var difficulty:SongDifficulty = new SongDifficulty(this, diffId, metadata.variation);
|
||||
|
@ -70,7 +81,7 @@ class Song // implements IPlayStateScriptedClass
|
|||
difficulty.timeFormat = metadata.timeFormat;
|
||||
difficulty.divisions = metadata.divisions;
|
||||
difficulty.timeChanges = metadata.timeChanges;
|
||||
difficulty.loop = metadata.loop;
|
||||
difficulty.looped = metadata.looped;
|
||||
difficulty.generatedBy = metadata.generatedBy;
|
||||
|
||||
difficulty.stage = metadata.playData.stage;
|
||||
|
@ -111,8 +122,9 @@ class Song // implements IPlayStateScriptedClass
|
|||
var difficulty:Null<SongDifficulty> = difficulties.get(diffId);
|
||||
if (difficulty == null)
|
||||
{
|
||||
trace('Could not find difficulty $diffId for song $songId');
|
||||
continue;
|
||||
trace('Fabricated new difficulty for $diffId.');
|
||||
difficulty = new SongDifficulty(this, diffId, variation);
|
||||
difficulties.set(diffId, difficulty);
|
||||
}
|
||||
// Add the chart data to the difficulty.
|
||||
difficulty.notes = chartData.notes.get(diffId);
|
||||
|
@ -151,6 +163,46 @@ class Song // implements IPlayStateScriptedClass
|
|||
{
|
||||
return 'Song($songId)';
|
||||
}
|
||||
|
||||
public function onPause(event:PauseScriptEvent):Void {};
|
||||
|
||||
public function onResume(event:ScriptEvent):Void {};
|
||||
|
||||
public function onSongLoaded(event:SongLoadScriptEvent):Void {};
|
||||
|
||||
public function onSongStart(event:ScriptEvent):Void {};
|
||||
|
||||
public function onSongEnd(event:ScriptEvent):Void {};
|
||||
|
||||
public function onGameOver(event:ScriptEvent):Void {};
|
||||
|
||||
public function onSongRetry(event:ScriptEvent):Void {};
|
||||
|
||||
public function onNoteHit(event:NoteScriptEvent):Void {};
|
||||
|
||||
public function onNoteMiss(event:NoteScriptEvent):Void {};
|
||||
|
||||
public function onNoteGhostMiss(event:GhostMissNoteScriptEvent):Void {};
|
||||
|
||||
public function onSongEvent(event:SongEventScriptEvent):Void {};
|
||||
|
||||
public function onStepHit(event:SongTimeScriptEvent):Void {};
|
||||
|
||||
public function onBeatHit(event:SongTimeScriptEvent):Void {};
|
||||
|
||||
public function onCountdownStart(event:CountdownScriptEvent):Void {};
|
||||
|
||||
public function onCountdownStep(event:CountdownScriptEvent):Void {};
|
||||
|
||||
public function onCountdownEnd(event:CountdownScriptEvent):Void {};
|
||||
|
||||
public function onScriptEvent(event:ScriptEvent):Void {};
|
||||
|
||||
public function onCreate(event:ScriptEvent):Void {};
|
||||
|
||||
public function onDestroy(event:ScriptEvent):Void {};
|
||||
|
||||
public function onUpdate(event:UpdateScriptEvent):Void {};
|
||||
}
|
||||
|
||||
class SongDifficulty
|
||||
|
@ -184,7 +236,7 @@ class SongDifficulty
|
|||
public var songArtist:String = SongValidator.DEFAULT_ARTIST;
|
||||
public var timeFormat:SongTimeFormat = SongValidator.DEFAULT_TIMEFORMAT;
|
||||
public var divisions:Int = SongValidator.DEFAULT_DIVISIONS;
|
||||
public var loop:Bool = SongValidator.DEFAULT_LOOP;
|
||||
public var looped:Bool = SongValidator.DEFAULT_LOOPED;
|
||||
public var generatedBy:String = SongValidator.DEFAULT_GENERATEDBY;
|
||||
|
||||
public var timeChanges:Array<SongTimeChange> = [];
|
||||
|
@ -231,31 +283,109 @@ class SongDifficulty
|
|||
return cast events;
|
||||
}
|
||||
|
||||
public inline function cacheInst()
|
||||
public inline function cacheInst():Void
|
||||
{
|
||||
FlxG.sound.cache(Paths.inst(this.song.songId));
|
||||
}
|
||||
|
||||
public inline function playInst(volume:Float = 1.0, looped:Bool = false)
|
||||
public inline function playInst(volume:Float = 1.0, looped:Bool = false):Void
|
||||
{
|
||||
FlxG.sound.playMusic(Paths.inst(this.song.songId), volume, looped);
|
||||
}
|
||||
|
||||
public inline function cacheVocals()
|
||||
/**
|
||||
* Cache the vocals for a given character.
|
||||
* @param id The character we are about to play.
|
||||
*/
|
||||
public inline function cacheVocals(?id:String = 'bf'):Void
|
||||
{
|
||||
FlxG.sound.cache(Paths.voices(this.song.songId));
|
||||
for (voice in buildVoiceList(id))
|
||||
{
|
||||
FlxG.sound.cache(voice);
|
||||
}
|
||||
}
|
||||
|
||||
public function buildVoiceList():Array<String>
|
||||
/**
|
||||
* Build a list of vocal files for the given character.
|
||||
* Automatically resolves suffixed character IDs (so bf-car will resolve to bf if needed).
|
||||
*
|
||||
* @param id The character we are about to play.
|
||||
*/
|
||||
public function buildVoiceList(?id:String = 'bf'):Array<String>
|
||||
{
|
||||
// TODO: Implement.
|
||||
var playableCharData:SongPlayableChar = getPlayableChar(id);
|
||||
if (playableCharData == null)
|
||||
{
|
||||
trace('Could not find playable char $id for song ${this.song.songId}');
|
||||
return [];
|
||||
}
|
||||
|
||||
return [""];
|
||||
// Automatically resolve voices by removing suffixes.
|
||||
// For example, if `Voices-bf-car.ogg` does not exist, check for `Voices-bf.ogg`.
|
||||
|
||||
var playerId:String = id;
|
||||
var voicePlayer:String = Paths.voices(this.song.songId, '-$id');
|
||||
while (voicePlayer != null && !Assets.exists(voicePlayer))
|
||||
{
|
||||
// Remove the last suffix.
|
||||
// For example, bf-car becomes bf.
|
||||
playerId = playerId.split('-').slice(0, -1).join('-');
|
||||
// Try again.
|
||||
voicePlayer = playerId == '' ? null : Paths.voices(this.song.songId, '-${playerId}');
|
||||
}
|
||||
|
||||
var opponentId:String = playableCharData.opponent;
|
||||
var voiceOpponent:String = Paths.voices(this.song.songId, '-${opponentId}');
|
||||
while (voiceOpponent != null && !Assets.exists(voiceOpponent))
|
||||
{
|
||||
// Remove the last suffix.
|
||||
opponentId = opponentId.split('-').slice(0, -1).join('-');
|
||||
// Try again.
|
||||
voiceOpponent = opponentId == '' ? null : Paths.voices(this.song.songId, '-${opponentId}');
|
||||
}
|
||||
|
||||
var result:Array<String> = [];
|
||||
if (voicePlayer != null) result.push(voicePlayer);
|
||||
if (voiceOpponent != null) result.push(voiceOpponent);
|
||||
if (voicePlayer == null && voiceOpponent == null)
|
||||
{
|
||||
// Try to use `Voices.ogg` if no other voices are found.
|
||||
if (Assets.exists(Paths.voices(this.song.songId, ''))) result.push(Paths.voices(this.song.songId, ''));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function buildVocals(charId:String = "bf"):VoicesGroup
|
||||
/**
|
||||
* Create a VoicesGroup, an audio object that can play the vocals for all characters.
|
||||
* @param charId The player ID.
|
||||
* @return The generated vocal group.
|
||||
*/
|
||||
public function buildVocals(charId:String = 'bf'):VoicesGroup
|
||||
{
|
||||
var result:VoicesGroup = VoicesGroup.build(this.song.songId, this.buildVoiceList());
|
||||
var result:VoicesGroup = new VoicesGroup();
|
||||
|
||||
var voiceList:Array<String> = buildVoiceList(charId);
|
||||
|
||||
if (voiceList.length == 0)
|
||||
{
|
||||
trace('Could not find any voices for song ${this.song.songId}');
|
||||
return result;
|
||||
}
|
||||
|
||||
// Add player vocals.
|
||||
if (voiceList[0] != null) result.addPlayerVoice(new FlxSound().loadEmbedded(Assets.getSound(voiceList[0])));
|
||||
// Add opponent vocals.
|
||||
if (voiceList[1] != null) result.addOpponentVoice(new FlxSound().loadEmbedded(Assets.getSound(voiceList[1])));
|
||||
|
||||
// Add additional vocals.
|
||||
if (voiceList.length > 2)
|
||||
{
|
||||
for (i in 2...voiceList.length)
|
||||
{
|
||||
result.add(new FlxSound().loadEmbedded(Assets.getSound(voiceList[i])));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -220,7 +220,7 @@ typedef RawSongMetadata =
|
|||
var timeFormat:SongTimeFormat;
|
||||
var divisions:Int;
|
||||
var timeChanges:Array<SongTimeChange>;
|
||||
var loop:Bool;
|
||||
var looped:Bool;
|
||||
var playData:SongPlayData;
|
||||
var generatedBy:String;
|
||||
|
||||
|
@ -243,7 +243,7 @@ abstract SongMetadata(RawSongMetadata)
|
|||
timeFormat: 'ms',
|
||||
divisions: 96,
|
||||
timeChanges: [new SongTimeChange(-1, 0, 100, 4, 4, [4, 4, 4, 4])],
|
||||
loop: false,
|
||||
looped: false,
|
||||
playData:
|
||||
{
|
||||
songVariations: [],
|
||||
|
@ -271,7 +271,7 @@ abstract SongMetadata(RawSongMetadata)
|
|||
result.timeFormat = this.timeFormat;
|
||||
result.divisions = this.divisions;
|
||||
result.timeChanges = this.timeChanges;
|
||||
result.loop = this.loop;
|
||||
result.looped = this.looped;
|
||||
result.playData = this.playData;
|
||||
result.generatedBy = this.generatedBy;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class SongValidator
|
|||
public static final DEFAULT_ARTIST:String = "Unknown";
|
||||
public static final DEFAULT_TIMEFORMAT:SongTimeFormat = SongTimeFormat.MILLISECONDS;
|
||||
public static final DEFAULT_DIVISIONS:Int = -1;
|
||||
public static final DEFAULT_LOOP:Bool = false;
|
||||
public static final DEFAULT_LOOPED:Bool = false;
|
||||
public static final DEFAULT_STAGE:String = "mainStage";
|
||||
public static final DEFAULT_SCROLLSPEED:Float = 1.0;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import flixel.graphics.frames.FlxAtlasFrames;
|
|||
import flixel.graphics.frames.FlxFrame;
|
||||
import flixel.group.FlxGroup;
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.sound.FlxSound;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.util.FlxSpriteUtil;
|
||||
|
@ -76,8 +76,7 @@ class DebugBoundingState extends FlxState
|
|||
|
||||
// uiStuff.findComponent("btnViewSpriteSheet").onClick = _ -> curView = SPRITESHEET;
|
||||
var dropdown:DropDown = cast uiStuff.findComponent("swapper");
|
||||
dropdown.onChange = function(e:UIEvent)
|
||||
{
|
||||
dropdown.onChange = function(e:UIEvent) {
|
||||
trace(e.type);
|
||||
curView = cast e.data.curView;
|
||||
trace(e.data);
|
||||
|
@ -147,8 +146,7 @@ class DebugBoundingState extends FlxState
|
|||
swagOutlines.antialiasing = true;
|
||||
spriteSheetView.add(swagOutlines);
|
||||
|
||||
FlxG.stage.window.onDropFile.add(function(path:String)
|
||||
{
|
||||
FlxG.stage.window.onDropFile.add(function(path:String) {
|
||||
// WACKY ASS TESTING SHIT FOR WEB FILE LOADING??
|
||||
#if web
|
||||
var swagList:FileList = cast path;
|
||||
|
@ -157,9 +155,8 @@ class DebugBoundingState extends FlxState
|
|||
trace(objShit);
|
||||
|
||||
var funnysound = new FlxSound().loadStream('https://cdn.discordapp.com/attachments/767500676166451231/817821618251759666/Flutter.mp3', false, false,
|
||||
null, function()
|
||||
{
|
||||
trace('LOADED SHIT??');
|
||||
null, function() {
|
||||
trace('LOADED SHIT??');
|
||||
});
|
||||
|
||||
funnysound.volume = 1;
|
||||
|
@ -167,8 +164,7 @@ class DebugBoundingState extends FlxState
|
|||
|
||||
var urlShit = new URLLoader(new URLRequest(objShit));
|
||||
|
||||
new FlxTimer().start(3, function(tmr:FlxTimer)
|
||||
{
|
||||
new FlxTimer().start(3, function(tmr:FlxTimer) {
|
||||
// music lol!
|
||||
if (urlShit.dataFormat == BINARY)
|
||||
{
|
||||
|
@ -255,8 +251,7 @@ class DebugBoundingState extends FlxState
|
|||
charDropdown.dataSource.add({text: char});
|
||||
}
|
||||
|
||||
charDropdown.onChange = function(e:UIEvent)
|
||||
{
|
||||
charDropdown.onChange = function(e:UIEvent) {
|
||||
loadAnimShit(e.data.text);
|
||||
};
|
||||
}
|
||||
|
@ -306,8 +301,7 @@ class DebugBoundingState extends FlxState
|
|||
if (!LimeAssets.libraryPaths.exists(library)) throw "Missing library: " + library;
|
||||
|
||||
// var callback = callbacks.add("library:" + library);
|
||||
Assets.loadLibrary(library).onComplete(function(_)
|
||||
{
|
||||
Assets.loadLibrary(library).onComplete(function(_) {
|
||||
trace('LOADED... awesomeness...');
|
||||
// callback();
|
||||
});
|
||||
|
@ -483,8 +477,7 @@ class DebugBoundingState extends FlxState
|
|||
}
|
||||
|
||||
animDropDownMenu.setData(FlxUIDropDownMenu.makeStrIdLabelArray(animThing, true));
|
||||
animDropDownMenu.callback = function(str:String)
|
||||
{
|
||||
animDropDownMenu.callback = function(str:String) {
|
||||
// clears the canvas
|
||||
onionSkinChar.pixels.fillRect(new Rectangle(0, 0, FlxG.width * 2, FlxG.height * 2), 0x00000000);
|
||||
|
||||
|
|
|
@ -13,12 +13,12 @@ import flixel.FlxSprite;
|
|||
import flixel.group.FlxSpriteGroup;
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.math.FlxRect;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.sound.FlxSound;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.util.FlxSort;
|
||||
import flixel.util.FlxTimer;
|
||||
import funkin.audio.visualize.PolygonSpectogram;
|
||||
import funkin.audio.VocalGroup;
|
||||
import funkin.audio.VoicesGroup;
|
||||
import funkin.input.Cursor;
|
||||
import funkin.modding.events.ScriptEvent;
|
||||
import funkin.play.HealthIcon;
|
||||
|
@ -596,14 +596,14 @@ class ChartEditorState extends HaxeUIState
|
|||
/**
|
||||
* The audio track for the vocals.
|
||||
*/
|
||||
var audioVocalTrackGroup:VocalGroup;
|
||||
var audioVocalTrackGroup:VoicesGroup;
|
||||
|
||||
/**
|
||||
* A map of the audio tracks for each character's vocals.
|
||||
* - Keys are the character IDs.
|
||||
* - Values are the FlxSound objects to play that character's vocals.
|
||||
*
|
||||
* When switching characters, the elements of the VocalGroup will be swapped to match the new character.
|
||||
* When switching characters, the elements of the VoicesGroup will be swapped to match the new character.
|
||||
*/
|
||||
var audioVocalTracks:Map<String, FlxSound> = new Map<String, FlxSound>();
|
||||
|
||||
|
@ -961,7 +961,7 @@ class ChartEditorState extends HaxeUIState
|
|||
// Initialize the song chart data.
|
||||
songChartData = new Map<String, SongChartData>();
|
||||
|
||||
audioVocalTrackGroup = new VocalGroup();
|
||||
audioVocalTrackGroup = new VoicesGroup();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue