/// <inheritdoc />
        public void Draw(Rect windowRect)
        {
#if CREATOR_PRO
            // Do not show when user is not logged in.
            if (UserAccount.IsAccountLoggedIn() == false)
            {
                return;
            }
#endif

            IChapter chapter = GlobalEditorHandler.GetCurrentChapter();
            if (chapter != null && (chapter.Data.FirstStep == null && chapter.Data.Steps.Count == 0))
            {
                GUIStyle style = new GUIStyle(EditorStyles.label);
                style.normal.textColor = new Color(1, 1, 1, 0.70f);
                style.alignment        = TextAnchor.MiddleCenter;
                style.fontSize         = 20;

                GUIStyle backgroundStyle = new GUIStyle(GUI.skin.box);
                backgroundStyle.normal.background = backgroundTexture;

                Rect positionalRect = new Rect(windowRect.x + (windowRect.width / 2) - (width / 2), windowRect.y + (windowRect.height / 2) - (height / 2), width, height);

                GUI.Box(positionalRect, "", backgroundStyle);
                GUI.Label(positionalRect, "Right-click to create new step", style);
            }
        }
Esempio n. 2
0
        public void SetChapter(IChapter chapter)
        {
            if (chapter != GlobalEditorHandler.GetCurrentChapter())
            {
                GlobalEditorHandler.SetCurrentChapter(chapter);
            }

            CurrentChapter = chapter;

            Graphics.Reset();

            Grid = new WorkflowEditorGrid(Graphics, gridCellSize);

            Graphics.Canvas.ContextClick += HandleCanvasContextClick;

            EntryNode entryNode = CreateEntryNode(chapter);
            IDictionary <IStep, StepNode> stepNodes = SetupSteps(chapter);

            SetupTransitions(chapter, entryNode, stepNodes);

            Graphics.CalculateBoundingBox();

            if (EditorConfigurator.Instance.Validation.IsAllowedToValidate())
            {
                EditorConfigurator.Instance.Validation.Validate(CurrentChapter.Data, GlobalEditorHandler.GetCurrentCourse(), null);
            }
        }