Example #1
0
        public FileButtonWindow(Cursor cursor)
        {
            camera = SpriteManager.Cameras[0];
            this.messages = GuiData.messages;
            sesgMan = GameData.sesgMan;

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

            mAssetsRelativeToSpriteRig = true;
        }
Example #3
0
 public static bool AskQuestionsAndDelaySaveIfNecessary(GuiMessage guiMessage)
 {
     if (SESpriteGridManager.CurrentSpriteGrid != null && SESpriteGridManager.HasBlueprintChanged())
     {
         SESpriteGridManager.AskIfChangesShouldBeApplied(guiMessage);
         return(false);
     }
     else
     {
         return(true);
     }
 }
Example #4
0
        public void Initialize(GameForm form)
        {
            this.form   = form;
            this.camera = GameForm.camera;

            this.cursor  = GameForm.cursor;
            this.sesgMan = GameData.sesgMan;
            SpriteGridGuiMessages.camera  = this.camera;
            SpriteGridGuiMessages.random  = this.random;
            SpriteGridGuiMessages.sesgMan = GameData.sesgMan;

            mEditorProperties = GameData.EditorProperties;
        }
Example #5
0
        public SpriteGridCreationPropertiesWindow(Cursor cursor)
            : base(cursor)
        {
            #region Create "this" properties
            this.camera  = GameData.Camera;
            this.sesgMan = GameData.sesgMan;
            GuiManager.AddWindow(this);
            base.HasCloseButton = true;
            base.HasMoveBar     = true;
            base.SetPositionTL(18.1f, 33f);
            this.Visible = false;
            #endregion

            SelectedObject = new SpriteGridCreationOptions();


            this.spriteGridOkCancelGui = new WindowArray();
            this.spriteGridOk          = new Button(mCursor);
            this.spriteGridOk.Text     = "Ok";
            this.spriteGridOk.ScaleX   = 4f;
            this.spriteGridOk.ScaleY   = 1.2f;
            this.spriteGridOk.Click   += new GuiMessage(this.spriteGridOkClick);
            AddWindow(spriteGridOk);

            this.spriteGridCancel        = new Button(mCursor);
            this.spriteGridCancel.Text   = "Cancel";
            this.spriteGridCancel.ScaleX = 4f;
            this.spriteGridCancel.SetPositionTL(19f, 22f);
            this.spriteGridCancel.ScaleY = 1.2f;
            this.spriteGridCancel.Click += new GuiMessage(SpriteGridGuiMessages.spriteGridCancelClick);
            AddWindow(spriteGridCancel);


            this.mResizeWarning      = new TextDisplay(mCursor);
            this.mResizeWarning.Text = "Changing grid spacing clears painted\ntextures.";
            this.mResizeWarning.SetPositionTL(0.2f, 1.7f);
            this.mResizeWarning.Visible = false;
            AddWindow(mResizeWarning);
        }
Example #6
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;
        }
Example #7
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;
        }
Example #8
0
 public static void ShowWarningsAndMessagesBeforeSaving()
 {
     SESpriteGridManager.ShowMessageBoxIfBoundsAreInvalid();
 }
Example #9
0
        public void Initialize(GameForm form)
        {
            this.form = form;
            this.camera = GameForm.camera;

            this.cursor = GameForm.cursor;
            this.sesgMan = GameData.sesgMan;
            SpriteGridGuiMessages.camera = this.camera;
            SpriteGridGuiMessages.random = this.random;
            SpriteGridGuiMessages.sesgMan = GameData.sesgMan;

            mEditorProperties = GameData.EditorProperties;
        }