You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

MainWindow.xaml.cs 5.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. using System.Diagnostics;
  16. // 留意初始化
  17. // 目前MainWindow还未复现的功能:
  18. // 左侧信息private void SetStatusBar(),
  19. // private void ReactToCommandline(),
  20. // private void Playback(string fileName, double pbSpeed = 2.0)
  21. // 绘图函数private void DrawLaser(Point source, double theta, double range,double Width)//三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  22. // private void DrawProp(MessageToClient.Types.GameObjMessage data, string text),
  23. // private void Attack(object sender,RoutedEventArgs e)
  24. // 地图相关private void ZoomMap(),private void DrawMap()
  25. // 交互:private void ClickToSetMode(object sender, RoutedEventArgs e)
  26. // 最近要解决private void ConnectToServer(string[] comInfo)
  27. // private void KeyBoardControl(object sender, KeyEventArgs e)
  28. // private void GetMap(MessageToClient.Types.GameObjMessage obj)
  29. // private void OnReceive()
  30. // private bool CanSee(MessageOfCharacter msg) (以及两个重载函数)
  31. // private void Refresh(object? sender, EventArgs e)
  32. // private void Bonus()
  33. namespace Client
  34. {
  35. /// <summary>
  36. /// Interaction logic for MainWindow.xaml
  37. /// </summary>
  38. public partial class MainWindow : Window
  39. {
  40. public MainWindow()
  41. {
  42. InitializeComponent();
  43. isClientStocked = true;
  44. isPlaybackMode = false;
  45. WindowStartupLocation = WindowStartupLocation.CenterScreen;
  46. }
  47. // 之后需要修改,现在只具有修改按钮形状的功能,并不能实现暂停/继续
  48. private void ClickToPauseOrContinue(object sender, RoutedEventArgs e)
  49. {
  50. if (!isClientStocked)
  51. {
  52. isClientStocked = true;
  53. PorC.Content = "▶";
  54. }
  55. else
  56. {
  57. isClientStocked = false;
  58. PorC.Content = "⏸";
  59. }
  60. }
  61. // 未复现
  62. private void ClickToConnect(object sender, RoutedEventArgs e)
  63. {
  64. }
  65. // 窗口最大化、关闭、最小化、拖拽
  66. private void ClickToMaxmize(object sender, RoutedEventArgs e)
  67. {
  68. if (WindowState != WindowState.Maximized)
  69. WindowState = WindowState.Maximized;
  70. else
  71. WindowState = WindowState.Normal;
  72. }
  73. private void ClickToClose(object sender, RoutedEventArgs e)
  74. {
  75. Application.Current.Shutdown();
  76. }
  77. private void ClickToMinimize(object sender, RoutedEventArgs e)
  78. {
  79. WindowState = WindowState.Minimized;
  80. }
  81. private void DragWindow(object sender, RoutedEventArgs e)
  82. {
  83. DragMove();
  84. }
  85. // 寻求帮助、访问EESAST(部分功能未复原)
  86. private void ClickForHelp(object sender, RoutedEventArgs e)
  87. {
  88. PleaseWait();
  89. }
  90. private void ClickToVisitEESAST(object sender, RoutedEventArgs e)
  91. {
  92. try
  93. {
  94. _ = Process.Start("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", "https://eesast.com");
  95. }
  96. catch (Exception exc)
  97. {
  98. // ErrorDisplayer error = new("发生错误。以下是系统报告\n" + exc.ToString());
  99. // error.Show();
  100. }
  101. }
  102. // 配置连接(未复原)、我的AI(THUAI5未实现)、获取更新、天梯信息(可能需要网站协助)
  103. private void ClickToSetConnect(object sender, RoutedEventArgs e)
  104. {
  105. // ConnectRegister crg = new();
  106. // crg.Show();
  107. }
  108. private void ClickToEnterVS(object sender, RoutedEventArgs e)
  109. {
  110. // try
  111. //{
  112. // if (!File.Exists("VSRoute.txt"))
  113. // {
  114. // File.Create("VSRoute.txt");
  115. // Exception ex = new("没有路径存储文件,已为您创建。请将VS路径输入该文件,并重新操作。");
  116. // throw ex;
  117. // }//创建路径文件
  118. // using StreamReader sr = new("VSRoute.txt");
  119. // _ = Process.Start(sr.ReadLine());
  120. // }
  121. // catch (Exception exc)
  122. //{
  123. // ErrorDisplayer error = new("发生错误。以下是系统报告:\n" + exc.ToString());
  124. // error.Show();
  125. // }
  126. PleaseWait();
  127. }
  128. private void ClickForUpdate(object sender, RoutedEventArgs e)
  129. {
  130. PleaseWait();
  131. }
  132. private void ClickToCheckLadder(object sender, RoutedEventArgs e)
  133. {
  134. PleaseWait();
  135. }
  136. // 敬请期待函数
  137. private void PleaseWait()
  138. {
  139. try
  140. {
  141. throw new Exception("敬请期待");
  142. }
  143. catch (Exception exc)
  144. {
  145. // ErrorDisplayer error = new(exc.Message);
  146. // error.Show();
  147. }
  148. }
  149. private bool isClientStocked;
  150. private bool isPlaybackMode;
  151. }
  152. }