From 9e561ca8a71498d10a67fb3fc7aa94e930edfe9e Mon Sep 17 00:00:00 2001 From: TheRealJake_12 <84357907+TheRealJake12@users.noreply.github.com> Date: Sun, 12 Nov 2023 12:24:30 -0600 Subject: [PATCH] additional fixes --- source/Init.hx | 1 + source/Note.hx | 81 ++++++++++++++--------------------- source/PlayState.hx | 6 +++ source/ResultsScreen.hx | 8 ++-- source/debug/ChartingState.hx | 19 +++++--- 5 files changed, 57 insertions(+), 58 deletions(-) diff --git a/source/Init.hx b/source/Init.hx index df16645e..65bf5b46 100644 --- a/source/Init.hx +++ b/source/Init.hx @@ -35,6 +35,7 @@ class Init extends MusicBeatState CustomNoteHelpers.Skin.updateNoteskins(); CustomNoteHelpers.Splash.updateNotesplashes(); + if (FlxG.save.data.volDownBind == null) FlxG.save.data.volDownBind = "MINUS"; diff --git a/source/Note.hx b/source/Note.hx index 667a85b7..0e83f3fa 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -172,13 +172,10 @@ class Note extends FlxSprite { case 'hurt': { - switch (FlxG.save.data.noteskin) - { - default: - frames = Paths.getSparrowAtlas("notetypes/hurt_Arrows", 'shared'); - case 1: - frames = Paths.getSparrowAtlas("notetypes/hurt_Circles", 'shared'); - } + if (CustomNoteHelpers.Skin.getNoteskinByID(FlxG.save.data.noteskin).contains("Circles")) + frames = Paths.getSparrowAtlas("notetypes/hurt_Circles", 'shared'); + else + frames = Paths.getSparrowAtlas("notetypes/hurt_Arrows", 'shared'); for (i in 0...4) { animation.addByPrefix(dataColor[i] + 'Scroll', dataColor[i] + ' alone'); // Normal notes @@ -187,13 +184,10 @@ class Note extends FlxSprite } } case 'mustpress': - switch (FlxG.save.data.noteskin) - { - default: - frames = Paths.getSparrowAtlas("notetypes/mustpress_Arrows", 'shared'); - case 1: - frames = Paths.getSparrowAtlas("notetypes/mustpress_Circles", 'shared'); - } + if (CustomNoteHelpers.Skin.getNoteskinByID(FlxG.save.data.noteskin).contains("Circles")) + frames = Paths.getSparrowAtlas("notetypes/mustpress_Circles", 'shared'); + else + frames = Paths.getSparrowAtlas("notetypes/mustpress_Arrows", 'shared'); for (i in 0...4) { animation.addByPrefix(dataColor[i] + 'Scroll', dataColor[i] + ' alone'); // Normal notes @@ -238,13 +232,10 @@ class Note extends FlxSprite { case 'hurt': { - switch (FlxG.save.data.noteskin) - { - default: - frames = Paths.getSparrowAtlas("notetypes/hurt_Arrows", 'shared'); - case 1: - frames = Paths.getSparrowAtlas("notetypes/hurt_Circles", 'shared'); - } + if (CustomNoteHelpers.Skin.getNoteskinByID(FlxG.save.data.noteskin).contains("Circles")) + frames = Paths.getSparrowAtlas("notetypes/hurt_Circles", 'shared'); + else + frames = Paths.getSparrowAtlas("notetypes/hurt_Arrows", 'shared'); for (i in 0...4) { animation.addByPrefix(dataColor[i] + 'Scroll', dataColor[i] + ' alone'); // Normal notes @@ -257,13 +248,10 @@ class Note extends FlxSprite case 'mustpress': { - switch (FlxG.save.data.noteskin) - { - default: - frames = Paths.getSparrowAtlas("notetypes/mustpress_Arrows", 'shared'); - case 1: - frames = Paths.getSparrowAtlas("notetypes/mustpress_Circles", 'shared'); - } + if (CustomNoteHelpers.Skin.getNoteskinByID(FlxG.save.data.noteskin).contains("Circles")) + frames = Paths.getSparrowAtlas("notetypes/mustpress_Circles", 'shared'); + else + frames = Paths.getSparrowAtlas("notetypes/mustpress_Arrows", 'shared'); for (i in 0...4) { animation.addByPrefix(dataColor[i] + 'Scroll', dataColor[i] + ' alone'); // Normal notes @@ -300,13 +288,10 @@ class Note extends FlxSprite { case 'hurt': { - switch (FlxG.save.data.noteskin) - { - default: - frames = Paths.getSparrowAtlas("notetypes/hurt_Arrows", 'shared'); - case 1: - frames = Paths.getSparrowAtlas("notetypes/hurt_Circles", 'shared'); - } + if (CustomNoteHelpers.Skin.getNoteskinByID(FlxG.save.data.noteskin).contains("Circles")) + frames = Paths.getSparrowAtlas("notetypes/hurt_Circles", 'shared'); + else + frames = Paths.getSparrowAtlas("notetypes/hurt_Arrows", 'shared'); for (i in 0...4) { animation.addByPrefix(dataColor[i] + 'Scroll', dataColor[i] + ' alone'); // Normal notes @@ -316,13 +301,10 @@ class Note extends FlxSprite } case 'mustpress': - switch (FlxG.save.data.noteskin) - { - default: - frames = Paths.getSparrowAtlas("notetypes/mustpress_Arrows", 'shared'); - case 1: - frames = Paths.getSparrowAtlas("notetypes/mustpress_Circles", 'shared'); - } + if (CustomNoteHelpers.Skin.getNoteskinByID(FlxG.save.data.noteskin).contains("Circles")) + frames = Paths.getSparrowAtlas("notetypes/mustpress_Circles", 'shared'); + else + frames = Paths.getSparrowAtlas("notetypes/mustpress_Arrows", 'shared'); for (i in 0...4) { animation.addByPrefix(dataColor[i] + 'Scroll', dataColor[i] + ' alone'); // Normal notes @@ -330,11 +312,14 @@ class Note extends FlxSprite animation.addByPrefix(dataColor[i] + 'holdend', dataColor[i] + ' tail'); // Tails } default: - { - if (isPlayer) - frames = PlayState.noteskinSprite; - else - frames = PlayState.cpuNoteskinSprite; + { + switch (isPlayer) + { + case true: + frames = PlayState.noteskinSprite; + case false: + frames = PlayState.cpuNoteskinSprite; + } for (i in 0...4) { animation.addByPrefix(dataColor[i] + 'Scroll', dataColor[i] + ' alone'); // Normal notes @@ -422,7 +407,7 @@ class Note extends FlxSprite prevNote.scale.y *= (stepHeight / prevNote.height); prevNote.updateHitbox(); - if (antialiasing) + if (noteTypeCheck != 'pixel') prevNote.scale.y *= 1.0 + (1.0 / prevNote.frameHeight); prevNote.updateHitbox(); diff --git a/source/PlayState.hx b/source/PlayState.hx index d1320b26..9671e817 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -4214,6 +4214,12 @@ class PlayState extends MusicBeatState { var bpmRatio = Conductor.bpm / 100; + if (PlayStateChangeables.zoom < 0.8) + PlayStateChangeables.zoom = 0.8; + if (PlayStateChangeables.zoom > 1.2) + PlayStateChangeables.zoom = 1.2; + // this motherfucker fucks me so much. + FlxG.camera.zoom = FlxMath.lerp(zoomForTweens, FlxG.camera.zoom, CoolUtil.boundTo(1 - (elapsed * 3.125 * bpmRatio * songMultiplier * zoomMultiplier), 0, 1)); camHUD.zoom = FlxMath.lerp(PlayStateChangeables.zoom * zoomForHUDTweens, camHUD.zoom, diff --git a/source/ResultsScreen.hx b/source/ResultsScreen.hx index d1dc1094..c24dea7c 100644 --- a/source/ResultsScreen.hx +++ b/source/ResultsScreen.hx @@ -72,7 +72,7 @@ class ResultsScreen extends FlxSubState text = new FlxText(20, -55, 0, "Song Cleared!"); text.size = 34; text.font = Paths.font("vcr.ttf"); - text.setBorderStyle(FlxTextBorderStyle.OUTLINE, FlxColor.BLACK, 4, 1); + text.setBorderStyle(FlxTextBorderStyle.OUTLINE_FAST, FlxColor.BLACK, 2, 2); text.color = FlxColor.WHITE; text.scrollFactor.set(); add(text); @@ -95,7 +95,7 @@ class ResultsScreen extends FlxSubState '); comboText.size = 28; comboText.font = Paths.font("vcr.ttf"); - comboText.setBorderStyle(FlxTextBorderStyle.OUTLINE, FlxColor.BLACK, 4, 1); + comboText.setBorderStyle(FlxTextBorderStyle.OUTLINE_FAST, FlxColor.BLACK, 2, 2); comboText.color = FlxColor.WHITE; comboText.scrollFactor.set(); add(comboText); @@ -103,7 +103,7 @@ class ResultsScreen extends FlxSubState contText = new FlxText(FlxG.width - 475, FlxG.height + 50, 0, 'Press ENTER to continue.'); contText.font = Paths.font("vcr.ttf"); contText.size = 28; - contText.setBorderStyle(FlxTextBorderStyle.OUTLINE, FlxColor.BLACK, 4, 1); + contText.setBorderStyle(FlxTextBorderStyle.OUTLINE_FAST, FlxColor.BLACK, 2, 2); contText.color = FlxColor.WHITE; contText.scrollFactor.set(); add(contText); @@ -166,7 +166,7 @@ class ResultsScreen extends FlxSubState 'Mean: ${mean}ms (MARV:${Ratings.timingWindows[4]}ms,SICK:${Ratings.timingWindows[3]}ms,GOOD:${Ratings.timingWindows[2]}ms,BAD:${Ratings.timingWindows[1]}ms,SHIT:${Ratings.timingWindows[0]}ms)'); settingsText.size = 16; settingsText.font = Paths.font("vcr.ttf"); - settingsText.setBorderStyle(FlxTextBorderStyle.OUTLINE, FlxColor.BLACK, 2, 1); + settingsText.setBorderStyle(FlxTextBorderStyle.OUTLINE_FAST, FlxColor.BLACK, 2, 2); settingsText.color = FlxColor.WHITE; settingsText.scrollFactor.set(); add(settingsText); diff --git a/source/debug/ChartingState.hx b/source/debug/ChartingState.hx index d9754889..58e1c1b1 100644 --- a/source/debug/ChartingState.hx +++ b/source/debug/ChartingState.hx @@ -30,6 +30,7 @@ import openfl.events.Event; import openfl.events.IOErrorEvent; import openfl.media.Sound; import openfl.net.FileReference; +import CoolUtil.CoolText; #if FEATURE_DISCORD import Discord.DiscordClient; #end @@ -69,7 +70,7 @@ class ChartingState extends MusicBeatState var noteShit:Int = 0; var shits:Array = ['normal', 'hurt', 'mustpress']; - var notetypetext:FlxText; + var notetypetext:CoolText; public var beatsShown:Float = 1; // for the zoom factor public var zoomFactor:Float = 0.4; @@ -81,7 +82,7 @@ class ChartingState extends MusicBeatState // var curSection:Int = 0; public static var lastSection:Int = 0; - var bpmTxt:FlxText; + var bpmTxt:CoolText; var strumLine:FlxSprite; var curSong:String = 'Dad Battle'; @@ -373,13 +374,17 @@ class ChartingState extends MusicBeatState leftIcon.scrollFactor.set(); rightIcon.scrollFactor.set(); - bpmTxt = new FlxText(985, 25, 0, "", 16); - bpmTxt.font = Paths.font("vcr.ttf"); + bpmTxt = new CoolText(985, 25, 16, 16, Paths.bitmapFont('fonts/vcr')); + bpmTxt.autoSize = true; + bpmTxt.antialiasing = true; + bpmTxt.updateHitbox(); bpmTxt.scrollFactor.set(); add(bpmTxt); - notetypetext = new FlxText(825, 650, "", 28); - notetypetext.font = Paths.font("vcr.ttf"); + notetypetext = new CoolText(825, 650, 28, 28, Paths.bitmapFont('fonts/vcr')); + notetypetext.autoSize = true; + notetypetext.antialiasing = true; + notetypetext.updateHitbox(); notetypetext.scrollFactor.set(); add(notetypetext); @@ -3106,6 +3111,7 @@ class ChartingState extends MusicBeatState + (doSnapShit ? "Snap enabled" : "Snap disabled") + (FlxG.save.data.showHelp ? "\n\nHelp:\nCtrl-MWheel : Zoom in/out\nShift-Left/Right :\n Change playback speed\nCtrl-Drag Click : Select notes\nCtrl-C : Copy notes\nCtrl-V : Paste notes\nCtrl-Z : Undo\nDelete : Delete selection\nCTRL-Left/Right :\n Change Snap\nHold Shift : Disable Snap\nClick:\n Place notes\nUp/Down :\n Move selected notes 1 step\nShift-Up/Down :\n Move selected notes 1 beat\nSpace: Play Music\nEnter : Preview\n Z/X Change Notetype.\nPress F1 to hide/show this!" : ""); + bpmTxt.updateHitbox(); super.update(elapsed); } @@ -3800,6 +3806,7 @@ class ChartingState extends MusicBeatState notename = "Must Press"; } notetypetext.text = "Note Type: " + notename; + notetypetext.updateHitbox(); } function cleanObjects()