fix(shrink): Changes shrink table to use json (#446)

- [X] Replaces shrink.cfg with shrink.json
- [X] Cleans up shrink loading code
This commit is contained in:
Kamron Batman 2021-02-03 16:58:50 -08:00 committed by GitHub
parent 5d9ebf062f
commit 3664149422
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 453 additions and 517 deletions

View file

@ -1463,22 +1463,13 @@ namespace Server.Gumps
public static string FormatByteAmount(long totalBytes)
{
if (totalBytes > 1000000000)
return totalBytes switch
{
return $"{(double)totalBytes / 1073741824:F1} GB";
}
if (totalBytes > 1000000)
{
return $"{(double)totalBytes / 1048576:F1} MB";
}
if (totalBytes > 1000)
{
return $"{(double)totalBytes / 1024:F1} KB";
}
return $"{totalBytes} Bytes";
> 1000000000 => $"{(double)totalBytes / 1073741824:F1} GB",
> 1000000 => $"{(double)totalBytes / 1048576:F1} MB",
> 1000 => $"{(double)totalBytes / 1024:F1} KB",
_ => $"{totalBytes} Bytes"
};
}
public static void Initialize()