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

@ -40,17 +40,17 @@ namespace Server.Items
// item name
if (item.LabelNumber != 0)
{
AddHtmlLocalized(20, 217, 250, 20, item.LabelNumber, 0xFFFFFF); // Name
AddHtmlLocalized(20, 217, 250, 20, item.LabelNumber, 0x7FFF); // Name
}
// item details
if (item is BaseFish fish)
{
AddHtmlLocalized(20, 239, 315, 20, fish.GetDescription(), 0xFFFFFF);
AddHtmlLocalized(20, 239, 315, 20, fish.GetDescription(), 0x7FFF);
}
else
{
AddHtmlLocalized(20, 239, 315, 20, 1073634, 0xFFFFFF); // An aquarium decoration
AddHtmlLocalized(20, 239, 315, 20, 1073634, 0x7FFF); // An aquarium decoration
}
// item image
@ -71,14 +71,14 @@ namespace Server.Items
if (page < m_Aquarium.Items.Count)
{
AddButton(195, 280, 0xFA5, 0xFA7, 0, GumpButtonType.Page, page + 1);
AddHtmlLocalized(230, 283, 100, 18, 1044045, 0xFFFFFF); // NEXT PAGE
AddHtmlLocalized(230, 283, 100, 18, 1044045, 0x7FFF); // NEXT PAGE
}
// previous page
if (page > 1)
{
AddButton(45, 280, 0xFAE, 0xFAF, 0, GumpButtonType.Page, page - 1);
AddHtmlLocalized(80, 283, 100, 18, 1044044, 0xFFFFFF); // PREV PAGE
AddHtmlLocalized(80, 283, 100, 18, 1044044, 0x7FFF); // PREV PAGE
}
}

View file

@ -465,15 +465,15 @@ public partial class TreasureMapChest : LockableContainer
AddBackground(30, 0, 240, 240, 2620);
// When this treasure chest is removed, any items still inside of it will be lost.
AddHtmlLocalized(45, 15, 200, 80, 1048125, 0xFFFFFF);
AddHtmlLocalized(45, 15, 200, 80, 1048125, 0x7FFF);
// Are you certain you're ready to remove this chest?
AddHtmlLocalized(45, 95, 200, 60, 1048126, 0xFFFFFF);
AddHtmlLocalized(45, 95, 200, 60, 1048126, 0x7FFF);
AddButton(40, 153, 4005, 4007, 1);
AddHtmlLocalized(75, 155, 180, 40, 1048127, 0xFFFFFF); // Remove the Treasure Chest
AddHtmlLocalized(75, 155, 180, 40, 1048127, 0x7FFF); // Remove the Treasure Chest
AddButton(40, 195, 4005, 4007, 2);
AddHtmlLocalized(75, 197, 180, 35, 1006045, 0xFFFFFF); // Cancel
AddHtmlLocalized(75, 197, 180, 35, 1006045, 0x7FFF); // Cancel
}
public override void OnResponse(NetState sender, in RelayInfo info)

View file

@ -95,17 +95,17 @@ public abstract partial class SpecialScroll : Item
AddHtmlLocalized(40, 48, 387, 100, _scroll.Message, true, true);
AddHtmlLocalized(125, 148, 200, 20, 1049478, 0xFFFFFF); // Do you wish to use this scroll?
AddHtmlLocalized(125, 148, 200, 20, 1049478, 0x7FFF); // Do you wish to use this scroll?
AddButton(100, 172, 4005, 4007, 1);
AddHtmlLocalized(135, 172, 120, 20, 1046362, 0xFFFFFF); // Yes
AddHtmlLocalized(135, 172, 120, 20, 1046362, 0x7FFF); // Yes
AddButton(275, 172, 4005, 4007, 0);
AddHtmlLocalized(310, 172, 120, 20, 1046363, 0xFFFFFF); // No
AddHtmlLocalized(310, 172, 120, 20, 1046363, 0x7FFF); // No
if (_scroll.Title != 0)
{
AddHtmlLocalized(40, 20, 260, 20, _scroll.Title, 0xFFFFFF);
AddHtmlLocalized(40, 20, 260, 20, _scroll.Title, 0x7FFF);
}
else
{
@ -116,7 +116,7 @@ public abstract partial class SpecialScroll : Item
if (skillLabel > 0)
{
AddHtmlLocalized(310, 20, 120, 20, skillLabel, 0xFFFFFF);
AddHtmlLocalized(310, 20, 120, 20, skillLabel, 0x7FFF);
}
}