示例#1
0
        public void ResendGump(Mobile from, TimeSpan delay)
        {
            if (!Viewing.Contains(from))
            {
                Viewing.Add(from);
            }

            foreach (var pm in Viewing.OfType <PlayerMobile>())
            {
                var gump = BaseGump.GetGump <ShipCannonGump>(pm, g => g.Cannon == this);

                if (gump != null)
                {
                    if (delay != TimeSpan.Zero)
                    {
                        Timer.DelayCall(delay, () => gump.Refresh());
                    }
                    else
                    {
                        gump.Refresh();
                    }
                }
                else
                {
                    if (delay != TimeSpan.Zero)
                    {
                        Timer.DelayCall(delay, () => BaseGump.SendGump(new ShipCannonGump(pm, this)));
                    }
                    else
                    {
                        BaseGump.SendGump(new ShipCannonGump(pm, this));
                    }
                }
            }
        }
示例#2
0
        private void RefreshGumps(PlayerMobile pm)
        {
            if (pm == null)
            {
                return;
            }

            foreach (var m in NetState.Instances.Where(ns => ns.Mobile != null).Select(ns => ns.Mobile))
            {
                var gump = BaseGump.GetGump <AchievementGump>(m as PlayerMobile, null);

                if (gump != null && gump.Subject == pm)
                {
                    gump.Refresh();
                }
            }
        }
示例#3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.Player || from.AccessLevel < AccessLevel.Spawner)
            {
                return;
            }

            SpawnerGump gump = BaseGump.GetGump <SpawnerGump>((PlayerMobile)from, g => g.Spawner == this);

            if (gump != null)
            {
                gump.Refresh();
            }
            else
            {
                BaseGump.SendGump(new SpawnerGump(from, this));
            }
        }
示例#4
0
        private void SendTag(PlayerMobile pm)
        {
            var profile = AchievementSystem.GetProfile(pm);

            if (profile == null || !profile.ShowGumpTag || pm.NetState == null)
            {
                return;
            }

            var tag = BaseGump.GetGump <AchievementTagGump>(pm, g => g.Achievement == this);

            if (tag != null)
            {
                tag.Refresh();
            }
            else
            {
                BaseGump.SendGump(new AchievementTagGump(pm, this));
            }
        }
示例#5
0
        public override void Delete()
        {
            if (Galleon != null)
            {
                Galleon.RemoveCannon(this);
            }

            var list = new List <PlayerMobile>(Viewing.OfType <PlayerMobile>());

            foreach (var pm in list)
            {
                var gump = BaseGump.GetGump <ShipCannonGump>(pm, g => g.Cannon == this);

                if (gump != null)
                {
                    gump.Close();
                }
            }

            ColUtility.Free(list);
            base.Delete();
        }