pUSH
This commit is contained in:
@@ -220,7 +220,7 @@ class PlayState extends MusicBeatState
|
||||
// case "":
|
||||
// ADD YOUR HARDCODED SCRIPTS HERE!
|
||||
default:
|
||||
var content = Paths.getFolderContent('charts/${SONG.song}/', false, true, !fromMods);
|
||||
var content = Paths.getFolderContent('data/charts/${SONG.song}/', false, true, !fromMods);
|
||||
for(file in content) {
|
||||
var ext = Path.extension(file).toLowerCase();
|
||||
if (Script.scriptExtensions.contains(ext)) {
|
||||
|
||||
@@ -67,6 +67,8 @@ class TitleState extends MusicBeatState
|
||||
Conductor.changeBPM(102);
|
||||
persistentUpdate = true;
|
||||
|
||||
loadXML();
|
||||
|
||||
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
add(bg);
|
||||
|
||||
@@ -223,7 +225,7 @@ class TitleState extends MusicBeatState
|
||||
gfDance.animation.play('danceLeft');
|
||||
|
||||
#if TITLESCREEN_XML
|
||||
if (curBeat >= 16 || skippedIntro) {
|
||||
if (curBeat >= titleLength || skippedIntro) {
|
||||
if (!skippedIntro) skipIntro();
|
||||
return;
|
||||
}
|
||||
@@ -274,10 +276,10 @@ class TitleState extends MusicBeatState
|
||||
|
||||
public function loadXML() {
|
||||
try {
|
||||
xml = new Access(Xml.parse(Assets.getText('data/titlescreen.xml')).firstElement());
|
||||
if (xml.has.length) titleLength = CoolUtil.getDefault(Std.parseInt(xml.att.length), 16);
|
||||
xml = new Access(Xml.parse(Assets.getText(Paths.xml('titlescreen/titlescreen'))).firstElement());
|
||||
if (xml.hasNode.intro) {
|
||||
titleLines = [];
|
||||
if (xml.node.intro.has.length) titleLength = CoolUtil.getDefault(Std.parseInt(xml.node.intro.att.length), 16);
|
||||
for(text in xml.node.intro.nodes.text) {
|
||||
var beat:Int = CoolUtil.getDefault(text.has.beat ? Std.parseInt(text.att.beat) : null, 0);
|
||||
var texts:Array<OneOfTwo<String, TitleStateImage>> = [];
|
||||
|
||||
@@ -15,7 +15,7 @@ import lime.text.Font;
|
||||
import lime.utils.AssetType;
|
||||
import lime.utils.Bytes;
|
||||
|
||||
#if sys
|
||||
#if MOD_SUPPORT
|
||||
import sys.FileStat;
|
||||
import sys.FileSystem;
|
||||
#end
|
||||
@@ -32,7 +32,7 @@ class ModsAssetLibrary extends AssetLibrary {
|
||||
super();
|
||||
}
|
||||
|
||||
#if sys
|
||||
#if MOD_SUPPORT
|
||||
private var editedTimes:Map<String, Float> = [];
|
||||
var _parsedAsset:String = null;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import openfl.utils.AssetManifest;
|
||||
import openfl.utils.AssetLibrary;
|
||||
import flixel.graphics.FlxGraphic;
|
||||
|
||||
#if sys
|
||||
#if MOD_SUPPORT
|
||||
import sys.FileSystem;
|
||||
#end
|
||||
|
||||
@@ -16,7 +16,7 @@ import haxe.io.Path;
|
||||
using StringTools;
|
||||
|
||||
class ModsFolder {
|
||||
#if sys
|
||||
#if MOD_SUPPORT
|
||||
/**
|
||||
* Last time the folder was modified.
|
||||
*/
|
||||
@@ -148,7 +148,7 @@ class ModsFolder {
|
||||
lime.utils.Assets.cache.clear();
|
||||
|
||||
if (currentModFolder == null) return;
|
||||
#if sys
|
||||
#if MOD_SUPPORT
|
||||
var bmapsToRemove:Array<FlxGraphic> = [];
|
||||
@:privateAccess
|
||||
for(bmap in FlxG.bitmap._cache) {
|
||||
|
||||
@@ -45,7 +45,7 @@ class FramerateField extends TextField {
|
||||
|
||||
FlxG.stage.addEventListener(KeyboardEvent.KEY_UP, function(e:KeyboardEvent) {
|
||||
switch(e.keyCode) {
|
||||
case 114: // F3
|
||||
case #if web Keyboard.NUMBER_3 #else Keyboard.F3 #end: // 3 on web or F3 on windows, linux and other things that runs code
|
||||
debugMode = !debugMode;
|
||||
}
|
||||
});
|
||||
@@ -57,6 +57,7 @@ class FramerateField extends TextField {
|
||||
lastFPS = CoolUtil.fpsLerp(lastFPS, FlxG.elapsed == 0 ? 0 : (1 / FlxG.elapsed), 0.25);
|
||||
text.push('FPS: ${Std.int(lastFPS)}');
|
||||
}
|
||||
#if !web
|
||||
if (showMemory || debugMode) {
|
||||
text.push('RAM: ${CoolUtil.getSizeString(System.totalMemory)}');
|
||||
}
|
||||
@@ -65,6 +66,7 @@ class FramerateField extends TextField {
|
||||
peak = System.totalMemory;
|
||||
text.push('RAM PEAK: (${CoolUtil.getSizeString(peak)})');
|
||||
}
|
||||
#end
|
||||
#if !release
|
||||
text.push('CODENAME ENGINE ALPHA - BUILD ${funkin.macros.BuildCounterMacro.getBuildNumber()}');
|
||||
#end
|
||||
|
||||
@@ -90,9 +90,9 @@ class Main extends Sprite
|
||||
#end
|
||||
|
||||
|
||||
addChild(new FlxGame(gameWidth, gameHeight, initialState, zoom, framerate, framerate, skipSplash, startFullscreen));
|
||||
|
||||
addChild(new FlxGame(gameWidth, gameHeight, null, zoom, framerate, framerate, skipSplash, startFullscreen));
|
||||
loadGameSettings();
|
||||
FlxG.switchState(new TitleState());
|
||||
|
||||
#if !mobile
|
||||
addChild(new FramerateField(10, 3, 0xFFFFFF));
|
||||
@@ -129,7 +129,7 @@ class Main extends Sprite
|
||||
#end
|
||||
|
||||
FlxG.fixedTimestep = false;
|
||||
FlxG.autoPause = false;
|
||||
// FlxG.autoPause = false;
|
||||
|
||||
Options.load();
|
||||
|
||||
|
||||
@@ -119,12 +119,12 @@ class Paths
|
||||
|
||||
var difficultyEnd = (difficulty == "normal") ? "" : '-$difficulty';
|
||||
|
||||
// charts/your-song/hard.json
|
||||
var p = getPath('charts/$song/$difficulty.json', TEXT, null);
|
||||
// data/charts/your-song/hard.json
|
||||
var p = json('charts/$song/$difficulty');
|
||||
if (OpenFlAssets.exists(p)) return p;
|
||||
|
||||
// charts/your-song/your-song-hard.json
|
||||
var p2 = getPath('charts/$song/$song$difficultyEnd.json', TEXT, null);
|
||||
// data/charts/your-song/your-song-hard.json
|
||||
var p2 = json('charts/$song/$song$difficultyEnd');
|
||||
if (OpenFlAssets.exists(p2)) return p2;
|
||||
|
||||
// data/your-song/your-song-hard.json (default old format)
|
||||
@@ -168,7 +168,7 @@ class Paths
|
||||
}
|
||||
|
||||
var content:Array<String> = [];
|
||||
#if sys
|
||||
#if MOD_SUPPORT
|
||||
if (library is funkin.mods.ModsAssetLibrary) {
|
||||
// easy task, can immediatly scan for files!
|
||||
var lib = cast(library, funkin.mods.ModsAssetLibrary);
|
||||
|
||||
@@ -98,6 +98,7 @@ class Alphabet extends FlxSpriteGroup
|
||||
@:privateAccess
|
||||
library = cast(library.__proxy, AssetLibrary);
|
||||
}
|
||||
#if MOD_SUPPORT
|
||||
if (library is ModsAssetLibrary) {
|
||||
var modLib = cast(library, ModsAssetLibrary);
|
||||
@:privateAccess
|
||||
@@ -105,6 +106,7 @@ class Alphabet extends FlxSpriteGroup
|
||||
refreshAlphabetXML(alphabetPath);
|
||||
}
|
||||
}
|
||||
#end
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user