fix: Fixes issue with cached static gump strings. Fixes bad gump colors (#1771)

### Summary
- Fixes an issue that causes CUO to crash due to bad string caching in static gumps
- Fixes wrong/bad 16bit html gump hues.
- Moves `C16232` (16-bit to 32-bit) and `C32216` (32-bit to 16-bit) to Utility class for broader use.

TODO:
- Some gumps have different 32bit (for string content) vs 16bit (for localized content) strings. Does this matter?
This commit is contained in:
Kamron Batman 2024-05-10 22:44:16 -07:00 • committed by GitHub
parent a001eb03da
commit 622250b8f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 129 additions and 155 deletions

View file

@ -33,13 +33,13 @@ namespace Server.Gumps
AddImage(2, 2, 0x2716);
AddHtmlLocalized(25, 25, 200, 20, TitleNumber, 0x7D00);
AddImage(25, 40, 0xBBF);
AddHtmlLocalized(25, 55, 300, 120, LabelNumber, 0xFFFFFF);
AddHtmlLocalized(25, 55, 300, 120, LabelNumber, 0x7FFF);
AddRadio(25, 175, 0x25F8, 0x25FB, true, (int)Buttons.Break);
AddRadio(25, 210, 0x25F8, 0x25FB, false, (int)Buttons.Close);
AddHtmlLocalized(60, 180, 280, 20, 1074976, 0xFFFFFF);
AddHtmlLocalized(60, 215, 280, 20, 1074977, 0xFFFFFF);
AddHtmlLocalized(60, 180, 280, 20, 1074976, 0x7FFF);
AddHtmlLocalized(60, 215, 280, 20, 1074977, 0x7FFF);
AddButton(265, 220, 0xF7, 0xF8, (int)Buttons.Confirm);
}

View file

@ -190,11 +190,11 @@ namespace Server.Gumps
AddHtmlLocalized(25, 22, 200, 20, 1074974, 0x7D00); // Confirm Selection
AddImage(25, 40, 0xBBF);
AddHtmlLocalized(25, 55, 300, 120, 1074975, 0xFFFFFF); // Are you sure you wish to select this?
AddHtmlLocalized(25, 55, 300, 120, 1074975, 0x7FFF); // Are you sure you wish to select this?
AddRadio(25, 175, 0x25F8, 0x25FB, true, 1);
AddRadio(25, 210, 0x25F8, 0x25FB, false, 0);
AddHtmlLocalized(60, 180, 280, 20, 1074976, 0xFFFFFF); // Yes
AddHtmlLocalized(60, 215, 280, 20, 1074977, 0xFFFFFF); // No
AddHtmlLocalized(60, 180, 280, 20, 1074976, 0x7FFF); // Yes
AddHtmlLocalized(60, 215, 280, 20, 1074977, 0x7FFF); // No
AddButton(265, 220, 0xF7, 0xF8, 7);
}

View file

@ -42,7 +42,7 @@ public abstract class StaticWarningGump<T> : StaticGump<T> where T : StaticWarni
builder.AddImageTiled(10, 10, width - 20, 20, 2624);
builder.AddAlphaRegion(10, 10, width - 20, 20);
builder.AddHtmlLocalized(10, 10, width - 20, 20, header, (short)headerColor);
builder.AddHtmlLocalized(10, 10, width - 20, 20, header, headerColor);
builder.AddImageTiled(10, 40, width - 20, height - 80, 2624);
builder.AddAlphaRegion(10, 40, width - 20, height - 80);

View file

@ -55,7 +55,7 @@ public class WarningGump : DynamicGump
builder.AddImageTiled(10, 10, _width - 20, 20, 2624);
builder.AddAlphaRegion(10, 10, _width - 20, 20);
builder.AddHtmlLocalized(10, 10, _width - 20, 20, _header, (short)_headerColor);
builder.AddHtmlLocalized(10, 10, _width - 20, 20, _header, _headerColor);
builder.AddImageTiled(10, 40, _width - 20, _height - 80, 2624);
builder.AddAlphaRegion(10, 40, _width - 20, _height - 80);

View file

@ -38,17 +38,17 @@ namespace Server.Gumps
AddHtmlLocalized(190, 24, 120, 20, 1046287, 0x7D00); // You have died.
// As a ghost you cannot interact with the world. You cannot touch items nor can you use them.
AddHtmlLocalized(50, 50, 380, 40, 1046288, 0xFFFFFF);
AddHtmlLocalized(50, 50, 380, 40, 1046288, 0x7FFF);
// You can pass through doors as though they do not exist. However, you cannot pass through walls.
AddHtmlLocalized(50, 100, 380, 45, 1046289, 0xFFFFFF);
AddHtmlLocalized(50, 100, 380, 45, 1046289, 0x7FFF);
// Since you are a new player, any items you had on your person at the time of your death will be in your backpack upon resurrection.
AddHtmlLocalized(50, 140, 380, 60, 1046291, 0xFFFFFF);
AddHtmlLocalized(50, 140, 380, 60, 1046291, 0x7FFF);
// To be resurrected you must find a healer in town or wandering in the wilderness. Some powerful players may also be able to resurrect you.
AddHtmlLocalized(50, 204, 380, 65, 1046292, 0xFFFFFF);
AddHtmlLocalized(50, 204, 380, 65, 1046292, 0x7FFF);
// While you are still in young status, you will be transported to the nearest healer (along with your items) at the time of your death.
AddHtmlLocalized(50, 269, 380, 65, 1046293, 0xFFFFFF);
AddHtmlLocalized(50, 269, 380, 65, 1046293, 0x7FFF);
// To rejoin the world of the living simply walk near one of the NPC healers, and they will resurrect you as long as you are not marked as a criminal.
AddHtmlLocalized(50, 334, 380, 70, 1046294, 0xFFFFFF);
AddHtmlLocalized(50, 334, 380, 70, 1046294, 0x7FFF);
AddButton(195, 410, 0xF8, 0xF9, 0);
}