Exemplo n.º 1
0
        private async void LoadAppVersion()
        {
            var release = await ModProcessor.LoadLatestModRelease("ccir2429/AmongUsModInstaller");

            string tag = release.Tag_name;

            tag = tag.Equals(AppVersion) ? ($"{tag} - Latest") : ($"{tag} \n Consider updating to latest version!");
            this.lblAppVerTag.Text = tag;
        }
Exemplo n.º 2
0
        private async Task GetModReleaseFromGit(ModModel selectedMod)
        {
            List <ModModel> modReleases;

            try
            {
                // if selected mod has custom version skip loading assets
                ModModel selectedItem = selectedMod;
                ModModel release      = selectedItem;
                if (selectedItem.Dev_mod.Equals("Streamblox"))
                {
                    string dev = txtDev.Text;
                    string mod = txtModName.Text;

                    if (dev.Length == 0 || dev.Length == 0)
                    {
                        MessageBox.Show("Please fill in the Developer and Mod name!");
                        return;
                    }
                    selectedItem.Dev_mod = $"{dev}/{mod}";
                }
                if (!selectedItem.Is_custom_version)
                {
                    #region Load_Mod
                    //modReleases = await ModProcessor.LoadModReleases(selectedItem.Dev_mod);
                    //release = modReleases[0];
                    #endregion Load_Mod
                }

                ModProcessor.Version = release.Tag_name;
                ModProcessor.ModName = release.Name;

                #region DownloadZip_Mod
                var zipData  = release.Assets.Count > 0 ? release.Assets[0] : null;
                var fileName = $"{release.Name}#{release.Tag_name}";
                if (zipData == null)
                {
                    throw new Exception("No zip file found!");
                }
                string steamPath      = txtSteamPath.Text;
                bool   didReqDownload = ModProcessor.DownloadModRelease(zipData.Browser_download_url, fileName, steamPath);
                #endregion DownloadZip_Mod

                if (!didReqDownload)
                {
                    throw new Exception("Error while downloading content");
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Exemplo n.º 3
0
        private async Task GetModReleaseFromGit(ModModel mod)
        {
            List <ModModel> modReleases;

            try
            {
                if (ModProcessor.Processing)
                {
                    return;
                }
                ModProcessor.Processing = true;
                // if selected mod has custom version skip loading assets
                ModModel release = mod;
                if (!mod.Is_custom_version)
                {
                    release = await ModProcessor.LoadLatestModRelease(mod.Dev_mod);

                    release.Name = mod.Name;
                }

                ModProcessor.Version     = release.Tag_name;
                ModProcessor.ModName     = release.Name;
                ModProcessor.AutoStart   = chkAutoStart.Checked;
                ModProcessor.AddShortcut = chkShortcut.Checked;

                AssetModel modAsset = null;
                if (release.Assets.Count <= 0)
                {
                    throw new Exception("No assets found");
                }
                else
                {
                    #region DownloadZip_Mod
                    modAsset = release.Assets.Where(x => x.Name.Contains(".zip")).FirstOrDefault();
                    if (modAsset == null)
                    {
                        throw new Exception("No zip file found!");
                    }
                    string steamPath      = txtPath.Text;
                    bool   didReqDownload = ModProcessor.DownloadModRelease(modAsset.Browser_download_url, steamPath);
                    #endregion DownloadZip_Mod

                    if (!didReqDownload)
                    {
                        throw new Exception("Error while downloading content");
                    }
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Exemplo n.º 4
0
        private List <ModModel> GetInstallsForMod(string name)
        {
            List <ModModel> installs = new List <ModModel>();

            // Check if AULauncher folder exists
            if (!ModProcessor.CheckFolderExists())
            {
                return(installs);
            }
            // Check if mod folder exists
            if (!ModProcessor.CheckFolderExists(name))
            {
                return(installs);
            }
            // Get installed versions
            installs = ModProcessor.GetInstalledVersions(name);
            return(installs);
        }
Exemplo n.º 5
0
 private async Task <bool> IsLatestInstalled(string dev_mod)
 {
     return(await ModProcessor.IsLatestInstalled(dev_mod));
 }