Beispiel #1
0
            public static void Open()
            {
                ChangelogWindow editorWindow = GetWindow <ChangelogWindow>(true, AssetInfo.ASSET_NAME + " - Changelog", true);

                editorWindow.position = new Rect((Screen.currentResolution.width / 2f) - (width * 0.5f), (Screen.currentResolution.height / 2f) - (height * 0.5f), width, height);

                editorWindow.Init();
                editorWindow.Show();
            }
Beispiel #2
0
 private void Changelog_Click(object sender, RoutedEventArgs e)
 {
     if (VersionHandler.Instance.VersionResult.Tool.Changelog != null)
     {
         ChangelogWindow changelogWindow = new ChangelogWindow();
         changelogWindow.ShowDialog();
     }
     else
     {
         App.Instance.ShowError("Changelog not retrieved", "The changelog has not been retrieved from DevilDaggers.info.");
     }
 }
        public async Task Run(bool downloadPrerelease, ChangelogWindow changelogWindow)
        {
            // GitHub requires TLS 1.2, we need to hardcode this for Windows 7
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

            var url = "https://kamori.goats.dev/Proxy/Update";

            if (downloadPrerelease)
            {
                url += "/Prerelease";
            }
            else
            {
                url += "/Release";
            }

            try
            {
                ReleaseEntry newRelease = null;

                using (var updateManager = new UpdateManager(url, "XIVLauncher"))
                {
                    // TODO: is this allowed?
                    SquirrelAwareApp.HandleEvents(
                        onInitialInstall: v => updateManager.CreateShortcutForThisExe(),
                        onAppUpdate: v => updateManager.CreateShortcutForThisExe(),
                        onAppUninstall: v => updateManager.RemoveShortcutForThisExe());

                    var a = await updateManager.CheckForUpdate();

                    newRelease = await updateManager.UpdateApp();
                }

                if (newRelease != null)
                {
                    if (changelogWindow == null)
                    {
                        Log.Error("changelogWindow was null");
                        UpdateManager.RestartApp();
                        return;
                    }

                    try
                    {
                        changelogWindow.Dispatcher.Invoke(() =>
                        {
                            changelogWindow.UpdateVersion(newRelease.Version.ToString());
                            changelogWindow.Show();
                            changelogWindow.Closed += (_, _) =>
                            {
                                UpdateManager.RestartApp();
                            };
                        });

                        OnUpdateCheckFinished?.Invoke(false);
                    }
                    catch (Exception ex)
                    {
                        Log.Error(ex, "Could not show changelog window");
                        UpdateManager.RestartApp();
                    }
                }
#if !XL_NOAUTOUPDATE
                else
                {
                    OnUpdateCheckFinished?.Invoke(true);
                }
#endif
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Update failed");
                CustomMessageBox.Show(Loc.Localize("updatefailureerror", "XIVLauncher failed to check for updates. This may be caused by connectivity issues to GitHub. Wait a few minutes and try again.\nDisable your VPN, if you have one. You may also have to exclude XIVLauncher from your antivirus.\nIf this continues to fail after several minutes, please check out the FAQ."),
                                      "XIVLauncher",
                                      MessageBoxButton.OK,
                                      MessageBoxImage.Error, showOfficialLauncher: true);
                System.Environment.Exit(1);
            }

            // Reset security protocol after updating
            ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault;
        }
Beispiel #4
0
        void DrawInstallation()
        {
            //Testing
            //AssetInfo.compatibleVersion = false;
            //AssetInfo.alphaVersion = true;
            //AssetInfo.IS_UPDATED = false;

            Texture2D dot = null;

            if (AssetInfo.compatibleVersion && !AssetInfo.alphaVersion)
            {
                dot = UI.Styles.SmallGreenDot;
            }
            if (AssetInfo.alphaVersion || !AssetInfo.IS_UPDATED)
            {
                dot = UI.Styles.SmallOrangeDot;
            }
            if (!AssetInfo.compatibleVersion)
            {
                dot = UI.Styles.SmallRedDot;
            }

            EditorGUILayout.LabelField(new GUIContent(" Installation", dot), UI.Styles.Tab);

            using (new EditorGUILayout.VerticalScope(UI.Styles.Section))
            {
                if (EditorApplication.isCompiling)
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField(new GUIContent(" Compiling scripts...", EditorGUIUtility.FindTexture("cs Script Icon")), UI.Styles.Header);
                    EditorGUILayout.Space();
                    return;
                }

                Color defaultColor = GUI.contentColor;

                if (AssetInfo.compatibleVersion == false)
                {
                    UI.DrawNotification("This version of Unity is not supported.", MessageType.Error);
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("Please upgrade to at least Unity " + AssetInfo.MIN_UNITY_VERSION);
                    return;
                }

                //Version
                using (new EditorGUILayout.HorizontalScope())
                {
                    EditorGUILayout.LabelField("Version " + AssetInfo.INSTALLED_VERSION);

                    using (new EditorGUILayout.HorizontalScope(EditorStyles.textField))
                    {
                        if (AssetInfo.IS_UPDATED)
                        {
                            GUI.contentColor = Color.green;
                            EditorGUILayout.LabelField("Latest");
                            GUI.contentColor = defaultColor;
                        }
                        else
                        {
                            GUI.contentColor = new Color(1f, 0.65f, 0f);
                            EditorGUILayout.LabelField("Outdated", EditorStyles.boldLabel);
                            GUI.contentColor = defaultColor;
                        }

                        GUILayout.Space(-100f);
                        if (GUILayout.Button("View changelog"))
                        {
                            ChangelogWindow.Open();
                        }
                    }
                }

                UI.DrawNotification(!AssetInfo.IS_UPDATED, "Asset can be updated through the Package Manager", "Open", () => AssetInfo.OpenStorePage());

                //Unity version
                using (new EditorGUILayout.HorizontalScope())
                {
                    EditorGUILayout.LabelField("Unity " + AssetInfo.VersionChecking.GetUnityVersion());

                    using (new EditorGUILayout.HorizontalScope(EditorStyles.textField))
                    {
                        if (AssetInfo.compatibleVersion && !AssetInfo.alphaVersion)
                        {
                            GUI.contentColor = Color.green;
                            EditorGUILayout.LabelField("Compatible");
                            GUI.contentColor = defaultColor;
                        }
                        if (AssetInfo.alphaVersion)
                        {
                            GUI.contentColor = new Color(1f, 0.65f, 0f);
                            EditorGUILayout.LabelField("Alpha/beta", EditorStyles.boldLabel);
                            GUI.contentColor = defaultColor;
                        }
                    }
                }

                UI.DrawNotification(AssetInfo.alphaVersion, "Only release Unity versions are subject to support and fixes. You may run into issues at own risk.", MessageType.Warning);

                //Mobile only
                if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android || EditorUserBuildSettings.activeBuildTarget == BuildTarget.iOS)
                {
                    using (new EditorGUILayout.HorizontalScope())
                    {
                        EditorGUILayout.LabelField("Target graphics API");

                        using (new EditorGUILayout.HorizontalScope(EditorStyles.textField))
                        {
                            if (PlayerSettings.GetGraphicsAPIs(BuildTarget.Android)[0] != UnityEngine.Rendering.GraphicsDeviceType.OpenGLES2 || PlayerSettings.GetGraphicsAPIs(BuildTarget.iOS)[0] != UnityEngine.Rendering.GraphicsDeviceType.OpenGLES2)
                            {
                                GUI.contentColor = Color.green;
                                EditorGUILayout.LabelField("OpenGL ES 3.0+");
                                GUI.contentColor = defaultColor;
                            }
                            else
                            {
                                GUI.contentColor = Color.red;
                                EditorGUILayout.LabelField("OpenGL ES 2.0 (Not supported)", EditorStyles.boldLabel);
                                GUI.contentColor = defaultColor;
                            }
                        }
                    }
                }

                EditorGUILayout.Separator();

                EditorGUILayout.LabelField("Third-party integrations", EditorStyles.boldLabel);

                using (new EditorGUILayout.HorizontalScope())
                {
                    EditorGUILayout.LabelField("Dynamic Water Physics 2");

                    using (new EditorGUILayout.HorizontalScope(EditorStyles.textField))
                    {
                        EditorGUILayout.LabelField(StylizedWaterEditor.DWP2.isInstalled ? "Installed" : "Not Installed", GUILayout.MaxWidth((75f)));
                        GUILayout.FlexibleSpace();

                        using (new EditorGUI.DisabledScope(!StylizedWaterEditor.DWP2.isInstalled || StylizedWaterEditor.DWP2.dataProviderUnlocked))
                        {
                            if (GUILayout.Button("Install integration"))
                            {
                                StylizedWaterEditor.DWP2.UnlockDataProvider();
                                StylizedWaterEditor.DWP2.CheckInstallation();
                            }
                        }
                    }
                }

                using (new EditorGUILayout.HorizontalScope())
                {
                    EditorGUILayout.LabelField("Fog integration");

                    using (new EditorGUILayout.HorizontalScope())
                    {
                        fogConfig = (ShaderConfigurator.FogConfiguration)EditorGUILayout.EnumPopup(fogConfig);
                        if (GUILayout.Button("Change"))
                        {
                            ShaderConfigurator.SetFogConfiguration(fogConfig);
                            fogConfig = ShaderConfigurator.CurrentFogConfiguration;
                        }
                    }
                }
            }
        }
Beispiel #5
0
 public static void OpenWindow()
 {
     Singleton = GetWindow <ChangelogWindow>();
     Singleton.titleContent = new GUIContent("CHANGELOG");
     Singleton.Show();
 }