fix: Fixes resources, SOS messages, and codegens fishing (#1279)

This commit is contained in:
Kamron Batman 2022-11-24 11:12:44 -08:00 committed by GitHub
parent b006501535
commit 930431a6c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 592 additions and 659 deletions

View file

@ -27,8 +27,8 @@ public static class TextDefinitionExtensions
int y,
int width,
int height,
bool back,
bool scroll,
bool back = false,
bool scroll = false,
int numberColor = -1,
int stringColor = -1
)
@ -70,6 +70,51 @@ public static class TextDefinitionExtensions
}
}
public static void AddHtmlText(
this TextDefinition def,
Gump g,
int x,
int y,
int width,
int height,
string args,
bool back = false,
bool scroll = false,
int numberColor = -1,
int stringColor = -1
)
{
if (def == null)
{
return;
}
if (def.Number > 0)
{
// 5 bits per RGB component (15 bit RGB)
g.AddHtmlLocalized(x, y, width, height, def.Number, args, numberColor >= 0 ? numberColor : 0x7FFF, back, scroll);
}
else if (def.String != null)
{
if (stringColor >= 0) // 8 bits per RGB component (24 bit RGB)
{
g.AddHtml(
x,
y,
width,
height,
$"<BASEFONT COLOR=#{stringColor:X6}>{string.Format(def.String, args)}</BASEFONT>",
back,
scroll
);
}
else
{
g.AddHtml(x, y, width, height, string.Format(def.String, args), back, scroll);
}
}
}
public static void AddTo(this TextDefinition def, IPropertyList list)
{
if (def == null)