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


C# RelayInfo.IsSwitched方法代码示例

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


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

示例1: OnResponse

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            Handeling.Armor = info.IsSwitched(1);
            Handeling.MagicalArmor = info.IsSwitched(2);
            Handeling.Shields = info.IsSwitched(3);
            Handeling.Colored = info.IsSwitched(4);

            from.SendGump(new RVSSetup_Rules(Handeling));
        }
开发者ID:nick12344356,项目名称:The-Basement,代码行数:11,代码来源:RVSSetup_Rules_Armor.cs

示例2: OnResponse

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            Handeling.Weapons = info.IsSwitched(1);
            Handeling.Magical = info.IsSwitched(2);
            Handeling.Poisoned = info.IsSwitched(3);
            Handeling.RunicWeapons = info.IsSwitched(4);

            from.SendGump(new FieldSetup_Rules(Handeling));
        }
开发者ID:nick12344356,项目名称:The-Basement,代码行数:11,代码来源:FieldSetup_Rules_Weapons.cs

示例3: OnResponse

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;
			
            Handeling.RvS = info.IsSwitched(1);
            Handeling.Orcs = info.IsSwitched(2);
            Handeling.Lizardmen = info.IsSwitched(3);
            Handeling.Ratmen = info.IsSwitched(4);
            Handeling.Undead = info.IsSwitched(5);

            from.SendGump(new RVSSetup_Rules(Handeling));
        }
开发者ID:nick12344356,项目名称:The-Basement,代码行数:12,代码来源:RVSSetup_Rules_Monsters.cs

示例4: OnResponse

		public override void OnResponse( NetState sender, RelayInfo info )
		{
			if ( info.ButtonID == 1 )
			{
				Container pack = m_Mobile.Backpack;

				if ( pack != null && m_Item.IsChildOf( pack ) )
				{
					if ( pack.ConsumeTotal( typeof( Silver ), m_Definition.SilverCost ) )
					{
						int hue;

						if ( m_Item is SpellScroll )
							hue = 0;
						else if ( info.IsSwitched( 1 ) )
							hue = m_Faction.Definition.HuePrimary;
						else
							hue = m_Faction.Definition.HueSecondary;

						FactionItem.Imbue( m_Item, m_Faction, true, hue );
					}
					else
					{
						m_Mobile.SendLocalizedMessage( 1042204 ); // You do not have enough silver.
					}
				}
			}

			if ( m_Tool != null && !m_Tool.Deleted && m_Tool.UsesRemaining > 0 )
				m_Mobile.SendGump( new CraftGump( m_Mobile, m_CraftSystem, m_Tool, m_Notice ) );
			else if ( m_Notice is string )
				m_Mobile.SendMessage( (string) m_Notice );
			else if ( m_Notice is int && ((int)m_Notice) > 0 )
				m_Mobile.SendLocalizedMessage( (int) m_Notice );
		}
开发者ID:Godkong,项目名称:Origins,代码行数:35,代码来源:FactionImbueGump.cs

示例5: OnResponse

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile m = sender.Mobile;

            if (info.ButtonID == 1)
            {
                if (m.InRange(m_Healer, 16))
                {
                    if (info.IsSwitched(0) && Banker.Withdraw(m, m_Price))
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerStateCallback(PaidRes), m);
                        m.Frozen = true;
                    }

                    else
                    {
                        m.Resurrect();
                        m.PlaySound(0x214);
                        m.FixedEffect(0x376A, 10, 16);
                    }
                }
                else
                    m.SendMessage("You have wandered to far off to gain any benefits from the healers practices.");
            }
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:25,代码来源:PaidFullHealerGump.cs

示例6: OnResponse

        public override void OnResponse( NetState state, RelayInfo info )
        {
            Mobile from = state.Mobile;

            if( info.IsSwitched( (int)Buttons.rdoYesJoin ) )
            {
                if( ScavengerSignup.signupEnabled && from is PlayerMobile )
                {
                    ScavengerBasket newBasket = new ScavengerBasket( (PlayerMobile)from );
                    if( !from.Backpack.CheckHold( from, newBasket, false ) )
                    {
                        from.SendMessage( "Your backpack is too full to even consider entering this event!" );
                        newBasket.Delete();
                        return;
                    }

                    from.AddToBackpack( newBasket );
                    ScavengerSignup.ScavengerBaskets.Add( newBasket );
                    from.SendMessage( "You are now entered in the scavenger hunt. Use the supplied basket to gather the scavenger items!" );
                }
                else
                {
                    from.SendMessage( "You have waited too long and signup for the scavenger hunt has ended" );
                }
            }
            else
            {
                from.SendMessage( "You have not been entered into the scavenger hunt event" );
            }
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:30,代码来源:ScavengerSignupGump.cs

示例7: OnResponse

/* The main thing from NetState state you will want is state.Mobile.  This is the Mobile that clicked the button.
 * RelayInfo contains information from the gump like ButtonID, Switches and TextEntries.  We will focus on Switches here.*/
		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;
			if( info.ButtonID == 20 )
			{
				string toSay = "";
/* info.Switches is an int array (int[]).
 * One way I've found to check the switches is to loop through the array
 * and do a switch/case for the SwitchIDs.
 * info.Switches will only contain the ID's if they are checked.
 */
				for( int i = 0; i < info.Switches.Length; i++ )
				{
					int m = info.Switches[i];
					switch( m )
					{
						case 1: toSay += "Radio 1 : "; break;
						case 2: toSay += "Radio 2 : "; break;
						case 3: toSay += "Radio 3 : "; break;
						case 4: toSay += "Radio 4 : "; break;
						case 10: toSay += "Check 1, "; break;
						case 11: toSay += "Check 2, "; break;
						case 12: toSay += "Check 3, "; break;
						case 13: toSay += "Check 4, "; break;
					}
				}
				from.SendMessage( toSay );

/* Another way of doing it is by doing info.IsSwitched( SwitchID ).
 * This call will return a true/false depending on if the switch is checked.
 */
				toSay = "";
				if( info.IsSwitched( 1 ) )
					toSay += "Radio 1 : ";
				else if( info.IsSwitched( 2 ) )
					toSay += "Radio 2 : ";
				else if( info.IsSwitched( 3 ) )
					toSay += "Radio 3 : ";
				else if( info.IsSwitched( 4 ) )
					toSay += "Radio 4 : ";

				toSay += String.Format( "Check 1={0}, 2={1}, 3={2}, 4={3}", info.IsSwitched( 10 ), info.IsSwitched( 11 ), info.IsSwitched( 12 ), info.IsSwitched( 13 ) );
				from.SendMessage( toSay );
			}
		}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:47,代码来源:Switches.cs

示例8: OnResponse

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            base.OnResponse(sender, info);

            PlayerMobile pm = sender.Mobile as PlayerMobile;

            if (!IsMember(pm, this.guild))
                return;

            pm.DisplayGuildTitle = info.IsSwitched(0);

            switch( info.ButtonID )
            {
                //1-3 handled by base.OnResponse
                case 4:
                    {
                        if (IsLeader(pm, this.guild))
                        {
                            pm.SendLocalizedMessage(1013071); // Enter the new guild charter (50 characters max):

                            pm.BeginPrompt(new PromptCallback(SetCharter_Callback), true);	//Have the same callback handle both canceling and deletion cause the 2nd callback would just get a text of ""
                        }
                        break;
                    }
                case 5:
                    {
                        if (IsLeader(pm, this.guild))
                        {
                            pm.SendLocalizedMessage(1013072); // Enter the new website for the guild (50 characters max):
                            pm.BeginPrompt(new PromptCallback(SetWebsite_Callback), true);	//Have the same callback handle both canceling and deletion cause the 2nd callback would just get a text of ""
                        }
                        break;
                    }
                case 6:
                    {
                        //Alliance Roster
                        if (this.guild.Alliance != null && this.guild.Alliance.IsMember(this.guild))
                            pm.SendGump(new AllianceInfo.AllianceRosterGump(pm, this.guild, this.guild.Alliance));

                        break;
                    }
                case 7:
                    {
                        //Resign
                        if (!this.m_IsResigning)
                        {
                            pm.SendLocalizedMessage(1063332); // Are you sure you wish to resign from your guild?
                            pm.SendGump(new GuildInfoGump(pm, this.guild, true));
                        }
                        else
                        {
                            this.guild.RemoveMember(pm, 1063411); // You resign from your guild.
                        }
                        break;
                    }
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:57,代码来源:GuildInfoGump.cs

示例9: OnResponse

        public override void OnResponse(Server.Network.NetState state, RelayInfo info)
        {
            if (info.ButtonID != (int)Buttons.Okay || this.m_Quest == null)
                return;
			
            if (this.m_Quest.ChainID != QuestChain.None && info.IsSwitched((int)Radios.Chain))
            { 
                this.m_Quest.OnResign(true);
            }
						
            if (info.IsSwitched((int)Radios.Quest))
            {
                this.m_Quest.OnResign(false);
            }
						
            if (info.IsSwitched((int)Radios.None) && this.m_Quest.Owner != null)
                this.m_Quest.Owner.SendGump(new MondainQuestGump(this.m_Quest.Owner));
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:18,代码来源:MondainResignGump.cs

示例10: OnResponse

		public override void OnResponse( Server.Network.NetState state, RelayInfo info )
		{		
			if ( info.ButtonID == (int) Buttons.Confirm )
			{
				if ( info.IsSwitched( (int) Buttons.Break ) )
					Confirm( state.Mobile );
				else
					Refuse( state.Mobile );
			}
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:10,代码来源:BaseConfirmGump.cs

示例11: OnResponse

		public override void OnResponse( NetState sender, RelayInfo info )
		{
			Mobile from = sender.Mobile;

            Handeling.Spells = info.IsSwitched(1);

            switch (info.ButtonID)
            {
                case 0: // Closeing
                    {
                        from.SendGump(new DuelSetup_Rules(Handeling));
                        break;
                    }
                case 2: // First Circle
                    {
                        from.SendGump(new DuelSetup_Rules_Spells_1st(Handeling));
                        break;
                    }
                case 3: // Second Circle
                    {
                        from.SendGump(new DuelSetup_Rules_Spells_2nd(Handeling));
                        break;
                    }
                case 4: // Third Circle
                    {
                        from.SendGump(new DuelSetup_Rules_Spells_3rd(Handeling));
                        break;
                    }
                case 5: // Fourth Circle
                    {
                        from.SendGump(new DuelSetup_Rules_Spells_4th(Handeling));
                        break;
                    }
                case 6: // Fifth Circle
                    {
                        from.SendGump(new DuelSetup_Rules_Spells_5th(Handeling));
                        break;
                    }
                case 7: // Sixth Circle
                    {
                        from.SendGump(new DuelSetup_Rules_Spells_6th(Handeling));
                        break;
                    }
                case 8: // Seventh Circle
                    {
                        from.SendGump(new DuelSetup_Rules_Spells_7th(Handeling));
                        break;
                    }
                case 9: // Eigth Circle
                    {
                        from.SendGump(new DuelSetup_Rules_Spells_8th(Handeling));
                        break;
                    }
            }
		}
开发者ID:nick12344356,项目名称:The-Basement,代码行数:55,代码来源:DuelSetup_Rules_Spells.cs

示例12: OnResponse

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile m = sender.Mobile;

            if (info.ButtonID == 1)
            {
                if (m_Struct.Event == null || m_Struct.Event.Deleted)
                {
                    m.SendGump(new IndexGump(0, m.AccessLevel >= AccessLevel.Administrator));
                    m.SendMessage("The event has been deleted, thus the timer could not be added.");
                    return;
                }

                bool add = true;

                string name = info.GetTextEntry(0).Text;
                int hour;
                int minute;

                if(!Int32.TryParse(info.GetTextEntry(1).Text, out hour))
                    add = false;

                if (!Int32.TryParse(info.GetTextEntry(2).Text, out minute))
                    add = false;

                bool[] barray = new bool[7];
                for (int i = 0; i < 7; i++)
                    barray[i] = info.IsSwitched(i);

                if (!add)
                {
                    m.SendGump(this);
                    m.SendMessage("The hour or minute are not valid Int32 values.");
                }

                else if (!AutoStartEvent.Enlisted.Contains(m_Struct))
                {
                    m_Struct.Name = name;
                    m_Struct.Hour = hour;
                    m_Struct.Minute = minute;
                    m_Struct.Days = barray;

                    if (m_Struct.Days[AutoStartEvent.NowDayOfWeek] && (AutoStartEvent.Now.Hour > m_Struct.Hour || (AutoStartEvent.Now.Hour == m_Struct.Hour && AutoStartEvent.Now.Minute > m_Struct.Minute)))
                        m_Struct.LastExecutedDay = AutoStartEvent.Now.Day;

                    m_Struct.SetNextExecution();
                    AutoStartEvent.AddNewTimedEvent(m_Struct);
                    m.SendGump(new IndexGump(0, m.AccessLevel >= AccessLevel.Administrator));
                    m.SendMessage("The timer has been succesfully added.");
                }

                else
                    m.SendMessage("Someone else has edited this entry in the meantime.");
            }
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:55,代码来源:Gumps.cs

示例13: OnResponse

        public override void OnResponse( GameClient sender, RelayInfo info )
        {
            if ( info.ButtonID == 7 )
            {
                if ( info.IsSwitched( 1 ) )
                {
                    Mobile from = sender.Mobile;

                    int price = m_Entry.GetPrice( from );

                    if ( from.Backpack == null || price > (int) m_Collection.Table[from] )
                        return;

                    if ( m_Entry.Type == typeof( RewardTitle ) )
                    {
                        PlayerMobile pm = from as PlayerMobile;

                        if ( pm.CollectionTitles.Contains( m_Entry.RewardTitle ) )
                        {
                            pm.SendLocalizedMessage( 1073626 ); // You already have that title!
                        }
                        else
                        {
                            m_Collection.Table[from] = (int) m_Collection.Table[from] - price;

                            pm.CollectionTitles.Add( m_Entry.RewardTitle );
                            pm.SendLocalizedMessage( 1073625, String.Format( "#{0}", m_Entry.RewardTitle.ToString() ) ); // The title "~1_TITLE~" has been bestowed upon you.

                            pm.CurrentCollectionTitle = pm.CollectionTitles.Count - 1;
                            pm.PlaySound( 0x5A7 );
                        }
                    }
                    else
                    {
                        m_Collection.Table[from] = (int) m_Collection.Table[from] - price;

                        Item reward = Activator.CreateInstance( m_Entry.Type, m_Entry.Args ) as Item;

                        if ( m_Hue != 0 )
                            reward.Hue = m_Hue;

                        m_Collection.OnRewardCreated( from, reward );

                        from.Backpack.DropItem( reward );

                        from.SendLocalizedMessage( 1073621 ); // Your reward has been placed in your backpack.
                        from.PlaySound( 0x5A7 );
                    }

                    m_Entry.OnRewardChosen( from );
                }

                sender.Mobile.SendGump( new CollectionRewardGump( m_Collection, m_From ) );
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:55,代码来源:CollectionConfirmReward.cs

示例14: OnResponse

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            Handeling.Anatomy = info.IsSwitched(1);
            Handeling.DetectHidden = info.IsSwitched(2);
            Handeling.EvaluatingIntelligence = info.IsSwitched(3);
            Handeling.Hiding = info.IsSwitched(4);
            Handeling.Poisoning = info.IsSwitched(5);
            Handeling.Snooping = info.IsSwitched(6);
            Handeling.Stealing = info.IsSwitched(7);
            Handeling.SpiritSpeak = info.IsSwitched(8);
            Handeling.Stealth = info.IsSwitched(9);

            from.SendGump(new DuelSetup_Rules(Handeling));
        }
开发者ID:nick12344356,项目名称:The-Basement,代码行数:16,代码来源:DuelSetup_Rules_Skills.cs

示例15: OnResponse

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            bool id = info.ButtonID == 1;
            bool hasaccepted = info.IsSwitched(0);

            if (id && hasaccepted)
                ToSRulesChecker.SetAccepted(sender.Mobile);

            else
                sender.Mobile.SendGump(this);
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:11,代码来源:TosRulesVerifier.cs


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