Skip to content

Commit

Permalink
feat: add version feature
Browse files Browse the repository at this point in the history
- add version info for Assembly.
- update version to 1.1
- add info textblock in main window for more convenient debug because some users only send a screenshot without reference any version info.
- fix typo
- fix menu dynamic resource link error
  • Loading branch information
yyc12345 committed May 11, 2022
1 parent 5971069 commit e8fc96e
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 26 deletions.
5 changes: 3 additions & 2 deletions BallanceTASEditor/Language/CHS.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<sys:String x:Key="ui_TASFlow_Menu_Cut">剪切</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_Copy">复制</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_PasteAfter">粘贴于后方</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_PasterBefore">粘贴于前方</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_PasteBefore">粘贴于前方</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_Delete">删除</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_DeleteAfter">向后删除</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_DeleteBefore">向前删除</sys:String>
Expand All @@ -62,9 +62,10 @@
<sys:String x:Key="code_Shared_ProgramName">Ballance TAS 编辑器</sys:String>

<sys:String x:Key="code_MainWindow_Menu_Help_About" xml:space="preserve">基于 MIT 开源许可证发布
版本:1.0 stable
版本:1.1 stable
程序:yyc12345.
图标设计:plAer_2</sys:String>
<sys:String x:Key="code_MainWindow_Closing">文件未关闭。您想直接退出吗?所有修改不会被保存。</sys:String>
<sys:String x:Key="code_MainWindow_Menu_File_Close">您想要关闭这个TAS文件吗?</sys:String>
<sys:String x:Key="code_MainWindow_Menu_File_Open_Fail">无法打开文件,文件可能不是合法的TAS文件。</sys:String>
<sys:String x:Key="code_MainWindow_Menu_Display_ItemCount">输入新的数量(&lt;=5 &amp;&amp; &gt;=30)</sys:String>
Expand Down
5 changes: 3 additions & 2 deletions BallanceTASEditor/Language/DefaultLanguage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<sys:String x:Key="ui_TASFlow_Menu_Cut">Cut</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_Copy">Copy</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_PasteAfter">Paste after this</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_PasterBefore">Paste before this</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_PasteBefore">Paste before this</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_Delete">Delete</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_DeleteAfter">Delete this frame</sys:String>
<sys:String x:Key="ui_TASFlow_Menu_DeleteBefore">Delete last frame</sys:String>
Expand All @@ -62,9 +62,10 @@
<sys:String x:Key="code_Shared_ProgramName">Ballance TAS Editor</sys:String>

<sys:String x:Key="code_MainWindow_Menu_Help_About" xml:space="preserve">Under MIT License
Version: 1.0 stable
Version: 1.1 stable
Program: yyc12345.
Icon design: plAer_2</sys:String>
<sys:String x:Key="code_MainWindow_Closing">File is not closed. Do you want to just quit? All changes will not be saved.</sys:String>
<sys:String x:Key="code_MainWindow_Menu_File_Close">Do you want to close this TAS file?</sys:String>
<sys:String x:Key="code_MainWindow_Menu_File_Open_Fail">Fail to open file. This file might not a legal TAS file.</sys:String>
<sys:String x:Key="code_MainWindow_Menu_Display_ItemCount">Input new count (&lt;=5 &amp;&amp; &gt;=30)</sys:String>
Expand Down
38 changes: 25 additions & 13 deletions BallanceTASEditor/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"
mc:Ignorable="d"
Title="{DynamicResource ui_MainWindow_Title}" Height="500" Width="800" KeyUp="funcWindow_KeyUp"
input:InputMethod.IsInputMethodEnabled="False" MouseWheel="funcWindow_MouseWheel" Icon="icon.ico">
input:InputMethod.IsInputMethodEnabled="False" MouseWheel="funcWindow_MouseWheel" Icon="icon.ico" Closing="funcWindow_Closing">

<!-- shortcut defination-->
<Window.Resources>
Expand Down Expand Up @@ -145,11 +145,11 @@
<MenuItem x:Name="uiDataMenu_Cut" Header="{DynamicResource ui_TASFlow_Menu_Cut}" Click="funcDataMenu_Cut" InputGestureText="Ctrl + X"/>
<MenuItem x:Name="uiDataMenu_Copy" Header="{DynamicResource ui_TASFlow_Menu_Copy}" Click="funcDataMenu_Copy" InputGestureText="Ctrl + C"/>
<MenuItem x:Name="uiDataMenu_PasteAfter" Header="{DynamicResource ui_TASFlow_Menu_PasteAfter}" Click="funcDataMenu_PasteAfter" InputGestureText="Ctrl + V"/>
<MenuItem x:Name="uiDataMenu_PasteBefore" Header="{DynamicResource ui_TASFlow_Menu_PasterBefore}" Click="funcDataMenu_PasteBefore"/>
<MenuItem x:Name="uiDataMenu_PasteBefore" Header="{DynamicResource ui_TASFlow_Menu_PasteBefore}" Click="funcDataMenu_PasteBefore"/>
<Separator/>
<MenuItem x:Name="uiDataMenu_Delete" Header="{DynamicResource ui_TASFlow_Menu_Delete}" Click="funcDataMenu_Delete"/>
<MenuItem x:Name="uiDataMenu_DeleteAfter" Header="{DynamicResource ui_TASFlow_Menu_DeleteAfter}" Click="funcDataMenu_DeleteAfter" InputGestureText="Del"/>
<MenuItem x:Name="uiDataMenu_DeleteBefore" Header="{DynamicResource ui_TASFlow_Menu_PasterBefore}" Click="funcDataMenu_DeleteBefore" InputGestureText="Backspace"/>
<MenuItem x:Name="uiDataMenu_DeleteBefore" Header="{DynamicResource ui_TASFlow_Menu_DeleteBefore}" Click="funcDataMenu_DeleteBefore" InputGestureText="Backspace"/>
<Separator/>
<MenuItem x:Name="uiDataMenu_AddAfter" Header="{DynamicResource ui_TASFlow_Menu_AddAfter}" Click="funcDataMenu_AddAfter"/>
<MenuItem x:Name="uiDataMenu_AddBefore" Header="{DynamicResource ui_TASFlow_Menu_AddBefore}" Click="funcDataMenu_AddBefore"/>
Expand Down Expand Up @@ -242,16 +242,28 @@
</Grid>

<StatusBar x:Name="uiStatusbar" Grid.Row="2">
<Grid>
<TextBlock x:Name="uiStatusbar_Mode_Cursor" Text="{DynamicResource ui_MainWindow_StatusBar_Mode_Cursor}"/>
<TextBlock x:Name="uiStatusbar_Mode_Fill" Text="{DynamicResource ui_MainWindow_StatusBar_Mode_Fill}"/>
<TextBlock x:Name="uiStatusbar_Mode_Overwrite" Text="{DynamicResource ui_MainWindow_StatusBar_Mode_Overwritten}"/>
</Grid>
<Separator/>
<TextBlock x:Name="uiStatusbar_OverwrittenPaste" Text="{DynamicResource ui_MainWindow_StatusBar_OverwrittenPaste}"/>
<Separator/>
<TextBlock Text="{DynamicResource ui_MainWindow_StatusBar_Selected}"/>
<TextBlock x:Name="uiStatusbar_Selected" Text="-"/>
<StatusBarItem x:Name="uiStatusbar_Runtime_Mode">
<Grid>
<TextBlock x:Name="uiStatusbar_Mode_Cursor" Text="{DynamicResource ui_MainWindow_StatusBar_Mode_Cursor}"/>
<TextBlock x:Name="uiStatusbar_Mode_Fill" Text="{DynamicResource ui_MainWindow_StatusBar_Mode_Fill}"/>
<TextBlock x:Name="uiStatusbar_Mode_Overwrite" Text="{DynamicResource ui_MainWindow_StatusBar_Mode_Overwritten}"/>
</Grid>
</StatusBarItem>
<Separator x:Name="uiStatusbar_Runtime_Separator1"/>
<StatusBarItem x:Name="uiStatusbar_Runtime_PasteMode">
<TextBlock x:Name="uiStatusbar_OverwrittenPaste" Text="{DynamicResource ui_MainWindow_StatusBar_OverwrittenPaste}"/>
</StatusBarItem>
<Separator x:Name="uiStatusbar_Runtime_Separator2"/>
<StatusBarItem x:Name="uiStatusbar_Runtime_Selected">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{DynamicResource ui_MainWindow_StatusBar_Selected}"/>
<TextBlock x:Name="uiStatusbar_Selected" Text="-"/>
</StackPanel>
</StatusBarItem>

<StatusBarItem DockPanel.Dock="Right" HorizontalAlignment="Right">
<TextBlock Text="v1.1 stable" Foreground="Gray" FontStyle="Italic"/>
</StatusBarItem>
</StatusBar>

</Grid>
Expand Down
20 changes: 18 additions & 2 deletions BallanceTASEditor/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ private void funcMenu_File_Close(object sender, RoutedEventArgs e) {
RefreshUI(false);
}

private void funcWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
if (!(mFile is null)) {
if (!DialogUtil.ConfirmDialog(I18NProcessor.GetI18N("code_MainWindow_Closing"))) {
e.Cancel = true;
}
}
}

private void funcMenu_Display_ItemCount(object sender, RoutedEventArgs e) {
int newvalue = 0;
if (DialogUtil.InputNumber(I18NProcessor.GetI18N("code_MainWindow_Menu_Display_ItemCount"), 5, 30, ref newvalue)) {
Expand Down Expand Up @@ -392,7 +400,11 @@ private void RefreshUI(bool isFileOpened) {
uiMenu_Display_Undo.IsEnabled = true;
uiMenu_Display_Redo.IsEnabled = true;

uiStatusbar.Visibility = Visibility.Visible;
uiStatusbar_Runtime_Mode.Visibility = Visibility.Visible;
uiStatusbar_Runtime_PasteMode.Visibility = Visibility.Visible;
uiStatusbar_Runtime_Selected.Visibility = Visibility.Visible;
uiStatusbar_Runtime_Separator1.Visibility = Visibility.Visible;
uiStatusbar_Runtime_Separator2.Visibility = Visibility.Visible;
} else {
uiEditorPanel.Visibility = Visibility.Collapsed;
uiEditorNote.Visibility = Visibility.Visible;
Expand All @@ -408,7 +420,11 @@ private void RefreshUI(bool isFileOpened) {
uiMenu_Display_Undo.IsEnabled = false;
uiMenu_Display_Redo.IsEnabled = false;

uiStatusbar.Visibility = Visibility.Collapsed;
uiStatusbar_Runtime_Mode.Visibility = Visibility.Collapsed;
uiStatusbar_Runtime_PasteMode.Visibility = Visibility.Collapsed;
uiStatusbar_Runtime_Selected.Visibility = Visibility.Collapsed;
uiStatusbar_Runtime_Separator1.Visibility = Visibility.Collapsed;
uiStatusbar_Runtime_Separator2.Visibility = Visibility.Collapsed;
}
}

Expand Down
14 changes: 7 additions & 7 deletions BallanceTASEditor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("BallanceTASEditor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyTitle("Ballance TAS Editor")]
[assembly: AssemblyDescription("Ballance TAS Editor")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BallanceTASEditor")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyCompany("Ballance Community")]
[assembly: AssemblyProduct("Ballance TAS Editor")]
[assembly: AssemblyCopyright("Copyright © Ballance Community 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -51,5 +51,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]

0 comments on commit e8fc96e

Please sign in to comment.