public void DisplayHuePage() { int points = m_Owner.GetCollectionPoints(m_Collection.CollectionID); AddPage(m_Page); // title AddHtmlLocalized(50, 65, 150, 20, 1072843, 0x1, false, false); // Your Reward Points: AddLabel(230, 65, 0x64, points.ToString()); AddImageTiled(35, 85, 270, 2, 0x23C5); AddHtmlLocalized(35, 90, 270, 20, 1074255, 0x1, false, false); // Please select a hue for your Reward: // hues int height = Math.Max(m_Item.Height, 20); int offset = 110; while (offset + height < 290 && m_Index < m_Item.Hues.Length) { AddButton(35, offset + height / 2 - 5, 0x837, 0x838, 100 + m_Index, GumpButtonType.Reply, 0); TextDefinition.AddTooltip(this, m_Item.Tooltip); AddItem(55 - m_Item.X, offset - m_Item.Y, m_Item.ItemID, m_Item.Hues[m_Index]); TextDefinition.AddTooltip(this, m_Item.Tooltip); offset += 5 + height; m_Index += 1; } m_Page += 1; // buttons AddButton(50, 335, 0x15E3, 0x15E7, (int)Buttons.Rewards, GumpButtonType.Reply, 0); AddHtmlLocalized(75, 335, 100, 20, 1072842, 0x1, false, false); // Rewards if (m_Index < m_Item.Hues.Length && m_Page > 2) { if (m_Index < m_Item.Hues.Length) { AddButton(270, 335, 0x15E1, 0x15E5, (int)Buttons.Next, GumpButtonType.Page, m_Page); } else { AddButton(270, 335, 0x15E1, 0x15E5, (int)Buttons.Next, GumpButtonType.Page, 1); } AddHtmlLocalized(210, 335, 60, 20, 1074256, 0x1, false, false); // More Hues } }
public void DisplayRewardPage() { AddPage(Page); int offset = 110; int next = 0; int max = GetMax(); while (offset + next < 320 && Index < Collection.Count) { CollectionItem item = Collection[Index]; int height = Math.Max(item.Height, 20); if (Points >= item.Points) { AddButton(35, offset + height / 2 - 5, 0x837, 0x838, 200 + Index, GumpButtonType.Reply, 0); TextDefinition.AddTooltip(this, item.Tooltip); } int y = offset - item.Y; if (item.Height < 20) { y += (20 - item.Height) / 2; } Item i = null; if (Owner.Backpack != null && item.Type != null) { i = Owner.Backpack.FindItemByType(item.Type); } int hue = GetItemHue(i, item); AddItem(55 - item.X + max / 2 - item.Width / 2, y, item.ItemID, hue); if (i != null) { AddItemProperty(i.Serial); } else { TextDefinition.AddTooltip(this, item.Tooltip); } AddLabel(80 + max, offset + height / 2 - 10, Points >= item.Points ? 0x64 : 0x21, item.Points.ToString("N0")); offset += GetYOffset(item.ItemID) + height; Index++; if (Index < Collection.Count) { next = Math.Max(Collection[Index].Height, 20); } else { next = 0; } } if (Page > 1) { AddButton(150, 335, 0x15E3, 0x15E7, 0, GumpButtonType.Page, Page - 1); AddHtmlLocalized(170, 335, 60, 20, 1074880, 0x1, false, false); // Previous } Page++; if (Index < Collection.Count) { AddButton(300, 335, 0x15E1, 0x15E5, 0, GumpButtonType.Page, Page); AddHtmlLocalized(240, 335, 60, 20, 1072854, 0x1, false, false); // <div align=right>Next</div> } }
public void DisplayRewardPage() { int points = m_Owner.GetCollectionPoints(m_Collection.CollectionID); AddPage(m_Page); // title AddHtmlLocalized(50, 65, 150, 20, 1072843, 0x1, false, false); // Your Reward Points: AddLabel(230, 65, 0x64, points.ToString()); AddImageTiled(35, 85, 270, 2, 0x23C5); AddHtmlLocalized(35, 90, 270, 20, 1072844, 0x1, false, false); // Please Choose a Reward: // rewards int offset = 110; int next = 0; while (offset + next < 300 && m_Index < m_Collection.Rewards.Count) { CollectionItem item = m_Collection.Rewards[m_Index]; if (item.QuestItem && SkipQuestReward(m_Owner, item)) { m_Index++; continue; } int height = Math.Max(item.Height, 20); if (points >= item.Points && item.CanSelect(m_Owner)) { AddButton(35, offset + height / 2 - 5, 0x837, 0x838, 200 + m_Index, GumpButtonType.Reply, 0); TextDefinition.AddTooltip(this, item.Tooltip); } int y = offset - item.Y; if (item.Height < 20) { y += (20 - item.Height) / 2; } AddItem(55 - item.X + m_Max / 2 - item.Width / 2, y, item.ItemID, points >= item.Points ? item.Hue : 0x3E9); TextDefinition.AddTooltip(this, item.Tooltip); AddLabel(65 + m_Max, offset + height / 2 - 10, points >= item.Points ? 0x64 : 0x21, item.Points.ToString()); TextDefinition.AddTooltip(this, item.Tooltip); offset += 5 + height; m_Index += 1; if (m_Index < m_Collection.Donations.Count) { next = Math.Max(m_Collection.Donations[m_Index].Height, 20); } else { next = 0; } } // buttons AddButton(50, 335, 0x15E3, 0x15E7, (int)Buttons.Status, GumpButtonType.Reply, 0); AddHtmlLocalized(75, 335, 100, 20, 1072845, 0x1, false, false); // Status if (m_Page > 1) { AddButton(150, 335, 0x15E3, 0x15E7, (int)Buttons.Next, GumpButtonType.Page, m_Page - 1); AddHtmlLocalized(170, 335, 60, 20, 1074880, 0x1, false, false); // Previous } m_Page += 1; if (m_Index < m_Collection.Rewards.Count) { AddButton(300, 335, 0x15E1, 0x15E5, (int)Buttons.Next, GumpButtonType.Page, m_Page); AddHtmlLocalized(240, 335, 60, 20, 1072854, 0x1, false, false); // <div align=right>Next</div> } }
public void DisplayDonationPage() { AddPage(m_Page); // title AddHtmlLocalized(50, 65, 150, 20, 1072836, 0x1, false, false); // Current Tier: AddLabel(230, 65, 0x64, m_Collection.Tier.ToString()); AddHtmlLocalized(50, 85, 150, 20, 1072837, 0x1, false, false); // Current Points: AddLabel(230, 85, 0x64, m_Collection.Points.ToString()); AddHtmlLocalized(50, 105, 150, 20, 1072838, 0x1, false, false); // Points Until Next Tier: AddLabel(230, 105, 0x64, m_Collection.CurrentTier.ToString()); AddImageTiled(35, 125, 270, 2, 0x23C5); AddHtmlLocalized(35, 130, 270, 20, 1072840, 0x1, false, false); // Donations Accepted: // donations int offset = 150; int next = 0; while (offset + next < 330 && m_Index < m_Collection.Donations.Count) { CollectionItem item = m_Collection.Donations[m_Index]; Type type = item.Type; Account acct = m_Owner.Account as Account; int height = Math.Max(item.Height, 20); int amount = 0; if (item.Type == typeof(Gold) && acct != null) { amount = acct.TotalGold + m_Owner.Backpack.GetAmount(item.Type); } else { amount = GetTypes(m_Owner, item); } if (amount > 0) { AddButton(35, offset + height / 2 - 5, 0x837, 0x838, 300 + m_Index, GumpButtonType.Reply, 0); TextDefinition.AddTooltip(this, item.Tooltip); } int y = offset - item.Y; if (item.Height < 20) { y += (20 - item.Height) / 2; } AddItem(55 - item.X + m_Max / 2 - item.Width / 2, y, item.ItemID, item.Hue); TextDefinition.AddTooltip(this, item.Tooltip); if (item.Points < 1 && item.Points > 0) { AddLabel(65 + m_Max, offset + height / 2 - 10, 0x64, "1 per " + ((int)Math.Pow(item.Points, -1)).ToString()); } else { AddLabel(65 + m_Max, offset + height / 2 - 10, 0x64, item.Points.ToString()); } TextDefinition.AddTooltip(this, item.Tooltip); if (amount > 0) { AddLabel(235, offset + height / 2 - 5, 0xB1, amount.ToString("N0", System.Globalization.CultureInfo.GetCultureInfo("en-US"))); } offset += 5 + height; m_Index += 1; if (m_Index < m_Collection.Donations.Count) { next = Math.Max(m_Collection.Donations[m_Index].Height, 20); } else { next = 0; } } // buttons AddButton(50, 335, 0x15E3, 0x15E7, (int)Buttons.Rewards, GumpButtonType.Reply, 0); AddHtmlLocalized(75, 335, 100, 20, 1072842, 0x1, false, false); // Rewards if (m_Page > 1) { AddButton(150, 335, 0x15E3, 0x15E7, (int)Buttons.Next, GumpButtonType.Page, m_Page - 1); AddHtmlLocalized(170, 335, 60, 20, 1074880, 0x1, false, false); // Previous } m_Page += 1; if (m_Index < m_Collection.Donations.Count) { AddButton(300, 335, 0x15E1, 0x15E5, (int)Buttons.Next, GumpButtonType.Page, m_Page); AddHtmlLocalized(240, 335, 60, 20, 1072854, 0x1, false, false); // <div align=right>Next</div> } }