private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base(40, 40) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); AddPage(0); AddBackground(0, 0, 530, 437, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 85, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 417); if (craftSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); } else { AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); } AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> AddHtmlLocalized(10, 302, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER> AddButton(15, 402, 4017, 4019, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 405, 150, 18, 1011441, LabelColor, false, false); // EXIT //MODDED FROM this to AddButton( 270, 402, 4005, 4007, GetButtonID( 6, 2 ), GumpButtonType.Reply, 0 ); //MODDED FROM this to AddHtmlLocalized( 305, 405, 150, 18, 1044013, LabelColor, false, false ); // MAKE LAST AddButton(170, 402, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); AddHtmlLocalized(205, 405, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST //I ADDED bool autoloop = false; if (context != null && context.AutoLoop) { autoloop = true; } AddButton(320, 342, autoloop ? 209 : 208, autoloop ? 208 : 209, GetButtonID(6, 11), GumpButtonType.Reply, 0); AddHtml(355, 345, 150, 18, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Auto Loop"), false, false); AddHtml(320, 370, 150, 18, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Make Count"), false, false); int count = 0; if (context != null && context.TotalCount > 0) { count = context.TotalCount; } // AddImageTiled(415, 371, 50, 20, 2524);//bage AddImageTiled(414, 370, 52, 22, 2624); //black AddTextEntry(415, 371, 50, 20, 1152, 100, count > 0 ? count.ToString():""); //original // AddImageTiled(414, 370, 52, 22, 2624);//black // AddImageTiled(415, 371, 50, 20, 2524);//bage // // AddTextEntry(415, 371, 50, 20, 261, 100, count>0 ? count.ToString():""); //original //I ADDED // Mark option if (craftSystem.MarkOption) { //Moded from this to AddButton( 270, 362, 4005, 4007, GetButtonID( 6, 6 ), GumpButtonType.Reply, 0 ); //Moded from this to AddHtmlLocalized( 305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false ); // MARK ITEM AddButton(170, 362, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); AddHtmlLocalized(205, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM } // **************************************** // Resmelt option if (craftSystem.Resmelt) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** // Repair option if (craftSystem.Repair) { //Modded this from to AddButton( 270, 342, 4005, 4007, GetButtonID( 6, 5 ), GumpButtonType.Reply, 0 ); //Modded this from to AddHtmlLocalized( 305, 345, 150, 18, 1044260, LabelColor, false, false ); // REPAIR ITEM AddButton(170, 342, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); AddHtmlLocalized(205, 345, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM } // **************************************** // Enhance option if (craftSystem.CanEnhance) { //Modded this from to AddButton( 270, 382, 4005, 4007, GetButtonID( 6, 8 ), GumpButtonType.Reply, 0 ); //Modded this from to AddHtmlLocalized( 305, 385, 150, 18, 1061001, LabelColor, false, false ); // ENHANCE ITEM AddButton(170, 382, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); AddHtmlLocalized(205, 385, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM } // **************************************** if (notice is int && (int)notice > 0) { AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false); } else if (notice is string) { AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); } // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); Type resourceType = craftSystem.CraftSubRes.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(15, 362, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 365, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { AddLabel(50, 362, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex2); Type resourceType = craftSystem.CraftSubRes2.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(15, 382, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { AddLabel(50, 385, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** CreateGroupList(); if (page == CraftPage.PickResource) { CreateResList(false, from); } else if (page == CraftPage.PickResource2) { CreateResList(true, from); } else if (context != null && context.LastGroupIndex > -1) { CreateItemList(context.LastGroupIndex); } }
private CraftGump( Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page ) : base(40, 40) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext( from ); from.CloseGump( typeof( CraftGump ) ); from.CloseGump( typeof( CraftGumpItem ) ); AddPage( 0 ); AddBackground( 0, 0, 530, 437, 5054 ); AddImageTiled( 10, 10, 510, 22, 2624 ); AddImageTiled( 10, 292, 150, 45, 2624 ); AddImageTiled( 165, 292, 355, 45, 2624 ); AddImageTiled( 10, 342, 510, 85, 2624 ); AddImageTiled( 10, 37, 200, 250, 2624 ); AddImageTiled( 215, 37, 305, 250, 2624 ); AddAlphaRegion( 10, 10, 510, 417 ); if ( craftSystem.GumpTitleNumber > 0 ) AddHtmlLocalized( 10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false ); else AddHtml( 10, 12, 510, 20, craftSystem.GumpTitleString, false, false ); AddHtmlLocalized( 10, 37, 200, 22, 1044010, LabelColor, false, false ); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized( 215, 37, 305, 22, 1044011, LabelColor, false, false ); // <CENTER>SELECTIONS</CENTER> AddHtmlLocalized( 10, 302, 150, 25, 1044012, LabelColor, false, false ); // <CENTER>NOTICES</CENTER> AddButton( 15, 402, 4017, 4019, 0, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 50, 405, 150, 18, 1011441, LabelColor, false, false ); // EXIT AddButton( 270, 402, 4005, 4007, GetButtonID( 6, 2 ), GumpButtonType.Reply, 0 ); AddHtmlLocalized( 305, 405, 150, 18, 1044013, LabelColor, false, false ); // MAKE LAST // Mark option if ( craftSystem.MarkOption ) { AddButton( 270, 362, 4005, 4007, GetButtonID( 6, 6 ), GumpButtonType.Reply, 0 ); AddHtmlLocalized( 305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false ); // MARK ITEM } // **************************************** // Resmelt option if ( craftSystem.Resmelt ) { AddButton( 15, 342, 4005, 4007, GetButtonID( 6, 1 ), GumpButtonType.Reply, 0 ); AddHtmlLocalized( 50, 345, 150, 18, 1044259, LabelColor, false, false ); // SMELT ITEM } // **************************************** // Repair option if ( craftSystem.Repair ) { AddButton( 270, 342, 4005, 4007, GetButtonID( 6, 5 ), GumpButtonType.Reply, 0 ); AddHtmlLocalized( 305, 345, 150, 18, 1044260, LabelColor, false, false ); // REPAIR ITEM } // **************************************** // Enhance option if ( craftSystem.CanEnhance ) { AddButton( 270, 382, 4005, 4007, GetButtonID( 6, 8 ), GumpButtonType.Reply, 0 ); AddHtmlLocalized( 305, 385, 150, 18, 1061001, LabelColor, false, false ); // ENHANCE ITEM } // **************************************** if ( notice is int && (int)notice > 0 ) AddHtmlLocalized( 170, 295, 350, 40, (int)notice, LabelColor, false, false ); else if ( notice is string ) AddHtml( 170, 295, 350, 40, String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice ), false, false ); // If the system has more than one resource if ( craftSystem.CraftSubRes.Init ) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = ( context == null ? -1 : context.LastResourceIndex ); Type resourceType = craftSystem.CraftSubRes.ResType; if ( resIndex > -1 ) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt( resIndex ); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if ( from.Backpack != null ) { Item[] items = from.Backpack.FindItemsByType( resourceType, true ); for ( int i = 0; i < items.Length; ++i ) resourceCount += items[i].Amount; } AddButton( 15, 362, 4005, 4007, GetButtonID( 6, 0 ), GumpButtonType.Reply, 0 ); if ( nameNumber > 0 ) AddHtmlLocalized( 50, 365, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false ); else AddLabel( 50, 362, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) ); } // **************************************** // For dragon scales if ( craftSystem.CraftSubRes2.Init ) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = ( context == null ? -1 : context.LastResourceIndex2 ); Type resourceType = craftSystem.CraftSubRes.ResType; if ( resIndex > -1 ) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt( resIndex ); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if ( from.Backpack != null ) { Item[] items = from.Backpack.FindItemsByType( resourceType, true ); for ( int i = 0; i < items.Length; ++i ) resourceCount += items[i].Amount; } AddButton( 15, 382, 4005, 4007, GetButtonID( 6, 7 ), GumpButtonType.Reply, 0 ); if ( nameNumber > 0 ) AddHtmlLocalized( 50, 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false ); else AddLabel( 50, 385, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) ); } // **************************************** CreateGroupList(); if ( page == CraftPage.PickResource ) CreateResList( false ); else if ( page == CraftPage.PickResource2 ) CreateResList( true ); else if ( context != null && context.LastGroupIndex > -1 ) CreateItemList( context.LastGroupIndex ); }
private CraftGump(Mobile from, CraftSystem craftSystem, ITool tool, object notice, CraftPage page) : base(40, 40) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); AddPage(0); AddBackground(0, 0, 530, 497, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 145, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 477); if (craftSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); } else { AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); } AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> AddHtmlLocalized(10, 302, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER> AddButton(15, 442, 4017, 4019, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 445, 150, 18, 1011441, LabelColor, false, false); // EXIT AddButton(115, 442, 4017, 4019, GetButtonID(6, 11), GumpButtonType.Reply, 0); AddHtmlLocalized(150, 445, 150, 18, 1112698, LabelColor, false, false); // CANCEL MAKE // Repair option if (m_CraftSystem.Repair) { AddButton(270, 342, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 345, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM } // **************************************** // Mark option if (m_CraftSystem.MarkOption) { AddButton(270, 362, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM } // **************************************** // Enhance option if (m_CraftSystem.CanEnhance) { AddButton(270, 382, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 385, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM } // **************************************** // Alter option if (m_CraftSystem.CanAlter) { AddButton(270, 402, 4005, 4007, GetButtonID(6, 9), GumpButtonType.Reply, 0); AddHtmlLocalized(304, 405, 250, 18, 1094726, LabelColor, false, false); // ALTER ITEM (Gargoyle) } // **************************************** // Quest item AddButton(270, 422, 4005, 4007, GetButtonID(6, 10), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 425, 150, 18, context != null && context.QuestOption == CraftQuestOption.QuestItem ? 1112534 : 1112533, LabelColor, false, false); // QUEST ITEM // **************************************** AddButton(270, 442, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 445, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST int total = 1; int made = 0; if (Locked && AutoCraftTimer.AutoCraftTable.ContainsKey(m_From)) { AutoCraftTimer timer = AutoCraftTimer.AutoCraftTable[m_From]; if (timer != null) { total = timer.Amount; made = timer.Attempts; } else { if (context != null) { total = context.MakeTotal; } } } string args = string.Format("{0}\t{1}", made.ToString(), total.ToString()); AddHtmlLocalized(270, 468, 150, 18, 1079443, args, LabelColor, false, false); //~1_DONE~/~2_TOTAL~ COMPLETED // Resmelt option if (m_CraftSystem.Resmelt) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** if (notice is int note && note > 0) { AddHtmlLocalized(170, 295, 350, 40, note, LabelColor, false, false); }
private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base(40, 40) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); AddPage(0); AddBackground(0, 0, 830, 537, 5054); AddImageTiled(10, 10, 810, 22, 2624); AddImageTiled(10, 37, 200, 350, 2624); AddImageTiled(215, 37, 605, 350, 2624); AddImageTiled(10, 392, 150, 45, 2624); AddImageTiled(165, 392, 655, 45, 2624); AddImageTiled(10, 442, 810, 85, 2624); AddAlphaRegion(10, 10, 810, 517); if (craftSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); } else { // AddHtml( 10, 12, 510, 20, craftSystem.GumpTitleString, false, false ); AddHtml(10, 12, 500, 20, "<h3><basefont color=#FFFFFF>" + craftSystem.GumpTitleString + "<basefont></h3>", false, false); } //AddHtmlLocalized( 10, 37, 200, 22, 1044010, LabelColor, false, false ); // <CENTER>CATEGORIES</CENTER> //AddHtmlLocalized( 215, 37, 305, 22, 1044011, LabelColor, false, false ); // <CENTER>SELECTIONS</CENTER> //AddHtmlLocalized( 10, 302, 150, 25, 1044012, LabelColor, false, false ); // <CENTER>NOTICES</CENTER> AddHtml(13, 37, 200, 20, "<h3><basefont color=#FFFFFF>Catégories<basefont></h3>", false, false); AddHtml(218, 37, 200, 20, "<h3><basefont color=#FFFFFF>Sélections<basefont></h3>", false, false); AddHtml(13, 402, 200, 20, "<h3><basefont color=#FFFFFF>Message<basefont></h3>", false, false); AddButton(15, 502, 4017, 4019, 0, GumpButtonType.Reply, 0); //AddHtmlLocalized( 50, 405, 150, 18, 1011441, LabelColor, false, false ); // EXIT AddHtml(50, 502, 200, 20, "<h3><basefont color=#FFFFFF>Quitter<basefont></h3>", false, false); AddButton(650, 482, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); //AddHtmlLocalized( 305, 405, 150, 18, 1044013, LabelColor, false, false ); // MAKE LAST AddHtml(685, 485, 200, 20, "<h3><basefont color=#FFFFFF>Refaire<basefont></h3>", false, false); // Mark option if (craftSystem.MarkOption) { AddButton(650, 462, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); //AddHtmlLocalized( 305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false ); // MARK ITEM if (context.MarkOption == CraftMarkOption.DoNotMark) { AddHtml(685, 465, 200, 20, "<h3><basefont color=#FFFFFF>Marquer<basefont></h3>", false, false); } else { AddHtml(685, 465, 200, 20, "<h3><basefont color=#FFFFFF>Ne Pas Marquer<basefont></h3>", false, false); } } // **************************************** // Resmelt option if (craftSystem.Resmelt) { AddButton(415, 442, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); //AddHtmlLocalized( 50, 345, 150, 18, 1044259, LabelColor, false, false ); // SMELT ITEM AddHtml(450, 445, 150, 20, "<h3><basefont color=#FFFFFF>Fondre<basefont></h3>", false, false); } // **************************************** // Repair option if (craftSystem.Repair) { AddButton(650, 442, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); //AddHtmlLocalized( 305, 345, 150, 18, 1044260, LabelColor, false, false ); // REPAIR ITEM AddHtml(685, 445, 200, 20, "<h3><basefont color=#FFFFFF>Réparer<basefont></h3>", false, false); } // **************************************** // Enhance option //if ( craftSystem.CanEnhance ) //{ // AddButton( 270, 402, 4005, 4007, GetButtonID( 6, 8 ), GumpButtonType.Reply, 0 ); // AddHtmlLocalized( 305, 405, 150, 18, 1061001, LabelColor, false, false ); // ENHANCE ITEM //} // **************************************** if (notice is int && (int)notice > 0) { AddHtmlLocalized(170, 395, 350, 40, (int)notice, LabelColor, false, false); } else if (notice is string) { // AddHtml( 170, 295, 350, 40, String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice ), false, false ); AddHtml(170, 345, 350, 40, "<h3><basefont color=#FFFFFF>" + notice + "<basefont></h3>", false, false); } // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); Type resourceType = craftSystem.CraftSubRes.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(15, 442, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 445, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { //AddLabel( 50, 362, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) ); AddHtml(50, 442, 450, 40, "<h3><basefont color=#FFFFFF>" + nameString + " " + resourceCount + "<basefont></h3>", false, false); } } // **************************************** // If the system has more than one resource type if (craftSystem.CraftSubRes2.Init) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex2); Type resourceType = craftSystem.CraftSubRes2.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(15, 462, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 465, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { //AddLabel( 50, 385, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) ); AddHtml(50, 462, 450, 40, "<h3><basefont color=#FFFFFF>" + nameString + " " + resourceCount + "<basefont></h3>", false, false); } } // **************************************** CreateGroupList(); if (page == CraftPage.PickResource) { CreateResList(false, from); } else if (page == CraftPage.PickResource2) { CreateResList(true, from); } else if (context != null && context.LastGroupIndex > -1) { CreateItemList(context.LastGroupIndex); } }
private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base(40, 40) { this.m_From = from; this.m_CraftSystem = craftSystem; this.m_Tool = tool; this.m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); this.AddPage(0); AddBackground(0, 0, 530, 497, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 145, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 477); if (craftSystem.GumpTitleNumber > 0) this.AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); else this.AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> AddHtmlLocalized(10, 302, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER> this.AddButton(15, 442, 4017, 4019, 0, GumpButtonType.Reply, 0); this.AddHtmlLocalized(50, 445, 150, 18, 1011441, LabelColor, false, false); // EXIT this.AddButton(115, 442, 4017, 4019, GetButtonID(6, 11), GumpButtonType.Reply, 0); this.AddHtmlLocalized(150, 445, 150, 18, 1112698, LabelColor, false, false); // CANCEL MAKE // Repair option if (m_CraftSystem.Repair) { AddButton(270, 342, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 345, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM } // **************************************** // Mark option if (m_CraftSystem.MarkOption) { AddButton(270, 362, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM } // **************************************** // Enhance option if (m_CraftSystem.CanEnhance) { AddButton(270, 382, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 385, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM } // **************************************** #region SA // Alter option if (Core.SA && m_CraftSystem.CanAlter) { AddButton(270, 402, 4005, 4007, GetButtonID(6, 9), GumpButtonType.Reply, 0); AddHtmlLocalized(304, 405, 250, 18, 1094726, LabelColor, false, false); // ALTER ITEM (Gargoyle) } // **************************************** // Quest item if (Core.SA) { AddButton(270, 422, 4005, 4007, GetButtonID(6, 10), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 425, 150, 18, context != null && context.QuestOption == CraftQuestOption.QuestItem ? 1112534 : 1112533, LabelColor, false, false); // QUEST ITEM } // **************************************** #endregion AddButton(270, 442, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 445, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST #region Stygian Abyss int total = 1; int made = 0; if (Locked && AutoCraftTimer.AutoCraftTable.ContainsKey(m_From)) { AutoCraftTimer timer = AutoCraftTimer.AutoCraftTable[m_From]; if (timer != null) { total = timer.Amount; made = timer.Attempts; } else { if (context != null) total = context.MakeTotal; } } string args = String.Format("{0}\t{1}", made.ToString(), total.ToString()); AddHtmlLocalized(270, 468, 150, 18, 1079443, args, LabelColor, false, false); //~1_DONE~/~2_TOTAL~ COMPLETED #endregion // Resmelt option if (m_CraftSystem.Resmelt) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** if (notice is int && (int)notice > 0) this.AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false); else if (notice is string) this.AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); Type resourceType = craftSystem.CraftSubRes.ResType; Type resourceType2 = GetAltType(resourceType); if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) resourceCount += items[i].Amount; if (resourceType2 != null) { Item[] items2 = m_From.Backpack.FindItemsByType(resourceType2, true); for (int i = 0; i < items2.Length; ++i) resourceCount += items2[i].Amount; } } this.AddButton(15, 382, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) { if (context.DoNotColor) AddLabel(50, 385, LabelHue, "*"); AddHtmlLocalized(50 + (context.DoNotColor ? 13 : 0), 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else AddLabel(50, 382, LabelHue, (context.DoNotColor ? "*" : "") + String.Format("{0} ({1} Available)", nameString, resourceCount)); } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex2); Type resourceType = craftSystem.CraftSubRes2.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) resourceCount += items[i].Amount; } this.AddButton(15, 402, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) AddHtmlLocalized(50, 405, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); else AddLabel(50, 405, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } // **************************************** this.CreateGroupList(); if (page == CraftPage.PickResource) this.CreateResList(false, from); else if (page == CraftPage.PickResource2) this.CreateResList(true, from); else if (context != null && context.LastGroupIndex > -1) this.CreateItemList(context.LastGroupIndex); }
private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base(50, 50) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump <CraftGump>(); from.CloseGump <CraftGumpItem>(); AddPage((int)CraftPage.None); AddBackground(0, 0, 530, 497, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 145, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 497); if (craftSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, FontColor, false, false); } else { AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); } AddHtmlLocalized(10, 302, 150, 25, 1044012, FontColor, false, false); // <CENTER>NOTICES</CENTER> AddButton(15, 442, 4017, 4019, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 445, 150, 18, 1011441, FontColor, false, false); // EXIT AddButton(270, 442, 4005, 4007, 1999, GumpButtonType.Reply, 0); AddHtmlLocalized(305, 445, 150, 18, 1044013, FontColor, false, false); // MAKE LAST AddButton(115, 442, 4017, 4019, 12000, GumpButtonType.Reply, 0); AddHtmlLocalized(150, 445, 150, 18, 1112698, FontColor, false, false); // CANCEL MAKE // Resmelt option if (craftSystem.Resmelt) { AddButton(15, 342, 4005, 4007, 7000, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 345, 150, 18, 1044259, FontColor, false, false); // SMELT ITEM } // **************************************** // Repair option if (craftSystem.Repair) { AddButton(270, 342, 4005, 4007, 8000, GumpButtonType.Reply, 0); AddHtmlLocalized(305, 345, 150, 18, 1044260, FontColor, false, false); // REPAIR ITEM } // **************************************** // Alter option if (craftSystem.Alter) { AddButton(270, 402, 4005, 4007, 9000, GumpButtonType.Reply, 0); AddHtmlLocalized(305, 405, 300, 18, 1094726, FontColor, false, false); // ALTER ITEM (GARGOYLE) } // **************************************** AddHtmlLocalized(10, 37, 200, 22, 1044010, FontColor, false, false); // <CENTER>CATEGORIES</CENTER> CreateGroupList(); if (craftSystem.CraftSubRes.Init) { CreateResList(false); } if (craftSystem.CraftSubRes2.Init) { CreateResList(true); } AddPage(0); // Enhance option if (craftSystem.CanEnhance) { AddButton(270, 382, 4005, 4007, 2000, GumpButtonType.Reply, 0); AddHtmlLocalized(305, 385, 150, 18, 1061001, FontColor, false, false); // ENHANCE ITEM } // **************************************** if (craftSystem.CraftSubRes2.Init) { AddButton(15, 382, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 10); } if (craftSystem.CraftSubRes.Init) { AddButton(15, 362, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 9); } if (context != null && context.LastGroupIndex > -1) { CreateItemList(context.LastGroupIndex); } // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { AddPage(0); string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int amount; int resIndex = (context == null ? -1 : context.LastResourceIndex); if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; amount = GetAmount(subResource.ItemType); } else { amount = GetAmount(craftSystem.CraftSubRes.ResType); } if (nameNumber > 0) { AddHtmlLocalized(50, 365, 170, 18, nameNumber, amount.ToString(), LabelColor, false, false); AddKRHtmlLocalized(50, 365, 170, 18, nameNumber, LabelColor, false, false); } else { AddLabel(50, 362, LabelHue, nameString); } AddPage(9); AddButton(220, 260, 4005, 4007, 3000, GumpButtonType.Reply, 0); AddHtmlLocalized(255, 263, 200, 18, (context == null || !context.DoNotColor) ? 1061591 : 1061590, LabelColor, false, false); } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { AddPage(0); string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int amount; int resIndex = (context == null ? -1 : context.LastResourceIndex2); if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; amount = GetAmount(subResource.ItemType); } else { amount = GetAmount(craftSystem.CraftSubRes2.ResType); } if (nameNumber > 0) { AddHtmlLocalized(50, 385, 150, 18, nameNumber, amount.ToString(), LabelColor, false, false); AddKRHtmlLocalized(50, 385, 150, 18, nameNumber, LabelColor, false, false); } else { AddLabel(50, 385, LabelHue, nameString); } AddPage(10); AddButton(220, 260, 4005, 4007, 3001, GumpButtonType.Reply, 0); AddHtmlLocalized(255, 263, 200, 18, (context == null || !context.DoNotColor) ? 1061591 : 1061590, LabelColor, false, false); } // **************************************** // Notice if (notice is int && (int)notice > 0) { AddPage(0); AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false); } else if (notice is string) { AddPage(0); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); } // **************************************** // Mark option if (craftSystem.MarkOption) { AddPage(0); AddButton(270, 362, 4005, 4007, 6000, GumpButtonType.Reply, 0); AddHtmlLocalized(305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM if (context != null && context.MarkOption == CraftMarkOption.MarkItem) { AddKRButton(0, 0, 0, 0, 6001, GumpButtonType.Page, 0); } } // **************************************** // Quest Item option bool questItem = (context != null && context.QuestItem); AddPage(0); AddButton(270, 422, 0xFA5, 0xFA7, 6002, GumpButtonType.Reply, 0); AddHtmlLocalized(305, 425, 150, 18, questItem ? 1112534 : 1112533, LabelColor, false, false); // **************************************** if (context != null) { if (context.MakeLast) { AddKRButton(0, 0, 0, 0, 6003, GumpButtonType.Page, 0); } if (context.MakeNumber) { AddKRButton(0, 0, 0, 0, context.Total + 6100, GumpButtonType.Page, 0); } if (context.MakeMax) { AddKRButton(0, 0, 0, 0, 6005, GumpButtonType.Page, 0); } } if (context != null) { if (context.Success) { context.Done++; } int done = 0, total = 1; done = context.Done; total = context.Total; AddHtmlLocalized(270, 465, 200, 18, 1079443, String.Format("{0}@{1}", done, total), FontColor, false, false); // ~1_DONE~/~2_TOTAL~ COMPLETED if (context.Making != null && context.Success) { m_MakeTimer = Timer.DelayCall(TimeSpan.FromSeconds(1.25), new TimerCallback(DoMake)); } context.Success = false; } }
private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base(30, 30) // eddited by sam for woodworking changes { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); AddPage(0); //edited by sam AddBackground(0, 0, 530, 437, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 85, 2624); AddImageTiled(10, 37, 300, 380, 2624); //edited by sam to fix gump AddImageTiled(215, 37, 305, 380, 2624); //edited by sam to fix gump AddAlphaRegion(10, 10, 510, 417); if (craftSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); } else { AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); } AddHtmlLocalized(10, 50, 200, 100, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 50, 305, 100, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> //edited by sam removed notice tab AddButton(15, 400, 4017, 4019, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 400, 150, 18, 1011441, LabelColor, false, false); // EXIT AddButton(270, 400, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 400, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST // Mark option if (craftSystem.MarkOption) { AddButton(270, 362, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM } // **************************************** // Resmelt option if (craftSystem.Resmelt) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** // Repair option if (craftSystem.Repair) { AddButton(270, 342, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 345, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM } // **************************************** // Enhance option if (craftSystem.CanEnhance) { AddButton(270, 382, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 385, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM } // **************************************** if (notice is int && (int)notice > 0) { AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false); } else if (notice is string) { AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); } // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; } AddButton(15, 362, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 365, 250, 18, nameNumber, LabelColor, false, false); } else { AddLabel(50, 362, LabelHue, nameString); } } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex2); if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; } AddButton(15, 382, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 385, 250, 18, nameNumber, LabelColor, false, false); } else { AddLabel(50, 385, LabelHue, nameString); } } // **************************************** CreateGroupList(); if (page == CraftPage.PickResource) { CreateResList(false); } else if (page == CraftPage.PickResource2) { CreateResList(true); } else if (context != null && context.LastGroupIndex > -1) { CreateItemList(context.LastGroupIndex); } }
private CraftGump( Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page ) : base(50, 50) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext( from ); from.CloseGump( typeof( CraftGump ) ); from.CloseGump( typeof( CraftGumpItem ) ); AddPage( (int) CraftPage.None ); AddBackground( 0, 0, 530, 497, 5054 ); AddImageTiled( 10, 10, 510, 22, 2624 ); AddImageTiled( 10, 292, 150, 45, 2624 ); AddImageTiled( 165, 292, 355, 45, 2624 ); AddImageTiled( 10, 342, 510, 145, 2624 ); AddImageTiled( 10, 37, 200, 250, 2624 ); AddImageTiled( 215, 37, 305, 250, 2624 ); AddAlphaRegion( 10, 10, 510, 497 ); if ( craftSystem.GumpTitleNumber > 0 ) AddHtmlLocalized( 10, 12, 510, 20, craftSystem.GumpTitleNumber, FontColor, false, false ); else AddHtml( 10, 12, 510, 20, craftSystem.GumpTitleString, false, false ); AddHtmlLocalized( 10, 302, 150, 25, 1044012, FontColor, false, false ); // <CENTER>NOTICES</CENTER> AddButton( 15, 442, 4017, 4019, 0, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 50, 445, 150, 18, 1011441, FontColor, false, false ); // EXIT AddButton( 270, 442, 4005, 4007, 1999, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 305, 445, 150, 18, 1044013, FontColor, false, false ); // MAKE LAST AddButton( 115, 442, 4017, 4019, 12000, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 150, 445, 150, 18, 1112698, FontColor, false, false ); // CANCEL MAKE // Resmelt option if ( craftSystem.Resmelt ) { AddButton( 15, 342, 4005, 4007, 7000, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 50, 345, 150, 18, 1044259, FontColor, false, false ); // SMELT ITEM } // **************************************** // Repair option if ( craftSystem.Repair ) { AddButton( 270, 342, 4005, 4007, 8000, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 305, 345, 150, 18, 1044260, FontColor, false, false ); // REPAIR ITEM } // **************************************** // Alter option if ( craftSystem.Alter ) { AddButton( 270, 402, 4005, 4007, 9000, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 305, 405, 300, 18, 1094726, FontColor, false, false ); // ALTER ITEM (GARGOYLE) } // **************************************** AddHtmlLocalized( 10, 37, 200, 22, 1044010, FontColor, false, false ); // <CENTER>CATEGORIES</CENTER> CreateGroupList(); if ( craftSystem.CraftSubRes.Init ) CreateResList( false ); if ( craftSystem.CraftSubRes2.Init ) CreateResList( true ); AddPage( 0 ); // Enhance option if ( craftSystem.CanEnhance ) { AddButton( 270, 382, 4005, 4007, 2000, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 305, 385, 150, 18, 1061001, FontColor, false, false ); // ENHANCE ITEM } // **************************************** if ( craftSystem.CraftSubRes2.Init ) AddButton( 15, 382, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 10 ); if ( craftSystem.CraftSubRes.Init ) AddButton( 15, 362, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 9 ); if ( context != null && context.LastGroupIndex > -1 ) CreateItemList( context.LastGroupIndex ); // If the system has more than one resource if ( craftSystem.CraftSubRes.Init ) { AddPage( 0 ); string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int amount; int resIndex = ( context == null ? -1 : context.LastResourceIndex ); if ( resIndex > -1 ) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt( resIndex ); nameString = subResource.NameString; nameNumber = subResource.NameNumber; amount = GetAmount( subResource.ItemType ); } else amount = GetAmount( craftSystem.CraftSubRes.ResType ); if ( nameNumber > 0 ) { AddHtmlLocalized( 50, 365, 170, 18, nameNumber, amount.ToString(), LabelColor, false, false ); AddKRHtmlLocalized( 50, 365, 170, 18, nameNumber, LabelColor, false, false ); } else AddLabel( 50, 362, LabelHue, nameString ); AddPage( 9 ); AddButton( 220, 260, 4005, 4007, 3000, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 255, 263, 200, 18, ( context == null || !context.DoNotColor ) ? 1061591 : 1061590, LabelColor, false, false ); } // **************************************** // For dragon scales if ( craftSystem.CraftSubRes2.Init ) { AddPage( 0 ); string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int amount; int resIndex = ( context == null ? -1 : context.LastResourceIndex2 ); if ( resIndex > -1 ) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt( resIndex ); nameString = subResource.NameString; nameNumber = subResource.NameNumber; amount = GetAmount( subResource.ItemType ); } else amount = GetAmount( craftSystem.CraftSubRes2.ResType ); if ( nameNumber > 0 ) { AddHtmlLocalized( 50, 385, 150, 18, nameNumber, amount.ToString(), LabelColor, false, false ); AddKRHtmlLocalized( 50, 385, 150, 18, nameNumber, LabelColor, false, false ); } else AddLabel( 50, 385, LabelHue, nameString ); AddPage( 10 ); AddButton( 220, 260, 4005, 4007, 3001, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 255, 263, 200, 18, ( context == null || !context.DoNotColor ) ? 1061591 : 1061590, LabelColor, false, false ); } // **************************************** // Notice if ( notice is int && (int) notice > 0 ) { AddPage( 0 ); AddHtmlLocalized( 170, 295, 350, 40, (int) notice, LabelColor, false, false ); } else if ( notice is string ) { AddPage( 0 ); AddHtml( 170, 295, 350, 40, String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice ), false, false ); } // **************************************** // Mark option if ( craftSystem.MarkOption ) { AddPage( 0 ); AddButton( 270, 362, 4005, 4007, 6000, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 305, 365, 150, 18, 1044017 + ( context == null ? 0 : (int) context.MarkOption ), LabelColor, false, false ); // MARK ITEM if ( context != null && context.MarkOption == CraftMarkOption.MarkItem ) AddKRButton( 0, 0, 0, 0, 6001, GumpButtonType.Page, 0 ); } // **************************************** // Quest Item option bool questItem = ( context != null && context.QuestItem ); AddPage( 0 ); AddButton( 270, 422, 0xFA5, 0xFA7, 6002, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 305, 425, 150, 18, questItem ? 1112534 : 1112533, LabelColor, false, false ); // **************************************** if ( context != null ) { if ( context.MakeLast ) AddKRButton( 0, 0, 0, 0, 6003, GumpButtonType.Page, 0 ); if ( context.MakeNumber ) AddKRButton( 0, 0, 0, 0, context.Total + 6100, GumpButtonType.Page, 0 ); if ( context.MakeMax ) AddKRButton( 0, 0, 0, 0, 6005, GumpButtonType.Page, 0 ); } if ( context != null ) { if ( context.Success ) context.Done++; int done = 0, total = 1; done = context.Done; total = context.Total; AddHtmlLocalized( 270, 465, 200, 18, 1079443, String.Format( "{0}@{1}", done, total ), FontColor, false, false ); // ~1_DONE~/~2_TOTAL~ COMPLETED if ( context.Making != null && context.Success ) m_MakeTimer = Timer.DelayCall( TimeSpan.FromSeconds( 1.25 ), new TimerCallback( DoMake ) ); context.Success = false; } }
private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base((Int32)40, (Int32)40) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; if (m_CraftSystem == DefAlchemy.CraftSystem) { m_CraftSystem = new DefAlchemy(); m_CraftSystem.CustomSystem(from); } else if (m_CraftSystem == DefBowFletching.CraftSystem) { m_CraftSystem = new DefBowFletching(); m_CraftSystem.CustomSystem(from); } else if (m_CraftSystem == DefBlacksmithy.CraftSystem) { m_CraftSystem = new DefBlacksmithy(); m_CraftSystem.CustomSystem(from); } else if (m_CraftSystem == DefCarpentry.CraftSystem) { m_CraftSystem = new DefCarpentry(); m_CraftSystem.CustomSystem(from); } else if (m_CraftSystem == DefTinkering.CraftSystem) { m_CraftSystem = new DefTinkering(); m_CraftSystem.CustomSystem(from); } else if (m_CraftSystem == DefTailoring.CraftSystem) { m_CraftSystem = new DefTailoring(); m_CraftSystem.CustomSystem(from); } else if (m_CraftSystem == DefCooking.CraftSystem) { m_CraftSystem = new DefCooking(); m_CraftSystem.CustomSystem(from); } CraftContext context = craftSystem.GetContext(from); from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); AddPage(0); AddBackground(0, 0, 530, 437, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 85, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 417); if (craftSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); } else { AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); } AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> AddHtmlLocalized(10, 302, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER> AddButton(15, 402, 4017, 4019, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 405, 150, 18, 1011441, LabelColor, false, false); // EXIT AddButton(270, 402, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 405, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST // Mark option if (craftSystem.MarkOption) { AddButton(270, 362, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM } // **************************************** // Resmelt option if (craftSystem.Resmelt) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** // Repair option if (craftSystem.Repair) { AddButton(270, 342, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 345, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM } // **************************************** // Enhance option if (craftSystem.CanEnhance) { AddButton(270, 382, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 385, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM } // **************************************** // Polish option if (craftSystem.CanFinish) { AddButton(400, 342, 4005, 4007, GetButtonID(6, 9), GumpButtonType.Reply, 0); AddHtml(435, 345, 150, 18, "<BASEFONT COLOR=#FFFFFF>FINISH ITEM</BASEFONT>", false, false); // FINISH ITEM AddButton(400, 382, 4005, 4007, GetButtonID(6, 10), GumpButtonType.Reply, 0); AddHtml(435, 385, 150, 18, "<BASEFONT COLOR=#FFFFFF>POLISH ITEM</BASEFONT>", false, false); // POLISH ITEM } // **************************************** if (notice is int && (int)notice > 0) { AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false); } else if (notice is string) { AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); } // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; } AddButton(15, 362, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 365, 250, 18, nameNumber, LabelColor, false, false); } else { //rw3 color hack //AddLabel( 50, 362, LabelHue, nameString ); AddHtml(50, 365, 250, 18, "<basefont color=\"" + LabelColor + "\">" + nameString + "</basefont>", false, false); } } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex2); if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; } AddButton(15, 382, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 385, 250, 18, nameNumber, LabelColor, false, false); } else { AddLabel(50, 385, LabelHue, nameString); } } // **************************************** CreateGroupList(); if (page == CraftPage.PickResource) { CreateResList(false); } else if (page == CraftPage.PickResource2) { CreateResList(true); } else if (context != null && context.LastGroupIndex > -1) { CreateItemList(context.LastGroupIndex); } }
private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base(40, 40) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); AddPage(0); AddBackground(0, 0, 530, 437, 5054); AddImageTiled(10, 10, 510, 22, 2624); // AddImageTiled(10, 292, 150, 45, 2624); // AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 85, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 417); if (craftSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); } else { AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); } AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> AddHtmlLocalized(10, 302, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER> int textHue = 2499; int highlightColor = 2599; //Guide AddButton(10, 0, 2094, 2095, 1000, GumpButtonType.Reply, 0); AddLabel(35, 5, textHue, "Guide"); #region Left Side Button Controls //Smelt Mode if (craftSystem.Recycle) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 9), GumpButtonType.Reply, 0); switch (context.RecycleOption) { case CraftRecycleOption.RecycleItem: AddLabel(50, 345, textHue, "Recycle Mode: Single Item"); break; case CraftRecycleOption.RecycleAllNonExceptional: AddLabel(50, 345, textHue, "Recycle Mode: All Non-Exceptional"); break; case CraftRecycleOption.RecycleAll: AddLabel(50, 345, textHue, "Recycle Mode: All"); break; } } //Smelt Button if (craftSystem.Recycle) { AddButton(15, 362, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); if (context.RecycleOption == CraftRecycleOption.RecycleItem) { AddLabel(50, 365, textHue, "Recycle Item"); } else { AddLabel(50, 365, textHue, "Recyle Items (Select Type)"); } } //Repair Button if (craftSystem.Repair) { AddButton(15, 382, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); AddLabel(50, 385, textHue, "Repair Item"); } //Exit Button AddButton(15, 402, 4017, 4019, 0, GumpButtonType.Reply, 0); AddLabel(50, 405, textHue, "Exit"); #endregion #region Right Side Button Controls //Material Selection if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); Type resourceType = craftSystem.CraftSubRes.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(270, 342, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); AddLabel(305, 345, textHue, nameString + " (" + resourceCount + " Available)"); } // Highlight Skillgain AddButton(270, 362, 4005, 4007, GetButtonID(6, 10), GumpButtonType.Reply, 0); if (context.HighlightSkillGainItems) { AddLabel(305, 365, highlightColor, "Highlight Skillgain Items"); } else { AddLabel(305, 365, textHue, "Do Not Highlight Skillgain Items"); } // Mark Button if (craftSystem.MarkOption) { AddButton(270, 382, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); if (context == null) { AddLabel(305, 385, textHue, "Do Not Mark"); } else { switch (context.MarkOption) { case CraftMarkOption.DoNotMark: AddLabel(305, 385, textHue, "Do Not Mark"); break; case CraftMarkOption.MarkItem: AddLabel(305, 385, textHue, "Mark Item"); break; case CraftMarkOption.PromptForMark: AddLabel(305, 385, textHue, "Prompt For Mark"); break; } } } //Make Last AddButton(270, 402, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); AddLabel(305, 405, textHue, "Make Last Item"); #endregion if (notice is int && (int)notice > 0) { AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false); } else if (notice is string) { AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); } CreateGroupList(); if (page == CraftPage.PickResource) { CreateResList(false, from); } else if (page == CraftPage.PickResource2) { CreateResList(true, from); } else if (context != null && context.LastGroupIndex > -1) { CreateItemList(context.LastGroupIndex); } }
public CraftGump( Mobile from, CraftSystem craftSystem, BaseTool tool, TextDefinition notice, CraftPage page = CraftPage.None ) : base(40, 40) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; var context = craftSystem.GetContext(from); from.CloseGump <CraftGump>(); from.CloseGump <CraftGumpItem>(); AddPage(0); AddBackground(0, 0, 530, 437, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 85, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 417); if (craftSystem.GumpTitle.Number > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitle.Number, LabelColor); } else { AddHtml(10, 12, 510, 20, craftSystem.GumpTitle.String); } AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor); // <CENTER>SELECTIONS</CENTER> AddHtmlLocalized(10, 302, 150, 25, 1044012, LabelColor); // <CENTER>NOTICES</CENTER> AddButton(15, 402, 4017, 4019, 0); AddHtmlLocalized(50, 405, 150, 18, 1011441, LabelColor); // EXIT AddButton(270, 402, 4005, 4007, GetButtonID(6, 2)); AddHtmlLocalized(305, 405, 150, 18, 1044013, LabelColor); // MAKE LAST // Mark option if (craftSystem.MarkOption) { AddButton(270, 362, 4005, 4007, GetButtonID(6, 6)); AddHtmlLocalized( 305, 365, 150, 18, 1044017 + (int)(context?.MarkOption ?? CraftMarkOption.MarkItem), // MARK ITEM LabelColor ); } // **************************************** // Resmelt option if (craftSystem.Resmelt) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 1)); AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor); // SMELT ITEM } // **************************************** // Repair option if (craftSystem.Repair) { AddButton(270, 342, 4005, 4007, GetButtonID(6, 5)); AddHtmlLocalized(305, 345, 150, 18, 1044260, LabelColor); // REPAIR ITEM } // **************************************** // Enhance option if (craftSystem.CanEnhance) { AddButton(270, 382, 4005, 4007, GetButtonID(6, 8)); AddHtmlLocalized(305, 385, 150, 18, 1061001, LabelColor); // ENHANCE ITEM } // **************************************** if (notice != null) { if (notice.Number > 0) { AddHtmlLocalized(170, 295, 350, 40, notice.Number, LabelColor); } else { AddHtml(170, 295, 350, 40, $"<BASEFONT COLOR=#{FontColor:X6}>{notice.String}</BASEFONT>"); } } // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { var nameString = craftSystem.CraftSubRes.Name.String; var nameNumber = craftSystem.CraftSubRes.Name.Number; var resIndex = context?.LastResourceIndex ?? -1; var resourceType = craftSystem.CraftSubRes.ResType; if (resIndex > -1) { var subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.Name.String; nameNumber = subResource.Name.Number; resourceType = subResource.ItemType; } var resourceCount = 0; if (from.Backpack != null) { var items = from.Backpack.FindItemsByType(resourceType); for (var i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(15, 362, 4005, 4007, GetButtonID(6, 0)); if (nameNumber > 0) { AddHtmlLocalized(50, 365, 250, 18, nameNumber, resourceCount.ToString(), LabelColor); } else { AddLabel(50, 362, LabelHue, $"{nameString} ({resourceCount} Available)"); } } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { var nameString = craftSystem.CraftSubRes2.Name.String; var nameNumber = craftSystem.CraftSubRes2.Name.Number; var resIndex = context?.LastResourceIndex2 ?? -1; var resourceType = craftSystem.CraftSubRes2.ResType; if (resIndex > -1) { var subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.Name.String; nameNumber = subResource.Name.Number; resourceType = subResource.ItemType; } var resourceCount = 0; if (from.Backpack != null) { var items = from.Backpack.FindItemsByType(resourceType); for (var i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(15, 382, 4005, 4007, GetButtonID(6, 7)); if (nameNumber > 0) { AddHtmlLocalized(50, 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor); } else { AddLabel(50, 385, LabelHue, $"{nameString} ({resourceCount} Available)"); } } // **************************************** CreateGroupList(); if (page == CraftPage.PickResource) { CreateResList(false, from); } else if (page == CraftPage.PickResource2) { CreateResList(true, from); } else if (context?.LastGroupIndex > -1) { CreateItemList(context.LastGroupIndex); } }
private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page, int resind) : base(40, 40) { from.CloseGump(typeof(CraftGump)); m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; m_LastResourceIndex = resind; CraftContext context = craftSystem.GetContext(from); if (resind > -1) { context.LastResourceIndex = m_LastResourceIndex; } from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); AddPage(0); AddBackground(0, 0, 530, 437, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 85, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 417); if (craftSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); } else { AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); } AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> AddHtmlLocalized(10, 302, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER> AddButton(15, 402, 4017, 4019, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 405, 150, 18, 1011441, LabelColor, false, false); // EXIT AddButton(270, 402, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 405, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST // Mark option if (craftSystem.MarkOption) { AddButton(270, 362, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM } // **************************************** // Resmelt option if (craftSystem.Resmelt) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** // Repair option if (craftSystem.Repair) { AddButton(270, 342, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 345, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM } // **************************************** // Enhance option if (craftSystem.CanEnhance) { AddButton(270, 382, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 385, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM } // **************************************** if (notice is int && (int)notice > 0) { AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false); } else if (notice is string) { AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); } // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); Type resourceType = craftSystem.CraftSubRes.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } //Taran: Bad fix to check for boards in backpack when using carpenting //Needs to be fixed in a better way if (m_CraftSystem is DefCarpentry) { Item[] item; if (resourceType == typeof(Log)) { item = from.Backpack.FindItemsByType(typeof(Board), true); } else if (resourceType == typeof(OakLog)) { item = from.Backpack.FindItemsByType(typeof(OakBoard), true); } else if (resourceType == typeof(AshLog)) { item = from.Backpack.FindItemsByType(typeof(AshBoard), true); } else if (resourceType == typeof(OakLog)) { item = from.Backpack.FindItemsByType(typeof(OakBoard), true); } else if (resourceType == typeof(YewLog)) { item = from.Backpack.FindItemsByType(typeof(YewBoard), true); } else if (resourceType == typeof(HeartwoodLog)) { item = from.Backpack.FindItemsByType(typeof(HeartwoodBoard), true); } else if (resourceType == typeof(BloodwoodLog)) { item = from.Backpack.FindItemsByType(typeof(BloodwoodBoard), true); } else if (resourceType == typeof(FrostwoodLog)) { item = from.Backpack.FindItemsByType(typeof(FrostwoodBoard), true); } else if (resourceType == typeof(MahoganyLog)) { item = from.Backpack.FindItemsByType(typeof(MahoganyBoard), true); } else if (resourceType == typeof(CedarLog)) { item = from.Backpack.FindItemsByType(typeof(CedarBoard), true); } else if (resourceType == typeof(WillowLog)) { item = from.Backpack.FindItemsByType(typeof(WillowBoard), true); } else if (resourceType == typeof(MystWoodLog)) { item = from.Backpack.FindItemsByType(typeof(MystWoodBoard), true); } else { item = from.Backpack.FindItemsByType(typeof(Board), true); } for (int j = 0; j < item.Length; ++j) { resourceCount += item[j].Amount; } } } AddButton(15, 362, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 365, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { AddLabel(50, 362, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex2); Type resourceType = craftSystem.CraftSubRes2.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } //Taran: Bad fix to check for boards in backpack when using carpenting //Needs to be fixed in a better way if (m_CraftSystem is DefCarpentry) { Item[] item; if (resourceType == typeof(Log)) { item = from.Backpack.FindItemsByType(typeof(Board), true); } else if (resourceType == typeof(OakLog)) { item = from.Backpack.FindItemsByType(typeof(OakBoard), true); } else if (resourceType == typeof(AshLog)) { item = from.Backpack.FindItemsByType(typeof(AshBoard), true); } else if (resourceType == typeof(OakLog)) { item = from.Backpack.FindItemsByType(typeof(OakBoard), true); } else if (resourceType == typeof(YewLog)) { item = from.Backpack.FindItemsByType(typeof(YewBoard), true); } else if (resourceType == typeof(HeartwoodLog)) { item = from.Backpack.FindItemsByType(typeof(HeartwoodBoard), true); } else if (resourceType == typeof(BloodwoodLog)) { item = from.Backpack.FindItemsByType(typeof(BloodwoodBoard), true); } else if (resourceType == typeof(FrostwoodLog)) { item = from.Backpack.FindItemsByType(typeof(FrostwoodBoard), true); } else if (resourceType == typeof(MahoganyLog)) { item = from.Backpack.FindItemsByType(typeof(MahoganyBoard), true); } else if (resourceType == typeof(CedarLog)) { item = from.Backpack.FindItemsByType(typeof(CedarBoard), true); } else if (resourceType == typeof(WillowLog)) { item = from.Backpack.FindItemsByType(typeof(WillowBoard), true); } else if (resourceType == typeof(MystWoodLog)) { item = from.Backpack.FindItemsByType(typeof(MystWoodBoard), true); } else { item = from.Backpack.FindItemsByType(typeof(Board), true); } for (int j = 0; j < item.Length; ++j) { resourceCount += item[j].Amount; } } } AddButton(15, 382, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { AddLabel(50, 385, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** CreateGroupList(); if (page == CraftPage.PickResource) { CreateResList(false, from); } else if (page == CraftPage.PickResource2) { CreateResList(true, from); } else if (context != null && context.LastGroupIndex > -1) { CreateItemList(context.LastGroupIndex); } }
/*public CraftGump( Mobile from, CraftSystem craftSystem, BaseTool tool ): this( from, craftSystem, -1, -1, tool, null ) * { * }*/ public CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : this(from, craftSystem, tool, notice, page, -1) { }
private CraftGump( Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page ) : base(40, 40) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext( from ); from.CloseGump( typeof( CraftGump ) ); from.CloseGump( typeof( CraftGumpItem ) ); AddPage( 0 ); AddBackground(0, 0, 530, 437, 9270); // AddBackground( 0, 0, 530, 437, 5054 ); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 85, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); //AddAlphaRegion( 10, 10, 510, 417 ); if ( craftSystem.GumpTitleNumber > 0 ) AddHtmlLocalized( 10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false ); else AddHtml( 10, 12, 510, 20, craftSystem.GumpTitleString, false, false ); AddHtml(10, 37, 200, 22, "<CENTER><BASEFONT COLOR=#800000>CATEGORIA</CENTER>", false, false); // <CENTER>CATEGORIES</CENTER> AddHtml(215, 37, 305, 22, "<CENTER><BASEFONT COLOR=#800000>SELEÇÃO</CENTER>", false, false); // <CENTER>SELECTIONS</CENTER> AddHtml(10, 302, 150, 25, "<CENTER><BASEFONT COLOR=#800000>AVISOS</CENTER>", false, false); // <CENTER>NOTICES</CENTER> AddButton( 15, 402, 4017, 4019, 0, GumpButtonType.Reply, 0 ); AddHtml(50, 405, 150, 18, "Sair", false, false); // EXIT AddButton( 270, 402, 4005, 4007, GetButtonID( 6, 2 ), GumpButtonType.Reply, 0 ); AddHtml(305, 405, 150, 18, "Fazer Último", false, false); // MAKE LAST // Mark option if ( craftSystem.MarkOption ) { AddButton( 270, 362, 4005, 4007, GetButtonID( 6, 6 ), GumpButtonType.Reply, 0 ); //AddHtmlLocalized( 305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false ); // MARK ITEM AddHtml(305, 365, 150, 18,"Assinar Item", false, false); // MARK ITEM } // **************************************** // Resmelt option if ( craftSystem.Resmelt ) { AddButton( 15, 342, 4005, 4007, GetButtonID( 6, 1 ), GumpButtonType.Reply, 0 ); AddHtmlLocalized( 50, 345, 150, 18, 1044259, LabelColor, false, false ); // SMELT ITEM } // **************************************** // Repair option if ( craftSystem.Repair ) { AddButton( 270, 342, 4005, 4007, GetButtonID( 6, 5 ), GumpButtonType.Reply, 0 ); //AddHtmlLocalized( 305, 345, 150, 18, 1044260, LabelColor, false, false ); // REPAIR ITEM AddHtml(305, 345, 150, 18, "Reparar Item", false, false); // REPAIR ITEM } // **************************************** // Enhance option if ( false && craftSystem.CanEnhance ) { AddButton( 270, 382, 4005, 4007, GetButtonID( 6, 8 ), GumpButtonType.Reply, 0 ); AddHtmlLocalized( 305, 385, 150, 18, 1061001, LabelColor, false, false ); // ENHANCE ITEM } // **************************************** if (notice is int && (int)notice > 0) { switch((int)notice) { case 1044038: m_From.SendMessage("Sua ferramenta quebrou!"); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Sua ferramenta quebrou!"), false, false); break; case 1044043: m_From.SendMessage("Voce falhou ao criar o item, e perdeu algum material."); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Voce falhou ao criar o item, e perdeu algum material."), false, false); break; case 1044157: m_From.SendMessage("Voce falhou ao criar o item, mas nao perdeu nenhum material."); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Voce falhou ao criar o item, mas nao perdeu nenhum material."), false, false); break; case 502785: from.SendMessage("Voce criou um item de baixa qualidade."); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Voce criou um item de baixa qualidade."), false, false); break; case 1044156: from.SendMessage("Voce criou um item de qualidade excepcional e assinou a obra!"); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Voce criou um item de qualidade excepcional e assinou a obra!"), false, false); break; case 1044155: from.SendMessage("Voce criou um item de qualidade excepcional!"); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Voce criou um item de qualidade excepcional!"), false, false); break; case 1044154: from.SendMessage("Voce criou o item."); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Voce criou o item."), false, false); break; default: AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false); break; } } else if (notice is string) { AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); } // If the system has more than one resource if ( craftSystem.CraftSubRes.Init ) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = ( context == null ? -1 : context.LastResourceIndex ); Type resourceType = craftSystem.CraftSubRes.ResType; if ( resIndex > -1 ) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt( resIndex ); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if ( from.Backpack != null ) { Item[] items = from.Backpack.FindItemsByType( resourceType, true ); for ( int i = 0; i < items.Length; ++i ) resourceCount += items[i].Amount; } AddButton( 15, 362, 4005, 4007, GetButtonID( 6, 0 ), GumpButtonType.Reply, 0 ); if ( nameNumber > 0 ) AddHtmlLocalized( 50, 365, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false ); else AddLabel( 50, 362, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) ); } // **************************************** // For dragon scales if ( craftSystem.CraftSubRes2.Init ) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = ( context == null ? -1 : context.LastResourceIndex2 ); Type resourceType = craftSystem.CraftSubRes2.ResType; if ( resIndex > -1 ) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt( resIndex ); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if ( from.Backpack != null ) { Item[] items = from.Backpack.FindItemsByType( resourceType, true ); for ( int i = 0; i < items.Length; ++i ) resourceCount += items[i].Amount; } AddButton( 15, 382, 4005, 4007, GetButtonID( 6, 7 ), GumpButtonType.Reply, 0 ); if ( nameNumber > 0 ) AddHtmlLocalized( 50, 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false ); else AddLabel( 50, 385, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) ); } // **************************************** CreateGroupList(); if ( page == CraftPage.PickResource ) CreateResList( false, from ); else if ( page == CraftPage.PickResource2 ) CreateResList( true, from ); else if ( context != null && context.LastGroupIndex > -1 ) CreateItemList( context.LastGroupIndex ); }
private CraftGump(Mobile from, CraftSystem craftSystem, IBaseTool tool, object notice, CraftPage page) : base(40, 40) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); AddPage(0); AddBackground(0, 0, 530, 437, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 25, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 85, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 417); if (craftSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); } else { AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); } AddHtmlLocalized(10, 38, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 38, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> AddHtmlLocalized(10, 293, 150, 22, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER> AddButton(15, 402, 4017, 4019, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 405, 150, 18, 1011441, LabelColor, false, false); // EXIT AddButton(270, 402, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 405, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST // Mark option if (craftSystem.MarkOption) { AddButton(270, 362, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); AddHtmlLocalized( 305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM } // **************************************** // Resmelt option if (craftSystem.Resmelt) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** // Repair option if (craftSystem.Repair) { AddButton(270, 342, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 345, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM } // **************************************** // Enhance option if (craftSystem.CanEnhance) { AddButton(270, 382, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 385, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM } // **************************************** if (notice is int && (int)notice > 0) { AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false); } else if (notice is string) { AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); } // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); Type resourceType = craftSystem.CraftSubRes.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); resourceCount += items.Sum(t => t.Amount); } AddButton(15, 362, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized( 50, 365, 250, 18, nameNumber, resourceCount.ToString(CultureInfo.InvariantCulture), LabelColor, false, false); } else { AddLabel(50, 362, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex2); Type resourceType = craftSystem.CraftSubRes2.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); resourceCount += items.Sum(t => t.Amount); } AddButton(15, 382, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized( 50, 385, 250, 18, nameNumber, resourceCount.ToString(CultureInfo.InvariantCulture), LabelColor, false, false); } else { AddLabel(50, 385, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** CreateGroupList(); switch (page) { case CraftPage.PickResource: CreateResList(false, from); break; case CraftPage.PickResource2: CreateResList(true, from); break; default: { if (context != null && context.LastGroupIndex > -1) { CreateItemList(context.LastGroupIndex); } } break; } }
private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base(40, 40) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); AddPage(0); AddBackground(0, 0, 530, 437, 9270); // AddBackground( 0, 0, 530, 437, 5054 ); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 85, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); //AddAlphaRegion( 10, 10, 510, 417 ); if (craftSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); } else { AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); } AddHtml(10, 37, 200, 22, "<CENTER><BASEFONT COLOR=#800000>CATEGORIA</CENTER>", false, false); // <CENTER>CATEGORIES</CENTER> AddHtml(215, 37, 305, 22, "<CENTER><BASEFONT COLOR=#800000>SELEÇÃO</CENTER>", false, false); // <CENTER>SELECTIONS</CENTER> AddHtml(10, 302, 150, 25, "<CENTER><BASEFONT COLOR=#800000>AVISOS</CENTER>", false, false); // <CENTER>NOTICES</CENTER> AddButton(15, 402, 4017, 4019, 0, GumpButtonType.Reply, 0); AddHtml(50, 405, 150, 18, "Sair", false, false); // EXIT AddButton(270, 402, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); AddHtml(305, 405, 150, 18, "Fazer Último", false, false); // MAKE LAST // Mark option if (craftSystem.MarkOption) { AddButton(270, 362, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); //AddHtmlLocalized( 305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false ); // MARK ITEM AddHtml(305, 365, 150, 18, "Assinar Item", false, false); // MARK ITEM } // **************************************** // Resmelt option if (craftSystem.Resmelt) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** // Repair option if (craftSystem.Repair) { AddButton(270, 342, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); //AddHtmlLocalized( 305, 345, 150, 18, 1044260, LabelColor, false, false ); // REPAIR ITEM AddHtml(305, 345, 150, 18, "Reparar Item", false, false); // REPAIR ITEM } // **************************************** // Enhance option if (false && craftSystem.CanEnhance) { AddButton(270, 382, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 385, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM } // **************************************** if (notice is int && (int)notice > 0) { switch ((int)notice) { case 1044038: m_From.SendMessage("Sua ferramenta quebrou!"); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Sua ferramenta quebrou!"), false, false); break; case 1044043: m_From.SendMessage("Voce falhou ao criar o item, e perdeu algum material."); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Voce falhou ao criar o item, e perdeu algum material."), false, false); break; case 1044157: m_From.SendMessage("Voce falhou ao criar o item, mas nao perdeu nenhum material."); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Voce falhou ao criar o item, mas nao perdeu nenhum material."), false, false); break; case 502785: from.SendMessage("Voce criou um item de baixa qualidade."); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Voce criou um item de baixa qualidade."), false, false); break; case 1044156: from.SendMessage("Voce criou um item de qualidade excepcional e assinou a obra!"); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Voce criou um item de qualidade excepcional e assinou a obra!"), false, false); break; case 1044155: from.SendMessage("Voce criou um item de qualidade excepcional!"); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Voce criou um item de qualidade excepcional!"), false, false); break; case 1044154: from.SendMessage("Voce criou o item."); AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, "Voce criou o item."), false, false); break; default: AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false); break; } } else if (notice is string) { AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); } // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); Type resourceType = craftSystem.CraftSubRes.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(15, 362, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 365, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { AddLabel(50, 362, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex2); Type resourceType = craftSystem.CraftSubRes2.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(15, 382, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { AddLabel(50, 385, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** CreateGroupList(); if (page == CraftPage.PickResource) { CreateResList(false, from); } else if (page == CraftPage.PickResource2) { CreateResList(true, from); } else if (context != null && context.LastGroupIndex > -1) { CreateItemList(context.LastGroupIndex); } }
private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base(40, 40) { this.m_From = from; this.m_CraftSystem = craftSystem; this.m_Tool = tool; this.m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); this.AddPage(0); AddBackground(0, 0, 530, 497, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 145, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 477); if (craftSystem.GumpTitleNumber > 0) { this.AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); } else { this.AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); } AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> AddHtmlLocalized(10, 302, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER> this.AddButton(15, 442, 4017, 4019, 0, GumpButtonType.Reply, 0); this.AddHtmlLocalized(50, 445, 150, 18, 1011441, LabelColor, false, false); // EXIT this.AddButton(115, 442, 4017, 4019, GetButtonID(6, 11), GumpButtonType.Reply, 0); this.AddHtmlLocalized(150, 445, 150, 18, 1112698, LabelColor, false, false); // CANCEL MAKE // Repair option if (m_CraftSystem.Repair) { AddButton(270, 342, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 345, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM } // **************************************** // Mark option if (m_CraftSystem.MarkOption) { AddButton(270, 362, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM } // **************************************** // Enhance option if (m_CraftSystem.CanEnhance) { AddButton(270, 382, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 385, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM } // **************************************** #region SA // Alter option if (Core.SA && m_CraftSystem.CanAlter) { AddButton(270, 402, 4005, 4007, GetButtonID(6, 9), GumpButtonType.Reply, 0); AddHtmlLocalized(304, 405, 250, 18, 1094726, LabelColor, false, false); // ALTER ITEM (Gargoyle) } // **************************************** // Quest item if (Core.SA) { AddButton(270, 422, 4005, 4007, GetButtonID(6, 10), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 425, 150, 18, context != null && context.QuestOption == CraftQuestOption.QuestItem ? 1112534 : 1112533, LabelColor, false, false); // QUEST ITEM } // **************************************** #endregion AddButton(270, 442, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 445, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST #region Stygian Abyss int total = 1; int made = 0; if (Locked && AutoCraftTimer.AutoCraftTable.ContainsKey(m_From)) { AutoCraftTimer timer = AutoCraftTimer.AutoCraftTable[m_From]; if (timer != null) { total = timer.Amount; made = timer.Attempts; } else { if (context != null) { total = context.MakeTotal; } } } string args = String.Format("{0}\t{1}", made.ToString(), total.ToString()); AddHtmlLocalized(270, 468, 150, 18, 1079443, args, LabelColor, false, false); //~1_DONE~/~2_TOTAL~ COMPLETED #endregion // Resmelt option if (m_CraftSystem.Resmelt) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** if (notice is int && (int)notice > 0) { this.AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false); } else if (notice is string) { this.AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); } // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); Type resourceType = craftSystem.CraftSubRes.ResType; //Type resourceType2 = GetAltType(resourceType); if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } //daat99 OWLTR start - craft from storage ulong storageCount = MasterStorageUtils.GetPlayersStorageItemCount(from as Mobiles.PlayerMobile, resourceType); if (storageCount > 0) { if (storageCount < int.MaxValue && storageCount + (ulong)resourceCount < int.MaxValue) { resourceCount += (int)storageCount; } else { resourceCount = int.MaxValue; } } //daat99 OWLTR end - craft from storage } this.AddButton(15, 382, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) { if (context.DoNotColor) { AddLabel(50, 385, LabelHue, "*"); } AddHtmlLocalized(50 + (context.DoNotColor ? 13 : 0), 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { AddLabel(50, 382, LabelHue, (context.DoNotColor ? "*" : "") + String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex2); Type resourceType = craftSystem.CraftSubRes2.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } //daat99 OWLTR start - craft from storage ulong storageCount = MasterStorageUtils.GetPlayersStorageItemCount(from as Mobiles.PlayerMobile, resourceType); if (storageCount > 0) { if (storageCount < int.MaxValue && storageCount + (ulong)resourceCount < int.MaxValue) { resourceCount += (int)storageCount; } else { resourceCount = int.MaxValue; } } //daat99 OWLTR end - craft from storage } this.AddButton(15, 402, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 405, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { AddLabel(50, 405, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** this.CreateGroupList(); if (page == CraftPage.PickResource) { this.CreateResList(false, from); } else if (page == CraftPage.PickResource2) { this.CreateResList(true, from); } else if (context != null && context.LastGroupIndex > -1) { this.CreateItemList(context.LastGroupIndex); } }
private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base(40, 40) { this.m_From = from; this.m_CraftSystem = craftSystem; this.m_Tool = tool; this.m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); this.AddPage(0); this.AddBackground(0, 0, 550, 587, 5054); this.AddImageTiled(10, 10, 530, 22, 2624); //Section for Gump Heading this.AddImageTiled(10, 375, 132, 45, 2624); //Section for Notices this.AddImageTiled(146, 375, 395, 45, 2624); //Section across from Notices this.AddImageTiled(10, 422, 530, 155, 2624); //Section where Exit is this.AddImageTiled(10, 37, 200, 335, 2624); //Section for Categories this.AddImageTiled(215, 37, 325, 335, 2624); //Section for Sublisted Items this.AddAlphaRegion(10, 10, 530, 567); if (craftSystem.GumpTitleNumber > 0) this.AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); else this.AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); this.AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> this.AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> this.AddHtmlLocalized(10, 385, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER> this.AddButton(15, 542, 4017, 4019, 0, GumpButtonType.Reply, 0); this.AddHtmlLocalized(50, 545, 150, 18, 1011441, LabelColor, false, false); // EXIT this.AddButton(270, 542, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); this.AddHtmlLocalized(305, 545, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST this.AddButton(270, 522, 4005, 4007, GetButtonID(6, 10), GumpButtonType.Reply, 0); this.AddHtmlLocalized(305, 525, 150, 18, 1112533 + (context == null ? 0 : (int)context.QuestOption), LabelColor, false, false); // QUEST ITEM this.AddButton(115, 542, 4017, 4019, GetButtonID(6, 11), GumpButtonType.Reply, 0); this.AddHtmlLocalized(150, 545, 150, 18, 1112698, LabelColor, false, false); // CANCEL MAKE // Mark option if (craftSystem.MarkOption) { this.AddButton(270, 462, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); this.AddHtmlLocalized(305, 465, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM } // **************************************** // Resmelt option if (craftSystem.Resmelt) { this.AddButton(15, 442, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); this.AddHtmlLocalized(50, 445, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** // Repair option if (craftSystem.Repair) { this.AddButton(270, 442, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); this.AddHtmlLocalized(305, 445, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM } // **************************************** // Enhance option if (craftSystem.CanEnhance) { this.AddButton(270, 482, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); this.AddHtmlLocalized(305, 485, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM } // **************************************** // Alter option if (craftSystem.CanAlter) { this.AddButton(270, 502, 4005, 4007, GetButtonID(6, 9), GumpButtonType.Reply, 0); this.AddHtmlLocalized(304, 505, 1152, 18, 1094726, LabelColor, false, false); // ALTER ITEM } // **************************************** if (notice is int && (int)notice > 0) this.AddHtmlLocalized(170, 377, 350, 40, (int)notice, LabelColor, false, false); else if (notice is string) this.AddHtml(170, 377, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); Type resourceType = craftSystem.CraftSubRes.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) resourceCount += items[i].Amount; Type secondaryType = Craft.CraftItem.GetSecondaryResourceType(resourceType); if (secondaryType != null) { items = from.Backpack.FindItemsByType(secondaryType, true); resourceCount += items.Sum(item => item.Amount); } } this.AddButton(15, 462, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) this.AddHtmlLocalized(50, 465, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); else this.AddLabel(50, 465, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex2); Type resourceType = craftSystem.CraftSubRes2.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) resourceCount += items[i].Amount; } this.AddButton(15, 482, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) this.AddHtmlLocalized(50, 485, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); else this.AddLabel(50, 485, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } // **************************************** this.CreateGroupList(); if (page == CraftPage.PickResource) this.CreateResList(false, from); else if (page == CraftPage.PickResource2) this.CreateResList(true, from); else if (context != null && context.LastGroupIndex > -1) this.CreateItemList(context.LastGroupIndex); }
private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base(40, 40) { From = from; CraftSystem = craftSystem; Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump <CraftGump>(); from.CloseGump <CraftGumpItem>(); AddPage(0); AddBackground(0, 0, 530, 487, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 150, 45, 2624); AddImageTiled(165, 342, 355, 45, 2624); AddImageTiled(10, 392, 510, 85, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 467); if (craftSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); } else { AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); } AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> AddHtml(10, 302, 150, 25, "<BASEFONT COLOR=#FFFFFF><CENTER>MAKE AMOUNT</CENTER></BASEFONT>", false, false); AddHtmlLocalized(10, 352, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER> AddButton(15, 452, 4017, 4019, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 455, 150, 18, 1011441, LabelColor, false, false); // EXIT AddButton(320, 452, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); AddHtmlLocalized(355, 455, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST // Mark option if (craftSystem.MarkOption) { AddButton(320, 412, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); AddHtmlLocalized(355, 415, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM } // **************************************** // Resmelt option if (craftSystem.Resmelt) { AddButton(15, 392, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); AddHtmlLocalized(50, 395, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** // Repair option if (craftSystem.Repair) { AddButton(320, 392, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); AddHtmlLocalized(355, 395, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM } // **************************************** // Fortify option if (craftSystem.Fortify) { AddButton(320, 432, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); AddHtml(355, 435, 150, 18, "<BASEFONT COLOR=#FFFFFF>FORTIFY ITEM</BASEFONT>", false, false); // FORTIFY ITEM } // **************************************** // Make amount AddImage(180, 302, 2443); AddTextEntry(190, 304, 30, 18, LabelHue, 0, context.CraftNumber.ToString()); // **************************************** if (notice is int && (int)notice > 0) { AddHtmlLocalized(170, 345, 350, 40, (int)notice, LabelColor, false, false); } else if (notice is string) { AddHtml(170, 345, 350, 40, $"<BASEFONT COLOR=#{FontColor:X6}>{notice}</BASEFONT>", false, false); } // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = context == null ? -1 : context.LastResourceIndex; Type resourceType = craftSystem.CraftSubRes.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(15, 412, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 415, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { AddLabel(50, 412, LabelHue, $"{nameString} ({resourceCount} Available)"); } } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = context == null ? -1 : context.LastResourceIndex2; Type resourceType = craftSystem.CraftSubRes2.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(15, 432, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 435, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { AddLabel(50, 435, LabelHue, $"{nameString} ({resourceCount} Available)"); } } // **************************************** CreateGroupList(); if (page == CraftPage.PickResource) { CreateResList(false, from); } else if (page == CraftPage.PickResource2) { CreateResList(true, from); } else if (context != null && context.LastGroupIndex > -1) { CreateItemList(context.LastGroupIndex); } }
private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base(40, 40) { this.m_From = from; this.m_CraftSystem = craftSystem; this.m_Tool = tool; this.m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump(typeof(CraftGump)); from.CloseGump(typeof(CraftGumpItem)); this.AddPage(0); this.AddBackground(0, 0, 550, 587, 5054); this.AddImageTiled(10, 10, 530, 22, 2624); //Section for Gump Heading this.AddImageTiled(10, 375, 132, 45, 2624); //Section for Notices this.AddImageTiled(146, 375, 395, 45, 2624); //Section across from Notices this.AddImageTiled(10, 422, 530, 155, 2624); //Section where Exit is this.AddImageTiled(10, 37, 200, 335, 2624); //Section for Categories this.AddImageTiled(215, 37, 325, 335, 2624); //Section for Sublisted Items this.AddAlphaRegion(10, 10, 530, 567); if (craftSystem.GumpTitleNumber > 0) { this.AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false); } else { this.AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false); } this.AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> this.AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> this.AddHtmlLocalized(10, 385, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER> this.AddButton(15, 542, 4017, 4019, 0, GumpButtonType.Reply, 0); this.AddHtmlLocalized(50, 545, 150, 18, 1011441, LabelColor, false, false); // EXIT this.AddButton(270, 542, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); this.AddHtmlLocalized(305, 545, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST this.AddButton(270, 502, 4005, 4007, GetButtonID(6, 9), GumpButtonType.Reply, 0); this.AddLabel(304, 505, 1152, @"ALTER ITEM (GARGOYLE)"); this.AddButton(270, 522, 4005, 4007, GetButtonID(6, 10), GumpButtonType.Reply, 0); this.AddHtmlLocalized(305, 525, 150, 18, 1112533 + (context == null ? 0 : (int)context.QuestOption), LabelColor, false, false); // QUEST ITEM this.AddButton(115, 542, 4017, 4019, GetButtonID(6, 11), GumpButtonType.Reply, 0); this.AddHtmlLocalized(150, 545, 150, 18, 1112698, LabelColor, false, false); // CANCEL MAKE // Mark option if (craftSystem.MarkOption) { this.AddButton(270, 462, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); this.AddHtmlLocalized(305, 465, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM } // **************************************** // Resmelt option if (craftSystem.Resmelt) { this.AddButton(15, 442, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); this.AddHtmlLocalized(50, 445, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** // Repair option if (craftSystem.Repair) { this.AddButton(270, 442, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); this.AddHtmlLocalized(305, 445, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM } // **************************************** // Enhance option if (craftSystem.CanEnhance) { this.AddButton(270, 482, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); this.AddHtmlLocalized(305, 485, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM } // **************************************** if (notice is int && (int)notice > 0) { this.AddHtmlLocalized(170, 377, 350, 40, (int)notice, LabelColor, false, false); } else if (notice is string) { this.AddHtml(170, 377, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); } // If the system has more than one resource if (craftSystem.CraftSubRes.Init) { string nameString = craftSystem.CraftSubRes.NameString; int nameNumber = craftSystem.CraftSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); Type resourceType = craftSystem.CraftSubRes.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } //daat99 OWLTR start - craft from storage ulong storageCount = MasterStorageUtils.GetPlayersStorageItemCount(from as Mobiles.PlayerMobile, resourceType); if (storageCount > 0) { if (storageCount < int.MaxValue && storageCount + (ulong)resourceCount < int.MaxValue) { resourceCount += (int)storageCount; } else { resourceCount = int.MaxValue; } } //daat99 OWLTR end - craft from storage } this.AddButton(15, 462, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) { this.AddHtmlLocalized(50, 465, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { this.AddLabel(50, 465, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** // For dragon scales if (craftSystem.CraftSubRes2.Init) { string nameString = craftSystem.CraftSubRes2.NameString; int nameNumber = craftSystem.CraftSubRes2.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex2); Type resourceType = craftSystem.CraftSubRes2.ResType; if (resIndex > -1) { CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } //daat99 OWLTR start - craft from storage ulong storageCount = MasterStorageUtils.GetPlayersStorageItemCount(from as Mobiles.PlayerMobile, resourceType); if (storageCount > 0) { if (storageCount < int.MaxValue && storageCount + (ulong)resourceCount < int.MaxValue) { resourceCount += (int)storageCount; } else { resourceCount = int.MaxValue; } } //daat99 OWLTR end - craft from storage } this.AddButton(15, 482, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) { this.AddHtmlLocalized(50, 485, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { this.AddLabel(50, 485, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** this.CreateGroupList(); if (page == CraftPage.PickResource) { this.CreateResList(false, from); } else if (page == CraftPage.PickResource2) { this.CreateResList(true, from); } else if (context != null && context.LastGroupIndex > -1) { this.CreateItemList(context.LastGroupIndex); } }
public CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page = CraftPage.None) : base(40, 40) { m_From = from; m_CraftSystem = craftSystem; m_Tool = tool; m_Page = page; CraftContext context = craftSystem.GetContext(from); from.CloseGump <CraftGump>(); from.CloseGump <CraftGumpItem>(); AddPage(0); AddBackground(0, 0, 530, 437, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 85, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 417); if (craftSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor); } else { AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString); } AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor); // <CENTER>SELECTIONS</CENTER> AddHtmlLocalized(10, 302, 150, 25, 1044012, LabelColor); // <CENTER>NOTICES</CENTER> AddButton(15, 402, 4017, 4019, 0); AddHtmlLocalized(50, 405, 150, 18, 1011441, LabelColor); // EXIT AddButton(270, 402, 4005, 4007, GetButtonID(6, 2)); AddHtmlLocalized(305, 405, 150, 18, 1044013, LabelColor); // MAKE LAST // Mark option if (craftSystem.MarkOption) { AddButton(270, 362, 4005, 4007, GetButtonID(6, 6)); AddHtmlLocalized(305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor); // MARK ITEM } // **************************************** // Resmelt option if (craftSystem.Resmelt) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 1)); AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor); // SMELT ITEM } // **************************************** // Repair option if (craftSystem.Repair) { AddButton(270, 342, 4005, 4007, GetButtonID(6, 5)); AddHtmlLocalized(305, 345, 150, 18, 1044260, LabelColor); // REPAIR ITEM } // **************************************** // Enhance option if (craftSystem.CanEnhance) { AddButton(270, 382, 4005, 4007, GetButtonID(6, 8)); AddHtmlLocalized(305, 385, 150, 18, 1061001, LabelColor); // ENHANCE ITEM } // **************************************** if (notice is int noticeInt && noticeInt > 0) { AddHtmlLocalized(170, 295, 350, 40, noticeInt, LabelColor); }
/*public CraftGump( Mobile from, CraftSystem craftSystem, BaseTool tool ): this( from, craftSystem, -1, -1, tool, null ) { }*/ public CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : this(from, craftSystem, tool, notice, page, -1) { }