Skip to content

Commit

Permalink
somehow this got broken, plus other crap
Browse files Browse the repository at this point in the history
closes #724 and #728
I didn't test the autosave shit btw, I don't have time rn
  • Loading branch information
moxie-coder committed Nov 8, 2024
1 parent dfa63bb commit 8bf331a
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 66 deletions.
20 changes: 8 additions & 12 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
<!--Mobile-specific-->
<window if="mobile" orientation="landscape" fullscreen="false" width="1280" height="720" resizable="false"/>

<!--Switch-specific-->
<window if="switch" orientation="landscape" fullscreen="true" width="0" height="0" resizable="true" />

<!-- _____________________________ Path Settings ____________________________ -->

<set name="BUILD_DIR" value="export/debug" if="debug" />
Expand All @@ -31,20 +28,19 @@
<classpath name="source" />

<!-- PSYCH ENGINE CUSTOMIZATION -->
<define name="MODS_ALLOWED" />
<define name="LUA_ALLOWED" />
<define name="MODS_ALLOWED" if="desktop || mobile" unless="web" />
<define name="LUA_ALLOWED" if="desktop || mobile" unless="web" />
<define name="ACHIEVEMENTS_ALLOWED" />
<define name="VIDEOS_ALLOWED" unless="32bits"/>
<define name="VIDEOS_ALLOWED" if="desktop || mobile" unless="32bits || web"/>
<define name="PSYCH_WATERMARKS"/> <!-- DELETE THIS TO REMOVE WATERMARKS/DEV NAMES ON TITLE SCREEN -->
<define name="DISCORD_ALLOWED" />
<define name="DISCORD_ALLOWED" if="desktop || mobile" unless="web" />

<assets path="assets/preload" rename="assets" exclude="*.ogg" if="web"/>
<assets path="assets/preload" rename="assets" exclude="*.mp3" unless="web"/>
<assets path="assets/preload" rename="assets" exclude="*.mp3" unless="web"/>

<!-- DONT ENABLE THIS!! shut up shadowmario ill enable whatever i want-->
<define name="CHECK_FOR_UPDATES" />

<!-- <define name="PRELOAD_ALL" /> -->
<define name="PRELOAD_ALL" unless="web" />
<define name="NO_PRELOAD_ALL" unless="PRELOAD_ALL"/>

Expand All @@ -59,7 +55,7 @@
<library name="week5" preload="true" />
<library name="week6" preload="true" />
<library name="week7" preload="true" />
<library name="weekend1" preload="true" />
<library name="weekend1" preload="true" />
</section>

<section if="NO_PRELOAD_ALL">
Expand All @@ -71,7 +67,7 @@
<library name="week5" preload="false" />
<library name="week6" preload="false" />
<library name="week7" preload="false" />
<library name="weekend1" preload="false" />
<library name="weekend1" preload="false" />
</section>

<assets path="assets/videos" library="videos" if="VIDEOS_ALLOWED"/>
Expand All @@ -93,7 +89,7 @@
<assets path="assets/week6" library="week6" exclude="*.mp3" unless="web"/>
<assets path="assets/week7" library="week7" exclude="*.ogg" if="web"/>
<assets path="assets/week7" library="week7" exclude="*.mp3" unless="web"/>
<assets path="assets/weekend1" library="weekend1" exclude="*.mp3" unless="web"/>
<assets path="assets/weekend1" library="weekend1" exclude="*.mp3" unless="web"/>

<haxelib name="grig.audio"/>
<haxelib name="funkin.vis"/>
Expand Down
100 changes: 54 additions & 46 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,7 @@ class PlayState extends MusicBeatState
add(chromaScreen);
}

// TODO: cleanup playstate, by moving most of this and other duplicate functions like healthbop, etc
if (ClientPrefs.scoreStyle == 'Kade Engine')
{
scoreTxt = new FlxText(0, healthBarBG.y + 50, FlxG.width, "", 20);
Expand Down Expand Up @@ -1464,6 +1465,15 @@ class PlayState extends MusicBeatState
scoreTxt.scrollFactor.set();
add(scoreTxt);
}
if (ClientPrefs.scoreStyle == 'Vanilla')
{
scoreTxt = new FlxText(300, healthBarBG.y + 50, FlxG.width, "", 18);
scoreTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, CENTER, OUTLINE, FlxColor.BLACK);
scoreTxt.borderSize = 1.25;
updateScore();
scoreTxt.scrollFactor.set();
add(scoreTxt);
}
if (ClientPrefs.showcaseMode) {
scoreTxt.visible = false;
healthBarBG.visible = false;
Expand All @@ -1473,7 +1483,7 @@ class PlayState extends MusicBeatState
if (ClientPrefs.hideHud) {
scoreTxt.visible = false;
final daArray:Array<Dynamic> = [botplayTxt, healthBarBG, healthBar, iconP2, iconP1, timeBarBG, timeBar, timeTxt];
for (i in daArray){
for (i in daArray){
if (i != null)
i.visible = false;
}
Expand Down Expand Up @@ -2178,6 +2188,11 @@ class PlayState extends MusicBeatState

function schoolIntro(?dialogueBox:DialogueBox):Void
{
if (dialogueBox == null){
startCountdown();
return;
} // don't load any of this, since there's not even any dialog

inCutscene = true;
var black:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK);
black.scrollFactor.set();
Expand Down Expand Up @@ -2217,47 +2232,41 @@ class PlayState extends MusicBeatState
}
else
{
if (dialogueBox != null)
if (Paths.formatToSongPath(SONG.song) == 'thorns')
{
if (Paths.formatToSongPath(SONG.song) == 'thorns')
add(senpaiEvil);
senpaiEvil.alpha = 0;
new FlxTimer().start(0.3, function(swagTimer:FlxTimer)
{
add(senpaiEvil);
senpaiEvil.alpha = 0;
new FlxTimer().start(0.3, function(swagTimer:FlxTimer)
senpaiEvil.alpha += 0.15;
if (senpaiEvil.alpha < 1)
{
senpaiEvil.alpha += 0.15;
if (senpaiEvil.alpha < 1)
{
swagTimer.reset();
}
else
swagTimer.reset();
}
else
{
senpaiEvil.animation.play('idle');
FlxG.sound.play(Paths.sound('Senpai_Dies'), 1, false, null, true, function()
{
senpaiEvil.animation.play('idle');
FlxG.sound.play(Paths.sound('Senpai_Dies'), 1, false, null, true, function()
remove(senpaiEvil);
remove(red);
FlxG.camera.fade(FlxColor.WHITE, 0.01, true, function()
{
remove(senpaiEvil);
remove(red);
FlxG.camera.fade(FlxColor.WHITE, 0.01, true, function()
{
add(dialogueBox);
camHUD.visible = true;
}, true);
});
new FlxTimer().start(3.2, function(deadTime:FlxTimer)
{
FlxG.camera.fade(FlxColor.WHITE, 1.6, false);
});
}
});
}
else
{
add(dialogueBox);
}
add(dialogueBox);
camHUD.visible = true;
}, true);
});
new FlxTimer().start(3.2, function(deadTime:FlxTimer)
{
FlxG.camera.fade(FlxColor.WHITE, 1.6, false);
});
}
});
}
else
startCountdown();

{
add(dialogueBox);
}
remove(black);
}
});
Expand Down Expand Up @@ -2642,6 +2651,9 @@ class PlayState extends MusicBeatState

case 'VS Impostor':
tempScore = 'Score: ' + formattedScore + ' $divider Combo Breaks: ' + formattedSongMisses + (ClientPrefs.showComboInfo ? ' $divider Combo: ' + formattedCombo : '') + npsString + ' $divider Accuracy: ' + Highscore.floorDecimal(ratingPercent * 100, 2) + '% [' + fcString + ']';

case 'Vanilla':
tempScore = 'Score: ' + formattedScore;
}

scoreTxt.text = '${tempScore}\n';
Expand Down Expand Up @@ -2689,16 +2701,12 @@ class PlayState extends MusicBeatState
callOnLuas('onSkipDialogue', [dialogueCount]);
}

var previousFrameTime:Int = 0;
var lastReportedPlayheadPosition:Int = 0;
var songTime:Float = 0;

function startSong():Void
{
startingSong = false;

previousFrameTime = FlxG.game.ticks;
lastReportedPlayheadPosition = 0;
if (ClientPrefs.songLoading)
{
var diff:String = (SONG.specialAudioName.length > 1 ? SONG.specialAudioName : CoolUtil.difficultyString()).toLowerCase();
Expand Down Expand Up @@ -3208,7 +3216,7 @@ class PlayState extends MusicBeatState
public var skipArrowStartTween:Bool = false; //for lua
private function generateStaticArrows(player:Int):Void
{
var strumLine:FlxPoint = FlxPoint.get(middleScroll ? STRUM_X_MIDDLESCROLL : STRUM_X, (ClientPrefs.downScroll) ? FlxG.height - 150 : 50);
final strumLine:FlxPoint = FlxPoint.get(middleScroll ? STRUM_X_MIDDLESCROLL : STRUM_X, (ClientPrefs.downScroll) ? FlxG.height - 150 : 50);
for (i in 0...4)
{
var targetAlpha:Float = 1;
Expand All @@ -3218,7 +3226,7 @@ class PlayState extends MusicBeatState
else if(middleScroll) targetAlpha = ClientPrefs.oppNoteAlpha;
}

var noteSkinExists:Bool = FileSystem.exists("assets/shared/images/noteskins/" + (player == 0 ? dadNoteskin : bfNoteskin)) || FileSystem.exists(Paths.modsImages("noteskins/" + (player == 0 ? dadNoteskin : bfNoteskin)));
final noteSkinExists:Bool = FileSystem.exists("assets/shared/images/noteskins/" + (player == 0 ? dadNoteskin : bfNoteskin)) || FileSystem.exists(Paths.modsImages("noteskins/" + (player == 0 ? dadNoteskin : bfNoteskin)));

var babyArrow:StrumNote = new StrumNote(middleScroll ? STRUM_X_MIDDLESCROLL : STRUM_X, strumLine.y, i, player);
babyArrow.downScroll = ClientPrefs.downScroll;
Expand Down Expand Up @@ -5247,11 +5255,11 @@ class PlayState extends MusicBeatState
rating.updateHitbox();

FlxTween.tween(rating, {alpha: 0}, 0.2 / playbackRate, {
startDelay: 0.7 / playbackRate,
startDelay: Conductor.crochet * 0.001 / playbackRate,
onComplete: function(tween:FlxTween)
{
rating.kill();
}
rating.destroy();
},
});
}

Expand Down Expand Up @@ -5313,9 +5321,9 @@ class PlayState extends MusicBeatState
FlxTween.tween(numScore, {alpha: 0}, 0.2 / playbackRate, {
onComplete: function(tween:FlxTween)
{
numScore.kill();
numScore.destroy();
},
startDelay: 1.4 / playbackRate
startDelay: Conductor.crochet * 0.002 / playbackRate
});
}
}
Expand Down
5 changes: 0 additions & 5 deletions source/Section.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ class Section
public var typeOfSection:Int = 0;
public var mustHitSection:Bool = true;

/**
* Copies the first section into the second section!
*/
public static var COPYCAT:Int = 0;

public function new(sectionBeats:Float = 4)
{
this.sectionBeats = sectionBeats;
Expand Down
28 changes: 26 additions & 2 deletions source/editors/ChartingState.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package editors;

import flash.geom.Rectangle;
import openfl.geom.Rectangle;
import haxe.Json;
import haxe.format.JsonParser;
import haxe.io.Bytes;
Expand Down Expand Up @@ -49,7 +49,7 @@ import openfl.utils.ByteArray;
import openfl.events.UncaughtErrorEvent;
using StringTools;
#if sys
import flash.media.Sound;
import openfl.media.Sound;
import sys.FileSystem;
import sys.io.File;
#end
Expand Down Expand Up @@ -251,6 +251,9 @@ class ChartingState extends MusicBeatState
public static var vortex:Bool = false;
public var mouseQuant:Bool = false;
public var hitsoundVol:Float = 1;

var autoSaveTimer:FlxTimer;
public var autoSaveLength:Float = 90; // 2 minutes
override function create()
{
idleMusic = new EditingMusic();
Expand Down Expand Up @@ -498,6 +501,24 @@ class ChartingState extends MusicBeatState
autosaveIndicator.scrollFactor.set();
autosaveIndicator.antialiasing = ClientPrefs.globalAntialiasing;
add(autosaveIndicator);
if(autoSaveTimer != null) {
autoSaveTimer.cancel();
autoSaveTimer = null;
autosaveIndicator.alpha = 0;
}
// TODO: expand this more & maybe port the 1.0 system to here
autoSaveTimer = new FlxTimer().start(autoSaveLength, function(tmr:FlxTimer) {
FlxTween.tween(autosaveIndicator, {alpha: 1}, 1, {
ease: FlxEase.quadInOut,
onComplete: function (twn:FlxTween) {
FlxTween.tween(autosaveIndicator, {alpha: 0}, 1, {
startDelay: 0.1,
ease: FlxEase.quadInOut
});
}
});
autosaveSong();
}, 0);

addSongUI();
addSectionUI();
Expand Down Expand Up @@ -659,6 +680,9 @@ class ChartingState extends MusicBeatState
});
var autosaveButton:FlxButton = new FlxButton(saveEvents.x, reloadSongJson.y + 60, "Save to Autosave", function()
{
if (autoSaveTimer != null)
autoSaveTimer.reset(autoSaveLength);

autosaveSong();
});

Expand Down
2 changes: 1 addition & 1 deletion source/options/VisualsUISubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class VisualsUISubState extends BaseOptionsMenu
'scoreStyle',
'string',
'Psych Engine',
['Psych Engine', 'VS Impostor', 'Kade Engine', 'Forever Engine', 'TGT V4', 'Dave Engine', 'Doki Doki+', 'Leather Engine', 'JS Engine']);
['Psych Engine', 'VS Impostor', 'Kade Engine', 'Forever Engine', 'TGT V4', 'Dave Engine', 'Doki Doki+', 'Leather Engine', 'JS Engine', 'Vanilla']);
addOption(option);

var option:Option = new Option('Time Bar Style:',
Expand Down

2 comments on commit 8bf331a

@moxie-coder
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a genuine accomplishment to get the combos to be broken, no joke

@JordanSantiagoYT
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how were the combos/popups broken? all i did to them was make it so that the speed of them disappearing wasn't dependant on bpm

Please sign in to comment.