Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
41 changes: 21 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,26 @@ jobs:
path: export/release/macos/bin
# MacOS On ARM (M1 to M4 chips) Will be commented until we figure it out.

# MacOS-ARM-Build:
# runs-on: macos-latest
MacOS-ARM-Build:
runs-on: macos-latest

# steps:
# - uses: actions/checkout@v4.1.7
steps:
- uses: actions/checkout@v4.1.7

# - uses: krdlab/setup-haxe@master
# with:
# haxe-version: 4.3.4
# - name: Install Haxelib
# run: |
# haxelib setup ~/haxelib
# chmod +x ./compile/workflow/unix.sh
# sh ./compile/workflow/unix.sh
# haxelib list
# - name: Compile MacOS ARM
# run: haxelib run lime build mac -arm64
# - name: Publish Artifact
# uses: actions/upload-artifact@v4
# with:
# name: Universe-MacOS-ARM
# path: export/release/macos/bin
- uses: krdlab/setup-haxe@master
with:
haxe-version: 4.3.4
- name: Install Haxelib
run: |
haxelib setup ~/haxelib
chmod +x ./compile/workflow/unix.sh
sh ./compile/workflow/unix.sh
haxelib list
haxelib install lime 8.2.2 && haxelib set lime 8.2.2
- name: Compile MacOS ARM
run: haxelib run lime build mac -arm64
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
name: Universe-MacOS-ARM
path: export/release/macos/bin
20 changes: 9 additions & 11 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
<project>
<!-- _________________________ Application Settings _________________________ -->

<app title="Friday Night Funkin': Universe Engine" file="UniverseEngine" packageName="com.univere.engine" package="com.universe.engine" main="Main" version="0.2.8" company="Universe" />
<section unless="mac">
<app title="Friday Night Funkin': Universe Engine" file="UniverseEngine" packageName="com.univere.engine" package="com.universe.engine" main="Main" version="0.2.8" company="Universe" />
</section>
<section if="mac"> <!-- Version the final file for mac (Revert to just the top when release build)-->
<app title="Friday Night Funkin': Universe Engine" file="UniverseEngine_1-0-0B2" packageName="com.univere.engine" package="com.universe.engine" main="Main" version="0.2.8" company="Universe" />
</section>

<!--Switch Export with Unique ApplicationID and Icon-->
<set name="APP_ID" value="0x0100f6c013bbc000" />
Expand Down Expand Up @@ -45,23 +50,17 @@

<!-- PSYCH ENGINE CUSTOMIZATION -->
<define name="MODS_ALLOWED" if="desktop" />
<define name="MOD_SUPPORT" if="MODS_ALLOWED" /> <!-- TODO: Rename all instances to MODS_ALLOWED-->
<define name="LUA_ALLOWED" if="desktop" />
<define name="ACHIEVEMENTS_ALLOWED" />
<define name="VIDEOS_ALLOWED" if="web || desktop" unless="32bits"/>
<define name="PSYCH_WATERMARKS"/> <!-- DELETE THIS TO REMOVE WATERMARKS/DEV NAMES ON TITLE SCREEN -->
<define name="TITLE_SCREEN_EASTER_EGG" if="officialBuild"/> <!-- DELETE THE if="officialBuild" for enabling this on an unofficial build -->
<define name="CRASH_HANDLER" if="desktop release" />
<define name="SOFTCODED_STATES" if="MODS_ALLOWED"/>
<define name="GLOBAL_SCRIPT" if="MODS_ALLOWED"/>

<define name="DEV"/>

<define name="PSYCH" />
<define name="PSYCHVERSION" value="0.6.3"/>
<define name="hscript"/>

<define name="GLOBAL_SCRIPT"/>

<assets path="assets/preload" rename="assets" exclude="*.ogg" if="web"/>
<assets path="assets/preload" rename="assets" exclude="*.mp3" unless="web"/>
Expand Down Expand Up @@ -143,9 +142,8 @@
<!--In case you want to use the addons package-->
<!-- god fucking damn it i hate github actions and haxeflixel with their shit 3:< -->
<haxelib name="flixel-addons" />
<haxelib name="hscript" />
<haxelib name="hscript-improved"/>
<haxedef name="hscriptPos" />
<haxelib name="polymod" if="MODS_ALLOWED"/> <!-- Required for the custom mod loader.-->
<haxedef name="POLYMOD_ROOT_PATH" value="game/"/> <!-- This is used to tell polymod where scripts are-->

<!--In case you want to use the ui package-->
<haxelib name="flixel-ui" version="2.5.0"/>
Expand All @@ -157,7 +155,7 @@
<haxelib name="hxdiscord_rpc" version="1.3.0"/>
<!-- <haxelib name="hxcpp-debug-server" if="desktop"/> -->

<!-- <haxelib name="markdown" /> -->
<!-- <haxelib name="markdown" /> --> <!-- WHAT THE FUCK IS MARKDOWN DOING HERE?! -->
<!-- <haxelib name="HtmlParser" /> -->

<!--In case you want to use nape with flixel-->
Expand Down
Binary file added assets/.DS_Store
Binary file not shown.
Binary file added assets/preload/.DS_Store
Binary file not shown.
Binary file added assets/preload/images/.DS_Store
Binary file not shown.
Binary file added assets/preload/uescript/.DS_Store
Binary file not shown.
Binary file added assets/shared/.DS_Store
Binary file not shown.
Binary file added assets/shared/images/.DS_Store
Binary file not shown.
Binary file added compile/.DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions compile/Test_Build_Mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lime test mac -DTEST_BUILD
read -n1 -r -p "Press any key to continue..." key
14 changes: 9 additions & 5 deletions compile/workflow/unix.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
haxelib install lime 8.1.3 && haxelib set lime 8.1.3
haxelib install openfl 9.2.2 && haxelib set openfl 9.2.2
haxelib install flixel 5.6.2 && haxelib set flixel 5.6.2
haxelib install lime 8.2.2 && haxelib set lime 8.2.2
haxelib install openfl 9.4.1 && haxelib set openfl 9.4.1
haxelib install flixel 5.5.0 && haxelib set flixel 5.5.0
haxelib install flixel-addons 3.2.0 && haxelib set flixel-addons 3.2.0
haxelib install flixel-ui 2.5.0 && haxelib set flixel-ui 2.5.0
haxelib install hxvlc 1.9.3 && haxelib set hxvlc 1.9.3
haxelib install polymod
haxelib git jsonpatch https://github.com/EliteMasterEric/jsonpatch f9b83215acd586dc28754b4ae7f69d4c06c3b4d3
haxelib git jsonpath https://github.com/EliteMasterEric/jsonpath 7a24193717b36393458c15c0435bb7c4470ecdda
haxelib git thx.core https://github.com/fponticelli/thx.core 2bf2b992e06159510f595554e6b952e47922f128
haxelib git thx.semver https://github.com/fponticelli/thx.semver bdb191fe7cf745c02a980749906dbf22719e200b

haxelib run lime setup flixel
haxelib run lime setup
Expand All @@ -13,5 +18,4 @@ haxelib install hxcpp-debug-server
haxelib install hxdiscord_rpc

haxelib git hxcpp https://github.com/moxie-coder/hxcpp-compiled
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit
haxelib git hscript-improved https://github.com/CodenameCrew/hscript-improved
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit
14 changes: 9 additions & 5 deletions compile/workflow/windows.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
haxelib install lime 8.1.3 && haxelib set lime 8.1.3
haxelib install openfl 9.2.2 && haxelib set openfl 9.2.2
haxelib install flixel 5.6.2 && haxelib set flixel 5.6.2
haxelib install lime 8.2.2 && haxelib set lime 8.2.2
haxelib install openfl 9.4.1 && haxelib set openfl 9.4.1
haxelib install flixel 5.5.0 && haxelib set flixel 5.5.0
haxelib install flixel-addons 3.2.0 && haxelib set flixel-addons 3.2.0
haxelib install flixel-ui 2.5.0 && haxelib set flixel-ui 2.5.0
haxelib install hxvlc 1.9.3 && haxelib set hxvlc 1.9.3
haxelib install polymod
haxelib git jsonpatch https://github.com/EliteMasterEric/jsonpatch f9b83215acd586dc28754b4ae7f69d4c06c3b4d3
haxelib git jsonpath https://github.com/EliteMasterEric/jsonpath 7a24193717b36393458c15c0435bb7c4470ecdda
haxelib git thx.core https://github.com/fponticelli/thx.core 2bf2b992e06159510f595554e6b952e47922f128
haxelib git thx.semver https://github.com/fponticelli/thx.semver bdb191fe7cf745c02a980749906dbf22719e200b

haxelib run lime setup flixel
haxelib run lime setup
Expand All @@ -13,5 +18,4 @@ haxelib install hxcpp-debug-server
haxelib install hxdiscord_rpc

haxelib git hxcpp https://github.com/moxie-coder/hxcpp-compiled
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit
haxelib git hscript-improved https://github.com/CodenameCrew/hscript-improved
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit
Binary file added example_mods/.DS_Store
Binary file not shown.
Binary file added new_example_mods/.DS_Store
Binary file not shown.
Binary file added new_example_mods/test_folder/.DS_Store
Binary file not shown.
Binary file added new_example_mods/test_folder/_polymod_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions new_example_mods/test_folder/_polymod_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title":"Test Mod",
"description":"This mod is for testing the polymod mod loader framework",
"api_version":"1.0.0",
"mod_version":"1.0.0"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions new_example_mods/test_folder/yuh.json

This file was deleted.

Binary file added source/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions source/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class SaveVariables
public var splashAlpha:Float = 0.6;

// UE
public var enabledMods:Array<Array<String>> = []; // Format: [modID, modName]
public var universeEngineCPREF:Bool = true; // this is to check if you running universe engine!
public var keystrokes:Bool = true;
public var keyA:Float = 0.3;
Expand Down
12 changes: 9 additions & 3 deletions source/HealthIcon.hx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,19 @@ class HealthIcon extends FlxSprite
imageFile = name;
var file:Dynamic = Paths.image(name);

var imageRatio:Int = Math.round(width / height); // The ratio for the image, used to divide the image.
loadGraphic(file); //Load stupidly first for getting the file size
var framesArray:Array<Int> = [0, 1]; // The amount of animation frames
var w2 = width;
loadGraphic(file, true, Math.floor(width / 2), Math.floor(height)); //Then load it fr
iconOffsets[0] = (width - 150) / 2;
iconOffsets[1] = (width - 150) / 2;
for (i in 0...imageRatio)
{
iconOffsets[i] = (width - 150) / imageRatio;
framesArray[i] = i;
}
updateHitbox();

animation.add(char, [0, 1], 0, false, isPlayer);
animation.add(char, framesArray, 0, false, isPlayer);
animation.play(char);
this.char = char;

Expand Down
55 changes: 26 additions & 29 deletions source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import openfl.display.FPS;
import openfl.display.Sprite;
import openfl.events.Event;
import openfl.display.StageScaleMode;
import codename.modding.ModsFolder;
import codename.backend.system.Logs;
import sys.logger.Logs;

//crash handler stuff
#if CRASH_HANDLER
Expand All @@ -25,20 +24,24 @@ import sys.io.File;
import sys.io.Process;
#end

import codename.backend.assets.AssetsLibraryList;
#if MODS_ALLOWED
import modding.PolymodHandler as Modding;
#end

using StringTools;

class Main extends Sprite
{
var gameWidth:Int = 1280; // Width of the game in pixels (might be less / more in actual pixels depending on your zoom).
var gameHeight:Int = 720; // Height of the game in pixels (might be less / more in actual pixels depending on your zoom).
var initialState:Class<FlxState> = TitleState; // The FlxState the game starts with.
var zoom:Float = -1; // If -1, zoom is automatically calculated to fit the window dimensions.
var framerate:Int = 60; // How many frames per second the game should run at.
var skipSplash:Bool = true; // Whether to skip the flixel splash screen that appears in release mode.
var startFullscreen:Bool = false; // Whether to start the game in fullscreen on desktop targets
var modToLoad:String = null;
var game = {
width: 1280,
height: 720,
initialState: TitleState,
zoom: -1.0,
fps: 60,
skipSplash: true,
startFullscreen: false,
};
var gameArgs:Array<String> = []; // Used for allowing mods to define custom commandline arguments.
public static var fpsVar:FPS;

public static var noTerminalColor:Bool = false;
Expand Down Expand Up @@ -79,23 +82,26 @@ class Main extends Sprite

private function setupGame():Void
{
gameArgs = Sys.args();
trace(gameArgs);
var stageWidth:Int = Lib.current.stage.stageWidth;
var stageHeight:Int = Lib.current.stage.stageHeight;

if (zoom == -1)
if (game.zoom == -1)
{
var ratioX:Float = stageWidth / gameWidth;
var ratioY:Float = stageHeight / gameHeight;
zoom = Math.min(ratioX, ratioY);
gameWidth = Math.ceil(stageWidth / zoom);
gameHeight = Math.ceil(stageHeight / zoom);
var ratioX:Float = stageWidth / game.width;
var ratioY:Float = stageHeight / game.height;
game.zoom = Math.min(ratioX, ratioY);
game.width = Math.ceil(stageWidth / game.zoom);
game.height = Math.ceil(stageHeight / game.zoom);
}

Paths.assetsTree = new AssetsLibraryList();
Logs.init();
#if MODS_ALLOWED
Modding.initMods();
#end

ClientPrefs.loadDefaultStuff();
addChild(new FlxGame(gameWidth, gameHeight, initialState, framerate, framerate, skipSplash, startFullscreen));
addChild(new FlxGame(game.width, game.height, game.initialState, game.fps, game.fps, game.skipSplash, game.startFullscreen));

#if !mobile
fpsVar = new FPS(10, 3, 0xFFFFFF);
Expand All @@ -115,15 +121,6 @@ class Main extends Sprite
#if CRASH_HANDLER
Lib.current.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onCrash);
#end

#if GLOBAL_SCRIPT
codename.scripting.GlobalScript.init();
#end

ModsFolder.init();
#if MOD_SUPPORT
ModsFolder.switchMod(modToLoad = ClientPrefs.data.lastLoadedMod);
#end
}

// Code was entirely made by sqirra-rng for their fnf engine named "Izzy Engine", big props to them!!!
Expand Down
4 changes: 2 additions & 2 deletions source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,12 @@ class MainMenuState extends MusicBeatState
MusicBeatState.switchState(new FreeplayState());
#if MODS_ALLOWED
case 'mods':
openSubState(new codename.substates.ModSwitchMenu());
MusicBeatState.switchState(new ModsMenuState());
#end
case 'awards':
MusicBeatState.switchState(new AchievementsMenuState());
case 'credits':
MusicBeatState.switchState(new credits.CreditsState());
MusicBeatState.switchState(new credits.PECreditsState());
case 'options':
LoadingState.loadAndSwitchState(new options.SelectThing());
}
Expand Down
29 changes: 7 additions & 22 deletions source/MusicBeatState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import flixel.FlxState;
import flixel.FlxCamera;
import flixel.FlxBasic;
import flixel.sound.FlxSound;
// scripting
import codename.scripting.ScriptPack;
import codename.scripting.DummyScript;
#if sys
import sys.FileSystem;
import sys.io.File;
Expand All @@ -42,9 +39,6 @@ class MusicBeatState extends modchart.modcharting.ModchartMusicBeatState
inline function get_controls():Controls
return PlayerSettings.player1.controls;

// scripting
public var stateScripts:ScriptPack;

public var scriptsAllowed:Bool = true;

public static var lastScriptName:String = null;
Expand All @@ -55,19 +49,11 @@ class MusicBeatState extends modchart.modcharting.ModchartMusicBeatState
public function new(scriptsAllowed:Bool = true, ?scriptName:String)
{
super();
this.scriptsAllowed = #if SOFTCODED_STATES scriptsAllowed #else false #end;

if (lastStateName != (lastStateName = Type.getClassName(Type.getClass(this))))
{
lastScriptName = null;
}
this.scriptName = scriptName != null ? scriptName : lastScriptName;
lastScriptName = this.scriptName;
}

function loadScript()
function loadScript() // Stubbed untill later, this will be re-used for loading polymod scripts.
{
var className = Type.getClassName(Type.getClass(this));
/* var className = Type.getClassName(Type.getClass(this));
if (stateScripts == null)
(stateScripts = new ScriptPack(className)).setParent(this);
if (scriptsAllowed)
Expand All @@ -88,7 +74,7 @@ class MusicBeatState extends modchart.modcharting.ModchartMusicBeatState
}
else
stateScripts.reload();
}
} */
}

override function create()
Expand All @@ -108,10 +94,12 @@ class MusicBeatState extends modchart.modcharting.ModchartMusicBeatState
FlxTransitionableState.skipNextTransOut = false;
}

public function call(name:String, ?args:Array<Dynamic>, ?defaultVal:Dynamic):Dynamic {
// calls the function on the assigned script
public function call(name:String, ?args:Array<Dynamic>, ?defaultVal:Dynamic):Dynamic { // Stubbed untill polymod loader finished.
/* // calls the function on the assigned script
if(stateScripts != null)
return stateScripts.call(name, args);
return defaultVal; */

return defaultVal;
}

Expand Down Expand Up @@ -140,9 +128,6 @@ class MusicBeatState extends modchart.modcharting.ModchartMusicBeatState
if (FlxG.save.data != null)
FlxG.save.data.fullscreen = FlxG.fullscreen;

if (FlxG.keys.justPressed.F5)
loadScript();

call("update", [elapsed]);

super.update(elapsed);
Expand Down
Loading
Loading