Пример #1
0
        protected override void OnContentGUI()
        {
            if (!plugins.Any())
            {
                Complete();
            }

            GUILayout.BeginVertical(Styles.background, GUILayout.ExpandHeight(true));
            LudiqGUI.FlexibleSpace();
            GUILayout.Label($"The following plugins have been downgraded to a previous version: ", LudiqStyles.centeredLabel);
            LudiqGUI.FlexibleSpace();
            UpdateWizard.DrawPluginVersionTable(plugins);
            LudiqGUI.FlexibleSpace();
            GUILayout.Label("This will likely cause backwards incompatibility issues.", LudiqStyles.centeredLabel);
            GUILayout.Label("We recommend that you re-install their saved version to avoid data corruption.", LudiqStyles.centeredLabel);
            LudiqGUI.FlexibleSpace();

            LudiqGUI.BeginHorizontal();
            LudiqGUI.FlexibleSpace();

            if (GUILayout.Button("Close", Styles.button))
            {
                window.Close();
            }

            LudiqGUI.Space(10);

            if (GUILayout.Button("Force Consolidate", Styles.button))
            {
                var consolidationExplanation = string.Empty;
                consolidationExplanation += $"By forcing consolidation, the saved versions will be set to match the installed versions. ";
                consolidationExplanation += "This does not roll back updates and may lead to data corruption. ";
                consolidationExplanation += "You should only do this if you know what you are doing. ";
                consolidationExplanation += "A backup will be created automatically if you decide to proceed.";

                if (EditorUtility.DisplayDialog("Force Consolidate Version", consolidationExplanation, "Force Consolidate", "Cancel"))
                {
                    foreach (var plugin in plugins)
                    {
                        plugin.manifest.savedVersion = plugin.manifest.currentVersion;
                    }

                    Complete();
                }
            }

            LudiqGUI.FlexibleSpace();
            LudiqGUI.EndHorizontal();

            LudiqGUI.FlexibleSpace();
            LudiqGUI.EndVertical();
        }
        protected override void OnContentGUI()
        {
            GUILayout.BeginVertical(Styles.background, GUILayout.ExpandHeight(true));
            LudiqGUI.FlexibleSpace();

            if (plugins.All(plugin => plugin.manifest.savedVersion == plugin.manifest.currentVersion))
            {
                GUILayout.Label("All your plugins are up to date.", LudiqStyles.centeredLabel);
            }
            else
            {
                GUILayout.Label("Welcome to the plugin update wizard.", LudiqStyles.centeredLabel);
            }

            LudiqGUI.FlexibleSpace();
            UpdateWizard.DrawPluginVersionTable(plugins);
            LudiqGUI.FlexibleSpace();
            LudiqGUI.FlexibleSpace();
            LudiqGUI.BeginHorizontal();
            LudiqGUI.FlexibleSpace();

            if (plugins.Any(plugin => plugin.manifest.savedVersion != plugin.manifest.currentVersion))
            {
                if (GUILayout.Button("Start", Styles.completeButton))
                {
                    Complete();
                }
            }
            else
            {
                if (GUILayout.Button("Close", Styles.completeButton))
                {
                    window.Close();
                }
            }

            LudiqGUI.FlexibleSpace();

            LudiqGUI.EndHorizontal();

            LudiqGUI.FlexibleSpace();
            LudiqGUI.EndVertical();
        }
Пример #3
0
 private static void HookUpdateWizard()
 {
     UpdateWizard.Show();
 }