public override void OnResponse(RelayInfo info) { base.OnResponse(info); if (info.ButtonID > 0 && info.ButtonID < 500) { CityTitle t = (CityTitle)info.ButtonID - 1; if (!Citizenship.HasTitle(User, t)) { BaseGump.SendGump(new CityTitlesInfoGump(User, t)); } } }
public override void AddGumpLayout() { base.AddGumpLayout(); AddHtmlLocalized(60, 40, 200, 16, 1152894, false, false); // Your Titles int y = 60; foreach (int i in Enum.GetValues(typeof(CityTitle))) { CityTitle title = (CityTitle)i; if (title == CityTitle.None) { continue; } if (Citizenship.HasTitle(User, title)) { AddHtmlLocalized(65, y, 300, 16, CityLoyaltySystem.GetTitleLocalization(User, title, Citizenship.City), false, false); y += 20; } } y += 20; AddHtmlLocalized(60, y, 250, 16, 1152895, false, false); //Available Titles: y += 20; foreach (int i in Enum.GetValues(typeof(CityTitle))) { CityTitle title = (CityTitle)i; if (title == CityTitle.None) { continue; } if (!Citizenship.HasTitle(User, title)) { AddButton(60, y + 5, 2103, 2104, i + 1, GumpButtonType.Reply, 0); AddHtmlLocalized(75, y, 300, 16, CityLoyaltySystem.GetTitleLocalization(User, title, Citizenship.City), false, false); y += 20; } } y += 40; AddHtmlLocalized(30, y, 285, 60, 1152896, false, false); /*Click the gem next to an available title for more information about obtaining that title.*/ }