예제 #1
0
 public void OnSwitchScene(bool isWarp)
 {
     if (isWarp)
     {
         TalePlayer.Save();//每次切场景存个档
     }
 }
예제 #2
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);
            }
        }
예제 #3
0
 private void buttonLogin_Click(object sender, EventArgs e)
 {
     TalePlayer.Save();
     TalePlayer.Oneloop(); //保证存档可以成功
     Thread.Sleep(300);
     TalePlayer.Close();
     MainForm.Instance.ChangePage(0);
     Close();
 }
예제 #4
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (viewStack1.SelectedIndex == 1)
     {
         UserProfile.Profile.OnLogout();
         TalePlayer.Save();
         TalePlayer.Oneloop(); //保证存档可以成功
         Thread.Sleep(300);
     }
 }
예제 #5
0
 public void ChangePage(int pg)
 {
     if (pg == 0)
     {
         SoundManager.PlayBGMScene("SCN000.mp3");
         page = pg;
         viewStack1.SelectedIndex = page;
     }
     else if (pg == 1)
     {
         UserProfile.ProfileName = passport;
         TalePlayer.Connect();
     }
 }
 public void FireFadeOut(int rid)
 {
     TalePlayer.Start(FadeOut(rid));
 }
 public void FireShake(int rid)
 {
     TalePlayer.Start(Shake(rid));
 }