コード例 #1
0
        // Mode disengages
        public override void OnDisengage()
        {
            base.OnDisengage();

            // Remove toolbar buttons
            if (General.Map.UDMF)
            {
                General.Interface.BeginToolbarUpdate();
                General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.CopyProperties);
                General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.PasteProperties);
                General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.PastePropertiesOptions);            //mxd
                General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.TextureOffsetLock);                 //mxd
                General.Interface.EndToolbarUpdate();
            }

            // Going to EditSelectionMode?
            EditSelectionMode mode = General.Editing.NewMode as EditSelectionMode;

            if (mode != null)
            {
                // Not pasting anything?
                if (!mode.Pasting)
                {
                    // No selection made? But we have a highlight!
                    if ((General.Map.Map.GetSelectedVertices(true).Count == 0) && (highlighted != null))
                    {
                        // Make the highlight the selection
                        highlighted.Selected = true;
                    }
                }
            }

            // Hide highlight info
            General.Interface.HideInfo();
        }
コード例 #2
0
ファイル: VerticesMode.cs プロジェクト: paulyc/doombuilder
        // Mode disengages
        public override void OnDisengage()
        {
            base.OnDisengage();

            // Remove toolbar buttons
            General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.CopyProperties);
            General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.PasteProperties);

            // Going to EditSelectionMode?
            if (General.Editing.NewMode is EditSelectionMode)
            {
                // Not pasting anything?
                EditSelectionMode editmode = (General.Editing.NewMode as EditSelectionMode);
                if (!editmode.Pasting)
                {
                    // No selection made? But we have a highlight!
                    if ((General.Map.Map.GetSelectedVertices(true).Count == 0) && (highlighted != null))
                    {
                        // Make the highlight the selection
                        highlighted.Selected = true;
                    }
                }
            }

            // Hide highlight info
            General.Interface.HideInfo();
        }
コード例 #3
0
        // When disengaged
        public override void OnDisengage()
        {
            base.OnDisengage();

            // Remove toolbar buttons
            General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.ViewSelectionNumbers);
            General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.SeparatorSectors1);
            General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.MakeGradientBrightness);

            // Keep only sectors selected
            General.Map.Map.ClearSelectedLinedefs();

            // Going to EditSelectionMode?
            if (General.Editing.NewMode is EditSelectionMode)
            {
                // Not pasting anything?
                EditSelectionMode editmode = (General.Editing.NewMode as EditSelectionMode);
                if (!editmode.Pasting)
                {
                    // No selection made? But we have a highlight!
                    if ((General.Map.Map.GetSelectedSectors(true).Count == 0) && (highlighted != null))
                    {
                        // Make the highlight the selection
                        SelectSector(highlighted, true, false);
                    }
                }
            }

            // Hide highlight info
            General.Interface.HideInfo();
        }
コード例 #4
0
        // This is called when something was pasted.
        public override void OnPasteEnd(PasteOptions options)
        {
            General.Map.Map.ClearAllSelected();
            General.Map.Map.SelectMarkedGeometry(true, true);

            // Switch to EditSelectionMode
            EditSelectionMode editmode = new EditSelectionMode();

            editmode.Pasting      = true;
            editmode.PasteOptions = options;
            General.Editing.ChangeMode(editmode);
        }
コード例 #5
0
        // This is called when something was pasted.
        public override void OnPasteEnd(PasteOptions options)
        {
            General.Map.Map.ClearAllSelected();
            General.Map.Map.SelectMarkedGeometry(true, true);
            General.Map.Renderer2D.UpdateExtraFloorFlag();             //mxd

            // Switch to EditSelectionMode
            EditSelectionMode editmode = new EditSelectionMode();

            editmode.Pasting      = true;
            editmode.UpdateSlopes = false;
            editmode.PasteOptions = options;
            General.Editing.ChangeMode(editmode);
        }
コード例 #6
0
        // Constructor
        public EditSelectionPanel(EditSelectionMode mode)
        {
            InitializeComponent();
            this.mode = mode;

            //mxd
            preventchanges = true;
            if(General.Map.UDMF)
            {
                preciseposition.Checked = mode.UsePrecisePosition;
                preciseposition.Enabled = true;
            }
            else
            {
                preciseposition.Checked = false;
                preciseposition.Enabled = false;
            }
            preventchanges = false;

            //mxd. Otherwise the focus will go to one of TextBoxes
            // and stay there forever preventing tab collapsing when in collapsed mode
            label1.Focus();
        }
コード例 #7
0
 // Constructor
 public EditSelectionPanel(EditSelectionMode mode)
 {
     InitializeComponent();
     this.mode = mode;
 }