Inheritance: EditorObjects.Gui.ToolsWindow
Beispiel #1
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();
        }
Beispiel #2
0
        public static void Initialize()
        {
            Window.KeepWindowsInScreen = false;

            #region Assign engine references

            camera = GameForm.camera;

            #endregion


            fileButtonWindow = new FileButtonWindow(GuiManager.Cursor);

            ToolsWindow = new ToolsWindow();
            mVisibleToggleWindows.Add(ToolsWindow);

            ListWindow = new ListWindow(ToolsWindow);
            mVisibleToggleWindows.Add(ListWindow);

            //#region Create AttributesWindow
            //mAttributesWindow = new AttributesWindow(messages);
            //mAttributesWindow.SetPositionTL(84.5f, 25.8f);
            //mAttributesWindow.Visible = false;
            //GuiManager.AddWindow(mAttributesWindow);
            //#endregion

            spriteGridPropertiesWindow = new SpriteGridCreationPropertiesWindow(GuiManager.Cursor);
            srSaveOptions = new SpriteRigSaveOptions(messages, GuiManager.Cursor);

            #region TextureCoordinateSelectionWindow

            mTextureCoordinateSelectionWindow = new TextureCoordinatesSelectionWindow();
            GuiManager.AddWindow(mTextureCoordinateSelectionWindow);
            // set AddToListButtonShown to true before setting the visibility to false so that it updates correclty
            mTextureCoordinateSelectionWindow.AddToListButtonShown = true;
            mTextureCoordinateSelectionWindow.Visible        = false;
            mTextureCoordinateSelectionWindow.HasCloseButton = true;
            mTextureCoordinateSelectionWindow.AddToListClickEventAdd(messages.AddDisplayRegion);
            mVisibleToggleWindows.Add(mTextureCoordinateSelectionWindow);

            #endregion

            #region MenuStrip

            mMenuStrip = new SpriteEditor.Gui.MenuStrip();
            mMenuStrip.SavedSuccess += new EventHandler(mMenuStrip_SavedSuccess);

            #endregion

            GameData.EditorLogic.NodeNetworkEditorManager.AddNodeNetworkMenus(MenuStrip);


            CreateInfoBar();

            CreatePropertyGrids();

            CreateListDisplayWindows();

            List <string> windowsToExclude = new List <string>();
            windowsToExclude.Add(mMenuStrip.Name);

            LayoutManager.LoadWindowLayout(windowsToExclude);

            Window.KeepWindowsInScreen = true;
        }