restarting again
i hate git
This commit is contained in:
@@ -13,7 +13,7 @@ import lime.utils.AssetType;
|
||||
/**
|
||||
* A class that reads the `flags.ini` file, allowing to read settable Flags (customs too).
|
||||
*/
|
||||
@:build(funkin.backend.system.macros.FlagMacro.build())
|
||||
@:build(funkin.backend.system.macros.FlagMacro.build("onReset"))
|
||||
class Flags {
|
||||
public static var overridenFlags:Map<String, Bool> = [];
|
||||
|
||||
@@ -157,7 +157,7 @@ class Flags {
|
||||
public static var DEFAULT_HUD_ZOOM_LERP:Float = 0.05;
|
||||
|
||||
public static var USE_LEGACY_ZOOM_FACTOR:Null<Bool> = null;
|
||||
|
||||
|
||||
// Font configuration
|
||||
public static var DEFAULT_FONT:String = "vcr.ttf";
|
||||
public static var DEFAULT_FONT_SIZE:Int = 16;
|
||||
@@ -312,6 +312,11 @@ class Flags {
|
||||
if (SUSTAINS_AS_ONE_NOTE == null) SUSTAINS_AS_ONE_NOTE = MOD_API_VERSION >= 2;
|
||||
}
|
||||
|
||||
private static function onReset() {
|
||||
var currentModFolder = ModsFolder.currentModFolder;
|
||||
if (currentModFolder != null) SAVE_NAME = currentModFolder;
|
||||
}
|
||||
|
||||
public static function loadFromDatas(datas:Array<String>):Map<String, String> {
|
||||
var flags:Map<String, String> = [];
|
||||
for (data in datas) {
|
||||
|
||||
@@ -19,7 +19,7 @@ class FlagMacro {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function build():Array<Field> {
|
||||
public static function build(resetCallback:String):Array<Field> {
|
||||
var fields = Context.getBuildFields();
|
||||
|
||||
var clRef = Context.getLocalClass();
|
||||
@@ -248,7 +248,10 @@ class FlagMacro {
|
||||
access: [APublic, AStatic],
|
||||
kind: FFun({
|
||||
args: [],
|
||||
expr: macro $b{resetExprs},
|
||||
expr: macro {
|
||||
$b{resetExprs};
|
||||
$i{resetCallback}();
|
||||
},
|
||||
ret: macro: Void
|
||||
}),
|
||||
pos: Context.currentPos(),
|
||||
|
||||
@@ -342,10 +342,17 @@ class StoryWeeklist {
|
||||
public function new() {}
|
||||
|
||||
public function getWeeksFromSource(source:funkin.backend.assets.AssetSource, useTxt:Bool = true, loadCharactersData:Bool = true) {
|
||||
var path:String = Paths.txt('weeks/weeks');
|
||||
var weeksFound:Array<String> = useTxt && Paths.assetsTree.existsSpecific(path, "TEXT", source) ? CoolUtil.coolTextFile(path) :
|
||||
[for (c in Paths.getFolderContent('data/weeks/weeks/', false, source)) if (Path.extension(c).toLowerCase() == "xml") Path.withoutExtension(c)];
|
||||
|
||||
var weeksFound:Array<String> = null;
|
||||
if (useTxt) {
|
||||
var oldPath:String = Paths.txt('weeks/weeks');
|
||||
var newPath:String = Paths.txt('config/weeks');
|
||||
if (Paths.assetsTree.existsSpecific(newPath, "TEXT", source)) weeksFound = CoolUtil.coolTextFile(newPath);
|
||||
else if (Paths.assetsTree.existsSpecific(oldPath, "TEXT", source)) {
|
||||
Logs.warn("data/weeks/weeks.txt is deprecated and will be removed in the future. Please move the file to data/config/", DARKYELLOW, "StoryWeeklist");
|
||||
weeksFound = CoolUtil.coolTextFile(oldPath);
|
||||
}
|
||||
}
|
||||
if (weeksFound == null) weeksFound = [for (c in Paths.getFolderContent('data/weeks/weeks/', false, source)) if (Path.extension(c).toLowerCase() == "xml") Path.withoutExtension(c)];
|
||||
if (weeksFound.length > 0) {
|
||||
for (w in weeksFound) {
|
||||
var week = Week.loadWeek(w, loadCharactersData);
|
||||
|
||||
Reference in New Issue
Block a user