Merge pull request #103 from FunkinCrew/bugfix/formatting-cleanup

Formatting cleanup (whitespace only)
This commit is contained in:
Cameron Taylor 2023-06-09 14:22:31 -04:00 committed by GitHub
commit 6c65a9ea78
92 changed files with 456 additions and 581 deletions

192
.vscode/settings.json vendored
View file

@ -1,84 +1,120 @@
{
"[haxe]": {
// Automatically keep Haxe files formatted.
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.codeActionsOnSave": {
// Compilation server issues can cause auto-cleanup to remove valid imports.
"source.organizeImports": false
},
"editor.defaultFormatter": "nadako.vshaxe",
"editor.tabSize": 2
"[haxe]": {
// Automatically keep Haxe files formatted.
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.codeActionsOnSave": {
// Compilation server issues can cause auto-cleanup to remove valid imports.
"source.organizeImports": false
},
"[json]": {
// Automatically keep JSON files formatted.
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "nadako.vshaxe",
"editor.tabSize": 2
},
"[json]": {
// Automatically keep JSON files formatted.
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
// Automatically keep JSONC files formatted.
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.tabWidth": 2,
// XML formatting style configuration
"xml.format.enabled": true,
"xml.format.legacy": false,
"xml.format.emptyElements": "collapse",
"xml.preferences.quoteStyle": "double",
"xml.format.enforceQuoteStyle": "preferred",
"xml.format.preserveAttributeLineBreaks": false,
"xml.format.preservedNewlines": 0,
"xml.format.splitAttributes": false,
"xml.format.joinCDATALines": true,
"xml.format.preserveEmptyContent": false,
"xml.format.joinCommentLines": false,
"xml.format.joinContentLines": false,
"xml.format.spaceBeforeEmptyCloseTag": true,
"xml.format.xsiSchemaLocationSplit": "onPair",
"xml.format.splitAttributesIndentSize": 2,
"xml.format.closingBracketNewLine": false,
"xml.format.preserveSpace": [
"xsl:text",
"xsl:comment",
"xsl:processing-instruction",
"literallayout",
"programlisting",
"screen",
"synopsis",
"pre",
"xd:pre"
],
"xml.format.maxLineWidth": 0,
"xml.format.grammarAwareFormatting": true,
// Generic file formatting style configuration
"files.insertFinalNewline": true,
"files.trimFinalNewlines": false,
"files.trimTrailingWhitespace": true,
// Automatically detect indentation.
"editor.detectIndentation": true,
"editor.insertSpaces": true,
"editor.tabSize": 2,
// Automatically enforce Linux style line endings.
"files.eol": "\n",
"haxe.displayPort": "auto",
"haxe.enableCompilationServer": true,
"haxe.displayServer": {
"arguments": ["-v"]
},
// Fix file associations for HScript.
"files.associations": {
"*.hxp": "haxe",
"*.hscript": "haxe",
"*.haxe": "haxe",
"*.hxs": "haxe",
"*.hxc": "haxe"
},
"projectManager.git.baseFolders": ["./"],
"haxecheckstyle.sourceFolders": ["src", "Source"],
"haxecheckstyle.externalSourceRoots": [],
"haxecheckstyle.configurationFile": "checkstyle.json",
"haxecheckstyle.codeSimilarityBufferSize": 100,
"lime.targetConfigurations": [
{
"label": "Windows / Debug",
"target": "windows",
"args": ["-debug"]
},
"[jsonc]": {
// Automatically keep JSONC files formatted.
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
{
"label": "Windows / Debug (DEBUG ASSETS)",
"target": "windows",
"args": ["-debug", "-DDEBUG_ASSETS"]
},
"prettier.tabWidth": 2,
// Automatically detect indentation.
"editor.detectIndentation": true,
"editor.insertSpaces": true,
"editor.tabSize": 2,
// Automatically enforce Linux style line endings.
"files.eol": "\n",
"haxe.displayPort": "auto",
"haxe.enableCompilationServer": true,
"haxe.displayServer": {
"arguments": ["-v"]
{
"label": "Windows / Debug (ANIMATE)",
"target": "windows",
"args": ["-debug", "-DANIMATE"]
},
// Fix file associations for HScript.
"files.associations": {
"*.hxp": "haxe",
"*.hscript": "haxe",
"*.haxe": "haxe",
"*.hxs": "haxe",
"*.hxc": "haxe"
{
"label": "HTML5 / Debug",
"target": "html5",
"args": ["-debug"]
},
"projectManager.git.baseFolders": ["./"],
"haxecheckstyle.sourceFolders": ["src", "Source"],
"haxecheckstyle.externalSourceRoots": [],
"haxecheckstyle.configurationFile": "checkstyle.json",
"haxecheckstyle.codeSimilarityBufferSize": 100,
"lime.targetConfigurations": [
{
"label": "Windows / Debug",
"target": "windows",
"args": ["-debug"]
},
{
"label": "Windows / Debug (DEBUG ASSETS)",
"target": "windows",
"args": ["-debug", "-DDEBUG_ASSETS"]
},
{
"label": "Windows / Debug (ANIMATE)",
"target": "windows",
"args": ["-debug", "-DANIMATE"]
},
{
"label": "HTML5 / Debug",
"target": "html5",
"args": ["-debug"]
},
{
"label": "HTML5 / Debug (Watch)",
"target": "html5",
"args": ["-debug", "-watch"]
}
]
}
{
"label": "HTML5 / Debug (Watch)",
"target": "html5",
"args": ["-debug", "-watch"]
}
]
}

View file

@ -1,48 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<!-- _________________________ Application Settings _________________________ -->
<app title="Friday Night Funkin'" file="Funkin" packageName="com.funkin.fnf" package="com.funkin.fnf" main="Main" version="0.3.0" company="ninjamuffin99" />
<!--Switch Export with Unique ApplicationID and Icon-->
<set name="APP_ID" value="0x0100f6c013bbc000" />
<!--The flixel preloader is not accurate in Chrome. You can use it regularly if you embed the swf into a html file
or you can set the actual size of your file manually at "FlxPreloaderBase-onUpdate-bytesTotal"-->
<!-- <app preloader="Preloader" resizable="true" /> -->
<app preloader="Preloader" />
<!--Minimum without FLX_NO_GAMEPAD: 11.8, without FLX_NO_NATIVE_CURSOR: 11.2-->
<set name="SWF_VERSION" value="11.8" />
<!-- ____________________________ Window Settings ___________________________ -->
<!--These window settings apply to all targets-->
<window width="1280" height="720" fps="" background="#000000" hardware="true" vsync="false" />
<!--HTML5-specific-->
<window if="html5" resizable="true" />
<!--Desktop-specific-->
<window if="desktop" orientation="landscape" fullscreen="false" resizable="true" vsync="false" />
<!--Mobile-specific-->
<window if="mobile" orientation="landscape" fullscreen="true" width="0" height="0" resizable="false" />
<!-- _____________________________ Path Settings ____________________________ -->
<set name="BUILD_DIR" value="export/debug" if="debug" />
<set name="BUILD_DIR" value="export/release" unless="debug" />
<set name="BUILD_DIR" value="export/32bit" if="32bit" />
<classpath name="source" />
<assets path="assets/preload" rename="assets" exclude="*.ogg" if="web" />
<assets path="assets/preload" rename="assets" exclude="*.mp3" unless="web" />
<define name="PRELOAD_ALL" unless="web" />
<define name="NO_PRELOAD_ALL" unless="PRELOAD_ALL" />
<section if="PRELOAD_ALL">
<library name="songs" preload="true" />
<library name="shared" preload="true" />
@ -56,7 +41,6 @@
<library name="week7" preload="true" />
<library name="weekend1" preload="true" />
</section>
<section if="NO_PRELOAD_ALL">
<library name="songs" preload="false" />
<library name="shared" preload="false" />
@ -70,7 +54,6 @@
<library name="week7" preload="false" />
<library name="weekend1" preload="false" />
</section>
<assets path="assets/songs" library="songs" exclude="*.fla|*.ogg" if="web" />
<assets path="assets/songs" library="songs" exclude="*.fla|*.mp3" unless="web" />
<assets path="assets/shared" library="shared" exclude="*.fla|*.ogg" if="web" />
@ -93,9 +76,7 @@
<assets path="assets/week7" library="week7" exclude="*.fla|*.mp3" unless="web" />
<assets path="assets/weekend1" library="weekend1" exclude="*.fla|*.ogg" if="web" />
<assets path="assets/weekend1" library="weekend1" exclude="*.fla|*.mp3" unless="web" />
<!-- <assets path='example_mods' rename='mods' embed='false'/> -->
<!--
AUTOMATICALLY MOVING EXAMPLE MODS INTO THE BUILD CAUSES ISSUES
Currently, this line will add the mod files to the library manifest,
@ -103,49 +84,39 @@
If we can exclude the `mods` folder from the manifest, we can re-enable this line.
<assets path='example_mods' rename='mods' embed='false' exclude="*.md" />
-->
<assets path='art/readme.txt' rename='do NOT readme.txt' />
<assets path="CHANGELOG.md" rename='changelog.txt' />
<!-- NOTE FOR FUTURE SELF SINCE FONTS ARE ALWAYS FUCKY
<assets path="art/readme.txt" rename="do NOT readme.txt" />
<assets path="CHANGELOG.md" rename="changelog.txt" />
<!-- NOTE FOR FUTURE SELF SINCE FONTS ARE ALWAYS FUCKY
TO FIX ONE OF THEM, I CONVERTED IT TO OTF. DUNNO IF YOU NEED TO
THEN UHHH I USED THE NAME OF THE FONT WITH SETFORMAT() ON THE TEXT!!!
NOT USING A DIRECT THING TO THE ASSET!!!
-->
<assets path="assets/fonts" embed='true' />
<assets path="assets/fonts" embed="true" />
<!-- _______________________________ Libraries ______________________________ -->
<haxelib name="lime" /> <!-- Game engine backend -->
<haxelib name="openfl" /> <!-- Game engine backend -->
<haxelib name="flixel" /> <!-- Game engine -->
<haxedev set='webgl' />
<haxedev set="webgl" />
<!--In case you want to use the addons package-->
<haxelib name="flixel-addons" /> <!-- Additional utilities for Flixel -->
<haxelib name="hscript" /> <!-- Scripting -->
<haxelib name="flixel-ui" /> <!-- UI framework (deprecate this? -->
<haxelib name="haxeui-core"/> <!-- UI framework -->
<haxelib name="haxeui-flixel"/> <!-- Integrate HaxeUI with Flixel -->
<haxelib name="haxeui-core" /> <!-- UI framework -->
<haxelib name="haxeui-flixel" /> <!-- Integrate HaxeUI with Flixel -->
<haxelib name="polymod" /> <!-- Modding framework -->
<haxelib name="flxanimate" /> <!-- Texture atlas rendering -->
<!-- <haxelib name="hxcodec" /> Video playback -->
<haxelib name="json2object" /> <!-- JSON parsing -->
<haxelib name="thx.semver" />
<haxelib name="hxcpp-debug-server" if="desktop debug" />
<!--Disable the Flixel core focus lost screen-->
<haxedef name="FLX_NO_FOCUS_LOST_SCREEN" />
<!--Disable the Flixel core debugger. Automatically gets set whenever you compile in release mode!-->
<haxedef name="FLX_NO_DEBUG" unless="debug" />
<!--Enable this for Nape release builds for a serious peformance improvement-->
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />
<!--
<!--
Hide deprecation warnings until they're fixed.
TODO: REMOVE THIS!!!!
-->
@ -155,85 +126,61 @@
<haxedef name="message-reporting" value="pretty" />
<!-- _________________________________ Custom _______________________________ -->
<!-- Disable trace() calls in release builds to bump up performance. -->
<haxeflag name="--no-traces" unless="debug" />
<!-- HScript relies heavily on Reflection, which means we can't use DCE. -->
<haxeflag name="-dce no" />
<!-- Ensure all Funkin' classes are available at runtime. -->
<haxeflag name="--macro" value="include('funkin')" />
<!-- Ensure all UI components are available at runtime. -->
<haxeflag name="--macro" value="include('haxe.ui.backend.flixel.components')" />
<haxeflag name="--macro" value="include('haxe.ui.containers.dialogs')" />
<haxeflag name="--macro" value="include('haxe.ui.containers.menus')" />
<haxeflag name="--macro" value="include('haxe.ui.containers.properties')" />
<haxeflag name="--macro" value="include('haxe.ui.core')" />
<haxeflag name="--macro" value="include('haxe.ui.components')" />
<haxeflag name="--macro" value="include('haxe.ui.containers')" />
<haxeflag name="--macro" value="include('haxe.ui.components')" />
<haxeflag name="--macro" value="include('haxe.ui.containers')" />
<!--
Ensure additional class packages are available at runtime (some only really used by scripts).
Ignore packages we can't include.
-->
<haxeflag name="--macro" value="include('flixel', true, [ 'flixel.addons.editors.spine.*', 'flixel.addons.nape.*', 'flixel.system.macros.*' ])" />
<!-- Necessary to provide stack traces for HScript. -->
<haxedef name="hscriptPos" />
<haxedef name="HXCPP_CHECK_POINTER" />
<haxedef name="HXCPP_STACK_LINE" />
<!-- This macro allows addition of new functionality to existing Flixel. -->
<haxeflag name="--macro" value="addMetadata('@:build(funkin.util.macro.FlxMacro.buildFlxBasic())', 'flixel.FlxBasic')" />
<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->
<icon path="art/icon16.png" size='16' />
<icon path="art/icon32.png" size='32' />
<icon path="art/icon64.png" size='64' />
<icon path="art/icon16.png" size="16" />
<icon path="art/icon32.png" size="32" />
<icon path="art/icon64.png" size="64" />
<icon path="art/iconOG.png" />
<!-- <haxedef name="SKIP_TO_PLAYSTATE" if="debug" /> -->
<haxedef name="CAN_OPEN_LINKS" unless="switch" />
<haxedef name="CAN_CHEAT" if="switch debug" />
<haxedef name="haxeui_no_mouse_reset" />
<!-- Skip the Intro -->
<section if="debug">
<!-- Starts the game at the specified week, at the first song -->
<!-- <haxedef name="week" value="1" if="debug"/> -->
<!-- Starts the game at the specified song -->
<!-- <haxedef name="song" value="bopeebo" if="debug"/> -->
<!-- Difficulty, only used for week or song, defaults to 1 -->
<!-- <haxedef name="dif" value="2" if="debug"/> -->
</section>
<!-- <haxedef name="CLEAR_INPUT_SAVE"/> -->
<section if="newgrounds">
<!-- Enables Ng.core.verbose -->
<!-- <haxedef name="NG_VERBOSE" /> -->
<!-- Enables a NG debug session, so medals don't permently unlock -->
<!-- <haxedef name="NG_DEBUG" /> -->
<!-- pretends that the saved session Id was expired, forcing the reconnect prompt -->
<!-- <haxedef name="NG_FORCE_EXPIRED_SESSION" if="debug" /> -->
</section>
<!-- <prebuild haxe="trace('prebuilding');"/> -->
<!-- <postbuild haxe="art/Postbuild.hx"/> -->
<!-- <config:ios allow-provisioning-updates="true" team-id="" /> -->
<!-- Options for Polymod -->
<section if="polymod">
<!-- Turns on additional debug logging. -->
@ -253,14 +200,12 @@
<!-- Determines the file in the mod folder used for the icon. -->
<haxedef name="POLYMOD_MOD_ICON_FILE" value="_polymod_icon.png" />
</section>
<section if='TOOLS'>
<section if="TOOLS">
<!-- Compiles tool for old song conversion shit -->
<!-- Assumes you use it on windows/desktop!!!! -->
<postbuild command='haxe -main art/SongConverter.hx --cs export/songShit' />
<assets path='export/songShit/bin/SongConverter.exe' rename='SongConverter.exe' />
<postbuild command="haxe -main art/SongConverter.hx --cs export/songShit" />
<assets path="export/songShit/bin/SongConverter.exe" rename="SongConverter.exe" />
<!-- <postbuild command='ren export/songShit/bin export/songShit/tools '/> -->
<!-- <postbuild command='move export/songShit/tools export/release/windows/bin'/> -->
</section>
</project>
</project>

View file

@ -1,9 +1,11 @@
{
"title": "Intro Mod",
"description": "An introductory mod.",
"contributors": [{
"name": "MasterEric"
}],
"contributors": [
{
"name": "MasterEric"
}
],
"api_version": "0.1.0",
"mod_version": "1.0.0",
"license": "Apache-2.0"

View file

@ -1,9 +1,11 @@
{
"title": "Testing123",
"description": "Newgrounds? More like OLDGROUNDS lol.",
"contributors": [{
"name": "MasterEric"
}],
"contributors": [
{
"name": "MasterEric"
}
],
"api_version": "0.1.0",
"mod_version": "1.0.0",
"license": "Apache-2.0"

View file

@ -68,7 +68,7 @@
"name": "hxcodec",
"type": "git",
"dir": null,
"ref": "91adeec",
"ref": "c42ab99",
"url": "https://github.com/polybiusproxy/hxCodec"
},
{
@ -95,7 +95,7 @@
"name": "lime",
"type": "git",
"dir": null,
"ref": "deecd6c",
"ref": "5634ad7",
"url": "https://github.com/openfl/lime"
},
{
@ -118,4 +118,4 @@
"version": "0.2.2"
}
]
}
}

View file

@ -125,8 +125,7 @@ class Alphabet extends FlxSpriteGroup
var xPos:Float = 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));
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.play('funny');
effectStuff.antialiasing = true;
effectStuff.animation.finishCallback = function(nameThing)
{
effectStuff.animation.finishCallback = function(nameThing) {
kill();
};
effectStuff.setGraphicSize(Std.int(effectStuff.width * 0.7));
@ -42,8 +41,7 @@ class ComboCounter extends FlxTypedSpriteGroup<FlxSprite>
{
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();
});
}
@ -64,16 +62,14 @@ class ComboCounter extends FlxTypedSpriteGroup<FlxSprite>
if (effectStuff.animation.curAnim.curFrame == 18)
{
grpNumbers.forEach(function(spr:ComboNumber)
{
grpNumbers.forEach(function(spr:ComboNumber) {
spr.animation.reset();
});
}
if (effectStuff.animation.curAnim.curFrame == 20)
{
grpNumbers.forEach(function(spr:ComboNumber)
{
grpNumbers.forEach(function(spr:ComboNumber) {
spr.kill();
});
}

View file

@ -149,9 +149,9 @@ class Conductor
/**
* Forcibly defines the current BPM of the song.
* 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.
*
*
* WARNING: Avoid this for things like setting the BPM of the title screen music,
* you should have a metadata file for it instead.
*/
@ -166,7 +166,7 @@ class Conductor
/**
* Update the conductor with the current 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.
* Leave blank to use the FlxG.sound.music position.
*/

View file

@ -119,8 +119,7 @@ class CoolUtil
FlxTween.tween(screenWipeShit, {daAlphaShit: 1}, time,
{
ease: FlxEase.quadInOut,
onComplete: function(twn)
{
onComplete: function(twn) {
screenShit.destroy();
FlxG.switchState(new MainMenuState());
}
@ -130,7 +129,7 @@ class CoolUtil
/**
* Just saves the json with some default values hehe
* @param json
* @param json
* @return 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.antialiasing = true;
cutScene.animation.finishCallback = function(anim:String)
{
cutScene.animation.finishCallback = function(anim:String) {
cutScene.kill();
cutScene.destroy();
cutScene = null;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -49,8 +49,7 @@ class NGio
trace('checking NG.io 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;
trace('CURRENT NG VERSION: ' + GAME_VER);
callback(GAME_VER);
@ -141,8 +140,7 @@ class NGio
var onCancel:Void->Void = null;
if (onComplete != null)
{
onSuccess = function()
{
onSuccess = function() {
onNGLogin();
onComplete(Success);
}
@ -228,7 +226,7 @@ class NGio
scoreboardsLoaded = true;
ngScoresLoaded.dispatch();
/*
/*
for (score in NG.core.scoreBoards.get(8737).scores)
{
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();
/**
* code colors for.... code....
* code colors for.... code....
* i think goes in order of left to right
*
*
* left 0
* down 1
* up 2

View file

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

View file

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

View file

@ -53,7 +53,7 @@ class TitleState extends MusicBeatState
super.create();
/*
/*
#elseif web
@ -84,8 +84,7 @@ class TitleState extends MusicBeatState
*/
// netConnection.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
new FlxTimer().start(1, function(tmr:FlxTimer)
{
new FlxTimer().start(1, function(tmr:FlxTimer) {
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});
}
/*
/*
FlxG.watch.addQuick('cur display', FlxG.stage.window.display.id);
if (FlxG.keys.justPressed.Y)
{
@ -373,8 +372,7 @@ class TitleState extends MusicBeatState
#if newgrounds
if (!OutdatedSubState.leftState)
{
NGio.checkVersion(function(version)
{
NGio.checkVersion(function(version) {
// Check if version is outdated
var localVersion:String = "v" + Application.current.meta.get('version');
var onlineVersion = version.split(" ")[0].trim();
@ -391,8 +389,7 @@ class TitleState extends MusicBeatState
});
}
#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
// Saves about 50mb of RAM or so???
Assets.cache.clear(Paths.image('gfDanceTitle'));
@ -404,7 +401,7 @@ class TitleState extends MusicBeatState
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
}
if (pressedEnter && !skippedIntro && initialized) skipIntro();
/*
/*
#if web
if (!initialized && controls.ACCEPT)
{

View file

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

View file

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

View file

@ -44,7 +44,7 @@ class SoundGroup extends FlxTypedGroup<FlxSound>
/**
* Finds the largest deviation from the desired time inside this SoundGroup.
*
*
* @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.
* @return The largest deviation from the target time found.

View file

@ -484,7 +484,7 @@ class ChartingState extends MusicBeatState
// general shit
var title:FlxText = new FlxText(UI_box.x + 20, UI_box.y + 20, 0);
bullshitUI.add(title);
/*
/*
var loopCheck = new FlxUICheckBox(UI_box.x + 10, UI_box.y + 50, null, null, "Loops", 100, ['loop check']);
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});
@ -561,7 +561,7 @@ class ChartingState extends MusicBeatState
}*/
/**
* 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
*/
function sectionStartTime(?funnySection:Int):Float
@ -1156,7 +1156,7 @@ class ChartingState extends MusicBeatState
{
sidePreview.drawRect(0, 0, 40, FlxG.height, 0xFF444444);
/*
/*
var sectionsNeeded:Int = Std.int(FlxG.sound.music.length / (sectionCalc(_song.bpm) * 4));
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.
*
*
* @param T The type to construct. Must implement `IRegistryEntry`.
* @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.
*
* 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>;
@ -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.
* @param clsName
* @param clsName
*/
abstract function createScriptedEntry(clsName:String):Null<T>;
}

View file

@ -48,8 +48,7 @@ class BGScrollingText extends FlxSpriteGroup
function set_funnyColor(col:Int):Int
{
grpTexts.forEach(function(txt)
{
grpTexts.forEach(function(txt) {
txt.color = col;
});
@ -85,8 +84,7 @@ class BGScrollingText extends FlxSpriteGroup
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);
});
}

View file

@ -77,9 +77,9 @@ class SustainTrail extends FlxSprite
/**
* Normally you would take strumTime:Float, noteData:Int, sustainLength:Float, parentNote:Note (?)
* @param NoteData
* @param SustainLength
* @param FileName
* @param NoteData
* @param SustainLength
* @param FileName
*/
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;
/**
* 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)
{

View file

@ -123,8 +123,7 @@ class Cursor
if (assetCursorDefault == null)
{
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_DEFAULT_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData)
{
future.onComplete(function(bitmapData:BitmapData) {
assetCursorDefault = bitmapData;
applyCursorParams(assetCursorDefault, CURSOR_DEFAULT_PARAMS);
});
@ -138,8 +137,7 @@ class Cursor
if (assetCursorCross == null)
{
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_CROSS_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData)
{
future.onComplete(function(bitmapData:BitmapData) {
assetCursorCross = bitmapData;
applyCursorParams(assetCursorCross, CURSOR_CROSS_PARAMS);
});
@ -153,8 +151,7 @@ class Cursor
if (assetCursorEraser == null)
{
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_ERASER_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData)
{
future.onComplete(function(bitmapData:BitmapData) {
assetCursorEraser = bitmapData;
applyCursorParams(assetCursorEraser, CURSOR_ERASER_PARAMS);
});
@ -168,8 +165,7 @@ class Cursor
if (assetCursorGrabbing == null)
{
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_GRABBING_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData)
{
future.onComplete(function(bitmapData:BitmapData) {
assetCursorGrabbing = bitmapData;
applyCursorParams(assetCursorGrabbing, CURSOR_GRABBING_PARAMS);
});
@ -183,8 +179,7 @@ class Cursor
if (assetCursorHourglass == null)
{
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_HOURGLASS_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData)
{
future.onComplete(function(bitmapData:BitmapData) {
assetCursorHourglass = bitmapData;
applyCursorParams(assetCursorHourglass, CURSOR_HOURGLASS_PARAMS);
});
@ -198,8 +193,7 @@ class Cursor
if (assetCursorPointer == null)
{
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_POINTER_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData)
{
future.onComplete(function(bitmapData:BitmapData) {
assetCursorPointer = bitmapData;
applyCursorParams(assetCursorPointer, CURSOR_POINTER_PARAMS);
});
@ -213,8 +207,7 @@ class Cursor
if (assetCursorText == null)
{
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_TEXT_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData)
{
future.onComplete(function(bitmapData:BitmapData) {
assetCursorText = bitmapData;
applyCursorParams(assetCursorText, CURSOR_TEXT_PARAMS);
});
@ -228,8 +221,7 @@ class Cursor
if (assetCursorZoomIn == null)
{
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_ZOOM_IN_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData)
{
future.onComplete(function(bitmapData:BitmapData) {
assetCursorZoomIn = bitmapData;
applyCursorParams(assetCursorZoomIn, CURSOR_ZOOM_IN_PARAMS);
});
@ -243,8 +235,7 @@ class Cursor
if (assetCursorZoomOut == null)
{
var future:Future<BitmapData> = Assets.loadBitmapData(CURSOR_ZOOM_OUT_PARAMS.graphic);
future.onComplete(function(bitmapData:BitmapData)
{
future.onComplete(function(bitmapData:BitmapData) {
assetCursorZoomOut = bitmapData;
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.
*
*
* 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.
*
*
* Example: Pressing Ctrl+Z will undo, while holding Ctrl+Z will start to undo repeatedly.
*/
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.
*
*
* Includes events handling basic life cycle relevant to all scripted classes.
*/
interface IScriptedClass
@ -53,7 +53,7 @@ interface INoteScriptedClass extends IScriptedClass
/**
* Developer note:
*
*
* 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:
* `FlxG.state.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);`

View file

@ -8,7 +8,7 @@ class PolymodErrorHandler
* Show a popup with the given text.
* 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.
*
*
* @param name The name at the top 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.
* Keep in mind that the constructor may be called before the object is needed,
* for the purposes of caching data or otherwise.
*
*
* This event is not cancelable.
*/
public static inline final CREATE:ScriptEventType = "CREATE";
@ -27,7 +27,7 @@ class ScriptEvent
/**
* Called when the relevant object is destroyed.
* This should perform relevant cleanup to ensure good performance.
*
*
* This event is not cancelable.
*/
public static inline final DESTROY:ScriptEventType = "DESTROY";
@ -35,7 +35,7 @@ class ScriptEvent
/**
* Called when the relevent object is added to the game state.
* This assumes all data is loaded and ready to go.
*
*
* This event is not cancelable.
*/
public static inline final ADDED:ScriptEventType = 'ADDED';
@ -43,35 +43,35 @@ class ScriptEvent
/**
* Called during the update function.
* This is called every frame, so be careful!
*
*
* This event is not cancelable.
*/
public static inline final UPDATE:ScriptEventType = "UPDATE";
/**
* Called when the player moves to pause the game.
*
*
* This event IS cancelable! Canceling the event will prevent the game from pausing.
*/
public static inline final PAUSE:ScriptEventType = "PAUSE";
/**
* Called when the player moves to unpause the game while paused.
*
*
* This event IS cancelable! Canceling the event will prevent the game from resuming.
*/
public static inline final RESUME:ScriptEventType = "RESUME";
/**
* Called once per step in the song. This happens 4 times per measure.
*
*
* This event is not cancelable.
*/
public static inline final SONG_BEAT_HIT:ScriptEventType = "BEAT_HIT";
/**
* Called once per step in the song. This happens 16 times per measure.
*
*
* This event is not cancelable.
*/
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.
*
*
* This event IS cancelable! Cancelling this event prevents the event from being triggered,
* 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.
*
*
* This event is not cancelable.
*/
public static inline final SONG_START:ScriptEventType = "SONG_START";
/**
* Called when the song ends. This happens as the instrumental and vocals end.
*
*
* This event is not cancelable.
*/
public static inline final SONG_END:ScriptEventType = "SONG_END";
/**
* Called when the countdown begins. This occurs before the song starts.
*
*
* This event IS cancelable! Canceling this event will prevent the countdown from starting.
* - 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.
@ -137,7 +137,7 @@ class ScriptEvent
/**
* Called when a step of the countdown happens.
* Includes information about what step of the countdown was hit.
*
*
* This event IS cancelable! Canceling this event will pause the countdown.
* - 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.
*
*
* This event is not cancelable.
*/
public static inline final COUNTDOWN_END:ScriptEventType = "COUNTDOWN_END";
/**
* Called before the game over screen triggers and the death animation plays.
*
*
* This event is not cancelable.
*/
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.
* 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.
*/
public static inline final SONG_RETRY:ScriptEventType = "SONG_RETRY";
/**
* Called when the player pushes down any key on the keyboard.
*
*
* This event is not cancelable.
*/
public static inline final KEY_DOWN:ScriptEventType = "KEY_DOWN";
/**
* Called when the player releases a key on the keyboard.
*
*
* This event is not cancelable.
*/
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.
* This allows modders to mutate the notes before they are used in the song.
*
*
* This event is not cancelable.
*/
public static inline final SONG_LOADED:ScriptEventType = "SONG_LOADED";
/**
* Called when the game is about to switch the current FlxState.
*
*
* This event is not cancelable.
*/
public static inline final STATE_CHANGE_BEGIN:ScriptEventType = "STATE_CHANGE_BEGIN";
/**
* Called when the game has finished switching the current FlxState.
*
*
* This event is not cancelable.
*/
public static inline final STATE_CHANGE_END:ScriptEventType = "STATE_CHANGE_END";
/**
* Called when the game is about to open a new FlxSubState.
*
*
* This event is not cancelable.
*/
public static inline final SUBSTATE_OPEN_BEGIN:ScriptEventType = "SUBSTATE_OPEN_BEGIN";
/**
* Called when the game has finished opening a new FlxSubState.
*
*
* This event is not cancelable.
*/
public static inline final SUBSTATE_OPEN_END:ScriptEventType = "SUBSTATE_OPEN_END";
/**
* Called when the game is about to close the current FlxSubState.
*
*
* This event is not cancelable.
*/
public static inline final SUBSTATE_CLOSE_BEGIN:ScriptEventType = "SUBSTATE_CLOSE_BEGIN";
/**
* Called when the game has finished closing the current FlxSubState.
*
*
* This event is not cancelable.
*/
public static inline final SUBSTATE_CLOSE_END:ScriptEventType = "SUBSTATE_CLOSE_END";
/**
* Called when the game is exiting the current FlxState.
*
*
* 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.
* You can modify this to change the order in which a given module receives events.
*
*
* Priority 1 is processed before Priority 1000, etc.
*/
public var priority(default, set):Int;
@ -41,7 +41,7 @@ class Module implements IPlayStateScriptedClass implements IStateChangingScripte
/**
* Called when the module is initialized.
* 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.
*/
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.
*
*
* If you want to force stages to be reloaded, you can just call this function again.
*/
public static function loadModuleCache():Void
@ -66,8 +66,7 @@ class ModuleHandler
{
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 bModule:Module = moduleCache.get(b);

View file

@ -7,7 +7,7 @@ import openfl.Assets;
* Just various functions that IDK where to put em!!!
* Semi-temp for now? the note stuff is super clutter-y right now
* so I am putting this new stuff here right now XDD
*
*
* A lot of this stuff can probably be moved to where appropriate!
* i dont care about NoteUtil.hx at all!!!
*/
@ -15,7 +15,7 @@ class NoteUtil
{
/**
* IDK THING FOR BOTH LOL! DIS SHIT HACK-Y
* @param jsonPath
* @param jsonPath
* @return 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?
* @param songEvents
* @param songEvents
*/
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.
countdownTimer = new FlxTimer();
countdownTimer.start(Conductor.crochet / 1000, function(tmr:FlxTimer)
{
countdownTimer.start(Conductor.crochet / 1000, function(tmr:FlxTimer) {
countdownStep = decrement(countdownStep);
// 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().
*
*
* 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()
@ -115,7 +114,7 @@ class Countdown
/**
* 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.
*/
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.
*
*
* 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()
@ -166,7 +165,7 @@ class Countdown
/**
* Retrieves the graphic to use for this step of the countdown.
* TODO: Make this less dumb. Unhardcode it? Use modules? Use notestyles?
*
*
* This is public so modules can do lol funny shit.
*/
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,
{
ease: FlxEase.cubeInOut,
onComplete: function(twn:FlxTween)
{
onComplete: function(twn:FlxTween) {
countdownSprite.destroy();
}
});
@ -228,7 +226,7 @@ class Countdown
/**
* Retrieves the sound file to use for this step of the countdown.
* TODO: Make this less dumb. Unhardcode it? Use modules? Use notestyles?
*
*
* This is public so modules can do lol funny shit.
*/
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.
* 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.
*/
class GameOverSubstate extends MusicBeatSubstate
@ -237,7 +237,7 @@ class GameOverSubstate extends MusicBeatSubstate
/**
* Starts the death music at the appropriate volume.
* @param startingVolume
* @param startingVolume
*/
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)
* Note that this is looking for SPECIFIC animation names, so you may need to modify the XML.
* @param charId
* @param charId
*/
function loadAnimationNew():Void
{
@ -333,7 +333,7 @@ class HealthIcon extends FlxSprite
/**
* Load health icon animations using the legacy format.
* Simply assumes two icons, the idle and losing icons.
* @param charId
* @param charId
*/
function loadAnimationOld():Void
{

View file

@ -164,7 +164,7 @@ class PlayState extends MusicBeatState
/**
* 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.
*
*
* 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.
* 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,
* then reloads all the stages.
*
*
* 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.
*
*
* Call this by pressing F5 on a debug build.
*/
override function debug_refreshModules()
@ -892,7 +892,7 @@ class PlayState extends MusicBeatState
/**
* Loads stage data from cache, assembles the props,
* and adds it to the state.
* @param id
* @param id
*/
function loadStage(id:String)
{
@ -1840,7 +1840,7 @@ class PlayState extends MusicBeatState
/**
* Jumps forward or backward a number of sections in the song.
* Accounts for BPM changes, does not prevent death from skipped notes.
* @param sec
* @param sec
*/
function changeSection(sec:Int):Void
{
@ -2273,9 +2273,9 @@ class PlayState extends MusicBeatState
* 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,
* or even cancel the event entirely.
*
* @param direction
* @param hasPossibleNotes
*
* @param direction
* @param hasPossibleNotes
*/
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.
*
*
* TODO: Move some of this logic into `Bopper.hx`
*/
public function danceOnBeat()
@ -2628,7 +2628,7 @@ class PlayState extends MusicBeatState
/**
* Function called before closing the current substate.
* @param subState
* @param subState
*/
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.
*
*
* FUN FACT: Setting the X and Y of a FlxSpriteGroup will move all the sprites in the group.
*/
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.
* 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 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
* displaying an animation derived from an Adobe Animate texture atlas spritesheet file.
*
*
* BaseCharacter has game logic, AnimateAtlasCharacter has only rendering logic.
* KEEP THEM SEPARATE!
*/
@ -537,7 +537,7 @@ class AnimateAtlasCharacter extends BaseCharacter
/**
* Returns the left-most position of the left-most member.
* If there are no members, x is returned.
*
*
* @since 5.0.0
* @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.
* If there are no members, x is returned.
*
*
* @since 5.0.0
* @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.
* If there are no members, y is returned.
*
*
* @since 5.0.0
* @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.
* If there are no members, y is returned.
*
*
* @since 5.0.0
* @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.
*
*
* Remember: The character's origin is at its FEET. (horizontal center, vertical bottom)
*/
class BaseCharacter extends Bopper
@ -43,7 +43,7 @@ class BaseCharacter extends Bopper
/**
* Set to true when the character being used in a special way.
* 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.
*/
public var debug:Bool = false;
@ -76,7 +76,7 @@ class BaseCharacter extends Bopper
/**
* The absolute position of the top-left of the character.
* @return
* @return
*/
public var cornerPosition(get, set):FlxPoint;
@ -112,7 +112,7 @@ class BaseCharacter extends Bopper
/**
* Returns the point the camera should focus on.
* 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.
*/
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.
* @param scale
* @param scale
*/
public function setScale(scale:Null<Float>):Void
{
@ -394,7 +394,7 @@ class BaseCharacter extends Bopper
/**
* Since no `onBeatHit` or `dance` calls happen in GameOverSubState,
* this regularly gets called instead.
*
*
* @param force Force the deathLoop animation to play, even if `firstDeath` is still playing.
*/
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.
*
*
* If you want to force stages to be reloaded, you can just call this function again.
*/
public static function loadCharacterCache():Void
@ -294,7 +294,7 @@ class CharacterDataParser
/**
* Load a character's JSON file and parse its data.
*
*
* @param charId The character to load.
* @return The character data, or null if validation failed.
*/
@ -363,8 +363,8 @@ class CharacterDataParser
/**
* Set unspecified parameters to their defaults.
* If the parameter is mandatory, print an error message.
* @param id
* @param input
* @param id
* @param input
* @return The validated character data
*/
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.
* Increasing this number will make the character dance less often.
*
*
* @default 1
*/
var danceEvery:Null<Int>;
@ -633,7 +633,7 @@ typedef CharacterData =
* 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 high, you may see the the character play the sing animation for too long after the notes are gone.
*
*
* Examples:
* - Daddy Dearest uses a value of `1.525`.
* @default 1.0
@ -654,7 +654,7 @@ typedef CharacterData =
/**
* Whether or not the whole ass sprite is flipped by default.
* Useful for characters that could also be played (Pico)
*
*
* @default false
*/
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
* 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
* 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).
*
*
* BaseCharacter has game logic, SparrowCharacter has only rendering logic.
* KEEP THEM SEPARATE!
*

View file

@ -8,7 +8,7 @@ import funkin.play.character.CharacterData.CharacterRenderType;
/**
* A SparrowCharacter is a Character which is rendered by
* displaying an animation derived from a SparrowV2 atlas spritesheet file.
*
*
* BaseCharacter has game logic, SparrowCharacter has only rendering logic.
* 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.
* It is used by the ScriptedSongEvent class to handle user-defined events.
*
*
* Example: Focus on Boyfriend:
* ```
* {
@ -16,7 +16,7 @@ import funkin.play.song.SongData;
* }
* }
* ```
*
*
* Example: Focus on 10px above Girlfriend:
* ```
* {
@ -27,7 +27,7 @@ import funkin.play.song.SongData;
* }
* }
* ```
*
*
* Example: Focus on (100, 100):
* ```
* {

View file

@ -7,7 +7,7 @@ import polymod.hscript.HScriptedClass;
* A script that can be tied to a SongEvent.
* Create a scripted class that extends SongEvent,
* 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 `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.

View file

@ -184,8 +184,7 @@ class SongEventParser
*/
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 (event.activated) return false;

View file

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

View file

@ -24,7 +24,7 @@ class SongDataParser
/**
* 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.
*/
public static function loadSongCache():Void
@ -217,7 +217,7 @@ typedef RawSongMetadata =
{
/**
* A semantic versioning string for the song data format.
*
*
*/
var version:Version;
@ -414,7 +414,7 @@ abstract SongNoteData(RawSongNoteData)
/**
* The strumline index of the note, if applicable.
* Strips the direction from the data.
*
*
* 0 = player, 1 = opponent, etc.
*/
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
* whose timestamps are shifted by the given amount.
* Does not mutate the original array.
*
*
* @param notes The notes to modify.
* @param offset The time difference to apply in milliseconds.
*/
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);
});
}
@ -30,14 +29,13 @@ class SongDataUtils
* Given an array of SongEventData objects, return a new array of SongEventData objects
* whose timestamps are shifted by the given amount.
* Does not mutate the original array.
*
*
* @param events The events to modify.
* @param offset The time difference to apply in milliseconds.
*/
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);
});
}
@ -45,7 +43,7 @@ class SongDataUtils
/**
* Return a new array without a certain subset of notes from an array of SongNoteData objects.
* Does not mutate the original array.
*
*
* @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.
*/
@ -53,8 +51,7 @@ class SongDataUtils
{
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)
// SongNoteData's == operation has been overridden so that this will work.
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.
* Does not mutate the original array.
*
*
* @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.
*/
@ -76,8 +73,7 @@ class SongDataUtils
{
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.
return !subtrahend.has(event);
});
@ -89,8 +85,7 @@ class SongDataUtils
*/
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;
if (newData < strumlineSize) newData += strumlineSize;
@ -103,7 +98,7 @@ class SongDataUtils
/**
* 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.
*/
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.
*
*
* Offset the provided array of events such that the first event is at 0 milliseconds.
*/
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>
{
// 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 notes;
@ -140,8 +134,7 @@ class SongDataUtils
public static function sortEvents(events:Array<SongEventData>, ?desc:Bool = false):Array<SongEventData>
{
// 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 events;
@ -192,8 +185,7 @@ class SongDataUtils
*/
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;
});
}
@ -203,8 +195,7 @@ class SongDataUtils
*/
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;
});
}
@ -214,8 +205,7 @@ class SongDataUtils
*/
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;
});
}
@ -225,8 +215,7 @@ class SongDataUtils
*/
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;
});
}

View file

@ -50,8 +50,7 @@ class SongSerializer
*/
public static function importSongChartDataAsync(callback:SongChartData->Void):Void
{
browseFileReference(function(fileReference:FileReference)
{
browseFileReference(function(fileReference:FileReference) {
var data = fileReference.data.toString();
if (data == null) return;
@ -68,8 +67,7 @@ class SongSerializer
*/
public static function importSongMetadataAsync(callback:SongMetadata->Void):Void
{
browseFileReference(function(fileReference:FileReference)
{
browseFileReference(function(fileReference:FileReference) {
var data = fileReference.data.toString();
if (data == null) return;
@ -103,7 +101,7 @@ class SongSerializer
/**
* Save a SongChartData object as a JSON file to a specified path.
* Works great on HTML5 and desktop.
*
*
* @param path The file path to save to.
*/
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.
* Works great on HTML5 and desktop.
*
*
* @param path The file path to save to.
*/
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.
* Works great on HTML5 or desktop.
*
*
* @param callback The function to call when the file is loaded.
*/
static function browseFileReference(callback:FileReference->Void)
{
var file = new FileReference();
file.addEventListener(Event.SELECT, function(e)
{
file.addEventListener(Event.SELECT, function(e) {
var selectedFileRef:FileReference = e.target;
trace('Selected file: ' + selectedFileRef.name);
selectedFileRef.addEventListener(Event.COMPLETE, function(e)
{
selectedFileRef.addEventListener(Event.COMPLETE, function(e) {
var loadedFileRef:FileReference = e.target;
trace('Loaded file: ' + loadedFileRef.name);
callback(loadedFileRef);
@ -192,16 +188,13 @@ class SongSerializer
static function writeFileReference(path:String, data:String)
{
var file = new FileReference();
file.addEventListener(Event.COMPLETE, function(e:Event)
{
file.addEventListener(Event.COMPLETE, function(e:Event) {
trace('Successfully wrote file.');
});
file.addEventListener(Event.CANCEL, function(e:Event)
{
file.addEventListener(Event.CANCEL, function(e:Event) {
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.');
});
file.save(data, path);

View file

@ -30,7 +30,7 @@ class SongValidator
/**
* Validates the fields of a SongMetadata object (excluding the version field).
*
*
* @param input The SongMetadata object to validate.
* @param songId The ID of the song being validated. Only used for error messages.
* @return The validated SongMetadata object.
@ -73,7 +73,7 @@ class SongValidator
/**
* Validates the fields of a SongPlayData object.
*
*
* @param input The SongPlayData object to validate.
* @param songId The ID of the song being validated. Only used for error messages.
* @return The validated SongPlayData object.
@ -85,7 +85,7 @@ class SongValidator
/**
* Validates the fields of a TimeChange object.
*
*
* @param input The TimeChange object to validate.
* @param songId The ID of the song being validated. Only used for error messages.
* @return The validated TimeChange object.
@ -113,7 +113,7 @@ class SongValidator
/**
* Validates the fields of a SongChartData object (excluding the version field).
*
*
* @param input The SongChartData object to validate.
* @param songId The ID of the song being validated. Only used for error messages.
* @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.
* - If true, alternate playing `danceLeft` and `danceRight`.
* - If false, play `idle` every time.
*
*
* You can manually set this value, or you can leave it as `null` to determine it automatically.
*/
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 frameNumber The number 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],
* 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.
* 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
{

View file

@ -19,7 +19,7 @@ typedef StagePropGroup = FlxTypedSpriteGroup<StageProp>;
/**
* 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.
*/
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.
* They're used to cache the data needed to build the stage,
* then accessed and fleshed out when the stage needs to be built.
*
* @param stageId
*
* @param stageId
*/
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.
* Override this in a scripted class to ensure that all necessary assets are loaded!
*
*
* @return An array of file names.
*/
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.
*
*
* If you want to force stages to be reloaded, you can just call this function again.
*/
public static function loadStageCache():Void
@ -68,8 +68,7 @@ class StageDataParser
// UNSCRIPTED 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);
});
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.
*
*
* @param stageId The stage to load.
* @return The stage data, or null if validation failed.
*/
@ -199,8 +198,8 @@ class StageDataParser
/**
* Set unspecified parameters to their defaults.
* If the parameter is mandatory, print an error message.
* @param id
* @param input
* @param id
* @param input
* @return The validated stage data
*/
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.
* This requires animations to be defined. If `danceLeft` and `danceRight` are defined,
* they will alternated between, otherwise the `idle` animation will be used.
*
*
* @default 0
*/
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.
* @param event
* @param event
*/
public function onAdd(event:ScriptEvent):Void {}

View file

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

View file

@ -47,7 +47,7 @@ class OverlayBlend extends FlxShader
{
vec2 funnyUv = openfl_TextureCoordv;
vec4 color = flixel_texture2D(bitmap, funnyUv);
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));

View file

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

View file

@ -44,7 +44,7 @@ class StrokeShader extends FlxShader
if (sample.a == 0.) {
float w = size.x / openfl_TextureSize.x;
float h = size.y / openfl_TextureSize.y;
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, openfl_TextureCoordv.y + h)).a != 0.

View file

@ -50,7 +50,7 @@ class TitleOutline extends FlxShader
if (color.a == 0.0) {
float w = size.x / openfl_TextureSize.x;
float h = size.y / openfl_TextureSize.y;
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.)
color = vec4(0.0, 1.0, 0.8, color.a);
}
gl_FragColor = color;
}

View file

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

View file

@ -121,8 +121,7 @@ class ControlsMenu extends funkin.ui.OptionsState.Page
var margin = 100;
menuCamera.deadzone.set(0, margin, menuCamera.width, menuCamera.height - margin * 2);
menuCamera.minScrollY = 0;
controlGrid.onChange.add(function(selected)
{
controlGrid.onChange.add(function(selected) {
camFollow.y = selected.y;
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.
* @param prev
* @param next
* @param allowWrap
* @param prev
* @param next
* @param allowWrap
*/
inline function navList(prev:Bool, next:Bool, allowWrap:Bool)
{
@ -164,8 +164,7 @@ class MenuTypedList<T:MenuItem> extends FlxTypedGroup<T>
{
busy = true;
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;
selected.callback();
});

View file

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

View file

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

View file

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

View file

@ -43,8 +43,7 @@ class PreferencesMenu extends Page
menuCamera.deadzone.set(0, margin, menuCamera.width, 40);
menuCamera.minScrollY = 0;
items.onChange.add(function(selected)
{
items.onChange.add(function(selected) {
camFollow.y = selected.y;
});
}
@ -82,8 +81,7 @@ class PreferencesMenu extends Page
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);
switch (Type.typeof(prefValue).getName())
@ -145,8 +143,7 @@ class PreferencesMenu extends Page
// menuCamera.followLerp = CoolUtil.camLerpShit(0.05);
items.forEach(function(daItem:TextMenuItem)
{
items.forEach(function(daItem:TextMenuItem) {
if (items.selectedItem == daItem) daItem.x = 150;
else
daItem.x = 120;

View file

@ -44,7 +44,7 @@ import sys.io.File;
class DebugBoundingState extends FlxState
{
/*
/*
TODAY'S TO-DO
- 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.
*
*
* @param state The current chart editor state.
* @return The dialog that was opened.
*/

View file

@ -58,7 +58,7 @@ using Lambda;
* Built with HaxeUI for use by both developers and modders.
*
* Some functionality is moved to other classes to help maintain my sanity.
*
*
* @author MasterEric
*/
// 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.
* - Keys are the character IDs.
* - 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.
*/
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.
*
*
* @param path The absolute path to the audio file.
* @return Success or failure.
*/
@ -3132,7 +3132,7 @@ class ChartEditorState extends HaxeUIState
/**
* Perform (or redo) a command, then add it to the undo stack.
*
*
* @param command The command to perform.
* @param purgeRedoStack If true, the redo stack will be cleared.
*/

View file

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

View file

@ -119,14 +119,12 @@ class CharacterPlayer extends Box
character.scale.x *= _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
character.onAnimationFrame(name, frameNumber, frameIndex);
dispatch(new AnimationEvent(AnimationEvent.FRAME));
};
character.animation.finishCallback = function(name:String = "")
{
character.animation.finishCallback = function(name:String = "") {
@:privateAccess
character.onAnimationFinished(name);
dispatch(new AnimationEvent(AnimationEvent.END));

View file

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

View file

@ -18,11 +18,9 @@ class SprStage extends FlxSprite
{
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;
}, function(spr:SprStage)
{
}, function(spr:SprStage) {
alpha = 1;
}, false, true, true);
}

View file

@ -94,8 +94,7 @@ class StageBuilderState extends MusicBeatState
hudGrp.add(saveSceneBtn);
#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));
var fileName:String = path.split('\\').pop();
@ -113,8 +112,7 @@ class StageBuilderState extends MusicBeatState
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);
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.
*
* All functionality is kept within this file to ruin my own sanity.
*
*
* @author ninjamuffin99
*/
// Give other classes access to private instance fields

View file

@ -390,7 +390,7 @@ class StoryMenuState extends MusicBeatState
/**
* 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
{

View file

@ -18,7 +18,7 @@ class FileUtil
/**
* 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.
*
*
* @param typeFilter Filters what kinds of files can be selected.
* @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.
* Note that on HTML5 this will immediately fail.
*
*
* @param typeFilter TODO What does this do?
* @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.
* Note that on HTML5 this will immediately fail.
*
*
* @return Whether the file dialog was opened successfully.
*/
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.
* 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?
* @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)`.
* Works great on desktop and HTML5.
*
*
* @param typeFilter TODO What does this do?
* @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.
* Works great on desktop and HTML5.
*
*
* @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
@ -204,7 +204,7 @@ class FileUtil
* 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 HTML5, this will zip the files up and prompt the user to save that.
*
*
* @param typeFilter TODO What does this do?
* @return Whether the file dialog was opened successfully.
*/
@ -296,7 +296,7 @@ class FileUtil
/**
* Write string file contents directly to a given path.
* Only works on desktop.
*
*
* @param mode Whether to Force, Skip, or Ask to overwrite an existing file.
*/
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.
* Only works on desktop.
*
*
* @param mode Whether to Force, Skip, or Ask to overwrite an existing file.
*/
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.
*
*
* @param entries The entries to add to the ZIP file.
* @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.
*
*
* @param name The name of the file. You can use slashes to create subdirectories.
* @param content The string contents of the file.
* @return The resulting entry.

View file

@ -24,7 +24,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
{

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.
*
*
* @param order Either `FlxSort.ASCENDING` or `FlxSort.DESCENDING`
*/
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.
*
*
* This code is a bitch glad Jason figured it out.
* 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.
*
*
* Example: `var list:Array<Class<Dynamic>> = listClassesInPackage("funkin", true);`
*
*
* @param targetPackage A String containing the package name to query.
* @param includeSubPackages Whether to include classes located in sub-packages of the target package.
* @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.
*
*
* Example: `var list:Array<Class<FlxSprite>> = listSubclassesOf(FlxSprite);`
*
*
* @param targetClass The class to query for subclasses.
* @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.
* 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.
*/
static function onGenerate(allTypes:Array<haxe.macro.Type>)

View file

@ -24,7 +24,7 @@ class FlxMacro
{
name: "zIndex", // Field name.
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.
}
]);

View file

@ -8,7 +8,7 @@ class MacroUtil
{
/**
* Gets the value of a Haxe compiler define.
*
*
* @param key The name of the define to get the value of.
* @param defaultValue The value to return if the define is not set.
* @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.
*
*
* For example, add `using IteratorTools` then call `iterator.array()`.
*
*
* @see https://haxe.org/manual/lf-static-extension.html
*/
class IteratorTools

View file

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

View file

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

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<module>
<!-- A module provides additional behavior and configuration for HaxeUI. -->
<components>
@ -14,8 +14,7 @@
<class package="haxe.ui.containers.properties" loadAll="true" />
<class package="haxe.ui.containers" loadAll="true" />
<class package="haxe.ui.core" loadAll="true" />
<!-- Custom components. -->
<class package="funkin.ui.haxeui.components" loadAll="true" />
</components>
</module>
</module>