private void InstructionListHotkeyUpdate(IInputReceiver receiver)
        {
            #region Delete

            if (InputManager.Keyboard.KeyPushed(Microsoft.Xna.Framework.Input.Keys.Delete))
            {
                object highlightedObject = mInstructionSetListBox.GetFirstHighlightedObject();

                if (highlightedObject is KeyframeList)
                {
                    EditorData.EditorLogic.CurrentInstructionSet.Remove(highlightedObject as KeyframeList);

                    EditorData.EditorLogic.CurrentKeyframe = null;

                    EditorData.EditorLogic.CurrentKeyframeList = null;

                    UpdateLists();
                }
                else if (highlightedObject is InstructionList)
                {
                    EditorData.EditorLogic.CurrentKeyframeList.Remove(highlightedObject as InstructionList);
                    UpdateLists();
                }
            }

            #endregion
        }
Beispiel #2
0
        private void TextureListBoxFocusUpdate(IInputReceiver inputReceiver)
        {
            if (InputManager.Keyboard.KeyPushed(Microsoft.DirectX.DirectInput.Key.Delete))
            {
                bool doAnyItemsReferenceTexture = false;

                if (!doAnyItemsReferenceTexture)
                {
                    object highlightedObject = textureListBox.GetFirstHighlightedObject();

                    if (highlightedObject != null && highlightedObject is Texture2D)
                    {
                        GameData.DeleteTexture(highlightedObject as Texture2D);
                    }
                }
            }
        }
Beispiel #3
0
        private static void SelectNodeInListBox(Window callingWindow)
        {
            CollapseListBox asListBox = callingWindow as CollapseListBox;

            PositionedNode node = asListBox.GetFirstHighlightedObject() as PositionedNode;

            EditorData.EditingLogic.SelectNode(node);
        }
Beispiel #4
0
        private static void CreateObjectOfSelectedType(Window callingWindow)
        {
            CollapseListBox collapseListBox = callingWindow as CollapseListBox;

            Type type = collapseListBox.GetFirstHighlightedObject() as Type;

            mObjectToSerialize       = Activator.CreateInstance(type);
            mTypeOfObjectToSerialize = type;

            if (PropertyGrid.IsIEnumerable(type))
            {
                mObjectListDisplayWindow = CreateListDisplayWindowForObject(mObjectToSerialize);
            }
            else
            {
                mObjectPropertyGrid = CreatePropertyGridForObject(mObjectToSerialize);
            }
        }