Skip to content

Commit

Permalink
fix storymode stage transition
Browse files Browse the repository at this point in the history
also the ugh animation has been broken for god knows how long
how tf did i miss that
  • Loading branch information
MaybeMaru committed Jun 26, 2024
1 parent 3dbf20c commit f50f8c9
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
8 changes: 4 additions & 4 deletions assets/songs/ugh/charts/easy.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
[5062.5,1,0],
[5250,0,281.25],
[5625,2,0,
true
"default-alt"
]
],
"mustHitSection": false
Expand Down Expand Up @@ -291,7 +291,7 @@
[41062.5,1,0],
[41250,0,281.25],
[41625,2,0,
true
"default-alt"
]
],
"mustHitSection": false
Expand Down Expand Up @@ -338,7 +338,7 @@
[48750,1,0],
[48937.5,3,0],
[49125,2,0,
true
"default-alt"
]
],
"mustHitSection": false
Expand Down Expand Up @@ -521,7 +521,7 @@
[77062.5,1,0],
[77250,0,281.25],
[77625,2,0,
true
"default-alt"
]
],
"mustHitSection": false
Expand Down
8 changes: 4 additions & 4 deletions assets/songs/ugh/charts/hard.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
[5062.5,0,0],
[5250,3,281.25],
[5625,2,0,
true
"default-alt"
]
],
"mustHitSection": false
Expand Down Expand Up @@ -403,7 +403,7 @@
[41062.5,3,0],
[41250,0,281.25],
[41625,2,0,
true
"default-alt"
]
],
"mustHitSection": false
Expand Down Expand Up @@ -468,7 +468,7 @@
[48843.75,2,0],
[48937.5,3,0],
[49125,2,0,
true
"default-alt"
]
],
"mustHitSection": false
Expand Down Expand Up @@ -737,7 +737,7 @@
[77062.5,3,0],
[77250,0,281.25],
[77625,2,0,
true
"default-alt"
]
],
"mustHitSection": false
Expand Down
8 changes: 4 additions & 4 deletions assets/songs/ugh/charts/normal.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
[5062.5,0,0],
[5250,3,281.25],
[5625,2,0,
true
"default-alt"
]
],
"mustHitSection": false
Expand Down Expand Up @@ -375,7 +375,7 @@
[41062.5,3,0],
[41250,0,281.25],
[41625,2,0,
true
"default-alt"
]
],
"mustHitSection": false
Expand Down Expand Up @@ -434,7 +434,7 @@
[48843.75,0,0],
[48937.5,1,0],
[49125,2,0,
true
"default-alt"
]
],
"mustHitSection": false
Expand Down Expand Up @@ -683,7 +683,7 @@
[77062.5,3,0],
[77250,0,281.25],
[77625,2,0,
true
"default-alt"
]
],
"mustHitSection": false
Expand Down
10 changes: 7 additions & 3 deletions source/funkin/ScriptConsole.hx
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,25 @@ class Print extends Sprite {
return color = textField.textColor = value;
}

public var timer:Float = 7.0;
public var timer:Float = 7;
inline public function resetTimer() {
timer = 7.0;
timer = 7;
alpha = 1;
}

inline public function hide() {
timer = 0.0;
text = ""; // Clear text rendering crap
timer = 0;
alpha = 0;
}

public function update(e:Float) {
if (timer > 0) {
timer -= e;
alpha = timer;
if (alpha <= 0) {
hide();
}
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions source/funkin/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -683,14 +683,15 @@ class PlayState extends MusicBeatState
PlayState.SONG = Song.loadFromFile(curDifficulty, nextSong);
Conductor.stop();

// Reset cam follow if the stage changed
prevCamFollow = (SONG.stage == curStage) ? camFollow : null;
// Reset cam follow and enable transition if the stage changed
final changedStage:Bool = (SONG.stage != curStage);
prevCamFollow = changedStage ? null : camFollow;
seenCutscene = false;

clearCache = true;
clearCacheData = {tempCache: false, skins: false}
ModdingUtil.addCall('switchSong', [nextSong, curDifficulty]); // Could be used to change cache clear
switchState(new PlayState(), true);
switchState(new PlayState(), !changedStage);
}

override function startTransition() {
Expand Down

0 comments on commit f50f8c9

Please sign in to comment.