private void bAddLoc_Click(object sender, System.EventArgs e) { TreeNode parent = tCat.SelectedNode; if (parent.Tag == null) { return; } int x = 0; int y = 0; int z = 0; int map = 0; Location loc = new Location(); loc.Name = txLoc.Text; if (rClient.Checked) { Ultima.Client.Calibrate(); Ultima.Client.FindLocation(ref x, ref y, ref z, ref map); } else if (rMap.Checked) { map = (int)m_Map.Map; x = m_Map.Center.X; y = m_Map.Center.Y; z = m_Map.GetMapHeight(); } loc.X = (short)x; loc.Y = (short)y; loc.Z = ( sbyte)z; loc.Map = map; TreeNode node = new TreeNode(loc.Name); node.Tag = loc; tLoc.Nodes.Add(node); tLoc.SelectedNode = node; // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert (parent.Tag as List <object>).Add(loc); // Issue 10 - End txLoc.Clear(); txLoc.Focus(); m_Changed = true; EnableButtons(); }
private void bSetCoordinates_Click(object sender, System.EventArgs e) { CurrentLocation.X = (short)Map.Center.X; CurrentLocation.Y = (short)Map.Center.Y; CurrentLocation.Z = (sbyte)Map.GetMapHeight(Map.Center); SynchData(); }