HTML5 stuff, now going to sleep gn yall

This commit is contained in:
Yoshman29
2022-10-09 03:46:07 +02:00
parent 0a46a5c1d1
commit 44a5f4b1be
10 changed files with 39 additions and 24 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ class GameOverSubstate extends MusicBeatSubstate
{
FlxG.camera.fade(FlxColor.BLACK, 2, false, function()
{
LoadingState.loadAndSwitchState(new PlayState());
FlxG.switchState(new PlayState());
});
});
}
+1 -1
View File
@@ -1076,7 +1076,7 @@ class PlayState extends MusicBeatState
PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase(), difficulty);
FlxG.sound.music.stop();
LoadingState.loadAndSwitchState(new PlayState());
FlxG.switchState(new PlayState());
}
}
else
@@ -2,7 +2,9 @@ package funkin.macros;
import haxe.macro.Expr.Field;
import haxe.macro.Context;
#if sys
import sys.io.File;
#end
class BuildCounterMacro {
// non functional
+3 -3
View File
@@ -220,7 +220,7 @@ class FreeplayState extends MusicBeatState
// PlayState.storyWeek = songs[curSelected].week;
trace('CUR WEEK' + PlayState.storyWeek);
LoadingState.loadAndSwitchState(new PlayState());
FlxG.switchState(new PlayState());
}
}
@@ -277,7 +277,7 @@ class FreeplayState extends MusicBeatState
for (i in 0...iconArray.length)
{
iconArray[i].alpha = lerp(iconArray[i].alpha, songInstPlaying ? 0.45 : 0.6, 0.25);
iconArray[i].alpha = lerp(iconArray[i].alpha, #if PRELOAD_ALL songInstPlaying ? 0.45 : #end 0.6, 0.25);
}
iconArray[curSelected].alpha = 1;
@@ -287,7 +287,7 @@ class FreeplayState extends MusicBeatState
item.targetY = bullShit - curSelected;
bullShit++;
item.alpha = lerp(item.alpha, songInstPlaying ? 0.45 : 0.6, 0.25);
item.alpha = lerp(item.alpha, #if PRELOAD_ALL songInstPlaying ? 0.45 : #end 0.6, 0.25);
// item.setGraphicSize(Std.int(item.width * 0.8));
if (item.targetY == 0)
+1 -1
View File
@@ -326,7 +326,7 @@ class StoryMenuState extends MusicBeatState
PlayState.campaignScore = 0;
new FlxTimer().start(1, function(tmr:FlxTimer)
{
LoadingState.loadAndSwitchState(new PlayState(), true);
FlxG.switchState(new PlayState());
});
}
}
+5 -2
View File
@@ -1,8 +1,6 @@
package funkin.mods;
import lime.utils.Log;
import sys.FileStat;
import sys.FileSystem;
import lime.utils.AssetLibrary;
import lime.utils.AssetManifest;
@@ -17,6 +15,11 @@ import lime.text.Font;
import lime.utils.AssetType;
import lime.utils.Bytes;
#if sys
import sys.FileStat;
import sys.FileSystem;
#end
using StringTools;
class ModsAssetLibrary extends AssetLibrary {
+2
View File
@@ -87,6 +87,7 @@ class ModsFolder {
* @param addRoot Whenever the root should be added to the paths. Defaults to false
*/
public static function getAssetFiles(assets:Array<Dynamic>, rootPath:String, path:String, libraryName:String, prefix:String = "", addRoot:Bool = false) {
#if sys
for(f in FileSystem.readDirectory('$rootPath$path')) {
if (FileSystem.isDirectory('$rootPath$path$f')) {
// fuck you git
@@ -117,6 +118,7 @@ class ModsFolder {
});
}
}
#end
}
public static function checkForOutdatedAssets(assets:ModsAssetLibrary) {
+15 -4
View File
@@ -86,12 +86,12 @@ class Paths
inline static public function voices(song:String)
{
return getPath('songs/${song.toLowerCase()}/Voices.ogg', MUSIC, null);
return getPath('songs/${song.toLowerCase()}/Voices.$SOUND_EXT', MUSIC, null);
}
inline static public function inst(song:String)
{
return getPath('songs/${song.toLowerCase()}/Inst.ogg', MUSIC, null);
return getPath('songs/${song.toLowerCase()}/Inst.$SOUND_EXT', MUSIC, null);
}
inline static public function image(key:String, ?library:String)
@@ -166,12 +166,23 @@ class Paths
}
var content:Array<String> = [];
#if sys
if (library is funkin.mods.ModsAssetLibrary) {
// easy task, can immediatly scan for files!
var lib = cast(library, funkin.mods.ModsAssetLibrary);
content = lib.getFiles(libThing.symbolName);
} else {
// TODO!!
} else
#end
if (library is lime.utils.AssetLibrary) {
var lib = cast(library, lime.utils.AssetLibrary);
@:privateAccess
for(k=>e in lib.paths) {
if (k.startsWith(libThing.symbolName)) {
var barebonesFileName = k.substr(libThing.symbolName.length);
if (!barebonesFileName.contains("/"))
content.push(barebonesFileName);
}
}
}
if (includeSource) {