Exemplo n.º 1
0
        public void LoadGUI()
        {
            window.ProcessTextBox.Text              = ConfigHolder.GetProcessPath();
            window.KillNonRespProcessBox.IsChecked  = ConfigHolder.killNonRespProcess;
            window.StartServerWithToolBox.IsChecked = ConfigHolder.startServerOnStartup;

            foreach (string s in ConfigHolder.GetParameters())
            {
                window.AddItemToList(window.ParameterList, s);
            }
            foreach (string s in ConfigHolder.GetMods())
            {
                window.AddItemToList(window.ModList, ConfigHolder.ShortenModPath(s));
            }
            WriteToConsole("Config files loaded");
        }
Exemplo n.º 2
0
        private static string ReadMods()
        {
            string parameter = "\"-mod=";

            for (int i = 0; i < ConfigHolder.GetMods().Count; i++)
            {
                string mod = ConfigHolder.GetMods()[i].ToString();
                if (i != ConfigHolder.GetMods().Count - 1)
                {
                    parameter += ConfigHolder.ShortenModPath(mod) + ";";
                }
                else
                {
                    parameter += ConfigHolder.ShortenModPath(mod);
                }
            }
            return(parameter += "\"");
        }
Exemplo n.º 3
0
        public bool AddMod(string mod)
        {
            foreach (string m in ConfigHolder.GetMods())
            {
                if (m.Equals(mod))
                {
                    WriteToConsole("The mod " + mod + " is already loaded!");
                    return(false);
                }
            }

            string keysPath = "";

            if (Directory.Exists(mod + @"\keys") || Directory.Exists(mod + @"\key"))
            {
                if (Directory.Exists(mod + @"\keys"))
                {
                    keysPath = mod + @"\keys";
                }
                else if (Directory.Exists(mod + @"\key"))
                {
                    keysPath = mod + @"\key";
                }
                if (Directory.Exists(keysPath))
                {
                    foreach (string s in Directory.GetFiles(keysPath))
                    {
                        if (s.EndsWith(".bikey"))
                        {
                            if (!File.Exists(GetProcessDirectory() + @"\keys\" + Path.GetFileName(s)))
                            {
                                File.Copy(s, GetProcessDirectory() + @"\keys\" + Path.GetFileName(s));
                            }
                        }
                    }
                }
            }

            ConfigHolder.AddMod(mod);
            ConfigIO.WriteMods(ConfigHolder.GetMods());
            return(true);
        }
Exemplo n.º 4
0
        public void RemoveMod(string mod)
        {
            string modPath = "";

            if (mod[0] == char.Parse("@"))
            {
                modPath = GetProcessDirectory() + mod;
                WriteToConsole("Deleting mod: " + modPath);
            }
            else
            {
                modPath = mod;
            }

            for (int i = 0; i < ConfigHolder.GetMods().Count; i++)
            {
                if (ConfigHolder.GetMods()[i].ToString() == modPath)
                {
                    ConfigHolder.GetMods().RemoveAt(i);
                }
            }

            ConfigIO.WriteMods(ConfigHolder.GetMods());
        }
Exemplo n.º 5
0
 public void RemoveAllMods()
 {
     ConfigHolder.SetMods(new System.Collections.ArrayList());
     ConfigIO.WriteMods(ConfigHolder.GetMods());
 }