aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx/UI/Windows/AmiiboWindow.Designer.cs
blob: 3bf73318ff7c22eede33778039f3c1b606a0ca68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
using Gtk;

namespace Ryujinx.UI.Windows
{
    public partial class AmiiboWindow : Window
    {
        private Box _mainBox;
        private ButtonBox _buttonBox;
        private Button _scanButton;
        private Button _cancelButton;
        private CheckButton _randomUuidCheckBox;
        private Box _amiiboBox;
        private Box _amiiboHeadBox;
        private Box _amiiboSeriesBox;
        private Label _amiiboSeriesLabel;
        private ComboBoxText _amiiboSeriesComboBox;
        private Box _amiiboCharsBox;
        private Label _amiiboCharsLabel;
        private ComboBoxText _amiiboCharsComboBox;
        private CheckButton _showAllCheckBox;
        private Image _amiiboImage;
        private Label _gameUsageLabel;

        private void InitializeComponent()
        {
            //
            // AmiiboWindow
            //
            CanFocus = false;
            Resizable = false;
            Modal = true;
            WindowPosition = WindowPosition.Center;
            DefaultWidth = 600;
            DefaultHeight = 470;
            TypeHint = Gdk.WindowTypeHint.Dialog;

            //
            // _mainBox
            //
            _mainBox = new Box(Orientation.Vertical, 2);

            //
            // _buttonBox
            //
            _buttonBox = new ButtonBox(Orientation.Horizontal)
            {
                Margin = 20,
                LayoutStyle = ButtonBoxStyle.End,
            };

            //
            // _scanButton
            //
            _scanButton = new Button()
            {
                Label = "Scan It!",
                CanFocus = true,
                ReceivesDefault = true,
                MarginStart = 10,
            };
            _scanButton.Clicked += ScanButton_Pressed;

            //
            // _randomUuidCheckBox
            //
            _randomUuidCheckBox = new CheckButton()
            {
                Label = "Hack: Use Random Tag Uuid",
                TooltipText = "This allows multiple scans of a single Amiibo.\n(used in The Legend of Zelda: Breath of the Wild)",
            };

            //
            // _cancelButton
            //
            _cancelButton = new Button()
            {
                Label = "Cancel",
                CanFocus = true,
                ReceivesDefault = true,
                MarginStart = 10,
            };
            _cancelButton.Clicked += CancelButton_Pressed;

            //
            // _amiiboBox
            //
            _amiiboBox = new Box(Orientation.Vertical, 0);

            //
            // _amiiboHeadBox
            //
            _amiiboHeadBox = new Box(Orientation.Horizontal, 0)
            {
                Margin = 20,
                Hexpand = true,
            };

            //
            // _amiiboSeriesBox
            //
            _amiiboSeriesBox = new Box(Orientation.Horizontal, 0)
            {
                Hexpand = true,
            };

            //
            // _amiiboSeriesLabel
            //
            _amiiboSeriesLabel = new Label("Amiibo Series:");

            //
            // _amiiboSeriesComboBox
            //
            _amiiboSeriesComboBox = new ComboBoxText();

            //
            // _amiiboCharsBox
            //
            _amiiboCharsBox = new Box(Orientation.Horizontal, 0)
            {
                Hexpand = true,
            };

            //
            // _amiiboCharsLabel
            //
            _amiiboCharsLabel = new Label("Character:");

            //
            // _amiiboCharsComboBox
            //
            _amiiboCharsComboBox = new ComboBoxText();

            //
            // _showAllCheckBox
            //
            _showAllCheckBox = new CheckButton()
            {
                Label = "Show All Amiibo",
            };

            //
            // _amiiboImage
            //
            _amiiboImage = new Image()
            {
                HeightRequest = 350,
                WidthRequest = 350,
            };

            //
            // _gameUsageLabel
            //
            _gameUsageLabel = new Label("")
            {
                MarginTop = 20,
            };

            ShowComponent();
        }

        private void ShowComponent()
        {
            _buttonBox.Add(_showAllCheckBox);
            _buttonBox.Add(_randomUuidCheckBox);
            _buttonBox.Add(_scanButton);
            _buttonBox.Add(_cancelButton);

            _amiiboSeriesBox.Add(_amiiboSeriesLabel);
            _amiiboSeriesBox.Add(_amiiboSeriesComboBox);

            _amiiboCharsBox.Add(_amiiboCharsLabel);
            _amiiboCharsBox.Add(_amiiboCharsComboBox);

            _amiiboHeadBox.Add(_amiiboSeriesBox);
            _amiiboHeadBox.Add(_amiiboCharsBox);

            _amiiboBox.PackStart(_amiiboHeadBox, true, true, 0);
            _amiiboBox.PackEnd(_gameUsageLabel, false, false, 0);
            _amiiboBox.PackEnd(_amiiboImage, false, false, 0);

            _mainBox.Add(_amiiboBox);
            _mainBox.PackEnd(_buttonBox, false, false, 0);

            Add(_mainBox);

            ShowAll();
        }
    }
}