예제 #1
0
        private string Color(ChatInfo info)
        {
            if (info.Mobile.NetState == null ||
                info.PublicDisabled ||
                (info.Hidden && info.Mobile.AccessLevel > Owner.AccessLevel))
            {
                return(HTML.Gray);
            }
            if (info.Banned)
            {
                return(HTML.Red);
            }
            if (c_Info.Ignoring(info.Mobile))
            {
                return(HTML.AshRed);
            }
            if (c_Info.GlobalIgnoring(info.Mobile))
            {
                return(HTML.DarkGray);
            }
            if (info.Mobile.AccessLevel != AccessLevel.Player)
            {
                return(HTML.Blue);
            }
            if (Owner.Guild != null && Owner.Guild == info.Mobile.Guild)
            {
                return(HTML.Green);
            }
            if (FactionChat.SameFaction(Owner, info.Mobile))
            {
                return(HTML.Purple);
            }

            return(HTML.White);
        }
예제 #2
0
        private void MiniList()
        {
            Hashtable table = new Hashtable();

            if (Owner.AccessLevel > AccessLevel.Player)
            {
                table.Add((int)Listing.Banned, "Banned");
            }

            if (ChatInfo.ShowStaff ||
                Owner.AccessLevel != AccessLevel.Player)
            {
                table.Add((int)Listing.Staff, "Staff");
            }

            if (Owner.Guild != null)
            {
                table.Add((int)Listing.Guild, "Guild");
            }

            if (FactionChat.IsInFaction(Owner) && ChatInfo.AllowFaction)
            {
                table.Add((int)Listing.Faction, "Faction");
            }

            table.Add((int)Listing.Ignores, "Ignores");
            table.Add((int)Listing.Messages, "Messages");

            if (ChatInfo.IrcEnabled &&
                IrcConnection.Connection.Connected &&
                c_Info.IrcOn)
            {
                table.Add((int)Listing.IRC, "IRC");
            }

            if (!c_Info.PublicDisabled)
            {
                table.Add((int)Listing.Search, "Search");
            }

            table.Add((int)Listing.Friends, "Friends");

            if (!c_Info.PublicDisabled)
            {
                table.Add((int)Listing.Public, "Public");
            }

            ChoiceGump.SendTo(Owner, "", 100, new TimerStateCallback(List), table);
        }
예제 #3
0
        private void BuildTabs()
        {
            int y = c_Height - 80;
            int x = 10;

            if (!c_Info.PublicDisabled)
            {
                if (c_Listing == Listing.Public)
                {
                    AddTemplateButton(x, y, 70, Template.RedSquare, "Public List", HTML.Green + "<CENTER>Public", new TimerStateCallback(List), (int)Listing.Public, false);
                }
                else
                {
                    AddTemplateButton(x, y, 70, Template.RedSquare, "Public List", HTML.White + "<CENTER>Public", new TimerStateCallback(List), (int)Listing.Public);
                }
            }

            if (!c_Info.PublicDisabled)
            {
                if (c_Listing == Listing.Search)
                {
                    AddTemplateButton(x, y + 15, 70, Template.RedSquare, "Search List", HTML.Green + "<CENTER>Search", new TimerStateCallback(List), (int)Listing.Search, false);
                }
                else
                {
                    AddTemplateButton(x, y + 15, 70, Template.RedSquare, "Search List", HTML.White + "<CENTER>Search", new TimerStateCallback(List), (int)Listing.Search);
                }
            }

            if (ChatInfo.ShowStaff || Owner.AccessLevel != AccessLevel.Player)
            {
                if (c_Listing == Listing.Staff)
                {
                    AddTemplateButton(x, y + 30, 70, Template.RedSquare, "Staff List", HTML.Green + "<CENTER>Staff", new TimerStateCallback(List), (int)Listing.Staff, false);
                }
                else
                {
                    AddTemplateButton(x, y + 30, 70, Template.RedSquare, "Staff List", HTML.White + "<CENTER>Staff", new TimerStateCallback(List), (int)Listing.Staff);
                }
            }

            if (Owner.AccessLevel > AccessLevel.Player)
            {
                if (c_Listing == Listing.Banned)
                {
                    AddTemplateButton(x, y + 45, 70, Template.RedSquare, "Banned List", HTML.Green + "<CENTER>Banned", new TimerStateCallback(List), (int)Listing.Banned, false);
                }
                else
                {
                    AddTemplateButton(x, y + 45, 70, Template.RedSquare, "Banned List", HTML.White + "<CENTER>Banned", new TimerStateCallback(List), (int)Listing.Banned);
                }
            }

            x += 55;

            if (Owner.Guild != null)
            {
                if (c_Listing == Listing.Guild)
                {
                    AddTemplateButton(x, y, 70, Template.RedSquare, "Guild List", HTML.Green + "<CENTER>Guild", new TimerStateCallback(List), (int)Listing.Guild, false);
                }
                else
                {
                    AddTemplateButton(x, y, 70, Template.RedSquare, "Guild List", HTML.White + "<CENTER>Guild", new TimerStateCallback(List), (int)Listing.Guild);
                }
            }

            if (c_Listing == Listing.Friends)
            {
                AddTemplateButton(x, y + 15, 70, Template.RedSquare, "Friends List", HTML.Green + "<CENTER>Friends", new TimerStateCallback(List), (int)Listing.Friends, false);
            }
            else
            {
                AddTemplateButton(x, y + 15, 70, Template.RedSquare, "Friends List", HTML.White + "<CENTER>Friends", new TimerStateCallback(List), (int)Listing.Friends);
            }

            if (c_Listing == Listing.Ignores)
            {
                AddTemplateButton(x, y + 30, 70, Template.RedSquare, "Ignores List", HTML.Green + "<CENTER>Ignores", new TimerStateCallback(List), (int)Listing.Ignores, false);
            }
            else
            {
                AddTemplateButton(x, y + 30, 70, Template.RedSquare, "Ignores List", HTML.White + "<CENTER>Ignores", new TimerStateCallback(List), (int)Listing.Ignores);
            }

            AddTemplateButton(x, y + 45, 70, Template.RedSquare, "Options", HTML.White + "<CENTER>Options", new TimerCallback(Options));

            x += 55;

            if (ChatInfo.AllowFaction && FactionChat.IsInFaction(Owner))
            {
                if (c_Listing == Listing.Faction)
                {
                    AddTemplateButton(x, y, 70, Template.RedSquare, "Faction List", HTML.Green + "<CENTER>Faction", new TimerStateCallback(List), (int)Listing.Faction, false);
                }
                else
                {
                    AddTemplateButton(x, y, 70, Template.RedSquare, "Faction List", HTML.White + "<CENTER>Faction", new TimerStateCallback(List), (int)Listing.Faction);
                }
            }

            if (c_Listing == Listing.Messages)
            {
                AddTemplateButton(x, y + 15, 70, Template.RedSquare, "Message List", HTML.Green + "<CENTER>Messages", new TimerStateCallback(List), (int)Listing.Messages, false);
            }
            else
            {
                AddTemplateButton(x, y + 15, 70, Template.RedSquare, "Message List", HTML.White + "<CENTER>Messages", new TimerStateCallback(List), (int)Listing.Messages);
            }

            if (ChatInfo.IrcEnabled && IrcConnection.Connection.Connected && c_Info.IrcOn)
            {
                if (c_Listing == Listing.IRC)
                {
                    AddTemplateButton(x, y + 30, 70, Template.RedSquare, "IRC List", HTML.Green + "<CENTER>IRC", new TimerStateCallback(List), (int)Listing.IRC, false);
                }
                else
                {
                    AddTemplateButton(x, y + 30, 70, Template.RedSquare, "IRC List", HTML.White + "<CENTER>IRC", new TimerStateCallback(List), (int)Listing.IRC);
                }
            }
        }
예제 #4
0
        private void BuildList()
        {
            try{
                c_List.Clear();

                switch (c_Listing)
                {
                case Listing.Public:

                    foreach (ChatInfo info in new ArrayList(ChatInfo.ChatInfos.Values))
                    {
                        if (info.Mobile == null || info.Mobile.Deleted)
                        {
                            ChatInfo.ChatInfos.Remove(info);
                            continue;
                        }

                        if (info.Mobile.NetState == null ||
                            info.Mobile.AccessLevel != AccessLevel.Player)
                        {
                            continue;
                        }

                        if (PublicChat.CanChat(info) || Owner.AccessLevel > info.Mobile.AccessLevel)
                        {
                            c_List.Add(info.Mobile);
                        }
                    }

                    c_List.Sort(new MobileName());

                    break;

                case Listing.Friends:

                    c_List = new ArrayList(c_Info.Friends);

                    if (!ChatInfo.ShowStaff)
                    {
                        foreach (Mobile m in new ArrayList(c_List))
                        {
                            if (m.AccessLevel != AccessLevel.Player)
                            {
                                c_List.Remove(m);
                            }
                        }
                    }

                    c_List.Sort(new MobileName());

                    break;

                case Listing.Search:

                    if (c_Info.Search == "")
                    {
                        break;
                    }

                    foreach (ChatInfo info in ChatInfo.ChatInfos.Values)
                    {
                        if (!ChatInfo.ShowStaff && info.Mobile.AccessLevel != AccessLevel.Player)
                        {
                            continue;
                        }

                        if (info.Mobile.Name.ToLower().IndexOf(c_Info.Search.ToLower()) != -1 &&
                            info.Mobile.NetState != null)
                        {
                            c_List.Add(info.Mobile);
                        }
                    }

                    c_List.Sort(new MobileName());

                    break;

                case Listing.IRC:

                    c_List = new ArrayList(ChatInfo.IrcList);
                    c_List.Sort(new Alpha());

                    break;

                case Listing.Messages:

                    c_List = new ArrayList(c_Mailbox ? c_Info.Messages : c_Info.SavedMsgs);
                    c_List.Sort(new MessageTime());

                    break;

                case Listing.Ignores:

                    c_List = new ArrayList(c_Info.Ignores);
                    c_List.AddRange(c_Info.GlobalIgnores);

                    if (!ChatInfo.ShowStaff)
                    {
                        foreach (Mobile m in new ArrayList(c_List))
                        {
                            if (m.AccessLevel != AccessLevel.Player)
                            {
                                c_List.Remove(m);
                            }
                        }
                    }

                    c_List.Sort(new MobileName());

                    break;

                case Listing.Guild:

                    foreach (ChatInfo info in ChatInfo.ChatInfos.Values)
                    {
                        if (info.Mobile.Guild != null &&
                            info.Mobile.Guild == Owner.Guild)
                        {
                            c_List.Add(info.Mobile);
                        }
                    }

                    c_List.Sort(new MobileName());

                    break;

                case Listing.Faction:

                    foreach (ChatInfo info in ChatInfo.ChatInfos.Values)
                    {
                        if (FactionChat.SameFaction(Owner, info.Mobile))
                        {
                            c_List.Add(info.Mobile);
                        }
                    }

                    c_List.Sort(new MobileName());

                    break;

                case Listing.Staff:

                    foreach (ChatInfo info in ChatInfo.ChatInfos.Values)
                    {
                        if (info.Mobile.AccessLevel != AccessLevel.Player)
                        {
                            c_List.Add(info.Mobile);
                        }
                    }

                    c_List.Sort(new MobileAccessLevel());

                    break;

                case Listing.Banned:

                    foreach (ChatInfo info in ChatInfo.ChatInfos.Values)
                    {
                        if (info.Banned)
                        {
                            c_List.Add(info.Mobile);
                        }
                    }

                    c_List.Sort(new MobileName());

                    break;
                }
            }catch { Errors.Report(String.Format("ListGump-> BuildList-> |{0}|", Owner)); }
        }
예제 #5
0
        private void General()
        {
            AddHtml(0, 10, Width, 25, HTML.White + "<CENTER>General Options", false, false);
            AddBackground(20, 30, Width - 40, 3, 0x13BE);

            int x = 30;
            int y = 45;

            AddButton(x, y, 0x145E, 0x145E, "Public Color", new TimerStateCallback(Color), 0);
            AddLabel(x + 25, y - 1, c_Info.PublicColor, "Public");

            if (Owner.Guild != null || c_Info.GlobalAccess)
            {
                AddButton(x, y += 20, 0x145E, 0x145E, "Guild Color", new TimerStateCallback(Color), 1);
                AddLabel(x + 25, y - 1, c_Info.GuildColor, "Guild");
            }

            if (FactionChat.IsInFaction(Owner) && ChatInfo.AllowFaction)
            {
                AddButton(x, y += 20, 0x145E, 0x145E, "Faction Color", new TimerStateCallback(Color), 2);
                AddLabel(x + 25, y - 1, c_Info.GuildColor, "Faction");
            }

            AddButton(x, y += 20, 0x145E, 0x145E, "System Color", new TimerStateCallback(Color), 3);
            AddLabel(x + 25, y - 1, c_Info.SystemColor, "System");

            if (ChatInfo.IrcEnabled)
            {
                AddButton(x, y += 20, 0x145E, 0x145E, "IRC Color", new TimerStateCallback(Color), 4);
                AddLabel(x + 25, y - 1, c_Info.IrcColor, "IRC");
            }

            if (Owner.AccessLevel != AccessLevel.Player)
            {
                AddButton(x, y += 20, 0x145E, 0x145E, "StaffColor", new TimerStateCallback(Color), 5);
                AddLabel(x + 25, y - 1, c_Info.StaffColor, "Staff");
                AddItem(x - 30, y + 3, 0x186A);
            }

            if (c_Info.GlobalAccess)
            {
                AddButton(x, y += 20, 0x145E, 0x145E, "World Color", new TimerStateCallback(Color), 6);
                AddLabel(x + 25, y - 1, c_Info.WorldColor, "World");
                AddItem(x - 30, y + 3, 0x186A);

                AddButton(x, y += 20, 0x145E, 0x145E, "World Pm Color", new TimerStateCallback(Color), 7);
                AddLabel(x + 25, y - 1, c_Info.PmColor, "Pm");
                AddItem(x - 30, y + 3, 0x186A);
            }

            x = Width / 2 + 30;
            y = 45;

            if (Owner.AccessLevel == AccessLevel.Player)
            {
                AddHtml(x, y, 90, 25, HTML.White + "<CENTER>Public On", false, false);
                AddButton(x - 20, y, c_Info.PublicDisabled ? 0xD2 : 0xD3, c_Info.PublicDisabled ? 0xD2 : 0xD3, "Disable Public", new TimerCallback(PublicDisabled));
            }
            else
            {
                AddHtml(x, y, 90, 25, HTML.White + "<CENTER>Hidden", false, false);
                AddButton(x - 20, y, c_Info.Hidden ? 0xD3 : 0xD2, c_Info.Hidden ? 0xD3 : 0xD2, "Hide", new TimerCallback(Hidden));
            }

            AddHtml(x, y += 20, 90, 25, HTML.White + "<CENTER>Away", false, false);
            AddButton(x - 20, y, c_Info.Away ? 0xD3 : 0xD2, c_Info.Away ? 0xD3 : 0xD2, "Away", new TimerCallback(Away));

            if (ChatInfo.IrcEnabled && !ChatInfo.PublicPlusIRC)
            {
                AddHtml(x, y += 20, 90, 25, HTML.White + "<CENTER>IRC On", false, false);
                AddButton(x - 20, y, c_Info.IrcOn ? 0xD3 : 0xD2, c_Info.IrcOn ? 0xD3 : 0xD2, "Irc On", new TimerCallback(IrcOn));
            }

            AddHtml(x, y += 20, 90, 25, HTML.White + "<CENTER>Show Quickbar", false, false);
            AddButton(x - 20, y, c_Info.Quickbar ? 0xD3 : 0xD2, c_Info.Quickbar ? 0xD3 : 0xD2, "Quickbar", new TimerCallback(Quickbar));

            if (c_Info.GlobalAccess)
            {
                AddHtml(x, y += 20, 90, 25, HTML.White + "<CENTER>Global World", false, false);
                AddButton(x - 20, y, c_Info.GlobalWorld ? 0xD3 : 0xD2, c_Info.GlobalWorld ? 0xD3 : 0xD2, "Global World", new TimerCallback(GlobalWorld));
                AddItem(x - 50, y + 3, 0x186A);

                AddHtml(x, y += 20, 90, 25, HTML.White + "<CENTER>Global Pm", false, false);
                AddButton(x - 20, y, c_Info.GlobalPm ? 0xD3 : 0xD2, c_Info.GlobalPm ? 0xD3 : 0xD2, "Global Pm", new TimerCallback(GlobalPm));
                AddItem(x - 50, y + 3, 0x186A);

                AddHtml(x, y += 20, 90, 25, HTML.White + "<CENTER>Global Guild", false, false);
                AddButton(x - 20, y, c_Info.GlobalGuild ? 0xD3 : 0xD2, c_Info.GlobalGuild ? 0xD3 : 0xD2, "Global Guild", new TimerCallback(GlobalGuild));
                AddItem(x - 50, y + 3, 0x186A);

                AddHtml(x, y += 20, 90, 25, HTML.White + "<CENTER>Global Faction", false, false);
                AddButton(x - 20, y, c_Info.GlobalFaction ? 0xD3 : 0xD2, c_Info.GlobalFaction ? 0xD3 : 0xD2, "Global Faction", new TimerCallback(GlobalFaction));
                AddItem(x - 50, y + 3, 0x186A);
            }
        }