fix: Fixes TextDefinition and optimizes CraftItem (#930)
This commit is contained in:
parent
202c4a99b7
commit
d7786ce586
27 changed files with 138 additions and 173 deletions
|
|
@ -9,7 +9,7 @@ namespace Server.Gumps
|
|||
private readonly NoticeGumpCallback m_Callback;
|
||||
|
||||
public NoticeGump(
|
||||
int header, int headerColor, object content, int contentColor, int width, int height,
|
||||
int header, int headerColor, TextDefinition content, int contentColor, int width, int height,
|
||||
NoticeGumpCallback callback = null
|
||||
) : base((640 - width) / 2, (480 - height) / 2)
|
||||
{
|
||||
|
|
@ -28,18 +28,18 @@ namespace Server.Gumps
|
|||
AddImageTiled(10, 40, width - 20, height - 80, 2624);
|
||||
AddAlphaRegion(10, 40, width - 20, height - 80);
|
||||
|
||||
if (content is int i)
|
||||
if (content.Number > 0)
|
||||
{
|
||||
AddHtmlLocalized(10, 40, width - 20, height - 80, i, contentColor, false, true);
|
||||
AddHtmlLocalized(10, 40, width - 20, height - 80, content.Number, contentColor, false, true);
|
||||
}
|
||||
else if (content is string)
|
||||
else
|
||||
{
|
||||
AddHtml(
|
||||
10,
|
||||
40,
|
||||
width - 20,
|
||||
height - 80,
|
||||
$"<BASEFONT COLOR=#{contentColor:X6}>{content}</BASEFONT>",
|
||||
$"<BASEFONT COLOR=#{contentColor:X6}>{content.String}</BASEFONT>",
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Server.Gumps
|
|||
private readonly WarningGumpCallback m_Callback;
|
||||
|
||||
public WarningGump(
|
||||
int header, int headerColor, object content, int contentColor, int width, int height,
|
||||
int header, int headerColor, TextDefinition content, int contentColor, int width, int height,
|
||||
WarningGumpCallback callback = null, bool cancelButton = true
|
||||
) : base((640 - width) / 2, (480 - height) / 2)
|
||||
{
|
||||
|
|
@ -28,18 +28,18 @@ namespace Server.Gumps
|
|||
AddImageTiled(10, 40, width - 20, height - 80, 2624);
|
||||
AddAlphaRegion(10, 40, width - 20, height - 80);
|
||||
|
||||
if (content is int i)
|
||||
if (content.Number > 0)
|
||||
{
|
||||
AddHtmlLocalized(10, 40, width - 20, height - 80, i, contentColor, false, true);
|
||||
AddHtmlLocalized(10, 40, width - 20, height - 80, content.Number, contentColor, false, true);
|
||||
}
|
||||
else if (content is string)
|
||||
else
|
||||
{
|
||||
AddHtml(
|
||||
10,
|
||||
40,
|
||||
width - 20,
|
||||
height - 80,
|
||||
$"<BASEFONT COLOR=#{contentColor:X6}>{content}</BASEFONT>",
|
||||
$"<BASEFONT COLOR=#{contentColor:X6}>{content.String}</BASEFONT>",
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
|
@ -71,7 +71,7 @@ namespace Server.Gumps
|
|||
}
|
||||
else
|
||||
{
|
||||
m_Callback.Invoke(false);
|
||||
m_Callback(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue