Пример #1
0
        public TownCrierQuestCompleteGump(PlayerMobile pm, BaseQuest quest)
            : base(pm, 10, 100)
        {
            Title = quest.Title;
            Body  = quest.Complete;

            TownCryerNewsEntry entry = TownCryerSystem.NewsEntries.FirstOrDefault(e => e.QuestType == quest.GetType());

            if (entry != null)
            {
                GumpID = entry.GumpImage;
            }
        }
Пример #2
0
        private void BuildNewsPage()
        {
            int perPage = 20;

            int y     = 170;
            int start = Page * perPage;

            Pages = (int)Math.Ceiling(TownCryerSystem.NewsEntries.Count / (double)perPage);

            for (int i = start; i < TownCryerSystem.NewsEntries.Count && i < perPage; i++)
            {
                TownCryerNewsEntry entry = TownCryerSystem.NewsEntries[i];

                AddButton(50, y, 0x5FB, 0x5FC, 100 + i, GumpButtonType.Reply, 0);
                bool doneQuest = entry.QuestType != null && QuestHelper.CheckDoneOnce(User, entry.QuestType, Cryer, false);

                if (entry.Title.Number > 0)
                {
                    AddHtmlLocalized(87, y, 700, 20, entry.Title.Number, doneQuest ? C32216(0x696969) : 0, false, false);
                }
                else
                {
                    AddLabelCropped(87, y, 700, 20, doneQuest ? 0x3B2 : 0, entry.Title);
                }

                y += 23;
            }

            if (TownCryerSystem.NewsEntries.Count > perPage)
            {
                AddButton(350, 570, 0x605, 0x606, 5, GumpButtonType.Reply, 0);
                AddButton(380, 570, 0x609, 0x60A, 6, GumpButtonType.Reply, 0);
                AddButton(430, 570, 0x607, 0x608, 7, GumpButtonType.Reply, 0);
                AddButton(455, 570, 0x603, 0x604, 8, GumpButtonType.Reply, 0);

                AddHtml(395, 570, 35, 20, Center(String.Format("{0}/{1}", (Page + 1).ToString(), (Pages + 1).ToString())), false, false);
            }
        }
        public TownCrierQuestCompleteGump(PlayerMobile pm, BaseQuest quest)
            : base(pm, 10, 100)
        {
            Title = quest.Title;
            Body  = quest.Complete;

            TownCryerNewsEntry entry = null;

            for (var index = 0; index < TownCryerSystem.NewsEntries.Count; index++)
            {
                var e = TownCryerSystem.NewsEntries[index];

                if (e.QuestType == quest.GetType())
                {
                    entry = e;
                    break;
                }
            }

            if (entry != null)
            {
                GumpID = entry.GumpImage;
            }
        }
Пример #4
0
 public TownCryerNewsGump(PlayerMobile pm, TownCrier cryer, TownCryerNewsEntry entry)
     : base(pm, cryer)
 {
     Entry = entry;
 }