コード例 #1
0
        public void DisplayItemGridEffect(ulong id, int type = 0)
        {
            MirItemCell cell = GetCell(id);

            if (cell.Item == null)
            {
                return;
            }

            MirAnimatedControl animEffect = null;

            switch (type)
            {
            case 0:
                animEffect = new MirAnimatedControl
                {
                    Animated       = true,
                    AnimationCount = 9,
                    AnimationDelay = 150,
                    Index          = 410,
                    Library        = Libraries.Prguse,
                    Location       = cell.Location,
                    Parent         = this,
                    Loop           = false,
                    NotControl     = true,
                    UseOffSet      = true,
                    Blending       = true,
                    BlendingRate   = 1F
                };
                animEffect.AfterAnimation += (o, e) => animEffect.Dispose();
                SoundManager.PlaySound(20000 + (ushort)Spell.MagicShield * 10);
                break;
            }
        }
コード例 #2
0
ファイル: SelectScene.cs プロジェクト: NightBakery/mir2
        public void StartGame()
        {
            if (!Libraries.Loaded)
            {
                MirAnimatedControl loadProgress = new MirAnimatedControl
                {
                    Library        = Libraries.Prguse,
                    Index          = 940,
                    Visible        = true,
                    Parent         = this,
                    Location       = new Point(470, 680),
                    Animated       = true,
                    AnimationCount = 9,
                    AnimationDelay = 100,
                    Loop           = true,
                };
                loadProgress.AfterDraw += (o, e) =>
                {
                    if (!Libraries.Loaded)
                    {
                        return;
                    }
                    loadProgress.Dispose();
                    StartGame();
                };
                return;
            }
            StartGameButton.Enabled = false;

            Network.Enqueue(new C.StartGame
            {
                CharacterIndex = Characters[_selected].Index
            });
        }
コード例 #3
0
ファイル: MagicButton.cs プロジェクト: wang35777/kkkgame
        public void SetDelay()
        {
            if (Magic == null)
            {
                return;
            }

            int totalFrames = 34;

            long timeLeft = Magic.CastTime + Magic.Delay - CMain.Time;

            if (timeLeft < 100 || (CoolDown != null && CoolDown.Animated))
            {
                return;
            }

            int delayPerFrame = (int)(Magic.Delay / totalFrames);
            int startFrame    = totalFrames - (int)(timeLeft / delayPerFrame);

            if ((CMain.Time <= Magic.CastTime + Magic.Delay) && Magic.CastTime > 0)
            {
                CoolDown.Dispose();

                CoolDown = new MirAnimatedControl
                {
                    Index          = 1290 + startFrame,
                    AnimationCount = (totalFrames - startFrame),
                    AnimationDelay = delayPerFrame,
                    Library        = Libraries.Prguse2,
                    Parent         = this,
                    Location       = new Point(36, 0),
                    NotControl     = true,
                    UseOffSet      = true,
                    Loop           = false,
                    Animated       = true,
                    Opacity        = 0.6F
                };
            }
        }
コード例 #4
0
        //public void StartGame()
        //{
        //    if (!Libraries.Loaded)
        //    {
        //        MirMessageBox message = new MirMessageBox(string.Format("Please wait, The game is still loading... {0:##0}%", Libraries.Progress / (double)Libraries.Count * 100), MirMessageBoxButtons.Cancel);

        //        message.BeforeDraw += (o, e) => message.Label.Text = string.Format("Please wait, The game is still loading... {0:##0}%", Libraries.Progress / (double)Libraries.Count * 100);

        //        message.AfterDraw += (o, e) =>
        //        {
        //            if (!Libraries.Loaded) return;
        //            message.Dispose();
        //            StartGame();
        //        };

        //        message.Show();

        //        return;
        //    }
        //    StartGameButton.Enabled = false;

        //    Network.Enqueue(new C.StartGame
        //    {
        //        CharacterIndex = Characters[_selected].Index
        //    });
        //}

        public void StartGame()
        {
            if (StartGameButton.Enabled = true)
            {
                Random          random         = new Random();
                MirImageControl loadingOverlay = new MirImageControl
                {
                    Library = Libraries.Prguse,
                    Index   = 930 + random.Next(0, 10),
                    Visible = true,

                    Parent = this
                };
                MirAnimatedControl loadProgress = new MirAnimatedControl
                {
                    Library  = Libraries.Prguse,
                    Index    = 940,
                    Visible  = true,
                    Parent   = loadingOverlay,
                    Location = new Point(400, 300),
                    Animated = true,

                    AnimationCount = 9,
                    AnimationDelay = 10000,
                    Loop           = true,
                };
            }



            if (!Libraries.Loaded)
            {
                Random          random         = new Random();
                MirImageControl loadingOverlay = new MirImageControl
                {
                    Library = Libraries.Prguse,
                    Index   = 930 + random.Next(0, 10),
                    Visible = true,
                    Parent  = this
                };



                MirAnimatedControl loadProgress = new MirAnimatedControl
                {
                    Library        = Libraries.Prguse,
                    Index          = 940,
                    Visible        = true,
                    Parent         = loadingOverlay,
                    Location       = new Point(400, 300),
                    Animated       = true,
                    AnimationCount = 9,
                    AnimationDelay = 100,
                    Loop           = true,
                };
                loadProgress.AfterDraw += (o, e) =>
                {
                    if (!Libraries.Loaded)
                    {
                        return;
                    }
                    loadProgress.Dispose();
                    StartGame();
                };
                return;
            }
            StartGameButton.Enabled = false;

            Network.Enqueue(new C.StartGame
            {
                CharacterIndex = Characters[_selected].Index
            });
        }