// Edit button released
        public void OnEditEnd()
        {
            if (General.Interface.IsActiveWindow)
            {
                List <Thing> things = mode.GetSelectedThings();
                //mxd
                updateList = new List <BaseVisualThing>();
                foreach (Thing t in things)
                {
                    VisualThing vt = mode.GetVisualThing(t);
                    if (vt != null)
                    {
                        updateList.Add((BaseVisualThing)vt);
                    }
                }

                General.Interface.OnEditFormValuesChanged += Interface_OnEditFormValuesChanged;
                mode.StartRealtimeInterfaceUpdate(SelectionType.Things);
                General.Interface.ShowEditThings(things);
                mode.StopRealtimeInterfaceUpdate(SelectionType.Things);
                General.Interface.OnEditFormValuesChanged -= Interface_OnEditFormValuesChanged;

                updateList.Clear();
                updateList = null;
            }
        }
Beispiel #2
0
        // Thisvirtuals the secotr and neightbours if needed
        public void UpdateSectorGeometry(bool includeneighbours)
        {
            // Rebuild sector
            this.Changed = true;

            // Go for all things in this sector
            foreach (Thing t in General.Map.Map.Things)
            {
                if (t.Sector == this.Sector)
                {
                    if (mode.VisualThingExists(t))
                    {
                        // Update thing
                        BaseVisualThing vt = (mode.GetVisualThing(t) as BaseVisualThing);
                        vt.Changed = true;
                    }
                }
            }

            if (includeneighbours)
            {
                // Also rebuild surrounding sectors, because outside sidedefs may need to be adjusted
                foreach (Sidedef sd in this.Sector.Sidedefs)
                {
                    if (sd.Other != null)
                    {
                        if (mode.VisualSectorExists(sd.Other.Sector))
                        {
                            BaseVisualSector bvs = (BaseVisualSector)mode.GetVisualSector(sd.Other.Sector);
                            bvs.Changed = true;
                        }
                    }
                }
            }
        }
Beispiel #3
0
 // Edit button released
 public virtual void OnEditEnd()
 {
     if (General.Interface.IsActiveWindow)
     {
         List <Thing> things = mode.GetSelectedThings();
         DialogResult result = General.Interface.ShowEditThings(things);
         if (result == DialogResult.OK)
         {
             foreach (Thing t in things)
             {
                 VisualThing vt = mode.GetVisualThing(t);
                 if (vt != null)
                 {
                     (vt as BaseVisualThing).Changed = true;
                 }
             }
         }
     }
 }
Beispiel #4
0
        // Sector brightness change
        public virtual void OnChangeTargetBrightness(bool up)
        {
            if (!Sector.Changed)
            {
                // Change brightness
                mode.CreateUndo("Change sector brightness", UndoGroup.SectorBrightnessChange, Sector.Sector.FixedIndex);

                if (up)
                {
                    Sector.Sector.Brightness = General.Map.Config.BrightnessLevels.GetNextHigher(Sector.Sector.Brightness);
                }
                else
                {
                    Sector.Sector.Brightness = General.Map.Config.BrightnessLevels.GetNextLower(Sector.Sector.Brightness);
                }

                mode.SetActionResult("Changed sector brightness to " + Sector.Sector.Brightness + ".");

                Sector.Sector.UpdateCache();

                // Rebuild sector
                Sector.Changed = true;

                // Go for all things in this sector
                foreach (Thing t in General.Map.Map.Things)
                {
                    if (t.Sector == Sector.Sector)
                    {
                        if (mode.VisualThingExists(t))
                        {
                            // Update thing
                            BaseVisualThing vt = (mode.GetVisualThing(t) as BaseVisualThing);
                            vt.Changed = true;
                        }
                    }
                }
            }
        }
Beispiel #5
0
 // Edit button released
 public virtual void OnEditEnd()
 {
     // Not using any modifier buttons
     if (!General.Interface.ShiftState && !General.Interface.CtrlState && !General.Interface.AltState)
     {
         if (General.Interface.IsActiveWindow)
         {
             List <Thing> things = mode.GetSelectedThings();
             DialogResult result = General.Interface.ShowEditThings(things);
             if (result == DialogResult.OK)
             {
                 foreach (Thing t in things)
                 {
                     VisualThing vt = mode.GetVisualThing(t);
                     if (vt != null)
                     {
                         (vt as BaseVisualThing).Changed = true;
                     }
                 }
             }
         }
     }
 }
Beispiel #6
0
        // This updates this virtual the sector and neightbours if needed
        override public void UpdateSectorGeometry(bool includeneighbours)
        {
            if (isupdating)
            {
                return;
            }

            isupdating = true;
            changed    = true;

            // Not sure what from this part we need, so commented out for now
            SectorData data = mode.GetSectorDataEx(this.Sector); //mxd

            if (data != null)                                    //mxd
            {
                data.Reset(false);

                // Update sectors that rely on this sector
                foreach (KeyValuePair <Sector, bool> s in data.UpdateAlso)
                {
                    SectorData other = mode.GetSectorDataEx(s.Key);
                    if (other != null)
                    {
                        other.Reset(s.Value);
                    }
                }
            }

            // Go for all things in this sector
            foreach (Thing t in General.Map.Map.Things)
            {
                if (t.Sector == this.Sector)
                {
                    if (mode.VisualThingExists(t))
                    {
                        // Update thing
                        BaseVisualThing vt = (BaseVisualThing)mode.GetVisualThing(t);
                        vt.Changed = true;
                    }
                }
            }

            if (includeneighbours)
            {
                // Also rebuild surrounding sectors, because outside sidedefs may need to be adjusted
                foreach (Sidedef sd in this.Sector.Sidedefs)
                {
                    if (sd.Other != null)
                    {
                        if (mode.VisualSectorExists(sd.Other.Sector))
                        {
                            SectorData other = mode.GetSectorDataEx(sd.Other.Sector);

                            if (other != null)
                            {
                                other.Reset(other.UpdateAlso.Count > 0 ? true : false);                                 // biwa. Make sure to reset the update status of dependend sectors. This fixes #250, where 3D floors where not updated when the control sector was sloped using line action 181
                            }
                            else
                            {
                                BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(sd.Other.Sector);
                                vs.Changed = true;
                            }
                        }
                    }
                }
            }

            Sector.UpdateFogColor();             //mxd
            isupdating = false;
        }