Exemplo n.º 1
0
        private void    ClearException()
        {
            this.fullError = this.workingException.ToString();

            int hash = this.fullError.GetHashCode();

            this.exception        = null;
            this.workingException = null;

            if (this.lastExceptionHash == hash)
            {
                ++this.clearRetry;
            }
            else
            {
                this.lastExceptionHash = hash;
                this.clearRetry        = 1;
            }

            if (this.clearRetry == 3)
            {
                if (EditorUtility.DisplayDialog(Constants.PackageTitle, "It seems that the error is redundant.\nPlease contact the author to improve stability and your brain sanity. :)", "Contact the author", "OK") == true)
                {
                    ContactFormWizard.Open(ContactFormWizard.Subject.BugReport, "Exception raised :\n" + this.fullError);
                }
            }
        }
Exemplo n.º 2
0
        protected virtual void  OnGUI()
        {
            if (GUILayout.Button("Contact the author") == true)
            {
                ContactFormWizard.Open(ContactFormWizard.Subject.Support, this.result);
            }

            Rect r = this.position;

            r.x       = 0F;
            r.y       = 20F;
            r.height -= 20F;

            Utility.content.text = this.result;
            float minHeight = GUI.skin.textArea.CalcHeight(Utility.content, r.width);

            this.scrollPosition = GUILayout.BeginScrollView(this.scrollPosition);
            {
                EditorGUILayout.SelectableLabel(this.result, GUI.skin.textArea,
                                                new GUILayoutOption[]
                {
                    GUILayoutOptionPool.ExpandWidthTrue,
                    GUILayoutOptionPool.ExpandHeightTrue,
                    GUILayout.MinHeight(minHeight),
                }
                                                );
            }
            GUILayout.EndScrollView();
        }
Exemplo n.º 3
0
        public static void      Open(Subject subject, string tool, string complementaryInformation)
        {
            ScriptableWizard.GetWindow <ContactFormWizard>().Close();
            ContactFormWizard wizard = ScriptableWizard.DisplayWizard <ContactFormWizard>(Constants.PackageTitle);

            wizard.subject = subject;
            wizard.complementaryInformation = complementaryInformation;
            wizard.specificTools            = tool;
        }
Exemplo n.º 4
0
        protected virtual void  OnGUI()
        {
            if (UnityAssemblyVerifier.cachedMissing == null)
            {
                if (UnityAssemblyVerifier.missing.Count > 0)
                {
                    StringBuilder buffer = Utility.GetBuffer();

                    for (int i = 0; i < UnityAssemblyVerifier.missing.Count; i++)
                    {
                        if (buffer.Length > 0)
                        {
                            buffer.AppendLine();
                        }
                        buffer.AppendLine(UnityAssemblyVerifier.missing[i].Key);
                        buffer.AppendLine(UnityAssemblyVerifier.missing[i].Value);
                    }

                    buffer.Length -= Environment.NewLine.Length;

                    UnityAssemblyVerifier.cachedMissing = Utility.ReturnBuffer(buffer);
                }
                else
                {
                    UnityAssemblyVerifier.cachedMissing = string.Empty;
                }
            }

            EditorGUILayout.HelpBox(Constants.PackageTitle + " has detected a change in Unity code. Please contact the author.", MessageType.Error);

            if (GUILayout.Button("Contact the author") == true)
            {
                ContactFormWizard.Open(ContactFormWizard.Subject.BugReport, "The following metadata are missing :" + Environment.NewLine + UnityAssemblyVerifier.cachedMissing);
            }

            if (GUILayout.Button("Don't show the message again") == true)
            {
                NGEditorPrefs.SetBool(UnityAssemblyVerifier.SkipWarningPrefKey, true);
                this.Close();
            }

            GUILayout.Label("The following metadata are missing :");
            EditorGUILayout.TextArea(UnityAssemblyVerifier.cachedMissing);
        }
Exemplo n.º 5
0
        public override void    OnGUI(Rect r)
        {
            float w = r.width;

            r.height = ErrorPopup.Height;
            EditorGUI.HelpBox(r, "Please contact the author and send the following error :", MessageType.Info);

            r.width  = 120F;
            r.x      = w - r.width - 5F;
            r.y     += 5F;
            r.height = ErrorPopup.Height - 10F;
            if (GUI.Button(r, "Contact the author") == true)
            {
                ContactFormWizard.Open(ContactFormWizard.Subject.BugReport, "Exception raised :\n" + this.fullError);
            }

            r.x      = 0F;
            r.y     += r.height + 5F;
            r.height = this.size.y - ErrorPopup.Height;
            r.width  = w;
            EditorGUI.TextField(r, this.fullError);
        }
Exemplo n.º 6
0
 public static void      Open(Subject subject)
 {
     ContactFormWizard.Open(subject, string.Empty, string.Empty);
 }
Exemplo n.º 7
0
 public static void      Open(Subject subject, string complementaryInformation)
 {
     ContactFormWizard.Open(subject, string.Empty, complementaryInformation);
 }
Exemplo n.º 8
0
        protected virtual void  OnGUI()
        {
            GUILayout.Label(Constants.PackageTitle, GeneralStyles.MainTitle);

            GUILayout.Label("Version " + Constants.Version);

            GUILayout.FlexibleSpace();

            Rect r = GUILayoutUtility.GetRect(this.position.width, 150F);

            r.width  = r.width * .5F - 5F;
            r.height = r.height * .33F - 5F;
            r.x     += 3.33F;
            r.y     += 5F;

            if (GUI.Button(r, Preferences.DiscordContent, GeneralStyles.BigButton) == true)
            {
                Application.OpenURL(Constants.DiscordURL);
            }

            r.y += r.height + 5F;

            if (GUI.Button(r, Preferences.TwitterContent, GeneralStyles.BigButton) == true)
            {
                Application.OpenURL(Constants.TwitterURL);
            }

            r.y += r.height + 5F;

            if (GUI.Button(r, Preferences.UnityForumContent, GeneralStyles.BigButton) == true)
            {
                Application.OpenURL(Constants.SupportForumUnityThread);
            }

            r.x += r.width + 3.33F;

            if (GUI.Button(r, LC.G("Preferences_Contact"), GeneralStyles.BigButton) == true)
            {
                ContactFormWizard.Open(ContactFormWizard.Subject.Contact);
            }

            r.y -= r.height + 5F;

            if (GUI.Button(r, "Bit Bucket", GeneralStyles.BigButton) == true)
            {
                Application.OpenURL(Constants.TicketURL);
            }

            r.y -= r.height + 5F;

            if (GUI.Button(r, "Documentation", GeneralStyles.BigButton) == true)
            {
                Application.OpenURL(Constants.WikiBaseURL);
            }

            r.height = 20F;
            r.y     -= r.height + 5F;

            r.xMin -= 50F;
            if (GUI.Button(r, "Help with a review!") == true)
            {
                List <HQ.ToolAssemblyInfo> licensedTools = new List <HQ.ToolAssemblyInfo>();

                foreach (HQ.ToolAssemblyInfo tool in HQ.EachTool)
                {
                    if (NGLicensesManager.IsLicenseValid(tool.name) == true)
                    {
                        licensedTools.Add(tool);
                    }
                }

                if (licensedTools.Count == 0)
                {
                    if (NGLicensesManager.IsPro() == true)
                    {
                        Application.OpenURL(Constants.AssetStoreNGToolsProURL);
                    }
                    else
                    {
                        Application.OpenURL(Constants.AssetStoreNGToolsFreeURL);
                    }
                }
                else
                {
                    licensedTools.Insert(0, new HQ.ToolAssemblyInfo()
                    {
                        name = "NG Tools Free", assetStoreBuyLink = Constants.AssetStoreNGToolsFreeURL
                    });
                    PopupWindow.Show(r, new PreviewVersionsBackupPopup(licensedTools));
                }
            }

            r.y -= r.height + 5F;

            r.xMin = 220F;
            if (GUI.Button(r, "Change Log") == true)
            {
                Application.OpenURL(Constants.ChangeLogURL);
            }
        }
Exemplo n.º 9
0
        protected virtual void  OnGUI()
        {
            GUILayout.Label(@"In order to get full power from NG Tools, you need to activate licenses to remove limitations.

An ""NG Tools Pro"" license will remove all limitations.

Any other license will grant full power to only the tool that it is related.");

            GUILayout.Space(15F);

            GUILayout.Label("1. Get the invoice.", GeneralStyles.Title1);

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label("Go to your Order History in the Asset Store.");

                if (GUILayout.Button("Go to Asset Store orders") == true)
                {
                    Help.BrowseURL("https://assetstore.unity.com/orders");
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Label("Top-right corner picture in the Asset Store, then \"<b>My Orders</b>\".", GeneralStyles.RichLabel);

            GUILayout.Space(10F);

            GUILayout.Label("Find your purchase line, then look for column \"<b>Invoice Number</b>\".", GeneralStyles.RichLabel);
            GUILayout.Label(@"It might be empty, Unity can require time to generate it.
If it is not appearing, please contact them directly.");

            GUILayout.Space(10F);

            GUILayout.Label("If you urgently need the license to work, contact me through the following medium:");

            EditorGUILayout.BeginHorizontal();
            {
                if (GUILayout.Button(Preferences.DiscordContent, GeneralStyles.BigButton, GUILayoutOptionPool.Height(40F)) == true)
                {
                    Application.OpenURL(Constants.DiscordURL);
                }

                if (GUILayout.Button(Preferences.UnityForumContent, GeneralStyles.BigButton, GUILayoutOptionPool.Height(40F)) == true)
                {
                    Application.OpenURL(Constants.SupportForumUnityThread);
                }

                if (GUILayout.Button(LC.G("Preferences_Contact"), GeneralStyles.BigButton, GUILayoutOptionPool.Height(40F)) == true)
                {
                    ContactFormWizard.Open(ContactFormWizard.Subject.Contact);
                }
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(10F);

            GUILayout.Label("2. Check invoice.", GeneralStyles.Title1);

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label("Go back to Preferences > NG Tools > Licenses.");

                if (GUILayout.Button("Go") == true)
                {
                    Utility.ShowPreferencesWindowAt(Constants.PackageTitle, "Licenses");
                    Preferences.tab = Preferences.Tab.Licenses;
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label("Write your invoice in the input at the bottom and add it.");

                if (GUILayout.Button("Highlight") == true)
                {
                    Utility.ShowPreferencesWindowAt(Constants.PackageTitle, "Licenses");
                    Preferences.tab = Preferences.Tab.Licenses;
                    XGUIHighlightManager.Highlight(Preferences.Title + ".AddInvoice");
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label(@"Then you need to check it, to ensure NG Tools recognizes it as a valid license.");

                if (GUILayout.Button("Highlight") == true)
                {
                    Utility.ShowPreferencesWindowAt(Constants.PackageTitle, "Licenses");
                    Preferences.tab = Preferences.Tab.Licenses;

                    bool hasUncheckedLicense = false;

                    foreach (License i in NGLicenses.NGLicensesManager.EachInvoices())
                    {
                        if (i.status == Status.Unknown)
                        {
                            hasUncheckedLicense = true;
                            break;
                        }
                    }

                    if (hasUncheckedLicense == true)
                    {
                        XGUIHighlightManager.Highlight(Preferences.Title + ".CheckLicense");
                    }
                    else
                    {
                        EditorUtility.DisplayDialog(Constants.PackageTitle, "You must first add invoice prior to check it.", "OK");
                    }
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(10F);

            GUILayout.Label("3. Activate license.", GeneralStyles.Title1);

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label(@"If the license is valid, its associated asset will be displayed.
Otherwise, it will show ""Invalid"" in grey letters.
Now you can activate it.");

                if (GUILayout.Button("Highlight") == true)
                {
                    Utility.ShowPreferencesWindowAt(Constants.PackageTitle, "Licenses");
                    Preferences.tab = Preferences.Tab.Licenses;

                    bool hasValidLicense = false;

                    foreach (License i in NGLicenses.NGLicensesManager.EachInvoices())
                    {
                        if (i.status == Status.Valid)
                        {
                            hasValidLicense = true;
                            break;
                        }
                    }

                    if (hasValidLicense == true)
                    {
                        XGUIHighlightManager.Highlight(Preferences.Title + ".ActivateLicense");
                    }
                    else
                    {
                        EditorUtility.DisplayDialog(Constants.PackageTitle, "You must first check an invoice prior to validate it.", "OK");
                    }
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(10F);

            GUILayout.Label("4. Manage seats.", GeneralStyles.Title1);

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label(@"You can verifiy seats associated with your licenses.
And revoke them as it fits you.");

                if (GUILayout.Button("Highlight") == true)
                {
                    Utility.ShowPreferencesWindowAt(Constants.PackageTitle, "Licenses");
                    Preferences.tab = Preferences.Tab.Licenses;

                    bool hasValidLicense = false;

                    foreach (License i in NGLicenses.NGLicensesManager.EachInvoices())
                    {
                        if (i.status == Status.Valid)
                        {
                            hasValidLicense = true;
                            break;
                        }
                    }

                    if (hasValidLicense == true)
                    {
                        XGUIHighlightManager.Highlight(Preferences.Title + ".CheckSeats");
                    }
                    else
                    {
                        EditorUtility.DisplayDialog(Constants.PackageTitle, "You must first check an invoice prior to manage its seats.", "OK");
                    }
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label(@"If you are encountering issues with seats, please contact me directly.

If you require a license without the 2 seats limitation, please contact me directly.");

                if (GUILayout.Button(LC.G("Preferences_Contact"), GUILayoutOptionPool.ExpandHeightTrue) == true)
                {
                    ContactFormWizard.Open(ContactFormWizard.Subject.Contact);
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(5F);

            EditorGUILayout.HelpBox("A license is an invoice.", MessageType.Info);
            EditorGUILayout.HelpBox("You can activate a license on 2 seats maximum! \"2 seats\" means 2 computers, implying many projects on those 2 computers, as much as you want.", MessageType.Info);

            if (this.preferencesWindow != null)
            {
                this.preferencesWindow.Repaint();
            }
        }