Exemplo n.º 1
0
        protected override void BuildGump()
        {
            try{
                Owner.CloseGump(typeof(ProfileGump));

                AddPage(0);

                ChatInfo otherInfo = ChatInfo.GetInfo(c_Target);

                AddBackground(0, 0, Width, Height, 0x13BE);

                AddButton(Width - 20, Height - 20, 0x5689, 0x5689, "Help", new TimerCallback(Help));

                AddPage(1);

                string text = Server.Misc.Titles.ComputeTitle(Owner, c_Target);

                if (c_Target.AccessLevel != AccessLevel.Player)
                {
                    text += "<BR>" + c_Target.AccessLevel;
                }
                else if (c_Target.Guild != null)
                {
                    text += "<BR>[" + c_Target.Guild.Abbreviation + "] " + c_Target.GuildTitle;
                }

                if (Owner.AccessLevel > c_Target.AccessLevel ||
                    (ChatInfo.ShowLocation && Owner.AccessLevel == c_Target.AccessLevel))
                {
                    if (c_Target.NetState != null)
                    {
                        text += "<BR>" + c_Target.Map.Name;

                        if (c_Target.Region != null && c_Target.Region.Name != "")
                        {
                            text += ", " + c_Target.Region.Name;
                        }
                    }
                }

                AddHtml(0, 10, Width, 65, HTML.White + "<CENTER>" + text, false, false);

                AddBackground(20, 65, Width - 40, 3, 0x13BE);

                int y = 90;
                int x = 40;

                if (c_Target.AccessLevel >= Owner.AccessLevel)
                {
                    x = Width / 2 - 35;
                }

                if (Pm.CanPm(c_Info, otherInfo))
                {
                    AddTemplateButton(x, y, 70, Template.RedSquare, "New Message", HTML.White + "<CENTER>Message", new TimerCallback(Message));
                }

                AddTemplateButton(x, y + 20, 70, Template.RedSquare, "Friend", HTML.White + (c_Info.Friends.Contains(c_Target) ? "<CENTER>Unfriend" : "<CENTER>Friend"), new TimerStateCallback(Friend), c_Info.Friends.Contains(c_Target));

                if (Owner.AccessLevel >= c_Target.AccessLevel)
                {
                    AddTemplateButton(x, y + 40, 70, Template.RedSquare, "Ignore", HTML.White + (c_Info.Ignores.Contains(c_Target) ? "<CENTER>Unignore" : "<CENTER>Ignore"), new TimerStateCallback(Ignore), c_Info.Ignores.Contains(c_Target));
                }

                AddHtml(x - 10, y + 65, 70, 25, HTML.White + "Pm Sound:", false, false);
                AddImageTiled(x + 65, y + 65, 35, 21, 0xBBA);
                AddTextField(x + 65, y + 65, 35, 21, 0x480, 0, c_Info.GetSound(c_Target).ToString());
                AddButton(x + 100, y + 67, 0x15E1, 0x15E5, "Play Sound", new TimerCallback(PlaySound));
                AddButton(x + 55, y + 65, 0x983, 0x983, "Sound Up", new TimerCallback(SoundUp));
                AddButton(x + 55, y + 75, 0x985, 0x985, "Sound Down", new TimerCallback(SoundDown));

                if (Owner.AccessLevel > c_Target.AccessLevel)
                {
                    x = Width - 110;

                    if (c_Target.NetState != null)
                    {
                        AddTemplateButton(x, y, 70, Template.RedSquare, "Client", HTML.White + "<CENTER>Client", new TimerCallback(Client));
                        AddItem(x - 30, y + 3, 0x186A);

                        AddTemplateButton(x, y + 20, 70, Template.RedSquare, "Goto", HTML.White + "<CENTER>Goto", new TimerCallback(Goto));
                        AddItem(x - 30, y + 23, 0x186A);
                    }

                    if (c_Info.GlobalAccess)
                    {
                        AddTemplateButton(x, y + 60, 70, Template.RedSquare, "Global Ignore", HTML.White + (c_Info.GlobalIgnores.Contains(c_Target) ? "<CENTER>Global Unignore" : "<CENTER>Global Ignore"), new TimerStateCallback(IgnoreGlobal), c_Info.GlobalIgnores.Contains(c_Target));
                        AddItem(x - 30, y + 63, 0x186A);
                    }

                    if (c_Target.AccessLevel == AccessLevel.Player)
                    {
                        AddTemplateButton(x, y + 40, 70, Template.RedSquare, "Ban", HTML.White + (otherInfo.Banned ? "<CENTER>Unban" : "<CENTER>Ban"), otherInfo.Banned ? new TimerCallback(Unban) : new TimerCallback(Ban));
                        AddItem(x - 30, y + 43, 0x186A);
                    }
                    else if (Owner.AccessLevel == AccessLevel.Administrator)
                    {
                        AddTemplateButton(x, y + 40, 70, Template.RedSquare, "Global Priv", HTML.White + (otherInfo.GlobalAccess ? "<CENTER>Revoke Global" : "<CENTER>Give Global"), new TimerStateCallback(GlobalAccess), otherInfo.GlobalAccess);
                        AddItem(x - 30, y + 43, 0x186A);
                    }
                }

                AddButton(Width - 20, Height / 2 - 10, 0x15E1, 0x15E5, 0, GumpButtonType.Page, 2);

                AddPage(2);

                AddButton(0, Height / 2 - 10, 0x15E3, 0x15E7, 0, GumpButtonType.Page, 1);

                AddHtml(0, 10, Width, 25, "<CENTER>" + HTML.White + c_Target.Name + "'s Profile", false, false);
                AddHtml(20, 30, Width - 40, Height - 50, c_Target.Profile, true, true);
            }catch { Errors.Report(String.Format("ProfileGump-> BuildGump-> |{0}|-> |{1}|", Owner, c_Target)); }
        }