Skip to content

Commit

Permalink
fix antialiasing when changing ui skins in charter
Browse files Browse the repository at this point in the history
  • Loading branch information
Vortex2Oblivion committed Nov 23, 2024
1 parent 332b717 commit 13c629f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import game.graphics.ABotVis;
import game.ABotVis;
import flixe.sound.FlxSound;

var pupilState:Int = 0;
Expand Down
20 changes: 10 additions & 10 deletions source/toolbox/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ class ChartingState extends MusicBeatState {
Assets.loadLibrary("shared").onComplete(function(_) {});
#end



menuBG = new FlxSprite().makeBackground(0x3D3D3D);

menuBG.updateHitbox();
Expand Down Expand Up @@ -1015,22 +1013,21 @@ 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);
}
}
}

//FlxG.sound.list.add(vocals);
// FlxG.sound.list.add(vocals);

FlxG.sound.music.pause();
vocals.pause();
Expand Down Expand Up @@ -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<String> = CoolUtil.coolTextFile(Paths.txt("ui skins/" + _song.ui_Skin + "/config"));
remove(gridBG);
gridBG.kill();
gridBG.destroy();
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 13c629f

Please sign in to comment.