Skip to content

Commit

Permalink
0.8.0c Patch
Browse files Browse the repository at this point in the history
  • Loading branch information
UmbratheUmbreon committed Mar 12, 2023
1 parent a414c32 commit 20c2310
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 19 deletions.
Binary file modified crshhndlr/export/release/windows/bin/DENPACRASHHANDLER.exe
Binary file not shown.
24 changes: 18 additions & 6 deletions crshhndlr/source/CrashState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class CrashState extends flixel.FlxState {
for (i=>check in ['Character.hx', 'Song.hx', 'StageData.hx', 'WeekData.hx',
'HealthIcon.hx', 'CreditsState.hx', 'PatchState.hx', 'DialogueBox.hx', 'DialogueBoxDenpa.hx',
'FreeplayState.hx', 'Hscript.hx', 'Modcharts.hx', 'SoundtestState.hx', 'FunkinLua.hx',
'CharacterEditorState.hx (line 2022)', 'hscript/Parser.hx', 'HscriptSubstate.hx', 'HscriptState.hx',
'HscriptClass.hx', 'hscript/Interp.hx'])
'hscript/Parser.hx', 'HscriptSubstate.hx', 'HscriptState.hx', 'HscriptClass.hx',
'hscript/Interp.hx', 'Note.hx'])
{
if (log.contains(check)) {
switch (i) {
Expand Down Expand Up @@ -75,18 +75,30 @@ class CrashState extends flixel.FlxState {
case 8:
if (!(extralines.contains('\nYour Dialogue .json may be invalid!')))
extralines.push('\nYour Dialogue .json may be invalid!');
case 10 | 11 | 15 | 16 | 17 | 18 | 19:
case 10 | 14 | 18:
if (!(extralines.contains('\nYour .hscript may be invalid!')))
extralines.push('\nYour .hscript may be invalid!');
case 11:
if (!(extralines.contains('\nYour Modchart .hscript may be invalid!')))
extralines.push('\nYour Modchart .hscript may be invalid!');
case 15:
if (!(extralines.contains('\nYour SubState .hscript may be invalid!')))
extralines.push('\nYour SubState .hscript may be invalid!');
case 16:
if (!(extralines.contains('\nYour State .hscript may be invalid!')))
extralines.push('\nYour State .hscript may be invalid!');
case 17:
if (!(extralines.contains('\nYour Class .hscript may be invalid!')))
extralines.push('\nYour Class .hscript may be invalid!');
case 12:
if (!(extralines.contains('\nYour Album .json may be invalid!')))
extralines.push('\nYour Album .json may be invalid!');
case 13:
if (!(extralines.contains('\nYour .lua may be invalid!')))
extralines.push('\nYour .lua may be invalid!');
case 14:
if (!(extralines.contains('\nThis one is funny it made me laugh')))
extralines.push('\nThis one is funny it made me laugh');
case 19:
if (!(extralines.contains('\nYour note skin may be invalid!')))
extralines.push('\nYour note skin may be invalid!');
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions source/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,7 @@ class FreeplayState extends MusicBeatState
songJsonPopup();
}
#end
}

if (accepted)
} else if (accepted)
{
persistentUpdate = false;
var songLowercase:String = Paths.formatToSongPath(songs[curSelected].songName);
Expand Down Expand Up @@ -635,6 +633,7 @@ class FreeplayState extends MusicBeatState
if(FlxG.keys.anyJustPressed([END, HOME]))
{
changeSelection((FlxG.keys.pressed.END ? (songs.length - curSelected)-1 : -curSelected), true, true);
changeDiff();
}

hscript.call("onUpdatePost", [elapsed]);
Expand Down
2 changes: 1 addition & 1 deletion source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Main extends Sprite
*
* Use `debugVersion` to get the version with build date.
*/
public static final denpaEngineVersion:GameVersion = new GameVersion(0, 8, 0, 'b');
public static final denpaEngineVersion:GameVersion = new GameVersion(0, 8, 0, 'c');

public static var fpsCounter:FramerateDisplay;
public static var ramCount:DebugDisplay;
Expand Down
13 changes: 9 additions & 4 deletions source/ManualSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ class ManualSubState extends MusicBeatSubstate {
manual = new FlxSprite().loadGraphic(Paths.image('oscillators/manual'));
manual.screenCenter(X);
manual.y = FlxG.height;
FlxTween.tween(manual, {y: lastManualPos}, 1, {ease: FlxEase.expoOut});
FlxTween.tween(manual, {y: lastManualPos}, 1, {
ease: FlxEase.expoOut,
onComplete: _ -> blockInput = false
});
manual.scrollFactor.set();
manual.antialiasing = false;
add(manual);
Expand All @@ -133,6 +136,7 @@ class ManualSubState extends MusicBeatSubstate {
}
}

var blockInput:Bool = true;
override function update(elapsed) {
super.update(elapsed);
if (control('back')) exit();
Expand All @@ -148,14 +152,15 @@ class ManualSubState extends MusicBeatSubstate {
icon.changeIcon(usableIcons[FlxG.random.int(0, usableIcons.length-1)]);
icon.animation.curAnim.curFrame = FlxG.random.int(0, icon.animation.curAnim.frames.length-1);
}
if (blockInput) return;
final mult = (FlxG.keys.pressed.SHIFT ? 32000 : (FlxG.keys.pressed.CONTROL ? 5000 : 9000)); //keep in mind how large this is
if (controls.UI_DOWN) moveManual(manual.y - (elapsed*mult), scrollSound);
if (controls.UI_UP) moveManual(manual.y + (elapsed*mult), scrollSound);
if (FlxG.keys.justPressed.HOME) moveManual(60, endSound);
if (FlxG.keys.justPressed.END) moveManual((-manual.height + FlxG.height) - 60, endSound);
if (FlxG.keys.justPressed.PAGEUP) moveManual(manual.y + manual.height/22, pageSound);
if (FlxG.keys.justPressed.PAGEDOWN) moveManual(manual.y - (manual.height/22), pageSound);
if (manual != null) FlxG.watch.addQuick('manualY', manual.y);
#if debug FlxG.watch.addQuick('manualY', manual.y); #end
}

var moveTwn:FlxTween = null;
Expand All @@ -169,8 +174,8 @@ class ManualSubState extends MusicBeatSubstate {

var alreadyExiting:Bool = false;
function exit() {
if (alreadyExiting) return;
alreadyExiting = true;
if (alreadyExiting || blockInput) return;
blockInput = alreadyExiting = true;

state.persistentDraw = true; //doing this seperate so you can see it during the exit anim
bgMusic.fadeOut(0.44, 0, _ -> {
Expand Down
7 changes: 5 additions & 2 deletions source/MusicBeatState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ class MusicBeatState extends FlxUIState

public static var camBeat:FlxCamera;
public static var curInstance:MusicBeatState = null;
public static var disableManual:Bool = false;

inline function get_controls():Controls
return PlayerSettings.player1.controls;

override function destroy() {
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPress);
FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP, keyRelease);
disableManual = false;
super.destroy();
}

Expand Down Expand Up @@ -89,7 +91,7 @@ class MusicBeatState extends FlxUIState

secRet += calc(diff, Std.int(nextChange.bpm));
}
trace(secRet);
//trace(secRet);
return secRet / playbackRate;
}

Expand Down Expand Up @@ -120,6 +122,7 @@ class MusicBeatState extends FlxUIState
}

function openManual() {
FreeplayState.destroyFreeplayVocals();
persistentUpdate = persistentDraw = false;
openSubState(new ManualSubState(this));
}
Expand All @@ -131,7 +134,7 @@ class MusicBeatState extends FlxUIState
if (key == -1) return;

//yippie
if (ClientPrefs.keyBinds.get('manual').contains(key) && !(FlxSubState.curInstance != null && FlxSubState.curInstance.name == 'ManualSubState'))
if (ClientPrefs.keyBinds.get('manual').contains(key) && !(FlxSubState.curInstance != null && FlxSubState.curInstance.name == 'ManualSubState') && !disableManual)
openManual();
//toggle debug display
if (ClientPrefs.keyBinds.get('debug_3').contains(key) && FlxG.keys.checkStatus(key, JUST_PRESSED) && Main.fpsCounter.visible)
Expand Down
5 changes: 2 additions & 3 deletions source/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,8 @@ class StrumNote extends FlxSprite
animation.addByPrefix('pressed', skinThing[1] + ' press', 24, false);
animation.addByPrefix('confirm', skinThing[1] + ' confirm', 24, false);
}
animationLengths[1] = animation.getByName('pressed').numFrames;
animationLengths[2] = animation.getByName('confirm').numFrames;
animationLengths[0] = animation.getByName('static').numFrames;
for (i=>anim in ['static', 'pressed', 'confirm'])
animationLengths[i] = (animation.getByName(anim) != null ? animation.getByName('pressed').numFrames : 1);

updateHitbox();

Expand Down
1 change: 1 addition & 0 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ class PlayState extends MusicBeatState
cpp.vm.Gc.enable(false); //prevent lag spikes where it matters most
#end

MusicBeatState.disableManual = true;
SoundTestState.isPlaying = false;
FlxG.mouse.visible = false;
instance = this;
Expand Down
1 change: 1 addition & 0 deletions source/TitleState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class TitleState extends MusicBeatState
// Just to load a mod on start up if ya got one. For mods that change the menu music and bg
WeekData.loadTheFirstEnabledMod();

MusicBeatState.disableManual = true;
if (ClientPrefs.settings.get("checkForUpdates")) {
if(!closedState) {
trace('checking for update');
Expand Down
1 change: 1 addition & 0 deletions source/options/OptionsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class OptionsState extends MusicBeatState
DiscordClient.changePresence("In the Options Menu", null);
#end

MusicBeatState.disableManual = true;
FreeplayState.destroyFreeplayVocals();
FlxG.sound.playMusic(Paths.music('msm'), 0);
FlxG.sound.music.fadeIn(1, 0, 0.6);
Expand Down

0 comments on commit 20c2310

Please sign in to comment.