public void DisplayRunebooks(int y, int h, int w, int tiers) { this.AddBackground(0, y, w, h, 9270); this.AddImageTiled(10, y + 10, w - 20, h - 20, 2624); this.AddAlphaRegion(10, y + 10, w - 20, h - 20); for (int i = tiers, j = 1; i > 0; i--, j++) { this.AddBackground(j * 5, y + 37, ((i - 1) * 5) + 278, 42, 9270); if (i == 1) { this.AddImageTiled((j * 5) + 10, y + 47, ((i - 1) * 5) + 258, 22, 2624); this.AddAlphaRegion((j * 5) + 10, y + 47, ((i - 1) * 5) + 258, 22); } } SR_Rune rune = this.RuneAcc.Runes[this.RuneAcc.PageIndex]; this.AddItem(SR_Utilities.ItemOffsetX(rune), y + SR_Utilities.ItemOffsetY(rune) + 12, SR_Utilities.RunebookID, SR_Utilities.ItemHue(rune)); this.AddLabelCropped(35, y + 12, w - 108, 20, 2100, rune.Name); this.AddButton(w - 70, y + 10, 4014, 4016, 5, GumpButtonType.Reply, 0); this.AddButton(w - 40, y + 10, 4017, 4019, 4, GumpButtonType.Reply, 0); if (tiers > 0) { rune = this.RuneAcc.ChildRune; this.AddItem(SR_Utilities.ItemOffsetX(rune) + tiers * 5, y + SR_Utilities.ItemOffsetY(rune) + 12 + 37, SR_Utilities.RunebookID, SR_Utilities.ItemHue(rune)); this.AddLabelCropped(35 + tiers * 5, y + 12 + 37, 170, 20, 2100, rune.Name); this.AddButton(w - 70, y + 10 + 37, 4014, 4016, 7, GumpButtonType.Reply, 0); this.AddButton(w - 40, y + 10 + 37, 4017, 4019, 6, GumpButtonType.Reply, 0); } // AddButton(238, 30 + bgY + 10, 4011, 4013, 0, GumpButtonType.Reply, 0); }
public void DisplayRunes(int y, int h) { this.AddBackground(0, y, 430 /*400*/, h, 9270); this.AddImageTiled(10, y + 10, 410, h - 20, 2624); this.AddAlphaRegion(10, y + 10, 410, h - 20); List <SR_Rune> runes = null; int count, runebooks; if (this.RuneAcc.ChildRune == null) { runes = this.RuneAcc.Runes; count = this.RuneAcc.Count; runebooks = this.RuneAcc.RunebookCount; } else { runes = this.RuneAcc.ChildRune.Runes; count = this.RuneAcc.ChildRune.Count; runebooks = this.RuneAcc.ChildRune.RunebookCount; } this.AddPage(1); int pages = (int)Math.Ceiling((double)count / 9.0), temp = 0; for (int i = 0, loc = 0, page = 1; i < count; i++, loc++) { temp = 10 + y + (22 + 5) * loc; this.AddItem(SR_Utilities.ItemOffsetX(runes[i]), 2 + SR_Utilities.ItemOffsetY(runes[i]) + temp, runes[i].IsRunebook ? SR_Utilities.RunebookID : SR_Utilities.RuneID, SR_Utilities.ItemHue(runes[i])); if (runes[i].IsRunebook) { this.AddLabelCropped(35, 2 + temp, 175, 20, 2100, String.Format("{0}. {1}", i + 1, runes[i].Name)); } else { this.AddLabelCropped(35, 2 + temp, 175, 20, 2100, String.Format("{0}. {1} ({2})", i + 1 - runebooks, runes[i].Name, runes[i].TargetMap.ToString())); this.AddLabelCropped(215, 2 + temp, 110, 20, 2100, runes[i].TargetLoc.ToString()); this.AddButton(360, temp, 4008, 4010, i + 30010, GumpButtonType.Reply, 0); } this.AddButton(330 + (runes[i].IsRunebook ? 30 : 0), temp, 4005, 4007, i + 10, GumpButtonType.Reply, 0); //AddButton(340, 40 + ((22+5)*i), 4026, 4028, 0, GumpButtonType.Reply, 0); //AddImage(340, 40 + ((22+5)*i), 4026, 1000); this.AddButton(390, temp, 4017, 4019, i + 60010, GumpButtonType.Reply, 0); // delete if (pages > 1 && ((loc == 8 && i < count - 1) || i == count - 1)) { temp = 10 + y + (22 + 5) * 9; // (430(bg) - 20 (buffer) - 70 (txt/buffer) - 60(buttons)) / 2 = 140 if (page > 1) { this.AddButton(140, temp, 4014, 4016, 0, GumpButtonType.Page, page - 1); } else { this.AddImage(140, temp, 4014, 1000); } this.AddHtml(170, 2 + temp, 90, 20, String.Format("<BASEFONT COLOR=#FFFFFF><CENTER>Page {0}/{1}", page, pages), false, false); if (page < pages) { this.AddButton(260, temp, 4005, 4007, 0, GumpButtonType.Page, page + 1); } else { this.AddImage(260, temp, 4005, 1000); } page++; this.AddPage(page); loc = -1; } } }