feat: Adds grid support for the DynamicGump system (#2306)
### Summary
- Adds a new grid layout system for DynamicGump with zero heap allocations
- Migrates SpawnerControllerGump from legacy GumpGrid to DynamicGump
- Migrates CommandListGump from BaseGridGump to DynamicGump
- Removes legacy GumpGrid (no longer needed)
### New Grid Layout Components
| Component | Purpose |
|-----------|---------|
| `GridCell` | Value type for cell bounds (x, y, width, height) |
| `GridSizeSpec` | Parses CSS-like sizing specs ("10*", "*", "100") |
| `GridCalculator` | Computes track positions using stackalloc |
| `ListViewLayout` | Pagination + column layout for list views |
| `GridBuilderExtensions` | Extension methods accepting `GridCell` |
| `GridEntryStyle` | Styling properties for BaseGridGump migration |
| `GridEntryExtensions` | Entry methods matching BaseGridGump patterns |
### Memory Impact
| Component | Legacy | New |
|-----------|--------|-----|
| Grid storage | ~200 bytes heap | 0 bytes (stackalloc) |
| Column/Row lists | ~400 bytes heap | ~128 bytes stack |
| ListView | ~300 bytes heap | ~64 bytes stack |
| **Total per render** | **~900 bytes heap** | **0 bytes heap** |
### Test plan
- [x] All 21 gump tests pass
- [x] Build succeeds with no warnings
- [ ] In-game verification of SpawnerControllerGump
- [ ] In-game verification of CommandListGump (HelpInfo command)
This commit is contained in:
parent
a354f79f54
commit
bc6735bd23
13 changed files with 2579 additions and 1015 deletions
|
|
@ -209,7 +209,7 @@ public static partial class Utility
|
|||
var span = chars.AsSpan(0, str.Length);
|
||||
str.CopyTo(span);
|
||||
|
||||
FixHtml(span);
|
||||
span.FixHtml();
|
||||
|
||||
var fixedStr = span.ToString();
|
||||
STArrayPool<char>.Shared.Return(chars);
|
||||
|
|
@ -243,7 +243,7 @@ public static partial class Utility
|
|||
|
||||
if (!str.IsNullOrWhiteSpace())
|
||||
{
|
||||
FixHtml(span);
|
||||
span.FixHtml();
|
||||
}
|
||||
|
||||
return formattable;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue