Skip to content

Commit

Permalink
Merge branch 'develop' into fix-opponent-strum-animation
Browse files Browse the repository at this point in the history
  • Loading branch information
lemz1 authored May 29, 2024
2 parents 1166c3a + eeaae74 commit 4884b7b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
6 changes: 3 additions & 3 deletions source/funkin/play/notes/Strumline.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down
5 changes: 5 additions & 0 deletions source/funkin/play/stage/Stage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
17 changes: 16 additions & 1 deletion source/funkin/ui/freeplay/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 10 additions & 4 deletions source/funkin/ui/transition/LoadingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 4884b7b

Please sign in to comment.