public PsPriceEntryGump(int skill, int button, int page) : base(GumpOffsetX, GumpOffsetY) { m_Skill = skill; m_Button = button; m_Page = page; string title = ""; string initialText = ""; bool setbool = false; int bt = 0; if (button < 10) // PowerScroll { m_IsPs = true; PsPriceInfo info = PsPriceInfo.PsTable[skill] as PsPriceInfo; title = ((SkillName)skill).ToString(); switch (button) { case 0: { title = title + " Price120"; initialText = info.Price120.ToString(); break; } case 1: { title = title + " Price115"; initialText = info.Price115.ToString(); break; } case 2: { title = title + " Price110"; initialText = info.Price110.ToString(); break; } case 3: { title = title + " Discount"; initialText = info.Discount.ToString(); break; } default: { title = title + " Enabled = " + info.Enabled.ToString(); setbool = true; break; } } } else // StatScroll { m_IsPs = false; bt = 10; switch (button) { case 10: title = "Stat+25"; initialText = PsPriceInfo.StatPriceInfo(250).ToString(); break; case 11: title = "Stat+20"; initialText = PsPriceInfo.StatPriceInfo(245).ToString(); break; case 12: title = "Stat+15"; initialText = PsPriceInfo.StatPriceInfo(240).ToString(); break; case 13: title = "Stat+10"; initialText = PsPriceInfo.StatPriceInfo(235).ToString(); break; default: title = "Stat+5"; initialText = PsPriceInfo.StatPriceInfo(230).ToString(); break; } } if (!setbool) { AddPage(0); AddBackground(0, 0, BackWidth, BackHeight, BackGumpID); AddImageTiled(BorderSize, BorderSize, TotalWidth, TotalHeight, OffsetGumpID); int x = BorderSize + OffsetSize; int y = BorderSize + OffsetSize; AddImageTiled(x, y, EntryWidth, EntryHeight, EntryGumpID); AddLabelCropped(x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, TextHue, title); x += EntryWidth + OffsetSize; if (SetGumpID != 0) { AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID); } x = BorderSize + OffsetSize; y += EntryHeight + OffsetSize; AddImageTiled(x, y, EntryWidth, EntryHeight, EntryGumpID); AddTextEntry(x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, TextHue, 0, initialText); x += EntryWidth + OffsetSize; if (SetGumpID != 0) { AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID); } AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1 + bt, GumpButtonType.Reply, 0); } else { AddPage(0); int totalHeight = OffsetSize + (4 * (EntryHeight + OffsetSize)); int backHeight = BorderSize + totalHeight + BorderSize; AddBackground(0, 0, BackWidth, backHeight, BackGumpID); AddImageTiled(BorderSize, BorderSize, TotalWidth, totalHeight, OffsetGumpID); int x = BorderSize + OffsetSize; int y = BorderSize + OffsetSize; int emptyWidth = TotalWidth - PrevWidth - NextWidth - (OffsetSize * 4); AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); x += PrevWidth + OffsetSize; AddImageTiled(x, y, emptyWidth, EntryHeight, HeaderGumpID); x += emptyWidth + OffsetSize; AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); AddRect(0, title, 0); for (int i = 0; i < 2; ++i) { AddRect(i + 1, m_Names[i], i + 2); } } }
public SetPsPriceGump(int skill, bool isPs, int page) : base(GumpOffsetX, GumpOffsetY) { string name = ""; string sval = ""; m_Skill = skill; m_IsPs = isPs; m_Page = page; int bt = 10; AddPage(0); AddBackground(0, 0, BackWidth, BorderSize + TotalHeight + BorderSize, BackGumpID); AddImageTiled(BorderSize, BorderSize, TotalWidth, TotalHeight, OffsetGumpID); int x = BorderSize + OffsetSize; int y = BorderSize + OffsetSize; AddLabelCropped(x + TextOffsetX, y, NameWidth - TextOffsetX, EntryHeight, HeaderTextHue, isPs ? ((SkillName)skill).ToString() : "StatCapScroll"); for (int i = 0; i < 5; i++) { x = BorderSize + OffsetSize; y += EntryHeight + OffsetSize; if (isPs) { PsPriceInfo info = PsPriceInfo.PsTable[skill] as PsPriceInfo; switch (i) { case 0: name = "Price120"; sval = info.Price120.ToString(); break; case 1: name = "Price115"; sval = info.Price115.ToString(); break; case 2: name = "Price110"; sval = info.Price110.ToString(); break; case 3: name = "Discount"; sval = info.Discount.ToString(); break; case 4: name = "Enabled"; sval = info.Enabled.ToString(); break; } } else { bt = 20; switch (i) { case 0: name = "Stat+25"; sval = PsPriceInfo.StatPriceInfo(250).ToString(); break; case 1: name = "Stat+20"; sval = PsPriceInfo.StatPriceInfo(245).ToString(); break; case 2: name = "Stat+15"; sval = PsPriceInfo.StatPriceInfo(240).ToString(); break; case 3: name = "Stat+10"; sval = PsPriceInfo.StatPriceInfo(235).ToString(); break; case 4: name = "Stat+5"; sval = PsPriceInfo.StatPriceInfo(230).ToString(); break; } } AddImageTiled(x, y, NameWidth, EntryHeight, EntryGumpID); AddLabelCropped(x + TextOffsetX, y, NameWidth - TextOffsetX, EntryHeight, TextHue, name); x += NameWidth + OffsetSize; AddImageTiled(x, y, ValueWidth, EntryHeight, EntryGumpID); AddLabelCropped(x + TextOffsetX, y, ValueWidth - TextOffsetX, EntryHeight, TextHue, sval); x += ValueWidth + OffsetSize; if (SetGumpID != 0) { AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID); } AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, i + bt, GumpButtonType.Reply, 0); } }