From 13c629fcb79402d62a8b0693d87165f19fb1ff7b Mon Sep 17 00:00:00 2001 From: Vortex <73261680+Vortex2Oblivion@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:47:24 -0500 Subject: [PATCH] fix antialiasing when changing ui skins in charter --- .../data/character data/nene/script.hx | 2 +- source/toolbox/ChartingState.hx | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mods/Friday Night Funkin'/data/character data/nene/script.hx b/mods/Friday Night Funkin'/data/character data/nene/script.hx index 73f836db49..761c87de05 100644 --- a/mods/Friday Night Funkin'/data/character data/nene/script.hx +++ b/mods/Friday Night Funkin'/data/character data/nene/script.hx @@ -1,4 +1,4 @@ -import game.graphics.ABotVis; +import game.ABotVis; import flixe.sound.FlxSound; var pupilState:Int = 0; diff --git a/source/toolbox/ChartingState.hx b/source/toolbox/ChartingState.hx index e75d0a5679..5189724d38 100644 --- a/source/toolbox/ChartingState.hx +++ b/source/toolbox/ChartingState.hx @@ -128,8 +128,6 @@ class ChartingState extends MusicBeatState { Assets.loadLibrary("shared").onComplete(function(_) {}); #end - - menuBG = new FlxSprite().makeBackground(0x3D3D3D); menuBG.updateHitbox(); @@ -1015,14 +1013,13 @@ class ChartingState extends MusicBeatState { if (openfl.Assets.cache.hasSound(Paths.voices(daSong, difficulty_name))) openfl.Assets.cache.removeSound(Paths.voices(daSong, difficulty_name)); - FlxG.sound.music = new FlxSound().loadEmbedded(Paths.inst(daSong, _song.specialAudioName ?? difficulty_name, _song.player1)); + FlxG.sound.music = new FlxSound().loadEmbedded(Paths.inst(daSong, _song.specialAudioName ?? difficulty_name, _song.player1)); FlxG.sound.music.persist = true; vocals = new SoundGroup(2); - if (_song.needsVoices){ + if (_song.needsVoices) { for (character in ['player', 'opponent', _song.player1, _song.player2]) { - var soundPath:String = Paths.voices(daSong, _song.specialAudioName ?? difficulty_name, character, - _song.player1); + var soundPath:String = Paths.voices(daSong, _song.specialAudioName ?? difficulty_name, character, _song.player1); if (!addedVocals.contains(soundPath)) { vocals.add(new FlxSound().loadEmbedded(soundPath)); addedVocals.push(soundPath); @@ -1030,7 +1027,7 @@ class ChartingState extends MusicBeatState { } } - //FlxG.sound.list.add(vocals); + // FlxG.sound.list.add(vocals); FlxG.sound.music.pause(); vocals.pause(); @@ -1744,15 +1741,16 @@ class ChartingState extends MusicBeatState { var json:CharacterConfig = cast Json.parse(rawJson); - return (json.healthIcon != null && json.healthIcon != "" ? json.healthIcon : char); + return (json.healthIcon ?? char); } - function updateNoteUI():Void { + public function updateNoteUI():Void { if (curSelectedNote != null) stepperSusLength.value = curSelectedNote[2]; } - function updateGrid():Void { + public function updateGrid():Void { + var uiSettings:Array = CoolUtil.coolTextFile(Paths.txt("ui skins/" + _song.ui_Skin + "/config")); remove(gridBG); gridBG.kill(); gridBG.destroy(); @@ -1852,6 +1850,7 @@ class ChartingState extends MusicBeatState { note.x = Math.floor((daNoteInfo + 1) * GRID_SIZE) + Std.parseFloat(PlayState.instance.arrow_Configs.get(daType)[1]); note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime())) + Std.parseFloat(PlayState.instance.arrow_Configs.get(daType)[3])); + note.antialiasing = uiSettings[3] == "true"; note.rawNoteData = daNoteInfo; @@ -1883,6 +1882,7 @@ class ChartingState extends MusicBeatState { var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, goodNoteInfo, oldNote, true, 0, daType, _song, [0], mustPress, true); sustainNote.scale.set(note.scale.x, note.scale.y); + sustainNote.antialiasing = uiSettings[3] == "true"; sustainNote.updateHitbox(); sustainNote.x = note.x + (GRID_SIZE / 2) - Std.parseFloat(PlayState.instance.arrow_Configs.get(daType)[1]) - sustainNote.width / 2; sustainNote.y = note.height