1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-03-23 10:29:29 +00:00

Validated formatting of 203 HX files.

This commit is contained in:
EliteMasterEric 2023-06-08 16:30:45 -04:00
parent 9a04678399
commit e68f9ca9a1
86 changed files with 310 additions and 419 deletions

View file

@ -125,8 +125,7 @@ class Alphabet extends FlxSpriteGroup
var xPos:Float = 0; var xPos:Float = 0;
var curRow:Int = 0; var curRow:Int = 0;
new FlxTimer().start(0.05, function(tmr:FlxTimer) new FlxTimer().start(0.05, function(tmr:FlxTimer) {
{
// trace(_finalText.fastCodeAt(loopNum) + " " + _finalText.charAt(loopNum)); // trace(_finalText.fastCodeAt(loopNum) + " " + _finalText.charAt(loopNum));
if (_finalText.fastCodeAt(loopNum) == "\n".code) if (_finalText.fastCodeAt(loopNum) == "\n".code)
{ {

View file

@ -27,8 +27,7 @@ class ComboCounter extends FlxTypedSpriteGroup<FlxSprite>
effectStuff.animation.addByPrefix('funny', 'NOTE COMBO animation', 24, false); effectStuff.animation.addByPrefix('funny', 'NOTE COMBO animation', 24, false);
effectStuff.animation.play('funny'); effectStuff.animation.play('funny');
effectStuff.antialiasing = true; effectStuff.antialiasing = true;
effectStuff.animation.finishCallback = function(nameThing) effectStuff.animation.finishCallback = function(nameThing) {
{
kill(); kill();
}; };
effectStuff.setGraphicSize(Std.int(effectStuff.width * 0.7)); effectStuff.setGraphicSize(Std.int(effectStuff.width * 0.7));
@ -42,8 +41,7 @@ class ComboCounter extends FlxTypedSpriteGroup<FlxSprite>
{ {
if (onScreenTime < 0.9) if (onScreenTime < 0.9)
{ {
new FlxTimer().start((Conductor.crochet / 1000) * 0.25, function(tmr) new FlxTimer().start((Conductor.crochet / 1000) * 0.25, function(tmr) {
{
forceFinish(); forceFinish();
}); });
} }
@ -64,16 +62,14 @@ class ComboCounter extends FlxTypedSpriteGroup<FlxSprite>
if (effectStuff.animation.curAnim.curFrame == 18) if (effectStuff.animation.curAnim.curFrame == 18)
{ {
grpNumbers.forEach(function(spr:ComboNumber) grpNumbers.forEach(function(spr:ComboNumber) {
{
spr.animation.reset(); spr.animation.reset();
}); });
} }
if (effectStuff.animation.curAnim.curFrame == 20) if (effectStuff.animation.curAnim.curFrame == 20)
{ {
grpNumbers.forEach(function(spr:ComboNumber) grpNumbers.forEach(function(spr:ComboNumber) {
{
spr.kill(); spr.kill();
}); });
} }

View file

@ -149,9 +149,9 @@ class Conductor
/** /**
* Forcibly defines the current BPM of the song. * Forcibly defines the current BPM of the song.
* Useful for things like the chart editor that need to manipulate BPM in real time. * Useful for things like the chart editor that need to manipulate BPM in real time.
* *
* Set to null to reset to the BPM defined by the timeChanges. * Set to null to reset to the BPM defined by the timeChanges.
* *
* WARNING: Avoid this for things like setting the BPM of the title screen music, * WARNING: Avoid this for things like setting the BPM of the title screen music,
* you should have a metadata file for it instead. * you should have a metadata file for it instead.
*/ */
@ -166,7 +166,7 @@ class Conductor
/** /**
* Update the conductor with the current song position. * Update the conductor with the current song position.
* BPM, current step, etc. will be re-calculated based on the song position. * BPM, current step, etc. will be re-calculated based on the song position.
* *
* @param songPosition The current position in the song in milliseconds. * @param songPosition The current position in the song in milliseconds.
* Leave blank to use the FlxG.sound.music position. * Leave blank to use the FlxG.sound.music position.
*/ */

View file

@ -119,8 +119,7 @@ class CoolUtil
FlxTween.tween(screenWipeShit, {daAlphaShit: 1}, time, FlxTween.tween(screenWipeShit, {daAlphaShit: 1}, time,
{ {
ease: FlxEase.quadInOut, ease: FlxEase.quadInOut,
onComplete: function(twn) onComplete: function(twn) {
{
screenShit.destroy(); screenShit.destroy();
FlxG.switchState(new MainMenuState()); FlxG.switchState(new MainMenuState());
} }
@ -130,7 +129,7 @@ class CoolUtil
/** /**
* Just saves the json with some default values hehe * Just saves the json with some default values hehe
* @param json * @param json
* @return String * @return String
*/ */
public static inline function jsonStringify(data:Dynamic):String public static inline function jsonStringify(data:Dynamic):String

View file

@ -52,8 +52,7 @@ class CutsceneCharacter extends FlxTypedGroup<FlxSprite>
cutScene.animation.play('weed'); cutScene.animation.play('weed');
cutScene.antialiasing = true; cutScene.antialiasing = true;
cutScene.animation.finishCallback = function(anim:String) cutScene.animation.finishCallback = function(anim:String) {
{
cutScene.kill(); cutScene.kill();
cutScene.destroy(); cutScene.destroy();
cutScene = null; cutScene = null;

View file

@ -53,8 +53,7 @@ class DialogueBox extends FlxSpriteGroup
bgFade.alpha = 0; bgFade.alpha = 0;
add(bgFade); add(bgFade);
new FlxTimer().start(0.83, function(tmr:FlxTimer) new FlxTimer().start(0.83, function(tmr:FlxTimer) {
{
bgFade.alpha += (1 / 5) * 0.7; bgFade.alpha += (1 / 5) * 0.7;
if (bgFade.alpha > 0.7) bgFade.alpha = 0.7; if (bgFade.alpha > 0.7) bgFade.alpha = 0.7;
}, 5); }, 5);
@ -192,8 +191,7 @@ class DialogueBox extends FlxSpriteGroup
if (PlayState.currentSong.song.toLowerCase() == 'senpai' if (PlayState.currentSong.song.toLowerCase() == 'senpai'
|| PlayState.currentSong.song.toLowerCase() == 'thorns') FlxG.sound.music.fadeOut(2.2, 0); || PlayState.currentSong.song.toLowerCase() == 'thorns') FlxG.sound.music.fadeOut(2.2, 0);
new FlxTimer().start(0.2, function(tmr:FlxTimer) new FlxTimer().start(0.2, function(tmr:FlxTimer) {
{
box.alpha -= 1 / 5; box.alpha -= 1 / 5;
bgFade.alpha -= 1 / 5 * 0.7; bgFade.alpha -= 1 / 5 * 0.7;
portraitLeft.visible = false; portraitLeft.visible = false;
@ -203,8 +201,7 @@ class DialogueBox extends FlxSpriteGroup
dropText.alpha = swagDialogue.alpha; dropText.alpha = swagDialogue.alpha;
}, 5); }, 5);
new FlxTimer().start(1.2, function(tmr:FlxTimer) new FlxTimer().start(1.2, function(tmr:FlxTimer) {
{
finishThing(); finishThing();
kill(); kill();
}); });
@ -233,8 +230,7 @@ class DialogueBox extends FlxSpriteGroup
// swagDialogue.text = ; // swagDialogue.text = ;
swagDialogue.resetText(dialogueList[0]); swagDialogue.resetText(dialogueList[0]);
swagDialogue.start(0.04); swagDialogue.start(0.04);
swagDialogue.completeCallback = function() swagDialogue.completeCallback = function() {
{
trace('dialogue finish'); trace('dialogue finish');
handSelect.visible = true; handSelect.visible = true;
dialogueEnded = true; dialogueEnded = true;

View file

@ -58,8 +58,7 @@ class DiscordClient
public static function initialize() public static function initialize()
{ {
var DiscordDaemon = sys.thread.Thread.create(() -> var DiscordDaemon = sys.thread.Thread.create(() -> {
{
new DiscordClient(); new DiscordClient();
}); });
trace("Discord Client initialized"); trace("Discord Client initialized");

View file

@ -426,7 +426,7 @@ class FreeplayState extends MusicBeatSubstate
var swag:Alphabet = new Alphabet(1, 0, "swag"); var swag:Alphabet = new Alphabet(1, 0, "swag");
// JUST DOIN THIS SHIT FOR TESTING!!! // JUST DOIN THIS SHIT FOR TESTING!!!
/* /*
var md:String = Markdown.markdownToHtml(Assets.getText('CHANGELOG.md')); var md:String = Markdown.markdownToHtml(Assets.getText('CHANGELOG.md'));
var texFel:TextField = new TextField(); var texFel:TextField = new TextField();

View file

@ -50,8 +50,7 @@ class LoadingState extends MusicBeatState
loadBar.screenCenter(X); loadBar.screenCenter(X);
add(loadBar); add(loadBar);
initSongsManifest().onComplete(function(lib) initSongsManifest().onComplete(function(lib) {
{
callbacks = new MultiCallback(onLoad); callbacks = new MultiCallback(onLoad);
var introComplete = callbacks.add("introComplete"); var introComplete = callbacks.add("introComplete");
checkLoadSong(getSongPath()); checkLoadSong(getSongPath());
@ -89,8 +88,7 @@ class LoadingState extends MusicBeatState
// @:privateAccess // @:privateAccess
// library.pathGroups.set(symbolPath, [library.__cacheBreak(symbolPath)]); // library.pathGroups.set(symbolPath, [library.__cacheBreak(symbolPath)]);
var callback = callbacks.add("song:" + path); var callback = callbacks.add("song:" + path);
Assets.loadSound(path).onComplete(function(_) Assets.loadSound(path).onComplete(function(_) {
{
callback(); callback();
}); });
} }
@ -105,8 +103,7 @@ class LoadingState extends MusicBeatState
if (!LimeAssets.libraryPaths.exists(library)) throw "Missing library: " + library; if (!LimeAssets.libraryPaths.exists(library)) throw "Missing library: " + library;
var callback = callbacks.add("library:" + library); var callback = callbacks.add("library:" + library);
Assets.loadLibrary(library).onComplete(function(_) Assets.loadLibrary(library).onComplete(function(_) {
{
callback(); callback();
}); });
} }
@ -259,8 +256,7 @@ class LoadingState extends MusicBeatState
path = LimeAssets.__cacheBreak(path); path = LimeAssets.__cacheBreak(path);
} }
AssetManifest.loadFromFile(path, rootPath).onComplete(function(manifest) AssetManifest.loadFromFile(path, rootPath).onComplete(function(manifest) {
{
if (manifest == null) if (manifest == null)
{ {
promise.error("Cannot parse asset manifest for library \"" + id + "\""); promise.error("Cannot parse asset manifest for library \"" + id + "\"");
@ -280,9 +276,8 @@ class LoadingState extends MusicBeatState
library.onChange.add(LimeAssets.onChange.dispatch); library.onChange.add(LimeAssets.onChange.dispatch);
promise.completeWith(Future.withValue(library)); promise.completeWith(Future.withValue(library));
} }
}).onError(function(_) }).onError(function(_) {
{ promise.error("There is no asset library with an ID of \"" + id + "\"");
promise.error("There is no asset library with an ID of \"" + id + "\"");
}); });
return promise.future; return promise.future;
@ -311,8 +306,7 @@ class MultiCallback
length++; length++;
numRemaining++; numRemaining++;
var func:Void->Void = null; var func:Void->Void = null;
func = function() func = function() {
{
if (unfired.exists(id)) if (unfired.exists(id))
{ {
unfired.remove(id); unfired.remove(id);

View file

@ -223,8 +223,8 @@ class MainMenuState extends MusicBeatState
/** /**
* Calls openPrompt and redraws the login/logout button * Calls openPrompt and redraws the login/logout button
* @param prompt * @param prompt
* @param onClose * @param onClose
*/ */
public function openNgPrompt(prompt:Prompt, ?onClose:Void->Void) public function openNgPrompt(prompt:Prompt, ?onClose:Void->Void)
{ {

View file

@ -24,8 +24,7 @@ class MemoryCounter extends TextField
text = "RAM: "; text = "RAM: ";
#if flash #if flash
addEventListener(Event.ENTER_FRAME, function(e) addEventListener(Event.ENTER_FRAME, function(e) {
{
var time = Lib.getTimer(); var time = Lib.getTimer();
__enterFrame(time - currentTime); __enterFrame(time - currentTime);
}); });

View file

@ -49,8 +49,7 @@ class NGio
trace('checking NG.io version'); trace('checking NG.io version');
GAME_VER = "v" + Application.current.meta.get('version'); GAME_VER = "v" + Application.current.meta.get('version');
NG.core.calls.app.getCurrentVersion(GAME_VER).addDataHandler(function(response) NG.core.calls.app.getCurrentVersion(GAME_VER).addDataHandler(function(response) {
{
GAME_VER = response.result.data.currentVersion; GAME_VER = response.result.data.currentVersion;
trace('CURRENT NG VERSION: ' + GAME_VER); trace('CURRENT NG VERSION: ' + GAME_VER);
callback(GAME_VER); callback(GAME_VER);
@ -141,8 +140,7 @@ class NGio
var onCancel:Void->Void = null; var onCancel:Void->Void = null;
if (onComplete != null) if (onComplete != null)
{ {
onSuccess = function() onSuccess = function() {
{
onNGLogin(); onNGLogin();
onComplete(Success); onComplete(Success);
} }
@ -228,7 +226,7 @@ class NGio
scoreboardsLoaded = true; scoreboardsLoaded = true;
ngScoresLoaded.dispatch(); ngScoresLoaded.dispatch();
/* /*
for (score in NG.core.scoreBoards.get(8737).scores) for (score in NG.core.scoreBoards.get(8737).scores)
{ {
trace('score loaded user:${score.user.name}, score:${score.formatted_value}'); trace('score loaded user:${score.user.name}, score:${score.formatted_value}');

View file

@ -15,9 +15,9 @@ class Note extends FlxSprite
public var data = new NoteData(); public var data = new NoteData();
/** /**
* code colors for.... code.... * code colors for.... code....
* i think goes in order of left to right * i think goes in order of left to right
* *
* left 0 * left 0
* down 1 * down 1
* up 2 * up 2

View file

@ -34,8 +34,7 @@ class NoteSplash extends FlxSprite
animation.play('note' + noteData + '-' + FlxG.random.int(0, 1), true); animation.play('note' + noteData + '-' + FlxG.random.int(0, 1), true);
animation.curAnim.frameRate = 24 + FlxG.random.int(-2, 2); animation.curAnim.frameRate = 24 + FlxG.random.int(-2, 2);
animation.finishCallback = function(name) animation.finishCallback = function(name) {
{
kill(); kill();
}; };
updateHitbox(); updateHitbox();

View file

@ -281,7 +281,7 @@ class SongLoad
// castNoteDataToNoteData(swagShit.noteMap[diff]); // castNoteDataToNoteData(swagShit.noteMap[diff]);
/* /*
switch (diff) switch (diff)
{ {
case "easy": case "easy":

View file

@ -53,7 +53,7 @@ class TitleState extends MusicBeatState
super.create(); super.create();
/* /*
#elseif web #elseif web
@ -84,8 +84,7 @@ class TitleState extends MusicBeatState
*/ */
// netConnection.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown); // netConnection.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
new FlxTimer().start(1, function(tmr:FlxTimer) new FlxTimer().start(1, function(tmr:FlxTimer) {
{
startIntro(); startIntro();
}); });
} }
@ -284,7 +283,7 @@ class TitleState extends MusicBeatState
FlxTween.tween(FlxG.stage.window, {y: FlxG.stage.window.y + 100}, 0.7, {ease: FlxEase.quadInOut, type: PINGPONG}); FlxTween.tween(FlxG.stage.window, {y: FlxG.stage.window.y + 100}, 0.7, {ease: FlxEase.quadInOut, type: PINGPONG});
} }
/* /*
FlxG.watch.addQuick('cur display', FlxG.stage.window.display.id); FlxG.watch.addQuick('cur display', FlxG.stage.window.display.id);
if (FlxG.keys.justPressed.Y) if (FlxG.keys.justPressed.Y)
{ {
@ -373,8 +372,7 @@ class TitleState extends MusicBeatState
#if newgrounds #if newgrounds
if (!OutdatedSubState.leftState) if (!OutdatedSubState.leftState)
{ {
NGio.checkVersion(function(version) NGio.checkVersion(function(version) {
{
// Check if version is outdated // Check if version is outdated
var localVersion:String = "v" + Application.current.meta.get('version'); var localVersion:String = "v" + Application.current.meta.get('version');
var onlineVersion = version.split(" ")[0].trim(); var onlineVersion = version.split(" ")[0].trim();
@ -391,8 +389,7 @@ class TitleState extends MusicBeatState
}); });
} }
#end #end
new FlxTimer().start(2, function(tmr:FlxTimer) new FlxTimer().start(2, function(tmr:FlxTimer) {
{
// These assets are very unlikely to be used for the rest of gameplay, so it unloads them from cache/memory // These assets are very unlikely to be used for the rest of gameplay, so it unloads them from cache/memory
// Saves about 50mb of RAM or so??? // Saves about 50mb of RAM or so???
Assets.cache.clear(Paths.image('gfDanceTitle')); Assets.cache.clear(Paths.image('gfDanceTitle'));
@ -404,7 +401,7 @@ class TitleState extends MusicBeatState
// FlxG.sound.play(Paths.music('titleShoot'), 0.7); // FlxG.sound.play(Paths.music('titleShoot'), 0.7);
} }
if (pressedEnter && !skippedIntro && initialized) skipIntro(); if (pressedEnter && !skippedIntro && initialized) skipIntro();
/* /*
#if web #if web
if (!initialized && controls.ACCEPT) if (!initialized && controls.ACCEPT)
{ {

View file

@ -226,7 +226,7 @@ class NGUtil
scoreboardsLoaded = true; scoreboardsLoaded = true;
ngScoresLoaded.dispatch(); ngScoresLoaded.dispatch();
/* /*
for (score in NG.core.scoreBoards.get(8737).scores) for (score in NG.core.scoreBoards.get(8737).scores)
{ {
trace('score loaded user:${score.user.name}, score:${score.formatted_value}'); trace('score loaded user:${score.user.name}, score:${score.formatted_value}');

View file

@ -36,14 +36,12 @@ class NgPrompt extends Prompt
#if web #if web
prompt.buttons.getItem("yes").fireInstantly = true; prompt.buttons.getItem("yes").fireInstantly = true;
#end #end
prompt.onYes = function() prompt.onYes = function() {
{
prompt.setText("Connecting..." #if web + "\n(check your popup blocker)" #end); prompt.setText("Connecting..." #if web + "\n(check your popup blocker)" #end);
prompt.setButtons(None); prompt.setButtons(None);
openPassportUrl(); openPassportUrl();
}; };
prompt.onNo = function() prompt.onNo = function() {
{
prompt.close(); prompt.close();
prompt = null; prompt = null;
NGio.cancelLogin(); NGio.cancelLogin();
@ -92,8 +90,7 @@ class NgPrompt extends Prompt
{ {
var user = io.newgrounds.NG.core.user.name; var user = io.newgrounds.NG.core.user.name;
var prompt = new NgPrompt('Log out of $user?', Yes_No); var prompt = new NgPrompt('Log out of $user?', Yes_No);
prompt.onYes = function() prompt.onYes = function() {
{
NGio.logout(); NGio.logout();
prompt.close(); prompt.close();
}; };

View file

@ -44,7 +44,7 @@ class SoundGroup extends FlxTypedGroup<FlxSound>
/** /**
* Finds the largest deviation from the desired time inside this SoundGroup. * Finds the largest deviation from the desired time inside this SoundGroup.
* *
* @param targetTime The time to check against. * @param targetTime The time to check against.
* If none is provided, it checks the time of all members against the first member of this SoundGroup. * If none is provided, it checks the time of all members against the first member of this SoundGroup.
* @return The largest deviation from the target time found. * @return The largest deviation from the target time found.

View file

@ -484,7 +484,7 @@ class ChartingState extends MusicBeatState
// general shit // general shit
var title:FlxText = new FlxText(UI_box.x + 20, UI_box.y + 20, 0); var title:FlxText = new FlxText(UI_box.x + 20, UI_box.y + 20, 0);
bullshitUI.add(title); bullshitUI.add(title);
/* /*
var loopCheck = new FlxUICheckBox(UI_box.x + 10, UI_box.y + 50, null, null, "Loops", 100, ['loop check']); var loopCheck = new FlxUICheckBox(UI_box.x + 10, UI_box.y + 50, null, null, "Loops", 100, ['loop check']);
loopCheck.checked = notes[0]elected.doesLoop; loopCheck.checked = notes[0]elected.doesLoop;
tooltips.add(loopCheck, {title: 'Section looping', body: "Whether or not it's a simon says style section", style: tooltipType}); tooltips.add(loopCheck, {title: 'Section looping', body: "Whether or not it's a simon says style section", style: tooltipType});
@ -561,7 +561,7 @@ class ChartingState extends MusicBeatState
}*/ }*/
/** /**
* Gets the start time of section, defaults to the curSection * Gets the start time of section, defaults to the curSection
* @param section * @param section
* @return position of the song in... either seconds or milliseconds.... woops * @return position of the song in... either seconds or milliseconds.... woops
*/ */
function sectionStartTime(?funnySection:Int):Float function sectionStartTime(?funnySection:Int):Float
@ -1156,7 +1156,7 @@ class ChartingState extends MusicBeatState
{ {
sidePreview.drawRect(0, 0, 40, FlxG.height, 0xFF444444); sidePreview.drawRect(0, 0, 40, FlxG.height, 0xFF444444);
/* /*
var sectionsNeeded:Int = Std.int(FlxG.sound.music.length / (sectionCalc(_song.bpm) * 4)); var sectionsNeeded:Int = Std.int(FlxG.sound.music.length / (sectionCalc(_song.bpm) * 4));
while (sectionsNeeded > 0) while (sectionsNeeded > 0)

View file

@ -11,7 +11,7 @@ typedef EntryConstructorFunction = String->Void;
/** /**
* A base type for a Registry, which is an object which handles loading scriptable objects. * A base type for a Registry, which is an object which handles loading scriptable objects.
* *
* @param T The type to construct. Must implement `IRegistryEntry`. * @param T The type to construct. Must implement `IRegistryEntry`.
* @param J The type of the JSON data used when constructing. * @param J The type of the JSON data used when constructing.
*/ */
@ -139,8 +139,8 @@ abstract class BaseRegistry<T:(IRegistryEntry<J> & Constructible<EntryConstructo
/** /**
* Read, parse, and validate the JSON data and produce the corresponding data object. * Read, parse, and validate the JSON data and produce the corresponding data object.
* *
* NOTE: Must be implemented on the implementation class annd * NOTE: Must be implemented on the implementation class annd
*/ */
public abstract function parseEntryData(id:String):Null<J>; public abstract function parseEntryData(id:String):Null<J>;
@ -161,7 +161,7 @@ abstract class BaseRegistry<T:(IRegistryEntry<J> & Constructible<EntryConstructo
/** /**
* Create a entry, attached to a scripted class, from the given class name. * Create a entry, attached to a scripted class, from the given class name.
* @param clsName * @param clsName
*/ */
abstract function createScriptedEntry(clsName:String):Null<T>; abstract function createScriptedEntry(clsName:String):Null<T>;
} }

View file

@ -48,8 +48,7 @@ class BGScrollingText extends FlxSpriteGroup
function set_funnyColor(col:Int):Int function set_funnyColor(col:Int):Int
{ {
grpTexts.forEach(function(txt) grpTexts.forEach(function(txt) {
{
txt.color = col; txt.color = col;
}); });
@ -85,8 +84,7 @@ class BGScrollingText extends FlxSpriteGroup
function sortTextShit():Void function sortTextShit():Void
{ {
grpTexts.sort(function(Order:Int, Obj1:FlxObject, Obj2:FlxObject) grpTexts.sort(function(Order:Int, Obj1:FlxObject, Obj2:FlxObject) {
{
return FlxSort.byValues(Order, Obj1.x, Obj2.x); return FlxSort.byValues(Order, Obj1.x, Obj2.x);
}); });
} }

View file

@ -77,9 +77,9 @@ class SustainTrail extends FlxSprite
/** /**
* Normally you would take strumTime:Float, noteData:Int, sustainLength:Float, parentNote:Note (?) * Normally you would take strumTime:Float, noteData:Int, sustainLength:Float, parentNote:Note (?)
* @param NoteData * @param NoteData
* @param SustainLength * @param SustainLength
* @param FileName * @param FileName
*/ */
public function new(NoteData:Int, SustainLength:Float, Path:String, ?Alpha:Float = 0.6, ?Pixel:Bool = false) public function new(NoteData:Int, SustainLength:Float, Path:String, ?Alpha:Float = 0.6, ?Pixel:Bool = false)
{ {

View file

@ -18,7 +18,7 @@ class FlxVideo extends FlxBasic
public var finishCallback:Void->Void; public var finishCallback:Void->Void;
/** /**
* Doesn't actually interact with Flixel shit, only just a pleasant to use class * Doesn't actually interact with Flixel shit, only just a pleasant to use class
*/ */
public function new(vidSrc:String) public function new(vidSrc:String)
{ {

View file

@ -123,8 +123,7 @@ class Cursor
if (assetCursorDefault == null) if (assetCursorDefault == null)
{ {
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_DEFAULT_PARAMS.graphic); var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_DEFAULT_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData) future.onComplete(function(bitmapData:BitmapData) {
{
assetCursorDefault = bitmapData; assetCursorDefault = bitmapData;
applyCursorParams(assetCursorDefault, CURSOR_DEFAULT_PARAMS); applyCursorParams(assetCursorDefault, CURSOR_DEFAULT_PARAMS);
}); });
@ -138,8 +137,7 @@ class Cursor
if (assetCursorCross == null) if (assetCursorCross == null)
{ {
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_CROSS_PARAMS.graphic); var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_CROSS_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData) future.onComplete(function(bitmapData:BitmapData) {
{
assetCursorCross = bitmapData; assetCursorCross = bitmapData;
applyCursorParams(assetCursorCross, CURSOR_CROSS_PARAMS); applyCursorParams(assetCursorCross, CURSOR_CROSS_PARAMS);
}); });
@ -153,8 +151,7 @@ class Cursor
if (assetCursorEraser == null) if (assetCursorEraser == null)
{ {
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_ERASER_PARAMS.graphic); var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_ERASER_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData) future.onComplete(function(bitmapData:BitmapData) {
{
assetCursorEraser = bitmapData; assetCursorEraser = bitmapData;
applyCursorParams(assetCursorEraser, CURSOR_ERASER_PARAMS); applyCursorParams(assetCursorEraser, CURSOR_ERASER_PARAMS);
}); });
@ -168,8 +165,7 @@ class Cursor
if (assetCursorGrabbing == null) if (assetCursorGrabbing == null)
{ {
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_GRABBING_PARAMS.graphic); var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_GRABBING_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData) future.onComplete(function(bitmapData:BitmapData) {
{
assetCursorGrabbing = bitmapData; assetCursorGrabbing = bitmapData;
applyCursorParams(assetCursorGrabbing, CURSOR_GRABBING_PARAMS); applyCursorParams(assetCursorGrabbing, CURSOR_GRABBING_PARAMS);
}); });
@ -183,8 +179,7 @@ class Cursor
if (assetCursorHourglass == null) if (assetCursorHourglass == null)
{ {
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_HOURGLASS_PARAMS.graphic); var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_HOURGLASS_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData) future.onComplete(function(bitmapData:BitmapData) {
{
assetCursorHourglass = bitmapData; assetCursorHourglass = bitmapData;
applyCursorParams(assetCursorHourglass, CURSOR_HOURGLASS_PARAMS); applyCursorParams(assetCursorHourglass, CURSOR_HOURGLASS_PARAMS);
}); });
@ -198,8 +193,7 @@ class Cursor
if (assetCursorPointer == null) if (assetCursorPointer == null)
{ {
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_POINTER_PARAMS.graphic); var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_POINTER_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData) future.onComplete(function(bitmapData:BitmapData) {
{
assetCursorPointer = bitmapData; assetCursorPointer = bitmapData;
applyCursorParams(assetCursorPointer, CURSOR_POINTER_PARAMS); applyCursorParams(assetCursorPointer, CURSOR_POINTER_PARAMS);
}); });
@ -213,8 +207,7 @@ class Cursor
if (assetCursorText == null) if (assetCursorText == null)
{ {
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_TEXT_PARAMS.graphic); var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_TEXT_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData) future.onComplete(function(bitmapData:BitmapData) {
{
assetCursorText = bitmapData; assetCursorText = bitmapData;
applyCursorParams(assetCursorText, CURSOR_TEXT_PARAMS); applyCursorParams(assetCursorText, CURSOR_TEXT_PARAMS);
}); });
@ -228,8 +221,7 @@ class Cursor
if (assetCursorZoomIn == null) if (assetCursorZoomIn == null)
{ {
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_ZOOM_IN_PARAMS.graphic); var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_ZOOM_IN_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData) future.onComplete(function(bitmapData:BitmapData) {
{
assetCursorZoomIn = bitmapData; assetCursorZoomIn = bitmapData;
applyCursorParams(assetCursorZoomIn, CURSOR_ZOOM_IN_PARAMS); applyCursorParams(assetCursorZoomIn, CURSOR_ZOOM_IN_PARAMS);
}); });
@ -243,8 +235,7 @@ class Cursor
if (assetCursorZoomOut == null) if (assetCursorZoomOut == null)
{ {
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_ZOOM_OUT_PARAMS.graphic); var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_ZOOM_OUT_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData) future.onComplete(function(bitmapData:BitmapData) {
{
assetCursorZoomOut = bitmapData; assetCursorZoomOut = bitmapData;
applyCursorParams(assetCursorZoomOut, CURSOR_ZOOM_OUT_PARAMS); applyCursorParams(assetCursorZoomOut, CURSOR_ZOOM_OUT_PARAMS);
}); });

View file

@ -5,10 +5,10 @@ import flixel.FlxBasic;
/** /**
* Handles repeating behavior when holding down a key or key combination. * Handles repeating behavior when holding down a key or key combination.
* *
* When the `keys` are pressed, `activated` will be true for the first frame, * When the `keys` are pressed, `activated` will be true for the first frame,
* then wait `delay` seconds before becoming true for one frame every `interval` seconds. * then wait `delay` seconds before becoming true for one frame every `interval` seconds.
* *
* Example: Pressing Ctrl+Z will undo, while holding Ctrl+Z will start to undo repeatedly. * Example: Pressing Ctrl+Z will undo, while holding Ctrl+Z will start to undo repeatedly.
*/ */
class TurboKeyHandler extends FlxBasic class TurboKeyHandler extends FlxBasic

View file

@ -4,7 +4,7 @@ import funkin.modding.events.ScriptEvent;
/** /**
* Defines a set of callbacks available to all scripted classes. * Defines a set of callbacks available to all scripted classes.
* *
* Includes events handling basic life cycle relevant to all scripted classes. * Includes events handling basic life cycle relevant to all scripted classes.
*/ */
interface IScriptedClass interface IScriptedClass
@ -53,7 +53,7 @@ interface INoteScriptedClass extends IScriptedClass
/** /**
* Developer note: * Developer note:
* *
* I previously considered adding events for onKeyDown, onKeyUp, mouse events, etc. * I previously considered adding events for onKeyDown, onKeyUp, mouse events, etc.
* However, I realized that you can simply call something like the following within a module: * However, I realized that you can simply call something like the following within a module:
* `FlxG.state.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);` * `FlxG.state.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);`

View file

@ -8,7 +8,7 @@ class PolymodErrorHandler
* Show a popup with the given text. * Show a popup with the given text.
* This displays a system popup, it WILL interrupt the game. * This displays a system popup, it WILL interrupt the game.
* Make sure to only use this when it's important, like when there's a script error. * Make sure to only use this when it's important, like when there's a script error.
* *
* @param name The name at the top of the popup. * @param name The name at the top of the popup.
* @param desc The body text of the popup. * @param desc The body text of the popup.
*/ */

View file

@ -19,7 +19,7 @@ class ScriptEvent
* Called when the relevant object is created. * Called when the relevant object is created.
* Keep in mind that the constructor may be called before the object is needed, * Keep in mind that the constructor may be called before the object is needed,
* for the purposes of caching data or otherwise. * for the purposes of caching data or otherwise.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final CREATE:ScriptEventType = "CREATE"; public static inline final CREATE:ScriptEventType = "CREATE";
@ -27,7 +27,7 @@ class ScriptEvent
/** /**
* Called when the relevant object is destroyed. * Called when the relevant object is destroyed.
* This should perform relevant cleanup to ensure good performance. * This should perform relevant cleanup to ensure good performance.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final DESTROY:ScriptEventType = "DESTROY"; public static inline final DESTROY:ScriptEventType = "DESTROY";
@ -35,7 +35,7 @@ class ScriptEvent
/** /**
* Called when the relevent object is added to the game state. * Called when the relevent object is added to the game state.
* This assumes all data is loaded and ready to go. * This assumes all data is loaded and ready to go.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final ADDED:ScriptEventType = 'ADDED'; public static inline final ADDED:ScriptEventType = 'ADDED';
@ -43,35 +43,35 @@ class ScriptEvent
/** /**
* Called during the update function. * Called during the update function.
* This is called every frame, so be careful! * This is called every frame, so be careful!
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final UPDATE:ScriptEventType = "UPDATE"; public static inline final UPDATE:ScriptEventType = "UPDATE";
/** /**
* Called when the player moves to pause the game. * Called when the player moves to pause the game.
* *
* This event IS cancelable! Canceling the event will prevent the game from pausing. * This event IS cancelable! Canceling the event will prevent the game from pausing.
*/ */
public static inline final PAUSE:ScriptEventType = "PAUSE"; public static inline final PAUSE:ScriptEventType = "PAUSE";
/** /**
* Called when the player moves to unpause the game while paused. * Called when the player moves to unpause the game while paused.
* *
* This event IS cancelable! Canceling the event will prevent the game from resuming. * This event IS cancelable! Canceling the event will prevent the game from resuming.
*/ */
public static inline final RESUME:ScriptEventType = "RESUME"; public static inline final RESUME:ScriptEventType = "RESUME";
/** /**
* Called once per step in the song. This happens 4 times per measure. * Called once per step in the song. This happens 4 times per measure.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final SONG_BEAT_HIT:ScriptEventType = "BEAT_HIT"; public static inline final SONG_BEAT_HIT:ScriptEventType = "BEAT_HIT";
/** /**
* Called once per step in the song. This happens 16 times per measure. * Called once per step in the song. This happens 16 times per measure.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final SONG_STEP_HIT:ScriptEventType = "STEP_HIT"; public static inline final SONG_STEP_HIT:ScriptEventType = "STEP_HIT";
@ -105,7 +105,7 @@ class ScriptEvent
/** /**
* Called when a song event is reached in the chart. * Called when a song event is reached in the chart.
* *
* This event IS cancelable! Cancelling this event prevents the event from being triggered, * This event IS cancelable! Cancelling this event prevents the event from being triggered,
* thus blocking its normal functionality. * thus blocking its normal functionality.
*/ */
@ -113,21 +113,21 @@ class ScriptEvent
/** /**
* Called when the song starts. This occurs as the countdown ends and the instrumental and vocals begin. * Called when the song starts. This occurs as the countdown ends and the instrumental and vocals begin.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final SONG_START:ScriptEventType = "SONG_START"; public static inline final SONG_START:ScriptEventType = "SONG_START";
/** /**
* Called when the song ends. This happens as the instrumental and vocals end. * Called when the song ends. This happens as the instrumental and vocals end.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final SONG_END:ScriptEventType = "SONG_END"; public static inline final SONG_END:ScriptEventType = "SONG_END";
/** /**
* Called when the countdown begins. This occurs before the song starts. * Called when the countdown begins. This occurs before the song starts.
* *
* This event IS cancelable! Canceling this event will prevent the countdown from starting. * This event IS cancelable! Canceling this event will prevent the countdown from starting.
* - The song will not start until you call Countdown.performCountdown() later. * - The song will not start until you call Countdown.performCountdown() later.
* - Note that calling performCountdown() will trigger this event again, so be sure to add logic to ignore it. * - Note that calling performCountdown() will trigger this event again, so be sure to add logic to ignore it.
@ -137,7 +137,7 @@ class ScriptEvent
/** /**
* Called when a step of the countdown happens. * Called when a step of the countdown happens.
* Includes information about what step of the countdown was hit. * Includes information about what step of the countdown was hit.
* *
* This event IS cancelable! Canceling this event will pause the countdown. * This event IS cancelable! Canceling this event will pause the countdown.
* - The countdown will not resume until you call PlayState.resumeCountdown(). * - The countdown will not resume until you call PlayState.resumeCountdown().
*/ */
@ -145,14 +145,14 @@ class ScriptEvent
/** /**
* Called when the countdown is done but just before the song starts. * Called when the countdown is done but just before the song starts.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final COUNTDOWN_END:ScriptEventType = "COUNTDOWN_END"; public static inline final COUNTDOWN_END:ScriptEventType = "COUNTDOWN_END";
/** /**
* Called before the game over screen triggers and the death animation plays. * Called before the game over screen triggers and the death animation plays.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final GAME_OVER:ScriptEventType = "GAME_OVER"; public static inline final GAME_OVER:ScriptEventType = "GAME_OVER";
@ -160,21 +160,21 @@ class ScriptEvent
/** /**
* Called after the player presses a key to restart the game. * Called after the player presses a key to restart the game.
* This can happen from the pause menu or the game over screen. * This can happen from the pause menu or the game over screen.
* *
* This event IS cancelable! Canceling this event will prevent the game from restarting. * This event IS cancelable! Canceling this event will prevent the game from restarting.
*/ */
public static inline final SONG_RETRY:ScriptEventType = "SONG_RETRY"; public static inline final SONG_RETRY:ScriptEventType = "SONG_RETRY";
/** /**
* Called when the player pushes down any key on the keyboard. * Called when the player pushes down any key on the keyboard.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final KEY_DOWN:ScriptEventType = "KEY_DOWN"; public static inline final KEY_DOWN:ScriptEventType = "KEY_DOWN";
/** /**
* Called when the player releases a key on the keyboard. * Called when the player releases a key on the keyboard.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final KEY_UP:ScriptEventType = "KEY_UP"; public static inline final KEY_UP:ScriptEventType = "KEY_UP";
@ -182,56 +182,56 @@ class ScriptEvent
/** /**
* Called when the game has finished loading the notes from JSON. * Called when the game has finished loading the notes from JSON.
* This allows modders to mutate the notes before they are used in the song. * This allows modders to mutate the notes before they are used in the song.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final SONG_LOADED:ScriptEventType = "SONG_LOADED"; public static inline final SONG_LOADED:ScriptEventType = "SONG_LOADED";
/** /**
* Called when the game is about to switch the current FlxState. * Called when the game is about to switch the current FlxState.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final STATE_CHANGE_BEGIN:ScriptEventType = "STATE_CHANGE_BEGIN"; public static inline final STATE_CHANGE_BEGIN:ScriptEventType = "STATE_CHANGE_BEGIN";
/** /**
* Called when the game has finished switching the current FlxState. * Called when the game has finished switching the current FlxState.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final STATE_CHANGE_END:ScriptEventType = "STATE_CHANGE_END"; public static inline final STATE_CHANGE_END:ScriptEventType = "STATE_CHANGE_END";
/** /**
* Called when the game is about to open a new FlxSubState. * Called when the game is about to open a new FlxSubState.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final SUBSTATE_OPEN_BEGIN:ScriptEventType = "SUBSTATE_OPEN_BEGIN"; public static inline final SUBSTATE_OPEN_BEGIN:ScriptEventType = "SUBSTATE_OPEN_BEGIN";
/** /**
* Called when the game has finished opening a new FlxSubState. * Called when the game has finished opening a new FlxSubState.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final SUBSTATE_OPEN_END:ScriptEventType = "SUBSTATE_OPEN_END"; public static inline final SUBSTATE_OPEN_END:ScriptEventType = "SUBSTATE_OPEN_END";
/** /**
* Called when the game is about to close the current FlxSubState. * Called when the game is about to close the current FlxSubState.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final SUBSTATE_CLOSE_BEGIN:ScriptEventType = "SUBSTATE_CLOSE_BEGIN"; public static inline final SUBSTATE_CLOSE_BEGIN:ScriptEventType = "SUBSTATE_CLOSE_BEGIN";
/** /**
* Called when the game has finished closing the current FlxSubState. * Called when the game has finished closing the current FlxSubState.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
public static inline final SUBSTATE_CLOSE_END:ScriptEventType = "SUBSTATE_CLOSE_END"; public static inline final SUBSTATE_CLOSE_END:ScriptEventType = "SUBSTATE_CLOSE_END";
/** /**
* Called when the game is exiting the current FlxState. * Called when the game is exiting the current FlxState.
* *
* This event is not cancelable. * This event is not cancelable.
*/ */
/** /**

View file

@ -25,7 +25,7 @@ class Module implements IPlayStateScriptedClass implements IStateChangingScripte
/** /**
* Determines the order in which modules receive events. * Determines the order in which modules receive events.
* You can modify this to change the order in which a given module receives events. * You can modify this to change the order in which a given module receives events.
* *
* Priority 1 is processed before Priority 1000, etc. * Priority 1 is processed before Priority 1000, etc.
*/ */
public var priority(default, set):Int; public var priority(default, set):Int;
@ -41,7 +41,7 @@ class Module implements IPlayStateScriptedClass implements IStateChangingScripte
/** /**
* Called when the module is initialized. * Called when the module is initialized.
* It may not be safe to reference other modules here since they may not be loaded yet. * It may not be safe to reference other modules here since they may not be loaded yet.
* *
* NOTE: To make the module start inactive, call `this.active = false` in the constructor. * NOTE: To make the module start inactive, call `this.active = false` in the constructor.
*/ */
public function new(moduleId:String, priority:Int = 1000):Void public function new(moduleId:String, priority:Int = 1000):Void

View file

@ -16,7 +16,7 @@ class ModuleHandler
/** /**
* Parses and preloads the game's stage data and scripts when the game starts. * Parses and preloads the game's stage data and scripts when the game starts.
* *
* If you want to force stages to be reloaded, you can just call this function again. * If you want to force stages to be reloaded, you can just call this function again.
*/ */
public static function loadModuleCache():Void public static function loadModuleCache():Void
@ -66,8 +66,7 @@ class ModuleHandler
{ {
modulePriorityOrder = moduleCache.keys().array(); modulePriorityOrder = moduleCache.keys().array();
modulePriorityOrder.sort(function(a:String, b:String):Int modulePriorityOrder.sort(function(a:String, b:String):Int {
{
var aModule:Module = moduleCache.get(a); var aModule:Module = moduleCache.get(a);
var bModule:Module = moduleCache.get(b); var bModule:Module = moduleCache.get(b);

View file

@ -7,7 +7,7 @@ import openfl.Assets;
* Just various functions that IDK where to put em!!! * Just various functions that IDK where to put em!!!
* Semi-temp for now? the note stuff is super clutter-y right now * Semi-temp for now? the note stuff is super clutter-y right now
* so I am putting this new stuff here right now XDD * so I am putting this new stuff here right now XDD
* *
* A lot of this stuff can probably be moved to where appropriate! * A lot of this stuff can probably be moved to where appropriate!
* i dont care about NoteUtil.hx at all!!! * i dont care about NoteUtil.hx at all!!!
*/ */
@ -15,7 +15,7 @@ class NoteUtil
{ {
/** /**
* IDK THING FOR BOTH LOL! DIS SHIT HACK-Y * IDK THING FOR BOTH LOL! DIS SHIT HACK-Y
* @param jsonPath * @param jsonPath
* @return Map<Int, Array<SongEventInfo>> * @return Map<Int, Array<SongEventInfo>>
*/ */
public static function loadSongEvents(jsonPath:String):Map<Int, Array<SongEventInfo>> public static function loadSongEvents(jsonPath:String):Map<Int, Array<SongEventInfo>>
@ -34,7 +34,7 @@ class NoteUtil
/** /**
* Parses song event json stuff into a neater lil map grouping? * Parses song event json stuff into a neater lil map grouping?
* @param songEvents * @param songEvents
*/ */
public static function parseSongEvents(songEvents:Array<SongEvent>):Map<Int, Array<SongEventInfo>> public static function parseSongEvents(songEvents:Array<SongEvent>):Map<Int, Array<SongEventInfo>>
{ {

View file

@ -46,8 +46,7 @@ class Countdown
// The timer function gets called based on the beat of the song. // The timer function gets called based on the beat of the song.
countdownTimer = new FlxTimer(); countdownTimer = new FlxTimer();
countdownTimer.start(Conductor.crochet / 1000, function(tmr:FlxTimer) countdownTimer.start(Conductor.crochet / 1000, function(tmr:FlxTimer) {
{
countdownStep = decrement(countdownStep); countdownStep = decrement(countdownStep);
// Handle onBeatHit events manually // Handle onBeatHit events manually
@ -102,7 +101,7 @@ class Countdown
/** /**
* Pauses the countdown at the current step. You can start it up again later by calling resumeCountdown(). * Pauses the countdown at the current step. You can start it up again later by calling resumeCountdown().
* *
* If you want to call this from a module, it's better to use the event system and cancel the onCountdownStep event. * If you want to call this from a module, it's better to use the event system and cancel the onCountdownStep event.
*/ */
public static function pauseCountdown() public static function pauseCountdown()
@ -115,7 +114,7 @@ class Countdown
/** /**
* Resumes the countdown at the current step. Only makes sense if you called pauseCountdown() first. * Resumes the countdown at the current step. Only makes sense if you called pauseCountdown() first.
* *
* If you want to call this from a module, it's better to use the event system and cancel the onCountdownStep event. * If you want to call this from a module, it's better to use the event system and cancel the onCountdownStep event.
*/ */
public static function resumeCountdown() public static function resumeCountdown()
@ -128,7 +127,7 @@ class Countdown
/** /**
* Stops the countdown at the current step. You will have to restart it again later. * Stops the countdown at the current step. You will have to restart it again later.
* *
* If you want to call this from a module, it's better to use the event system and cancel the onCountdownStart event. * If you want to call this from a module, it's better to use the event system and cancel the onCountdownStart event.
*/ */
public static function stopCountdown() public static function stopCountdown()
@ -166,7 +165,7 @@ class Countdown
/** /**
* Retrieves the graphic to use for this step of the countdown. * Retrieves the graphic to use for this step of the countdown.
* TODO: Make this less dumb. Unhardcode it? Use modules? Use notestyles? * TODO: Make this less dumb. Unhardcode it? Use modules? Use notestyles?
* *
* This is public so modules can do lol funny shit. * This is public so modules can do lol funny shit.
*/ */
public static function showCountdownGraphic(index:CountdownStep, isPixelStyle:Bool):Void public static function showCountdownGraphic(index:CountdownStep, isPixelStyle:Bool):Void
@ -216,8 +215,7 @@ class Countdown
FlxTween.tween(countdownSprite, {y: countdownSprite.y += 100, alpha: 0}, Conductor.crochet / 1000, FlxTween.tween(countdownSprite, {y: countdownSprite.y += 100, alpha: 0}, Conductor.crochet / 1000,
{ {
ease: FlxEase.cubeInOut, ease: FlxEase.cubeInOut,
onComplete: function(twn:FlxTween) onComplete: function(twn:FlxTween) {
{
countdownSprite.destroy(); countdownSprite.destroy();
} }
}); });
@ -228,7 +226,7 @@ class Countdown
/** /**
* Retrieves the sound file to use for this step of the countdown. * Retrieves the sound file to use for this step of the countdown.
* TODO: Make this less dumb. Unhardcode it? Use modules? Use notestyles? * TODO: Make this less dumb. Unhardcode it? Use modules? Use notestyles?
* *
* This is public so modules can do lol funny shit. * This is public so modules can do lol funny shit.
*/ */
public static function playCountdownSound(index:CountdownStep, isPixelStyle:Bool):Void public static function playCountdownSound(index:CountdownStep, isPixelStyle:Bool):Void

View file

@ -15,7 +15,7 @@ import funkin.ui.PreferencesMenu;
/** /**
* A substate which renders over the PlayState when the player dies. * A substate which renders over the PlayState when the player dies.
* Displays the player death animation, plays the music, and handles restarting the song. * Displays the player death animation, plays the music, and handles restarting the song.
* *
* The newest implementation uses a substate, which prevents having to reload the song and stage each reset. * The newest implementation uses a substate, which prevents having to reload the song and stage each reset.
*/ */
class GameOverSubstate extends MusicBeatSubstate class GameOverSubstate extends MusicBeatSubstate
@ -237,7 +237,7 @@ class GameOverSubstate extends MusicBeatSubstate
/** /**
* Starts the death music at the appropriate volume. * Starts the death music at the appropriate volume.
* @param startingVolume * @param startingVolume
*/ */
function startDeathMusic(?startingVolume:Float = 1, ?force:Bool = false):Void function startDeathMusic(?startingVolume:Float = 1, ?force:Bool = false):Void
{ {

View file

@ -317,7 +317,7 @@ class HealthIcon extends FlxSprite
/** /**
* Load health icon animations from a Sparrow XML file (the kind used by characters) * Load health icon animations from a Sparrow XML file (the kind used by characters)
* Note that this is looking for SPECIFIC animation names, so you may need to modify the XML. * Note that this is looking for SPECIFIC animation names, so you may need to modify the XML.
* @param charId * @param charId
*/ */
function loadAnimationNew():Void function loadAnimationNew():Void
{ {
@ -333,7 +333,7 @@ class HealthIcon extends FlxSprite
/** /**
* Load health icon animations using the legacy format. * Load health icon animations using the legacy format.
* Simply assumes two icons, the idle and losing icons. * Simply assumes two icons, the idle and losing icons.
* @param charId * @param charId
*/ */
function loadAnimationOld():Void function loadAnimationOld():Void
{ {

View file

@ -164,7 +164,7 @@ class PlayState extends MusicBeatState
/** /**
* An empty FlxObject contained in the scene. * An empty FlxObject contained in the scene.
* The current gameplay camera will be centered on this object. Tween its position to move the camera smoothly. * The current gameplay camera will be centered on this object. Tween its position to move the camera smoothly.
* *
* This is an FlxSprite for two reasons: * This is an FlxSprite for two reasons:
* 1. It needs to be an object in the scene for the camera to be configured to follow it. * 1. It needs to be an object in the scene for the camera to be configured to follow it.
* 2. It needs to be an FlxSprite to allow a graphic (optionally, for debug purposes) to be drawn on it. * 2. It needs to be an FlxSprite to allow a graphic (optionally, for debug purposes) to be drawn on it.
@ -859,10 +859,10 @@ class PlayState extends MusicBeatState
/** /**
* Removes any references to the current stage, then clears the stage cache, * Removes any references to the current stage, then clears the stage cache,
* then reloads all the stages. * then reloads all the stages.
* *
* This is useful for when you want to edit a stage without reloading the whole game. * This is useful for when you want to edit a stage without reloading the whole game.
* Reloading works on both the JSON and the HXC, if applicable. * Reloading works on both the JSON and the HXC, if applicable.
* *
* Call this by pressing F5 on a debug build. * Call this by pressing F5 on a debug build.
*/ */
override function debug_refreshModules() override function debug_refreshModules()
@ -892,7 +892,7 @@ class PlayState extends MusicBeatState
/** /**
* Loads stage data from cache, assembles the props, * Loads stage data from cache, assembles the props,
* and adds it to the state. * and adds it to the state.
* @param id * @param id
*/ */
function loadStage(id:String) function loadStage(id:String)
{ {
@ -1840,7 +1840,7 @@ class PlayState extends MusicBeatState
/** /**
* Jumps forward or backward a number of sections in the song. * Jumps forward or backward a number of sections in the song.
* Accounts for BPM changes, does not prevent death from skipped notes. * Accounts for BPM changes, does not prevent death from skipped notes.
* @param sec * @param sec
*/ */
function changeSection(sec:Int):Void function changeSection(sec:Int):Void
{ {
@ -2273,9 +2273,9 @@ class PlayState extends MusicBeatState
* Called when a player presses a key with no note present. * Called when a player presses a key with no note present.
* Scripts can modify the amount of health/score lost, whether player animations or sounds are used, * Scripts can modify the amount of health/score lost, whether player animations or sounds are used,
* or even cancel the event entirely. * or even cancel the event entirely.
* *
* @param direction * @param direction
* @param hasPossibleNotes * @param hasPossibleNotes
*/ */
function ghostNoteMiss(direction:funkin.noteStuff.NoteBasic.NoteType = 1, hasPossibleNotes:Bool = true):Void function ghostNoteMiss(direction:funkin.noteStuff.NoteBasic.NoteType = 1, hasPossibleNotes:Bool = true):Void
{ {
@ -2535,7 +2535,7 @@ class PlayState extends MusicBeatState
/** /**
* Handles characters dancing to the beat of the current song. * Handles characters dancing to the beat of the current song.
* *
* TODO: Move some of this logic into `Bopper.hx` * TODO: Move some of this logic into `Bopper.hx`
*/ */
public function danceOnBeat() public function danceOnBeat()
@ -2628,7 +2628,7 @@ class PlayState extends MusicBeatState
/** /**
* Function called before closing the current substate. * Function called before closing the current substate.
* @param subState * @param subState
*/ */
public override function closeSubState() public override function closeSubState()
{ {

View file

@ -13,7 +13,7 @@ import funkin.util.Constants;
/** /**
* A group controlling the individual notes of the strumline for a given player. * A group controlling the individual notes of the strumline for a given player.
* *
* FUN FACT: Setting the X and Y of a FlxSpriteGroup will move all the sprites in the group. * FUN FACT: Setting the X and Y of a FlxSpriteGroup will move all the sprites in the group.
*/ */
class Strumline extends FlxTypedSpriteGroup<StrumlineArrow> class Strumline extends FlxTypedSpriteGroup<StrumlineArrow>
@ -62,8 +62,8 @@ class Strumline extends FlxTypedSpriteGroup<StrumlineArrow>
/** /**
* Apply a small animation which moves the arrow down and fades it in. * Apply a small animation which moves the arrow down and fades it in.
* Only plays at the start of Free Play songs. * Only plays at the start of Free Play songs.
* *
* Note that modifying the offset of the whole strumline won't have the * Note that modifying the offset of the whole strumline won't have the
* @param arrow The arrow to animate. * @param arrow The arrow to animate.
* @param index The index of the arrow in the strumline. * @param index The index of the arrow in the strumline.
*/ */

View file

@ -32,7 +32,7 @@ typedef AnimateAtlasAnimation =
/** /**
* An AnimateAtlasCharacter is a Character which is rendered by * An AnimateAtlasCharacter is a Character which is rendered by
* displaying an animation derived from an Adobe Animate texture atlas spritesheet file. * displaying an animation derived from an Adobe Animate texture atlas spritesheet file.
* *
* BaseCharacter has game logic, AnimateAtlasCharacter has only rendering logic. * BaseCharacter has game logic, AnimateAtlasCharacter has only rendering logic.
* KEEP THEM SEPARATE! * KEEP THEM SEPARATE!
*/ */
@ -537,7 +537,7 @@ class AnimateAtlasCharacter extends BaseCharacter
/** /**
* Returns the left-most position of the left-most member. * Returns the left-most position of the left-most member.
* If there are no members, x is returned. * If there are no members, x is returned.
* *
* @since 5.0.0 * @since 5.0.0
* @return the left-most position of the left-most member * @return the left-most position of the left-most member
*/ */
@ -554,7 +554,7 @@ class AnimateAtlasCharacter extends BaseCharacter
/** /**
* Returns the right-most position of the right-most member. * Returns the right-most position of the right-most member.
* If there are no members, x is returned. * If there are no members, x is returned.
* *
* @since 5.0.0 * @since 5.0.0
* @return the right-most position of the right-most member * @return the right-most position of the right-most member
*/ */
@ -586,7 +586,7 @@ class AnimateAtlasCharacter extends BaseCharacter
/** /**
* Returns the top-most position of the top-most member. * Returns the top-most position of the top-most member.
* If there are no members, y is returned. * If there are no members, y is returned.
* *
* @since 5.0.0 * @since 5.0.0
* @return the top-most position of the top-most member * @return the top-most position of the top-most member
*/ */
@ -603,7 +603,7 @@ class AnimateAtlasCharacter extends BaseCharacter
/** /**
* Returns the top-most position of the top-most member. * Returns the top-most position of the top-most member.
* If there are no members, y is returned. * If there are no members, y is returned.
* *
* @since 5.0.0 * @since 5.0.0
* @return the bottom-most position of the bottom-most member * @return the bottom-most position of the bottom-most member
*/ */

View file

@ -9,7 +9,7 @@ import funkin.play.stage.Bopper;
/** /**
* A Character is a stage prop which bops to the music as well as controlled by the strumlines. * A Character is a stage prop which bops to the music as well as controlled by the strumlines.
* *
* Remember: The character's origin is at its FEET. (horizontal center, vertical bottom) * Remember: The character's origin is at its FEET. (horizontal center, vertical bottom)
*/ */
class BaseCharacter extends Bopper class BaseCharacter extends Bopper
@ -43,7 +43,7 @@ class BaseCharacter extends Bopper
/** /**
* Set to true when the character being used in a special way. * Set to true when the character being used in a special way.
* This includes the Chart Editor and the Animation Editor. * This includes the Chart Editor and the Animation Editor.
* *
* Used by scripts to ensure that they don't try to run code to interact with the stage when the stage doesn't actually exist. * Used by scripts to ensure that they don't try to run code to interact with the stage when the stage doesn't actually exist.
*/ */
public var debug:Bool = false; public var debug:Bool = false;
@ -76,7 +76,7 @@ class BaseCharacter extends Bopper
/** /**
* The absolute position of the top-left of the character. * The absolute position of the top-left of the character.
* @return * @return
*/ */
public var cornerPosition(get, set):FlxPoint; public var cornerPosition(get, set):FlxPoint;
@ -112,7 +112,7 @@ class BaseCharacter extends Bopper
/** /**
* Returns the point the camera should focus on. * Returns the point the camera should focus on.
* Should be approximately centered on the character, and should not move based on the current animation. * Should be approximately centered on the character, and should not move based on the current animation.
* *
* Set the position of this rather than reassigning it, so that anything referencing it will not be affected. * Set the position of this rather than reassigning it, so that anything referencing it will not be affected.
*/ */
public var cameraFocusPoint(default, null):FlxPoint = new FlxPoint(0, 0); public var cameraFocusPoint(default, null):FlxPoint = new FlxPoint(0, 0);
@ -242,7 +242,7 @@ class BaseCharacter extends Bopper
/** /**
* Set the sprite scale to the appropriate value. * Set the sprite scale to the appropriate value.
* @param scale * @param scale
*/ */
public function setScale(scale:Null<Float>):Void public function setScale(scale:Null<Float>):Void
{ {
@ -394,7 +394,7 @@ class BaseCharacter extends Bopper
/** /**
* Since no `onBeatHit` or `dance` calls happen in GameOverSubState, * Since no `onBeatHit` or `dance` calls happen in GameOverSubState,
* this regularly gets called instead. * this regularly gets called instead.
* *
* @param force Force the deathLoop animation to play, even if `firstDeath` is still playing. * @param force Force the deathLoop animation to play, even if `firstDeath` is still playing.
*/ */
public function playDeathAnimation(force:Bool = false):Void public function playDeathAnimation(force:Bool = false):Void

View file

@ -33,7 +33,7 @@ class CharacterDataParser
/** /**
* Parses and preloads the game's stage data and scripts when the game starts. * Parses and preloads the game's stage data and scripts when the game starts.
* *
* If you want to force stages to be reloaded, you can just call this function again. * If you want to force stages to be reloaded, you can just call this function again.
*/ */
public static function loadCharacterCache():Void public static function loadCharacterCache():Void
@ -294,7 +294,7 @@ class CharacterDataParser
/** /**
* Load a character's JSON file and parse its data. * Load a character's JSON file and parse its data.
* *
* @param charId The character to load. * @param charId The character to load.
* @return The character data, or null if validation failed. * @return The character data, or null if validation failed.
*/ */
@ -363,8 +363,8 @@ class CharacterDataParser
/** /**
* Set unspecified parameters to their defaults. * Set unspecified parameters to their defaults.
* If the parameter is mandatory, print an error message. * If the parameter is mandatory, print an error message.
* @param id * @param id
* @param input * @param input
* @return The validated character data * @return The validated character data
*/ */
static function validateCharacterData(id:String, input:CharacterData):Null<CharacterData> static function validateCharacterData(id:String, input:CharacterData):Null<CharacterData>
@ -624,7 +624,7 @@ typedef CharacterData =
/** /**
* The frequency at which the character will play its idle animation, in beats. * The frequency at which the character will play its idle animation, in beats.
* Increasing this number will make the character dance less often. * Increasing this number will make the character dance less often.
* *
* @default 1 * @default 1
*/ */
var danceEvery:Null<Int>; var danceEvery:Null<Int>;
@ -633,7 +633,7 @@ typedef CharacterData =
* The minimum duration that a character will play a note animation for, in beats. * The minimum duration that a character will play a note animation for, in beats.
* If this number is too low, you may see the character start playing the idle animation between notes. * If this number is too low, you may see the character start playing the idle animation between notes.
* If this number is too high, you may see the the character play the sing animation for too long after the notes are gone. * If this number is too high, you may see the the character play the sing animation for too long after the notes are gone.
* *
* Examples: * Examples:
* - Daddy Dearest uses a value of `1.525`. * - Daddy Dearest uses a value of `1.525`.
* @default 1.0 * @default 1.0
@ -654,7 +654,7 @@ typedef CharacterData =
/** /**
* Whether or not the whole ass sprite is flipped by default. * Whether or not the whole ass sprite is flipped by default.
* Useful for characters that could also be played (Pico) * Useful for characters that could also be played (Pico)
* *
* @default false * @default false
*/ */
var flipX:Null<Bool>; var flipX:Null<Bool>;

View file

@ -8,11 +8,11 @@ import funkin.play.character.CharacterData.CharacterRenderType;
/** /**
* For some characters which use Sparrow atlases, the spritesheets need to be split * For some characters which use Sparrow atlases, the spritesheets need to be split
* into multiple files. This character renderer handles by showing the appropriate sprite. * into multiple files. This character renderer handles by showing the appropriate sprite.
* *
* Examples in base game include BF Holding GF (most of the sprites are in one file * Examples in base game include BF Holding GF (most of the sprites are in one file
* but the death animation is in a separate file). * but the death animation is in a separate file).
* Only example I can think of in mods is Tricky (which has a separate file for each animation). * Only example I can think of in mods is Tricky (which has a separate file for each animation).
* *
* BaseCharacter has game logic, SparrowCharacter has only rendering logic. * BaseCharacter has game logic, SparrowCharacter has only rendering logic.
* KEEP THEM SEPARATE! * KEEP THEM SEPARATE!
* *

View file

@ -8,7 +8,7 @@ import funkin.play.character.CharacterData.CharacterRenderType;
/** /**
* A SparrowCharacter is a Character which is rendered by * A SparrowCharacter is a Character which is rendered by
* displaying an animation derived from a SparrowV2 atlas spritesheet file. * displaying an animation derived from a SparrowV2 atlas spritesheet file.
* *
* BaseCharacter has game logic, SparrowCharacter has only rendering logic. * BaseCharacter has game logic, SparrowCharacter has only rendering logic.
* KEEP THEM SEPARATE! * KEEP THEM SEPARATE!
*/ */

View file

@ -6,7 +6,7 @@ import funkin.play.song.SongData;
/** /**
* This class represents a handler for a type of song event. * This class represents a handler for a type of song event.
* It is used by the ScriptedSongEvent class to handle user-defined events. * It is used by the ScriptedSongEvent class to handle user-defined events.
* *
* Example: Focus on Boyfriend: * Example: Focus on Boyfriend:
* ``` * ```
* { * {
@ -16,7 +16,7 @@ import funkin.play.song.SongData;
* } * }
* } * }
* ``` * ```
* *
* Example: Focus on 10px above Girlfriend: * Example: Focus on 10px above Girlfriend:
* ``` * ```
* { * {
@ -27,7 +27,7 @@ import funkin.play.song.SongData;
* } * }
* } * }
* ``` * ```
* *
* Example: Focus on (100, 100): * Example: Focus on (100, 100):
* ``` * ```
* { * {

View file

@ -7,7 +7,7 @@ import polymod.hscript.HScriptedClass;
* A script that can be tied to a SongEvent. * A script that can be tied to a SongEvent.
* Create a scripted class that extends SongEvent, * Create a scripted class that extends SongEvent,
* then call `super('SongEventType')` to use this. * then call `super('SongEventType')` to use this.
* *
* - Remember to override `handleEvent(data:SongEventData)` to perform your actions when the event is hit. * - Remember to override `handleEvent(data:SongEventData)` to perform your actions when the event is hit.
* - Remember to override `getTitle()` to return an event name that will be displayed in the editor. * - Remember to override `getTitle()` to return an event name that will be displayed in the editor.
* - Remember to override `getEventSchema()` to return a schema for the event data, used to build a form in the chart editor. * - Remember to override `getEventSchema()` to return a schema for the event data, used to build a form in the chart editor.

View file

@ -184,8 +184,7 @@ class SongEventParser
*/ */
public static function queryEvents(events:Array<SongEventData>, currentTime:Float):Array<SongEventData> public static function queryEvents(events:Array<SongEventData>, currentTime:Float):Array<SongEventData>
{ {
return events.filter(function(event:SongEventData):Bool return events.filter(function(event:SongEventData):Bool {
{
// If the event is already activated, don't activate it again. // If the event is already activated, don't activate it again.
if (event.activated) return false; if (event.activated) return false;

View file

@ -324,7 +324,7 @@ class SongDifficulty
/** /**
* Build a list of vocal files for the given character. * Build a list of vocal files for the given character.
* Automatically resolves suffixed character IDs (so bf-car will resolve to bf if needed). * Automatically resolves suffixed character IDs (so bf-car will resolve to bf if needed).
* *
* @param id The character we are about to play. * @param id The character we are about to play.
*/ */
public function buildVoiceList(?id:String = 'bf'):Array<String> public function buildVoiceList(?id:String = 'bf'):Array<String>

View file

@ -24,7 +24,7 @@ class SongDataParser
/** /**
* Parses and preloads the game's song metadata and scripts when the game starts. * Parses and preloads the game's song metadata and scripts when the game starts.
* *
* If you want to force song metadata to be reloaded, you can just call this function again. * If you want to force song metadata to be reloaded, you can just call this function again.
*/ */
public static function loadSongCache():Void public static function loadSongCache():Void
@ -217,7 +217,7 @@ typedef RawSongMetadata =
{ {
/** /**
* A semantic versioning string for the song data format. * A semantic versioning string for the song data format.
* *
*/ */
var version:Version; var version:Version;
@ -414,7 +414,7 @@ abstract SongNoteData(RawSongNoteData)
/** /**
* The strumline index of the note, if applicable. * The strumline index of the note, if applicable.
* Strips the direction from the data. * Strips the direction from the data.
* *
* 0 = player, 1 = opponent, etc. * 0 = player, 1 = opponent, etc.
*/ */
public inline function getStrumlineIndex(strumlineSize:Int = 4):Int public inline function getStrumlineIndex(strumlineSize:Int = 4):Int

View file

@ -14,14 +14,13 @@ class SongDataUtils
* Given an array of SongNoteData objects, return a new array of SongNoteData objects * Given an array of SongNoteData objects, return a new array of SongNoteData objects
* whose timestamps are shifted by the given amount. * whose timestamps are shifted by the given amount.
* Does not mutate the original array. * Does not mutate the original array.
* *
* @param notes The notes to modify. * @param notes The notes to modify.
* @param offset The time difference to apply in milliseconds. * @param offset The time difference to apply in milliseconds.
*/ */
public static function offsetSongNoteData(notes:Array<SongNoteData>, offset:Int):Array<SongNoteData> public static function offsetSongNoteData(notes:Array<SongNoteData>, offset:Int):Array<SongNoteData>
{ {
return notes.map(function(note:SongNoteData):SongNoteData return notes.map(function(note:SongNoteData):SongNoteData {
{
return new SongNoteData(note.time + offset, note.data, note.length, note.kind); return new SongNoteData(note.time + offset, note.data, note.length, note.kind);
}); });
} }
@ -30,14 +29,13 @@ class SongDataUtils
* Given an array of SongEventData objects, return a new array of SongEventData objects * Given an array of SongEventData objects, return a new array of SongEventData objects
* whose timestamps are shifted by the given amount. * whose timestamps are shifted by the given amount.
* Does not mutate the original array. * Does not mutate the original array.
* *
* @param events The events to modify. * @param events The events to modify.
* @param offset The time difference to apply in milliseconds. * @param offset The time difference to apply in milliseconds.
*/ */
public static function offsetSongEventData(events:Array<SongEventData>, offset:Int):Array<SongEventData> public static function offsetSongEventData(events:Array<SongEventData>, offset:Int):Array<SongEventData>
{ {
return events.map(function(event:SongEventData):SongEventData return events.map(function(event:SongEventData):SongEventData {
{
return new SongEventData(event.time + offset, event.event, event.value); return new SongEventData(event.time + offset, event.event, event.value);
}); });
} }
@ -45,7 +43,7 @@ class SongDataUtils
/** /**
* Return a new array without a certain subset of notes from an array of SongNoteData objects. * Return a new array without a certain subset of notes from an array of SongNoteData objects.
* Does not mutate the original array. * Does not mutate the original array.
* *
* @param notes The array of notes to be subtracted from. * @param notes The array of notes to be subtracted from.
* @param subtrahend The notes to remove from the `notes` array. Yes, subtrahend is a real word. * @param subtrahend The notes to remove from the `notes` array. Yes, subtrahend is a real word.
*/ */
@ -53,8 +51,7 @@ class SongDataUtils
{ {
if (notes.length == 0 || subtrahend.length == 0) return notes; if (notes.length == 0 || subtrahend.length == 0) return notes;
var result = notes.filter(function(note:SongNoteData):Bool var result = notes.filter(function(note:SongNoteData):Bool {
{
for (x in subtrahend) for (x in subtrahend)
// SongNoteData's == operation has been overridden so that this will work. // SongNoteData's == operation has been overridden so that this will work.
if (x == note) return false; if (x == note) return false;
@ -68,7 +65,7 @@ class SongDataUtils
/** /**
* Return a new array without a certain subset of events from an array of SongEventData objects. * Return a new array without a certain subset of events from an array of SongEventData objects.
* Does not mutate the original array. * Does not mutate the original array.
* *
* @param events The array of events to be subtracted from. * @param events The array of events to be subtracted from.
* @param subtrahend The events to remove from the `events` array. Yes, subtrahend is a real word. * @param subtrahend The events to remove from the `events` array. Yes, subtrahend is a real word.
*/ */
@ -76,8 +73,7 @@ class SongDataUtils
{ {
if (events.length == 0 || subtrahend.length == 0) return events; if (events.length == 0 || subtrahend.length == 0) return events;
return events.filter(function(event:SongEventData):Bool return events.filter(function(event:SongEventData):Bool {
{
// SongEventData's == operation has been overridden so that this will work. // SongEventData's == operation has been overridden so that this will work.
return !subtrahend.has(event); return !subtrahend.has(event);
}); });
@ -89,8 +85,7 @@ class SongDataUtils
*/ */
public static function flipNotes(notes:Array<SongNoteData>, ?strumlineSize:Int = 4):Array<SongNoteData> public static function flipNotes(notes:Array<SongNoteData>, ?strumlineSize:Int = 4):Array<SongNoteData>
{ {
return notes.map(function(note:SongNoteData):SongNoteData return notes.map(function(note:SongNoteData):SongNoteData {
{
var newData = note.data; var newData = note.data;
if (newData < strumlineSize) newData += strumlineSize; if (newData < strumlineSize) newData += strumlineSize;
@ -103,7 +98,7 @@ class SongDataUtils
/** /**
* Prepare an array of notes to be used as the clipboard data. * Prepare an array of notes to be used as the clipboard data.
* *
* Offset the provided array of notes such that the first note is at 0 milliseconds. * Offset the provided array of notes such that the first note is at 0 milliseconds.
*/ */
public static function buildNoteClipboard(notes:Array<SongNoteData>):Array<SongNoteData> public static function buildNoteClipboard(notes:Array<SongNoteData>):Array<SongNoteData>
@ -113,7 +108,7 @@ class SongDataUtils
/** /**
* Prepare an array of events to be used as the clipboard data. * Prepare an array of events to be used as the clipboard data.
* *
* Offset the provided array of events such that the first event is at 0 milliseconds. * Offset the provided array of events such that the first event is at 0 milliseconds.
*/ */
public static function buildEventClipboard(events:Array<SongEventData>):Array<SongEventData> public static function buildEventClipboard(events:Array<SongEventData>):Array<SongEventData>
@ -127,8 +122,7 @@ class SongDataUtils
public static function sortNotes(notes:Array<SongNoteData>, ?desc:Bool = false):Array<SongNoteData> public static function sortNotes(notes:Array<SongNoteData>, ?desc:Bool = false):Array<SongNoteData>
{ {
// TODO: Modifies the array in place. Is this okay? // TODO: Modifies the array in place. Is this okay?
notes.sort(function(a:SongNoteData, b:SongNoteData):Int notes.sort(function(a:SongNoteData, b:SongNoteData):Int {
{
return FlxSort.byValues(desc ? FlxSort.DESCENDING : FlxSort.ASCENDING, a.time, b.time); return FlxSort.byValues(desc ? FlxSort.DESCENDING : FlxSort.ASCENDING, a.time, b.time);
}); });
return notes; return notes;
@ -140,8 +134,7 @@ class SongDataUtils
public static function sortEvents(events:Array<SongEventData>, ?desc:Bool = false):Array<SongEventData> public static function sortEvents(events:Array<SongEventData>, ?desc:Bool = false):Array<SongEventData>
{ {
// TODO: Modifies the array in place. Is this okay? // TODO: Modifies the array in place. Is this okay?
events.sort(function(a:SongEventData, b:SongEventData):Int events.sort(function(a:SongEventData, b:SongEventData):Int {
{
return FlxSort.byValues(desc ? FlxSort.DESCENDING : FlxSort.ASCENDING, a.time, b.time); return FlxSort.byValues(desc ? FlxSort.DESCENDING : FlxSort.ASCENDING, a.time, b.time);
}); });
return events; return events;
@ -192,8 +185,7 @@ class SongDataUtils
*/ */
public static function getNotesInTimeRange(notes:Array<SongNoteData>, start:Float, end:Float):Array<SongNoteData> public static function getNotesInTimeRange(notes:Array<SongNoteData>, start:Float, end:Float):Array<SongNoteData>
{ {
return notes.filter(function(note:SongNoteData):Bool return notes.filter(function(note:SongNoteData):Bool {
{
return note.time >= start && note.time <= end; return note.time >= start && note.time <= end;
}); });
} }
@ -203,8 +195,7 @@ class SongDataUtils
*/ */
public static function getEventsInTimeRange(events:Array<SongEventData>, start:Float, end:Float):Array<SongEventData> public static function getEventsInTimeRange(events:Array<SongEventData>, start:Float, end:Float):Array<SongEventData>
{ {
return events.filter(function(event:SongEventData):Bool return events.filter(function(event:SongEventData):Bool {
{
return event.time >= start && event.time <= end; return event.time >= start && event.time <= end;
}); });
} }
@ -214,8 +205,7 @@ class SongDataUtils
*/ */
public static function getNotesInDataRange(notes:Array<SongNoteData>, start:Int, end:Int):Array<SongNoteData> public static function getNotesInDataRange(notes:Array<SongNoteData>, start:Int, end:Int):Array<SongNoteData>
{ {
return notes.filter(function(note:SongNoteData):Bool return notes.filter(function(note:SongNoteData):Bool {
{
return note.data >= start && note.data <= end; return note.data >= start && note.data <= end;
}); });
} }
@ -225,8 +215,7 @@ class SongDataUtils
*/ */
public static function getNotesWithData(notes:Array<SongNoteData>, data:Array<Int>):Array<SongNoteData> public static function getNotesWithData(notes:Array<SongNoteData>, data:Array<Int>):Array<SongNoteData>
{ {
return notes.filter(function(note:SongNoteData):Bool return notes.filter(function(note:SongNoteData):Bool {
{
return data.indexOf(note.data) != -1; return data.indexOf(note.data) != -1;
}); });
} }

View file

@ -50,8 +50,7 @@ class SongSerializer
*/ */
public static function importSongChartDataAsync(callback:SongChartData->Void):Void public static function importSongChartDataAsync(callback:SongChartData->Void):Void
{ {
browseFileReference(function(fileReference:FileReference) browseFileReference(function(fileReference:FileReference) {
{
var data = fileReference.data.toString(); var data = fileReference.data.toString();
if (data == null) return; if (data == null) return;
@ -68,8 +67,7 @@ class SongSerializer
*/ */
public static function importSongMetadataAsync(callback:SongMetadata->Void):Void public static function importSongMetadataAsync(callback:SongMetadata->Void):Void
{ {
browseFileReference(function(fileReference:FileReference) browseFileReference(function(fileReference:FileReference) {
{
var data = fileReference.data.toString(); var data = fileReference.data.toString();
if (data == null) return; if (data == null) return;
@ -103,7 +101,7 @@ class SongSerializer
/** /**
* Save a SongChartData object as a JSON file to a specified path. * Save a SongChartData object as a JSON file to a specified path.
* Works great on HTML5 and desktop. * Works great on HTML5 and desktop.
* *
* @param path The file path to save to. * @param path The file path to save to.
*/ */
public static function exportSongChartDataAs(path:String, data:SongChartData) public static function exportSongChartDataAs(path:String, data:SongChartData)
@ -116,7 +114,7 @@ class SongSerializer
/** /**
* Save a SongMetadata object as a JSON file to a specified path. * Save a SongMetadata object as a JSON file to a specified path.
* Works great on HTML5 and desktop. * Works great on HTML5 and desktop.
* *
* @param path The file path to save to. * @param path The file path to save to.
*/ */
public static function exportSongMetadataAs(path:String, data:SongMetadata) public static function exportSongMetadataAs(path:String, data:SongMetadata)
@ -163,19 +161,17 @@ class SongSerializer
/** /**
* Browse for a file to read and execute a callback once we have a file reference. * Browse for a file to read and execute a callback once we have a file reference.
* Works great on HTML5 or desktop. * Works great on HTML5 or desktop.
* *
* @param callback The function to call when the file is loaded. * @param callback The function to call when the file is loaded.
*/ */
static function browseFileReference(callback:FileReference->Void) static function browseFileReference(callback:FileReference->Void)
{ {
var file = new FileReference(); var file = new FileReference();
file.addEventListener(Event.SELECT, function(e) file.addEventListener(Event.SELECT, function(e) {
{
var selectedFileRef:FileReference = e.target; var selectedFileRef:FileReference = e.target;
trace('Selected file: ' + selectedFileRef.name); trace('Selected file: ' + selectedFileRef.name);
selectedFileRef.addEventListener(Event.COMPLETE, function(e) selectedFileRef.addEventListener(Event.COMPLETE, function(e) {
{
var loadedFileRef:FileReference = e.target; var loadedFileRef:FileReference = e.target;
trace('Loaded file: ' + loadedFileRef.name); trace('Loaded file: ' + loadedFileRef.name);
callback(loadedFileRef); callback(loadedFileRef);
@ -192,16 +188,13 @@ class SongSerializer
static function writeFileReference(path:String, data:String) static function writeFileReference(path:String, data:String)
{ {
var file = new FileReference(); var file = new FileReference();
file.addEventListener(Event.COMPLETE, function(e:Event) file.addEventListener(Event.COMPLETE, function(e:Event) {
{
trace('Successfully wrote file.'); trace('Successfully wrote file.');
}); });
file.addEventListener(Event.CANCEL, function(e:Event) file.addEventListener(Event.CANCEL, function(e:Event) {
{
trace('Cancelled writing file.'); trace('Cancelled writing file.');
}); });
file.addEventListener(IOErrorEvent.IO_ERROR, function(e:IOErrorEvent) file.addEventListener(IOErrorEvent.IO_ERROR, function(e:IOErrorEvent) {
{
trace('IO error writing file.'); trace('IO error writing file.');
}); });
file.save(data, path); file.save(data, path);

View file

@ -30,7 +30,7 @@ class SongValidator
/** /**
* Validates the fields of a SongMetadata object (excluding the version field). * Validates the fields of a SongMetadata object (excluding the version field).
* *
* @param input The SongMetadata object to validate. * @param input The SongMetadata object to validate.
* @param songId The ID of the song being validated. Only used for error messages. * @param songId The ID of the song being validated. Only used for error messages.
* @return The validated SongMetadata object. * @return The validated SongMetadata object.
@ -73,7 +73,7 @@ class SongValidator
/** /**
* Validates the fields of a SongPlayData object. * Validates the fields of a SongPlayData object.
* *
* @param input The SongPlayData object to validate. * @param input The SongPlayData object to validate.
* @param songId The ID of the song being validated. Only used for error messages. * @param songId The ID of the song being validated. Only used for error messages.
* @return The validated SongPlayData object. * @return The validated SongPlayData object.
@ -85,7 +85,7 @@ class SongValidator
/** /**
* Validates the fields of a TimeChange object. * Validates the fields of a TimeChange object.
* *
* @param input The TimeChange object to validate. * @param input The TimeChange object to validate.
* @param songId The ID of the song being validated. Only used for error messages. * @param songId The ID of the song being validated. Only used for error messages.
* @return The validated TimeChange object. * @return The validated TimeChange object.
@ -113,7 +113,7 @@ class SongValidator
/** /**
* Validates the fields of a SongChartData object (excluding the version field). * Validates the fields of a SongChartData object (excluding the version field).
* *
* @param input The SongChartData object to validate. * @param input The SongChartData object to validate.
* @param songId The ID of the song being validated. Only used for error messages. * @param songId The ID of the song being validated. Only used for error messages.
* @return The validated SongChartData object. * @return The validated SongChartData object.

View file

@ -26,7 +26,7 @@ class Bopper extends StageProp implements IPlayStateScriptedClass
* Whether the bopper should dance left and right. * Whether the bopper should dance left and right.
* - If true, alternate playing `danceLeft` and `danceRight`. * - If true, alternate playing `danceLeft` and `danceRight`.
* - If false, play `idle` every time. * - If false, play `idle` every time.
* *
* You can manually set this value, or you can leave it as `null` to determine it automatically. * You can manually set this value, or you can leave it as `null` to determine it automatically.
*/ */
public var shouldAlternate:Null<Bool> = null; public var shouldAlternate:Null<Bool> = null;
@ -139,7 +139,7 @@ class Bopper extends StageProp implements IPlayStateScriptedClass
* @param name The name of the current animation. * @param name The name of the current animation.
* @param frameNumber The number of the current frame. * @param frameNumber The number of the current frame.
* @param frameIndex The index of the current frame. * @param frameIndex The index of the current frame.
* *
* For example, if an animation was defined as having the indexes [3, 0, 1, 2], * For example, if an animation was defined as having the indexes [3, 0, 1, 2],
* then the first callback would have frameNumber = 0 and frameIndex = 3. * then the first callback would have frameNumber = 0 and frameIndex = 3.
*/ */
@ -223,7 +223,7 @@ class Bopper extends StageProp implements IPlayStateScriptedClass
/** /**
* Ensure that a given animation exists before playing it. * Ensure that a given animation exists before playing it.
* Will gracefully check for name, then name with stripped suffixes, then 'idle', then fail to play. * Will gracefully check for name, then name with stripped suffixes, then 'idle', then fail to play.
* @param name * @param name
*/ */
function correctAnimationName(name:String):String function correctAnimationName(name:String):String
{ {

View file

@ -19,7 +19,7 @@ typedef StagePropGroup = FlxTypedSpriteGroup<StageProp>;
/** /**
* A Stage is a group of objects rendered in the PlayState. * A Stage is a group of objects rendered in the PlayState.
* *
* A Stage is comprised of one or more props, each of which is a FlxSprite. * A Stage is comprised of one or more props, each of which is a FlxSprite.
*/ */
class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass
@ -39,8 +39,8 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass
* The Stage elements get initialized at the beginning of the game. * The Stage elements get initialized at the beginning of the game.
* They're used to cache the data needed to build the stage, * They're used to cache the data needed to build the stage,
* then accessed and fleshed out when the stage needs to be built. * then accessed and fleshed out when the stage needs to be built.
* *
* @param stageId * @param stageId
*/ */
public function new(stageId:String) public function new(stageId:String)
{ {
@ -543,7 +543,7 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass
/** /**
* Retrieve a list of all the asset paths required to load the stage. * Retrieve a list of all the asset paths required to load the stage.
* Override this in a scripted class to ensure that all necessary assets are loaded! * Override this in a scripted class to ensure that all necessary assets are loaded!
* *
* @return An array of file names. * @return An array of file names.
*/ */
public function fetchAssetPaths():Array<String> public function fetchAssetPaths():Array<String>

View file

@ -31,7 +31,7 @@ class StageDataParser
/** /**
* Parses and preloads the game's stage data and scripts when the game starts. * Parses and preloads the game's stage data and scripts when the game starts.
* *
* If you want to force stages to be reloaded, you can just call this function again. * If you want to force stages to be reloaded, you can just call this function again.
*/ */
public static function loadStageCache():Void public static function loadStageCache():Void
@ -68,8 +68,7 @@ class StageDataParser
// UNSCRIPTED STAGES // UNSCRIPTED STAGES
// //
var stageIdList:Array<String> = DataAssets.listDataFilesInPath('stages/'); var stageIdList:Array<String> = DataAssets.listDataFilesInPath('stages/');
var unscriptedStageIds:Array<String> = stageIdList.filter(function(stageId:String):Bool var unscriptedStageIds:Array<String> = stageIdList.filter(function(stageId:String):Bool {
{
return !stageCache.exists(stageId); return !stageCache.exists(stageId);
}); });
trace(' Instantiating ${unscriptedStageIds.length} non-scripted stages...'); trace(' Instantiating ${unscriptedStageIds.length} non-scripted stages...');
@ -126,7 +125,7 @@ class StageDataParser
/** /**
* Load a stage's JSON file, parse its data, and return it. * Load a stage's JSON file, parse its data, and return it.
* *
* @param stageId The stage to load. * @param stageId The stage to load.
* @return The stage data, or null if validation failed. * @return The stage data, or null if validation failed.
*/ */
@ -199,8 +198,8 @@ class StageDataParser
/** /**
* Set unspecified parameters to their defaults. * Set unspecified parameters to their defaults.
* If the parameter is mandatory, print an error message. * If the parameter is mandatory, print an error message.
* @param id * @param id
* @param input * @param input
* @return The validated stage data * @return The validated stage data
*/ */
static function validateStageData(id:String, input:StageData):Null<StageData> static function validateStageData(id:String, input:StageData):Null<StageData>
@ -461,7 +460,7 @@ typedef StageDataProp =
* If not zero, this prop will play an animation every X beats of the song. * If not zero, this prop will play an animation every X beats of the song.
* This requires animations to be defined. If `danceLeft` and `danceRight` are defined, * This requires animations to be defined. If `danceLeft` and `danceRight` are defined,
* they will alternated between, otherwise the `idle` animation will be used. * they will alternated between, otherwise the `idle` animation will be used.
* *
* @default 0 * @default 0
*/ */
var danceEvery:Null<Int>; var danceEvery:Null<Int>;

View file

@ -18,7 +18,7 @@ class StageProp extends FlxSprite implements IStateStageProp
/** /**
* Called when this prop is added to the stage. * Called when this prop is added to the stage.
* @param event * @param event
*/ */
public function onAdd(event:ScriptEvent):Void {} public function onAdd(event:ScriptEvent):Void {}

View file

@ -13,7 +13,7 @@ class AngleMask extends FlxShader
vec2 uv = openfl_TextureCoordv.xy; vec2 uv = openfl_TextureCoordv.xy;
vec2 start = vec2(0.0, 0.0); vec2 start = vec2(0.0, 0.0);
vec2 end = vec2(endPosition.x / openfl_TextureSize.x, 1.0); vec2 end = vec2(endPosition.x / openfl_TextureSize.x, 1.0);

View file

@ -66,8 +66,8 @@ class ColorSwapShader extends FlxShader
const float offset = 1.0 / 128.0; const float offset = 1.0 / 128.0;
vec3 normalizeColor(vec3 color) vec3 normalizeColor(vec3 color)
{ {
@ -101,7 +101,7 @@ class ColorSwapShader extends FlxShader
vec4 color = flixel_texture2D(bitmap, openfl_TextureCoordv); vec4 color = flixel_texture2D(bitmap, openfl_TextureCoordv);
vec4 swagColor = vec4(rgb2hsv(vec3(color[0], color[1], color[2])), color[3]); vec4 swagColor = vec4(rgb2hsv(vec3(color[0], color[1], color[2])), color[3]);
// [0] is the hue??? // [0] is the hue???
swagColor[0] += uTime; swagColor[0] += uTime;
// swagColor[1] += uTime; // swagColor[1] += uTime;
@ -109,7 +109,7 @@ class ColorSwapShader extends FlxShader
// money += swagColor[0]; // money += swagColor[0];
color = vec4(hsv2rgb(vec3(swagColor[0], swagColor[1], swagColor[2])), swagColor[3]); color = vec4(hsv2rgb(vec3(swagColor[0], swagColor[1], swagColor[2])), swagColor[3]);
if (awesomeOutline) if (awesomeOutline)
{ {
@ -119,7 +119,7 @@ class ColorSwapShader extends FlxShader
if (color.a <= 0.5) { if (color.a <= 0.5) {
float w = size.x / openfl_TextureSize.x; float w = size.x / openfl_TextureSize.x;
float h = size.y / openfl_TextureSize.y; float h = size.y / openfl_TextureSize.y;
if (flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x + w, openfl_TextureCoordv.y)).a != 0. if (flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x + w, openfl_TextureCoordv.y)).a != 0.
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y)).a != 0. || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y)).a != 0.
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y + h)).a != 0. || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y + h)).a != 0.
@ -130,12 +130,12 @@ class ColorSwapShader extends FlxShader
} }
gl_FragColor = color; gl_FragColor = color;
/* /*
if (color.a > 0.5) if (color.a > 0.5)
gl_FragColor = color; gl_FragColor = color;
else else

View file

@ -47,7 +47,7 @@ class OverlayBlend extends FlxShader
{ {
vec2 funnyUv = openfl_TextureCoordv; vec2 funnyUv = openfl_TextureCoordv;
vec4 color = flixel_texture2D(bitmap, funnyUv); vec4 color = flixel_texture2D(bitmap, funnyUv);
vec2 reallyFunnyUv = vec2(vec2(0.0, 0.0) - gl_FragCoord.xy / openfl_TextureSize.xy); vec2 reallyFunnyUv = vec2(vec2(0.0, 0.0) - gl_FragCoord.xy / openfl_TextureSize.xy);
vec4 gf = flixel_texture2D(funnyShit, openfl_TextureCoordv.xy + vec2(0.1, 0.2)); vec4 gf = flixel_texture2D(funnyShit, openfl_TextureCoordv.xy + vec2(0.1, 0.2));

View file

@ -45,7 +45,7 @@ class ScreenWipeShader extends FlxShader
{ {
vec2 funnyUv = openfl_TextureCoordv; vec2 funnyUv = openfl_TextureCoordv;
vec4 color = flixel_texture2D(bitmap, funnyUv); vec4 color = flixel_texture2D(bitmap, funnyUv);
vec2 reallyFunnyUv = vec2(vec2(0.0, 0.0) - gl_FragCoord.xy / openfl_TextureSize.xy); vec2 reallyFunnyUv = vec2(vec2(0.0, 0.0) - gl_FragCoord.xy / openfl_TextureSize.xy);
vec4 gf = flixel_texture2D(funnyShit, openfl_TextureCoordv); vec4 gf = flixel_texture2D(funnyShit, openfl_TextureCoordv);

View file

@ -44,7 +44,7 @@ class StrokeShader extends FlxShader
if (sample.a == 0.) { if (sample.a == 0.) {
float w = size.x / openfl_TextureSize.x; float w = size.x / openfl_TextureSize.x;
float h = size.y / openfl_TextureSize.y; float h = size.y / openfl_TextureSize.y;
if (flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x + w, openfl_TextureCoordv.y)).a != 0. if (flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x + w, openfl_TextureCoordv.y)).a != 0.
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y)).a != 0. || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y)).a != 0.
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y + h)).a != 0. || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y + h)).a != 0.

View file

@ -50,7 +50,7 @@ class TitleOutline extends FlxShader
if (color.a == 0.0) { if (color.a == 0.0) {
float w = size.x / openfl_TextureSize.x; float w = size.x / openfl_TextureSize.x;
float h = size.y / openfl_TextureSize.y; float h = size.y / openfl_TextureSize.y;
vec4 colorOffset = flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y - h)); vec4 colorOffset = flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y - h));
@ -59,7 +59,7 @@ class TitleOutline extends FlxShader
if (hsvShit.b <= 0.1 && colorOffset.a != 0.) if (hsvShit.b <= 0.1 && colorOffset.a != 0.)
color = vec4(0.0, 1.0, 0.8, color.a); color = vec4(0.0, 1.0, 0.8, color.a);
} }
gl_FragColor = color; gl_FragColor = color;
} }

View file

@ -86,7 +86,7 @@ class AtlasText extends FlxTypedSpriteGroup<AtlasChar>
/** /**
* Converts all characters to fit the font's `allowedCase`. * Converts all characters to fit the font's `allowedCase`.
* @param text * @param text
*/ */
function restrictCase(text:String) function restrictCase(text:String)
{ {

View file

@ -121,8 +121,7 @@ class ControlsMenu extends funkin.ui.OptionsState.Page
var margin = 100; var margin = 100;
menuCamera.deadzone.set(0, margin, menuCamera.width, menuCamera.height - margin * 2); menuCamera.deadzone.set(0, margin, menuCamera.width, menuCamera.height - margin * 2);
menuCamera.minScrollY = 0; menuCamera.minScrollY = 0;
controlGrid.onChange.add(function(selected) controlGrid.onChange.add(function(selected) {
{
camFollow.y = selected.y; camFollow.y = selected.y;
labels.forEach((label) -> label.alpha = 0.6); labels.forEach((label) -> label.alpha = 0.6);

View file

@ -121,9 +121,9 @@ class MenuTypedList<T:MenuItem> extends FlxTypedGroup<T>
/** /**
* Controls navigation on a linear list of items such as Vertical. * Controls navigation on a linear list of items such as Vertical.
* @param prev * @param prev
* @param next * @param next
* @param allowWrap * @param allowWrap
*/ */
inline function navList(prev:Bool, next:Bool, allowWrap:Bool) inline function navList(prev:Bool, next:Bool, allowWrap:Bool)
{ {
@ -164,8 +164,7 @@ class MenuTypedList<T:MenuItem> extends FlxTypedGroup<T>
{ {
busy = true; busy = true;
FlxG.sound.play(Paths.sound('confirmMenu')); FlxG.sound.play(Paths.sound('confirmMenu'));
FlxFlicker.flicker(selected, 1, 0.06, true, false, function(_) FlxFlicker.flicker(selected, 1, 0.06, true, false, function(_) {
{
busy = false; busy = false;
selected.callback(); selected.callback();
}); });

View file

@ -36,14 +36,12 @@ class NgPrompt extends Prompt
#if web #if web
prompt.buttons.getItem("yes").fireInstantly = true; prompt.buttons.getItem("yes").fireInstantly = true;
#end #end
prompt.onYes = function() prompt.onYes = function() {
{
prompt.setText("Connecting..." #if web + "\n(check your popup blocker)" #end); prompt.setText("Connecting..." #if web + "\n(check your popup blocker)" #end);
prompt.setButtons(None); prompt.setButtons(None);
openPassportUrl(); openPassportUrl();
}; };
prompt.onNo = function() prompt.onNo = function() {
{
prompt.close(); prompt.close();
prompt = null; prompt = null;
NGio.cancelLogin(); NGio.cancelLogin();
@ -92,8 +90,7 @@ class NgPrompt extends Prompt
{ {
var user = io.newgrounds.NG.core.user.name; var user = io.newgrounds.NG.core.user.name;
var prompt = new NgPrompt('Log out of $user?', Yes_No); var prompt = new NgPrompt('Log out of $user?', Yes_No);
prompt.onYes = function() prompt.onYes = function() {
{
NGio.logout(); NGio.logout();
prompt.close(); prompt.close();
}; };

View file

@ -145,8 +145,7 @@ class Page extends FlxGroup
function openPrompt(prompt:Prompt, onClose:Void->Void) function openPrompt(prompt:Prompt, onClose:Void->Void)
{ {
enabled = false; enabled = false;
prompt.closeCallback = function() prompt.closeCallback = function() {
{
enabled = true; enabled = true;
if (onClose != null) onClose(); if (onClose != null) onClose();
} }
@ -217,16 +216,15 @@ class OptionsMenu extends Page
/** /**
* Calls openPrompt and redraws the login/logout button * Calls openPrompt and redraws the login/logout button
* @param prompt * @param prompt
* @param onClose * @param onClose
*/ */
public function openNgPrompt(prompt:Prompt, ?onClose:Void->Void) public function openNgPrompt(prompt:Prompt, ?onClose:Void->Void)
{ {
var onPromptClose = checkLoginStatus; var onPromptClose = checkLoginStatus;
if (onClose != null) if (onClose != null)
{ {
onPromptClose = function() onPromptClose = function() {
{
checkLoginStatus(); checkLoginStatus();
onClose(); onClose();
} }

View file

@ -55,8 +55,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
FlxTween.tween(rating, {alpha: 0}, 0.2, FlxTween.tween(rating, {alpha: 0}, 0.2,
{ {
onComplete: function(tween:FlxTween) onComplete: function(tween:FlxTween) {
{
remove(rating, true); remove(rating, true);
rating.destroy(); rating.destroy();
}, },
@ -106,8 +105,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
FlxTween.tween(comboSpr, {alpha: 0}, 0.2, FlxTween.tween(comboSpr, {alpha: 0}, 0.2,
{ {
onComplete: function(tween:FlxTween) onComplete: function(tween:FlxTween) {
{
remove(comboSpr, true); remove(comboSpr, true);
comboSpr.destroy(); comboSpr.destroy();
}, },
@ -153,8 +151,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
FlxTween.tween(numScore, {alpha: 0}, 0.2, FlxTween.tween(numScore, {alpha: 0}, 0.2,
{ {
onComplete: function(tween:FlxTween) onComplete: function(tween:FlxTween) {
{
remove(numScore, true); remove(numScore, true);
numScore.destroy(); numScore.destroy();
}, },

View file

@ -43,8 +43,7 @@ class PreferencesMenu extends Page
menuCamera.deadzone.set(0, margin, menuCamera.width, 40); menuCamera.deadzone.set(0, margin, menuCamera.width, 40);
menuCamera.minScrollY = 0; menuCamera.minScrollY = 0;
items.onChange.add(function(selected) items.onChange.add(function(selected) {
{
camFollow.y = selected.y; camFollow.y = selected.y;
}); });
} }
@ -82,8 +81,7 @@ class PreferencesMenu extends Page
function createPrefItem(prefName:String, prefString:String, prefValue:Dynamic):Void function createPrefItem(prefName:String, prefString:String, prefValue:Dynamic):Void
{ {
items.createItem(120, (120 * items.length) + 30, prefName, AtlasFont.BOLD, function() items.createItem(120, (120 * items.length) + 30, prefName, AtlasFont.BOLD, function() {
{
preferenceCheck(prefString, prefValue); preferenceCheck(prefString, prefValue);
switch (Type.typeof(prefValue).getName()) switch (Type.typeof(prefValue).getName())
@ -145,8 +143,7 @@ class PreferencesMenu extends Page
// menuCamera.followLerp = CoolUtil.camLerpShit(0.05); // menuCamera.followLerp = CoolUtil.camLerpShit(0.05);
items.forEach(function(daItem:TextMenuItem) items.forEach(function(daItem:TextMenuItem) {
{
if (items.selectedItem == daItem) daItem.x = 150; if (items.selectedItem == daItem) daItem.x = 150;
else else
daItem.x = 120; daItem.x = 120;

View file

@ -44,7 +44,7 @@ import sys.io.File;
class DebugBoundingState extends FlxState class DebugBoundingState extends FlxState
{ {
/* /*
TODAY'S TO-DO TODAY'S TO-DO
- Cleaner UI - Cleaner UI
*/ */

View file

@ -552,7 +552,7 @@ class ChartEditorDialogHandler
/** /**
* Builds and opens a dialog displaying the user guide, providing guidance and help on how to use the chart editor. * Builds and opens a dialog displaying the user guide, providing guidance and help on how to use the chart editor.
* *
* @param state The current chart editor state. * @param state The current chart editor state.
* @return The dialog that was opened. * @return The dialog that was opened.
*/ */

View file

@ -58,7 +58,7 @@ using Lambda;
* Built with HaxeUI for use by both developers and modders. * Built with HaxeUI for use by both developers and modders.
* *
* Some functionality is moved to other classes to help maintain my sanity. * Some functionality is moved to other classes to help maintain my sanity.
* *
* @author MasterEric * @author MasterEric
*/ */
// Give other classes access to private instance fields // Give other classes access to private instance fields
@ -602,7 +602,7 @@ class ChartEditorState extends HaxeUIState
* A map of the audio tracks for each character's vocals. * A map of the audio tracks for each character's vocals.
* - Keys are the character IDs. * - Keys are the character IDs.
* - Values are the FlxSound objects to play that character's vocals. * - Values are the FlxSound objects to play that character's vocals.
* *
* When switching characters, the elements of the VoicesGroup 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>(); var audioVocalTracks:Map<String, FlxSound> = new Map<String, FlxSound>();
@ -2945,7 +2945,7 @@ class ChartEditorState extends HaxeUIState
/** /**
* Loads an instrumental from an absolute file path, replacing the current instrumental. * Loads an instrumental from an absolute file path, replacing the current instrumental.
* *
* @param path The absolute path to the audio file. * @param path The absolute path to the audio file.
* @return Success or failure. * @return Success or failure.
*/ */
@ -3132,7 +3132,7 @@ class ChartEditorState extends HaxeUIState
/** /**
* Perform (or redo) a command, then add it to the undo stack. * Perform (or redo) a command, then add it to the undo stack.
* *
* @param command The command to perform. * @param command The command to perform.
* @param purgeRedoStack If true, the redo stack will be cleared. * @param purgeRedoStack If true, the redo stack will be cleared.
*/ */

View file

@ -133,8 +133,7 @@ class ChartEditorToolboxHandler
toolbox.x = 50; toolbox.x = 50;
toolbox.y = 50; toolbox.y = 50;
toolbox.onDialogClosed = (event:DialogEvent) -> toolbox.onDialogClosed = (event:DialogEvent) -> {
{
state.setUICheckboxSelected('menubarItemToggleToolboxTools', false); state.setUICheckboxSelected('menubarItemToggleToolboxTools', false);
} }
@ -142,8 +141,7 @@ class ChartEditorToolboxHandler
if (toolsGroup == null) return null; if (toolsGroup == null) return null;
toolsGroup.onChange = (event:UIEvent) -> toolsGroup.onChange = (event:UIEvent) -> {
{
switch (event.target.id) switch (event.target.id)
{ {
case 'toolboxToolsGroupSelect': case 'toolboxToolsGroupSelect':
@ -168,8 +166,7 @@ class ChartEditorToolboxHandler
toolbox.x = 75; toolbox.x = 75;
toolbox.y = 100; toolbox.y = 100;
toolbox.onDialogClosed = (event:DialogEvent) -> toolbox.onDialogClosed = (event:DialogEvent) -> {
{
state.setUICheckboxSelected('menubarItemToggleToolboxNotes', false); state.setUICheckboxSelected('menubarItemToggleToolboxNotes', false);
} }
@ -177,8 +174,7 @@ class ChartEditorToolboxHandler
var toolboxNotesCustomKindLabel:Label = toolbox.findComponent("toolboxNotesCustomKindLabel", Label); var toolboxNotesCustomKindLabel:Label = toolbox.findComponent("toolboxNotesCustomKindLabel", Label);
var toolboxNotesCustomKind:TextField = toolbox.findComponent("toolboxNotesCustomKind", TextField); var toolboxNotesCustomKind:TextField = toolbox.findComponent("toolboxNotesCustomKind", TextField);
toolboxNotesNoteKind.onChange = (event:UIEvent) -> toolboxNotesNoteKind.onChange = (event:UIEvent) -> {
{
var isCustom = (event.data.id == '~CUSTOM~'); var isCustom = (event.data.id == '~CUSTOM~');
if (isCustom) if (isCustom)
@ -197,8 +193,7 @@ class ChartEditorToolboxHandler
} }
} }
toolboxNotesCustomKind.onChange = (event:UIEvent) -> toolboxNotesCustomKind.onChange = (event:UIEvent) -> {
{
state.selectedNoteKind = toolboxNotesCustomKind.text; state.selectedNoteKind = toolboxNotesCustomKind.text;
} }
@ -215,8 +210,7 @@ class ChartEditorToolboxHandler
toolbox.x = 100; toolbox.x = 100;
toolbox.y = 150; toolbox.y = 150;
toolbox.onDialogClosed = (event:DialogEvent) -> toolbox.onDialogClosed = (event:DialogEvent) -> {
{
state.setUICheckboxSelected('menubarItemToggleToolboxEvents', false); state.setUICheckboxSelected('menubarItemToggleToolboxEvents', false);
} }
@ -232,8 +226,7 @@ class ChartEditorToolboxHandler
toolboxEventsEventKind.dataSource.add({text: event.getTitle(), value: event.id}); toolboxEventsEventKind.dataSource.add({text: event.getTitle(), value: event.id});
} }
toolboxEventsEventKind.onChange = (event:UIEvent) -> toolboxEventsEventKind.onChange = (event:UIEvent) -> {
{
var eventType:String = event.data.value; var eventType:String = event.data.value;
trace('ChartEditorToolboxHandler.buildToolboxEventDataLayout() - Event type changed: $eventType'); trace('ChartEditorToolboxHandler.buildToolboxEventDataLayout() - Event type changed: $eventType');
@ -320,8 +313,7 @@ class ChartEditorToolboxHandler
target.addComponent(input); target.addComponent(input);
input.onChange = (event:UIEvent) -> input.onChange = (event:UIEvent) -> {
{
trace('ChartEditorToolboxHandler.buildEventDataFormFromSchema() - ${event.target.id} = ${event.target.value}'); trace('ChartEditorToolboxHandler.buildEventDataFormFromSchema() - ${event.target.id} = ${event.target.value}');
if (event.target.value == null) state.selectedEventData.remove(event.target.id); if (event.target.value == null) state.selectedEventData.remove(event.target.id);
@ -341,8 +333,7 @@ class ChartEditorToolboxHandler
toolbox.x = 125; toolbox.x = 125;
toolbox.y = 200; toolbox.y = 200;
toolbox.onDialogClosed = (event:DialogEvent) -> toolbox.onDialogClosed = (event:DialogEvent) -> {
{
state.setUICheckboxSelected('menubarItemToggleToolboxDifficulty', false); state.setUICheckboxSelected('menubarItemToggleToolboxDifficulty', false);
} }
@ -352,35 +343,28 @@ class ChartEditorToolboxHandler
var difficultyToolboxLoadMetadata:Button = toolbox.findComponent("difficultyToolboxLoadMetadata", Button); var difficultyToolboxLoadMetadata:Button = toolbox.findComponent("difficultyToolboxLoadMetadata", Button);
var difficultyToolboxLoadChart:Button = toolbox.findComponent("difficultyToolboxLoadChart", Button); var difficultyToolboxLoadChart:Button = toolbox.findComponent("difficultyToolboxLoadChart", Button);
difficultyToolboxSaveMetadata.onClick = (event:UIEvent) -> difficultyToolboxSaveMetadata.onClick = (event:UIEvent) -> {
{
SongSerializer.exportSongMetadata(state.currentSongMetadata); SongSerializer.exportSongMetadata(state.currentSongMetadata);
}; };
difficultyToolboxSaveChart.onClick = (event:UIEvent) -> difficultyToolboxSaveChart.onClick = (event:UIEvent) -> {
{
SongSerializer.exportSongChartData(state.currentSongChartData); SongSerializer.exportSongChartData(state.currentSongChartData);
}; };
difficultyToolboxSaveAll.onClick = (event:UIEvent) -> difficultyToolboxSaveAll.onClick = (event:UIEvent) -> {
{
state.exportAllSongData(); state.exportAllSongData();
}; };
difficultyToolboxLoadMetadata.onClick = (event:UIEvent) -> difficultyToolboxLoadMetadata.onClick = (event:UIEvent) -> {
{
// Replace metadata for current variation. // Replace metadata for current variation.
SongSerializer.importSongMetadataAsync(function(songMetadata) SongSerializer.importSongMetadataAsync(function(songMetadata) {
{
state.currentSongMetadata = songMetadata; state.currentSongMetadata = songMetadata;
}); });
}; };
difficultyToolboxLoadChart.onClick = (event:UIEvent) -> difficultyToolboxLoadChart.onClick = (event:UIEvent) -> {
{
// Replace chart data for current variation. // Replace chart data for current variation.
SongSerializer.importSongChartDataAsync(function(songChartData) SongSerializer.importSongChartDataAsync(function(songChartData) {
{
state.currentSongChartData = songChartData; state.currentSongChartData = songChartData;
state.noteDisplayDirty = true; state.noteDisplayDirty = true;
}); });
@ -401,14 +385,12 @@ class ChartEditorToolboxHandler
toolbox.x = 150; toolbox.x = 150;
toolbox.y = 250; toolbox.y = 250;
toolbox.onDialogClosed = (event:DialogEvent) -> toolbox.onDialogClosed = (event:DialogEvent) -> {
{
state.setUICheckboxSelected('menubarItemToggleToolboxMetadata', false); state.setUICheckboxSelected('menubarItemToggleToolboxMetadata', false);
} }
var inputSongName:TextField = toolbox.findComponent('inputSongName', TextField); var inputSongName:TextField = toolbox.findComponent('inputSongName', TextField);
inputSongName.onChange = (event:UIEvent) -> inputSongName.onChange = (event:UIEvent) -> {
{
var valid = event.target.text != null && event.target.text != ""; var valid = event.target.text != null && event.target.text != "";
if (valid) if (valid)
@ -423,8 +405,7 @@ class ChartEditorToolboxHandler
}; };
var inputSongArtist:TextField = toolbox.findComponent('inputSongArtist', TextField); var inputSongArtist:TextField = toolbox.findComponent('inputSongArtist', TextField);
inputSongArtist.onChange = (event:UIEvent) -> inputSongArtist.onChange = (event:UIEvent) -> {
{
var valid = event.target.text != null && event.target.text != ""; var valid = event.target.text != null && event.target.text != "";
if (valid) if (valid)
@ -439,8 +420,7 @@ class ChartEditorToolboxHandler
}; };
var inputStage:DropDown = toolbox.findComponent('inputStage', DropDown); var inputStage:DropDown = toolbox.findComponent('inputStage', DropDown);
inputStage.onChange = (event:UIEvent) -> inputStage.onChange = (event:UIEvent) -> {
{
var valid = event.data != null && event.data.id != null; var valid = event.data != null && event.data.id != null;
if (valid) if (valid)
@ -450,15 +430,13 @@ class ChartEditorToolboxHandler
}; };
var inputNoteSkin:DropDown = toolbox.findComponent('inputNoteSkin', DropDown); var inputNoteSkin:DropDown = toolbox.findComponent('inputNoteSkin', DropDown);
inputNoteSkin.onChange = (event:UIEvent) -> inputNoteSkin.onChange = (event:UIEvent) -> {
{
if (event.data.id == null) return; if (event.data.id == null) return;
state.currentSongMetadata.playData.noteSkin = event.data.id; state.currentSongMetadata.playData.noteSkin = event.data.id;
}; };
var inputBPM:NumberStepper = toolbox.findComponent('inputBPM', NumberStepper); var inputBPM:NumberStepper = toolbox.findComponent('inputBPM', NumberStepper);
inputBPM.onChange = (event:UIEvent) -> inputBPM.onChange = (event:UIEvent) -> {
{
if (event.value == null || event.value <= 0) return; if (event.value == null || event.value <= 0) return;
var timeChanges = state.currentSongMetadata.timeChanges; var timeChanges = state.currentSongMetadata.timeChanges;
@ -477,8 +455,7 @@ class ChartEditorToolboxHandler
}; };
var inputScrollSpeed:Slider = toolbox.findComponent('inputScrollSpeed', Slider); var inputScrollSpeed:Slider = toolbox.findComponent('inputScrollSpeed', Slider);
inputScrollSpeed.onChange = (event:UIEvent) -> inputScrollSpeed.onChange = (event:UIEvent) -> {
{
var valid = event.target.value != null && event.target.value > 0; var valid = event.target.value != null && event.target.value > 0;
if (valid) if (valid)
@ -505,8 +482,7 @@ class ChartEditorToolboxHandler
toolbox.x = 175; toolbox.x = 175;
toolbox.y = 300; toolbox.y = 300;
toolbox.onDialogClosed = (event:DialogEvent) -> toolbox.onDialogClosed = (event:DialogEvent) -> {
{
state.setUICheckboxSelected('menubarItemToggleToolboxCharacters', false); state.setUICheckboxSelected('menubarItemToggleToolboxCharacters', false);
} }
@ -523,8 +499,7 @@ class ChartEditorToolboxHandler
toolbox.x = 200; toolbox.x = 200;
toolbox.y = 350; toolbox.y = 350;
toolbox.onDialogClosed = (event:DialogEvent) -> toolbox.onDialogClosed = (event:DialogEvent) -> {
{
state.setUICheckboxSelected('menubarItemToggleToolboxPlayerPreview', false); state.setUICheckboxSelected('menubarItemToggleToolboxPlayerPreview', false);
} }
@ -548,8 +523,7 @@ class ChartEditorToolboxHandler
toolbox.x = 200; toolbox.x = 200;
toolbox.y = 350; toolbox.y = 350;
toolbox.onDialogClosed = (event:DialogEvent) -> toolbox.onDialogClosed = (event:DialogEvent) -> {
{
state.setUICheckboxSelected('menubarItemToggleToolboxOpponentPreview', false); state.setUICheckboxSelected('menubarItemToggleToolboxOpponentPreview', false);
} }

View file

@ -119,14 +119,12 @@ class CharacterPlayer extends Box
character.scale.x *= _scale; character.scale.x *= _scale;
character.scale.y *= _scale; character.scale.y *= _scale;
character.animation.callback = function(name:String = "", frameNumber:Int = -1, frameIndex:Int = -1) character.animation.callback = function(name:String = "", frameNumber:Int = -1, frameIndex:Int = -1) {
{
@:privateAccess @:privateAccess
character.onAnimationFrame(name, frameNumber, frameIndex); character.onAnimationFrame(name, frameNumber, frameIndex);
dispatch(new AnimationEvent(AnimationEvent.FRAME)); dispatch(new AnimationEvent(AnimationEvent.FRAME));
}; };
character.animation.finishCallback = function(name:String = "") character.animation.finishCallback = function(name:String = "") {
{
@:privateAccess @:privateAccess
character.onAnimationFinished(name); character.onAnimationFinished(name);
dispatch(new AnimationEvent(AnimationEvent.END)); dispatch(new AnimationEvent(AnimationEvent.END));

View file

@ -44,8 +44,7 @@ class Notifbar extends SideBar
this.action.text = actionText; this.action.text = actionText;
this.action.visible = true; this.action.visible = true;
this.action.disabled = false; this.action.disabled = false;
this.action.onClick = (_) -> this.action.onClick = (_) -> {
{
actionCallback(); actionCallback();
}; };
} }
@ -98,8 +97,7 @@ class Notifbar extends SideBar
action = outerContainer.findComponent('notifbarAction', Button); action = outerContainer.findComponent('notifbarAction', Button);
dismiss = outerContainer.findComponent('notifbarDismiss', Button); dismiss = outerContainer.findComponent('notifbarDismiss', Button);
dismiss.onClick = (_) -> dismiss.onClick = (_) -> {
{
dismissNotification(); dismissNotification();
}; };
} }

View file

@ -18,11 +18,9 @@ class SprStage extends FlxSprite
{ {
super(x, y); super(x, y);
FlxMouseEvent.add(this, dragShitFunc, null, function(spr:SprStage) FlxMouseEvent.add(this, dragShitFunc, null, function(spr:SprStage) {
{
if (isSelected() || StageBuilderState.curTool == SELECT) alpha = 0.5; if (isSelected() || StageBuilderState.curTool == SELECT) alpha = 0.5;
}, function(spr:SprStage) }, function(spr:SprStage) {
{
alpha = 1; alpha = 1;
}, false, true, true); }, false, true, true);
} }

View file

@ -94,8 +94,7 @@ class StageBuilderState extends MusicBeatState
hudGrp.add(saveSceneBtn); hudGrp.add(saveSceneBtn);
#if desktop #if desktop
FlxG.stage.window.onDropFile.add(function(path:String) FlxG.stage.window.onDropFile.add(function(path:String) {
{
trace("DROPPED FILE FROM: " + Std.string(path)); trace("DROPPED FILE FROM: " + Std.string(path));
var fileName:String = path.split('\\').pop(); var fileName:String = path.split('\\').pop();
@ -113,8 +112,7 @@ class StageBuilderState extends MusicBeatState
fo.write(sys.io.File.getBytes(path)); fo.write(sys.io.File.getBytes(path));
new FlxTimer().start(0.2, function(tmr) new FlxTimer().start(0.2, function(tmr) {
{
var awesomeImg:SprStage = new SprStage(FlxG.mouse.x, FlxG.mouse.y, sprDragShitFunc); var awesomeImg:SprStage = new SprStage(FlxG.mouse.x, FlxG.mouse.y, sprDragShitFunc);
awesomeImg.loadGraphic(Paths.image('stageBuild/stageTempImg'), false, 0, 0, true); awesomeImg.loadGraphic(Paths.image('stageBuild/stageTempImg'), false, 0, 0, true);

View file

@ -23,7 +23,7 @@ import openfl.net.FileReference;
* Built with HaxeUI for use by both developers and modders. * Built with HaxeUI for use by both developers and modders.
* *
* All functionality is kept within this file to ruin my own sanity. * All functionality is kept within this file to ruin my own sanity.
* *
* @author ninjamuffin99 * @author ninjamuffin99
*/ */
// Give other classes access to private instance fields // Give other classes access to private instance fields

View file

@ -390,7 +390,7 @@ class StoryMenuState extends MusicBeatState
/** /**
* Changes the selected difficulty. * Changes the selected difficulty.
* @param change +1 (right) to increase difficulty, -1 (left) to decrease difficulty * @param change +1 (right) to increase difficulty, -1 (left) to decrease difficulty
*/ */
function changeDifficulty(change:Int = 0):Void function changeDifficulty(change:Int = 0):Void
{ {

View file

@ -18,7 +18,7 @@ class FileUtil
/** /**
* Browses for a single file, then calls `onSelect(path)` when a path chosen. * Browses for a single file, then calls `onSelect(path)` when a path chosen.
* Note that on HTML5 this will immediately fail, you should call `openFile(onOpen:Resource->Void)` instead. * Note that on HTML5 this will immediately fail, you should call `openFile(onOpen:Resource->Void)` instead.
* *
* @param typeFilter Filters what kinds of files can be selected. * @param typeFilter Filters what kinds of files can be selected.
* @return Whether the file dialog was opened successfully. * @return Whether the file dialog was opened successfully.
*/ */
@ -46,7 +46,7 @@ class FileUtil
/** /**
* Browses for a directory, then calls `onSelect(path)` when a path chosen. * Browses for a directory, then calls `onSelect(path)` when a path chosen.
* Note that on HTML5 this will immediately fail. * Note that on HTML5 this will immediately fail.
* *
* @param typeFilter TODO What does this do? * @param typeFilter TODO What does this do?
* @return Whether the file dialog was opened successfully. * @return Whether the file dialog was opened successfully.
*/ */
@ -74,7 +74,7 @@ class FileUtil
/** /**
* Browses for multiple file, then calls `onSelect(paths)` when a path chosen. * Browses for multiple file, then calls `onSelect(paths)` when a path chosen.
* Note that on HTML5 this will immediately fail. * Note that on HTML5 this will immediately fail.
* *
* @return Whether the file dialog was opened successfully. * @return Whether the file dialog was opened successfully.
*/ */
public static function browseForMultipleFiles(?typeFilter:Array<FileFilter>, ?onSelect:Array<String>->Void, ?onCancel:Void->Void, ?defaultPath:String, public static function browseForMultipleFiles(?typeFilter:Array<FileFilter>, ?onSelect:Array<String>->Void, ?onCancel:Void->Void, ?defaultPath:String,
@ -101,7 +101,7 @@ class FileUtil
/** /**
* Browses for a file location to save to, then calls `onSelect(path)` when a path chosen. * Browses for a file location to save to, then calls `onSelect(path)` when a path chosen.
* Note that on HTML5 you can't do much with this, you should call `saveFile(resource:haxe.io.Bytes)` instead. * Note that on HTML5 you can't do much with this, you should call `saveFile(resource:haxe.io.Bytes)` instead.
* *
* @param typeFilter TODO What does this do? * @param typeFilter TODO What does this do?
* @return Whether the file dialog was opened successfully. * @return Whether the file dialog was opened successfully.
*/ */
@ -129,7 +129,7 @@ class FileUtil
/** /**
* Browses for a single file location, then reads it and passes it to `onOpen(resource:haxe.io.Bytes)`. * Browses for a single file location, then reads it and passes it to `onOpen(resource:haxe.io.Bytes)`.
* Works great on desktop and HTML5. * Works great on desktop and HTML5.
* *
* @param typeFilter TODO What does this do? * @param typeFilter TODO What does this do?
* @return Whether the file dialog was opened successfully. * @return Whether the file dialog was opened successfully.
*/ */
@ -171,7 +171,7 @@ class FileUtil
/** /**
* Browses for a single file location, then writes the provided `haxe.io.Bytes` data and calls `onSave(path)` when done. * Browses for a single file location, then writes the provided `haxe.io.Bytes` data and calls `onSave(path)` when done.
* Works great on desktop and HTML5. * Works great on desktop and HTML5.
* *
* @return Whether the file dialog was opened successfully. * @return Whether the file dialog was opened successfully.
*/ */
public static function saveFile(data:Bytes, ?onSave:String->Void, ?onCancel:Void->Void, ?defaultFileName:String, ?dialogTitle:String):Bool public static function saveFile(data:Bytes, ?onSave:String->Void, ?onCancel:Void->Void, ?defaultFileName:String, ?dialogTitle:String):Bool
@ -204,7 +204,7 @@ class FileUtil
* Prompts the user to save multiple files. * Prompts the user to save multiple files.
* On desktop, this will prompt the user for a directory, then write all of the files to there. * On desktop, this will prompt the user for a directory, then write all of the files to there.
* On HTML5, this will zip the files up and prompt the user to save that. * On HTML5, this will zip the files up and prompt the user to save that.
* *
* @param typeFilter TODO What does this do? * @param typeFilter TODO What does this do?
* @return Whether the file dialog was opened successfully. * @return Whether the file dialog was opened successfully.
*/ */
@ -296,7 +296,7 @@ class FileUtil
/** /**
* Write string file contents directly to a given path. * Write string file contents directly to a given path.
* Only works on desktop. * Only works on desktop.
* *
* @param mode Whether to Force, Skip, or Ask to overwrite an existing file. * @param mode Whether to Force, Skip, or Ask to overwrite an existing file.
*/ */
public static function writeStringToPath(path:String, data:String, mode:FileWriteMode = Skip) public static function writeStringToPath(path:String, data:String, mode:FileWriteMode = Skip)
@ -335,7 +335,7 @@ class FileUtil
/** /**
* Write byte file contents directly to a given path. * Write byte file contents directly to a given path.
* Only works on desktop. * Only works on desktop.
* *
* @param mode Whether to Force, Skip, or Ask to overwrite an existing file. * @param mode Whether to Force, Skip, or Ask to overwrite an existing file.
*/ */
public static function writeBytesToPath(path:String, data:Bytes, mode:FileWriteMode = Skip) public static function writeBytesToPath(path:String, data:Bytes, mode:FileWriteMode = Skip)
@ -432,7 +432,7 @@ class FileUtil
/** /**
* Create a Bytes object containing a ZIP file, containing the provided entries. * Create a Bytes object containing a ZIP file, containing the provided entries.
* *
* @param entries The entries to add to the ZIP file. * @param entries The entries to add to the ZIP file.
* @return The ZIP file as a Bytes object. * @return The ZIP file as a Bytes object.
*/ */
@ -448,7 +448,7 @@ class FileUtil
/** /**
* Create a ZIP file entry from a file name and its string contents. * Create a ZIP file entry from a file name and its string contents.
* *
* @param name The name of the file. You can use slashes to create subdirectories. * @param name The name of the file. You can use slashes to create subdirectories.
* @param content The string contents of the file. * @param content The string contents of the file.
* @return The resulting entry. * @return The resulting entry.

View file

@ -23,7 +23,7 @@ class SerializerUtil
} }
/** /**
* Convert a JSON string to a Haxe object of the chosen type. * Convert a JSON string to a Haxe object of the chosen type.
*/ */
public static function fromJSONTyped<T>(input:String, type:Class<T>):T public static function fromJSONTyped<T>(input:String, type:Class<T>):T
{ {

View file

@ -19,7 +19,7 @@ class SortUtil
/** /**
* Given two Notes, returns 1 or -1 based on whether `a` or `b` has an earlier strumtime. * Given two Notes, returns 1 or -1 based on whether `a` or `b` has an earlier strumtime.
* *
* @param order Either `FlxSort.ASCENDING` or `FlxSort.DESCENDING` * @param order Either `FlxSort.ASCENDING` or `FlxSort.DESCENDING`
*/ */
public static inline function byStrumtime(order:Int, a:Note, b:Note) public static inline function byStrumtime(order:Int, a:Note, b:Note)

View file

@ -7,7 +7,7 @@ import funkin.util.macro.MacroUtil;
/** /**
* Macros to generate lists of classes at compile time. * Macros to generate lists of classes at compile time.
* *
* This code is a bitch glad Jason figured it out. * This code is a bitch glad Jason figured it out.
* Based on code from CompileTime: https://github.com/jasononeil/compiletime * Based on code from CompileTime: https://github.com/jasononeil/compiletime
*/ */
@ -15,9 +15,9 @@ class ClassMacro
{ {
/** /**
* Gets a list of `Class<T>` for all classes in a specified package. * Gets a list of `Class<T>` for all classes in a specified package.
* *
* Example: `var list:Array<Class<Dynamic>> = listClassesInPackage("funkin", true);` * Example: `var list:Array<Class<Dynamic>> = listClassesInPackage("funkin", true);`
* *
* @param targetPackage A String containing the package name to query. * @param targetPackage A String containing the package name to query.
* @param includeSubPackages Whether to include classes located in sub-packages of the target package. * @param includeSubPackages Whether to include classes located in sub-packages of the target package.
* @return A list of classes matching the specified criteria. * @return A list of classes matching the specified criteria.
@ -39,9 +39,9 @@ class ClassMacro
/** /**
* Get a list of `Class<T>` for all classes extending a specified class. * Get a list of `Class<T>` for all classes extending a specified class.
* *
* Example: `var list:Array<Class<FlxSprite>> = listSubclassesOf(FlxSprite);` * Example: `var list:Array<Class<FlxSprite>> = listSubclassesOf(FlxSprite);`
* *
* @param targetClass The class to query for subclasses. * @param targetClass The class to query for subclasses.
* @return A list of classes matching the specified criteria. * @return A list of classes matching the specified criteria.
*/ */
@ -68,7 +68,7 @@ class ClassMacro
/** /**
* Callback executed after the typing phase but before the generation phase. * Callback executed after the typing phase but before the generation phase.
* Receives a list of `haxe.macro.Type` for all types in the program. * Receives a list of `haxe.macro.Type` for all types in the program.
* *
* Only metadata can be modified at this time, which makes it a BITCH to access the data at runtime. * Only metadata can be modified at this time, which makes it a BITCH to access the data at runtime.
*/ */
static function onGenerate(allTypes:Array<haxe.macro.Type>) static function onGenerate(allTypes:Array<haxe.macro.Type>)

View file

@ -24,7 +24,7 @@ class FlxMacro
{ {
name: "zIndex", // Field name. name: "zIndex", // Field name.
access: [haxe.macro.Expr.Access.APublic], // Access level access: [haxe.macro.Expr.Access.APublic], // Access level
kind: haxe.macro.Expr.FieldType.FVar(macro:Int, macro $v{0}), // Variable type and default value kind: haxe.macro.Expr.FieldType.FVar(macro :Int, macro $v{0}), // Variable type and default value
pos: pos, // The field's position in code. pos: pos, // The field's position in code.
} }
]); ]);

View file

@ -8,7 +8,7 @@ class MacroUtil
{ {
/** /**
* Gets the value of a Haxe compiler define. * Gets the value of a Haxe compiler define.
* *
* @param key The name of the define to get the value of. * @param key The name of the define to get the value of.
* @param defaultValue The value to return if the define is not set. * @param defaultValue The value to return if the define is not set.
* @return An expression containing the value of the define. * @return An expression containing the value of the define.

View file

@ -2,9 +2,9 @@ package funkin.util.tools;
/** /**
* A static extension which provides utility functions for Iterators. * A static extension which provides utility functions for Iterators.
* *
* For example, add `using IteratorTools` then call `iterator.array()`. * For example, add `using IteratorTools` then call `iterator.array()`.
* *
* @see https://haxe.org/manual/lf-static-extension.html * @see https://haxe.org/manual/lf-static-extension.html
*/ */
class IteratorTools class IteratorTools

View file

@ -2,9 +2,9 @@ package funkin.util.tools;
/** /**
* A static extension which provides utility functions for Maps. * A static extension which provides utility functions for Maps.
* *
* For example, add `using MapTools` then call `map.values()`. * For example, add `using MapTools` then call `map.values()`.
* *
* @see https://haxe.org/manual/lf-static-extension.html * @see https://haxe.org/manual/lf-static-extension.html
*/ */
class MapTools class MapTools

View file

@ -7,7 +7,7 @@ class StringTools
{ {
/** /**
* Converts a string to title case. For example, "hello world" becomes "Hello World". * Converts a string to title case. For example, "hello world" becomes "Hello World".
* *
* @param value The string to convert. * @param value The string to convert.
* @return The converted string. * @return The converted string.
*/ */
@ -29,7 +29,7 @@ class StringTools
/** /**
* Converts a string to lower kebab case. For example, "Hello World" becomes "hello-world". * Converts a string to lower kebab case. For example, "Hello World" becomes "hello-world".
* *
* @param value The string to convert. * @param value The string to convert.
* @return The converted string. * @return The converted string.
*/ */
@ -40,7 +40,7 @@ class StringTools
/** /**
* Converts a string to upper kebab case, aka screaming kebab case. For example, "Hello World" becomes "HELLO-WORLD". * Converts a string to upper kebab case, aka screaming kebab case. For example, "Hello World" becomes "HELLO-WORLD".
* *
* @param value The string to convert. * @param value The string to convert.
* @return The converted string. * @return The converted string.
*/ */
@ -51,7 +51,7 @@ class StringTools
/** /**
* Parses the string data as JSON and returns the resulting object. * Parses the string data as JSON and returns the resulting object.
* *
* @return The parsed object. * @return The parsed object.
*/ */
public static function parseJSON(value:String):Dynamic public static function parseJSON(value:String):Dynamic