1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-09-11 20:57:20 +00:00

Mac fix, doh!

This commit is contained in:
EliteMasterEric 2023-03-01 18:22:28 -05:00
parent fe92d00a04
commit 75b4c732db
4 changed files with 18 additions and 11 deletions

View file

@ -169,6 +169,7 @@ class PolymodHandler
// `polymod.*`
for (cls in ClassMacro.listClassesInPackage('polymod'))
{
if (cls == null) continue;
var className = Type.getClassName(cls);
Polymod.blacklistImport(className);
}

View file

@ -60,7 +60,7 @@ class VanillaCutscenes
#if html5
// Video displays OVER the FlxState.
vid = new FlxVideo(path);
vid.finishCallback = finishCutscene;
vid.finishCallback = finishCutscene.bind(0.5);
#else
// Video displays OVER the FlxState.
// vid = new FlxVideoSprite(0, 0);

View file

@ -5,6 +5,10 @@ import lime.utils.Bytes;
import lime.ui.FileDialog;
import openfl.net.FileFilter;
import haxe.io.Path;
#if html5
import openfl.net.FileReference;
import openfl.events.Event;
#end
/**
* Utilities for reading and writing files on various platforms.
@ -141,8 +145,6 @@ class FileUtil
fileDialog.open(filter, defaultPath, dialogTitle);
return true;
#elseif html5
var filter = convertTypeFilter(typeFilter);
var onFileLoaded = function(event) {
var loadedFileRef:FileReference = event.target;
trace('Loaded file: ' + loadedFileRef.name);
@ -157,8 +159,9 @@ class FileUtil
}
var fileRef = new FileReference();
file.addEventListener(Event.SELECT, onFileSelected);
file.open(filter, defaultPath, dialogTitle);
fileRef.addEventListener(Event.SELECT, onFileSelected);
fileRef.browse(typeFilter);
return true;
#else
onCancel();
return false;
@ -169,7 +172,6 @@ class FileUtil
* Browses for a single file location, then writes the provided `haxe.io.Bytes` data and calls `onSave(path)` when done.
* Works great on desktop and HTML5.
*
* @param typeFilter TODO What does this do?
* @return Whether the file dialog was opened successfully.
*/
public static function saveFile(data:Bytes, ?onSave:String->Void, ?onCancel:Void->Void, ?defaultFileName:String, ?dialogTitle:String):Bool
@ -191,6 +193,7 @@ class FileUtil
if (onCancel != null) fileDialog.onCancel.add(onCancel);
fileDialog.save(data, filter, defaultFileName, dialogTitle);
return true;
#else
onCancel();
return false;
@ -374,7 +377,11 @@ class FileUtil
*/
public static function appendStringToPath(path:String, data:String)
{
#if sys
sys.io.File.append(path, false).writeString(data);
#else
throw 'Direct file writing by path not supported on this platform.';
#end
}
/**
@ -410,7 +417,7 @@ class FileUtil
{
path = Sys.getEnv(envName);
if (path == "") path = null;
if (path == '') path = null;
if (path != null) break;
}

View file

@ -2,7 +2,7 @@ package funkin.util;
import flixel.util.FlxSignal.FlxTypedSignal;
#if cpp
#if (cpp && windows)
@:cppFileCode('
#include <iostream>
#include <windows.h>
@ -35,8 +35,7 @@ class WindowUtil
// onUpdate is called every frame just before rendering.
// onExit is called when the game window is closed.
openfl.Lib.current.stage.application.onExit.add(function(exitCode:Int)
{
openfl.Lib.current.stage.application.onExit.add(function(exitCode:Int) {
windowExit.dispatch(exitCode);
});
}
@ -46,7 +45,7 @@ class WindowUtil
*/
public static function disableCrashHandler()
{
#if cpp
#if (cpp && windows)
untyped __cpp__('SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);');
#else
// Do nothing.