feat: Adds size/style support to gump builders, optimizes EscapeHtml (#2257)

> [!IMPORTANT]
> **Developer Note**
> THIS IS A BREAKING CHANGE TO THE NEW API GUMP.
> Please give us feedback in [discord ](https://muo.gg/discord) if you have issues, need help, or have ideas for a better API change!

### Summary

* Adds support for size/style to dynamic/static builder.
* Drastically simplifies the dynamic/static builder api for AddHtml.
* Cleans up some legacy gump files.
This commit is contained in:
Kamron Batman 2025-11-23 11:35:31 -08:00 • committed by GitHub
parent ea86d5b2a6
commit 7bd5a853a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 398 additions and 635 deletions

View file

@ -27,7 +27,7 @@ public class DynamicTestGump : DynamicGump
builder.AddItem(218, 95, 0xCB0);
builder.AddHtml(30, 30, 150, 75, "<div align=center>Wilt thou sanctify the resurrection of:</div>");
builder.AddHtml(30, 70, 150, 25, $"<CENTER>{_petName}</CENTER>", true);
builder.AddHtml(30, 70, 150, 25, _petName, align: TextAlignment.Center, background: true);
builder.AddButton(40, 105, 0x81A, 0x81B, 0x1); // Okay
builder.AddButton(110, 105, 0x819, 0x818, 0x2); // Cancel

View file

@ -35,6 +35,6 @@ public class StaticLayoutTestGump : StaticGump<StaticLayoutTestGump>
protected override void BuildStrings(ref GumpStringsBuilder builder)
{
builder.SetHtmlTextCentered("petName", _petName);
builder.SetHtmlText("petName", _petName, align: TextAlignment.Center);
}
}

View file

@ -24,7 +24,7 @@ public class StaticTestGump : StaticGump<StaticTestGump>
builder.AddItem(218, 95, 0xCB0);
builder.AddHtml(30, 30, 150, 75, "<div align=center>Wilt thou sanctify the resurrection of:</div>");
builder.AddHtml(30, 70, 150, 25, "<CENTER>Test</CENTER>", true);
builder.AddHtml(30, 70, 150, 25, "Test", align: TextAlignment.Center, background: true);
builder.AddButton(40, 105, 0x81A, 0x81B, 0x1); // Okay
builder.AddButton(110, 105, 0x819, 0x818, 0x2); // Cancel