Add directionsOverride and colorsOverride to FunkinHitbox
This commit is contained in:
@@ -330,12 +330,12 @@ class FunkinHitbox extends FlxTypedSpriteGroup<FunkinHint>
|
||||
/**
|
||||
* Creates a new `FunkinHitbox` object.
|
||||
*/
|
||||
public function new(?schemeOverride:String = null):Void
|
||||
public function new(?schemeOverride:String = null, ?directionsOverride:Array<NoteDirection> = null, ?colorsOverride:Array<FlxColor> = null):Void
|
||||
{
|
||||
super();
|
||||
|
||||
final hintsColors:Array<FlxColor> = [0xFFC34B9A, 0xFF00FFFF, 0xFF12FB06, 0xFFF9393F];
|
||||
final hintsNoteDirections:Array<NoteDirection> = [NoteDirection.LEFT, NoteDirection.DOWN, NoteDirection.UP, NoteDirection.RIGHT];
|
||||
final hintsColors:Array<FlxColor> = (colorsOverride == null || colorsOverride.length == 0) ? [0xFFC34B9A, 0xFF00FFFF, 0xFF12FB06, 0xFFF9393F] : colorsOverride;
|
||||
final hintsNoteDirections:Array<NoteDirection> = (directionsOverride == null || directionsOverride.length == 0) ? [NoteDirection.LEFT, NoteDirection.DOWN, NoteDirection.UP, NoteDirection.RIGHT] : directionsOverride;
|
||||
final controlsScheme:String = (schemeOverride == null || schemeOverride.length == 0) ? Preferences.controlsScheme : schemeOverride;
|
||||
|
||||
switch (controlsScheme)
|
||||
|
||||
@@ -18,6 +18,7 @@ import funkin.graphics.FunkinCamera;
|
||||
import funkin.mobile.ui.FunkinHitbox;
|
||||
import funkin.mobile.input.PreciseInputHandler;
|
||||
import funkin.mobile.ui.FunkinBackspace;
|
||||
import funkin.play.notes.NoteDirection;
|
||||
#end
|
||||
|
||||
/**
|
||||
@@ -67,7 +68,8 @@ class MusicBeatState extends FlxTransitionableState implements IEventHandler
|
||||
public var backButton:FunkinBackspace;
|
||||
public var camControls:FunkinCamera;
|
||||
|
||||
public function addHitbox(?visible:Bool = true, ?initInput:Bool = true, ?schemeOverride:String = null):Void
|
||||
public function addHitbox(?visible:Bool = true, ?initInput:Bool = true, ?schemeOverride:String = null, ?directionsOverride:Array<NoteDirection> = null,
|
||||
?colorsOverride:Array<FlxColor> = null):Void
|
||||
{
|
||||
if (hitbox != null)
|
||||
{
|
||||
@@ -83,7 +85,7 @@ class MusicBeatState extends FlxTransitionableState implements IEventHandler
|
||||
camControls.bgColor = 0x0;
|
||||
}
|
||||
|
||||
hitbox = new FunkinHitbox(schemeOverride);
|
||||
hitbox = new FunkinHitbox(schemeOverride, directionsOverride, colorsOverride);
|
||||
hitbox.cameras = [camControls];
|
||||
hitbox.visible = visible;
|
||||
add(hitbox);
|
||||
|
||||
@@ -17,6 +17,7 @@ import funkin.graphics.FunkinCamera;
|
||||
import funkin.mobile.ui.FunkinHitbox;
|
||||
import funkin.mobile.input.PreciseInputHandler;
|
||||
import funkin.mobile.ui.FunkinBackspace;
|
||||
import funkin.play.notes.NoteDirection;
|
||||
#end
|
||||
|
||||
/**
|
||||
@@ -52,7 +53,8 @@ class MusicBeatSubState extends FlxSubState implements IEventHandler
|
||||
public var backButton:FunkinBackspace;
|
||||
public var camControls:FunkinCamera;
|
||||
|
||||
public function addHitbox(?visible:Bool = true, ?initInput:Bool = true, ?schemeOverride:String = null):Void
|
||||
public function addHitbox(?visible:Bool = true, ?initInput:Bool = true, ?schemeOverride:String = null, ?directionsOverride:Array<NoteDirection> = null,
|
||||
?colorsOverride:Array<FlxColor> = null):Void
|
||||
{
|
||||
if (hitbox != null)
|
||||
{
|
||||
@@ -68,7 +70,7 @@ class MusicBeatSubState extends FlxSubState implements IEventHandler
|
||||
camControls.bgColor = 0x0;
|
||||
}
|
||||
|
||||
hitbox = new FunkinHitbox(schemeOverride);
|
||||
hitbox = new FunkinHitbox(schemeOverride, directionsOverride, colorsOverride);
|
||||
hitbox.cameras = [camControls];
|
||||
hitbox.visible = visible;
|
||||
add(hitbox);
|
||||
|
||||
Reference in New Issue
Block a user