Skip to content

Commit

Permalink
blah
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Nov 13, 2024
1 parent 25a2927 commit 030c9c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
5 changes: 5 additions & 0 deletions source/backend/ExtendableState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ class ExtendableState extends FlxState {

if (FlxG.stage != null)
FlxG.stage.frameRate = SaveData.settings.framerate;

#if debug
if (FlxG.keys.justPressed.F5)
FlxG.resetState();
#end

super.update(elapsed);
}
Expand Down
30 changes: 10 additions & 20 deletions source/modding/Hscript.hx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class Hscript extends FlxBasic {

setVariable('this', this);
setVariable('import', function(daClass:String, ?asDa:String) {
var splitClassName:Array<String> = daClass.split('.');
var className:String = splitClassName.join('.');
var daClass:Class<Dynamic> = Type.resolveClass(className);
var daEnum:Enum<Dynamic> = Type.resolveEnum(className);
final splitClassName:Array<String> = [for (e in daClass.split('.')) e.trim()];
final className:String = splitClassName.join('.');
final daClass:Class<Dynamic> = Type.resolveClass(className);
final daEnum:Enum<Dynamic> = Type.resolveEnum(className);

if (daClass == null && daEnum == null)
Lib.application.window.alert('Class / Enum at $className does not exist.', 'Hscript Error!');
Expand All @@ -49,21 +49,8 @@ class Hscript extends FlxBasic {
} else {
if (asDa != null && asDa != '')
setVariable(asDa, daClass);
else {
var daClassName = splitClassName[splitClassName.length - 1];
if (daClassName == '*') {
while (splitClassName.length > 0 && daClass != null) {
daClassName = splitClassName.pop();
daClass = Type.resolveClass(splitClassName.join('.'));
if (daClass != null) break;
}

if (daClass != null)
for (field in Reflect.fields(daClass))
setVariable(field, Reflect.field(daClass, field));
} else
setVariable(daClassName, daClass);
}
else
setVariable(splitClassName[splitClassName.length - 1], daClass);
}
}
});
Expand Down Expand Up @@ -262,7 +249,10 @@ class Hscript extends FlxBasic {
"fromRGB": FlxColor.fromRGB,
"fromRGBFloat": FlxColor.fromRGBFloat,
"fromString": FlxColor.fromString,
"interpolate": FlxColor.interpolate
"interpolate": FlxColor.interpolate,
"to24Bit": function(color:Int) {
return color & 0xffffff;
},
};
}

Expand Down

0 comments on commit 030c9c1

Please sign in to comment.