Esempio n. 1
0
        void DrawVisiblePanes()
        {
            EditorGUILayout.BeginScrollView(Vector2.zero);
            {
                if (HardlightPanes != null && HardlightPanes.Count > 0)
                {
                    //NSEditorStyles.DrawLabel("We have " + HardlightPanes.Count);
                    //Draw each of the active panes
                    for (int i = 0; i < HardlightPanes.Count; i++)
                    {
                        //NSEditorStyles.DrawLabel("Inside For Loop");
                        if (HardlightPanes[i] != null)
                        {
                            //NSEditorStyles.DrawLabel("i Not Null");
                            if (HardlightPanes[i].ShouldDisplay)
                            {
                                //NSEditorStyles.DrawLabel("Attempt Draw Pane ");
                                HardlightPanes[i].DrawPane();
                                NSEditorStyles.DrawDivider();
                            }
                        }
                        //else
                        //{
                        //	NSEditorStyles.DrawLabel("HardlightPanes[i] is null");

                        //}
                    }
                }
            }
            EditorGUILayout.EndScrollView();
        }
Esempio n. 2
0
        void DrawTitleSection()
        {
            EditorGUILayout.BeginHorizontal();

            EditorGUILayout.BeginVertical();
            NSEditorStyles.DrawTitle(new GUIContent(" Hardlight Editor"));
            EditorGUILayout.EndVertical();
            //NSEditorStyles.DrawLabel("   v" + NSManager.GetPluginVersionInfo().ToString());

            NSEditorStyles.DrawButton("Plugin v" + NSManager.GetPluginVersionInfo().ToString());
            if (NSEditorStyles.DrawButton(NSEditorStyles.CompactMode ? "Feedback" : "Send Feedback"))
            {
                Application.OpenURL(FeedbackLink);
            }
            if (NSEditorStyles.DrawButton(NSEditorStyles.CompactMode ? "Docs" : "Documentation"))
            {
                Application.OpenURL(DocumentationLink);
            }
            if (NSEditorStyles.DrawButton(NSEditorStyles.CompactMode ? "+" : "Compact Mode"))
            {
                NSEditorStyles.CompactMode = !NSEditorStyles.CompactMode;
            }
            EditorGUILayout.EndHorizontal();

            //NSEditorStyles.DrawLabel("Holy Crap Dividers!");
            //NSEditorStyles.DrawDivider(1);
            //NSEditorStyles.DrawLabel("In different styles!");
            //NSEditorStyles.DrawDivider(3);
            //NSEditorStyles.DrawLabel("Sizes!");
            //NSEditorStyles.DrawDivider(NSEditorStyles.ColorBoxType.Error, 8);
            //NSEditorStyles.DrawLabel("And colors!");
            //NSEditorStyles.DrawDivider(NSEditorStyles.ColorBoxType.Black, 4);
            //NSEditorStyles.DrawDivider(NSEditorStyles.ColorBoxType.Tutorial, 8);
        }
Esempio n. 3
0
        void DrawPaneTabs()
        {
            if (DebugHardlightEditor)
            {
                NSEditorStyles.DrawLabel("Active Tab:" + (ActiveTab == null ? "Null Active Tab" : ActiveTab.GetType().ToString()));
            }

            //Draw horizontal row(s) of tab buttons.
            GUILayout.BeginHorizontal();
            if (HardlightPanes != null && HardlightPanes.Count > 0)
            {
                for (int i = 0; i < HardlightPanes.Count; i++)
                {
                    if (HardlightPanes[i] != null)
                    {
                        //if (HardlightPanes[i].Visible)
                        //{
                        bool Result = HardlightPanes[i].DrawTabButton(HardlightPanes[i].ShouldDisplay);

                        //Controls showing only one at a time.
                        if (Result)
                        {
                            SetActiveTab(HardlightPanes[i]);
                        }
                        //}
                    }
                    //NSEditorStyles.OperationToolbarButton(false, new GUIContent("ShortPaneTitle"));
                    //NSEditorStyles.OperationToolbarButton(false, new GUIContent("ShortPaneTitle"));
                }
            }
            GUILayout.EndHorizontal();
        }
Esempio n. 4
0
        public virtual void DrawPaneContent()
        {
            IsTutorialStep(2, () =>
            {
                NSEditorStyles.DrawLabel("A tutorial's content can even jump around and be out of order with the code order!");
            });


            NSEditorStyles.DrawLabel("This is text");


            IsTutorialStep(0, () =>
            {
                NSEditorStyles.DrawLabel("Welcome to a tutorial");
            });
            IsTutorialStep(1, () =>
            {
                NSEditorStyles.DrawLabel("A tutorial can contain much content");
            });
            IsTutorialStep(2, () =>
            {
                GUILayout.Space(20);
                NSEditorStyles.DrawLabel("Divided up amongst multiple entries.");
            });


            IsTutorialStep(3, () =>
            {
                NSEditorStyles.DrawLabel("Isn't that cool!");
            });

            NSEditorStyles.DrawLabel("This is ending text");
        }
Esempio n. 5
0
 private void DrawWalkthroughButton(string text)
 {
     if (NSEditorStyles.TutorialToolbarButton(false, text))
     {
         TutorialModeActive   = true;
         CurrentTutorialIndex = 0;
     }
 }
Esempio n. 6
0
        void OnGUI()
        {
            //NSVR.NSVR_Plugin.GetPluginVersion();
            //Initialize if we aren't initialized
            CheckIfInvalidSetup();

            NSEditorStyles.DrawBackgroundImage(icon, mat, this);

            DrawHardlightEditor();
        }
Esempio n. 7
0
        public virtual bool DrawTabButton(bool maintainPressed)
        {
            bool result = NSEditorStyles.OperationToolbarButton(false, new GUIContent(ShortPaneTitle), maintainPressed);

            if (result)
            {
                ShouldDisplay = !ShouldDisplay;
            }

            //Debug.Log(GetType().ToString() + "   " + ShouldDisplay + "\n");
            return(ShouldDisplay);
        }
Esempio n. 8
0
        /// <summary>
        /// Draws the actual tutorial box content.
        /// Does not check if it should or shouldn't display. Call IsTutorialStep instead.
        /// </summary>
        /// <param name="StepDelegate">The content to execute when this tutorial box is displayed</param>
        /// <param name="tutorialStepNumber">-1 will not show step number information</param>
        public void TutorialStepBox(TutorialStepDelegate StepDelegate, int tutorialStepNumber = -1, ColorBoxType boxType = ColorBoxType.Tutorial)
        {
            EditorGUILayout.BeginVertical("Box");
            EditorGUILayout.BeginVertical(NSEditorStyles.GetColoredHelpBoxStyle(boxType));
            StepDelegate();
            if (tutorialStepNumber != -1)
            {
                EditorGUILayout.BeginHorizontal();
                NSEditorStyles.DrawLabel("[" + tutorialStepNumber + "]");
                EditorGUILayout.EndHorizontal();
            }

            EditorGUILayout.EndVertical();
            EditorGUILayout.EndVertical();
        }
Esempio n. 9
0
        /// <summary>
        /// This function ALWAYS calls the StepDelegate, but highlights the Delegate Element when told too.
        /// Will not highlight outside of tutorial mode
        /// </summary>
        /// <param name="shouldHighlight"></param>
        /// <param name="StepDelegate"></param>
        /// <param name="boxType"></param>
        public void TutorialHighlight(bool shouldHighlight, TutorialStepDelegate StepDelegate, ColorBoxType boxType = ColorBoxType.Tutorial)
        {
            if (shouldHighlight && TutorialModeActive)
            {
                //EditorGUILayout.BeginVertical("Box");
                EditorGUILayout.BeginVertical(NSEditorStyles.GetColoredHelpBoxStyle(boxType));
            }

            StepDelegate();

            if (shouldHighlight && TutorialModeActive)
            {
                //EditorGUILayout.EndVertical();
                EditorGUILayout.EndVertical();
            }
        }
Esempio n. 10
0
        private void DrawTutorialButtons()
        {
            //GUILayout.Space(4);
            NSEditorStyles.DrawTitle("Tutorial", 0);
            NSEditorStyles.OpenHorizontal();

            //Draw a back button
            if (NSEditorStyles.TutorialToolbarButton(CurrentTutorialIndex <= 0, "Previous"))
            {
                //Decrement the current tutorial index
                CurrentTutorialIndex--;
            }

            //Draw a restart button
            if (NSEditorStyles.TutorialToolbarButton(CurrentTutorialIndex <= 0, "Restart"))
            {
                //Set the tutorial index back to 0.
                CurrentTutorialIndex = 0;
            }

            if (CurrentTutorialIndex > LargestTutorialIndex - 1)
            {
                //Draw a finish button
                if (NSEditorStyles.TutorialToolbarButton(false, "Finish!"))
                {
                    //Increment the current tutorial index
                    TutorialModeActive = false;
                }
            }
            else
            {
                //Draw a next button
                if (NSEditorStyles.TutorialToolbarButton(CurrentTutorialIndex > LargestTutorialIndex - 1, "Next"))
                {
                    //OutputMessage("Next button hit", MessageType.Info);
                    //Increment the current tutorial index
                    CurrentTutorialIndex++;
                }
            }

            NSEditorStyles.DrawLabel("Current Index: " + CurrentTutorialIndex);
            NSEditorStyles.CloseHorizontal();
            GUILayout.Space(2);
        }
Esempio n. 11
0
 public virtual void DrawTitleContent()
 {
     NSEditorStyles.OpenHorizontal();
     NSEditorStyles.DrawTitle(PaneTitle);
     if (!TutorialModeActive)
     {
         //Draw a walkthrough button
         DrawWalkthroughButton(WalkthroughText);
     }
     else
     {
         //Draw a exit tutorial button
         if (NSEditorStyles.TutorialToolbarButton(false, "Exit Tutorial"))
         {
             TutorialModeActive = false;
         }
     }
     NSEditorStyles.CloseHorizontal();
 }
Esempio n. 12
0
 /// <summary>
 /// Label Wrapper - takes a Rect to offset padding of the label by. Left/X, Top/Y, Right/Width, Bottom/Height format for the Rect
 /// </summary>
 /// <param name="labelText">Label text.</param>
 /// <param name="offset">Offset.</param>
 /// <param name="minWidth">Minimum width.</param>
 public static void DrawLabel(string labelText, Rect offset, float minWidth = 105)
 {
     GUILayout.Label(labelText, NSEditorStyles.GetSubTitleLabel(offset), GUILayout.ExpandWidth(false), GUILayout.MinWidth(105));
 }
Esempio n. 13
0
 public static void DrawLabel(string labelText, float minWidth = 105, float spacingAfterward = 0)
 {
     GUILayout.Label(labelText, NSEditorStyles.GetSmallLabel(), GUILayout.ExpandWidth(true), GUILayout.MinWidth(105));
     GUILayout.Space(spacingAfterward);
 }
Esempio n. 14
0
 public override void DrawPaneContent()
 {
     NSEditorStyles.OpenHorizontal(ColorBoxType.Warning);
     NSEditorStyles.DrawTitle("This tool is coming soon!\nIt will let you watch in real time what is going on in each pad.");
     NSEditorStyles.CloseHorizontal();
 }