chore: Removes dead gump code (#2403)

This commit is contained in:
Kamron Batman 2026-04-08 08:39:23 -06:00 • committed by GitHub
parent 5b6ea0c3b5
commit c0d75562be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 460 additions and 724 deletions

View file

@ -9,13 +9,13 @@ namespace Server.Gumps
{
public class EditSkillGump : Gump
{
private static readonly int EntryWidth = 160;
private const int EntryWidth = 160;
private static readonly int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize;
private static readonly int TotalHeight = OffsetSize + 2 * (EntryHeight + OffsetSize);
private const int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize;
private const int TotalHeight = OffsetSize + 2 * (EntryHeight + OffsetSize);
private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize;
private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize;
private const int BackWidth = BorderSize + TotalWidth + BorderSize;
private const int BackHeight = BorderSize + TotalHeight + BorderSize;
private readonly Mobile m_From;
@ -38,13 +38,7 @@ namespace Server.Gumps
AddPage(0);
AddBackground(0, 0, BackWidth, BackHeight, BackGumpID);
AddImageTiled(
BorderSize,
BorderSize,
TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0),
TotalHeight,
OffsetGumpID
);
AddImageTiled(BorderSize, BorderSize, TotalWidth, TotalHeight, OffsetGumpID);
var x = BorderSize + OffsetSize;
var y = BorderSize + OffsetSize;
@ -111,22 +105,10 @@ namespace Server.Gumps
public class SkillsGump : Gump
{
/*
private static bool PrevLabel = OldStyle, NextLabel = OldStyle;
private const int NameWidth = 107;
private const int ValueWidth = 128;
private static readonly int PrevLabelOffsetX = PrevWidth + 1;
private static readonly int PrevLabelOffsetY = 0;
private static readonly int NextLabelOffsetX = -29;
private static readonly int NextLabelOffsetY = 0;
* */
private static readonly int NameWidth = 107;
private static readonly int ValueWidth = 128;
private static readonly int TotalWidth =
OffsetSize + NameWidth + OffsetSize + ValueWidth + OffsetSize + SetWidth + OffsetSize;
private const int TotalWidth = OffsetSize + NameWidth + OffsetSize + ValueWidth + OffsetSize + SetWidth + OffsetSize;
private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize;
@ -158,47 +140,21 @@ namespace Server.Gumps
AddPage(0);
AddBackground(0, 0, BackWidth, BorderSize + totalHeight + BorderSize, BackGumpID);
AddImageTiled(
BorderSize,
BorderSize,
TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0),
totalHeight,
OffsetGumpID
);
AddImageTiled(BorderSize, BorderSize, TotalWidth, totalHeight, OffsetGumpID);
var x = BorderSize + OffsetSize;
var y = BorderSize + OffsetSize;
var emptyWidth = TotalWidth - PrevWidth - NextWidth - OffsetSize * 4 - (OldStyle ? SetWidth + OffsetSize : 0);
if (OldStyle)
{
AddImageTiled(x, y, TotalWidth - OffsetSize * 3 - SetWidth, EntryHeight, HeaderGumpID);
}
else
{
AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID);
}
const int emptyWidth = TotalWidth - PrevWidth - NextWidth - OffsetSize * 4;
AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID);
x += PrevWidth + OffsetSize;
if (!OldStyle)
{
AddImageTiled(
x - (OldStyle ? OffsetSize : 0),
y,
emptyWidth + (OldStyle ? OffsetSize * 2 : 0),
EntryHeight,
HeaderGumpID
);
}
AddImageTiled(x, y, emptyWidth, EntryHeight, HeaderGumpID);
x += emptyWidth + OffsetSize;
if (!OldStyle)
{
AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID);
}
AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID);
for (var i = 0; i < m_Groups.Length; ++i)
{
@ -220,12 +176,10 @@ namespace Server.Gumps
x += PrevWidth + OffsetSize;
x -= OldStyle ? OffsetSize : 0;
AddImageTiled(x, y, emptyWidth + (OldStyle ? OffsetSize * 2 : 0), EntryHeight, EntryGumpID);
AddImageTiled(x, y, emptyWidth, EntryHeight, EntryGumpID);
AddLabel(x + TextOffsetX, y, TextHue, group?.Name ?? "");
x += emptyWidth + (OldStyle ? OffsetSize * 2 : 0);
x += emptyWidth;
x += OffsetSize;
if (SetGumpID != 0)
@ -238,7 +192,6 @@ namespace Server.Gumps
continue;
}
var indentMaskX = BorderSize;
var indentMaskY = y + EntryHeight + OffsetSize;
for (var j = 0; j < group!.Skills.Length; ++j)
@ -257,18 +210,10 @@ namespace Server.Gumps
x += PrevWidth + OffsetSize;
x -= OldStyle ? OffsetSize : 0;
AddImageTiled(
x,
y,
emptyWidth + (OldStyle ? OffsetSize * 2 : 0) - OffsetSize - IndentWidth,
EntryHeight,
EntryGumpID
);
AddImageTiled(x, y, emptyWidth - OffsetSize - IndentWidth, EntryHeight, EntryGumpID);
AddLabel(x + TextOffsetX, y, TextHue, sk == null ? "(null)" : sk.Name);
x += emptyWidth + (OldStyle ? OffsetSize * 2 : 0) - OffsetSize - IndentWidth;
x += emptyWidth - OffsetSize - IndentWidth;
x += OffsetSize;
if (SetGumpID != 0)
@ -284,23 +229,29 @@ namespace Server.Gumps
switch (sk.Lock)
{
default:
buttonID1 = 0x983;
buttonID2 = 0x983;
xOffset = 6;
yOffset = 4;
break;
{
buttonID1 = 0x983;
buttonID2 = 0x983;
xOffset = 6;
yOffset = 4;
break;
}
case SkillLock.Down:
buttonID1 = 0x985;
buttonID2 = 0x985;
xOffset = 6;
yOffset = 4;
break;
{
buttonID1 = 0x985;
buttonID2 = 0x985;
xOffset = 6;
yOffset = 4;
break;
}
case SkillLock.Locked:
buttonID1 = 0x82C;
buttonID2 = 0x82C;
xOffset = 5;
yOffset = 2;
break;
{
buttonID1 = 0x82C;
buttonID2 = 0x82C;
xOffset = 5;
yOffset = 2;
break;
}
}
AddButton(x + xOffset, y + yOffset, buttonID1, buttonID2, GetButtonID(2, j));
@ -331,7 +282,7 @@ namespace Server.Gumps
}
AddImageTiled(
indentMaskX,
BorderSize,
indentMaskY,
IndentWidth + OffsetSize,
group.Skills.Length * (EntryHeight + OffsetSize) - (i < m_Groups.Length - 1 ? OffsetSize : 0),
@ -406,17 +357,23 @@ namespace Server.Gumps
switch (sk.Lock)
{
case SkillLock.Up:
sk.SetLockNoRelay(SkillLock.Down);
sk.Update();
break;
{
sk.SetLockNoRelay(SkillLock.Down);
sk.Update();
break;
}
case SkillLock.Down:
sk.SetLockNoRelay(SkillLock.Locked);
sk.Update();
break;
{
sk.SetLockNoRelay(SkillLock.Locked);
sk.Update();
break;
}
case SkillLock.Locked:
sk.SetLockNoRelay(SkillLock.Up);
sk.Update();
break;
{
sk.SetLockNoRelay(SkillLock.Up);
sk.Update();
break;
}
}
}
else
@ -451,11 +408,10 @@ namespace Server.Gumps
public SkillName[] Skills { get; }
public static SkillsGumpGroup[] Groups { get; } =
{
[
new(
"Crafting",
new[]
{
[
SkillName.Alchemy,
SkillName.Blacksmith,
SkillName.Cartography,
@ -466,22 +422,20 @@ namespace Server.Gumps
SkillName.Tailoring,
SkillName.Tinkering,
SkillName.Imbuing
}
]
),
new(
"Bardic",
new[]
{
[
SkillName.Discordance,
SkillName.Musicianship,
SkillName.Peacemaking,
SkillName.Provocation
}
]
),
new(
"Magical",
new[]
{
[
SkillName.Chivalry,
SkillName.EvalInt,
SkillName.Magery,
@ -493,12 +447,11 @@ namespace Server.Gumps
SkillName.Bushido,
SkillName.Spellweaving,
SkillName.Mysticism
}
]
),
new(
"Miscellaneous",
new[]
{
[
SkillName.Camping,
SkillName.Fishing,
SkillName.Focus,
@ -509,12 +462,11 @@ namespace Server.Gumps
SkillName.Mining,
SkillName.Snooping,
SkillName.Veterinary
}
]
),
new(
"Combat Ratings",
new[]
{
[
SkillName.Archery,
SkillName.Fencing,
SkillName.Macing,
@ -523,12 +475,11 @@ namespace Server.Gumps
SkillName.Tactics,
SkillName.Wrestling,
SkillName.Throwing
}
]
),
new(
"Actions",
new[]
{
[
SkillName.AnimalTaming,
SkillName.Begging,
SkillName.DetectHidden,
@ -538,21 +489,20 @@ namespace Server.Gumps
SkillName.Stealing,
SkillName.Stealth,
SkillName.Tracking
}
]
),
new(
"Lore & Knowledge",
new[]
{
[
SkillName.Anatomy,
SkillName.AnimalLore,
SkillName.ArmsLore,
SkillName.Forensics,
SkillName.ItemID,
SkillName.TasteID
}
]
)
};
];
private class SkillNameComparer : IComparer<SkillName>
{