Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix crash when opening urls #2

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/funkin/ui/mainmenu/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class MainMenuState extends MusicBeatState
}));
});

#if CAN_OPEN_LINKS
#if FEATURE_OPEN_URL
// In order to prevent popup blockers from triggering,
// we need to open the link as an immediate result of a keypress event,
// so we can't wait for the flicker animation to complete.
Expand Down Expand Up @@ -234,7 +234,7 @@ class MainMenuState extends MusicBeatState
camFollow.setPosition(selected.getGraphicMidpoint().x, selected.getGraphicMidpoint().y);
}

#if CAN_OPEN_LINKS
#if FEATURE_OPEN_URL
function selectDonate()
{
WindowUtil.openURL(Constants.URL_ITCH);
Expand Down
6 changes: 3 additions & 3 deletions source/funkin/util/WindowUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class WindowUtil
*/
public static function openURL(targetUrl:String):Void
{
#if CAN_OPEN_LINKS
#if FEATURE_OPEN_URL
#if linux
Sys.command('/usr/bin/xdg-open $targetUrl &');
#else
Expand All @@ -40,7 +40,7 @@ class WindowUtil
*/
public static function openFolder(targetPath:String):Void
{
#if CAN_OPEN_LINKS
#if FEATURE_OPEN_URL
#if windows
Sys.command('explorer', [targetPath.replace('/', '\\')]);
#elseif mac
Expand All @@ -59,7 +59,7 @@ class WindowUtil
*/
public static function openSelectFile(targetPath:String):Void
{
#if CAN_OPEN_LINKS
#if FEATURE_OPEN_URL
#if windows
Sys.command('explorer', ['/select,' + targetPath.replace('/', '\\')]);
#elseif mac
Expand Down
Loading