Esempio n. 1
0
            protected internal override void OnDragStart()
            {
                GSkillIcon icon;

                base.m_IsDragging = false;
                Gumps.Drag        = null;
                icon = new GSkillIcon(this.m_Skill)
                {
                    m_IsDragging = true,
                    m_OffsetX    = icon.Width / 2,
                    m_OffsetY    = icon.Height / 2,
                    X            = Engine.m_xMouse - icon.m_OffsetX,
                    Y            = Engine.m_yMouse - icon.m_OffsetY
                };
                Gumps.Desktop.Children.Add(icon);
                Gumps.Drag = icon;
            }
Esempio n. 2
0
 protected internal override void OnDragStart()
 {
     GSkillIcon icon;
     base.m_IsDragging = false;
     Gumps.Drag = null;
     icon = new GSkillIcon(this.m_Skill) {
         m_IsDragging = true,
         m_OffsetX = icon.Width / 2,
         m_OffsetY = icon.Height / 2,
         X = Engine.m_xMouse - icon.m_OffsetX,
         Y = Engine.m_yMouse - icon.m_OffsetY
     };
     Gumps.Desktop.Children.Add(icon);
     Gumps.Drag = icon;
 }
Esempio n. 3
0
        private static void LoginComplete(PacketReader pvSrc)
        {
            Music.Stop();
            Engine.Unlock();
            Engine.m_Loading = false;
            Engine.m_Ingame = true;
            Cursor.Hourglass = false;
            Gumps.Desktop.Children.Clear();
            int gameWidth = Engine.GameWidth;
            int gameHeight = Engine.GameHeight;
            int num3 = gameWidth / 0x30;
            int num4 = gameHeight / 0x30;
            int num5 = (num3 * 0x30) - 4;
            int num6 = (num4 * 0x30) - 4;
            int num7 = (gameWidth - num5) / 2;
            int num8 = (gameHeight - num6) / 2;
            for (int i = 0; i < num3; i++)
            {
                Gumps.Desktop.Children.Add(new GSpellPlaceholder(num7 + (i * 0x30), -54));
                Gumps.Desktop.Children.Add(new GSpellPlaceholder(num7 + (i * 0x30), (gameHeight + 6) + 4));
            }
            for (int j = 0; j < num4; j++)
            {
                Gumps.Desktop.Children.Add(new GSpellPlaceholder(-54, num8 + (j * 0x30)));
                Gumps.Desktop.Children.Add(new GSpellPlaceholder((gameWidth + 6) + 4, num8 + (j * 0x30)));
            }
            Gumps.Desktop.Children.Add(new GSpellPlaceholder(-54, -54));
            Gumps.Desktop.Children.Add(new GSpellPlaceholder((gameWidth + 6) + 4, -54));
            Gumps.Desktop.Children.Add(new GSpellPlaceholder(-54, (gameHeight + 6) + 4));
            Gumps.Desktop.Children.Add(new GSpellPlaceholder((gameWidth + 6) + 4, (gameHeight + 6) + 4));
            Gumps.Desktop.Children.Add(new GDesktopBorder());
            Gumps.Desktop.Children.Add(new GBandageTimer());
            Gumps.Desktop.Children.Add(new GMapTracker());
            Gumps.Desktop.Children.Add(new GQuestArrow());
            Gumps.Desktop.Children.Add(new GPingDisplay());
            Gumps.Desktop.Children.Add(new GParticleCounter());
            Gumps.Desktop.Children.Add(new GTransparencyGump());
            Reagent[] reagents = Spells.Reagents;
            int length = reagents.Length;
            if ((Engine.ServerFeatures != null) && !Engine.Features.AOS)
            {
                length = 8;
            }
            PotionType[] typeArray = new PotionType[] { PotionType.Yellow, PotionType.Orange, PotionType.Red, PotionType.Purple };
            ItemIDValidator[] list = new ItemIDValidator[(length + 1) + typeArray.Length];
            for (int k = 0; k < length; k++)
            {
                list[k] = new ItemIDValidator(new int[] { reagents[k].ItemID });
            }
            for (int m = 0; m < typeArray.Length; m++)
            {
                list[length + m] = new ItemIDValidator(new int[] { 0xf06 + typeArray[m] });
            }
            list[length + typeArray.Length] = new ItemIDValidator(new int[] { 0xe21, 0xee9 });
            Gumps.Desktop.Children.Add(new GItemCounters(list));
            CharData charData = World.CharData;
            Mobile player = World.Player;
            if ((player != null) && (player.Name.Length > 0))
            {
                charData.Name = player.Name;
            }
            if ((Engine.m_ServerName != null) && (Engine.m_ServerName.Length > 0))
            {
                charData.Shard = Engine.m_ServerName;
            }
            foreach (GumpLayout layout in charData.Layout)
            {
                switch (layout.Type)
                {
                    case 0:
                    {
                        GSpellIcon toAdd = new GSpellIcon(layout.Extra - 1) {
                            X = layout.X,
                            Y = layout.Y
                        };
                        Gumps.Desktop.Children.Add(toAdd);
                        break;
                    }
                    case 1:
                        if (!Engine.m_SkillsOpen)
                        {
                            Network.Send(new PQuerySkills());
                            Engine.m_SkillsOpen = true;
                            Engine.m_SkillsGump = new GSkills();
                            Engine.m_SkillsGump.X = layout.X;
                            Engine.m_SkillsGump.Y = layout.Y;
                            Engine.m_SkillsGump.Width = layout.Width;
                            Engine.m_SkillsGump.Height = layout.Height;
                            Gumps.Desktop.Children.Add(Engine.m_SkillsGump);
                        }
                        break;

                    case 2:
                    {
                        Mobile mobile2 = World.FindMobile(layout.Extra);
                        if (mobile2 != null)
                        {
                            Network.Send(new POpenPaperdoll(mobile2.Serial));
                            mobile2.PaperdollX = layout.X;
                            mobile2.PaperdollY = layout.Y;
                        }
                        break;
                    }
                    case 3:
                    {
                        Skill skill = Engine.Skills[layout.Extra];
                        if (skill != null)
                        {
                            GSkillIcon icon2 = new GSkillIcon(skill) {
                                X = layout.X,
                                Y = layout.Y
                            };
                            Gumps.Desktop.Children.Add(icon2);
                        }
                        break;
                    }
                }
            }
            charData.Save();
            Engine.DrawNow();
            Engine.StartPings();
            Network.Send(new POpenPaperdoll());
            World.Player.QueryStats();
        }