Example #1
0
        protected override void OnTick()
        {
            if (m_From.NetState == null || m_From.Deleted || m_Target.Deleted || m_From.Map != m_Target.Map)
            {
                Stop();
                return;
            }

            Party p = Engines.PartySystem.Party.Get(m_From);

            if (p != null)
            {
                //Refresh Gump
                m_From.CloseGump(typeof(PartyRadarGump));

                NetState ns = m_From.NetState;
                if (ns != null)
                {
                    List <Gump> gumps = new List <Gump>(ns.Gumps);

                    for (int i = 0; i < gumps.Count; ++i)
                    {
                        if (gumps[i].GetType() == typeof(PartyRadarGump))
                        {
                            ns.RemoveGump(i);
                        }
                    }
                }
                if (!m_From.HasGump(typeof(PartyRadarGump)))
                {
                    PartyRadarGump pr = new PartyRadarGump(m_From, m_Target);
                    m_From.SendGump(pr);                       // Custom Radar Gump
                }

                // can switch pages instead of resending/recycling?
            }
            else
            {
                m_From.CloseGump(typeof(PartyRadarGump));
                Stop();
                return;
            }
        }
		protected override void OnTick()
		{
			if ( m_From.NetState == null || m_From.Deleted || m_Target.Deleted || m_From.Map != m_Target.Map )
			{
				Stop();
				return;
			}

			Party p = Engines.PartySystem.Party.Get( m_From );
			if ( p != null )
			{
				//Refresh Gump
				m_From.CloseGump( typeof (PartyRadarGump));
                                 
			         NetState ns = m_From.NetState;
			        if (ns != null)
				{
    
                        List<Gump> gumps = new List<Gump>( ns.Gumps );
                        
			for ( int i = 0; i < gumps.Count; ++i )
			{
                                if (gumps[i].GetType() == typeof(PartyRadarGump) )
				{
                                          ns.RemoveGump(i);

				}
			}

				}
				if (! m_From.HasGump( typeof( PartyRadarGump)))
				{
					PartyRadarGump pr = new PartyRadarGump( m_From, m_Target );
					m_From.SendGump( pr ); // Custom Radar Gump
				}

				// can switch pages instead of resending/recycling?
			}
			else
			{
				m_From.CloseGump( typeof (PartyRadarGump));
				Stop();
				return;
			}
		}
Example #3
0
		public void Add( Mobile m )
		{
			PartyMemberInfo mi = this[m];

			if ( mi == null )
			{
				m_Members.Add( new PartyMemberInfo( m ) );
				m.Party = this;

				Packet memberList = new PartyMemberList( this );
				Packet attrs  = new MobileAttributesN( m );

				for ( int i = 0; i < m_Members.Count; ++i )
				{
					Mobile f = ((PartyMemberInfo)m_Members[i]).Mobile;

					f.Send( memberList );

					if (! f.HasGump( typeof( PartyRadarGump)))
					{
						PartyRadarGump pr = new PartyRadarGump( f, m );
						f.SendGump( pr ); // Custom Radar Gump

						GumpTimer gumpTimer = new GumpTimer( f, m );
						gumpTimer.Start();

						GumpTimer gumpTimerT = new GumpTimer( m, f );
						gumpTimerT.Start();
					}

					if ( f != m )
					{
						f.Send( new MobileStatusCompact( m.CanBeRenamedBy( f ), m ) );
						f.Send( attrs );
						m.Send( new MobileStatusCompact( f.CanBeRenamedBy( m ), f ) );
						m.Send( new MobileAttributesN( f ) );
					}
				}
			}
		}