private void bAddLoc_Click(object sender, EventArgs e) { var parent = tCat.SelectedNode; if (parent.Tag == null) { return; } var x = 0; var y = 0; var z = 0; var map = 0; var loc = new Location(); loc.Name = txLoc.Text; if (rClient.Checked) { Client.Calibrate(); 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; var 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, EventArgs e) { CurrentLocation.X = (short)Map.Center.X; CurrentLocation.Y = (short)Map.Center.Y; CurrentLocation.Z = (sbyte)Map.GetMapHeight(Map.Center); SynchData(); }
private void Map_MouseDown(object sender, MouseEventArgs e) { Map.Center = Map.ControlToMap(new Point(e.X, e.Y)); m_Updating = true; m_CurrentLocation.X = (short)Map.Center.X; m_CurrentLocation.Y = (short)Map.Center.Y; m_CurrentLocation.Z = (sbyte)Map.GetMapHeight(); nX.Value = m_CurrentLocation.X; nY.Value = m_CurrentLocation.Y; nZ.Value = m_CurrentLocation.Z; m_Updating = false; }