diff --git a/source/funkin/util/WindowUtil.hx b/source/funkin/util/WindowUtil.hx index 42930570f..6e6a41641 100644 --- a/source/funkin/util/WindowUtil.hx +++ b/source/funkin/util/WindowUtil.hx @@ -11,17 +11,21 @@ import flixel.util.FlxSignal.FlxTypedSignal; #end class WindowUtil { + /** + * Runs platform-specific code to open a URL in a web browser. + * @param targetUrl The URL to open. + */ public static function openURL(targetUrl:String) { #if CAN_OPEN_LINKS #if linux - // Sys.command('/usr/bin/xdg-open', [, "&"]); Sys.command('/usr/bin/xdg-open', [targetUrl, "&"]); #else + // This should work on Windows and HTML5. FlxG.openURL(targetUrl); #end #else - trace('Cannot open'); + throw 'Cannot open URLs on this platform.'; #end } @@ -30,6 +34,10 @@ class WindowUtil */ public static final windowExit:FlxTypedSignalVoid> = new FlxTypedSignalVoid>(); + /** + * Wires up FlxSignals that happen based on window activity. + * For example, we can run a callback when the window is closed. + */ public static function initWindowEvents() { // onUpdate is called every frame just before rendering.