From 639a018adb418889068fdae55a1be5850578b093 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Thu, 22 Dec 2022 21:09:19 +0100 Subject: [PATCH] Flixel 5.0.0 migration + FlxColor in HScript --- buildnumber.txt | 2 +- source/funkin/desktop/sprites/Checkbox.hx | 3 ++- source/funkin/scripting/Script.hx | 2 -- source/funkin/system/CoolUtil.hx | 4 +++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/buildnumber.txt b/buildnumber.txt index 62cab397..870e31e0 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1683 \ No newline at end of file +1697 \ No newline at end of file diff --git a/source/funkin/desktop/sprites/Checkbox.hx b/source/funkin/desktop/sprites/Checkbox.hx index 2672bc99..e541f151 100644 --- a/source/funkin/desktop/sprites/Checkbox.hx +++ b/source/funkin/desktop/sprites/Checkbox.hx @@ -1,5 +1,6 @@ package funkin.desktop.sprites; +import flixel.math.FlxRect; import flixel.FlxSprite; import flixel.text.FlxText; import flixel.FlxObject; @@ -26,7 +27,7 @@ class Checkbox extends WindowText { super.update(elapsed); checkboxSprite.update(elapsed); - var overlaps = DesktopMain.mouseInput.overlaps(this, camera) || DesktopMain.mouseInput.overlaps(checkboxSprite, camera); + var overlaps = DesktopMain.mouseInput.overlapsRect(this, new FlxRect(x, y, width + 20, height), camera); var pressed = DesktopMain.mouseInput.pressed; if (overlaps) { diff --git a/source/funkin/scripting/Script.hx b/source/funkin/scripting/Script.hx index 78855951..7a94fcae 100644 --- a/source/funkin/scripting/Script.hx +++ b/source/funkin/scripting/Script.hx @@ -41,13 +41,11 @@ class Script extends FlxBasic implements IFlxDestroyable { "FlxSound" => flixel.system.FlxSound, "FlxAssets" => flixel.system.FlxAssets, "FlxMath" => flixel.math.FlxMath, - "FlxPoint" => flixel.math.FlxPoint, "FlxGroup" => flixel.group.FlxGroup, "FlxTypedGroup" => flixel.group.FlxGroup.FlxTypedGroup, "FlxSpriteGroup" => flixel.group.FlxSpriteGroup, "FlxTypeText" => flixel.addons.text.FlxTypeText, "FlxText" => flixel.text.FlxText, - "FlxAxes" => flixel.util.FlxAxes, "FlxTimer" => flixel.util.FlxTimer, // Engine related stuff diff --git a/source/funkin/system/CoolUtil.hx b/source/funkin/system/CoolUtil.hx index b79a2403..104c6132 100644 --- a/source/funkin/system/CoolUtil.hx +++ b/source/funkin/system/CoolUtil.hx @@ -76,7 +76,7 @@ class CoolUtil label++; rSize /= 1024; } - return '${Std.int(rSize) + "." + addZeros(Std.string(Math.round((rSize % 1) * 100)), 2)}${labels[label]}'; + return '${Std.int(rSize) + "." + addZeros(Std.string(Std.int((rSize % 1) * 100)), 2)}${labels[label]}'; } public static function fpsLerp(v1:Float, v2:Float, ratio:Float):Float { @@ -246,6 +246,8 @@ class CoolUtil obj.x = (cam.width - obj.width) / 2; case Y: obj.y = (cam.height - obj.height) / 2; + case NONE: + } }