diff --git a/BallanceTASEditor/BallanceTASEditor.csproj b/BallanceTASEditor/BallanceTASEditor.csproj
index eda5c69..ae75845 100644
--- a/BallanceTASEditor/BallanceTASEditor.csproj
+++ b/BallanceTASEditor/BallanceTASEditor.csproj
@@ -36,6 +36,9 @@
4false
+
+ icon.ico
+
@@ -135,6 +138,8 @@
Settings.Designer.cs
-
+
+
+
\ No newline at end of file
diff --git a/BallanceTASEditor/Language/CHS.xaml b/BallanceTASEditor/Language/CHS.xaml
index 101e041..bc5a152 100644
--- a/BallanceTASEditor/Language/CHS.xaml
+++ b/BallanceTASEditor/Language/CHS.xaml
@@ -50,8 +50,27 @@
在后方添加新项在前方添加新项
+ 添加项
+ 个数
+ 帧率
+ 间隔时间
+ 好
+ 取消
+
+ Ballance TAS 编辑器
+ 基于 MIT 开源许可证发布
+版本:1.0 stable
+程序:yyc12345.
+图标设计:plAer_2
+ 您想要关闭这个TAS文件吗?
+ 无法打开文件,文件可能不是合法的TAS文件。
+ 输入新的数量(<=5 && >=30)
+ 警告
+ TAS 文件(*.tas)|*.tas|所有文件(*.*)|*.*
+ 输入数字
+ 无效的数字,请再试一次。
\ No newline at end of file
diff --git a/BallanceTASEditor/Language/DefaultLanguage.xaml b/BallanceTASEditor/Language/DefaultLanguage.xaml
index 5447638..d22de0a 100644
--- a/BallanceTASEditor/Language/DefaultLanguage.xaml
+++ b/BallanceTASEditor/Language/DefaultLanguage.xaml
@@ -45,13 +45,32 @@
Paste after thisPaste before thisDelete
- Delete next frame
+ Delete this frameDelete last frameAdd blank item after thisAdd blank item before this
-
+
+ Add Item
+ Count
+ FPS
+ Delta Time
+ OK
+ Cancel
+
+
+ Ballance TAS Editor
-
+ Under MIT License
+Version: 1.0 stable
+Program: yyc12345.
+Icon design: plAer_2
+ Do you want to close this TAS file?
+ Fail to open file. This file might not a legal TAS file.
+ Input new count (<=5 && >=30)
+ Warning
+ TAS file(*.tas)|*.tas|All file(*.*)|*.*
+ Input number
+ Invalid number. Please input again.
\ No newline at end of file
diff --git a/BallanceTASEditor/MainWindow.xaml b/BallanceTASEditor/MainWindow.xaml
index 04d8181..64109c2 100644
--- a/BallanceTASEditor/MainWindow.xaml
+++ b/BallanceTASEditor/MainWindow.xaml
@@ -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">
+ input:InputMethod.IsInputMethodEnabled="False" MouseWheel="funcWindow_MouseWheel" Icon="icon.ico">
@@ -18,6 +18,7 @@
+
@@ -29,6 +30,7 @@
+
@@ -40,6 +42,7 @@
+
@@ -141,7 +144,7 @@
-
+
diff --git a/BallanceTASEditor/MainWindow.xaml.cs b/BallanceTASEditor/MainWindow.xaml.cs
index 3ddb732..3d9a6db 100644
--- a/BallanceTASEditor/MainWindow.xaml.cs
+++ b/BallanceTASEditor/MainWindow.xaml.cs
@@ -69,6 +69,7 @@ namespace BallanceTASEditor {
private void funcCommand_Menu_Display_Redo(object sender, ExecutedRoutedEventArgs e) => funcMenu_Display_Redo(sender, e);
private void funcCommand_DataMenu_Cut(object sender, ExecutedRoutedEventArgs e) => funcDataMenu_Cut(sender, e);
private void funcCommand_DataMenu_Copy(object sender, ExecutedRoutedEventArgs e) => funcDataMenu_Copy(sender, e);
+ private void funcCommand_DataMenu_PasteAfter(object sender, ExecutedRoutedEventArgs e) => funcDataMenu_PasteAfter(sender, e);
private void funcCommand_DataMenu_DeleteAfter(object sender, ExecutedRoutedEventArgs e) => funcDataMenu_DeleteAfter(sender, e);
private void funcCommand_DataMenu_DeleteBefore(object sender, ExecutedRoutedEventArgs e) => funcDataMenu_DeleteBefore(sender, e);
private void funcCanExeCmd_Menu_File_Open(object sender, CanExecuteRoutedEventArgs e) => e.CanExecute = uiMenu_File_Open.IsEnabled;
@@ -77,6 +78,7 @@ namespace BallanceTASEditor {
private void funcCanExeCmd_Menu_Display_Redo(object sender, CanExecuteRoutedEventArgs e) => e.CanExecute = uiMenu_Display_Redo.IsEnabled;
private void funcCanExeCmd_DataMenu_Cut(object sender, CanExecuteRoutedEventArgs e) => e.CanExecute = mViewer != null && uiDataMenu_Cut.IsEnabled;
private void funcCanExeCmd_DataMenu_Copy(object sender, CanExecuteRoutedEventArgs e) => e.CanExecute = mViewer != null && uiDataMenu_Copy.IsEnabled;
+ private void funcCanExeCmd_DataMenu_PasteAfter(object sender, CanExecuteRoutedEventArgs e) => e.CanExecute = mViewer != null && uiDataMenu_PasteAfter.IsEnabled;
private void funcCanExeCmd_DataMenu_DeleteAfter(object sender, CanExecuteRoutedEventArgs e) => e.CanExecute = mViewer != null && uiDataMenu_DeleteAfter.IsEnabled;
private void funcCanExeCmd_DataMenu_DeleteBefore(object sender, CanExecuteRoutedEventArgs e) => e.CanExecute = mViewer != null && uiDataMenu_DeleteBefore.IsEnabled;
@@ -88,7 +90,9 @@ namespace BallanceTASEditor {
}
private void funcMenu_Help_About(object sender, RoutedEventArgs e) {
- MessageBox.Show("Under MIT License\nVersion: 1.0 beta\nyyc12345.", "Ballance TAS Editor", MessageBoxButton.OK, MessageBoxImage.Information);
+ MessageBox.Show(I18NProcessor.GetI18N("code_MainWindow_Menu_Help_About"),
+ I18NProcessor.GetI18N("code_Shared_ProgramName"),
+ MessageBoxButton.OK, MessageBoxImage.Information);
}
private void funcMenu_File_Open(object sender, RoutedEventArgs e) {
@@ -108,7 +112,7 @@ namespace BallanceTASEditor {
}
private void funcMenu_File_Close(object sender, RoutedEventArgs e) {
- if (!DialogUtil.ConfirmDialog("Do you want to close this TAS file?")) return;
+ if (!DialogUtil.ConfirmDialog(I18NProcessor.GetI18N("code_MainWindow_Menu_File_Close"))) return;
mViewer.UpdateDataUI -= RefreshDataUI;
mViewer.UpdateSelection -= RefreshSelection;
@@ -122,7 +126,7 @@ namespace BallanceTASEditor {
private void funcMenu_Display_ItemCount(object sender, RoutedEventArgs e) {
int newvalue = 0;
- if (DialogUtil.InputNumber("Input new count (>=5 && <=30)", 5, 30, ref newvalue)) {
+ if (DialogUtil.InputNumber(I18NProcessor.GetI18N("code_MainWindow_Menu_Display_ItemCount"), 5, 30, ref newvalue)) {
ChangeItemCount(newvalue);
}
}
@@ -322,7 +326,9 @@ namespace BallanceTASEditor {
try {
mFile = new TASFile(file);
} catch {
- MessageBox.Show("Fail to open file. This file might not a legal TAS file.", "Ballance TAS Editor", MessageBoxButton.OK, MessageBoxImage.Error);
+ MessageBox.Show(I18NProcessor.GetI18N("code_MainWindow_Menu_File_Open_Fail"),
+ I18NProcessor.GetI18N("code_Shared_ProgramName"),
+ MessageBoxButton.OK, MessageBoxImage.Error);
mFile = null;
return;
}
diff --git a/BallanceTASEditor/UI/AddItem.xaml b/BallanceTASEditor/UI/AddItem.xaml
index a3f12a8..b5b5d02 100644
--- a/BallanceTASEditor/UI/AddItem.xaml
+++ b/BallanceTASEditor/UI/AddItem.xaml
@@ -6,7 +6,7 @@
xmlns:local="clr-namespace:BallanceTASEditor.UI"
xmlns:converter="clr-namespace:BallanceTASEditor.UI"
mc:Ignorable="d"
- Title="Add Item" Height="200" Width="400" WindowStyle="ToolWindow" WindowStartupLocation="CenterOwner">
+ Title="{DynamicResource ui_AddItem_Title}" Height="200" Width="400" WindowStyle="ToolWindow" WindowStartupLocation="CenterOwner" Icon="/BallanceTASEditor;component/icon.ico">
@@ -25,9 +25,9 @@
-
-
-
+
+
+
@@ -35,7 +35,7 @@
Text="{Binding Converter={StaticResource conv_fps2DeltaTime}, Mode=OneWay, ElementName=uiTextbox_FPS, Path=Text}"/>
-
diff --git a/BallanceTASEditor/UI/DialogUtil.cs b/BallanceTASEditor/UI/DialogUtil.cs
index b46f4b7..c2ad60c 100644
--- a/BallanceTASEditor/UI/DialogUtil.cs
+++ b/BallanceTASEditor/UI/DialogUtil.cs
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
+using BallanceTASEditor.Core;
namespace BallanceTASEditor.UI {
public class DialogUtil {
@@ -12,7 +13,7 @@ namespace BallanceTASEditor.UI {
Microsoft.Win32.OpenFileDialog op = new Microsoft.Win32.OpenFileDialog();
op.RestoreDirectory = true;
op.Multiselect = false;
- op.Filter = "TAS file(*.tas)|*.tas|All file(*.*)|*.*";
+ op.Filter = I18NProcessor.GetI18N("code_DialogUtil_FileFilter");
if (!(bool)op.ShowDialog()) return "";
return op.FileName;
}
@@ -20,24 +21,26 @@ namespace BallanceTASEditor.UI {
public static string SaveFileDialog() {
Microsoft.Win32.SaveFileDialog op = new Microsoft.Win32.SaveFileDialog();
op.RestoreDirectory = true;
- op.Filter = "TAS file(*.tas)|*.tas|All file(*.*)|*.*";
+ op.Filter = I18NProcessor.GetI18N("code_DialogUtil_FileFilter");
if (!(bool)op.ShowDialog()) return "";
return op.FileName;
}
public static bool ConfirmDialog(string str) {
- var result = MessageBox.Show(str, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning);
+ var result = MessageBox.Show(str, I18NProcessor.GetI18N("code_DialogUtil_Warning"), MessageBoxButton.YesNo, MessageBoxImage.Warning);
return (result == MessageBoxResult.Yes);
}
public static bool InputNumber(string title, int min, int max, ref int result) {
while (true) {
- var dialog = Interaction.InputBox(title, "Input number", "");
+ var dialog = Interaction.InputBox(title, I18NProcessor.GetI18N("code_DialogUtil_InputNumber_Title"), "");
if (dialog == "") return false;
if (int.TryParse(dialog, out result)) {
if (result <= max && result >= min) break;
}
- MessageBox.Show("Invalid number. Please input again", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
+ MessageBox.Show(I18NProcessor.GetI18N("code_DialogUtil_InputNumber_Wrong"),
+ I18NProcessor.GetI18N("code_DialogUtil_Warning"),
+ MessageBoxButton.OK, MessageBoxImage.Warning);
}
return true;
}
diff --git a/BallanceTASEditor/icon.ico b/BallanceTASEditor/icon.ico
new file mode 100644
index 0000000..07673cf
Binary files /dev/null and b/BallanceTASEditor/icon.ico differ
diff --git a/README.md b/README.md
index 88cf91e..d010897 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,114 @@
-# Ballance TAS Editor
\ No newline at end of file
+# Ballance TAS Editor
+
+A editor written for TAS file editing.
+
+## Basic Interface
+
+### Program Menu
+
+* File
+ * Open: Open a TAS file.
+ * Save: Save modifications to opended TAS file.
+ * Save as...: Save the modifications as a new TAS file and switch to the new file.
+ * Close: Close current file.
+* Edit
+ * Undo: Undo a operation.
+ * Redo: Redo previous undo operation.
+ * Item Count: Set the count of items showed in editor panel.
+ * Overwritten Paste: Switch paste mode between Overwritten Mode and Insert Mode.
+ * Horizontal Layout: Switch editor layout between horzontal layout and vertical layout.
+* Help
+ * Report Bugs: Open a web page to report bugs about this program.
+ * About: Open a dialog to show some infomations about this prrogram.
+
+### TAS Unit Menu
+
+Right click TAS unit will open a menu. The enable statue of each is decided by your current tools and selected items.
+
+|Operation|Needed mode|Needed selection|What the operation do|
+|:---|:---|:---|:---|
+|Set|Fill mode|Multiple selection|Set selected units as *set* status|
+|Unset|Fill mode|Multiple selection|Set selected units as *unset* status|
+|Cut|Cursor mode|Multiple selection|Cut selected units|
+|Copy|Cursor mode|Multiple selection|Copy selected units|
+|Paste after this|Cursor mode|Single selection|Pasted copied units after selected unit|
+|Paste before this|Cursor mode|Single selection|Pasted copied units before selected unit|
+|Delete|Cursor mode|Single selection|Delete selected units|
+|Delete this frame|Cursor mode|Single selection|Delete selected unit, and move selection to the next unit|
+|Delete last frame|Cursor mode|Single selection|Delete one unit aheading of selected unit|
+|Add blank item after this|Cursor mode|Single selection|Add blank unit after selected unit|
+|Add blank item before this|Cursor mode|Single selection|Add blank unit before selected unit|
+
+### Status Bar
+
+A status bar will be shown at the bottom of window if you opended a TAS file. The item located in status bar from left to right is: Current tools mode, Overwritten paste status, Current selected region.
+
+## View
+
+### Basic Operation
+
+Once a file opened, a slider will be placed at the bottom of window. You can drag it and go to any position of this file which you want to browse.
+4 buttons were located at the left of slider, from left to right is: fast rewind, rewind, forward, fast forward. Fase backward and fast forward will rewind or forward the number of units by one page at a time.
+
+If you want to change the count of shown units in display panel, please use Edit - Item Count to change it.
+
+### Quick Operation
+
+The key ASDF of keyboard are corresponding with the functions of 4 buttons.
+
+A mouse wheel will scroll 1 TAS unit.
+Or, if you press Shift at the same time, it will scroll 1 page TAS units.
+Or, if you press Crtl at the same time, it will increase or decrease the count of shown item in display panel.
+
+### Horzontal Layout and Vertical Layout
+
+After opening a file, you can use Edit - Horizontal Layout to switch layout between horzontal layout and vertical layout. Different layouts suit for different people. Please choose your favorite layout freely.
+
+## Mode Introduction
+
+### Basic Mode
+
+Once ths file opened, 3 tools buttons were placed at the top of window. They are:
+
+* Cursor mode: Allow you pick TAS unit by column. In this mode, you can copy, paste, insert, delete and etc...
+* Fill mode: Allow you select TAS unit by cell. And you can set or unset the status of cells.
+* Draw mode: See cursor as brush. Flip the set status of clicked cell.
+
+### Multiple and Single Selection
+
+Cursor mode allow single selection. Click a TAS unit directly, you can select it.
+
+Cursor mode and Fill mode allow multiple selection. For a multiple selection, you should click a cell as the start point, then hold on shift to click another cell, as the end of selection.
+Click a cell again will start a new selection, hold shift click a cell to finish the new multiple selection.
+If you want to multiple select a single cell(if operation require), you can hold on shift to click the start of selection to finish a single cell's multiple selection.
+
+### Highlight of Selection
+
+In cursor mode, selected TAS unit will show a orange rectangle at the top of them.
+
+In fill mode, selected cell will show with orange border.
+
+## Special Operation
+
+### Overwritten Paste and Insert Paste
+
+Paste have 2 mode, overwritten paste and insert paste.
+Insert will insert copied content before or after selected unit.
+However, overwrite pasting will use the currently selected cell as the beginning or end of the paste, and write the contents of the clipboard forward or backward directly. The original data of affected unit will be wipe out. If the length of data is not enough, additional items will be added.
+
+### Shortcut
+
+* `Ctrl + O`:Open file
+* `Ctrl + S`:Save file
+* `Ctrl + Z`:Undo
+* `Ctrl + Y`:Redo
+* `Ctrl + X`:Cut
+* `Ctrl + C`:Copy
+* `Ctrl + V`:Paste After
+* `Delete`:Delete this frame
+* `Backspace`:Delete last frame
+
+## Something Went Wrong
+
+If program crashed, program will output a error log in the folder called `logs`. Please send error log to developer to help us to locate and reproduce error.
+
diff --git a/README_ZH.md b/README_ZH.md
index 45ed076..1549635 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -104,6 +104,7 @@
* `Ctrl + Y`:重做
* `Ctrl + X`:剪切
* `Ctrl + C`:复制
+* `Ctrl + V`:向后粘贴
* `Delete`:向后删除
* `Backspace`:向前删除