// Methods
        public AttributesWindow(GuiMessages messages)
            : base(GuiManager.Cursor)
        {
            this.ScaleX = 11f;
            this.ScaleY = 20f;
            base.HasMoveBar = true;
            base.HasCloseButton = true;
            base.Name = "Attributes";

            this.mListBox = new ListBox(mCursor);
            AddWindow(mListBox);
            this.mListBox.ScaleX = this.ScaleX - 0.5f;
            this.mListBox.ScaleY = this.ScaleY - 3f;
            this.mListBox.SetPositionTL(this.ScaleX, this.ScaleY - 0.5f);
            this.mListBox.Click += new GuiMessage(this.AttributesListBoxClick);
            this.mListBox.Name = "Attributes ListBox";

            this.mAddAttribute = new Button(mCursor);
            AddWindow(mAddAttribute);
            this.mAddAttribute.ScaleX = 8f;
            this.mAddAttribute.ScaleY = 1.4f;
            this.mAddAttribute.SetPositionTL(8.5f, (2f * this.ScaleY) - 2f);
            this.mAddAttribute.Text = "Create New Attribute";
            this.mAddAttribute.Click += new GuiMessage(this.AddAttribute);
        }
Beispiel #2
0
        // Methods
        public AttributesWindow(GuiMessages messages)
            : base(GuiManager.Cursor)
        {
            this.ScaleX         = 11f;
            this.ScaleY         = 20f;
            base.HasMoveBar     = true;
            base.HasCloseButton = true;
            base.Name           = "Attributes";

            this.mListBox = new ListBox(mCursor);
            AddWindow(mListBox);
            this.mListBox.ScaleX = this.ScaleX - 0.5f;
            this.mListBox.ScaleY = this.ScaleY - 3f;
            this.mListBox.SetPositionTL(this.ScaleX, this.ScaleY - 0.5f);
            this.mListBox.Click += new GuiMessage(this.AttributesListBoxClick);
            this.mListBox.Name   = "Attributes ListBox";

            this.mAddAttribute = new Button(mCursor);
            AddWindow(mAddAttribute);
            this.mAddAttribute.ScaleX = 8f;
            this.mAddAttribute.ScaleY = 1.4f;
            this.mAddAttribute.SetPositionTL(8.5f, (2f * this.ScaleY) - 2f);
            this.mAddAttribute.Text   = "Create New Attribute";
            this.mAddAttribute.Click += new GuiMessage(this.AddAttribute);
        }
        public FileButtonWindow(Cursor cursor)
        {
            camera = SpriteManager.Cameras[0];
            this.messages = GuiData.messages;
            sesgMan = GameData.sesgMan;

            mAssetsRelativeToSpriteRig = true;
        }
Beispiel #4
0
        public FileButtonWindow(Cursor cursor)
        {
            camera        = SpriteManager.Cameras[0];
            this.messages = GuiData.messages;
            sesgMan       = GameData.sesgMan;

            mAssetsRelativeToSpriteRig = true;
        }
Beispiel #5
0
        public ListWindow(ToolsWindow toolsWindow)
            : base(GuiManager.Cursor)
        {
            #region Set engine and common SpriteEditor references

            this.messages     = GuiData.messages;
            this.mToolsWindow = toolsWindow;

            #endregion

            #region Set "this" properties

            GuiManager.AddWindow(this);
            this.ScaleX = 13f;
            this.ScaleY = 20f;
            base.SetPositionTL(this.ScaleX, 25.7f);
            base.HasMoveBar     = true;
            base.HasCloseButton = true;
            base.mName          = "Object List";
            base.Resizing      += new GuiMessage(this.PositionContainedElements);
            base.Resizable      = true;
            base.MinimumScaleX  = 10f;
            base.MinimumScaleY  = 5f;

            #endregion

            #region spriteListBox

            SpriteListBox                           = new ListDisplayWindow(GuiManager.Cursor);
            SpriteListBox.DrawBorders               = false;
            SpriteListBox.ListBox.TakingInput       = false; // allows input like delete, keyboard camera movement to fall through
            SpriteListBox.ListBox.ShiftClickOn      = true;
            SpriteListBox.ListBox.CtrlClickOn       = true;
            this.SpriteListBox.ListBox.Push        += new GuiMessage(spriteListBoxClick);
            this.SpriteListBox.ListBox.DoubleClick += new GuiMessage(spriteListBoxDoubleClick);
            this.SpriteListBox.Lined                = true;
            this.AddWindow(SpriteListBox);
            SpriteListBox.ListBox.FocusUpdate += SpriteListFocusUpdate;

            SpriteListBox.ConsiderAttachments = true;

            #endregion

            #region gridListBox property setting

            SpriteGridListBox                           = new ListDisplayWindow(GuiManager.Cursor);
            SpriteGridListBox.DrawBorders               = false;
            this.SpriteGridListBox.Visible              = false;
            this.SpriteGridListBox.ListBox.Push        += new GuiMessage(this.GridListBoxClick);
            this.SpriteGridListBox.ListBox.DoubleClick += new GuiMessage(this.messages.GridListBoxDoubleClick);
            SpriteGridListBox.ListBox.FocusUpdate      += SpriteGridListFocusUpdate;
            AddWindow(SpriteGridListBox);
            #endregion

            #region SpriteFrameListBox

            SpriteFrameListBox                     = new ListDisplayWindow(GuiManager.Cursor);
            SpriteFrameListBox.DrawBorders         = false;
            SpriteFrameListBox.ListBox.TakingInput = false;             // allows input like delete, keyboard camera movement to fall through

            this.SpriteFrameListBox.Visible       = false;
            this.SpriteFrameListBox.ListBox.Push += new GuiMessage(this.FrameListBoxClick);
            AddWindow(SpriteFrameListBox);
            SpriteFrameListBox.ConsiderAttachments = true;

            #endregion

            #region ModelListBox
            mModelListBox                    = new ListDisplayWindow(GuiManager.Cursor);
            mModelListBox.DrawBorders        = false;
            this.mModelListBox.Visible       = false;
            this.mModelListBox.ListBox.Push += new GuiMessage(this.ModelListBoxClick);
            this.AddWindow(ModelListBox);
            mModelListBox.ConsiderAttachments = true;
            #endregion

            #region TextListBox

            mTextListBox               = new ListDisplayWindow(GuiManager.Cursor);
            mTextListBox.DrawBorders   = false;
            mTextListBox.Visible       = false;
            mTextListBox.ListBox.Push += TextListBoxClick;
            this.AddWindow(mTextListBox);
            mTextListBox.ConsiderAttachments = true;


            #endregion

            #region TextureListBox
            this.textureListBox = new CollapseListBox(mCursor);
            AddWindow(textureListBox);
            this.textureListBox.Visible      = false;
            this.textureListBox.Highlight   += new GuiMessage(TextureListBoxClick);
            this.textureListBox.FocusUpdate += TextureListBoxFocusUpdate;
            #endregion

            #region AnimationChain List Box

            mAnimationChainListWindow                    = new ListDisplayWindow(GuiManager.Cursor);
            mAnimationChainListWindow.DrawBorders        = false;
            mAnimationChainListWindow.Visible            = false;
            mAnimationChainListWindow.ListBox.Highlight += AnimationChainListBoxClick;
            this.AddWindow(mAnimationChainListWindow);

            #endregion

            this.PositionContainedElements(this);

            float buttonScale = 1.3f;

            #region Create the EditSprites ToggleButton

            this.editSprites = new ToggleButton(mCursor);
            AddWindow(editSprites);
            this.editSprites.ScaleX = this.editSprites.ScaleY = buttonScale;
            this.editSprites.SetPositionTL(buttonScale + .4f, 1.5f);
            this.editSprites.Text = "Edit Sprites";
            this.editSprites.SetOverlayTextures(3, 1);
            this.editSprites.Press();
            this.editSprites.Click += new GuiMessage(this.EditSpritesClick);

            #endregion

            #region Edit SpriteGrids

            this.editGrids = new ToggleButton(mCursor);
            AddWindow(editGrids);
            this.editGrids.ScaleX = this.editGrids.ScaleY = buttonScale;
            this.editGrids.SetPositionTL(3 * buttonScale + .4f, 1.5f);
            this.editGrids.Text = "Edit Grids";
            this.editGrids.SetOverlayTextures(4, 1);
            this.editSprites.AddToRadioGroup(this.editGrids);
            this.editGrids.Click += new GuiMessage(this.EditGridsClick);
            this.editGrids.SetOneAlwaysDown(true);

            #endregion

            #region Edit SpriteFrames toggle button

            this.editSpriteFrames = new ToggleButton(mCursor);
            AddWindow(editSpriteFrames);
            this.editSpriteFrames.ScaleX = this.editSpriteFrames.ScaleY = buttonScale;
            this.editSpriteFrames.SetPositionTL(5 * buttonScale + .4f, 1.5f);
            this.editSpriteFrames.Text = "Edit SpriteFrames";
            this.editSpriteFrames.SetOverlayTextures(0, 3);
            this.editSprites.AddToRadioGroup(this.editSpriteFrames);
            this.editSpriteFrames.Click += new GuiMessage(this.EditFramesClick);
            this.editSpriteFrames.SetOneAlwaysDown(true);

            #endregion

            #region editModels
            this.editModels = new ToggleButton(mCursor);
            AddWindow(editModels);
            this.editModels.ScaleX = this.editModels.ScaleY = buttonScale;
            this.editModels.SetPositionTL(7 * buttonScale + .4f, 1.5f);
            this.editModels.Text = "Edit Models";
            this.editModels.SetOverlayTextures(4, 3);
            this.editSprites.AddToRadioGroup(this.editModels);
            this.editModels.Click += new GuiMessage(this.EditModelsClick);
            this.editModels.SetOneAlwaysDown(true);
            #endregion

            #region EditTexts
            this.mEditTexts = new ToggleButton(mCursor);
            AddWindow(mEditTexts);
            this.mEditTexts.ScaleX = this.mEditTexts.ScaleY = buttonScale;
            this.mEditTexts.SetPositionTL(9 * buttonScale + .4f, 1.5f);
            this.mEditTexts.Text = "Edit Texts";
            this.mEditTexts.SetOverlayTextures(6, 3);
            this.editSprites.AddToRadioGroup(this.mEditTexts);
            this.mEditTexts.Click += new GuiMessage(this.EditTextsClick);
            this.mEditTexts.SetOneAlwaysDown(true);

            #endregion

            #region View Textures icon
            this.mViewTexturesButton = new Button(mCursor);
            AddWindow(mViewTexturesButton);
            this.mViewTexturesButton.ScaleX = this.mViewTexturesButton.ScaleY = buttonScale;
            this.mViewTexturesButton.SetPositionTL(11 * buttonScale + .4f + .7f, 1.5f);
            this.mViewTexturesButton.Text = "View Textures";
            this.mViewTexturesButton.SetOverlayTextures(2, 3);
            // no longer a ToggleButton and it shouldn't be part of the group
            //this.editSprites.AddToRadioGroup(this.editTextures);
            //this.editTextures.SetOneAlwaysDown(true);
            this.mViewTexturesButton.Click += new GuiMessage(this.EditTexturesClick);
            #endregion

            #region Vew AnimationChains icon
            this.mViewAnimationChainsButton = new Button(mCursor);
            AddWindow(mViewAnimationChainsButton);
            this.mViewAnimationChainsButton.ScaleX = this.mViewAnimationChainsButton.ScaleY = buttonScale;
            this.mViewAnimationChainsButton.SetPositionTL(13 * buttonScale + .4f + .7f, 1.5f);
            this.mViewAnimationChainsButton.Text = "View AnimationChains";
            this.mViewAnimationChainsButton.SetOverlayTextures(7, 3);
            // no longer a ToggleButton and it shouldn't be part of the group
            //this.editSprites.AddToRadioGroup(this.editTextures);
            //this.editTextures.SetOneAlwaysDown(true);
            this.mViewAnimationChainsButton.Click += new GuiMessage(this.ViewAnimationChainsClick);

            #endregion

            RefreshListsShown();
        }
        // Methods
        public SpriteRigSaveOptions(GuiMessages messages, Cursor cursor)
            : base(cursor)
        {
            this.messages = messages;
            GuiManager.AddWindow(this);
            this.ScaleX = 13f;
            this.ScaleY = 17f;
            base.HasMoveBar = true;
            base.mName = "SpriteRig Options";
            base.HasCloseButton = true;

            TextDisplay tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Include:";
            tempTextDisplay.SetPositionTL(0.2f, 1.5f);

            this.sceneOrGroup = new ComboBox(mCursor);
            AddWindow(sceneOrGroup);
            this.sceneOrGroup.ScaleX = 8f;
            this.sceneOrGroup.SetPositionTL(10f, 3.5f);
            this.sceneOrGroup.Text = "Entire Scene";
            this.sceneOrGroup.AddItem("Current Group");
            this.sceneOrGroup.AddItem("Entire Scene");

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Body Sprite Selection Includes:";
            tempTextDisplay.SetPositionTL(0.2f, 6f);

            this.bodySpriteSelectionMethod = new ComboBox(mCursor);
            AddWindow(bodySpriteSelectionMethod);
            this.bodySpriteSelectionMethod.ScaleX = 8f;
            this.bodySpriteSelectionMethod.SetPositionTL(10f, 8.5f);
            this.bodySpriteSelectionMethod.Text = "Name Includes";
            this.bodySpriteSelectionMethod.AddItem("Name Includes");
            this.bodySpriteSelectionMethod.AddItem("By Texture");
            this.bodySpriteSelectionMethod.AddItem("All Not Joint");
            this.bodySpriteSelectionMethod.AddItem("All");
            this.bodySpriteSelectionMethod.ItemClick += new GuiMessage(this.bodySpriteSelectionMethodClicked);

            this.bodyAvailableTextures = new ComboBox(mCursor);
            AddWindow(bodyAvailableTextures);
            this.bodyAvailableTextures.ScaleX = 8f;
            this.bodyAvailableTextures.SetPositionTL(10f, 10.5f);
            this.bodyAvailableTextures.Visible = false;

            this.bodyNameToInclude = new TextBox(mCursor);
            AddWindow(bodyNameToInclude);
            this.bodyNameToInclude.ScaleX = 8f;
            this.bodyNameToInclude.SetPositionTL(10f, 10.5f);

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Joint Sprite Selection Includes:";
            tempTextDisplay.SetPositionTL(0.2f, 13f);

            this.jointSpriteSelectionMethod = new ComboBox(mCursor);
            AddWindow(jointSpriteSelectionMethod);
            this.jointSpriteSelectionMethod.ScaleX = 8f;
            this.jointSpriteSelectionMethod.SetPositionTL(10f, 15.5f);
            this.jointSpriteSelectionMethod.Text = "Name Includes";
            this.jointSpriteSelectionMethod.AddItem("Name Includes");
            this.jointSpriteSelectionMethod.AddItem("By Texture");
            this.jointSpriteSelectionMethod.AddItem("All Not Body");
            this.jointSpriteSelectionMethod.AddItem("All");
            this.jointSpriteSelectionMethod.ItemClick += new GuiMessage(this.jointSpriteSelectionMethodClicked);

            this.jointAvailableTextures = new ComboBox(mCursor);
            AddWindow(jointAvailableTextures);
            this.jointAvailableTextures.ScaleX = 8f;
            this.jointAvailableTextures.SetPositionTL(10f, 18f);
            this.jointAvailableTextures.Visible = false;

            this.jointNameToInclude = new TextBox(mCursor);
            AddWindow(jointNameToInclude);
            this.jointNameToInclude.ScaleX = 8f;
            this.jointNameToInclude.SetPositionTL(10f, 18f);

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Root Sprite:";
            tempTextDisplay.SetPositionTL(0.2f, 20);

            this.rootSpriteComboBox = new ComboBox(mCursor);
            AddWindow(rootSpriteComboBox);
            this.rootSpriteComboBox.ScaleX = 8f;
            this.rootSpriteComboBox.SetPositionTL(10f, 22.5f);
            this.rootSpriteComboBox.Text = "<No Root>";

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Sprite Visibility:";
            tempTextDisplay.SetPositionTL(0.2f, 25f);

            this.jointsVisible = new ToggleButton(mCursor);
            AddWindow(jointsVisible);
            this.jointsVisible.SetPositionTL(11f, 27f);
            this.jointsVisible.SetText("Joints Not Visible", "Joints Visible");
            this.jointsVisible.ScaleX = 7.5f;

            this.rootVisible = new ToggleButton(mCursor);
            AddWindow(rootVisible);
            this.rootVisible.SetPositionTL(11f, 29f);
            this.rootVisible.SetText("Root Not Visible", "Root Visible");
            this.rootVisible.ScaleX = 7.5f;

            this.okButton = new Button(mCursor);
            AddWindow(okButton);
            this.okButton.Text = "Save";
            this.okButton.ScaleX = 4.5f;
            this.okButton.ScaleY = 1.3f;
            this.okButton.SetPositionTL(5f, 32f);
            this.okButton.Click += new GuiMessage(this.saveButtonClick);

            this.cancelButton = new Button(mCursor);
            AddWindow(cancelButton);
            this.cancelButton.Text = "Cancel";
            this.cancelButton.ScaleX = 4.5f;
            this.cancelButton.ScaleY = 1.3f;
            this.cancelButton.SetPositionTL(16f, 32f);
            this.cancelButton.Click += new GuiMessage(this.cancelButtonClick);

            this.Visible = false;
        }
        // Methods
        public SpriteRigSaveOptions(GuiMessages messages, Cursor cursor)
            : base(cursor)
        {
            this.messages = messages;
            GuiManager.AddWindow(this);
            this.ScaleX         = 13f;
            this.ScaleY         = 17f;
            base.HasMoveBar     = true;
            base.mName          = "SpriteRig Options";
            base.HasCloseButton = true;

            TextDisplay tempTextDisplay = new TextDisplay(mCursor);

            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Include:";
            tempTextDisplay.SetPositionTL(0.2f, 1.5f);

            this.sceneOrGroup = new ComboBox(mCursor);
            AddWindow(sceneOrGroup);
            this.sceneOrGroup.ScaleX = 8f;
            this.sceneOrGroup.SetPositionTL(10f, 3.5f);
            this.sceneOrGroup.Text = "Entire Scene";
            this.sceneOrGroup.AddItem("Current Group");
            this.sceneOrGroup.AddItem("Entire Scene");

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Body Sprite Selection Includes:";
            tempTextDisplay.SetPositionTL(0.2f, 6f);

            this.bodySpriteSelectionMethod = new ComboBox(mCursor);
            AddWindow(bodySpriteSelectionMethod);
            this.bodySpriteSelectionMethod.ScaleX = 8f;
            this.bodySpriteSelectionMethod.SetPositionTL(10f, 8.5f);
            this.bodySpriteSelectionMethod.Text = "Name Includes";
            this.bodySpriteSelectionMethod.AddItem("Name Includes");
            this.bodySpriteSelectionMethod.AddItem("By Texture");
            this.bodySpriteSelectionMethod.AddItem("All Not Joint");
            this.bodySpriteSelectionMethod.AddItem("All");
            this.bodySpriteSelectionMethod.ItemClick += new GuiMessage(this.bodySpriteSelectionMethodClicked);

            this.bodyAvailableTextures = new ComboBox(mCursor);
            AddWindow(bodyAvailableTextures);
            this.bodyAvailableTextures.ScaleX = 8f;
            this.bodyAvailableTextures.SetPositionTL(10f, 10.5f);
            this.bodyAvailableTextures.Visible = false;

            this.bodyNameToInclude = new TextBox(mCursor);
            AddWindow(bodyNameToInclude);
            this.bodyNameToInclude.ScaleX = 8f;
            this.bodyNameToInclude.SetPositionTL(10f, 10.5f);

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Joint Sprite Selection Includes:";
            tempTextDisplay.SetPositionTL(0.2f, 13f);

            this.jointSpriteSelectionMethod = new ComboBox(mCursor);
            AddWindow(jointSpriteSelectionMethod);
            this.jointSpriteSelectionMethod.ScaleX = 8f;
            this.jointSpriteSelectionMethod.SetPositionTL(10f, 15.5f);
            this.jointSpriteSelectionMethod.Text = "Name Includes";
            this.jointSpriteSelectionMethod.AddItem("Name Includes");
            this.jointSpriteSelectionMethod.AddItem("By Texture");
            this.jointSpriteSelectionMethod.AddItem("All Not Body");
            this.jointSpriteSelectionMethod.AddItem("All");
            this.jointSpriteSelectionMethod.ItemClick += new GuiMessage(this.jointSpriteSelectionMethodClicked);

            this.jointAvailableTextures = new ComboBox(mCursor);
            AddWindow(jointAvailableTextures);
            this.jointAvailableTextures.ScaleX = 8f;
            this.jointAvailableTextures.SetPositionTL(10f, 18f);
            this.jointAvailableTextures.Visible = false;

            this.jointNameToInclude = new TextBox(mCursor);
            AddWindow(jointNameToInclude);
            this.jointNameToInclude.ScaleX = 8f;
            this.jointNameToInclude.SetPositionTL(10f, 18f);

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Root Sprite:";
            tempTextDisplay.SetPositionTL(0.2f, 20);

            this.rootSpriteComboBox = new ComboBox(mCursor);
            AddWindow(rootSpriteComboBox);
            this.rootSpriteComboBox.ScaleX = 8f;
            this.rootSpriteComboBox.SetPositionTL(10f, 22.5f);
            this.rootSpriteComboBox.Text = "<No Root>";

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Sprite Visibility:";
            tempTextDisplay.SetPositionTL(0.2f, 25f);

            this.jointsVisible = new ToggleButton(mCursor);
            AddWindow(jointsVisible);
            this.jointsVisible.SetPositionTL(11f, 27f);
            this.jointsVisible.SetText("Joints Not Visible", "Joints Visible");
            this.jointsVisible.ScaleX = 7.5f;

            this.rootVisible = new ToggleButton(mCursor);
            AddWindow(rootVisible);
            this.rootVisible.SetPositionTL(11f, 29f);
            this.rootVisible.SetText("Root Not Visible", "Root Visible");
            this.rootVisible.ScaleX = 7.5f;

            this.okButton = new Button(mCursor);
            AddWindow(okButton);
            this.okButton.Text   = "Save";
            this.okButton.ScaleX = 4.5f;
            this.okButton.ScaleY = 1.3f;
            this.okButton.SetPositionTL(5f, 32f);
            this.okButton.Click += new GuiMessage(this.saveButtonClick);

            this.cancelButton = new Button(mCursor);
            AddWindow(cancelButton);
            this.cancelButton.Text   = "Cancel";
            this.cancelButton.ScaleX = 4.5f;
            this.cancelButton.ScaleY = 1.3f;
            this.cancelButton.SetPositionTL(16f, 32f);
            this.cancelButton.Click += new GuiMessage(this.cancelButtonClick);

            this.Visible = false;
        }
Beispiel #8
0
        public ToolsWindow()
            : base()
        {
            #region Set managers and UI references
            this.messages = GuiData.messages;
            this.sesgMan  = GameData.sesgMan;
            #endregion

            #region Set "this" properties
            base.SetPositionTL(106f, 5.8f);
            base.HasCloseButton = true;
            #endregion

            #region Move Button
            this.MoveButton      = AddToggleButton();
            this.MoveButton.Text = "Move";
            this.MoveButton.SetOverlayTextures(2, 0);
            #endregion

            #region Scale Button
            this.ScaleButton      = AddToggleButton();
            this.ScaleButton.Text = "Scale";
            this.MoveButton.AddToRadioGroup(this.ScaleButton);
            this.ScaleButton.SetOverlayTextures(1, 0);
            #endregion

            #region Rotate Button
            this.RotateButton      = AddToggleButton();
            this.RotateButton.Text = "Rotate";
            this.MoveButton.AddToRadioGroup(this.RotateButton);
            this.RotateButton.SetOverlayTextures(0, 0);
            #endregion

            #region Attach Sprite

            this.attachSprite      = base.AddToggleButton();
            this.attachSprite.Text = "Attach";
            this.MoveButton.AddToRadioGroup(this.attachSprite);
            this.attachSprite.SetOverlayTextures(7, 0);

            #endregion

            #region Detach Sprite

            this.detachSpriteButton         = AddButton();
            this.detachSpriteButton.Text    = "Detach";
            this.detachSpriteButton.Enabled = false;
            this.detachSpriteButton.SetOverlayTextures(10, 0);
            this.detachSpriteButton.Click += new GuiMessage(this.detachSprite);

            #endregion

            #region SetRootAsControlPoint
            this.setRootAsControlPoint         = AddButton();
            this.setRootAsControlPoint.Text    = "Set Root As Control Point";
            this.setRootAsControlPoint.Enabled = false;
            this.setRootAsControlPoint.SetOverlayTextures(12, 2);
            this.setRootAsControlPoint.Click += new GuiMessage(this.SetRootAsControlPointClick);
            #endregion

            #region Duplicate Objects

            this.mDuplicateObject      = AddButton();
            this.mDuplicateObject.Text = "Duplicate";
            this.mDuplicateObject.SetOverlayTextures(9, 0);
            this.mDuplicateObject.Click += new GuiMessage(this.CopyCurrentObjects);

            #endregion

            #region Convert to SpriteGrid
            this.convertToSpriteGridButton      = AddButton();
            this.convertToSpriteGridButton.Text = "Convert Sprite to SpriteGrid";
            this.convertToSpriteGridButton.SetOverlayTextures(2, 1);
            this.convertToSpriteGridButton.Enabled = false;
            this.convertToSpriteGridButton.Click  += new GuiMessage(SpriteGridGuiMessages.ConvertToSpriteGridButtonClick);
            #endregion

            #region Convert to SpriteFrame

            this.convertToSpriteFrame      = AddButton();
            this.convertToSpriteFrame.Text = "Convert Sprite to SpriteFrame";
            this.convertToSpriteFrame.SetOverlayTextures(1, 3);
            this.convertToSpriteFrame.Enabled = false;
            this.convertToSpriteFrame.Click  += new GuiMessage(GameData.sfMan.ConvertToSpriteFrameClick);

            #endregion

            #region Paint Button
            this.paintButton      = AddToggleButton();
            this.paintButton.Text = "Paint";
            this.paintButton.SetOverlayTextures(5, 1);
            this.MoveButton.AddToRadioGroup(this.paintButton);
            this.paintButton.Click += new GuiMessage(this.PaintButtonClicked);

            #endregion

            #region Current Texture Display

            this.currentTextureDisplay        = AddButton();
            this.currentTextureDisplay.Text   = "";
            this.currentTextureDisplay.Click += new GuiMessage(FileButtonWindow.openFileWindowLoadTexture);

            #endregion

            #region eyedropper

            this.eyedropper      = AddToggleButton();
            this.eyedropper.Text = "Eyedropper Tool";
            this.eyedropper.SetOverlayTextures(8, 1);
            this.MoveButton.AddToRadioGroup(this.eyedropper);

            #endregion

            #region Brush size

            this.brushSize = new ComboBox(mCursor);
            AddWindow(brushSize);
            this.brushSize.SetPositionTL(4.2f, 12.5f);
            this.brushSize.ScaleY = 1.3f;
            this.brushSize.ScaleX = 3.8f;
            this.brushSize.AddItem("1X1");
            this.brushSize.AddItem("3X3");
            this.brushSize.AddItem("5X5");
            this.brushSize.Text = "1X1";
            this.brushSize.ExpandOnTextBoxClick = true;

            #endregion

            this.constrainDimensions = base.AddToggleButton();
            this.constrainDimensions.SetPositionTL(constrainDimensions.X, 15.5f);
            this.constrainDimensions.Text = "Constrain Dim.";
            this.constrainDimensions.SetOverlayTextures(5, 0);

            #region Group/Hierarchy Button
            this.groupHierarchyControlButton = base.AddToggleButton();
            this.groupHierarchyControlButton.SetText("Group Control", "Hierarchy Control");
            this.groupHierarchyControlButton.SetOverlayTextures(3, 0, 4, 0);
            #endregion


            this.mSnapSprite      = base.AddToggleButton();
            this.mSnapSprite.Text = "Sprite Snapping";
            this.mSnapSprite.SetOverlayTextures(6, 0);

            #region DownZFreeRotateButton

            this.mDownZFreeRotateButton = base.AddToggleButton();


            mDownZFreeRotateButton.SetOverlayTextures(
                FlatRedBallServices.Load <Texture2D>(@"Content\DownZ.png", FlatRedBallServices.GlobalContentManager),
                FlatRedBallServices.Load <Texture2D>(@"Content\FreeRotation.png", FlatRedBallServices.GlobalContentManager));


            #endregion

            this.MinimumScaleX = this.ScaleX;
            this.MinimumScaleY = this.ScaleY;
        }
Beispiel #9
0
        public ToolsWindow()
            : base()
        {
            #region Set managers and UI references
            this.messages = GuiData.messages;
            this.sesgMan = GameData.sesgMan;
            #endregion

            #region Set "this" properties
            base.SetPositionTL(106f, 5.8f);
            base.HasCloseButton = true;
            #endregion

            #region Move Button
            this.MoveButton = AddToggleButton();
            this.MoveButton.Text = "Move";
            this.MoveButton.SetOverlayTextures(2, 0);
            #endregion

            #region Scale Button
            this.ScaleButton = AddToggleButton();
            this.ScaleButton.Text = "Scale";
            this.MoveButton.AddToRadioGroup(this.ScaleButton);
            this.ScaleButton.SetOverlayTextures(1, 0);
            #endregion

            #region Rotate Button
            this.RotateButton = AddToggleButton();
            this.RotateButton.Text = "Rotate";
            this.MoveButton.AddToRadioGroup(this.RotateButton);
            this.RotateButton.SetOverlayTextures(0, 0);
            #endregion

            #region Attach Sprite

            this.attachSprite = base.AddToggleButton();
            this.attachSprite.Text = "Attach";
            this.MoveButton.AddToRadioGroup(this.attachSprite);
            this.attachSprite.SetOverlayTextures(7, 0);

            #endregion

            #region Detach Sprite

            this.detachSpriteButton = AddButton();
            this.detachSpriteButton.Text = "Detach";
            this.detachSpriteButton.Enabled = false;
            this.detachSpriteButton.SetOverlayTextures(10, 0);
            this.detachSpriteButton.Click += new GuiMessage(this.detachSprite);

            #endregion

            #region SetRootAsControlPoint
            this.setRootAsControlPoint = AddButton();
            this.setRootAsControlPoint.Text = "Set Root As Control Point";
            this.setRootAsControlPoint.Enabled = false;
            this.setRootAsControlPoint.SetOverlayTextures(12, 2);
            this.setRootAsControlPoint.Click += new GuiMessage(this.SetRootAsControlPointClick);
            #endregion

            #region Duplicate Objects

            this.mDuplicateObject = AddButton();
            this.mDuplicateObject.Text = "Duplicate";
            this.mDuplicateObject.SetOverlayTextures(9, 0);
            this.mDuplicateObject.Click += new GuiMessage(this.CopyCurrentObjects);

            #endregion

            #region Convert to SpriteGrid
            this.convertToSpriteGridButton = AddButton();
            this.convertToSpriteGridButton.Text = "Convert Sprite to SpriteGrid";
            this.convertToSpriteGridButton.SetOverlayTextures(2, 1);
            this.convertToSpriteGridButton.Enabled = false;
            this.convertToSpriteGridButton.Click += new GuiMessage(SpriteGridGuiMessages.ConvertToSpriteGridButtonClick);
            #endregion

            #region Convert to SpriteFrame

            this.convertToSpriteFrame = AddButton();
            this.convertToSpriteFrame.Text = "Convert Sprite to SpriteFrame";
            this.convertToSpriteFrame.SetOverlayTextures(1, 3);
            this.convertToSpriteFrame.Enabled = false;
            this.convertToSpriteFrame.Click += new GuiMessage(GameData.sfMan.ConvertToSpriteFrameClick);

            #endregion

            #region Paint Button
            this.paintButton = AddToggleButton();
            this.paintButton.Text = "Paint";
            this.paintButton.SetOverlayTextures(5, 1);
            this.MoveButton.AddToRadioGroup(this.paintButton);
            this.paintButton.Click += new GuiMessage(this.PaintButtonClicked);

            #endregion

            #region Current Texture Display

            this.currentTextureDisplay = AddButton();
            this.currentTextureDisplay.Text = "";
            this.currentTextureDisplay.Click += new GuiMessage(FileButtonWindow.openFileWindowLoadTexture);

            #endregion

            #region eyedropper

            this.eyedropper = AddToggleButton();
            this.eyedropper.Text = "Eyedropper Tool";
            this.eyedropper.SetOverlayTextures(8, 1);
            this.MoveButton.AddToRadioGroup(this.eyedropper);

            #endregion

            #region Brush size

            this.brushSize = new ComboBox(mCursor);
            AddWindow(brushSize);
            this.brushSize.SetPositionTL(4.2f, 12.5f);
            this.brushSize.ScaleY = 1.3f;
            this.brushSize.ScaleX = 3.8f;
            this.brushSize.AddItem("1X1");
            this.brushSize.AddItem("3X3");
            this.brushSize.AddItem("5X5");
            this.brushSize.Text = "1X1";
            this.brushSize.ExpandOnTextBoxClick = true;

            #endregion

            this.constrainDimensions = base.AddToggleButton();
            this.constrainDimensions.SetPositionTL(constrainDimensions.X, 15.5f);
            this.constrainDimensions.Text = "Constrain Dim.";
            this.constrainDimensions.SetOverlayTextures(5, 0);

            #region Group/Hierarchy Button
            this.groupHierarchyControlButton = base.AddToggleButton();
            this.groupHierarchyControlButton.SetText("Group Control", "Hierarchy Control");
            this.groupHierarchyControlButton.SetOverlayTextures(3, 0, 4, 0);
            #endregion


            this.mSnapSprite = base.AddToggleButton();
            this.mSnapSprite.Text = "Sprite Snapping";
            this.mSnapSprite.SetOverlayTextures(6, 0);

            #region DownZFreeRotateButton

            this.mDownZFreeRotateButton = base.AddToggleButton();


            mDownZFreeRotateButton.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>(@"Content\DownZ.png", FlatRedBallServices.GlobalContentManager),
                FlatRedBallServices.Load<Texture2D>(@"Content\FreeRotation.png", FlatRedBallServices.GlobalContentManager));
            

            #endregion

            this.MinimumScaleX = this.ScaleX;
            this.MinimumScaleY = this.ScaleY;
        }
        public SESpriteGridManager()
		{
			camera = GameData.Camera;
			cursor = GameData.Cursor;
			currentSprites = GameData.EditorLogic.CurrentSprites;

			messages = GuiData.messages;

            mSpriteGridBorder = new SpriteGridBorder(cursor,
                camera);

            UndoManager.SetAfterUpdateDelegate(typeof(SpriteGrid), "XLeftBound", RepopulateSpriteGrid);
            UndoManager.SetAfterUpdateDelegate(typeof(SpriteGrid), "XRightBound", RepopulateSpriteGrid);
            UndoManager.SetAfterUpdateDelegate(typeof(SpriteGrid), "YTopBound", RepopulateSpriteGrid);
            UndoManager.SetAfterUpdateDelegate(typeof(SpriteGrid), "YBottomBound", RepopulateSpriteGrid);
            UndoManager.SetAfterUpdateDelegate(typeof(SpriteGrid), "ZCloseBound", RepopulateSpriteGrid);
            UndoManager.SetAfterUpdateDelegate(typeof(SpriteGrid), "ZFarBound", RepopulateSpriteGrid);

            tla = new List<TextureLocation<Texture2D>>();
        }