Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)
This commit is contained in:
parent
e748af4430
commit
513e54f70e
1094 changed files with 15913 additions and 21892 deletions
|
|
@ -23,27 +23,26 @@ namespace Server.Guilds
|
|||
{
|
||||
base.PopulateGump();
|
||||
|
||||
AddHtmlLocalized(431, 43, 110, 26, 1062978, 0xF, false, false); // Diplomacy
|
||||
AddHtmlLocalized(431, 43, 110, 26, 1062978, 0xF); // Diplomacy
|
||||
|
||||
AddHtmlLocalized(65, 80, 480, 26, 1063124, 0xF, true, false); // <i>Advanced Search Options</i>
|
||||
AddHtmlLocalized(65, 80, 480, 26, 1063124, 0xF, true); // <i>Advanced Search Options</i>
|
||||
|
||||
AddHtmlLocalized(65, 110, 480, 26, 1063136 + (int)m_Display, 0xF, false,
|
||||
false); // Showing All Guilds/w/Relation/Waiting Relation
|
||||
AddHtmlLocalized(65, 110, 480, 26, 1063136 + (int)m_Display, 0xF); // Showing All Guilds/w/Relation/Waiting Relation
|
||||
|
||||
AddGroup(1);
|
||||
AddRadio(75, 140, 0xD2, 0xD3, false, 2);
|
||||
AddHtmlLocalized(105, 140, 200, 26, 1063006, 0x0, false, false); // Show Guilds with Relationship
|
||||
AddHtmlLocalized(105, 140, 200, 26, 1063006, 0x0); // Show Guilds with Relationship
|
||||
AddRadio(75, 170, 0xD2, 0xD3, false, 1);
|
||||
AddHtmlLocalized(105, 170, 200, 26, 1063005, 0x0, false, false); // Show Guilds Awaiting Action
|
||||
AddHtmlLocalized(105, 170, 200, 26, 1063005, 0x0); // Show Guilds Awaiting Action
|
||||
AddRadio(75, 200, 0xD2, 0xD3, false, 0);
|
||||
AddHtmlLocalized(105, 200, 200, 26, 1063007, 0x0, false, false); // Show All Guilds
|
||||
AddHtmlLocalized(105, 200, 200, 26, 1063007, 0x0); // Show All Guilds
|
||||
|
||||
AddBackground(450, 370, 100, 26, 0x2486);
|
||||
AddButton(455, 375, 0x845, 0x846, 5, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(480, 373, 60, 26, 1006044, 0x0, false, false); // OK
|
||||
AddButton(455, 375, 0x845, 0x846, 5);
|
||||
AddHtmlLocalized(480, 373, 60, 26, 1006044, 0x0); // OK
|
||||
AddBackground(340, 370, 100, 26, 0x2486);
|
||||
AddButton(345, 375, 0x845, 0x846, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(370, 373, 60, 26, 1006045, 0x0, false, false); // Cancel
|
||||
AddButton(345, 375, 0x845, 0x846, 0);
|
||||
AddHtmlLocalized(370, 373, 60, 26, 1006045, 0x0); // Cancel
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -66,4 +65,4 @@ namespace Server.Guilds
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,7 @@ namespace Server.Guilds
|
|||
{
|
||||
public abstract class BaseGuildGump : Gump
|
||||
{
|
||||
public BaseGuildGump(PlayerMobile pm, Guild g) : this(pm, g, 10, 10)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseGuildGump(PlayerMobile pm, Guild g, int x, int y) : base(x, y)
|
||||
public BaseGuildGump(PlayerMobile pm, Guild g, int x = 10, int y = 10) : base(x, y)
|
||||
{
|
||||
guild = g;
|
||||
player = pm;
|
||||
|
|
@ -31,14 +27,14 @@ namespace Server.Guilds
|
|||
|
||||
AddBackground(0, 0, 600, 440, 0x24AE);
|
||||
AddBackground(66, 40, 150, 26, 0x2486);
|
||||
AddButton(71, 45, 0x845, 0x846, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(96, 43, 110, 26, 1063014, 0x0, false, false); // My Guild
|
||||
AddButton(71, 45, 0x845, 0x846, 1);
|
||||
AddHtmlLocalized(96, 43, 110, 26, 1063014, 0x0); // My Guild
|
||||
AddBackground(236, 40, 150, 26, 0x2486);
|
||||
AddButton(241, 45, 0x845, 0x846, 2, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(266, 43, 110, 26, 1062974, 0x0, false, false); // Guild Roster
|
||||
AddButton(241, 45, 0x845, 0x846, 2);
|
||||
AddHtmlLocalized(266, 43, 110, 26, 1062974, 0x0); // Guild Roster
|
||||
AddBackground(401, 40, 150, 26, 0x2486);
|
||||
AddButton(406, 45, 0x845, 0x846, 3, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(431, 43, 110, 26, 1062978, 0x0, false, false); // Diplomacy
|
||||
AddButton(406, 45, 0x845, 0x846, 3);
|
||||
AddHtmlLocalized(431, 43, 110, 26, 1062978, 0x0); // Diplomacy
|
||||
AddPage(1);
|
||||
}
|
||||
|
||||
|
|
@ -81,12 +77,7 @@ namespace Server.Guilds
|
|||
m.AccessLevel < AccessLevel.GameMaster && !g.IsMember(m));
|
||||
}
|
||||
|
||||
public static bool CheckProfanity(string s)
|
||||
{
|
||||
return CheckProfanity(s, 50);
|
||||
}
|
||||
|
||||
public static bool CheckProfanity(string s, int maxLength)
|
||||
public static bool CheckProfanity(string s, int maxLength = 50)
|
||||
{
|
||||
//return NameVerification.Validate( s, 1, 50, true, true, false, int.MaxValue, ProfanityProtection.Exceptions, ProfanityProtection.Disallowed, ProfanityProtection.StartDisallowed ); //What am I doing wrong, this still allows chars like the <3 symbol... 3 AM. someone change this to use this
|
||||
|
||||
|
|
@ -126,7 +117,7 @@ namespace Server.Guilds
|
|||
|
||||
public void AddHtmlText(int x, int y, int width, int height, TextDefinition text, bool back, bool scroll)
|
||||
{
|
||||
if (text != null && text.Number > 0)
|
||||
if (text?.Number > 0)
|
||||
AddHtmlLocalized(x, y, width, height, text.Number, back, scroll);
|
||||
else if (text?.String != null)
|
||||
AddHtml(x, y, width, height, text.String, back, scroll);
|
||||
|
|
@ -137,4 +128,4 @@ namespace Server.Guilds
|
|||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ namespace Server.Guilds
|
|||
|
||||
AddBackground(130, 75, 385, 30, 0xBB8);
|
||||
AddTextEntry(135, 80, 375, 30, 0x481, 1, m_Filter);
|
||||
AddButton(520, 75, 0x867, 0x868, 5, GumpButtonType.Reply, 0); //Filter Button
|
||||
AddButton(520, 75, 0x867, 0x868, 5); //Filter Button
|
||||
|
||||
int width = 0;
|
||||
for (int i = 0; i < m_Fields.Length; i++)
|
||||
|
|
@ -69,21 +69,20 @@ namespace Server.Guilds
|
|||
|
||||
int ButtonID = isComparer ? m_Ascending ? 0x983 : 0x985 : 0x2716;
|
||||
|
||||
AddButton(59 + width + f.Width, 117, ButtonID, ButtonID + (isComparer ? 1 : 0), 100 + i,
|
||||
GumpButtonType.Reply, 0);
|
||||
AddButton(59 + width + f.Width, 117, ButtonID, ButtonID + (isComparer ? 1 : 0), 100 + i);
|
||||
|
||||
width += f.Width + 12;
|
||||
}
|
||||
|
||||
if (m_StartNumber <= 0)
|
||||
AddButton(65, 80, 0x15E3, 0x15E7, 0, GumpButtonType.Page, 0);
|
||||
AddButton(65, 80, 0x15E3, 0x15E7, 0, GumpButtonType.Page);
|
||||
else
|
||||
AddButton(65, 80, 0x15E3, 0x15E7, 6, GumpButtonType.Reply, 0); // Back
|
||||
AddButton(65, 80, 0x15E3, 0x15E7, 6); // Back
|
||||
|
||||
if (m_StartNumber + itemsPerPage > m_List.Count)
|
||||
AddButton(95, 80, 0x15E1, 0x15E5, 0, GumpButtonType.Page, 0);
|
||||
AddButton(95, 80, 0x15E1, 0x15E5, 0, GumpButtonType.Page);
|
||||
else
|
||||
AddButton(95, 80, 0x15E1, 0x15E5, 7, GumpButtonType.Reply, 0); // Forward
|
||||
AddButton(95, 80, 0x15E1, 0x15E5, 7); // Forward
|
||||
|
||||
|
||||
int itemNumber = 0;
|
||||
|
|
@ -125,9 +124,9 @@ namespace Server.Guilds
|
|||
}
|
||||
|
||||
if (HasRelationship(o))
|
||||
AddButton(40, 143 + itemNumber * 28, 0x8AF, 0x8AF, 200 + index, GumpButtonType.Reply, 0); //Info Button
|
||||
AddButton(40, 143 + itemNumber * 28, 0x8AF, 0x8AF, 200 + index); //Info Button
|
||||
else
|
||||
AddButton(40, 143 + itemNumber * 28, 0x4B9, 0x4BA, 200 + index, GumpButtonType.Reply, 0); //Info Button
|
||||
AddButton(40, 143 + itemNumber * 28, 0x4B9, 0x4BA, 200 + index); //Info Button
|
||||
}
|
||||
|
||||
protected abstract TextDefinition[] GetValuesFor(T o, int aryLength);
|
||||
|
|
@ -206,4 +205,4 @@ namespace Server.Guilds
|
|||
Comparer = comparer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,26 +14,25 @@ namespace Server.Guilds
|
|||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 500, 300, 0x2422);
|
||||
AddHtmlLocalized(25, 20, 450, 25, 1062939, 0x0, true, false); // <center>GUILD MENU</center>
|
||||
AddHtmlLocalized(25, 60, 450, 60, 1062940, 0x0, false,
|
||||
false); // As you are not a member of any guild, you can create your own by providing a unique guild name and paying the standard guild registration fee.
|
||||
AddHtmlLocalized(25, 135, 120, 25, 1062941, 0x0, false, false); // Registration Fee:
|
||||
AddHtmlLocalized(25, 20, 450, 25, 1062939, 0x0, true); // <center>GUILD MENU</center>
|
||||
AddHtmlLocalized(25, 60, 450, 60, 1062940, 0x0); // As you are not a member of any guild, you can create your own by providing a unique guild name and paying the standard guild registration fee.
|
||||
AddHtmlLocalized(25, 135, 120, 25, 1062941, 0x0); // Registration Fee:
|
||||
AddLabel(155, 135, 0x481, Guild.RegistrationFee.ToString());
|
||||
AddHtmlLocalized(25, 165, 120, 25, 1011140, 0x0, false, false); // Enter Guild Name:
|
||||
AddHtmlLocalized(25, 165, 120, 25, 1011140, 0x0); // Enter Guild Name:
|
||||
AddBackground(155, 160, 320, 26, 0xBB8);
|
||||
AddTextEntry(160, 163, 315, 21, 0x481, 5, guildName);
|
||||
AddHtmlLocalized(25, 191, 120, 26, 1063035, 0x0, false, false); // Abbreviation:
|
||||
AddHtmlLocalized(25, 191, 120, 26, 1063035, 0x0); // Abbreviation:
|
||||
AddBackground(155, 186, 320, 26, 0xBB8);
|
||||
AddTextEntry(160, 189, 315, 21, 0x481, 6, guildAbbrev);
|
||||
AddButton(415, 217, 0xF7, 0xF8, 1, GumpButtonType.Reply, 0);
|
||||
AddButton(345, 217, 0xF2, 0xF1, 0, GumpButtonType.Reply, 0);
|
||||
AddButton(415, 217, 0xF7, 0xF8, 1);
|
||||
AddButton(345, 217, 0xF2, 0xF1, 0);
|
||||
|
||||
if (pm.AcceptGuildInvites)
|
||||
AddButton(20, 260, 0xD2, 0xD3, 2, GumpButtonType.Reply, 0);
|
||||
AddButton(20, 260, 0xD2, 0xD3, 2);
|
||||
else
|
||||
AddButton(20, 260, 0xD3, 0xD2, 2, GumpButtonType.Reply, 0);
|
||||
AddButton(20, 260, 0xD3, 0xD2, 2);
|
||||
|
||||
AddHtmlLocalized(45, 260, 200, 30, 1062943, 0x0, false, false); // <i>Ignore Guild Invites</i>
|
||||
AddHtmlLocalized(45, 260, 200, 30, 1062943, 0x0); // <i>Ignore Guild Invites</i>
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
|
|
@ -110,4 +109,4 @@ namespace Server.Guilds
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ namespace Server.Guilds
|
|||
{
|
||||
base.PopulateGump();
|
||||
|
||||
AddHtmlLocalized(431, 43, 110, 26, 1062978, 0xF, false, false); // Diplomacy
|
||||
AddHtmlLocalized(431, 43, 110, 26, 1062978, 0xF); // Diplomacy
|
||||
}
|
||||
|
||||
protected override TextDefinition[] GetValuesFor(Guild g, int aryLength)
|
||||
|
|
@ -137,16 +137,16 @@ namespace Server.Guilds
|
|||
//AddHtmlLocalized( 66, 153 + itemNumber * 28, 280, 26, 1063136 + (int)m_Display, 0xF, false, false ); // Showing All Guilds/Awaiting Action/ w/Relation Ship
|
||||
//AddHtmlText( 66, 153 + itemNumber * 28, 280, 26, m_LowerText, false, false );
|
||||
|
||||
if (m_LowerText != null && m_LowerText.Number > 0)
|
||||
AddHtmlLocalized(66, 153 + itemNumber * 28, 280, 26, m_LowerText.Number, 0xF, false, false);
|
||||
if (m_LowerText?.Number > 0)
|
||||
AddHtmlLocalized(66, 153 + itemNumber * 28, 280, 26, m_LowerText.Number, 0xF);
|
||||
else if (m_LowerText?.String != null)
|
||||
AddHtml(66, 153 + itemNumber * 28, 280, 26, Color(m_LowerText.String, 0x99), false, false);
|
||||
AddHtml(66, 153 + itemNumber * 28, 280, 26, Color(m_LowerText.String, 0x99));
|
||||
|
||||
if (AllowAdvancedSearch)
|
||||
{
|
||||
AddBackground(350, 148 + itemNumber * 28, 200, 26, 0x2486);
|
||||
AddButton(355, 153 + itemNumber * 28, 0x845, 0x846, 8, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(380, 151 + itemNumber * 28, 160, 26, 1063083, 0x0, false, false); // Advanced Search
|
||||
AddButton(355, 153 + itemNumber * 28, 0x845, 0x846, 8);
|
||||
AddHtmlLocalized(380, 151 + itemNumber * 28, 160, 26, 1063083, 0x0); // Advanced Search
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -290,4 +290,4 @@ namespace Server.Guilds
|
|||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,11 +9,7 @@ namespace Server.Guilds
|
|||
{
|
||||
private bool m_IsResigning;
|
||||
|
||||
public GuildInfoGump(PlayerMobile pm, Guild g) : this(pm, g, false)
|
||||
{
|
||||
}
|
||||
|
||||
public GuildInfoGump(PlayerMobile pm, Guild g, bool isResigning) : base(pm, g)
|
||||
public GuildInfoGump(PlayerMobile pm, Guild g, bool isResigning = false) : base(pm, g)
|
||||
{
|
||||
m_IsResigning = isResigning;
|
||||
PopulateGump();
|
||||
|
|
@ -24,37 +20,37 @@ namespace Server.Guilds
|
|||
bool isLeader = IsLeader(player, guild);
|
||||
base.PopulateGump();
|
||||
|
||||
AddHtmlLocalized(96, 43, 110, 26, 1063014, 0xF, false, false); // My Guild
|
||||
AddHtmlLocalized(96, 43, 110, 26, 1063014, 0xF); // My Guild
|
||||
|
||||
AddImageTiled(65, 80, 160, 26, 0xA40);
|
||||
AddImageTiled(67, 82, 156, 22, 0xBBC);
|
||||
AddHtmlLocalized(70, 83, 150, 20, 1062954, 0x0, false, false); // <i>Guild Name</i>
|
||||
AddHtml(233, 84, 320, 26, guild.Name, false, false);
|
||||
AddHtmlLocalized(70, 83, 150, 20, 1062954, 0x0); // <i>Guild Name</i>
|
||||
AddHtml(233, 84, 320, 26, guild.Name);
|
||||
|
||||
AddImageTiled(65, 114, 160, 26, 0xA40);
|
||||
AddImageTiled(67, 116, 156, 22, 0xBBC);
|
||||
AddHtmlLocalized(70, 117, 150, 20, 1063025, 0x0, false, false); // <i>Alliance</i>
|
||||
AddHtmlLocalized(70, 117, 150, 20, 1063025, 0x0); // <i>Alliance</i>
|
||||
|
||||
if (guild.Alliance != null && guild.Alliance.IsMember(guild))
|
||||
{
|
||||
AddHtml(233, 118, 320, 26, guild.Alliance.Name, false, false);
|
||||
AddButton(40, 120, 0x4B9, 0x4BA, 6, GumpButtonType.Reply, 0); //Alliance Roster
|
||||
AddHtml(233, 118, 320, 26, guild.Alliance.Name);
|
||||
AddButton(40, 120, 0x4B9, 0x4BA, 6); //Alliance Roster
|
||||
}
|
||||
|
||||
if (Guild.OrderChaos && isLeader)
|
||||
AddButton(40, 154, 0x4B9, 0x4BA, 100, GumpButtonType.Reply, 0); // Guild Faction
|
||||
AddButton(40, 154, 0x4B9, 0x4BA, 100); // Guild Faction
|
||||
|
||||
AddImageTiled(65, 148, 160, 26, 0xA40);
|
||||
AddImageTiled(67, 150, 156, 22, 0xBBC);
|
||||
AddHtmlLocalized(70, 151, 150, 20, 1063084, 0x0, false, false); // <i>Guild Faction</i>
|
||||
AddHtmlLocalized(70, 151, 150, 20, 1063084, 0x0); // <i>Guild Faction</i>
|
||||
|
||||
GuildType gt;
|
||||
Faction f;
|
||||
|
||||
if ((gt = guild.Type) != GuildType.Regular)
|
||||
AddHtml(233, 152, 320, 26, gt.ToString(), false, false);
|
||||
AddHtml(233, 152, 320, 26, gt.ToString());
|
||||
else if ((f = Faction.Find(guild.Leader)) != null)
|
||||
AddHtml(233, 152, 320, 26, f.ToString(), false, false);
|
||||
AddHtml(233, 152, 320, 26, f.ToString());
|
||||
|
||||
AddImageTiled(65, 196, 480, 4, 0x238D);
|
||||
|
||||
|
|
@ -65,21 +61,21 @@ namespace Server.Guilds
|
|||
|
||||
AddHtml(65, 216, 480, 80, s, true, true);
|
||||
if (isLeader)
|
||||
AddButton(40, 251, 0x4B9, 0x4BA, 4, GumpButtonType.Reply, 0); //Charter Edit button
|
||||
AddButton(40, 251, 0x4B9, 0x4BA, 4); //Charter Edit button
|
||||
|
||||
s = guild.Website;
|
||||
if (string.IsNullOrEmpty(s))
|
||||
s = "Guild website not yet set.";
|
||||
AddHtml(65, 306, 480, 30, s, true, false);
|
||||
AddHtml(65, 306, 480, 30, s, true);
|
||||
if (isLeader)
|
||||
AddButton(40, 313, 0x4B9, 0x4BA, 5, GumpButtonType.Reply, 0); //Website Edit button
|
||||
AddButton(40, 313, 0x4B9, 0x4BA, 5); //Website Edit button
|
||||
|
||||
AddCheck(65, 370, 0xD2, 0xD3, player.DisplayGuildTitle, 0);
|
||||
AddHtmlLocalized(95, 370, 150, 26, 1063085, 0x0, false, false); // Show Guild Title
|
||||
AddHtmlLocalized(95, 370, 150, 26, 1063085, 0x0); // Show Guild Title
|
||||
AddBackground(450, 370, 100, 26, 0x2486);
|
||||
|
||||
AddButton(455, 375, 0x845, 0x846, 7, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(480, 373, 60, 26, 3006115, m_IsResigning ? 0x5000 : 0, false, false); // Resign
|
||||
AddButton(455, 375, 0x845, 0x846, 7);
|
||||
AddHtmlLocalized(480, 373, 60, 26, 3006115, m_IsResigning ? 0x5000 : 0); // Resign
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
|
|
@ -193,4 +189,4 @@ namespace Server.Guilds
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,13 +20,12 @@ namespace Server.Guilds
|
|||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 350, 170, 0x2422);
|
||||
AddHtmlLocalized(25, 20, 300, 45, 1062946, 0x0, true,
|
||||
false); // <center>You have been invited to join a guild! (Warning: Accepting will make you attackable!)</center>
|
||||
AddHtml(25, 75, 300, 25, $"<center>{guild.Name}</center>", true, false);
|
||||
AddButton(265, 130, 0xF7, 0xF8, 1, GumpButtonType.Reply, 0);
|
||||
AddButton(195, 130, 0xF2, 0xF1, 0, GumpButtonType.Reply, 0);
|
||||
AddButton(20, 130, 0xD2, 0xD3, 2, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(45, 130, 150, 30, 1062943, 0x0, false, false); // <i>Ignore Guild Invites</i>
|
||||
AddHtmlLocalized(25, 20, 300, 45, 1062946, 0x0, true); // <center>You have been invited to join a guild! (Warning: Accepting will make you attackable!)</center>
|
||||
AddHtml(25, 75, 300, 25, $"<center>{guild.Name}</center>", true);
|
||||
AddButton(265, 130, 0xF7, 0xF8, 1);
|
||||
AddButton(195, 130, 0xF2, 0xF1, 0);
|
||||
AddButton(20, 130, 0xD2, 0xD3, 2);
|
||||
AddHtmlLocalized(45, 130, 150, 30, 1062943, 0x0); // <i>Ignore Guild Invites</i>
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -62,4 +61,4 @@ namespace Server.Guilds
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,41 +23,39 @@ namespace Server.Guilds
|
|||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 350, 255, 0x242C);
|
||||
AddHtmlLocalized(20, 15, 310, 26, 1063018, 0x0, false,
|
||||
false); // <div align=center><i>Guild Member Information</i></div>
|
||||
AddHtmlLocalized(20, 15, 310, 26, 1063018, 0x0); // <div align=center><i>Guild Member Information</i></div>
|
||||
AddImageTiled(20, 40, 310, 2, 0x2711);
|
||||
|
||||
AddHtmlLocalized(20, 50, 150, 26, 1062955, 0x0, true, false); // <i>Name</i>
|
||||
AddHtml(180, 53, 150, 26, m_Member.Name, false, false);
|
||||
AddHtmlLocalized(20, 50, 150, 26, 1062955, 0x0, true); // <i>Name</i>
|
||||
AddHtml(180, 53, 150, 26, m_Member.Name);
|
||||
|
||||
AddHtmlLocalized(20, 80, 150, 26, 1062956, 0x0, true, false); // <i>Rank</i>
|
||||
AddHtmlLocalized(180, 83, 150, 26, m_Member.GuildRank.Name, 0x0, false, false);
|
||||
AddHtmlLocalized(20, 80, 150, 26, 1062956, 0x0, true); // <i>Rank</i>
|
||||
AddHtmlLocalized(180, 83, 150, 26, m_Member.GuildRank.Name, 0x0);
|
||||
|
||||
AddHtmlLocalized(20, 110, 150, 26, 1062953, 0x0, true, false); // <i>Guild Title</i>
|
||||
AddHtml(180, 113, 150, 26, m_Member.GuildTitle, false, false);
|
||||
AddHtmlLocalized(20, 110, 150, 26, 1062953, 0x0, true); // <i>Guild Title</i>
|
||||
AddHtml(180, 113, 150, 26, m_Member.GuildTitle);
|
||||
AddImageTiled(20, 142, 310, 2, 0x2711);
|
||||
|
||||
AddBackground(20, 150, 310, 26, 0x2486);
|
||||
AddButton(25, 155, 0x845, 0x846, 4, GumpButtonType.Reply, 0);
|
||||
AddButton(25, 155, 0x845, 0x846, 4);
|
||||
AddHtmlLocalized(50, 153, 270, 26,
|
||||
m_Member == player.GuildFealty && guild.Leader != m_Member ? 1063082 : 1062996, 0x0, false,
|
||||
false); // Clear/Cast Vote For This Member
|
||||
m_Member == player.GuildFealty && guild.Leader != m_Member ? 1063082 : 1062996, 0x0); // Clear/Cast Vote For This Member
|
||||
|
||||
AddBackground(20, 180, 150, 26, 0x2486);
|
||||
AddButton(25, 185, 0x845, 0x846, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(50, 183, 110, 26, 1062993, m_ToLeader ? 0x990000 : 0, false, false); // Promote
|
||||
AddButton(25, 185, 0x845, 0x846, 1);
|
||||
AddHtmlLocalized(50, 183, 110, 26, 1062993, m_ToLeader ? 0x990000 : 0); // Promote
|
||||
|
||||
AddBackground(180, 180, 150, 26, 0x2486);
|
||||
AddButton(185, 185, 0x845, 0x846, 3, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(210, 183, 110, 26, 1062995, 0x0, false, false); // Set Guild Title
|
||||
AddButton(185, 185, 0x845, 0x846, 3);
|
||||
AddHtmlLocalized(210, 183, 110, 26, 1062995, 0x0); // Set Guild Title
|
||||
|
||||
AddBackground(20, 210, 150, 26, 0x2486);
|
||||
AddButton(25, 215, 0x845, 0x846, 2, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(50, 213, 110, 26, 1062994, 0x0, false, false); // Demote
|
||||
AddButton(25, 215, 0x845, 0x846, 2);
|
||||
AddHtmlLocalized(50, 213, 110, 26, 1062994, 0x0); // Demote
|
||||
|
||||
AddBackground(180, 210, 150, 26, 0x2486);
|
||||
AddButton(185, 215, 0x845, 0x846, 5, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(210, 213, 110, 26, 1062997, m_toKick ? 0x5000 : 0, false, false); // Kick
|
||||
AddButton(185, 215, 0x845, 0x846, 5);
|
||||
AddHtmlLocalized(210, 213, 110, 26, 1062997, m_toKick ? 0x5000 : 0); // Kick
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
|
|
@ -252,4 +250,4 @@ namespace Server.Guilds
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,12 +17,12 @@ namespace Server.Guilds
|
|||
new InfoField<PlayerMobile>(1062953, 150, TitleComparer.Instance) //Guild Title
|
||||
};
|
||||
|
||||
public GuildRosterGump(PlayerMobile pm, Guild g) : this(pm, g, LastOnComparer.Instance, false, "", 0)
|
||||
public GuildRosterGump(PlayerMobile pm, Guild g) : this(pm, g, LastOnComparer.Instance)
|
||||
{
|
||||
}
|
||||
|
||||
public GuildRosterGump(PlayerMobile pm, Guild g, IComparer<PlayerMobile> currentComparer, bool ascending,
|
||||
string filter, int startNumber)
|
||||
public GuildRosterGump(PlayerMobile pm, Guild g, IComparer<PlayerMobile> currentComparer, bool ascending = false,
|
||||
string filter = "", int startNumber = 0)
|
||||
: base(pm, g, Utility.SafeConvertList<Mobile, PlayerMobile>(g.Members), currentComparer, ascending, filter,
|
||||
startNumber, m_Fields)
|
||||
{
|
||||
|
|
@ -33,14 +33,14 @@ namespace Server.Guilds
|
|||
{
|
||||
base.PopulateGump();
|
||||
|
||||
AddHtmlLocalized(266, 43, 110, 26, 1062974, 0xF, false, false); // Guild Roster
|
||||
AddHtmlLocalized(266, 43, 110, 26, 1062974, 0xF); // Guild Roster
|
||||
}
|
||||
|
||||
public override void DrawEndingEntry(int itemNumber)
|
||||
{
|
||||
AddBackground(225, 148 + itemNumber * 28, 150, 26, 0x2486);
|
||||
AddButton(230, 153 + itemNumber * 28, 0x845, 0x846, 8, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(255, 151 + itemNumber * 28, 110, 26, 1062992, 0x0, false, false); // Invite Player
|
||||
AddButton(230, 153 + itemNumber * 28, 0x845, 0x846, 8);
|
||||
AddHtmlLocalized(255, 151 + itemNumber * 28, 110, 26, 1062992, 0x0); // Invite Player
|
||||
}
|
||||
|
||||
protected override TextDefinition[] GetValuesFor(PlayerMobile pm, int aryLength)
|
||||
|
|
@ -156,7 +156,7 @@ namespace Server.Guilds
|
|||
else
|
||||
pm.SendLocalizedMessage(1013028); // That person has a different faction affiliation.
|
||||
}
|
||||
else if (targetState != null && targetState.IsLeaving)
|
||||
else if (targetState?.IsLeaving == true)
|
||||
{
|
||||
// OSI does this quite strangely, so we'll just do it this way
|
||||
pm.SendMessage("That person is quitting their faction and so you may not recruit them.");
|
||||
|
|
@ -252,4 +252,4 @@ namespace Server.Guilds
|
|||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ namespace Server.Guilds
|
|||
public void AddButtonAndBackground(int x, int y, int buttonID, int locNum)
|
||||
{
|
||||
AddBackground(x, y, 225, 26, 0x2486);
|
||||
AddButton(x + 5, y + 5, 0x845, 0x846, buttonID, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(x + 30, y + 3, 185, 26, locNum, 0x0, false, false);
|
||||
AddButton(x + 5, y + 5, 0x845, 0x846, buttonID);
|
||||
AddHtmlLocalized(x + 30, y + 3, 185, 26, locNum, 0x0);
|
||||
}
|
||||
|
||||
public override void PopulateGump()
|
||||
|
|
@ -43,20 +43,19 @@ namespace Server.Guilds
|
|||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 520, 335, 0x242C);
|
||||
AddHtmlLocalized(20, 15, 480, 26, 1062975, 0x0, false,
|
||||
false); // <div align=center><i>Guild Relationship</i></div>
|
||||
AddHtmlLocalized(20, 15, 480, 26, 1062975, 0x0); // <div align=center><i>Guild Relationship</i></div>
|
||||
AddImageTiled(20, 40, 480, 2, 0x2711);
|
||||
AddHtmlLocalized(20, 50, 120, 26, 1062954, 0x0, true, false); // <i>Guild Name</i>
|
||||
AddHtml(150, 53, 360, 26, m_Other.Name, false, false);
|
||||
AddHtmlLocalized(20, 50, 120, 26, 1062954, 0x0, true); // <i>Guild Name</i>
|
||||
AddHtml(150, 53, 360, 26, m_Other.Name);
|
||||
|
||||
AddHtmlLocalized(20, 80, 120, 26, 1063025, 0x0, true, false); // <i>Alliance</i>
|
||||
AddHtmlLocalized(20, 80, 120, 26, 1063025, 0x0, true); // <i>Alliance</i>
|
||||
|
||||
if (otherAlliance != null)
|
||||
if (otherAlliance.IsMember(m_Other))
|
||||
AddHtml(150, 83, 360, 26, otherAlliance.Name, false, false);
|
||||
AddHtml(150, 83, 360, 26, otherAlliance.Name);
|
||||
|
||||
AddHtmlLocalized(20, 110, 120, 26, 1063139, 0x0, true, false); // <i>Abbreviation</i>
|
||||
AddHtml(150, 113, 120, 26, m_Other.Abbreviation, false, false);
|
||||
AddHtmlLocalized(20, 110, 120, 26, 1063139, 0x0, true); // <i>Abbreviation</i>
|
||||
AddHtml(150, 113, 120, 26, m_Other.Abbreviation);
|
||||
|
||||
|
||||
string kills = "0/0";
|
||||
|
|
@ -92,14 +91,14 @@ namespace Server.Guilds
|
|||
otherKills = Color($"{otherWar.Kills}/{otherWar.MaxKills}", 0x990000);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(280, 110, 120, 26, 1062966, 0x0, true, false); // <i>Your Kills</i>
|
||||
AddHtml(410, 113, 120, 26, kills, false, false);
|
||||
AddHtmlLocalized(280, 110, 120, 26, 1062966, 0x0, true); // <i>Your Kills</i>
|
||||
AddHtml(410, 113, 120, 26, kills);
|
||||
|
||||
AddHtmlLocalized(20, 140, 120, 26, 1062968, 0x0, true, false); // <i>Time Remaining</i>
|
||||
AddHtml(150, 143, 120, 26, time, false, false);
|
||||
AddHtmlLocalized(20, 140, 120, 26, 1062968, 0x0, true); // <i>Time Remaining</i>
|
||||
AddHtml(150, 143, 120, 26, time);
|
||||
|
||||
AddHtmlLocalized(280, 140, 120, 26, 1062967, 0x0, true, false); // <i>Their Kills</i>
|
||||
AddHtml(410, 143, 120, 26, otherKills, false, false);
|
||||
AddHtmlLocalized(280, 140, 120, 26, 1062967, 0x0, true); // <i>Their Kills</i>
|
||||
AddHtml(410, 143, 120, 26, otherKills);
|
||||
|
||||
AddImageTiled(20, 172, 480, 2, 0x2711);
|
||||
|
||||
|
|
@ -155,7 +154,7 @@ namespace Server.Guilds
|
|||
//Withdraw Request
|
||||
AddButtonAndBackground(20, 290, 14, 1062986); // Withdraw Request
|
||||
|
||||
AddHtml(150, 83, 360, 26, Color(alliance.Name, 0x99), false, false);
|
||||
AddHtml(150, 83, 360, 26, Color(alliance.Name, 0x99));
|
||||
}
|
||||
else if (alliance.Leader == m_Other && alliance.IsPendingMember(guild))
|
||||
{
|
||||
|
|
@ -168,7 +167,7 @@ namespace Server.Guilds
|
|||
AddButtonAndBackground(20, 260, 15, 1062988); // Deny Request
|
||||
AddButtonAndBackground(20, 290, 16, 1062987); // Accept Request
|
||||
|
||||
AddHtml(150, 83, 360, 26, Color(alliance.Name, 0x99), false, false);
|
||||
AddHtml(150, 83, 360, 26, Color(alliance.Name, 0x99));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -179,7 +178,7 @@ namespace Server.Guilds
|
|||
|
||||
AddButtonAndBackground(275, 290, 0, 3000091); //Cancel
|
||||
|
||||
AddHtmlLocalized(20, 180, 480, 30, number, 0x0, true, false);
|
||||
AddHtmlLocalized(20, 180, 480, 30, number, 0x0, true);
|
||||
AddImageTiled(20, 245, 480, 2, 0x2711);
|
||||
}
|
||||
|
||||
|
|
@ -209,7 +208,7 @@ namespace Server.Guilds
|
|||
|
||||
case 5: //Accept the war
|
||||
{
|
||||
if (war != null && !war.WarRequester && activeWar == null)
|
||||
if (war?.WarRequester == false && activeWar == null)
|
||||
{
|
||||
if (!playerRank.GetFlag(RankFlags.ControlWarStatus))
|
||||
{
|
||||
|
|
@ -229,7 +228,7 @@ namespace Server.Guilds
|
|||
war.WarBeginning = DateTime.UtcNow;
|
||||
guild.AcceptedWars.Add(war);
|
||||
|
||||
if (alliance != null && alliance.IsMember(guild))
|
||||
if (alliance?.IsMember(guild) == true)
|
||||
{
|
||||
alliance.AllianceMessage(1070769,
|
||||
otherAlliance != null
|
||||
|
|
@ -274,7 +273,7 @@ namespace Server.Guilds
|
|||
}
|
||||
case 6: //Modify war terms
|
||||
{
|
||||
if (war != null && !war.WarRequester && activeWar == null)
|
||||
if (war?.WarRequester == false && activeWar == null)
|
||||
{
|
||||
if (!playerRank.GetFlag(RankFlags.ControlWarStatus))
|
||||
{
|
||||
|
|
@ -338,7 +337,7 @@ namespace Server.Guilds
|
|||
{
|
||||
if (activeWar != null)
|
||||
{
|
||||
if (alliance != null && alliance.IsMember(guild))
|
||||
if (alliance?.IsMember(guild) == true)
|
||||
{
|
||||
alliance.AllianceMessage(1070740,
|
||||
otherAlliance != null
|
||||
|
|
@ -521,7 +520,7 @@ namespace Server.Guilds
|
|||
{
|
||||
pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance.
|
||||
}
|
||||
else if (alliance != null && alliance.IsMember(guild))
|
||||
else if (alliance?.IsMember(guild) == true)
|
||||
{
|
||||
guild.Alliance = null; //Calls alliance.Removeguild
|
||||
// alliance.RemoveGuild( guild );
|
||||
|
|
@ -544,7 +543,7 @@ namespace Server.Guilds
|
|||
pm.SendLocalizedMessage(1063239,
|
||||
$"{guild.Name}\t{alliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
|
||||
}
|
||||
else if (alliance != null && alliance.IsMember(guild) && alliance.IsMember(m_Other))
|
||||
else if (alliance?.IsMember(guild) == true && alliance.IsMember(m_Other))
|
||||
{
|
||||
m_Other.Alliance = null;
|
||||
|
||||
|
|
@ -566,7 +565,7 @@ namespace Server.Guilds
|
|||
pm.SendLocalizedMessage(1063239,
|
||||
$"{guild.Name}\t{alliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
|
||||
}
|
||||
else if (alliance != null && alliance.IsMember(guild) && alliance.IsMember(m_Other))
|
||||
else if (alliance?.IsMember(guild) == true && alliance.IsMember(m_Other))
|
||||
{
|
||||
pm.SendLocalizedMessage(1063434,
|
||||
$"{m_Other.Name}\t{alliance.Name}"); // ~1_val~ is now the leader of ~2_val~.
|
||||
|
|
@ -700,4 +699,4 @@ namespace Server.Guilds
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,23 +18,22 @@ namespace Server.Guilds
|
|||
|
||||
AddBackground(0, 0, 500, 340, 0x24AE);
|
||||
AddBackground(65, 50, 370, 30, 0x2486);
|
||||
AddHtmlLocalized(75, 55, 370, 26, 1062979, 0x3C00, false,
|
||||
false); // <div align=center><i>Declaration of War</i></div>
|
||||
AddHtmlLocalized(75, 55, 370, 26, 1062979, 0x3C00); // <div align=center><i>Declaration of War</i></div>
|
||||
AddImage(410, 45, 0x232C);
|
||||
AddHtmlLocalized(65, 95, 200, 20, 1063009, 0x14AF, false, false); // <i>Duration of War</i>
|
||||
AddHtmlLocalized(65, 120, 400, 20, 1063010, 0x0, false, false); // Enter the number of hours the war will last.
|
||||
AddHtmlLocalized(65, 95, 200, 20, 1063009, 0x14AF); // <i>Duration of War</i>
|
||||
AddHtmlLocalized(65, 120, 400, 20, 1063010, 0x0); // Enter the number of hours the war will last.
|
||||
AddBackground(65, 150, 40, 30, 0x2486);
|
||||
AddTextEntry(70, 154, 50, 30, 0x481, 10, war != null ? war.WarLength.Hours.ToString() : "0");
|
||||
AddHtmlLocalized(65, 195, 200, 20, 1063011, 0x14AF, false, false); // <i>Victory Condition</i>
|
||||
AddHtmlLocalized(65, 220, 400, 20, 1063012, 0x0, false, false); // Enter the winning number of kills.
|
||||
AddHtmlLocalized(65, 195, 200, 20, 1063011, 0x14AF); // <i>Victory Condition</i>
|
||||
AddHtmlLocalized(65, 220, 400, 20, 1063012, 0x0); // Enter the winning number of kills.
|
||||
AddBackground(65, 250, 40, 30, 0x2486);
|
||||
AddTextEntry(70, 254, 50, 30, 0x481, 11, war != null ? war.MaxKills.ToString() : "0");
|
||||
AddBackground(190, 270, 130, 26, 0x2486);
|
||||
AddButton(195, 275, 0x845, 0x846, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(220, 273, 90, 26, 1006045, 0x0, false, false); // Cancel
|
||||
AddButton(195, 275, 0x845, 0x846, 0);
|
||||
AddHtmlLocalized(220, 273, 90, 26, 1006045, 0x0); // Cancel
|
||||
AddBackground(330, 270, 130, 26, 0x2486);
|
||||
AddButton(335, 275, 0x845, 0x846, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(360, 273, 90, 26, 1062989, 0x5000, false, false); // Declare War!
|
||||
AddButton(335, 275, 0x845, 0x846, 1);
|
||||
AddHtmlLocalized(360, 273, 90, 26, 1062989, 0x5000); // Declare War!
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
|
|
@ -137,4 +136,4 @@ namespace Server.Guilds
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue