Exemple #1
0
        private void updateGameVersion()
        {
            string curVer = FileVersionInfo.GetVersionInfo(Program.GamePath + Program.LoncherSettings.ExeName).FileVersion.Replace(',', '.');

            Program.GameVersion = curVer;

            Program.ModsDisabledPath = Program.GamePath + "_loncher_disabled_mods\\";
            Program.LoncherSettings.LoadFileListForVersion(curVer);
            LauncherConfig.SaveMods();
        }
Exemple #2
0
 public void Enable()
 {
     foreach (FileInfo fi in CurrentVersionFiles)
     {
         if (File.Exists(Program.ModsDisabledPath + fi.Path))
         {
             File.Move(Program.ModsDisabledPath + fi.Path, Program.GamePath + fi.Path);
         }
     }
     ModConfigurationInfo.Active = true;
     LauncherConfig.SaveMods();
 }
Exemple #3
0
        public void Delete()
        {
            string prefix = ModConfigurationInfo.Active ? Program.GamePath : Program.ModsDisabledPath;

            foreach (FileInfo fi in CurrentVersionFiles)
            {
                File.Delete(prefix + fi.Path);
                fi.IsOK = false;
            }
            LauncherConfig.InstalledMods.Remove(ModConfigurationInfo);
            ModConfigurationInfo = null;
            LauncherConfig.SaveMods();
        }
Exemple #4
0
        public void Install()
        {
            List <string> fileList = new List <string>();

            foreach (FileInfo fi in CurrentVersionFiles)
            {
                fileList.Add(fi.Path);
            }
            ModConfigurationInfo = new ModCfgInfo(Name, Program.GameVersion, fileList, true);
            int oldModConfInfoIdx = LauncherConfig.InstalledMods.FindIndex(x => x.Name.Equals(Name));

            if (oldModConfInfoIdx > -1)
            {
                LauncherConfig.InstalledMods.RemoveAt(oldModConfInfoIdx);
            }
            LauncherConfig.InstalledMods.Add(ModConfigurationInfo);
            LauncherConfig.SaveMods();
        }
Exemple #5
0
 public void Disable()
 {
     MoveToDisabled(CurrentVersionFiles);
     ModConfigurationInfo.Active = false;
     LauncherConfig.SaveMods();
 }