Skip to content

Commit

Permalink
me when i broke compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
superpowers04 committed Dec 16, 2024
1 parent a21e587 commit 3b4ef15
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 17 deletions.
1 change: 1 addition & 0 deletions project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<!--In case you want to use the addons package-->
<!-- <haxelib name="openfl" if="mobile"/>
<haxelib name="flixel" if="mobile" /> -->
<haxelib name="lime"/>
<haxelib name="openfl"/>
<haxelib name="flixel" version="5.6.2"/>
<haxelib name="flixel-addons" version="3.2.2"/>
Expand Down
3 changes: 3 additions & 0 deletions source/ArrowSelection.hx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ class ArrowSelection extends SearchMenuState
}
override function create()
{try{
bg.color = 0xFFFF6E6E;
{ // Looks for all notes, This will probably be rarely accessed, so loading like this shouldn't be a problem

searchList = ["default"];

var dataDir:String = Sys.getCwd() + "mods/noteassets/";
var customArrows:Array<String> = [];
if (SELoader.exists(dataDir)) {
Expand Down
134 changes: 118 additions & 16 deletions source/openfl/Lib.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package openfl;

import openfl.utils.Dictionary;
import haxe.Constraints.Function;
import haxe.PosInfos;
import haxe.Timer;
Expand All @@ -22,14 +23,17 @@ import js.Browser;
@:fileXml('tags="haxe,release"')
@:noDebug
#end
@:access(openfl.display.Stage) class Lib
@:access(openfl.display.Stage)
@:access(openfl.events.UncaughtErrorEvents)
class Lib
{
public static var application(get, never):Application;
public static var current(get, never):MovieClip;
@:noCompletion private static var __lastTimerID:UInt = 0;
@:noCompletion private static var __sentWarnings:Map<String, Bool> = new Map();
@:noCompletion private static var __timers:Map<UInt, Timer> = new Map();
@:noCompletion private static var __registeredClassAliases:Map<String, Class<Dynamic>> = new Map();
@:noCompletion private static var __registeredClasses:Dictionary<Class<Dynamic>, String> = new Dictionary();
#if 0
private static var __unusedImports:Array<Class<Dynamic>> = [SWFLibrary, SWFLiteLibrary];
#end
Expand Down Expand Up @@ -130,6 +134,7 @@ import js.Browser;
public static function getDefinitionByName(name:String):Class<Dynamic>
{
if (name == null) return null;
name = StringTools.replace(name, "::", ".");
#if flash
if (StringTools.startsWith(name, "openfl."))
{
Expand All @@ -145,8 +150,8 @@ import js.Browser;
Returns the fully qualified class name of an object.
@param value The object for which a fully qualified class name is desired. Any
ActionScript value may be passed to this method including all available
ActionScript types, object instances, primitive types such as uint, and class
Haxe value may be passed to this method including all available
Haxe types, object instances, primitive types such as Int, and class
objects.
@returns String A string containing the fully qualified class name.
**/
Expand Down Expand Up @@ -222,15 +227,54 @@ import js.Browser;
public static function getTimer():Int
{
#if lime
#if sys
return Std.int(Sys.time() * 1000);
#elseif flash
return flash.Lib.getTimer();
#else
return System.getTimer();
#end
#if flash
return flash.Lib.getTimer();
#else
return System.getTimer();
#end
#else
return 0;
#end
}

/**
Produces an `Xml` object that describes the Haxe object named as the
parameter of the method. This method implements the programming concept
of reflection for OpenFL.
_OpenFL target support:_ Not currently supported, except when targeting AIR.
If the `value` parameter is an instance of a type, the returned `Xml`
object includes all the instance properties of that type, but does not
include any static properties. You can check for this condition when you
parse the `Xml` object by examining the value of the `<type>` tag's
`isStatic` attribute, which is `false` when the `value` parameter is an
instance of a type.
To obtain the static properties of a type, pass the type itself for the
`value` parameter. The returned `Xml` object includes not only the
type's static properties, but also all of its instance properties. The
instance properties are nested inside a tag named `<factory>` to
distinguish them from the static properties. In this case, the
`isStatic` attribute of the `<type>` tag is true.
Note: If you need only to traverse an object's inheritance hierarchy and
do not need the other information provided by `describeType()`, use the
`getQualifiedClassName()` and `getQualifiedSuperclassName()` functions
instead.
**/
public static function describeType(value:Dynamic):Xml
{
#if lime
#if flash
return Xml.parse(flash.Lib.describeType(value).toString());
#else
notImplemented();
return null;
#end
#else
return 0;
notImplemented();
return null;
#end
}

Expand Down Expand Up @@ -295,7 +339,7 @@ import js.Browser;
In Flash Player, and in non-application sandboxes in Adobe AIR, you cannot connect to
commonly reserved ports. For a complete list of blocked ports, see "Restricting
Networking APIs" in the ActionScript 3.0 Developer's Guide.
Networking APIs" in the _OpenFL Developer's Guide_.
In Flash Player 10 and later running in a browser, using this method programmatically
to open a pop-up window may not be successful. Various browsers (and browser
Expand Down Expand Up @@ -383,7 +427,7 @@ import js.Browser;
* You cannot navigate a window with a nondefault name from within a SWF file that
is in the local-with-filesystem sandbox.
* You cannot connect to commonly reserved ports. For a complete list of blocked
ports, see "Restricting Networking APIs" in the ActionScript 3.0 Developer's Guide.
ports, see "Restricting Networking APIs" in the _OpenFL Developer's Guide_.
@throws Error If the method is not called in response to a user action, such as a
mouse event or keypress event. This requirement only applies to content in Flash
Player and to non-application sandbox content in Adobe AIR.
Expand Down Expand Up @@ -425,6 +469,27 @@ import js.Browser;
#end
}

/**
Encodes a string into a valid URI component. Converts a substring of a
URI into a string in which all characters are encoded as UTF-8 escape
sequences unless a character belongs to a very small group of basic
characters.
**/
public static function encodeURIComponent(value:String):String
{
return StringTools.urlEncode(value);
}

/**
Decodes an encoded URI component into a string. Returns a string in
which all characters previously escaped by the `encodeURIComponent`
function are restored to their uncoded representation.
**/
public static function decodeURIComponent(value:String):String
{
return StringTools.urlDecode(value);
}

public static function notImplemented(?posInfo:PosInfos):Void
{
var api = posInfo.className + "." + posInfo.methodName;
Expand Down Expand Up @@ -460,7 +525,7 @@ import js.Browser;
To examine the server response, use the `URLLoader.load()` method instead.
You cannot connect to commonly reserved ports. For a complete list of blocked
ports, see "Restricting Networking APIs" in the ActionScript 3.0 Developer's Guide.
ports, see "Restricting Networking APIs" in the _OpenFL Developer's Guide_.
You can prevent a SWF file from using this method by setting the `allowNetworking`
parameter of the the object and embed tags in the HTML page that contains the SWF
Expand Down Expand Up @@ -490,7 +555,7 @@ import js.Browser;
local-with-networking or trusted.
@throws SecurityError You cannot connect to commonly reserved ports. For a
complete list of blocked ports, see "Restricting Networking APIs" in the
ActionScript 3.0 Developer's Guide.
_OpenFL Developer's Guide_.
**/
public static function sendToURL(request:URLRequest):Void
{
Expand Down Expand Up @@ -528,7 +593,25 @@ import js.Browser;
__timers[id] = timer;
timer.run = function()
{
#if flash
Reflect.callMethod(closure, closure, args == null ? [] : args);
#else
if (Lib.current != null && Lib.current.stage != null && Lib.current.stage.__uncaughtErrorEvents.__enabled)
{
try
{
Reflect.callMethod(closure, closure, args == null ? [] : args);
}
catch (e:Dynamic)
{
Lib.current.stage.__handleError(e);
}
}
else
{
Reflect.callMethod(closure, closure, args == null ? [] : args);
}
#end
};
return id;
}
Expand Down Expand Up @@ -561,7 +644,25 @@ import js.Browser;
__timers[id] = Timer.delay(function()
{
__timers.remove(id);
#if flash
Reflect.callMethod(closure, closure, args == null ? [] : args);
#else
if (Lib.current != null && Lib.current.stage != null && Lib.current.stage.__uncaughtErrorEvents.__enabled)
{
try
{
Reflect.callMethod(closure, closure, args == null ? [] : args);
}
catch (e:Dynamic)
{
Lib.current.stage.__handleError(e);
}
}
else
{
Reflect.callMethod(closure, closure, args == null ? [] : args);
}
#end
}, delay);
return id;
}
Expand Down Expand Up @@ -653,6 +754,7 @@ import js.Browser;
throw new TypeError("Parameter aliasName must be non-null");
}
__registeredClassAliases.set(aliasName, classObject);
__registeredClasses.set(classObject, aliasName);
#end
}

Expand All @@ -675,4 +777,4 @@ import js.Browser;
// @:noCompletion private static function set_current (current:MovieClip):MovieClip {
// return cast flash.Lib.current = cast current;
// }
}
}
2 changes: 1 addition & 1 deletion version.downloadMe
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
24.10.12.1808;
24.12.16.0126;
* Better Psych character support(Still kinda experimental but should be more stable)
* Fix some small errors
* Fix characters not loading due to using ID instead of folderName
Expand Down

0 comments on commit 3b4ef15

Please sign in to comment.