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

@ -30,40 +30,39 @@ namespace Server.Gumps
AddImageTiled(10, 40, 307, 244, 0xA40);
AddImageTiled(10, 294, 307, 20, 0xA40);
AddAlphaRegion(10, 10, 307, 304);
AddHtmlLocalized(14, 12, 327, 20, 1076156, 0x7FFF, false, false); // Character Statue Maker
AddHtmlLocalized(14, 12, 327, 20, 1076156, 0x7FFF); // Character Statue Maker
// pose
AddHtmlLocalized(133, 41, 120, 20, 1076168, 0x7FFF, false, false); // Choose Pose
AddHtmlLocalized(133, 61, 120, 20, 1076208 + (int)m_Statue.Pose, 0x77E, false, false);
AddButton(163, 81, 0xFA5, 0xFA7, (int)Buttons.PoseNext, GumpButtonType.Reply, 0);
AddButton(133, 81, 0xFAE, 0xFB0, (int)Buttons.PosePrev, GumpButtonType.Reply, 0);
AddHtmlLocalized(133, 41, 120, 20, 1076168, 0x7FFF); // Choose Pose
AddHtmlLocalized(133, 61, 120, 20, 1076208 + (int)m_Statue.Pose, 0x77E);
AddButton(163, 81, 0xFA5, 0xFA7, (int)Buttons.PoseNext);
AddButton(133, 81, 0xFAE, 0xFB0, (int)Buttons.PosePrev);
// direction
AddHtmlLocalized(133, 126, 120, 20, 1076170, 0x7FFF, false, false); // Choose Direction
AddHtmlLocalized(133, 146, 120, 20, GetDirectionNumber(m_Statue.Direction), 0x77E, false, false);
AddButton(163, 167, 0xFA5, 0xFA7, (int)Buttons.DirNext, GumpButtonType.Reply, 0);
AddButton(133, 167, 0xFAE, 0xFB0, (int)Buttons.DirPrev, GumpButtonType.Reply, 0);
AddHtmlLocalized(133, 126, 120, 20, 1076170, 0x7FFF); // Choose Direction
AddHtmlLocalized(133, 146, 120, 20, GetDirectionNumber(m_Statue.Direction), 0x77E);
AddButton(163, 167, 0xFA5, 0xFA7, (int)Buttons.DirNext);
AddButton(133, 167, 0xFAE, 0xFB0, (int)Buttons.DirPrev);
// material
AddHtmlLocalized(133, 211, 120, 20, 1076171, 0x7FFF, false, false); // Choose Material
AddHtmlLocalized(133, 231, 120, 20, GetMaterialNumber(m_Statue.StatueType, m_Statue.Material), 0x77E, false,
false);
AddButton(163, 253, 0xFA5, 0xFA7, (int)Buttons.MatNext, GumpButtonType.Reply, 0);
AddButton(133, 253, 0xFAE, 0xFB0, (int)Buttons.MatPrev, GumpButtonType.Reply, 0);
AddHtmlLocalized(133, 211, 120, 20, 1076171, 0x7FFF); // Choose Material
AddHtmlLocalized(133, 231, 120, 20, GetMaterialNumber(m_Statue.StatueType, m_Statue.Material), 0x77E);
AddButton(163, 253, 0xFA5, 0xFA7, (int)Buttons.MatNext);
AddButton(133, 253, 0xFAE, 0xFB0, (int)Buttons.MatPrev);
// cancel
AddButton(10, 294, 0xFB1, 0xFB2, (int)Buttons.Close, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 294, 80, 20, 1006045, 0x7FFF, false, false); // Cancel
AddButton(10, 294, 0xFB1, 0xFB2, (int)Buttons.Close);
AddHtmlLocalized(45, 294, 80, 20, 1006045, 0x7FFF); // Cancel
// sculpt
AddButton(234, 294, 0xFB7, 0xFB9, (int)Buttons.Sculpt, GumpButtonType.Reply, 0);
AddHtmlLocalized(269, 294, 80, 20, 1076174, 0x7FFF, false, false); // Sculpt
AddButton(234, 294, 0xFB7, 0xFB9, (int)Buttons.Sculpt);
AddHtmlLocalized(269, 294, 80, 20, 1076174, 0x7FFF); // Sculpt
// restore
if (m_Maker is CharacterStatueDeed)
{
AddButton(107, 294, 0xFAB, 0xFAD, (int)Buttons.Restore, GumpButtonType.Reply, 0);
AddHtmlLocalized(142, 294, 80, 20, 1076193, 0x7FFF, false, false); // Restore
AddButton(107, 294, 0xFAB, 0xFAD, (int)Buttons.Restore);
AddHtmlLocalized(142, 294, 80, 20, 1076193, 0x7FFF); // Restore
}
}
@ -111,7 +110,7 @@ namespace Server.Gumps
public override void OnResponse(NetState state, RelayInfo info)
{
if (m_Statue == null || m_Statue.Deleted)
if (m_Statue?.Deleted != false)
return;
bool sendGump = false;
@ -195,4 +194,4 @@ namespace Server.Gumps
Restore
}
}
}
}