comparer, bool ascending,
- string filter, int startNumber
- ) =>
- new GuildRosterGump(pm, g, comparer, ascending, filter, startNumber);
-
- public override Gump GetObjectInfoGump(PlayerMobile pm, Guild g, PlayerMobile o) =>
+ public override BaseGump GetObjectInfoGump(PlayerMobile pm, Guild g, PlayerMobile o) =>
new GuildMemberInfoGump(pm, g, o, false, false);
public override void OnResponse(NetState sender, in RelayInfo info)
{
base.OnResponse(sender, info);
- if (sender.Mobile is not PlayerMobile pm || !IsMember(pm, guild))
+ if (sender.Mobile is not PlayerMobile pm || !IsMember(pm, Guild))
{
return;
}
@@ -109,7 +100,7 @@ namespace Server.Guilds
if (pm.GuildRank.GetFlag(RankFlags.CanInvitePlayer))
{
pm.SendLocalizedMessage(1063048); // Whom do you wish to invite into your guild?
- pm.BeginTarget(-1, false, TargetFlags.None, InvitePlayer_Callback, guild);
+ pm.BeginTarget(-1, false, TargetFlags.None, InvitePlayer_Callback, Guild);
}
else
{
@@ -129,7 +120,7 @@ namespace Server.Guilds
var guildFaction = guildState?.Faction;
var targetFaction = targetState?.Faction;
- if (pm == null || !IsMember(pm, guild) || !pm.GuildRank.GetFlag(RankFlags.CanInvitePlayer))
+ if (pm == null || !IsMember(pm, Guild) || !pm.GuildRank.GetFlag(RankFlags.CanInvitePlayer))
{
from.SendLocalizedMessage(503301); // You don't have permission to do that.
}
@@ -181,7 +172,7 @@ namespace Server.Guilds
else
{
pm.SendLocalizedMessage(1063053, targ.Name); // You invite ~1_val~ to join your guild.
- targ.SendGump(new GuildInvitationRequest(targ, guild, pm));
+ targ.SendGump(new GuildInvitationRequest(targ, Guild, pm));
}
}
diff --git a/Projects/UOContent/Gumps/Guilds/New Guild System/OtherGuildInfo.cs b/Projects/UOContent/Gumps/Guilds/New Guild System/OtherGuildInfo.cs
index df1b8a36e..c8857c8a2 100644
--- a/Projects/UOContent/Gumps/Guilds/New Guild System/OtherGuildInfo.cs
+++ b/Projects/UOContent/Gumps/Guilds/New Guild System/OtherGuildInfo.cs
@@ -8,55 +8,55 @@ namespace Server.Guilds
{
public class OtherGuildInfo : BaseGuildGump
{
- private readonly Guild m_Other;
+ private readonly Guild _other;
public OtherGuildInfo(PlayerMobile pm, Guild g, Guild otherGuild) : base(pm, g, 10, 40)
{
- m_Other = otherGuild;
+ _other = otherGuild;
g.CheckExpiredWars();
-
- PopulateGump();
}
- public void AddButtonAndBackground(int x, int y, int buttonID, int locNum)
+ protected override bool ShowTabStrip => false;
+
+ private static void AddButtonAndBackground(ref DynamicGumpBuilder builder, int x, int y, int buttonID, int locNum)
{
- AddBackground(x, y, 225, 26, 0x2486);
- AddButton(x + 5, y + 5, 0x845, 0x846, buttonID);
- AddHtmlLocalized(x + 30, y + 3, 185, 26, locNum, 0x0);
+ builder.AddBackground(x, y, 225, 26, 0x2486);
+ builder.AddButton(x + 5, y + 5, 0x845, 0x846, buttonID);
+ builder.AddHtmlLocalized(x + 30, y + 3, 185, 26, locNum, 0x0);
}
- public override void PopulateGump()
+ protected override void BuildContent(ref DynamicGumpBuilder builder)
{
- var g = Guild.GetAllianceLeader(guild);
- var other = Guild.GetAllianceLeader(m_Other);
+ builder.AddBackground(0, 0, 520, 335, 0x242C);
+
+ var g = Guild.GetAllianceLeader(Guild);
+ var other = Guild.GetAllianceLeader(_other);
var war = g.FindPendingWar(other);
var activeWar = g.FindActiveWar(other);
- var alliance = guild.Alliance;
- var otherAlliance = m_Other.Alliance;
+ var alliance = Guild.Alliance;
+ var otherAlliance = _other.Alliance;
// NOTE TO SELF: Only only alliance leader can see pending guild alliance statuses
- var PendingWar = war != null;
- var ActiveWar = activeWar != null;
- AddPage(0);
+ var pendingWar = war != null;
+ var activeWarFlag = activeWar != null;
- AddBackground(0, 0, 520, 335, 0x242C);
- AddHtmlLocalized(20, 15, 480, 26, 1062975, 0x0); // Guild Relationship
- AddImageTiled(20, 40, 480, 2, 0x2711);
- AddHtmlLocalized(20, 50, 120, 26, 1062954, 0x0, true); // Guild Name
- AddHtml(150, 53, 360, 26, m_Other.Name);
+ builder.AddHtmlLocalized(20, 15, 480, 26, 1062975, 0x0); // Guild Relationship
+ builder.AddImageTiled(20, 40, 480, 2, 0x2711);
+ builder.AddHtmlLocalized(20, 50, 120, 26, 1062954, 0x0, true); // Guild Name
+ builder.AddHtml(150, 53, 360, 26, _other.Name);
- AddHtmlLocalized(20, 80, 120, 26, 1063025, 0x0, true); // Alliance
+ builder.AddHtmlLocalized(20, 80, 120, 26, 1063025, 0x0, true); // Alliance
- if (otherAlliance?.IsMember(m_Other) == true)
+ if (otherAlliance?.IsMember(_other) == true)
{
- AddHtml(150, 83, 360, 26, otherAlliance.Name);
+ builder.AddHtml(150, 83, 360, 26, otherAlliance.Name);
}
- AddHtmlLocalized(20, 110, 120, 26, 1063139, 0x0, true); // Abbreviation
- AddHtml(150, 113, 120, 26, m_Other.Abbreviation);
+ builder.AddHtmlLocalized(20, 110, 120, 26, 1063139, 0x0, true); // Abbreviation
+ builder.AddHtml(150, 113, 120, 26, _other.Abbreviation);
var kills = "0/0";
var time = "00:00";
@@ -64,7 +64,7 @@ namespace Server.Guilds
WarDeclaration otherWar;
- if (ActiveWar)
+ if (activeWarFlag)
{
kills = $"{activeWar.Kills}/{activeWar.MaxKills}";
@@ -77,38 +77,38 @@ namespace Server.Guilds
time = $"{timeRemaining.Hours:D2}:{DateTime.MinValue + timeRemaining:mm}";
- otherWar = m_Other.FindActiveWar(guild);
+ otherWar = _other.FindActiveWar(Guild);
if (otherWar != null)
{
otherKills = $"{otherWar.Kills}/{otherWar.MaxKills}";
}
}
- else if (PendingWar)
+ else if (pendingWar)
{
kills = Html.Color($"{war.Kills}/{war.MaxKills}", 0x990000);
time = Html.Color($"{war.WarLength.Hours:D2}:{DateTime.MinValue + war.WarLength:mm}", 0x990000);
- otherWar = m_Other.FindPendingWar(guild);
+ otherWar = _other.FindPendingWar(Guild);
if (otherWar != null)
{
otherKills = Html.Color($"{otherWar.Kills}/{otherWar.MaxKills}", 0x990000);
}
}
- AddHtmlLocalized(280, 110, 120, 26, 1062966, 0x0, true); // Your Kills
- AddHtml(410, 113, 120, 26, kills);
+ builder.AddHtmlLocalized(280, 110, 120, 26, 1062966, 0x0, true); // Your Kills
+ builder.AddHtml(410, 113, 120, 26, kills);
- AddHtmlLocalized(20, 140, 120, 26, 1062968, 0x0, true); // Time Remaining
- AddHtml(150, 143, 120, 26, time);
+ builder.AddHtmlLocalized(20, 140, 120, 26, 1062968, 0x0, true); // Time Remaining
+ builder.AddHtml(150, 143, 120, 26, time);
- AddHtmlLocalized(280, 140, 120, 26, 1062967, 0x0, true); // Their Kills
- AddHtml(410, 143, 120, 26, otherKills);
+ builder.AddHtmlLocalized(280, 140, 120, 26, 1062967, 0x0, true); // Their Kills
+ builder.AddHtml(410, 143, 120, 26, otherKills);
- AddImageTiled(20, 172, 480, 2, 0x2711);
+ builder.AddImageTiled(20, 172, 480, 2, 0x2711);
var number = 1062973; // You are at peace with this guild.
- if (PendingWar)
+ if (pendingWar)
{
if (war.WarRequester)
{
@@ -118,92 +118,92 @@ namespace Server.Guilds
{
number = 1062969; // This guild has challenged you to war!
- AddButtonAndBackground(20, 260, 5, 1062981); // Accept Challenge
- AddButtonAndBackground(275, 260, 6, 1062983); // Modify Terms
+ AddButtonAndBackground(ref builder, 20, 260, 5, 1062981); // Accept Challenge
+ AddButtonAndBackground(ref builder, 275, 260, 6, 1062983); // Modify Terms
}
- AddButtonAndBackground(20, 290, 7, 1062982); // Dismiss Challenge
+ AddButtonAndBackground(ref builder, 20, 290, 7, 1062982); // Dismiss Challenge
}
- else if (ActiveWar)
+ else if (activeWarFlag)
{
number = 1062965; // You are at war with this guild!
- AddButtonAndBackground(20, 290, 8, 1062980); // Surrender
+ AddButtonAndBackground(ref builder, 20, 290, 8, 1062980); // Surrender
}
else if (alliance != null && alliance == otherAlliance) // alliance, Same Alliance
{
- if (alliance.IsMember(guild) && alliance.IsMember(m_Other)) // Both in Same alliance, full members
+ if (alliance.IsMember(Guild) && alliance.IsMember(_other)) // Both in Same alliance, full members
{
number = 1062970; // You are allied with this guild.
- if (alliance.Leader == guild)
+ if (alliance.Leader == Guild)
{
- AddButtonAndBackground(20, 260, 12, 1062984); // Remove Guild from Alliance
+ AddButtonAndBackground(ref builder, 20, 260, 12, 1062984); // Remove Guild from Alliance
- //Note: No 'confirmation' like the other leader guild promotion things
+ // Note: No 'confirmation' like the other leader guild promotion things
// Promote to Alliance Leader
- AddButtonAndBackground(275, 260, 13, 1063433);
+ AddButtonAndBackground(ref builder, 275, 260, 13, 1063433);
// Remove guild from alliance //Promote to Alliance Leader
}
// Show roster, Centered, up
- AddButtonAndBackground(148, 215, 10, 1063164); // Show Alliance Roster
+ AddButtonAndBackground(ref builder, 148, 215, 10, 1063164); // Show Alliance Roster
// Leave Alliance
- AddButtonAndBackground(20, 290, 11, 1062985); // Leave Alliance
+ AddButtonAndBackground(ref builder, 20, 290, 11, 1062985); // Leave Alliance
}
- else if (alliance.Leader == guild && alliance.IsPendingMember(m_Other))
+ else if (alliance.Leader == Guild && alliance.IsPendingMember(_other))
{
number = 1062971; // You have requested an alliance with this guild.
// Show Alliance Roster, Centered, down.
- AddButtonAndBackground(148, 245, 10, 1063164); // Show Alliance Roster
+ AddButtonAndBackground(ref builder, 148, 245, 10, 1063164); // Show Alliance Roster
// Withdraw Request
- AddButtonAndBackground(20, 290, 14, 1062986); // Withdraw Request
+ AddButtonAndBackground(ref builder, 20, 290, 14, 1062986); // Withdraw Request
- AddHtml(150, 83, 360, 26, alliance.Name.Color(0x99));
+ builder.AddHtml(150, 83, 360, 26, alliance.Name.Color(0x99));
}
- else if (alliance.Leader == m_Other && alliance.IsPendingMember(guild))
+ else if (alliance.Leader == _other && alliance.IsPendingMember(Guild))
{
number = 1062972; // This guild has requested an alliance.
// Show alliance Roster, top
- AddButtonAndBackground(148, 215, 10, 1063164); // Show Alliance Roster
+ AddButtonAndBackground(ref builder, 148, 215, 10, 1063164); // Show Alliance Roster
// Deny Request
// Accept Request
- AddButtonAndBackground(20, 260, 15, 1062988); // Deny Request
- AddButtonAndBackground(20, 290, 16, 1062987); // Accept Request
+ AddButtonAndBackground(ref builder, 20, 260, 15, 1062988); // Deny Request
+ AddButtonAndBackground(ref builder, 20, 290, 16, 1062987); // Accept Request
- AddHtml(150, 83, 360, 26, alliance.Name.Color(0x99));
+ builder.AddHtml(150, 83, 360, 26, alliance.Name.Color(0x99));
}
}
else
{
- AddButtonAndBackground(20, 260, 2, 1062990); // Request Alliance
- AddButtonAndBackground(20, 290, 1, 1062989); // Declare War!
+ AddButtonAndBackground(ref builder, 20, 260, 2, 1062990); // Request Alliance
+ AddButtonAndBackground(ref builder, 20, 290, 1, 1062989); // Declare War!
}
- AddButtonAndBackground(275, 290, 0, 3000091); // Cancel
+ AddButtonAndBackground(ref builder, 275, 290, 0, 3000091); // Cancel
- AddHtmlLocalized(20, 180, 480, 30, number, 0x0, true);
- AddImageTiled(20, 245, 480, 2, 0x2711);
+ builder.AddHtmlLocalized(20, 180, 480, 30, number, 0x0, true);
+ builder.AddImageTiled(20, 245, 480, 2, 0x2711);
}
public override void OnResponse(NetState sender, in RelayInfo info)
{
- if (!(sender.Mobile is PlayerMobile pm && IsMember(pm, guild)))
+ if (!(sender.Mobile is PlayerMobile pm && IsMember(pm, Guild)))
{
return;
}
var playerRank = pm.GuildRank;
- var guildLeader = Guild.GetAllianceLeader(guild);
- var otherGuild = Guild.GetAllianceLeader(m_Other);
+ var guildLeader = Guild.GetAllianceLeader(Guild);
+ var otherGuild = Guild.GetAllianceLeader(_other);
var war = guildLeader.FindPendingWar(otherGuild);
var activeWar = guildLeader.FindActiveWar(otherGuild);
var otherWar = otherGuild.FindPendingWar(guildLeader);
- var alliance = guild.Alliance;
+ var alliance = Guild.Alliance;
var otherAlliance = otherGuild.Alliance;
switch (info.ButtonID)
@@ -216,10 +216,10 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1063440); // You don't have permission to negotiate wars.
}
- else if (alliance != null && alliance.Leader != guild)
+ else if (alliance != null && alliance.Leader != Guild)
{
// ~1_val~ is not the leader of the ~2_val~ alliance.
- pm.SendLocalizedMessage(1063239, $"{guild.Name}\t{alliance.Name}");
+ pm.SendLocalizedMessage(1063239, $"{Guild.Name}\t{alliance.Name}");
// You need to negotiate via ~1_val~ instead.
pm.SendLocalizedMessage(1070707, alliance.Leader.Name);
@@ -227,11 +227,11 @@ namespace Server.Guilds
else
{
// Accept the war
- guild.PendingWars.Remove(war);
+ Guild.PendingWars.Remove(war);
war.WarBeginning = Core.Now;
- guild.AcceptedWars.Add(war);
+ Guild.AcceptedWars.Add(war);
- if (alliance?.IsMember(guild) == true)
+ if (alliance?.IsMember(Guild) == true)
{
// Guild Message: Your guild is now at war with ~1_GUILDNAME~
alliance.AllianceMessage(1070769, otherAlliance?.Name ?? otherGuild.Name);
@@ -240,8 +240,8 @@ namespace Server.Guilds
else
{
// Guild Message: Your guild is now at war with ~1_GUILDNAME~
- guild.GuildMessage(1070769, otherAlliance?.Name ?? otherGuild.Name);
- guild.InvalidateMemberProperties();
+ Guild.GuildMessage(1070769, otherAlliance?.Name ?? otherGuild.Name);
+ Guild.InvalidateMemberProperties();
}
// Technically SHOULD say Your guild is now at war w/out any info, intentional diff.
@@ -249,16 +249,16 @@ namespace Server.Guilds
otherWar.WarBeginning = Core.Now;
otherGuild.AcceptedWars.Add(otherWar);
- if (otherAlliance != null && m_Other.Alliance.IsMember(m_Other))
+ if (otherAlliance != null && _other.Alliance.IsMember(_other))
{
// Guild Message: Your guild is now at war with ~1_GUILDNAME~
- otherAlliance.AllianceMessage(1070769, alliance?.Name ?? guild.Name);
+ otherAlliance.AllianceMessage(1070769, alliance?.Name ?? Guild.Name);
otherAlliance.InvalidateMemberProperties();
}
else
{
// Guild Message: Your guild is now at war with ~1_GUILDNAME~
- otherGuild.GuildMessage(1070769, alliance?.Name ?? guild.Name);
+ otherGuild.GuildMessage(1070769, alliance?.Name ?? Guild.Name);
otherGuild.InvalidateMemberProperties();
}
}
@@ -274,17 +274,17 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1063440); // You don't have permission to negotiate wars.
}
- else if (alliance != null && alliance.Leader != guild)
+ else if (alliance != null && alliance.Leader != Guild)
{
// ~1_val~ is not the leader of the ~2_val~ alliance.
- pm.SendLocalizedMessage(1063239, $"{guild.Name}\t{alliance.Name}");
+ pm.SendLocalizedMessage(1063239, $"{Guild.Name}\t{alliance.Name}");
// You need to negotiate via ~1_val~ instead.
pm.SendLocalizedMessage(1070707, alliance.Leader.Name);
}
else
{
- pm.SendGump(new WarDeclarationGump(pm, guild, otherGuild));
+ pm.SendGump(new WarDeclarationGump(pm, Guild, otherGuild));
}
}
@@ -298,10 +298,10 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1063440); // You don't have permission to negotiate wars.
}
- else if (alliance != null && alliance.Leader != guild)
+ else if (alliance != null && alliance.Leader != Guild)
{
// ~1_val~ is not the leader of the ~2_val~ alliance.
- pm.SendLocalizedMessage(1063239, $"{guild.Name}\t{alliance.Name}");
+ pm.SendLocalizedMessage(1063239, $"{Guild.Name}\t{alliance.Name}");
// You need to negotiate via ~1_val~ instead.
pm.SendLocalizedMessage(1070707, alliance.Leader.Name);
@@ -309,7 +309,7 @@ namespace Server.Guilds
else
{
// Dismiss the war
- guild.PendingWars.Remove(war);
+ Guild.PendingWars.Remove(war);
otherGuild.PendingWars.Remove(otherWar);
pm.SendLocalizedMessage(1070752); // The proposal has been updated.
// Messages to opposing guild? (Testing on OSI says no)
@@ -324,10 +324,10 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1063440); // You don't have permission to negotiate wars.
}
- else if (alliance != null && alliance.Leader != guild)
+ else if (alliance != null && alliance.Leader != Guild)
{
// ~1_val~ is not the leader of the ~2_val~ alliance.
- pm.SendLocalizedMessage(1063239, $"{guild.Name}\t{alliance.Name}");
+ pm.SendLocalizedMessage(1063239, $"{Guild.Name}\t{alliance.Name}");
// You need to negotiate via ~1_val~ instead.
pm.SendLocalizedMessage(1070707, alliance.Leader.Name);
@@ -336,7 +336,7 @@ namespace Server.Guilds
{
if (activeWar != null)
{
- if (alliance?.IsMember(guild) == true)
+ if (alliance?.IsMember(Guild) == true)
{
// You have lost the war with ~1_val~.
alliance.AllianceMessage(1070740, otherAlliance?.Name ?? otherGuild.Name);
@@ -345,26 +345,26 @@ namespace Server.Guilds
else
{
// You have lost the war with ~1_val~.
- guild.GuildMessage(1070740, otherAlliance?.Name ?? otherGuild.Name);
- guild.InvalidateMemberProperties();
+ Guild.GuildMessage(1070740, otherAlliance?.Name ?? otherGuild.Name);
+ Guild.InvalidateMemberProperties();
}
- guild.AcceptedWars.Remove(activeWar);
+ Guild.AcceptedWars.Remove(activeWar);
if (otherAlliance?.IsMember(otherGuild) == true)
{
// You have won the war against ~1_val~!
- otherAlliance.AllianceMessage(1070739, guild.Alliance?.Name ?? guild.Name);
+ otherAlliance.AllianceMessage(1070739, Guild.Alliance?.Name ?? Guild.Name);
otherAlliance.InvalidateMemberProperties();
}
else
{
// You have won the war against ~1_val~!
- otherGuild.GuildMessage(1070739, guild.Alliance?.Name ?? guild.Name);
+ otherGuild.GuildMessage(1070739, Guild.Alliance?.Name ?? Guild.Name);
otherGuild.InvalidateMemberProperties();
}
- otherGuild.AcceptedWars.Remove(otherGuild.FindActiveWar(guild));
+ otherGuild.AcceptedWars.Remove(otherGuild.FindActiveWar(Guild));
}
}
@@ -378,25 +378,25 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1063440); // You don't have permission to negotiate wars.
}
- else if (alliance != null && alliance.Leader != guild)
+ else if (alliance != null && alliance.Leader != Guild)
{
// ~1_val~ is not the leader of the ~2_val~ alliance.
- pm.SendLocalizedMessage(1063239, $"{guild.Name}\t{alliance.Name}");
+ pm.SendLocalizedMessage(1063239, $"{Guild.Name}\t{alliance.Name}");
// You need to negotiate via ~1_val~ instead.
pm.SendLocalizedMessage(1070707, alliance.Leader.Name);
}
- else if (otherAlliance != null && otherAlliance.Leader != m_Other)
+ else if (otherAlliance != null && otherAlliance.Leader != _other)
{
// ~1_val~ is not the leader of the ~2_val~ alliance.
- pm.SendLocalizedMessage(1063239, $"{m_Other.Name}\t{otherAlliance.Name}");
+ pm.SendLocalizedMessage(1063239, $"{_other.Name}\t{otherAlliance.Name}");
// You need to negotiate via ~1_val~ instead.
pm.SendLocalizedMessage(1070707, otherAlliance.Leader.Name);
}
else
{
- pm.SendGump(new WarDeclarationGump(pm, guild, m_Other));
+ pm.SendGump(new WarDeclarationGump(pm, Guild, _other));
}
}
@@ -411,33 +411,33 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1070747); // You don't have permission to create an alliance.
}
- else if (Faction.Find(guild.Leader) != Faction.Find(m_Other.Leader))
+ else if (Faction.Find(Guild.Leader) != Faction.Find(_other.Leader))
{
// You cannot propose an alliance to a guild with a different faction allegiance.
pm.SendLocalizedMessage(1070758);
}
else if (otherAlliance != null)
{
- if (otherAlliance.IsPendingMember(m_Other))
+ if (otherAlliance.IsPendingMember(_other))
{
// ~1_val~ is currently considering another alliance proposal.
- pm.SendLocalizedMessage(1063416, m_Other.Name);
+ pm.SendLocalizedMessage(1063416, _other.Name);
}
else
{
// ~1_val~ already belongs to an alliance.
- pm.SendLocalizedMessage(1063426, m_Other.Name);
+ pm.SendLocalizedMessage(1063426, _other.Name);
}
}
- else if (m_Other.AcceptedWars.Count > 0 || m_Other.PendingWars.Count > 0)
+ else if (_other.AcceptedWars.Count > 0 || _other.PendingWars.Count > 0)
{
// ~1_val~ is currently involved in a guild war.
- pm.SendLocalizedMessage(1063427, m_Other.Name);
+ pm.SendLocalizedMessage(1063427, _other.Name);
}
- else if (guild.AcceptedWars.Count > 0 || guild.PendingWars.Count > 0)
+ else if (Guild.AcceptedWars.Count > 0 || Guild.PendingWars.Count > 0)
{
// ~1_val~ is currently involved in a guild war.
- pm.SendLocalizedMessage(1063427, guild.Name);
+ pm.SendLocalizedMessage(1063427, Guild.Name);
}
else
{
@@ -451,40 +451,40 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance.
}
- else if (alliance.Leader != guild)
+ else if (alliance.Leader != Guild)
{
// ~1_val~ is not the leader of the ~2_val~ alliance.
- pm.SendLocalizedMessage(1063239, $"{guild.Name}\t{alliance.Name}");
+ pm.SendLocalizedMessage(1063239, $"{Guild.Name}\t{alliance.Name}");
}
else if (otherAlliance != null)
{
- if (otherAlliance.IsPendingMember(m_Other))
+ if (otherAlliance.IsPendingMember(_other))
{
// ~1_val~ is currently considering another alliance proposal.
- pm.SendLocalizedMessage(1063416, m_Other.Name);
+ pm.SendLocalizedMessage(1063416, _other.Name);
}
else
{
// ~1_val~ already belongs to an alliance.
- pm.SendLocalizedMessage(1063426, m_Other.Name);
+ pm.SendLocalizedMessage(1063426, _other.Name);
}
}
- else if (alliance.IsPendingMember(guild))
+ else if (alliance.IsPendingMember(Guild))
{
// ~1_val~ is currently considering another alliance proposal.
- pm.SendLocalizedMessage(1063416, guild.Name);
+ pm.SendLocalizedMessage(1063416, Guild.Name);
}
- else if (m_Other.AcceptedWars.Count > 0 || m_Other.PendingWars.Count > 0)
+ else if (_other.AcceptedWars.Count > 0 || _other.PendingWars.Count > 0)
{
// ~1_val~ is currently involved in a guild war.
- pm.SendLocalizedMessage(1063427, m_Other.Name);
+ pm.SendLocalizedMessage(1063427, _other.Name);
}
- else if (guild.AcceptedWars.Count > 0 || guild.PendingWars.Count > 0)
+ else if (Guild.AcceptedWars.Count > 0 || Guild.PendingWars.Count > 0)
{
// ~1_val~ is currently involved in a guild war.
- pm.SendLocalizedMessage(1063427, guild.Name);
+ pm.SendLocalizedMessage(1063427, Guild.Name);
}
- else if (Faction.Find(guild.Leader) != Faction.Find(m_Other.Leader))
+ else if (Faction.Find(Guild.Leader) != Faction.Find(_other.Leader))
{
// You cannot propose an alliance to a guild with a different faction allegiance.
pm.SendLocalizedMessage(1070758);
@@ -492,12 +492,11 @@ namespace Server.Guilds
else
{
// An invitation to join your alliance has been sent to ~1_val~.
- pm.SendLocalizedMessage(1070750, m_Other.Name);
+ pm.SendLocalizedMessage(1070750, _other.Name);
- m_Other.GuildMessage(1070780, guild.Name); // ~1_val~ has proposed an alliance.
+ _other.GuildMessage(1070780, Guild.Name); // ~1_val~ has proposed an alliance.
- m_Other.Alliance = alliance; // Calls addPendingGuild
- // alliance.AddPendingGuild( m_Other );
+ _other.Alliance = alliance; // Calls addPendingGuild
}
}
@@ -507,7 +506,7 @@ namespace Server.Guilds
{
if (alliance != null && alliance == otherAlliance)
{
- pm.SendGump(new AllianceInfo.AllianceRosterGump(pm, guild, alliance));
+ pm.SendGump(new AllianceInfo.AllianceRosterGump(pm, Guild, alliance));
}
break;
@@ -518,14 +517,13 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance.
}
- else if (alliance?.IsMember(guild) == true)
+ else if (alliance?.IsMember(Guild) == true)
{
- guild.Alliance = null; // Calls alliance.RemoveGuild
- // alliance.RemoveGuild( guild );
+ Guild.Alliance = null; // Calls alliance.RemoveGuild
- m_Other.InvalidateWarNotoriety();
+ _other.InvalidateWarNotoriety();
- guild.InvalidateMemberNotoriety();
+ Guild.InvalidateMemberNotoriety();
}
break;
@@ -536,18 +534,18 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance.
}
- else if (alliance != null && alliance.Leader != guild)
+ else if (alliance != null && alliance.Leader != Guild)
{
// ~1_val~ is not the leader of the ~2_val~ alliance.
- pm.SendLocalizedMessage(1063239, $"{guild.Name}\t{alliance.Name}");
+ pm.SendLocalizedMessage(1063239, $"{Guild.Name}\t{alliance.Name}");
}
- else if (alliance?.IsMember(guild) == true && alliance.IsMember(m_Other))
+ else if (alliance?.IsMember(Guild) == true && alliance.IsMember(_other))
{
- m_Other.Alliance = null;
+ _other.Alliance = null;
- m_Other.InvalidateMemberNotoriety();
+ _other.InvalidateMemberNotoriety();
- guild.InvalidateWarNotoriety();
+ Guild.InvalidateWarNotoriety();
}
break;
@@ -558,17 +556,17 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance.
}
- else if (alliance != null && alliance.Leader != guild)
+ else if (alliance != null && alliance.Leader != Guild)
{
// ~1_val~ is not the leader of the ~2_val~ alliance.
- pm.SendLocalizedMessage(1063239, $"{guild.Name}\t{alliance.Name}");
+ pm.SendLocalizedMessage(1063239, $"{Guild.Name}\t{alliance.Name}");
}
- else if (alliance?.IsMember(guild) == true && alliance.IsMember(m_Other))
+ else if (alliance?.IsMember(Guild) == true && alliance.IsMember(_other))
{
// ~1_val~ is now the leader of ~2_val~.
- pm.SendLocalizedMessage(1063434, $"{m_Other.Name}\t{alliance.Name}");
+ pm.SendLocalizedMessage(1063434, $"{_other.Name}\t{alliance.Name}");
- alliance.Leader = m_Other;
+ alliance.Leader = _other;
}
break;
@@ -579,9 +577,9 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance.
}
- else if (alliance != null && alliance.Leader == guild && alliance.IsPendingMember(m_Other))
+ else if (alliance != null && alliance.Leader == Guild && alliance.IsPendingMember(_other))
{
- m_Other.Alliance = null;
+ _other.Alliance = null;
pm.SendLocalizedMessage(1070752); // The proposal has been updated.
}
@@ -593,15 +591,15 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance.
}
- else if (alliance != null && otherAlliance != null && alliance.Leader == m_Other &&
- otherAlliance.IsPendingMember(guild))
+ else if (alliance != null && otherAlliance != null && alliance.Leader == _other &&
+ otherAlliance.IsPendingMember(Guild))
{
// The proposal has been updated.
- // m_Other.GuildMessage( 1070782 );
+ // _other.GuildMessage( 1070782 );
// // ~1_val~ has responded to your proposal.
- // //Per OSI commented out.
+ // // Per OSI commented out.
pm.SendLocalizedMessage(1070752);
- guild.Alliance = null;
+ Guild.Alliance = null;
}
break;
@@ -612,15 +610,15 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance.
}
- else if (otherAlliance != null && otherAlliance.Leader == m_Other &&
- otherAlliance.IsPendingMember(guild))
+ else if (otherAlliance != null && otherAlliance.Leader == _other &&
+ otherAlliance.IsPendingMember(Guild))
{
pm.SendLocalizedMessage(1070752); // The proposal has been updated.
// No need to verify it's in the guild or already a member, the function does this
- otherAlliance.TurnToMember(m_Other);
+ otherAlliance.TurnToMember(_other);
- otherAlliance.TurnToMember(guild);
+ otherAlliance.TurnToMember(Guild);
}
break;
@@ -635,10 +633,10 @@ namespace Server.Guilds
return;
}
- var alliance = guild.Alliance;
- var otherAlliance = m_Other.Alliance;
+ var alliance = Guild.Alliance;
+ var otherAlliance = _other.Alliance;
- if (!IsMember(from, guild) || alliance != null)
+ if (!IsMember(from, Guild) || alliance != null)
{
return;
}
@@ -649,7 +647,7 @@ namespace Server.Guilds
{
pm.SendLocalizedMessage(1070747); // You don't have permission to create an alliance.
}
- else if (Faction.Find(guild.Leader) != Faction.Find(m_Other.Leader))
+ else if (Faction.Find(Guild.Leader) != Faction.Find(_other.Leader))
{
// Notes about this: OSI only cares/checks when proposing, you can change your faction all you want later.
// You cannot propose an alliance to a guild with a different faction allegiance.
@@ -657,23 +655,23 @@ namespace Server.Guilds
}
else if (otherAlliance != null)
{
- if (otherAlliance.IsPendingMember(m_Other))
+ if (otherAlliance.IsPendingMember(_other))
{
// ~1_val~ is currently considering another alliance proposal.
- pm.SendLocalizedMessage(1063416, m_Other.Name);
+ pm.SendLocalizedMessage(1063416, _other.Name);
}
else
{
- pm.SendLocalizedMessage(1063426, m_Other.Name); // ~1_val~ already belongs to an alliance.
+ pm.SendLocalizedMessage(1063426, _other.Name); // ~1_val~ already belongs to an alliance.
}
}
- else if (m_Other.AcceptedWars.Count > 0 || m_Other.PendingWars.Count > 0)
+ else if (_other.AcceptedWars.Count > 0 || _other.PendingWars.Count > 0)
{
- pm.SendLocalizedMessage(1063427, m_Other.Name); // ~1_val~ is currently involved in a guild war.
+ pm.SendLocalizedMessage(1063427, _other.Name); // ~1_val~ is currently involved in a guild war.
}
- else if (guild.AcceptedWars.Count > 0 || guild.PendingWars.Count > 0)
+ else if (Guild.AcceptedWars.Count > 0 || Guild.PendingWars.Count > 0)
{
- pm.SendLocalizedMessage(1063427, guild.Name); // ~1_val~ is currently involved in a guild war.
+ pm.SendLocalizedMessage(1063427, Guild.Name); // ~1_val~ is currently involved in a guild war.
}
else
{
@@ -695,11 +693,11 @@ namespace Server.Guilds
else
{
// An invitation to join your alliance has been sent to ~1_val~.
- pm.SendLocalizedMessage(1070750, m_Other.Name);
+ pm.SendLocalizedMessage(1070750, _other.Name);
- m_Other.GuildMessage(1070780, guild.Name); // ~1_val~ has proposed an alliance.
+ _other.GuildMessage(1070780, Guild.Name); // ~1_val~ has proposed an alliance.
- new AllianceInfo(guild, name, m_Other);
+ new AllianceInfo(Guild, name, _other);
}
}
}
diff --git a/Projects/UOContent/Gumps/Guilds/New Guild System/WarDeclarationGump.cs b/Projects/UOContent/Gumps/Guilds/New Guild System/WarDeclarationGump.cs
index b0a5749ae..2a2be3b73 100644
--- a/Projects/UOContent/Gumps/Guilds/New Guild System/WarDeclarationGump.cs
+++ b/Projects/UOContent/Gumps/Guilds/New Guild System/WarDeclarationGump.cs
@@ -7,40 +7,42 @@ namespace Server.Guilds
{
public class WarDeclarationGump : BaseGuildGump
{
- private readonly Guild m_Other;
+ private readonly Guild _other;
- public WarDeclarationGump(PlayerMobile pm, Guild g, Guild otherGuild) : base(pm, g)
+ public WarDeclarationGump(PlayerMobile pm, Guild g, Guild otherGuild) : base(pm, g) => _other = otherGuild;
+
+ protected override bool ShowTabStrip => false;
+
+ protected override void BuildContent(ref DynamicGumpBuilder builder)
{
- m_Other = otherGuild;
- var war = g.FindPendingWar(otherGuild);
+ var war = Guild.FindPendingWar(_other);
- AddPage(0);
-
- AddBackground(0, 0, 500, 340, 0x24AE);
- AddBackground(65, 50, 370, 30, 0x2486);
- AddHtmlLocalized(75, 55, 370, 26, 1062979, 0x3C00); // Declaration of War
- AddImage(410, 45, 0x232C);
- AddHtmlLocalized(65, 95, 200, 20, 1063009, 0x14AF); // Duration of War
- 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?.WarLength.Hours.ToString() ?? "0");
- AddHtmlLocalized(65, 195, 200, 20, 1063011, 0x14AF); // Victory Condition
- 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?.MaxKills.ToString() ?? "0");
- AddBackground(190, 270, 130, 26, 0x2486);
- 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);
- AddHtmlLocalized(360, 273, 90, 26, 1062989, 0x5000); // Declare War!
+ builder.AddBackground(0, 0, 500, 340, 0x24AE);
+ builder.AddBackground(65, 50, 370, 30, 0x2486);
+ // Declaration of War
+ builder.AddHtmlLocalized(75, 55, 370, 26, 1062979, 0x3C00);
+ builder.AddImage(410, 45, 0x232C);
+ builder.AddHtmlLocalized(65, 95, 200, 20, 1063009, 0x14AF); // Duration of War
+ builder.AddHtmlLocalized(65, 120, 400, 20, 1063010, 0x0); // Enter the number of hours the war will last.
+ builder.AddBackground(65, 150, 40, 30, 0x2486);
+ builder.AddTextEntry(70, 154, 50, 30, 0x481, 10, $"{war?.WarLength.Hours ?? 0}");
+ builder.AddHtmlLocalized(65, 195, 200, 20, 1063011, 0x14AF); // Victory Condition
+ builder.AddHtmlLocalized(65, 220, 400, 20, 1063012, 0x0); // Enter the winning number of kills.
+ builder.AddBackground(65, 250, 40, 30, 0x2486);
+ builder.AddTextEntry(70, 254, 50, 30, 0x481, 11, $"{war?.MaxKills ?? 0}");
+ builder.AddBackground(190, 270, 130, 26, 0x2486);
+ builder.AddButton(195, 275, 0x845, 0x846, 0);
+ builder.AddHtmlLocalized(220, 273, 90, 26, 1006045, 0x0); // Cancel
+ builder.AddBackground(330, 270, 130, 26, 0x2486);
+ builder.AddButton(335, 275, 0x845, 0x846, 1);
+ builder.AddHtmlLocalized(360, 273, 90, 26, 1062989, 0x5000); // Declare War!
}
public override void OnResponse(NetState sender, in RelayInfo info)
{
var pm = sender.Mobile as PlayerMobile;
- if (!IsMember(pm, guild))
+ if (!IsMember(pm, Guild))
{
return;
}
@@ -51,45 +53,38 @@ namespace Server.Guilds
{
case 1:
{
- var alliance = guild.Alliance;
- var otherAlliance = m_Other.Alliance;
+ var alliance = Guild.Alliance;
+ var otherAlliance = _other.Alliance;
if (!playerRank.GetFlag(RankFlags.ControlWarStatus))
{
pm.SendLocalizedMessage(1063440); // You don't have permission to negotiate wars.
}
- else if (alliance != null && alliance.Leader != guild)
+ else if (alliance != null && alliance.Leader != Guild)
{
- pm.SendLocalizedMessage(
- 1063239,
- $"{guild.Name}\t{alliance.Name}"
- ); // ~1_val~ is not the leader of the ~2_val~ alliance.
- pm.SendLocalizedMessage(
- 1070707,
- alliance.Leader.Name
- ); // You need to negotiate via ~1_val~ instead.
+ // ~1_val~ is not the leader of the ~2_val~ alliance.
+ pm.SendLocalizedMessage(1063239, $"{Guild.Name}\t{alliance.Name}");
+ // You need to negotiate via ~1_val~ instead.
+ pm.SendLocalizedMessage(1070707, alliance.Leader.Name);
}
- else if (otherAlliance != null && otherAlliance.Leader != m_Other)
+ else if (otherAlliance != null && otherAlliance.Leader != _other)
{
- pm.SendLocalizedMessage(
- 1063239,
- $"{m_Other.Name}\t{otherAlliance.Name}"
- ); // ~1_val~ is not the leader of the ~2_val~ alliance.
- pm.SendLocalizedMessage(
- 1070707,
- otherAlliance.Leader.Name
- ); // You need to negotiate via ~1_val~ instead.
+ // ~1_val~ is not the leader of the ~2_val~ alliance.
+ pm.SendLocalizedMessage(1063239, $"{_other.Name}\t{otherAlliance.Name}");
+ // You need to negotiate via ~1_val~ instead.
+ pm.SendLocalizedMessage(1070707, otherAlliance.Leader.Name);
}
else
{
- var activeWar = guild.FindActiveWar(m_Other);
+ var activeWar = Guild.FindActiveWar(_other);
if (activeWar == null)
{
- var war = guild.FindPendingWar(m_Other);
- var otherWar = m_Other.FindPendingWar(guild);
+ var war = Guild.FindPendingWar(_other);
+ var otherWar = _other.FindPendingWar(Guild);
- // Note: OSI differs from what it says on website. unlimited war = 0 kills/ 0 hrs. Not > 999. (sidenote: they both cap at 65535, 7.5 years, but, still.)
+ // Note: OSI differs from what it says on website. unlimited war = 0 kills/0 hrs.
+ // Not > 999. (sidenote: they both cap at 65535, 7.5 years, but, still.)
var tKills = info.GetTextEntry(11);
var tWarLength = info.GetTextEntry(10);
@@ -110,7 +105,7 @@ namespace Server.Guilds
}
else
{
- guild.PendingWars.Add(new WarDeclaration(guild, m_Other, maxKills, warLength, true));
+ Guild.PendingWars.Add(new WarDeclaration(Guild, _other, maxKills, warLength, true));
}
if (otherWar != null)
@@ -121,7 +116,7 @@ namespace Server.Guilds
}
else
{
- m_Other.PendingWars.Add(new WarDeclaration(m_Other, guild, maxKills, warLength, false));
+ _other.PendingWars.Add(new WarDeclaration(_other, Guild, maxKills, warLength, false));
}
if (war != null)
@@ -130,20 +125,22 @@ namespace Server.Guilds
}
else
{
- m_Other.GuildMessage(
+ // ~1_val~ has proposed a war.
+ _other.GuildMessage(
1070781,
- guild.Alliance != null
- ? guild.Alliance.Name
- : guild.Name
- ); // ~1_val~ has proposed a war.
+ Guild.Alliance != null
+ ? Guild.Alliance.Name
+ : Guild.Name
+ );
}
+ // War proposal has been sent to ~1_val~.
pm.SendLocalizedMessage(
1070751,
- m_Other.Alliance != null
- ? m_Other.Alliance.Name
- : m_Other.Name
- ); // War proposal has been sent to ~1_val~.
+ _other.Alliance != null
+ ? _other.Alliance.Name
+ : _other.Name
+ );
}
}
@@ -151,7 +148,7 @@ namespace Server.Guilds
}
default:
{
- pm.SendGump(new OtherGuildInfo(pm, guild, m_Other));
+ pm.SendGump(new OtherGuildInfo(pm, Guild, _other));
break;
}
}
diff --git a/Projects/UOContent/Misc/Guild.cs b/Projects/UOContent/Misc/Guild.cs
index ca905ec4a..faf9914ab 100644
--- a/Projects/UOContent/Misc/Guild.cs
+++ b/Projects/UOContent/Misc/Guild.cs
@@ -351,8 +351,6 @@ namespace Server.Guilds
public class AllianceRosterGump : GuildDiplomacyGump
{
- private readonly AllianceInfo m_Alliance;
-
public AllianceRosterGump(PlayerMobile pm, Guild g, AllianceInfo alliance) : base(
pm,
g,
@@ -361,32 +359,12 @@ namespace Server.Guilds
0,
alliance.m_Members,
alliance.Name
- ) =>
- m_Alliance = alliance;
-
- public AllianceRosterGump(
- PlayerMobile pm, Guild g, AllianceInfo alliance, IComparer currentComparer,
- bool ascending, string filter, int startNumber
- ) : base(
- pm,
- g,
- currentComparer,
- ascending,
- filter,
- startNumber,
- alliance.m_Members,
- alliance.Name
- ) =>
- m_Alliance = alliance;
+ )
+ {
+ }
protected override bool AllowAdvancedSearch => false;
- public override Gump GetResentGump(
- PlayerMobile pm, Guild g, IComparer comparer, bool ascending,
- string filter, int startNumber
- ) =>
- new AllianceRosterGump(pm, g, m_Alliance, comparer, ascending, filter, startNumber);
-
public override void OnResponse(NetState sender, in RelayInfo info)
{
if (info.ButtonID != 8) // So that they can't get to the AdvancedSearch button