From 02a52ba1082cdf5438c5ef944648ff316b5b7f97 Mon Sep 17 00:00:00 2001 From: AT <101066547+UmbratheUmbreon@users.noreply.github.com> Date: Fri, 10 Mar 2023 20:24:24 -0800 Subject: [PATCH] more bug fixes --- assets/preload/update/tracking/GitVer.txt | 2 +- gitVersion.txt | 1 - hxformat.json | 16 ------------ source/HUD.hx | 2 +- source/HealthBar.hx | 9 ++++++- source/Main.hx | 2 +- source/Paths.hx | 2 +- source/TitleState.hx | 2 +- source/options/BaseOptionsMenu.hx | 31 +++++++++++++---------- source/options/OptionsSubState.hx | 1 + 10 files changed, 31 insertions(+), 37 deletions(-) delete mode 100644 gitVersion.txt delete mode 100644 hxformat.json diff --git a/assets/preload/update/tracking/GitVer.txt b/assets/preload/update/tracking/GitVer.txt index fa88e3c..7c58df9 100644 --- a/assets/preload/update/tracking/GitVer.txt +++ b/assets/preload/update/tracking/GitVer.txt @@ -1 +1 @@ -0.8.0a \ No newline at end of file +0.8.0b \ No newline at end of file diff --git a/gitVersion.txt b/gitVersion.txt deleted file mode 100644 index 8adc70f..0000000 --- a/gitVersion.txt +++ /dev/null @@ -1 +0,0 @@ -0.8.0 \ No newline at end of file diff --git a/hxformat.json b/hxformat.json deleted file mode 100644 index 4d31f14..0000000 --- a/hxformat.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "lineEnds": { - "leftCurly": "both", - "rightCurly": "both", - "emptyCurly": "break", - "objectLiteralCurly": { - "leftCurly": "after" - } - }, - "sameLine": { - "ifElse": "next", - "doWhile": "next", - "tryBody": "next", - "tryCatch": "next" - } -} diff --git a/source/HUD.hx b/source/HUD.hx index 8ed453f..8bbdc86 100644 --- a/source/HUD.hx +++ b/source/HUD.hx @@ -79,7 +79,7 @@ class HUD extends FlxSpriteGroup { timeBar.createGradientBar([0xFF0a0a0a], [color = FlxColor.fromRGB(PlayState.instance.dad.healthColorArray[0].red, PlayState.instance.dad.healthColorArray[0].green, PlayState.instance.dad.healthColorArray[0].blue), FlxColor.subtract(color, 0x00333333)], blockyness, 90); } catch(e) { timeBar.createGradientBar([0xFF0a0a0a], [color = FlxColor.fromRGB(255,255,255), FlxColor.subtract(color, 0x00333333)], blockyness, 90); - trace('exception: ' + e); + FlxG.log.add('Error: ' + e + ' at HUD.hx (78-80)'); } if (ClientPrefs.settings.get("lowQuality") || PlayState.isPixelStage) timeBar.numDivisions = Std.int((timeBar.width)/4); diff --git a/source/HealthBar.hx b/source/HealthBar.hx index 185fc32..83cad00 100644 --- a/source/HealthBar.hx +++ b/source/HealthBar.hx @@ -9,7 +9,14 @@ class HealthBar extends flixel.ui.FlxBar public function splitColor(filled:Bool = false, colors:Array):HealthBar { //TODO: Make this function not use a switch and be able to be any amount - var pixelData:BitmapData = FlxG.bitmap.get((filled ? _filledKey : _emptyKey)).bitmap; + var pixelData:BitmapData; + try { + pixelData = FlxG.bitmap.get((filled ? _filledKey : _emptyKey)).bitmap; + } catch(e) { + FlxG.log.add('Error: ' + e + ' at Healthbar.hx (12-14)'); + return this; + } + final height:Int = pixelData.height; switch (colors.length) { case 1: diff --git a/source/Main.hx b/source/Main.hx index d7850cb..be8993f 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -60,7 +60,7 @@ class Main extends Sprite * * Use `debugVersion` to get the version with build date. */ - public static final denpaEngineVersion:GameVersion = new GameVersion(0, 8, 0, 'a'); + public static final denpaEngineVersion:GameVersion = new GameVersion(0, 8, 0, 'b'); public static var fpsCounter:FramerateDisplay; public static var ramCount:DebugDisplay; diff --git a/source/Paths.hx b/source/Paths.hx index 6726d33..e0437a0 100644 --- a/source/Paths.hx +++ b/source/Paths.hx @@ -512,7 +512,7 @@ class Paths if (FileSystem.exists('mods/data/stages')) { for (a in FileSystem.readDirectory('mods/data/stages')) { if (!a.endsWith('.json')) continue; - characterMap.set(a.substr(0, a.length - 5), ''); + stageMap.set(a.substr(0, a.length - 5), ''); } } if (FileSystem.exists('mods/images/icons')) { diff --git a/source/TitleState.hx b/source/TitleState.hx index af797c5..c3f9e30 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -379,7 +379,7 @@ class TitleState extends MusicBeatState titleText.animation.play('press'); } - if (!ClientPrefs.settings.get("lowQuality")) { + if (!ClientPrefs.settings.get("lowQuality") && swagShader != null) { swagShader.hue = 0; swagShader.brightness = 0; } diff --git a/source/options/BaseOptionsMenu.hx b/source/options/BaseOptionsMenu.hx index e2d2ca4..7e745ea 100644 --- a/source/options/BaseOptionsMenu.hx +++ b/source/options/BaseOptionsMenu.hx @@ -156,24 +156,27 @@ class BaseOptionsMenu extends MusicBeatSubstate var nextAccept:Int = 5; var holdTime:Float = 0; var holdValue:Float = 0; + var stopLerping:Bool = false; override function update(elapsed:Float) { final lerpVal:Float = CoolUtil.clamp(elapsed * 9.6, 0, 1); - for (i=>item in grpOptions.members) { - @:privateAccess { - if (lerpList[i]) { - item.y = FlxMath.lerp(item.y, (item.scaledY * item.yMult) + (FlxG.height * 0.48) + item.yAdd, lerpVal); - if(item.forceX != Math.NEGATIVE_INFINITY) { - item.x = item.forceX; - } else { - item.x = FlxMath.lerp(item.x, (item.isBold ? 30 : 15) + item.alignAdd, lerpVal); - } - } else { - item.y = ((item.scaledY * item.yMult) + (FlxG.height * 0.48) + item.yAdd); - if(item.forceX != Math.NEGATIVE_INFINITY) { - item.x = item.forceX; + if (!stopLerping) { + for (i=>item in grpOptions.members) { + @:privateAccess { + if (lerpList[i]) { + item.y = FlxMath.lerp(item.y, (item.scaledY * item.yMult) + (FlxG.height * 0.48) + item.yAdd, lerpVal); + if(item.forceX != Math.NEGATIVE_INFINITY) { + item.x = item.forceX; + } else { + item.x = FlxMath.lerp(item.x, (item.isBold ? 30 : 15) + item.alignAdd, lerpVal); + } } else { - item.x = ((item.isBold ? 30 : 15) + item.alignAdd); + item.y = ((item.scaledY * item.yMult) + (FlxG.height * 0.48) + item.yAdd); + if(item.forceX != Math.NEGATIVE_INFINITY) { + item.x = item.forceX; + } else { + item.x = ((item.isBold ? 30 : 15) + item.alignAdd); + } } } } diff --git a/source/options/OptionsSubState.hx b/source/options/OptionsSubState.hx index a49dce2..1f7a9a8 100644 --- a/source/options/OptionsSubState.hx +++ b/source/options/OptionsSubState.hx @@ -1145,6 +1145,7 @@ class MiscSettingsSubState extends BaseOptionsMenu } function openCrossfadeOptions() { + stopLerping = true; for (option in grpOptions) { if (option.text != 'CrossFade Options') { option.align = 'none';