From 33e236fd4578d115097947130e2e213fb4114ff2 Mon Sep 17 00:00:00 2001 From: KadeDev Date: Fri, 2 Apr 2021 14:44:15 -0700 Subject: [PATCH] the funny commit --- source/Discord.hx | 5 +++++ source/MusicBeatState.hx | 5 +++++ source/OptionsMenu.hx | 19 +++++++++++++------ source/TitleState.hx | 5 +++++ 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/source/Discord.hx b/source/Discord.hx index 9d5b103..5dc9c64 100644 --- a/source/Discord.hx +++ b/source/Discord.hx @@ -28,6 +28,11 @@ class DiscordClient DiscordRpc.shutdown(); } + public static function shutdown() + { + DiscordRpc.shutdown(); + } + static function onReady() { DiscordRpc.presence({ diff --git a/source/MusicBeatState.hx b/source/MusicBeatState.hx index afe4f3f..3900654 100644 --- a/source/MusicBeatState.hx +++ b/source/MusicBeatState.hx @@ -1,5 +1,6 @@ package; +import Discord.DiscordClient; import flixel.tweens.FlxTween; import flixel.util.FlxColor; import openfl.Lib; @@ -32,6 +33,7 @@ class MusicBeatState extends FlxUIState super.create(); } + var array:Array = [ FlxColor.fromRGB(148, 0, 211), FlxColor.fromRGB(75, 0, 130), @@ -66,6 +68,9 @@ class MusicBeatState extends FlxUIState else skippedFrames++; + if ((cast (Lib.current.getChildAt(0), Main)).getFPSCap != FlxG.save.data.fpsCap) + (cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap); + super.update(elapsed); } diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 5b4ca64..400c271 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -84,6 +84,13 @@ class OptionsMenu extends MusicBeatState var isCat:Bool = false; + function truncateFloat( number : Float, precision : Int): Float { + var num = number; + num = num * Math.pow(10, precision); + num = Math.round( num ) / Math.pow(10, precision); + return num; + } + override function update(elapsed:Float) { super.update(elapsed); @@ -149,23 +156,23 @@ class OptionsMenu extends MusicBeatState versionShit.text = "Current Scroll Speed: " + FlxG.save.data.scrollSpeed + " - Description - " + currentDescription; default: if (FlxG.keys.pressed.RIGHT) - FlxG.save.data.offset += 0.1; + FlxG.save.data.offset += 0.01; if (FlxG.keys.pressed.LEFT) - FlxG.save.data.offset -= 0.1; + FlxG.save.data.offset -= 0.01; - versionShit.text = "Offset (Left, Right): " + FlxG.save.data.offset + " - Description - " + currentDescription; + versionShit.text = "Offset (Left, Right): " + truncateFloat(FlxG.save.data.offset,2) + " - Description - " + currentDescription; } } else { if (FlxG.keys.pressed.RIGHT) - FlxG.save.data.offset++; + FlxG.save.data.offset+= 0.01; if (FlxG.keys.pressed.LEFT) - FlxG.save.data.offset--; + FlxG.save.data.offset-= 0.01; - versionShit.text = "Offset (Left, Right): " + FlxG.save.data.offset + " - Description - " + currentDescription; + versionShit.text = "Offset (Left, Right): " + truncateFloat(FlxG.save.data.offset,2) + " - Description - " + currentDescription; } diff --git a/source/TitleState.hx b/source/TitleState.hx index a8515b5..ec98454 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -61,6 +61,11 @@ class TitleState extends MusicBeatState #if desktop DiscordClient.initialize(); + + Application.current.onExit.add (function (exitCode) { + DiscordClient.shutdown(); + }); + #end curWacky = FlxG.random.getObject(getIntroTextShit());