当前位置: 首页>>代码示例>>C#>>正文


C# Mobile.HasGump方法代码示例

本文整理汇总了C#中Mobile.HasGump方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.HasGump方法的具体用法?C# Mobile.HasGump怎么用?C# Mobile.HasGump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mobile的用法示例。


在下文中一共展示了Mobile.HasGump方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnMovement

 public override void OnMovement(Mobile from, Point3D oldLocation)
 {
     if (from.InRange(this, 3) && from is PlayerMobile)
     {
         if (!from.HasGump(typeof(PopUpGump)))
             from.SendGump(new PopUpGump(Name));
     }
     if (!from.InRange(this, 3) && from is PlayerMobile)
     {
         if (from.HasGump(typeof(PopUpGump)))
             from.CloseGump(typeof(PopUpGump));
     }
 }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:13,代码来源:PopUp.cs

示例2: TryTalkTo

		public void TryTalkTo( Mobile from, bool fromClick )
		{
			if ( !from.Hidden && !from.HasGump( typeOfRaceChangeConfirmGump ) && !RaceChangeConfirmGump.IsPending( from.NetState ) && CanTalkTo( from ) )
				TalkTo( from as PlayerMobile );
			else if ( fromClick )
				DenyTalk( from );
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:7,代码来源:BoonCollector.cs

示例3: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (this.Parent != null || !this.VerifyMove(from))
                return;

            if (!from.InRange(this, 2))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                return;
            }

            if (this.ItemID == 0xA57) // rolled
            {
                Direction dir = PlayerMobile.GetDirection4(from.Location, this.Location);

                if (dir == Direction.North || dir == Direction.South)
                    this.ItemID = 0xA55;
                else
                    this.ItemID = 0xA56;
            }
            else // unrolled
            {
                this.ItemID = 0xA57;

                if (!from.HasGump(typeof(LogoutGump)))
                {
                    CampfireEntry entry = Campfire.GetEntry(from);

                    if (entry != null && entry.Safe)
                        from.SendGump(new LogoutGump(entry, this));
                }
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:33,代码来源:Bedroll.cs

示例4: OnTargetFinish

		protected override void OnTargetFinish( Mobile from )
		{
			if ( !m_Plant.Deleted && m_Plant.PlantStatus < PlantStatus.DecorativePlant && from.InRange( m_Plant.GetWorldLocation(), 3 ) && m_Plant.IsUsableBy( from ) )
			{
				if ( from.HasGump( typeof( MainPlantGump ) ) )
					from.CloseGump( typeof( MainPlantGump ) );

				from.SendGump( new MainPlantGump( m_Plant ) );
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:10,代码来源:PlantPourTarget.cs

示例5: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{

			if ( !from.HasGump( typeof( PSCreditsGump ) ) )
				{
					from.SendGump( new PSCreditsGump());
				}
			else
				from.SendMessage ( "You already have this menu open!" );
            
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:11,代码来源:PowerScrollExchange.cs

示例6: OnDoubleClick

 public override void OnDoubleClick(Mobile from)
 {
     //Fix for crash when 2 gumps opened simultainously
     if (from.HasGump(typeof(Suggestion)))
     {
         from.SendMessage("You already have a suggestion open, please finish with that one before opening a new one!");
         return;
     }
     //End fix for crash
     from.SendGump(new Suggestion());
 }
开发者ID:greeduomacro,项目名称:annox,代码行数:11,代码来源:SuggestionBox.cs

示例7: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			Point2D start = new Point2D( from.X - 3, from.Y - 3 );
			Point2D end = new Point2D( from.X + 3, from.Y + 3 );

			m_Bounds = new Rectangle2D( start, end );

			if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
			}
			else if( AlreadyOwnTent( from ) )
			{
				from.SendMessage( "You already have a tent established." );
			}
			else if( from.HasGump( typeof( ConfirmTentPlacementGump ) ) )
			{
				from.CloseGump( typeof( ConfirmTentPlacementGump ) );
			}
			else if( from.Combatant != null )
			{
				from.SendMessage( "You can't place a tent while fighting!" );
			}
			else if( VerifyPlacement( from, m_Bounds ) )
			{
				TentAddon tent = new TentAddon();
				tent.MoveToWorld( new Point3D( from.X, from.Y, from.Z ), from.Map );

				TentFlap flap = new TentFlap( from, this );
				flap.MoveToWorld( new Point3D( from.X + 2, from.Y, from.Z ), from.Map );

				SecureTentChest chest = new SecureTentChest( from );
				chest.MoveToWorld( new Point3D( from.X - 1, from.Y - 2, from.Z ), from.Map );

				TentBedroll roll = new TentBedroll( from, tent, flap, chest );
				roll.MoveToWorld( new Point3D( from.X, from.Y + 1, from.Z ), from.Map );

				from.SendGump( new ConfirmTentPlacementGump( from, tent, flap, roll, chest, m_Bounds ) );

				this.Delete();
			}
			else
			{
				from.SendMessage( "You cannot place a tent in this area." );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:46,代码来源:TravelTent.cs

示例8: OnDoubleClick

        public override void OnDoubleClick( Mobile from )
        {
        	if( m_Tracks.Count < 1 )
        	{
        		from.SendMessage( "This music box is empty." );
        	}
			else if( IsOwner( from ) )
			{
				if( !IsLockedDown )
					from.SendLocalizedMessage( 502692 ); // This must be in a house and be locked down to work.
				else
				{
					if( from.HasGump( typeof(MusicGump) ) )
						from.CloseGump( typeof(MusicGump) );
					
					from.SendGump( new MusicGump( this ) );
				}
			}
			else
			{
				from.SendLocalizedMessage( 502691 ); // You must be the owner to use this.
			}
        }
开发者ID:PepeBiondi,项目名称:runsa,代码行数:23,代码来源:DawnsMusicBox.cs

示例9: SendGump

        public static bool SendGump(TriggerObject trigObject, Mobile target, string GumpFile, bool closeGump )
        {
            if (GumpFile == null || target == null) return false;

            string path;
            GumpFileMap.TryGetValue(GumpFile.ToLower(), out path);
            if (path == null)
            {
                //path = Path.GetFullPath(ScriptFile);
                path = Path.Combine(Core.BaseDirectory, "UberScripts", GumpFile);
                if (!File.Exists(path))
                {
                    throw new UberScriptException("Script file did not exist at " + path);
                }
                GumpFileMap.Add(GumpFile.ToLower(), path);
            }

            UberGumpBase parsedGump;
            XmlDocument parsedXml;
            if (!Gumps.ContainsKey(path))
            {
                parsedXml = new XmlDocument(); //* create an xml document object.
                parsedXml.Load(path); //* load the XML document from the specified file.
                if (parsedXml == null) return false;
                parsedGump = new UberGumpBase(parsedXml.FirstChild);
                Gumps.Add(path, parsedGump);
            }
            else
            {
                parsedGump = Gumps[path];
            }

            if (closeGump && target.HasGump(typeof(UberScriptGump)))
                target.CloseGump(typeof(UberScriptGump));
            target.SendGump(new UberScriptGump(target, trigObject, parsedGump, GumpFile));
            return true;
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:37,代码来源:ParsedGumps.cs

示例10: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (null == from || 0 == this.m_Lifespan)
                return;

            if (!this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
            else
            {
                if (from.HasGump(typeof(ClockworkStartGump)))
                    from.CloseGump(typeof(ClockworkStartGump));

                from.SendGump(new ClockworkStartGump(this));
            }
        }
开发者ID:m309,项目名称:ForkUO,代码行数:17,代码来源:ClockworkMechanism.cs

示例11: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(this.GetWorldLocation(), 2))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that
            }
            else if (this.m_Tournament != null)
            {
                Tournament tourny = this.m_Tournament.Tournament;

                if (tourny != null)
                {
                    if (this.m_Registrar != null)
                        this.m_Registrar.Direction = this.m_Registrar.GetDirectionTo(this);

                    switch ( tourny.Stage )
                    {
                        case TournamentStage.Fighting:
                            {
                                if (this.m_Registrar != null)
                                {
                                    if (tourny.HasParticipant(from))
                                    {
                                        this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                            0x35, false, "Excuse me? You are already signed up.", from.NetState);
                                    }
                                    else
                                    {
                                        this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                            0x22, false, "The tournament has already begun. You are too late to signup now.", from.NetState);
                                    }
                                }

                                break;
                            }
                        case TournamentStage.Inactive:
                            {
                                if (this.m_Registrar != null)
                                    this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                        0x35, false, "The tournament is closed.", from.NetState);

                                break;
                            }
                        case TournamentStage.Signup:
                            {
                                Ladder ladder = Ladder.Instance;

                                if (ladder != null)
                                {
                                    LadderEntry entry = ladder.Find(from);

                                    if (entry != null && Ladder.GetLevel(entry.Experience) < tourny.LevelRequirement)
                                    {
                                        if (this.m_Registrar != null)
                                        {
                                            this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                                0x35, false, "You have not yet proven yourself a worthy dueler.", from.NetState);
                                        }

                                        break;
                                    }
                                }

                                if (from.HasGump(typeof(AcceptTeamGump)))
                                {
                                    if (this.m_Registrar != null)
                                        this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                            0x22, false, "You must first respond to the offer I've given you.", from.NetState);
                                }
                                else if (from.HasGump(typeof(AcceptDuelGump)))
                                {
                                    if (this.m_Registrar != null)
                                        this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                            0x22, false, "You must first cancel your duel offer.", from.NetState);
                                }
                                else if (from is PlayerMobile && ((PlayerMobile)from).DuelContext != null)
                                {
                                    if (this.m_Registrar != null)
                                        this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                            0x22, false, "You are already participating in a duel.", from.NetState);
                                }
                                else if (!tourny.HasParticipant(from))
                                {
                                    ArrayList players = new ArrayList();
                                    players.Add(from);
                                    from.CloseGump(typeof(ConfirmSignupGump));
                                    from.SendGump(new ConfirmSignupGump(from, this.m_Registrar, tourny, players));
                                }
                                else if (this.m_Registrar != null)
                                {
                                    this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                        0x35, false, "You have already entered this tournament.", from.NetState);
                                }

                                break;
                            }
                    }
                }
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:100,代码来源:Tournament.cs

示例12: OnTarget

            protected override void OnTarget(Mobile from, object targeted)
            {
                if (from == null || targeted == null)
                    return;

                if (targeted is Mobile && ((Mobile)targeted).Player)
                {
                    Mobile pm = targeted as Mobile;
                    
                    // test them for young status
                    if (YoungProtection(from, pm))
                    {
                        SendText(from, 100207, pm.Name); // "{0} is too inexperience to be challenged"
                        return;
                    }

                    // check the owner for existing challenges
                    XmlPoints a = (XmlPoints)XmlAttach.FindAttachment(from, typeof(XmlPoints));

                    if (a != null && !a.Deleted)
                    {
                        // issuing a challenge when one is already in place will initiate cancellation of the current challenge
                        if (a.Challenger != null)
                        {
                            // this will initiate the challenge cancellation timer
                            if (a.m_CancelTimer != null && a.m_CancelTimer.Running)
                            {
                                // timer is running
                                a.SendText(100208, a.m_CancelEnd - DateTime.UtcNow); // "{0} mins remaining until current challenge is cancelled."
                            }
                            else
                            {
                                a.SendText(100209, XmlPoints.CancelTimeout.TotalMinutes);  // "Canceling current challenge.  Please wait {0} minutes"

                                SendText(a.Challenger, 100210, from.Name, XmlPoints.CancelTimeout.TotalMinutes); // "{0} is canceling the current challenge. {1} minutes remain"

                                // start up the cancel challenge timer
                                a.DoTimer(XmlPoints.CancelTimeout);

                                // update the points gumps on the challenger if they are open
                                if (from.HasGump(typeof(PointsGump)))
                                {
                                    a.OnIdentify(from);
                                }
                                // update the points gumps on the challenge target if they are open
                                if (a.Challenger.HasGump(typeof(PointsGump)))
                                {
                                    XmlPoints ca = (XmlPoints)XmlAttach.FindAttachment(a.Challenger, typeof(XmlPoints));
                                    if (ca != null && !ca.Deleted)
                                        ca.OnIdentify(a.Challenger);
                                }
                            }
                            return;
                        }

                        // check the target for existing challengers
                        XmlPoints xa = (XmlPoints)XmlAttach.FindAttachment(pm, typeof(XmlPoints));

                        if (xa != null && !xa.Deleted)
                        {
                            if (xa.Challenger != null)
                            {
                                from.SendMessage(String.Format(a.Text(100211), pm.Name));  // "{0} is already being challenged."
                                return;
                            }
                        }

                        if (from == targeted)
                        {
                            from.SendMessage(a.Text(100212));  // "You cannot challenge yourself."
                        }
                        else
                        {
                            // send the confirmation gump to the challenged player
                            from.SendGump(new IssueChallengeGump(this.m_challenger, pm));
                        }
                    }
                    else
                    {
                        from.SendMessage(SystemText(100213)); // "No XmlPoints support."
                    }
                }
            }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:83,代码来源:XmlPoints.cs

示例13: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( SkillBonus <= 0 || ( Expires && DateTime.UtcNow >= m_ExpireDate ) )
			{
				if ( from.AccessLevel >= AccessLevel.GameMaster )
					from.SendGump( new PropertiesGump( from, this ) );
				SendLocalizedMessageTo( from, 1042544 ); // This item is out of charges.
			}
			else if ( !IsChildOf( from.Backpack ) )
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			else if ( !from.HasGump( typeof(MacingSkillScroll) ) )
				SendGump( from );
			else
				from.SendMessage( "You are already using a skill ball." );
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:15,代码来源:MacingSkillScroll.cs

示例14: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (from.AccessLevel > AccessLevel.Counselor)
            {
                TryCreateMissingBags();

                TryMoveBags();

                if (from.HasGump(typeof(ConfigSelectionGump)))
                {
                    for (int i = 0; i < m_ItemContaiers.Length; i++)
                        m_ItemContaiers[i].DisplayTo(from);

                    from.CloseGump(typeof(ConfigSelectionGump));
                }
                else if (m_SupplyType == SupplyType.Custom)
                {
                    from.SendAsciiMessage("Double click the pad again to open all bags at once.");
                    from.SendGump(new ConfigSelectionGump(from, this));
                }
                else
                    from.SendAsciiMessage("You need to turn the pad on to custom mode to customize the gear.");
            }
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:24,代码来源:EventSupplier.cs

示例15: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( (this.SkillBonus == 0) && (from.AccessLevel < AccessLevel.GameMaster) )
			{
				from.SendMessage("This skill ball isn't charged. Please page for a GM.");
				return;
			}
			else if ( (from.AccessLevel >= AccessLevel.GameMaster) && (this.SkillBonus == 0) )
			{
				from.SendGump( new PropertiesGump( from, this ) );
				return;
			}
			else if ( !IsChildOf( from.Backpack ) )
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
            else if (!from.HasGump(typeof(TempDonationSkillBallGump)))
				from.SendGump( new TempDonationSkillBallGump( from, this ) );
			else
				from.SendMessage("You're already using a skill ball.");
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:19,代码来源:TempDonationSkillBall.cs


注:本文中的Mobile.HasGump方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。