Skip to content

Commit

Permalink
hmmm
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Jun 3, 2024
1 parent b7a8940 commit d42e827
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
4 changes: 3 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[NEXT UPDATE]
- Main Menu Addons

[HIGH PRIORITY]
- Localization Support
- Note Color Presets (WIP)
- Backport stuff from FNF 0.3.X

[LOW PRIORITY]
Expand Down
4 changes: 4 additions & 0 deletions source/meta/data/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class ClientPrefs {
public static var language:String = 'en';
public static var displayMilliseconds:Bool = true;
public static var weekendScore:Bool = false;
public static var resultsScreen:Bool = true;
public static var gameplaySettings:Map<String, Dynamic> = [
'scrollspeed' => 1.0,
'scrolltype' => 'multiplicative',
Expand Down Expand Up @@ -150,6 +151,7 @@ class ClientPrefs {
FlxG.save.data.language = language;
FlxG.save.data.displayMilliseconds = displayMilliseconds;
FlxG.save.data.weekendScore = weekendScore;
FlxG.save.data.resultsScreen = resultsScreen;

FlxG.save.flush();

Expand Down Expand Up @@ -312,6 +314,8 @@ class ClientPrefs {
displayMilliseconds = FlxG.save.data.displayMilliseconds;
if(FlxG.save.data.weekendScore != null)
weekendScore = FlxG.save.data.weekendScore;
if(FlxG.save.data.resultsScreen != null)
resultsScreen = FlxG.save.data.resultsScreen;

var save:FlxSave = new FlxSave();
save.bind('controls_v2', 'ninjamuffin99');
Expand Down
7 changes: 7 additions & 0 deletions source/meta/data/options/OptionsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,13 @@ class GameplaySubState extends BaseOptionsMenu
false);
addOption(option);

var option:Option = new Option('Results Screen',
'If checked, displays your stats after finishing a song/week.',
'resultsScreen',
'bool',
true);
addOption(option);

var option:Option = new Option('Sick! Hit Window',
'Changes the amount of time you have\nfor hitting a "Sick!" in milliseconds.',
'sickWindow',
Expand Down
32 changes: 21 additions & 11 deletions source/meta/state/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4703,11 +4703,15 @@ class PlayState extends MusicBeatState

cancelMusicFadeTween();

new FlxTimer().start(0.5, function(tmr:FlxTimer) {
persistentUpdate = true;
openSubState(new ResultsSubState(campaignSicks, campaignGoods, campaignBads, campaignShits, campaignScore, campaignMisses,
Highscore.floorDecimal(ratingPercent * 100, 2), ratingName, ratingFC));
});
if (ClientPrefs.resultsScreen) {
new FlxTimer().start(0.5, function(tmr:FlxTimer) {
persistentUpdate = true;
openSubState(new ResultsSubState(campaignSicks, campaignGoods, campaignBads, campaignShits, campaignScore, campaignMisses,
Highscore.floorDecimal(ratingPercent * 100, 2), ratingName, ratingFC));
});
}
else
MusicBeatState.switchState(new StoryMenuState());

if(!ClientPrefs.getGameplaySetting('practice', false) && !ClientPrefs.getGameplaySetting('botplay', false)) {
StoryMenuState.weekCompleted.set(WeekData.weeksList[storyWeek], true);
Expand Down Expand Up @@ -4763,12 +4767,16 @@ class PlayState extends MusicBeatState
Mods.loadTheFirstEnabledMod();

cancelMusicFadeTween();

new FlxTimer().start(0.5, function(tmr:FlxTimer) {
persistentUpdate = true;
openSubState(new ResultsSubState(sicks, goods, bads, shits, songScore, songMisses,
Highscore.floorDecimal(ratingPercent * 100, 2), ratingName, ratingFC));
});

if (ClientPrefs.resultsScreen) {
new FlxTimer().start(0.5, function(tmr:FlxTimer) {
persistentUpdate = true;
openSubState(new ResultsSubState(sicks, goods, bads, shits, songScore, songMisses,
Highscore.floorDecimal(ratingPercent * 100, 2), ratingName, ratingFC));
});
}
else
MusicBeatState.switchState(new FreeplayState());

changedDifficulty = false;
}
Expand Down Expand Up @@ -5860,11 +5868,13 @@ class PlayState extends MusicBeatState
}

override function destroy() {
#if LUA_ALLOWED
for (lua in luaArray) {
lua.call('onDestroy', []);
lua.stop();
}
luaArray = [];
#end

#if HSCRIPT_ALLOWED
for (i in hscriptMap.keys()) {
Expand Down

0 comments on commit d42e827

Please sign in to comment.