예제 #1
0
        public static RegionEventArgs Clear()
        {
            RegionEventArgs e = new RegionEventArgs();

            e.m_Action = RegionActions.ClearRegion;
            return(e);
        }
예제 #2
0
        public static RegionEventArgs PriorityChange(int newPriority)
        {
            RegionEventArgs e = new RegionEventArgs();

            e.m_X      = newPriority;
            e.m_Action = RegionActions.ChangePriority;
            return(e);
        }
예제 #3
0
        public static RegionEventArgs ChangeLogoutDelay(bool state)
        {
            RegionEventArgs e = new RegionEventArgs();

            e.m_Action      = RegionActions.ChangeLogoutDelay;
            e.m_LogoutDelay = state;
            return(e);
        }
예제 #4
0
        public static RegionEventArgs NewSubregion(string subregionName)
        {
            RegionEventArgs e = new RegionEventArgs();

            e.m_Action = RegionActions.AddSubregion;
            e.m_Name   = subregionName;
            return(e);
        }
예제 #5
0
        public static RegionEventArgs ChangeName(string newName)
        {
            RegionEventArgs e = new RegionEventArgs();

            e.m_Action = RegionActions.RenameRegion;
            e.m_Name   = newName;
            return(e);
        }
예제 #6
0
        public static RegionEventArgs ChangeType(string newType)
        {
            RegionEventArgs e = new RegionEventArgs();

            e.m_Action   = RegionActions.ChangeTypeName;
            e.m_TypeName = newType;
            return(e);
        }
예제 #7
0
        public static RegionEventArgs ChangeMusic(string newMusic)
        {
            RegionEventArgs e = new RegionEventArgs();

            e.m_Action    = RegionActions.ChangeMusicName;
            e.m_MusicName = newMusic;
            return(e);
        }
예제 #8
0
        public static RegionEventArgs ChangeRuneName(string newRuneName)
        {
            RegionEventArgs e = new RegionEventArgs();

            e.m_Action   = RegionActions.ChangeRuneName;
            e.m_RuneName = newRuneName;
            return(e);
        }
예제 #9
0
        public static RegionEventArgs ChangeGuardsDisabled(bool state)
        {
            RegionEventArgs e = new RegionEventArgs();

            e.m_Action         = RegionActions.ChangeGuardsDisabled;
            e.m_GuardsDisabled = state;
            return(e);
        }
예제 #10
0
        public static RegionEventArgs ChangeSmartNoHousing(bool state)
        {
            RegionEventArgs e = new RegionEventArgs();

            e.m_Action         = RegionActions.ChangeSmartNoHousing;
            e.m_SmartNoHousing = state;
            return(e);
        }
예제 #11
0
        public static RegionEventArgs ChangeZ(int minZ, int maxZ)
        {
            RegionEventArgs e = new RegionEventArgs();

            e.m_Action = RegionActions.ChangeZ;
            e.m_MinZ   = minZ;
            e.m_MaxZ   = maxZ;
            return(e);
        }
예제 #12
0
        public static RegionEventArgs ChangeGo(int x, int y, int z)
        {
            RegionEventArgs e = new RegionEventArgs();

            e.m_Action = RegionActions.ChangeGo;
            e.m_X      = x;
            e.m_Y      = y;
            e.m_Z      = z;
            return(e);
        }
예제 #13
0
        private void ButtonAddSubsection_Click(object sender, System.EventArgs e)
        {
            if (TextBoxSubregionName.Text.Length == 0)
            {
                MessageBox.Show("Please enter a name for the subsection");
                return;
            }

            OnRegionChanged(RegionEventArgs.NewSubregion(TextBoxSubregionName.Text));
        }
예제 #14
0
 private void CheckBoxSet_CheckedChanged(object sender, System.EventArgs e)
 {
     if (CheckBoxSet.Checked)
     {
         if (!m_Updating)
         {
             OnRegionChanged(RegionEventArgs.SetGo());
         }
     }
 }
예제 #15
0
 private void ButtonDelRegion_Click(object sender, System.EventArgs e)
 {
     if (MessageBox.Show(
             this,
             "This will delete the current region from its facet. Are you sure?",
             "Confirm region deletion",
             MessageBoxButtons.YesNo,
             MessageBoxIcon.Question) == DialogResult.Yes)
     {
         OnRegionChanged(RegionEventArgs.Delete());
     }
 }
예제 #16
0
 private void ButtonClearRegion_Click(object sender, System.EventArgs e)
 {
     if (MessageBox.Show(
             this,
             "This will remove all the rectangles and subregions from the current region. Are you sure?",
             "Confirm region clear",
             MessageBoxButtons.YesNo,
             MessageBoxIcon.Question) == DialogResult.Yes)
     {
         OnRegionChanged(RegionEventArgs.Clear());
     }
 }
예제 #17
0
        private void TextBoxRegionName_TextChanged(object sender, System.EventArgs e)
        {
            if (TextBoxRegionName.Text.Length == 0)
            {
                return;
            }

            if (!m_Updating)
            {
                OnRegionChanged(RegionEventArgs.ChangeName(TextBoxRegionName.Text));
            }
        }
예제 #18
0
        private void NumPriority_ValueChanged(object sender, System.EventArgs e)
        {
            int val = (int)NumPriority.Value;

            if (val > 100)
            {
                val = 100;
            }
            if (val < 0)
            {
                val = 0;
            }

            if (!m_Updating)
            {
                OnRegionChanged(RegionEventArgs.PriorityChange(val));
            }
        }
예제 #19
0
        private void ChangePos()
        {
            int x = (int)NumX.Value;
            int y = (int)NumY.Value;
            int z = (int)NumZ.Value;

            if (x < 0)
            {
                x = 0;
            }
            if (y < 0)
            {
                y = 0;
            }
            if (z < -128)
            {
                z = -128;
            }

            if (x >= m_MapWidth)
            {
                x = m_MapWidth - 1;
            }
            if (y >= m_MapHeight)
            {
                y = m_MapHeight - 1;
            }
            if (z > 127)
            {
                z = 127;
            }

            if (!m_Updating)
            {
                OnRegionChanged(RegionEventArgs.ChangeGo(x, y, z));
            }
        }
예제 #20
0
 public static RegionEventArgs ChangeSmartNoHousing(bool state)
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.ChangeSmartNoHousing;
     e.m_SmartNoHousing = state;
     return e;
 }
예제 #21
0
 public static RegionEventArgs ChangeType( string newType)
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.ChangeTypeName;
     e.m_TypeName = newType;
     return e;
 }
예제 #22
0
 public static RegionEventArgs ChangeZ(int minZ, int maxZ)
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.ChangeZ;
     e.m_MinZ = minZ;
     e.m_MaxZ = maxZ;
     return e;
 }
예제 #23
0
 public static RegionEventArgs Clear()
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.ClearRegion;
     return e;
 }
예제 #24
0
 protected virtual void OnRegionChanged( RegionEventArgs e )
 {
     RegionChanged( this, e );
 }
예제 #25
0
 public static RegionEventArgs ChangeLogoutDelay(bool state)
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.ChangeLogoutDelay;
     e.m_LogoutDelay = state;
     return e;
 }
예제 #26
0
        private void regionPanel_RegionChanged(object sender, RegionEventArgs e)
        {
            MapRegion region = Tree.SelectedNode.Tag as MapRegion;

            m_Modified = true;

            switch (e.Action)
            {
                case RegionActions.DeleteRegion:

                    MapRegion parentRegion = Tree.SelectedNode.Parent.Tag as MapRegion;
                    if (parentRegion != null)
                        parentRegion.SubRegions.Remove(region);

                    // Delete the tree node
                    Tree.Nodes.Remove(Tree.SelectedNode);
                    SelectPanel();
                    break;

                case RegionActions.AddSubregion:

                    // Make a new subregion
                    MapRegion subregion = new MapRegion((string)e.Data);
                    region.SubRegions.Add(subregion);

                    TreeNode subregionTree = new TreeNode((string)e.Data);
                    subregionTree.Tag = subregion;
                    Tree.SelectedNode.Nodes.Add(subregionTree);

                    break;

                case RegionActions.ChangeGo:

                    // Change the GO location
                    int[] newGo = e.Data as int[];
                    region.GoLocation.X = newGo[0];
                    region.GoLocation.Y = newGo[1];
                    region.GoLocation.Z = newGo[2];
                    UpdateGoLocation();
                    break;

                case RegionActions.ChangePriority:

                    int newPriority = (int)e.Data;
                    region.Priority = newPriority;
                    break;

                case RegionActions.ClearRegion:

                    region.Area.Clear();
                    Tree.SelectedNode.Nodes.Clear();
                    Map.RemoveAllDrawObjects();
                    RectList.Items.Clear();
                    DisplayedRects.Clear();
                    if ((region.GoLocation.X != -1) && (region.GoLocation.Y != -1))
                    {
                        Map.AddDrawObject(m_CrossHair1, false);
                        Map.AddDrawObject(m_CrossHair2, true);
                    }

                    if (region != null)
                    {
                        region.Area.Clear();
                        region.SubRegions.Clear();
                    }
                    SelectPanel();
                    break;

                case RegionActions.RenameRegion:

                    region.Name = (string)e.Data;
                    Tree.SelectedNode.Text = (string)e.Data;
                    break;

                case RegionActions.ChangeTypeName:

                    region.TypeName = (string)e.Data;
                    break;

                case RegionActions.ChangeRuneName:

                    region.RuneName = (string)e.Data;
                    break;

                case RegionActions.ChangeMusicName:

                    region.MusicName = (string)e.Data;
                    break;

                case RegionActions.SetGo:
                    m_SetGo = true;
                    break;

                case RegionActions.ChangeZ:

                    int[] newZ = e.Data as int[];
                    region.MinZ = newZ[0];
                    region.MaxZ = newZ[1];
                    break;

                case RegionActions.ChangeLogoutDelay:

                    if((bool)e.Data)
                        region.LogoutDelayActive = XmlBool.True;
                    else
                        region.LogoutDelayActive = XmlBool.False;
                    break;

                case RegionActions.ChangeGuardsDisabled:

                    if ((bool)e.Data)
                        region.GuardsDisabled = XmlBool.True;
                    else
                        region.GuardsDisabled = XmlBool.False;
                    break;

                case RegionActions.ChangeSmartNoHousing:

                    if ((bool)e.Data)
                        region.SmartNoHousing = XmlBool.True;
                    else
                        region.SmartNoHousing = XmlBool.False;
                    break;
            }
        }
예제 #27
0
 public static RegionEventArgs SetGo()
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.SetGo;
     return e;
 }
예제 #28
0
 public static RegionEventArgs ChangeRuneName(string newRuneName)
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.ChangeRuneName;
     e.m_RuneName = newRuneName;
     return e;
 }
예제 #29
0
 public static RegionEventArgs NewSubregion( string subregionName )
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.AddSubregion;
     e.m_Name = subregionName;
     return e;
 }
예제 #30
0
 public static RegionEventArgs ChangeName( string newName )
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.RenameRegion;
     e.m_Name = newName;
     return e;
 }
예제 #31
0
 public static RegionEventArgs Delete()
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.DeleteRegion;
     return e;
 }
예제 #32
0
 public static RegionEventArgs ChangeGuardsDisabled(bool state)
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.ChangeGuardsDisabled;
     e.m_GuardsDisabled = state;
     return e;
 }
예제 #33
0
 public static RegionEventArgs PriorityChange( int newPriority )
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_X = newPriority;
     e.m_Action = RegionActions.ChangePriority;
     return e;
 }
예제 #34
0
 private void CheckBoxSet_Click(object sender, System.EventArgs e)
 {
     OnRegionChanged(RegionEventArgs.SetGo());
 }
예제 #35
0
 public static RegionEventArgs ChangeMusic(string newMusic)
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.ChangeMusicName;
     e.m_MusicName = newMusic;
     return e;
 }
예제 #36
0
 protected virtual void OnRegionChanged(RegionEventArgs e)
 {
     RegionChanged(this, e);
 }
예제 #37
0
 public static RegionEventArgs ChangeGo(int x, int y, int z)
 {
     RegionEventArgs e = new RegionEventArgs();
     e.m_Action = RegionActions.ChangeGo;
     e.m_X = x;
     e.m_Y = y;
     e.m_Z = z;
     return e;
 }