Skip to content

Commit

Permalink
finally runs?? with no crashes?? (i think)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesisbetterxoxo committed Feb 17, 2024
1 parent 53b7a5c commit 2a999b8
Show file tree
Hide file tree
Showing 12 changed files with 2,026 additions and 41 deletions.
2 changes: 1 addition & 1 deletion source/Alphabet.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import flixel.FlxSprite;
import flixel.group.FlxSpriteGroup;
import flixel.math.FlxMath;
import flixel.util.FlxTimer;
import flixel.sound.FlxSound;
import flixel.system.FlxSound;
import flash.media.Sound;

using StringTools;
Expand Down
2 changes: 1 addition & 1 deletion source/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import flixel.math.FlxMath;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import flixel.tweens.FlxTween;
import flixel.sound.FlxSound;
import flixel.system.FlxSound;
import lime.app.Application;
import flixel.util.FlxTimer;
import WeekData;
Expand Down
2 changes: 1 addition & 1 deletion source/FunkinHscript.hx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import flixel.util.FlxColor;
import flixel.ui.FlxBar;
import flixel.tweens.FlxTween;
import flixel.tweens.FlxEase;
import flixel.sound.FlxSound;
import flixel.system.FlxSound;
import flixel.math.FlxRect;
#if HSCRIPT_ALLOWED
#if DISCORD_ALLOWED
Expand Down
2 changes: 1 addition & 1 deletion source/FunkinLua.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.group.FlxSpriteGroup;
import flixel.math.FlxMath;
import flixel.util.FlxSave;
import flixel.sound.FlxSound;
import flixel.system.FlxSound;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
Expand Down
39 changes: 21 additions & 18 deletions source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -72,55 +72,58 @@ class Main extends Sprite
var path:String;
var callStack:Array<StackItem> = CallStack.exceptionStack(true);
var dateNow:String = Date.now().toString();

dateNow = StringTools.replace(dateNow, " ", "_");
dateNow = StringTools.replace(dateNow, ":", "'");

path = "./crash/" + "ICE_" + dateNow + ".txt";

for (stackItem in callStack)
{
switch (stackItem)
{
case FilePos(s, file, line, column):
errMsg += file + " (line " + line + ")\n";
default:
Sys.println(stackItem);
errMsg += stackItem + ""; // Add stack item to error message
}
}

errMsg += "\nUncaught Error: " + e.error;

if (!FileSystem.exists("./crash/"))
FileSystem.createDirectory("./crash/");

File.saveContent(path, errMsg + "\n");

Sys.println(errMsg);
Sys.println("Crash dump saved in " + Path.normalize(path));


trace(errMsg); // Output error message to console

trace("Crash dump saved in " + Path.normalize(path)); // Output path to console

var crashDialoguePath:String = "FE-CrashDialog";

#if windows
crashDialoguePath += ".exe";
#end

if (FileSystem.exists("./" + crashDialoguePath))
{
Sys.println("Found crash dialog: " + crashDialoguePath);

trace("Found crash dialog: " + crashDialoguePath);
#if linux
crashDialoguePath = "./" + crashDialoguePath;
#end
new Process(crashDialoguePath, [path]);
}
else
{
Sys.println("No crash dialog found! Making a simple alert instead...");
trace("No crash dialog found! Making a simple alert instead...");
Application.current.window.alert(errMsg, "Error!");
}

Sys.exit(1);
// omg maybe this will work im so tired

trace(errMsg);
}
#end

Expand All @@ -140,7 +143,7 @@ class Main extends Sprite

#if !debug
initialState = TitleState;
#end
#end

ClientPrefs.setupDefaults();
addChild(new FlxGame(gameWidth, gameHeight, initialState, #if (flixel < "5.0.0") zoom, #end framerate, framerate, skipSplash, startFullscreen));
Expand Down
15 changes: 12 additions & 3 deletions source/MusicBeatState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class MusicBeatState extends FlxUIState
}

public static function switchState(nextState:FlxState) {
FlxGridOverlay.clearCache();
// Custom made Trans in
var curState:Dynamic = FlxG.state;
var leState:MusicBeatState = curState;
Expand All @@ -112,7 +111,6 @@ class MusicBeatState extends FlxUIState
// hscript shit REAL!!!!
public static function switchHscriptState(nextState:String)
{
FlxGridOverlay.clearCache();
// Custom made Trans in
FlxG.state.openSubState(new CustomFadeTransition(0.6, false));
return;
Expand All @@ -138,6 +136,17 @@ class MusicBeatState extends FlxUIState

public function beatHit():Void
{
//do literally nothing dumbass
//do literally nothing dumbass (no atleast do smth cs it literally crashes)

var wtv:Bool = true;

wtv = !wtv;

var erm:Int = 0;
if (wtv)
erm = 0;

else
erm = 1;
}
}
2 changes: 1 addition & 1 deletion source/PauseSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import flixel.FlxG;
import flixel.FlxSprite;
import flixel.addons.transition.FlxTransitionableState;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.sound.FlxSound;
import flixel.system.FlxSound;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
Expand Down
20 changes: 10 additions & 10 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import flixel.math.FlxMath;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.system.FlxAssets.FlxShader;
import flixel.sound.FlxSound;
import flixel.system.FlxSound;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
Expand Down Expand Up @@ -2520,21 +2520,21 @@ function loadOgStages(stage:String) {
for(i in camHUDShaders){
newCamEffects.push(new ShaderFilter(i.shader));
}
camHUD.filters = newCamEffects;
camHUD._filters = newCamEffects;
case 'camother' | 'other':
camOtherShaders.push(effect);
var newCamEffects:Array<BitmapFilter>=[]; // IT SHUTS HAXE UP IDK WHY BUT WHATEVER IDK WHY I CANT JUST ARRAY<SHADERFILTER>
for(i in camOtherShaders){
newCamEffects.push(new ShaderFilter(i.shader));
}
camOther.filters = newCamEffects;
camOther._filters = newCamEffects;
case 'camgame' | 'game':
camGameShaders.push(effect);
var newCamEffects:Array<BitmapFilter>=[]; // IT SHUTS HAXE UP IDK WHY BUT WHATEVER IDK WHY I CANT JUST ARRAY<SHADERFILTER>
for(i in camGameShaders){
newCamEffects.push(new ShaderFilter(i.shader));
}
camGame.filters = newCamEffects;
camGame._filters = newCamEffects;
default:
if(modchartSprites.exists(cam)) {
Reflect.setProperty(modchartSprites.get(cam),"shader",effect.shader);
Expand Down Expand Up @@ -2565,21 +2565,21 @@ function loadOgStages(stage:String) {
for(i in camHUDShaders){
newCamEffects.push(new ShaderFilter(i.shader));
}
camHUD.filters = newCamEffects;
camHUD._filters = newCamEffects;
case 'camother' | 'other':
camOtherShaders.remove(effect);
var newCamEffects:Array<BitmapFilter>=[];
for(i in camOtherShaders){
newCamEffects.push(new ShaderFilter(i.shader));
}
camOther.filters = newCamEffects;
camOther._filters = newCamEffects;
default:
camGameShaders.remove(effect);
var newCamEffects:Array<BitmapFilter>=[];
for(i in camGameShaders){
newCamEffects.push(new ShaderFilter(i.shader));
}
camGame.filters = newCamEffects;
camGame._filters = newCamEffects;
}


Expand All @@ -2594,15 +2594,15 @@ function loadOgStages(stage:String) {
case 'camhud' | 'hud':
camHUDShaders = [];
var newCamEffects:Array<BitmapFilter>=[];
camHUD.filters = newCamEffects;
camHUD._filters = newCamEffects;
case 'camother' | 'other':
camOtherShaders = [];
var newCamEffects:Array<BitmapFilter>=[];
camOther.filters = newCamEffects;
camOther._filters = newCamEffects;
default:
camGameShaders = [];
var newCamEffects:Array<BitmapFilter>=[];
camGame.filters = newCamEffects;
camGame._filters = newCamEffects;
}


Expand Down
4 changes: 2 additions & 2 deletions source/PlaylistState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package;
import flixel.util.FlxTimer;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.sound.FlxSoundGroup;
import flixel.system.FlxSoundGroup;
import flixel.ui.FlxBar;
import flixel.sound.FlxSound;
import flixel.system.FlxSound;
import flash.text.TextField;
import flixel.FlxG;
import flixel.FlxSprite;
Expand Down
5 changes: 3 additions & 2 deletions source/TitleState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import flixel.group.FlxGroup;
import flixel.input.gamepad.FlxGamepad;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.sound.FlxSound;
import flixel.system.FlxSound;
import flixel.system.ui.FlxSoundTray;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
Expand Down Expand Up @@ -179,7 +179,8 @@ class TitleState extends MusicBeatState
if(FlxG.save.data.flashing == null && !FlashingState.leftState) {
FlxTransitionableState.skipNextTransIn = true;
FlxTransitionableState.skipNextTransOut = true;
FlxG.sound.music.stop();
//FlxG.sound.music.stop();
FlxG.sound.music = null; // kinda tweak to stop crashing??
MusicBeatState.switchState(new FlashingState());
} else {
#if desktop
Expand Down
2 changes: 1 addition & 1 deletion source/editors/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import flixel.addons.ui.FlxUITabMenu;
import flixel.group.FlxGroup;
import flixel.math.FlxMath;
import flixel.math.FlxPoint;
import flixel.sound.FlxSound;
import flixel.system.FlxSound;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
Expand Down
Loading

0 comments on commit 2a999b8

Please sign in to comment.