Skip to content

Commit

Permalink
Moved config file to Configs folder
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesenibbles123 committed Feb 22, 2021
1 parent 045c5e0 commit bf173f3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions customEliteBadges/mainClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class mainClass : MonoBehaviour
static Dictionary<int, Texture2D> customBadges = new Dictionary<int, Texture2D>();
static List<int> levels = new List<int>();

static string cfgFilePath = "/Managed/Mods/Configs/customBadges.cfg";
static string texturesFilePath = "/Managed/Mods/Assets/CustomEliteBadges/";

static void log(string contents)
Expand Down Expand Up @@ -68,9 +69,9 @@ void setMainmenu()
}
void initMod()
{
if (File.Exists(Application.dataPath + "/Managed/Mods/customBadges.txt"))
if (File.Exists(Application.dataPath + cfgFilePath))
{
string[] text = File.ReadAllLines(Application.dataPath + "/Managed/Mods/customBadges.txt");
string[] text = File.ReadAllLines(Application.dataPath + cfgFilePath);
Texture2D newTexture;
for (int i = 0; i < text.Length; i++)
{
Expand Down Expand Up @@ -101,10 +102,10 @@ void createConfig()
{
Directory.CreateDirectory(Application.dataPath + texturesFilePath);
}
if (!File.Exists(Application.dataPath + "/Managed/Mods/customBadges.txt"))
if (!File.Exists(Application.dataPath + cfgFilePath))
{
string[] lines = { "100=silver", "250=eyes", "500=diamond" };
File.WriteAllLines(Application.dataPath + "/Managed/Mods/customBadges.txt", lines);
File.WriteAllLines(Application.dataPath + cfgFilePath, lines);
}
initMod();
}
Expand Down

0 comments on commit bf173f3

Please sign in to comment.