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.

StatusBarOfCircumstance.xaml.cs 2.7 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.Shapes;
  14. using Protobuf;
  15. namespace Client
  16. {
  17. /// <summary>
  18. /// StatusBarOfCircumstance.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class StatusBarOfCircumstance : UserControl
  21. {
  22. public StatusBarOfCircumstance(Grid parent, int Row, int Column)
  23. {
  24. InitializeComponent();
  25. parent.Children.Add(this);
  26. Grid.SetColumn(this, Column);
  27. Grid.SetColumnSpan(this, 2);
  28. Grid.SetRow(this, Row);
  29. Grid.SetRowSpan(this, 2);
  30. }
  31. public void SetFontSize(double fontsize)
  32. {
  33. status.FontSize = 13 * fontsize / 12;
  34. time.FontSize = 13 * fontsize / 12;
  35. scoresOfStudents.FontSize = scoresOfTrickers.FontSize = fontsize;
  36. }
  37. public void SetValue(MessageOfAll obj, bool gateOpened, bool hiddenGateRefreshed, bool hiddenGateOpened)
  38. {
  39. time.Text = "Time⏳: " + Convert.ToString(obj.GameTime);
  40. status.Text = "📱: " + Convert.ToString(obj.SubjectFinished) + "\n🚪: ";
  41. if (gateOpened)
  42. {
  43. status.Text += "Open\n🆘: ";
  44. }
  45. else
  46. {
  47. status.Text += "Close\n🆘: ";
  48. }
  49. //if (obj.SubjectFinished >= Preparation.Utility.GameData.numOfGeneratorRequiredForEmergencyExit)
  50. //{
  51. // hiddenGateRefreshed = true;
  52. //}
  53. //if (Preparation.Utility.GameData.numOfStudent == 1 + obj.StudentQuited + obj.StudentGraduated)
  54. //{
  55. // hiddenGateOpened = true;
  56. //}
  57. if (hiddenGateRefreshed)
  58. {
  59. if (hiddenGateOpened)
  60. {
  61. status.Text += "Open\n🏃: ";
  62. }
  63. else
  64. {
  65. status.Text += "Refreshed\n🏃: ";
  66. }
  67. }
  68. else
  69. {
  70. status.Text += "Unrefreshed\n🏃: ";
  71. }
  72. status.Text += Convert.ToString(obj.StudentGraduated) + "\n⚰️: ";
  73. status.Text += Convert.ToString(obj.StudentQuited);
  74. scoresOfStudents.Text = "Scores of Students: " + Convert.ToString(obj.StudentScore);
  75. scoresOfTrickers.Text = "Scores of Tricker: " + Convert.ToString(obj.TrickerScore);
  76. }
  77. }
  78. }