feat: Consolidates staff gump layouts (#2404)

## Summary
- Creates `PropsLayoutExtensions.cs` with reusable extension methods for both legacy `Gump` and `DynamicGumpBuilder` that encapsulate the repeating PropsConfig-style layout patterns (frame, header navigation, entry rows)
- Converts all 12 standardized staff gumps to use the new extensions, reducing ~570 lines of duplicated layout code
- Adds Type and Serial display to PropsGump and SkillsGump headers (e.g. `PlayerMobile (0x1)`)

### Extension methods provided
| Method | Pattern |
|--------|---------|
| `AddPropsFrame` | Background + offset region + origin coordinates |
| `AddPropsHeader` | 3-column: [Prev] [Title] [Next] |
| `AddPropsHeaderWithBack` | 4-column: [Back] [Title] [Prev] [Next] |
| `AddPropsEntryButton` | Label + action button |
| `AddPropsEntryNameValue` | Name + Value + action button |
| `AddPropsEntryTextInput` | Text input + action button |
| `AddPropsEntryLabel` | Label only (no button) |
| `AddPropsEntryType` | Full-width type label |
| `AddPropsEntryBlank` | Separator row |

### Gumps converted
PropsGump, GoGump, WhoGump, SkillsGump (frame+header), EditSkillGump, SetGump, SetObjectGump, SetPoint2DGump, SetPoint3DGump, SetTimeSpanGump (frame), SetListOptionGump (frame+header), CategorizedAddGump (frame+header)

## Test plan
- [x] Verify `[props` gump displays correctly with type + serial in header
- [x] Verify `[skills` gump displays correctly with type + serial in header
- [x] Verify `[go` navigation gump works (prev/next/back)
- [x] Verify property editing gumps (Set, SetObject, SetPoint2D, SetPoint3D, SetTimeSpan, SetListOption)
- [x] Verify `[categorizedadd` gump works
- [x] Verify `[who` gump works with pagination
This commit is contained in:
Kamron Batman 2026-04-08 11:42:46 -06:00 • committed by GitHub
parent c0d75562be
commit 8a34903326
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 786 additions and 570 deletions

View file

@ -12,10 +12,6 @@ namespace Server.Gumps
private const int EntryWidth = 212;
private const int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize;
private const int TotalHeight = OffsetSize + 2 * (EntryHeight + OffsetSize);
private const int BackWidth = BorderSize + TotalWidth + BorderSize;
private const int BackHeight = BorderSize + TotalHeight + BorderSize;
private readonly Mobile m_Mobile;
private readonly object m_Object;
@ -40,81 +36,25 @@ namespace Server.Gumps
_ => val.ToString()
};
var rowCount = 2 + (canNull ? 1 : 0) + (canDye ? 1 : 0);
AddPage(0);
AddBackground(
0,
0,
BackWidth,
BackHeight + (canNull ? EntryHeight + OffsetSize : 0) + (canDye ? EntryHeight + OffsetSize : 0),
BackGumpID
);
AddImageTiled(
BorderSize,
BorderSize,
TotalWidth,
TotalHeight + (canNull ? EntryHeight + OffsetSize : 0) + (canDye ? EntryHeight + OffsetSize : 0),
OffsetGumpID
);
var x = BorderSize + OffsetSize;
var y = BorderSize + OffsetSize;
AddImageTiled(x, y, EntryWidth, EntryHeight, EntryGumpID);
AddLabelCropped(x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, TextHue, prop.Name);
x += EntryWidth + OffsetSize;
if (SetGumpID != 0)
{
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
}
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
AddImageTiled(x, y, EntryWidth, EntryHeight, EntryGumpID);
AddTextEntry(x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, TextHue, 0, initialText);
x += EntryWidth + OffsetSize;
if (SetGumpID != 0)
{
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
}
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1);
this.AddPropsFrame(TotalWidth, rowCount, out var x, out var y);
this.AddPropsEntryLabel(ref x, ref y, EntryWidth, prop.Name);
PropsLayout.NextRow(ref x, ref y);
this.AddPropsEntryTextInput(ref x, ref y, EntryWidth, 0, initialText, true, 1);
if (canNull)
{
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
AddImageTiled(x, y, EntryWidth, EntryHeight, EntryGumpID);
AddLabelCropped(x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, TextHue, "Null");
x += EntryWidth + OffsetSize;
if (SetGumpID != 0)
{
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
}
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 2);
PropsLayout.NextRow(ref x, ref y);
this.AddPropsEntryButton(ref x, ref y, EntryWidth, "Null", true, 2);
}
if (canDye)
{
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
AddImageTiled(x, y, EntryWidth, EntryHeight, EntryGumpID);
AddLabelCropped(x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, TextHue, "Hue Picker");
x += EntryWidth + OffsetSize;
if (SetGumpID != 0)
{
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
}
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 3);
PropsLayout.NextRow(ref x, ref y);
this.AddPropsEntryButton(ref x, ref y, EntryWidth, "Hue Picker", true, 3);
}
}