Skip to content

Commit

Permalink
Disable FileFilter on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasDarkson committed Oct 28, 2024
1 parent 844dee8 commit b5e7cc4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion source/states/editors/DialogueCharacterEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ class DialogueCharacterEditorState extends MusicBeatState implements PsychUIEven
_file.addEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.addEventListener(Event.CANCEL, onLoadCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file.browse([jsonFilter]);
_file.browse([#if !mac jsonFilter #end]);
}

function onLoadComplete(_):Void
Expand Down
2 changes: 1 addition & 1 deletion source/states/editors/DialogueEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ class DialogueEditorState extends MusicBeatState implements PsychUIEventHandler.
_file.addEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.addEventListener(Event.CANCEL, onLoadCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file.browse([jsonFilter]);
_file.browse([#if !mac jsonFilter #end]);
}

function onLoadComplete(_):Void
Expand Down
2 changes: 1 addition & 1 deletion source/states/editors/MenuCharacterEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class MenuCharacterEditorState extends MusicBeatState implements PsychUIEventHan
_file.addEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.addEventListener(Event.CANCEL, onLoadCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file.browse([jsonFilter]);
_file.browse([#if !mac jsonFilter #end]);
}

function onLoadComplete(_):Void
Expand Down
2 changes: 1 addition & 1 deletion source/states/editors/NoteSplashEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ class NoteSplashEditorState extends MusicBeatState
_file.addEventListener(Event.SELECT, onLoadComplete);
_file.addEventListener(Event.CANCEL, onLoadCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file.browse([#if windows jsonFilter #end]);
_file.browse([#if !mac jsonFilter #end]);
}

function onLoadComplete(_):Void
Expand Down
2 changes: 1 addition & 1 deletion source/states/editors/StageEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ class StageEditorState extends MusicBeatState implements PsychUIEventHandler.Psy
_file.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);

final filters = [new FileFilter('PNG (Image)', '*.png'), new FileFilter('XML (Sparrow)', '*.xml'), new FileFilter('JSON (Aseprite)', '*.json'), new FileFilter('TXT (Packer)', '*.txt')];
_file.browse(filters);
_file.browse(#if !mac filters #else [] #end);
}

private function onLoadComplete(_):Void
Expand Down
2 changes: 1 addition & 1 deletion source/states/editors/WeekEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ class WeekEditorState extends MusicBeatState implements PsychUIEventHandler.Psyc
_file.addEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.addEventListener(Event.CANCEL, onLoadCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file.browse([jsonFilter]);
_file.browse([#if !mac jsonFilter #end]);
}

public static var loadedWeek:WeekFile = null;
Expand Down
3 changes: 3 additions & 0 deletions source/states/editors/content/FileDialogHandler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class FileDialogHandler extends FlxBasic
this._dialogMode = OPEN;
_startUp(onComplete, onCancel, onError);
if(filter == null) filter = [new FileFilter('JSON', 'json')];
#if mac
filter = [];
#end

removeEvents();
_currentEvent = onLoadComplete;
Expand Down
2 changes: 1 addition & 1 deletion source/states/editors/content/PreloadListSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class PreloadListSubState extends MusicBeatSubstate implements PsychUIEvent
{
if(!fileDialog.completed) return;

fileDialog.open(null, 'Load a .PNG/.OGG File...', [new FileFilter('Image/Audio', '*.png;*.ogg')], function()
fileDialog.open(null, 'Load a .PNG/.OGG File...', [#if !mac new FileFilter('Image/Audio', '*.png;*.ogg') #end], function()
{
var path:Path = new Path(fileDialog.path.replace('\\', '/'));

Expand Down

0 comments on commit b5e7cc4

Please sign in to comment.