Skip to content

Commit

Permalink
jk, engine update
Browse files Browse the repository at this point in the history
- hxcodec replaced with hxvlc cuz its better :)
- engine is now called alleyway engine, yes really.
- dialogue box rework
- custom week flash color, like in Mid-Fight Masses
  • Loading branch information
charlesisfeline committed Feb 8, 2024
1 parent 9250102 commit b3f4386
Show file tree
Hide file tree
Showing 29 changed files with 1,209 additions and 708 deletions.
28 changes: 15 additions & 13 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<project>
<!-- _________________________ Application Settings _________________________ -->

<app title="Friday Night Funkin': Vs. Foxa" packageName="com.shadowmario.psychengine" package="com.shadowmario.psychengine" main="Main" version="0.2.8" company="ShadowMario" />
<app packageName="com.vsfoxateam.vsfoxa" package="com.vsfoxateam.vsfoxa" main="Main" version="0.2.8" company="VsFoxaTeam" />

<app file="VsFoxa" unless="STORY_EDITION" />
<app file="VsFoxaStoryEdition" if="STORY_EDITION" />
<app title="Friday Night Funkin': Vs. Foxa" file="VsFoxa" unless="STORY_EDITION" />
<app title="Friday Night Funkin': Vs. Foxa Story Edition" file="VsFoxaStoryEdition" if="STORY_EDITION" />

<!--<define name="STORY_EDITION" />-->

Expand All @@ -25,7 +25,7 @@
<define name="ACHIEVEMENTS_ALLOWED" />
<define name="LOADING_SCREEN" />
<define name="VIDEOS_ALLOWED" if="windows || linux || android" unless="32bits" /><!-- wait why is there some hints of an official android port wtf -->
<define name="PSYCH_WATERMARKS" /> <!-- DELETE THIS TO REMOVE WATERMARKS/DEV NAMES ON TITLE SCREEN -->
<define name="ALLEYWAY_WATERMARKS" /> <!-- DELETE THIS TO REMOVE WATERMARKS/DEV NAMES ON TITLE SCREEN -->
<define name="TITLE_SCREEN_EASTER_EGG" /> <!-- DELETE THE if="officialBuild" for enabling this on an unofficial build -->

<!-- ____________________________ Window Settings ___________________________ -->
Expand Down Expand Up @@ -78,7 +78,7 @@
</section>

<section if="MODS_ALLOWED">
<assets path="example_mods" rename="mods" embed="false" />
<assets path='example_mods' rename='mods' embed='false' type='template'/>
</section>

<assets path='art/readme.txt' rename='do NOT readme.txt' />
Expand All @@ -93,7 +93,7 @@
<!--Psych stuff needed-->
<haxelib name="linc_luajit" if="LUA_ALLOWED"/>
<haxelib name="SScript" if="HSCRIPT_ALLOWED"/>
<haxelib name="hxCodec" if="VIDEOS_ALLOWED"/>
<haxelib name="hxvlc" if="VIDEOS_ALLOWED"/>
<haxelib name="discord_rpc" if="desktop"/>
<haxelib name="flxanimate"/>
<haxelib name="tjson" />
Expand All @@ -103,8 +103,6 @@

<!-- Enables a terminal log prompt on debug builds -->
<haxelib name="hxcpp-debug-server" if="debug"/>
<haxedef name="HXC_LIBVLC_LOGGING" if="VIDEOS_ALLOWED debug" />

<haxelib name="systools" unless="mac" />
<ndll name="systools" haxelib="systools" unless="mac" />

Expand All @@ -116,11 +114,6 @@
<!--Disable the Flixel core focus lost screen-->
<haxedef name="FLX_NO_FOCUS_LOST_SCREEN" />

<!--Show debug traces for hxCodec-->
<section if="VIDEOS_ALLOWED">
<haxedef name="HXC_LIBVLC_LOGGING" if="debug" />
</section>

<!--Disable the Flixel core debugger. Automatically gets set whenever you compile in release mode!-->
<haxedef name="FLX_NO_DEBUG" unless="debug" />

Expand Down Expand Up @@ -163,6 +156,15 @@
<dependency name="Metal.framework" if="${lime &lt; 8.0.0}" />
</section>

<!--hxVLC Defines-->
<section if="VIDEOS_ALLOWED">
<!--The level of verbosity that is being used for logging-->
<haxedef name="HXVLC_VERBOSE" value="2" if="debug" />

<!--Enable libVLC logging on hxVLC-->
<haxedef name="HXVLC_LOGGING" if="debug" />
</section>

<!-- _________________________________ Custom _______________________________ -->

<assets path='art/icon16.png' rename='icon.png' if="linux" />
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ Once finished, you should be ready to compile, you can open a terminal in the so

With `<target>` being either `windows`, `mac` or `linux`.

If the compiler gives an error saying that hxCodec cannot be found read this issue to fix it: ShadowMario/FNF-PsychEngine#12770

If you want to just play the mod and not compile, just use the action builds (either through just Github's Actions tab, which requires a Github account, or use nightly.link). For Linux users though, fuck you, use Wine to play the mod, suckers!!!!!

## Customization:
Expand All @@ -106,7 +104,6 @@ same goes for *Lua & Haxe Scripts*, comment out or delete the line with `LUA_ALL
* SqirraRNG - Crash Handler and Base code for Chart Editor's Waveform
* KadeDev - Fixed some cool stuff on Chart Editor and other PRs
* iFlicky - Composer of Psync and Tea Time, also made the Dialogue Sounds
* PolybiusProxy - .MP4 Video Loader Library (hxCodec)
* Keoiki - Note Splash Animations
* Smokey - Sprite Atlas Support
* SuperPowers04 - LUA JIT Fork and some Lua reworks
Expand Down
2 changes: 1 addition & 1 deletion hmm.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"version": null
},
{
"name": "hxCodec",
"name": "hxvlc",
"type": "haxelib",
"version": null
},
Expand Down
2 changes: 1 addition & 1 deletion setup/setup-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ haxelib install tjson
haxelib install flixel-addons
haxelib install flixel-tools
haxelib install SScript
haxelib install hxCodec
haxelib install hxvlc
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit
haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
2 changes: 1 addition & 1 deletion setup/setup-windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ haxelib install tjson
haxelib install flixel-addons
haxelib install flixel-tools
haxelib install SScript
haxelib install hxCodec
haxelib install hxvlc
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit
haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
curl -# -O https://download.visualstudio.microsoft.com/download/pr/3105fcfe-e771-41d6-9a1c-fc971e7d03a7/8eb13958dc429a6e6f7e0d6704d43a55f18d02a253608351b6bf6723ffdaf24e/vs_Community.exe
Expand Down
2 changes: 1 addition & 1 deletion source/backend/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class ClientPrefs {

if(Main.fpsVar != null) Main.fpsVar.visible = data.showFPS;

#if (!html5 && !switch)
#if (!html5)
FlxG.autoPause = ClientPrefs.data.autoPause;

if(FlxG.save.data.framerate == null) {
Expand Down
53 changes: 33 additions & 20 deletions source/backend/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,32 @@ class CoolUtil
return colorNum != null ? colorNum : FlxColor.WHITE;
}

public static function listFromString(string:String, trimLines:Bool = true):Array<String>
/**
* Returns a `FlxColor` by receiving an array with integer values,
* automatically fixes the array if fields are missing,
* format: [Red, Green, Blue, Alpha].
* @param colors Your base color array.
* @param defColors The default colors that should be used in the event of an error.
**/
inline public static function colorFromArray(colors: Array<Int>, ?defColors: Array<Int>) {
colors = fixRGBColorArray(colors, defColors);
return FlxColor.fromRGB(colors[0], colors[1], colors[2], colors[3]);
}

inline public static function fixRGBColorArray(colors: Array<Int>, ?defColors: Array<Int>) {
// helper function used on characters n such
final endResult: Array<Int> = (defColors != null && defColors.length > 2) ? defColors : [255, 255, 255, 255]; // Red, Green, Blue, Alpha
for (i in 0...endResult.length) if (colors[i] > -1) endResult[i] = colors[i];
return endResult;
}

inline public static function listFromString(string:String):Array<String>
{
final daList:Array<String> = string.trim().replace('\r\n', '\n').split('\n');
if(trimLines) for (i in 0...daList.length) daList[i] = daList[i].trim();
var daList:Array<String> = string.trim().split('\n');
for (i in 0...daList.length) daList[i] = daList[i].trim();
return daList;
}

public static function floorDecimal(value:Float, decimals:Int):Float
{
if(decimals < 1) return Math.floor(value);
Expand Down Expand Up @@ -130,20 +149,17 @@ class CoolUtil
}

public static function setTextBorderFromString(text:FlxText, border:String) {
switch (border.toLowerCase().trim()){
case 'shadow': text.borderStyle = SHADOW;
case 'outline': text.borderStyle = OUTLINE;
case 'outline_fast', 'outlinefast': text.borderStyle = OUTLINE_FAST;
default: text.borderStyle = NONE;
text.borderStyle = switch(border.toLowerCase().trim())
{
case 'shadow': SHADOW;
case 'outline': OUTLINE;
case 'outline_fast', 'outlinefast': OUTLINE_FAST;
default: NONE;
}
}

inline public static function browserLoad(site:String) {
#if linux
Sys.command('/usr/bin/xdg-open', [site]);
#else
FlxG.openURL(site);
#end
public static function browserLoad(site:String) {
#if linux Sys.command('/usr/bin/xdg-open', [site]); #else FlxG.openURL(site); #end
}

inline public static function openFolder(folder:String, absolute:Bool = false) {
Expand All @@ -153,11 +169,8 @@ class CoolUtil
folder = folder.replace('/', '\\');
if(folder.endsWith('/')) folder.substr(0, folder.length - 1);

#if linux
var command:String = '/usr/bin/xdg-open';
#else
var command:String = 'explorer.exe';
#end
final command:String = #if linux '/usr/bin/xdg-open' #else 'explorer.exe' #end;

Sys.command(command, [folder]);
trace('$command $folder');
#else
Expand Down
49 changes: 31 additions & 18 deletions source/backend/WeekData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ typedef WeekFile =
{
// JSON variables
var songs:Array<Dynamic>;
var difficulties:String;
var startUnlocked:Bool;
var hiddenUntilUnlocked:Bool;
var weekName:String;
// -- STORY MENU SPECIFIC -- //
var weekCharacters:Array<String>;
var weekBackground:String;
var flashingColor:Array<Int>;
var hideStoryMode:Bool;
var weekBefore:String;
var storyName:String;
var weekName:String;
// -- FREEPLAY MENU SPECIFIC -- //
var freeplayColor:Array<Int>;
var startUnlocked:Bool;
var hiddenUntilUnlocked:Bool;
var hideStoryMode:Bool;
var hideFreeplay:Bool;
var difficulties:String;
}

class WeekData {
Expand All @@ -28,45 +31,55 @@ class WeekData {

// JSON variables
public var songs:Array<Dynamic>;
public var difficulties:String;
public var startUnlocked:Bool;
public var hiddenUntilUnlocked:Bool;
public var weekName:String;
// -- STORY MENU SPECIFIC -- //
public var weekCharacters:Array<String>;
public var weekBackground:String;
public var flashingColor:FlxColor = 0xFF33FFFF;
public var hideStoryMode:Bool;
public var weekBefore:String;
public var storyName:String;
public var weekName:String;
// -- FREEPLAY MENU SPECIFIC -- //
public var freeplayColor:Array<Int>;
public var startUnlocked:Bool;
public var hiddenUntilUnlocked:Bool;
public var hideStoryMode:Bool;
public var hideFreeplay:Bool;
public var difficulties:String;

public var fileName:String;

public static function createWeekFile():WeekFile {
var weekFile:WeekFile = {
songs: [["Bopeebo", "dad", [146, 113, 253]], ["Fresh", "dad", [146, 113, 253]], ["Dad Battle", "dad", [146, 113, 253]]],
public static inline function createWeekFile():WeekFile {
return {
songs: [
["Bopeebo", "dad", [146, 113, 253]],
["Fresh", "dad", [146, 113, 253]],
["Dad Battle", "dad", [146, 113, 253]]
],
weekCharacters: ['dad', 'bf', 'gf'],
weekBackground: 'stage',
weekBefore: 'tutorial',
storyName: 'Your New Week',
weekName: 'Custom Week',
freeplayColor: [146, 113, 253],
flashingColor: [51, 255, 255], // 0xFF33FFFF
startUnlocked: true,
hiddenUntilUnlocked: false,
hideStoryMode: false,
hideFreeplay: false,
difficulties: ''
};
return weekFile;
}

// HELP: Is there any way to convert a WeekFile to WeekData without having to put all variables there manually? I'm kind of a noob in haxe lmao
public function new(weekFile:WeekFile, fileName:String) {
// here ya go - MiguelItsOut
for (field in Reflect.fields(weekFile))
if(Reflect.fields(this).contains(field)) // Reflect.hasField() won't fucking work :/
Reflect.setProperty(this, field, Reflect.getProperty(weekFile, field));

for (field in Reflect.fields(weekFile)) {
if(Reflect.fields(this).contains(field) && field != "flashingColor") {// Reflect.hasField() won't fucking work :/
Reflect.setProperty(this, field,Reflect.field(weekFile, field));
}
}
if (weekFile.flashingColor != null) // had to do it manually lol @crowplexus
flashingColor = CoolUtil.colorFromArray(weekFile.flashingColor);
this.fileName = fileName;
}

Expand Down
Loading

0 comments on commit b3f4386

Please sign in to comment.