Exemplo n.º 1
0
        protected override void BuildGump()
        {
            if (c_ListPage == ListPage.Channel && Data.GetData(Current).CurrentChannel == null)
            {
                c_ListPage = ListPage.All;
            }

            int width   = Data.GetData(Current).QuickBar ? 250 : 200;
            int y       = 10;
            int perpage = 10;
            int bar     = width - 18;

            if (c_ListPage == ListPage.Mail || (c_ListPage == ListPage.Channel && (Data.GetData(Current).CurrentChannel is Guild || Data.GetData(Current).CurrentChannel is Faction)))
            {
                perpage /= 2;
            }

            AddBackground(width, 0, 39, 55, Data.GetData(Owner).DefaultBack);

            if (c_Search)
            {
                ShowSearch(width);
            }
            else
            {
                AddButton(width + 10, 55, c_Search ? 0xFA : 0xFC, c_Search ? 0xFB : 0xFD, "Search", new GumpCallback(Search));
            }

            ArrayList list = GetList();

            SearchFilter(list);
            list.Sort(new InternalSort(this));

            if (c_Page != 0)
            {
                AddButton(width / 2 - 10, y - 5, 0x15E0, 0x15E4, "Page Down", new GumpCallback(PageDown));
            }

            if (c_Target != null)
            {
                AddHtml(0, y += 25, width, "<CENTER>" + General.Local(224) + " " + c_Target.RawName);
                AddButton(width / 2 - 80, y, 0x5686, "Clear Viewing", new GumpCallback(ClearViewing));
                AddButton(width / 2 + 65, y, 0x5686, "Clear Viewing", new GumpCallback(ClearViewing));
            }

            y += 5;

            if (c_Page != 0)
            {
                AddButton(width + 12, 10, 0x15E2, 0x15E6, "Page Down", new GumpCallback(PageDown));
            }
            if (perpage * (c_Page + 1) < list.Count)
            {
                AddButton(width + 12, 30, 0x15E2, 0x15E6, "Page Up", new GumpCallback(PageUp));
            }

            y -= 25;

            for (int i = c_Page * perpage; i < (c_Page + 1) * perpage && i < list.Count; ++i)
            {
                if (list[i] is string)
                {
                    if (list[i].ToString().IndexOf("@") == 0)
                    {
                        list[i] = list[i].ToString().Substring(1, list[i].ToString().Length - 1);
                    }

                    AddHtml(35, y += 20, width - 35, list[i].ToString());
                    AddButton(width - 40, y, Data.GetData(Current).IrcIgnores.Contains(list[i].ToString()) ? 0x5687 : 0x5686, "Ignore IRC", new GumpStateCallback(IgnoreIrc), list[i]);
                }
                else if (list[i] is Mobile)
                {
                    AddHtml(20, y += 25, width - 40, ColorFor((Mobile)list[i]) + (Data.GetData(Owner).QuickBar ? "" : "<CENTER>") + ((Mobile)list[i]).RawName + StatusFor((Mobile)list[i]));

                    if (Current == Owner && Data.GetData(Owner).NewMsgFrom((Mobile)list[i]))
                    {
                        AddButton(width - 20, y, 0x1523, "Check Msg", new GumpStateCallback(CheckMsg), (Mobile)list[i]);
                    }
                    else
                    {
                        AddButton(width - 20, y + 2, 0x15E1, 0x15E5, "Profile", new GumpStateCallback(Profile), (Mobile)list[i]);
                    }

                    if (c_ListPage == ListPage.Channel && Data.GetData(Current).CurrentChannel is Guild)
                    {
                        AddHtml(35, y += 20, width - 35, ((Mobile)list[i]).GuildTitle);
                    }
                    else if (c_ListPage == ListPage.Channel && Data.GetData(Current).CurrentChannel is Faction)
                    {
                        AddHtml(35, y += 20, width - 35, General.FactionTitle((Mobile)list[i]));
                    }

                    if (list[i] != Current && Data.GetData(Current).QuickBar)
                    {
                        bar = width - 18;

                        if (Current.AccessLevel > ((Mobile)list[i]).AccessLevel)
                        {
                            if (Data.GetData(Current).GlobalAccess)
                            {
                                if (Data.GetData(Current).Global)
                                {
                                    AddButton(bar -= 12, y + 3, 0x13A8, "Mini Ignore", new GumpStateCallback(GIgnore), list[i]);
                                    AddLabel(bar + 4, y, Data.GetData(Current).GIgnores.Contains(list[i]) ? 0x44 : 0x26, "I");
                                }
                                else
                                {
                                    AddButton(bar -= 12, y + 3, 0x13A8, "Mini Listen", new GumpStateCallback(GListen), list[i]);
                                    AddLabel(bar + 4, y, Data.GetData(Current).GListens.Contains(list[i]) ? 0x44 : 0x26, "L");
                                }
                            }

                            AddButton(bar -= 12, y + 3, 0x13A8, "Mini Ban", new GumpStateCallback(Ban), list[i]);
                            AddLabel(bar + 4, y, Data.GetData((Mobile)list[i]).Banned ? 0x44 : 0x26, "b");
                        }

                        if (Current.AccessLevel >= AccessLevel.GameMaster && ((Mobile)list[i]).NetState != null)
                        {
                            AddButton(bar -= 12, y + 3, 0x13A8, "Mini Goto", new GumpStateCallback(Goto), list[i]);
                            AddLabel(bar + 3, y - 2, 0x47E, "g");

                            AddButton(bar -= 12, y + 3, 0x13A8, "Mini Client", new GumpStateCallback(Client), list[i]);
                            AddLabel(bar + 3, y - 2, 0x47E, "c");
                        }

                        if (Chat3.Message.CanMessage(Current, (Mobile)list[i]))
                        {
                            AddButton(bar -= 12, y + 3, 0x13A8, "Mini Message", new GumpStateCallback(Message), list[i]);
                            AddLabel(bar + 3, y - 2, 0x47E, "m");
                        }

                        AddButton(bar -= 12, y + 3, 0x13A8, "Mini Ignore", new GumpStateCallback(Ignore), list[i]);
                        AddLabel(bar + 5, y - 1, Data.GetData(Current).Ignores.Contains(list[i]) ? 0x44 : 0x26, "i");

                        AddButton(bar -= 12, y + 3, 0x13A8, "Mini Friend", new GumpStateCallback(Friend), list[i]);
                        AddLabel(bar + 3, y, Data.GetData(Current).Friends.Contains(list[i]) ? 0x44 : 0x26, "f");
                    }
                }
                else if (list[i] is Message)
                {
                    Message msg = (Message)list[i];

                    AddHtml(45, y += 20, width - 85, ColorFor(msg) + (msg.Read ? "" : "<B>") + msg.Subject, false);
                    AddHtml(45, y += 16, width - 85, General.Local(60) + " " + msg.From.RawName);

                    AddButton(20, y - 10, 0x2716, "Open", new GumpStateCallback(Open), (Message)list[i]);
                    AddButton(width - 40, y - 10, 0x5686, 0x5687, "Delete", new GumpStateCallback(Delete), (Message)list[i]);
                }
                else if (list[i] is Notification)
                {
                    Notification not = (Notification)list[i];

                    AddHtml(45, y += 20, width - 85, ColorFor(not) + not.Name);

                    AddButton(20, y + 3, 0x2716, "Edit Notif", new GumpStateCallback(EditNotif), (Notification)list[i]);
                    AddButton(width - 40, y + 3, 0x5686, 0x5687, "Delete", new GumpStateCallback(Delete), (Notification)list[i]);
                }

                AddBackground(25, y + 20, width - 50, 3, Data.GetData(Owner).DefaultBack);
            }

            if (c_ListPage == ListPage.Mail && Current.AccessLevel >= AccessLevel.GameMaster)
            {
                AddHtml(0, y += 25, width, "<CENTER>" + General.Local(95), false);
                AddButton(width / 2 - 50, y + 3, 0x2716, "Broadcast", new GumpCallback(Broadcast));
                AddButton(width / 2 + 40, y + 3, 0x2716, "Broadcast", new GumpCallback(Broadcast));

                AddHtml(0, y += 20, width, "<CENTER>" + General.Local(257), false);
                AddButton(width / 2 - 50, y + 3, 0x2716, "Staff", new GumpCallback(BroadcastStaff));
                AddButton(width / 2 + 40, y + 3, 0x2716, "Staff", new GumpCallback(BroadcastStaff));
            }
            else if (c_ListPage == ListPage.Notifications)
            {
                AddHtml(0, y += 25, width, "<CENTER>" + General.Local(270), false);
                AddButton(width / 2 - 70, y + 3, 0x2716, "New Notif", new GumpCallback(NewNotif));
                AddButton(width / 2 + 60, y + 3, 0x2716, "New Notif", new GumpCallback(NewNotif));
            }

            if (c_ListPage == ListPage.Mail)
            {
                AddHtml(0, y += 20, width, "<CENTER>" + Data.GetData(Owner).Messages.Count + " / " + Data.MaxMsgs);
            }

            if (c_ListPage == ListPage.Channel)
            {
                ArrayList states = new ArrayList(Server.Network.NetState.Instances);
                foreach (Server.Network.NetState state in Server.Network.NetState.Instances)
                {
                    if (state.Mobile != null && state.Mobile.AccessLevel != AccessLevel.Player)
                    {
                        states.Remove(state);
                    }
                }

                AddHtml(0, 260, width, "<CENTER>" + states.Count + " " + General.Local(19));
            }

            AddButton(width - 80, 280, 0x5689, "Help", new GumpCallback(Help));
            AddButton(width - 65, 280, 0x5689, "Status", new GumpCallback(Status));
            AddLabel(width - 62, 279, Data.GetData(Current).Status == OnlineStatus.Online ? 0x47E : 0x34, "A");
            AddButton(width - 50, 280, 0x5689, "QuickBar", new GumpCallback(QuickBar));
            AddLabel(width - 47, 279, Data.GetData(Current).QuickBar ? 0x34 : 0x47E, "Q");

            AddBackgroundZero(0, 0, width, 300, Data.GetData(Current).DefaultBack);

            BuildTabs(width, 300);
        }
Exemplo n.º 2
0
        protected override void BuildGump()
        {
            int width = 300;
            int y     = 10;

            AddImage(10, y, 0x589);
            Avatar av = Avatar.GetAvatar(c_Target);

            if (av.Id < 100000)
            {
                AddImage(10 + av.X, y + av.Y, av.Id);
            }
            else
            {
                AddItem(10 + av.X, y + av.Y, av.Id - 100000);
            }

            AddHtml(95, y, width - 95, Server.Misc.Titles.ComputeTitle(Owner, c_Target));

            if (Owner.AccessLevel != AccessLevel.Player)
            {
                AddHtml(95, y += 20, width - 95, "Access: " + c_Target.AccessLevel);
            }
            else if (c_Target.AccessLevel != AccessLevel.Player)
            {
                AddHtml(95, y += 20, width - 95, "" + c_Target.AccessLevel);
            }
            else
            {
                if (c_Target.Guild != null)
                {
                    AddHtml(95, y += 20, width - 95, "[" + c_Target.Guild.Abbreviation + "] " + c_Target.GuildTitle);
                }
                if (General.IsInFaction(c_Target))
                {
                    AddHtml(95, y += 20, width - 95, General.FactionName(c_Target) + " " + General.FactionTitle(c_Target));
                }
            }

            if (y < 89)
            {
                y = 89;
            }

            if (Owner == c_Target)
            {
                AddButton(32, y, 0x2626, 0x2627, "Avatar Down", new GumpCallback(AvatarDown));
                AddButton(52, y, 0x2622, 0x2623, "Avatar Up", new GumpCallback(AvatarUp));
            }

            AddHtml(0, y += 20, width, "<CENTER>" + General.Local(253) + " " + Data.GetData(c_Target).Karma);

            if (Owner == c_Target)
            {
                AddHtml(20, y          += 25, 100, General.Local(247));
                AddTextField(20, y     += 25, width - 40, 65, 0x480, 0xBBC, "Signature", Data.GetData(c_Target).Signature);
                AddHtml(width - 125, y += 65, 50, General.Local(244));
                AddHtml(width - 65, y, 50, General.Local(245));
                AddButton(width - 140, y + 3, 0x2716, "Clear Sig", new GumpCallback(ClearSig));
                AddButton(width - 80, y + 3, 0x2716, "Submit Sig", new GumpCallback(SubmitSig));
            }
            else
            {
                AddHtml(20, y += 25, width - 40, 65, "'" + Data.GetData(c_Target).Signature + "'", false, false);
                y             += 65;
            }

            if (Owner != c_Target)
            {
                ViewOptions(width);
            }

            AddBackgroundZero(0, 0, width, y + 40, Data.GetData(c_Target).DefaultBack);
        }