Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 • committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -18,11 +18,7 @@ namespace Server.Gumps
private int m_Type;
public AddDoorGump() : this(-1)
{
}
public AddDoorGump(int type) : base(50, 40)
public AddDoorGump(int type = -1) : base(50, 40)
{
m_Type = type;
@ -35,18 +31,18 @@ namespace Server.Gumps
int baseID = m_Types[m_Type].m_BaseID;
AddItem(25, 24, baseID);
AddButton(26, 37, 0x5782, 0x5782, 1, GumpButtonType.Reply, 0);
AddButton(26, 37, 0x5782, 0x5782, 1);
AddItem(47, 45, baseID + 2);
AddButton(43, 57, 0x5783, 0x5783, 2, GumpButtonType.Reply, 0);
AddButton(43, 57, 0x5783, 0x5783, 2);
AddItem(87, 22, baseID + 10);
AddButton(116, 35, 0x5785, 0x5785, 6, GumpButtonType.Reply, 0);
AddButton(116, 35, 0x5785, 0x5785, 6);
AddItem(65, 45, baseID + 8);
AddButton(96, 55, 0x5784, 0x5784, 5, GumpButtonType.Reply, 0);
AddButton(96, 55, 0x5784, 0x5784, 5);
AddButton(73, 36, 0x2716, 0x2716, 9, GumpButtonType.Reply, 0);
AddButton(73, 36, 0x2716, 0x2716, 9);
}
else
{
@ -54,7 +50,7 @@ namespace Server.Gumps
for (int i = 0; i < m_Types.Length; ++i)
{
AddButton(30 + i * 49, 13, 0x2624, 0x2625, i + 1, GumpButtonType.Reply, 0);
AddButton(30 + i * 49, 13, 0x2624, 0x2625, i + 1);
AddItem(22 + i * 49, 20, m_Types[i].m_BaseID);
}
}
@ -122,4 +118,4 @@ namespace Server.Gumps
m_BaseID = baseID;
}
}
}
}

View file

@ -32,10 +32,10 @@ namespace Server.Gumps
AddImageTiled(42, 12, 182, 16, 2624);
AddAlphaRegion(42, 12, 182, 16);
AddButton(10, 9, 4011, 4013, 1, GumpButtonType.Reply, 0);
AddButton(10, 9, 4011, 4013, 1);
AddTextEntry(44, 10, 180, 20, 0x480, 0, searchString);
AddHtmlLocalized(230, 10, 100, 20, 3010005, 0x7FFF, false, false);
AddHtmlLocalized(230, 10, 100, 20, 3010005, 0x7FFF);
AddImageTiled(10, 40, 400, 200, 2624);
AddAlphaRegion(10, 40, 400, 200);
@ -46,7 +46,7 @@ namespace Server.Gumps
int index = i % 10;
AddLabel(44, 39 + index * 20, 0x480, searchResults[i].Name);
AddButton(10, 39 + index * 20, 4023, 4025, 4 + i, GumpButtonType.Reply, 0);
AddButton(10, 39 + index * 20, 4023, 4025, 4 + i);
}
else
AddLabel(15, 44, 0x480, explicitSearch ? "Nothing matched your search terms." : "No results to display.");
@ -55,19 +55,18 @@ namespace Server.Gumps
AddAlphaRegion(10, 250, 400, 20);
if (m_Page > 0)
AddButton(10, 249, 4014, 4016, 2, GumpButtonType.Reply, 0);
AddButton(10, 249, 4014, 4016, 2);
else
AddImage(10, 249, 4014);
AddHtmlLocalized(44, 250, 170, 20, 1061028, m_Page > 0 ? 0x7FFF : 0x5EF7, false, false); // Previous page
AddHtmlLocalized(44, 250, 170, 20, 1061028, m_Page > 0 ? 0x7FFF : 0x5EF7); // Previous page
if ((m_Page + 1) * 10 < searchResults.Length)
AddButton(210, 249, 4005, 4007, 3, GumpButtonType.Reply, 0);
AddButton(210, 249, 4005, 4007, 3);
else
AddImage(210, 249, 4005);
AddHtmlLocalized(244, 250, 170, 20, 1061027, (m_Page + 1) * 10 < searchResults.Length ? 0x7FFF : 0x5EF7, false,
false); // Next page
AddHtmlLocalized(244, 250, 170, 20, 1061027, (m_Page + 1) * 10 < searchResults.Length ? 0x7FFF : 0x5EF7); // Next page
}
public static void Initialize()
@ -248,4 +247,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -109,7 +109,7 @@ namespace Server.Gumps
AddPageButton(10, 90, GetButtonID(0, 4), "FIREWALL", AdminGumpPage.Firewall, AdminGumpPage.FirewallInfo);
if (notice != null)
AddHtml(12, 392, 396, 36, Color(notice, LabelColor32), false, false);
AddHtml(12, 392, 396, 36, Color(notice, LabelColor32));
switch (pageType)
{
@ -251,7 +251,7 @@ namespace Server.Gumps
}
case AdminGumpPage.Administer_WorldBuilding:
{
AddHtml(10, 125, 400, 20, Color(Center("Generating"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Generating"), LabelColor32));
AddButtonLabeled(20, 150, GetButtonID(3, 100), "Documentation");
AddButtonLabeled(220, 150, GetButtonID(3, 107), "Rebuild Categorization");
@ -265,7 +265,7 @@ namespace Server.Gumps
AddButtonLabeled(20, 225, GetButtonID(3, 104), "Doors");
AddButtonLabeled(220, 225, GetButtonID(3, 105), "Signs");
AddHtml(20, 275, 400, 30, Color(Center("Statics"), LabelColor32), false, false);
AddHtml(20, 275, 400, 30, Color(Center("Statics"), LabelColor32));
AddButtonLabeled(20, 300, GetButtonID(3, 110), "Freeze (Target)");
AddButtonLabeled(20, 325, GetButtonID(3, 111), "Freeze (World)");
@ -279,7 +279,7 @@ namespace Server.Gumps
}
case AdminGumpPage.Administer_Server:
{
AddHtml(10, 125, 400, 20, Color(Center("Server"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Server"), LabelColor32));
AddButtonLabeled(20, 150, GetButtonID(3, 200), "Save");
@ -296,7 +296,7 @@ namespace Server.Gumps
AddLabel( 20, 215, LabelHue, "Shutdown/Restart not available." );
}*/
AddHtml(10, 295, 400, 20, Color(Center("Broadcast"), LabelColor32), false, false);
AddHtml(10, 295, 400, 20, Color(Center("Broadcast"), LabelColor32));
AddTextField(20, 320, 380, 20, 0);
AddButtonLabeled(20, 350, GetButtonID(3, 210), "To Everyone");
@ -306,12 +306,12 @@ namespace Server.Gumps
}
case AdminGumpPage.Administer_Access_Lockdown:
{
AddHtml(10, 125, 400, 20, Color(Center("Server Lockdown"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Server Lockdown"), LabelColor32));
AddHtml(20, 150, 380, 80,
Color(
"When enabled, only clients with an access level equal to or greater than the specified lockdown level may access the server. After setting a lockdown level, use the <em>Purge Invalid Clients</em> button to disconnect those clients without access.",
LabelColor32), false, false);
LabelColor32));
AccessLevel level = AccountHandler.LockdownLevel;
bool isLockedDown = level > AccessLevel.Player;
@ -331,9 +331,9 @@ namespace Server.Gumps
}
case AdminGumpPage.Administer_Access:
{
AddHtml(10, 125, 400, 20, Color(Center("Access"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Access"), LabelColor32));
AddHtml(10, 155, 400, 20, Color(Center("Connectivity"), LabelColor32), false, false);
AddHtml(10, 155, 400, 20, Color(Center("Connectivity"), LabelColor32));
AddButtonLabeled(20, 180, GetButtonID(3, 300), "Kick");
AddButtonLabeled(220, 180, GetButtonID(3, 301), "Ban");
@ -341,7 +341,7 @@ namespace Server.Gumps
AddButtonLabeled(20, 210, GetButtonID(3, 302), "Firewall");
AddButtonLabeled(220, 210, GetButtonID(3, 303), "Lockdown");
AddHtml(10, 245, 400, 20, Color(Center("Staff"), LabelColor32), false, false);
AddHtml(10, 245, 400, 20, Color(Center("Staff"), LabelColor32));
AddButtonLabeled(20, 270, GetButtonID(3, 310), "Make Player");
AddButtonLabeled(20, 290, GetButtonID(3, 311), "Make Counselor");
@ -365,7 +365,7 @@ namespace Server.Gumps
}
case AdminGumpPage.Administer_Commands:
{
AddHtml(10, 125, 400, 20, Color(Center("Commands"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Commands"), LabelColor32));
AddButtonLabeled(20, 150, GetButtonID(3, 400), "Add");
AddButtonLabeled(220, 150, GetButtonID(3, 401), "Remove");
@ -427,12 +427,12 @@ namespace Server.Gumps
AddLabelCropped(273, 120, 109, 20, LabelHue, "IP Address");
if (listPage > 0)
AddButton(375, 122, 0x15E3, 0x15E7, GetButtonID(1, 0), GumpButtonType.Reply, 0);
AddButton(375, 122, 0x15E3, 0x15E7, GetButtonID(1, 0));
else
AddImage(375, 122, 0x25EA);
if ((listPage + 1) * 12 < m_List.Count)
AddButton(392, 122, 0x15E1, 0x15E5, GetButtonID(1, 1), GumpButtonType.Reply, 0);
AddButton(392, 122, 0x15E1, 0x15E5, GetButtonID(1, 1));
else
AddImage(392, 122, 0x25E6);
@ -461,7 +461,7 @@ namespace Server.Gumps
AddLabelCropped(273, offset, 109, 20, LabelHue, ns.ToString());
if (a != null || m != null)
AddButton(380, offset - 1, 0xFA5, 0xFA7, GetButtonID(4, index + 2), GumpButtonType.Reply, 0);
AddButton(380, offset - 1, 0xFA5, 0xFA7, GetButtonID(4, index + 2));
}
break;
@ -473,7 +473,7 @@ namespace Server.Gumps
AddClientHeader();
AddHtml(10, 125, 400, 20, Color(Center("Information"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Information"), LabelColor32));
int y = 146;
@ -485,7 +485,7 @@ namespace Server.Gumps
AddLabel(20, y, LabelHue, "Account:");
AddLabel(200, y, a != null && a.Banned ? RedHue : LabelHue, a == null ? "(no account)" : a.Username);
AddButton(380, y, 0xFA5, 0xFA7, GetButtonID(7, 14), GumpButtonType.Reply, 0);
AddButton(380, y, 0xFA5, 0xFA7, GetButtonID(7, 14));
y += 20;
NetState ns = m.NetState;
@ -565,12 +565,12 @@ namespace Server.Gumps
AddLabelCropped(192, 120, 180, 20, LabelHue, "Accounts");
if (listPage > 0)
AddButton(375, 122, 0x15E3, 0x15E7, GetButtonID(1, 0), GumpButtonType.Reply, 0);
AddButton(375, 122, 0x15E3, 0x15E7, GetButtonID(1, 0));
else
AddImage(375, 122, 0x25EA);
if ((listPage + 1) * 12 < sharedAccounts.Count)
AddButton(392, 122, 0x15E1, 0x15E5, GetButtonID(1, 1), GumpButtonType.Reply, 0);
AddButton(392, 122, 0x15E1, 0x15E5, GetButtonID(1, 1));
else
AddImage(392, 122, 0x25E6);
@ -614,7 +614,7 @@ namespace Server.Gumps
AddLabelCropped(192, offset, 180, 20, LabelHue, sb.ToString());
AddButton(380, offset - 1, 0xFA5, 0xFA7, GetButtonID(5, index + 56), GumpButtonType.Reply, 0);
AddButton(380, offset - 1, 0xFA5, 0xFA7, GetButtonID(5, index + 56));
}
break;
@ -637,12 +637,12 @@ namespace Server.Gumps
AddLabelCropped(252, 120, 120, 20, LabelHue, "Status");
if (listPage > 0)
AddButton(375, 122, 0x15E3, 0x15E7, GetButtonID(1, 0), GumpButtonType.Reply, 0);
AddButton(375, 122, 0x15E3, 0x15E7, GetButtonID(1, 0));
else
AddImage(375, 122, 0x25EA);
if ((listPage + 1) * 12 < m_List.Count)
AddButton(392, 122, 0x15E1, 0x15E5, GetButtonID(1, 1), GumpButtonType.Reply, 0);
AddButton(392, 122, 0x15E1, 0x15E5, GetButtonID(1, 1));
else
AddImage(392, 122, 0x25E6);
@ -686,7 +686,7 @@ namespace Server.Gumps
else
AddLabelCropped(252, offset, 120, 20, RedHue, "Offline");
AddButton(380, offset - 1, 0xFA5, 0xFA7, GetButtonID(5, index + 56), GumpButtonType.Reply, 0);
AddButton(380, offset - 1, 0xFA5, 0xFA7, GetButtonID(5, index + 56));
}
break;
@ -707,7 +707,7 @@ namespace Server.Gumps
if (!(state is Account a))
break;
AddHtml(10, 125, 400, 20, Color(Center("Change Password"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Change Password"), LabelColor32));
AddLabel(20, 150, LabelHue, "Username:");
AddLabel(200, 150, LabelHue, a.Username);
@ -727,7 +727,7 @@ namespace Server.Gumps
if (!(state is Account a))
break;
AddHtml(10, 125, 400, 20, Color(Center("Change Access Level"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Change Access Level"), LabelColor32));
AddLabel(20, 150, LabelHue, "Username:");
AddLabel(200, 150, LabelHue, a.Username);
@ -766,7 +766,7 @@ namespace Server.Gumps
if (a[i] != null)
++charCount;
AddHtml(10, 125, 400, 20, Color(Center("Information"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Information"), LabelColor32));
AddLabel(20, 150, LabelHue, "Username:");
AddLabel(200, 150, LabelHue, a.Username);
@ -841,7 +841,7 @@ namespace Server.Gumps
if (!(state is Account a))
break;
AddHtml(10, 125, 400, 20, Color(Center("Access"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Access"), LabelColor32));
AddPageButton(20, 150, GetButtonID(5, 14), "View client addresses",
AdminGumpPage.AccountDetails_Access_ClientIPs);
@ -865,41 +865,39 @@ namespace Server.Gumps
else
ipAddresses = Utility.CastListCovariant<object, IPAddress>(m_List);
AddHtml(10, 195, 400, 20, Color(Center("Client Addresses"), LabelColor32), false, false);
AddHtml(10, 195, 400, 20, Color(Center("Client Addresses"), LabelColor32));
AddButtonLabeled(227, 225, GetButtonID(5, 16), "View all shared accounts");
AddButtonLabeled(227, 245, GetButtonID(5, 17), "Ban all shared accounts");
AddButtonLabeled(227, 265, GetButtonID(5, 18), "Firewall all addresses");
AddButtonLabeled(227, 285, GetButtonID(5, 36), "Clear all addresses");
AddHtml(225, 315, 180, 80, Color("List of IP addresses which have accessed this account.", LabelColor32),
false, false);
AddHtml(225, 315, 180, 80, Color("List of IP addresses which have accessed this account.", LabelColor32));
AddImageTiled(15, 219, 206, 156, 0xBBC);
AddBlackAlpha(16, 220, 204, 154);
AddHtml(18, 221, 114, 20, Color("IP Address", LabelColor32), false, false);
AddHtml(18, 221, 114, 20, Color("IP Address", LabelColor32));
if (listPage > 0)
AddButton(184, 223, 0x15E3, 0x15E7, GetButtonID(1, 0), GumpButtonType.Reply, 0);
AddButton(184, 223, 0x15E3, 0x15E7, GetButtonID(1, 0));
else
AddImage(184, 223, 0x25EA);
if ((listPage + 1) * 6 < ipAddresses.Count)
AddButton(201, 223, 0x15E1, 0x15E5, GetButtonID(1, 1), GumpButtonType.Reply, 0);
AddButton(201, 223, 0x15E1, 0x15E5, GetButtonID(1, 1));
else
AddImage(201, 223, 0x25E6);
if (ipAddresses.Count == 0)
AddHtml(18, 243, 200, 60, Color("This account has not yet been accessed.", LabelColor32), false,
false);
AddHtml(18, 243, 200, 60, Color("This account has not yet been accessed.", LabelColor32));
for (int i = 0, index = listPage * 6; i < 6 && index >= 0 && index < ipAddresses.Count; ++i, ++index)
{
AddHtml(18, 243 + i * 22, 114, 20, Color(ipAddresses[index].ToString(), LabelColor32), false, false);
AddButton(130, 242 + i * 22, 0xFA2, 0xFA4, GetButtonID(8, index), GumpButtonType.Reply, 0);
AddButton(160, 242 + i * 22, 0xFA8, 0xFAA, GetButtonID(9, index), GumpButtonType.Reply, 0);
AddButton(190, 242 + i * 22, 0xFB1, 0xFB3, GetButtonID(10, index), GumpButtonType.Reply, 0);
AddHtml(18, 243 + i * 22, 114, 20, Color(ipAddresses[index].ToString(), LabelColor32));
AddButton(130, 242 + i * 22, 0xFA2, 0xFA4, GetButtonID(8, index));
AddButton(160, 242 + i * 22, 0xFA8, 0xFAA, GetButtonID(9, index));
AddButton(190, 242 + i * 22, 0xFB1, 0xFB3, GetButtonID(10, index));
}
goto case AdminGumpPage.AccountDetails_Access;
@ -919,7 +917,7 @@ namespace Server.Gumps
else
ipRestrictions = Utility.CastListCovariant<object, string>(m_List);
AddHtml(10, 195, 400, 20, Color(Center("Address Restrictions"), LabelColor32), false, false);
AddHtml(10, 195, 400, 20, Color(Center("Address Restrictions"), LabelColor32));
AddTextField(227, 225, 120, 20, 0);
@ -928,30 +926,30 @@ namespace Server.Gumps
AddHtml(225, 255, 180, 120,
Color(
"Any clients connecting from an address not in this list will be rejected. Or, if the list is empty, any client may connect.",
LabelColor32), false, false);
LabelColor32));
AddImageTiled(15, 219, 206, 156, 0xBBC);
AddBlackAlpha(16, 220, 204, 154);
AddHtml(18, 221, 114, 20, Color("IP Address", LabelColor32), false, false);
AddHtml(18, 221, 114, 20, Color("IP Address", LabelColor32));
if (listPage > 0)
AddButton(184, 223, 0x15E3, 0x15E7, GetButtonID(1, 0), GumpButtonType.Reply, 0);
AddButton(184, 223, 0x15E3, 0x15E7, GetButtonID(1, 0));
else
AddImage(184, 223, 0x25EA);
if ((listPage + 1) * 6 < ipRestrictions.Count)
AddButton(201, 223, 0x15E1, 0x15E5, GetButtonID(1, 1), GumpButtonType.Reply, 0);
AddButton(201, 223, 0x15E1, 0x15E5, GetButtonID(1, 1));
else
AddImage(201, 223, 0x25E6);
if (ipRestrictions.Count == 0)
AddHtml(18, 243, 200, 60, Color("There are no addresses in this list.", LabelColor32), false, false);
AddHtml(18, 243, 200, 60, Color("There are no addresses in this list.", LabelColor32));
for (int i = 0, index = listPage * 6; i < 6 && index >= 0 && index < ipRestrictions.Count; ++i, ++index)
{
AddHtml(18, 243 + i * 22, 114, 20, Color(ipRestrictions[index].ToString(), LabelColor32), false, false);
AddButton(190, 242 + i * 22, 0xFB1, 0xFB3, GetButtonID(8, index), GumpButtonType.Reply, 0);
AddHtml(18, 243 + i * 22, 114, 20, Color(ipRestrictions[index], LabelColor32));
AddButton(190, 242 + i * 22, 0xFB1, 0xFB3, GetButtonID(8, index));
}
goto case AdminGumpPage.AccountDetails_Access;
@ -961,7 +959,7 @@ namespace Server.Gumps
if (!(state is Account a))
break;
AddHtml(10, 125, 400, 20, Color(Center("Characters"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Characters"), LabelColor32));
AddLabelCropped(12, 150, 120, 20, LabelHue, "Name");
AddLabelCropped(132, 150, 120, 20, LabelHue, "Access Level");
@ -986,7 +984,7 @@ namespace Server.Gumps
else
AddLabelCropped(252, offset, 120, 20, RedHue, "Offline");
AddButton(380, offset - 1, 0xFA5, 0xFA7, GetButtonID(5, i + 50), GumpButtonType.Reply, 0);
AddButton(380, offset - 1, 0xFA5, 0xFA7, GetButtonID(5, i + 50));
++index;
}
@ -1001,7 +999,7 @@ namespace Server.Gumps
if (!(state is Account a))
break;
AddHtml(10, 125, 400, 20, Color(Center("Comments"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Comments"), LabelColor32));
AddButtonLabeled(20, 150, GetButtonID(5, 4), "Add Comment");
@ -1029,7 +1027,7 @@ namespace Server.Gumps
if (!(state is Account a))
break;
AddHtml(10, 125, 400, 20, Color(Center("Tags"), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center("Tags"), LabelColor32));
AddButtonLabeled(20, 150, GetButtonID(5, 5), "Add Tag");
@ -1069,12 +1067,12 @@ namespace Server.Gumps
AddLabelCropped(12, 120, 358, 20, LabelHue, "IP Address");
if (listPage > 0)
AddButton(375, 122, 0x15E3, 0x15E7, GetButtonID(1, 0), GumpButtonType.Reply, 0);
AddButton(375, 122, 0x15E3, 0x15E7, GetButtonID(1, 0));
else
AddImage(375, 122, 0x25EA);
if ((listPage + 1) * 12 < firewallEntries.Count)
AddButton(392, 122, 0x15E1, 0x15E5, GetButtonID(1, 1), GumpButtonType.Reply, 0);
AddButton(392, 122, 0x15E1, 0x15E5, GetButtonID(1, 1));
else
AddImage(392, 122, 0x25E6);
@ -1088,7 +1086,7 @@ namespace Server.Gumps
int offset = 140 + i * 20;
AddLabelCropped(12, offset, 358, 20, LabelHue, firewallEntry.ToString());
AddButton(380, offset - 1, 0xFA5, 0xFA7, GetButtonID(6, index + 4), GumpButtonType.Reply, 0);
AddButton(380, offset - 1, 0xFA5, 0xFA7, GetButtonID(6, index + 4));
}
break;
@ -1100,11 +1098,11 @@ namespace Server.Gumps
if (!(state is Firewall.IFirewallEntry firewallEntry))
break;
AddHtml(10, 125, 400, 20, Color(Center(firewallEntry.ToString()), LabelColor32), false, false);
AddHtml(10, 125, 400, 20, Color(Center(firewallEntry.ToString()), LabelColor32));
AddButtonLabeled(20, 150, GetButtonID(6, 3), "Remove");
AddHtml(10, 175, 400, 20, Color(Center("Potentially Affected Accounts"), LabelColor32), false, false);
AddHtml(10, 175, 400, 20, Color(Center("Potentially Affected Accounts"), LabelColor32));
List<Account> blockedAccts;
@ -1135,12 +1133,12 @@ namespace Server.Gumps
blockedAccts = Utility.CastListCovariant<object, Account>(m_List);
if (listPage > 0)
AddButton(375, 177, 0x15E3, 0x15E7, GetButtonID(1, 0), GumpButtonType.Reply, 0);
AddButton(375, 177, 0x15E3, 0x15E7, GetButtonID(1, 0));
else
AddImage(375, 177, 0x25EA);
if ((listPage + 1) * 12 < blockedAccts.Count)
AddButton(392, 177, 0x15E1, 0x15E5, GetButtonID(1, 1), GumpButtonType.Reply, 0);
AddButton(392, 177, 0x15E1, 0x15E5, GetButtonID(1, 1));
else
AddImage(392, 177, 0x25E6);
@ -1165,7 +1163,7 @@ namespace Server.Gumps
else
AddLabelCropped(252, offset, 120, 20, RedHue, "Offline");
AddButton(380, offset - 1, 0xFA5, 0xFA7, GetButtonID(5, index + 56), GumpButtonType.Reply, 0);
AddButton(380, offset - 1, 0xFA5, 0xFA7, GetButtonID(5, index + 56));
}
break;
@ -1186,14 +1184,14 @@ namespace Server.Gumps
public void AddSelectedButton(int x, int y, int buttonID, string text, bool isSelection)
{
AddButton(x, y - 1, isSelection ? 4006 : 4005, 4007, buttonID, GumpButtonType.Reply, 0);
AddHtml(x + 35, y, 200, 20, Color(text, isSelection ? SelectedColor32 : LabelColor32), false, false);
AddButton(x, y - 1, isSelection ? 4006 : 4005, 4007, buttonID);
AddHtml(x + 35, y, 200, 20, Color(text, isSelection ? SelectedColor32 : LabelColor32));
}
public void AddButtonLabeled(int x, int y, int buttonID, string text)
{
AddButton(x, y - 1, 4005, 4007, buttonID, GumpButtonType.Reply, 0);
AddHtml(x + 35, y, 240, 20, Color(text, LabelColor32), false, false);
AddButton(x, y - 1, 4005, 4007, buttonID);
AddHtml(x + 35, y, 240, 20, Color(text, LabelColor32));
}
public string Center(string text)
@ -1342,7 +1340,7 @@ namespace Server.Gumps
for (int i = 0; i < theirAddresses.Length; ++i)
{
if (!table.ContainsKey(theirAddresses[i]))
table[theirAddresses[i]] = new List<Account>{ acct };
table[theirAddresses[i]] = new List<Account>{ acct };
}
}
@ -1352,7 +1350,7 @@ namespace Server.Gumps
{
KeyValuePair<IPAddress, List<Account>> kvp = tableEntries[i];
List<Account> list = kvp.Value;
if (kvp.Value.Count == 1)
list.RemoveAt(i--);
else
@ -1372,7 +1370,7 @@ namespace Server.Gumps
foreach (IAccount account in Accounts.GetAccounts())
{
Account acct = (Account)account;
IPAddress[] theirAddresses = acct.LoginIPs;
bool contains = false;
@ -2004,7 +2002,7 @@ namespace Server.Gumps
{
Mobile m = a[j];
if (m != null && m.AccessLevel >= level)
if (m?.AccessLevel >= level)
hasAccess = true;
}
@ -2085,8 +2083,8 @@ namespace Server.Gumps
Mobile m = ns.Mobile;
IAccount a = ns.Account;
isMatch = m != null && m.Name.ToLower().IndexOf(match) >= 0
|| a != null && a.Username.ToLower().IndexOf(match) >= 0;
isMatch = m?.Name.ToLower().IndexOf(match) >= 0
|| a?.Username.ToLower().IndexOf(match) >= 0;
}
else
{
@ -2103,10 +2101,7 @@ namespace Server.Gumps
if (results.Count == 1)
{
NetState ns = results[0];
object state = ns.Mobile;
if (state == null)
state = ns.Account;
object state = ns.Mobile ?? (object)ns.Account;
if (state is Mobile)
from.SendGump(new AdminGump(from, AdminGumpPage.ClientInfo, 0, null, "One match found.",
@ -2327,7 +2322,7 @@ namespace Server.Gumps
List<Account> list = GetSharedAccounts(a.LoginIPs);
if (list.Count > 1 || list.Count == 1 && !list.Contains(a))
from.SendGump(new AdminGump(from, AdminGumpPage.Accounts, 0,
from.SendGump(new AdminGump(from, AdminGumpPage.Accounts, 0,
Utility.CastListContravariant<Account, object>(list), null, new List<object>()));
else if (a.LoginIPs.Length > 0)
from.SendGump(new AdminGump(from, AdminGumpPage.AccountDetails_Access_ClientIPs, 0, null,
@ -3183,9 +3178,9 @@ namespace Server.Gumps
return 1;
if (aLevel > bLevel)
return -1;
return aLevel < bLevel ? 1 : Insensitive.Compare(x.Username, y.Username);
}
}
}
}
}

View file

@ -26,7 +26,7 @@ namespace Server.Gumps
//AddImageTiled( 10, 10, width - 20, 20, 2624 );
//AddAlphaRegion( 10, 10, width - 20, 20 );
AddHtml(10, 10, width - 20, 20, "<CENTER>Ban Duration</CENTER>", false, false);
AddHtml(10, 10, width - 20, 20, "<CENTER>Ban Duration</CENTER>");
//AddImageTiled( 10, 40, width - 20, height - 50, 2624 );
//AddAlphaRegion( 10, 40, width - 20, height - 50 );
@ -39,14 +39,14 @@ namespace Server.Gumps
AddInput(5, 2, "Minutes");
AddInput(6, 3, "Seconds");
AddHtml(170, 45, 240, 20, "Comments:", false, false);
AddHtml(170, 45, 240, 20, "Comments:");
AddTextField(170, 65, 315, height - 80, 10);
}
public void AddButtonLabeled(int x, int y, int buttonID, string text)
{
AddButton(x, y - 1, 4005, 4007, buttonID, GumpButtonType.Reply, 0);
AddHtml(x + 35, y, 240, 20, text, false, false);
AddButton(x, y - 1, 4005, 4007, buttonID);
AddHtml(x + 35, y, 240, 20, text);
}
public void AddTextField(int x, int y, int width, int height, int index)
@ -240,4 +240,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -31,17 +31,17 @@ namespace Server.Gumps
AddImage(315, 248, 0x2716);
AddImage(2, 248, 0x2716);
AddImage(2, 2, 0x2716);
AddHtmlLocalized(25, 25, 200, 20, TitleNumber, 0x7D00, false, false);
AddHtmlLocalized(25, 25, 200, 20, TitleNumber, 0x7D00);
AddImage(25, 40, 0xBBF);
AddHtmlLocalized(25, 55, 300, 120, LabelNumber, 0xFFFFFF, false, false);
AddHtmlLocalized(25, 55, 300, 120, LabelNumber, 0xFFFFFF);
AddRadio(25, 175, 0x25F8, 0x25FB, true, (int)Buttons.Break);
AddRadio(25, 210, 0x25F8, 0x25FB, false, (int)Buttons.Close);
AddHtmlLocalized(60, 180, 280, 20, 1074976, 0xFFFFFF, false, false);
AddHtmlLocalized(60, 215, 280, 20, 1074977, 0xFFFFFF, false, false);
AddHtmlLocalized(60, 180, 280, 20, 1074976, 0xFFFFFF);
AddHtmlLocalized(60, 215, 280, 20, 1074977, 0xFFFFFF);
AddButton(265, 220, 0xF7, 0xF8, (int)Buttons.Confirm, GumpButtonType.Reply, 0);
AddButton(265, 220, 0xF7, 0xF8, (int)Buttons.Confirm);
}
public virtual int TitleNumber // <center>Warning!</center>
@ -76,4 +76,4 @@ namespace Server.Gumps
Confirm
}
}
}
}

View file

@ -126,7 +126,7 @@ namespace Server.Gumps
public void AddEntryHtml(int width, string text)
{
AddImageTiled(CurrentX, CurrentY, width, EntryHeight, EntryGumpID);
AddHtml(CurrentX + TextOffsetX, CurrentY, width - TextOffsetX, EntryHeight, text, false, false);
AddHtml(CurrentX + TextOffsetX, CurrentY, width - TextOffsetX, EntryHeight, text);
IncreaseX(width);
}
@ -163,7 +163,7 @@ namespace Server.Gumps
HeaderGumpID);
AddButton(CurrentX + (width - buttonWidth) / 2,
CurrentY + (EntryHeight * spannedEntries + OffsetSize * (spannedEntries - 1) - buttonHeight) / 2, normalID,
pressedID, buttonID, GumpButtonType.Reply, 0);
pressedID, buttonID);
IncreaseX(width);
}
@ -185,4 +185,4 @@ namespace Server.Gumps
IncreaseX(width);
}
}
}
}

View file

@ -11,7 +11,7 @@ namespace Server.Gumps
private TextDefinition m_Label;
private int m_LocalizedTooltip;
public ImageTileButtonInfo(int itemID, int hue, TextDefinition label, int localizedTooltip)
public ImageTileButtonInfo(int itemID, int hue, TextDefinition label, int localizedTooltip = -1)
{
m_Hue = hue;
m_ItemID = itemID;
@ -19,10 +19,6 @@ namespace Server.Gumps
m_LocalizedTooltip = localizedTooltip;
}
public ImageTileButtonInfo(int itemID, int hue, TextDefinition label) : this(itemID, hue, label, -1)
{
}
public virtual int ItemID
{
get => m_ItemID;
@ -69,8 +65,8 @@ namespace Server.Gumps
AddImageTiled(10, y + 54, x, 20, 0xA40);
AddAlphaRegion(10, 10, x, y + 64);
AddButton(10, y + 54, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0); //Cancel Button
AddHtmlLocalized(45, y + 56, x - 50, 20, 1060051, 0x7FFF, false, false); // CANCEL
AddButton(10, y + 54, 0xFB1, 0xFB2, 0); //Cancel Button
AddHtmlLocalized(45, y + 56, x - 50, 20, 1060051, 0x7FFF); // CANCEL
TextDefinition.AddHtmlText(this, 14, 12, x, 20, header, false, false, 0x7FFF, 0xFFFFFF);
AddPage(1);
@ -89,12 +85,12 @@ namespace Server.Gumps
if (position == 0 && i != 0)
{
AddButton(x - 100, y + 54, 0xFA5, 0xFA7, 0, GumpButtonType.Page, pageNum);
AddHtmlLocalized(x - 60, y + 56, 60, 20, 1043353, 0x7FFF, false, false); // Next
AddHtmlLocalized(x - 60, y + 56, 60, 20, 1043353, 0x7FFF); // Next
AddPage(pageNum);
AddButton(x - 200, y + 54, 0xFAE, 0xFB0, 0, GumpButtonType.Page, pageNum - 1);
AddHtmlLocalized(x - 160, y + 56, 60, 20, 1011393, 0x7FFF, false, false); // Back
AddHtmlLocalized(x - 160, y + 56, 60, 20, 1011393, 0x7FFF); // Back
}
ImageTileButtonInfo b = buttons[i];
@ -128,4 +124,4 @@ namespace Server.Gumps
{
}
}
}
}

View file

@ -111,20 +111,11 @@ namespace Server.Gumps
public override string Caption => Title;
public static CAGCategory Root
{
get
{
if (m_Root == null)
m_Root = Load("Data/objects.xml");
return m_Root;
}
}
public static CAGCategory Root => m_Root ?? (m_Root = Load("Data/objects.xml"));
public override void OnClick(Mobile from, int page)
{
from.SendGump(new CategorizedAddGump(from, this, 0));
from.SendGump(new CategorizedAddGump(from, this));
}
public static CAGCategory Load(string path)
@ -215,11 +206,11 @@ namespace Server.Gumps
private Mobile m_Owner;
private int m_Page;
public CategorizedAddGump(Mobile owner) : this(owner, CAGCategory.Root, 0)
public CategorizedAddGump(Mobile owner) : this(owner, CAGCategory.Root)
{
}
public CategorizedAddGump(Mobile owner, CAGCategory category, int page) : base(GumpOffsetX, GumpOffsetY)
public CategorizedAddGump(Mobile owner, CAGCategory category, int page = 0) : base(GumpOffsetX, GumpOffsetY)
{
owner.CloseGump<WhoGump>();
@ -260,7 +251,7 @@ namespace Server.Gumps
if (m_Category.Parent != null)
{
AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1, GumpButtonType.Reply, 0);
AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1);
if (PrevLabel)
AddLabel(x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous");
@ -276,7 +267,7 @@ namespace Server.Gumps
EntryGumpID);
AddHtml(x + TextOffsetX, y + (EntryHeight - 20) / 2, emptyWidth - TextOffsetX, EntryHeight,
$"<center>{m_Category.Caption}</center>", false, false);
$"<center>{m_Category.Caption}</center>");
x += emptyWidth + OffsetSize;
@ -287,7 +278,7 @@ namespace Server.Gumps
if (page > 0)
{
AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 2, GumpButtonType.Reply, 0);
AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 2);
if (PrevLabel)
AddLabel(x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous");
@ -322,7 +313,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, i + 4, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, i + 4);
if (node is CAGObject obj)
{
@ -393,4 +384,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -12,11 +12,7 @@ namespace Server.Gumps
private const int LabelColor32 = 0xFFFFFF;
private NetState m_State;
public ClientGump(Mobile from, NetState state) : this(from, state, "")
{
}
public ClientGump(Mobile from, NetState state, string initialText) : base(30, 20)
public ClientGump(Mobile from, NetState state, string initialText = "") : base(30, 20)
{
if (state == null)
return;
@ -33,44 +29,43 @@ namespace Server.Gumps
AddImageTiled(10, 32, 380, 232, 0xA40);
AddAlphaRegion(10, 32, 380, 232);
AddHtml(10, 10, 380, 20, Color(Center("User Information"), LabelColor32), false, false);
AddHtml(10, 10, 380, 20, Color(Center("User Information"), LabelColor32));
int line = 0;
AddHtml(14, 36 + line * 20, 200, 20, Color("Address:", LabelColor32), false, false);
AddHtml(70, 36 + line++ * 20, 200, 20, Color(state.ToString(), LabelColor32), false, false);
AddHtml(14, 36 + line * 20, 200, 20, Color("Address:", LabelColor32));
AddHtml(70, 36 + line++ * 20, 200, 20, Color(state.ToString(), LabelColor32));
AddHtml(14, 36 + line * 20, 200, 20, Color("Client:", LabelColor32), false, false);
AddHtml(14, 36 + line * 20, 200, 20, Color("Client:", LabelColor32));
AddHtml(70, 36 + line++ * 20, 200, 20,
Color(state.Version == null ? "(null)" : state.Version.ToString(), LabelColor32), false, false);
Color(state.Version == null ? "(null)" : state.Version.ToString(), LabelColor32));
AddHtml(14, 36 + line * 20, 200, 20, Color("Version:", LabelColor32), false, false);
AddHtml(14, 36 + line * 20, 200, 20, Color("Version:", LabelColor32));
ExpansionInfo info = state.ExpansionInfo;
string expansionName = info.Name;
AddHtml(70, 36 + line++ * 20, 200, 20, Color(expansionName, LabelColor32), false, false);
AddHtml(70, 36 + line++ * 20, 200, 20, Color(expansionName, LabelColor32));
Account a = state.Account as Account;
Mobile m = state.Mobile;
if (from.AccessLevel >= AccessLevel.GameMaster && a != null)
{
AddHtml(14, 36 + line * 20, 200, 20, Color("Account:", LabelColor32), false, false);
AddHtml(70, 36 + line++ * 20, 200, 20, Color(a.Username, LabelColor32), false, false);
AddHtml(14, 36 + line * 20, 200, 20, Color("Account:", LabelColor32));
AddHtml(70, 36 + line++ * 20, 200, 20, Color(a.Username, LabelColor32));
}
if (m != null)
{
AddHtml(14, 36 + line * 20, 200, 20, Color("Mobile:", LabelColor32), false, false);
AddHtml(70, 36 + line++ * 20, 200, 20, Color($"{m.Name} (0x{m.Serial.Value:X})", LabelColor32), false,
false);
AddHtml(14, 36 + line * 20, 200, 20, Color("Mobile:", LabelColor32));
AddHtml(70, 36 + line++ * 20, 200, 20, Color($"{m.Name} (0x{m.Serial.Value:X})", LabelColor32));
AddHtml(14, 36 + line * 20, 200, 20, Color("Location:", LabelColor32), false, false);
AddHtml(70, 36 + line++ * 20, 200, 20, Color($"{m.Location} [{m.Map}]", LabelColor32), false, false);
AddHtml(14, 36 + line * 20, 200, 20, Color("Location:", LabelColor32));
AddHtml(70, 36 + line++ * 20, 200, 20, Color($"{m.Location} [{m.Map}]", LabelColor32));
AddButton(13, 157, 0xFAB, 0xFAD, 1, GumpButtonType.Reply, 0);
AddHtml(48, 158, 200, 20, Color("Send Message", LabelColor32), false, false);
AddButton(13, 157, 0xFAB, 0xFAD, 1);
AddHtml(48, 158, 200, 20, Color("Send Message", LabelColor32));
AddImageTiled(12, 182, 376, 80, 0xA40);
AddImageTiled(13, 183, 374, 78, 0xBBC);
@ -85,43 +80,43 @@ namespace Server.Gumps
if (BaseCommand.IsAccessible(from, m))
{
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 4, GumpButtonType.Reply, 0);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Properties", LabelColor32), false, false);
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 4);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Properties", LabelColor32));
}
if (from != m)
{
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 5, GumpButtonType.Reply, 0);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Go to them", LabelColor32), false, false);
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 5);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Go to them", LabelColor32));
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 6, GumpButtonType.Reply, 0);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Bring them here", LabelColor32), false, false);
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 6);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Bring them here", LabelColor32));
}
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 7, GumpButtonType.Reply, 0);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Move to target", LabelColor32), false, false);
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 7);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Move to target", LabelColor32));
if (from.AccessLevel >= AccessLevel.GameMaster && from.AccessLevel > m.AccessLevel)
{
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 8, GumpButtonType.Reply, 0);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Disconnect", LabelColor32), false, false);
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 8);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Disconnect", LabelColor32));
if (m.Alive)
{
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 9, GumpButtonType.Reply, 0);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Kill", LabelColor32), false, false);
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 9);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Kill", LabelColor32));
}
else
{
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 10, GumpButtonType.Reply, 0);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Resurrect", LabelColor32), false, false);
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 10);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Resurrect", LabelColor32));
}
}
if (from.AccessLevel >= AccessLevel.Counselor && from.AccessLevel > m.AccessLevel)
{
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 11, GumpButtonType.Reply, 0);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Skills browser", LabelColor32), false, false);
AddButton(246, 36 + line * 20, 0xFA5, 0xFA7, 11);
AddHtml(280, 38 + line++ * 20, 100, 20, Color("Skills browser", LabelColor32));
}
}
}
@ -307,4 +302,4 @@ namespace Server.Gumps
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
}
}
}
}

View file

@ -26,7 +26,7 @@ namespace Server.Gumps
AddLabel(x, 12, 2100, title);
AddPage(1);
AddButton(12, 12, 0xFA8, 0xFAA, 0x7F, GumpButtonType.Reply, 0);
AddButton(12, 12, 0xFA8, 0xFAA, 0x7F);
AddLabel(48, 12, 2100, "Add Comment");
List<AccountComment> list = acct.Comments;
@ -115,4 +115,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -17,37 +17,37 @@ namespace Server.Gumps
public override void Confirm(Mobile from)
{
if (m_Item == null || m_Item.Deleted)
if (m_Item?.Deleted != false)
return;
BaseCreature summon = m_Item.Summon;
if (summon != null)
if (summon == null)
return;
if (!summon.SetControlMaster(from))
{
if (!summon.SetControlMaster(from))
{
summon.Delete();
}
else
{
from.SendLocalizedMessage(1049666); // Your pet has bonded with you!
summon.Delete();
}
else
{
from.SendLocalizedMessage(1049666); // Your pet has bonded with you!
summon.MoveToWorld(from.Location, from.Map);
summon.IsBonded = true;
summon.MoveToWorld(from.Location, from.Map);
summon.IsBonded = true;
summon.Skills.Wrestling.Base = 100;
summon.Skills.Tactics.Base = 100;
summon.Skills.MagicResist.Base = 100;
summon.Skills.Anatomy.Base = 100;
summon.Skills.Wrestling.Base = 100;
summon.Skills.Tactics.Base = 100;
summon.Skills.MagicResist.Base = 100;
summon.Skills.Anatomy.Base = 100;
Effects.PlaySound(summon.Location, summon.Map, summon.BaseSoundID);
Effects.SendLocationParticles(EffectItem.Create(summon.Location, summon.Map, EffectItem.DefaultDuration),
0x3728, 1, 10, 0x26B6);
Effects.PlaySound(summon.Location, summon.Map, summon.BaseSoundID);
Effects.SendLocationParticles(EffectItem.Create(summon.Location, summon.Map, EffectItem.DefaultDuration),
0x3728, 1, 10, 0x26B6);
m_Item.Release(from, summon);
m_Item.Delete();
}
m_Item.Release(from, summon);
m_Item.Delete();
}
}
}
}
}

View file

@ -18,19 +18,18 @@ namespace Server.Gumps
AddBackground(0, 0, 291, 99, 0x13BE);
AddImageTiled(5, 6, 280, 20, 0xA40);
AddHtmlLocalized(9, 8, 280, 20, 1070972, 0x7FFF, false,
false); // Click "OKAY" to redeem the following promotional item:
AddHtmlLocalized(9, 8, 280, 20, 1070972, 0x7FFF); // Click "OKAY" to redeem the following promotional item:
AddImageTiled(5, 31, 280, 40, 0xA40);
AddHtmlLocalized(9, 35, 272, 40, cliloc, 0x7FFF, false, false);
AddButton(180, 73, 0xFB7, 0xFB8, (int)Buttons.Okay, GumpButtonType.Reply, 0);
AddHtmlLocalized(215, 75, 100, 20, 1011036, 0x7FFF, false, false); // OKAY
AddButton(5, 73, 0xFB1, 0xFB2, (int)Buttons.Cancel, GumpButtonType.Reply, 0);
AddHtmlLocalized(40, 75, 100, 20, 1060051, 0x7FFF, false, false); // CANCEL
AddHtmlLocalized(9, 35, 272, 40, cliloc, 0x7FFF);
AddButton(180, 73, 0xFB7, 0xFB8, (int)Buttons.Okay);
AddHtmlLocalized(215, 75, 100, 20, 1011036, 0x7FFF); // OKAY
AddButton(5, 73, 0xFB1, 0xFB2, (int)Buttons.Cancel);
AddHtmlLocalized(40, 75, 100, 20, 1060051, 0x7FFF); // CANCEL
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (m_Token == null || m_Token.Deleted)
if (m_Token?.Deleted != false)
return;
switch (info.ButtonID)
@ -71,4 +70,4 @@ namespace Server.Gumps
Okay
}
}
}
}

View file

@ -24,7 +24,7 @@ namespace Server.Gumps
AddBackground(0, 0, 420, 280, 0x13BE);
AddImageTiled(10, 10, 400, 20, 0xA40);
AddAlphaRegion(10, 10, 400, 20);
AddHtmlLocalized(10, 10, 400, 20, 1060635, 0x7800, false, false); // <CENTER>WARNING</CENTER>
AddHtmlLocalized(10, 10, 400, 20, 1060635, 0x7800); // <CENTER>WARNING</CENTER>
AddImageTiled(10, 40, 400, 200, 0xA40);
AddAlphaRegion(10, 40, 400, 200);
@ -40,10 +40,10 @@ namespace Server.Gumps
AddImageTiled(10, 250, 400, 20, 0xA40);
AddAlphaRegion(10, 250, 400, 20);
AddButton(10, 250, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
AddButton(210, 250, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(40, 250, 170, 20, 1011036, 0x7FFF, false, false); // OKAY
AddHtmlLocalized(240, 250, 170, 20, 1011012, 0x7FFF, false, false); // CANCEL
AddButton(10, 250, 0xFA5, 0xFA7, 1);
AddButton(210, 250, 0xFA5, 0xFA7, 0);
AddHtmlLocalized(40, 250, 170, 20, 1011036, 0x7FFF); // OKAY
AddHtmlLocalized(240, 250, 170, 20, 1011012, 0x7FFF); // CANCEL
}
public override void OnResponse(NetState state, RelayInfo info)
@ -155,4 +155,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -22,23 +22,20 @@ namespace Server.Gumps
AddHtmlLocalized(20, 15, 230, 60, 1046257, true, true); // Are you sure you want to release your pet?
AddButton(20, 80, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 80, 75, 20, 1011011, false, false); // CONTINUE
AddButton(20, 80, 4005, 4007, 2);
AddHtmlLocalized(55, 80, 75, 20, 1011011); // CONTINUE
AddButton(135, 80, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(170, 80, 75, 20, 1011012, false, false); // CANCEL
AddButton(135, 80, 4005, 4007, 1);
AddHtmlLocalized(170, 80, 75, 20, 1011012); // CANCEL
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (info.ButtonID == 2)
if (!m_Pet.Deleted && m_Pet.Controlled && m_From == m_Pet.ControlMaster &&
m_From.CheckAlive() /*&& m_Pet.CheckControlChance( m_From )*/)
if (m_Pet.Map == m_From.Map && m_Pet.InRange(m_From, 14))
{
m_Pet.ControlTarget = null;
m_Pet.ControlOrder = OrderType.Release;
}
if (info.ButtonID != 2 || m_Pet.Deleted || !(m_Pet.Controlled && m_From == m_Pet.ControlMaster &&
m_From.CheckAlive() && m_Pet.Map == m_From.Map && m_Pet.InRange(m_From, 14)))
return;
m_Pet.ControlTarget = null;
m_Pet.ControlOrder = OrderType.Release;
}
}
}
}

View file

@ -19,9 +19,9 @@ namespace Server.Gumps
AddImageTiled(10, 40, 253, 244, 0xA40);
AddImageTiled(10, 294, 253, 20, 0xA40);
AddAlphaRegion(10, 10, 253, 304);
AddButton(10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF, false, false); // CANCEL
AddHtmlLocalized(14, 12, 273, 20, 1075130, 0x7FFF, false, false); // Choose a track to play
AddButton(10, 294, 0xFB1, 0xFB2, 0);
AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL
AddHtmlLocalized(14, 12, 273, 20, 1075130, 0x7FFF); // Choose a track to play
int page = 1;
int i, y = 49;
@ -47,8 +47,8 @@ namespace Server.Gumps
if (info == null)
continue;
AddButton(19, y, 0x845, 0x846, 100 + i, GumpButtonType.Reply, 0);
AddHtmlLocalized(44, y - 2, 213, 20, info.Name, 0x7FFF, false, false);
AddButton(19, y, 0x845, 0x846, 100 + i);
AddHtmlLocalized(44, y - 2, 213, 20, info.Name, 0x7FFF);
}
if (i % 10 == 0)
@ -61,13 +61,13 @@ namespace Server.Gumps
AddButton(193, 294, 0xFAE, 0xFAF, 0, GumpButtonType.Page, page);
}
AddButton(19, y, 0x845, 0x846, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(44, y - 2, 213, 20, 1075207, 0x7FFF, false, false); // Stop Song
AddButton(19, y, 0x845, 0x846, 1);
AddHtmlLocalized(44, y - 2, 213, 20, 1075207, 0x7FFF); // Stop Song
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (m_Box == null || m_Box.Deleted)
if (m_Box?.Deleted != false)
return;
Mobile m = sender.Mobile;
@ -83,4 +83,4 @@ namespace Server.Gumps
m_Box.PlayMusic(m, m_Box.Tracks[info.ButtonID - 100]);
}
}
}
}

View file

@ -100,7 +100,7 @@ namespace Server.Gumps
if (node.Parent != null)
{
AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1, GumpButtonType.Reply, 0);
AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1);
if (PrevLabel)
AddLabel(x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous");
@ -115,8 +115,7 @@ namespace Server.Gumps
AddImageTiled(x - (OldStyle ? OffsetSize : 0), y, emptyWidth + (OldStyle ? OffsetSize * 2 : 0), EntryHeight,
EntryGumpID);
AddHtml(x + TextOffsetX, y, emptyWidth - TextOffsetX, EntryHeight, $"<center>{node.Name}</center>", false,
false);
AddHtml(x + TextOffsetX, y, emptyWidth - TextOffsetX, EntryHeight, $"<center>{node.Name}</center>");
x += emptyWidth + OffsetSize;
@ -127,7 +126,7 @@ namespace Server.Gumps
if (page > 0)
{
AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 2, GumpButtonType.Reply, 0);
AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 2);
if (PrevLabel)
AddLabel(x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous");
@ -162,7 +161,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, index + 4, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, index + 4);
}
}

View file

@ -11,13 +11,13 @@ namespace Server.Gumps
protected override void Design()
{
AddHtmlLocalized(20, 10, 400, 35, 1011097, false, false); // Declare your fealty
AddHtmlLocalized(20, 10, 400, 35, 1011097); // Declare your fealty
AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 250, 35, 1011098, false, false); // I have selected my new lord.
AddButton(20, 400, 4005, 4007, 1);
AddHtmlLocalized(55, 400, 250, 35, 1011098); // I have selected my new lord.
AddButton(300, 400, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(335, 400, 100, 35, 1011012, false, false); // CANCEL
AddButton(300, 400, 4005, 4007, 0);
AddHtmlLocalized(335, 400, 100, 35, 1011012); // CANCEL
}
public override void OnResponse(NetState state, RelayInfo info)
@ -37,7 +37,8 @@ namespace Server.Gumps
{
Mobile m = m_List[index];
if (m != null && !m.Deleted) state.Mobile.GuildFealty = m;
if (m?.Deleted == false)
state.Mobile.GuildFealty = m;
}
}
}
@ -46,4 +47,4 @@ namespace Server.Gumps
m_Mobile.SendGump(new GuildGump(m_Mobile, m_Guild));
}
}
}
}

View file

@ -11,13 +11,13 @@ namespace Server.Gumps
protected override void Design()
{
AddHtmlLocalized(20, 10, 400, 35, 1011118, false, false); // Grant a title to another member.
AddHtmlLocalized(20, 10, 400, 35, 1011118); // Grant a title to another member.
AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 245, 30, 1011127, false, false); // I dub thee...
AddButton(20, 400, 4005, 4007, 1);
AddHtmlLocalized(55, 400, 245, 30, 1011127); // I dub thee...
AddButton(300, 400, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(335, 400, 100, 35, 1011012, false, false); // CANCEL
AddButton(300, 400, 4005, 4007, 2);
AddHtmlLocalized(335, 400, 100, 35, 1011012); // CANCEL
}
public override void OnResponse(NetState state, RelayInfo info)
@ -37,7 +37,7 @@ namespace Server.Gumps
{
Mobile m = m_List[index];
if (m != null && !m.Deleted)
if (m?.Deleted == false)
{
m_Mobile.SendLocalizedMessage(1013074); // New title (20 characters max):
m_Mobile.Prompt = new GuildTitlePrompt(m_Mobile, m, m_Guild);
@ -52,4 +52,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -11,13 +11,13 @@ namespace Server.Gumps
protected override void Design()
{
AddHtmlLocalized(20, 10, 400, 35, 1011147, false, false); // Select the guild to accept the invitations:
AddHtmlLocalized(20, 10, 400, 35, 1011147); // Select the guild to accept the invitations:
AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 245, 30, 1011100, false, false); // Accept war invitations.
AddButton(20, 400, 4005, 4007, 1);
AddHtmlLocalized(55, 400, 245, 30, 1011100); // Accept war invitations.
AddButton(300, 400, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(335, 400, 100, 35, 1011012, false, false); // CANCEL
AddButton(300, 400, 4005, 4007, 2);
AddHtmlLocalized(335, 400, 100, 35, 1011012); // CANCEL
}
public override void OnResponse(NetState state, RelayInfo info)
@ -62,4 +62,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -12,13 +12,13 @@ namespace Server.Gumps
protected override void Design()
{
AddHtmlLocalized(20, 10, 400, 35, 1013075, false, false); // Accept or Refuse candidates for membership
AddHtmlLocalized(20, 10, 400, 35, 1013075); // Accept or Refuse candidates for membership
AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 245, 30, 1013076, false, false); // Accept
AddButton(20, 400, 4005, 4007, 1);
AddHtmlLocalized(55, 400, 245, 30, 1013076); // Accept
AddButton(300, 400, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(335, 400, 100, 35, 1013077, false, false); // Refuse
AddButton(300, 400, 4005, 4007, 2);
AddHtmlLocalized(335, 400, 100, 35, 1013077); // Refuse
}
public override void OnResponse(NetState state, RelayInfo info)
@ -47,7 +47,7 @@ namespace Server.Gumps
{
Mobile m = m_List[index];
if (m != null && !m.Deleted)
if (m?.Deleted == false)
{
#region Factions
@ -72,7 +72,7 @@ namespace Server.Gumps
break;
}
if (targetState != null && targetState.IsLeaving)
if (targetState?.IsLeaving == true)
{
// OSI does this quite strangely, so we'll just do it this way
m_Mobile.SendMessage(
@ -109,7 +109,7 @@ namespace Server.Gumps
{
Mobile m = m_List[index];
if (m != null && !m.Deleted)
if (m?.Deleted == false)
{
m_Guild.Candidates.Remove(m);
@ -128,4 +128,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -11,10 +11,10 @@ namespace Server.Gumps
protected override void Design()
{
AddHtmlLocalized(20, 10, 500, 35, 1013030, false, false); // <center> Candidates </center>
AddHtmlLocalized(20, 10, 500, 35, 1013030); // <center> Candidates </center>
AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 300, 35, 1011120, false, false); // Return to the main menu.
AddButton(20, 400, 4005, 4007, 1);
AddHtmlLocalized(55, 400, 300, 35, 1011120); // Return to the main menu.
}
public override void OnResponse(NetState state, RelayInfo info)
@ -29,4 +29,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -22,24 +22,23 @@ namespace Server.Gumps
AddBackground(0, 0, 550, 400, 5054);
AddBackground(10, 10, 530, 380, 3000);
AddHtmlLocalized(20, 15, 510, 30, 1013062, false, false); // <center>Change Guild Type Menu</center>
AddHtmlLocalized(20, 15, 510, 30, 1013062); // <center>Change Guild Type Menu</center>
AddHtmlLocalized(50, 50, 450, 30, 1013066, false,
false); // Please select the type of guild you would like to change to
AddHtmlLocalized(50, 50, 450, 30, 1013066); // Please select the type of guild you would like to change to
AddButton(20, 100, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(85, 100, 300, 30, 1013063, false, false); // Standard guild
AddButton(20, 100, 4005, 4007, 1);
AddHtmlLocalized(85, 100, 300, 30, 1013063); // Standard guild
AddButton(20, 150, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddButton(20, 150, 4005, 4007, 2);
AddItem(50, 143, 7109);
AddHtmlLocalized(85, 150, 300, 300, 1013064, false, false); // Order guild
AddHtmlLocalized(85, 150, 300, 300, 1013064); // Order guild
AddButton(20, 200, 4005, 4007, 3, GumpButtonType.Reply, 0);
AddButton(20, 200, 4005, 4007, 3);
AddItem(45, 200, 7107);
AddHtmlLocalized(85, 200, 300, 300, 1013065, false, false); // Chaos guild
AddHtmlLocalized(85, 200, 300, 300, 1013065); // Chaos guild
AddButton(300, 360, 4005, 4007, 4, GumpButtonType.Reply, 0);
AddHtmlLocalized(335, 360, 150, 30, 1011012, false, false); // CANCEL
AddButton(300, 360, 4005, 4007, 4);
AddHtmlLocalized(335, 360, 150, 30, 1011012); // CANCEL
}
public override void OnResponse(NetState state, RelayInfo info)
@ -98,4 +97,4 @@ namespace Server.Gumps
m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
}
}
}
}

View file

@ -20,25 +20,25 @@ namespace Server.Gumps
AddBackground(0, 0, 550, 400, 5054);
AddBackground(10, 10, 530, 380, 3000);
AddButton(20, 360, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 360, 300, 35, 1011120, false, false); // Return to the main menu.
AddButton(20, 360, 4005, 4007, 1);
AddHtmlLocalized(55, 360, 300, 35, 1011120); // Return to the main menu.
string charter;
if ((charter = guild.Charter) == null || (charter = charter.Trim()).Length <= 0)
AddHtmlLocalized(20, 20, 400, 35, 1013032, false, false); // No charter has been defined.
AddHtmlLocalized(20, 20, 400, 35, 1013032); // No charter has been defined.
else
AddHtml(20, 20, 510, 75, charter, true, true);
AddButton(20, 200, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 200, 300, 20, 1011122, false, false); // Visit the guild website :
AddButton(20, 200, 4005, 4007, 2);
AddHtmlLocalized(55, 200, 300, 20, 1011122); // Visit the guild website :
string website;
if ((website = guild.Website) == null || (website = website.Trim()).Length <= 0)
website = DefaultWebsite;
AddHtml(55, 220, 300, 20, website, false, false);
AddHtml(55, 220, 300, 20, website);
}
public override void OnResponse(NetState state, RelayInfo info)
@ -66,4 +66,4 @@ namespace Server.Gumps
m_Mobile.SendGump(new GuildGump(m_Mobile, m_Guild));
}
}
}
}

View file

@ -11,13 +11,13 @@ namespace Server.Gumps
protected override void Design()
{
AddHtmlLocalized(20, 10, 400, 35, 1011137, false, false); // Select the guild you wish to declare peace with.
AddHtmlLocalized(20, 10, 400, 35, 1011137); // Select the guild you wish to declare peace with.
AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 245, 30, 1011138, false, false); // Send the olive branch.
AddButton(20, 400, 4005, 4007, 1);
AddHtmlLocalized(55, 400, 245, 30, 1011138); // Send the olive branch.
AddButton(300, 400, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(335, 400, 100, 35, 1011012, false, false); // CANCEL
AddButton(300, 400, 4005, 4007, 2);
AddHtmlLocalized(335, 400, 100, 35, 1011012); // CANCEL
}
public override void OnResponse(NetState state, RelayInfo info)
@ -60,4 +60,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -14,13 +14,13 @@ namespace Server.Gumps
protected override void Design()
{
AddHtmlLocalized(20, 10, 400, 35, 1011065, false, false); // Select the guild you wish to declare war on.
AddHtmlLocalized(20, 10, 400, 35, 1011065); // Select the guild you wish to declare war on.
AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 245, 30, 1011068, false, false); // Send the challenge!
AddButton(20, 400, 4005, 4007, 1);
AddHtmlLocalized(55, 400, 245, 30, 1011068); // Send the challenge!
AddButton(300, 400, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(335, 400, 100, 35, 1011012, false, false); // CANCEL
AddButton(300, 400, 4005, 4007, 2);
AddHtmlLocalized(335, 400, 100, 35, 1011012); // CANCEL
}
public override void OnResponse(NetState state, RelayInfo info)
@ -86,4 +86,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -11,13 +11,13 @@ namespace Server.Gumps
protected override void Design()
{
AddHtmlLocalized(20, 10, 400, 35, 1011124, false, false); // Whom do you wish to dismiss?
AddHtmlLocalized(20, 10, 400, 35, 1011124); // Whom do you wish to dismiss?
AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 245, 30, 1011125, false, false); // Kick them out!
AddButton(20, 400, 4005, 4007, 1);
AddHtmlLocalized(55, 400, 245, 30, 1011125); // Kick them out!
AddButton(300, 400, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(335, 400, 100, 35, 1011012, false, false); // CANCEL
AddButton(300, 400, 4005, 4007, 2);
AddHtmlLocalized(335, 400, 100, 35, 1011012); // CANCEL
}
public override void OnResponse(NetState state, RelayInfo info)
@ -37,7 +37,7 @@ namespace Server.Gumps
{
Mobile m = m_List[index];
if (m != null && !m.Deleted)
if (m?.Deleted == false)
{
m_Guild.RemoveMember(m);
@ -57,4 +57,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -19,7 +19,7 @@ namespace Server.Gumps
AddBackground(0, 0, 550, 400, 5054);
AddBackground(10, 10, 530, 380, 3000);
AddHtml(20, 15, 200, 35, guild.Name, false, false);
AddHtml(20, 15, 200, 35, guild.Name);
Mobile leader = guild.Leader;
@ -37,11 +37,11 @@ namespace Server.Gumps
if ((leadName = leader.Name) == null || (leadName = leadName.Trim()).Length <= 0)
leadName = "(empty)";
AddHtml(220, 15, 250, 35, leadTitle + leadName, false, false);
AddHtml(220, 15, 250, 35, leadTitle + leadName);
}
AddButton(20, 50, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 50, 100, 20, 1013022, false, false); // Loyal to
AddButton(20, 50, 4005, 4007, 1);
AddHtmlLocalized(55, 50, 100, 20, 1013022); // Loyal to
Mobile fealty = beholder.GuildFealty;
@ -57,55 +57,53 @@ namespace Server.Gumps
fealtyName = "(empty)";
if (beholder == fealty)
AddHtmlLocalized(55, 70, 470, 20, 1018002, false, false); // yourself
AddHtmlLocalized(55, 70, 470, 20, 1018002); // yourself
else
AddHtml(55, 70, 470, 20, fealtyName, false, false);
AddHtml(55, 70, 470, 20, fealtyName);
AddButton(215, 50, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(250, 50, 170, 20, 1013023, false, false); // Display guild abbreviation
AddHtmlLocalized(250, 70, 50, 20, beholder.DisplayGuildTitle ? 1011262 : 1011263, false, false); // on/off
AddButton(215, 50, 4005, 4007, 2);
AddHtmlLocalized(250, 50, 170, 20, 1013023); // Display guild abbreviation
AddHtmlLocalized(250, 70, 50, 20, beholder.DisplayGuildTitle ? 1011262 : 1011263); // on/off
AddButton(20, 100, 4005, 4007, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 100, 470, 30, 1011086, false, false); // View the current roster.
AddButton(20, 100, 4005, 4007, 3);
AddHtmlLocalized(55, 100, 470, 30, 1011086); // View the current roster.
AddButton(20, 130, 4005, 4007, 4, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 130, 470, 30, 1011085, false, false); // Recruit someone into the guild.
AddButton(20, 130, 4005, 4007, 4);
AddHtmlLocalized(55, 130, 470, 30, 1011085); // Recruit someone into the guild.
if (guild.Candidates.Count > 0)
{
AddButton(20, 160, 4005, 4007, 5, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 160, 470, 30, 1011093, false,
false); // View list of candidates who have been sponsored to the guild.
AddButton(20, 160, 4005, 4007, 5);
AddHtmlLocalized(55, 160, 470, 30, 1011093); // View list of candidates who have been sponsored to the guild.
}
else
{
AddImage(20, 160, 4020);
AddHtmlLocalized(55, 160, 470, 30, 1013031, false,
false); // There are currently no candidates for membership.
AddHtmlLocalized(55, 160, 470, 30, 1013031); // There are currently no candidates for membership.
}
AddButton(20, 220, 4005, 4007, 6, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 220, 470, 30, 1011087, false, false); // View the guild's charter.
AddButton(20, 220, 4005, 4007, 6);
AddHtmlLocalized(55, 220, 470, 30, 1011087); // View the guild's charter.
AddButton(20, 250, 4005, 4007, 7, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 250, 470, 30, 1011092, false, false); // Resign from the guild.
AddButton(20, 250, 4005, 4007, 7);
AddHtmlLocalized(55, 250, 470, 30, 1011092); // Resign from the guild.
AddButton(20, 280, 4005, 4007, 8, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 280, 470, 30, 1011095, false, false); // View list of guilds you are at war with.
AddButton(20, 280, 4005, 4007, 8);
AddHtmlLocalized(55, 280, 470, 30, 1011095); // View list of guilds you are at war with.
if (beholder.AccessLevel >= AccessLevel.GameMaster || beholder == leader)
{
AddButton(20, 310, 4005, 4007, 9, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 310, 470, 30, 1011094, false, false); // Access guildmaster functions.
AddButton(20, 310, 4005, 4007, 9);
AddHtmlLocalized(55, 310, 470, 30, 1011094); // Access guildmaster functions.
}
else
{
AddImage(20, 310, 4020);
AddHtmlLocalized(55, 310, 470, 30, 1018013, false, false); // Reserved for guildmaster
AddHtmlLocalized(55, 310, 470, 30, 1018013); // Reserved for guildmaster
}
AddButton(20, 360, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 360, 470, 30, 1011441, false, false); // EXIT
AddButton(20, 360, 4005, 4007, 0);
AddHtmlLocalized(55, 360, 470, 30, 1011441); // EXIT
}
public static void EnsureClosed(Mobile m)
@ -130,7 +128,7 @@ namespace Server.Gumps
Item stone = g.Guildstone;
return stone == null || stone.Deleted || !m.InRange(stone.GetWorldLocation(), 2);
return stone?.Deleted != false || !m.InRange(stone.GetWorldLocation(), 2);
}
public static bool BadMember(Mobile m, Guild g)
@ -140,7 +138,7 @@ namespace Server.Gumps
Item stone = g.Guildstone;
return stone == null || stone.Deleted || !m.InRange(stone.GetWorldLocation(), 2);
return stone?.Deleted != false || !m.InRange(stone.GetWorldLocation(), 2);
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -219,4 +217,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -31,7 +31,7 @@ namespace Server.Gumps
if (i != 0)
{
AddButton(300, 370, 4005, 4007, 0, GumpButtonType.Page, i / 11 + 1);
AddHtmlLocalized(335, 370, 300, 35, 1011066, false, false); // Next page
AddHtmlLocalized(335, 370, 300, 35, 1011066); // Next page
}
AddPage(i / 11 + 1);
@ -39,7 +39,7 @@ namespace Server.Gumps
if (i != 0)
{
AddButton(20, 370, 4014, 4016, 0, GumpButtonType.Page, i / 11);
AddHtmlLocalized(55, 370, 300, 35, 1011067, false, false); // Previous page
AddHtmlLocalized(55, 370, 300, 35, 1011067); // Previous page
}
}

View file

@ -32,7 +32,7 @@ namespace Server.Gumps
if (i != 0)
{
AddButton(300, 370, 4005, 4007, 0, GumpButtonType.Page, i / 11 + 1);
AddHtmlLocalized(335, 370, 300, 35, 1011066, false, false); // Next page
AddHtmlLocalized(335, 370, 300, 35, 1011066); // Next page
}
AddPage(i / 11 + 1);
@ -40,7 +40,7 @@ namespace Server.Gumps
if (i != 0)
{
AddButton(20, 370, 4014, 4016, 0, GumpButtonType.Page, i / 11);
AddHtmlLocalized(55, 370, 300, 35, 1011067, false, false); // Previous page
AddHtmlLocalized(55, 370, 300, 35, 1011067); // Previous page
}
}

View file

@ -11,13 +11,13 @@ namespace Server.Gumps
protected override void Design()
{
AddHtmlLocalized(20, 10, 400, 35, 1011148, false, false); // Select the guild to reject their invitations:
AddHtmlLocalized(20, 10, 400, 35, 1011148); // Select the guild to reject their invitations:
AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 245, 30, 1011101, false, false); // Reject war invitations.
AddButton(20, 400, 4005, 4007, 1);
AddHtmlLocalized(55, 400, 245, 30, 1011101); // Reject war invitations.
AddButton(300, 400, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(335, 400, 100, 35, 1011012, false, false); // CANCEL
AddButton(300, 400, 4005, 4007, 2);
AddHtmlLocalized(335, 400, 100, 35, 1011012); // CANCEL
}
public override void OnResponse(NetState state, RelayInfo info)
@ -59,4 +59,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -11,13 +11,13 @@ namespace Server.Gumps
protected override void Design()
{
AddHtmlLocalized(20, 10, 400, 35, 1011150, false, false); // Select the guild to rescind our invitations:
AddHtmlLocalized(20, 10, 400, 35, 1011150); // Select the guild to rescind our invitations:
AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 245, 30, 1011102, false, false); // Rescind your war declarations.
AddButton(20, 400, 4005, 4007, 1);
AddHtmlLocalized(55, 400, 245, 30, 1011102); // Rescind your war declarations.
AddButton(300, 400, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(335, 400, 100, 35, 1011012, false, false); // CANCEL
AddButton(300, 400, 4005, 4007, 2);
AddHtmlLocalized(335, 400, 100, 35, 1011012); // CANCEL
}
public override void OnResponse(NetState state, RelayInfo info)
@ -59,4 +59,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -11,10 +11,10 @@ namespace Server.Gumps
protected override void Design()
{
AddHtml(20, 10, 500, 35, $"<center>{m_Guild.Name}</center>", false, false);
AddHtml(20, 10, 500, 35, $"<center>{m_Guild.Name}</center>");
AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 300, 35, 1011120, false, false); // Return to the main menu.
AddButton(20, 400, 4005, 4007, 1);
AddHtmlLocalized(55, 400, 300, 35, 1011120); // Return to the main menu.
}
public override void OnResponse(NetState state, RelayInfo info)
@ -29,4 +29,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -19,49 +19,48 @@ namespace Server.Gumps
AddBackground(0, 0, 550, 440, 5054);
AddBackground(10, 10, 530, 420, 3000);
AddHtmlLocalized(20, 10, 510, 35, 1011105, false, false); // <center>WAR FUNCTIONS</center>
AddHtmlLocalized(20, 10, 510, 35, 1011105); // <center>WAR FUNCTIONS</center>
AddButton(20, 40, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 40, 400, 30, 1011099, false, false); // Declare war through guild name search.
AddButton(20, 40, 4005, 4007, 1);
AddHtmlLocalized(55, 40, 400, 30, 1011099); // Declare war through guild name search.
int count = 0;
if (guild.Enemies.Count > 0)
{
AddButton(20, 160 + count * 30, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 160 + count++ * 30, 400, 30, 1011103, false, false); // Declare peace.
AddButton(20, 160 + count * 30, 4005, 4007, 2);
AddHtmlLocalized(55, 160 + count++ * 30, 400, 30, 1011103); // Declare peace.
}
else
{
AddHtmlLocalized(20, 160 + count++ * 30, 400, 30, 1013033, false, false); // No current wars
AddHtmlLocalized(20, 160 + count++ * 30, 400, 30, 1013033); // No current wars
}
if (guild.WarInvitations.Count > 0)
{
AddButton(20, 160 + count * 30, 4005, 4007, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 160 + count++ * 30, 400, 30, 1011100, false, false); // Accept war invitations.
AddButton(20, 160 + count * 30, 4005, 4007, 3);
AddHtmlLocalized(55, 160 + count++ * 30, 400, 30, 1011100); // Accept war invitations.
AddButton(20, 160 + count * 30, 4005, 4007, 4, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 160 + count++ * 30, 400, 30, 1011101, false, false); // Reject war invitations.
AddButton(20, 160 + count * 30, 4005, 4007, 4);
AddHtmlLocalized(55, 160 + count++ * 30, 400, 30, 1011101); // Reject war invitations.
}
else
{
AddHtmlLocalized(20, 160 + count++ * 30, 400, 30, 1018012, false,
false); // No current invitations received for war.
AddHtmlLocalized(20, 160 + count++ * 30, 400, 30, 1018012); // No current invitations received for war.
}
if (guild.WarDeclarations.Count > 0)
{
AddButton(20, 160 + count * 30, 4005, 4007, 5, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 160 + count++ * 30, 400, 30, 1011102, false, false); // Rescind your war declarations.
AddButton(20, 160 + count * 30, 4005, 4007, 5);
AddHtmlLocalized(55, 160 + count++ * 30, 400, 30, 1011102); // Rescind your war declarations.
}
else
{
AddHtmlLocalized(20, 160 + count++ * 30, 400, 30, 1013055, false, false); // No current war declarations
AddHtmlLocalized(20, 160 + count++ * 30, 400, 30, 1013055); // No current war declarations
}
AddButton(20, 400, 4005, 4007, 6, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 400, 35, 1011104, false, false); // Return to the previous menu.
AddButton(20, 400, 4005, 4007, 6);
AddHtmlLocalized(55, 400, 400, 35, 1011104); // Return to the previous menu.
}
public override void OnResponse(NetState state, RelayInfo info)
@ -73,7 +72,7 @@ namespace Server.Gumps
{
case 1: // Declare war
{
m_Mobile.SendLocalizedMessage(1018001); // Declare war through search - Enter Guild Name:
m_Mobile.SendLocalizedMessage(1018001); // Declare war through search - Enter Guild Name:
m_Mobile.Prompt = new GuildDeclareWarPrompt(m_Mobile, m_Guild);
break;
@ -116,4 +115,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -20,69 +20,69 @@ namespace Server.Gumps
AddBackground(0, 0, 550, 440, 5054);
AddBackground(10, 10, 530, 420, 3000);
AddHtmlLocalized(20, 10, 500, 35, 1011133, false, false); // <center>WARFARE STATUS</center>
AddHtmlLocalized(20, 10, 500, 35, 1011133); // <center>WARFARE STATUS</center>
AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 400, 300, 35, 1011120, false, false); // Return to the main menu.
AddButton(20, 400, 4005, 4007, 1);
AddHtmlLocalized(55, 400, 300, 35, 1011120); // Return to the main menu.
AddPage(1);
AddButton(375, 375, 5224, 5224, 0, GumpButtonType.Page, 2);
AddHtmlLocalized(410, 373, 100, 25, 1011066, false, false); // Next page
AddHtmlLocalized(410, 373, 100, 25, 1011066); // Next page
AddHtmlLocalized(20, 45, 400, 20, 1011134, false, false); // We are at war with:
AddHtmlLocalized(20, 45, 400, 20, 1011134); // We are at war with:
List<Guild> enemies = guild.Enemies;
if (enemies.Count == 0)
AddHtmlLocalized(20, 65, 400, 20, 1013033, false, false); // No current wars
AddHtmlLocalized(20, 65, 400, 20, 1013033); // No current wars
else
for (int i = 0; i < enemies.Count; ++i)
{
Guild g = enemies[i];
AddHtml(20, 65 + i * 20, 300, 20, g.Name, false, false);
AddHtml(20, 65 + i * 20, 300, 20, g.Name);
}
AddPage(2);
AddButton(375, 375, 5224, 5224, 0, GumpButtonType.Page, 3);
AddHtmlLocalized(410, 373, 100, 25, 1011066, false, false); // Next page
AddHtmlLocalized(410, 373, 100, 25, 1011066); // Next page
AddButton(30, 375, 5223, 5223, 0, GumpButtonType.Page, 1);
AddHtmlLocalized(65, 373, 150, 25, 1011067, false, false); // Previous page
AddHtmlLocalized(65, 373, 150, 25, 1011067); // Previous page
AddHtmlLocalized(20, 45, 400, 20, 1011136, false, false); // Guilds that we have declared war on:
AddHtmlLocalized(20, 45, 400, 20, 1011136); // Guilds that we have declared war on:
List<Guild> declared = guild.WarDeclarations;
if (declared.Count == 0)
AddHtmlLocalized(20, 65, 400, 20, 1018012, false, false); // No current invitations received for war.
AddHtmlLocalized(20, 65, 400, 20, 1018012); // No current invitations received for war.
else
for (int i = 0; i < declared.Count; ++i)
{
Guild g = declared[i];
AddHtml(20, 65 + i * 20, 300, 20, g.Name, false, false);
AddHtml(20, 65 + i * 20, 300, 20, g.Name);
}
AddPage(3);
AddButton(30, 375, 5223, 5223, 0, GumpButtonType.Page, 2);
AddHtmlLocalized(65, 373, 150, 25, 1011067, false, false); // Previous page
AddHtmlLocalized(65, 373, 150, 25, 1011067); // Previous page
AddHtmlLocalized(20, 45, 400, 20, 1011135, false, false); // Guilds that have declared war on us:
AddHtmlLocalized(20, 45, 400, 20, 1011135); // Guilds that have declared war on us:
List<Guild> invites = guild.WarInvitations;
if (invites.Count == 0)
AddHtmlLocalized(20, 65, 400, 20, 1013055, false, false); // No current war declarations
AddHtmlLocalized(20, 65, 400, 20, 1013055); // No current war declarations
else
for (int i = 0; i < invites.Count; ++i)
{
Guild g = invites[i];
AddHtml(20, 65 + i * 20, 300, 20, g.Name, false, false);
AddHtml(20, 65 + i * 20, 300, 20, g.Name);
}
}
@ -98,4 +98,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -20,67 +20,66 @@ namespace Server.Gumps
AddBackground(0, 0, 550, 400, 5054);
AddBackground(10, 10, 530, 380, 3000);
AddHtmlLocalized(20, 15, 510, 35, 1011121, false, false); // <center>GUILDMASTER FUNCTIONS</center>
AddHtmlLocalized(20, 15, 510, 35, 1011121); // <center>GUILDMASTER FUNCTIONS</center>
AddButton(20, 40, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 40, 470, 30, 1011107, false, false); // Set the guild name.
AddButton(20, 40, 4005, 4007, 2);
AddHtmlLocalized(55, 40, 470, 30, 1011107); // Set the guild name.
AddButton(20, 70, 4005, 4007, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 70, 470, 30, 1011109, false, false); // Set the guild's abbreviation.
AddButton(20, 70, 4005, 4007, 3);
AddHtmlLocalized(55, 70, 470, 30, 1011109); // Set the guild's abbreviation.
if (Guild.OrderChaos)
{
AddButton(20, 100, 4005, 4007, 4, GumpButtonType.Reply, 0);
AddButton(20, 100, 4005, 4007, 4);
switch (m_Guild.Type)
{
case GuildType.Regular:
AddHtmlLocalized(55, 100, 470, 30, 1013059, false, false); // Change guild type: Currently Standard
AddHtmlLocalized(55, 100, 470, 30, 1013059); // Change guild type: Currently Standard
break;
case GuildType.Order:
AddHtmlLocalized(55, 100, 470, 30, 1013057, false, false); // Change guild type: Currently Order
AddHtmlLocalized(55, 100, 470, 30, 1013057); // Change guild type: Currently Order
break;
case GuildType.Chaos:
AddHtmlLocalized(55, 100, 470, 30, 1013058, false, false); // Change guild type: Currently Chaos
AddHtmlLocalized(55, 100, 470, 30, 1013058); // Change guild type: Currently Chaos
break;
}
}
AddButton(20, 130, 4005, 4007, 5, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 130, 470, 30, 1011112, false, false); // Set the guild's charter.
AddButton(20, 130, 4005, 4007, 5);
AddHtmlLocalized(55, 130, 470, 30, 1011112); // Set the guild's charter.
AddButton(20, 160, 4005, 4007, 6, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 160, 470, 30, 1011113, false, false); // Dismiss a member.
AddButton(20, 160, 4005, 4007, 6);
AddHtmlLocalized(55, 160, 470, 30, 1011113); // Dismiss a member.
AddButton(20, 190, 4005, 4007, 7, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 190, 470, 30, 1011114, false, false); // Go to the WAR menu.
AddButton(20, 190, 4005, 4007, 7);
AddHtmlLocalized(55, 190, 470, 30, 1011114); // Go to the WAR menu.
if (m_Guild.Candidates.Count > 0)
{
AddButton(20, 220, 4005, 4007, 8, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 220, 470, 30, 1013056, false, false); // Administer the list of candidates
AddButton(20, 220, 4005, 4007, 8);
AddHtmlLocalized(55, 220, 470, 30, 1013056); // Administer the list of candidates
}
else
{
AddImage(20, 220, 4020);
AddHtmlLocalized(55, 220, 470, 30, 1013031, false,
false); // There are currently no candidates for membership.
AddHtmlLocalized(55, 220, 470, 30, 1013031); // There are currently no candidates for membership.
}
AddButton(20, 250, 4005, 4007, 9, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 250, 470, 30, 1011117, false, false); // Set the guildmaster's title.
AddButton(20, 250, 4005, 4007, 9);
AddHtmlLocalized(55, 250, 470, 30, 1011117); // Set the guildmaster's title.
AddButton(20, 280, 4005, 4007, 10, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 280, 470, 30, 1011118, false, false); // Grant a title to another member.
AddButton(20, 280, 4005, 4007, 10);
AddHtmlLocalized(55, 280, 470, 30, 1011118); // Grant a title to another member.
AddButton(20, 310, 4005, 4007, 11, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 310, 470, 30, 1011119, false, false); // Move this guildstone.
AddButton(20, 310, 4005, 4007, 11);
AddHtmlLocalized(55, 310, 470, 30, 1011119); // Move this guildstone.
AddButton(20, 360, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 360, 245, 30, 1011120, false, false); // Return to the main menu.
AddButton(20, 360, 4005, 4007, 1);
AddHtmlLocalized(55, 360, 245, 30, 1011120); // Return to the main menu.
AddButton(300, 360, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(335, 360, 100, 30, 1011441, false, false); // EXIT
AddButton(300, 360, 4005, 4007, 0);
AddHtmlLocalized(335, 360, 100, 30, 1011441); // EXIT
}
public override void OnResponse(NetState state, RelayInfo info)
@ -186,4 +185,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -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
}
}
}
}
}

View file

@ -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>";
}
}
}
}

View file

@ -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;
}
}
}
}

View file

@ -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
}
}
}
}
}

View file

@ -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
}
}
}

View file

@ -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
}
}
}
}
}

View file

@ -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
}
}
}
}
}

View file

@ -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
}
}
}
}
}

View file

@ -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
}
}
}

View file

@ -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
}
}
}
}
}

View file

@ -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
}
}
}
}
}

View file

@ -66,7 +66,7 @@ namespace Server.Gumps
else
m_Mobile.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
m_Mobile.SendMessage("That person is quitting their faction and so you may not recruit them.");
@ -94,4 +94,4 @@ namespace Server.Gumps
m_Mobile.SendGump(new GuildGump(m_Mobile, m_Guild));
}
}
}
}

View file

@ -20,260 +20,260 @@ namespace Server.Gumps
AddImageTiled(10, 40, 500, 324, 0xA40);
AddImageTiled(10, 374, 500, 20, 0xA40);
AddAlphaRegion(10, 10, 500, 384);
AddButton(10, 374, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 376, 450, 20, 1060051, 0x7FFF, false, false); // CANCEL
AddHtmlLocalized(14, 12, 500, 20, 1075576, 0x7FFF, false, false); // Choose your item from the following pages
AddButton(10, 374, 0xFB1, 0xFB2, 0);
AddHtmlLocalized(45, 376, 450, 20, 1060051, 0x7FFF); // CANCEL
AddHtmlLocalized(14, 12, 500, 20, 1075576, 0x7FFF); // Choose your item from the following pages
AddPage(1);
AddImageTiledButton(14, 44, 0x918, 0x919, 0x64, GumpButtonType.Reply, 0, 0x1411, 0x2C, 18, 8);
AddTooltip(1062912);
AddHtmlLocalized(98, 44, 250, 60, 1078147, 0x7FFF, false, false); // Royal Leggings of Embers
AddHtmlLocalized(98, 44, 250, 60, 1078147, 0x7FFF); // Royal Leggings of Embers
AddImageTiledButton(264, 44, 0x918, 0x919, 0x65, GumpButtonType.Reply, 0, 0x234D, 0x0, 18, 12);
AddTooltip(1062914);
AddHtmlLocalized(348, 44, 250, 60, 1062913, 0x7FFF, false, false); // Rose of Trinsic
AddHtmlLocalized(348, 44, 250, 60, 1062913, 0x7FFF); // Rose of Trinsic
AddImageTiledButton(14, 108, 0x918, 0x919, 0x66, GumpButtonType.Reply, 0, 0x26C3, 0x504, 18, 8);
AddTooltip(1062916);
AddHtmlLocalized(98, 108, 250, 60, 1062915, 0x7FFF, false, false); // Shamino’s Best Crossbow
AddHtmlLocalized(98, 108, 250, 60, 1062915, 0x7FFF); // Shamino’s Best Crossbow
AddImageTiledButton(264, 108, 0x918, 0x919, 0x67, GumpButtonType.Reply, 0, 0x3F1D, 0x0, 18, 8);
AddTooltip(1062918);
AddHtmlLocalized(348, 108, 250, 60, 1062917, 0x7FFF, false, false); // The Tapestry of Sosaria
AddHtmlLocalized(348, 108, 250, 60, 1062917, 0x7FFF); // The Tapestry of Sosaria
AddImageTiledButton(14, 172, 0x918, 0x919, 0x68, GumpButtonType.Reply, 0, 0x3F14, 0x0, 18, 8);
AddTooltip(1062920);
AddHtmlLocalized(98, 172, 250, 60, 1062919, 0x7FFF, false, false); // Hearth of the Home Fire
AddHtmlLocalized(98, 172, 250, 60, 1062919, 0x7FFF); // Hearth of the Home Fire
AddImageTiledButton(264, 172, 0x918, 0x919, 0x69, GumpButtonType.Reply, 0, 0xF60, 0x482, -1, 10);
AddTooltip(1062922);
AddHtmlLocalized(348, 172, 250, 60, 1062921, 0x7FFF, false, false); // The Holy Sword
AddHtmlLocalized(348, 172, 250, 60, 1062921, 0x7FFF); // The Holy Sword
AddImageTiledButton(14, 236, 0x918, 0x919, 0x6A, GumpButtonType.Reply, 0, 0x236C, 0x0, 18, 6);
AddTooltip(1062924);
AddHtmlLocalized(98, 236, 250, 60, 1062923, 0x7FFF, false, false); // Ancient Samurai Helm
AddHtmlLocalized(98, 236, 250, 60, 1062923, 0x7FFF); // Ancient Samurai Helm
AddImageTiledButton(264, 236, 0x918, 0x919, 0x6B, GumpButtonType.Reply, 0, 0x2B10, 0x226, 18, 11);
AddTooltip(1075223);
AddHtmlLocalized(348, 236, 250, 60, 1075188, 0x7FFF, false, false); // Helm of Spirituality
AddHtmlLocalized(348, 236, 250, 60, 1075188, 0x7FFF); // Helm of Spirituality
AddImageTiledButton(14, 300, 0x918, 0x919, 0x6C, GumpButtonType.Reply, 0, 0x2B0C, 0x226, 18, 15);
AddTooltip(1075224);
AddHtmlLocalized(98, 300, 250, 60, 1075192, 0x7FFF, false, false); // Gauntlets of Valor
AddHtmlLocalized(98, 300, 250, 60, 1075192, 0x7FFF); // Gauntlets of Valor
AddImageTiledButton(264, 300, 0x918, 0x919, 0x6D, GumpButtonType.Reply, 0, 0x2B01, 0x0, 18, 9);
AddTooltip(1075225);
AddHtmlLocalized(348, 300, 250, 60, 1075196, 0x7FFF, false, false); // Dupre’s Shield
AddHtmlLocalized(348, 300, 250, 60, 1075196, 0x7FFF); // Dupre’s Shield
AddButton(400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2);
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF, false, false); // Next
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF); // Next
AddPage(2);
AddButton(300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF, false, false); // Back
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF); // Back
AddImageTiledButton(14, 44, 0x918, 0x919, 0x6E, GumpButtonType.Reply, 0, 0x2AC6, 0x0, 29, 0);
AddTooltip(1075226);
AddHtmlLocalized(98, 44, 250, 60, 1075197, 0x7FFF, false, false); // Fountain of Life
AddHtmlLocalized(98, 44, 250, 60, 1075197, 0x7FFF); // Fountain of Life
AddImageTiledButton(264, 44, 0x918, 0x919, 0x6F, GumpButtonType.Reply, 0, 0x2AF9, 0x0, -4, -5);
AddTooltip(1075227);
AddHtmlLocalized(348, 44, 250, 60, 1075198, 0x7FFF, false, false); // Dawn’s Music Box
AddHtmlLocalized(348, 44, 250, 60, 1075198, 0x7FFF); // Dawn’s Music Box
AddImageTiledButton(14, 108, 0x918, 0x919, 0x70, GumpButtonType.Reply, 0, 0x2253, 0x0, 18, 12);
AddTooltip(1075228);
AddHtmlLocalized(98, 108, 250, 60, 1078148, 0x7FFF, false, false); // Ossian Grimoire
AddHtmlLocalized(98, 108, 250, 60, 1078148, 0x7FFF); // Ossian Grimoire
AddImageTiledButton(264, 108, 0x918, 0x919, 0x71, GumpButtonType.Reply, 0, 0x2D98, 0x0, 19, 13);
AddTooltip(1078527);
AddHtmlLocalized(348, 108, 250, 60, 1078142, 0x7FFF, false, false); // Talisman of the Fey:<br>Ferret
AddHtmlLocalized(348, 108, 250, 60, 1078142, 0x7FFF); // Talisman of the Fey:<br>Ferret
AddImageTiledButton(14, 172, 0x918, 0x919, 0x72, GumpButtonType.Reply, 0, 0x2D97, 0x0, 19, 13);
AddTooltip(1078528);
AddHtmlLocalized(98, 172, 250, 60, 1078143, 0x7FFF, false, false); // Talisman of the Fey:<br>Squirrel
AddHtmlLocalized(98, 172, 250, 60, 1078143, 0x7FFF); // Talisman of the Fey:<br>Squirrel
AddImageTiledButton(264, 172, 0x918, 0x919, 0x73, GumpButtonType.Reply, 0, 0x2D96, 0x0, 19, 8);
AddTooltip(1078529);
AddHtmlLocalized(348, 172, 250, 60, 1078144, 0x7FFF, false, false); // Talisman of the Fey:<br>Cu Sidhe
AddHtmlLocalized(348, 172, 250, 60, 1078144, 0x7FFF); // Talisman of the Fey:<br>Cu Sidhe
AddImageTiledButton(14, 236, 0x918, 0x919, 0x74, GumpButtonType.Reply, 0, 0x2D95, 0x0, -4, 2);
AddTooltip(1078530);
AddHtmlLocalized(98, 236, 250, 60, 1078145, 0x7FFF, false, false); // Talisman of the Fey:<br>Reptalon
AddHtmlLocalized(98, 236, 250, 60, 1078145, 0x7FFF); // Talisman of the Fey:<br>Reptalon
AddImageTiledButton(264, 236, 0x918, 0x919, 0x75, GumpButtonType.Reply, 0, 0x2B02, 0x0, -2, 9);
AddTooltip(1078526);
AddHtmlLocalized(348, 236, 250, 60, 1075201, 0x7FFF, false, false); // Quiver of Infinity
AddHtmlLocalized(348, 236, 250, 60, 1075201, 0x7FFF); // Quiver of Infinity
AddImageTiledButton(14, 300, 0x918, 0x919, 0x76, GumpButtonType.Reply, 0, 0x2A91, 0x0, 25, 5);
AddTooltip(1075986);
AddHtmlLocalized(98, 300, 250, 60, 1074797, 0x7FFF, false, false); // Bone Throne, Bone Couch<br>and Bone Table
AddHtmlLocalized(98, 300, 250, 60, 1074797, 0x7FFF); // Bone Throne, Bone Couch<br>and Bone Table
AddImageTiledButton(264, 300, 0x918, 0x919, 0x77, GumpButtonType.Reply, 0, 0x2A99, 0x0, 18, 1);
AddTooltip(1075987);
AddHtmlLocalized(348, 300, 250, 60, 1078146, 0x7FFF, false, false); // Creepy Portraits
AddHtmlLocalized(348, 300, 250, 60, 1078146, 0x7FFF); // Creepy Portraits
AddButton(400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 3);
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF, false, false); // Next
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF); // Next
AddPage(3);
AddButton(300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 2);
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF, false, false); // Back
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF); // Back
AddImageTiledButton(14, 44, 0x918, 0x919, 0x78, GumpButtonType.Reply, 0, 0x2A71, 0x0, 13, 5);
AddTooltip(1075988);
AddHtmlLocalized(98, 44, 250, 60, 1074799, 0x7FFF, false, false); // Mounted Pixies (5)
AddHtmlLocalized(98, 44, 250, 60, 1074799, 0x7FFF); // Mounted Pixies (5)
AddImageTiledButton(264, 44, 0x918, 0x919, 0x79, GumpButtonType.Reply, 0, 0x2A98, 0x0, 26, 1);
AddTooltip(1075990);
AddHtmlLocalized(348, 44, 250, 60, 1074800, 0x7FFF, false, false); // Haunted Mirror
AddHtmlLocalized(348, 44, 250, 60, 1074800, 0x7FFF); // Haunted Mirror
AddImageTiledButton(14, 108, 0x918, 0x919, 0x7A, GumpButtonType.Reply, 0, 0x2A92, 0x0, 18, 1);
AddTooltip(1075989);
AddHtmlLocalized(98, 108, 250, 60, 1074801, 0x7FFF, false, false); // Bed of Nails
AddHtmlLocalized(98, 108, 250, 60, 1074801, 0x7FFF); // Bed of Nails
AddImageTiledButton(264, 108, 0x918, 0x919, 0x7B, GumpButtonType.Reply, 0, 0x2AB8, 0x0, 18, 1);
AddTooltip(1075991);
AddHtmlLocalized(348, 108, 250, 60, 1074818, 0x7FFF, false, false); // Sacrificial Altar
AddHtmlLocalized(348, 108, 250, 60, 1074818, 0x7FFF); // Sacrificial Altar
AddImageTiledButton(14, 172, 0x918, 0x919, 0x7C, GumpButtonType.Reply, 0, 0x3F26, 0x0, 18, 8);
AddTooltip(1076610);
AddHtmlLocalized(98, 172, 250, 60, 1076257, 0x7FFF, false, false); // Broken Covered Chair
AddHtmlLocalized(98, 172, 250, 60, 1076257, 0x7FFF); // Broken Covered Chair
AddImageTiledButton(264, 172, 0x918, 0x919, 0x7D, GumpButtonType.Reply, 0, 0x3F22, 0x0, 18, 8);
AddTooltip(1076610);
AddHtmlLocalized(348, 172, 250, 60, 1076258, 0x7FFF, false, false); // Broken Bookcase
AddHtmlLocalized(348, 172, 250, 60, 1076258, 0x7FFF); // Broken Bookcase
AddImageTiledButton(14, 236, 0x918, 0x919, 0x7E, GumpButtonType.Reply, 0, 0x3F24, 0x0, 18, 8);
AddTooltip(1076610);
AddHtmlLocalized(98, 236, 250, 60, 1076259, 0x7FFF, false, false); // Standing Broken Chair
AddHtmlLocalized(98, 236, 250, 60, 1076259, 0x7FFF); // Standing Broken Chair
AddImageTiledButton(264, 236, 0x918, 0x919, 0x7F, GumpButtonType.Reply, 0, 0x3F25, 0x0, 18, 8);
AddTooltip(1076610);
AddHtmlLocalized(348, 236, 250, 60, 1076260, 0x7FFF, false, false); // Broken Vanity
AddHtmlLocalized(348, 236, 250, 60, 1076260, 0x7FFF); // Broken Vanity
AddImageTiledButton(14, 300, 0x918, 0x919, 0x80, GumpButtonType.Reply, 0, 0x3F23, 0x0, 18, 8);
AddTooltip(1076610);
AddHtmlLocalized(98, 300, 250, 60, 1076261, 0x7FFF, false, false); // Broken Chest of Drawers
AddHtmlLocalized(98, 300, 250, 60, 1076261, 0x7FFF); // Broken Chest of Drawers
AddImageTiledButton(264, 300, 0x918, 0x919, 0x81, GumpButtonType.Reply, 0, 0x3F21, 0x0, 18, 8);
AddTooltip(1076610);
AddHtmlLocalized(348, 300, 250, 60, 1076262, 0x7FFF, false, false); // Broken Armoire
AddHtmlLocalized(348, 300, 250, 60, 1076262, 0x7FFF); // Broken Armoire
AddButton(400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 4);
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF, false, false); // Next
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF); // Next
AddPage(4);
AddButton(300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 3);
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF, false, false); // Back
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF); // Back
AddImageTiledButton(14, 44, 0x918, 0x919, 0x82, GumpButtonType.Reply, 0, 0x3F0B, 0x0, 18, 8);
AddTooltip(1076610);
AddHtmlLocalized(98, 44, 250, 60, 1076263, 0x7FFF, false, false); // Broken Bed
AddHtmlLocalized(98, 44, 250, 60, 1076263, 0x7FFF); // Broken Bed
AddImageTiledButton(264, 44, 0x918, 0x919, 0x83, GumpButtonType.Reply, 0, 0xC19, 0x0, 13, 8);
AddTooltip(1076610);
AddHtmlLocalized(348, 44, 250, 60, 1076264, 0x7FFF, false, false); // Broken Fallen Chair
AddHtmlLocalized(348, 44, 250, 60, 1076264, 0x7FFF); // Broken Fallen Chair
AddImageTiledButton(14, 108, 0x918, 0x919, 0x84, GumpButtonType.Reply, 0, 0x3DAA, 0x0, 20, -3);
AddTooltip(1076611);
AddHtmlLocalized(98, 108, 250, 60, 1076265, 0x7FFF, false, false); // Suit of Gold Armor
AddHtmlLocalized(98, 108, 250, 60, 1076265, 0x7FFF); // Suit of Gold Armor
AddImageTiledButton(264, 108, 0x918, 0x919, 0x85, GumpButtonType.Reply, 0, 0x151C, 0x0, -20, -3);
AddTooltip(1076612);
AddHtmlLocalized(348, 108, 250, 60, 1076266, 0x7FFF, false, false); // Suit of Silver Armor
AddHtmlLocalized(348, 108, 250, 60, 1076266, 0x7FFF); // Suit of Silver Armor
AddImageTiledButton(14, 172, 0x918, 0x919, 0x86, GumpButtonType.Reply, 0, 0x3DB1, 0x0, 18, 8);
AddTooltip(1076613);
AddHtmlLocalized(98, 172, 250, 60, 1076267, 0x7FFF, false, false); // Boiling Cauldron
AddHtmlLocalized(98, 172, 250, 60, 1076267, 0x7FFF); // Boiling Cauldron
AddImageTiledButton(264, 172, 0x918, 0x919, 0x87, GumpButtonType.Reply, 0, 0x3F27, 0x0, 18, 8);
AddTooltip(1076614);
AddHtmlLocalized(348, 172, 250, 60, 1024656, 0x7FFF, false, false); // Guillotine
AddHtmlLocalized(348, 172, 250, 60, 1024656, 0x7FFF); // Guillotine
AddImageTiledButton(14, 236, 0x918, 0x919, 0x88, GumpButtonType.Reply, 0, 0x3F0C, 0x0, 18, 8);
AddTooltip(1076615);
AddHtmlLocalized(98, 236, 250, 60, 1076268, 0x7FFF, false, false); // Cherry Blossom Tree
AddHtmlLocalized(98, 236, 250, 60, 1076268, 0x7FFF); // Cherry Blossom Tree
AddImageTiledButton(264, 236, 0x918, 0x919, 0x89, GumpButtonType.Reply, 0, 0x3F07, 0x0, 18, 8);
AddTooltip(1076616);
AddHtmlLocalized(348, 236, 250, 60, 1076269, 0x7FFF, false, false); // Apple Tree
AddHtmlLocalized(348, 236, 250, 60, 1076269, 0x7FFF); // Apple Tree
AddImageTiledButton(14, 300, 0x918, 0x919, 0x8A, GumpButtonType.Reply, 0, 0x3F16, 0x0, 18, 8);
AddTooltip(1076617);
AddHtmlLocalized(98, 300, 250, 60, 1076270, 0x7FFF, false, false); // Peach Tree
AddHtmlLocalized(98, 300, 250, 60, 1076270, 0x7FFF); // Peach Tree
AddImageTiledButton(264, 300, 0x918, 0x919, 0x8B, GumpButtonType.Reply, 0, 0x3F12, 0x0, 18, 8);
AddTooltip(1076618);
AddHtmlLocalized(348, 300, 250, 60, 1076271, 0x7FFF, false, false); // Hanging Axes
AddHtmlLocalized(348, 300, 250, 60, 1076271, 0x7FFF); // Hanging Axes
AddButton(400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 5);
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF, false, false); // Next
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF); // Next
AddPage(5);
AddButton(300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 4);
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF, false, false); // Back
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF); // Back
AddImageTiledButton(14, 44, 0x918, 0x919, 0x8C, GumpButtonType.Reply, 0, 0x3F13, 0x0, 18, 8);
AddTooltip(1076619);
AddHtmlLocalized(98, 44, 250, 60, 1076272, 0x7FFF, false, false); // Hanging Swords
AddHtmlLocalized(98, 44, 250, 60, 1076272, 0x7FFF); // Hanging Swords
AddImageTiledButton(264, 44, 0x918, 0x919, 0x8D, GumpButtonType.Reply, 0, 0x3F09, 0x0, 18, 8);
AddTooltip(1076620);
AddHtmlLocalized(348, 44, 250, 60, 1076273, 0x7FFF, false, false); // Blue fancy rug
AddHtmlLocalized(348, 44, 250, 60, 1076273, 0x7FFF); // Blue fancy rug
AddImageTiledButton(14, 108, 0x918, 0x919, 0x8E, GumpButtonType.Reply, 0, 0x3F0E, 0x0, 18, 8);
AddTooltip(1076621);
AddHtmlLocalized(98, 108, 250, 60, 1076274, 0x7FFF, false, false); // Coffin
AddHtmlLocalized(98, 108, 250, 60, 1076274, 0x7FFF); // Coffin
AddImageTiledButton(264, 108, 0x918, 0x919, 0x8F, GumpButtonType.Reply, 0, 0x3F1F, 0x0, 18, 8);
AddTooltip(1076623);
AddHtmlLocalized(348, 108, 250, 60, 1074027, 0x7FFF, false, false); // Vanity
AddHtmlLocalized(348, 108, 250, 60, 1074027, 0x7FFF); // Vanity
AddImageTiledButton(14, 172, 0x918, 0x919, 0x90, GumpButtonType.Reply, 0, 0x118B, 0x0, -4, -9);
AddTooltip(1076624);
AddHtmlLocalized(98, 172, 250, 60, 1076635, 0x7FFF, false, false); // Table With A Purple<br>Tablecloth
AddHtmlLocalized(98, 172, 250, 60, 1076635, 0x7FFF); // Table With A Purple<br>Tablecloth
AddImageTiledButton(264, 172, 0x918, 0x919, 0x91, GumpButtonType.Reply, 0, 0x118C, 0x0, -4, -9);
AddTooltip(1076624);
AddHtmlLocalized(348, 172, 250, 60, 1076636, 0x7FFF, false, false); // Table With A Blue<br>Tablecloth
AddHtmlLocalized(348, 172, 250, 60, 1076636, 0x7FFF); // Table With A Blue<br>Tablecloth
AddImageTiledButton(14, 236, 0x918, 0x919, 0x92, GumpButtonType.Reply, 0, 0x118D, 0x0, -4, -9);
AddTooltip(1076624);
AddHtmlLocalized(98, 236, 250, 60, 1076637, 0x7FFF, false, false); // Table With A Red<br>Tablecloth
AddHtmlLocalized(98, 236, 250, 60, 1076637, 0x7FFF); // Table With A Red<br>Tablecloth
AddImageTiledButton(264, 236, 0x918, 0x919, 0x93, GumpButtonType.Reply, 0, 0x118E, 0x0, -4, -9);
AddTooltip(1076624);
AddHtmlLocalized(348, 236, 250, 60, 1076638, 0x7FFF, false, false); // Table With An Orange<br>Tablecloth
AddHtmlLocalized(348, 236, 250, 60, 1076638, 0x7FFF); // Table With An Orange<br>Tablecloth
AddImageTiledButton(14, 300, 0x918, 0x919, 0x94, GumpButtonType.Reply, 0, 0x3F1E, 0x0, 18, 8);
AddTooltip(1076625);
AddHtmlLocalized(98, 300, 250, 60, 1076279, 0x7FFF, false, false); // Unmade Bed
AddHtmlLocalized(98, 300, 250, 60, 1076279, 0x7FFF); // Unmade Bed
AddImageTiledButton(264, 300, 0x918, 0x919, 0x95, GumpButtonType.Reply, 0, 0x3F0F, 0x0, 18, 8);
AddTooltip(1076626);
AddHtmlLocalized(348, 300, 250, 60, 1076280, 0x7FFF, false, false); // Curtains
AddHtmlLocalized(348, 300, 250, 60, 1076280, 0x7FFF); // Curtains
AddButton(400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 6);
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF, false, false); // Next
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF); // Next
AddPage(6);
AddButton(300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 5);
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF, false, false); // Back
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF); // Back
AddImageTiledButton(14, 44, 0x918, 0x919, 0x96, GumpButtonType.Reply, 0, 0x1E34, 0x0, 18, -17);
AddTooltip(1076627);
AddHtmlLocalized(98, 44, 250, 60, 1076281, 0x7FFF, false, false); // Scarecrow
AddHtmlLocalized(98, 44, 250, 60, 1076281, 0x7FFF); // Scarecrow
AddImageTiledButton(264, 44, 0x918, 0x919, 0x97, GumpButtonType.Reply, 0, 0xA0C, 0x0, 18, 8);
AddTooltip(1076628);
AddHtmlLocalized(348, 44, 250, 60, 1076282, 0x7FFF, false, false); // Wall Torch
AddHtmlLocalized(348, 44, 250, 60, 1076282, 0x7FFF); // Wall Torch
AddImageTiledButton(14, 108, 0x918, 0x919, 0x98, GumpButtonType.Reply, 0, 0x3F10, 0x0, 18, 9);
AddTooltip(1076629);
AddHtmlLocalized(98, 108, 250, 60, 1076283, 0x7FFF, false, false); // Fountain
AddHtmlLocalized(98, 108, 250, 60, 1076283, 0x7FFF); // Fountain
AddImageTiledButton(264, 108, 0x918, 0x919, 0x99, GumpButtonType.Reply, 0, 0x3F19, 0x0, 18, 8);
AddTooltip(1076630);
AddHtmlLocalized(348, 108, 250, 60, 1076284, 0x7FFF, false, false); // Statue
AddHtmlLocalized(348, 108, 250, 60, 1076284, 0x7FFF); // Statue
AddImageTiledButton(14, 172, 0x918, 0x919, 0x9A, GumpButtonType.Reply, 0, 0x1EA5, 0x0, 5, -25);
AddTooltip(1076631);
AddHtmlLocalized(98, 172, 250, 60, 1076285, 0x7FFF, false, false); // Large Fish Net
AddHtmlLocalized(98, 172, 250, 60, 1076285, 0x7FFF); // Large Fish Net
AddImageTiledButton(264, 172, 0x918, 0x919, 0x9B, GumpButtonType.Reply, 0, 0x1EA3, 0x0, 18, -27);
AddTooltip(1076632);
AddHtmlLocalized(348, 172, 250, 60, 1076286, 0x7FFF, false, false); // Small Fish Net
AddHtmlLocalized(348, 172, 250, 60, 1076286, 0x7FFF); // Small Fish Net
AddImageTiledButton(14, 236, 0x918, 0x919, 0x9C, GumpButtonType.Reply, 0, 0x2FDF, 0x0, 18, -36);
AddTooltip(1076633);
AddHtmlLocalized(98, 236, 250, 60, 1076287, 0x7FFF, false, false); // Ladder
AddHtmlLocalized(98, 236, 250, 60, 1076287, 0x7FFF); // Ladder
AddImageTiledButton(264, 236, 0x918, 0x919, 0x9D, GumpButtonType.Reply, 0, 0x3F15, 0x0, 18, 8);
AddTooltip(1076622);
AddHtmlLocalized(348, 236, 250, 60, 1076288, 0x7FFF, false, false); // Iron Maiden
AddHtmlLocalized(348, 236, 250, 60, 1076288, 0x7FFF); // Iron Maiden
AddImageTiledButton(14, 300, 0x918, 0x919, 0x9E, GumpButtonType.Reply, 0, 0x3F0A, 0x0, 18, 8);
AddTooltip(1076620);
AddHtmlLocalized(98, 300, 250, 60, 1076585, 0x7FFF, false, false); // Blue plain rug
AddHtmlLocalized(98, 300, 250, 60, 1076585, 0x7FFF); // Blue plain rug
AddImageTiledButton(264, 300, 0x918, 0x919, 0x9F, GumpButtonType.Reply, 0, 0x3F11, 0x0, 18, 8);
AddTooltip(1076620);
AddHtmlLocalized(348, 300, 250, 60, 1076586, 0x7FFF, false, false); // Golden decorative rug
AddHtmlLocalized(348, 300, 250, 60, 1076586, 0x7FFF); // Golden decorative rug
AddButton(400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 7);
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF, false, false); // Next
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF); // Next
AddPage(7);
AddButton(300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 6);
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF, false, false); // Back
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF); // Back
AddImageTiledButton(14, 44, 0x918, 0x919, 0xA0, GumpButtonType.Reply, 0, 0x3F0D, 0x0, 18, 8);
AddTooltip(1076620);
AddHtmlLocalized(98, 44, 250, 60, 1076587, 0x7FFF, false, false); // Cinnamon fancy rug
AddHtmlLocalized(98, 44, 250, 60, 1076587, 0x7FFF); // Cinnamon fancy rug
AddImageTiledButton(264, 44, 0x918, 0x919, 0xA1, GumpButtonType.Reply, 0, 0x3F18, 0x0, 18, 8);
AddTooltip(1076620);
AddHtmlLocalized(348, 44, 250, 60, 1076588, 0x7FFF, false, false); // Red plain rug
AddHtmlLocalized(348, 44, 250, 60, 1076588, 0x7FFF); // Red plain rug
AddImageTiledButton(14, 108, 0x918, 0x919, 0xA2, GumpButtonType.Reply, 0, 0x3F08, 0x0, 18, 8);
AddTooltip(1076620);
AddHtmlLocalized(98, 108, 250, 60, 1076589, 0x7FFF, false, false); // Blue decorative rug
AddHtmlLocalized(98, 108, 250, 60, 1076589, 0x7FFF); // Blue decorative rug
AddImageTiledButton(264, 108, 0x918, 0x919, 0xA3, GumpButtonType.Reply, 0, 0x3F17, 0x0, 18, 8);
AddTooltip(1076620);
AddHtmlLocalized(348, 108, 250, 60, 1076590, 0x7FFF, false, false); // Pink fancy rug
AddHtmlLocalized(348, 108, 250, 60, 1076590, 0x7FFF); // Pink fancy rug
AddImageTiledButton(14, 172, 0x918, 0x919, 0xA4, GumpButtonType.Reply, 0, 0x312A, 0x0, 18, 8);
AddTooltip(1076615);
AddHtmlLocalized(98, 172, 250, 60, 1076784, 0x7FFF, false, false); // Cherry Blossom Trunk
AddHtmlLocalized(98, 172, 250, 60, 1076784, 0x7FFF); // Cherry Blossom Trunk
AddImageTiledButton(264, 172, 0x918, 0x919, 0xA5, GumpButtonType.Reply, 0, 0x3128, 0x0, 18, 8);
AddTooltip(1076616);
AddHtmlLocalized(348, 172, 250, 60, 1076785, 0x7FFF, false, false); // Apple Trunk
AddHtmlLocalized(348, 172, 250, 60, 1076785, 0x7FFF); // Apple Trunk
AddImageTiledButton(14, 236, 0x918, 0x919, 0xA6, GumpButtonType.Reply, 0, 0x3129, 0x0, 18, 8);
AddTooltip(1076617);
AddHtmlLocalized(98, 236, 250, 60, 1076786, 0x7FFF, false, false); // Peach Trunk
AddHtmlLocalized(98, 236, 250, 60, 1076786, 0x7FFF); // Peach Trunk
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (m_Token == null || m_Token.Deleted || info.ButtonID == 0)
if (m_Token?.Deleted != false || info.ButtonID == 0)
return;
List<Type> types = new List<Type>();
@ -575,4 +575,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -11,10 +11,10 @@ namespace Server.Gumps
{
m_from = from;
AddBackground(0, 0, 245, 145, 9250);
AddButton(157, 101, 247, 248, 1, GumpButtonType.Reply, 0);
AddButton(81, 100, 241, 248, 0, GumpButtonType.Reply, 0);
AddButton(157, 101, 247, 248, 1);
AddButton(81, 100, 241, 248, 0);
AddHtml(21, 20, 203, 70, @"Are you sure you want to use
honor points on yourself?", true, false);
honor points on yourself?", true);
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -22,4 +22,4 @@ honor points on yourself?", true, false);
if (info.ButtonID == 1) HonorVirtue.ActivateEmbrace(m_from);
}
}
}
}

View file

@ -27,7 +27,7 @@ namespace Server.Gumps
AddImageTiled(10, 10, 400, 20, 2624);
AddAlphaRegion(10, 10, 400, 20);
AddHtmlLocalized(10, 10, 400, 20, 1060635, 30720, false, false); // <CENTER>WARNING</CENTER>
AddHtmlLocalized(10, 10, 400, 20, 1060635, 30720); // <CENTER>WARNING</CENTER>
AddImageTiled(10, 40, 400, 200, 2624);
AddAlphaRegion(10, 40, 400, 200);
@ -43,11 +43,11 @@ namespace Server.Gumps
AddImageTiled(10, 250, 400, 20, 2624);
AddAlphaRegion(10, 250, 400, 20);
AddButton(10, 250, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(40, 250, 170, 20, 1011036, 32767, false, false); // OKAY
AddButton(10, 250, 4005, 4007, 1);
AddHtmlLocalized(40, 250, 170, 20, 1011036, 32767); // OKAY
AddButton(210, 250, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(240, 250, 170, 20, 1011012, 32767, false, false); // CANCEL
AddButton(210, 250, 4005, 4007, 0);
AddHtmlLocalized(240, 250, 170, 20, 1011012, 32767); // CANCEL
}
public override void OnResponse(NetState state, RelayInfo info)
@ -167,4 +167,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -22,14 +22,14 @@ namespace Server.Gumps
AddBackground(0, 0, 420, 430, 5054);
AddBackground(10, 10, 400, 410, 3000);
AddButton(20, 388, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 388, 300, 20, 1011104, false, false); // Return to previous menu
AddButton(20, 388, 4005, 4007, 0);
AddHtmlLocalized(55, 388, 300, 20, 1011104); // Return to previous menu
AddHtmlLocalized(20, 20, 350, 20, number, false, false);
AddHtmlLocalized(20, 20, 350, 20, number);
if (list == null)
return;
for (int i = 0; i < list.Count; ++i)
{
if (i % 16 == 0)
@ -87,17 +87,17 @@ namespace Server.Gumps
AddBackground(0, 0, 420, 430, 5054);
AddBackground(10, 10, 400, 410, 3000);
AddButton(20, 388, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 388, 300, 20, 1011104, false, false); // Return to previous menu
AddButton(20, 388, 4005, 4007, 0);
AddHtmlLocalized(55, 388, 300, 20, 1011104); // Return to previous menu
AddButton(20, 365, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 365, 300, 20, 1011270, false, false); // Remove now!
AddButton(20, 365, 4005, 4007, 1);
AddHtmlLocalized(55, 365, 300, 20, 1011270); // Remove now!
AddHtmlLocalized(20, 20, 350, 20, number, false, false);
AddHtmlLocalized(20, 20, 350, 20, number);
if (list == null)
return;
m_Copy = new List<Mobile>(list);
for (int i = 0; i < list.Count; ++i)
@ -210,114 +210,113 @@ namespace Server.Gumps
if (!isFriend)
return;
AddHtmlLocalized(55, 103, 75, 20, 1011233, false, false); // INFO
AddHtmlLocalized(55, 103, 75, 20, 1011233); // INFO
AddButton(20, 103, 4005, 4007, 0, GumpButtonType.Page, 1);
AddHtmlLocalized(170, 103, 75, 20, 1011234, false, false); // FRIENDS
AddHtmlLocalized(170, 103, 75, 20, 1011234); // FRIENDS
AddButton(135, 103, 4005, 4007, 0, GumpButtonType.Page, 2);
AddHtmlLocalized(295, 103, 75, 20, 1011235, false, false); // OPTIONS
AddHtmlLocalized(295, 103, 75, 20, 1011235); // OPTIONS
AddButton(260, 103, 4005, 4007, 0, GumpButtonType.Page, 3);
AddHtmlLocalized(295, 390, 75, 20, 1011441, false, false); // EXIT
AddButton(260, 390, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(295, 390, 75, 20, 1011441); // EXIT
AddButton(260, 390, 4005, 4007, 0);
AddHtmlLocalized(55, 390, 200, 20, 1011236, false, false); // Change this house's name!
AddButton(20, 390, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 390, 200, 20, 1011236); // Change this house's name!
AddButton(20, 390, 4005, 4007, 1);
// Info page
AddPage(1);
AddHtmlLocalized(20, 135, 100, 20, 1011242, false, false); // Owned by:
AddHtml(120, 135, 100, 20, GetOwnerName(), false, false);
AddHtmlLocalized(20, 135, 100, 20, 1011242); // Owned by:
AddHtml(120, 135, 100, 20, GetOwnerName());
AddHtmlLocalized(20, 170, 275, 20, 1011237, false, false); // Number of locked down items:
AddHtml(320, 170, 50, 20, m_House.LockDownCount.ToString(), false, false);
AddHtmlLocalized(20, 170, 275, 20, 1011237); // Number of locked down items:
AddHtml(320, 170, 50, 20, m_House.LockDownCount.ToString());
AddHtmlLocalized(20, 190, 275, 20, 1011238, false, false); // Maximum locked down items:
AddHtml(320, 190, 50, 20, m_House.MaxLockDowns.ToString(), false, false);
AddHtmlLocalized(20, 190, 275, 20, 1011238); // Maximum locked down items:
AddHtml(320, 190, 50, 20, m_House.MaxLockDowns.ToString());
AddHtmlLocalized(20, 210, 275, 20, 1011239, false, false); // Number of secure containers:
AddHtml(320, 210, 50, 20, m_House.SecureCount.ToString(), false, false);
AddHtmlLocalized(20, 210, 275, 20, 1011239); // Number of secure containers:
AddHtml(320, 210, 50, 20, m_House.SecureCount.ToString());
AddHtmlLocalized(20, 230, 275, 20, 1011240, false, false); // Maximum number of secure containers:
AddHtml(320, 230, 50, 20, m_House.MaxSecures.ToString(), false, false);
AddHtmlLocalized(20, 230, 275, 20, 1011240); // Maximum number of secure containers:
AddHtml(320, 230, 50, 20, m_House.MaxSecures.ToString());
AddHtmlLocalized(20, 260, 400, 20, 1018032, false, false); // This house is properly placed.
AddHtmlLocalized(20, 280, 400, 20, 1018035, false, false); // This house is of modern design.
AddHtmlLocalized(20, 260, 400, 20, 1018032); // This house is properly placed.
AddHtmlLocalized(20, 280, 400, 20, 1018035); // This house is of modern design.
if (m_House.Public)
{
// TODO: Validate exact placement
AddHtmlLocalized(20, 305, 275, 20, 1011241, false, false); // Number of visits this building has had
AddHtml(320, 305, 50, 20, m_House.Visits.ToString(), false, false);
AddHtmlLocalized(20, 305, 275, 20, 1011241); // Number of visits this building has had
AddHtml(320, 305, 50, 20, m_House.Visits.ToString());
}
// Friends page
AddPage(2);
AddHtmlLocalized(45, 130, 150, 20, 1011266, false, false); // List of co-owners
AddButton(20, 130, 2714, 2715, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 130, 150, 20, 1011266); // List of co-owners
AddButton(20, 130, 2714, 2715, 2);
AddHtmlLocalized(45, 150, 150, 20, 1011267, false, false); // Add a co-owner
AddButton(20, 150, 2714, 2715, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 150, 150, 20, 1011267); // Add a co-owner
AddButton(20, 150, 2714, 2715, 3);
AddHtmlLocalized(45, 170, 150, 20, 1018036, false, false); // Remove a co-owner
AddButton(20, 170, 2714, 2715, 4, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 170, 150, 20, 1018036); // Remove a co-owner
AddButton(20, 170, 2714, 2715, 4);
AddHtmlLocalized(45, 190, 150, 20, 1011268, false, false); // Clear co-owner list
AddButton(20, 190, 2714, 2715, 5, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 190, 150, 20, 1011268); // Clear co-owner list
AddButton(20, 190, 2714, 2715, 5);
AddHtmlLocalized(225, 130, 155, 20, 1011243, false, false); // List of Friends
AddButton(200, 130, 2714, 2715, 6, GumpButtonType.Reply, 0);
AddHtmlLocalized(225, 130, 155, 20, 1011243); // List of Friends
AddButton(200, 130, 2714, 2715, 6);
AddHtmlLocalized(225, 150, 155, 20, 1011244, false, false); // Add a Friend
AddButton(200, 150, 2714, 2715, 7, GumpButtonType.Reply, 0);
AddHtmlLocalized(225, 150, 155, 20, 1011244); // Add a Friend
AddButton(200, 150, 2714, 2715, 7);
AddHtmlLocalized(225, 170, 155, 20, 1018037, false, false); // Remove a Friend
AddButton(200, 170, 2714, 2715, 8, GumpButtonType.Reply, 0);
AddHtmlLocalized(225, 170, 155, 20, 1018037); // Remove a Friend
AddButton(200, 170, 2714, 2715, 8);
AddHtmlLocalized(225, 190, 155, 20, 1011245, false, false); // Clear Friends list
AddButton(200, 190, 2714, 2715, 9, GumpButtonType.Reply, 0);
AddHtmlLocalized(225, 190, 155, 20, 1011245); // Clear Friends list
AddButton(200, 190, 2714, 2715, 9);
AddHtmlLocalized(120, 215, 280, 20, 1011258, false, false); // Ban someone from the house
AddButton(95, 215, 2714, 2715, 10, GumpButtonType.Reply, 0);
AddHtmlLocalized(120, 215, 280, 20, 1011258); // Ban someone from the house
AddButton(95, 215, 2714, 2715, 10);
AddHtmlLocalized(120, 235, 280, 20, 1011259, false, false); // Eject someone from the house
AddButton(95, 235, 2714, 2715, 11, GumpButtonType.Reply, 0);
AddHtmlLocalized(120, 235, 280, 20, 1011259); // Eject someone from the house
AddButton(95, 235, 2714, 2715, 11);
AddHtmlLocalized(120, 255, 280, 20, 1011260, false, false); // View a list of banned people
AddButton(95, 255, 2714, 2715, 12, GumpButtonType.Reply, 0);
AddHtmlLocalized(120, 255, 280, 20, 1011260); // View a list of banned people
AddButton(95, 255, 2714, 2715, 12);
AddHtmlLocalized(120, 275, 280, 20, 1011261, false, false); // Lift a ban
AddButton(95, 275, 2714, 2715, 13, GumpButtonType.Reply, 0);
AddHtmlLocalized(120, 275, 280, 20, 1011261); // Lift a ban
AddButton(95, 275, 2714, 2715, 13);
// Options page
AddPage(3);
AddHtmlLocalized(45, 150, 355, 30, 1011248, false, false); // Transfer ownership of the house
AddButton(20, 150, 2714, 2715, 14, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 150, 355, 30, 1011248); // Transfer ownership of the house
AddButton(20, 150, 2714, 2715, 14);
AddHtmlLocalized(45, 180, 355, 30, 1011249, false, false); // Demolish house and get deed back
AddButton(20, 180, 2714, 2715, 15, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 180, 355, 30, 1011249); // Demolish house and get deed back
AddButton(20, 180, 2714, 2715, 15);
if (!m_House.Public)
{
AddHtmlLocalized(45, 210, 355, 30, 1011247, false, false); // Change the house locks
AddButton(20, 210, 2714, 2715, 16, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 210, 355, 30, 1011247); // Change the house locks
AddButton(20, 210, 2714, 2715, 16);
AddHtmlLocalized(45, 240, 350, 90, 1011253, false,
false); // Declare this building to be public. This will make your front door unlockable.
AddButton(20, 240, 2714, 2715, 17, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 240, 350, 90, 1011253); // Declare this building to be public. This will make your front door unlockable.
AddButton(20, 240, 2714, 2715, 17);
}
else
{
//AddHtmlLocalized( 45, 280, 350, 30, 1011250, false, false ); // Change the sign type
AddHtmlLocalized(45, 210, 350, 30, 1011250, false, false); // Change the sign type
AddHtmlLocalized(45, 210, 350, 30, 1011250); // Change the sign type
AddButton(20, 210, 2714, 2715, 0, GumpButtonType.Page, 4);
AddHtmlLocalized(45, 240, 350, 30, 1011252, false, false); // Declare this building to be private.
AddButton(20, 240, 2714, 2715, 17, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 240, 350, 30, 1011252); // Declare this building to be private.
AddButton(20, 240, 2714, 2715, 17);
// Change the sign type
AddPage(4);
@ -328,11 +327,11 @@ namespace Server.Gumps
AddItem(60 + i / 4 * 50, 130 + i % 4 * 35, 2980 + i * 2);
}
AddHtmlLocalized(200, 305, 129, 20, 1011254, false, false); // Guild sign choices
AddHtmlLocalized(200, 305, 129, 20, 1011254); // Guild sign choices
AddButton(350, 305, 252, 253, 0, GumpButtonType.Page, 5);
AddHtmlLocalized(200, 340, 355, 30, 1011277, false, false); // Okay that is fine.
AddButton(350, 340, 4005, 4007, 18, GumpButtonType.Reply, 0);
AddHtmlLocalized(200, 340, 355, 30, 1011277); // Okay that is fine.
AddButton(350, 340, 4005, 4007, 18);
AddPage(5);
@ -342,11 +341,11 @@ namespace Server.Gumps
AddItem(60 + i / 5 * 50, 130 + i % 5 * 35, 3028 + i * 2);
}
AddHtmlLocalized(200, 305, 129, 20, 1011255, false, false); // Shop sign choices
AddHtmlLocalized(200, 305, 129, 20, 1011255); // Shop sign choices
AddButton(350, 305, 250, 251, 0, GumpButtonType.Page, 4);
AddHtmlLocalized(200, 340, 355, 30, 1011277, false, false); // Okay that is fine.
AddButton(350, 340, 4005, 4007, 18, GumpButtonType.Reply, 0);
AddHtmlLocalized(200, 340, 355, 30, 1011277); // Okay that is fine.
AddButton(350, 340, 4005, 4007, 18);
}
}
@ -738,4 +737,4 @@ namespace Server.Prompts
}
}
}
}
}

View file

@ -118,7 +118,7 @@ namespace Server.Gumps
for (int i = 0, y = (114 - lines.Count * 14) / 2; i < lines.Count; ++i, y += 14)
{
string s = (string)lines[i];
string s = lines[i];
AddLabel(10 + (160 - s.Length * 8) / 2, y, 0, s);
}
@ -126,7 +126,7 @@ namespace Server.Gumps
if (page == HouseGumpPageAOS.Vendors)
{
AddHtmlLocalized(10, 120, 400, 20, 1062428, LabelColor, false, false); // <CENTER>SHOPS</CENTER>
AddHtmlLocalized(10, 120, 400, 20, 1062428, LabelColor); // <CENTER>SHOPS</CENTER>
AddList(house.AvailableVendorsFor(from), 1, false, false, from);
return;
@ -156,52 +156,44 @@ namespace Server.Gumps
{
case HouseGumpPageAOS.Information:
{
AddHtmlLocalized(20, 130, 200, 20, 1011242, LabelColor, false, false); // Owned By:
AddHtmlLocalized(20, 130, 200, 20, 1011242, LabelColor); // Owned By:
AddLabel(210, 130, LabelHue, GetOwnerName());
AddHtmlLocalized(20, 170, 380, 20, 1018032, SelectedColor, false,
false); // This house is properly placed.
AddHtmlLocalized(20, 190, 380, 20, 1018035, SelectedColor, false,
false); // This house is of modern design.
AddHtmlLocalized(20, 210, 380, 20, house is HouseFoundation ? 1060681 : 1060680, SelectedColor, false,
false); // This is a (pre | custom)-built house.
AddHtmlLocalized(20, 230, 380, 20, house.Public ? 1060678 : 1060679, SelectedColor, false,
false); // This house is (private | open to the public).
AddHtmlLocalized(20, 170, 380, 20, 1018032, SelectedColor); // This house is properly placed.
AddHtmlLocalized(20, 190, 380, 20, 1018035, SelectedColor); // This house is of modern design.
AddHtmlLocalized(20, 210, 380, 20, house is HouseFoundation ? 1060681 : 1060680, SelectedColor); // This is a (pre | custom)-built house.
AddHtmlLocalized(20, 230, 380, 20, house.Public ? 1060678 : 1060679, SelectedColor); // This house is (private | open to the public).
switch (house.DecayType)
{
case DecayType.Ageless:
case DecayType.AutoRefresh:
{
AddHtmlLocalized(20, 250, 380, 20, 1062209, SelectedColor, false,
false); // This house is <a href = "?ForceTopic97">Automatically</a> refreshed.
AddHtmlLocalized(20, 250, 380, 20, 1062209, SelectedColor); // This house is <a href = "?ForceTopic97">Automatically</a> refreshed.
break;
}
case DecayType.ManualRefresh:
{
AddHtmlLocalized(20, 250, 380, 20, 1062208, SelectedColor, false,
false); // This house is <a href = "?ForceTopic97">Grandfathered</a>.
AddHtmlLocalized(20, 250, 380, 20, 1062208, SelectedColor); // This house is <a href = "?ForceTopic97">Grandfathered</a>.
break;
}
case DecayType.Condemned:
{
AddHtmlLocalized(20, 250, 380, 20, 1062207, WarningColor, false,
false); // This house is <a href = "?ForceTopic97">Condemned</a>.
AddHtmlLocalized(20, 250, 380, 20, 1062207, WarningColor); // This house is <a href = "?ForceTopic97">Condemned</a>.
break;
}
}
AddHtmlLocalized(20, 290, 200, 20, 1060692, SelectedColor, false, false); // Built On:
AddHtmlLocalized(20, 290, 200, 20, 1060692, SelectedColor); // Built On:
AddLabel(250, 290, LabelHue, GetDateTime(house.BuiltOn));
AddHtmlLocalized(20, 310, 200, 20, 1060693, SelectedColor, false, false); // Last Traded:
AddHtmlLocalized(20, 310, 200, 20, 1060693, SelectedColor); // Last Traded:
AddLabel(250, 310, LabelHue, GetDateTime(house.LastTraded));
AddHtmlLocalized(20, 330, 200, 20, 1061793, SelectedColor, false, false); // House Value
AddHtmlLocalized(20, 330, 200, 20, 1061793, SelectedColor); // House Value
AddLabel(250, 330, LabelHue, house.Price.ToString());
AddHtmlLocalized(20, 360, 300, 20, 1011241, SelectedColor, false,
false); // Number of visits this building has had:
AddHtmlLocalized(20, 360, 300, 20, 1011241, SelectedColor); // Number of visits this building has had:
AddLabel(350, 360, LabelHue, house.Visits.ToString());
break;
@ -225,14 +217,14 @@ namespace Server.Gumps
AddButtonLabeled(210, 130, GetButtonID(3, 12), 1060695, isOwner); // Change to Private
AddHtmlLocalized(245, 150, 240, 20, 1060694, SelectedColor, false, false); // Change to Public
AddHtmlLocalized(245, 150, 240, 20, 1060694, SelectedColor); // Change to Public
}
else
{
AddButtonLabeled(10, 310, GetButtonID(3, 10), 1060699); // View Access List
AddButtonLabeled(10, 330, GetButtonID(3, 11), 1060700); // Clear Access List
AddHtmlLocalized(245, 130, 240, 20, 1060695, SelectedColor, false, false); // Change to Private
AddHtmlLocalized(245, 130, 240, 20, 1060695, SelectedColor); // Change to Private
AddButtonLabeled(210, 150, GetButtonID(3, 13), 1060694, isOwner); // Change to Public
}
@ -241,8 +233,7 @@ namespace Server.Gumps
}
case HouseGumpPageAOS.Storage:
{
AddHtmlLocalized(10, 130, 400, 20, 1060682, LabelColor, false,
false); // <CENTER>HOUSE STORAGE SUMMARY</CENTER>
AddHtmlLocalized(10, 130, 400, 20, 1060682, LabelColor); // <CENTER>HOUSE STORAGE SUMMARY</CENTER>
// This is not as OSI; storage changes not yet implemented
@ -258,11 +249,9 @@ namespace Server.Gumps
AddHtmlLocalized( 10, 230, 275, 20, 1011240, LabelColor, false, false ); // Maximum number of secure containers:
AddLabel( 310, 230, LabelHue, m_House.MaxSecures.ToString() );*/
int fromSecures, fromVendors, fromLockdowns, fromMovingCrate;
int maxSecures = house.GetAosMaxSecures();
int curSecures = house.GetAosCurSecures(out fromSecures, out fromVendors, out fromLockdowns,
out fromMovingCrate);
int curSecures = house.GetAosCurSecures(out int fromSecures, out int fromVendors, out int fromLockdowns,
out int fromMovingCrate);
int maxLockdowns = house.GetAosMaxLockdowns();
int curLockdowns = house.GetAosCurLockdowns();
@ -271,54 +260,54 @@ namespace Server.Gumps
if (bonusStorage > 0)
{
AddHtmlLocalized(10, 150, 300, 20, 1072519, LabelColor, false, false); // Increased Storage
AddHtmlLocalized(10, 150, 300, 20, 1072519, LabelColor); // Increased Storage
AddLabel(310, 150, LabelHue, $"{bonusStorage}%");
}
AddHtmlLocalized(10, 170, 300, 20, 1060683, LabelColor, false, false); // Maximum Secure Storage
AddHtmlLocalized(10, 170, 300, 20, 1060683, LabelColor); // Maximum Secure Storage
AddLabel(310, 170, LabelHue, maxSecures.ToString());
AddHtmlLocalized(10, 190, 300, 20, 1060685, LabelColor, false, false); // Used by Moving Crate
AddHtmlLocalized(10, 190, 300, 20, 1060685, LabelColor); // Used by Moving Crate
AddLabel(310, 190, LabelHue, fromMovingCrate.ToString());
AddHtmlLocalized(10, 210, 300, 20, 1060686, LabelColor, false, false); // Used by Lockdowns
AddHtmlLocalized(10, 210, 300, 20, 1060686, LabelColor); // Used by Lockdowns
AddLabel(310, 210, LabelHue, fromLockdowns.ToString());
if (BaseHouse.NewVendorSystem)
{
AddHtmlLocalized(10, 230, 300, 20, 1060688, LabelColor, false, false); // Used by Secure Containers
AddHtmlLocalized(10, 230, 300, 20, 1060688, LabelColor); // Used by Secure Containers
AddLabel(310, 230, LabelHue, fromSecures.ToString());
AddHtmlLocalized(10, 250, 300, 20, 1060689, LabelColor, false, false); // Available Storage
AddHtmlLocalized(10, 250, 300, 20, 1060689, LabelColor); // Available Storage
AddLabel(310, 250, LabelHue, Math.Max(maxSecures - curSecures, 0).ToString());
AddHtmlLocalized(10, 290, 300, 20, 1060690, LabelColor, false, false); // Maximum Lockdowns
AddHtmlLocalized(10, 290, 300, 20, 1060690, LabelColor); // Maximum Lockdowns
AddLabel(310, 290, LabelHue, maxLockdowns.ToString());
AddHtmlLocalized(10, 310, 300, 20, 1060691, LabelColor, false, false); // Available Lockdowns
AddHtmlLocalized(10, 310, 300, 20, 1060691, LabelColor); // Available Lockdowns
AddLabel(310, 310, LabelHue, Math.Max(maxLockdowns - curLockdowns, 0).ToString());
int maxVendors = house.GetNewVendorSystemMaxVendors();
int vendors = house.PlayerVendors.Count + house.VendorRentalContracts.Count;
AddHtmlLocalized(10, 350, 300, 20, 1062391, LabelColor, false, false); // Vendor Count
AddHtmlLocalized(10, 350, 300, 20, 1062391, LabelColor); // Vendor Count
AddLabel(310, 350, LabelHue, vendors + " / " + maxVendors);
}
else
{
AddHtmlLocalized(10, 230, 300, 20, 1060687, LabelColor, false, false); // Used by Vendors
AddHtmlLocalized(10, 230, 300, 20, 1060687, LabelColor); // Used by Vendors
AddLabel(310, 230, LabelHue, fromVendors.ToString());
AddHtmlLocalized(10, 250, 300, 20, 1060688, LabelColor, false, false); // Used by Secure Containers
AddHtmlLocalized(10, 250, 300, 20, 1060688, LabelColor); // Used by Secure Containers
AddLabel(310, 250, LabelHue, fromSecures.ToString());
AddHtmlLocalized(10, 270, 300, 20, 1060689, LabelColor, false, false); // Available Storage
AddHtmlLocalized(10, 270, 300, 20, 1060689, LabelColor); // Available Storage
AddLabel(310, 270, LabelHue, Math.Max(maxSecures - curSecures, 0).ToString());
AddHtmlLocalized(10, 330, 300, 20, 1060690, LabelColor, false, false); // Maximum Lockdowns
AddHtmlLocalized(10, 330, 300, 20, 1060690, LabelColor); // Maximum Lockdowns
AddLabel(310, 330, LabelHue, maxLockdowns.ToString());
AddHtmlLocalized(10, 350, 300, 20, 1060691, LabelColor, false, false); // Available Lockdowns
AddHtmlLocalized(10, 350, 300, 20, 1060691, LabelColor); // Available Lockdowns
AddLabel(310, 350, LabelHue, Math.Max(maxLockdowns - curLockdowns, 0).ToString());
}
@ -360,7 +349,7 @@ namespace Server.Gumps
int x = 50 + i % 3 * 100;
int y = 180 + i / 3 * 80;
AddButton(x, y, 4005, 4007, GetButtonID(7, i), GumpButtonType.Reply, 0);
AddButton(x, y, 4005, 4007, GetButtonID(7, i));
AddItem(x + 20, y, m_HangerNumbers[i]);
}
@ -373,7 +362,7 @@ namespace Server.Gumps
int x = 15 + i % 5 * 80;
int y = 180 + i / 5 * 100;
AddButton(x, y, 4005, 4007, GetButtonID(8, i), GumpButtonType.Reply, 0);
AddButton(x, y, 4005, 4007, GetButtonID(8, i));
AddItem(x + 25, y, m_FoundationNumbers[i]);
}
@ -408,7 +397,7 @@ namespace Server.Gumps
int x = 30 + j % 6 * 60;
int y = 130 + j / 6 * 60;
AddButton(x, y, 4005, 4007, GetButtonID(9, index), GumpButtonType.Reply, 0);
AddButton(x, y, 4005, 4007, GetButtonID(9, index));
AddItem(x + 20, y, _HouseSigns[index++]);
}
}
@ -417,49 +406,49 @@ namespace Server.Gumps
}
case HouseGumpPageAOS.RemoveCoOwner:
{
AddHtmlLocalized(10, 120, 400, 20, 1060730, LabelColor, false, false); // <CENTER>CO-OWNER LIST</CENTER>
AddHtmlLocalized(10, 120, 400, 20, 1060730, LabelColor); // <CENTER>CO-OWNER LIST</CENTER>
AddList(house.CoOwners, 10, false, true, from);
break;
}
case HouseGumpPageAOS.ListCoOwner:
{
AddHtmlLocalized(10, 120, 400, 20, 1060730, LabelColor, false, false); // <CENTER>CO-OWNER LIST</CENTER>
AddHtmlLocalized(10, 120, 400, 20, 1060730, LabelColor); // <CENTER>CO-OWNER LIST</CENTER>
AddList(house.CoOwners, -1, false, true, from);
break;
}
case HouseGumpPageAOS.RemoveFriend:
{
AddHtmlLocalized(10, 120, 400, 20, 1060731, LabelColor, false, false); // <CENTER>FRIENDS LIST</CENTER>
AddHtmlLocalized(10, 120, 400, 20, 1060731, LabelColor); // <CENTER>FRIENDS LIST</CENTER>
AddList(house.Friends, 11, false, true, from);
break;
}
case HouseGumpPageAOS.ListFriend:
{
AddHtmlLocalized(10, 120, 400, 20, 1060731, LabelColor, false, false); // <CENTER>FRIENDS LIST</CENTER>
AddHtmlLocalized(10, 120, 400, 20, 1060731, LabelColor); // <CENTER>FRIENDS LIST</CENTER>
AddList(house.Friends, -1, false, true, from);
break;
}
case HouseGumpPageAOS.RemoveBan:
{
AddHtmlLocalized(10, 120, 400, 20, 1060733, LabelColor, false, false); // <CENTER>BAN LIST</CENTER>
AddHtmlLocalized(10, 120, 400, 20, 1060733, LabelColor); // <CENTER>BAN LIST</CENTER>
AddList(house.Bans, 12, true, true, from);
break;
}
case HouseGumpPageAOS.ListBan:
{
AddHtmlLocalized(10, 120, 400, 20, 1060733, LabelColor, false, false); // <CENTER>BAN LIST</CENTER>
AddHtmlLocalized(10, 120, 400, 20, 1060733, LabelColor); // <CENTER>BAN LIST</CENTER>
AddList(house.Bans, -1, true, true, from);
break;
}
case HouseGumpPageAOS.RemoveAccess:
{
AddHtmlLocalized(10, 120, 400, 20, 1060732, LabelColor, false, false); // <CENTER>ACCESS LIST</CENTER>
AddHtmlLocalized(10, 120, 400, 20, 1060732, LabelColor); // <CENTER>ACCESS LIST</CENTER>
AddList(house.Access, 13, false, true, from);
break;
}
case HouseGumpPageAOS.ListAccess:
{
AddHtmlLocalized(10, 120, 400, 20, 1060732, LabelColor, false, false); // <CENTER>ACCESS LIST</CENTER>
AddHtmlLocalized(10, 120, 400, 20, 1060732, LabelColor); // <CENTER>ACCESS LIST</CENTER>
AddList(house.Access, -1, false, true, from);
break;
}
@ -478,7 +467,7 @@ namespace Server.Gumps
int x = 15 + j % 8 * 50;
int y = 130 + j / 8 * 110;
AddButton(x, y, 4005, 4007, GetButtonID(14, index), GumpButtonType.Reply, 0);
AddButton(x, y, 4005, 4007, GetButtonID(14, index));
AddItem(x + 10, y, m_PostNumbers[index++]);
}
}
@ -492,15 +481,10 @@ namespace Server.Gumps
{
Mobile m = m_House.Owner;
if (m == null || m.Deleted)
if (m?.Deleted != false)
return "(unowned)";
string name;
if ((name = m.Name) == null || (name = name.Trim()).Length <= 0)
name = "(no name)";
return name;
return String.IsNullOrWhiteSpace(m.Name) ? "(no name)" : m.Name.Trim();
}
private string GetDateTime(DateTime val)
@ -512,21 +496,16 @@ namespace Server.Gumps
{
bool isSelection = m_Page == page;
AddButton(x, y, isSelection ? 4006 : 4005, 4007, buttonID, GumpButtonType.Reply, 0);
AddHtmlLocalized(x + 45, y, 200, 20, number, isSelection ? SelectedColor : LabelColor, false, false);
AddButton(x, y, isSelection ? 4006 : 4005, 4007, buttonID);
AddHtmlLocalized(x + 45, y, 200, 20, number, isSelection ? SelectedColor : LabelColor);
}
public void AddButtonLabeled(int x, int y, int buttonID, int number)
{
AddButtonLabeled(x, y, buttonID, number, true);
}
public void AddButtonLabeled(int x, int y, int buttonID, int number, bool enabled)
public void AddButtonLabeled(int x, int y, int buttonID, int number, bool enabled = true)
{
if (enabled)
AddButton(x, y, 4005, 4007, buttonID, GumpButtonType.Reply, 0);
AddButton(x, y, 4005, 4007, buttonID);
AddHtmlLocalized(x + 35, y, 240, 20, number, enabled ? LabelColor : DisabledColor, false, false);
AddHtmlLocalized(x + 35, y, 240, 20, number, enabled ? LabelColor : DisabledColor);
}
public void AddList(List<Mobile> list, int button, bool accountOf, bool leadingStar, Mobile from)
@ -584,7 +563,7 @@ namespace Server.Gumps
continue;
if (button != -1)
AddButton(10 + xoffset, 150 + yoffset, 4005, 4007, GetButtonID(button, i), GumpButtonType.Reply, 0);
AddButton(10 + xoffset, 150 + yoffset, 4005, 4007, GetButtonID(button, i));
if (accountOf && m.Player && m.Account != null)
name = "Account of " + name;
@ -698,7 +677,7 @@ namespace Server.Gumps
if (e == null)
return;
int cost = e.Cost - house.Price;
if (cost > 0)
@ -1351,7 +1330,7 @@ namespace Server.Gumps
{
if (isOwner && m_List != null && index >= 0 && index < m_List.Count)
{
m_House.RemoveCoOwner(from, (Mobile)m_List[index]);
m_House.RemoveCoOwner(from, m_List[index]);
if (m_House.CoOwners.Count > 0)
from.SendGump(new HouseGumpAOS(HouseGumpPageAOS.RemoveCoOwner, from, m_House));
@ -1365,7 +1344,7 @@ namespace Server.Gumps
{
if (isCoOwner && m_List != null && index >= 0 && index < m_List.Count)
{
m_House.RemoveFriend(from, (Mobile)m_List[index]);
m_House.RemoveFriend(from, m_List[index]);
if (m_House.Friends.Count > 0)
from.SendGump(new HouseGumpAOS(HouseGumpPageAOS.RemoveFriend, from, m_House));
@ -1379,7 +1358,7 @@ namespace Server.Gumps
{
if (m_List != null && index >= 0 && index < m_List.Count)
{
m_House.RemoveBan(from, (Mobile)m_List[index]);
m_House.RemoveBan(from, m_List[index]);
if (m_House.Bans.Count > 0)
from.SendGump(new HouseGumpAOS(HouseGumpPageAOS.RemoveBan, from, m_House));
@ -1393,7 +1372,7 @@ namespace Server.Gumps
{
if (m_List != null && index >= 0 && index < m_List.Count)
{
m_House.RemoveAccess(from, (Mobile)m_List[index]);
m_House.RemoveAccess(from, m_List[index]);
if (m_House.Access.Count > 0)
from.SendGump(new HouseGumpAOS(HouseGumpPageAOS.RemoveAccess, from, m_House));
@ -1477,4 +1456,4 @@ namespace Server.Gumps
return list;
}
}
}
}

View file

@ -23,7 +23,7 @@ namespace Server.Gumps
AddImageTiled(10, 10, 400, 20, 2624);
AddAlphaRegion(10, 10, 400, 20);
AddHtmlLocalized(10, 10, 400, 20, 1060635, 30720, false, false); // <CENTER>WARNING</CENTER>
AddHtmlLocalized(10, 10, 400, 20, 1060635, 30720); // <CENTER>WARNING</CENTER>
AddImageTiled(10, 40, 400, 200, 2624);
AddAlphaRegion(10, 40, 400, 200);
@ -46,11 +46,11 @@ namespace Server.Gumps
AddImageTiled(10, 250, 400, 20, 2624);
AddAlphaRegion(10, 250, 400, 20);
AddButton(10, 250, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(40, 250, 170, 20, 1011036, 32767, false, false); // OKAY
AddButton(10, 250, 4005, 4007, 1);
AddHtmlLocalized(40, 250, 170, 20, 1011036, 32767); // OKAY
AddButton(210, 250, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(240, 250, 170, 20, 1011012, 32767, false, false); // CANCEL
AddButton(210, 250, 4005, 4007, 0);
AddHtmlLocalized(240, 250, 170, 20, 1011012, 32767); // CANCEL
}
public override void OnResponse(NetState state, RelayInfo info)
@ -59,4 +59,4 @@ namespace Server.Gumps
m_House.EndConfirmTransfer(m_From, m_To);
}
}
}
}

View file

@ -21,7 +21,7 @@ namespace Server.Gumps
AddImageTiled(10, 10, width - 20, 20, 2624);
AddAlphaRegion(10, 10, width - 20, 20);
AddHtmlLocalized(10, 10, width - 20, 20, header, headerColor, false, false);
AddHtmlLocalized(10, 10, width - 20, 20, header, headerColor);
AddImageTiled(10, 40, width - 20, height - 80, 2624);
AddAlphaRegion(10, 40, width - 20, height - 80);
@ -34,8 +34,8 @@ namespace Server.Gumps
AddImageTiled(10, height - 30, width - 20, 20, 2624);
AddAlphaRegion(10, height - 30, width - 20, 20);
AddButton(10, height - 30, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(40, height - 30, 120, 20, 1011036, 32767, false, false); // OKAY
AddButton(10, height - 30, 4005, 4007, 1);
AddHtmlLocalized(40, height - 30, 120, 20, 1011036, 32767); // OKAY
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -44,4 +44,4 @@ namespace Server.Gumps
m_Callback?.Invoke();
}
}
}
}

View file

@ -8,12 +8,7 @@ namespace Server.Gumps
private double m_HitsScalar;
private BaseCreature m_Pet;
public PetResurrectGump(Mobile from, BaseCreature pet)
: this(from, pet, 0.0)
{
}
public PetResurrectGump(Mobile from, BaseCreature pet, double hitsScalar) : base(50, 50)
public PetResurrectGump(Mobile from, BaseCreature pet, double hitsScalar = 0.0) : base(50, 50)
{
from.CloseGump<PetResurrectGump>();
@ -31,12 +26,11 @@ namespace Server.Gumps
AddItem(195, 90, 0xCAD);
AddItem(218, 95, 0xCB0);
AddHtmlLocalized(30, 30, 150, 75, 1049665, false,
false); // <div align=center>Wilt thou sanctify the resurrection of:</div>
AddHtml(30, 70, 150, 25, $"<div align=CENTER>{pet.Name}</div>", true, false);
AddHtmlLocalized(30, 30, 150, 75, 1049665); // <div align=center>Wilt thou sanctify the resurrection of:</div>
AddHtml(30, 70, 150, 25, $"<div align=CENTER>{pet.Name}</div>", true);
AddButton(40, 105, 0x81A, 0x81B, 0x1, GumpButtonType.Reply, 0); // Okay
AddButton(110, 105, 0x819, 0x818, 0x2, GumpButtonType.Reply, 0); // Cancel
AddButton(40, 105, 0x81A, 0x81B, 0x1); // Okay
AddButton(110, 105, 0x819, 0x818, 0x2); // Cancel
}
public override void OnResponse(NetState state, RelayInfo info)
@ -80,4 +74,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -20,21 +20,21 @@ namespace Server.Gumps
AddBackground(100, 10, 300, 150, 5054);
AddHtmlLocalized(125, 20, 250, 24, 1019070, false, false); // You have agreed to purchase:
AddHtmlLocalized(125, 20, 250, 24, 1019070); // You have agreed to purchase:
if (!string.IsNullOrEmpty(vi.Description))
AddLabel(125, 45, 0, vi.Description);
else
AddHtmlLocalized(125, 45, 250, 24, 1019072, false, false); // an item without a description
AddHtmlLocalized(125, 45, 250, 24, 1019072); // an item without a description
AddHtmlLocalized(125, 70, 250, 24, 1019071, false, false); // for the amount of:
AddHtmlLocalized(125, 70, 250, 24, 1019071); // for the amount of:
AddLabel(125, 95, 0, vi.Price.ToString());
AddButton(250, 130, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(282, 130, 100, 24, 1011012, false, false); // CANCEL
AddButton(250, 130, 4005, 4007, 0);
AddHtmlLocalized(282, 130, 100, 24, 1011012); // CANCEL
AddButton(120, 130, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(152, 130, 100, 24, 1011036, false, false); // OKAY
AddButton(120, 130, 4005, 4007, 1);
AddHtmlLocalized(152, 130, 100, 24, 1011036); // OKAY
}
public override void OnResponse(NetState state, RelayInfo info)
@ -110,28 +110,28 @@ namespace Server.Gumps
AddPage(0);
AddBackground(25, 10, 530, 140, 5054);
AddHtmlLocalized(425, 25, 120, 20, 1019068, false, false); // See goods
AddButton(390, 25, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(425, 48, 120, 20, 1019069, false, false); // Customize
AddButton(390, 48, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(425, 72, 120, 20, 1011012, false, false); // CANCEL
AddButton(390, 71, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(425, 25, 120, 20, 1019068); // See goods
AddButton(390, 25, 4005, 4007, 1);
AddHtmlLocalized(425, 48, 120, 20, 1019069); // Customize
AddButton(390, 48, 4005, 4007, 2);
AddHtmlLocalized(425, 72, 120, 20, 1011012); // CANCEL
AddButton(390, 71, 4005, 4007, 0);
AddHtmlLocalized(40, 72, 260, 20, 1038321, false, false); // Gold held for you:
AddHtmlLocalized(40, 72, 260, 20, 1038321); // Gold held for you:
AddLabel(300, 72, 0, m_Vendor.HoldGold.ToString());
AddHtmlLocalized(40, 96, 260, 20, 1038322, false, false); // Gold held in my account:
AddHtmlLocalized(40, 96, 260, 20, 1038322); // Gold held in my account:
AddLabel(300, 96, 0, m_Vendor.BankAccount.ToString());
//AddHtmlLocalized( 40, 120, 260, 20, 1038324, false, false ); // My charge per day is:
// Localization has changed, we must use a string here
AddHtml(40, 120, 260, 20, "My charge per day is:", false, false);
AddHtml(40, 120, 260, 20, "My charge per day is:");
AddLabel(300, 120, 0, perDay.ToString());
double days = (m_Vendor.HoldGold + m_Vendor.BankAccount) / (double)perDay;
AddHtmlLocalized(40, 25, 260, 20, 1038318, false, false); // Amount of days I can work:
AddHtmlLocalized(40, 25, 260, 20, 1038318); // Amount of days I can work:
AddLabel(300, 25, 0, ((int)days).ToString());
AddHtmlLocalized(40, 48, 260, 20, 1038319, false, false); // Earth days:
AddHtmlLocalized(40, 48, 260, 20, 1038319); // Earth days:
AddLabel(300, 48, 0, ((int)(days / 12.0)).ToString());
}
@ -185,24 +185,24 @@ namespace Server.Gumps
{
int goldNeeded = perRealWorldDay - goldHeld;
AddHtmlLocalized(40, 35, 260, 20, 1038320, 0x7FFF, false, false); // Gold needed for 1 day of vendor salary:
AddHtmlLocalized(40, 35, 260, 20, 1038320, 0x7FFF); // Gold needed for 1 day of vendor salary:
AddLabel(300, 35, 0x1F, goldNeeded.ToString());
}
else
{
int days = goldHeld / perRealWorldDay;
AddHtmlLocalized(40, 35, 260, 20, 1038318, 0x7FFF, false, false); // # of days Vendor salary is paid for:
AddHtmlLocalized(40, 35, 260, 20, 1038318, 0x7FFF); // # of days Vendor salary is paid for:
AddLabel(300, 35, 0x480, days.ToString());
}
AddHtmlLocalized(40, 58, 260, 20, 1038324, 0x7FFF, false, false); // My charge per real world day is:
AddHtmlLocalized(40, 58, 260, 20, 1038324, 0x7FFF); // My charge per real world day is:
AddLabel(300, 58, 0x480, perRealWorldDay.ToString());
AddHtmlLocalized(40, 82, 260, 20, 1038322, 0x7FFF, false, false); // Gold held in my account:
AddHtmlLocalized(40, 82, 260, 20, 1038322, 0x7FFF); // Gold held in my account:
AddLabel(300, 82, 0x480, goldHeld.ToString());
AddHtmlLocalized(40, 108, 260, 20, 1062509, 0x7FFF, false, false); // Shop Name:
AddHtmlLocalized(40, 108, 260, 20, 1062509, 0x7FFF); // Shop Name:
AddLabel(140, 106, 0x66D, vendor.ShopName);
if (vendor is RentedVendor rentedVendor)
@ -213,29 +213,29 @@ namespace Server.Gumps
$"Location rental will expire in {days} day{(days != 1 ? "s" : "")} and {hours} hour{(hours != 1 ? "s" : "")}.");
}
AddButton(390, 24, 0x15E1, 0x15E5, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(408, 21, 120, 20, 1019068, 0x7FFF, false, false); // See goods
AddButton(390, 24, 0x15E1, 0x15E5, 1);
AddHtmlLocalized(408, 21, 120, 20, 1019068, 0x7FFF); // See goods
AddButton(390, 44, 0x15E1, 0x15E5, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(408, 41, 120, 20, 1019069, 0x7FFF, false, false); // Customize
AddButton(390, 44, 0x15E1, 0x15E5, 2);
AddHtmlLocalized(408, 41, 120, 20, 1019069, 0x7FFF); // Customize
AddButton(390, 64, 0x15E1, 0x15E5, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(408, 61, 120, 20, 1062434, 0x7FFF, false, false); // Rename Shop
AddButton(390, 64, 0x15E1, 0x15E5, 3);
AddHtmlLocalized(408, 61, 120, 20, 1062434, 0x7FFF); // Rename Shop
AddButton(390, 84, 0x15E1, 0x15E5, 4, GumpButtonType.Reply, 0);
AddHtmlLocalized(408, 81, 120, 20, 3006217, 0x7FFF, false, false); // Rename Vendor
AddButton(390, 84, 0x15E1, 0x15E5, 4);
AddHtmlLocalized(408, 81, 120, 20, 3006217, 0x7FFF); // Rename Vendor
AddButton(390, 104, 0x15E1, 0x15E5, 5, GumpButtonType.Reply, 0);
AddHtmlLocalized(408, 101, 120, 20, 3006123, 0x7FFF, false, false); // Open Paperdoll
AddButton(390, 104, 0x15E1, 0x15E5, 5);
AddHtmlLocalized(408, 101, 120, 20, 3006123, 0x7FFF); // Open Paperdoll
AddButton(390, 124, 0x15E1, 0x15E5, 6, GumpButtonType.Reply, 0);
AddButton(390, 124, 0x15E1, 0x15E5, 6);
AddLabel(408, 121, 0x480, "Collect Gold");
AddButton(390, 144, 0x15E1, 0x15E5, 7, GumpButtonType.Reply, 0);
AddButton(390, 144, 0x15E1, 0x15E5, 7);
AddLabel(408, 141, 0x480, "Dismiss Vendor");
AddButton(390, 162, 0x15E1, 0x15E5, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(408, 161, 120, 20, 1011012, 0x7FFF, false, false); // CANCEL
AddButton(390, 162, 0x15E1, 0x15E5, 0);
AddHtmlLocalized(408, 161, 120, 20, 1011012, 0x7FFF); // CANCEL
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -431,17 +431,17 @@ namespace Server.Gumps
AddPage(0);
AddBackground(0, 0, 585, 393, 5054);
AddBackground(195, 36, 387, 275, 3000);
AddHtmlLocalized(10, 10, 565, 18, 1011356, false, false); // <center>VENDOR CUSTOMIZATION MENU</center>
AddHtmlLocalized(60, 355, 150, 18, 1011036, false, false); // OKAY
AddButton(25, 355, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(320, 355, 150, 18, 1011012, false, false); // CANCEL
AddButton(285, 355, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(10, 10, 565, 18, 1011356); // <center>VENDOR CUSTOMIZATION MENU</center>
AddHtmlLocalized(60, 355, 150, 18, 1011036); // OKAY
AddButton(25, 355, 4005, 4007, 1);
AddHtmlLocalized(320, 355, 150, 18, 1011012); // CANCEL
AddButton(285, 355, 4005, 4007, 0);
y = 35;
for (int i = 0; i < Categories.Length; i++)
{
CustomCategory cat = Categories[i];
AddHtmlLocalized(5, y, 150, 25, cat.LocNumber, true, false);
AddHtmlLocalized(5, y, 150, 25, cat.LocNumber, true);
AddButton(155, y, 4005, 4007, 0, GumpButtonType.Page, i + 1);
y += 25;
}
@ -457,7 +457,7 @@ namespace Server.Gumps
x = 198 + c % 3 * 129;
y = 38 + c / 3 * 67;
AddHtmlLocalized(x, y, 100, entry.LongText ? 36 : 18, entry.LocNumber, false, false);
AddHtmlLocalized(x, y, 100, entry.LongText ? 36 : 18, entry.LocNumber);
if (entry.ArtNumber != 0)
AddItem(x + 20, y + 25, entry.ArtNumber);
@ -467,11 +467,11 @@ namespace Server.Gumps
if (cat.CanDye)
{
AddHtmlLocalized(327, 239, 100, 18, 1011402, false, false); // Color
AddHtmlLocalized(327, 239, 100, 18, 1011402); // Color
AddRadio(327, 259, 210, 211, false, 100 + i);
}
AddHtmlLocalized(456, 239, 100, 18, 1011403, false, false); // Remove
AddHtmlLocalized(456, 239, 100, 18, 1011403); // Remove
AddRadio(456, 259, 210, 211, false, 200 + i);
}
}
@ -824,57 +824,57 @@ namespace Server.Gumps
AddAlphaRegion(10, 10, 350, 350);
AddHtmlLocalized(10, 12, 350, 18, 1011356, 0x7FFF, false, false); // <center>VENDOR CUSTOMIZATION MENU</center>
AddHtmlLocalized(10, 12, 350, 18, 1011356, 0x7FFF); // <center>VENDOR CUSTOMIZATION MENU</center>
AddHtmlLocalized(10, 42, 150, 18, 1062459, 0x421F, false, false); // <CENTER>HAIR</CENTER>
AddHtmlLocalized(10, 42, 150, 18, 1062459, 0x421F); // <CENTER>HAIR</CENTER>
for (int i = 0; i < m_HairStyles.Length; i++)
{
HairOrBeard hair = m_HairStyles[i];
AddButton(10, 70 + i * 20, 0xFA5, 0xFA7, 0x100 | i, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 72 + i * 20, 110, 18, hair.Name, 0x7FFF, false, false);
AddButton(10, 70 + i * 20, 0xFA5, 0xFA7, 0x100 | i);
AddHtmlLocalized(45, 72 + i * 20, 110, 18, hair.Name, 0x7FFF);
}
AddButton(10, 70 + m_HairStyles.Length * 20, 0xFB1, 0xFB3, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 72 + m_HairStyles.Length * 20, 110, 18, 1011403, 0x7FFF, false, false); // Remove
AddButton(10, 70 + m_HairStyles.Length * 20, 0xFB1, 0xFB3, 2);
AddHtmlLocalized(45, 72 + m_HairStyles.Length * 20, 110, 18, 1011403, 0x7FFF); // Remove
AddButton(10, 70 + (m_HairStyles.Length + 1) * 20, 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 72 + (m_HairStyles.Length + 1) * 20, 110, 18, 1011402, 0x7FFF, false, false); // Color
AddButton(10, 70 + (m_HairStyles.Length + 1) * 20, 0xFA5, 0xFA7, 3);
AddHtmlLocalized(45, 72 + (m_HairStyles.Length + 1) * 20, 110, 18, 1011402, 0x7FFF); // Color
if (vendor.Female)
{
AddButton(160, 290, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(195, 292, 160, 18, 1015327, 0x7FFF, false, false); // Male
AddButton(160, 290, 0xFA5, 0xFA7, 1);
AddHtmlLocalized(195, 292, 160, 18, 1015327, 0x7FFF); // Male
AddHtmlLocalized(195, 312, 160, 18, 1015328, 0x421F, false, false); // Female
AddHtmlLocalized(195, 312, 160, 18, 1015328, 0x421F); // Female
}
else
{
AddHtmlLocalized(160, 42, 210, 18, 1062460, 0x421F, false, false); // <CENTER>BEARD</CENTER>
AddHtmlLocalized(160, 42, 210, 18, 1062460, 0x421F); // <CENTER>BEARD</CENTER>
for (int i = 0; i < m_BeardStyles.Length; i++)
{
HairOrBeard beard = m_BeardStyles[i];
AddButton(160, 70 + i * 20, 0xFA5, 0xFA7, 0x200 | i, GumpButtonType.Reply, 0);
AddHtmlLocalized(195, 72 + i * 20, 160, 18, beard.Name, 0x7FFF, false, false);
AddButton(160, 70 + i * 20, 0xFA5, 0xFA7, 0x200 | i);
AddHtmlLocalized(195, 72 + i * 20, 160, 18, beard.Name, 0x7FFF);
}
AddButton(160, 70 + m_BeardStyles.Length * 20, 0xFB1, 0xFB3, 4, GumpButtonType.Reply, 0);
AddHtmlLocalized(195, 72 + m_BeardStyles.Length * 20, 160, 18, 1011403, 0x7FFF, false, false); // Remove
AddButton(160, 70 + m_BeardStyles.Length * 20, 0xFB1, 0xFB3, 4);
AddHtmlLocalized(195, 72 + m_BeardStyles.Length * 20, 160, 18, 1011403, 0x7FFF); // Remove
AddButton(160, 70 + (m_BeardStyles.Length + 1) * 20, 0xFA5, 0xFA7, 5, GumpButtonType.Reply, 0);
AddHtmlLocalized(195, 72 + (m_BeardStyles.Length + 1) * 20, 160, 18, 1011402, 0x7FFF, false, false); // Color
AddButton(160, 70 + (m_BeardStyles.Length + 1) * 20, 0xFA5, 0xFA7, 5);
AddHtmlLocalized(195, 72 + (m_BeardStyles.Length + 1) * 20, 160, 18, 1011402, 0x7FFF); // Color
AddHtmlLocalized(195, 292, 160, 18, 1015327, 0x421F, false, false); // Male
AddHtmlLocalized(195, 292, 160, 18, 1015327, 0x421F); // Male
AddButton(160, 310, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(195, 312, 160, 18, 1015328, 0x7FFF, false, false); // Female
AddButton(160, 310, 0xFA5, 0xFA7, 1);
AddHtmlLocalized(195, 312, 160, 18, 1015328, 0x7FFF); // Female
}
AddButton(10, 340, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 342, 305, 18, 1060675, 0x7FFF, false, false); // CLOSE
AddButton(10, 340, 0xFA5, 0xFA7, 0);
AddHtmlLocalized(45, 342, 305, 18, 1060675, 0x7FFF); // CLOSE
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -1040,4 +1040,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -87,17 +87,17 @@ namespace Server.Gumps
AddPage(0);
AddBackground(0, 0, 585, 393, 5054);
AddBackground(195, 36, 387, 275, 3000);
AddHtmlLocalized(0, 0, 510, 18, 1015234, false, false); // <center>Polymorph Selection Menu</center>
AddHtmlLocalized(60, 355, 150, 18, 1011036, false, false); // OKAY
AddHtmlLocalized(0, 0, 510, 18, 1015234); // <center>Polymorph Selection Menu</center>
AddHtmlLocalized(60, 355, 150, 18, 1011036); // OKAY
AddButton(25, 355, 4005, 4007, 1, GumpButtonType.Reply, 1);
AddHtmlLocalized(320, 355, 150, 18, 1011012, false, false); // CANCEL
AddHtmlLocalized(320, 355, 150, 18, 1011012); // CANCEL
AddButton(285, 355, 4005, 4007, 0, GumpButtonType.Reply, 2);
y = 35;
for (int i = 0; i < Categories.Length; i++)
{
PolymorphCategory cat = Categories[i];
AddHtmlLocalized(5, y, 150, 25, cat.LocNumber, true, false);
AddHtmlLocalized(5, y, 150, 25, cat.LocNumber, true);
AddButton(155, y, 4005, 4007, 0, GumpButtonType.Page, i + 1);
y += 25;
}
@ -113,7 +113,7 @@ namespace Server.Gumps
x = 198 + c % 3 * 129;
y = 38 + c / 3 * 67;
AddHtmlLocalized(x, y, 100, 18, entry.LocNumber, false, false);
AddHtmlLocalized(x, y, 100, 18, entry.LocNumber);
AddItem(x + 20, y + 25, entry.ArtID);
AddRadio(x, y + 20, 210, 211, false, (c << 8) + i);
}
@ -191,10 +191,10 @@ namespace Server.Gumps
AddImageTiled(10, 374, 500, 20, 0xA40);
AddAlphaRegion(10, 10, 500, 384);
AddHtmlLocalized(14, 12, 500, 20, 1015234, 0x7FFF, false, false); // <center>Polymorph Selection Menu</center>
AddHtmlLocalized(14, 12, 500, 20, 1015234, 0x7FFF); // <center>Polymorph Selection Menu</center>
AddButton(10, 374, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 376, 450, 20, 1060051, 0x7FFF, false, false); // CANCEL
AddButton(10, 374, 0xFB1, 0xFB2, 0);
AddHtmlLocalized(45, 376, 450, 20, 1060051, 0x7FFF); // CANCEL
for (int i = 0; i < m_Entries.Length; i++)
{
@ -208,7 +208,7 @@ namespace Server.Gumps
if (page > 1)
{
AddButton(400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, page);
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF, false, false); // Next
AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF); // Next
}
AddPage(page);
@ -216,7 +216,7 @@ namespace Server.Gumps
if (page > 1)
{
AddButton(300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF, false, false); // Back
AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF); // Back
}
}
@ -224,7 +224,7 @@ namespace Server.Gumps
int y = pos / 2 * 64 + 44;
AddImageTiledButton(x, y, 0x918, 0x919, i + 1, GumpButtonType.Reply, 0, entry.ArtID, 0x0, entry.X, entry.Y);
AddHtmlLocalized(x + 84, y, 250, 60, entry.LocNumber, 0x7FFF, false, false);
AddHtmlLocalized(x + 84, y, 250, 60, entry.LocNumber, 0x7FFF);
}
}
@ -239,4 +239,4 @@ namespace Server.Gumps
spell.Cast();
}
}
}
}

View file

@ -213,7 +213,7 @@ namespace Server.Gumps
if (page > 0)
{
AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1, GumpButtonType.Reply, 0);
AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1);
if (PrevLabel)
AddLabel(x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous");
@ -226,7 +226,7 @@ namespace Server.Gumps
if (TypeLabel && m_Type != null)
AddHtml(x, y, emptyWidth, EntryHeight,
$"<BASEFONT COLOR=#FAFAFA><CENTER>{m_Type.Name}</CENTER></BASEFONT>", false, false);
$"<BASEFONT COLOR=#FAFAFA><CENTER>{m_Type.Name}</CENTER></BASEFONT>");
x += emptyWidth + OffsetSize;
@ -276,8 +276,7 @@ namespace Server.Gumps
CPA cpa = GetCPA(prop);
if (prop.CanWrite && cpa != null && m_Mobile.AccessLevel >= cpa.WriteLevel && !cpa.ReadOnly)
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, i + 3, GumpButtonType.Reply,
0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, i + 3);
}
}
}
@ -296,10 +295,9 @@ namespace Server.Gumps
{
case 0: // Closed
{
if (m_Stack != null && m_Stack.Count > 0)
if (m_Stack?.Count > 0)
{
StackEntry entry = m_Stack.Pop();
from.SendGump(new PropertiesGump(from, entry.m_Object, m_Stack, null));
}
@ -504,7 +502,7 @@ namespace Server.Gumps
}
if (o is byte || o is sbyte || o is short || o is ushort || o is int || o is uint || o is long || o is ulong)
return string.Format("{0} (0x{0:X})", o);
return $"{o} (0x{o:X})";
if (o is Mobile mobile) return $"(M) 0x{mobile.Serial.Value:X} \"{mobile.Name}\"";
if (o is Item item) return $"(I) 0x{item.Serial.Value:X}";
if (o is Type type) return type.Name;
@ -637,7 +635,7 @@ namespace Server.Gumps
}
if (o is byte || o is sbyte || o is short || o is ushort || o is int || o is uint || o is long || o is ulong)
return string.Format("{0} (0x{0:X})", o);
return $"{o} (0x{o:X})";
if (o is Mobile mobile) return $"(M) 0x{mobile.Serial.Value:X} \"{mobile.Name}\"";
if (o is Item item) return $"(I) 0x{item.Serial.Value:X}";
if (o is Type type) return type.Name;

View file

@ -76,23 +76,23 @@ namespace Server.Gumps
int y = 40 + i / 4 * 93;
AddItem(x + (120 - bounds.Width) / 2 - bounds.X, y + (69 - bounds.Height) / 2 - bounds.Y, itemID);
AddButton(x + 6, y + 66, 0x98D, 0x98D, 7 + index, GumpButtonType.Reply, 0);
AddButton(x + 6, y + 66, 0x98D, 0x98D, 7 + index);
x += 6;
y += 67;
AddHtml(x + 0, y - 1, 108, 21, Center(entry.DisplayName), false, false);
AddHtml(x + 0, y + 1, 108, 21, Center(entry.DisplayName), false, false);
AddHtml(x - 1, y + 0, 108, 21, Center(entry.DisplayName), false, false);
AddHtml(x + 1, y + 0, 108, 21, Center(entry.DisplayName), false, false);
AddHtml(x + 0, y + 0, 108, 21, Color(Center(entry.DisplayName), TextColor32), false, false);
AddHtml(x + 0, y - 1, 108, 21, Center(entry.DisplayName));
AddHtml(x + 0, y + 1, 108, 21, Center(entry.DisplayName));
AddHtml(x - 1, y + 0, 108, 21, Center(entry.DisplayName));
AddHtml(x + 1, y + 0, 108, 21, Center(entry.DisplayName));
AddHtml(x + 0, y + 0, 108, 21, Color(Center(entry.DisplayName), TextColor32));
}
if (ourPage > 0)
AddButton(480, 12, 0x15E3, 0x15E7, 5, GumpButtonType.Reply, 0);
AddButton(480, 12, 0x15E3, 0x15E7, 5);
if ((ourPage + 1) * 12 < ourList.Count)
AddButton(497, 12, 0x15E1, 0x15E5, 6, GumpButtonType.Reply, 0);
AddButton(497, 12, 0x15E1, 0x15E5, 6);
}
}
@ -110,8 +110,8 @@ namespace Server.Gumps
{
bool isSelection = m_OurType == type;
AddButton(x, y - 1, isSelection ? 4006 : 4005, 4007, buttonID, GumpButtonType.Reply, 0);
AddHtml(x + 35, y, 200, 20, Color(text, isSelection ? SelectedColor32 : LabelColor32), false, false);
AddButton(x, y - 1, isSelection ? 4006 : 4005, 4007, buttonID);
AddHtml(x + 35, y, 200, 20, Color(text, isSelection ? SelectedColor32 : LabelColor32));
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -299,4 +299,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -109,7 +109,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1);
if (canNull)
{
@ -123,7 +123,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 2, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 2);
}
if (canDye)
@ -138,7 +138,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 3, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 3);
}
if (isBody)
@ -153,7 +153,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 4, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 4);
}
}
@ -280,4 +280,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -156,7 +156,7 @@ namespace Server.Gumps
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
if (button != 0)
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, button, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, button);
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -184,4 +184,4 @@ namespace Server.Gumps
m_Mobile.SendGump(new PropertiesGump(m_Mobile, m_Object, m_Stack, m_List, m_Page));
}
}
}
}

View file

@ -98,7 +98,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1);
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
@ -110,7 +110,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 2, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 2);
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
@ -122,7 +122,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 3, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 3);
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
@ -134,7 +134,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 4, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 4);
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -269,4 +269,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -94,7 +94,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1);
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
@ -105,7 +105,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 2, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 2);
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
@ -122,7 +122,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 3, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 3);
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -228,4 +228,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -94,7 +94,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1);
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
@ -105,7 +105,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 2, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 2);
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
@ -127,7 +127,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 3, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 3);
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -235,4 +235,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -100,7 +100,7 @@ namespace Server.Gumps
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
if (button != 0)
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, button, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, button);
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -226,4 +226,4 @@ namespace Server.Gumps
m_Mobile.SendGump(new PropertiesGump(m_Mobile, m_Object, m_Stack, m_List, m_Page));
}
}
}
}

View file

@ -18,7 +18,7 @@ namespace Server.Gumps
AddBackground(0, 0, 170, 50 + m_Vendors.Count * 20, 0x13BE);
AddImageTiled(10, 10, 150, 20, 0xA40);
AddHtmlLocalized(10, 10, 150, 20, 1061827, 0x7FFF, false, false); // <CENTER>Reclaim Vendor</CENTER>
AddHtmlLocalized(10, 10, 150, 20, 1061827, 0x7FFF); // <CENTER>Reclaim Vendor</CENTER>
AddImageTiled(10, 40, 150, m_Vendors.Count * 20, 0xA40);
@ -28,7 +28,7 @@ namespace Server.Gumps
int y = 40 + i * 20;
AddButton(10, y, 0xFA5, 0xFA7, i + 1, GumpButtonType.Reply, 0);
AddButton(10, y, 0xFA5, 0xFA7, i + 1);
AddLabel(45, y, 0x481, m.Name);
}
}
@ -75,4 +75,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -90,11 +90,7 @@ namespace Server.Gumps
}
}
public ReportMurdererGump( Mobile victum, List<Mobile> killers ) : this( victum, killers, 0 )
{
}
private ReportMurdererGump( Mobile victum, List<Mobile> killers, int idx ) : base( 0, 0 )
private ReportMurdererGump(Mobile victum, List<Mobile> killers, int idx = 0) : base( 0, 0 )
{
m_Killers = killers;
m_Victum = victum;
@ -121,14 +117,14 @@ namespace Server.Gumps
AddPage( 1 );
AddHtml( 260, 234, 300, 140, ((Mobile)m_Killers[m_Idx]).Name, false, false ); // Player's Name
AddHtmlLocalized( 260, 254, 300, 140, 1049066, false, false ); // Would you like to report...
AddHtml( 260, 234, 300, 140, m_Killers[m_Idx].Name ); // Player's Name
AddHtmlLocalized( 260, 254, 300, 140, 1049066 ); // Would you like to report...
AddButton( 260, 300, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 300, 300, 300, 50, 1046362, false, false ); // Yes
AddButton( 260, 300, 0xFA5, 0xFA7, 1 );
AddHtmlLocalized( 300, 300, 300, 50, 1046362 ); // Yes
AddButton( 360, 300, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 400, 300, 300, 50, 1046363, false, false ); // No
AddButton( 360, 300, 0xFA5, 0xFA7, 2 );
AddHtmlLocalized( 400, 300, 300, 50, 1046363 ); // No
}
public static void ReportedListExpiry_Callback( PlayerMobile from, Mobile killer )
@ -146,7 +142,7 @@ namespace Server.Gumps
case 1:
{
Mobile killer = m_Killers[m_Idx];
if ( killer != null && !killer.Deleted )
if (killer?.Deleted == false)
{
killer.Kills++;
killer.ShortTermMurders++;

View file

@ -10,7 +10,7 @@ namespace Server.Gumps
ChaosShrine = 0,
VirtueShrine = 1,
Healer = 2,
Generic = 3,
Generic = 3
}
public class ResurrectGump : Gump
@ -20,42 +20,22 @@ namespace Server.Gumps
private bool m_FromSacrifice;
private double m_HitsScalar;
public ResurrectGump( Mobile owner )
: this( owner, owner, ResurrectMessage.Generic, false )
public ResurrectGump(Mobile owner, double hitsScalar)
: this(owner, owner, ResurrectMessage.Generic, false, hitsScalar)
{
}
public ResurrectGump( Mobile owner, double hitsScalar )
: this( owner, owner, ResurrectMessage.Generic, false, hitsScalar )
public ResurrectGump(Mobile owner, ResurrectMessage msg) : this(owner, owner, msg)
{
}
public ResurrectGump( Mobile owner, bool fromSacrifice )
: this( owner, owner, ResurrectMessage.Generic, fromSacrifice )
public ResurrectGump(Mobile owner, bool fromSacrifice = false)
: this(owner, owner, ResurrectMessage.Generic, fromSacrifice)
{
}
public ResurrectGump( Mobile owner, Mobile healer )
: this( owner, healer, ResurrectMessage.Generic, false )
{
}
public ResurrectGump( Mobile owner, ResurrectMessage msg )
: this( owner, owner, msg, false )
{
}
public ResurrectGump( Mobile owner, Mobile healer, ResurrectMessage msg )
: this( owner, healer, msg, false )
{
}
public ResurrectGump( Mobile owner, Mobile healer, ResurrectMessage msg, bool fromSacrifice )
: this( owner, healer, msg, fromSacrifice, 0.0 )
{
}
public ResurrectGump( Mobile owner, Mobile healer, ResurrectMessage msg, bool fromSacrifice, double hitsScalar )
public ResurrectGump(Mobile owner, Mobile healer, ResurrectMessage msg = ResurrectMessage.Generic,
bool fromSacrifice = false, double hitsScalar = 0.0)
: base( 100, 0 )
{
m_Healer = healer;
@ -66,18 +46,18 @@ namespace Server.Gumps
AddBackground( 0, 0, 400, 350, 2600 );
AddHtmlLocalized( 0, 20, 400, 35, 1011022, false, false ); // <center>Resurrection</center>
AddHtmlLocalized( 0, 20, 400, 35, 1011022 ); // <center>Resurrection</center>
AddHtmlLocalized( 50, 55, 300, 140, 1011023 + (int)msg, true, true ); /* It is possible for you to be resurrected here by this healer. Do you wish to try?<br>
* CONTINUE - You chose to try to come back to life now.<br>
* CANCEL - You prefer to remain a ghost for now.
*/
AddButton( 200, 227, 4005, 4007, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 235, 230, 110, 35, 1011012, false, false ); // CANCEL
AddButton( 200, 227, 4005, 4007, 0);
AddHtmlLocalized( 235, 230, 110, 35, 1011012 ); // CANCEL
AddButton( 65, 227, 4005, 4007, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 100, 230, 110, 35, 1011011, false, false ); // CONTINUE
AddButton( 65, 227, 4005, 4007, 1);
AddHtmlLocalized( 100, 230, 110, 35, 1011011 ); // CONTINUE
}
public ResurrectGump( Mobile owner, Mobile healer, int price )
@ -107,14 +87,14 @@ namespace Server.Gumps
AddImageTiled( 15, 15, 365, 190, 2624 );
AddRadio( 30, 140, 9727, 9730, true, 1 );
AddHtmlLocalized( 65, 145, 300, 25, 1060015, 0x7FFF, false, false ); // Grudgingly pay the money
AddHtmlLocalized( 65, 145, 300, 25, 1060015, 0x7FFF ); // Grudgingly pay the money
AddRadio( 30, 175, 9727, 9730, false, 0 );
AddHtmlLocalized( 65, 178, 300, 25, 1060016, 0x7FFF, false, false ); // I'd rather stay dead, you scoundrel!!!
AddHtmlLocalized( 65, 178, 300, 25, 1060016, 0x7FFF ); // I'd rather stay dead, you scoundrel!!!
AddHtmlLocalized( 30, 20, 360, 35, 1060017, 0x7FFF, false, false ); // Wishing to rejoin the living, are you? I can restore your body... for a price of course...
AddHtmlLocalized( 30, 20, 360, 35, 1060017, 0x7FFF ); // Wishing to rejoin the living, are you? I can restore your body... for a price of course...
AddHtmlLocalized( 30, 105, 345, 40, 1060018, 0x5B2D, false, false ); // Do you accept the fee, which will be withdrawn from your bank?
AddHtmlLocalized( 30, 105, 345, 40, 1060018, 0x5B2D ); // Do you accept the fee, which will be withdrawn from your bank?
AddImage( 65, 72, 5605 );
@ -122,9 +102,9 @@ namespace Server.Gumps
AddImageTiled( 95, 92, 200, 1, 9157 );
AddLabel( 90, 70, 1645, price.ToString() );
AddHtmlLocalized( 140, 70, 100, 25, 1023823, 0x7FFF, false, false ); // gold coins
AddHtmlLocalized( 140, 70, 100, 25, 1023823, 0x7FFF ); // gold coins
AddButton( 290, 175, 247, 248, 2, GumpButtonType.Reply, 0 );
AddButton( 290, 175, 247, 248, 2 );
AddImageTiled( 15, 14, 365, 1, 9107 );
AddImageTiled( 380, 14, 1, 190, 9105 );
@ -142,107 +122,107 @@ namespace Server.Gumps
from.CloseGump<ResurrectGump>();
if ( info.ButtonID == 1 || info.ButtonID == 2 )
{
if ( from.Map == null || !from.Map.CanFit( from.Location, 16, false, false ) )
{
from.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
return;
}
if (info.ButtonID != 1 && info.ButtonID != 2)
return;
if ( m_Price > 0 )
{
if ( info.IsSwitched( 1 ) )
{
if ( Banker.Withdraw( from, m_Price ) )
{
from.SendLocalizedMessage( 1060398, m_Price.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.
from.SendLocalizedMessage( 1060022, Banker.GetBalance( from ).ToString() ); // You have ~1_AMOUNT~ gold in cash remaining in your bank box.
}
else
{
from.SendLocalizedMessage( 1060020 ); // Unfortunately, you do not have enough cash in your bank to cover the cost of the healing.
return;
}
}
else
{
from.SendLocalizedMessage( 1060019 ); // You decide against paying the healer, and thus remain dead.
return;
}
}
if (from.Map?.CanFit( from.Location, 16, false, false ) != true)
{
from.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
return;
}
from.PlaySound( 0x214 );
from.FixedEffect( 0x376A, 10, 16 );
if ( m_Price > 0 )
{
if ( info.IsSwitched( 1 ) )
{
if ( Banker.Withdraw( from, m_Price ) )
{
from.SendLocalizedMessage( 1060398, m_Price.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.
from.SendLocalizedMessage( 1060022, Banker.GetBalance( from ).ToString() ); // You have ~1_AMOUNT~ gold in cash remaining in your bank box.
}
else
{
from.SendLocalizedMessage( 1060020 ); // Unfortunately, you do not have enough cash in your bank to cover the cost of the healing.
return;
}
}
else
{
from.SendLocalizedMessage( 1060019 ); // You decide against paying the healer, and thus remain dead.
return;
}
}
from.Resurrect();
from.PlaySound( 0x214 );
from.FixedEffect( 0x376A, 10, 16 );
if ( m_Healer != null && from != m_Healer )
{
VirtueLevel level = VirtueHelper.GetLevel( m_Healer, VirtueName.Compassion );
from.Resurrect();
switch( level )
{
case VirtueLevel.Seeker: from.Hits = AOS.Scale( from.HitsMax, 20 ); break;
case VirtueLevel.Follower: from.Hits = AOS.Scale( from.HitsMax, 40 ); break;
case VirtueLevel.Knight: from.Hits = AOS.Scale( from.HitsMax, 80 ); break;
}
}
if ( m_Healer != null && from != m_Healer )
{
VirtueLevel level = VirtueHelper.GetLevel( m_Healer, VirtueName.Compassion );
if ( m_FromSacrifice && from is PlayerMobile mobile )
{
mobile.AvailableResurrects -= 1;
switch( level )
{
case VirtueLevel.Seeker: from.Hits = AOS.Scale( from.HitsMax, 20 ); break;
case VirtueLevel.Follower: from.Hits = AOS.Scale( from.HitsMax, 40 ); break;
case VirtueLevel.Knight: from.Hits = AOS.Scale( from.HitsMax, 80 ); break;
}
}
Container pack = mobile.Backpack;
Container corpse = mobile.Corpse;
if ( m_FromSacrifice && from is PlayerMobile mobile )
{
mobile.AvailableResurrects -= 1;
if ( pack != null && corpse != null )
{
List<Item> items = new List<Item>( corpse.Items );
Container pack = mobile.Backpack;
Container corpse = mobile.Corpse;
for( int i = 0; i < items.Count; ++i )
{
Item item = items[i];
if ( pack != null && corpse != null )
{
List<Item> items = new List<Item>( corpse.Items );
if ( item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Movable )
pack.DropItem( item );
}
}
}
for( int i = 0; i < items.Count; ++i )
{
Item item = items[i];
if ( from.Fame > 0 )
{
int amount = from.Fame / 10;
if ( item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Movable )
pack.DropItem( item );
}
}
}
Misc.Titles.AwardFame( from, -amount, true );
}
if ( from.Fame > 0 )
{
int amount = from.Fame / 10;
if ( !Core.AOS && from.ShortTermMurders >= 5 )
{
double loss = (100.0 - (4.0 + (from.ShortTermMurders / 5.0))) / 100.0; // 5 to 15% loss
Misc.Titles.AwardFame( from, -amount, true );
}
if ( loss < 0.85 )
loss = 0.85;
else if ( loss > 0.95 )
loss = 0.95;
if ( !Core.AOS && from.ShortTermMurders >= 5 )
{
double loss = (100.0 - (4.0 + (from.ShortTermMurders / 5.0))) / 100.0; // 5 to 15% loss
if ( from.RawStr * loss > 10 )
from.RawStr = (int)(from.RawStr * loss);
if ( from.RawInt * loss > 10 )
from.RawInt = (int)(from.RawInt * loss);
if ( from.RawDex * loss > 10 )
from.RawDex = (int)(from.RawDex * loss);
if ( loss < 0.85 )
loss = 0.85;
else if ( loss > 0.95 )
loss = 0.95;
for( int s = 0; s < from.Skills.Length; s++ )
{
if ( from.Skills[s].Base * loss > 35 )
from.Skills[s].Base *= loss;
}
}
if ( from.RawStr * loss > 10 )
from.RawStr = (int)(from.RawStr * loss);
if ( from.RawInt * loss > 10 )
from.RawInt = (int)(from.RawInt * loss);
if ( from.RawDex * loss > 10 )
from.RawDex = (int)(from.RawDex * loss);
if ( from.Alive && m_HitsScalar > 0 )
from.Hits = (int)(from.HitsMax * m_HitsScalar);
}
}
for( int s = 0; s < from.Skills.Length; s++ )
{
if ( from.Skills[s].Base * loss > 35 )
from.Skills[s].Base *= loss;
}
}
if ( from.Alive && m_HitsScalar > 0 )
from.Hits = (int)(from.HitsMax * m_HitsScalar);
}
}
}

View file

@ -40,14 +40,14 @@ namespace Server.Gumps
AddImageTiled(70, 55, 230, 2, 0x23C5);
if (Title.String != null)
AddHtml(70, 35, 270, 20, Title.String, false, false);
AddHtml(70, 35, 270, 20, Title.String);
else if (Title.Number != 0)
AddHtmlLocalized(70, 35, 270, 20, Title.Number, 1, false, false);
AddHtmlLocalized(70, 35, 270, 20, Title.Number, 1);
AddHtmlLocalized(50, 65, 150, 20, 1072843, 1, false, false); // Your Reward Points:
AddHtmlLocalized(50, 65, 150, 20, 1072843, 1); // Your Reward Points:
AddLabel(230, 65, 0x64, Points.ToString());
AddImageTiled(35, 85, 270, 2, 0x23C5);
AddHtmlLocalized(35, 90, 270, 20, 1072844, 1, false, false); // Please Choose a Reward:
AddHtmlLocalized(35, 90, 270, 20, 1072844, 1); // Please Choose a Reward:
AddPage(1);
@ -63,13 +63,13 @@ namespace Server.Gumps
if (offset + height > 320)
{
AddHtmlLocalized(240, 335, 60, 20, 1072854, 1, false, false); // <div align=right>Next</div>
AddHtmlLocalized(240, 335, 60, 20, 1072854, 1); // <div align=right>Next</div>
AddButton(300, 335, 0x15E1, 0x15E5, 51, GumpButtonType.Page, page + 1);
AddPage(++page);
AddButton(150, 335, 0x15E3, 0x15E7, 52, GumpButtonType.Page, page - 1);
AddHtmlLocalized(170, 335, 60, 20, 1074880, 1, false, false); // Previous
AddHtmlLocalized(170, 335, 60, 20, 1074880, 1); // Previous
offset = 110;
}
@ -78,7 +78,7 @@ namespace Server.Gumps
int half = offset + height / 2;
if (available)
AddButton(35, half - 6, 0x837, 0x838, 100 + i, GumpButtonType.Reply, 0);
AddButton(35, half - 6, 0x837, 0x838, 100 + i);
AddItem(83 - bounds.Width / 2 - bounds.X, half - bounds.Height / 2 - bounds.Y, entry.ItemID,
available ? entry.Hue : 995);
@ -91,9 +91,9 @@ namespace Server.Gumps
if (entry.Description != null)
{
if (entry.Description.String != null)
AddHtml(190, offset, 114, height, entry.Description.String, false, false);
AddHtml(190, offset, 114, height, entry.Description.String);
else if (entry.Description.Number != 0)
AddHtmlLocalized(190, offset, 114, height, entry.Description.Number, 1, false, false);
AddHtmlLocalized(190, offset, 114, height, entry.Description.Number, 1);
}
offset += height + 10;
@ -166,14 +166,14 @@ namespace Server.Gumps
if (entry.Tooltip != 0)
AddTooltip(entry.Tooltip);
AddHtmlLocalized(25, 22, 200, 20, 1074974, 0x7D00, false, false); // Confirm Selection
AddHtmlLocalized(25, 22, 200, 20, 1074974, 0x7D00); // Confirm Selection
AddImage(25, 40, 0xBBF);
AddHtmlLocalized(25, 55, 300, 120, 1074975, 0xFFFFFF, false, false); // Are you sure you wish to select this?
AddHtmlLocalized(25, 55, 300, 120, 1074975, 0xFFFFFF); // Are you sure you wish to select this?
AddRadio(25, 175, 0x25F8, 0x25FB, true, 1);
AddRadio(25, 210, 0x25F8, 0x25FB, false, 0);
AddHtmlLocalized(60, 180, 280, 20, 1074976, 0xFFFFFF, false, false); // Yes
AddHtmlLocalized(60, 215, 280, 20, 1074977, 0xFFFFFF, false, false); // No
AddButton(265, 220, 0xF7, 0xF8, 7, GumpButtonType.Reply, 0);
AddHtmlLocalized(60, 180, 280, 20, 1074976, 0xFFFFFF); // Yes
AddHtmlLocalized(60, 215, 280, 20, 1074977, 0xFFFFFF); // No
AddButton(265, 220, 0xF7, 0xF8, 7);
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -184,4 +184,4 @@ namespace Server.Gumps
sender.Mobile.SendGump(new RewardGump(m_Parent.Title, m_Parent.Rewards, m_Parent.Points, m_Parent.OnPicked));
}
}
}
}

View file

@ -88,12 +88,12 @@ namespace Server.Gumps
AddButton(xOffset, 187, gumpID, gumpID, 0, GumpButtonType.Page, 6 + i);
// Charges
AddHtmlLocalized(140, 40, 80, 18, 1011296, false, false); // Charges:
AddHtml(220, 40, 30, 18, Book.CurCharges.ToString(), false, false);
AddHtmlLocalized(140, 40, 80, 18, 1011296); // Charges:
AddHtml(220, 40, 30, 18, Book.CurCharges.ToString());
// Max charges
AddHtmlLocalized(300, 40, 100, 18, 1011297, false, false); // Max Charges:
AddHtml(400, 40, 30, 18, Book.MaxCharges.ToString(), false, false);
AddHtmlLocalized(300, 40, 100, 18, 1011297); // Max Charges:
AddHtml(400, 40, 30, 18, Book.MaxCharges.ToString());
}
private void AddIndex()
@ -102,8 +102,8 @@ namespace Server.Gumps
AddPage(1);
// Rename button
AddButton(125, 15, 2472, 2473, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(158, 22, 100, 18, 1011299, false, false); // Rename book
AddButton(125, 15, 2472, 2473, 1);
AddHtmlLocalized(158, 22, 100, 18, 1011299); // Rename book
// List of entries
List<RunebookEntry> entries = Book.Entries;
@ -125,7 +125,7 @@ namespace Server.Gumps
}
// Use charge button
AddButton(130 + i / 8 * 160, 65 + i % 8 * 15, 2103, 2104, 2 + i * 6 + 0, GumpButtonType.Reply, 0);
AddButton(130 + i / 8 * 160, 65 + i % 8 * 15, 2103, 2104, 2 + i * 6 + 0);
// Description label
AddLabelCropped(145 + i / 8 * 160, 60 + i % 8 * 15, 115, 17, hue, desc);
@ -138,7 +138,7 @@ namespace Server.Gumps
private void AddDetails(int index, int half)
{
// Use charge button
AddButton(130 + half * 160, 65, 2103, 2104, 2 + index * 6 + 0, GumpButtonType.Reply, 0);
AddButton(130 + half * 160, 65, 2103, 2104, 2 + index * 6 + 0);
string desc;
int hue;
@ -162,33 +162,33 @@ namespace Server.Gumps
}
// Drop rune button
AddButton(135 + half * 160, 115, 2437, 2438, 2 + index * 6 + 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(150 + half * 160, 115, 100, 18, 1011298, false, false); // Drop rune
AddButton(135 + half * 160, 115, 2437, 2438, 2 + index * 6 + 1);
AddHtmlLocalized(150 + half * 160, 115, 100, 18, 1011298); // Drop rune
// Set as default button
int defButtonID = e != Book.Default ? 2361 : 2360;
AddButton(160 + half * 140, 20, defButtonID, defButtonID, 2 + index * 6 + 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(175 + half * 140, 15, 100, 18, 1011300, false, false); // Set default
AddButton(160 + half * 140, 20, defButtonID, defButtonID, 2 + index * 6 + 2);
AddHtmlLocalized(175 + half * 140, 15, 100, 18, 1011300); // Set default
if (Core.AOS)
{
AddButton(135 + half * 160, 140, 2103, 2104, 2 + index * 6 + 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(150 + half * 160, 136, 110, 20, 1062722, false, false); // Recall
AddButton(135 + half * 160, 140, 2103, 2104, 2 + index * 6 + 3);
AddHtmlLocalized(150 + half * 160, 136, 110, 20, 1062722); // Recall
AddButton(135 + half * 160, 158, 2103, 2104, 2 + index * 6 + 4, GumpButtonType.Reply, 0);
AddHtmlLocalized(150 + half * 160, 154, 110, 20, 1062723, false, false); // Gate Travel
AddButton(135 + half * 160, 158, 2103, 2104, 2 + index * 6 + 4);
AddHtmlLocalized(150 + half * 160, 154, 110, 20, 1062723); // Gate Travel
AddButton(135 + half * 160, 176, 2103, 2104, 2 + index * 6 + 5, GumpButtonType.Reply, 0);
AddHtmlLocalized(150 + half * 160, 172, 110, 20, 1062724, false, false); // Sacred Journey
AddButton(135 + half * 160, 176, 2103, 2104, 2 + index * 6 + 5);
AddHtmlLocalized(150 + half * 160, 172, 110, 20, 1062724); // Sacred Journey
}
else
{
// Recall button
AddButton(135 + half * 160, 140, 2271, 2271, 2 + index * 6 + 3, GumpButtonType.Reply, 0);
AddButton(135 + half * 160, 140, 2271, 2271, 2 + index * 6 + 3);
// Gate button
AddButton(205 + half * 160, 140, 2291, 2291, 2 + index * 6 + 4, GumpButtonType.Reply, 0);
AddButton(205 + half * 160, 140, 2291, 2291, 2 + index * 6 + 4);
}
}
else
@ -203,9 +203,7 @@ namespace Server.Gumps
public static bool HasSpell(Mobile from, int spellID)
{
Spellbook book = Spellbook.Find(from, spellID);
return book != null && book.HasSpell(spellID);
return Spellbook.Find(from, spellID)?.HasSpell(spellID) == true;
}
public override void OnResponse(NetState state, RelayInfo info)
@ -271,7 +269,7 @@ namespace Server.Gumps
}
Book.OnTravel();
new RecallSpell(from, Book, e, Book).Cast();
new RecallSpell(from, e, Book, Book).Cast();
Book.Openers.Remove(from);
}
@ -329,7 +327,7 @@ namespace Server.Gumps
}
Book.OnTravel();
new RecallSpell(from, null, e).Cast();
new RecallSpell(from, e).Cast();
}
else
{
@ -357,7 +355,7 @@ namespace Server.Gumps
}
Book.OnTravel();
new GateTravelSpell(from, null, e).Cast();
new GateTravelSpell(from, e).Cast();
}
else
{
@ -387,7 +385,7 @@ namespace Server.Gumps
}
Book.OnTravel();
new SacredJourneySpell(from, null, e).Cast();
new SacredJourneySpell(from, e).Cast();
}
else
{
@ -451,4 +449,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -29,31 +29,31 @@ namespace Server.Gumps
AddAlphaRegion(10, 10, 200, 140);
AddHtmlLocalized(10, 10, 200, 20, 1061276, 32767, false, false); // <CENTER>SET ACCESS</CENTER>
AddHtmlLocalized(10, 40, 100, 20, 1041474, 32767, false, false); // Owner:
AddHtmlLocalized(10, 10, 200, 20, 1061276, 32767); // <CENTER>SET ACCESS</CENTER>
AddHtmlLocalized(10, 40, 100, 20, 1041474, 32767); // Owner:
AddLabel(110, 40, 1152, owner == null ? "" : owner.Name);
AddButton(10, 70, GetFirstID(SecureLevel.Owner), 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 70, 150, 20, 1061277, GetColor(SecureLevel.Owner), false, false); // Owner Only
AddButton(10, 70, GetFirstID(SecureLevel.Owner), 4007, 1);
AddHtmlLocalized(45, 70, 150, 20, 1061277, GetColor(SecureLevel.Owner)); // Owner Only
AddButton(10, 90, GetFirstID(SecureLevel.CoOwners), 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 90, 150, 20, 1061278, GetColor(SecureLevel.CoOwners), false, false); // Co-Owners
AddButton(10, 90, GetFirstID(SecureLevel.CoOwners), 4007, 2);
AddHtmlLocalized(45, 90, 150, 20, 1061278, GetColor(SecureLevel.CoOwners)); // Co-Owners
AddButton(10, 110, GetFirstID(SecureLevel.Friends), 4007, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 110, 150, 20, 1061279, GetColor(SecureLevel.Friends), false, false); // Friends
AddButton(10, 110, GetFirstID(SecureLevel.Friends), 4007, 3);
AddHtmlLocalized(45, 110, 150, 20, 1061279, GetColor(SecureLevel.Friends)); // Friends
Mobile houseOwner = house.Owner;
if (Guild.NewGuildSystem && houseOwner?.Guild != null &&
((Guild)houseOwner.Guild).Leader == houseOwner
) //Only the actual House owner AND guild master can set guild secures
{
AddButton(10, 130, GetFirstID(SecureLevel.Guild), 4007, 5, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 130, 150, 20, 1063455, GetColor(SecureLevel.Guild), false, false); // Guild Members
AddButton(10, 130, GetFirstID(SecureLevel.Guild), 4007, 5);
AddHtmlLocalized(45, 130, 150, 20, 1063455, GetColor(SecureLevel.Guild)); // Guild Members
}
AddButton(10, 130 + offset, GetFirstID(SecureLevel.Anyone), 4007, 4, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 130 + offset, 150, 20, 1061626, GetColor(SecureLevel.Anyone), false, false); // Anyone
AddButton(10, 130 + offset, GetFirstID(SecureLevel.Anyone), 4007, 4);
AddHtmlLocalized(45, 130 + offset, 150, 20, 1061626, GetColor(SecureLevel.Anyone)); // Anyone
}
public int GetColor(SecureLevel level)
@ -100,4 +100,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -91,7 +91,7 @@ namespace Server.Gumps
if (SetGumpID != 0)
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1, GumpButtonType.Reply, 0);
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1);
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -166,7 +166,7 @@ namespace Server.Gumps
private static bool PrevLabel = OldStyle, NextLabel = OldStyle;
private static readonly int PrevLabelOffsetX = PrevWidth + 1;
private static readonly int PrevLabelOffsetY = 0;
private static readonly int NextLabelOffsetX = -29;
@ -196,11 +196,7 @@ namespace Server.Gumps
private SkillsGumpGroup m_Selected;
private Mobile m_Target;
public SkillsGump(Mobile from, Mobile target) : this(from, target, null)
{
}
public SkillsGump(Mobile from, Mobile target, SkillsGumpGroup selected) : base(GumpOffsetX, GumpOffsetY)
public SkillsGump(Mobile from, Mobile target, SkillsGumpGroup selected = null) : base(GumpOffsetX, GumpOffsetY)
{
m_From = from;
m_Target = target;
@ -252,9 +248,9 @@ namespace Server.Gumps
AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID);
if (group == selected)
AddButton(x + PrevOffsetX, y + PrevOffsetY, 0x15E2, 0x15E6, GetButtonID(0, i), GumpButtonType.Reply, 0);
AddButton(x + PrevOffsetX, y + PrevOffsetY, 0x15E2, 0x15E6, GetButtonID(0, i));
else
AddButton(x + PrevOffsetX, y + PrevOffsetY, 0x15E1, 0x15E5, GetButtonID(0, i), GumpButtonType.Reply, 0);
AddButton(x + PrevOffsetX, y + PrevOffsetY, 0x15E1, 0x15E5, GetButtonID(0, i));
x += PrevWidth + OffsetSize;
@ -286,8 +282,7 @@ namespace Server.Gumps
AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID);
AddButton(x + PrevOffsetX, y + PrevOffsetY, 0x15E1, 0x15E5, GetButtonID(1, j), GumpButtonType.Reply,
0);
AddButton(x + PrevOffsetX, y + PrevOffsetY, 0x15E1, 0x15E5, GetButtonID(1, j));
x += PrevWidth + OffsetSize;
@ -331,8 +326,7 @@ namespace Server.Gumps
break;
}
AddButton(x + xOffset, y + yOffset, buttonID1, buttonID2, GetButtonID(2, j),
GumpButtonType.Reply, 0);
AddButton(x + xOffset, y + yOffset, buttonID1, buttonID2, GetButtonID(2, j));
y += 1;
x -= OffsetSize;
@ -378,7 +372,7 @@ namespace Server.Gumps
if (m_Selected != newSelection)
m_From.SendGump(new SkillsGump(m_From, m_Target, newSelection));
else
m_From.SendGump(new SkillsGump(m_From, m_Target, null));
m_From.SendGump(new SkillsGump(m_From, m_Target));
}
break;
@ -562,4 +556,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -24,8 +24,7 @@ namespace Server.Gumps
AddImage(30, 30, 102);
AddHtmlLocalized(95, 100, 120, 100, 1060198, 0, false,
false); // May your wealth bring blessings to those in need, if tithed upon this most sacred site.
AddHtmlLocalized(95, 100, 120, 100, 1060198, 0); // May your wealth bring blessings to those in need, if tithed upon this most sacred site.
AddLabel(57, 274, 0, "Gold:");
AddLabel(87, 274, 53, (totalGold - offer).ToString());
@ -33,23 +32,23 @@ namespace Server.Gumps
AddLabel(137, 274, 0, "Tithe:");
AddLabel(172, 274, 53, offer.ToString());
AddButton(105, 230, 5220, 5220, 2, GumpButtonType.Reply, 0);
AddButton(113, 230, 5222, 5222, 2, GumpButtonType.Reply, 0);
AddButton(105, 230, 5220, 5220, 2);
AddButton(113, 230, 5222, 5222, 2);
AddLabel(108, 228, 0, "<");
AddLabel(112, 228, 0, "<");
AddButton(127, 230, 5223, 5223, 1, GumpButtonType.Reply, 0);
AddButton(127, 230, 5223, 5223, 1);
AddLabel(131, 228, 0, "<");
AddButton(147, 230, 5224, 5224, 3, GumpButtonType.Reply, 0);
AddButton(147, 230, 5224, 5224, 3);
AddLabel(153, 228, 0, ">");
AddButton(168, 230, 5220, 5220, 4, GumpButtonType.Reply, 0);
AddButton(176, 230, 5222, 5222, 4, GumpButtonType.Reply, 0);
AddButton(168, 230, 5220, 5220, 4);
AddButton(176, 230, 5222, 5222, 4);
AddLabel(172, 228, 0, ">");
AddLabel(176, 228, 0, ">");
AddButton(217, 272, 4023, 4024, 5, GumpButtonType.Reply, 0);
AddButton(217, 272, 4023, 4024, 5);
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -109,7 +108,7 @@ namespace Server.Gumps
Container pack = m_From.Backpack;
if (pack != null && pack.ConsumeTotal(typeof(Gold), m_Offer))
if (pack?.ConsumeTotal(typeof(Gold), m_Offer) == true)
{
// You tithe gold to the shrine as a sign of devotion.
m_From.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1060195);
@ -129,4 +128,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -60,7 +60,7 @@ namespace Server.Gumps
public void SetupToTEras()
{
bool isActivated = TreasuresOfTokuno.DropEra != TreasuresOfTokunoEra.None;
AddButton(75, 50, isActivated ? 2361 : 2360, isActivated ? 2361 : 2360, 1, GumpButtonType.Reply, 0);
AddButton(75, 50, isActivated ? 2361 : 2360, isActivated ? 2361 : 2360, 1);
AddLabel(90, 45, isActivated ? 167 : 137, isActivated ? "Activated" : "Deactivated");
for (int i = 0; i < m_ToTEras; i++)
@ -73,9 +73,9 @@ namespace Server.Gumps
int rewardButtonID = isThisRewardEra ? 2361 : 2360;
AddLabel(10, 70 + yoffset, 2100, "ToT " + (i + 1));
AddButton(75, 75 + yoffset, dropButtonID, dropButtonID, 2 + i * 2, GumpButtonType.Reply, 0);
AddButton(75, 75 + yoffset, dropButtonID, dropButtonID, 2 + i * 2);
AddLabel(90, 70 + yoffset, isThisDropEra ? 167 : 137, isThisDropEra ? "Active" : "Inactive");
AddButton(180, 75 + yoffset, rewardButtonID, rewardButtonID, 2 + i * 2 + 1, GumpButtonType.Reply, 0);
AddButton(180, 75 + yoffset, rewardButtonID, rewardButtonID, 2 + i * 2 + 1);
AddLabel(195, 70 + yoffset, isThisRewardEra ? 167 : 137, isThisRewardEra ? "Active" : "Inactive");
AddButton(285, 70 + yoffset, 4005, 4006, i, GumpButtonType.Page, 2 + i);
@ -132,4 +132,4 @@ namespace Server.Gumps
e.Mobile.SendGump(tg);
}
}
}
}

View file

@ -20,8 +20,8 @@ namespace Server.Gumps
AddBackground(0, 0, 420, 50 + 20 * m_Inventories.Count, 0x13BE);
AddImageTiled(10, 10, 400, 20, 0xA40);
AddHtmlLocalized(15, 10, 200, 20, 1062435, 0x7FFF, false, false); // Reclaim Vendor Inventory
AddHtmlLocalized(330, 10, 50, 20, 1062465, 0x7FFF, false, false); // Expires
AddHtmlLocalized(15, 10, 200, 20, 1062435, 0x7FFF); // Reclaim Vendor Inventory
AddHtmlLocalized(330, 10, 50, 20, 1062465, 0x7FFF); // Expires
AddImageTiled(10, 40, 400, 20 * m_Inventories.Count, 0xA40);
@ -32,7 +32,7 @@ namespace Server.Gumps
int y = 40 + 20 * i;
if (inventory.Owner == from)
AddButton(10, y, 0xFA5, 0xFA7, i + 1, GumpButtonType.Reply, 0);
AddButton(10, y, 0xFA5, 0xFA7, i + 1);
AddLabel(45, y, 0x481, $"{inventory.ShopName} ({inventory.VendorName})");
@ -40,7 +40,7 @@ namespace Server.Gumps
int hours = (int)expire.TotalHours;
AddLabel(320, y, 0x481, hours.ToString());
AddHtmlLocalized(350, y, 50, 20, 1062466, 0x7FFF, false, false); // hour(s)
AddHtmlLocalized(350, y, 50, 20, 1062466, 0x7FFF); // hour(s)
}
}
@ -52,7 +52,7 @@ namespace Server.Gumps
Mobile from = sender.Mobile;
HouseSign sign = m_House.Sign;
if (m_House.Deleted || sign == null || sign.Deleted || !from.CheckAlive())
if (m_House.Deleted || sign?.Deleted != false || !from.CheckAlive())
return;
if (from.Map != sign.Map || !from.InRange(sign, 5))
@ -122,4 +122,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -37,7 +37,7 @@ namespace Server.Gumps
AddImageTiled( 70, 55, 230, 2, 0x23C5 );
AddImage( 32, 33, 0x2635 );
AddHtmlLocalized( 70, 35, 270, 20, 1062353, 0x1, false, false ); // Vendor Rental Contract
AddHtmlLocalized( 70, 35, 270, 20, 1062353, 0x1 ); // Vendor Rental Contract
AddPage( 1 );
@ -45,7 +45,7 @@ namespace Server.Gumps
if ( type != GumpType.UnlockedContract )
{
AddImage( 65, 60, 0x827 );
AddHtmlLocalized( 79, 58, 270, 20, 1062370, 0x1, false, false ); // Landlord:
AddHtmlLocalized( 79, 58, 270, 20, 1062370, 0x1 ); // Landlord:
AddLabel( 150, 58, 0x64, landlord != null ? landlord.Name : "" );
AddImageTiled( 70, 80, 230, 2, 0x23C5 );
@ -53,48 +53,48 @@ namespace Server.Gumps
if ( type == GumpType.UnlockedContract || type == GumpType.LockedContract )
AddButton( 30, 96, 0x15E1, 0x15E5, 0, GumpButtonType.Page, 2 );
AddHtmlLocalized( 50, 95, 150, 20, 1062354, 0x1, false, false ); // Contract Length
AddHtmlLocalized( 230, 95, 270, 20, duration.Name, 0x1, false, false );
AddHtmlLocalized( 50, 95, 150, 20, 1062354, 0x1 ); // Contract Length
AddHtmlLocalized( 230, 95, 270, 20, duration.Name, 0x1 );
if ( type == GumpType.UnlockedContract || type == GumpType.LockedContract )
AddButton( 30, 116, 0x15E1, 0x15E5, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 50, 115, 150, 20, 1062356, 0x1, false, false ); // Price Per Rental
AddButton( 30, 116, 0x15E1, 0x15E5, 1);
AddHtmlLocalized( 50, 115, 150, 20, 1062356, 0x1 ); // Price Per Rental
AddLabel( 230, 115, 0x64, price > 0 ? price.ToString() : "FREE" );
AddImageTiled( 50, 160, 250, 2, 0x23BF );
if ( type == GumpType.Offer )
{
AddButton( 67, 180, 0x482, 0x483, 2, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 100, 180, 270, 20, 1049011, 0x28, false, false ); // I accept!
AddButton( 67, 180, 0x482, 0x483, 2);
AddHtmlLocalized( 100, 180, 270, 20, 1049011, 0x28 ); // I accept!
AddButton( 67, 210, 0x47F, 0x480, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 100, 210, 270, 20, 1049012, 0x28, false, false ); // No thanks, I decline.
AddButton( 67, 210, 0x47F, 0x480, 0);
AddHtmlLocalized( 100, 210, 270, 20, 1049012, 0x28 ); // No thanks, I decline.
}
else
{
AddImage( 49, 170, 0x61 );
AddHtmlLocalized( 60, 170, 250, 20, 1062355, 0x1, false, false ); // Renew On Expiration?
AddHtmlLocalized( 60, 170, 250, 20, 1062355, 0x1 ); // Renew On Expiration?
if ( type == GumpType.LockedContract || type == GumpType.UnlockedContract || type == GumpType.VendorLandlord )
AddButton( 30, 192, 0x15E1, 0x15E5, 3, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 85, 190, 250, 20, 1062359, 0x1, false, false ); // Landlord:
AddHtmlLocalized( 230, 190, 270, 20, landlordRenew ? 1049717 : 1049718, 0x1, false, false ); // YES / NO
AddButton( 30, 192, 0x15E1, 0x15E5, 3);
AddHtmlLocalized( 85, 190, 250, 20, 1062359, 0x1 ); // Landlord:
AddHtmlLocalized( 230, 190, 270, 20, landlordRenew ? 1049717 : 1049718, 0x1 ); // YES / NO
if ( type == GumpType.VendorRenter )
AddButton( 30, 212, 0x15E1, 0x15E5, 4, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 85, 210, 250, 20, 1062360, 0x1, false, false ); // Renter:
AddHtmlLocalized( 230, 210, 270, 20, renterRenew ? 1049717 : 1049718, 0x1, false, false ); // YES / NO
AddButton( 30, 212, 0x15E1, 0x15E5, 4);
AddHtmlLocalized( 85, 210, 250, 20, 1062360, 0x1 ); // Renter:
AddHtmlLocalized( 230, 210, 270, 20, renterRenew ? 1049717 : 1049718, 0x1 ); // YES / NO
if ( renew )
{
AddImage( 49, 233, 0x939 );
AddHtmlLocalized( 70, 230, 250, 20, 1062482, 0x1, false, false ); // Contract WILL renew
AddHtmlLocalized( 70, 230, 250, 20, 1062482, 0x1 ); // Contract WILL renew
}
else
{
AddImage( 49, 233, 0x938 );
AddHtmlLocalized( 70, 230, 250, 20, 1062483, 0x1, false, false ); // Contract WILL NOT renew
AddHtmlLocalized( 70, 230, 250, 20, 1062483, 0x1 ); // Contract WILL NOT renew
}
}
@ -104,17 +104,17 @@ namespace Server.Gumps
if ( type == GumpType.LockedContract )
{
AddButton( 67, 295, 0x15E1, 0x15E5, 5, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 85, 294, 270, 20, 1062358, 0x28, false, false ); // Offer Contract To Someone
AddButton( 67, 295, 0x15E1, 0x15E5, 5);
AddHtmlLocalized( 85, 294, 270, 20, 1062358, 0x28 ); // Offer Contract To Someone
}
else if ( type == GumpType.VendorLandlord || type == GumpType.VendorRenter )
{
if ( type == GumpType.VendorLandlord )
AddButton( 30, 250, 0x15E1, 0x15E1, 6, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 85, 250, 250, 20, 1062499, 0x1, false, false ); // Renewal Price
AddButton( 30, 250, 0x15E1, 0x15E1, 6);
AddHtmlLocalized( 85, 250, 250, 20, 1062499, 0x1 ); // Renewal Price
AddLabel( 230, 250, 0x64, renewalPrice.ToString() );
AddHtmlLocalized( 60, 294, 270, 20, 1062369, 0x1, false, false ); // Renter:
AddHtmlLocalized( 60, 294, 270, 20, 1062369, 0x1 ); // Renter:
AddLabel( 120, 293, 0x64, renter != null ? renter.Name : "" );
}
@ -128,7 +128,7 @@ namespace Server.Gumps
VendorRentalDuration durationItem = VendorRentalDuration.Instances[i];
AddButton( 30, 76 + i * 20, 0x15E1, 0x15E5, 0x10 | i, GumpButtonType.Reply, 1 );
AddHtmlLocalized( 50, 75 + i * 20, 150, 20, durationItem.Name, 0x1, false, false );
AddHtmlLocalized( 50, 75 + i * 20, 150, 20, durationItem.Name, 0x1 );
}
}
}
@ -280,10 +280,8 @@ namespace Server.Gumps
text = text.Trim();
int price;
if ( !int.TryParse( text, out price ) )
price = -1;
if ( !int.TryParse( text, out int price ) )
price = -1;
if ( price < 0 )
{
@ -500,10 +498,8 @@ namespace Server.Gumps
text = text.Trim();
int price;
if ( !int.TryParse( text, out price ) )
price = -1;
if ( !int.TryParse( text, out int price ) )
price = -1;
if ( price < 0 )
{
@ -558,20 +554,20 @@ namespace Server.Gumps
*/
AddHtmlLocalized( 10, 10, 400, 150, 1062501, 0x7FFF, false, true );
AddHtmlLocalized( 10, 180, 150, 20, 1062508, 0x7FFF, false, false ); // Vendor Name:
AddHtmlLocalized( 10, 180, 150, 20, 1062508, 0x7FFF ); // Vendor Name:
AddLabel( 160, 180, 0x480, vendor.Name );
AddHtmlLocalized( 10, 200, 150, 20, 1062509, 0x7FFF, false, false ); // Shop Name:
AddHtmlLocalized( 10, 200, 150, 20, 1062509, 0x7FFF ); // Shop Name:
AddLabel( 160, 200, 0x480, vendor.ShopName );
AddHtmlLocalized( 10, 220, 150, 20, 1062510, 0x7FFF, false, false ); // Refund Amount:
AddHtmlLocalized( 10, 220, 150, 20, 1062510, 0x7FFF ); // Refund Amount:
AddLabel( 160, 220, 0x480, refundAmount.ToString() );
AddButton( 10, 268, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 268, 350, 20, 1062511, 0x7FFF, false, false ); // Agree, and <strong>dismiss vendor</strong>
AddButton( 10, 268, 0xFA5, 0xFA7, 1);
AddHtmlLocalized( 45, 268, 350, 20, 1062511, 0x7FFF ); // Agree, and <strong>dismiss vendor</strong>
AddButton( 10, 288, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 288, 350, 20, 1062512, 0x7FFF, false, false ); // No, I want to <strong>keep my vendor</strong>
AddButton( 10, 288, 0xFA5, 0xFA7, 0);
AddHtmlLocalized( 45, 288, 350, 20, 1062512, 0x7FFF ); // No, I want to <strong>keep my vendor</strong>
}
public override void OnResponse( NetState sender, RelayInfo info )

View file

@ -30,14 +30,14 @@ namespace Server.Gumps
AddBackground(0, 0, 240, 360, 5054);
AddBlackAlpha(10, 10, 220, 340);
if (sel == null || sel.Deleted)
if (sel?.Deleted != false)
{
m_Selection = null;
AddHtml(35, 15, 120, 20, Color("House Type", White), false, false);
AddHtml(35, 15, 120, 20, Color("House Type", White));
if (list.Count == 0)
AddHtml(35, 40, 160, 40, Color("There were no houses found for that player.", White), false, false);
AddHtml(35, 40, 160, 40, Color("There were no houses found for that player.", White));
AddImage(190, 17, 0x25EA);
AddImage(207, 17, 0x25E6);
@ -59,14 +59,14 @@ namespace Server.Gumps
object name = FindHouseName(list[i]);
AddHtml(15, 40 + i % 15 * 20, 20, 20, Color($"{i + 1}.", White), false, false);
AddHtml(15, 40 + i % 15 * 20, 20, 20, Color($"{i + 1}.", White));
if (name is int nameInt)
AddHtmlLocalized(35, 40 + i % 15 * 20, 160, 20, nameInt, White16, false, false);
AddHtmlLocalized(35, 40 + i % 15 * 20, 160, 20, nameInt, White16);
else
AddHtml(35, 40 + i % 15 * 20, 160, 20, Color(name.ToString(), White), false, false);
AddHtml(35, 40 + i % 15 * 20, 160, 20, Color(name.ToString(), White));
AddButton(198, 39 + i % 15 * 20, 4005, 4007, i + 1, GumpButtonType.Reply, 0);
AddButton(198, 39 + i % 15 * 20, 4005, 4007, i + 1);
}
}
else
@ -88,49 +88,49 @@ namespace Server.Gumps
else
location = "unknown";
AddHtml(10, 15, 220, 20, Color(Center("House Properties"), White), false, false);
AddHtml(10, 15, 220, 20, Color(Center("House Properties"), White));
AddHtml(15, 40, 210, 20, Color("Facet:", White), false, false);
AddHtml(15, 40, 210, 20, Color(Right(map == null ? "(null)" : map.Name), White), false, false);
AddHtml(15, 40, 210, 20, Color("Facet:", White));
AddHtml(15, 40, 210, 20, Color(Right(map == null ? "(null)" : map.Name), White));
AddHtml(15, 60, 210, 20, Color("Location:", White), false, false);
AddHtml(15, 60, 210, 20, Color(Right(sel.Location.ToString()), White), false, false);
AddHtml(15, 60, 210, 20, Color("Location:", White));
AddHtml(15, 60, 210, 20, Color(Right(sel.Location.ToString()), White));
AddHtml(15, 80, 210, 20, Color("Sextant:", White), false, false);
AddHtml(15, 80, 210, 20, Color(Right(location), White), false, false);
AddHtml(15, 80, 210, 20, Color("Sextant:", White));
AddHtml(15, 80, 210, 20, Color(Right(location), White));
AddHtml(15, 100, 210, 20, Color("Owner:", White), false, false);
AddHtml(15, 100, 210, 20, Color(Right(owner), White), false, false);
AddHtml(15, 100, 210, 20, Color("Owner:", White));
AddHtml(15, 100, 210, 20, Color(Right(owner), White));
AddHtml(15, 120, 210, 20, Color("Name:", White), false, false);
AddHtml(15, 120, 210, 20, Color(Right(houseName), White), false, false);
AddHtml(15, 120, 210, 20, Color("Name:", White));
AddHtml(15, 120, 210, 20, Color(Right(houseName), White));
AddHtml(15, 140, 210, 20, Color("Friends:", White), false, false);
AddHtml(15, 140, 210, 20, Color(Right(sel.Friends.Count.ToString()), White), false, false);
AddHtml(15, 140, 210, 20, Color("Friends:", White));
AddHtml(15, 140, 210, 20, Color(Right(sel.Friends.Count.ToString()), White));
AddHtml(15, 160, 210, 20, Color("Co-Owners:", White), false, false);
AddHtml(15, 160, 210, 20, Color(Right(sel.CoOwners.Count.ToString()), White), false, false);
AddHtml(15, 160, 210, 20, Color("Co-Owners:", White));
AddHtml(15, 160, 210, 20, Color(Right(sel.CoOwners.Count.ToString()), White));
AddHtml(15, 180, 210, 20, Color("Bans:", White), false, false);
AddHtml(15, 180, 210, 20, Color(Right(sel.Bans.Count.ToString()), White), false, false);
AddHtml(15, 180, 210, 20, Color("Bans:", White));
AddHtml(15, 180, 210, 20, Color(Right(sel.Bans.Count.ToString()), White));
AddHtml(15, 200, 210, 20, Color("Decays:", White), false, false);
AddHtml(15, 200, 210, 20, Color(Right(sel.CanDecay ? "Yes" : "No"), White), false, false);
AddHtml(15, 200, 210, 20, Color("Decays:", White));
AddHtml(15, 200, 210, 20, Color(Right(sel.CanDecay ? "Yes" : "No"), White));
AddHtml(15, 220, 210, 20, Color("Decay Level:", White), false, false);
AddHtml(15, 220, 210, 20, Color(Right(sel.DecayLevel.ToString()), White), false, false);
AddHtml(15, 220, 210, 20, Color("Decay Level:", White));
AddHtml(15, 220, 210, 20, Color(Right(sel.DecayLevel.ToString()), White));
AddButton(15, 245, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtml(50, 245, 120, 20, Color("Go to house", White), false, false);
AddButton(15, 245, 4005, 4007, 1);
AddHtml(50, 245, 120, 20, Color("Go to house", White));
AddButton(15, 265, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtml(50, 265, 120, 20, Color("Open house menu", White), false, false);
AddButton(15, 265, 4005, 4007, 2);
AddHtml(50, 265, 120, 20, Color("Open house menu", White));
AddButton(15, 285, 4005, 4007, 3, GumpButtonType.Reply, 0);
AddHtml(50, 285, 120, 20, Color("Demolish house", White), false, false);
AddButton(15, 285, 4005, 4007, 3);
AddHtml(50, 285, 120, 20, Color("Demolish house", White));
AddButton(15, 305, 4005, 4007, 4, GumpButtonType.Reply, 0);
AddHtml(50, 305, 120, 20, Color("Refresh house", White), false, false);
AddButton(15, 305, 4005, 4007, 4);
AddHtml(50, 305, 120, 20, Color("Refresh house", White));
}
}
@ -208,7 +208,7 @@ namespace Server.Gumps
HouseSign sign = m_Selection.Sign;
if (sign != null && !sign.Deleted)
if (sign?.Deleted == false)
sign.OnDoubleClick(m_From);
break;

View file

@ -18,7 +18,7 @@ namespace Server.Gumps
AddImageTiled( 10, 10, width - 20, 20, 2624 );
AddAlphaRegion( 10, 10, width - 20, 20 );
AddHtmlLocalized( 10, 10, width - 20, 20, header, headerColor, false, false );
AddHtmlLocalized( 10, 10, width - 20, 20, header, headerColor );
AddImageTiled( 10, 40, width - 20, height - 80, 2624 );
AddAlphaRegion( 10, 40, width - 20, height - 80 );
@ -31,13 +31,13 @@ namespace Server.Gumps
AddImageTiled( 10, height - 30, width - 20, 20, 2624 );
AddAlphaRegion( 10, height - 30, width - 20, 20 );
AddButton( 10, height - 30, 4005, 4007, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 40, height - 30, 170, 20, 1011036, 32767, false, false ); // OKAY
AddButton( 10, height - 30, 4005, 4007, 1 );
AddHtmlLocalized( 40, height - 30, 170, 20, 1011036, 32767 ); // OKAY
if ( cancelButton )
{
AddButton( 10 + ((width - 20) / 2), height - 30, 4005, 4007, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 40 + ((width - 20) / 2), height - 30, 170, 20, 1011012, 32767, false, false ); // CANCEL
AddButton( 10 + ((width - 20) / 2), height - 30, 4005, 4007, 0 );
AddHtmlLocalized( 40 + ((width - 20) / 2), height - 30, 170, 20, 1011012, 32767 ); // CANCEL
}
}

View file

@ -98,11 +98,11 @@ namespace Server.Gumps
}
}
public WhoGump( Mobile owner, string filter ) : this( owner, BuildList( owner, filter ), 0 )
public WhoGump(Mobile owner, string filter) : this(owner, BuildList( owner, filter ))
{
}
public WhoGump( Mobile owner, List<Mobile> list, int page ) : base( GumpOffsetX, GumpOffsetY )
public WhoGump(Mobile owner, List<Mobile> list, int page = 0) : base(GumpOffsetX, GumpOffsetY)
{
owner.CloseGump<WhoGump>();
@ -112,12 +112,9 @@ namespace Server.Gumps
Initialize( page );
}
public static List<Mobile> BuildList( Mobile owner, string filter )
public static List<Mobile> BuildList(Mobile owner, string rawFilter)
{
if ( filter != null && (filter = filter.Trim()).Length == 0 )
filter = null;
else
filter = filter.ToLower();
string filter = String.IsNullOrWhiteSpace(rawFilter) ? null : rawFilter.Trim().ToLower();
List<Mobile> list = new List<Mobile>();
List<NetState> states = NetState.Instances;
@ -126,9 +123,9 @@ namespace Server.Gumps
{
Mobile m = states[i].Mobile;
if ( m != null && (m == owner || !m.Hidden || owner.AccessLevel >= m.AccessLevel || (m is PlayerMobile mobile && mobile.VisibilityList.Contains( owner ) ) ) )
if ( m != null && (m == owner || !m.Hidden || owner.AccessLevel >= m.AccessLevel || m is PlayerMobile mobile && mobile.VisibilityList.Contains( owner ) ) )
{
if ( filter != null && ( m.Name == null || m.Name.ToLower().IndexOf( filter ) < 0 ) )
if ( filter != null && !(m.Name?.ToLower().IndexOf(filter) >= 0) )
continue;
list.Add( m );
@ -144,14 +141,14 @@ namespace Server.Gumps
{
m_Page = page;
int count = m_Mobiles.Count - (page * EntryCount);
int count = m_Mobiles.Count - page * EntryCount;
if ( count < 0 )
count = 0;
else if ( count > EntryCount )
count = EntryCount;
int totalHeight = OffsetSize + ((EntryHeight + OffsetSize) * (count + 1));
int totalHeight = OffsetSize + (EntryHeight + OffsetSize) * (count + 1);
AddPage( 0 );
@ -178,7 +175,7 @@ namespace Server.Gumps
if ( page > 0 )
{
AddButton( x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1, GumpButtonType.Reply, 0 );
AddButton( x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1 );
if ( PrevLabel )
AddLabel( x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous" );
@ -213,7 +210,7 @@ namespace Server.Gumps
AddImageTiled( x, y, SetWidth, EntryHeight, SetGumpID );
if ( m.NetState != null && !m.Deleted )
AddButton( x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, i + 3, GumpButtonType.Reply, 0 );
AddButton( x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, i + 3 );
}
}
@ -227,14 +224,9 @@ namespace Server.Gumps
case AccessLevel.Seer: return 0x144;
case AccessLevel.GameMaster: return 0x21;
case AccessLevel.Counselor: return 0x2;
case AccessLevel.Player: default:
default:
{
if ( m.Kills >= 5 )
return 0x21;
if ( m.Criminal )
return 0x3B1;
return 0x58;
return m.Kills >= 5 ? 0x21 : m.Criminal ? 0x3B1 : 0x58;
}
}
}
@ -265,7 +257,7 @@ namespace Server.Gumps
}
default:
{
int index = (m_Page * EntryCount) + (info.ButtonID - 3);
int index = m_Page * EntryCount + (info.ButtonID - 3);
if ( index >= 0 && index < m_Mobiles.Count )
{
@ -281,7 +273,7 @@ namespace Server.Gumps
from.SendMessage( "That player is no longer online." );
from.SendGump( new WhoGump( from, m_Mobiles, m_Page ) );
}
else if ( m == from || !m.Hidden || from.AccessLevel >= m.AccessLevel || (m is PlayerMobile mobile && mobile.VisibilityList.Contains( from )))
else if ( m == from || !m.Hidden || from.AccessLevel >= m.AccessLevel || m is PlayerMobile mobile && mobile.VisibilityList.Contains( from ))
{
from.SendGump( new ClientGump( from, m.NetState ) );
}

View file

@ -11,8 +11,8 @@ namespace Server.Gumps
AddHtmlLocalized( 20, 43, 215, 70, 1018030, true, true ); // Warning: monsters may attack you on site down here in the dungeons!
AddButton( 70, 123, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 105, 125, 100, 35, 1011036, false, false ); // OKAY
AddButton( 70, 123, 0xFA5, 0xFA7, 0);
AddHtmlLocalized( 105, 125, 100, 35, 1011036 ); // OKAY
}
}
@ -27,22 +27,22 @@ namespace Server.Gumps
AddImageTiled( 33, 20, 407, 425, 0xA40 );
AddAlphaRegion( 33, 20, 407, 425 );
AddHtmlLocalized( 190, 24, 120, 20, 1046287, 0x7D00, false, false ); // You have died.
AddHtmlLocalized( 190, 24, 120, 20, 1046287, 0x7D00 ); // You have died.
// As a ghost you cannot interact with the world. You cannot touch items nor can you use them.
AddHtmlLocalized( 50, 50, 380, 40, 1046288, 0xFFFFFF, false, false );
AddHtmlLocalized( 50, 50, 380, 40, 1046288, 0xFFFFFF );
// You can pass through doors as though they do not exist. However, you cannot pass through walls.
AddHtmlLocalized( 50, 100, 380, 45, 1046289, 0xFFFFFF, false, false );
AddHtmlLocalized( 50, 100, 380, 45, 1046289, 0xFFFFFF );
// Since you are a new player, any items you had on your person at the time of your death will be in your backpack upon resurrection.
AddHtmlLocalized( 50, 140, 380, 60, 1046291, 0xFFFFFF, false, false );
AddHtmlLocalized( 50, 140, 380, 60, 1046291, 0xFFFFFF );
// To be resurrected you must find a healer in town or wandering in the wilderness. Some powerful players may also be able to resurrect you.
AddHtmlLocalized( 50, 204, 380, 65, 1046292, 0xFFFFFF, false, false );
AddHtmlLocalized( 50, 204, 380, 65, 1046292, 0xFFFFFF );
// While you are still in young status, you will be transported to the nearest healer (along with your items) at the time of your death.
AddHtmlLocalized( 50, 269, 380, 65, 1046293, 0xFFFFFF, false, false );
AddHtmlLocalized( 50, 269, 380, 65, 1046293, 0xFFFFFF );
// To rejoin the world of the living simply walk near one of the NPC healers, and they will resurrect you as long as you are not marked as a criminal.
AddHtmlLocalized( 50, 334, 380, 70, 1046294, 0xFFFFFF, false, false );
AddHtmlLocalized( 50, 334, 380, 70, 1046294, 0xFFFFFF );
AddButton( 195, 410, 0xF8, 0xF9, 0, GumpButtonType.Reply, 0 );
AddButton( 195, 410, 0xF8, 0xF9, 0);
}
}
@ -52,7 +52,7 @@ namespace Server.Gumps
{
AddBackground( 0, 0, 450, 400, 0xA28 );
AddHtmlLocalized( 0, 30, 450, 35, 1013004, false, false ); // <center> Renouncing 'Young Player' Status</center>
AddHtmlLocalized( 0, 30, 450, 35, 1013004 ); // <center> Renouncing 'Young Player' Status</center>
/* As a 'Young' player, you are currently under a system of protection that prevents
* you from being attacked by other players and certain monsters.<br><br>
@ -66,11 +66,11 @@ namespace Server.Gumps
*/
AddHtmlLocalized( 30, 70, 390, 210, 1013005, true, true );
AddButton( 45, 298, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 78, 300, 100, 35, 1011036, false, false ); // OKAY
AddButton( 45, 298, 0xFA5, 0xFA7, 1);
AddHtmlLocalized( 78, 300, 100, 35, 1011036 ); // OKAY
AddButton( 178, 298, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 211, 300, 100, 35, 1011012, false, false ); // CANCEL
AddButton( 178, 298, 0xFA5, 0xFA7, 0);
AddHtmlLocalized( 211, 300, 100, 35, 1011012 ); // CANCEL
}
public override void OnResponse( NetState sender, RelayInfo info )