Пример #1
0
        public AchievementGump(PlayerMobile pm, PlayerMobile subject)
            : base(pm, 50, 50)
        {
            pm.CloseGump(typeof(AchievementGump));

            Subject    = subject;
            SearchName = "Search";

            Profile = subject != null?AchievementSystem.GetProfile(subject) : AchievementSystem.GetProfile(pm);

            Index = Profile.GetTypeIndex(Profile.FilterType);
        }
Пример #2
0
        private void SendTag(PlayerMobile pm)
        {
            var profile = AchievementSystem.GetProfile(pm);

            if (profile == null || !profile.ShowGumpTag || pm.NetState == null)
            {
                return;
            }

            var tag = BaseGump.GetGump <AchievementTagGump>(pm, g => g.Achievement == this);

            if (tag != null)
            {
                tag.Refresh();
            }
            else
            {
                BaseGump.SendGump(new AchievementTagGump(pm, this));
            }
        }
Пример #3
0
        public override void AddGumpLayout()
        {
            AddBackground(0, 0, 444, 80, 1579);

            AddHtmlLocalized(90, 5, 265, 20, CenterLoc, Achievement.Name.ToString(), C32216(0x444444), false, false);
            AddImageTiled(77, 24, 300, 2, 96);
            AddHtmlLocalized(82, 27, 290, 40, CenterLoc, Achievement.Description.ToString(), C32216(0x2A2A2A), false, false);

            AddImage(377, 4, 10553);
            AddImageTiled(404, 4, 5, 59, 10554);
            AddImage(404, 4, 10555);

            if (Achievement.Unlocks != null)
            {
                UnlocksTooltip(Achievement);
            }

            var      profile     = AchievementSystem.GetProfile(User);
            DateTime achieveTime = DateTime.MinValue;
            bool     hasAchieved = profile.HasAchieved(Achievement, out achieveTime);

            AddHtml(377, 19, 55, 20, ColorAndCenter("#FFFFFF", Achievement.Points.ToString()), false, false);

            if (hasAchieved)
            {
                AddHtml(338, 58, 100, 20, ColorAndAlignRight("#444444", achieveTime.ToShortDateString()), false, false);
            }

            if (Achievement.GumpImage > 0)
            {
                AddImage(15 + Achievement.GumpImageOffset.X, 10 + Achievement.GumpImageOffset.Y, Achievement.GumpImage);
            }

            if (Achievement.MaxProgress > 1)
            {
                BuildProgressBar(profile, Achievement);
            }
        }