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); } }
private void buttonLogin_Click(object sender, EventArgs e) { TalePlayer.Save(); TalePlayer.Oneloop(); //保证存档可以成功 Thread.Sleep(300); TalePlayer.Close(); MainForm.Instance.ChangePage(0); Close(); }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (viewStack1.SelectedIndex == 1) { UserProfile.Profile.OnLogout(); TalePlayer.Save(); TalePlayer.Oneloop(); //保证存档可以成功 Thread.Sleep(300); } }