mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-02-06 03:28:08 +00:00
Rewrote documentation for InitState
This commit is contained in:
parent
6f737a1805
commit
4c85e59037
|
@ -11,17 +11,21 @@ import flixel.util.FlxSignal.FlxTypedSignal;
|
||||||
#end
|
#end
|
||||||
class WindowUtil
|
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)
|
public static function openURL(targetUrl:String)
|
||||||
{
|
{
|
||||||
#if CAN_OPEN_LINKS
|
#if CAN_OPEN_LINKS
|
||||||
#if linux
|
#if linux
|
||||||
// Sys.command('/usr/bin/xdg-open', [, "&"]);
|
|
||||||
Sys.command('/usr/bin/xdg-open', [targetUrl, "&"]);
|
Sys.command('/usr/bin/xdg-open', [targetUrl, "&"]);
|
||||||
#else
|
#else
|
||||||
|
// This should work on Windows and HTML5.
|
||||||
FlxG.openURL(targetUrl);
|
FlxG.openURL(targetUrl);
|
||||||
#end
|
#end
|
||||||
#else
|
#else
|
||||||
trace('Cannot open');
|
throw 'Cannot open URLs on this platform.';
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +34,10 @@ class WindowUtil
|
||||||
*/
|
*/
|
||||||
public static final windowExit:FlxTypedSignal<Int->Void> = new FlxTypedSignal<Int->Void>();
|
public static final windowExit:FlxTypedSignal<Int->Void> = new FlxTypedSignal<Int->Void>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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()
|
public static function initWindowEvents()
|
||||||
{
|
{
|
||||||
// onUpdate is called every frame just before rendering.
|
// onUpdate is called every frame just before rendering.
|
||||||
|
|
Loading…
Reference in a new issue