1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-12-09 13:39:12 +00:00

Ansify Newgrounds, Discord, and HXVLC traces

This commit is contained in:
MoonDroid 2025-09-19 02:49:42 +07:00 committed by Hundrec
parent eb1d54e750
commit ee952c0789
25 changed files with 114 additions and 105 deletions

View file

@ -20,6 +20,7 @@ import openfl.Lib;
import openfl.media.Video;
import openfl.net.NetStream;
import funkin.util.WindowUtil;
import funkin.util.AnsiUtil;
/**
* The main class which initializes HaxeFlixel and starts the game in its initial state.
@ -133,11 +134,11 @@ class Main extends Sprite
Handle.initAsync(function(success:Bool):Void {
if (success)
{
trace('[HXVLC] LibVLC instance initialized!');
trace('${AnsiUtil.apply(' HXVLC ', [BG_WHITE, BOLD])} LibVLC instance initialized!');
}
else
{
trace('[HXVLC] LibVLC instance failed to initialize!');
trace('${AnsiUtil.apply(' HXVLC ', [BG_WHITE, BOLD])} LibVLC instance failed to initialize!');
}
});
#end

View file

@ -29,7 +29,7 @@ class DiscordClient
private function new()
{
trace('[DISCORD] Initializing event handlers...');
trace('${funkin.util.AnsiUtil.apply(' DISCORD ', [BOLD, BG_BLUE])} Initializing event handlers...');
handlers = new DiscordEventHandlers();
@ -40,7 +40,7 @@ class DiscordClient
public function init():Void
{
trace('[DISCORD] Initializing connection...');
trace('${funkin.util.AnsiUtil.apply(' DISCORD ', [BOLD, BG_BLUE])} Initializing connection...');
if (!hasValidCredentials())
{
@ -86,7 +86,7 @@ class DiscordClient
public function shutdown():Void
{
trace('[DISCORD] Shutting down...');
trace('${funkin.util.AnsiUtil.apply(' DISCORD ', [BOLD, BG_BLUE])} Shutting down...');
Discord.Shutdown();
}
@ -140,7 +140,7 @@ class DiscordClient
// TODO: WHAT THE FUCK get this pointer bullfuckery out of here
private static function onReady(request:cpp.RawConstPointer<DiscordUser>):Void
{
trace('[DISCORD] Client has connected!');
trace('${funkin.util.AnsiUtil.apply(' DISCORD ', [BOLD, BG_BLUE])} Client has connected!');
final username:String = request[0].username;
final globalName:String = request[0].username;
@ -148,22 +148,22 @@ class DiscordClient
if (discriminator != null && discriminator != 0)
{
trace('[DISCORD] User: ${username}#${discriminator} (${globalName})');
trace('${funkin.util.AnsiUtil.apply(' DISCORD ', [BOLD, BG_BLUE])} User: ${username}#${discriminator} (${globalName})');
}
else
{
trace('[DISCORD] User: @${username} (${globalName})');
trace('${funkin.util.AnsiUtil.apply(' DISCORD ', [BOLD, BG_BLUE])} User: @${username} (${globalName})');
}
}
private static function onDisconnected(errorCode:Int, message:cpp.ConstCharStar):Void
{
trace('[DISCORD] Client has disconnected! ($errorCode) "${cast (message, String)}"');
trace('${funkin.util.AnsiUtil.apply(' DISCORD ', [BOLD, BG_BLUE])} Client has disconnected! ($errorCode) "${cast (message, String)}"');
}
private static function onError(errorCode:Int, message:cpp.ConstCharStar):Void
{
trace('[DISCORD] Client has received an error! ($errorCode) "${cast (message, String)}"');
trace('${funkin.util.AnsiUtil.apply(' DISCORD ', [BOLD, BG_BLUE])} Client has received an error! ($errorCode) "${cast (message, String)}"');
}
// public var type(get, set):DiscordActivityType;

View file

@ -39,21 +39,21 @@ class Events
switch (outcome)
{
case SUCCESS(data):
trace('[NEWGROUNDS] Logged event: ${data.eventName}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Logged event: ${data.eventName}');
case FAIL(outcome):
switch (outcome)
{
case HTTP(error):
trace('[NEWGROUNDS] HTTP error while logging event: ${error}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} HTTP error while logging event: ${error}');
case RESPONSE(error):
trace('[NEWGROUNDS] Response error (${error.code}) while logging event: ${error.message}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Response error (${error.code}) while logging event: ${error.message}');
case RESULT(error):
switch (error.code)
{
case 103: // Invalid custom event name
trace('[NEWGROUNDS] Invalid custom event name: ${eventName}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Invalid custom event name: ${eventName}');
default:
trace('[NEWGROUNDS] Result error (${error.code}) while logging event: ${error.message}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Result error (${error.code}) while logging event: ${error.message}');
}
}
}

View file

@ -17,7 +17,7 @@ class Leaderboards
var leaderboardList:Null<ScoreBoardList> = NewgroundsClient.instance.leaderboards;
if (leaderboardList == null)
{
trace('[NEWGROUNDS] Not logged in, cannot fetch medal data!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Not logged in, cannot fetch medal data!');
return [];
}
@ -44,9 +44,9 @@ class Leaderboards
switch (outcome)
{
case SUCCESS:
trace('[NEWGROUNDS] Submitted score!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Submitted score!');
case FAIL(error):
trace('[NEWGROUNDS] Failed to submit score!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Failed to submit score!');
trace(error);
}
});
@ -75,11 +75,11 @@ class Leaderboards
switch (outcome)
{
case SUCCESS:
trace('[NEWGROUNDS] Fetched scores!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Fetched scores!');
if (params != null && params.onComplete != null) params.onComplete(leaderboardData.scores);
case FAIL(error):
trace('[NEWGROUNDS] Failed to fetch scores!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Failed to fetch scores!');
trace(error);
if (params != null && params.onFail != null) params.onFail();
}

View file

@ -19,7 +19,7 @@ class Medals
if (medalList == null)
{
trace('[NEWGROUNDS] Not logged in, cannot fetch medal data!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Not logged in, cannot fetch medal data!');
return [];
}
@ -34,12 +34,12 @@ class Medals
@:privateAccess
if (medalData == null || medalData._data == null)
{
trace('[NEWGROUNDS] Could not retrieve data for medal: ${medal}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Could not retrieve data for medal: ${medal}');
return;
}
else if (!medalData.unlocked)
{
trace('[NEWGROUNDS] Awarding medal (${medal}).');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Awarding medal (${medal}).');
medalData.sendUnlock();
// Play the medal unlock animation, but only if the user has not already unlocked it.
@ -81,12 +81,12 @@ class Medals
}
else
{
trace('[NEWGROUNDS] User already has medal (${medal}).');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} User already has medal (${medal}).');
}
}
else
{
trace('[NEWGROUNDS] Attempted to award medal (${medal}), but not logged into Newgrounds.');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Attempted to award medal (${medal}), but not logged into Newgrounds.');
}
}
@ -98,12 +98,12 @@ class Medals
var parser = new json2object.JsonParser<Array<MedalJSON>>();
parser.ignoreUnknownVariables = false;
trace('[NEWGROUNDS] Parsing local medal data...');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Parsing local medal data...');
parser.fromJson(jsonString, jsonPath);
if (parser.errors.length > 0)
{
trace('[NEWGROUNDS] Failed to parse local medal data!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Failed to parse local medal data!');
for (error in parser.errors)
funkin.data.DataError.printError(error);
medalJSON = [];
@ -120,7 +120,7 @@ class Medals
@:privateAccess
if (medalData == null || medalData._data == null)
{
trace('[NEWGROUNDS] Could not retrieve data for medal: ${medal}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Could not retrieve data for medal: ${medal}');
return null;
}
@ -141,7 +141,7 @@ class Medals
var medal:Medal = Medal.getMedalByStoryLevel(id);
if (medal == Medal.Unknown)
{
trace('[NEWGROUNDS] Story level does not have a medal! (${id}).');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Story level does not have a medal! (${id}).');
return;
}
Medals.award(medal);

View file

@ -33,7 +33,7 @@ class NGSaveSlot
static function loadSlot(slot:Int):NGSaveSlot
{
trace('[NEWGROUNDS] Getting save slot from ID $slot');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Getting save slot from ID $slot');
var saveSlot:Null<SaveSlot> = NewgroundsClient.instance.saveSlots?.getById(slot);
@ -67,16 +67,16 @@ class NGSaveSlot
switch (outcome)
{
case SUCCESS:
trace('[NEWGROUNDS] Successfully saved save data to save slot!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Successfully saved save data to save slot!');
case FAIL(error):
trace('[NEWGROUNDS] Failed to save data to save slot!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Failed to save data to save slot!');
trace(error);
}
});
}
catch (error:String)
{
trace('[NEWGROUNDS] Failed to save data to save slot!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Failed to save data to save slot!');
trace(error);
}
}
@ -89,7 +89,7 @@ class NGSaveSlot
switch (outcome)
{
case SUCCESS(value):
trace('[NEWGROUNDS] Loaded save slot with the ID of ${ngSaveSlot?.id}!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Loaded save slot with the ID of ${ngSaveSlot?.id}!');
#if FEATURE_DEBUG_FUNCTIONS
trace('Save Slot Data:');
trace(value);
@ -101,7 +101,7 @@ class NGSaveSlot
onComplete(decodedData);
}
case FAIL(error):
trace('[NEWGROUNDS] Failed to load save slot with the ID of ${ngSaveSlot?.id}!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Failed to load save slot with the ID of ${ngSaveSlot?.id}!');
trace(error);
if (onError != null)
@ -113,7 +113,7 @@ class NGSaveSlot
}
catch (error:String)
{
trace('[NEWGROUNDS] Failed to load save slot with the ID of ${ngSaveSlot?.id}!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Failed to load save slot with the ID of ${ngSaveSlot?.id}!');
trace(error);
if (onError != null)
@ -131,23 +131,23 @@ class NGSaveSlot
switch (outcome)
{
case SUCCESS:
trace('[NEWGROUNDS] Successfully cleared save slot!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Successfully cleared save slot!');
case FAIL(error):
trace('[NEWGROUNDS] Failed to clear save slot!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Failed to clear save slot!');
trace(error);
}
});
}
catch (error:String)
{
trace('[NEWGROUNDS] Failed to clear save slot!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Failed to clear save slot!');
trace(error);
}
}
public function checkSlot():Void
{
trace('[NEWGROUNDS] Checking save slot with the ID of ${ngSaveSlot?.id}...');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Checking save slot with the ID of ${ngSaveSlot?.id}...');
trace(' Is null? ${ngSaveSlot == null}');
trace(' Is empty? ${ngSaveSlot?.isEmpty() ?? false}');

View file

@ -42,11 +42,11 @@ class NewgroundsClient
private function new()
{
trace('[NEWGROUNDS] Initializing client...');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Initializing client...');
#if FEATURE_NEWGROUNDS_DEBUG
trace('[NEWGROUNDS] App ID: ${API_NG_APP_ID}');
trace('[NEWGROUNDS] Encryption Key: ${API_NG_ENC_KEY}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} App ID: ${API_NG_APP_ID}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Encryption Key: ${API_NG_ENC_KEY}');
#end
if (!hasValidCredentials())
@ -67,7 +67,7 @@ class NewgroundsClient
{
if (NG.core == null) return;
trace('[NEWGROUNDS] Setting up connection...');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Setting up connection...');
#if FEATURE_NEWGROUNDS_DEBUG
NG.core.verbose = true;
@ -78,16 +78,16 @@ class NewgroundsClient
if (NG.core.attemptingLogin)
{
// Session ID was valid and we should be logged in soon.
trace('[NEWGROUNDS] Waiting for existing login!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Waiting for existing login!');
}
else
{
#if FEATURE_NEWGROUNDS_AUTOLOGIN
// Attempt an automatic login.
trace('[NEWGROUNDS] Attempting new login immediately!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Attempting new login immediately!');
this.autoLogin();
#else
trace('[NEWGROUNDS] Not logged in, you have to login manually!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Not logged in, you have to login manually!');
#end
}
}
@ -107,7 +107,7 @@ class NewgroundsClient
if (NG.core.attemptingLogin)
{
trace("[NEWGROUNDS] Login attempt ongoing, will not login until finished.");
trace("${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Login attempt ongoing, will not login until finished.");
return;
}
@ -245,17 +245,17 @@ class NewgroundsClient
{
if (NG.core == null) return;
trace('[NEWGROUNDS] Login successful!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Login successful!');
// Persist the session ID.
Save.instance.ngSessionId = NG.core.sessionId;
trace('[NEWGROUNDS] Submitting medal request...');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Submitting medal request...');
NG.core.requestMedals(onFetchedMedals);
trace('[NEWGROUNDS] Submitting leaderboard request...');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Submitting leaderboard request...');
NG.core.scoreBoards.loadList(onFetchedLeaderboards);
trace('[NEWGROUNDS] Submitting save slot request...');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Submitting save slot request...');
NG.core.saveSlots.loadList(onFetchedSaveSlots);
}
@ -267,32 +267,32 @@ class NewgroundsClient
switch (type)
{
case PASSPORT:
trace('[NEWGROUNDS] Login cancelled by passport website.');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Login cancelled by passport website.');
case MANUAL:
trace('[NEWGROUNDS] Login cancelled by application.');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Login cancelled by application.');
default:
trace('[NEWGROUNDS] Login cancelled by unknown source.');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Login cancelled by unknown source.');
}
case ERROR(error):
switch (error)
{
case HTTP(error):
trace('[NEWGROUNDS] Login failed due to HTTP error: ${error}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Login failed due to HTTP error: ${error}');
case RESPONSE(error):
trace('[NEWGROUNDS] Login failed due to response error: ${error.message} (${error.code})');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Login failed due to response error: ${error.message} (${error.code})');
case RESULT(error):
trace('[NEWGROUNDS] Login failed due to result error: ${error.message} (${error.code})');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Login failed due to result error: ${error.message} (${error.code})');
default:
trace('[NEWGROUNDS] Login failed due to unknown error: ${error}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Login failed due to unknown error: ${error}');
}
default:
trace('[NEWGROUNDS] Login failed due to unknown reason.');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Login failed due to unknown reason.');
}
}
function onLogoutSuccessful():Void
{
trace('[NEWGROUNDS] Logout successful!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Logout successful!');
}
function onLogoutFailed(result:CallError):Void
@ -300,31 +300,31 @@ class NewgroundsClient
switch (result)
{
case HTTP(error):
trace('[NEWGROUNDS] Logout failed due to HTTP error: ${error}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Logout failed due to HTTP error: ${error}');
case RESPONSE(error):
trace('[NEWGROUNDS] Logout failed due to response error: ${error.message} (${error.code})');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Logout failed due to response error: ${error.message} (${error.code})');
case RESULT(error):
trace('[NEWGROUNDS] Logout failed due to result error: ${error.message} (${error.code})');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Logout failed due to result error: ${error.message} (${error.code})');
default:
trace('[NEWGROUNDS] Logout failed due to unknown error: ${result}');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Logout failed due to unknown error: ${result}');
}
}
function onFetchedMedals(outcome:Outcome<CallError>):Void
{
trace('[NEWGROUNDS] Fetched medals!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Fetched medals!');
}
function onFetchedLeaderboards(outcome:Outcome<CallError>):Void
{
trace('[NEWGROUNDS] Fetched leaderboards!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Fetched leaderboards!');
// trace(funkin.api.newgrounds.Leaderboards.listLeaderboardData());
}
function onFetchedSaveSlots(outcome:Outcome<CallError>):Void
{
trace('[NEWGROUNDS] Fetched save slots!');
trace('${funkin.util.AnsiUtil.apply(' NEWGROUNDS ', [BOLD, BG_ORANGE])} Fetched save slots!');
NGSaveSlot.instance.checkSlot();
}

View file

@ -244,7 +244,7 @@ class CharacterDataParser
case CharacterRenderType.Packer:
char = new PackerCharacter(charId);
default:
trace('[WARN] Creating character with undefined renderType ${charData.renderType}');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Creating character with undefined renderType ${charData.renderType}');
char = new BaseCharacter(charId, CharacterRenderType.Custom);
}
}
@ -312,7 +312,7 @@ class CharacterDataParser
if (!Assets.exists(Paths.image(charPath)))
{
trace('[WARN] Character ${char} has no freeplay icon.');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Character ${char} has no freeplay icon.');
return null;
}
@ -329,7 +329,7 @@ class CharacterDataParser
if (idleFrame == null)
{
trace('[WARN] Character ${char} has no idle in their freeplay icon.');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Character ${char} has no idle in their freeplay icon.');
return null;
}

View file

@ -446,7 +446,7 @@ using funkin.data.song.migrator.SongDataMigrator;
var entryFilePath:String = Paths.json('$dataFilePath/$id/$id-metadata${variation == Constants.DEFAULT_VARIATION ? '' : '-$variation'}');
if (!openfl.Assets.exists(entryFilePath))
{
trace(' [WARN] Could not locate file $entryFilePath');
trace(' ${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Could not locate file $entryFilePath');
return null;
}
var rawJson:Null<String> = openfl.Assets.getText(entryFilePath);
@ -524,7 +524,7 @@ using funkin.data.song.migrator.SongDataMigrator;
if (character == null)
{
trace(' [WARN] Could not locate character $characterId');
trace(' ${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Could not locate character $characterId');
return allDifficulties;
}
@ -542,7 +542,7 @@ using funkin.data.song.migrator.SongDataMigrator;
if (allDifficulties.length == 0)
{
trace(' [WARN] No difficulties found. Returning default difficulty list.');
trace(' ${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} No difficulties found. Returning default difficulty list.');
allDifficulties = Constants.DEFAULT_DIFFICULTY_LIST.copy();
}

View file

@ -337,7 +337,7 @@ class BaseCharacter extends Bopper
{
if (PlayState.instance.iconP1 == null)
{
trace('[WARN] Player 1 health icon not found!');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Player 1 health icon not found!');
return;
}
PlayState.instance.iconP1.configure(_data?.healthIcon);
@ -347,7 +347,7 @@ class BaseCharacter extends Bopper
{
if (PlayState.instance.iconP2 == null)
{
trace('[WARN] Player 2 health icon not found!');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Player 2 health icon not found!');
return;
}
PlayState.instance.iconP2.configure(_data?.healthIcon);

View file

@ -61,7 +61,7 @@ class SetHealthIconSongEvent extends SongEvent
trace('Applying Opponent health icon via song event: ${healthIconData.id}');
PlayState.instance.iconP2.configure(healthIconData);
default:
trace('[WARN] Unknown character index: ' + data.value.char);
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Unknown character index: ' + data.value.char);
}
}

View file

@ -154,7 +154,7 @@ class Song implements IPlayStateScriptedClass implements IRegistryEntry<SongMeta
{
if (!validateVariationId(vari))
{
trace(' [WARN] Variation id "$vari" is invalid, skipping...');
trace(' ${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Variation id "$vari" is invalid, skipping...');
continue;
}
@ -174,7 +174,7 @@ class Song implements IPlayStateScriptedClass implements IRegistryEntry<SongMeta
if (_metadata.size() == 0)
{
trace('[WARN] Could not find song data for songId: $id');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Could not find song data for songId: $id');
return;
}

View file

@ -40,7 +40,7 @@ class PixelatedIcon extends FlxFilteredSprite
if (!Assets.exists(Paths.image(charPath)))
{
trace('[WARN] Character ${char} has no freeplay icon.');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Character ${char} has no freeplay icon.');
this.visible = false;
return;
}

View file

@ -1,6 +1,8 @@
package funkin.ui.credits;
import funkin.data.JsonFile;
import funkin.util.AnsiUtil;
import funkin.util.AnsiUtil.AnsiCode;
using StringTools;
@ -20,13 +22,13 @@ class CreditsDataHandler
{
if (data == null)
{
Sys.println('[INFO] CreditsData(NULL)');
Sys.println('${AnsiUtil.apply(' INFO ', [BOLD, BG_BLUE])} CreditsData(NULL)');
return;
}
if (data.entries == null || data.entries.length == 0)
{
Sys.println('[INFO] CreditsData(EMPTY)');
Sys.println('${AnsiUtil.apply(' INFO ', [BOLD, BG_BLUE])} CreditsData(EMPTY)');
return;
}
@ -37,7 +39,7 @@ class CreditsDataHandler
lineCount += entry?.body?.length ?? 0;
}
Sys.println('[INFO] CreditsData($entryCount entries containing $lineCount lines)');
Sys.println('${AnsiUtil.apply(' INFO ', [BOLD, BG_BLUE])} CreditsData($entryCount entries containing $lineCount lines)');
}
#end

View file

@ -2,6 +2,8 @@ package funkin.ui.credits;
#if macro
import haxe.macro.Context;
import funkin.util.AnsiUtil;
import funkin.util.AnsiUtil.AnsiCode;
#end
@:access(funkin.ui.credits.CreditsDataHandler)
@ -10,12 +12,12 @@ class CreditsDataMacro
public static macro function loadCreditsData():haxe.macro.Expr.ExprOf<CreditsData>
{
#if !display
Sys.println('[INFO] Hardcoding credits data...');
Sys.println('${AnsiUtil.apply(' INFO ', [BOLD, BG_BLUE])} Hardcoding credits data...');
var json = CreditsDataMacro.fetchJSON();
if (json == null)
{
Context.info('[WARN] Could not fetch JSON data for credits.', Context.currentPos());
Context.info('${AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Could not fetch JSON data for credits.', Context.currentPos());
return macro $v{CreditsDataHandler.getFallback()};
}
@ -23,7 +25,7 @@ class CreditsDataMacro
if (creditsData == null)
{
Context.info('[WARN] Could not parse JSON data for credits.', Context.currentPos());
Context.info('${AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Could not parse JSON data for credits.', Context.currentPos());
return macro $v{CreditsDataHandler.getFallback()};
}

View file

@ -2823,7 +2823,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
{
if (notePreviewViewport == null)
{
trace('[WARN] Tried to set note preview viewport bounds, but notePreviewViewport is null!');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Tried to set note preview viewport bounds, but notePreviewViewport is null!');
return;
}

View file

@ -84,7 +84,7 @@ class ChartEditorBaseDialog extends Dialog
if (_overlay == null)
{
trace('[WARN] Dialog overlay is null, skipping overlay fade...');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Dialog overlay is null, skipping overlay fade...');
return;
}

View file

@ -148,7 +148,7 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog
if (songName == null) songName = songData.getDifficulty()?.songName;
if (songName == null) // Still null?
{
trace('[WARN] Could not fetch song name for ${targetSongId}');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Could not fetch song name for ${targetSongId}');
continue;
}

View file

@ -36,7 +36,7 @@ class ChartEditorAudioHandler
var fileBytes:Bytes = sys.io.File.getBytes(path.toString());
return loadVocalsFromBytes(state, fileBytes, charId, instId, wipeFirst);
#else
trace("[WARN] This platform can't load audio from a file path, you'll need to fetch the bytes some other way.");
trace("${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} This platform can't load audio from a file path, you'll need to fetch the bytes some other way.");
return false;
#end
}
@ -88,7 +88,7 @@ class ChartEditorAudioHandler
var fileBytes:Bytes = sys.io.File.getBytes(path.toString());
return loadInstFromBytes(state, fileBytes, instId, wipeFirst);
#else
trace("[WARN] This platform can't load audio from a file path, you'll need to fetch the bytes some other way.");
trace("${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} This platform can't load audio from a file path, you'll need to fetch the bytes some other way.");
return false;
#end
}
@ -211,7 +211,7 @@ class ChartEditorAudioHandler
}
else
{
trace('[WARN] Failed to parse waveform data for vocal track.');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Failed to parse waveform data for vocal track.');
}
state.audioVocalTrackGroup.playerVoicesOffset = state.currentVocalOffsetPlayer;
@ -235,7 +235,7 @@ class ChartEditorAudioHandler
}
else
{
trace('[WARN] Failed to parse waveform data for vocal track.');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Failed to parse waveform data for vocal track.');
}
state.audioVocalTrackGroup.opponentVoicesOffset = state.currentVocalOffsetOpponent;
@ -311,7 +311,7 @@ class ChartEditorAudioHandler
var data:Null<Bytes> = state.audioInstTrackData.get('default');
if (data == null)
{
trace('[WARN] Failed to access inst track ($key)');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Failed to access inst track ($key)');
continue;
}
zipEntries.push(FileUtil.makeZIPEntryFromBytes('Inst.ogg', data));
@ -321,7 +321,7 @@ class ChartEditorAudioHandler
var data:Null<Bytes> = state.audioInstTrackData.get(key);
if (data == null)
{
trace('[WARN] Failed to access inst track ($key)');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Failed to access inst track ($key)');
continue;
}
zipEntries.push(FileUtil.makeZIPEntryFromBytes('Inst-${key}.ogg', data));
@ -346,7 +346,7 @@ class ChartEditorAudioHandler
var data:Null<Bytes> = state.audioVocalTrackData.get(key);
if (data == null)
{
trace('[WARN] Failed to access vocal track ($key)');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Failed to access vocal track ($key)');
continue;
}
zipEntries.push(FileUtil.makeZIPEntryFromBytes('Voices-${key}.ogg', data));

View file

@ -523,7 +523,7 @@ class ChartEditorImportExportHandler
var onSave:Array<String>->Void = function(paths:Array<String>) {
if (paths.length != 1)
{
trace('[WARN] Could not get save path.');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Could not get save path.');
state.applyWindowTitle();
}
else

View file

@ -389,7 +389,7 @@ class FreeplayState extends MusicBeatSubState
if (level == null)
{
trace('[WARN] Could not find level with id (${levelId})');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Could not find level with id (${levelId})');
continue;
}
@ -399,7 +399,7 @@ class FreeplayState extends MusicBeatSubState
if (song == null)
{
trace('[WARN] Could not find song with id (${songId})');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Could not find song with id (${songId})');
continue;
}

View file

@ -21,7 +21,7 @@ class CLIUtil
gameDir = Path.addTrailingSlash(extension.androidtools.content.Context.getExternalFilesDir());
#elseif ios
// Why? Because for some reason lime.system.System.documentsDirectory is returning a directory that's different and we're unable to read or write from, so it's disabled and no solution is found...
trace('[WARN]: Reseting the Current Working Directory is unavailable on iOS targets');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])}: Reseting the Current Working Directory is unavailable on iOS targets');
gameDir = cwd;
#elseif mac
gameDir = Path.addTrailingSlash(Path.join([Path.directory(Sys.programPath()), '../Resources/']));

View file

@ -2,6 +2,8 @@ package funkin.util.macro;
import haxe.macro.Context;
import haxe.macro.Expr;
import funkin.util.AnsiUtil;
import funkin.util.AnsiUtil.AnsiCode;
#if !macro
import flixel.FlxG;
#end
@ -58,7 +60,7 @@ class ConsoleMacro
};
fields.push(initField);
Sys.println('[INFO] Generated console registration for: $cl');
Sys.println('${AnsiUtil.apply(' INFO ', [BOLD, BG_BLUE])} Generated console registration for: $cl');
return fields;
}
#end

View file

@ -17,7 +17,8 @@ class GitCommit
if (process.exitCode() != 0)
{
var message = process.stderr.readAll().toString();
haxe.macro.Context.info('[WARN] Could not determine current git commit; is this a proper Git repository?', pos);
haxe.macro.Context.info('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Could not determine current git commit; is this a proper Git repository?',
pos);
}
// read the output of the process
@ -49,7 +50,8 @@ class GitCommit
if (branchProcess.exitCode() != 0)
{
var message = branchProcess.stderr.readAll().toString();
haxe.macro.Context.info('[WARN] Could not determine current git commit; is this a proper Git repository?', pos);
haxe.macro.Context.info('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Could not determine current git commit; is this a proper Git repository?',
pos);
}
var branchName:String = branchProcess.stdout.readLine();

View file

@ -521,7 +521,7 @@ class ScreenshotPlugin extends FlxBasic
if (pngData == null)
{
trace('[WARN] Failed to encode PNG data');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Failed to encode PNG data');
previousScreenshotName = null;
// Just in case
unsavedScreenshotBuffer.shift();
@ -545,7 +545,7 @@ class ScreenshotPlugin extends FlxBasic
if (pngData == null)
{
trace('[WARN] Failed to encode PNG data');
trace('${funkin.util.AnsiUtil.apply(' WARNING ', [BOLD, BG_YELLOW])} Failed to encode PNG data');
previousScreenshotName = null;
return;
}