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

Enable FileBrowse on HTML5. (#288) #291

Merged
merged 1 commit into from
Jan 21, 2022
Merged
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
14 changes: 7 additions & 7 deletions UserInterface/FileBrowse/source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import flixel.ui.FlxButton;
import flixel.util.FlxColor;
import flixel.math.FlxMath;
import flixel.system.FlxAssets;
#if flash
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.net.FileReference;
import flash.net.FileFilter;
#if (flash || html5)
import openfl.display.Loader;
import openfl.display.LoaderInfo;
import openfl.net.FileReference;
import openfl.net.FileFilter;
#elseif (sys && !hl)
import systools.Dialogs;
#end
Expand Down Expand Up @@ -139,7 +139,7 @@ class PlayState extends FlxState

function _showFileDialog():Void
{
#if flash
#if (flash || html5)
var fr:FileReference = new FileReference();
fr.addEventListener(Event.SELECT, _onSelect, false, 0, true);
fr.addEventListener(Event.CANCEL, _onCancel, false, 0, true);
Expand All @@ -159,7 +159,7 @@ class PlayState extends FlxState
#end
}

#if flash
#if (flash || html5)
function _onSelect(E:Event):Void
{
var fr:FileReference = cast(E.target, FileReference);
Expand Down