private void DrawFeedbackGui(IGUIContainer window)
        {
            var position = window.Position;

            GUI.Label(new Rect(5, 5, position.width, 24), Config.FeedbackTitle);

            _feedbackMessage = GUI.TextArea(new Rect(5, 24, position.width - 10, position.height - 128),
                                            _feedbackMessage);

            if (GUI.Button(new Rect(position.width / 2 - 156, position.height - 64, 156, 64),
                           Config.FeedbackBackButtonText,
                           _targetGui.Assets.ButtonStyle))
            {
                window.DrawGuiCallback = DrawRateGui;
                window.Repaint();
                return;
            }

            if (GUI.Button(new Rect(position.width / 2 + 5, position.height - 64, 156, 64),
                           Config.FeedbackSendEmailButtonText,
                           _targetGui.Assets.ButtonStyle))
            {
                Email();
                window.Close();
                return;
            }

            window.Repaint();
        }
Example #2
0
        private void OnWindowGui(IGUIContainer window)
        {
            if (!_isLoaded || EditorApplication.isCompiling)
            {
                DrawUnavailableState(window.Position);
                return;
            }

            DrawSearchBar();
            DrawMenuBar();
            DrawItems();
            DrawSupportBar();
        }
Example #3
0
        private void DrawCrashReporterGui(IGUIContainer window)
        {
            const float buttonWidth  = 200;
            const float buttonHeight = 64;

            var position = window.Position;

            GUI.Label(new Rect(5, 5, position.width, 28), "Something bad happened", _targetGui.Assets.LabelStyle);

            var rect = new Rect(5, 40, position.width - 10, position.height - buttonHeight - 40 - 10);

            //GUI.Box(rect, _targetGui.Assets.BoxContent);
            _scrollPosition = GUI.BeginScrollView(rect, _scrollPosition, new Rect(0, 0, rect.width, 1000), false, true);

            GUI.Label(new Rect(0, 0, rect.width, 1000), _result, _targetGui.Assets.LabelErrorStyle);
            GUI.EndScrollView();

            if (GUI.Button(new Rect(position.width / 2 - buttonWidth, position.height - buttonHeight, buttonWidth, buttonHeight),
                           "Don't Show Again",
                           _targetGui.Assets.ButtonStyle))
            {
                Logs.Config.DontShowAgain = true;
                Logs.Save(_assetsDirectory);
                window.Close();
                return;
            }

            if (GUI.Button(new Rect(position.width / 2 + 5, position.height - buttonHeight, buttonWidth, buttonHeight),
                           "Send Report",
                           _targetGui.Assets.ButtonStyle))
            {
                Email();
                Logs.Lines.Clear();
                Logs.Save(_assetsDirectory);
                window.Close();
                return;
            }

            window.Repaint();
        }
Example #4
0
        private void DrawRateGui(IGUIContainer window)
        {
            var position = window.Position;

            var height    = (position.height - SizeStar) * 0.5f;
            var rectUpper = new Rect(0, 0, position.width, height);

            GUI.Label(rectUpper, Config.RequestLabel, _targetGui.Assets.LabelStyle);

            var offsetX = (position.width / Config.MaxStar - SizeStar) * 0.5f;
            var rect    = new Rect(0, height, SizeStar, SizeStar);

            for (var i = 0; i < Config.MaxStar; i++)
            {
                rect.x       += offsetX;
                _starRects[i] = rect;

                if (GUI.Button(_starRects[i], string.Empty, _targetGui.Assets.StarStyles[i]))
                {
                    _starsCount = i + 1;
                    SetCountStar(_starsCount);
                    return;
                }

                rect.x += SizeStar + offsetX;
            }

            if (GUI.Button(new Rect((position.width - 128) / 2, position.height - 64, 128, 64), Config.RateButtonText,
                           _targetGui.Assets.ButtonStyle))
            {
                if (_starsCount <= Config.MinStar)
                {
                    window.DrawGuiCallback = DrawFeedbackGui;
                    window.Repaint();
                    return;
                }

                if (!string.IsNullOrEmpty(Config.RateOptionalUrl))
                {
                    var ok = EditorUtility.DisplayDialog("Please take a look", Config.RateOptionalMessage,
                                                         Config.RateMainButtonText, Config.RateOptionalButtonText);
                    if (ok)
                    {
                        Application.OpenURL(Config.RateMainUrl);
                    }
                    else
                    {
                        Application.OpenURL(Config.RateOptionalUrl);
                    }
                }
                else
                {
                    Application.OpenURL(Config.RateMainUrl);
                }

                window.Close();
                return;
            }

            if (Event.current.type == EventType.Repaint)
            {
                var countStar = _starsCount;

                for (var i = 0; i < Config.MaxStar; i++)
                {
                    if (_starRects[i].Contains(Event.current.mousePosition))
                    {
                        countStar = i + 1;
                    }
                }

                SetCountStar(countStar);
            }

            window.Repaint();
        }
Example #5
0
 private void OnWindowClosed(IGUIContainer window)
 {
     SavePrefs();
 }
Example #6
0
 private void OnWindowLostFocus(IGUIContainer window)
 {
     SavePrefs();
 }
Example #7
0
 private void OnWindowFocus(IGUIContainer window)
 {
     _prefs.PreviousFilterString = _prefs.FilterString;
     SetFilteredItems(_prefs.FilterString);
     window.Repaint();
 }