FUCK SPACES!!!! TABS RULES!!! 💪💪💪💪

This commit is contained in:
Yoshman29
2023-03-25 22:53:47 +01:00
parent c259385f2a
commit a63e5f5958
135 changed files with 6799 additions and 6799 deletions
+23 -23
View File
@@ -4,35 +4,35 @@ import flixel.FlxState;
import funkin.scripting.events.*;
class EventManager {
// map doesnt work for that
public static var eventValues:Array<CancellableEvent> = [];
public static var eventKeys:Array<Class<CancellableEvent>> = [];
// map doesnt work for that
public static var eventValues:Array<CancellableEvent> = [];
public static var eventKeys:Array<Class<CancellableEvent>> = [];
public static function get<T:CancellableEvent>(cl:Class<T>):T {
var c:Class<CancellableEvent> = cast cl;
public static function get<T:CancellableEvent>(cl:Class<T>):T {
var c:Class<CancellableEvent> = cast cl;
var index = eventKeys.indexOf(c);
if (index < 0) {
eventKeys.push(c);
eventValues.push(Type.createInstance(c, []));
return cast eventValues.last();
}
var index = eventKeys.indexOf(c);
if (index < 0) {
eventKeys.push(c);
eventValues.push(Type.createInstance(c, []));
return cast eventValues.last();
}
return cast eventValues[index];
}
return cast eventValues[index];
}
public static function reset() {
for(v in eventValues)
v.destroy();
eventValues = [];
eventKeys = [];
}
public static function reset() {
for(v in eventValues)
v.destroy();
eventValues = [];
eventKeys = [];
}
public static function init() {
public static function init() {
FlxG.signals.preStateCreate.add(onStateSwitch);
}
}
private static inline function onStateSwitch(newState:FlxState)
reset();
private static inline function onStateSwitch(newState:FlxState)
reset();
}