some lil null safety fix for SwipeUtil
This commit is contained in:
committed by
MoonDroid
parent
86241d53da
commit
acd10ffbe5
@@ -1846,8 +1846,6 @@ class FreeplayState extends MusicBeatSubState
|
||||
{
|
||||
if (_pressedOnSelected && TouchUtil.touch != null)
|
||||
{
|
||||
// Have to turn off null safety in-order to compile this!! -Zack
|
||||
@:nullSafety(Off)
|
||||
if (SwipeUtil.swipeLeft)
|
||||
{
|
||||
draggingDifficulty = true;
|
||||
@@ -2266,7 +2264,6 @@ class FreeplayState extends MusicBeatSubState
|
||||
#if FEATURE_TOUCH_CONTROLS
|
||||
function handleDiffDragRelease(diff:FlxSprite):Void
|
||||
{
|
||||
@:nullSafety(Off)
|
||||
if ((diffSelLeft != null && diffSelLeft.x + 20 > diff.x) || SwipeUtil.justSwipedLeft)
|
||||
{
|
||||
handleDiffBoundaryChange(1);
|
||||
|
||||
@@ -143,7 +143,7 @@ class SwipeUtil
|
||||
{
|
||||
#if FEATURE_TOUCH_CONTROLS
|
||||
#if mobile
|
||||
return TouchUtil.touch != null && TouchUtil.touch.justMovedUp;
|
||||
return TouchUtil.touch?.justMovedUp ?? false;
|
||||
#else
|
||||
return FlxG.mouse.justMovedUp && FlxG.mouse.pressed;
|
||||
#end
|
||||
@@ -157,7 +157,7 @@ class SwipeUtil
|
||||
{
|
||||
#if FEATURE_TOUCH_CONTROLS
|
||||
#if mobile
|
||||
return TouchUtil.touch != null && TouchUtil.touch.justMovedRight;
|
||||
return TouchUtil.touch?.justMovedRight ?? false;
|
||||
#else
|
||||
return FlxG.mouse.justMovedRight && FlxG.mouse.pressed;
|
||||
#end
|
||||
@@ -171,7 +171,7 @@ class SwipeUtil
|
||||
{
|
||||
#if FEATURE_TOUCH_CONTROLS
|
||||
#if mobile
|
||||
return TouchUtil.touch != null && TouchUtil.touch.justMovedLeft;
|
||||
return TouchUtil.touch?.justMovedLeft ?? false;
|
||||
#else
|
||||
return FlxG.mouse.justMovedLeft && FlxG.mouse.pressed;
|
||||
#end
|
||||
@@ -185,7 +185,7 @@ class SwipeUtil
|
||||
{
|
||||
#if FEATURE_TOUCH_CONTROLS
|
||||
#if mobile
|
||||
return TouchUtil.touch != null && TouchUtil.touch.justMovedDown;
|
||||
return TouchUtil.touch?.justMovedDown ?? false;
|
||||
#else
|
||||
return FlxG.mouse.justMovedDown && FlxG.mouse.pressed;
|
||||
#end
|
||||
|
||||
Reference in New Issue
Block a user