private void UnlocksTooltip(Achievement achievement) { var lines = new string[achievement.Unlocks.Length + 1]; lines[0] = "Unlocks:"; for (int i = 0; i < achievement.Unlocks.Length; i++) { var locked = AchievementSystem.GetAchievement(achievement.Unlocks[i]); lines[i + 1] = locked != null?locked.Name.ToString() : string.Empty; } AddTooltip(lines); }
public virtual void OnAchieved(PlayerMobile pm, AchievementProfile profile) { Timer.DelayCall(Delay, () => { SendAchievementMessage(pm); SendTag(pm); RefreshGumps(pm); if (Unlocks != null && Unlocks.Length > 0) { for (int i = 0; i < Unlocks.Length; i++) { var achievement = AchievementSystem.GetAchievement(Unlocks[i]); if (achievement != null) { pm.SendLocalizedMessage(1060658, String.Format("You have unlocked\t{0}", Name.ToString()), 2949); } } } }); }
public override void OnResponse(RelayInfo info) { switch (info.ButtonID) { case 0: return; case 1: if (ViewSummary) { ViewSummary = false; } else { ViewSummary = true; } break; case 2: TextRelay relay = info.GetTextEntry(1); string search = relay.Text; if (!string.IsNullOrEmpty(search) && search.ToLower() != "search") { SearchName = search; Profile.SetTypeIndex(Profile.FilterType, 0); BuildListFromSearch(); } else { SearchName = "Search"; BuildList(); } break; case 3: Index = Math.Max(0, Index - 1); Profile.SetTypeIndex(Profile.FilterType, Index); break; case 4: Index = Math.Min(List.Count - MaxEntriesPerPage, Index + 1); Profile.SetTypeIndex(Profile.FilterType, Index); break; case 5: var sort = Profile.SortFilter; if (sort == SortFilter.Descending) { sort = (SortFilter)0; } else { sort++; } Profile.SortFilter = sort; Index = 0; Profile.SetTypeIndex(Profile.FilterType, Index); BuildList(); break; case 6: if (ViewingOwn) { if (Profile.ShowGumpTag) { Profile.ShowGumpTag = false; } else { Profile.ShowGumpTag = true; } } break; case 7: if (ViewingOwn) { if (Profile.ShowProgress) { Profile.ShowProgress = false; } else { Profile.ShowProgress = true; } } break; default: if (info.ButtonID < 10000) { var type = (AchievementType)info.ButtonID - 100; ViewSummary = false; var filter = Profile.FilterType; if (filter != type) { Profile.SetTypeFilter(type); BuildList(); Index = Profile.GetTypeIndex(type); } } else { var achievement = AchievementSystem.GetAchievement(info.ButtonID - 10000); if (achievement != null) { User.SendGump(new PropertiesGump(User, achievement)); var details = Profile.GetDetails(achievement.Identifier); if (details != null) { User.SendGump(new PropertiesGump(User, details)); } } } break; } Refresh(); }
public ProgressCheckResult CheckProgress(int id) { return(CheckProgress(AchievementSystem.GetAchievement(id), null)); }