public override void OnSingleClick(Mobile from) { base.OnSingleClick(from); LabelTo(from, "Active: " + m_Activated.ToString()); LabelTo(from, "Area: " + m_TopLeftAreaPoint.ToString() + " to " + m_BottomRightAreaPoint.ToString()); }
public override string ToString() { string output = ""; for (int i = 0; i < DirectionalItemIDs.GetLength(0); i++) { for (int j = 0; j < DirectionalItemIDs.GetLength(1); j++) { output += DirectionalItemIDs[i, j] + ","; } } return(Offset.ToString() + " " + output); }
public override void OnResponse( NetState sender, RelayInfo info ) { Point3D toSet; bool shouldSet, shouldSend; switch ( info.ButtonID ) { case 1: // Current location { toSet = m_Mobile.Location; shouldSet = true; shouldSend = true; break; } case 2: // Pick location { m_Mobile.Target = new InternalTarget( m_Property, m_Mobile, m_Object, m_Stack, m_Page, m_List ); toSet = Point3D.Zero; shouldSet = false; shouldSend = false; break; } case 3: // Use values { TextRelay x = info.GetTextEntry( 0 ); TextRelay y = info.GetTextEntry( 1 ); TextRelay z = info.GetTextEntry( 2 ); toSet = new Point3D( x == null ? 0 : Utility.ToInt32( x.Text ), y == null ? 0 : Utility.ToInt32( y.Text ), z == null ? 0 : Utility.ToInt32( z.Text ) ); shouldSet = true; shouldSend = true; break; } default: { toSet = Point3D.Zero; shouldSet = false; shouldSend = true; break; } } if ( shouldSet ) { try { CommandLogging.LogChangeProperty( m_Mobile, m_Object, m_Property.Name, toSet.ToString() ); m_Property.SetValue( m_Object, toSet, null ); PropertiesGump.OnValueChanged( m_Object, m_Property, m_Stack ); } catch { m_Mobile.SendMessage( "An exception was caught. The property may not have changed." ); } } if ( shouldSend ) m_Mobile.SendGump( new PropertiesGump( m_Mobile, m_Object, m_Stack, m_List, m_Page ) ); }
public string GetSextantLocation(Point3D pnt) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(pnt, m_Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) return String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); return pnt.ToString(); }
private object GetAnchorName() { if(m_Anchor == null) return "None"; if(m_Anchor is Mobile) return ((Mobile)m_Anchor).Name; if(m_Anchor is Item) { if(((Item)m_Anchor).Name != null) return ((Item)m_Anchor).Name; return ((Item)m_Anchor).LabelNumber; } if(m_Anchor is StaticTarget) return String.Format("{0} {1}", ((StaticTarget)m_Anchor).Name, ((StaticTarget)m_Anchor).Location.ToString()); if(m_Anchor is LandTarget) return String.Format("{0} {1}", ((LandTarget)m_Anchor).Name, ((LandTarget)m_Anchor).Location.ToString()); Point3D p = new Point3D(m_Anchor); return p.ToString(); }
public static string FormatSextant(Point3D p, Map map) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(p, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { return String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); } return p.ToString(); }