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:
parent
c0d75562be
commit
8a34903326
13 changed files with 786 additions and 570 deletions
|
|
@ -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 + 7 * (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;
|
||||
private readonly PropertyInfo m_Property;
|
||||
|
|
@ -35,8 +31,7 @@ namespace Server.Gumps
|
|||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, BackWidth, BackHeight, BackGumpID);
|
||||
AddImageTiled(BorderSize, BorderSize, TotalWidth, TotalHeight, OffsetGumpID);
|
||||
this.AddPropsFrame(TotalWidth, 7, out _, out _);
|
||||
|
||||
AddRect(0, prop?.Name, 0, -1);
|
||||
AddRect(1, ts.ToString(), 0, -1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue