Exemplo n.º 1
0
        public static async void getTheOtherRoles(dynamic mainWindow)
        {
#if DEBUG
            Properties.Settings.Default.ReleaseId = null;
            Properties.Settings.Default.GamePath  = null;
            Properties.Settings.Default.Save();
#endif
            dynamic json = await ModFunctions.getModData(projectApi);

            downloadUrl      = json.assets[0].browser_download_url;
            releaseName      = json.name;
            currentReleaseId = json.assets[0].id.ToString();

            if (string.IsNullOrWhiteSpace(Properties.Settings.Default.ReleaseId))
            {
                mainWindow.buttonHomeInstall.Visible = true;
                mainWindow.buttonHomeStart.Visible   = false;
                mainWindow.buttonHomeUpdate.Visible  = false;
            }
            else if (Properties.Settings.Default.ReleaseId == currentReleaseId)
            {
                mainWindow.buttonHomeInstall.Visible = false;
                mainWindow.buttonHomeStart.Visible   = true;
                mainWindow.buttonHomeUpdate.Visible  = false;
            }
            else
            {
                mainWindow.buttonHomeInstall.Visible = false;
                mainWindow.buttonHomeStart.Visible   = false;
                mainWindow.buttonHomeUpdate.Visible  = true;
            }
        }
        public async static Task <string> checkVersionsUpdate(dynamic mainWindow)
        {
            dynamic json = await ModFunctions.getModData(projectUrl);

            if (Application.ProductVersion != json.tag_name.ToString().Replace("v", ""))
            {
                mainWindow.newVersionButton.Visible = true;
                return(json.assets[0].browser_download_url);
            }
            return(null);
        }