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

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