Пример #1
0
        private Chat()
        {
            LabelEx  label = new LabelEx("Chat", 12, style: FontStyle.Bold | FontStyle.Underline);
            CheckBox check = new CheckBox {
                AutoSize = true, Checked = textBox.AutoScroll, Dock = DockStyle.Fill
            };

            check.CheckedChanged += (s, e) => textBox.AutoScroll = check.Checked;
            table.Controls.Add(check, 0, 0);
            table.Controls.Add(label, 1, 0);
            table.SetColumnSpan(textBox, 2);
            table.Controls.Add(textBox, 0, 1);

            ConfigEx.SetAttribute(true, "enabled", "Chat");
            AutoSize     = false;
            AutoSizeMode = AutoSizeMode.GrowOnly;
            Location     = new Point(ConfigEx.GetAttribute(Location.X, "locX", "Chat"),
                                     ConfigEx.GetAttribute(Location.Y, "locY", "Chat"));
            Size = new Size(ConfigEx.GetAttribute(Size.Width, "sizeW", "Chat"),
                            ConfigEx.GetAttribute(Size.Height, "sizeH", "Chat"));

            Event.ASCIIMessage   += Event_ASCIIMessage;
            Event.UnicodeMessage += Event_UnicodeMessage;
            PacketHandler.RegisterServerToClientViewer(0xBF, OnPartySpeech);
            instance = this;
            MainFormEx.Disconnected -= Close;
            MainFormEx.Disconnected += () =>
            {
                Hidden = true;
                Hide();
            };
            textBox.LinkClicked += textBox_LinkClicked;
        }
Пример #2
0
        private void Honor_End()
        {
            LabelEx label = table.Controls.OfType <LabelEx>().FirstOrDefault();

            if (label != null)
            {
                table.Controls.Remove(label);
            }
        }
Пример #3
0
        private void Honor_Change()
        {
            LabelEx label = table.Controls.OfType <LabelEx>().FirstOrDefault();

            if (label != null)
            {
                label.Text = Honor.Perfection.ToString();
            }
        }
Пример #4
0
        private StatusBar(Serial serial)
        {
            this.serial              = serial;
            table.Padding            = new Padding(3);
            table.Controls.Add(barHP = new Bar(Color.Red));
            if (serial == Serial.MinusOne || PacketHandlers.Party.Contains(serial))
            {
                table.Controls.Add(barMana    = new Bar(Color.Blue));
                table.Controls.Add(barStamina = new Bar(Color.DarkGoldenrod));
                if (PacketHandlers.Party.Contains(serial))
                {
                    barMana.Text = barStamina.Text = "-";
                }
            }

            if (serial == Serial.MinusOne)
            {
                if (ConfigEx.GetAttribute(false, "ex", "Status"))
                {
                    table.ColumnCount            = 2;
                    table.Controls.Add(labelFoll = new LabelEx("-", margin: 0)
                    {
                        ForeColor = Color.White
                    });
                    table.Controls.Add(labelWeight = new LabelEx("-", margin: 0)
                    {
                        ForeColor = Color.White
                    });
                    table.Controls.Add(labelBands = new LabelEx("-", margin: 0)
                    {
                        ForeColor = Color.White
                    });
                    table.Controls.SetChildIndex(labelFoll, 1);
                    table.Controls.SetChildIndex(labelWeight, 3);
                    table.Controls.SetChildIndex(labelBands, 5);
                    Bandages.Changed += Bandages_Changed;
                }
                ConfigEx.SetAttribute(true, "enabled", "Status");
                BackColor = Color.Purple;
                Location  = new Point(ConfigEx.GetAttribute(Location.X, "locX", "Status"),
                                      ConfigEx.GetAttribute(Location.Y, "locY", "Status"));
                UpdateStats();
            }
            else
            {
                Mobile mobile = World.FindMobile(serial);
                if (mobile != null)
                {
                    WorldEx.SendToServer(new StatusQuery(mobile));
                }
            }
            Event.MobileUpdated += WorldEx_MobileUpdated;
        }
Пример #5
0
        private void Honor_Start()
        {
            foreach (LabelEx control in table.Controls.OfType <LabelEx>())
            {
                table.Controls.Remove(control);
            }
            LabelEx label = new LabelEx("0", 9)
            {
                Margin = new Padding(0, 1, 0, 1)
            };
            Mobile mobile = World.FindMobile(Honor.Current);

            if (mobile != null)
            {
                label.Tag = mobile.Name;
            }
            table.Controls.Add(label);
        }