forked from LingFeng-bbben/MajdataEdit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
293 lines (285 loc) · 21.2 KB
/
MainWindow.xaml
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:lex="http://wpflocalizeextension.codeplex.com"
lex:LocalizeDictionary.DesignCulture="zh-CN"
lex:ResxLocalizationProvider.DefaultAssembly="MajdataEdit"
lex:ResxLocalizationProvider.DefaultDictionary="Langs"
x:Name="TheWindow" x:Class="MajdataEdit.MainWindow"
mc:Ignorable="d"
Title="MajdataEdit" Height="589" Width="720.5" Loaded="Window_Loaded" Closing="Window_Closing" MinHeight="517"
WindowStartupLocation="CenterScreen">
<Grid Margin="0" DragEnter="Grid_DragEnter" AllowDrop="True" Drop="Grid_Drop">
<Grid.RowDefinitions>
<RowDefinition Height="0*"/>
<RowDefinition Height="501*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF526675" />
<GradientStop Color="#FF735573" Offset="1" />
</LinearGradientBrush>
</Grid.Background>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="358*"/>
<ColumnDefinition Width="360*" />
</Grid.ColumnDefinitions>
<Label x:Name="ErrCount" Grid.Column="1" Content="0"
Foreground="White"
HorizontalAlignment="Left" HorizontalContentAlignment="Center"
Margin="44,201,0,0" Grid.RowSpan="2" VerticalAlignment="Top" Width="53" Height="25" PreviewMouseDoubleClick="SyntaxCheckButton_Click"/>
<Label x:Name="ErrCount_Label" Content="Error"
Foreground="White"
HorizontalAlignment="Left" HorizontalContentAlignment="Left"
Margin="2,201,0,0" Grid.RowSpan="2" VerticalAlignment="Top" Width="45" PreviewMouseDoubleClick="SyntaxCheckButton_Click" Grid.Column="1" RenderTransformOrigin="0.5,0.5">
<Label.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="0.647"/>
<TranslateTransform/>
</TransformGroup>
</Label.RenderTransform>
</Label>
<Image x:Name="MusicWave" Height="74" VerticalAlignment="Bottom" MouseWheel="MusicWave_MouseWheel"
PreviewMouseLeftButtonDown="MusicWave_PreviewMouseLeftButtonDown" MouseMove="MusicWave_MouseMove"
Grid.ColumnSpan="3" SizeChanged="MusicWave_SizeChanged" Grid.RowSpan="2" Grid.Row="1" />
<Line StrokeThickness="3" Y2="56" Height="74" VerticalAlignment="Bottom" Stroke="Red" Y1="15"
HorizontalAlignment="Left" Width="45" Grid.ColumnSpan="2" Margin="357,0,0,0" Grid.RowSpan="2" Grid.Row="1" Grid.Column="1" />
<Menu Height="19" VerticalAlignment="Top" Background="{DynamicResource ButtonsBackground}"
Foreground="{DynamicResource ButtonForeground}" Grid.ColumnSpan="3" Grid.RowSpan="2">
<MenuItem Header="{lex:Loc Files}" Foreground="{DynamicResource ButtonForeground}"
Template="{DynamicResource DarkMenuItem}">
<MenuItem x:Name="Menu_New" Header="{lex:Loc New}" Click="Menu_New_Click" />
<MenuItem x:Name="Menu_Open" Header="{lex:Loc Open}" Click="Menu_Open_Click" />
<MenuItem x:Name="Menu_Save" Header="{lex:Loc Save}" Click="Menu_Save_Click" />
<MenuItem x:Name="Menu_SaveAs" Header="{lex:Loc SaveAs}" Click="Menu_SaveAs_Click" IsEnabled="False"
Visibility="Collapsed" />
<Separator />
<MenuItem x:Name="Menu_AutosaveRecover" Header="{lex:Loc AutosaveRecoverWindowTitle}"
Click="Menu_AutosaveRecover_Click" />
<Separator />
<MenuItem x:Name="Menu_ExportRender" Header="{lex:Loc ExportVideo}" Click="Menu_ExportRender_Click"
IsEnabled="False" />
</MenuItem>
<MenuItem x:Name="MenuEdit" Header="{lex:Loc Edit}" IsEnabled="False"
Foreground="{DynamicResource ButtonForeground}" Template="{DynamicResource DarkMenuItem}">
<MenuItem Header="{lex:Loc MirrorLR}" Click="MirrorLeftRight_MenuItem_Click" />
<MenuItem Header="{lex:Loc MirrorUD}" Click="MirrorUpDown_MenuItem_Click" />
<MenuItem Header="{lex:Loc Mirror180}" Click="Mirror180_MenuItem_Click" />
<MenuItem Header="{lex:Loc Mirror45}" Click="Mirror45_MenuItem_Click" />
<MenuItem Header="{lex:Loc MirrorCcw45}" Click="MirrorCcw45_MenuItem_Click" />
<Separator />
<MenuItem Header="{lex:Loc MapInfo}" Click="MenuItem_InfomationEdit_Click" />
<Separator />
<MenuItem Header="{lex:Loc FindAndReplace}" Click="MenuFind_Click" />
</MenuItem>
<MenuItem Header="{lex:Loc Setting}" Foreground="{DynamicResource ButtonForeground}"
Template="{DynamicResource DarkMenuItem}">
<MenuItem x:Name="VolumnSetting" Header="{lex:Loc Volume}" Click="MenuItem_SoundSetting_Click"
IsEnabled="False" />
<Separator />
<MenuItem Header="{lex:Loc EditorSetting}" Click="MenuItem_EditorSetting_Click" />
<MenuItem Header="{lex:Loc RemapViewer}" Click="Menu_ResetViewWindow" />
</MenuItem>
<MenuItem Header="{lex:Loc Tools}" Foreground="{DynamicResource ButtonForeground}"
Template="{DynamicResource DarkMenuItem}">
<MenuItem Header="{lex:Loc BPMtap}" Click="BPMtap_MenuItem_Click" />
<MenuItem x:Name="MenuMuriCheck" Header="{lex:Loc MapMuriDetc}" Click="MuriCheck_Click_1"
IsEnabled="False" />
<MenuItem x:Name="SyntaxCheckButton" Header="{lex:Loc SyntaxDisplay}" Click="SyntaxCheckButton_Click"
IsEnabled="False" />
</MenuItem>
<MenuItem Header="Majnet" Click="MenuItem_Majnet_Click"
Foreground="{DynamicResource ButtonForeground}" Template="{DynamicResource DarkMenuItem}" />
<MenuItem Header="{lex:Loc Github}" Click="MenuItem_GitHub_Click"
Foreground="{DynamicResource ButtonForeground}" Template="{DynamicResource DarkMenuItem}" />
<MenuItem Header="{lex:Loc CheckUpdate}" Click="CheckUpdate_Click"
Foreground="{DynamicResource ButtonForeground}" Template="{DynamicResource DarkMenuItem}" />
</Menu>
<Image x:Name="FFTImage" HorizontalAlignment="Right" Margin="0,0,14,91" Width="254" Height="255"
VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5" Grid.Column="2" Grid.Row="1">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="-90" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<CheckBox x:Name="FollowPlayCheck" Content="{lex:Loc TextFollow}" HorizontalAlignment="Left" Height="21"
Margin="6,0,0,128" VerticalAlignment="Bottom" Width="87"
Foreground="{DynamicResource ButtonForeground}" HorizontalContentAlignment="Right"
Click="FollowPlayCheck_Click" Background="{DynamicResource ButtonsBackground}"
Template="{DynamicResource DarkCheck}" Grid.Row="1" Grid.Column="1" />
<RichTextBox x:Name="FumenContent"
Padding="0,5" FontFamily="Consolas"
Foreground="#FFE8E8E8" TextChanged="FumenContent_TextChanged"
Margin="102,29,10,90" HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
SelectionChanged="FumenContent_SelectionChanged" Grid.ColumnSpan="2"
InputMethod.IsInputMethodEnabled="False"
AutoWordSelection="False"
PreviewKeyDown="FumenContent_OnPreviewKeyDown" Grid.Row="1" Grid.Column="1">
<RichTextBox.Resources>
<RoutedUICommand x:Key="PlayAndPause" Text="PlayAndPause" />
<RoutedUICommand x:Key="SaveFile" Text="SaveFile" />
<RoutedUICommand x:Key="StopPlaying" Text="StopPlaying" />
<RoutedUICommand x:Key="SendToView" Text="SendToView" />
<RoutedUICommand x:Key="IncreasePlaybackSpeed" Text="IncreasePlaybackSpeed" />
<RoutedUICommand x:Key="DecreasePlaybackSpeed" Text="DecreasePlaybackSpeed" />
<RoutedUICommand x:Key="Find" Text="Find" />
<RoutedUICommand x:Key="MirrorLR" Text="MirrorLR" />
<RoutedUICommand x:Key="MirrorUD" Text="MirrorUD" />
<RoutedUICommand x:Key="Mirror180" Text="Mirror180" />
<RoutedUICommand x:Key="Mirror45" Text="Mirror45" />
<RoutedUICommand x:Key="MirrorCcw45" Text="MirrorCcw45" />
</RichTextBox.Resources>
<RichTextBox.Background>
<SolidColorBrush Color="#FF171717" Opacity="0.3" />
</RichTextBox.Background>
<!--Bindings are dynamicly added via ReadEditorSetting()-->
<RichTextBox.CommandBindings>
<CommandBinding Command="{StaticResource PlayAndPause}" CanExecute="PlayAndPause_CanExecute" />
<CommandBinding Command="{StaticResource SaveFile}" CanExecute="SaveFile_Command_CanExecute" />
<CommandBinding Command="{StaticResource StopPlaying}" CanExecute="StopPlaying_CanExecute" />
<CommandBinding Command="{StaticResource SendToView}" CanExecute="SendToView_CanExecute" />
<CommandBinding Command="{StaticResource IncreasePlaybackSpeed}"
CanExecute="IncreasePlaybackSpeed_CanExecute" />
<CommandBinding Command="{StaticResource DecreasePlaybackSpeed}"
CanExecute="DecreasePlaybackSpeed_CanExecute" />
<CommandBinding Command="{StaticResource Find}" CanExecute="FindCommand_CanExecute" />
<CommandBinding Command="{StaticResource MirrorLR}" CanExecute="MirrorLRCommand_CanExecute" />
<CommandBinding Command="{StaticResource MirrorUD}" CanExecute="MirrorUDCommand_CanExecute" />
<CommandBinding Command="{StaticResource Mirror180}" CanExecute="Mirror180Command_CanExecute" />
<CommandBinding Command="{StaticResource Mirror45}" CanExecute="Mirror45Command_CanExecute" />
<CommandBinding Command="{StaticResource MirrorCcw45}" CanExecute="MirrorCcw45Command_CanExecute" />
</RichTextBox.CommandBindings>
<FlowDocument />
</RichTextBox>
<Label x:Name="TimeLabel" Content="0:00" HorizontalAlignment="Left" Height="64" Margin="0,16,0,0"
VerticalAlignment="Top" Width="105" Foreground="White" FontFamily="Bahnschrift Light" FontSize="50"
VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Grid.Row="1" Grid.ColumnSpan="2" />
<ComboBox x:Name="LevelSelector" Margin="7,116,0,0" SelectionChanged="ComboBox_SelectionChanged"
HorizontalAlignment="Left" Width="87" Height="21" VerticalAlignment="Top"
Background="{DynamicResource ButtonsBackground}" Foreground="{DynamicResource ButtonForeground}"
Template="{DynamicResource DarkComboBox}" Grid.Row="1" Grid.Column="1">
<ComboBoxItem Content="EASY" />
<ComboBoxItem Content="BASIC" />
<ComboBoxItem Content="ADVANCED" />
<ComboBoxItem Content="EXPERT" />
<ComboBoxItem Content="MASTER" />
<ComboBoxItem Content="Re:MASTER" />
<ComboBoxItem Content="ORIGINAL" />
</ComboBox>
<Button x:Name="WaveViewZoomIn" Content="+" HorizontalAlignment="Left" Height="24" Margin="7,0,0,40"
VerticalAlignment="Bottom" Width="24" Click="WaveViewZoomIn_Click"
Background="{DynamicResource ButtonsBackground}" Foreground="{DynamicResource ButtonForeground}"
Template="{DynamicResource DarkButton}" Grid.Row="1" Grid.Column="1" />
<Button x:Name="WaveViewZoomOut" Content="-" HorizontalAlignment="Left" Height="24" Margin="7,0,0,9"
VerticalAlignment="Bottom" Width="24" Click="WaveViewZoomOut_Click"
Background="{DynamicResource ButtonsBackground}" Foreground="{DynamicResource ButtonForeground}"
Template="{DynamicResource DarkButton}" Grid.Row="1" Grid.Column="1" />
<Label Content="{lex:Loc Difficulty}" HorizontalAlignment="Left" Height="25" Margin="2,142,0,0"
VerticalAlignment="Top" Width="45" Foreground="White" Grid.Row="1" Grid.Column="1" />
<TextBox x:Name="LevelTextBox" HorizontalAlignment="Left" Height="25" Margin="47,142,0,0" TextWrapping="Wrap"
VerticalAlignment="Top" Width="46" VerticalContentAlignment="Center"
TextChanged="LevelTextBox_TextChanged" Background="{DynamicResource ButtonsBackground}"
Foreground="{DynamicResource ButtonForeground}" HorizontalContentAlignment="Center" Grid.Row="1" Grid.Column="1" />
<Label Content="{lex:Loc Offset}" HorizontalAlignment="Left" Height="25" Margin="2,172,0,0"
VerticalAlignment="Top" Width="45" Foreground="White" Grid.Row="1" Grid.Column="1" />
<TextBox x:Name="OffsetTextBox" HorizontalAlignment="Left" Height="25" Margin="47,172,0,0" TextWrapping="Wrap"
VerticalAlignment="Top" Width="46" VerticalContentAlignment="Center"
Background="{DynamicResource ButtonsBackground}" Foreground="{DynamicResource ButtonForeground}"
HorizontalContentAlignment="Center" TextChanged="OffsetTextBox_TextChanged"
MouseWheel="OffsetTextBox_MouseWheel" Grid.Row="1" Grid.Column="1" />
<Button x:Name="PlayAndPauseButton" Content="▶" HorizontalAlignment="Left" Margin="55,0,0,90" Width="38"
Click="PlayAndPauseButton_Click" Height="38" VerticalAlignment="Bottom"
Background="{DynamicResource ButtonsBackground}" Foreground="{DynamicResource ButtonForeground}"
Template="{DynamicResource DarkButton}" Grid.Row="1" Grid.Column="1" />
<Button x:Name="StopButton" Content="◼" HorizontalAlignment="Left" Height="38" Margin="6,0,0,90"
VerticalAlignment="Bottom" Width="38" Click="StopButton_Click"
Background="{DynamicResource ButtonsBackground}" Foreground="{DynamicResource ButtonForeground}"
Template="{DynamicResource DarkButton}" Grid.Row="1" Grid.Column="1" />
<Label x:Name="NoteNowText" Content="行" HorizontalAlignment="Left" Margin="0,73,0,0" VerticalAlignment="Top"
Foreground="White" Width="105" HorizontalContentAlignment="Center" Height="25" Grid.Row="1" Grid.ColumnSpan="2" />
<Button x:Name="Op_Button" Content="{lex:Loc RecMode}" Height="30" Margin="6,0,0,165"
VerticalAlignment="Bottom" RenderTransformOrigin="1.1,0.25" Click="Op_Button_Click"
HorizontalAlignment="Left" Width="87" Template="{DynamicResource DarkButton}"
Foreground="{DynamicResource ButtonForeground}" Background="{DynamicResource ButtonsBackground}"
ToolTip="{lex:Loc RecordModeDiscrp}" Grid.Row="1" Grid.Column="1" />
<Label Content="{lex:Loc TouchSpeed}" MouseUp="SettingLabel_MouseUp" HorizontalAlignment="Left" Height="24"
Margin="2,0,0,200" VerticalAlignment="Bottom" Width="80" Foreground="White"
RenderTransformOrigin="9.667,-2.284" ToolTip="{lex:Loc SpeedSettingTooltip}" Grid.Row="1" Grid.Column="1" />
<Label x:Name="ViewerTouchSpeed" MouseUp="SettingLabel_MouseUp" HorizontalAlignment="Left" Height="24"
Margin="62,0,0,200" Content="7.0" VerticalAlignment="Bottom" Width="35"
VerticalContentAlignment="Center" Foreground="{DynamicResource ButtonForeground}"
HorizontalContentAlignment="Center" ToolTip="{lex:Loc SpeedSettingTooltip}" Grid.Row="1" Grid.Column="1" />
<Label Content="{lex:Loc Speed}" MouseUp="SettingLabel_MouseUp" HorizontalAlignment="Left" Height="24"
Margin="2,0,0,226" VerticalAlignment="Bottom" Width="60" Foreground="White"
RenderTransformOrigin="9.667,-2.284" ToolTip="{lex:Loc SpeedSettingTooltip}" Grid.Row="1" Grid.Column="1" />
<Label x:Name="ViewerSpeed" MouseUp="SettingLabel_MouseUp" HorizontalAlignment="Left" Height="24"
Margin="62,0,0,226" Content="7.0" VerticalAlignment="Bottom" Width="35"
VerticalContentAlignment="Center" Foreground="{DynamicResource ButtonForeground}"
HorizontalContentAlignment="Center" ToolTip="{lex:Loc SpeedSettingTooltip}" Grid.Row="1" Grid.Column="1" />
<Label Content="{lex:Loc Brightness}" MouseUp="SettingLabel_MouseUp" HorizontalAlignment="Left" Height="24"
Margin="2,0,0,250" VerticalAlignment="Bottom" Width="60" Foreground="White"
RenderTransformOrigin="9.667,-2.284" ToolTip="{lex:Loc SpeedSettingTooltip}" Grid.Row="1" Grid.Column="1" />
<Label x:Name="ViewerCover" MouseUp="SettingLabel_MouseUp" Height="24" Margin="62,0,0,250" Content="0.6"
VerticalAlignment="Bottom" VerticalContentAlignment="Center"
Foreground="{DynamicResource ButtonForeground}" HorizontalAlignment="Left" Width="35"
HorizontalContentAlignment="Center" ToolTip="{lex:Loc SpeedSettingTooltip}" Grid.Row="1" Grid.Column="1" />
<Grid x:Name="PlbSpdAdjGrid" HorizontalAlignment="Left" Height="105" Margin="102,289,0,0"
VerticalAlignment="Top" Width="148" Visibility="Hidden" Grid.Row="1" Grid.Column="1">
<Grid.Background>
<SolidColorBrush Color="#FF303030" Opacity="0.8" />
</Grid.Background>
<Label Content="{lex:Loc PlayBackSpeed}" Height="26" Margin="44,20,44,0" VerticalAlignment="Top"
Foreground="White" HorizontalContentAlignment="Center" />
<Label x:Name="PlbSpdLabel" Content="100%" Margin="34,46,34,20" Foreground="White" FontWeight="Bold"
FontSize="22" HorizontalContentAlignment="Center" />
</Grid>
<Grid x:Name="FindGrid" Margin="0,29,28,0" Grid.Column="2" HorizontalAlignment="Right" Width="272" Height="69"
VerticalAlignment="Top" Visibility="Collapsed" Grid.Row="1">
<Grid.Background>
<SolidColorBrush Color="Black" Opacity="0.2" />
</Grid.Background>
<TextBox x:Name="InputText" HorizontalAlignment="Left" Height="22" Margin="10,10,0,0" TextWrapping="Wrap"
VerticalAlignment="Top" Width="231" VerticalContentAlignment="Center" />
<Image x:Name="Find_icon" HorizontalAlignment="Left" Height="22" Margin="246,10,0,0"
VerticalAlignment="Top" Width="26" Source="Image/outline_search_white_24dp.png"
MouseDown="Find_icon_MouseDown" ToolTip="{lex:Loc FindNext}" />
<Image x:Name="Replace_icon" HorizontalAlignment="Left" Height="22" Margin="246,37,0,0"
VerticalAlignment="Top" Width="26" Source="Image/outline_find_replace_white_24dp.png"
MouseDown="Replace_icon_MouseDown" ToolTip="{lex:Loc ReplaceNext}" />
<Label x:Name="FindClose" Content="^" Height="19" Margin="127,53,127,-3" VerticalAlignment="Top"
FontSize="11" FontWeight="Bold" Foreground="White" MouseDown="FindClose_MouseDown" />
<TextBox x:Name="ReplaceText" HorizontalAlignment="Left" Height="22" Margin="10,37,0,0" TextWrapping="Wrap"
VerticalAlignment="Top" Width="231" VerticalContentAlignment="Center" />
</Grid>
<StackPanel x:Name="OverrideModeTipsPopup" Margin="102,29,0,0" HorizontalAlignment="Left"
VerticalAlignment="Top" Orientation="Horizontal" Visibility="Collapsed" Grid.Row="1" Height="0" Width="0" Grid.Column="1">
<StackPanel.Background>
<SolidColorBrush Color="Black" Opacity="0.8" />
</StackPanel.Background>
<Label Content="{lex:Loc OverwriteMode}" Foreground="White" />
<Label Foreground="{DynamicResource HelperForeground}" Margin="3,0,0,0">
<Label.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock Text="{lex:Loc Key=OverwriteModeTooltip}" />
</StackPanel>
</ToolTip>
</Label.ToolTip>
<TextBlock TextDecorations="Underline" FontSize="10" Text="{lex:Loc Key=WhatsThis}" />
</Label>
</StackPanel>
<Rectangle x:Name="Cover" Fill="#FF1F1F1F" Margin="0,18,0,0" Stroke="Black" Grid.ColumnSpan="3"
d:IsHidden="True" Grid.RowSpan="2" Grid.Row="1" />
</Grid>
</Window>