AmiiboWindow.Designer.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. using Gtk;
  2. namespace Ryujinx.Ui.Windows
  3. {
  4. public partial class AmiiboWindow : Window
  5. {
  6. private Box _mainBox;
  7. private ButtonBox _buttonBox;
  8. private Button _scanButton;
  9. private Button _cancelButton;
  10. private CheckButton _randomUuidCheckBox;
  11. private Box _amiiboBox;
  12. private Box _amiiboHeadBox;
  13. private Box _amiiboSeriesBox;
  14. private Label _amiiboSeriesLabel;
  15. private ComboBoxText _amiiboSeriesComboBox;
  16. private Box _amiiboCharsBox;
  17. private Label _amiiboCharsLabel;
  18. private ComboBoxText _amiiboCharsComboBox;
  19. private CheckButton _showAllCheckBox;
  20. private Image _amiiboImage;
  21. private Label _gameUsageLabel;
  22. private void InitializeComponent()
  23. {
  24. #pragma warning disable CS0612
  25. //
  26. // AmiiboWindow
  27. //
  28. CanFocus = false;
  29. Resizable = false;
  30. Modal = true;
  31. WindowPosition = WindowPosition.Center;
  32. DefaultWidth = 600;
  33. DefaultHeight = 470;
  34. TypeHint = Gdk.WindowTypeHint.Dialog;
  35. //
  36. // _mainBox
  37. //
  38. _mainBox = new Box(Orientation.Vertical, 2);
  39. //
  40. // _buttonBox
  41. //
  42. _buttonBox = new ButtonBox(Orientation.Horizontal)
  43. {
  44. Margin = 20,
  45. LayoutStyle = ButtonBoxStyle.End
  46. };
  47. //
  48. // _scanButton
  49. //
  50. _scanButton = new Button()
  51. {
  52. Label = "Scan It!",
  53. CanFocus = true,
  54. ReceivesDefault = true,
  55. MarginLeft = 10
  56. };
  57. _scanButton.Clicked += ScanButton_Pressed;
  58. //
  59. // _randomUuidCheckBox
  60. //
  61. _randomUuidCheckBox = new CheckButton()
  62. {
  63. Label = "Hack: Use Random Tag Uuid",
  64. TooltipText = "This allows multiple scans of a single Amiibo.\n(used in The Legend of Zelda: Breath of the Wild)"
  65. };
  66. //
  67. // _cancelButton
  68. //
  69. _cancelButton = new Button()
  70. {
  71. Label = "Cancel",
  72. CanFocus = true,
  73. ReceivesDefault = true,
  74. MarginLeft = 10
  75. };
  76. _cancelButton.Clicked += CancelButton_Pressed;
  77. //
  78. // _amiiboBox
  79. //
  80. _amiiboBox = new Box(Orientation.Vertical, 0);
  81. //
  82. // _amiiboHeadBox
  83. //
  84. _amiiboHeadBox = new Box(Orientation.Horizontal, 0)
  85. {
  86. Margin = 20,
  87. Hexpand = true
  88. };
  89. //
  90. // _amiiboSeriesBox
  91. //
  92. _amiiboSeriesBox = new Box(Orientation.Horizontal, 0)
  93. {
  94. Hexpand = true
  95. };
  96. //
  97. // _amiiboSeriesLabel
  98. //
  99. _amiiboSeriesLabel = new Label("Amiibo Series:");
  100. //
  101. // _amiiboSeriesComboBox
  102. //
  103. _amiiboSeriesComboBox = new ComboBoxText();
  104. //
  105. // _amiiboCharsBox
  106. //
  107. _amiiboCharsBox = new Box(Orientation.Horizontal, 0)
  108. {
  109. Hexpand = true
  110. };
  111. //
  112. // _amiiboCharsLabel
  113. //
  114. _amiiboCharsLabel = new Label("Character:");
  115. //
  116. // _amiiboCharsComboBox
  117. //
  118. _amiiboCharsComboBox = new ComboBoxText();
  119. //
  120. // _showAllCheckBox
  121. //
  122. _showAllCheckBox = new CheckButton()
  123. {
  124. Label = "Show All Amiibo"
  125. };
  126. //
  127. // _amiiboImage
  128. //
  129. _amiiboImage = new Image()
  130. {
  131. HeightRequest = 350,
  132. WidthRequest = 350
  133. };
  134. //
  135. // _gameUsageLabel
  136. //
  137. _gameUsageLabel = new Label("")
  138. {
  139. MarginTop = 20
  140. };
  141. #pragma warning restore CS0612
  142. ShowComponent();
  143. }
  144. private void ShowComponent()
  145. {
  146. _buttonBox.Add(_showAllCheckBox);
  147. _buttonBox.Add(_randomUuidCheckBox);
  148. _buttonBox.Add(_scanButton);
  149. _buttonBox.Add(_cancelButton);
  150. _amiiboSeriesBox.Add(_amiiboSeriesLabel);
  151. _amiiboSeriesBox.Add(_amiiboSeriesComboBox);
  152. _amiiboCharsBox.Add(_amiiboCharsLabel);
  153. _amiiboCharsBox.Add(_amiiboCharsComboBox);
  154. _amiiboHeadBox.Add(_amiiboSeriesBox);
  155. _amiiboHeadBox.Add(_amiiboCharsBox);
  156. _amiiboBox.PackStart(_amiiboHeadBox, true, true, 0);
  157. _amiiboBox.PackEnd(_gameUsageLabel, false, false, 0);
  158. _amiiboBox.PackEnd(_amiiboImage, false, false, 0);
  159. _mainBox.Add(_amiiboBox);
  160. _mainBox.PackEnd(_buttonBox, false, false, 0);
  161. Add(_mainBox);
  162. ShowAll();
  163. }
  164. }
  165. }