public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (info.ButtonID == 0) { return; } int index = info.ButtonID - 100; if (index >= 0 && index <= 12 && RunicReforging.HasSelection(index, m_ToReforge, m_Tool, m_Options, (int)m_Prefix, (int)m_Suffix)) { var context = ReforgingContext.GetContext(from); if (m_IsPrefix) { context.Prefix = (ReforgedPrefix)index; m_Prefix = (ReforgedPrefix)index; } else { context.Suffix = (ReforgedSuffix)index; m_Suffix = (ReforgedSuffix)index; } } from.SendGump(new RunicReforgingGump(from, m_ToReforge, m_Tool)); }
public RunicReforgingGump(Mobile from, Item toReforge, BaseRunicTool tool) : base(100, 100) { from.CloseGump(typeof(RunicReforgingGump)); from.CloseGump(typeof(ImbueGump)); m_Context = ReforgingContext.GetContext(from); if (!m_Context.Contexts.ContainsKey(tool)) { m_Context.Contexts[tool] = ReforgingOption.None; } m_Tool = tool; m_ToReforge = toReforge; m_Options = m_Context.Contexts[tool]; m_Prefix = m_Context.Prefix; m_Suffix = m_Context.Suffix; AddBackground(0, 0, 370, 440, 83); AddHtmlLocalized(10, 10, 350, 18, 1114513, "#1151952", 0x4BB7, false, false); // Runic Crafting Options int buttonHue = 0x4BB2; int buttonID = 0x4005; int y = 40; int idx = 0; for (int i = 0; i < Options.Length; i++) { ReforgingOption option = Options[i]; if ((m_Options & option) != 0) { if (CanReforge(from, option) && HasMetPrerequisite(option)) { buttonHue = 0x4BB2; buttonID = 4006; } else { buttonHue = 0x7652; buttonID = 4006; } } else { if (CanReforge(from, option) && HasMetPrerequisite(option)) { buttonHue = 0x6F7B; buttonID = 4005; } else { buttonHue = 0x7652; buttonID = 4006; } } if (HasMetPrerequisite(option) && CanReforge(from, option)) { AddButton(15, y, buttonID, buttonID, i + 100, GumpButtonType.Reply, 0); } AddHtmlLocalized(55, y, 250, 20, GetCliloc(option), buttonHue, false, false); y += 25; idx++; } int totalCharges = GetTotalCharges(); if ((m_Options & ReforgingOption.InspiredArtifice) != 0) { AddButton(15, 305, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(55, 305, 250, 20, 1152087, 0x6F7B, false, false); AddHtmlLocalized(190, 305, 250, 20, RunicReforging.GetName((int)m_Prefix), 0x5757, false, false); } if ((m_Options & ReforgingOption.SublimeArtifice) != 0) { AddButton(15, 330, 4005, 4007, 2, GumpButtonType.Reply, 0); AddHtmlLocalized(55, 330, 250, 20, 1152088, 0x6F7B, false, false); AddHtmlLocalized(190, 330, 250, 20, RunicReforging.GetName((int)m_Suffix), 0x5757, false, false); } AddHtmlLocalized(10, 363, 140, 22, 1114514, "#1152078", 0x4BB2, false, false); // CHARGES NEEDED: AddLabel(160, 363, 0x113, totalCharges.ToString()); AddHtmlLocalized(10, 385, 140, 22, 1114514, "#1152077", 0x6F7B, false, false); // TOOL CHARGES: AddLabel(160, 385, 0x44E, m_Tool.UsesRemaining.ToString()); AddButton(10, 412, 4017, 4018, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(45, 410, 200, 20, 1060675, 0x6F7B, false, false); // CLOSE AddButton(330, 363, 4014, 4016, 3, GumpButtonType.Reply, 0); AddHtmlLocalized(190, 363, 135, 22, 1114514, "#1152080", 0x6F7B, false, false); // REFORGE ITEM AddButton(330, 412, 4011, 4013, 4, GumpButtonType.Reply, 0); AddHtmlLocalized(185, 412, 140, 18, 1114514, "#1149735", 0x6F7B, false, false); // HELP }