diff --git a/README.md b/README.md
index 604cd9c2..b4d4bcc9 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,8 @@ Make sure to read the wiki and join the Discord server linked there!
Latest builds for the engine can be found in the [Actions](https://github.com/YoshiCrafter29/CodenameEngine/actions) tab.
In the future (when the engine won't be a WIP anymore) we're gonna also publish the engine on platforms like Gamebanana; stay tuned!
+If you don't have a github account please go onto https://fnf-cne-devs.github.io/ and click the download button for the respective operating system.
+
How to build
@@ -76,7 +78,7 @@ In the future (when the engine won't be a WIP anymore) we're gonna also publish
- Steal code from Codename Engine for another different project that is not Codename Engine related (Codename Engine mods excluded) without properly crediting
- Release the entire Codename Engine on platforms (Mods that use Codename Engine as source are fine, if it's specified even better)
- #### *If you need more info or feel like asking to do something which is not listed here, ask us directly on our discord (linked in the wiki)!*
+ #### *If you need more info or feel like asking to do something which is not listed here, ask us directly on our discord (linked on the website)!*
diff --git a/art/flashFiles/Editor_Icons.fla b/art/flashFiles/Editor_Icons.fla
new file mode 100644
index 00000000..6ad80d3d
Binary files /dev/null and b/art/flashFiles/Editor_Icons.fla differ
diff --git a/art/generateDoc.bat b/art/generateDoc.bat
index 5159ca88..e2d35e4f 100644
--- a/art/generateDoc.bat
+++ b/art/generateDoc.bat
@@ -1,7 +1,8 @@
@ECHO OFF
cd ..
echo Building Game...
-lime build windows --haxeflag="--macro include('scripting')" --haxeflag="-xml docs/doc.xml"
-echo Generating Documentation...
-haxelib run dox -i docs --include funkin --include scripting
-echo Done!
\ No newline at end of file
+lime build windows --haxeflag="--macro include('scripting')" --haxeflag="-xml docs/doc.xml" -D DOCUMENTATION --no-output
+echo art
+
+echo Generated the api xml file at docs/doc.xml
+echo Please put this in FNF-CNE-Devs.github.io/api-generator/api/doc.xml
\ No newline at end of file
diff --git a/assets/data/scripts/pixel.hx b/assets/data/scripts/pixel.hx
index 48dfb279..8f1887c8 100644
--- a/assets/data/scripts/pixel.hx
+++ b/assets/data/scripts/pixel.hx
@@ -1,3 +1,4 @@
+//
import funkin.game.HudCamera;
import funkin.backend.scripting.events.NoteHitEvent;
diff --git a/assets/data/stages/school-evil.hx b/assets/data/stages/school-evil.hx
index af086dab..c29dbeea 100644
--- a/assets/data/stages/school-evil.hx
+++ b/assets/data/stages/school-evil.hx
@@ -1,5 +1,4 @@
function create() {
- importScript("data/scripts/pixel");
isSpooky = true;
// Make transition work between school types
diff --git a/assets/data/stages/school-evil.xml b/assets/data/stages/school-evil.xml
index 568b3aad..48ee14b7 100644
--- a/assets/data/stages/school-evil.xml
+++ b/assets/data/stages/school-evil.xml
@@ -1,5 +1,6 @@
+
\ No newline at end of file
diff --git a/assets/data/stages/school.hx b/assets/data/stages/school.hx
index 5cba9421..dc55a69d 100644
--- a/assets/data/stages/school.hx
+++ b/assets/data/stages/school.hx
@@ -1,5 +1,5 @@
+//
function create() {
- importScript("data/scripts/pixel");
if (PlayState.SONG.meta.name.toLowerCase() == "roses") {
bgGirls.animation.remove("danceLeft");
bgGirls.animation.remove("danceRight");
diff --git a/assets/data/stages/school.xml b/assets/data/stages/school.xml
index dabf463b..7a2740ad 100644
--- a/assets/data/stages/school.xml
+++ b/assets/data/stages/school.xml
@@ -1,5 +1,7 @@
+
+
diff --git a/assets/images/editors/icons.png b/assets/images/editors/icons.png
index 41dee63c..cccc10f9 100644
Binary files a/assets/images/editors/icons.png and b/assets/images/editors/icons.png differ
diff --git a/source/funkin/backend/FlxAnimate.hx b/source/funkin/backend/FlxAnimate.hx
index c2b6e8c6..e22cb867 100644
--- a/source/funkin/backend/FlxAnimate.hx
+++ b/source/funkin/backend/FlxAnimate.hx
@@ -15,7 +15,7 @@ class FlxAnimate extends flxanimate.FlxAnimate {
for (camera in cameras)
{
rMatrix.identity();
- rMatrix.translate(-limb.offset.x, -limb.offset.y);
+ limb.prepareMatrix(rMatrix, FlxFrameAngle.ANGLE_0, _checkFlipX() != camera.flipX, _checkFlipY() != camera.flipY);
rMatrix.concat(_rMatrix);
if (!camera.visible || !camera.exists || !limbOnScreen(limb, _rMatrix, camera))
return;
diff --git a/source/funkin/backend/scripting/HScript.hx b/source/funkin/backend/scripting/HScript.hx
index 5c8d66d7..5ecb6299 100644
--- a/source/funkin/backend/scripting/HScript.hx
+++ b/source/funkin/backend/scripting/HScript.hx
@@ -64,7 +64,7 @@ class HScript extends Script {
}
private function importFailedCallback(cl:Array):Bool {
- if(_importFailedCallback(cl, "") || _importFailedCallback(cl, "source/")) {
+ if(_importFailedCallback(cl, "source/") || _importFailedCallback(cl, "")) {
return true;
}
return false;
diff --git a/source/funkin/backend/scripting/Script.hx b/source/funkin/backend/scripting/Script.hx
index 2e8f9f47..a0433ba3 100644
--- a/source/funkin/backend/scripting/Script.hx
+++ b/source/funkin/backend/scripting/Script.hx
@@ -283,7 +283,7 @@ class Script extends FlxBasic implements IFlxDestroyable {
public function get(variable:String):Dynamic {return null;}
/**
- * Gets the variable `variable` from the script's variables.
+ * Sets the variable `variable` from the script's variables.
* @param variable Name of the variable.
* @return Variable (or null if it doesn't exists)
*/
diff --git a/source/funkin/backend/scripting/events/SplashShowEvent.hx b/source/funkin/backend/scripting/events/SplashShowEvent.hx
new file mode 100644
index 00000000..46504d44
--- /dev/null
+++ b/source/funkin/backend/scripting/events/SplashShowEvent.hx
@@ -0,0 +1,23 @@
+package funkin.backend.scripting.events;
+
+import funkin.game.SplashGroup;
+import funkin.game.Strum;
+
+final class SplashShowEvent extends CancellableEvent {
+ /**
+ Splash name/type
+ **/
+ public var splashName:String;
+ /**
+ Splash that is shown
+ **/
+ public var splash:FunkinSprite;
+ /**
+ Strum that the splash is shown on
+ **/
+ public var strum:Strum;
+ /**
+ Splash group that the splash is from
+ **/
+ public var group:SplashGroup;
+}
\ No newline at end of file
diff --git a/source/funkin/backend/shaders/FunkinShader.hx b/source/funkin/backend/shaders/FunkinShader.hx
index b676ae45..f8d66fae 100644
--- a/source/funkin/backend/shaders/FunkinShader.hx
+++ b/source/funkin/backend/shaders/FunkinShader.hx
@@ -438,34 +438,33 @@ uniform sampler2D bitmap;
uniform bool hasTransform;
uniform bool hasColorTransform;
-vec4 flixel_texture2D(sampler2D bitmap, vec2 coord)
-{
- vec4 color = texture2D(bitmap, coord);
- if (!hasTransform)
- {
+vec4 applyFlixelEffects(vec4 color) {
+ if (!hasTransform) {
return color;
}
- if (color.a == 0.0)
- {
+ if (color.a == 0.0) {
return vec4(0.0, 0.0, 0.0, 0.0);
}
- if (!hasColorTransform)
- {
+ if (!hasColorTransform) {
return color * openfl_Alphav;
}
- color = vec4(color.rgb / color.a, color.a);
+ color.rgb = color.rgb / color.a;
color = clamp(openfl_ColorOffsetv + (color * openfl_ColorMultiplierv), 0.0, 1.0);
- if (color.a > 0.0)
- {
+ if (color.a > 0.0) {
return vec4(color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);
}
return vec4(0.0, 0.0, 0.0, 0.0);
}
+vec4 flixel_texture2D(sampler2D bitmap, vec2 coord) {
+ vec4 color = texture2D(bitmap, coord);
+ return applyFlixelEffects(color);
+}
+
uniform vec4 _camSize;
float map(float value, float min1, float max1, float min2, float max2) {
diff --git a/source/funkin/backend/system/macros/EventMacro.hx b/source/funkin/backend/system/macros/EventMacro.hx
index 810ff1fd..7219a528 100644
--- a/source/funkin/backend/system/macros/EventMacro.hx
+++ b/source/funkin/backend/system/macros/EventMacro.hx
@@ -75,34 +75,13 @@ class EventMacro {
// add a "set this" expr for each variable
for(v in values) {
var name = v.name;
- exprs.push({
- pos: Context.currentPos(),
- expr: EBinop(OpAssign, {
- pos: Context.currentPos(),
- expr: EField({
- pos: Context.currentPos(),
- expr: EConst(CIdent("this"))
- }, name)
- }, {
- pos: Context.currentPos(),
- expr: EConst(CIdent(name))
- })
- });
+ exprs.push(macro this.$name = $i{name});
}
// add a "set this" expr to reset each private/hidden variables
for(v in hiddenValues) {
var name = v.name;
- exprs.push({
- pos: Context.currentPos(),
- expr: EBinop(OpAssign, {
- pos: Context.currentPos(),
- expr: EField({
- pos: Context.currentPos(),
- expr: EConst(CIdent("this"))
- }, name)
- }, v.expr)
- });
+ exprs.push(macro this.$name = ${v.expr});
}
exprs.push(macro return this);
diff --git a/source/funkin/backend/utils/MemoryUtil.hx b/source/funkin/backend/utils/MemoryUtil.hx
index 81a6087a..e3a64b02 100644
--- a/source/funkin/backend/utils/MemoryUtil.hx
+++ b/source/funkin/backend/utils/MemoryUtil.hx
@@ -117,7 +117,17 @@ final class MemoryUtil {
22 => "DDR2 FB-DIMM",
24 => "DDR3",
25 => "FBD2",
- 26 => "DDR4"
+ 26 => "DDR4",
+ 27 => "LPDDR",
+ 28 => "LPDDR2",
+ 29 => "LPDDR3",
+ 30 => "LPDDR4",
+ 31 => "Logical Non-volatile device",
+ 32 => "HBM",
+ 33 => "HBM2",
+ 34 => "DDR5",
+ 35 => "LPDDR5",
+ 36 => "HBM3",
];
var memoryOutput:Int = -1;
diff --git a/source/funkin/editors/EditorPicker.hx b/source/funkin/editors/EditorPicker.hx
index 7b98f0e6..f1279b9b 100644
--- a/source/funkin/editors/EditorPicker.hx
+++ b/source/funkin/editors/EditorPicker.hx
@@ -22,11 +22,21 @@ class EditorPicker extends MusicBeatSubstate {
iconID: 2,
state: funkin.editors.stage.StageSelection
},
+ #if debug
{
name: "UI Debug State",
iconID: 3,
state: UIDebugState
},
+ #end
+ {
+ name: "Wiki",
+ iconID: 5,
+ state: null,
+ onClick: function() {
+ CoolUtil.openURL("https://fnf-cne-devs.github.io/");
+ }
+ },
{
name: "Debug Options",
iconID: 4,
@@ -94,7 +104,9 @@ class EditorPicker extends MusicBeatSubstate {
}
if (controls.ACCEPT || FlxG.mouse.justReleased) {
- if (options[curSelected].state != null) {
+ if(options[curSelected].onClick != null)
+ options[curSelected].onClick();
+ else if (options[curSelected].state != null) {
selected = true;
CoolUtil.playMenuSFX(CONFIRM);
@@ -145,6 +157,7 @@ typedef Editor = {
var name:String;
var iconID:Int;
var state:Class;
+ var ?onClick:Void->Void;
}
class EditorPickerOption extends FlxTypedSpriteGroup {
@@ -161,7 +174,6 @@ class EditorPickerOption extends FlxTypedSpriteGroup {
public function new(name:String, iconID:Int, height:Float) {
super();
-
FlxG.mouse.visible = true;
iconSpr = new FlxSprite();
iconSpr.loadGraphic(Paths.image('editors/icons'), true, 128, 128);
diff --git a/source/funkin/game/NoteGroup.hx b/source/funkin/game/NoteGroup.hx
index b539aed7..8c611581 100644
--- a/source/funkin/game/NoteGroup.hx
+++ b/source/funkin/game/NoteGroup.hx
@@ -34,10 +34,16 @@ class NoteGroup extends FlxTypedGroup {
return FlxSort.byValues(FlxSort.DESCENDING, n1.strumTime, n2.strumTime);
});
}
+
+ @:dox(hide) public var __forcedSongPos:Null = null;
+
+ @:dox(hide) private inline function __getSongPos()
+ return __forcedSongPos == null ? Conductor.songPosition : __forcedSongPos;
+
public override function update(elapsed:Float) {
i = length-1;
__loopSprite = null;
- __time = Conductor.songPosition;
+ __time = __getSongPos();
while(i >= 0) {
__loopSprite = members[i--];
if (__loopSprite == null || !__loopSprite.exists || !__loopSprite.active) {
@@ -58,7 +64,7 @@ class NoteGroup extends FlxTypedGroup {
i = length-1;
__loopSprite = null;
- __time = Conductor.songPosition;
+ __time = __getSongPos();
while(i >= 0) {
__loopSprite = members[i--];
if (__loopSprite == null || !__loopSprite.exists || !__loopSprite.visible)
@@ -81,7 +87,7 @@ class NoteGroup extends FlxTypedGroup {
public override function forEach(noteFunc:Note->Void, recursive:Bool = false) {
i = length-1;
__loopSprite = null;
- __time = Conductor.songPosition;
+ __time = __getSongPos();
var oldCur = __currentlyLooping;
__currentlyLooping = true;
diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx
index 9161cfef..45896bc1 100644
--- a/source/funkin/game/PlayState.hx
+++ b/source/funkin/game/PlayState.hx
@@ -242,7 +242,7 @@ class PlayState extends MusicBeatState
/**
* Current stage name
*/
- public var curStage:String = "";
+ public var curStage(get, set):String;
/**
* Interval at which Girlfriend dances.
@@ -525,6 +525,14 @@ class PlayState extends MusicBeatState
return this.maxHealth = v;
}
+ private inline function get_curStage()
+ return stage == null ? "" : stage.stageName;
+
+ private inline function set_curStage(name:String) {
+ if (stage != null) stage.stageName = name;
+ return name;
+ }
+
@:dox(hide) override public function create()
{
Note.__customNoteTypeExists = [];
diff --git a/source/funkin/game/SplashHandler.hx b/source/funkin/game/SplashHandler.hx
index 1776bdb8..31a06234 100644
--- a/source/funkin/game/SplashHandler.hx
+++ b/source/funkin/game/SplashHandler.hx
@@ -1,5 +1,7 @@
package funkin.game;
+import funkin.backend.scripting.events.SplashShowEvent;
+
class SplashHandler extends FlxTypedGroup {
/**
* Map containing all of the splashes group.
@@ -40,10 +42,10 @@ class SplashHandler extends FlxTypedGroup {
var __grp:SplashGroup;
public function showSplash(name:String, strum:Strum) {
__grp = getSplashGroup(name);
- var event = funkin.backend.scripting.EventManager.get(funkin.backend.scripting.events.DynamicEvent).recycle(__grp.showOnStrum(strum), strum);
+ var event = EventManager.get(SplashShowEvent).recycle(name, __grp.showOnStrum(strum), strum, __grp);
event = PlayState.instance.scripts.event("onSplashShown", event);
if (!event.cancelled)
- add(event.value1);
+ add(event.splash);
// max 8 rendered splashes
while(members.length > 8)
diff --git a/source/funkin/game/Stage.hx b/source/funkin/game/Stage.hx
index eb64c169..9e5ce76c 100644
--- a/source/funkin/game/Stage.hx
+++ b/source/funkin/game/Stage.hx
@@ -3,6 +3,7 @@ package funkin.game;
import flixel.util.typeLimit.OneOfTwo;
import flixel.FlxState;
import flixel.math.FlxPoint;
+import funkin.backend.scripting.DummyScript;
import funkin.backend.scripting.Script;
import funkin.backend.scripting.events.StageNodeEvent;
import funkin.backend.scripting.events.StageXMLEvent;
@@ -23,6 +24,7 @@ class Stage extends FlxBasic implements IBeatReceiver {
public var stageScript:Script;
public var state:FlxState;
public var characterPoses:Map = [];
+ public var xmlImportedScripts:Array = [];
public var defaultZoom:Float = 1.05;
public var startCam = new FlxPoint();
@@ -31,12 +33,15 @@ class Stage extends FlxBasic implements IBeatReceiver {
public var onNodeLoaded:(Access, Dynamic)->Dynamic = null;
public var onNodeFinished:(Access, Dynamic)->Void = null;
public var onAddSprite:(FlxObject)->Void = null;
+ public var onXMLPostLoaded:(Access, Array)->Array = null;
public var spritesParentFolder = "";
- public inline function getSprite(name:String) {
+ public inline function getSprite(name:String)
return stageSprites[name];
- }
+
+ public function setStagesSprites(script:Script)
+ for (k=>e in stageSprites) script.set(k, e);
public function new(stage:String, ?state:FlxState, autoLoad:Bool = true) {
super();
@@ -46,13 +51,9 @@ class Stage extends FlxBasic implements IBeatReceiver {
this.state = state;
stageFile = stage;
-
stagePath = Paths.xml('stages/$stageFile');
- try {
- if (Assets.exists(stagePath)) stageXML = new Access(Xml.parse(Assets.getText(stagePath)).firstElement());
- } catch(e) {
- Logs.trace('Couldn\'t load stage "$stageFile": ${e.message}', ERROR);
- }
+ try if (Assets.exists(stagePath)) stageXML = new Access(Xml.parse(Assets.getText(stagePath)).firstElement())
+ catch(e) Logs.trace('Couldn\'t load stage "$stageFile": ${e.message}', ERROR);
if (autoLoad) loadXml(stageXML);
}
@@ -66,6 +67,8 @@ class Stage extends FlxBasic implements IBeatReceiver {
stageScript.load();
}
+ var event = null;
+ var elems:Array = [];
if (xml != null) {
var parsed:Null;
if((parsed = Std.parseFloat(xml.getAtt("startCamPosX"))).isNotNull()) startCam.x = parsed;
@@ -78,7 +81,6 @@ class Stage extends FlxBasic implements IBeatReceiver {
if(xml.has.startCamPosX) PlayState.instance.camFollow.x = startCam.x;
if(xml.has.startCamPosY) PlayState.instance.camFollow.y = startCam.y;
if(xml.has.zoom) PlayState.instance.defaultCamZoom = defaultZoom;
- PlayState.instance.curStage = stageName;
}
if (xml.has.folder) {
spritesParentFolder = xml.att.folder;
@@ -90,22 +92,16 @@ class Stage extends FlxBasic implements IBeatReceiver {
if(!DEFAULT_ATTRIBUTES.contains(att))
extra.set(att, xml.x.get(att));
- var elems:Array = [];
// some way to tag that the sprites are from the group
for(node in xml.elements) {
- if (node.name == "high-memory" && (!Options.lowMemoryMode || forceLoadAll))
- for(e in node.elements)
- elems.push(e);
- else if (node.name == "low-memory" && (Options.lowMemoryMode || forceLoadAll))
- for(e in node.elements)
- elems.push(e);
- else
- elems.push(node);
+ if (node.name == "high-memory" && (!Options.lowMemoryMode || forceLoadAll)) for(e in node.elements) __pushNcheckNode(elems, e);
+ else if (node.name == "low-memory" && (Options.lowMemoryMode || forceLoadAll)) for(e in node.elements) __pushNcheckNode(elems, e);
+ else __pushNcheckNode(elems, node);
}
if (PlayState.instance == state) {
- var event = PlayState.instance.scripts.event("onStageXMLParsed", EventManager.get(StageXMLEvent).recycle(this, xml, elems));
- elems = event.elems;
+ event = EventManager.get(StageXMLEvent).recycle(this, xml, elems);
+ elems = PlayState.instance.scripts.event("onStageXMLParsed", event).elems;
}
if(onXMLLoaded != null) {
elems = onXMLLoaded(xml, elems);
@@ -121,7 +117,7 @@ class Stage extends FlxBasic implements IBeatReceiver {
stageSprites.set(spr.name, spr);
addSprite(spr);
case "box" | "solid":
- if ( !node.has.name || !node.has.width || !node.has.height) continue;
+ if (!node.has.name || !node.has.width || !node.has.height) continue;
var spr = new FunkinSprite(
(node.has.x) ? Std.parseFloat(node.att.x).getDefault(0) : 0,
@@ -154,6 +150,9 @@ class Stage extends FlxBasic implements IBeatReceiver {
);
PlayState.instance.add(PlayState.instance.comboGroup);
PlayState.instance.comboGroup;
+ case "use-extension" | "extension" | "ext":
+ if (__shouldLoadBefore(node) || XMLImportedScriptInfo.prepareInfos(node, this) == null) continue;
+ null;
default: null;
}
@@ -184,10 +183,31 @@ class Stage extends FlxBasic implements IBeatReceiver {
if (characterPoses["boyfriend"] == null)
addCharPos("boyfriend", null, getDefaultPos("boyfriend"));
- if (PlayState.instance != state) return;
- for(k=>e in stageSprites) {
- stageScript.set(k, e);
+ if (PlayState.instance == state) {
+ setStagesSprites(stageScript);
+
+ // i know this for gets run twice under, but its better like this in case a script modifies the short lived ones, i dont wanna save them in an array; more dynamic like this - Nex
+ for (info in xmlImportedScripts) if (info.importStageSprites) {
+ var script = info.getScript();
+ if (script != null) setStagesSprites(script);
+ }
+
+ // idk lemme check anyways just in case scripts did smth - Nex
+ if (event != null) PlayState.instance.scripts.event("onPostStageCreation", event);
+
+ // shortlived scripts destroy when the stage finishes setting up - Nex
+ for (info in xmlImportedScripts) if (info.shortLived) {
+ var script = info.getScript();
+ if (script == null) continue;
+
+ PlayState.instance.scripts.remove(script);
+ script.destroy();
+ }
}
+ if(onXMLPostLoaded != null) {
+ elems = onXMLPostLoaded(xml, elems);
+ }
+
}
public static function getDefaultPos(name:String):StageCharPosInfo {
@@ -219,6 +239,15 @@ class Stage extends FlxBasic implements IBeatReceiver {
}
}
+ @:dox(hide) private function __pushNcheckNode(array:Array, node:Access) {
+ array.push(node);
+ if ((node.name == "use-extension" || node.name == "extension" || node.name == "ext") && __shouldLoadBefore(node))
+ XMLImportedScriptInfo.prepareInfos(node, this);
+ }
+
+ @:dox(hide) private static inline function __shouldLoadBefore(node:Access):Bool
+ return node.getAtt("loadBefore") != "false";
+
public function addCharPos(name:String, node:Access, ?nonXMLInfo:StageCharPosInfo):StageCharPos {
var charPos = new StageCharPos();
charPos.visible = charPos.active = false;
@@ -410,4 +439,45 @@ typedef OldCharInfo = {
var alpha:Float;
var zoomFactor:Float;
var angle:Float;
+}
+
+class XMLImportedScriptInfo {
+ public var path:String;
+ public var shortLived:Bool = false;
+ public var loadBefore:Bool = true;
+ public var importStageSprites:Bool = false;
+
+ public function new(path:String)
+ this.path = path;
+
+ public function getScript():Script
+ return PlayState.instance == null ? null : PlayState.instance.scripts.getByPath(path);
+
+ public static function prepareInfos(node:Access, ?stage:Stage):XMLImportedScriptInfo {
+ if (!node.has.script || PlayState.instance == null) return null;
+
+ var folder = node.getAtt("folder").getDefault("data/scripts/");
+ if (!folder.endsWith("/")) folder += "/";
+
+ var path = Paths.script(folder + node.getAtt("script"));
+ var daScript = Script.create(path);
+ if (daScript is DummyScript) {
+ var msg = 'Script Extension at ${path} does not exist';
+ if (stage != null) msg += ' through stage "${stage.stageName}"';
+ Logs.trace(msg + ".", ERROR);
+ return null;
+ }
+
+ var infos = new XMLImportedScriptInfo(daScript.path);
+ infos.shortLived = node.getAtt("isShortLived") == "true";
+ infos.importStageSprites = node.getAtt("importStageSprites") == "true";
+ @:privateAccess infos.loadBefore = Stage.__shouldLoadBefore(node);
+
+ if (stage != null) stage.xmlImportedScripts.push(infos);
+ PlayState.instance.scripts.add(daScript);
+ daScript.set("scriptInfo", infos);
+ daScript.load();
+
+ return infos;
+ }
}
\ No newline at end of file
diff --git a/source/funkin/menus/PauseSubState.hx b/source/funkin/menus/PauseSubState.hx
index ff45f20a..7101486c 100644
--- a/source/funkin/menus/PauseSubState.hx
+++ b/source/funkin/menus/PauseSubState.hx
@@ -8,6 +8,7 @@ import funkin.backend.scripting.Script;
import funkin.backend.scripting.events.MenuChangeEvent;
import funkin.backend.scripting.events.NameEvent;
import funkin.backend.scripting.events.PauseCreationEvent;
+import funkin.backend.system.Conductor;
import funkin.backend.utils.FunkinParentDisabler;
import funkin.editors.charter.Charter;
import funkin.menus.StoryMenuState;
@@ -162,6 +163,9 @@ class PauseSubState extends MusicBeatSubstate
PlayState.resetSongInfos();
if (Charter.instance != null) Charter.instance.__clearStatics();
+ // prevents certain notes to disappear early when exiting - Nex
+ game.strumLines.forEachAlive(function(grp) grp.notes.__forcedSongPos = Conductor.songPosition);
+
CoolUtil.playMenuSong();
FlxG.switchState(PlayState.isStoryMode ? new StoryMenuState() : new FreeplayState());
}
diff --git a/source/hscript/Config.hx b/source/hscript/Config.hx
index dcfcc10e..98fc7f7a 100644
--- a/source/hscript/Config.hx
+++ b/source/hscript/Config.hx
@@ -3,19 +3,23 @@ package hscript;
class Config {
// Runs support for custom classes in these
public static final ALLOWED_CUSTOM_CLASSES = [
+ #if !DOCUMENTATION
"flixel",
"funkin",
+ #end
];
// Runs support for abstract support in these
public static final ALLOWED_ABSTRACT_AND_ENUM = [
+ #if !DOCUMENTATION
"flixel",
"openfl",
"haxe.xml",
"haxe.CallStack",
"funkin",
+ #end
];
// Incase any of your files fail