상속: FlatRedBall.Gui.Window
예제 #1
0
        private void AddKeyframe(Window callingWindow)
        {
            #region See if adding is allowed (Are there objects to record).  If not, show a message

            if (EditorData.CurrentSpriteMembersWatching.Count == 0 &&
                EditorData.CurrentSpriteFrameMembersWatching.Count == 0 &&
                EditorData.CurrentPositionedModelMembersWatching.Count == 0 &&
                EditorData.CurrentTextMembersWatching.Count == 0)
            {
                GuiManager.ShowMessageBox("There are no members being recorded.  Try opening the " +
                                          "\"used members\" window through Window->Used Members menu item.", "No members");
                return;
            }

            if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.Current)
            {
                if (EditorData.EditorLogic.CurrentKeyframeList == null)
                {
                    GuiManager.ShowMessageBox("There is no Keyframe List currently selected", "Error");
                    return;
                }

                if (EditorData.EditorLogic.CurrentSprites.Count == 0 &&
                    EditorData.EditorLogic.CurrentSpriteFrames.Count == 0 &&
                    EditorData.EditorLogic.CurrentPositionedModels.Count == 0 &&
                    EditorData.EditorLogic.CurrentTexts.Count == 0)
                {
                    GuiManager.ShowMessageBox("No object is selected.  Select an object to record.", "No selected object.");
                    return;
                }
            }
            else if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.All)
            {
                if (EditorData.EditorLogic.CurrentAnimationSequence == null)
                {
                    GuiManager.ShowMessageBox("There is no Animation currently selected", "Error");
                    return;
                }
            }
            #endregion

            if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.All)
            {
                KeyframeListSelectionWindow klsw = new KeyframeListSelectionWindow(GuiManager.Cursor);
                GuiManager.AddWindow(klsw);
                klsw.PopulateComboBoxes(EditorData.BlockingScene, EditorData.ObjectInstructionSets);

                klsw.OkClick += AddKeyframeToGlobalInstrutionSet;
            }
            else
            {
                TextInputWindow tiw = GuiManager.ShowTextInputWindow("Enter a name for the new keyframe:", "Enter name");
                tiw.Text = "Keyframe " + EditorData.EditorLogic.CurrentKeyframeList.Count;

                tiw.OkClick += new GuiMessage(AddKeyframeOk);
            }
        }
예제 #2
0
        private void AddKeyframe(Window callingWindow)
        {


            #region See if adding is allowed (Are there objects to record).  If not, show a message

            if (EditorData.CurrentSpriteMembersWatching.Count == 0 &&
                EditorData.CurrentSpriteFrameMembersWatching.Count == 0 &&
                EditorData.CurrentPositionedModelMembersWatching.Count == 0 &&
                EditorData.CurrentTextMembersWatching.Count == 0)
            {
                GuiManager.ShowMessageBox("There are no members being recorded.  Try opening the " +
                    "\"used members\" window through Window->Used Members menu item.", "No members");
                return;
            }

            if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.Current)
            {
                if (EditorData.EditorLogic.CurrentKeyframeList == null)
                {
                    GuiManager.ShowMessageBox("There is no Keyframe List currently selected", "Error");
                    return;
                }

                if (EditorData.EditorLogic.CurrentSprites.Count == 0 &&
                    EditorData.EditorLogic.CurrentSpriteFrames.Count == 0 &&
                    EditorData.EditorLogic.CurrentPositionedModels.Count == 0 &&
                    EditorData.EditorLogic.CurrentTexts.Count == 0)
                {
                    GuiManager.ShowMessageBox("No object is selected.  Select an object to record.", "No selected object.");
                    return;
                }
            }
            else if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.All)
            {
                if (EditorData.EditorLogic.CurrentAnimationSequence == null)
                {
                    GuiManager.ShowMessageBox("There is no Animation currently selected", "Error");
                    return;
                }
            }
            #endregion

            if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.All)
            {

                KeyframeListSelectionWindow klsw = new KeyframeListSelectionWindow(GuiManager.Cursor);
                GuiManager.AddWindow(klsw);
                klsw.PopulateComboBoxes(EditorData.BlockingScene, EditorData.ObjectInstructionSets);

                klsw.OkClick += AddKeyframeToGlobalInstrutionSet;
            }
            else
            {
                TextInputWindow tiw = GuiManager.ShowTextInputWindow("Enter a name for the new keyframe:", "Enter name");
                tiw.Text = "Keyframe " + EditorData.EditorLogic.CurrentKeyframeList.Count;

                tiw.OkClick += new GuiMessage(AddKeyframeOk);
            }

        }