本文整理汇总了C#中Server.Gumps.RelayInfo.GetTextEntry方法的典型用法代码示例。如果您正苦于以下问题:C# RelayInfo.GetTextEntry方法的具体用法?C# RelayInfo.GetTextEntry怎么用?C# RelayInfo.GetTextEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Gumps.RelayInfo
的用法示例。
在下文中一共展示了RelayInfo.GetTextEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnResponse
public override void OnResponse( NetState sender, RelayInfo info )
{
PlayerMobile pm = sender.Mobile as PlayerMobile;
if( pm == null || pm.Guild != null )
return; //Sanity
switch( info.ButtonID )
{
case 1:
{
TextRelay tName = info.GetTextEntry( 5 );
TextRelay tAbbrev = info.GetTextEntry( 6 );
string guildName = (tName == null) ? "" : tName.Text;
string guildAbbrev = (tAbbrev == null) ? "" : tAbbrev.Text;
guildName = Utility.FixHtml( guildName.Trim() );
guildAbbrev = Utility.FixHtml( guildAbbrev.Trim() );
if( guildName.Length <= 0 )
pm.SendLocalizedMessage( 1070884 ); // Guild name cannot be blank.
else if( guildAbbrev.Length <= 0 )
pm.SendLocalizedMessage( 1070885 ); // You must provide a guild abbreviation.
else if( guildName.Length > Guild.NameLimit )
pm.SendLocalizedMessage( 1063036, Guild.NameLimit.ToString() ); // A guild name cannot be more than ~1_val~ characters in length.
else if( guildAbbrev.Length > Guild.AbbrevLimit )
pm.SendLocalizedMessage( 1063037, Guild.AbbrevLimit.ToString() ); // An abbreviation cannot exceed ~1_val~ characters in length.
else if( Guild.FindByAbbrev( guildAbbrev ) != null || !BaseGuildGump.CheckProfanity( guildAbbrev ) )
pm.SendLocalizedMessage( 501153 ); // That abbreviation is not available.
else if( Guild.FindByName( guildName ) != null || !BaseGuildGump.CheckProfanity( guildName ) )
pm.SendLocalizedMessage( 1063000 ); // That guild name is not available.
else if( !Banker.Withdraw( pm, Guild.RegistrationFee ) )
pm.SendLocalizedMessage( 1063001, Guild.RegistrationFee.ToString() ); // You do not possess the ~1_val~ gold piece fee required to create a guild.
else
{
pm.SendLocalizedMessage( 1060398, Guild.RegistrationFee.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.
pm.SendGump(new GuildForm());
pm.SendLocalizedMessage( 1063238 ); // Your new guild has been founded.
pm.Guild = new Guild( pm, guildName, guildAbbrev );
}
break;
}
case 2:
{
pm.AcceptGuildInvites = !pm.AcceptGuildInvites;
if( pm.AcceptGuildInvites )
pm.SendLocalizedMessage( 1070699 ); // You are now accepting guild invitations.
else
pm.SendLocalizedMessage( 1070698 ); // You are now ignoring guild invitations.
break;
}
}
}
示例2: 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.");
}
}
示例3: OnResponse
public override void OnResponse(NetState sender, RelayInfo info)
{
Mobile from = sender.Mobile;
this.caller = sender.Mobile;
switch (info.ButtonID)
{
case 1:
{
TextRelay entrySphereAcc = info.GetTextEntry(10);
this.textSphereAcc = (entrySphereAcc == null ? "" : entrySphereAcc.Text.Trim());
TextRelay entrySphereChar = info.GetTextEntry(11);
this.textSphereChar = (entrySphereChar == null ? "" : entrySphereChar.Text.Trim());
TextRelay entryRunUOAcc = info.GetTextEntry(12);
this.textRunUOAcc = (entryRunUOAcc == null ? "" : entryRunUOAcc.Text.Trim());
TextRelay entryRunUOChar = info.GetTextEntry(13);
this.textRunUOChar = (entryRunUOChar == null ? "" : entryRunUOChar.Text.Trim());
ArrayList Selections = new ArrayList(info.Switches);
if (Selections.Contains(20))
this.importSkills = true;
else
this.importSkills = false;
if (Selections.Contains(21))
this.importItensToPlayer = true;
else
this.importItensToPlayer = false;
if (Selections.Contains(22))
this.importItensToStaff = true;
else
this.importItensToStaff = false;
StartImport();
break;
}
case 0:
default:
caller.SendMessage("Importacao CANCELADA.");
break;
}
}
示例4: OnResponse
public override void OnResponse( NetState sender, RelayInfo info )
{
Mobile from = sender.Mobile;
int button = info.ButtonID - 1;
if ( m_Type == -1 )
{
if ( button >= 0 && button < m_Types.Length )
from.SendGump( new AddStairsGump( button ) );
}
else
{
if ( button >= 0 && button < 4 )
{
TextRelay levelx = info.GetTextEntry(0);
string slevel = (levelx == null ? null : levelx.Text.Trim());
int level = 0;
if (slevel != null && slevel.Length != 0)
int.TryParse(slevel, out level);
if (level < 1) level = 1;
if (level > 20) level = 20;
from.SendGump( new AddStairsGump( m_Type, level) );
CommandSystem.Handle( from, String.Format( "{0}Add {1} {2} {3}", CommandSystem.Prefix, m_Types[m_Type].m_Type.Name, (Facing) button, level) );
}
else
{
from.SendGump( new AddStairsGump() );
}
}
}
示例5: OnResponse
public override void OnResponse( NetState sender, RelayInfo info )
{
if ( info.ButtonID == 0 )
{
m_From.SendLocalizedMessage( 501235, "", 0x35 ); // Help request aborted.
}
else
{
TextRelay entry = info.GetTextEntry( 0 );
string text = ( entry == null ? "" : entry.Text.Trim() );
if ( text.Length == 0 )
{
m_From.SendMessage( 0x35, "You must enter a description." );
m_From.SendGump( new PagePromptGump( m_From, m_Type ) );
}
else
{
m_From.SendLocalizedMessage( 501234, "", 0x35 ); /* The next available Counselor/Game Master will respond as soon as possible.
* Please check your Journal for messages every few minutes.
*/
PageQueue.Enqueue( new PageEntry( m_From, text, m_Type ) );
}
}
}
示例6: OnResponse
public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
{
if( _canEdit && _editMode )
{
string entryText = "";
TextRelay relay;
for( int i = 0; i < _numEntries; i++ )
{
relay = info.GetTextEntry( 100 + i );
if( relay != null )
entryText += relay.Text;
else
break;
}
if( entryText != _beheld.Profile )
_beheld.Profile = entryText.Trim();
}
if( info.ButtonID == 5 )
sender.Mobile.SendGump( new CharacterProfileGump( sender.Mobile, _beheld, _numEntries, !_editMode ) );
else if( info.ButtonID == 10 )
sender.Mobile.SendGump( new CharacterProfileGump( sender.Mobile, _beheld, Math.Min( MaxTextEntries, (_numEntries + 1) ), _editMode ) );
else if( info.ButtonID == 20 )
sender.Mobile.SendGump( new CharacterProfileGump( sender.Mobile, _beheld, Math.Max( MinTextEntries, (_numEntries - 1) ), _editMode ) );
}
示例7: OnResponse
public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
{
Mobile pm = ( Mobile )sender.Mobile;
if( pm == null )
return;
switch (info.ButtonID)
{
case 2:
{
TextRelay text = info.GetTextEntry( 1 );
if (text == null || text.Text == "")
{
pm.CloseGump(typeof(AccountSearch));
pm.SendGump(new AccountSearch());
return;
}
ArrayList authors = new ArrayList();
if (ForumCore.AuthorExists( out authors, text.Text))
{
pm.CloseGump( typeof(AccountListingGump));
pm.SendGump( new AccountListingGump( authors, 0 ) );
}
else
{
pm.SendMessage("Either that player does not exist, or no posts have been made by that player.");
}
break;
}
}
}
示例8: OnResponse
public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
{
if( info.ButtonID == 0 )
{
_from.SendLocalizedMessage( 501235, "", 0x35 ); //Help request aborted.
return;
}
else
{
TextRelay txtEntry = info.GetTextEntry( 0 );
string text = (txtEntry == null ? "" : txtEntry.Text);
if( text.Length == 0 )
{
_from.SendMessage( 0x35, "You must enter a description of your problem." );
_from.SendGump( new PagePromptGump( _from, _type ) );
}
else
{
_from.SendMessage( 0x35, "The next available staff member will be with you as soon as possible. If your issue is resolved early, please revoke it from the page queue. To check the statue of your page, type \'[CheckPage\'." );
PageQueue.AddNewPage( new PageEntry( _from, text, _type ) );
}
}
}
示例9: OnResponse
public override void OnResponse( GameClient state, RelayInfo info )
{
Mobile from = state.Mobile;
switch ( info.ButtonID )
{
case 0: // Close/Cancel
{
from.SendLocalizedMessage( 501235, "", 0x35 ); // Help request aborted.
break;
}
case 1: // OK
{
TextRelay entry = info.GetTextEntry( 0 );
string code = ( entry == null ? "" : entry.Text.Trim() );
if ( code != "" )
{
from.SendLocalizedMessage( 1062098 ); // Your promotional code has been submitted. We are processing your request.
PromotionalType type = PromotionalType.None;
bool success = false;
( (PlayerMobile) from ).LastPromotionCode = code;
// TODO: Send query for inputed promo-code to database
// We must receive following results: bool success, PromotionalType type, string code
from.SendGump( new PromotionMessageGump( success, type, code ) );
}
break;
}
}
}
示例10: CreateArray
public List<string> CreateArray( RelayInfo info, Mobile from )
{
List<string> itemsName = new List<string>();
for ( int i = 0; i < 13; i++ )
{
TextRelay te = info.GetTextEntry( i );
if ( te != null )
{
string str = te.Text;
if ( str.Length > 0 )
{
str = str.Trim();
Type type = ItemSpawnerType.GetType( str );
if ( type != null )
itemsName.Add( str );
else
from.SendMessage( "{0} is not a valid type name.", str );
}
}
}
return itemsName;
}
示例11: CreateArray
public ArrayList CreateArray( RelayInfo info, Mobile from )
{
ArrayList subSpawnerD = new ArrayList();
for ( int i = 0; i < 15; i++ )
{
TextRelay te = info.GetTextEntry( i );
if ( te != null )
{
string str = te.Text;
if ( str.Length > 0 )
{
str = str.Trim();
Type type = SpawnerType.GetType( str );
if ( type != null )
subSpawnerD.Add( str );
else
from.SendMessage( "{0} is not a valid type name.", str );
}
}
}
return subSpawnerD;
}
示例12: OnResponse
public override void OnResponse( NetState sender, RelayInfo info )
{
if ( info.ButtonID == 1 )
{
try
{
if ( m_From.AccessLevel >= AccessLevel.GameMaster )
{
TextRelay text = info.GetTextEntry( 0 );
if ( text != null )
{
m_Skill.Base = Convert.ToDouble( text.Text );
CommandLogging.LogChangeProperty( m_From, m_Target, String.Format( "{0}.Base", m_Skill ), m_Skill.Base.ToString() );
}
}
else
{
m_From.SendMessage( "You may not change that." );
}
m_From.SendGump( new SkillsGump( m_From, m_Target, m_Selected ) );
}
catch
{
m_From.SendMessage( "Bad format. ###.# expected." );
m_From.SendGump( new EditSkillGump( m_From, m_Target, m_Skill, m_Selected ) );
}
}
else
{
m_From.SendGump( new SkillsGump( m_From, m_Target, m_Selected ) );
}
}
示例13: OnResponse
public override void OnResponse( NetState sender, RelayInfo info )
{
Mobile from = sender.Mobile;
switch ( info.ButtonID )
{
case 1:
{
from.CloseGump( typeof( KillSearch ) );
from.SendGump( new KillIndex( from, m_Book, m_KillList ) );
break;
}
case 2:
{
TextRelay s = info.GetTextEntry( 0 );
if ( s != null )
{
string search = s.Text;
from.SendGump( new KillSearch( search, m_Book, m_KillList ));
}
break;
}
}
}
示例14: CreateArray
public List<string> CreateArray( RelayInfo info, Mobile from )
{
List<string> creaturesName = new List<string>();
for ( int i = 0; i < 13; i++ )
{
TextRelay te = info.GetTextEntry( i );
if ( te != null )
{
string str = te.Text;
if ( str.Length > 0 )
{
str = str.Trim();
string t = Spawner.ParseType( str );
Type type = ScriptCompiler.FindTypeByName( t );
if ( type != null )
creaturesName.Add( str );
else
from.SendMessage( "{0} is not a valid type name.", t );
}
}
}
return creaturesName;
}
示例15: OnResponse
public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
{
Mobile m_Player = ( Mobile )sender.Mobile;
if( m_Player == null )
return;
switch( info.ButtonID )
{
case 2:
{
TextRelay value = info.GetTextEntry( 1 );
int number;
try
{
number = Convert.ToInt32( value.Text );
}
catch
{
m_Player.SendMessage( "That value was not valid please try again." );
m_Player.CloseGump( typeof( InputGump ) );
m_Player.SendGump( new InputGump( m_Value, m_Property ) );
break;
}
if( number > 2147483647 || number < 0 )
{
m_Player.SendMessage( "This value may not be below 0 or above 2147483647. Please try again." );
m_Player.CloseGump( typeof( InputGump ) );
m_Player.SendGump( new InputGump( m_Value, m_Property ) );
break;
}
switch( m_Property.ToLower() )
{
case "purge days":
{
ForumCore.AutoCleanupDays = number;
break;
}
case "minimum characters":
{
ForumCore.MinPostCharactersCount = number;
break;
}
case "maximum characters":
{
ForumCore.MaxPostCharactersCount = number;
break;
}
}
m_Player.CloseGump( typeof( AdministrationGump ) );
m_Player.SendGump( new AdministrationGump( ) );
break;
}
}
}