Exemplo n.º 1
0
		/// <summary>
		/// Edit existing mobile
		/// </summary>
		private void mMobEdit_Click(object sender, System.EventArgs e)
		{
			if ( tMob.SelectedNode.Tag is BoxMobile )
			{
				TheBox.Forms.Editors.QuickMobile qm = new TheBox.Forms.Editors.QuickMobile();
				qm.Mobile = tMob.SelectedNode.Tag as BoxMobile;

				if ( qm.ShowDialog() == DialogResult.OK )
				{
					// Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
					List<object> list = tCat.SelectedNode.Tag as List<object>;
					// Issue 10 - End

					list.Sort();

					TreeNode node = tCat.SelectedNode;
					tCat.SelectedNode = null;
					tCat.SelectedNode = node;

					tMob.SelectedNode = tMob.Nodes[ list.IndexOf( qm.Mobile ) ];
					UpdateData();
				}
			}
			else if ( tMob.SelectedNode.Tag is BoxSpawn )
			{
				if ( m_SpawnForm == null )
				{
					m_SpawnForm = new TheBox.Forms.Editors.QuickSpawnGroup();
					m_SpawnForm.Spawn = tMob.SelectedNode.Tag as BoxSpawn;

					m_SpawnEdit = true;
					m_ManagingSpawns = true;

					m_SpawnParent = tCat.SelectedNode;

					m_SpawnForm.SpawnReady += new EventHandler(m_SpawnForm_SpawnReady);

					m_SpawnForm.Show();
				}
			}
		}
Exemplo n.º 2
0
		/// <summary>
		/// Add new mobile
		/// </summary>
		private void mMobAddMob_Click(object sender, System.EventArgs e)
		{
			TheBox.Forms.Editors.QuickMobile qm = new TheBox.Forms.Editors.QuickMobile();

			if ( qm.ShowDialog() == DialogResult.OK )
			{
				// Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
				List<object> list = tCat.SelectedNode.Tag as List<object>;
				// Issue 10 - End

				list.Add( qm.Mobile );
				list.Sort();

            TreeNode node = tCat.SelectedNode;
				tCat.SelectedNode = null;
				tCat.SelectedNode = node;

				tMob.SelectedNode = tMob.Nodes[ list.IndexOf( qm.Mobile ) ];

				UpdateData();
			}
		}