Ejemplo n.º 1
0
 // Select or deselect
 public void OnSelectEnd()
 {
     if (this.selected)
     {
         this.selected = false;
         mode.RemoveSelectedObject(this);
     }
     else
     {
         this.selected = true;
         mode.AddSelectedObject(this);
     }
 }
        }                                                                                                        //mxd

        //mxd
        override protected void PerformAutoSelection()
        {
            if (!performautoselection)
            {
                return;
            }
            if (Triangles > 0)
            {
                this.selected = true;
                mode.AddSelectedObject(this);
            }

            performautoselection = false;
        }
Ejemplo n.º 3
0
        // Constructor
        public BaseVisualThing(BaseVisualMode mode, Thing t) : base(t)
        {
            this.mode = mode;

            // Find thing information
            info = General.Map.Data.GetThingInfo(Thing.Type);

            //mxd. When true, the thing can be moved below floor/above ceiling
            nointeraction = (info.Actor != null && info.Actor.GetFlagValue("nointeraction", false));

            //mxd. Find sprite textures
            sprites = new ImageData[info.SpriteFrame.Length];
            for (int i = 0; i < info.SpriteFrame.Length; i++)
            {
                sprites[i] = General.Map.Data.GetSpriteImage(info.SpriteFrame[i].Sprite);
                if (sprites[i] != null)
                {
                    sprites[i].AddReference();
                }
            }

            //mxd
            if (mode.UseSelectionFromClassicMode && t.Selected)
            {
                this.selected = true;
                mode.AddSelectedObject(this);
            }

            // We have no destructor
            GC.SuppressFinalize(this);
        }
Ejemplo n.º 4
0
        // Select button released
        public virtual void OnSelectEnd()
        {
            mode.UnlockTarget();

            // Was dragging?
            if (uvdragging)
            {
                // Dragging stops now
                uvdragging = false;
            }
            else
            {
                // Add/remove selection
                if (this.selected)
                {
                    this.selected = false;
                    mode.RemoveSelectedObject(this);
                }
                else
                {
                    this.selected = true;
                    mode.AddSelectedObject(this);
                }
            }
        }
        // Constructor
        public BaseVisualVertex(BaseVisualMode mode, Vertex v, bool ceilingVertex)
            : base(v, ceilingVertex)
        {
            this.mode   = mode;
            cageradius2 = DEFAULT_SIZE * General.Settings.GZVertexScale3D * Angle2D.SQRT2;
            cageradius2 = cageradius2 * cageradius2;

            // Synchronize selection?
            if (mode.UseSelectionFromClassicMode && v.Selected &&
                (General.Map.ViewMode == ViewMode.Normal ||
                 (!ceilingVertex && General.Map.ViewMode == ViewMode.FloorTextures) ||
                 (ceilingVertex && General.Map.ViewMode == ViewMode.CeilingTextures)))
            {
                this.selected = true;
                mode.AddSelectedObject(this);
            }

            changed = true;
            Update();
        }