Merge branch 'develop' into fps-setting

This commit is contained in:
lemz 2024-05-29 06:42:46 +02:00 committed by GitHub
commit 01b1ce679c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 34 additions and 8 deletions

View file

@ -406,7 +406,7 @@ class Strumline extends FlxSpriteGroup
if (Preferences.downscroll)
{
holdNote.y = this.y + calculateNoteYPos(holdNote.strumTime, vwoosh) - holdNote.height + STRUMLINE_SIZE / 2;
holdNote.y = this.y - INITIAL_OFFSET + calculateNoteYPos(holdNote.strumTime, vwoosh) - holdNote.height + STRUMLINE_SIZE / 2;
}
else
{
@ -435,7 +435,7 @@ class Strumline extends FlxSpriteGroup
if (Preferences.downscroll)
{
holdNote.y = this.y - holdNote.height + STRUMLINE_SIZE / 2;
holdNote.y = this.y - INITIAL_OFFSET - holdNote.height + STRUMLINE_SIZE / 2;
}
else
{
@ -450,7 +450,7 @@ class Strumline extends FlxSpriteGroup
if (Preferences.downscroll)
{
holdNote.y = this.y + calculateNoteYPos(holdNote.strumTime, vwoosh) - holdNote.height + STRUMLINE_SIZE / 2;
holdNote.y = this.y - INITIAL_OFFSET + calculateNoteYPos(holdNote.strumTime, vwoosh) - holdNote.height + STRUMLINE_SIZE / 2;
}
else
{

View file

@ -852,6 +852,11 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements
}
}
public override function toString():String
{
return 'Stage($id)';
}
static function _fetchData(id:String):Null<StageData>
{
return StageRegistry.instance.parseEntryDataWithMigration(id, StageRegistry.instance.fetchEntryVersion(id));

View file

@ -29,6 +29,7 @@ import funkin.graphics.shaders.StrokeShader;
import funkin.input.Controls;
import funkin.play.PlayStatePlaylist;
import funkin.play.song.Song;
import funkin.ui.story.Level;
import funkin.save.Save;
import funkin.save.Save.SaveScoreData;
import funkin.ui.AtlasText;
@ -191,10 +192,24 @@ class FreeplayState extends MusicBeatSubState
// programmatically adds the songs via LevelRegistry and SongRegistry
for (levelId in LevelRegistry.instance.listSortedLevelIds())
{
for (songId in LevelRegistry.instance.parseEntryData(levelId).songs)
var level:Level = LevelRegistry.instance.fetchEntry(levelId);
if (level == null)
{
trace('[WARN] Could not find level with id (${levelId})');
continue;
}
for (songId in level.getSongs())
{
var song:Song = SongRegistry.instance.fetchEntry(songId);
if (song == null)
{
trace('[WARN] Could not find song with id (${songId})');
continue;
}
// Only display songs which actually have available charts for the current character.
var availableDifficultiesForSong:Array<String> = song.listDifficulties(displayedVariations, false);
if (availableDifficultiesForSong.length == 0) continue;

View file

@ -57,8 +57,7 @@ class LoadingState extends MusicBeatSubState
funkay.scrollFactor.set();
funkay.screenCenter();
loadBar = new FunkinSprite(0, FlxG.height - 20).makeSolidColor(FlxG.width, 10, 0xFFff16d2);
loadBar.screenCenter(X);
loadBar = new FunkinSprite(0, FlxG.height - 20).makeSolidColor(0, 10, 0xFFff16d2);
add(loadBar);
initSongsManifest().onComplete(function(lib) {
@ -163,8 +162,15 @@ class LoadingState extends MusicBeatSubState
targetShit = FlxMath.remapToRange(callbacks.numRemaining / callbacks.length, 1, 0, 0, 1);
var lerpWidth:Int = Std.int(FlxMath.lerp(loadBar.width, FlxG.width * targetShit, 0.2));
loadBar.setGraphicSize(lerpWidth, loadBar.height);
loadBar.updateHitbox();
// this if-check prevents the setGraphicSize function
// from setting the width of the loadBar to the height of the loadBar
// this is a behaviour that is implemented in the setGraphicSize function
// if the width parameter is equal to 0
if (lerpWidth > 0)
{
loadBar.setGraphicSize(lerpWidth, loadBar.height);
loadBar.updateHitbox();
}
FlxG.watch.addQuick('percentage?', callbacks.numRemaining / callbacks.length);
}