Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)
This commit is contained in:
parent
e748af4430
commit
513e54f70e
1094 changed files with 15913 additions and 21892 deletions
|
|
@ -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
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue