Moved externals + small fix

This commit is contained in:
NeeEoo
2024-04-15 14:36:27 +02:00
parent 7d236db474
commit 688c078e4a
11 changed files with 27 additions and 18 deletions
+11
View File
@@ -0,0 +1,11 @@
package external;
#if mac
@:build(external.LinkerMacro.xml('external_code.xml'))
@:native("ExternalMac")
@:include('Mac.h')
extern class ExternalMac {
@:native("ExternalMac::setCursorIcon")
public static function setCursorIcon(icon:Int):Bool;
}
#end
@@ -1,4 +1,4 @@
package funkin.backend.system.macros;
package external;
import haxe.io.Path;
import haxe.macro.Expr;
+1 -10
View File
@@ -4,7 +4,6 @@ package funkin.backend.utils.native;
import funkin.backend.utils.NativeAPI.CodeCursor;
import openfl.ui.Mouse;
@:build(funkin.backend.system.macros.LinkerMacro.xml('external/external_code.xml'))
@:headerInclude('sys/sysctl.h')
class Mac {
@:functionCode('
@@ -24,20 +23,12 @@ class Mac {
public static function setMouseCursorIcon(icon:CodeCursor):Void
{
final valid:Bool = ExternalMac.setCursorIcon(icon.toInt());
final valid:Bool = external.ExternalMac.setCursorIcon(icon.toInt());
if(!valid) {
Mouse.cursor = icon.toOpenFL();
}
}
}
@:build(funkin.backend.system.macros.LinkerMacro.xml('external/external_code.xml'))
@:native("ExternalMac")
@:include('Mac.h')
extern class ExternalMac {
@:native("ExternalMac::setCursorIcon")
public static function setCursorIcon(icon:Int):Bool;
}
#end
@@ -142,7 +142,7 @@ class StageElementButton extends UIButton {
public function getInfoText():String {
var pos = getPos();
var text = '${getName()} (${CoolUtil.quantize(pos.x, 100)}x${CoolUtil.quantize(pos.y, 100)})';
var text = '${getName()} (${CoolUtil.quantize(pos.x, 100)}, ${CoolUtil.quantize(pos.y, 100)})';
pos.put();
return text;
}