Format .hx files
Co-Authored-By: Eric <4635334+EliteMasterEric@users.noreply.github.com>
This commit is contained in:
@@ -31,8 +31,7 @@ class Postbuild
|
||||
else
|
||||
{
|
||||
var bytes:haxe.io.Bytes = haxe.io.Bytes.ofData(sys.io.File.getBytes(path).getData());
|
||||
var entry:haxe.zip.Entry =
|
||||
{
|
||||
var entry:haxe.zip.Entry = {
|
||||
fileName: StringTools.replace(path, inDir, ""),
|
||||
fileSize: bytes.length,
|
||||
fileTime: Date.now(),
|
||||
|
||||
@@ -23,6 +23,7 @@ class SongConverter
|
||||
|
||||
// TODO
|
||||
// Update engine shit, to accomodate single file
|
||||
|
||||
static function main()
|
||||
{
|
||||
// trace(Compiler.get);
|
||||
|
||||
@@ -868,10 +868,14 @@ class Conductor
|
||||
var wantedBeatLengthMs:Float = ((Constants.SECS_PER_MIN / wantedTimeChange.bpm) * Constants.MS_PER_SEC) * (4 / wantedTimeChange.timeSignatureDen);
|
||||
return switch (type.toLowerCase())
|
||||
{
|
||||
case "measure", "m": wantedBeatLengthMs * wantedTimeChange.timeSignatureNum;
|
||||
case "beat", "b": wantedBeatLengthMs;
|
||||
case "step", "s": wantedBeatLengthMs / Constants.STEPS_PER_BEAT;
|
||||
default: wantedBeatLengthMs;
|
||||
case "measure", "m":
|
||||
wantedBeatLengthMs * wantedTimeChange.timeSignatureNum;
|
||||
case "beat", "b":
|
||||
wantedBeatLengthMs;
|
||||
case "step", "s":
|
||||
wantedBeatLengthMs / Constants.STEPS_PER_BEAT;
|
||||
default:
|
||||
wantedBeatLengthMs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,11 +20,9 @@ class FunkinMemory
|
||||
static var permanentCachedTextures:Map<String, FlxGraphic> = [];
|
||||
static var currentCachedTextures:Map<String, FlxGraphic> = [];
|
||||
static var previousCachedTextures:Map<String, FlxGraphic> = [];
|
||||
|
||||
static var permanentCachedSounds:Map<String, Sound> = [];
|
||||
static var currentCachedSounds:Map<String, Sound> = [];
|
||||
static var previousCachedSounds:Map<String, Sound> = [];
|
||||
|
||||
static var purgeFilter:Array<String> = ["/week", "/characters", "/charSelect", "/results"];
|
||||
|
||||
/**
|
||||
|
||||
@@ -82,9 +82,7 @@ typedef RawTallies =
|
||||
var good:Int;
|
||||
var sick:Int;
|
||||
var maxCombo:Int;
|
||||
|
||||
var score:Int;
|
||||
|
||||
var isNewHighscore:Bool;
|
||||
|
||||
/**
|
||||
|
||||
@@ -237,7 +237,9 @@ class InitState extends FlxState
|
||||
// ANDROID SETUP
|
||||
//
|
||||
#if android
|
||||
FlxG.android.preventDefaultKeys = [flixel.input.android.FlxAndroidKey.BACK];
|
||||
FlxG.android.preventDefaultKeys = [
|
||||
flixel.input.android.FlxAndroidKey.BACK
|
||||
];
|
||||
#end
|
||||
|
||||
//
|
||||
@@ -309,7 +311,8 @@ class InitState extends FlxState
|
||||
}
|
||||
|
||||
#if FEATURE_LOST_FOCUS_VOLUME
|
||||
@:noCompletion var _lastFocusVolume:Null<Float>;
|
||||
@:noCompletion
|
||||
var _lastFocusVolume:Null<Float>;
|
||||
|
||||
function onLostFocus():Void
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@ class PlayerSettings
|
||||
public static var player1(default, null):PlayerSettings;
|
||||
@:nullSafety(Off)
|
||||
public static var player2(default, null):PlayerSettings;
|
||||
|
||||
public static var onAvatarAdd(default, null) = new FlxTypedSignal<PlayerSettings->Void>();
|
||||
public static var onAvatarRemove(default, null) = new FlxTypedSignal<PlayerSettings->Void>();
|
||||
|
||||
@@ -45,9 +44,12 @@ class PlayerSettings
|
||||
{
|
||||
return switch (id)
|
||||
{
|
||||
case 1: player1;
|
||||
case 2: player2;
|
||||
default: null;
|
||||
case 1:
|
||||
player1;
|
||||
case 2:
|
||||
player2;
|
||||
default:
|
||||
null;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,11 @@ import hxdiscord_rpc.Types.DiscordRichPresence;
|
||||
import hxdiscord_rpc.Types.DiscordUser;
|
||||
import sys.thread.Thread;
|
||||
|
||||
@:build(funkin.util.macro.EnvironmentMacro.build())
|
||||
@:nullSafety
|
||||
@:build(funkin.util.macro.EnvironmentMacro.build()) @:nullSafety
|
||||
class DiscordClient
|
||||
{
|
||||
@:envField
|
||||
static final DISCORD_CLIENT_ID:Null<String>;
|
||||
|
||||
public static var instance(get, never):DiscordClient;
|
||||
static var _instance:Null<DiscordClient> = null;
|
||||
|
||||
@@ -138,6 +136,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 '.bold().bg_blue() + ' Client has connected!');
|
||||
|
||||
@@ -236,14 +236,12 @@ enum abstract Leaderboard(Int) from Int to Int
|
||||
public var StoryWeek6 = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 14244 #else 9957 #end;
|
||||
public var StoryWeek7 = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 14245 #else 14682 #end;
|
||||
public var StoryWeekend1 = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 14237 #else 14683 #end;
|
||||
|
||||
// Collab 1 only has one song.
|
||||
//
|
||||
// SONGS
|
||||
//
|
||||
// Tutorial
|
||||
public var Tutorial = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 14249 #else 14684 #end;
|
||||
|
||||
// Week 1
|
||||
public var Bopeebo = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 14246 #else 9603 #end;
|
||||
public var BopeeboErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14685 #end;
|
||||
@@ -254,7 +252,6 @@ enum abstract Leaderboard(Int) from Int to Int
|
||||
public var DadBattle = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 14248 #else 9605 #end;
|
||||
public var DadBattleErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14689 #end;
|
||||
public var DadBattlePicoMix = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14690 #end;
|
||||
|
||||
// Week 2
|
||||
public var Spookeez = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 9604 #end;
|
||||
public var SpookeezErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14691 #end;
|
||||
@@ -263,7 +260,6 @@ enum abstract Leaderboard(Int) from Int to Int
|
||||
public var SouthErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14693 #end;
|
||||
public var SouthPicoMix = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14694 #end;
|
||||
public var Monster = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14703 #end;
|
||||
|
||||
// Week 3
|
||||
public var Pico = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 9766 #end;
|
||||
public var PicoErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14695 #end;
|
||||
@@ -274,14 +270,12 @@ enum abstract Leaderboard(Int) from Int to Int
|
||||
public var Blammed = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 9768 #end;
|
||||
public var BlammedErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14704 #end;
|
||||
public var BlammedPicoMix = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14705 #end;
|
||||
|
||||
// Week 4
|
||||
public var SatinPanties = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 9869 #end;
|
||||
public var SatinPantiesErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14701 #end;
|
||||
public var High = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 9867 #end;
|
||||
public var HighErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14699 #end;
|
||||
public var MILF = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 9868 #end;
|
||||
|
||||
// Week 5
|
||||
public var Cocoa = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14706 #end;
|
||||
public var CocoaErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14707 #end;
|
||||
@@ -290,7 +284,6 @@ enum abstract Leaderboard(Int) from Int to Int
|
||||
public var EggnogErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14711 #end;
|
||||
public var EggnogPicoMix = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14710 #end;
|
||||
public var WinterHorrorland = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14712 #end;
|
||||
|
||||
// Week 6
|
||||
public var Senpai = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 9958 #end;
|
||||
public var SenpaiErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14713 #end;
|
||||
@@ -300,7 +293,6 @@ enum abstract Leaderboard(Int) from Int to Int
|
||||
public var RosesPicoMix = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14717 #end;
|
||||
public var Thorns = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 9960 #end;
|
||||
public var ThornsErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14715 #end;
|
||||
|
||||
// Week 7
|
||||
public var Ugh = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14718 #end;
|
||||
public var UghErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14722 #end;
|
||||
@@ -309,7 +301,6 @@ enum abstract Leaderboard(Int) from Int to Int
|
||||
public var GunsPicoMix = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14723 #end;
|
||||
public var Stress = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14720 #end;
|
||||
public var StressPicoMix = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14724 #end;
|
||||
|
||||
// Weekend 1
|
||||
public var Darnell = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14725 #end;
|
||||
public var DarnellErect = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14727 #end;
|
||||
@@ -318,7 +309,6 @@ enum abstract Leaderboard(Int) from Int to Int
|
||||
public var LitUpBFMix = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14729 #end;
|
||||
public var TwoHot = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14730 #end; // Variable names can't start with a number!
|
||||
public var Blazin = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 1000000 #else 14731 #end;
|
||||
|
||||
// Collab 1
|
||||
public var Spaghetti = #if FEATURE_NEWGROUNDS_TESTING_MEDALS 15448 #else 15451 #end;
|
||||
|
||||
|
||||
@@ -438,7 +438,27 @@ enum abstract Medal(Int) from Int to Int
|
||||
*/
|
||||
public static function getAllMedals():Array<Medal>
|
||||
{
|
||||
return
|
||||
[StartGame, StoryTutorial, StoryWeek1, StoryWeek2, StoryWeek3, StoryWeek4, StoryWeek5, StoryWeek6, StoryWeek7, StoryWeekend1, CharSelect, FreeplayPicoMix, FreeplayStressPico, LossRating, PerfectRatingHard, GoldPerfectRatingHard, ErectDifficulty, GoldPerfectRatingNightmare, FridayNight, Nice];
|
||||
return [
|
||||
StartGame,
|
||||
StoryTutorial,
|
||||
StoryWeek1,
|
||||
StoryWeek2,
|
||||
StoryWeek3,
|
||||
StoryWeek4,
|
||||
StoryWeek5,
|
||||
StoryWeek6,
|
||||
StoryWeek7,
|
||||
StoryWeekend1,
|
||||
CharSelect,
|
||||
FreeplayPicoMix,
|
||||
FreeplayStressPico,
|
||||
LossRating,
|
||||
PerfectRatingHard,
|
||||
GoldPerfectRatingHard,
|
||||
ErectDifficulty,
|
||||
GoldPerfectRatingNightmare,
|
||||
FridayNight,
|
||||
Nice
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,7 @@ import io.newgrounds.Call.CallError;
|
||||
import io.newgrounds.objects.events.Outcome;
|
||||
import funkin.save.Save;
|
||||
|
||||
@:nullSafety
|
||||
@:access(funkin.save.Save)
|
||||
@:nullSafety @:access(funkin.save.Save)
|
||||
class NGSaveSlot
|
||||
{
|
||||
public static var instance(get, never):NGSaveSlot;
|
||||
|
||||
@@ -17,18 +17,14 @@ import io.newgrounds.objects.User;
|
||||
import funkin.mobile.util.WebViewUtil;
|
||||
#end
|
||||
|
||||
@:build(funkin.util.macro.EnvironmentMacro.build())
|
||||
@:nullSafety
|
||||
@:build(funkin.util.macro.EnvironmentMacro.build()) @:nullSafety
|
||||
class NewgroundsClient
|
||||
{
|
||||
@:envField
|
||||
static final API_NG_APP_ID:Null<String>;
|
||||
|
||||
@:envField
|
||||
static final API_NG_ENC_KEY:Null<String>;
|
||||
|
||||
public static var instance(get, never):NewgroundsClient;
|
||||
|
||||
static var _instance:Null<NewgroundsClient> = null;
|
||||
|
||||
static function get_instance():NewgroundsClient
|
||||
|
||||
@@ -329,9 +329,12 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||
var suffix = params.suffix ?? '';
|
||||
var pathToUse = switch (pathsFunction)
|
||||
{
|
||||
case MUSIC: Paths.music('$key/$key');
|
||||
case INST: Paths.inst('$key', suffix);
|
||||
default: Paths.music('$key/$key');
|
||||
case MUSIC:
|
||||
Paths.music('$key/$key');
|
||||
case INST:
|
||||
Paths.inst('$key', suffix);
|
||||
default:
|
||||
Paths.music('$key/$key');
|
||||
}
|
||||
|
||||
var shouldLoadPartial = params.partialParams?.loadPartial ?? false;
|
||||
@@ -528,9 +531,7 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||
this._waveformData = null;
|
||||
}
|
||||
|
||||
@:access(openfl.media.Sound)
|
||||
@:access(openfl.media.SoundChannel)
|
||||
@:access(openfl.media.SoundMixer)
|
||||
@:access(openfl.media.Sound) @:access(openfl.media.SoundChannel) @:access(openfl.media.SoundMixer)
|
||||
override function startSound(startTime:Float)
|
||||
{
|
||||
if (!important)
|
||||
|
||||
@@ -11,13 +11,9 @@ import flixel.tweens.FlxTween;
|
||||
class SoundGroup extends FlxTypedGroup<FunkinSound>
|
||||
{
|
||||
public var time(get, set):Float;
|
||||
|
||||
public var volume(get, set):Float;
|
||||
|
||||
public var muted(get, set):Bool;
|
||||
|
||||
public var pitch(get, set):Float;
|
||||
|
||||
public var playing(get, never):Bool;
|
||||
|
||||
public function new()
|
||||
@@ -242,6 +238,7 @@ class SoundGroup extends FlxTypedGroup<FunkinSound>
|
||||
}
|
||||
|
||||
// in PlayState, adjust the code so that it only mutes the player1 vocal tracks?
|
||||
|
||||
function set_volume(volume:Float):Float
|
||||
{
|
||||
forEachAlive(function(snd:FunkinSound)
|
||||
|
||||
@@ -15,7 +15,6 @@ class ABotVis extends FlxTypedSpriteGroup<FlxSprite>
|
||||
// public var vis:VisShit;
|
||||
var analyzer:Null<SpectralAnalyzer> = null;
|
||||
var analyzerLevelsCache:Array<Bar> = new Array<Bar>();
|
||||
|
||||
var volumes:Array<Float> = [];
|
||||
|
||||
public var snd:Null<FlxSound> = null;
|
||||
@@ -23,6 +22,7 @@ class ABotVis extends FlxTypedSpriteGroup<FlxSprite>
|
||||
static final BAR_COUNT:Int = 7;
|
||||
|
||||
// TODO: Make the sprites easier to soft code.
|
||||
|
||||
public function new(snd:FlxSound, pixel:Bool)
|
||||
{
|
||||
super();
|
||||
@@ -35,8 +35,40 @@ class ABotVis extends FlxTypedSpriteGroup<FlxSprite>
|
||||
var visFrms:FlxAtlasFrames = Paths.getSparrowAtlas(pixel ? 'characters/abotPixel/aBotVizPixel' : 'characters/abot/aBotViz');
|
||||
|
||||
// these are the differences in X position, from left to right
|
||||
var positionX:Array<Float> = pixel ? [0, 7 * 6, 8 * 6, 9 * 6, 10 * 6, 6 * 6, 7 * 6] : [0, 59, 56, 66, 54, 52, 51];
|
||||
var positionY:Array<Float> = pixel ? [0, -2 * 6, -1 * 6, 0, 0, 1 * 6, 2 * 6] : [0, -8, -3.5, -0.4, 0.5, 4.7, 7];
|
||||
var positionX:Array<Float> = pixel ? [
|
||||
0,
|
||||
7 * 6,
|
||||
8 * 6,
|
||||
9 * 6,
|
||||
10 * 6,
|
||||
6 * 6,
|
||||
7 * 6
|
||||
] : [
|
||||
0,
|
||||
59,
|
||||
56,
|
||||
66,
|
||||
54,
|
||||
52,
|
||||
51
|
||||
];
|
||||
var positionY:Array<Float> = pixel ? [
|
||||
0,
|
||||
-2 * 6,
|
||||
-1 * 6,
|
||||
0,
|
||||
0,
|
||||
1 * 6,
|
||||
2 * 6
|
||||
] : [
|
||||
0,
|
||||
-8,
|
||||
-3.5,
|
||||
-0.4,
|
||||
0.5,
|
||||
4.7,
|
||||
7
|
||||
];
|
||||
|
||||
for (index in 1...visCount)
|
||||
{
|
||||
|
||||
@@ -23,7 +23,6 @@ class PolygonSpectogram extends MeshRender
|
||||
|
||||
public var audioData:Int16Array;
|
||||
public var detail:Float = 1;
|
||||
|
||||
public var thickness:Float = 2;
|
||||
public var waveAmplitude:Int = 100;
|
||||
|
||||
|
||||
@@ -16,14 +16,11 @@ using flixel.util.FlxSpriteUtil;
|
||||
class SpectogramSprite extends FlxTypedSpriteGroup<FlxSprite>
|
||||
{
|
||||
var sampleRate:Int;
|
||||
|
||||
var lengthOfShit:Int = 500;
|
||||
|
||||
public var visType:VISTYPE = UPDATED;
|
||||
|
||||
public var col:Int = FlxColor.WHITE;
|
||||
public var daHeight:Float = FlxG.height;
|
||||
|
||||
public var vis:VisShit;
|
||||
|
||||
public function new(daSound:FlxSound, ?col:FlxColor = FlxColor.WHITE, ?height:Float = 720, ?amnt:Int = 500)
|
||||
|
||||
@@ -64,7 +64,10 @@ class VisShit
|
||||
while (c < samples.length)
|
||||
{
|
||||
// take a chunk (zero-padded if needed) and apply the window
|
||||
final chunk = [for (n in 0...fftN) (c + n < samples.length ? samples[c + n] : 0.0) * window(n)];
|
||||
final chunk = [
|
||||
for (n in 0...fftN)
|
||||
(c + n < samples.length ? samples[c + n] : 0.0) * window(n)
|
||||
];
|
||||
|
||||
// compute positive spectrum with sampling correction and BP filter
|
||||
final freqs = FFT.rfft(chunk).map(z -> z.scale(1 / fftN).magnitude).mapi(melodicBandPass);
|
||||
|
||||
@@ -3,8 +3,7 @@ package funkin.audio.visualize.dsp;
|
||||
/**
|
||||
Complex number representation.
|
||||
**/
|
||||
@:forward(real, imag) @:notNull @:pure
|
||||
@:nullSafety
|
||||
@:forward(real, imag) @:notNull @:pure @:nullSafety
|
||||
abstract Complex({
|
||||
final real:Float;
|
||||
final imag:Float;
|
||||
|
||||
@@ -43,10 +43,14 @@ class FFT
|
||||
public static function ifft(input:Array<Complex>):Array<Complex> return do_fft(input, true);
|
||||
|
||||
// Handles padding and scaling for forwards and inverse FFTs.
|
||||
|
||||
static function do_fft(input:Array<Complex>, inverse:Bool):Array<Complex>
|
||||
{
|
||||
final n = nextPow2(input.length);
|
||||
var ts = [for (i in 0...n) if (i < input.length) input[i] else Complex.zero];
|
||||
var ts = [
|
||||
for (i in 0...n)
|
||||
if (i < input.length) input[i] else Complex.zero
|
||||
];
|
||||
var fs = [for (_ in 0...n) Complex.zero];
|
||||
ditfft2(ts, 0, fs, 0, n, 1, inverse);
|
||||
return inverse ? fs.map(z -> z.scale(1 / n)) : fs;
|
||||
@@ -54,6 +58,7 @@ class FFT
|
||||
}
|
||||
|
||||
// Radix-2 Decimation-In-Time variant of Cooley–Tukey's FFT, recursive.
|
||||
|
||||
static function ditfft2(time:Array<Complex>, t:Int, freq:Array<Complex>, f:Int, n:Int, step:Int, inverse:Bool):Void
|
||||
{
|
||||
if (n == 1)
|
||||
@@ -77,6 +82,7 @@ class FFT
|
||||
}
|
||||
|
||||
// Naive O(n^2) DFT, used for testing purposes.
|
||||
|
||||
static function dft(ts:Array<Complex>, ?inverse:Bool):Array<Complex>
|
||||
{
|
||||
if (inverse == null) inverse = false;
|
||||
@@ -110,6 +116,7 @@ class FFT
|
||||
}
|
||||
|
||||
// testing, but also acts like an example
|
||||
|
||||
static function main()
|
||||
{
|
||||
// sampling and buffer parameters
|
||||
@@ -119,15 +126,24 @@ class FFT
|
||||
|
||||
// build a time signal as a sum of sinusoids
|
||||
final freqs = [5919.911];
|
||||
final ts = [for (n in 0...N) freqs.map(f -> Math.sin(2 * Math.PI * f * n / Fs)).sum()];
|
||||
final ts = [
|
||||
for (n in 0...N)
|
||||
freqs.map(f -> Math.sin(2 * Math.PI * f * n / Fs)).sum()
|
||||
];
|
||||
|
||||
// get positive spectrum and use its symmetry to reconstruct negative domain
|
||||
final fs_pos = rfft(ts);
|
||||
final fs_fft = new OffsetArray([for (k in -(halfN - 1)...0) fs_pos[-k].conj()].concat(fs_pos), -(halfN - 1));
|
||||
final fs_fft = new OffsetArray([
|
||||
for (k in -(halfN - 1)...0)
|
||||
fs_pos[-k].conj()
|
||||
].concat(fs_pos), -(halfN - 1));
|
||||
|
||||
// double-check with naive DFT
|
||||
final fs_dft = new OffsetArray(dft(ts.map(Complex.fromReal)).circShift(halfN - 1), -(halfN - 1));
|
||||
final fs_err = [for (k in -(halfN - 1)...halfN) fs_fft[k] - fs_dft[k]];
|
||||
final fs_err = [
|
||||
for (k in -(halfN - 1)...halfN)
|
||||
fs_fft[k] - fs_dft[k]
|
||||
];
|
||||
final max_fs_err = fs_err.map(z -> z.magnitude).max();
|
||||
if (max_fs_err > 1e-6) haxe.Log.trace('FT Error: ${max_fs_err}', null);
|
||||
// else for (k => s in fs_fft) haxe.Log.trace('${k * Fs / N};${s.scale(1 / Fs).magnitude}', null);
|
||||
@@ -143,14 +159,20 @@ class FFT
|
||||
}
|
||||
else
|
||||
{
|
||||
final freqs_err = [for (i in 0...freqs.length) freqis[i] - freqs[i]];
|
||||
final freqs_err = [
|
||||
for (i in 0...freqs.length)
|
||||
freqis[i] - freqs[i]
|
||||
];
|
||||
final max_freqs_err = freqs_err.map(Math.abs).max();
|
||||
if (max_freqs_err > Fs / N) trace('Frequency Errors: ${freqs_err}');
|
||||
}
|
||||
|
||||
// recover time signal from the frequency domain
|
||||
final ts_ifft = ifft(fs_fft.array.circShift(-(halfN - 1)).map(z -> z.scale(1 / Fs)));
|
||||
final ts_err = [for (n in 0...N) ts_ifft[n].scale(Fs).real - ts[n]];
|
||||
final ts_err = [
|
||||
for (n in 0...N)
|
||||
ts_ifft[n].scale(Fs).real - ts[n]
|
||||
];
|
||||
final max_ts_err = ts_err.map(Math.abs).max();
|
||||
if (max_ts_err > 1e-6) haxe.Log.trace('IFT Error: ${max_ts_err}', null);
|
||||
// else for (n in 0...ts_ifft.length) haxe.Log.trace('${n / Fs};${ts_ifft[n].scale(Fs).real}', null);
|
||||
|
||||
@@ -5,8 +5,7 @@ package funkin.audio.visualize.dsp;
|
||||
|
||||
Usages include 1-indexed sequences or zero-centered buffers with negative indexing.
|
||||
**/
|
||||
@:forward(array, offset)
|
||||
@:nullSafety
|
||||
@:forward(array, offset) @:nullSafety
|
||||
abstract OffsetArray<T>({
|
||||
final array:Array<T>;
|
||||
final offset:Int;
|
||||
|
||||
@@ -47,7 +47,10 @@ class Signal
|
||||
|
||||
var peaks = new Array<Int>();
|
||||
|
||||
final dy = [for (i in 1...y.length) y[i] - y[i - 1]];
|
||||
final dy = [
|
||||
for (i in 1...y.length)
|
||||
y[i] - y[i - 1]
|
||||
];
|
||||
for (i in 1...dy.length)
|
||||
{
|
||||
// peak: function growth positive to its left and negative to its right
|
||||
|
||||
@@ -7,7 +7,6 @@ class WaveformDataParser
|
||||
static final INT16_MAX:Int = 32767;
|
||||
@:native("int16_min")
|
||||
static final INT16_MIN:Int = -32768;
|
||||
|
||||
@:native("int8_max")
|
||||
static final INT8_MAX:Int = 127;
|
||||
@:native("int8_min")
|
||||
@@ -82,7 +81,9 @@ class WaveformDataParser
|
||||
{
|
||||
for (channelIndex in 0...channels)
|
||||
{
|
||||
var sampleValue:Int = soundData[sampleIndex * channels + channelIndex];
|
||||
var sampleValue:Int = soundData[
|
||||
sampleIndex * channels + channelIndex
|
||||
];
|
||||
|
||||
if (sampleValue < minValues[channelIndex]) minValues[channelIndex] = sampleValue;
|
||||
if (sampleValue > maxValues[channelIndex]) maxValues[channelIndex] = sampleValue;
|
||||
@@ -94,7 +95,9 @@ class WaveformDataParser
|
||||
for (channelIndex in 0...channels)
|
||||
{
|
||||
outputData[baseIndex + channelIndex * 2] = minValues[channelIndex];
|
||||
outputData[baseIndex + channelIndex * 2 + 1] = maxValues[channelIndex];
|
||||
outputData[
|
||||
baseIndex + channelIndex * 2 + 1
|
||||
] = maxValues[channelIndex];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,7 @@ typedef EntryConstructorFunction = (String, ?Dynamic) -> Void;
|
||||
* @param J The type of the JSON data used when constructing.
|
||||
* @param P The type of the parameters used for `fetchEntry()`.
|
||||
*/
|
||||
@:nullSafety
|
||||
@:generic
|
||||
@:autoBuild(funkin.util.macro.RegistryMacro.buildRegistry())
|
||||
@:nullSafety @:generic @:autoBuild(funkin.util.macro.RegistryMacro.buildRegistry())
|
||||
abstract class BaseRegistry<T:(IRegistryEntry<J> & Constructible<EntryConstructorFunction>), J, P>
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -224,7 +224,10 @@ class DataParse
|
||||
*/
|
||||
static function jsonArrayToDynamicArray(jsons:Array<Json>):Array<Null<Dynamic>>
|
||||
{
|
||||
return [for (json in jsons) Tools.getValue(json)];
|
||||
return [
|
||||
for (json in jsons)
|
||||
Tools.getValue(json)
|
||||
];
|
||||
}
|
||||
|
||||
static function legacyNoteSectionArray(json:Json, name:String):Array<LegacyNoteSection>
|
||||
@@ -232,7 +235,10 @@ class DataParse
|
||||
switch (json.value)
|
||||
{
|
||||
case JArray(values):
|
||||
return [for (value in values) legacyNoteSection(value, name)];
|
||||
return [
|
||||
for (value in values)
|
||||
legacyNoteSection(value, name)
|
||||
];
|
||||
default:
|
||||
throw 'Expected property to be an array, but it was ${json.value}.';
|
||||
}
|
||||
@@ -293,7 +299,10 @@ class DataParse
|
||||
switch (json.value)
|
||||
{
|
||||
case JArray(values):
|
||||
return [for (value in values) legacyNote(value, name)];
|
||||
return [
|
||||
for (value in values)
|
||||
legacyNote(value, name)
|
||||
];
|
||||
default:
|
||||
throw 'Expected property $name to be an array of notes, but it was ${json.value}.';
|
||||
}
|
||||
|
||||
@@ -9,11 +9,9 @@ package funkin.data;
|
||||
interface IRegistryEntry<T>
|
||||
{
|
||||
public final id:String;
|
||||
|
||||
// public function new(id:String):Void;
|
||||
public function destroy():Void;
|
||||
public function toString():String;
|
||||
|
||||
// Can't make an interface field private I guess.
|
||||
public final _data:T;
|
||||
// Can't make a static field required by an interface I guess.
|
||||
|
||||
@@ -93,40 +93,35 @@ typedef UnnamedAnimationData =
|
||||
* Offset the character's position by this amount when playing this animation.
|
||||
* @default [0, 0]
|
||||
*/
|
||||
@:default([0, 0])
|
||||
@:optional
|
||||
@:default([0, 0]) @:optional
|
||||
var offsets:Null<Array<Float>>;
|
||||
|
||||
/**
|
||||
* Whether the animation should loop when it finishes.
|
||||
* @default false
|
||||
*/
|
||||
@:default(false)
|
||||
@:optional
|
||||
@:default(false) @:optional
|
||||
var looped:Bool;
|
||||
|
||||
/**
|
||||
* Whether the animation's sprites should be flipped horizontally.
|
||||
* @default false
|
||||
*/
|
||||
@:default(false)
|
||||
@:optional
|
||||
@:default(false) @:optional
|
||||
var flipX:Null<Bool>;
|
||||
|
||||
/**
|
||||
* Whether the animation's sprites should be flipped vertically.
|
||||
* @default false
|
||||
*/
|
||||
@:default(false)
|
||||
@:optional
|
||||
@:default(false) @:optional
|
||||
var flipY:Null<Bool>;
|
||||
|
||||
/**
|
||||
* The frame rate of the animation.
|
||||
* @default 24
|
||||
*/
|
||||
@:default(24)
|
||||
@:optional
|
||||
@:default(24) @:optional
|
||||
var frameRate:Null<Int>;
|
||||
|
||||
/**
|
||||
@@ -135,8 +130,7 @@ typedef UnnamedAnimationData =
|
||||
* @example [0, 1, 2, 3] (use only the first four frames)
|
||||
* @default [] (all frames)
|
||||
*/
|
||||
@:default([])
|
||||
@:optional
|
||||
@:default([]) @:optional
|
||||
var frameIndices:Null<Array<Int>>;
|
||||
|
||||
/**
|
||||
@@ -144,8 +138,7 @@ typedef UnnamedAnimationData =
|
||||
* Only available for texture atlases.
|
||||
* Options: "framelabel", "symbol"
|
||||
*/
|
||||
@:default("framelabel")
|
||||
@:optional
|
||||
@:default("framelabel") @:optional
|
||||
var animType:String;
|
||||
|
||||
/**
|
||||
@@ -153,8 +146,7 @@ typedef UnnamedAnimationData =
|
||||
* Only available for multi-sparrow and multi-animateatlas characters.
|
||||
* Options: "sparrow", "animateatlas"
|
||||
*/
|
||||
@:default("")
|
||||
@:optional
|
||||
@:default("") @:optional
|
||||
var renderType:String;
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,7 +39,6 @@ class CharacterDataParser
|
||||
|
||||
static final characterCache:Map<String, CharacterData> = new Map<String, CharacterData>();
|
||||
static final characterScriptedClass:Map<String, String> = new Map<String, String>();
|
||||
|
||||
static final DEFAULT_CHAR_ID:String = 'UNKNOWN';
|
||||
|
||||
/**
|
||||
@@ -777,8 +776,7 @@ typedef CharacterData =
|
||||
* Supports up to `0.25` precision.
|
||||
* @default `1.0` on characters
|
||||
*/
|
||||
@:optional
|
||||
@:default(1.0)
|
||||
@:optional @:default(1.0)
|
||||
var danceEvery:Null<Float>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,8 +21,7 @@ typedef ConversationData =
|
||||
/**
|
||||
* Data on the outro for the conversation.
|
||||
*/
|
||||
@:jcustomparse(funkin.data.DataParse.outroData)
|
||||
@:optional
|
||||
@:jcustomparse(funkin.data.DataParse.outroData) @:optional
|
||||
public var outro:Null<OutroData>;
|
||||
|
||||
/**
|
||||
@@ -65,8 +64,7 @@ typedef BackdropData_Solid =
|
||||
* Fade-in time for the backdrop.
|
||||
* @default No fade-in
|
||||
*/
|
||||
@:optional
|
||||
@:default(0.0)
|
||||
@:optional @:default(0.0)
|
||||
var fadeTime:Float;
|
||||
};
|
||||
|
||||
@@ -95,8 +93,7 @@ typedef OutroData_Fade =
|
||||
* The time to fade out the conversation.
|
||||
* @default 1 second
|
||||
*/
|
||||
@:optional
|
||||
@:default(1.0)
|
||||
@:optional @:default(1.0)
|
||||
var fadeTime:Float;
|
||||
}
|
||||
|
||||
@@ -110,12 +107,10 @@ typedef MusicData =
|
||||
/**
|
||||
* The time to fade in the music.
|
||||
*/
|
||||
@:optional
|
||||
@:default(0.0)
|
||||
@:optional @:default(0.0)
|
||||
var fadeTime:Float;
|
||||
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
var looped:Bool;
|
||||
};
|
||||
|
||||
@@ -160,7 +155,6 @@ typedef DialogueEntryData =
|
||||
* Setting `speed` to `1.5` would make it look like the character is speaking quickly,
|
||||
* and setting `speed` to `0.5` would make it look like the character is emphasizing each word.
|
||||
*/
|
||||
@:optional
|
||||
@:default(1.0)
|
||||
@:optional @:default(1.0)
|
||||
public var speed:Float;
|
||||
};
|
||||
|
||||
@@ -29,29 +29,25 @@ typedef DialogueBoxData =
|
||||
/**
|
||||
* Whether to horizontally flip the dialogue box sprite.
|
||||
*/
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var flipX:Bool;
|
||||
|
||||
/**
|
||||
* Whether to vertically flip the dialogue box sprite.
|
||||
*/
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var flipY:Bool;
|
||||
|
||||
/**
|
||||
* Whether to disable anti-aliasing for the dialogue box sprite.
|
||||
*/
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var isPixel:Bool;
|
||||
|
||||
/**
|
||||
* The relative horizontal and vertical offsets for the dialogue box sprite.
|
||||
*/
|
||||
@:optional
|
||||
@:default([0, 0])
|
||||
@:optional @:default([0, 0])
|
||||
public var offsets:Array<Float>;
|
||||
|
||||
/**
|
||||
@@ -62,15 +58,13 @@ typedef DialogueBoxData =
|
||||
/**
|
||||
* Multiply the size of the dialogue box sprite.
|
||||
*/
|
||||
@:optional
|
||||
@:default(1)
|
||||
@:optional @:default(1)
|
||||
public var scale:Float;
|
||||
|
||||
/**
|
||||
* If using a spritesheet for the dialogue box, the animations to use.
|
||||
*/
|
||||
@:optional
|
||||
@:default([])
|
||||
@:optional @:default([])
|
||||
public var animations:Array<AnimationData>;
|
||||
}
|
||||
|
||||
@@ -79,30 +73,26 @@ typedef DialogueBoxTextData =
|
||||
/**
|
||||
* The position of the text in teh box.
|
||||
*/
|
||||
@:optional
|
||||
@:default([0, 0])
|
||||
@:optional @:default([0, 0])
|
||||
var offsets:Array<Float>;
|
||||
|
||||
/**
|
||||
* The width of the
|
||||
*/
|
||||
@:optional
|
||||
@:default(300)
|
||||
@:optional @:default(300)
|
||||
var width:Int;
|
||||
|
||||
/**
|
||||
* The font size to use for the text.
|
||||
*/
|
||||
@:optional
|
||||
@:default(32)
|
||||
@:optional @:default(32)
|
||||
var size:Int;
|
||||
|
||||
/**
|
||||
* The color to use for the text.
|
||||
* Use a string that can be translated to a color, like `#FF0000` for red.
|
||||
*/
|
||||
@:optional
|
||||
@:default("#000000")
|
||||
@:optional @:default("#000000")
|
||||
var color:String;
|
||||
|
||||
/**
|
||||
@@ -110,8 +100,7 @@ typedef DialogueBoxTextData =
|
||||
* @since v1.1.0
|
||||
* @default `Arial`, make sure to switch this!
|
||||
*/
|
||||
@:optional
|
||||
@:default("Arial")
|
||||
@:optional @:default("Arial")
|
||||
var fontFamily:String;
|
||||
|
||||
/**
|
||||
@@ -122,7 +111,6 @@ typedef DialogueBoxTextData =
|
||||
/**
|
||||
* The width of the shadow of the text.
|
||||
*/
|
||||
@:optional
|
||||
@:default(0)
|
||||
@:optional @:default(0)
|
||||
var shadowWidth:Int;
|
||||
};
|
||||
|
||||
@@ -27,42 +27,36 @@ typedef SpeakerData =
|
||||
/**
|
||||
* Whether the sprite should be flipped horizontally.
|
||||
*/
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var flipX:Bool;
|
||||
|
||||
/**
|
||||
* Whether the sprite should be flipped vertically.
|
||||
*/
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var flipY:Bool;
|
||||
|
||||
/**
|
||||
* Whether to disable anti-aliasing for the dialogue box sprite.
|
||||
*/
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var isPixel:Bool;
|
||||
|
||||
/**
|
||||
* The offsets to apply to the sprite's position.
|
||||
*/
|
||||
@:optional
|
||||
@:default([0, 0])
|
||||
@:optional @:default([0, 0])
|
||||
public var offsets:Array<Float>;
|
||||
|
||||
/**
|
||||
* The scale to apply to the sprite.
|
||||
*/
|
||||
@:optional
|
||||
@:default(1.0)
|
||||
@:optional @:default(1.0)
|
||||
public var scale:Float;
|
||||
|
||||
/**
|
||||
* The available animations for the speaker.
|
||||
*/
|
||||
@:optional
|
||||
@:default([])
|
||||
@:optional @:default([])
|
||||
public var animations:Array<AnimationData>;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package funkin.data.event;
|
||||
|
||||
@:nullSafety
|
||||
@:forward(name, title, type, keys, min, max, step, units, defaultValue, iterator)
|
||||
@:nullSafety @:forward(name, title, type, keys, min, max, step, units, defaultValue, iterator)
|
||||
abstract SongEventSchema(SongEventSchemaRaw)
|
||||
{
|
||||
/**
|
||||
@@ -209,46 +208,39 @@ typedef SongEventSchemaField =
|
||||
* The key is the display name and the value is the actual value.
|
||||
*/
|
||||
?keys:Map<String, Dynamic>,
|
||||
|
||||
/**
|
||||
* Used for INTEGER and FLOAT values.
|
||||
* The minimum value that can be entered.
|
||||
* @default No minimum
|
||||
*/
|
||||
?min:Float,
|
||||
|
||||
/**
|
||||
* Used for INTEGER and FLOAT values.
|
||||
* The maximum value that can be entered.
|
||||
* @default No maximum
|
||||
*/
|
||||
?max:Float,
|
||||
|
||||
/**
|
||||
* Used for INTEGER and FLOAT values.
|
||||
* The step value that will be used when incrementing/decrementing the value.
|
||||
* @default `0.1`
|
||||
*/
|
||||
?step:Float,
|
||||
|
||||
/**
|
||||
* Used for INTEGER and FLOAT values.
|
||||
* The units that the value is expressed in (pixels, percent, etc).
|
||||
*/
|
||||
?units:String,
|
||||
|
||||
/**
|
||||
* Used for FRAME values.
|
||||
* The child components that this frame contains.
|
||||
*/
|
||||
?children:SongEventSchemaRaw,
|
||||
|
||||
/**
|
||||
* Used for FRAME values.
|
||||
* Whether to make the frame be collapsible.
|
||||
*/
|
||||
?collapsible:Bool,
|
||||
|
||||
/**
|
||||
* An optional default value for the field.
|
||||
*/
|
||||
|
||||
@@ -39,15 +39,13 @@ typedef AlbumData =
|
||||
/**
|
||||
* Offsets for the album title.
|
||||
*/
|
||||
@:optional
|
||||
@:default([0, 0])
|
||||
@:optional @:default([0, 0])
|
||||
public var albumTitleOffsets:Null<Array<Float>>;
|
||||
|
||||
/**
|
||||
* An optional array of animations for the album title.
|
||||
*/
|
||||
@:optional
|
||||
@:default([])
|
||||
@:optional @:default([])
|
||||
public var albumTitleAnimations:Array<AnimationData>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,8 +27,7 @@ class PlayerData
|
||||
/**
|
||||
* Whether to show songs with character IDs that aren't associated with any specific character.
|
||||
*/
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var showUnownedChars:Bool = false;
|
||||
|
||||
/**
|
||||
@@ -36,15 +35,13 @@ class PlayerData
|
||||
* Can be overridden by specific songs.
|
||||
* @default `default`
|
||||
*/
|
||||
@:optional
|
||||
@:default(funkin.util.Constants.DEFAULT_STICKER_PACK)
|
||||
@:optional @:default(funkin.util.Constants.DEFAULT_STICKER_PACK)
|
||||
public var stickerPack:String = Constants.DEFAULT_STICKER_PACK;
|
||||
|
||||
/**
|
||||
* Which freeplay style to use for this character.
|
||||
*/
|
||||
@:optional
|
||||
@:default("bf")
|
||||
@:optional @:default("bf")
|
||||
public var freeplayStyle:String = Constants.DEFAULT_FREEPLAY_STYLE;
|
||||
|
||||
/**
|
||||
@@ -71,8 +68,7 @@ class PlayerData
|
||||
* Whether this character is unlocked by default.
|
||||
* Use a ScriptedPlayableCharacter to add custom logic.
|
||||
*/
|
||||
@:optional
|
||||
@:default(true)
|
||||
@:optional @:default(true)
|
||||
public var unlocked:Bool = true;
|
||||
|
||||
public function new()
|
||||
@@ -102,52 +98,33 @@ class PlayerFreeplayDJData
|
||||
{
|
||||
var assetPath:String;
|
||||
var animations:Array<AnimationData>;
|
||||
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
var applyStageMatrix:Bool;
|
||||
|
||||
@:optional
|
||||
@:default("BOYFRIEND")
|
||||
@:optional @:default("BOYFRIEND")
|
||||
var text1:String;
|
||||
|
||||
@:optional
|
||||
@:default("HOT BLOODED IN MORE WAYS THAN ONE")
|
||||
@:optional @:default("HOT BLOODED IN MORE WAYS THAN ONE")
|
||||
var text2:String;
|
||||
|
||||
@:optional
|
||||
@:default("PROTECT YO NUTS")
|
||||
@:optional @:default("PROTECT YO NUTS")
|
||||
var text3:String;
|
||||
|
||||
@:jignored
|
||||
var animationMap:Map<String, AnimationData>;
|
||||
|
||||
@:jignored
|
||||
var prefixToOffsetsMap:Map<String, Array<Float>>;
|
||||
|
||||
@:optional
|
||||
var charSelect:Null<PlayerFreeplayDJCharSelectData>;
|
||||
|
||||
@:optional
|
||||
var fistPump:Null<PlayerFreeplayDJFistPumpData>;
|
||||
|
||||
@:optional
|
||||
public var atlasSettings:funkin.data.stage.StageData.TextureAtlasData;
|
||||
|
||||
@:optional
|
||||
@:default("animateatlas")
|
||||
@:optional @:default("animateatlas")
|
||||
public var renderType:Null<String>;
|
||||
|
||||
@:optional
|
||||
@:default("")
|
||||
@:optional @:default("")
|
||||
public var scriptClass:Null<String>;
|
||||
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var useAnimatePosition:Bool;
|
||||
|
||||
@:optional
|
||||
@:default([0, 0])
|
||||
@:optional @:default([0, 0])
|
||||
var offsets:Array<Float>;
|
||||
|
||||
public function new()
|
||||
@@ -306,19 +283,15 @@ typedef PlayerCharSelectGFData =
|
||||
{
|
||||
@:optional
|
||||
public var assetPath:String;
|
||||
|
||||
@:optional
|
||||
public var animInfoPath:String;
|
||||
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var visualizer:Bool;
|
||||
}
|
||||
|
||||
typedef PlayerResultsData =
|
||||
{
|
||||
var music:PlayerResultsMusicData;
|
||||
|
||||
var perfectGold:Array<PlayerResultsAnimationData>;
|
||||
var perfect:Array<PlayerResultsAnimationData>;
|
||||
var excellent:Array<PlayerResultsAnimationData>;
|
||||
@@ -331,19 +304,14 @@ typedef PlayerResultsMusicData =
|
||||
{
|
||||
@:optional
|
||||
var PERFECT_GOLD:String;
|
||||
|
||||
@:optional
|
||||
var PERFECT:String;
|
||||
|
||||
@:optional
|
||||
var EXCELLENT:String;
|
||||
|
||||
@:optional
|
||||
var GREAT:String;
|
||||
|
||||
@:optional
|
||||
var GOOD:String;
|
||||
|
||||
@:optional
|
||||
var SHIT:String;
|
||||
}
|
||||
@@ -355,51 +323,30 @@ typedef PlayerResultsAnimationData =
|
||||
*/
|
||||
var renderType:String;
|
||||
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
var applyStageMatrix:Bool;
|
||||
|
||||
@:optional
|
||||
var assetPath:Null<String>;
|
||||
|
||||
@:optional
|
||||
var scriptClass:Null<String>;
|
||||
|
||||
@:optional
|
||||
@:default([0, 0])
|
||||
@:optional @:default([0, 0])
|
||||
var offsets:Array<Float>;
|
||||
|
||||
@:optional
|
||||
@:default("both")
|
||||
@:optional @:default("both")
|
||||
var filter:String;
|
||||
|
||||
@:optional
|
||||
@:default(500)
|
||||
@:optional @:default(500)
|
||||
var zIndex:Int;
|
||||
|
||||
@:optional
|
||||
@:default(0.0)
|
||||
@:optional @:default(0.0)
|
||||
var delay:Float;
|
||||
|
||||
@:optional
|
||||
@:default(1.0)
|
||||
@:optional @:default(1.0)
|
||||
var scale:Float;
|
||||
|
||||
@:optional
|
||||
@:default('')
|
||||
@:optional @:default('')
|
||||
var startFrameLabel:Null<String>;
|
||||
|
||||
@:optional
|
||||
@:default('')
|
||||
@:optional @:default('')
|
||||
var sound:Null<String>;
|
||||
|
||||
@:optional
|
||||
@:default(true)
|
||||
@:optional @:default(true)
|
||||
var looped:Bool;
|
||||
|
||||
@:optional
|
||||
var loopFrame:Null<Int>;
|
||||
|
||||
@:optional
|
||||
var loopFrameLabel:Null<String>;
|
||||
};
|
||||
@@ -413,25 +360,18 @@ typedef PlayerFreeplayDJFistPumpData =
|
||||
{
|
||||
@:default(0)
|
||||
var introStartFrame:Int;
|
||||
|
||||
@:default(4)
|
||||
var introEndFrame:Int;
|
||||
|
||||
@:default(4)
|
||||
var loopStartFrame:Int;
|
||||
|
||||
@:default(-1)
|
||||
var loopEndFrame:Int;
|
||||
|
||||
@:default(0)
|
||||
var introBadStartFrame:Int;
|
||||
|
||||
@:default(4)
|
||||
var introBadEndFrame:Int;
|
||||
|
||||
@:default(4)
|
||||
var loopBadStartFrame:Int;
|
||||
|
||||
@:default(-1)
|
||||
var loopBadEndFrame:Int;
|
||||
};
|
||||
|
||||
@@ -125,31 +125,22 @@ typedef NoteStyleAssetsData =
|
||||
|
||||
@:optional
|
||||
var comboNumber0:NoteStyleAssetData<NoteStyleData_ComboNum>;
|
||||
|
||||
@:optional
|
||||
var comboNumber1:NoteStyleAssetData<NoteStyleData_ComboNum>;
|
||||
|
||||
@:optional
|
||||
var comboNumber2:NoteStyleAssetData<NoteStyleData_ComboNum>;
|
||||
|
||||
@:optional
|
||||
var comboNumber3:NoteStyleAssetData<NoteStyleData_ComboNum>;
|
||||
|
||||
@:optional
|
||||
var comboNumber4:NoteStyleAssetData<NoteStyleData_ComboNum>;
|
||||
|
||||
@:optional
|
||||
var comboNumber5:NoteStyleAssetData<NoteStyleData_ComboNum>;
|
||||
|
||||
@:optional
|
||||
var comboNumber6:NoteStyleAssetData<NoteStyleData_ComboNum>;
|
||||
|
||||
@:optional
|
||||
var comboNumber7:NoteStyleAssetData<NoteStyleData_ComboNum>;
|
||||
|
||||
@:optional
|
||||
var comboNumber8:NoteStyleAssetData<NoteStyleData_ComboNum>;
|
||||
|
||||
@:optional
|
||||
var comboNumber9:NoteStyleAssetData<NoteStyleData_ComboNum>;
|
||||
}
|
||||
@@ -168,35 +159,30 @@ typedef NoteStyleAssetData<T> =
|
||||
* The scale to render the note at.
|
||||
* @default 1.0
|
||||
*/
|
||||
@:default(1.0)
|
||||
@:optional
|
||||
@:default(1.0) @:optional
|
||||
var scale:Float;
|
||||
|
||||
/**
|
||||
* Offset the sprite's position by this amount.
|
||||
* @default [0, 0]
|
||||
*/
|
||||
@:default([0, 0])
|
||||
@:optional
|
||||
@:default([0, 0]) @:optional
|
||||
var offsets:Null<Array<Float>>;
|
||||
|
||||
/**
|
||||
* If true, the note is a pixel sprite, and will be rendered without anti-aliasing.
|
||||
*/
|
||||
@:default(false)
|
||||
@:optional
|
||||
@:default(false) @:optional
|
||||
var isPixel:Bool;
|
||||
|
||||
@:default(1.0)
|
||||
@:optional
|
||||
@:default(1.0) @:optional
|
||||
var alpha:Float;
|
||||
|
||||
/**
|
||||
* If true, animations will be played on the graphic.
|
||||
* @default `false` to save performance.
|
||||
*/
|
||||
@:default(false)
|
||||
@:optional
|
||||
@:default(false) @:optional
|
||||
var animated:Bool;
|
||||
|
||||
/**
|
||||
@@ -260,31 +246,21 @@ typedef NoteStyleData_NoteSplash =
|
||||
* If false, note splashes are entirely hidden on this note style.
|
||||
* @default Note splashes are enabled.
|
||||
*/
|
||||
@:optional
|
||||
@:default(true)
|
||||
@:optional @:default(true)
|
||||
var enabled:Bool;
|
||||
|
||||
@:optional
|
||||
@:default(24)
|
||||
@:optional @:default(24)
|
||||
var framerateDefault:Int;
|
||||
|
||||
@:optional
|
||||
@:default(2)
|
||||
@:optional @:default(2)
|
||||
var framerateVariance:Int;
|
||||
|
||||
@:optional
|
||||
@:default("normal")
|
||||
@:optional @:default("normal")
|
||||
var blendMode:String;
|
||||
|
||||
@:optional
|
||||
var leftSplashes:Array<UnnamedAnimationData>;
|
||||
|
||||
@:optional
|
||||
var downSplashes:Array<UnnamedAnimationData>;
|
||||
|
||||
@:optional
|
||||
var upSplashes:Array<UnnamedAnimationData>;
|
||||
|
||||
@:optional
|
||||
var rightSplashes:Array<UnnamedAnimationData>;
|
||||
};
|
||||
@@ -295,19 +271,15 @@ typedef NoteStyleData_HoldNoteCover =
|
||||
* If false, hold note covers are entirely hidden on this note style.
|
||||
* @default Hold note covers are enabled.
|
||||
*/
|
||||
@:optional
|
||||
@:default(true)
|
||||
@:optional @:default(true)
|
||||
var enabled:Bool;
|
||||
|
||||
@:optional
|
||||
var left:NoteStyleData_HoldNoteCoverDirectionData;
|
||||
|
||||
@:optional
|
||||
var down:NoteStyleData_HoldNoteCoverDirectionData;
|
||||
|
||||
@:optional
|
||||
var up:NoteStyleData_HoldNoteCoverDirectionData;
|
||||
|
||||
@:optional
|
||||
var right:NoteStyleData_HoldNoteCoverDirectionData;
|
||||
};
|
||||
|
||||
@@ -22,25 +22,18 @@ class SongMetadata implements ICloneable<SongMetadata>
|
||||
* A semantic versioning string for the song data format.
|
||||
*
|
||||
*/
|
||||
@:jcustomparse(funkin.data.DataParse.semverVersion)
|
||||
@:jcustomwrite(funkin.data.DataWrite.semverVersion)
|
||||
@:jcustomparse(funkin.data.DataParse.semverVersion) @:jcustomwrite(funkin.data.DataWrite.semverVersion)
|
||||
public var version:Version;
|
||||
|
||||
@:default("Unknown")
|
||||
public var songName:String;
|
||||
|
||||
@:default("Unknown")
|
||||
public var artist:String;
|
||||
|
||||
@:optional
|
||||
public var charter:Null<String> = null;
|
||||
|
||||
@:optional
|
||||
@:default(96)
|
||||
@:optional @:default(96)
|
||||
public var divisions:Null<Int>; // Optional field
|
||||
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var looped:Bool;
|
||||
|
||||
/**
|
||||
@@ -56,11 +49,8 @@ class SongMetadata implements ICloneable<SongMetadata>
|
||||
public var playData:SongPlayData;
|
||||
|
||||
public var generatedBy:String;
|
||||
|
||||
@:optional
|
||||
@:default(funkin.data.song.SongData.SongTimeFormat.MILLISECONDS)
|
||||
@:optional @:default(funkin.data.song.SongData.SongTimeFormat.MILLISECONDS)
|
||||
public var timeFormat:SongTimeFormat;
|
||||
|
||||
public var timeChanges:Array<SongTimeChange>;
|
||||
|
||||
/**
|
||||
@@ -167,9 +157,7 @@ enum abstract SongTimeFormat(String) from String to String
|
||||
class SongTimeChange implements ICloneable<SongTimeChange>
|
||||
{
|
||||
public static final DEFAULT_SONGTIMECHANGE:SongTimeChange = new SongTimeChange(0, 100);
|
||||
|
||||
public static final DEFAULT_SONGTIMECHANGES:Array<SongTimeChange> = [DEFAULT_SONGTIMECHANGE];
|
||||
|
||||
static final DEFAULT_BEAT_TUPLETS:Array<Int> = [4, 4, 4, 4];
|
||||
static final DEFAULT_BEAT_TIME:Null<Float> = null; // Later, null gets detected and recalculated.
|
||||
|
||||
@@ -183,8 +171,7 @@ class SongTimeChange implements ICloneable<SongTimeChange>
|
||||
* Time in beats (int). The game will calculate further beat values based on this one,
|
||||
* so it can do it in a simple linear fashion.
|
||||
*/
|
||||
@:optional
|
||||
@:alias("b")
|
||||
@:optional @:alias("b")
|
||||
public var beatTime:Float;
|
||||
|
||||
/**
|
||||
@@ -197,17 +184,13 @@ class SongTimeChange implements ICloneable<SongTimeChange>
|
||||
/**
|
||||
* Time signature numerator (int). Optional, defaults to 4.
|
||||
*/
|
||||
@:default(4)
|
||||
@:optional
|
||||
@:alias("n")
|
||||
@:default(4) @:optional @:alias("n")
|
||||
public var timeSignatureNum:Int;
|
||||
|
||||
/**
|
||||
* Time signature denominator (int). Optional, defaults to 4. Should only ever be a power of two.
|
||||
*/
|
||||
@:default(4)
|
||||
@:optional
|
||||
@:alias("d")
|
||||
@:default(4) @:optional @:alias("d")
|
||||
public var timeSignatureDen:Int;
|
||||
|
||||
/**
|
||||
@@ -215,8 +198,7 @@ class SongTimeChange implements ICloneable<SongTimeChange>
|
||||
* It can either be an array of length `n` (see above) or a single integer number.
|
||||
* Optional, defaults to `[4]`.
|
||||
*/
|
||||
@:optional
|
||||
@:alias("bt")
|
||||
@:optional @:alias("bt")
|
||||
public var beatTuplets:Array<Int>;
|
||||
|
||||
public function new(timeStamp:Float, bpm:Float, timeSignatureNum:Int = 4, timeSignatureDen:Int = 4, ?beatTime:Float, ?beatTuplets:Array<Int>)
|
||||
@@ -259,31 +241,27 @@ class SongOffsets implements ICloneable<SongOffsets>
|
||||
* Setting this to `-5000.0` means the chart start 5 seconds into the song.
|
||||
* Setting this to `5000.0` means there will be 5 seconds of silence before the song starts.
|
||||
*/
|
||||
@:optional
|
||||
@:default(0)
|
||||
@:optional @:default(0)
|
||||
public var instrumental:Float;
|
||||
|
||||
/**
|
||||
* Apply different offsets to different alternate instrumentals.
|
||||
*/
|
||||
@:optional
|
||||
@:default([])
|
||||
@:optional @:default([])
|
||||
public var altInstrumentals:Map<String, Float>;
|
||||
|
||||
/**
|
||||
* The offset, in milliseconds, to apply to the song's vocals, relative to the song's base instrumental.
|
||||
* These are applied ON TOP OF the instrumental offset.
|
||||
*/
|
||||
@:optional
|
||||
@:default([])
|
||||
@:optional @:default([])
|
||||
public var vocals:Map<String, Float>;
|
||||
|
||||
/**
|
||||
* The offset, in milliseconds, to apply to the songs vocals, relative to each alternate instrumental.
|
||||
* This is useful for the circumstance where, for example, an alt instrumental has a few seconds of lead in before the song starts.
|
||||
*/
|
||||
@:optional
|
||||
@:default([])
|
||||
@:optional @:default([])
|
||||
public var altVocals:Map<String, Map<String, Float>>;
|
||||
|
||||
public function new(instrumental:Float = 0.0, ?altInstrumentals:Map<String, Float>, ?vocals:Map<String, Float>, ?altVocals:Map<String, Map<String, Float>>)
|
||||
@@ -365,30 +343,21 @@ class SongMusicData implements ICloneable<SongMusicData>
|
||||
* A semantic versioning string for the song data format.
|
||||
*
|
||||
*/
|
||||
@:jcustomparse(funkin.data.DataParse.semverVersion)
|
||||
@:jcustomwrite(funkin.data.DataWrite.semverVersion)
|
||||
@:jcustomparse(funkin.data.DataParse.semverVersion) @:jcustomwrite(funkin.data.DataWrite.semverVersion)
|
||||
public var version:Version;
|
||||
|
||||
@:default("Unknown")
|
||||
public var songName:String;
|
||||
|
||||
@:default("Unknown")
|
||||
public var artist:String;
|
||||
|
||||
@:optional
|
||||
@:default(96)
|
||||
@:optional @:default(96)
|
||||
public var divisions:Null<Int>; // Optional field
|
||||
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var looped:Null<Bool>;
|
||||
|
||||
// @:default(funkin.data.song.SongRegistry.DEFAULT_GENERATEDBY)
|
||||
public var generatedBy:String;
|
||||
|
||||
// @:default(funkin.data.song.SongData.SongTimeFormat.MILLISECONDS)
|
||||
public var timeFormat:SongTimeFormat;
|
||||
|
||||
// @:default(funkin.data.song.SongData.SongTimeChange.DEFAULT_SONGTIMECHANGES)
|
||||
public var timeChanges:Array<SongTimeChange>;
|
||||
|
||||
@@ -445,8 +414,7 @@ class SongPlayData implements ICloneable<SongPlayData>
|
||||
/**
|
||||
* The variations this song has. The associated metadata files should exist.
|
||||
*/
|
||||
@:default([])
|
||||
@:optional
|
||||
@:default([]) @:optional
|
||||
public var songVariations:Array<String>;
|
||||
|
||||
/**
|
||||
@@ -473,9 +441,7 @@ class SongPlayData implements ICloneable<SongPlayData>
|
||||
* The difficulty ratings for this song as displayed in Freeplay.
|
||||
* Key is a difficulty ID.
|
||||
*/
|
||||
@:optional
|
||||
@:default(['normal' => 0])
|
||||
@:order(funkin.util.Constants.DEFAULT_DIFFICULTY_LIST_FULL)
|
||||
@:optional @:default(['normal' => 0]) @:order(funkin.util.Constants.DEFAULT_DIFFICULTY_LIST_FULL)
|
||||
public var ratings:Map<String, Int>;
|
||||
|
||||
/**
|
||||
@@ -497,8 +463,7 @@ class SongPlayData implements ICloneable<SongPlayData>
|
||||
* Defaults to 0 seconds in.
|
||||
* @since `2.2.2`
|
||||
*/
|
||||
@:optional
|
||||
@:default(funkin.util.Constants.DEFAULT_PREVIEW_START_TIME)
|
||||
@:optional @:default(funkin.util.Constants.DEFAULT_PREVIEW_START_TIME)
|
||||
public var previewStart:Float;
|
||||
|
||||
/**
|
||||
@@ -506,8 +471,7 @@ class SongPlayData implements ICloneable<SongPlayData>
|
||||
* Defaults to 20% seconds in.
|
||||
* @since `2.2.2`
|
||||
*/
|
||||
@:optional
|
||||
@:default(funkin.util.Constants.DEFAULT_PREVIEW_END_TIME)
|
||||
@:optional @:default(funkin.util.Constants.DEFAULT_PREVIEW_END_TIME)
|
||||
public var previewEnd:Float;
|
||||
|
||||
public function new()
|
||||
@@ -547,29 +511,18 @@ class SongPlayData implements ICloneable<SongPlayData>
|
||||
*/
|
||||
class SongCharacterData implements ICloneable<SongCharacterData>
|
||||
{
|
||||
@:optional
|
||||
@:default('')
|
||||
@:optional @:default('')
|
||||
public var player:String = '';
|
||||
|
||||
@:optional
|
||||
@:default('')
|
||||
@:optional @:default('')
|
||||
public var girlfriend:String = '';
|
||||
|
||||
@:optional
|
||||
@:default('')
|
||||
@:optional @:default('')
|
||||
public var opponent:String = '';
|
||||
|
||||
@:optional
|
||||
@:default('')
|
||||
@:optional @:default('')
|
||||
public var instrumental:String = '';
|
||||
|
||||
@:optional
|
||||
@:default([])
|
||||
@:optional @:default([])
|
||||
public var altInstrumentals:Array<String> = [];
|
||||
|
||||
@:optional
|
||||
public var opponentVocals:Null<Array<String>> = null;
|
||||
|
||||
@:optional
|
||||
public var playerVocals:Null<Array<String>> = null;
|
||||
|
||||
@@ -608,16 +561,13 @@ class SongCharacterData implements ICloneable<SongCharacterData>
|
||||
|
||||
class SongChartData implements ICloneable<SongChartData>
|
||||
{
|
||||
@:jcustomparse(funkin.data.DataParse.semverVersion)
|
||||
@:jcustomwrite(funkin.data.DataWrite.semverVersion)
|
||||
@:jcustomparse(funkin.data.DataParse.semverVersion) @:jcustomwrite(funkin.data.DataWrite.semverVersion)
|
||||
public var version:Version;
|
||||
|
||||
@:order(funkin.util.Constants.DEFAULT_DIFFICULTY_LIST_FULL)
|
||||
public var scrollSpeed:Map<String, Float>;
|
||||
public var events:Array<SongEventData>;
|
||||
@:order(funkin.util.Constants.DEFAULT_DIFFICULTY_LIST_FULL)
|
||||
public var notes:Map<String, Array<SongNoteData>>;
|
||||
|
||||
public var generatedBy:String;
|
||||
|
||||
/**
|
||||
@@ -744,10 +694,7 @@ class SongEventDataRaw implements ICloneable<SongEventDataRaw>
|
||||
* This can allow the event to include information used for custom behavior.
|
||||
* Data type depends on the event kind. It can be anything that's JSON serializable.
|
||||
*/
|
||||
@:alias("v")
|
||||
@:optional
|
||||
@:jcustomparse(funkin.data.DataParse.dynamicValue)
|
||||
@:jcustomwrite(funkin.data.DataWrite.dynamicValue)
|
||||
@:alias("v") @:optional @:jcustomparse(funkin.data.DataParse.dynamicValue) @:jcustomwrite(funkin.data.DataWrite.dynamicValue)
|
||||
public var value:Dynamic = null;
|
||||
|
||||
/**
|
||||
@@ -1117,9 +1064,7 @@ class SongNoteDataRaw implements ICloneable<SongNoteDataRaw>
|
||||
* Length of the note, if applicable.
|
||||
* Defaults to 0 for single notes.
|
||||
*/
|
||||
@:alias("l")
|
||||
@:default(0)
|
||||
@:optional
|
||||
@:alias("l") @:default(0) @:optional
|
||||
public var length(default, set):Float;
|
||||
|
||||
function set_length(value:Float):Float
|
||||
@@ -1133,9 +1078,7 @@ class SongNoteDataRaw implements ICloneable<SongNoteDataRaw>
|
||||
* This can allow the note to include information used for custom behavior.
|
||||
* Defaults to `null` for no kind.
|
||||
*/
|
||||
@:alias("k")
|
||||
@:optional
|
||||
@:isVar
|
||||
@:alias("k") @:optional @:isVar
|
||||
public var kind(get, set):Null<String> = null;
|
||||
|
||||
function get_kind():Null<String>
|
||||
@@ -1155,9 +1098,7 @@ class SongNoteDataRaw implements ICloneable<SongNoteDataRaw>
|
||||
* The parameters for the note.
|
||||
* Used for custom behavior on custom note kinds. Defaults to an empty array.
|
||||
*/
|
||||
@:alias("p")
|
||||
@:default([])
|
||||
@:optional
|
||||
@:alias("p") @:default([]) @:optional
|
||||
public var params:Array<NoteParamData>;
|
||||
|
||||
public function new(time:Float, data:Int, length:Float = 0, kind:String = '', ?params:Array<NoteParamData>)
|
||||
@@ -1472,10 +1413,7 @@ class NoteParamData implements ICloneable<NoteParamData>
|
||||
{
|
||||
@:alias("n")
|
||||
public var name:String;
|
||||
|
||||
@:alias("v")
|
||||
@:jcustomparse(funkin.data.DataParse.dynamicValue)
|
||||
@:jcustomwrite(funkin.data.DataWrite.dynamicValue)
|
||||
@:alias("v") @:jcustomparse(funkin.data.DataParse.dynamicValue) @:jcustomwrite(funkin.data.DataWrite.dynamicValue)
|
||||
public var value:Dynamic;
|
||||
|
||||
public function new(name:String, value:Dynamic)
|
||||
|
||||
@@ -33,7 +33,10 @@ class SongDataUtils
|
||||
return new SongNoteData(time, data, length, kind);
|
||||
};
|
||||
|
||||
var result = [for (i in 0...notes.length) offsetNote(notes[i])];
|
||||
var result = [
|
||||
for (i in 0...notes.length)
|
||||
offsetNote(notes[i])
|
||||
];
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ import funkin.data.DefaultRegistryImpl;
|
||||
|
||||
using funkin.data.song.migrator.SongDataMigrator;
|
||||
|
||||
@:nullSafety class SongRegistry extends BaseRegistry<Song, SongMetadata, SongEntryParams> implements ISingleton implements DefaultRegistryImpl
|
||||
@:nullSafety
|
||||
class SongRegistry extends BaseRegistry<Song, SongMetadata, SongEntryParams> implements ISingleton implements DefaultRegistryImpl
|
||||
{
|
||||
/**
|
||||
* The current version string for the stage data format.
|
||||
@@ -25,15 +26,10 @@ using funkin.data.song.migrator.SongDataMigrator;
|
||||
public static final SONG_METADATA_VERSION:thx.semver.Version = "2.2.4";
|
||||
|
||||
public static final SONG_METADATA_VERSION_RULE:thx.semver.VersionRule = "2.2.x";
|
||||
|
||||
public static final SONG_CHART_DATA_VERSION:thx.semver.Version = "2.0.0";
|
||||
|
||||
public static final SONG_CHART_DATA_VERSION_RULE:thx.semver.VersionRule = "2.0.x";
|
||||
|
||||
public static final SONG_MUSIC_DATA_VERSION:thx.semver.Version = "2.0.0";
|
||||
|
||||
public static final SONG_MUSIC_DATA_VERSION_RULE:thx.semver.VersionRule = "2.0.x";
|
||||
|
||||
public static var DEFAULT_GENERATEDBY(get, never):String;
|
||||
|
||||
public var scriptedSongVariations:Map<String, Song> = new Map<String, Song>();
|
||||
|
||||
@@ -12,8 +12,7 @@ class ChartManifestData
|
||||
|
||||
public static final invalidIdRegex:EReg = ~/[\/\\:*?"<>|]/g;
|
||||
|
||||
@:jcustomparse(funkin.data.DataParse.semverVersion)
|
||||
@:jcustomwrite(funkin.data.DataWrite.semverVersion)
|
||||
@:jcustomparse(funkin.data.DataParse.semverVersion) @:jcustomwrite(funkin.data.DataWrite.semverVersion)
|
||||
public var version:thx.semver.Version;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,13 +16,11 @@ class LegacySongData
|
||||
{
|
||||
public var player1:String; // Boyfriend
|
||||
public var player2:String; // Opponent
|
||||
|
||||
@:jcustomparse(funkin.data.DataParse.eitherLegacyScrollSpeeds)
|
||||
public var speed:Either<Float, LegacyScrollSpeeds>;
|
||||
@:optional
|
||||
public var stageDefault:Null<String>;
|
||||
public var bpm:Float;
|
||||
|
||||
@:jcustomparse(funkin.data.DataParse.eitherLegacyNoteData)
|
||||
public var notes:Either<Array<LegacyNoteSection>, LegacyNoteData>;
|
||||
public var song:String; // Song name
|
||||
@@ -35,7 +33,8 @@ class LegacySongData
|
||||
{
|
||||
var notesStr:String = switch (notes)
|
||||
{
|
||||
case Left(sections): 'single difficulty w/ ${sections.length} sections';
|
||||
case Left(sections):
|
||||
'single difficulty w/ ${sections.length} sections';
|
||||
case Right(data):
|
||||
var difficultyCount:Int = 0;
|
||||
if (data.easy != null) difficultyCount++;
|
||||
@@ -91,9 +90,7 @@ typedef LegacyNoteSection =
|
||||
public var sectionNotes:Array<LegacyNote>;
|
||||
|
||||
public var ?typeOfSection:Int;
|
||||
|
||||
public var ?lengthInSteps:Int;
|
||||
|
||||
// BPM changes
|
||||
public var ?changeBPM:Bool;
|
||||
public var ?bpm:Float;
|
||||
|
||||
@@ -129,7 +129,9 @@ class OsuManiaImporter
|
||||
trace('Migrating song chart data from Osu!Mania.');
|
||||
|
||||
// Osu!Mania doesn't have a scroll speed variable as its controlled by the player
|
||||
var songChartData:SongChartData = new SongChartData([difficulty => Constants.DEFAULT_SCROLLSPEED], [], [difficulty => []]);
|
||||
var songChartData:SongChartData = new SongChartData([
|
||||
difficulty => Constants.DEFAULT_SCROLLSPEED
|
||||
], [], [difficulty => []]);
|
||||
|
||||
// songData.HitObjects is a Array<String> here so im casting it so haxe stops yelling at me
|
||||
var osuNotes:Array<ManiaHitObject> = parseManiaHitObjects(cast songData.HitObjects, songData.Difficulty.CircleSize);
|
||||
|
||||
@@ -69,7 +69,6 @@ class StepDifficulty
|
||||
public var charter:String;
|
||||
public var difficultyRating:Int;
|
||||
public var type:StepManiaChartType;
|
||||
|
||||
public var notes:Array<StepNote>;
|
||||
|
||||
public function parseChartType(chartTypeStr:String):StepManiaChartType
|
||||
@@ -111,11 +110,11 @@ class StepTimingPoint
|
||||
|
||||
// Not implemented, but if any chart uses them then the chart will break.
|
||||
// IE this messes with the timing of the notes.
|
||||
|
||||
class StepStop
|
||||
{
|
||||
public var startBeat:Float = Math.NEGATIVE_INFINITY;
|
||||
public var duration:Float = 0;
|
||||
|
||||
public var startTimestamp:Float = Math.NEGATIVE_INFINITY;
|
||||
|
||||
public function new(startBeat:Float, duration:Float)
|
||||
|
||||
@@ -492,7 +492,16 @@ class StepManiaImporter
|
||||
}
|
||||
else if (type == StepManiaChartType.DanceDouble)
|
||||
{
|
||||
holdArray = [-1, -1, -1, -1, -1, -1, -1, -1];
|
||||
holdArray = [
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1
|
||||
];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -17,36 +17,25 @@ class SongMetadata_v2_0_0
|
||||
/**
|
||||
* In metadata `v2.1.0`, `variation` was set to `ignore` when writing.
|
||||
*/
|
||||
@:optional
|
||||
@:default('default')
|
||||
@:optional @:default('default')
|
||||
public var variation:String;
|
||||
|
||||
// ==========
|
||||
// UNMODIFIED VALUES
|
||||
// ==========
|
||||
@:jcustomparse(funkin.data.DataParse.semverVersion)
|
||||
@:jcustomwrite(funkin.data.DataWrite.semverVersion)
|
||||
@:jcustomparse(funkin.data.DataParse.semverVersion) @:jcustomwrite(funkin.data.DataWrite.semverVersion)
|
||||
public var version:Version;
|
||||
|
||||
@:default("Unknown")
|
||||
public var songName:String;
|
||||
|
||||
@:default("Unknown")
|
||||
public var artist:String;
|
||||
|
||||
@:optional
|
||||
@:default(96)
|
||||
@:optional @:default(96)
|
||||
public var divisions:Null<Int>; // Optional field
|
||||
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var looped:Bool;
|
||||
|
||||
@:default(funkin.data.song.SongRegistry.DEFAULT_GENERATEDBY)
|
||||
public var generatedBy:String;
|
||||
|
||||
public var timeFormat:SongData.SongTimeFormat;
|
||||
|
||||
public var timeChanges:Array<SongData.SongTimeChange>;
|
||||
|
||||
public function new()
|
||||
@@ -83,11 +72,9 @@ class SongPlayData_v2_0_0
|
||||
// ==========
|
||||
// UNMODIFIED VALUES
|
||||
// ==========
|
||||
@:default([])
|
||||
@:optional
|
||||
@:default([]) @:optional
|
||||
public var songVariations:Array<String>;
|
||||
public var difficulties:Array<String>;
|
||||
|
||||
public var stage:String;
|
||||
|
||||
public function new()
|
||||
@@ -105,19 +92,11 @@ class SongPlayData_v2_0_0
|
||||
|
||||
class SongPlayableChar_v2_0_0
|
||||
{
|
||||
@:alias('g')
|
||||
@:optional
|
||||
@:default('')
|
||||
@:alias('g') @:optional @:default('')
|
||||
public var girlfriend:String = '';
|
||||
|
||||
@:alias('o')
|
||||
@:optional
|
||||
@:default('')
|
||||
@:alias('o') @:optional @:default('')
|
||||
public var opponent:String = '';
|
||||
|
||||
@:alias('i')
|
||||
@:optional
|
||||
@:default('')
|
||||
@:alias('i') @:optional @:default('')
|
||||
public var inst:String = '';
|
||||
|
||||
public function new(girlfriend:String = '', opponent:String = '', inst:String = '')
|
||||
|
||||
@@ -21,29 +21,19 @@ class SongMetadata_v2_1_0
|
||||
// ==========
|
||||
// UNMODIFIED VALUES
|
||||
// ==========
|
||||
@:jcustomparse(funkin.data.DataParse.semverVersion)
|
||||
@:jcustomwrite(funkin.data.DataWrite.semverVersion)
|
||||
@:jcustomparse(funkin.data.DataParse.semverVersion) @:jcustomwrite(funkin.data.DataWrite.semverVersion)
|
||||
public var version:Version;
|
||||
|
||||
@:default("Unknown")
|
||||
public var songName:String;
|
||||
|
||||
@:default("Unknown")
|
||||
public var artist:String;
|
||||
|
||||
@:optional
|
||||
@:default(96)
|
||||
@:optional @:default(96)
|
||||
public var divisions:Null<Int>; // Optional field
|
||||
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
public var looped:Bool;
|
||||
|
||||
@:default(funkin.data.song.SongRegistry.DEFAULT_GENERATEDBY)
|
||||
public var generatedBy:String;
|
||||
|
||||
public var timeFormat:SongData.SongTimeFormat;
|
||||
|
||||
public var timeChanges:Array<SongData.SongTimeChange>;
|
||||
|
||||
/**
|
||||
@@ -93,8 +83,7 @@ class SongPlayData_v2_1_0
|
||||
// ==========
|
||||
// UNMODIFIED VALUES
|
||||
// ==========
|
||||
@:default([])
|
||||
@:optional
|
||||
@:default([]) @:optional
|
||||
public var songVariations:Array<String>;
|
||||
public var difficulties:Array<String>;
|
||||
public var characters:SongData.SongCharacterData;
|
||||
|
||||
@@ -15,13 +15,9 @@ class StageData
|
||||
public var name:String = 'Unknown';
|
||||
public var props:Array<StageDataProp> = [];
|
||||
public var characters:StageDataCharacters;
|
||||
|
||||
@:default(1.0)
|
||||
@:optional
|
||||
@:default(1.0) @:optional
|
||||
public var cameraZoom:Null<Float>;
|
||||
|
||||
@:default("shared")
|
||||
@:optional
|
||||
@:default("shared") @:optional
|
||||
public var directory:Null<String>;
|
||||
|
||||
public function new()
|
||||
@@ -106,8 +102,7 @@ typedef StageDataProp =
|
||||
* This is just like CSS, it isn't hard.
|
||||
* @default 0
|
||||
*/
|
||||
@:optional
|
||||
@:default(0)
|
||||
@:optional @:default(0)
|
||||
var zIndex:Int;
|
||||
|
||||
/**
|
||||
@@ -115,42 +110,35 @@ typedef StageDataProp =
|
||||
* This prevents blurry images on pixel-art levels.
|
||||
* @default false
|
||||
*/
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
var isPixel:Bool;
|
||||
|
||||
/**
|
||||
* If set to true, the prop will be flipped horizontally.
|
||||
* @default false
|
||||
*/
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
var flipX:Bool;
|
||||
|
||||
/**
|
||||
* If set to true, the prop will be flipped vertically.
|
||||
* @default false
|
||||
*/
|
||||
@:optional
|
||||
@:default(false)
|
||||
@:optional @:default(false)
|
||||
var flipY:Bool;
|
||||
|
||||
/**
|
||||
* Either the scale of the prop as a float, or the [w, h] scale as an array of two floats.
|
||||
* Pro tip: On pixel-art levels, save the sprite small and set this value to 6 or so to save memory.
|
||||
*/
|
||||
@:jcustomparse(funkin.data.DataParse.eitherFloatOrFloats)
|
||||
@:jcustomwrite(funkin.data.DataWrite.eitherFloatOrFloats)
|
||||
@:optional
|
||||
@:default(Left(1.0))
|
||||
@:jcustomparse(funkin.data.DataParse.eitherFloatOrFloats) @:jcustomwrite(funkin.data.DataWrite.eitherFloatOrFloats) @:optional @:default(Left(1.0))
|
||||
var scale:haxe.ds.Either<Float, Array<Float>>;
|
||||
|
||||
/**
|
||||
* The alpha of the prop, as a float.
|
||||
* @default 1.0
|
||||
*/
|
||||
@:optional
|
||||
@:default(1.0)
|
||||
@:optional @:default(1.0)
|
||||
var alpha:Float;
|
||||
|
||||
/**
|
||||
@@ -160,8 +148,7 @@ typedef StageDataProp =
|
||||
* Supports up to 0.25 precision.
|
||||
* @default 0.0
|
||||
*/
|
||||
@:default(0.0)
|
||||
@:optional
|
||||
@:default(0.0) @:optional
|
||||
var danceEvery:Float;
|
||||
|
||||
/**
|
||||
@@ -172,16 +159,14 @@ typedef StageDataProp =
|
||||
* [0, 0] means the prop is not moved.
|
||||
* @default [1, 1]
|
||||
*/
|
||||
@:optional
|
||||
@:default([1, 1])
|
||||
@:optional @:default([1, 1])
|
||||
var scroll:Array<Float>;
|
||||
|
||||
/**
|
||||
* An optional array of animations which the prop can play.
|
||||
* @default Prop has no animations.
|
||||
*/
|
||||
@:optional
|
||||
@:default([])
|
||||
@:optional @:default([])
|
||||
var animations:Array<AnimationData>;
|
||||
|
||||
/**
|
||||
@@ -196,16 +181,14 @@ typedef StageDataProp =
|
||||
* Options: "sparrow", "packer", "animateatlas"
|
||||
* @default "sparrow"
|
||||
*/
|
||||
@:default("sparrow")
|
||||
@:optional
|
||||
@:default("sparrow") @:optional
|
||||
var animType:String;
|
||||
|
||||
/**
|
||||
* The angle of the prop, as a float.
|
||||
* @default 0.0
|
||||
*/
|
||||
@:optional
|
||||
@:default(0.0)
|
||||
@:optional @:default(0.0)
|
||||
var angle:Float;
|
||||
|
||||
/**
|
||||
@@ -213,8 +196,7 @@ typedef StageDataProp =
|
||||
* Just like in photoshop.
|
||||
* @default Nothing.
|
||||
*/
|
||||
@:default("")
|
||||
@:optional
|
||||
@:default("") @:optional
|
||||
var blend:String;
|
||||
|
||||
/**
|
||||
@@ -222,8 +204,7 @@ typedef StageDataProp =
|
||||
* White overlays, or the ones with the value #FFFFFF, do not appear.
|
||||
* @default `#FFFFFF`
|
||||
*/
|
||||
@:default("#FFFFFF")
|
||||
@:optional
|
||||
@:default("#FFFFFF") @:optional
|
||||
var color:String;
|
||||
|
||||
/**
|
||||
@@ -291,22 +272,19 @@ typedef StageDataCharacter =
|
||||
* Again, just like CSS.
|
||||
* @default 0
|
||||
*/
|
||||
@:optional
|
||||
@:default(0)
|
||||
@:optional @:default(0)
|
||||
var zIndex:Int;
|
||||
|
||||
/**
|
||||
* The position to render the character at.
|
||||
*/
|
||||
@:optional
|
||||
@:default([0, 0])
|
||||
@:optional @:default([0, 0])
|
||||
var position:Array<Float>;
|
||||
|
||||
/**
|
||||
* The scale to render the character at.
|
||||
*/
|
||||
@:optional
|
||||
@:default(1)
|
||||
@:optional @:default(1)
|
||||
var scale:Float;
|
||||
|
||||
/**
|
||||
@@ -324,23 +302,20 @@ typedef StageDataCharacter =
|
||||
* [0, 0] means the character is not moved.
|
||||
* @default [1, 1]
|
||||
*/
|
||||
@:optional
|
||||
@:default([1, 1])
|
||||
@:optional @:default([1, 1])
|
||||
var scroll:Array<Float>;
|
||||
|
||||
/**
|
||||
* The alpha of the character, as a float.
|
||||
* @default 1.0
|
||||
*/
|
||||
@:optional
|
||||
@:default(1.0)
|
||||
@:optional @:default(1.0)
|
||||
var alpha:Float;
|
||||
|
||||
/**
|
||||
* The angle of the character, as a float.
|
||||
* @default 0.0
|
||||
*/
|
||||
@:optional
|
||||
@:default(0.0)
|
||||
@:optional @:default(0.0)
|
||||
var angle:Float;
|
||||
};
|
||||
|
||||
@@ -15,7 +15,6 @@ class StickerRegistry extends BaseRegistry<StickerPack, StickerData, StickerEntr
|
||||
public static final STICKER_DATA_VERSION:thx.semver.Version = '1.0.0';
|
||||
|
||||
public static final STICKER_DATA_VERSION_RULE:thx.semver.VersionRule = '1.0.x';
|
||||
|
||||
public static final instance:StickerRegistry = new StickerRegistry();
|
||||
|
||||
public function new()
|
||||
|
||||
@@ -45,8 +45,7 @@ typedef LevelData =
|
||||
* Whether this week is visible in the story menu.
|
||||
* @default `true`
|
||||
*/
|
||||
@:default(true)
|
||||
@:optional
|
||||
@:default(true) @:optional
|
||||
var visible:Bool;
|
||||
|
||||
/**
|
||||
@@ -58,8 +57,7 @@ typedef LevelData =
|
||||
/**
|
||||
* The background for the level behind the props.
|
||||
*/
|
||||
@:default('#F9CF51')
|
||||
@:optional
|
||||
@:default('#F9CF51') @:optional
|
||||
var background:String;
|
||||
}
|
||||
|
||||
@@ -95,23 +93,20 @@ typedef LevelPropData =
|
||||
* The scale to render the prop at.
|
||||
* @default 1.0
|
||||
*/
|
||||
@:default(1.0)
|
||||
@:optional
|
||||
@:default(1.0) @:optional
|
||||
var scale:Float;
|
||||
|
||||
/**
|
||||
* The opacity to render the prop at.
|
||||
* @default 1.0
|
||||
*/
|
||||
@:default(1.0)
|
||||
@:optional
|
||||
@:default(1.0) @:optional
|
||||
var alpha:Float;
|
||||
|
||||
/**
|
||||
* If true, the prop is a pixel sprite, and will be rendered without smoothing.
|
||||
*/
|
||||
@:default(false)
|
||||
@:optional
|
||||
@:default(false) @:optional
|
||||
var isPixel:Bool;
|
||||
|
||||
/**
|
||||
@@ -120,45 +115,39 @@ typedef LevelPropData =
|
||||
* Supports up to 0.25 precision.
|
||||
* @default 1.0
|
||||
*/
|
||||
@:default(1.0)
|
||||
@:optional
|
||||
@:default(1.0) @:optional
|
||||
var danceEvery:Float;
|
||||
|
||||
/**
|
||||
* The offset on the position to render the prop at.
|
||||
* @default [0.0, 0.0]
|
||||
*/
|
||||
@:default([0, 0])
|
||||
@:optional
|
||||
@:default([0, 0]) @:optional
|
||||
var offsets:Array<Float>;
|
||||
|
||||
/**
|
||||
* A set of animations to play on the prop.
|
||||
* If default/empty, the prop will be static.
|
||||
*/
|
||||
@:default([])
|
||||
@:optional
|
||||
@:default([]) @:optional
|
||||
var animations:Array<AnimationData>;
|
||||
|
||||
/**
|
||||
* If animations are used, this is the name of the animation to play first.
|
||||
* @default idle
|
||||
*/
|
||||
@:default('')
|
||||
@:optional
|
||||
@:default('') @:optional
|
||||
var startingAnimation:String;
|
||||
|
||||
/**
|
||||
* Flips the sprite on X axis.
|
||||
*/
|
||||
@:default(false)
|
||||
@:optional
|
||||
@:default(false) @:optional
|
||||
var flipX:Null<Bool>;
|
||||
|
||||
/**
|
||||
* Flips the sprite on Y axis.
|
||||
*/
|
||||
@:default(false)
|
||||
@:optional
|
||||
@:default(false) @:optional
|
||||
var flipY:Null<Bool>;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,18 @@ class LevelRegistry extends BaseRegistry<Level, LevelData, LevelEntryParams> imp
|
||||
{
|
||||
// This MUST be hard-coded (overriding the auto-generated method)
|
||||
// because the auto-generated method spits out values in alphabetical order.
|
||||
return ['tutorial', 'week1', 'week2', 'week3', 'week4', 'week5', 'week6', 'week7', 'weekend1', 'sserafim'];
|
||||
return [
|
||||
'tutorial',
|
||||
'week1',
|
||||
'week2',
|
||||
'week3',
|
||||
'week4',
|
||||
'week5',
|
||||
'week6',
|
||||
'week7',
|
||||
'weekend1',
|
||||
'sserafim'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -193,7 +193,6 @@ class IntervalShake implements IFlxDestroyable
|
||||
}
|
||||
|
||||
public var _secondsSinceStart(default, null):Float = 0;
|
||||
|
||||
public var scale(default, null):Float = 0;
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,7 +41,9 @@ class RetroCameraFade
|
||||
0, 0, 1, 0, 1.0 * 255,
|
||||
0, 0, 0, 1, 0
|
||||
];
|
||||
camera.filters = [new ColorMatrixFilter(matrixDerp)];
|
||||
camera.filters = [
|
||||
new ColorMatrixFilter(matrixDerp)
|
||||
];
|
||||
|
||||
new FlxTimer().start(time / stepsTotal, _ ->
|
||||
{
|
||||
@@ -91,7 +93,9 @@ class RetroCameraFade
|
||||
0, 0, 1, 0, -1.0 * 255,
|
||||
0, 0, 0, 1, 0
|
||||
];
|
||||
camera.filters = [new ColorMatrixFilter(matrixDerp)];
|
||||
camera.filters = [
|
||||
new ColorMatrixFilter(matrixDerp)
|
||||
];
|
||||
|
||||
new FlxTimer().start(time / stepsTotal, _ ->
|
||||
{
|
||||
|
||||
@@ -52,7 +52,6 @@ class CallbackUtil #if (lime >= "8.0.0") implements JNISafety #end
|
||||
|
||||
@:noCompletion
|
||||
private static var __staticFields:Array<Dynamic> = null;
|
||||
|
||||
@:noCompletion
|
||||
public static var __callbacksFields:Map<String, Dynamic> = new Map<String, Dynamic>();
|
||||
|
||||
|
||||
-3
@@ -10,13 +10,10 @@ class JNIUtil
|
||||
{
|
||||
@:noCompletion
|
||||
private static var staticMethodCache:Map<String, Dynamic> = [];
|
||||
|
||||
@:noCompletion
|
||||
private static var memberMethodCache:Map<String, Dynamic> = [];
|
||||
|
||||
@:noCompletion
|
||||
private static var staticFieldCache:Map<String, JNIStaticField> = [];
|
||||
|
||||
@:noCompletion
|
||||
private static var memberFieldCache:Map<String, JNIMemberField> = [];
|
||||
|
||||
|
||||
+1
-3
@@ -4,9 +4,7 @@ package funkin.external.apple;
|
||||
/**
|
||||
* A utility class to manage the audio session on apple devices.
|
||||
*/
|
||||
@:build(funkin.util.macro.LinkerMacro.xml('project/Build.xml'))
|
||||
@:include('AudioSession.hpp')
|
||||
@:unreflective
|
||||
@:build(funkin.util.macro.LinkerMacro.xml('project/Build.xml')) @:include('AudioSession.hpp') @:unreflective
|
||||
extern class AudioSession
|
||||
{
|
||||
/**
|
||||
|
||||
+1
-3
@@ -4,9 +4,7 @@ package funkin.external.apple;
|
||||
/**
|
||||
* A utility class for FNFC loading on apple devices.
|
||||
*/
|
||||
@:build(funkin.util.macro.LinkerMacro.xml('project/Build.xml'))
|
||||
@:include('FNFCExtern.hpp')
|
||||
@:unreflective
|
||||
@:build(funkin.util.macro.LinkerMacro.xml('project/Build.xml')) @:include('FNFCExtern.hpp') @:unreflective
|
||||
extern class FNFCExtern
|
||||
{
|
||||
/**
|
||||
|
||||
+1
-3
@@ -4,9 +4,7 @@ package funkin.external.apple;
|
||||
/**
|
||||
* A utility class to get information about the mem usage.
|
||||
*/
|
||||
@:build(funkin.util.macro.LinkerMacro.xml('project/Build.xml'))
|
||||
@:include('MemoryUtil.hpp')
|
||||
@:unreflective
|
||||
@:build(funkin.util.macro.LinkerMacro.xml('project/Build.xml')) @:include('MemoryUtil.hpp') @:unreflective
|
||||
extern class MemoryUtil
|
||||
{
|
||||
/**
|
||||
|
||||
+1
-3
@@ -4,9 +4,7 @@ package funkin.external.apple;
|
||||
/**
|
||||
* A utility class to get screen related informations on apple devices.
|
||||
*/
|
||||
@:build(funkin.util.macro.LinkerMacro.xml('project/Build.xml'))
|
||||
@:include('ScreenUtil.hpp')
|
||||
@:unreflective
|
||||
@:build(funkin.util.macro.LinkerMacro.xml('project/Build.xml')) @:include('ScreenUtil.hpp') @:unreflective
|
||||
extern class ScreenUtil
|
||||
{
|
||||
/**
|
||||
|
||||
+1
-2
@@ -4,8 +4,7 @@ package funkin.external.windows;
|
||||
/**
|
||||
* This class provides handling for Windows API-related functions.
|
||||
*/
|
||||
@:build(funkin.util.macro.LinkerMacro.xml('project/Build.xml'))
|
||||
@:include('winapi.hpp')
|
||||
@:build(funkin.util.macro.LinkerMacro.xml('project/Build.xml')) @:include('winapi.hpp')
|
||||
extern class WinAPI
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -38,15 +38,7 @@ using funkin.graphics.framebuffer.BitmapDataUtil;
|
||||
* - COLOR
|
||||
* - LUMINOSITY
|
||||
*/
|
||||
@:nullSafety
|
||||
@:access(openfl.display.DisplayObject)
|
||||
@:access(openfl.display.BitmapData)
|
||||
@:access(openfl.display3D.Context3D)
|
||||
@:access(openfl.display3D.textures.TextureBase)
|
||||
@:access(flixel.graphics.FlxGraphic)
|
||||
@:access(flixel.graphics.frames.FlxFrame)
|
||||
@:access(openfl.display.OpenGLRenderer)
|
||||
@:access(openfl.geom.ColorTransform)
|
||||
@:nullSafety @:access(openfl.display.DisplayObject) @:access(openfl.display.BitmapData) @:access(openfl.display3D.Context3D) @:access(openfl.display3D.textures.TextureBase) @:access(flixel.graphics.FlxGraphic) @:access(flixel.graphics.frames.FlxFrame) @:access(openfl.display.OpenGLRenderer) @:access(openfl.geom.ColorTransform)
|
||||
class FunkinCamera extends FlxCamera
|
||||
{
|
||||
/**
|
||||
@@ -72,7 +64,21 @@ class FunkinCamera extends FlxCamera
|
||||
* - `LIGHTEN` is supported natively on desktop, but not other platforms.
|
||||
* - While `DARKEN` is supported natively on desktop, it causes issues with transparency.
|
||||
*/
|
||||
static final KHR_BLEND_MODES:Array<BlendMode> = [DARKEN, HARDLIGHT, #if !desktop LIGHTEN, #end OVERLAY, DIFFERENCE, COLORDODGE, COLORBURN, SOFTLIGHT, EXCLUSION, HUE, SATURATION, COLOR, LUMINOSITY];
|
||||
static final KHR_BLEND_MODES:Array<BlendMode> = [
|
||||
DARKEN,
|
||||
HARDLIGHT,
|
||||
#if !desktop LIGHTEN, #end
|
||||
OVERLAY,
|
||||
DIFFERENCE,
|
||||
COLORDODGE,
|
||||
COLORBURN,
|
||||
SOFTLIGHT,
|
||||
EXCLUSION,
|
||||
HUE,
|
||||
SATURATION,
|
||||
COLOR,
|
||||
LUMINOSITY
|
||||
];
|
||||
|
||||
/**
|
||||
* A list of blend modes that require the shader no matter what.
|
||||
@@ -95,10 +101,8 @@ class FunkinCamera extends FlxCamera
|
||||
|
||||
var _blendShader:RuntimeCustomBlendShader;
|
||||
var _backgroundFrame:FlxFrame;
|
||||
|
||||
var _blendRenderTexture:RenderTexture;
|
||||
var _backgroundRenderTexture:RenderTexture;
|
||||
|
||||
var _cameraTexture:FixedBitmapData;
|
||||
var _cameraMatrix:FlxMatrix;
|
||||
|
||||
|
||||
@@ -113,8 +113,7 @@ typedef AtlasSpriteSettings =
|
||||
* - A more efficient method for creating solid color sprites.
|
||||
* - TODO: Better cache handling for textures.
|
||||
*/
|
||||
@:nullSafety
|
||||
@:access(animate.FlxAnimateController)
|
||||
@:nullSafety @:access(animate.FlxAnimateController)
|
||||
class FunkinSprite extends FlxAnimate
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -15,14 +15,7 @@ import openfl.geom.ColorTransform;
|
||||
/**
|
||||
* A utility class for `BitmapData`s.
|
||||
*/
|
||||
@:nullSafety
|
||||
@:access(openfl.display.BitmapData)
|
||||
@:access(openfl.display3D.textures.TextureBase)
|
||||
@:access(openfl.display3D.Context3D)
|
||||
@:access(openfl.display.OpenGLRenderer)
|
||||
@:access(flixel.FlxCamera)
|
||||
@:access(openfl.display.Sprite)
|
||||
@:access(openfl.geom.ColorTransform)
|
||||
@:nullSafety @:access(openfl.display.BitmapData) @:access(openfl.display3D.textures.TextureBase) @:access(openfl.display3D.Context3D) @:access(openfl.display.OpenGLRenderer) @:access(flixel.FlxCamera) @:access(openfl.display.Sprite) @:access(openfl.geom.ColorTransform)
|
||||
class BitmapDataUtil
|
||||
{
|
||||
static var renderer(get, never):OpenGLRenderer;
|
||||
|
||||
@@ -11,9 +11,7 @@ import openfl.Lib;
|
||||
/**
|
||||
* `BitmapData` is kinda broken so I fixed it.
|
||||
*/
|
||||
@:nullSafety
|
||||
@:access(openfl.display3D.textures.TextureBase)
|
||||
@:access(openfl.display.OpenGLRenderer)
|
||||
@:nullSafety @:access(openfl.display3D.textures.TextureBase) @:access(openfl.display.OpenGLRenderer)
|
||||
class FixedBitmapData extends BitmapData
|
||||
{
|
||||
override function __drawGL(source:IBitmapDrawable, renderer:OpenGLRenderer):Void
|
||||
|
||||
@@ -12,13 +12,7 @@ import animate.internal.FilterRenderer;
|
||||
/**
|
||||
* A helper for rendering filters on `FunkinSprite` instances.
|
||||
*/
|
||||
@:access(animate.FlxAnimate)
|
||||
@:access(openfl.filters.BitmapFilter)
|
||||
@:access(animate.internal.FilterRenderer)
|
||||
@:access(openfl.display.OpenGLRenderer)
|
||||
@:access(openfl.geom.ColorTransform)
|
||||
@:access(openfl.display.BitmapData)
|
||||
@:nullSafety
|
||||
@:access(animate.FlxAnimate) @:access(openfl.filters.BitmapFilter) @:access(animate.internal.FilterRenderer) @:access(openfl.display.OpenGLRenderer) @:access(openfl.geom.ColorTransform) @:access(openfl.display.BitmapData) @:nullSafety
|
||||
class FunkinFilterRenderer implements IFlxDestroyable
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,6 @@ typedef BlendModeShader =
|
||||
class BlendModeEffect
|
||||
{
|
||||
public var shader(default, null):BlendModeShader;
|
||||
|
||||
@:isVar
|
||||
public var color(default, set):FlxColor = new FlxColor();
|
||||
|
||||
|
||||
@@ -9,9 +9,7 @@ class ColorSwap
|
||||
public var colorToReplace(default, set):FlxColor;
|
||||
public var newColor(default, set):FlxColor;
|
||||
public var daTime(default, set):Float;
|
||||
|
||||
public var hasOutline(default, set):Bool = false;
|
||||
|
||||
public var hueShit:Float = 0;
|
||||
|
||||
public function new():Void
|
||||
|
||||
@@ -14,14 +14,12 @@ class RuntimePostEffectShader extends FlxRuntimeShader
|
||||
// (0, 0) is the top left of the window
|
||||
// (1, 1) is the bottom right of the window
|
||||
varying vec2 screenCoord;
|
||||
', true)
|
||||
@:glVertexBody('
|
||||
', true) @:glVertexBody('
|
||||
screenCoord = vec2(
|
||||
openfl_TextureCoord.x > 0.0 ? 1.0 : 0.0,
|
||||
openfl_TextureCoord.y > 0.0 ? 1.0 : 0.0
|
||||
);
|
||||
')
|
||||
@:glFragmentHeader('
|
||||
') @:glFragmentHeader('
|
||||
// normalized screen coord
|
||||
// (0, 0) is the top left of the window
|
||||
// (1, 1) is the bottom right of the window
|
||||
@@ -108,6 +106,7 @@ class RuntimePostEffectShader extends FlxRuntimeShader
|
||||
}
|
||||
|
||||
// basically `updateViewInfo(FlxG.width, FlxG.height, FlxG.camera)` is good
|
||||
|
||||
public function updateViewInfo(screenWidth:Float, screenHeight:Float, camera:FlxCamera):Void
|
||||
{
|
||||
uScreenResolution.value = [screenWidth, screenHeight];
|
||||
|
||||
@@ -22,7 +22,6 @@ class RuntimeRainShader extends RuntimePostEffectShader
|
||||
color:ShaderParameter<Float>,
|
||||
radius:ShaderParameter<Float>,
|
||||
}>;
|
||||
|
||||
public var time(default, set):Float = 1;
|
||||
|
||||
function set_time(value:Float):Float
|
||||
@@ -133,12 +132,14 @@ class RuntimeRainShader extends RuntimePostEffectShader
|
||||
super.__processGLData(source, storageType);
|
||||
if (storageType == 'uniform')
|
||||
{
|
||||
lights = [for (i in 0...MAX_LIGHTS)
|
||||
lights = [
|
||||
for (i in 0...MAX_LIGHTS)
|
||||
{
|
||||
position: addFloatUniform('lights[$i].position', 2),
|
||||
color: addFloatUniform('lights[$i].color', 3),
|
||||
radius: addFloatUniform('lights[$i].radius', 1),
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +148,13 @@ class RuntimeRainShader extends RuntimePostEffectShader
|
||||
{
|
||||
final res = new ShaderParameter<Float>();
|
||||
res.name = name;
|
||||
res.type = [null, FLOAT, FLOAT2, FLOAT3, FLOAT4][length];
|
||||
res.type = [
|
||||
null,
|
||||
FLOAT,
|
||||
FLOAT2,
|
||||
FLOAT3,
|
||||
FLOAT4
|
||||
][length];
|
||||
res.__arrayLength = 1;
|
||||
res.__isFloat = true;
|
||||
res.__isUniform = true;
|
||||
|
||||
@@ -19,45 +19,37 @@ class SserafimShader extends FlxShader
|
||||
(this is treated differently when isCharacter is true)
|
||||
*/
|
||||
public var darkenAmount(default, set):Float;
|
||||
|
||||
/*
|
||||
The color of the pulse light behind the truck.
|
||||
*/
|
||||
public var pulseLightColor(default, set):FlxColor;
|
||||
|
||||
/*
|
||||
The strength/opacity of the light behind the truck.
|
||||
*/
|
||||
public var pulseLightStrength(default, set):Float;
|
||||
|
||||
/*
|
||||
The strength/opacity of the lights on the truck.
|
||||
*/
|
||||
public var truckLightStrength(default, set):Float;
|
||||
|
||||
/*
|
||||
Whether this shader is for the characters or not.
|
||||
This will change how dramatic the light effect is.
|
||||
*/
|
||||
public var isCharacter(default, set):Bool;
|
||||
|
||||
// TODO: this is for the future but maybe we should make support for AdjustColor to be like... a default thing any shader can pull from???
|
||||
// (if thats possible??) i know flixel does some stuff like that
|
||||
/*
|
||||
The hue component of the Adjust Color part of the shader.
|
||||
*/
|
||||
public var baseHue(default, set):Float;
|
||||
|
||||
/*
|
||||
The saturation component of the Adjust Color part of the shader.
|
||||
*/
|
||||
public var baseSaturation(default, set):Float;
|
||||
|
||||
/*
|
||||
The brightness component of the Adjust Color part of the shader.
|
||||
*/
|
||||
public var baseBrightness(default, set):Float;
|
||||
|
||||
/*
|
||||
The contrast component of the Adjust Color part of the shader.
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,6 @@ class StrokeShader extends FlxShader
|
||||
// https://gist.github.com/AustinEast/d3892fdf6a6079366fffde071f0c2bae
|
||||
public var width(default, set):Float = 0;
|
||||
public var height(default, set):Float = 0;
|
||||
|
||||
public var col(default, set):FlxColor = 0xFFFFFFFF;
|
||||
|
||||
function set_width(val):Float
|
||||
|
||||
@@ -5,11 +5,15 @@ package funkin.group;
|
||||
* Create a scripted class that extends FunkinGroup to use this.
|
||||
*/
|
||||
@:hscriptClass
|
||||
class ScriptedFunkinGroup extends funkin.group.FunkinGroup<Dynamic> implements polymod.hscript.HScriptedClass {}
|
||||
class ScriptedFunkinGroup extends funkin.group.FunkinGroup<Dynamic> implements polymod.hscript.HScriptedClass
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* A script that can be tied to a FunkinSpriteGroup.
|
||||
* Create a scripted class that extends FunkinSpriteGroup to use this.
|
||||
*/
|
||||
@:hscriptClass
|
||||
class ScriptedFunkinSpriteGroup extends funkin.group.FunkinGroup.FunkinSpriteGroup implements polymod.hscript.HScriptedClass {}
|
||||
class ScriptedFunkinSpriteGroup extends funkin.group.FunkinGroup.FunkinSpriteGroup implements polymod.hscript.HScriptedClass
|
||||
{
|
||||
}
|
||||
|
||||
+302
-126
@@ -28,12 +28,10 @@ class Controls extends FlxActionSet
|
||||
var _ui_left = new FunkinAction(Action.UI_LEFT);
|
||||
var _ui_right = new FunkinAction(Action.UI_RIGHT);
|
||||
var _ui_down = new FunkinAction(Action.UI_DOWN);
|
||||
|
||||
var _note_up = new FunkinAction(Action.NOTE_UP);
|
||||
var _note_left = new FunkinAction(Action.NOTE_LEFT);
|
||||
var _note_right = new FunkinAction(Action.NOTE_RIGHT);
|
||||
var _note_down = new FunkinAction(Action.NOTE_DOWN);
|
||||
|
||||
var _accept = new FunkinAction(Action.ACCEPT);
|
||||
var _back = new FunkinAction(Action.BACK);
|
||||
var _pause = new FunkinAction(Action.PAUSE);
|
||||
@@ -62,12 +60,10 @@ class Controls extends FlxActionSet
|
||||
var _volume_up = new FunkinAction(Action.VOLUME_UP);
|
||||
var _volume_down = new FunkinAction(Action.VOLUME_DOWN);
|
||||
var _volume_mute = new FunkinAction(Action.VOLUME_MUTE);
|
||||
|
||||
var byName:Map<String, FunkinAction> = new Map<String, FunkinAction>();
|
||||
|
||||
public var gamepadsAdded:Array<Int> = [];
|
||||
public var keyboardScheme = KeyboardScheme.None;
|
||||
|
||||
public var UI_UP(get, never):Bool;
|
||||
|
||||
inline function get_UI_UP() return _ui_up.checkPressed();
|
||||
@@ -387,18 +383,24 @@ class Controls extends FlxActionSet
|
||||
{
|
||||
return switch (FunkinAction.lastDeviceUsed)
|
||||
{
|
||||
case KEYBOARD: return '[${InputUtil.format(input.inputID, Keys).toUpperCase()}]';
|
||||
case GAMEPAD: return '(${InputUtil.format(input.inputID, Gamepad(input.deviceID)).toUpperCase()})';
|
||||
case device: throw 'unhandled device: $device';
|
||||
case KEYBOARD:
|
||||
return '[${InputUtil.format(input.inputID, Keys).toUpperCase()}]';
|
||||
case GAMEPAD:
|
||||
return '(${InputUtil.format(input.inputID, Gamepad(input.deviceID)).toUpperCase()})';
|
||||
case device:
|
||||
throw 'unhandled device: $device';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return switch (FunkinAction.lastDeviceUsed)
|
||||
{
|
||||
case KEYBOARD: return InputUtil.format(input.inputID, Keys).toUpperCase();
|
||||
case GAMEPAD: return InputUtil.format(input.inputID, Gamepad(input.deviceID)).toUpperCase();
|
||||
case device: throw 'unhandled device: $device';
|
||||
case KEYBOARD:
|
||||
return InputUtil.format(input.inputID, Keys).toUpperCase();
|
||||
case GAMEPAD:
|
||||
return InputUtil.format(input.inputID, Gamepad(input.deviceID)).toUpperCase();
|
||||
case device:
|
||||
throw 'unhandled device: $device';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,34 +419,70 @@ class Controls extends FlxActionSet
|
||||
{
|
||||
return switch (control)
|
||||
{
|
||||
case UI_UP: _ui_up;
|
||||
case UI_DOWN: _ui_down;
|
||||
case UI_LEFT: _ui_left;
|
||||
case UI_RIGHT: _ui_right;
|
||||
case NOTE_UP: _note_up;
|
||||
case NOTE_DOWN: _note_down;
|
||||
case NOTE_LEFT: _note_left;
|
||||
case NOTE_RIGHT: _note_right;
|
||||
case ACCEPT: _accept;
|
||||
case BACK: _back;
|
||||
case PAUSE: _pause;
|
||||
case RESET: _reset;
|
||||
#if FEATURE_SCREENSHOTS case WINDOW_SCREENSHOT: _window_screenshot; #end
|
||||
case WINDOW_FULLSCREEN: _window_fullscreen;
|
||||
case FREEPLAY_FAVORITE: _freeplay_favorite;
|
||||
case FREEPLAY_LEFT: _freeplay_left;
|
||||
case FREEPLAY_RIGHT: _freeplay_right;
|
||||
case FREEPLAY_CHAR_SELECT: _freeplay_char_select;
|
||||
case FREEPLAY_JUMP_TO_TOP: _freeplay_jump_to_top;
|
||||
case FREEPLAY_JUMP_TO_BOTTOM: _freeplay_jump_to_bottom;
|
||||
case CUTSCENE_ADVANCE: _cutscene_advance;
|
||||
#if FEATURE_DEBUG_MENU case DEBUG_MENU: _debug_menu; #end
|
||||
#if FEATURE_CHART_EDITOR case DEBUG_CHART: _debug_chart; #end
|
||||
#if FEATURE_STAGE_EDITOR case DEBUG_STAGE: _debug_stage; #end
|
||||
case DEBUG_DISPLAY: _debug_display;
|
||||
case VOLUME_UP: _volume_up;
|
||||
case VOLUME_DOWN: _volume_down;
|
||||
case VOLUME_MUTE: _volume_mute;
|
||||
case UI_UP:
|
||||
_ui_up;
|
||||
case UI_DOWN:
|
||||
_ui_down;
|
||||
case UI_LEFT:
|
||||
_ui_left;
|
||||
case UI_RIGHT:
|
||||
_ui_right;
|
||||
case NOTE_UP:
|
||||
_note_up;
|
||||
case NOTE_DOWN:
|
||||
_note_down;
|
||||
case NOTE_LEFT:
|
||||
_note_left;
|
||||
case NOTE_RIGHT:
|
||||
_note_right;
|
||||
case ACCEPT:
|
||||
_accept;
|
||||
case BACK:
|
||||
_back;
|
||||
case PAUSE:
|
||||
_pause;
|
||||
case RESET:
|
||||
_reset;
|
||||
#if FEATURE_SCREENSHOTS
|
||||
case WINDOW_SCREENSHOT:
|
||||
_window_screenshot;
|
||||
#end
|
||||
case WINDOW_FULLSCREEN:
|
||||
_window_fullscreen;
|
||||
case FREEPLAY_FAVORITE:
|
||||
_freeplay_favorite;
|
||||
case FREEPLAY_LEFT:
|
||||
_freeplay_left;
|
||||
case FREEPLAY_RIGHT:
|
||||
_freeplay_right;
|
||||
case FREEPLAY_CHAR_SELECT:
|
||||
_freeplay_char_select;
|
||||
case FREEPLAY_JUMP_TO_TOP:
|
||||
_freeplay_jump_to_top;
|
||||
case FREEPLAY_JUMP_TO_BOTTOM:
|
||||
_freeplay_jump_to_bottom;
|
||||
case CUTSCENE_ADVANCE:
|
||||
_cutscene_advance;
|
||||
#if FEATURE_DEBUG_MENU
|
||||
case DEBUG_MENU:
|
||||
_debug_menu;
|
||||
#end
|
||||
#if FEATURE_CHART_EDITOR
|
||||
case DEBUG_CHART:
|
||||
_debug_chart;
|
||||
#end
|
||||
#if FEATURE_STAGE_EDITOR
|
||||
case DEBUG_STAGE:
|
||||
_debug_stage;
|
||||
#end
|
||||
case DEBUG_DISPLAY:
|
||||
_debug_display;
|
||||
case VOLUME_UP:
|
||||
_volume_up;
|
||||
case VOLUME_DOWN:
|
||||
_volume_down;
|
||||
case VOLUME_MUTE:
|
||||
_volume_mute;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -775,98 +813,206 @@ class Controls extends FlxActionSet
|
||||
case Solo:
|
||||
switch (control)
|
||||
{
|
||||
case Control.UI_UP: return [W, FlxKey.UP];
|
||||
case Control.UI_DOWN: return [S, FlxKey.DOWN];
|
||||
case Control.UI_LEFT: return [A, FlxKey.LEFT];
|
||||
case Control.UI_RIGHT: return [D, FlxKey.RIGHT];
|
||||
case Control.NOTE_UP: return [W, FlxKey.UP];
|
||||
case Control.NOTE_DOWN: return [S, FlxKey.DOWN];
|
||||
case Control.NOTE_LEFT: return [A, FlxKey.LEFT];
|
||||
case Control.NOTE_RIGHT: return [D, FlxKey.RIGHT];
|
||||
case Control.ACCEPT: return [Z, SPACE, ENTER];
|
||||
case Control.BACK: return [X, BACKSPACE, ESCAPE];
|
||||
case Control.PAUSE: return [P, ENTER, ESCAPE];
|
||||
case Control.RESET: return [R];
|
||||
case Control.WINDOW_FULLSCREEN: return [F11]; // We use F for other things LOL.
|
||||
#if FEATURE_SCREENSHOTS case Control.WINDOW_SCREENSHOT: return [F3]; #end
|
||||
case Control.FREEPLAY_FAVORITE: return [F]; // Favorite a song on the menu
|
||||
case Control.FREEPLAY_LEFT: return [Q]; // Switch tabs on the menu
|
||||
case Control.FREEPLAY_RIGHT: return [E]; // Switch tabs on the menu
|
||||
case Control.FREEPLAY_CHAR_SELECT: return [TAB];
|
||||
case Control.FREEPLAY_JUMP_TO_TOP: return [HOME];
|
||||
case Control.FREEPLAY_JUMP_TO_BOTTOM: return [END];
|
||||
case Control.CUTSCENE_ADVANCE: return [Z, ENTER];
|
||||
#if FEATURE_DEBUG_MENU case Control.DEBUG_MENU: return [GRAVEACCENT]; #end
|
||||
#if FEATURE_CHART_EDITOR case Control.DEBUG_CHART: return []; #end
|
||||
#if FEATURE_STAGE_EDITOR case Control.DEBUG_STAGE: return []; #end
|
||||
case Control.DEBUG_DISPLAY: return [F6];
|
||||
case Control.VOLUME_UP: return [PLUS, NUMPADPLUS];
|
||||
case Control.VOLUME_DOWN: return [MINUS, NUMPADMINUS];
|
||||
case Control.VOLUME_MUTE: return [ZERO, NUMPADZERO];
|
||||
case Control.UI_UP:
|
||||
return [W, FlxKey.UP];
|
||||
case Control.UI_DOWN:
|
||||
return [S, FlxKey.DOWN];
|
||||
case Control.UI_LEFT:
|
||||
return [A, FlxKey.LEFT];
|
||||
case Control.UI_RIGHT:
|
||||
return [D, FlxKey.RIGHT];
|
||||
case Control.NOTE_UP:
|
||||
return [W, FlxKey.UP];
|
||||
case Control.NOTE_DOWN:
|
||||
return [S, FlxKey.DOWN];
|
||||
case Control.NOTE_LEFT:
|
||||
return [A, FlxKey.LEFT];
|
||||
case Control.NOTE_RIGHT:
|
||||
return [D, FlxKey.RIGHT];
|
||||
case Control.ACCEPT:
|
||||
return [Z, SPACE, ENTER];
|
||||
case Control.BACK:
|
||||
return [X, BACKSPACE, ESCAPE];
|
||||
case Control.PAUSE:
|
||||
return [P, ENTER, ESCAPE];
|
||||
case Control.RESET:
|
||||
return [R];
|
||||
case Control.WINDOW_FULLSCREEN:
|
||||
return [F11]; // We use F for other things LOL.
|
||||
#if FEATURE_SCREENSHOTS
|
||||
case Control.WINDOW_SCREENSHOT:
|
||||
return [F3];
|
||||
#end
|
||||
case Control.FREEPLAY_FAVORITE:
|
||||
return [F]; // Favorite a song on the menu
|
||||
case Control.FREEPLAY_LEFT:
|
||||
return [Q]; // Switch tabs on the menu
|
||||
case Control.FREEPLAY_RIGHT:
|
||||
return [E]; // Switch tabs on the menu
|
||||
case Control.FREEPLAY_CHAR_SELECT:
|
||||
return [TAB];
|
||||
case Control.FREEPLAY_JUMP_TO_TOP:
|
||||
return [HOME];
|
||||
case Control.FREEPLAY_JUMP_TO_BOTTOM:
|
||||
return [END];
|
||||
case Control.CUTSCENE_ADVANCE:
|
||||
return [Z, ENTER];
|
||||
#if FEATURE_DEBUG_MENU
|
||||
case Control.DEBUG_MENU:
|
||||
return [GRAVEACCENT];
|
||||
#end
|
||||
#if FEATURE_CHART_EDITOR
|
||||
case Control.DEBUG_CHART:
|
||||
return [];
|
||||
#end
|
||||
#if FEATURE_STAGE_EDITOR
|
||||
case Control.DEBUG_STAGE:
|
||||
return [];
|
||||
#end
|
||||
case Control.DEBUG_DISPLAY:
|
||||
return [F6];
|
||||
case Control.VOLUME_UP:
|
||||
return [PLUS, NUMPADPLUS];
|
||||
case Control.VOLUME_DOWN:
|
||||
return [MINUS, NUMPADMINUS];
|
||||
case Control.VOLUME_MUTE:
|
||||
return [ZERO, NUMPADZERO];
|
||||
}
|
||||
case Duo(true):
|
||||
switch (control)
|
||||
{
|
||||
case Control.UI_UP: return [W];
|
||||
case Control.UI_DOWN: return [S];
|
||||
case Control.UI_LEFT: return [A];
|
||||
case Control.UI_RIGHT: return [D];
|
||||
case Control.NOTE_UP: return [W];
|
||||
case Control.NOTE_DOWN: return [S];
|
||||
case Control.NOTE_LEFT: return [A];
|
||||
case Control.NOTE_RIGHT: return [D];
|
||||
case Control.ACCEPT: return [G, Z];
|
||||
case Control.BACK: return [H, X];
|
||||
case Control.PAUSE: return [ONE];
|
||||
case Control.RESET: return [R];
|
||||
#if FEATURE_SCREENSHOTS case Control.WINDOW_SCREENSHOT: return [F3]; #end
|
||||
case Control.WINDOW_FULLSCREEN: return [F11];
|
||||
case Control.FREEPLAY_FAVORITE: return [F]; // Favorite a song on the menu
|
||||
case Control.FREEPLAY_LEFT: return [Q]; // Switch tabs on the menu
|
||||
case Control.FREEPLAY_RIGHT: return [E]; // Switch tabs on the menu
|
||||
case Control.FREEPLAY_CHAR_SELECT: return [TAB];
|
||||
case Control.FREEPLAY_JUMP_TO_TOP: return [HOME];
|
||||
case Control.FREEPLAY_JUMP_TO_BOTTOM: return [END];
|
||||
case Control.CUTSCENE_ADVANCE: return [G, Z];
|
||||
#if FEATURE_DEBUG_MENU case Control.DEBUG_MENU: return [GRAVEACCENT]; #end
|
||||
#if FEATURE_CHART_EDITOR case Control.DEBUG_CHART: return []; #end
|
||||
#if FEATURE_STAGE_EDITOR case Control.DEBUG_STAGE: return []; #end
|
||||
case Control.DEBUG_DISPLAY: return [F6];
|
||||
case Control.VOLUME_UP: return [PLUS];
|
||||
case Control.VOLUME_DOWN: return [MINUS];
|
||||
case Control.VOLUME_MUTE: return [ZERO];
|
||||
case Control.UI_UP:
|
||||
return [W];
|
||||
case Control.UI_DOWN:
|
||||
return [S];
|
||||
case Control.UI_LEFT:
|
||||
return [A];
|
||||
case Control.UI_RIGHT:
|
||||
return [D];
|
||||
case Control.NOTE_UP:
|
||||
return [W];
|
||||
case Control.NOTE_DOWN:
|
||||
return [S];
|
||||
case Control.NOTE_LEFT:
|
||||
return [A];
|
||||
case Control.NOTE_RIGHT:
|
||||
return [D];
|
||||
case Control.ACCEPT:
|
||||
return [G, Z];
|
||||
case Control.BACK:
|
||||
return [H, X];
|
||||
case Control.PAUSE:
|
||||
return [ONE];
|
||||
case Control.RESET:
|
||||
return [R];
|
||||
#if FEATURE_SCREENSHOTS
|
||||
case Control.WINDOW_SCREENSHOT:
|
||||
return [F3];
|
||||
#end
|
||||
case Control.WINDOW_FULLSCREEN:
|
||||
return [F11];
|
||||
case Control.FREEPLAY_FAVORITE:
|
||||
return [F]; // Favorite a song on the menu
|
||||
case Control.FREEPLAY_LEFT:
|
||||
return [Q]; // Switch tabs on the menu
|
||||
case Control.FREEPLAY_RIGHT:
|
||||
return [E]; // Switch tabs on the menu
|
||||
case Control.FREEPLAY_CHAR_SELECT:
|
||||
return [TAB];
|
||||
case Control.FREEPLAY_JUMP_TO_TOP:
|
||||
return [HOME];
|
||||
case Control.FREEPLAY_JUMP_TO_BOTTOM:
|
||||
return [END];
|
||||
case Control.CUTSCENE_ADVANCE:
|
||||
return [G, Z];
|
||||
#if FEATURE_DEBUG_MENU
|
||||
case Control.DEBUG_MENU:
|
||||
return [GRAVEACCENT];
|
||||
#end
|
||||
#if FEATURE_CHART_EDITOR
|
||||
case Control.DEBUG_CHART:
|
||||
return [];
|
||||
#end
|
||||
#if FEATURE_STAGE_EDITOR
|
||||
case Control.DEBUG_STAGE:
|
||||
return [];
|
||||
#end
|
||||
case Control.DEBUG_DISPLAY:
|
||||
return [F6];
|
||||
case Control.VOLUME_UP:
|
||||
return [PLUS];
|
||||
case Control.VOLUME_DOWN:
|
||||
return [MINUS];
|
||||
case Control.VOLUME_MUTE:
|
||||
return [ZERO];
|
||||
}
|
||||
case Duo(false):
|
||||
switch (control)
|
||||
{
|
||||
case Control.UI_UP: return [FlxKey.UP];
|
||||
case Control.UI_DOWN: return [FlxKey.DOWN];
|
||||
case Control.UI_LEFT: return [FlxKey.LEFT];
|
||||
case Control.UI_RIGHT: return [FlxKey.RIGHT];
|
||||
case Control.NOTE_UP: return [FlxKey.UP];
|
||||
case Control.NOTE_DOWN: return [FlxKey.DOWN];
|
||||
case Control.NOTE_LEFT: return [FlxKey.LEFT];
|
||||
case Control.NOTE_RIGHT: return [FlxKey.RIGHT];
|
||||
case Control.ACCEPT: return [ENTER];
|
||||
case Control.BACK: return [ESCAPE];
|
||||
case Control.PAUSE: return [ONE];
|
||||
case Control.RESET: return [R];
|
||||
#if FEATURE_SCREENSHOTS case Control.WINDOW_SCREENSHOT: return []; #end
|
||||
case Control.WINDOW_FULLSCREEN: return [];
|
||||
case Control.FREEPLAY_FAVORITE: return [];
|
||||
case Control.FREEPLAY_LEFT: return [];
|
||||
case Control.FREEPLAY_RIGHT: return [];
|
||||
case Control.FREEPLAY_CHAR_SELECT: return [];
|
||||
case Control.FREEPLAY_JUMP_TO_TOP: return [];
|
||||
case Control.FREEPLAY_JUMP_TO_BOTTOM: return [];
|
||||
case Control.CUTSCENE_ADVANCE: return [ENTER];
|
||||
#if FEATURE_DEBUG_MENU case Control.DEBUG_MENU: return []; #end
|
||||
#if FEATURE_CHART_EDITOR case Control.DEBUG_CHART: return []; #end
|
||||
#if FEATURE_STAGE_EDITOR case Control.DEBUG_STAGE: return []; #end
|
||||
case Control.DEBUG_DISPLAY: return [];
|
||||
case Control.VOLUME_UP: return [NUMPADPLUS];
|
||||
case Control.VOLUME_DOWN: return [NUMPADMINUS];
|
||||
case Control.VOLUME_MUTE: return [NUMPADZERO];
|
||||
case Control.UI_UP:
|
||||
return [FlxKey.UP];
|
||||
case Control.UI_DOWN:
|
||||
return [FlxKey.DOWN];
|
||||
case Control.UI_LEFT:
|
||||
return [FlxKey.LEFT];
|
||||
case Control.UI_RIGHT:
|
||||
return [FlxKey.RIGHT];
|
||||
case Control.NOTE_UP:
|
||||
return [FlxKey.UP];
|
||||
case Control.NOTE_DOWN:
|
||||
return [FlxKey.DOWN];
|
||||
case Control.NOTE_LEFT:
|
||||
return [FlxKey.LEFT];
|
||||
case Control.NOTE_RIGHT:
|
||||
return [FlxKey.RIGHT];
|
||||
case Control.ACCEPT:
|
||||
return [ENTER];
|
||||
case Control.BACK:
|
||||
return [ESCAPE];
|
||||
case Control.PAUSE:
|
||||
return [ONE];
|
||||
case Control.RESET:
|
||||
return [R];
|
||||
#if FEATURE_SCREENSHOTS
|
||||
case Control.WINDOW_SCREENSHOT:
|
||||
return [];
|
||||
#end
|
||||
case Control.WINDOW_FULLSCREEN:
|
||||
return [];
|
||||
case Control.FREEPLAY_FAVORITE:
|
||||
return [];
|
||||
case Control.FREEPLAY_LEFT:
|
||||
return [];
|
||||
case Control.FREEPLAY_RIGHT:
|
||||
return [];
|
||||
case Control.FREEPLAY_CHAR_SELECT:
|
||||
return [];
|
||||
case Control.FREEPLAY_JUMP_TO_TOP:
|
||||
return [];
|
||||
case Control.FREEPLAY_JUMP_TO_BOTTOM:
|
||||
return [];
|
||||
case Control.CUTSCENE_ADVANCE:
|
||||
return [ENTER];
|
||||
#if FEATURE_DEBUG_MENU
|
||||
case Control.DEBUG_MENU:
|
||||
return [];
|
||||
#end
|
||||
#if FEATURE_CHART_EDITOR
|
||||
case Control.DEBUG_CHART:
|
||||
return [];
|
||||
#end
|
||||
#if FEATURE_STAGE_EDITOR
|
||||
case Control.DEBUG_STAGE:
|
||||
return [];
|
||||
#end
|
||||
case Control.DEBUG_DISPLAY:
|
||||
return [];
|
||||
case Control.VOLUME_UP:
|
||||
return [NUMPADPLUS];
|
||||
case Control.VOLUME_DOWN:
|
||||
return [NUMPADMINUS];
|
||||
case Control.VOLUME_MUTE:
|
||||
return [NUMPADZERO];
|
||||
}
|
||||
default:
|
||||
// Fallthrough.
|
||||
@@ -920,8 +1066,36 @@ class Controls extends FlxActionSet
|
||||
|
||||
public function addDefaultGamepad(id:Int):Void
|
||||
{
|
||||
addGamepadLiteral(id,
|
||||
[Control.ACCEPT => getDefaultGamepadBinds(Control.ACCEPT), Control.BACK => getDefaultGamepadBinds(Control.BACK), Control.UI_UP => getDefaultGamepadBinds(Control.UI_UP), Control.UI_DOWN => getDefaultGamepadBinds(Control.UI_DOWN), Control.UI_LEFT => getDefaultGamepadBinds(Control.UI_LEFT), Control.UI_RIGHT => getDefaultGamepadBinds(Control.UI_RIGHT), Control.NOTE_UP => getDefaultGamepadBinds(Control.NOTE_UP), Control.NOTE_DOWN => getDefaultGamepadBinds(Control.NOTE_DOWN), Control.NOTE_LEFT => getDefaultGamepadBinds(Control.NOTE_LEFT), Control.NOTE_RIGHT => getDefaultGamepadBinds(Control.NOTE_RIGHT), Control.PAUSE => getDefaultGamepadBinds(Control.PAUSE), Control.RESET => getDefaultGamepadBinds(Control.RESET), Control.WINDOW_FULLSCREEN => getDefaultGamepadBinds(Control.WINDOW_FULLSCREEN), #if FEATURE_SCREENSHOTS Control.WINDOW_SCREENSHOT => getDefaultGamepadBinds(Control.WINDOW_SCREENSHOT), #end Control.CUTSCENE_ADVANCE => getDefaultGamepadBinds(Control.CUTSCENE_ADVANCE), Control.FREEPLAY_FAVORITE => getDefaultGamepadBinds(Control.FREEPLAY_FAVORITE), Control.FREEPLAY_LEFT => getDefaultGamepadBinds(Control.FREEPLAY_LEFT), Control.FREEPLAY_RIGHT => getDefaultGamepadBinds(Control.FREEPLAY_RIGHT), Control.FREEPLAY_CHAR_SELECT => getDefaultGamepadBinds(Control.FREEPLAY_CHAR_SELECT), Control.FREEPLAY_JUMP_TO_TOP => getDefaultGamepadBinds(Control.FREEPLAY_JUMP_TO_TOP), Control.FREEPLAY_JUMP_TO_BOTTOM => getDefaultGamepadBinds(Control.FREEPLAY_JUMP_TO_BOTTOM), Control.VOLUME_UP => getDefaultGamepadBinds(Control.VOLUME_UP), Control.VOLUME_DOWN => getDefaultGamepadBinds(Control.VOLUME_DOWN), Control.VOLUME_MUTE => getDefaultGamepadBinds(Control.VOLUME_MUTE), #if FEATURE_DEBUG_MENU Control.DEBUG_MENU => getDefaultGamepadBinds(Control.DEBUG_MENU), #end#if FEATURE_CHART_EDITOR Control.DEBUG_CHART => getDefaultGamepadBinds(Control.DEBUG_CHART), #end#if FEATURE_STAGE_EDITOR Control.DEBUG_STAGE => getDefaultGamepadBinds(Control.DEBUG_STAGE), #end Control.DEBUG_DISPLAY => getDefaultGamepadBinds(Control.DEBUG_DISPLAY),]);
|
||||
addGamepadLiteral(id, [
|
||||
Control.ACCEPT => getDefaultGamepadBinds(Control.ACCEPT),
|
||||
Control.BACK => getDefaultGamepadBinds(Control.BACK),
|
||||
Control.UI_UP => getDefaultGamepadBinds(Control.UI_UP),
|
||||
Control.UI_DOWN => getDefaultGamepadBinds(Control.UI_DOWN),
|
||||
Control.UI_LEFT => getDefaultGamepadBinds(Control.UI_LEFT),
|
||||
Control.UI_RIGHT => getDefaultGamepadBinds(Control.UI_RIGHT),
|
||||
Control.NOTE_UP => getDefaultGamepadBinds(Control.NOTE_UP),
|
||||
Control.NOTE_DOWN => getDefaultGamepadBinds(Control.NOTE_DOWN),
|
||||
Control.NOTE_LEFT => getDefaultGamepadBinds(Control.NOTE_LEFT),
|
||||
Control.NOTE_RIGHT => getDefaultGamepadBinds(Control.NOTE_RIGHT),
|
||||
Control.PAUSE => getDefaultGamepadBinds(Control.PAUSE),
|
||||
Control.RESET => getDefaultGamepadBinds(Control.RESET),
|
||||
Control.WINDOW_FULLSCREEN => getDefaultGamepadBinds(Control.WINDOW_FULLSCREEN),
|
||||
#if FEATURE_SCREENSHOTS Control.WINDOW_SCREENSHOT => getDefaultGamepadBinds(Control.WINDOW_SCREENSHOT), #end
|
||||
Control.CUTSCENE_ADVANCE => getDefaultGamepadBinds(Control.CUTSCENE_ADVANCE),
|
||||
Control.FREEPLAY_FAVORITE => getDefaultGamepadBinds(Control.FREEPLAY_FAVORITE),
|
||||
Control.FREEPLAY_LEFT => getDefaultGamepadBinds(Control.FREEPLAY_LEFT),
|
||||
Control.FREEPLAY_RIGHT => getDefaultGamepadBinds(Control.FREEPLAY_RIGHT),
|
||||
Control.FREEPLAY_CHAR_SELECT => getDefaultGamepadBinds(Control.FREEPLAY_CHAR_SELECT),
|
||||
Control.FREEPLAY_JUMP_TO_TOP => getDefaultGamepadBinds(Control.FREEPLAY_JUMP_TO_TOP),
|
||||
Control.FREEPLAY_JUMP_TO_BOTTOM => getDefaultGamepadBinds(Control.FREEPLAY_JUMP_TO_BOTTOM),
|
||||
Control.VOLUME_UP => getDefaultGamepadBinds(Control.VOLUME_UP),
|
||||
Control.VOLUME_DOWN => getDefaultGamepadBinds(Control.VOLUME_DOWN),
|
||||
Control.VOLUME_MUTE => getDefaultGamepadBinds(Control.VOLUME_MUTE),
|
||||
#if FEATURE_DEBUG_MENU Control.DEBUG_MENU => getDefaultGamepadBinds(Control.DEBUG_MENU), #end
|
||||
#if FEATURE_CHART_EDITOR Control.DEBUG_CHART => getDefaultGamepadBinds(Control.DEBUG_CHART), #end
|
||||
#if FEATURE_STAGE_EDITOR Control.DEBUG_STAGE => getDefaultGamepadBinds(Control.DEBUG_STAGE), #end
|
||||
Control.DEBUG_DISPLAY => getDefaultGamepadBinds(Control.DEBUG_DISPLAY),
|
||||
]);
|
||||
}
|
||||
|
||||
function getDefaultGamepadBinds(control:Control):Array<FlxGamepadInputID>
|
||||
@@ -1140,8 +1314,10 @@ class Controls extends FlxActionSet
|
||||
{
|
||||
return switch (device)
|
||||
{
|
||||
case Keys: input.device == KEYBOARD;
|
||||
case Gamepad(id): isGamepad(input, id);
|
||||
case Keys:
|
||||
input.device == KEYBOARD;
|
||||
case Gamepad(id):
|
||||
isGamepad(input, id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ class Cursor
|
||||
offsetY: 0,
|
||||
};
|
||||
static var assetCursorDefault:Null<BitmapData> = null;
|
||||
|
||||
public static final CURSOR_CROSS_PARAMS:CursorParams = {
|
||||
graphic: "assets/images/cursor/cursor-cross.png",
|
||||
scale: 1.0,
|
||||
@@ -62,7 +61,6 @@ class Cursor
|
||||
offsetY: 0,
|
||||
};
|
||||
static var assetCursorCross:Null<BitmapData> = null;
|
||||
|
||||
public static final CURSOR_ERASER_PARAMS:CursorParams = {
|
||||
graphic: "assets/images/cursor/cursor-eraser.png",
|
||||
scale: 1.0,
|
||||
@@ -70,7 +68,6 @@ class Cursor
|
||||
offsetY: 0,
|
||||
};
|
||||
static var assetCursorEraser:Null<BitmapData> = null;
|
||||
|
||||
public static final CURSOR_GRABBING_PARAMS:CursorParams = {
|
||||
graphic: "assets/images/cursor/cursor-grabbing.png",
|
||||
scale: 1.0,
|
||||
@@ -78,7 +75,6 @@ class Cursor
|
||||
offsetY: 0,
|
||||
};
|
||||
static var assetCursorGrabbing:Null<BitmapData> = null;
|
||||
|
||||
public static final CURSOR_HOURGLASS_PARAMS:CursorParams = {
|
||||
graphic: "assets/images/cursor/cursor-hourglass.png",
|
||||
scale: 1.0,
|
||||
@@ -86,7 +82,6 @@ class Cursor
|
||||
offsetY: 0,
|
||||
};
|
||||
static var assetCursorHourglass:Null<BitmapData> = null;
|
||||
|
||||
public static final CURSOR_POINTER_PARAMS:CursorParams = {
|
||||
graphic: "assets/images/cursor/cursor-pointer.png",
|
||||
scale: 1.0,
|
||||
@@ -94,7 +89,6 @@ class Cursor
|
||||
offsetY: 0,
|
||||
};
|
||||
static var assetCursorPointer:Null<BitmapData> = null;
|
||||
|
||||
public static final CURSOR_TEXT_PARAMS:CursorParams = {
|
||||
graphic: "assets/images/cursor/cursor-text.png",
|
||||
scale: 0.2,
|
||||
@@ -102,7 +96,6 @@ class Cursor
|
||||
offsetY: 0,
|
||||
};
|
||||
static var assetCursorText:Null<BitmapData> = null;
|
||||
|
||||
public static final CURSOR_TEXT_VERTICAL_PARAMS:CursorParams = {
|
||||
graphic: "assets/images/cursor/cursor-text-vertical.png",
|
||||
scale: 0.2,
|
||||
@@ -110,7 +103,6 @@ class Cursor
|
||||
offsetY: 0,
|
||||
};
|
||||
static var assetCursorTextVertical:Null<BitmapData> = null;
|
||||
|
||||
public static final CURSOR_ZOOM_IN_PARAMS:CursorParams = {
|
||||
graphic: "assets/images/cursor/cursor-zoom-in.png",
|
||||
scale: 1.0,
|
||||
@@ -118,7 +110,6 @@ class Cursor
|
||||
offsetY: 0,
|
||||
};
|
||||
static var assetCursorZoomIn:Null<BitmapData> = null;
|
||||
|
||||
public static final CURSOR_ZOOM_OUT_PARAMS:CursorParams = {
|
||||
graphic: "assets/images/cursor/cursor-zoom-out.png",
|
||||
scale: 1.0,
|
||||
@@ -126,7 +117,6 @@ class Cursor
|
||||
offsetY: 0,
|
||||
};
|
||||
static var assetCursorZoomOut:Null<BitmapData> = null;
|
||||
|
||||
public static final CURSOR_CROSSHAIR_PARAMS:CursorParams = {
|
||||
graphic: "assets/images/cursor/cursor-crosshair.png",
|
||||
scale: 1.0,
|
||||
@@ -134,7 +124,6 @@ class Cursor
|
||||
offsetY: -16,
|
||||
};
|
||||
static var assetCursorCrosshair:Null<BitmapData> = null;
|
||||
|
||||
public static final CURSOR_CELL_PARAMS:CursorParams = {
|
||||
graphic: "assets/images/cursor/cursor-cell.png",
|
||||
scale: 1.0,
|
||||
@@ -142,7 +131,6 @@ class Cursor
|
||||
offsetY: -16,
|
||||
};
|
||||
static var assetCursorCell:Null<BitmapData> = null;
|
||||
|
||||
public static final CURSOR_SCROLL_PARAMS:CursorParams = {
|
||||
graphic: "assets/images/cursor/cursor-scroll.png",
|
||||
scale: 0.2,
|
||||
@@ -191,20 +179,34 @@ class Cursor
|
||||
|
||||
var data = switch (mode)
|
||||
{
|
||||
case Default: { cache: assetCursorDefault, params: CURSOR_DEFAULT_PARAMS, set: (bmp) -> assetCursorDefault = bmp };
|
||||
case Cross: { cache: assetCursorCross, params: CURSOR_CROSS_PARAMS, set: (bmp) -> assetCursorCross = bmp };
|
||||
case Eraser: { cache: assetCursorEraser, params: CURSOR_ERASER_PARAMS, set: (bmp) -> assetCursorEraser = bmp };
|
||||
case Grabbing: { cache: assetCursorGrabbing, params: CURSOR_GRABBING_PARAMS, set: (bmp) -> assetCursorGrabbing = bmp };
|
||||
case Hourglass: { cache: assetCursorHourglass, params: CURSOR_HOURGLASS_PARAMS, set: (bmp) -> assetCursorHourglass = bmp };
|
||||
case Pointer: { cache: assetCursorPointer, params: CURSOR_POINTER_PARAMS, set: (bmp) -> assetCursorPointer = bmp };
|
||||
case Text: { cache: assetCursorText, params: CURSOR_TEXT_PARAMS, set: (bmp) -> assetCursorText = bmp };
|
||||
case TextVertical: { cache: assetCursorTextVertical, params: CURSOR_TEXT_VERTICAL_PARAMS, set: (bmp) -> assetCursorTextVertical = bmp };
|
||||
case ZoomIn: { cache: assetCursorZoomIn, params: CURSOR_ZOOM_IN_PARAMS, set: (bmp) -> assetCursorZoomIn = bmp };
|
||||
case ZoomOut: { cache: assetCursorZoomOut, params: CURSOR_ZOOM_OUT_PARAMS, set: (bmp) -> assetCursorZoomOut = bmp };
|
||||
case Crosshair: { cache: assetCursorCrosshair, params: CURSOR_CROSSHAIR_PARAMS, set: (bmp) -> assetCursorCrosshair = bmp };
|
||||
case Cell: { cache: assetCursorCell, params: CURSOR_CELL_PARAMS, set: (bmp) -> assetCursorCell = bmp };
|
||||
case Scroll: { cache: assetCursorScroll, params: CURSOR_SCROLL_PARAMS, set: (bmp) -> assetCursorScroll = bmp };
|
||||
default: null;
|
||||
case Default:
|
||||
{cache: assetCursorDefault, params: CURSOR_DEFAULT_PARAMS, set: (bmp) -> assetCursorDefault = bmp};
|
||||
case Cross:
|
||||
{cache: assetCursorCross, params: CURSOR_CROSS_PARAMS, set: (bmp) -> assetCursorCross = bmp};
|
||||
case Eraser:
|
||||
{cache: assetCursorEraser, params: CURSOR_ERASER_PARAMS, set: (bmp) -> assetCursorEraser = bmp};
|
||||
case Grabbing:
|
||||
{cache: assetCursorGrabbing, params: CURSOR_GRABBING_PARAMS, set: (bmp) -> assetCursorGrabbing = bmp};
|
||||
case Hourglass:
|
||||
{cache: assetCursorHourglass, params: CURSOR_HOURGLASS_PARAMS, set: (bmp) -> assetCursorHourglass = bmp};
|
||||
case Pointer:
|
||||
{cache: assetCursorPointer, params: CURSOR_POINTER_PARAMS, set: (bmp) -> assetCursorPointer = bmp};
|
||||
case Text:
|
||||
{cache: assetCursorText, params: CURSOR_TEXT_PARAMS, set: (bmp) -> assetCursorText = bmp};
|
||||
case TextVertical:
|
||||
{cache: assetCursorTextVertical, params: CURSOR_TEXT_VERTICAL_PARAMS, set: (bmp) -> assetCursorTextVertical = bmp};
|
||||
case ZoomIn:
|
||||
{cache: assetCursorZoomIn, params: CURSOR_ZOOM_IN_PARAMS, set: (bmp) -> assetCursorZoomIn = bmp};
|
||||
case ZoomOut:
|
||||
{cache: assetCursorZoomOut, params: CURSOR_ZOOM_OUT_PARAMS, set: (bmp) -> assetCursorZoomOut = bmp};
|
||||
case Crosshair:
|
||||
{cache: assetCursorCrosshair, params: CURSOR_CROSSHAIR_PARAMS, set: (bmp) -> assetCursorCrosshair = bmp};
|
||||
case Cell:
|
||||
{cache: assetCursorCell, params: CURSOR_CELL_PARAMS, set: (bmp) -> assetCursorCell = bmp};
|
||||
case Scroll:
|
||||
{cache: assetCursorScroll, params: CURSOR_SCROLL_PARAMS, set: (bmp) -> assetCursorScroll = bmp};
|
||||
default:
|
||||
null;
|
||||
}
|
||||
|
||||
if (data == null)
|
||||
@@ -222,7 +224,8 @@ class Cursor
|
||||
if (async)
|
||||
{
|
||||
var future:Future<BitmapData> = Assets.loadBitmapData(data.params.graphic);
|
||||
future.onComplete((bmp:BitmapData) -> {
|
||||
future.onComplete((bmp:BitmapData) ->
|
||||
{
|
||||
data.set(bmp);
|
||||
applyGraphic(bmp, data.params);
|
||||
});
|
||||
@@ -274,6 +277,7 @@ class Cursor
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/cursor
|
||||
|
||||
enum CursorMode
|
||||
{
|
||||
Default;
|
||||
|
||||
@@ -56,7 +56,6 @@ class PreciseInputManager extends FlxKeyManager<FlxKey, PreciseInputList>
|
||||
var _buttonList:Map<Int, Array<FlxGamepadInputID>>;
|
||||
|
||||
var _buttonListArray:Array<FlxInput<FlxGamepadInputID>>;
|
||||
|
||||
var _buttonListMap:Map<Int, Map<FlxGamepadInputID, FlxInput<FlxGamepadInputID>>>;
|
||||
|
||||
/**
|
||||
@@ -115,10 +114,14 @@ class PreciseInputManager extends FlxKeyManager<FlxKey, PreciseInputList>
|
||||
{
|
||||
return switch (noteDirection)
|
||||
{
|
||||
case NoteDirection.LEFT: controls.getKeysForAction(NOTE_LEFT);
|
||||
case NoteDirection.DOWN: controls.getKeysForAction(NOTE_DOWN);
|
||||
case NoteDirection.UP: controls.getKeysForAction(NOTE_UP);
|
||||
case NoteDirection.RIGHT: controls.getKeysForAction(NOTE_RIGHT);
|
||||
case NoteDirection.LEFT:
|
||||
controls.getKeysForAction(NOTE_LEFT);
|
||||
case NoteDirection.DOWN:
|
||||
controls.getKeysForAction(NOTE_DOWN);
|
||||
case NoteDirection.UP:
|
||||
controls.getKeysForAction(NOTE_UP);
|
||||
case NoteDirection.RIGHT:
|
||||
controls.getKeysForAction(NOTE_RIGHT);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -126,10 +129,14 @@ class PreciseInputManager extends FlxKeyManager<FlxKey, PreciseInputList>
|
||||
{
|
||||
return switch (noteDirection)
|
||||
{
|
||||
case NoteDirection.LEFT: controls.getButtonsForAction(NOTE_LEFT);
|
||||
case NoteDirection.DOWN: controls.getButtonsForAction(NOTE_DOWN);
|
||||
case NoteDirection.UP: controls.getButtonsForAction(NOTE_UP);
|
||||
case NoteDirection.RIGHT: controls.getButtonsForAction(NOTE_RIGHT);
|
||||
case NoteDirection.LEFT:
|
||||
controls.getButtonsForAction(NOTE_LEFT);
|
||||
case NoteDirection.DOWN:
|
||||
controls.getButtonsForAction(NOTE_DOWN);
|
||||
case NoteDirection.UP:
|
||||
controls.getButtonsForAction(NOTE_UP);
|
||||
case NoteDirection.RIGHT:
|
||||
controls.getButtonsForAction(NOTE_RIGHT);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -240,6 +247,7 @@ class PreciseInputManager extends FlxKeyManager<FlxKey, PreciseInputList>
|
||||
|
||||
// TODO: Why doesn't this work?
|
||||
// @:allow(funkin.input.PreciseInputManager.PreciseInputList)
|
||||
|
||||
public function getInputByKey(key:FlxKey):FlxKeyInput
|
||||
{
|
||||
return _keyListMap.get(key);
|
||||
|
||||
@@ -48,11 +48,9 @@ class TurboActionHandler extends FlxBasic
|
||||
}
|
||||
|
||||
var action:Action;
|
||||
|
||||
var delay:Float;
|
||||
var interval:Float;
|
||||
var gamepadOnly:Bool;
|
||||
|
||||
var pressedTime:Float = 0;
|
||||
|
||||
function new(action:Action, delay:Float = DEFAULT_DELAY, interval:Float = DEFAULT_INTERVAL, gamepadOnly:Bool = false)
|
||||
|
||||
@@ -40,7 +40,6 @@ class TurboButtonHandler extends FlxBasic
|
||||
var delay:Float;
|
||||
var interval:Float;
|
||||
var targetGamepad:FlxGamepad;
|
||||
|
||||
var allPressedTime:Float = 0;
|
||||
|
||||
function new(inputs:Array<FlxGamepadInputID>, delay:Float = DEFAULT_DELAY, interval:Float = DEFAULT_INTERVAL, ?targetGamepad:FlxGamepad)
|
||||
|
||||
@@ -38,7 +38,6 @@ class TurboKeyHandler extends FlxBasic
|
||||
var keys:Array<FlxKey>;
|
||||
var delay:Float;
|
||||
var interval:Float;
|
||||
|
||||
var allPressedTime:Float = 0;
|
||||
|
||||
function new(keys:Array<FlxKey>, delay:Float = DEFAULT_DELAY, interval:Float = DEFAULT_INTERVAL)
|
||||
|
||||
@@ -12,9 +12,7 @@ class FunkinBackButton extends FunkinButton
|
||||
{
|
||||
public var onConfirmStart(default, null):FlxSignal = new FlxSignal();
|
||||
public var onConfirmEnd(default, null):FlxSignal = new FlxSignal();
|
||||
|
||||
public var enabled:Bool = true;
|
||||
|
||||
public var confirming(get, never):Bool;
|
||||
|
||||
function get_confirming():Bool
|
||||
@@ -47,7 +45,25 @@ class FunkinBackButton extends FunkinButton
|
||||
frames = Paths.getSparrowAtlas("backButton");
|
||||
animation.addByIndices('idle', 'back', [0], "", 24, false);
|
||||
animation.addByIndices('hold', 'back', [5], "", 24, false);
|
||||
animation.addByIndices('confirm', 'back', [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22], "", 24, false);
|
||||
animation.addByIndices('confirm', 'back', [
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22
|
||||
], "", 24, false);
|
||||
animation.play("idle");
|
||||
|
||||
scale.set(0.7, 0.7);
|
||||
|
||||
@@ -28,8 +28,7 @@ enum abstract FunkinButtonStatus(Int) from Int to Int
|
||||
#if !display
|
||||
@:generic
|
||||
#end
|
||||
@:allow(funkin.mobile.ui.FunkinHitbox)
|
||||
@:allow(funkin.mobile.ui.FunkinButton)
|
||||
@:allow(funkin.mobile.ui.FunkinHitbox) @:allow(funkin.mobile.ui.FunkinButton)
|
||||
class FunkinButton extends FunkinSprite implements IFlxInput
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -43,8 +43,10 @@ class FunkinHint extends FunkinButton
|
||||
* - The second value corresponds to the alpha when the hint is not pressed.
|
||||
* - The third value corresponds to the duratuon it'll take to tween between the two values.
|
||||
*/
|
||||
static final HINT_ALPHA_STYLE:Map<FunkinHintAlphaStyle,
|
||||
Array<Float>> = [INVISIBLE_TILL_PRESS => [0.3, 0.00001, 0.01], VISIBLE_TILL_PRESS => [0.4, 0.2, 0.08]];
|
||||
static final HINT_ALPHA_STYLE:Map<FunkinHintAlphaStyle, Array<Float>> = [
|
||||
INVISIBLE_TILL_PRESS => [0.3, 0.00001, 0.01],
|
||||
VISIBLE_TILL_PRESS => [0.4, 0.2, 0.08]
|
||||
];
|
||||
|
||||
/**
|
||||
* Indicates whether the hint is pixel.
|
||||
@@ -77,7 +79,6 @@ class FunkinHint extends FunkinButton
|
||||
var alphaTween:Null<FlxTween>;
|
||||
|
||||
var followTarget:Null<FunkinSprite>;
|
||||
|
||||
var followTargetSize:Bool = false;
|
||||
|
||||
/**
|
||||
@@ -653,10 +654,42 @@ class FunkinHitbox extends FlxTypedSpriteGroup<FunkinHint>
|
||||
|
||||
return switch (facing)
|
||||
{
|
||||
case UP: [width / 2, 0, 0, height, width, height];
|
||||
case DOWN: [0, 0, width, 0, width / 2, height];
|
||||
case LEFT: [0, 0, width, height / 2, 0, height];
|
||||
case RIGHT: [width, 0, 0, height / 2, width, height];
|
||||
case UP:
|
||||
[
|
||||
width / 2,
|
||||
0,
|
||||
0,
|
||||
height,
|
||||
width,
|
||||
height
|
||||
];
|
||||
case DOWN:
|
||||
[
|
||||
0,
|
||||
0,
|
||||
width,
|
||||
0,
|
||||
width / 2,
|
||||
height
|
||||
];
|
||||
case LEFT:
|
||||
[
|
||||
0,
|
||||
0,
|
||||
width,
|
||||
height / 2,
|
||||
0,
|
||||
height
|
||||
];
|
||||
case RIGHT:
|
||||
[
|
||||
width,
|
||||
0,
|
||||
0,
|
||||
height / 2,
|
||||
width,
|
||||
height
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,7 @@ class FunkinOptionsButton extends FunkinButton
|
||||
{
|
||||
public var onConfirmStart(default, null):FlxSignal = new FlxSignal();
|
||||
public var onConfirmEnd(default, null):FlxSignal = new FlxSignal();
|
||||
|
||||
public var enabled:Bool = true;
|
||||
|
||||
public var confirming(get, never):Bool;
|
||||
|
||||
function get_confirming():Bool
|
||||
@@ -40,7 +38,21 @@ class FunkinOptionsButton extends FunkinButton
|
||||
frames = Paths.getSparrowAtlas("mainmenu/optionsButton");
|
||||
animation.addByIndices('idle', 'options', [0], "", 24, false);
|
||||
animation.addByIndices('hold', 'options', [3], "", 24, false);
|
||||
animation.addByIndices('confirm', 'options', [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "", 24, false);
|
||||
animation.addByIndices('confirm', 'options', [
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16
|
||||
], "", 24, false);
|
||||
animation.play("idle");
|
||||
|
||||
scale.set(0.7, 0.7);
|
||||
|
||||
@@ -64,7 +64,13 @@ class ControlsSchemeMenu extends MusicBeatSubState
|
||||
/**
|
||||
* An array of every single scheme.
|
||||
*/
|
||||
final availableSchemes:Array<String> = [FunkinHitbox.FunkinHitboxControlSchemes.Arrows, FunkinHitbox.FunkinHitboxControlSchemes.FourLanes, FunkinHitbox.FunkinHitboxControlSchemes.DoubleThumbTriangle, FunkinHitbox.FunkinHitboxControlSchemes.DoubleThumbSquare, FunkinHitbox.FunkinHitboxControlSchemes.DoubleThumbDPad];
|
||||
final availableSchemes:Array<String> = [
|
||||
FunkinHitbox.FunkinHitboxControlSchemes.Arrows,
|
||||
FunkinHitbox.FunkinHitboxControlSchemes.FourLanes,
|
||||
FunkinHitbox.FunkinHitboxControlSchemes.DoubleThumbTriangle,
|
||||
FunkinHitbox.FunkinHitboxControlSchemes.DoubleThumbSquare,
|
||||
FunkinHitbox.FunkinHitboxControlSchemes.DoubleThumbDPad
|
||||
];
|
||||
|
||||
/**
|
||||
* Current selected index
|
||||
|
||||
@@ -11,8 +11,7 @@ import funkin.play.cutscene.VideoCutscene;
|
||||
/**
|
||||
* Provides utility functions for working with admob advertisements.
|
||||
*/
|
||||
@:build(funkin.util.macro.EnvironmentMacro.build())
|
||||
@:nullSafety
|
||||
@:build(funkin.util.macro.EnvironmentMacro.build()) @:nullSafety
|
||||
class AdMobUtil
|
||||
{
|
||||
/**
|
||||
@@ -44,7 +43,6 @@ class AdMobUtil
|
||||
#else
|
||||
static final ADMOB_PUBLISHER:Null<String> = "ca-app-pub-3940256099942544";
|
||||
#end
|
||||
|
||||
/**
|
||||
* Ad unit ID for displaying banner ads.
|
||||
*/
|
||||
@@ -54,7 +52,6 @@ class AdMobUtil
|
||||
#else
|
||||
static final ADMOB_BANNER_AD_UNIT_ID:Null<String> = #if android "9214589741" #elseif ios "2435281174" #else null #end;
|
||||
#end
|
||||
|
||||
/**
|
||||
* Ad unit ID for displaying interstitial ads.
|
||||
*/
|
||||
@@ -79,7 +76,10 @@ class AdMobUtil
|
||||
case AdmobEvent.INIT_OK:
|
||||
if (AdMobUtil.ADMOB_PUBLISHER != null && AdMobUtil.ADMOB_INTERSTITIAL_AD_UNIT_ID != null)
|
||||
{
|
||||
final adUnitID:String = [AdMobUtil.ADMOB_PUBLISHER, AdMobUtil.ADMOB_INTERSTITIAL_AD_UNIT_ID].join('/');
|
||||
final adUnitID:String = [
|
||||
AdMobUtil.ADMOB_PUBLISHER,
|
||||
AdMobUtil.ADMOB_INTERSTITIAL_AD_UNIT_ID
|
||||
].join('/');
|
||||
|
||||
Admob.startInterstitialPreloader(AdMobUtil.ADMOB_INTERSTITIAL_PRELOAD_ID, adUnitID, AdMobUtil.ADMOB_INTERSTITIAL_PRELOAD_BUFFER_SIZE);
|
||||
}
|
||||
@@ -120,7 +120,10 @@ class AdMobUtil
|
||||
|
||||
if (AdMobUtil.ADMOB_PUBLISHER != null && AdMobUtil.ADMOB_BANNER_AD_UNIT_ID != null)
|
||||
{
|
||||
Admob.showBanner([AdMobUtil.ADMOB_PUBLISHER, AdMobUtil.ADMOB_BANNER_AD_UNIT_ID].join('/'), size, align);
|
||||
Admob.showBanner([
|
||||
AdMobUtil.ADMOB_PUBLISHER,
|
||||
AdMobUtil.ADMOB_BANNER_AD_UNIT_ID
|
||||
].join('/'), size, align);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +190,10 @@ class AdMobUtil
|
||||
}
|
||||
else
|
||||
{
|
||||
Admob.loadInterstitial([AdMobUtil.ADMOB_PUBLISHER, AdMobUtil.ADMOB_INTERSTITIAL_AD_UNIT_ID].join('/'));
|
||||
Admob.loadInterstitial([
|
||||
AdMobUtil.ADMOB_PUBLISHER,
|
||||
AdMobUtil.ADMOB_INTERSTITIAL_AD_UNIT_ID
|
||||
].join('/'));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -10,7 +10,6 @@ import funkin.modding.events.ScriptEvent;
|
||||
interface IScriptedClass
|
||||
{
|
||||
public function onScriptEvent(event:ScriptEvent):Void;
|
||||
|
||||
public function onCreate(event:ScriptEvent):Void;
|
||||
public function onDestroy(event:ScriptEvent):Void;
|
||||
public function onUpdate(event:UpdateScriptEvent):Void;
|
||||
@@ -32,12 +31,10 @@ interface IStateChangingScriptedClass extends IScriptedClass
|
||||
{
|
||||
public function onStateChangeBegin(event:StateChangeScriptEvent):Void;
|
||||
public function onStateChangeEnd(event:StateChangeScriptEvent):Void;
|
||||
|
||||
public function onSubStateOpenBegin(event:SubStateScriptEvent):Void;
|
||||
public function onSubStateOpenEnd(event:SubStateScriptEvent):Void;
|
||||
public function onSubStateCloseBegin(event:SubStateScriptEvent):Void;
|
||||
public function onSubStateCloseEnd(event:SubStateScriptEvent):Void;
|
||||
|
||||
public function onFocusLost(event:FocusScriptEvent):Void;
|
||||
public function onFocusGained(event:FocusScriptEvent):Void;
|
||||
}
|
||||
|
||||
@@ -257,7 +257,13 @@ class PolymodHandler
|
||||
static function buildImports():Void
|
||||
{
|
||||
// Add default imports for common classes.
|
||||
static final DEFAULT_IMPORTS:Array<Class<Dynamic>> = [funkin.Assets, funkin.Paths, funkin.Preferences, funkin.util.Constants, flixel.FlxG];
|
||||
static final DEFAULT_IMPORTS:Array<Class<Dynamic>> = [
|
||||
funkin.Assets,
|
||||
funkin.Paths,
|
||||
funkin.Preferences,
|
||||
funkin.util.Constants,
|
||||
flixel.FlxG
|
||||
];
|
||||
|
||||
for (cls in DEFAULT_IMPORTS)
|
||||
{
|
||||
@@ -425,10 +431,14 @@ class PolymodHandler
|
||||
// `funkin.save.Save`
|
||||
// Direct access to save data is important for scripts (like checking unlocks),
|
||||
// but we don't want scripts to be able to perform operations like writing scores.
|
||||
Polymod.blacklistInstanceFields(funkin.save.Save, [ // No direct field access
|
||||
Polymod.blacklistInstanceFields(funkin.save.Save, [
|
||||
// No direct field access
|
||||
'data', // LMFAO definitely not
|
||||
'clearData', // No score manipulation please
|
||||
'setLevelScore', 'setSongScore', 'applySongRank']);
|
||||
'setLevelScore',
|
||||
'setSongScore',
|
||||
'applySongRank'
|
||||
]);
|
||||
|
||||
// `openfl.filesystem.FileStream`, `openfl.net.Socket`, `openfl.utils.ByteArray.ByteArrayData`
|
||||
// Returns `Unseralizer.run` if encoded in HXSF format, though it does have to be seralized correctly for the exploit to work.
|
||||
@@ -532,7 +542,22 @@ class PolymodHandler
|
||||
static inline function buildFrameworkParams():polymod.Polymod.FrameworkParams
|
||||
{
|
||||
return {
|
||||
assetLibraryPaths: ['default' => 'preload', 'shared' => 'shared', 'songs' => 'songs', 'videos' => 'videos', 'tutorial' => 'tutorial', 'week1' => 'week1', 'week2' => 'week2', 'week3' => 'week3', 'week4' => 'week4', 'week5' => 'week5', 'week6' => 'week6', 'week7' => 'week7', 'weekend1' => 'weekend1', 'sserafim' => 'sserafim'],
|
||||
assetLibraryPaths: [
|
||||
'default' => 'preload',
|
||||
'shared' => 'shared',
|
||||
'songs' => 'songs',
|
||||
'videos' => 'videos',
|
||||
'tutorial' => 'tutorial',
|
||||
'week1' => 'week1',
|
||||
'week2' => 'week2',
|
||||
'week3' => 'week3',
|
||||
'week4' => 'week4',
|
||||
'week5' => 'week5',
|
||||
'week6' => 'week6',
|
||||
'week7' => 'week7',
|
||||
'weekend1' => 'weekend1',
|
||||
'sserafim' => 'sserafim'
|
||||
],
|
||||
coreAssetRedirect: CORE_FOLDER,
|
||||
}
|
||||
}
|
||||
@@ -573,7 +598,10 @@ class PolymodHandler
|
||||
*/
|
||||
public static function getAllModDirs():Array<String>
|
||||
{
|
||||
var modDirs:Array<String> = [for (i in getAllMods()) i.dirName];
|
||||
var modDirs:Array<String> = [
|
||||
for (i in getAllMods())
|
||||
i.dirName
|
||||
];
|
||||
return modDirs;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,8 +92,13 @@ class ScriptEventDispatcher
|
||||
else
|
||||
{
|
||||
// If the target doesn't support the event, stop trying to dispatch.
|
||||
if ([ScriptEventType.DIALOGUE_START, ScriptEventType.DIALOGUE_LINE, ScriptEventType.DIALOGUE_COMPLETE_LINE, ScriptEventType.DIALOGUE_SKIP, ScriptEventType.DIALOGUE_END].contains(event.type))
|
||||
return;
|
||||
if ([
|
||||
ScriptEventType.DIALOGUE_START,
|
||||
ScriptEventType.DIALOGUE_LINE,
|
||||
ScriptEventType.DIALOGUE_COMPLETE_LINE,
|
||||
ScriptEventType.DIALOGUE_SKIP,
|
||||
ScriptEventType.DIALOGUE_END
|
||||
].contains(event.type)) return;
|
||||
}
|
||||
|
||||
if (Std.isOfType(target, INoteScriptedClass))
|
||||
@@ -189,8 +194,20 @@ class ScriptEventDispatcher
|
||||
else
|
||||
{
|
||||
// If the target doesn't support the event, stop trying to dispatch.
|
||||
if ([ScriptEventType.NOTE_GHOST_MISS, ScriptEventType.SONG_START, ScriptEventType.SONG_END, ScriptEventType.SONG_RETRY, ScriptEventType.GAME_OVER, ScriptEventType.PAUSE, ScriptEventType.RESUME, ScriptEventType.SONG_EVENT, ScriptEventType.COUNTDOWN_START, ScriptEventType.COUNTDOWN_STEP, ScriptEventType.COUNTDOWN_END, ScriptEventType.SONG_LOADED].contains(event.type))
|
||||
return;
|
||||
if ([
|
||||
ScriptEventType.NOTE_GHOST_MISS,
|
||||
ScriptEventType.SONG_START,
|
||||
ScriptEventType.SONG_END,
|
||||
ScriptEventType.SONG_RETRY,
|
||||
ScriptEventType.GAME_OVER,
|
||||
ScriptEventType.PAUSE,
|
||||
ScriptEventType.RESUME,
|
||||
ScriptEventType.SONG_EVENT,
|
||||
ScriptEventType.COUNTDOWN_START,
|
||||
ScriptEventType.COUNTDOWN_STEP,
|
||||
ScriptEventType.COUNTDOWN_END,
|
||||
ScriptEventType.SONG_LOADED
|
||||
].contains(event.type)) return;
|
||||
}
|
||||
|
||||
if (Std.isOfType(target, IStateChangingScriptedClass))
|
||||
@@ -228,8 +245,16 @@ class ScriptEventDispatcher
|
||||
else
|
||||
{
|
||||
// If the target doesn't support the event, stop trying to dispatch.
|
||||
if ([ScriptEventType.STATE_CHANGE_BEGIN, ScriptEventType.STATE_CHANGE_END, ScriptEventType.SUBSTATE_OPEN_BEGIN, ScriptEventType.SUBSTATE_OPEN_END, ScriptEventType.SUBSTATE_CLOSE_BEGIN, ScriptEventType.SUBSTATE_CLOSE_END, ScriptEventType.FOCUS_LOST, ScriptEventType.FOCUS_GAINED].contains(event.type))
|
||||
return;
|
||||
if ([
|
||||
ScriptEventType.STATE_CHANGE_BEGIN,
|
||||
ScriptEventType.STATE_CHANGE_END,
|
||||
ScriptEventType.SUBSTATE_OPEN_BEGIN,
|
||||
ScriptEventType.SUBSTATE_OPEN_END,
|
||||
ScriptEventType.SUBSTATE_CLOSE_BEGIN,
|
||||
ScriptEventType.SUBSTATE_CLOSE_END,
|
||||
ScriptEventType.FOCUS_LOST,
|
||||
ScriptEventType.FOCUS_GAINED
|
||||
].contains(event.type)) return;
|
||||
}
|
||||
|
||||
if (Std.isOfType(target, IFreeplayScriptedClass))
|
||||
@@ -261,8 +286,14 @@ class ScriptEventDispatcher
|
||||
else
|
||||
{
|
||||
// If the target doesn't support the event, stop trying to dispatch.
|
||||
if ([ScriptEventType.CAPSULE_SELECTED, ScriptEventType.DIFFICULTY_SWITCH, ScriptEventType.SONG_SELECTED, ScriptEventType.FREEPLAY_INTRO, ScriptEventType.FREEPLAY_OUTRO, ScriptEventType.FREEPLAY_CLOSE].contains(event.type))
|
||||
return;
|
||||
if ([
|
||||
ScriptEventType.CAPSULE_SELECTED,
|
||||
ScriptEventType.DIFFICULTY_SWITCH,
|
||||
ScriptEventType.SONG_SELECTED,
|
||||
ScriptEventType.FREEPLAY_INTRO,
|
||||
ScriptEventType.FREEPLAY_OUTRO,
|
||||
ScriptEventType.FREEPLAY_CLOSE
|
||||
].contains(event.type)) return;
|
||||
}
|
||||
|
||||
if (Std.isOfType(target, ICharacterSelectScriptedClass))
|
||||
@@ -285,7 +316,11 @@ class ScriptEventDispatcher
|
||||
else
|
||||
{
|
||||
// If the target doesn't support the event, stop trying to dispatch.
|
||||
if ([ScriptEventType.CHARACTER_SELECTED, ScriptEventType.CHARACTER_DESELECTED, ScriptEventType.CHARACTER_CONFIRMED].contains(event.type)) return;
|
||||
if ([
|
||||
ScriptEventType.CHARACTER_SELECTED,
|
||||
ScriptEventType.CHARACTER_DESELECTED,
|
||||
ScriptEventType.CHARACTER_CONFIRMED
|
||||
].contains(event.type)) return;
|
||||
}
|
||||
|
||||
// If we reach this line, it means a script event was dispatched while not being properly handled.
|
||||
|
||||
@@ -357,7 +357,8 @@ enum abstract ScriptEventType(String) from String to String
|
||||
/**
|
||||
* Allow for comparing `ScriptEventType` to `String`.
|
||||
*/
|
||||
@:op(A == B) private static inline function equals(a:ScriptEventType, b:String):Bool
|
||||
@:op(A == B)
|
||||
private static inline function equals(a:ScriptEventType, b:String):Bool
|
||||
{
|
||||
return (a : String) == b;
|
||||
}
|
||||
@@ -365,7 +366,8 @@ enum abstract ScriptEventType(String) from String to String
|
||||
/**
|
||||
* Allow for comparing `ScriptEventType` to `String`.
|
||||
*/
|
||||
@:op(A != B) private static inline function notEquals(a:ScriptEventType, b:String):Bool
|
||||
@:op(A != B)
|
||||
private static inline function notEquals(a:ScriptEventType, b:String):Bool
|
||||
{
|
||||
return (a : String) != b;
|
||||
}
|
||||
|
||||
@@ -90,15 +90,12 @@ class GameOverSubState extends MusicBeatSubState
|
||||
var isStarting:Bool = true;
|
||||
|
||||
var isChartingMode:Bool = false;
|
||||
|
||||
var mustNotExit:Bool = false;
|
||||
|
||||
var transparent:Bool;
|
||||
|
||||
static final CAMERA_ZOOM_DURATION:Float = 0.5;
|
||||
|
||||
var targetCameraZoom:Float = 1.0;
|
||||
|
||||
var canInput:Bool = false;
|
||||
|
||||
public function new(params:GameOverParams)
|
||||
|
||||
@@ -15,9 +15,7 @@ class GitarooPause extends MusicBeatState
|
||||
{
|
||||
var replayButton:FlxSprite;
|
||||
var cancelButton:FlxSprite;
|
||||
|
||||
var replaySelect:Bool = false;
|
||||
|
||||
var previousParams:Null<PlayStateParams>;
|
||||
|
||||
public function new(?previousParams:PlayStateParams):Void
|
||||
|
||||
@@ -37,7 +37,6 @@ typedef PauseSubStateParams =
|
||||
* Which mode to start in. Dictates what entries are displayed.
|
||||
*/
|
||||
?mode:PauseMode,
|
||||
|
||||
/**
|
||||
* Whether the game paused because the window lost focus.
|
||||
*/
|
||||
@@ -56,30 +55,41 @@ class PauseSubState extends MusicBeatSubState
|
||||
/**
|
||||
* Pause menu entries for when the game is paused during a song.
|
||||
*/
|
||||
static final PAUSE_MENU_ENTRIES_STANDARD:Array<PauseMenuEntry> = [{text: 'Resume', callback: resume}, {
|
||||
static final PAUSE_MENU_ENTRIES_STANDARD:Array<PauseMenuEntry> = [
|
||||
{text: 'Resume', callback: resume},
|
||||
{
|
||||
text: 'Restart Song',
|
||||
callback: restartPlayState
|
||||
}, {
|
||||
},
|
||||
{
|
||||
text: 'Change Difficulty',
|
||||
callback: switchMode.bind(_, Difficulty)
|
||||
}, {
|
||||
},
|
||||
{
|
||||
text: 'Enable Practice Mode',
|
||||
callback: enablePracticeMode,
|
||||
filter: () -> !(PlayState.instance?.isPracticeMode ?? false)
|
||||
}, {text: 'Exit to Menu', callback: quitToMenu},];
|
||||
},
|
||||
{text: 'Exit to Menu', callback: quitToMenu},
|
||||
];
|
||||
|
||||
/**
|
||||
* Pause menu entries for when the game is paused in the Chart Editor preview.
|
||||
*/
|
||||
static final PAUSE_MENU_ENTRIES_CHARTING:Array<PauseMenuEntry> = [{text: 'Resume', callback: resume}, {
|
||||
static final PAUSE_MENU_ENTRIES_CHARTING:Array<PauseMenuEntry> = [
|
||||
{text: 'Resume', callback: resume},
|
||||
{
|
||||
text: 'Restart Song',
|
||||
callback: restartPlayState
|
||||
}, {text: 'Return to Chart Editor', callback: quitToChartEditor},];
|
||||
},
|
||||
{text: 'Return to Chart Editor', callback: quitToChartEditor},
|
||||
];
|
||||
|
||||
/**
|
||||
* Pause menu entries for when the user selects "Change Difficulty".
|
||||
*/
|
||||
static final PAUSE_MENU_ENTRIES_DIFFICULTY:Array<PauseMenuEntry> = [{
|
||||
static final PAUSE_MENU_ENTRIES_DIFFICULTY:Array<PauseMenuEntry> = [
|
||||
{
|
||||
text: 'Back',
|
||||
callback: switchMode.bind(_, Standard)
|
||||
} // Other entries are added dynamically.
|
||||
@@ -88,18 +98,28 @@ class PauseSubState extends MusicBeatSubState
|
||||
/**
|
||||
* Pause menu entries for when the game is paused during a video cutscene.
|
||||
*/
|
||||
static final PAUSE_MENU_ENTRIES_VIDEO_CUTSCENE:Array<PauseMenuEntry> = [{text: 'Resume', callback: resume}, {
|
||||
static final PAUSE_MENU_ENTRIES_VIDEO_CUTSCENE:Array<PauseMenuEntry> = [
|
||||
{text: 'Resume', callback: resume},
|
||||
{
|
||||
text: 'Skip Cutscene',
|
||||
callback: skipVideoCutscene
|
||||
}, {text: 'Restart Cutscene', callback: restartVideoCutscene}, {text: 'Exit to Menu', callback: quitToMenu},];
|
||||
},
|
||||
{text: 'Restart Cutscene', callback: restartVideoCutscene},
|
||||
{text: 'Exit to Menu', callback: quitToMenu},
|
||||
];
|
||||
|
||||
/**
|
||||
* Pause menu entries for when the game is paused during a conversation.
|
||||
*/
|
||||
static final PAUSE_MENU_ENTRIES_CONVERSATION:Array<PauseMenuEntry> = [{text: 'Resume', callback: resume}, {
|
||||
static final PAUSE_MENU_ENTRIES_CONVERSATION:Array<PauseMenuEntry> = [
|
||||
{text: 'Resume', callback: resume},
|
||||
{
|
||||
text: 'Skip Dialogue',
|
||||
callback: skipConversation
|
||||
}, {text: 'Restart Dialogue', callback: restartConversation}, {text: 'Exit to Menu', callback: quitToMenu},];
|
||||
},
|
||||
{text: 'Restart Dialogue', callback: restartConversation},
|
||||
{text: 'Exit to Menu', callback: quitToMenu},
|
||||
];
|
||||
|
||||
/**
|
||||
* Duration for the music to fade in when the pause menu is opened.
|
||||
@@ -112,7 +132,6 @@ class PauseSubState extends MusicBeatSubState
|
||||
static final MUSIC_FINAL_VOLUME:Float = 0.75;
|
||||
|
||||
static final CHARTER_FADE_DELAY:Float = 15.0;
|
||||
|
||||
static final CHARTER_FADE_DURATION:Float = 0.75;
|
||||
|
||||
/**
|
||||
@@ -398,8 +417,35 @@ class PauseSubState extends MusicBeatSubState
|
||||
pauseButton = FunkinSprite.createSparrow(0, 0, "pauseButton");
|
||||
pauseButton.animation.addByIndices('idle', 'pause', [0], "", 24, false);
|
||||
pauseButton.animation.addByIndices('hold', 'pause', [5], "", 24, false);
|
||||
pauseButton.animation.addByIndices('confirm', 'pause',
|
||||
[6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], "", 24, false);
|
||||
pauseButton.animation.addByIndices('confirm', 'pause', [
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
31,
|
||||
32
|
||||
], "", 24, false);
|
||||
pauseButton.scale.set(0.8, 0.8);
|
||||
pauseButton.updateHitbox();
|
||||
pauseButton.animation.play("confirm");
|
||||
|
||||
@@ -544,7 +544,6 @@ class PlayState extends MusicBeatSubState
|
||||
var discordRPCAlbum:String = '';
|
||||
var discordRPCIcon:String = '';
|
||||
#end
|
||||
|
||||
/**
|
||||
* RENDER OBJECTS
|
||||
*/
|
||||
@@ -732,10 +731,8 @@ class PlayState extends MusicBeatSubState
|
||||
static final MUSIC_EASE_RATIO:Float = 42;
|
||||
|
||||
var mirrorSongData:Bool = false;
|
||||
|
||||
// TODO: Refactor or document
|
||||
var generatedMusic:Bool = false;
|
||||
|
||||
var skipEndingTransition:Bool = false;
|
||||
|
||||
static final BACKGROUND_COLOR:FlxColor = FlxColor.BLACK;
|
||||
@@ -2302,8 +2299,35 @@ class PlayState extends MusicBeatSubState
|
||||
{
|
||||
pauseButton.animation.addByIndices('idle', 'back', [0], "", 24, false);
|
||||
pauseButton.animation.addByIndices('hold', 'back', [5], "", 24, false);
|
||||
pauseButton.animation.addByIndices('confirm', 'back',
|
||||
[6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], "", 24, false);
|
||||
pauseButton.animation.addByIndices('confirm', 'back', [
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
31,
|
||||
32
|
||||
], "", 24, false);
|
||||
pauseButton.scale.set(0.8, 0.8);
|
||||
pauseButton.updateHitbox();
|
||||
pauseButton.animation.play("idle");
|
||||
|
||||
@@ -9,7 +9,6 @@ import flixel.tweens.FlxEase;
|
||||
class ResultScore extends FlxTypedSpriteGroup<ScoreNum>
|
||||
{
|
||||
public var scoreShit(default, set):Int = 0;
|
||||
|
||||
public var scoreStart:Int = 0;
|
||||
|
||||
function set_scoreShit(val):Int
|
||||
@@ -17,7 +16,7 @@ class ResultScore extends FlxTypedSpriteGroup<ScoreNum>
|
||||
if (group == null || group.members == null) return val;
|
||||
var loopNum:Int = group.members.length - 1;
|
||||
var dumbNumb = Std.parseInt(Std.string(val));
|
||||
//var prevNum:ScoreNum;
|
||||
// var prevNum:ScoreNum;
|
||||
|
||||
dumbNumb = Std.int(Math.min(dumbNumb, Math.pow(10, group.members.length) - 1));
|
||||
|
||||
@@ -142,11 +141,22 @@ class ScoreNum extends FlxSprite
|
||||
public var shuffleTimer:FlxTimer;
|
||||
public var finalTween:FlxTween;
|
||||
public var finalDelay:Float = 0;
|
||||
|
||||
public var baseY:Float = 0;
|
||||
public var baseX:Float = 0;
|
||||
|
||||
var numToString:Array<String> = ["ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "DISABLED"];
|
||||
var numToString:Array<String> = [
|
||||
"ZERO",
|
||||
"ONE",
|
||||
"TWO",
|
||||
"THREE",
|
||||
"FOUR",
|
||||
"FIVE",
|
||||
"SIX",
|
||||
"SEVEN",
|
||||
"EIGHT",
|
||||
"NINE",
|
||||
"DISABLED"
|
||||
];
|
||||
|
||||
function finishShuffleTween():Void
|
||||
{
|
||||
|
||||
@@ -58,24 +58,18 @@ import funkin.util.DeviceUtil;
|
||||
class ResultState extends MusicBeatSubState
|
||||
{
|
||||
final params:ResultsStateParams;
|
||||
|
||||
final rank:ScoringRank;
|
||||
final songName:FlxBitmapText;
|
||||
final difficulty:FlxSprite;
|
||||
final clearPercentSmall:ClearPercentCounter;
|
||||
|
||||
final maskShaderSongName:LeftMaskShader = new LeftMaskShader();
|
||||
final maskShaderDifficulty:LeftMaskShader = new LeftMaskShader();
|
||||
|
||||
final resultsAnim:FunkinSprite;
|
||||
final ratingsPopin:FunkinSprite;
|
||||
final scorePopin:FunkinSprite;
|
||||
|
||||
final bgFlash:FlxSprite;
|
||||
|
||||
final highscoreNew:FlxSprite;
|
||||
final score:ResultScore;
|
||||
|
||||
var characterAtlasAnimations:Array<
|
||||
{
|
||||
sprite:FunkinSprite,
|
||||
@@ -89,10 +83,8 @@ class ResultState extends MusicBeatSubState
|
||||
sprite:FunkinSprite,
|
||||
delay:Float
|
||||
}> = [];
|
||||
|
||||
var playerCharacterId:Null<String> = null;
|
||||
var playerCharacter:Null<PlayableCharacter> = null;
|
||||
|
||||
var introMusicAudio:Null<FunkinSound> = null;
|
||||
|
||||
/**
|
||||
@@ -104,9 +96,7 @@ class ResultState extends MusicBeatSubState
|
||||
final cameraBG:FunkinCamera;
|
||||
final cameraScroll:FunkinCamera;
|
||||
final cameraEverything:FunkinCamera;
|
||||
|
||||
var blackTopBar:FlxSprite = new FlxSprite();
|
||||
|
||||
var busy:Bool = false;
|
||||
|
||||
public var isChartingMode(get, never):Bool;
|
||||
|
||||
@@ -730,8 +730,7 @@ class BaseCharacter extends Bopper
|
||||
{
|
||||
PlayState.instance.vocals.opponentVolume = 1;
|
||||
}
|
||||
else if (characterType != BF || characterType != DAD)
|
||||
tempVocals = false;
|
||||
else if (characterType != BF || characterType != DAD) tempVocals = false;
|
||||
}
|
||||
|
||||
super.playAnimation(name, restart, ignoreOther, reversed);
|
||||
|
||||
@@ -258,6 +258,7 @@ class HealthIcon extends FunkinSprite
|
||||
}
|
||||
|
||||
// Apply custom icons offset after hitbox update.
|
||||
|
||||
override public function updateHitbox():Void
|
||||
{
|
||||
super.updateHitbox();
|
||||
|
||||
@@ -15,7 +15,6 @@ class Subtitles extends FlxSpriteGroup
|
||||
{
|
||||
var subtitleText:SubtitlesText;
|
||||
var background:FlxSprite;
|
||||
|
||||
var subtitlesData:Array<SubtitleEntry>;
|
||||
var assignedSound:FlxSound;
|
||||
|
||||
|
||||
@@ -13,9 +13,7 @@ class TallyCounter extends FlxTypedSpriteGroup<FlxSprite>
|
||||
{
|
||||
public var curNumber:Float = 0;
|
||||
public var neededNumber:Int = 0;
|
||||
|
||||
public var flavour:Int = 0xFFFFFFFF;
|
||||
|
||||
public var align:FlxTextAlign = FlxTextAlign.LEFT;
|
||||
|
||||
public function new(x:Float, y:Float, neededNumber:Int = 0, ?flavour:Int, align:FlxTextAlign = FlxTextAlign.LEFT)
|
||||
|
||||
@@ -22,15 +22,11 @@ class VideoCutscene
|
||||
@:noCompletion
|
||||
static final DEFAULT_LANGUAGE:String = 'English';
|
||||
#end
|
||||
|
||||
static var blackScreen:FlxSprite;
|
||||
|
||||
static var cutsceneType:CutsceneType;
|
||||
|
||||
#if html5
|
||||
static var vid:FlxVideo;
|
||||
#end
|
||||
|
||||
#if hxvlc
|
||||
static var vid:FunkinVideoSprite;
|
||||
#end
|
||||
|
||||
@@ -86,7 +86,6 @@ class Conversation extends FlxSpriteGroup implements IDialogueScriptedClass impl
|
||||
var backdrop:Null<FunkinSprite>;
|
||||
|
||||
var currentSpeaker:Null<Speaker>;
|
||||
|
||||
var currentDialogueBox:Null<DialogueBox>;
|
||||
|
||||
public function new(id:String, ?params:Dynamic)
|
||||
@@ -650,6 +649,7 @@ class Conversation extends FlxSpriteGroup implements IDialogueScriptedClass impl
|
||||
}
|
||||
|
||||
// Managing things with a single enum is a lot easier than a multitude of flags.
|
||||
|
||||
enum ConversationState
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -71,7 +71,6 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple
|
||||
|
||||
var boxSprite:FlxSprite;
|
||||
var textDisplay:FunkinTypeText;
|
||||
|
||||
var text(default, set):String;
|
||||
|
||||
function set_text(value:String):String
|
||||
@@ -289,7 +288,9 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple
|
||||
FlxColor.fromString(_data.text.shadowColor ?? '#00000000'), false);
|
||||
textDisplay.borderSize = _data.text.shadowWidth ?? 2;
|
||||
// TODO: Add an option to configure this.
|
||||
textDisplay.sounds = [FunkinSound.load(Paths.sound('pixelText'), 0.6)];
|
||||
textDisplay.sounds = [
|
||||
FunkinSound.load(Paths.sound('pixelText'), 0.6)
|
||||
];
|
||||
|
||||
textDisplay.completeCallback = onTypingComplete;
|
||||
|
||||
|
||||
@@ -174,27 +174,31 @@ class FocusCameraSongEvent extends SongEvent
|
||||
*/
|
||||
public override function getEventSchema():SongEventSchema
|
||||
{
|
||||
return new SongEventSchema([{
|
||||
return new SongEventSchema([
|
||||
{
|
||||
name: "char",
|
||||
title: "Target",
|
||||
defaultValue: DEFAULT_TARGET,
|
||||
type: SongEventFieldType.ENUM,
|
||||
keys: ["Position" => -1, "Player" => 0, "Opponent" => 1, "Girlfriend" => 2]
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "x",
|
||||
title: "X Position",
|
||||
defaultValue: DEFAULT_X_POSITION,
|
||||
step: 10.0,
|
||||
type: SongEventFieldType.FLOAT,
|
||||
units: "px"
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "y",
|
||||
title: "Y Position",
|
||||
defaultValue: DEFAULT_Y_POSITION,
|
||||
step: 10.0,
|
||||
type: SongEventFieldType.FLOAT,
|
||||
units: "px"
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: 'duration',
|
||||
title: 'Duration',
|
||||
defaultValue: DEFAULT_DURATION,
|
||||
@@ -202,18 +206,37 @@ class FocusCameraSongEvent extends SongEvent
|
||||
step: 0.5,
|
||||
type: SongEventFieldType.FLOAT,
|
||||
units: 'steps'
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: 'ease',
|
||||
title: 'Easing Type',
|
||||
defaultValue: DEFAULT_CAMERA_EASE,
|
||||
type: SongEventFieldType.ENUM,
|
||||
keys: ['Linear' => 'linear', 'Instant (Ignores duration)' => 'INSTANT', 'Classic (Ignores duration)' => 'CLASSIC', 'Sine' => 'sine', 'Quad' => 'quad', 'Cube' => 'cube', 'Quart' => 'quart', 'Quint' => 'quint', 'Expo' => 'expo', 'Smooth Step' => 'smoothStep', 'Smoother Step' => 'smootherStep', 'Elastic' => 'elastic', 'Back' => 'back', 'Bounce' => 'bounce', 'Circ ' => 'circ',]
|
||||
}, {
|
||||
keys: [
|
||||
'Linear' => 'linear',
|
||||
'Instant (Ignores duration)' => 'INSTANT',
|
||||
'Classic (Ignores duration)' => 'CLASSIC',
|
||||
'Sine' => 'sine',
|
||||
'Quad' => 'quad',
|
||||
'Cube' => 'cube',
|
||||
'Quart' => 'quart',
|
||||
'Quint' => 'quint',
|
||||
'Expo' => 'expo',
|
||||
'Smooth Step' => 'smoothStep',
|
||||
'Smoother Step' => 'smootherStep',
|
||||
'Elastic' => 'elastic',
|
||||
'Back' => 'back',
|
||||
'Bounce' => 'bounce',
|
||||
'Circ ' => 'circ',
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'easeDir',
|
||||
title: 'Easing Direction',
|
||||
defaultValue: SongEvent.DEFAULT_EASE_DIR,
|
||||
type: SongEventFieldType.ENUM,
|
||||
keys: ['In' => 'In', 'Out' => 'Out', 'In/Out' => 'InOut']
|
||||
}]);
|
||||
}
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user