示例#1
0
        private void ShowMenu(int x)
        {
            int width = 150;
            int y     = -10;

            AddImage(x - 8, 10, 0x100);
            AddHtml(x, y += 25, width, "<CENTER>" + General.Local(38));
            AddImage(x + 10, y + 2, 0x39);
            AddImage(x + width - 40, y + 2, 0x3B);

            y += 5;

            foreach (Chat3.Channel c in Chat3.Channel.Channels)
            {
                if (!c.CanChat(Current, false))
                {
                    continue;
                }

                AddHtml(x + 40, y += 20, width - 40, (Data.GetData(Current).CurrentChannel == c ? HTML.Yellow : HTML.White) + "<CENTER>" + (c.Style == ChatStyle.Regional ? c.Name : c.NameFor(Current)));
                AddButton(x + 20, y, c.IsIn(Current) ? 0x2343 : 0x2342, "Join Channel", new GumpStateCallback(JoinChannel), c);

                if (c.IsIn(Current))
                {
                    AddButton(x + 40 + (width - 40) / 2 - 40, y + 3, 0x2716, "View Channel", new GumpStateCallback(ViewChannel), c);
                    AddButton(x + 40 + (width - 40) / 2 + 30, y + 3, 0x2716, "View Channel", new GumpStateCallback(ViewChannel), c);
                }
            }

            AddHtml(x, y += 25, width, "<CENTER>" + General.Local(1));
            AddImage(x + 10, y + 2, 0x39);
            AddImage(x + width - 40, y + 2, 0x3B);

            AddHtml(x, y += 25, width, "<CENTER>" + General.Local(46));
            AddButton(x + 20, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.All);
            AddButton(x + width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.All);
            AddHtml(x, y += 20, width, "<CENTER>" + General.Local(56));
            AddButton(x + 20, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.Mail);
            AddButton(x + width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.Mail);
            AddHtml(x, y += 20, width, "<CENTER>" + General.Local(203));
            AddButton(x + 20, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.Friends);
            AddButton(x + width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.Friends);
            AddHtml(x, y += 20, width, "<CENTER>" + General.Local(51));
            AddButton(x + 20, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.Ignores);
            AddButton(x + width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.Ignores);

            AddHtml(x, y += 20, width, (c_ListPage == ListPage.Channel ? "" : HTML.Gray) + "<CENTER>" + General.Local(206));
            if (c_ListPage == ListPage.Channel)
            {
                AddButton(x + 20, y + 3, 0x2716, "History", new GumpCallback(History));
                AddButton(x + width - 30, y + 3, 0x2716, "History", new GumpCallback(History));
            }

            if (Data.GetData(Current).GlobalAccess)
            {
                AddHtml(x, y += 20, width, HTML.Red + "<CENTER>" + General.Local(204));
                AddButton(x + 20, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.GIgnores);
                AddButton(x + width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.GIgnores);
                AddHtml(x, y += 20, width, HTML.Red + "<CENTER>" + General.Local(205));
                AddButton(x + 20, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.GListens);
                AddButton(x + width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.GListens);
            }

            if (Current.AccessLevel > AccessLevel.GameMaster)
            {
                AddHtml(x, y += 20, width, HTML.Red + "<CENTER>" + General.Local(54));
                AddButton(x + 20, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.Bans);
                AddButton(x + width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.Bans);
                AddHtml(x, y += 20, width, HTML.Red + "<CENTER>" + General.Local(269));
                AddButton(x + 20, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.Notifications);
                AddButton(x + width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(Page), ListPage.Notifications);
            }

            AddHtml(x, y += 25, width, "<CENTER>" + General.Local(40));
            AddImage(x + 10, y + 2, 0x39);
            AddImage(x + width - 40, y + 2, 0x3B);

            AddHtml(x, y += 25, width, "<CENTER>" + General.Local(49));
            AddButton(x + 20, y + 3, 0x2716, "Colors", new GumpCallback(Colors));
            AddButton(x + width - 30, y + 3, 0x2716, "Colors", new GumpCallback(Colors));
            AddHtml(x, y += 20, width, "<CENTER>" + General.Local(56));
            AddButton(x + 20, y + 3, 0x2716, "Mail", new GumpCallback(Mail));
            AddButton(x + width - 30, y + 3, 0x2716, "Mail", new GumpCallback(Mail));

            if (Data.GetData(Current).GlobalAccess)
            {
                AddHtml(x, y += 20, width, HTML.Red + "<CENTER>" + General.Local(43));
                AddButton(x + 20, y + 3, 0x2716, "Global Menu", new GumpCallback(GlobalMenu));
                AddButton(x + width - 30, y + 3, 0x2716, "Global Menu", new GumpCallback(GlobalMenu));
            }

            if (Current.AccessLevel >= AccessLevel.Administrator)
            {
                AddHtml(x, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(207));
                AddButton(x + 20, y + 3, 0x2716, "General", new GumpCallback(GenOpt));
                AddButton(x + width - 30, y + 3, 0x2716, "General", new GumpCallback(GenOpt));
                AddHtml(x, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(237));
                AddButton(x + 20, y + 3, 0x2716, "Logging", new GumpCallback(Logging));
                AddButton(x + width - 30, y + 3, 0x2716, "Logging", new GumpCallback(Logging));
                AddHtml(x, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(208));
                AddButton(x + 20, y + 3, 0x2716, "Filter", new GumpCallback(Filter));
                AddButton(x + width - 30, y + 3, 0x2716, "Filter", new GumpCallback(Filter));
                AddHtml(x, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(209));
                AddButton(x + 20, y + 3, 0x2716, "Spam", new GumpCallback(Spam));
                AddButton(x + width - 30, y + 3, 0x2716, "Spam", new GumpCallback(Spam));
                AddHtml(x, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(210));
                AddButton(x + 20, y + 3, 0x2716, "Irc", new GumpCallback(Irc));
                AddButton(x + width - 30, y + 3, 0x2716, "Irc", new GumpCallback(Irc));
                AddHtml(x, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(287));
                AddButton(x + 20, y + 3, 0x2716, "Multi", new GumpCallback(Multi));
                AddButton(x + width - 30, y + 3, 0x2716, "Multi", new GumpCallback(Multi));
                AddHtml(x, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(50));
                AddButton(x + 20, y + 3, 0x2716, "Channel", new GumpCallback(Channel));
                AddButton(x + width - 30, y + 3, 0x2716, "Channel", new GumpCallback(Channel));
            }

            AddButton(x + width / 2 - 30, y += 25, 0x8B1, "1.0", new GumpStateCallback(SkinChange), Skin.One);
            AddButton(x + width / 2 - 10, y, 0x8B2, "2.0", new GumpStateCallback(SkinChange), Skin.Two);
            AddButton(x + width / 2 + 10, y, 0x8B3, "3.0", new GumpStateCallback(SkinChange), Skin.Three);

            AddBackgroundZero(x, 0, width, y + 40, Data.GetData(Current).DefaultBack, false);
        }
示例#2
0
        protected virtual void Broadcast(Mobile m, string msg)
        {
            if (m.HasFilter) //Players with battlefocus can't chat
            {
                return;
            }

            //Custom: Display staff tag
            string a_Name = m.AccessLevel > AccessLevel.Player ? String.Format("{0} [{1}]", m.RawName, m.AccessLevel) : m.RawName;

            foreach (Data data in Data.Datas.Values)
            {
                if (c_Mobiles.Contains(data.Mobile) && !data.Ignores.Contains(m))
                {
                    if (data.Mobile.HasFilter) //Players with battlefocus won't hear chat
                    {
                        continue;
                    }

                    if (c_Style == ChatStyle.Regional && data.Mobile.Region != m.Region)
                    {
                        continue;
                    }

                    data.Mobile.SendMessage(m.AccessLevel == AccessLevel.Player ? ColorFor(data.Mobile) : Data.GetData(m).StaffC, String.Format("<{0}{1}> {2}: {3}", NameFor(m), (c_Style == ChatStyle.Regional && m.Region != null ? "-" + m.Region.Name : ""), a_Name, msg));
                }
                else if (data.Mobile.AccessLevel >= m.AccessLevel && ((data.GlobalC && !data.GIgnores.Contains(m)) || data.GListens.Contains(m)))
                {
                    data.Mobile.SendMessage(data.GlobalCC, String.Format("(Global) <{0}{1}> {2}: {3}", c_Name, (c_Style == ChatStyle.Regional && m.Region != null ? "-" + m.Region.Name : ""), a_Name, msg));
                }
            }
        }
示例#3
0
 private void Submit()
 {
     Data.GetData(Owner).AwayMsg = GetTextField("Away");
     c_Gump.NewGump();
 }
 private void Delete()
 {
     Data.GetData(Owner).DeleteMessage(c_Message);
 }
示例#5
0
        public virtual void OnChat(Mobile m, string msg, bool spam)
        {
            if (msg == null || msg == "")
            {
                if (!CanChat(m, false))
                {
                    General.List(m, 0);
                    return;
                }

                if (c_Mobiles.Contains(m))
                {
                    Data.GetData(m).CurrentChannel = this;
                }

                General.List(m, 1);
                return;
            }

            if (!CanChat(m, true))
            {
                return;
            }

            if (c_Filter)
            {
                msg = Chat3.Filter.FilterText(m, msg);
            }

            if (!CanChat(m, false))
            {
                return;
            }

            if (!c_Mobiles.Contains(m))
            {
                m.SendMessage(Data.GetData(m).SystemC, General.Local(34));
                return;
            }

            if (c_Delay && !TrackSpam.LogSpam(m, "Chat", TimeSpan.FromSeconds(Data.ChatSpam)))
            {
                if (spam)
                {
                    m.SendMessage(Data.GetData(m).SystemC, General.Local(97));
                }
                Timer.DelayCall(TimeSpan.FromSeconds(4), new TimerStateCallback(OnChat), new object[] { m, msg });
                return;
            }

            AddHistory(m, msg);
            UpdateHistory(m);
            Events.InvokeChat(new ChatEventArgs(m, this, msg));

            if (Data.LogChat)
            {
                Logging.LogChat(String.Format(DateTime.Now + " <{0}{1}> {2}: {3}", c_Name, (c_Style == ChatStyle.Regional && m.Region != null ? "-" + m.Region.Name : ""), m.Name, msg));
            }

            Data.TotalChats++;
            Data.GetData(m).Karma++;

            Broadcast(m, msg);

            if (c_ToIrc && IrcConnection.Connection.Connected)
            {
                IrcConnection.Connection.SendUserMessage(m, "(" + c_Name + ") " + msg);
            }
        }
示例#6
0
 private void PerPageDown()
 {
     Data.GetData(Current).PerPage--;
     NewGump();
 }
示例#7
0
 private void History()
 {
     NewGump();
     new HistoryGump(Owner, Data.GetData(Current).CurrentChannel);
 }
示例#8
0
 private void Listen()
 {
     Data.GetData(Current).Global = false;
     NewGump();
 }
示例#9
0
 private void GlobalChat()
 {
     Data.GetData(Current).GlobalC = !Data.GetData(Current).GlobalC;
     NewGump();
 }
示例#10
0
 private void IrcRaw()
 {
     Data.GetData(Current).IrcRaw = !Data.GetData(Current).IrcRaw;
     NewGump();
 }
示例#11
0
 private void Global()
 {
     Data.GetData(Current).Global = true;
     NewGump();
 }
示例#12
0
 private void GlobalFaction()
 {
     Data.GetData(Current).GlobalF = !Data.GetData(Current).GlobalF;
     NewGump();
 }
示例#13
0
        private static void OnLogin(LoginEventArgs args)
        {
            if (Data.GetData(args.Mobile).NewMsg())
            {
                PmNotify(args.Mobile);
            }

            if (!Data.GetData(args.Mobile).WhenFull)
            {
                args.Mobile.SendMessage(Data.GetData(args.Mobile).SystemC, General.Local(258), Data.GetData(args.Mobile).Messages.Count, Data.MaxMsgs);
            }

            foreach (Data data in Data.Datas.Values)
            {
                if (data.Friends.Contains(args.Mobile) && data.FriendAlert)
                {
                    data.Mobile.SendMessage(data.SystemC, args.Mobile.RawName + " " + Local(173));
                }
            }
        }
示例#14
0
        protected override void BuildGump()
        {
            int width = 200;
            int y     = 10;

            AddHtml(0, y, width, "<CENTER>" + General.Local(216));
            AddImage(width / 2 - 70, y + 2, 0x39);
            AddImage(width / 2 + 40, y + 2, 0x3B);

            if (c_Target != null)
            {
                AddHtml(0, y += 25, width, "<CENTER>" + General.Local(224) + " " + c_Target.RawName);
            }

            foreach (Channel c in Channel.Channels)
            {
                if (c.CanChat(Current, false))
                {
                    AddHtml(0, y += 25, width, "<CENTER>" + c.NameFor(Current));
                    AddImage(width / 2 - 70, y, 0x2342, c.ColorFor(Current));
                    AddButton(width / 2 - 66, y + 4, 0x2716, "Channel Color", new GumpStateCallback(ChannelColor), c);
                    AddImage(width / 2 + 50, y, 0x2342, c.ColorFor(Current));
                    AddButton(width / 2 + 55, y + 4, 0x2716, "Channel Color", new GumpStateCallback(ChannelColor), c);
                }
            }

            AddHtml(0, y += 25, width, "<CENTER>" + General.Local(47));
            AddImage(width / 2 - 70, y, 0x2342, Data.GetData(Current).SystemC);
            AddButton(width / 2 - 66, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 2);
            AddImage(width / 2 + 50, y, 0x2342, Data.GetData(Current).SystemC);
            AddButton(width / 2 + 55, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 2);

            if (Current.AccessLevel > AccessLevel.Player)
            {
                AddHtml(0, y += 25, width, "<CENTER>" + General.Local(48));
                AddImage(width / 2 - 70, y, 0x2342, Data.GetData(Current).StaffC);
                AddButton(width / 2 - 66, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 3);
                AddImage(width / 2 + 50, y, 0x2342, Data.GetData(Current).StaffC);
                AddButton(width / 2 + 55, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 3);
            }

            if (Data.GetData(Current).GlobalAccess)
            {
                y += 20;

                AddHtml(0, y += 25, width, "<CENTER>" + General.Local(44));
                AddImage(width / 2 - 70, y, 0x2342, Data.GetData(Current).GlobalCC);
                AddButton(width / 2 - 66, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 0);
                AddImage(width / 2 + 50, y, 0x2342, Data.GetData(Current).GlobalCC);
                AddButton(width / 2 + 55, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 0);

                AddHtml(0, y += 25, width, "<CENTER>" + General.Local(45));
                AddImage(width / 2 - 70, y, 0x2342, Data.GetData(Current).GlobalWC);
                AddButton(width / 2 - 66, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 1);
                AddImage(width / 2 + 50, y, 0x2342, Data.GetData(Current).GlobalWC);
                AddButton(width / 2 + 55, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 1);

                AddHtml(0, y += 25, width, "<CENTER>" + General.Local(192));
                AddImage(width / 2 - 70, y, 0x2342, Data.GetData(Current).GlobalGC);
                AddButton(width / 2 - 66, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 4);
                AddImage(width / 2 + 50, y, 0x2342, Data.GetData(Current).GlobalGC);
                AddButton(width / 2 + 55, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 4);

                AddHtml(0, y += 25, width, "<CENTER>" + General.Local(193));
                AddImage(width / 2 - 70, y, 0x2342, Data.GetData(Current).GlobalFC);
                AddButton(width / 2 - 66, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 5);
                AddImage(width / 2 + 50, y, 0x2342, Data.GetData(Current).GlobalFC);
                AddButton(width / 2 + 55, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 5);

                AddHtml(0, y += 25, width, "<CENTER>" + General.Local(26));
                AddImage(width / 2 - 70, y, 0x2342, Data.GetData(Current).GlobalMC);
                AddButton(width / 2 - 66, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 6);
                AddImage(width / 2 + 50, y, 0x2342, Data.GetData(Current).GlobalMC);
                AddButton(width / 2 + 55, y + 4, 0x2716, "Colors", new GumpStateCallback(Colors), 6);
            }

            AddBackgroundZero(0, 0, width, y + 40, Data.GetData(Current).DefaultBack);
        }
示例#15
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 = Data.GetData(Current).PerPage;
            int bar     = width - 18;

            if (c_ListPage == ListPage.Mail)
            {
                perpage /= 2;
            }

            if (c_Menu)
            {
                ShowMenu(width);
            }
            if (c_Search)
            {
                ShowSearch(width);
            }

            AddButton(5, y - 5, 0x5689, "Help", new GumpCallback(Help));
            AddButton(30, y - 1, 0x983, "PerPage Down", new GumpCallback(PerPageDown));
            AddButton(40, y - 1, 0x985, "PerPage Up", new GumpCallback(PerPageUp));
            AddButton(width - 80, y - 5, 0x768, "Profile", new GumpStateCallback(Profile), Current);
            AddLabel(width - 75, y - 5, 0x47E, "P");
            AddButton(width - 65, y - 5, 0x768, "QuickBar", new GumpCallback(QuickBar));
            AddLabel(width - 60, y - 5, Data.GetData(Current).QuickBar ? 0x34 : 0x47E, "Q");
            AddButton(width - 50, y - 5, 0x768, "Menu", new GumpCallback(Menu));
            AddLabel(width - 46, y - 5, c_Menu ? 0x34 : 0x47E, "M");
            AddButton(width - 35, y - 5, 0x768, "Search", new GumpCallback(Search));
            AddLabel(width - 30, y - 5, c_Search ? 0x34 : 0x47E, "S");

            ArrayList list = GetList();

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

            if (list.Count < c_Page * perpage)
            {
                c_Page = 0;
            }

            if (c_Page != 0)
            {
                AddButton(width / 2 - 20, y - 3, 0x25E4, 0x25E5, "Page Down", new GumpCallback(PageDown));
            }
            if (perpage * (c_Page + 1) < list.Count)
            {
                AddButton(width / 2, y - 3, 0x25E8, 0x25E9, "Page Up", new GumpCallback(PageUp));
            }

            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));
            }

            AddImage(width / 2 - 72, (y += 25) - 1, 0x9C5);
            AddHtml(0, y, width, "<CENTER>" + GetTitle());

            if (c_ListPage == ListPage.Mail)
            {
                AddHtml(0, y += 20, width, "<CENTER>" + Data.GetData(Owner).Messages.Count + " / " + Data.MaxMsgs);
            }
            else if (c_ListPage != ListPage.Notifications)
            {
                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, y += 20, width, "<CENTER>" + states.Count + " " + General.Local(19));
            }

            y += 5;

            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(35, y += 20, width - 35, ColorFor((Mobile)list[i]) + ((Mobile)list[i]).RawName + StatusFor((Mobile)list[i]));
                    if (Current == Owner && Data.GetData(Owner).NewMsgFrom((Mobile)list[i]))
                    {
                        AddButton(20, y, 0x1523, "Check Msg", new GumpStateCallback(CheckMsg), (Mobile)list[i]);
                    }
                    else
                    {
                        AddButton(20, y + 3, 0x2716, "Profile", new GumpStateCallback(Profile), (Mobile)list[i]);
                    }

                    if (list[i] == Current)
                    {
                        continue;
                    }

                    if (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]);
                }
            }

            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));
            }

            AddImage(width / 2 - 32, (y += 30) - 2, 0x98C);
            AddHtml(0, y, width, "<CENTER>" + General.Local(19 + (int)Data.GetData(Current).Status));
            AddButton(width / 2 - 50, y + 3, 0x2716, "Status", new GumpCallback(Status));
            AddButton(width / 2 + 40, y + 3, 0x2716, "Status", new GumpCallback(Status));

            AddBackgroundZero(0, 0, width, y + 50, Data.GetData(Current).DefaultBack);
        }
示例#16
0
 private void GlobalWorld()
 {
     Data.GetData(Current).GlobalW = !Data.GetData(Current).GlobalW;
     NewGump();
 }
示例#17
0
 private void PerPageUp()
 {
     Data.GetData(Current).PerPage++;
     NewGump();
 }
示例#18
0
 private void GlobalMsg()
 {
     Data.GetData(Current).GlobalM = !Data.GetData(Current).GlobalM;
     NewGump();
 }
示例#19
0
 private void QuickBar()
 {
     Data.GetData(Current).QuickBar = !Data.GetData(Current).QuickBar;
     NewGump();
 }
示例#20
0
 private void GlobalGuild()
 {
     Data.GetData(Current).GlobalG = !Data.GetData(Current).GlobalG;
     NewGump();
 }
示例#21
0
        public static string FilterText(Mobile m, string s, bool punish)
        {
            try
            {
                string filter   = "";
                string subOne   = "";
                string subTwo   = "";
                string subThree = "";
                int    index    = 0;

                for (int i = 0; i < Data.Filters.Count; ++i)
                {
                    filter = Data.Filters[i].ToString();

                    if (filter == "")
                    {
                        Data.Filters.Remove(filter);
                        continue;
                    }

                    index = s.ToLower().IndexOf(filter);

                    if (index >= 0)
                    {
                        if (m.AccessLevel == AccessLevel.Player && punish)
                        {
                            if (++Data.GetData(m).Warnings <= Data.FilterWarnings)
                            {
                                m.SendMessage(Data.GetData(m).SystemC, General.Local(111) + " " + filter);
                            }
                            else
                            {
                                Data.GetData(m).Warnings = 0;

                                Events.InvokeFilterViolation(new FilterViolationEventArgs(m));

                                if (Data.FilterPenalty == FilterPenalty.Ban)
                                {
                                    Data.GetData(m).Ban(TimeSpan.FromMinutes(Data.FilterBanLength));
                                }

                                if (Data.FilterPenalty == FilterPenalty.Jail)
                                {
                                    ChatJail.SendToJail(m);
                                }

                                if (Data.FilterPenalty != FilterPenalty.None)
                                {
                                    return("");
                                }
                            }
                        }

                        subOne = s.Substring(0, index);
                        subTwo = "";

                        for (int ii = 0; ii < filter.Length; ++ii)
                        {
                            subTwo += "*";
                        }

                        subThree = s.Substring(index + filter.Length, s.Length - filter.Length - index);

                        s = subOne + subTwo + subThree;

                        i--;
                    }
                }
            }
            catch { Errors.Report(General.Local(176)); }

            return(s);
        }
示例#22
0
        private void BuildTabs(int width, int y)
        {
            AddButton(width / 2 - 90, y, 0x98B, "Channels", new GumpCallback(Channels));
            AddHtml(width / 2 - 90, y + 3, 60, (c_ListPage == ListPage.Channel ? HTML.Green : HTML.White) + "<CENTER>" + Data.GetData(Current).CurrentChannel.NameFor(Current));

            AddButton(width / 2 - 30, y, 0x98B, "Page", new GumpStateCallback(Page), ListPage.Friends);
            AddHtml(width / 2 - 30, y + 3, 60, (c_ListPage == ListPage.Friends ? HTML.Green : HTML.White) + "<CENTER>" + General.Local(203));

            AddButton(width / 2 + 30, y, 0x98B, "Page", new GumpStateCallback(Page), ListPage.Ignores);
            AddHtml(width / 2 + 30, y + 3, 60, (c_ListPage == ListPage.Ignores ? HTML.Green : HTML.White) + "<CENTER>" + General.Local(51));

            AddButton(width / 2 - 90, y += 23, 0x98B, "Page", new GumpStateCallback(Page), ListPage.Mail);
            AddHtml(width / 2 - 90, y + 3, 60, (c_ListPage == ListPage.Mail ? HTML.Green : HTML.White) + "<CENTER>" + General.Local(56));

            AddButton(width / 2 - 30, y, 0x98B, "Options", new GumpCallback(Options));
            AddHtml(width / 2 - 30, y + 3, 60, "<CENTER>" + General.Local(39));

            AddButton(width / 2 + 30, y, 0x98B, "Views", new GumpCallback(Views));
            AddHtml(width / 2 + 30, y + 3, 60, "<CENTER>" + General.Local(1));

            AddButton(width / 2 - 30, y += 25, 0x8B1, "1.0", new GumpStateCallback(SkinChange), Skin.One);
            AddButton(width / 2 - 10, y, 0x8B2, "2.0", new GumpStateCallback(SkinChange), Skin.Two);
            AddButton(width / 2 + 10, y, 0x8B3, "3.0", new GumpStateCallback(SkinChange), Skin.Three);
        }
示例#23
0
        protected override void BuildGump()
        {
            int width = 300;
            int y     = 10;

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

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

            AddButton(20, 20, 0x2716, "Profile", new GumpCallback(Profile));

            AddHtml(95, y += 15, width - 105, General.Local(60) + " " + c_Message.From.RawName);
            AddHtml(95, y += 20, width - 105, 42, c_Message.Subject, false, false);

            AddHtml(20, y += 50, width - 40, 80, HTML.Black + c_Message.Msg, true, true);
            y             += 90;

            if (Data.GetData(Owner).Messages.Contains(c_Message))
            {
                if (c_Message.Type == MsgType.Normal)
                {
                    if (Message.CanMessage(Owner, c_Message.From) && !Message.StaffTimeout(c_Message))
                    {
                        AddHtml(width - 85, y, 50, General.Local(248));
                        AddButton(width - 100, y + 3, 0x2716, "Reply", new GumpCallback(Reply));
                    }

                    AddHtml(width - 145, y, 50, General.Local(249));
                    AddButton(width - 160, y + 3, 0x2716, "Delete", new GumpCallback(Delete));

                    if (c_Message.From.AccessLevel == AccessLevel.Player)
                    {
                        AddHtml(95, y, 50, General.Local(2));
                        AddButton(80, y + 3, 0x2716, "Ignore", new GumpCallback(Ignore));
                    }
                }
                else if (c_Message.Type == MsgType.Invite)
                {
                    AddHtml(width - 85, y, 50, General.Local(250));
                    AddButton(width - 100, y + 3, 0x2716, "Accept", new GumpCallback(Accept));

                    AddHtml(width - 145, y, 50, General.Local(251));
                    AddButton(width - 160, y + 3, 0x2716, "Deny", new GumpCallback(Deny));

                    if (c_Message.From.AccessLevel == AccessLevel.Player)
                    {
                        AddHtml(95, y, 50, General.Local(2));
                        AddButton(80, y + 3, 0x2716, "Ignore", new GumpCallback(Ignore));
                    }
                }
            }

            AddBackgroundZero(0, 0, width, y + 30, Data.GetData(Owner).DefaultBack);
        }
示例#24
0
 private void ClearMsg()
 {
     Data.GetData(Owner).AwayMsg = "";
     NewGump();
 }
示例#25
0
        protected virtual void Broadcast(Mobile m, string msg)
        {
            foreach (Data data in Data.Datas.Values)
            {
                if (c_Mobiles.Contains(data.Mobile) && !data.Ignores.Contains(m))
                {
                    if (c_Style == ChatStyle.Regional && data.Mobile.Region != m.Region)
                    {
                        continue;
                    }

                    data.Mobile.SendMessage(m.AccessLevel == AccessLevel.Player ? ColorFor(data.Mobile) : Data.GetData(m).StaffC, String.Format("<{0}{1}> {2}: {3}", NameFor(m), (c_Style == ChatStyle.Regional && m.Region != null ? "-" + m.Region.Name : ""), m.Name, msg));
                }
                else if (data.Mobile.AccessLevel >= m.AccessLevel && ((data.GlobalC && !data.GIgnores.Contains(m)) || data.GListens.Contains(m)))
                {
                    data.Mobile.SendMessage(data.GlobalCC, String.Format("(Global) <{0}{1}> {2}: {3}", c_Name, (c_Style == ChatStyle.Regional && m.Region != null ? "-" + m.Region.Name : ""), m.Name, msg));
                }
            }
        }
示例#26
0
 protected override void BuildGump()
 {
     AddImage(0, 0, 0x15D5, Data.GetData(Owner).SystemC);
     AddButton(13, 13, 0xFC4, "Open", new GumpCallback(Open));
 }