Skip to content

Commit

Permalink
edddddd
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanSantiagoYT committed Oct 13, 2023
1 parent f6772cb commit 54aca3a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
13 changes: 13 additions & 0 deletions source/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,19 @@ class CoolUtil
return formatted_bytes;
}

public static function getSizeLabel(num:UInt):String{
var size:Float = num;
var data = 0;
var dataTexts = ["B", "KB", "MB", "GB", "TB", "PB"]; // IS THAT A QT MOD REFERENCE!!!??!!111!!11???
while(size > 1024 && data < dataTexts.length - 1) {
data++;
size = size / 1024;
}

size = Math.round(size * 100) / 100;
return size + " " + dataTexts[data];
}

/** Quick Function to Fix Save Files for Flixel 5
if you are making a mod, you are gonna wanna change "ShadowMario" to something else
so Base Psych saves won't conflict with yours
Expand Down
6 changes: 6 additions & 0 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5391,12 +5391,18 @@ if (ClientPrefs.showNPS) {
FlxG.sound.music.time = 0;
vocals.time = 0;
Conductor.songPosition = 0;
curSection = 0;
curBeat = 0;
curStep = 0;
}
if (ClientPrefs.songLoading && FlxG.sound.music.length - Conductor.songPosition <= endingTimeLimit && SONG.song.toLowerCase() == 'anti-cheat-song') { //stop crashes when playing normally
infiniteLoop();
FlxG.sound.music.time = 0;
vocals.time = 0;
Conductor.songPosition = 0;
curSection = 0;
curBeat = 0;
curStep = 0;
}
}
}
Expand Down
27 changes: 25 additions & 2 deletions source/WeekData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@ class WeekData {
weeksLoaded.clear();
#if MODS_ALLOWED
var disabledMods:Array<String> = [];
#if android
var modsListPath:String = SUtil.getPath() + 'modsList.txt';
var directories:Array<String> = [Paths.mods(), SUtil.getPath() + Paths.getPreloadPath()];
#else
var modsListPath:String = 'modsList.txt';
var directories:Array<String> = [Paths.mods(), Paths.getPreloadPath()];
#end
var originalLength:Int = directories.length;
if(FileSystem.exists(modsListPath))
{
Expand Down Expand Up @@ -131,8 +136,11 @@ class WeekData {
var directories:Array<String> = [Paths.getPreloadPath()];
var originalLength:Int = directories.length;
#end

#if android
var sexList:Array<String> = CoolUtil.coolTextFile(SUtil.getPath() + Paths.getPreloadPath('weeks/weekList.txt'));
#else
var sexList:Array<String> = CoolUtil.coolTextFile(Paths.getPreloadPath('weeks/weekList.txt'));
#end
for (i in 0...sexList.length) {
for (j in 0...directories.length) {
var fileToCheck:String = directories[j] + 'weeks/' + sexList[i] + '.json';
Expand Down Expand Up @@ -247,7 +255,7 @@ class WeekData {
{
Paths.currentModDirectory = '';

#if MODS_ALLOWED
#if (MODS_ALLOWED && android)
if (FileSystem.exists(SUtil.getPath() + "modsList.txt"))
{
var list:Array<String> = CoolUtil.listFromString(File.getContent(SUtil.getPath() +"modsList.txt"));
Expand All @@ -262,6 +270,21 @@ class WeekData {
}
}
}
#else
if (FileSystem.exists("modsList.txt"))
{
var list:Array<String> = CoolUtil.listFromString(File.getContent("modsList.txt"));
var foundTheTop = false;
for (i in list)
{
var dat = i.split("|");
if (dat[1] == "1" && !foundTheTop)
{
foundTheTop = true;
Paths.currentModDirectory = dat[0];
}
}
}
#end
}
}

0 comments on commit 54aca3a

Please sign in to comment.