Skip to content

Commit

Permalink
Merge branch 'Yoshubs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ImCodist authored Sep 12, 2021
2 parents 53f56ad + 5294e79 commit eb36a54
Show file tree
Hide file tree
Showing 98 changed files with 564 additions and 54 deletions.
Binary file added FE-CrashDialog.exe
Binary file not shown.
10 changes: 9 additions & 1 deletion Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- _________________________ Application Settings _________________________ -->

<app title="Friday Night Funkin' Forever Engine" file="FunkinForever" packageName="com.ninjamuffin99.funkin" package="com.ninjamuffin99.funkin" main="Main" version="0.2.7.1" company="ninjamuffin99" />
<app title="Friday Night Funkin' Forever Engine" file="Forever Engine" packageName="com.ninjamuffin99.funkin" package="com.ninjamuffin99.funkin" main="Main" version="0.2.7.1" company="ninjamuffin99" />

<!--The flixel preloader is not accurate in Chrome. You can use it regularly if you embed the swf into a html file
or you can set the actual size of your file manually at "FlxPreloaderBase-onUpdate-bytesTotal"-->
Expand Down Expand Up @@ -31,6 +31,7 @@
<set name="BUILD_DIR" value="export" />
<source path="source" />
<assets path="assets" />
<assets path="FE-CrashDialog.exe" type="template" if="windows release" />
<!--<assets path="mods" />-->

<!-- _______________________________ Libraries ______________________________ -->
Expand All @@ -46,6 +47,9 @@

<!-- ______________________________ Haxedefines _____________________________ -->

<set name="BUILD_DIR" value="export/debug" if="debug" />
<set name="BUILD_DIR" value="export/release" unless="debug" />

<!--Enable the Flixel core recording system-->
<!--<haxedef name="FLX_RECORD" />-->

Expand Down Expand Up @@ -76,6 +80,10 @@
<!--Enable this for Nape release builds for a serious peformance improvement-->
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />

<!-- Akways enable Null Object Reference check for crash dialog -->
<haxedef name="HXCPP_CHECK_POINTER" if="release" />
<haxedef name="HXCPP_STACK_LINE" if="release" />

<!-- _________________________________ Custom _______________________________ -->

<icon path="art/icon16.png" size='16'/>
Expand Down
Binary file added assets/images/UI/forever/base/chart editor/ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/music/Lunchbox.mp3
Binary file not shown.
Binary file removed assets/music/LunchboxScary.mp3
Binary file not shown.
Binary file removed assets/music/breakfast.mp3
Binary file not shown.
Binary file removed assets/music/freakyMenu.mp3
Binary file not shown.
Binary file removed assets/music/gameOver-pixel.mp3
Binary file not shown.
Binary file removed assets/music/gameOver.mp3
Binary file not shown.
Binary file removed assets/music/gameOverEnd-pixel.mp3
Binary file not shown.
Binary file removed assets/music/gameOverEnd.mp3
Binary file not shown.
Binary file removed assets/songs/blammed/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/blammed/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/bopeebo/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/bopeebo/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/cocoa/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/cocoa/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/dadbattle/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/dadbattle/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/eggnog/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/eggnog/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/fresh/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/fresh/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/high/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/high/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/milf/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/milf/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/monster/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/monster/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/philly-nice/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/philly-nice/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/pico/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/pico/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/roses/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/roses/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/satin-panties/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/satin-panties/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/senpai/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/senpai/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/south/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/south/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/spookeez/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/spookeez/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/test/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/test/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/thorns/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/thorns/Voices.mp3
Binary file not shown.
Binary file removed assets/songs/tutorial/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/winter-horrorland/Inst.mp3
Binary file not shown.
Binary file removed assets/songs/winter-horrorland/Voices.mp3
Binary file not shown.
Binary file removed assets/sounds/ANGRY.mp3
Binary file not shown.
Binary file removed assets/sounds/ANGRY_TEXT_BOX.mp3
Binary file not shown.
Binary file removed assets/sounds/GF_1.mp3
Binary file not shown.
Binary file removed assets/sounds/GF_2.mp3
Binary file not shown.
Binary file removed assets/sounds/GF_3.mp3
Binary file not shown.
Binary file removed assets/sounds/GF_4.mp3
Binary file not shown.
Binary file removed assets/sounds/Lights_Shut_off.mp3
Binary file not shown.
Binary file removed assets/sounds/Lights_Turn_On.mp3
Binary file not shown.
Binary file removed assets/sounds/Senpai_Dies.mp3
Binary file not shown.
Binary file removed assets/sounds/badnoise1.mp3
Binary file not shown.
Binary file removed assets/sounds/badnoise2.mp3
Binary file not shown.
Binary file removed assets/sounds/badnoise3.mp3
Binary file not shown.
Binary file removed assets/sounds/cancelMenu.mp3
Binary file not shown.
Binary file removed assets/sounds/carPass0.mp3
Binary file not shown.
Binary file removed assets/sounds/carPass1.mp3
Binary file not shown.
Binary file removed assets/sounds/clickText.mp3
Binary file not shown.
Binary file removed assets/sounds/confirmMenu.mp3
Binary file not shown.
Binary file removed assets/sounds/fnf_loss_sfx-pixel.mp3
Binary file not shown.
Binary file removed assets/sounds/fnf_loss_sfx.mp3
Binary file not shown.
Binary file removed assets/sounds/intro1-base.mp3
Binary file not shown.
Binary file removed assets/sounds/intro1-pixel.mp3
Binary file not shown.
Binary file removed assets/sounds/intro2-base.mp3
Binary file not shown.
Binary file removed assets/sounds/intro2-pixel.mp3
Binary file not shown.
Binary file removed assets/sounds/intro3-base.mp3
Binary file not shown.
Binary file removed assets/sounds/intro3-pixel.mp3
Binary file not shown.
Binary file removed assets/sounds/introGo-base.mp3
Binary file not shown.
Binary file removed assets/sounds/introGo-pixel.mp3
Binary file not shown.
Binary file removed assets/sounds/missnote1.mp3
Binary file not shown.
Binary file removed assets/sounds/missnote2.mp3
Binary file not shown.
Binary file removed assets/sounds/missnote3.mp3
Binary file not shown.
Binary file removed assets/sounds/pixelText.mp3
Binary file not shown.
Binary file removed assets/sounds/scrollMenu.mp3
Binary file not shown.
Binary file removed assets/sounds/soundNoteTick.mp3
Binary file not shown.
Binary file removed assets/sounds/soundTest.mp3
Binary file not shown.
Binary file removed assets/sounds/thunder_1.mp3
Binary file not shown.
Binary file removed assets/sounds/thunder_2.mp3
Binary file not shown.
Binary file removed assets/sounds/train_passes.mp3
Binary file not shown.
24 changes: 17 additions & 7 deletions source/Init.hx
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ class Init extends FlxState
"Enables Ghost Tapping, allowing you to press inputs without missing.",
NOT_FORCED
],
'Diagonalscroll' => [false, 0, 'kill me'],
'Centered Notefield' => [false, 0, "Center the notes, disables the enemy's notes."],
"Custom Titlescreen" => [
true,
false,
0,
"Enables the custom Forever Engine titlescreen! (only effective with a restart)",
FORCED
]
],
'Camera-fixed Judgements' => [false, 0, ""],
];

public static var trueSettings:Map<String, Dynamic> = [];
Expand Down Expand Up @@ -157,7 +157,7 @@ class Init extends FlxState

override public function create():Void
{
FlxG.save.bind('forever', 'engine');
FlxG.save.bind('foreverengine-options');
Highscore.load();

loadSettings();
Expand All @@ -176,7 +176,15 @@ class Init extends FlxState
FlxG.mouse.useSystemCursor = true; // Use system cursor because it's prettier
FlxG.mouse.visible = false; // Hide mouse on start

Main.switchState(this, new TitleState());
gotoTitleScreen();
}

private function gotoTitleScreen()
{
if (trueSettings.get("Custom Titlescreen"))
Main.switchState(this, new CustomTitlescreen());
else
Main.switchState(this, new TitleState());
}

public static function loadSettings():Void
Expand All @@ -194,12 +202,14 @@ class Init extends FlxState
{
var settingsMap:Map<String, Dynamic> = FlxG.save.data.settings;
for (singularSetting in settingsMap.keys())
if (gameSettings.get(singularSetting)[3] != FORCED)
if (gameSettings.get(singularSetting) != null && gameSettings.get(singularSetting)[3] != FORCED)
trueSettings.set(singularSetting, FlxG.save.data.settings.get(singularSetting));
}

// lemme fix that for you
if (!Std.isOfType(trueSettings.get("Framerate Cap"), Int) || trueSettings.get("Framerate Cap") < 30)
if (!Std.isOfType(trueSettings.get("Framerate Cap"), Int)
|| trueSettings.get("Framerate Cap") < 30
|| trueSettings.get("Framerate Cap") > 360)
trueSettings.set("Framerate Cap", 30);

// 'hardcoded' ui skins
Expand Down
69 changes: 68 additions & 1 deletion source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ import flixel.util.FlxColor;
import gameFolder.meta.*;
import gameFolder.meta.data.PlayerSettings;
import gameFolder.meta.data.dependency.Discord;
import haxe.CallStack.StackItem;
import haxe.CallStack;
import haxe.io.Path;
import lime.app.Application;
import openfl.Assets;
import openfl.Lib;
import openfl.display.FPS;
import openfl.display.Sprite;
import openfl.events.Event;
import openfl.events.UncaughtErrorEvent;
import sys.FileSystem;
import sys.io.File;
import sys.io.Process;

// Here we actually import the states and metadata, and just the metadata.
// It's nice to have modularity so that we don't have ALL elements loaded at the same time.
Expand Down Expand Up @@ -60,7 +68,7 @@ class Main extends Sprite
public static var mainClassState:Class<FlxState> = Init; // Determine the main class state of the game
public static var framerate:Int = 120; // How many frames per second the game should run at.

public static var gameVersion:String = '0.2.3';
public static var gameVersion:String = '0.2.3.1';

public static var loadedAssets:Array<FlxBasic> = [];

Expand Down Expand Up @@ -137,6 +145,8 @@ class Main extends Sprite
note studders and shit its weird.
**/

Lib.current.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onCrash);

#if html5
framerate = 60;
#end
Expand Down Expand Up @@ -230,4 +240,61 @@ class Main extends Sprite
}
// */
}

function onCrash(e:UncaughtErrorEvent):Void
{
var errMsg:String = "";
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/" + "FE_" + dateNow + ".txt";

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

errMsg += "\nUncaught Error: " + e.error + "\nPlease report this error to the GitHub page: https://github.com/Yoshubs/Forever-Engine";

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

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

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

var crashDialoguePath:String = "FE-CrashDialog";

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

if (FileSystem.exists("./" + crashDialoguePath))
{
Sys.println("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...");
Application.current.window.alert(errMsg, "Error!");
}

Sys.exit(1);
}
}
1 change: 0 additions & 1 deletion source/Paths.hx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class Paths
{
// Here we set up the paths class. This will be used to
// Return the paths of assets and call on those assets as well.
// set the current song extension to either OGG or MP3 depending on the client
inline public static var SOUND_EXT = "ogg";

// level we're loading
Expand Down
12 changes: 12 additions & 0 deletions source/gameFolder/gameObjects/userInterface/menu/DebugUI.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package gameFolder.gameObjects.userInterface.menu;

import flixel.FlxSprite;

/**
HEAVILY BASED ON FLIXEL UI SHIT
check that out lol its in the same library youre using rn
**/
class DebugCheckmark extends FlxSprite
{
//
}
8 changes: 4 additions & 4 deletions source/gameFolder/meta/data/Timings.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class Timings
// from left to right
// max milliseconds, score from it and percentage
public static var ratingsMap:Map<String, Array<Dynamic>> = [
"sick" => [50, 350, 100],
"good" => [90, 150, 50],
"bad" => [145, 0, -25],
"shit" => [180, -20, -50],
"sick" => [30, 350, 100],
"good" => [100, 150, 50],
"bad" => [145, 0, -75],
"shit" => [180, -20, -90],
"miss" => [200, -50, -100],
];

Expand Down
Loading

0 comments on commit eb36a54

Please sign in to comment.