diff --git a/buildnumber.txt b/buildnumber.txt index 721b63db..dcdd9eee 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2596 \ No newline at end of file +2602 \ No newline at end of file diff --git a/source/funkin/editors/ui/UIContextMenu.hx b/source/funkin/editors/ui/UIContextMenu.hx index 116eb8a9..d153cdbb 100644 --- a/source/funkin/editors/ui/UIContextMenu.hx +++ b/source/funkin/editors/ui/UIContextMenu.hx @@ -46,4 +46,20 @@ typedef UIContextMenuOption = { var ?icon:Int; var ?onSelect:Void->Void; var ?childs:Array; +} + +class UIContextMenuOptionSpr extends UISpliceSprite { + public var label:UIText; + public function new(x:Float, y:Float, t:String) { + label = new UIText(20, 2, 0, t); + + super(x, y, label.frameWidth + 22, label.frameHeight + 4, 'editors/ui/button'); + members.push(label); + } + + public override function draw() { + alpha = hovered ? 1 : 0; + label.follow(this, 20, 2); + super.draw(); + } } \ No newline at end of file diff --git a/source/funkin/windows/WindowsAPI.hx b/source/funkin/windows/WindowsAPI.hx index cbc6e6f4..2d7f017d 100644 --- a/source/funkin/windows/WindowsAPI.hx +++ b/source/funkin/windows/WindowsAPI.hx @@ -12,6 +12,12 @@ class WindowsAPI { native.WinAPI.registerAudio(); #end } + + @:dox(hide) public static function registerAsDPICompatible() { + #if windows + native.WinAPI.registerAsDPICompatible(); + #end + } /** * Allocates a new console. The console will automatically be opened diff --git a/source/lime/system/System.hx b/source/lime/system/System.hx index 549adf70..a2df1e12 100644 --- a/source/lime/system/System.hx +++ b/source/lime/system/System.hx @@ -529,6 +529,7 @@ class System // executes first!! #if sys + funkin.windows.WindowsAPI.registerAsDPICompatible(); funkin.system.CommandLineHandler.parseCommandLine(Sys.args()); #end diff --git a/source/native/WinAPI.hx b/source/native/WinAPI.hx index 51dc314e..aa8ee635 100644 --- a/source/native/WinAPI.hx +++ b/source/native/WinAPI.hx @@ -9,6 +9,7 @@ import funkin.windows.WindowsAPI.MessageBoxIcon; + ') @@ -26,6 +27,7 @@ import funkin.windows.WindowsAPI.MessageBoxIcon; #include #include #include +#include #define SAFE_RELEASE(punk) \\ if ((punk) != NULL) \\ @@ -150,34 +152,33 @@ class WinAPI { } - #if windows @:functionCode(' HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(console, color); ') - #end public static function setConsoleColors(color:Int) { } - #if windows @:functionCode(' system("CLS"); std::cout<< "" <