Skip to content

Commit

Permalink
josh hutcherson
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesisfeline committed Dec 25, 2023
1 parent 3052fc9 commit 1142d6d
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 94 deletions.
82 changes: 44 additions & 38 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!--<define name="STORY_EDITION" />-->

<!-- NOTE TO SELF: DISABLE THIS IF ISSUES ARE FOUND, theres no issues :) -->
<haxedef name="LINC_LUA_RELATIVE_DYNAMIC_LIB"/> <!-- stable lua -->
<haxedef name="LINC_LUA_RELATIVE_DYNAMIC_LIB" /> <!-- stable lua -->

<app preloader="flixel.system.FlxPreloader" />
<set name="SWF_VERSION" value="11.8" /> <!-- but this isnt flash :/-->
Expand All @@ -24,27 +24,26 @@
<define name="GITHUB_ALLOWED" />
<define name="ACHIEVEMENTS_ALLOWED" />
<define name="LOADING_SCREEN" /> <!-- i'll fix later-->
<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="TITLE_SCREEN_EASTER_EGG"/> <!-- DELETE THE if="officialBuild" for enabling this on an unofficial build -->
<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="TITLE_SCREEN_EASTER_EGG" /> <!-- DELETE THE if="officialBuild" for enabling this on an unofficial build -->

<!-- ____________________________ Window Settings ___________________________ -->

<!--These window settings apply to all targets-->
<window width="1280" height="720" fps="" background="#000000" hardware="true" vsync="false" />
<window width="1280" height="720" fps="60" background="#000000" hardware="true" vsync="false" />

<!--HTML5-specific-->
<window if="html5" resizable="true"/>
<window if="html5" resizable="true" />

<!--Desktop-specific-->
<window if="desktop" orientation="landscape" fullscreen="false" resizable="true" vsync="false"/>
<window if="desktop" orientation="landscape" fullscreen="false" resizable="true" vsync="false" />

<!--macOS-->
<window if="mac" orientation="auto" fullscreen="false" resizable="true" vsync="false"
allow-high-dpi="true" />
<window if="mac" orientation="auto" fullscreen="false" resizable="true" vsync="false" allow-high-dpi="true" />

<!--Mobile-specific-->
<window if="mobile" orientation="landscape" fullscreen="true" width="0" height="0" resizable="false"/>
<window if="mobile" orientation="landscape" fullscreen="true" width="0" height="0" resizable="false" />

<!-- _____________________________ Path Settings ____________________________ -->

Expand All @@ -58,27 +57,30 @@

<!-- Assets -->
<assets path="assets/fonts" />
<assets path="assets/shared" exclude="*.ogg" if="web"/>
<assets path="assets/shared" exclude="*.mp3" unless="web"/>
<assets path="assets/videos" library="videos" if="VIDEOS_ALLOWED"/>
<assets path="assets/songs" library="songs" exclude="*.ogg" if="web"/>
<assets path="assets/songs" library="songs" exclude="*.mp3" unless="web"/>
<assets path="assets/week_assets" library="week_assets" rename="assets" exclude="*.ogg" if="web"/>
<assets path="assets/week_assets" library="week_assets" rename="assets" exclude="*.mp3" unless="web"/>
<assets path="assets/shared" exclude="*.ogg" if="web" />
<assets path="assets/shared" exclude="*.mp3" unless="web" />
<assets path="assets/videos" library="videos" if="VIDEOS_ALLOWED" />
<assets path="assets/songs" library="songs" exclude="*.ogg" if="web" />
<assets path="assets/songs" library="songs" exclude="*.mp3" unless="web" />
<assets path="assets/week_assets" library="week_assets" rename="assets" exclude="*.ogg" if="web" />
<assets path="assets/week_assets" library="week_assets" rename="assets" exclude="*.mp3" unless="web" />
<section if="TITLE_SCREEN_EASTER_EGG">
<assets path="assets/secrets" rename="assets/shared" exclude="*.ogg" if="web"/>
<assets path="assets/secrets" rename="assets/shared" exclude="*.mp3" unless="web"/>
<assets path="assets/secrets" rename="assets/shared" exclude="*.ogg" if="web" />
<assets path="assets/secrets" rename="assets/shared" exclude="*.mp3" unless="web" />
</section>

<library name="videos" preload="true" />
<library name="videos" preload="true" if="VIDEOS_ALLOWED" />
<library name="songs" preload="true" />
<library name="week_assets" preload="true" />

<define name="CHECK_FOR_UPDATES" if="desktop officialBuild"/>
<section unless="web">
<define name="CHECK_FOR_UPDATES" if="officialBuild" />
</section>

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

<assets path='art/readme.txt' rename='do NOT readme.txt' />
<assets path='art/the rel readme.txt' rename='the REAL readme.txt' />

Expand All @@ -102,45 +104,49 @@

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

<!-- ______________________________ Haxedefines _____________________________ -->

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

<!--Disable the Flixel core focus lost screen-->
<haxedef name="FLX_NO_FOCUS_LOST_SCREEN" />

<!-- Show debug traces for hxCodec -->
<haxedef name="HXC_DEBUG_TRACE" if="debug" />


<!--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" />

<haxedef name="HXCPP_GC_BIG_BLOCKS" if="debug" /> <!-- mmmm memory (for debug only) -->
<haxedef name="HXCPP_GC_BIG_BLOCKS" if="cpp debug" /> <!-- mmmm memory (for debug only) -->

<!--Enable this for Nape release builds for a serious peformance improvement-->
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />

<!--Used for Izzy Engine's crash handler-->
<haxedef name="HXCPP_CHECK_POINTER" if="CRASH_HANDLER" />
<haxedef name="HXCPP_STACK_LINE" if="CRASH_HANDLER" />
<haxedef name="HXCPP_STACK_TRACE" if="CRASH_HANDLER" />
<haxedef name="HXCPP_DEBUG_LINK" if="CRASH_HANDLER" />
<haxedef name='no-deprecation-warnings' unless="debug" />

<section if="CRASH_HANDLER">
<haxedef name="HXCPP_CHECK_POINTER" />
<haxedef name="HXCPP_STACK_LINE" />
<haxedef name="HXCPP_STACK_TRACE" />
<haxedef name="HXCPP_DEBUG_LINK" />
</section>

<!--Disable deprecated warnings-->
<haxedef name="no-deprecation-warnings" />

<!--Macro fixes-->
<haxeflag name="--macro" value="allowPackage('flash')" />
<haxeflag name="--macro" value="include('my.pack')" />
<haxeflag name="-dce" value="no" if="HSCRIPT_ALLOWED" />

<!-- FIX LINUX NOW! -->
<!--Disables the use of precompiled headers but can cause issues with build times and memory usage-->
<haxedef name="NO_PRECOMPILED_HEADERS" if="linux" />

<!-- _________________________________ Custom _______________________________ -->

<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->

<assets path='art/icon16.png' rename='icon.png' if="linux" />
<icon path="art/icon16.png" size='16'/>
<icon path="art/iconOG.png" />
Expand Down
9 changes: 8 additions & 1 deletion source/backend/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,14 @@ class ClientPrefs {

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

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

if(FlxG.save.data.framerate == null) {
final refreshRate:Int = FlxG.stage.application.window.displayMode.refreshRate;
data.framerate = Std.int(FlxMath.bound(refreshRate, 60, 240));
}
#end

if(data.framerate > FlxG.drawFramerate) {
FlxG.updateFramerate = data.framerate;
Expand Down
2 changes: 2 additions & 0 deletions source/options/GraphicsSettingsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ class GraphicsSettingsSubState extends BaseOptionsMenu {
'int');
addOption(option);

final refreshRate:Int = FlxG.stage.application.window.displayMode.refreshRate;
option.minValue = 60;
option.maxValue = 240;
option.defaultValue = Std.int(FlxMath.bound(refreshRate, option.minValue, option.maxValue));
option.displayFormat = '%v FPS';
option.onChange = onChangeFramerate;
#end
Expand Down
41 changes: 38 additions & 3 deletions source/psychlua/ReflectionFunctions.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import substates.GameOverSubstate;

class ReflectionFunctions
{
static final instanceStr:Dynamic = "##PSYCHLUA_STRINGTOOBJ";

public static function implement(funk:FunkinLua)
{
var lua:State = funk.lua;
Expand Down Expand Up @@ -132,11 +134,11 @@ class ReflectionFunctions
});

Lua_helper.add_callback(lua, "callMethod", function(funcToRun:String, ?args:Array<Dynamic> = null) {
return callMethodFromObject(PlayState.instance, funcToRun, args);
return callMethodFromObject(PlayState.instance, funcToRun, parseInstances(args));

});
Lua_helper.add_callback(lua, "callMethodFromClass", function(className:String, funcToRun:String, ?args:Array<Dynamic> = null) {
return callMethodFromObject(Type.resolveClass(className), funcToRun, args);
return callMethodFromObject(Type.resolveClass(className), funcToRun, parseInstances(args));
});

Lua_helper.add_callback(lua, "createInstance", function(variableToSave:String, className:String, ?args:Array<Dynamic> = null) {
Expand Down Expand Up @@ -179,6 +181,39 @@ class ReflectionFunctions
}
else FunkinLua.luaTrace('addInstance: Can\'t add what doesn\'t exist~ ($objectName)', false, false, FlxColor.RED);
});
Lua_helper.add_callback(lua, "instanceArg", function(instanceName:String, ?className:String = null) {
var retStr:String ='$instanceStr::$instanceName';
if(className != null) retStr += '::$className';
return retStr;
});
}

static function parseInstances(args:Array<Dynamic>)
{
for (i in 0...args.length)
{
var myArg:String = cast args[i];
if(myArg != null && myArg.length > instanceStr.length)
{
var index:Int = myArg.indexOf('::');
if(index > -1)
{
myArg = myArg.substring(index+2);
//trace('Op1: $myArg');
var lastIndex:Int = myArg.lastIndexOf('::');

var split:Array<String> = myArg.split('.');
args[i] = (lastIndex > -1) ? Type.resolveClass(myArg.substring(0, lastIndex)) : PlayState.instance; //substring not substr
for (j in 0...split.length)
{
//trace('Op2: ${Type.getClass(args[i])}, ${split[j]}');
args[i] = LuaUtils.getVarInArray(args[i], split[j].trim());
//trace('Op3: ${args[i] != null ? Type.getClass(args[i]) : null}');
}
}
}
}
return args;
}

static function callMethodFromObject(classObj:Dynamic, funcStr:String, args:Array<Dynamic> = null)
Expand Down
2 changes: 1 addition & 1 deletion source/states/LoadingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class LoadingState extends MusicBeatState
"pico funny\nbig ol' bunny",
"Joe mama",
"Gettin freaky' on a friday night yeah",
"This may be based off on a Psych fork,\nbut this is Vs.FOXA, damn it.",
"This may be based off on a Psych fork,\nbut this is VS.FOXA, damn it.",
"Worjdjhewndjaiqkkwbdjkwqodbdjwoen&:’eked&3rd!2’wonenksiwnwihqbdibejwjebdjjejwjenfjdjejejjwkwiwjnensjsiieejjsjskikdjdnnwjwiwjejdjdjwiejdbdiwjdhehhrifjdnwoqnd",
"Oo0ooOoOOo000OOO!!!",
"Witness the might\nof the seas!",
Expand Down
Loading

0 comments on commit 1142d6d

Please sign in to comment.