Merge pull request #236 from FunkinCrew/bugfix/platform-fixes

HTML5 and MacOS platform fixes
This commit is contained in:
Cameron Taylor 2023-11-29 01:48:14 -05:00 committed by GitHub
commit f691de6452
6 changed files with 53 additions and 25 deletions

View file

@ -1,6 +1,12 @@
# Troubleshooting Common Issues # Troubleshooting Common Issues
- Weird macro error with a very tall call stack: Restart Visual Studio Code - Weird macro error with a very tall call stack: Restart Visual Studio Code
- NOTE: This is caused by Polymod somewhere, and seems to only occur when there is another compile error somewhere in the program. There is a bounty up for it.
- `Get Thread Context Failed`: Turn off other expensive applications while building - `Get Thread Context Failed`: Turn off other expensive applications while building
- `Type not found: T1`: This is thrown by `json2object`, make sure the data type of `@:default` is correct. - `Type not found: T1`: This is thrown by `json2object`, make sure the data type of `@:default` is correct.
- NOTE: `flixel.util.typeLimit.OneOfTwo` isn't supported. - NOTE: `flixel.util.typeLimit.OneOfTwo` isn't supported.
- `Class lists not properly generated. Try cleaning out your export folder, restarting your IDE, and rebuilding your project.`
- This is a bug specific to HTML5. Simply perform the steps listed (don't forget to restart the IDE too).

View file

@ -11,7 +11,7 @@
"name": "flixel", "name": "flixel",
"type": "git", "type": "git",
"dir": null, "dir": null,
"ref": "8437a86aa5dafdb3f5dcb91d212cb10a4ee6e53b", "ref": "da04cbda49a4c5eebe93fb61296dbaf4f0f1b556",
"url": "https://github.com/EliteMasterEric/flixel" "url": "https://github.com/EliteMasterEric/flixel"
}, },
{ {
@ -49,7 +49,7 @@
"name": "haxeui-core", "name": "haxeui-core",
"type": "git", "type": "git",
"dir": null, "dir": null,
"ref": "bfdb49886f256a8c37edfc4f46586727d68e2756", "ref": "91ed8d7867c52af5ea2a9513204057d69ab33c8e",
"url": "https://github.com/haxeui/haxeui-core" "url": "https://github.com/haxeui/haxeui-core"
}, },
{ {
@ -144,7 +144,7 @@
"name": "polymod", "name": "polymod",
"type": "git", "type": "git",
"dir": null, "dir": null,
"ref": "e8a07b81e3bc535238ad8649e38f5d43c46f1b65", "ref": "80d1d309803c1b111866524f9769325e3b8b0b1b",
"url": "https://github.com/larsiusprime/polymod" "url": "https://github.com/larsiusprime/polymod"
}, },
{ {

View file

@ -2199,8 +2199,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
#if sys #if sys
menubarItemGoToBackupsFolder.onClick = _ -> this.openBackupsFolder(); menubarItemGoToBackupsFolder.onClick = _ -> this.openBackupsFolder();
#else #else
// Disable if no file system or command access
menubarItemGoToBackupsFolder.disabled = true; // Disable the menu item if we're not on a desktop platform.
var menubarItemGoToBackupsFolder = findComponent('menubarItemGoToBackupsFolder', MenuItem);
if (menubarItemGoToBackupsFolder != null) menubarItemGoToBackupsFolder.disabled = true;
#end #end
menubarItemUserGuide.onClick = _ -> this.openUserGuideDialog(); menubarItemUserGuide.onClick = _ -> this.openUserGuideDialog();
@ -2341,9 +2344,13 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
*/ */
function openBackupsFolder():Void function openBackupsFolder():Void
{ {
#if sys
// TODO: Is there a way to open a folder and highlight a file in it? // TODO: Is there a way to open a folder and highlight a file in it?
var absoluteBackupsPath:String = Path.join([Sys.getCwd(), ChartEditorImportExportHandler.BACKUPS_PATH]); var absoluteBackupsPath:String = Path.join([Sys.getCwd(), ChartEditorImportExportHandler.BACKUPS_PATH]);
WindowUtil.openFolder(absoluteBackupsPath); WindowUtil.openFolder(absoluteBackupsPath);
#else
trace('No file system access, cannot open backups folder.');
#end
} }
/** /**

View file

@ -38,12 +38,19 @@ class CapsuleText extends FlxSpriteGroup
function set_text(value:String):String function set_text(value:String):String
{ {
if (value == null) return value;
if (blurredText == null || whiteText == null)
{
trace('WARN: Capsule not initialized properly');
return text = value;
}
blurredText.text = value; blurredText.text = value;
whiteText.text = value; whiteText.text = value;
whiteText.textField.filters = [ whiteText.textField.filters = [
new openfl.filters.GlowFilter(0x00ccff, 1, 5, 5, 210, BitmapFilterQuality.MEDIUM), new openfl.filters.GlowFilter(0x00ccff, 1, 5, 5, 210, BitmapFilterQuality.MEDIUM),
// new openfl.filters.BlurFilter(5, 5, BitmapFilterQuality.LOW) // new openfl.filters.BlurFilter(5, 5, BitmapFilterQuality.LOW)
]; ];
return value; return text = value;
} }
} }

View file

@ -998,6 +998,11 @@ class FreeplayState extends MusicBeatSubState
PlayStatePlaylist.isStoryMode = false; PlayStatePlaylist.isStoryMode = false;
var targetSong:Song = SongRegistry.instance.fetchEntry(cap.songData.songId); var targetSong:Song = SongRegistry.instance.fetchEntry(cap.songData.songId);
if (targetSong == null)
{
FlxG.log.warn('WARN: could not find song with id (${cap.songData.songId})');
return;
}
var targetDifficulty:String = currentDifficulty; var targetDifficulty:String = currentDifficulty;
// TODO: Implement Pico into the interface properly. // TODO: Implement Pico into the interface properly.

View file

@ -1,24 +1,25 @@
package funkin.ui.transition; package funkin.ui.transition;
import funkin.play.PlayStatePlaylist;
import flixel.FlxSprite; import flixel.FlxSprite;
import flixel.FlxState; import flixel.FlxState;
import funkin.graphics.shaders.ScreenWipeShader;
import flixel.math.FlxMath; import flixel.math.FlxMath;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.util.FlxTimer; import flixel.util.FlxTimer;
import funkin.graphics.shaders.ScreenWipeShader;
import funkin.play.PlayState; import funkin.play.PlayState;
import funkin.play.PlayStatePlaylist;
import funkin.play.song.Song.SongDifficulty;
import funkin.ui.mainmenu.MainMenuState;
import funkin.ui.MusicBeatState;
import haxe.io.Path; import haxe.io.Path;
import lime.app.Future; import lime.app.Future;
import flixel.tweens.FlxTween;
import funkin.ui.MusicBeatState;
import lime.app.Promise; import lime.app.Promise;
import lime.utils.AssetLibrary; import lime.utils.AssetLibrary;
import flixel.tweens.FlxEase;
import lime.utils.AssetManifest; import lime.utils.AssetManifest;
import lime.utils.Assets as LimeAssets; import lime.utils.Assets as LimeAssets;
import openfl.utils.Assets;
import funkin.ui.mainmenu.MainMenuState;
import openfl.filters.ShaderFilter; import openfl.filters.ShaderFilter;
import openfl.utils.Assets;
class LoadingState extends MusicBeatState class LoadingState extends MusicBeatState
{ {
@ -59,18 +60,20 @@ class LoadingState extends MusicBeatState
initSongsManifest().onComplete(function(lib) { initSongsManifest().onComplete(function(lib) {
callbacks = new MultiCallback(onLoad); callbacks = new MultiCallback(onLoad);
var introComplete = callbacks.add('introComplete'); var introComplete = callbacks.add('introComplete');
// checkLoadSong(getSongPath());
// if (PlayState.currentSong.needsVoices) if (Std.isOfType(target, PlayState))
// { {
// var files = PlayState.currentSong.voiceList; var targetPlayState:PlayState = cast target;
// var targetChart:SongDifficulty = targetPlayState.currentChart;
// if (files == null) files = ['']; // loads with no file name assumption, to load 'Voices.ogg' or whatev normally var instPath:String = Paths.inst(targetChart.song.id);
// var voicesPaths:Array<String> = targetChart.buildVoiceList();
// for (sndFile in files)
// { checkLoadSong(instPath);
// checkLoadSong(getVocalPath(sndFile)); for (voicePath in voicesPaths)
// } {
// } checkLoadSong(voicePath);
}
}
checkLibrary('shared'); checkLibrary('shared');
checkLibrary(PlayStatePlaylist.campaignId); checkLibrary(PlayStatePlaylist.campaignId);