Skip to content

Commit

Permalink
fix notetype skin sustains + stage change loading screen
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeMaru committed Jun 27, 2024
1 parent 95ed686 commit bf81b21
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
1 change: 0 additions & 1 deletion source/funkin/objects/NotesGroup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ class NotesGroup extends Group
unspawnNotes.push(note);

if (susLength > 0) {
// TODO: notetype skin sustains arent loading for some reason (?) fix dat
var sustain:Sustain = new Sustain(noteData, strumTime, susLength, skin, note);
sustain.noteSpeed = songSpeed;

Expand Down
2 changes: 1 addition & 1 deletion source/funkin/objects/note/BasicNote.hx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class BasicNote extends SmartSprite implements INoteData implements ITimingObjec
}

public function changeSkin(?value:String):Void {
if (value != skin)
if ((value != skin) || isSustainNote)
skin = value;
}

Expand Down
5 changes: 4 additions & 1 deletion source/funkin/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,10 @@ class PlayState extends MusicBeatState
clearCache = true;
clearCacheData = {tempCache: false, skins: false}
ModdingUtil.addCall('switchSong', [nextSong, curDifficulty]); // Could be used to change cache clear
switchState(new PlayState(), !changedStage);

// If the stage has changed we can sneak in a lil loading screen :]
changedStage ? WeekSetup.loadPlayState(new PlayState(), false, false)
: switchState(new PlayState(), true);
}

override function startTransition() {
Expand Down
18 changes: 4 additions & 14 deletions source/funkin/util/Stage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -389,18 +389,8 @@ class Stage extends TypedGroup<Layer> implements IMusicHit
return key is Bool ? (key ? "fg" : "bg") : key;
}

public function stepHit(curStep:Int):Void
{

}

public function beatHit(curBeat:Int):Void
{

}

public function sectionHit(curSection:Int):Void
{

}
// TODO: could add some metadata to setup boopers or something like that?
public function stepHit(curStep:Int):Void {}
public function beatHit(curBeat:Int):Void {}
public function sectionHit(curSection:Int):Void {}
}
8 changes: 5 additions & 3 deletions source/funkin/util/song/WeekSetup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,15 @@ class WeekSetup
else CoolUtil.switchState(instance, skipTrans);
}

public static function loadPlayState(instance:PlayState, skipTrans:Bool = false):Void
public static function loadPlayState(instance:PlayState, skipTrans:Bool = false, clearCache:Bool = true):Void
{
var loadScreen:LoadingState = new LoadingState();

loadScreen.onStart = () -> {
PlayState.clearCache = false;
CoolUtil.clearCache();
if (clearCache) {
PlayState.clearCache = false;
CoolUtil.clearCache();
}
}

loadScreen.onComplete = () -> {
Expand Down

0 comments on commit bf81b21

Please sign in to comment.