Files
CodenameEngine/source/funkin/backend/system/MainState.hx
T
23648695e9 More Optimizations (#188)
* bye

* Updated docs

* Adding docs to gitignore

Useless to keep and upload too plus it contains sensitive stuff that takes when generating docs (eg: repo's saved path)
It's prob smth that the docs program uses temporarily to generate

* Re-exported gf chrimah

Atlas exported christmas gf by @EnderNile8182
Gf adjusted offsets by me
No more black lines

Co-Authored-By: Nile <102095746+endernile8182@users.noreply.github.com>

* Custom Credits

* Better Custom Credits

* Custom Credits template

* Re-exported gf car

Atlas exported car gf by @EnderNile8182
I've edited some strings in the xml
No more black lines

Co-Authored-By: Nile <102095746+endernile8182@users.noreply.github.com>

* Re-exported gf tank

Atlas exported tank gf by @EnderNile8182
Gf adjusted offsets by me
No more black lines

Co-Authored-By: Nile <102095746+endernile8182@users.noreply.github.com>

* Yay finished gfs

* Better Icons

Mainly Fixed offsets and adjust Tankman ones (some transparent pixels)

* Added bf x gf week 7 gameover

* verbose!!!!!!!!!!

❗

* tank bg "bug" fix

it was also giving an error
what the hell is tankBg even

* No more game freeze for desktop on freeplay

* Some freeplay optimisations

* Making .temp folder hidden

idk i found it ugly

* Reupdated docs

---------

Co-authored-by: Nile <102095746+endernile8182@users.noreply.github.com>
2023-07-19 15:48:20 -07:00

61 lines
1.7 KiB
Haxe

package funkin.backend.system;
#if MOD_SUPPORT
import sys.FileSystem;
#end
import funkin.backend.assets.ModsFolder;
import funkin.menus.TitleState;
import funkin.menus.BetaWarningState;
import funkin.editors.charter.EventsData;
import flixel.FlxState;
/**
* Simple state used for loading the game
*/
class MainState extends FlxState {
public static var initiated:Bool = false;
public static var betaWarningShown:Bool = false;
public override function create() {
super.create();
if (!initiated)
Main.loadGameSettings();
initiated = true;
#if sys
CoolUtil.deleteFolder('./.temp/'); // delete temp folder
#end
Options.save();
FlxG.bitmap.reset();
FlxG.sound.destroy(true);
Paths.assetsTree.reset();
#if MOD_SUPPORT
if (ModsFolder.currentModFolder != null)
Paths.assetsTree.addLibrary(ModsFolder.loadModLib('${ModsFolder.modsPath}${ModsFolder.currentModFolder}'));
if (FileSystem.exists(ModsFolder.addonsPath) && FileSystem.isDirectory(ModsFolder.addonsPath))
for(addon in [for(dir in FileSystem.readDirectory(ModsFolder.addonsPath)) if (FileSystem.isDirectory('${ModsFolder.addonsPath}$dir')) dir])
Paths.assetsTree.addLibrary(ModsFolder.loadModLib('${ModsFolder.addonsPath}$addon'));
#end
Main.refreshAssets();
ModsFolder.onModSwitch.dispatch(ModsFolder.currentModFolder);
DiscordUtil.reloadJsonData();
EventsData.reloadEvents();
TitleState.initialized = false;
if (betaWarningShown)
FlxG.switchState(new TitleState());
else {
FlxG.switchState(new BetaWarningState());
betaWarningShown = true;
}
#if sys
sys.FileSystem.createDirectory('./.temp/');
#if windows Sys.command("attrib +h .temp"); #end
#end
}
}