#W# Added Crafting Queue and Crafting skill list.

This commit is contained in:
WarrentyExpired 2026-08-07 19:25:55 -04:00
parent 7ba1dd7245
commit 791f82b4d0
7 changed files with 911 additions and 5 deletions

View file

@ -74,7 +74,10 @@ namespace Server.Engines.Craft
AddButton( 270, 387, 4005, 4007, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 305, 390, 150, 18, 1044151, LabelColor, false, false ); // MAKE NOW
}
// --- Add to queue ---
AddButton( 385, 387, 4005, 4007, 2, GumpButtonType.Reply, 0 );
AddHtml( 415, 390, 150, 18, "<BASEFONT COLOR=#FFFFFF>ADD TO QUEUE</BASEFONT>", false, false );
// ---------------------------------------------
if ( craftItem.NameNumber > 0 )
AddHtmlLocalized( 330, 40, 180, 18, craftItem.NameNumber, LabelColor, false, false );
else
@ -256,6 +259,24 @@ namespace Server.Engines.Craft
CraftGump craftGump = new CraftGump( m_From, m_CraftSystem, m_Tool, null );
m_From.SendGump( craftGump );
}
// Add to Queue Button
else if ( info.ButtonID == 2 )
{
Type typeRes = null;
CraftContext context = m_CraftSystem.GetContext( m_From );
if ( context != null )
{
CraftSubResCol res = ( m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes );
int resIndex = ( m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex );
if ( resIndex > -1 )
typeRes = res.GetAt( resIndex ).ItemType;
}
m_From.SendGump( new QueueAmountGump( m_From, m_CraftSystem, m_CraftItem, typeRes, m_Tool ) );
//m_From.SendMessage( 0x35, "How many would you like to add to the queue?" );
//m_From.Prompt = new QueuePrompt( m_From, m_CraftSystem, m_CraftItem, typeRes, m_Tool );
}
else // Make Button
{
int num = m_CraftSystem.CanCraft( m_From, m_Tool, m_CraftItem.ItemType );
@ -284,4 +305,42 @@ namespace Server.Engines.Craft
}
}
}
}
public class QueuePrompt : Server.Prompts.Prompt
{
private Mobile m_From;
private CraftSystem m_System;
private CraftItem m_Item;
private Type m_ResType;
private BaseTool m_Tool;
public QueuePrompt( Mobile from, CraftSystem system, CraftItem item, Type resType, BaseTool tool )
{
m_From = from;
m_System = system;
m_Item = item;
m_ResType = resType;
m_Tool = tool;
}
public override void OnResponse( Mobile from, string text )
{
int amount = 0;
// Try to parse the text into a number
if ( int.TryParse( text, out amount ) && amount > 0 )
{
CraftQueue queue = CraftQueueManager.GetQueue( from, m_System );
queue.Entries.Add( new CraftQueueEntry( m_Item, m_ResType, amount ) );
from.SendMessage( 0x35, "Added {0} of that item to your crafting queue.", amount );
}
else
{
from.SendMessage( 0x22, "Invalid amount. Must be a number greater than 0." );
}
// Send them back to the main menu so they can queue more items!
from.SendGump( new CraftGump( from, m_System, m_Tool, null ) );
}
}
}