Exemplo n.º 1
0
        private void LoadProfileMods()
        {
            var reg = new AtsRegWork(true);
            var gam = reg.Read(RegKeys.CURRENT_GAME);

            if (lstSortMods.SelectedItem.IsNull())
            {
                return;
            }
            var chc = lstSortMods.SelectedItem.ToString();

            lstAvailableMods.Items.Clear();
            IEnumerable <string> lst = null;

            switch (gam)
            {
            case "ATS":
                var ats = new AtsLoader();
                lst = ats.LoadAtsGroupMods(chc);
                break;

            case "ETS":
                var ets = new EtsLoader();
                lst = ets.LoadEtsGroupMods(chc);
                break;

            case "FS15":
                var fs15 = new Fs15Loader();
                lst = fs15.LoadFs15GroupMods(chc);
                break;

            case "FS17":
                var fs17 = new Fs17Loader();
                lst = fs17.LoadFs17GroupMods(chc);
                break;
            }

            if (lst == null)
            {
                return;
            }
            foreach (var v in lst)
            {
                lstAvailableMods.Items.Add(v.GetFileName());
            }

            CheckModCount();
        }
Exemplo n.º 2
0
        private void EtsLoad()
        {
            var ets       = new EtsLoader();
            var profLst   = ets.LoadEtsProfiles();
            var groupsLst = ets.LoadEtsGroups();

            lstProfiles.Items.Clear();
            lstSortMods.Items.Clear();
            foreach (var v in profLst)
            {
                lstProfiles.Items.Add(v.GetLastFolderName());
            }

            foreach (var t in groupsLst)
            {
                lstSortMods.Items.Add(t.GetLastFolderName());
            }

            LoadProfileMods();
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Removes a Profile
        /// </summary>
        /// <returns></returns>
        public IEnumerable <string> ProfileRemove()
        {
            var    reg     = new AtsRegWork(true);
            var    gam     = reg.Read(RegKeys.CURRENT_GAME);
            var    profile = reg.Read(RegKeys.CURRENT_PROFILE);
            string proPath;
            IEnumerable <string> proList = null;

            switch (gam)
            {
            case "ATS":
                var ldr = new AtsLoader();
                proPath = reg.Read(AtsRegKeys.ATS_PROFILES) + profile;
                DeleteFiles.DeleteFilesOrFolders(proPath);
                proList = ldr.LoadAtsProfiles();
                break;

            case "ETS":
                var edr = new EtsLoader();
                proPath = reg.Read(EtsRegKeys.ETS_PROFILES) + profile;
                DeleteFiles.DeleteFilesOrFolders(proPath);
                proList = edr.LoadEtsProfiles();
                break;

            case "FS15":
                proPath = reg.Read(Fs15RegKeys.FS15_PROFILES) + profile;
                var fs15 = new Fs15Loader();
                DeleteFiles.DeleteFilesOrFolders(proPath);
                proList = fs15.LoadFs15Profiles();
                break;

            case "FS17":
                proPath = reg.Read(Fs17RegKeys.FS17_PROFILES) + profile;
                var fs17 = new Fs15Loader();
                DeleteFiles.DeleteFilesOrFolders(proPath);
                proList = fs17.LoadFs15Profiles();
                break;
            }

            return(proList);
        }
Exemplo n.º 4
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            var reg   = new AtsRegWork(true);
            var gam   = reg.Read(RegKeys.CURRENT_GAME);
            var cProf = reg.Read(RegKeys.CURRENT_PROFILE);

            if (gam.IsNullOrEmpty() || cProf.IsNullOrEmpty())
            {
                MsgBx.Msg("You need to have a Profile / Game active", "Process Error");
                return;
            }

            string tmp;
            string profPath;
            Dictionary <string, string> lst = null;

            lstProfileMods.Items.Clear();

            switch (gam)
            {
            case "ATS":
                var ats  = new AtsLoader();
                var atsp = new AtsRegWork(true);
                var prof = new ProfileWorker();
                tmp      = ats.LoadAtsModChoice(lstAvailableMods.SelectedItem.ToString());
                profPath = atsp.Read(AtsRegKeys.ATS_GAME_MOD_FOLDER) + tmp.GetFileName();
                prof.BuildProfileList(lstAvailableMods.SelectedItem.ToString());
                SymLinks.CreateSymLink(profPath, tmp, 0);
                lst = ats.LoadAtsProfileMods(reg.Read(RegKeys.CURRENT_PROFILE));
                break;

            case "ETS":
                var ets  = new EtsLoader();
                var etsp = new EtsRegWork(true);
                prof     = new ProfileWorker();
                tmp      = ets.LoadEtsModChoice(lstAvailableMods.SelectedItem.ToString());
                profPath = etsp.Read(EtsRegKeys.ETS_GAME_MOD_FOLDER) + tmp.GetFileName();
                prof.BuildProfileList(lstAvailableMods.SelectedItem.ToString());
                SymLinks.CreateSymLink(profPath, tmp, 0);
                lst = ets.LoadEtsProfileMods(reg.Read(RegKeys.CURRENT_PROFILE));
                break;

            case "FS15":
                var fs15  = new Fs15Loader();
                var fs15P = new Fs15RegWork(true);
                tmp      = fs15.LoadFs15ModChoice(lstAvailableMods.SelectedItem.ToString());
                profPath = fs15P.Read(Fs15RegKeys.FS15_PROFILES) + reg.Read(RegKeys.CURRENT_PROFILE) + "\\" +
                           tmp.GetFileName();
                prof = new ProfileWorker();
                prof.BuildProfileList(lstAvailableMods.SelectedItem.ToString());
                SymLinks.CreateSymLink(profPath, tmp, 0);
                lst = fs15.LoadFs15ProfileMods(reg.Read(RegKeys.CURRENT_PROFILE));
                break;

            case "FS17":
                var fs17  = new Fs17Loader();
                var fs17P = new Fs17RegWork(true);
                tmp      = fs17.LoadFs17ModChoice(lstAvailableMods.SelectedItem.ToString());
                profPath = fs17P.Read(Fs17RegKeys.FS17_PROFILES) + reg.Read(RegKeys.CURRENT_PROFILE) + "\\" +
                           tmp.GetFileName();
                prof = new ProfileWorker();
                prof.BuildProfileList(lstAvailableMods.SelectedItem.ToString());
                SymLinks.CreateSymLink(profPath, tmp, 0);
                lst = fs17.LoadFs17ProfileMods(reg.Read(RegKeys.CURRENT_PROFILE));
                break;
            }

            if (lst == null)
            {
                return;
            }
            foreach (var v in lst)
            {
                lstProfileMods.Items.Add(v.Key);
            }

            CheckModCount();
            label2.Text = @"Active Mods: " + lstProfileMods.Items.Count;

            // MsgBx.Msg("Profile Link Created", "Linker");
        }
Exemplo n.º 5
0
        private void lstProfiles_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lstProfiles.SelectedItem.IsNull())
            {
                return;
            }
            var reg = new AtsRegWork(true);
            var gam = reg.Read(RegKeys.CURRENT_GAME);

            if (gam.IsNullOrEmpty())
            {
                return;
            }
            lstProfileMods.Items.Clear();
            Dictionary <string, string> lst = null;

            lblActiveProfile.Text = @"Active Profile: " + lstProfiles.SelectedItem;
            reg.Write(RegKeys.CURRENT_PROFILE, lstProfiles.SelectedItem);

            switch (gam)
            {
            case "ATS":
                var prof = new ProfileWorker();
                var ats  = new AtsLoader();
                lst = ats.LoadAtsProfileMods(lstProfiles.SelectedItem.ToString());
                prof.SetProfileActive();
                break;

            case "ETS":
                prof = new ProfileWorker();
                var ets = new EtsLoader();
                lst = ets.LoadEtsProfileMods(lstProfiles.SelectedItem.ToString());
                prof.SetProfileActive();
                break;

            case "FS15":
                prof = new ProfileWorker();
                var fs15 = new Fs15Loader();
                lst = fs15.LoadFs15ProfileMods(lstProfiles.SelectedItem.ToString());
                prof.SetProfileActive();
                break;

            case "FS17":
                prof = new ProfileWorker();
                var fs17 = new Fs17Loader();
                lst = fs17.LoadFs17ProfileMods(lstProfiles.SelectedItem.ToString());
                prof.SetProfileActive();
                lblProfiles.Text = @"Active Profiles: " + lstProfiles.Items.Count;
                break;
            }

            if (lst == null)
            {
                return;
            }
            foreach (var v in lst)
            {
                lstProfileMods.Items.Add(v.Key);
            }

            label2.Text = @"Active Mods: " + lstProfileMods.Items.Count;
        }
Exemplo n.º 6
0
        private void euroTruckSimulatorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var ldr = new EtsLoader();

            ldr.StartEts();
        }