fix: Fixes TextDefinition and optimizes CraftItem (#930)

This commit is contained in:
Kamron Batman 2022-02-12 22:42:50 -08:00 • committed by GitHub
parent 202c4a99b7
commit d7786ce586
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 138 additions and 173 deletions

View file

@ -13,11 +13,11 @@ namespace Server.Factions
private readonly Faction m_Faction;
private readonly Item m_Item;
private readonly Mobile m_Mobile;
private readonly object m_Notice;
private readonly TextDefinition m_Notice;
private readonly BaseTool m_Tool;
public FactionImbueGump(
int quality, Item item, Mobile from, CraftSystem craftSystem, BaseTool tool, object notice,
int quality, Item item, Mobile from, CraftSystem craftSystem, BaseTool tool, TextDefinition notice,
int availableSilver, Faction faction, FactionItemDefinition def
) : base(100, 200)
{
@ -98,13 +98,13 @@ namespace Server.Factions
{
m_Mobile.SendGump(new CraftGump(m_Mobile, m_CraftSystem, m_Tool, m_Notice));
}
else if (m_Notice is string s)
else if (m_Notice.Number > 0)
{
m_Mobile.SendMessage(s);
m_Mobile.SendLocalizedMessage(m_Notice.Number);
}
else if (m_Notice is int i && i > 0)
else
{
m_Mobile.SendLocalizedMessage(i);
m_Mobile.SendMessage(m_Notice.String);
}
}
}