示例#1
0
        private void TimeGo()
        {
            while (true)
            {
                TalePlayer.Oneloop();

                timeTick++;
                if (timeTick > 1000)
                {
                    timeTick -= 1000;
                }
                if (page == 0)
                {
                    var logWid    = tabPageLogin.Width / 4;
                    var logHeight = tabPageLogin.Height / 5;
                    var logX      = (tabPageLogin.Width - logWid) / 2;
                    var logY      = (tabPageLogin.Height - logHeight) / 2 + Math.Sin((double)timeTick / 12) * 6;
                    tabPageLogin.Invalidate(new Rectangle(logX, (int)logY - 6, logWid, logHeight + 12)); //logo区域
                }
                else if (page == 1)
                {
                    try
                    {
                        foreach (var control in tabPageGame.Controls)
                        {
                            if (control is BasePanel)
                            {
                                (control as BasePanel).OnFrame(timeTick, 0.05f);
                            }
                        }

                        if (SystemMenuManager.IsHotkeyEnabled && (timeTick % 5) == 0)
                        {
                            SystemMenuManager.UpdateAll(tabPageGame);

                            if (MainTipManager.OnFrame())
                            {
                                tabPageGame.Invalidate();
                            }
                        }

                        if (SystemMenuManager.GMMode)
                        {
                            GMCodeZone.OnFrame();
                        }

                        if (flowController != null)
                        {
                            flowController.CheckTick();
                        }
                    }
                    catch (Exception e)
                    {
                        NLog.Error(e);
                        throw;
                    }
                }
                Thread.Sleep(50);
            }
        }
示例#2
0
        private void TimeGo()
        {
            while (true)
            {
                if (page == 1)
                {
                    try
                    {
                        timeTick++;
                        if (timeTick > 1000)
                        {
                            timeTick -= 1000;
                        }
                        foreach (var control in tabPageGame.Controls)
                        {
                            if (control is BasePanel)
                            {
                                (control as BasePanel).OnFrame(timeTick, 0.05f);
                            }
                        }

                        if (SystemMenuManager.IsHotkeyEnabled && (timeTick % 5) == 0)
                        {
                            SystemMenuManager.UpdateAll(tabPageGame);

                            if (MainTipManager.OnFrame())
                            {
                                tabPageGame.Invalidate();
                            }
                        }

                        Scene.Instance.TimeGo(0.05f);
                    }
                    catch (Exception e)
                    {
                        NLog.Fatal(e);
                        throw;
                    }
                }
                Thread.Sleep(50);
            }
        }