2 Commits
v1.1 ... master

Author SHA1 Message Date
df68c79f28 doc: add deprecation note
- add deprecation note in README.
- archive this repository.
2025-03-03 12:35:05 +08:00
96f61362d3 fix: fix issue that fail to open legal TAS file.
- switch zlib library from zlib.net to DotNetZip because old one can not handle zlib-compressed file properly.
- bump version to 1.2
2024-07-26 23:20:11 +08:00
9 changed files with 83 additions and 36 deletions

View File

@ -40,6 +40,9 @@
<ApplicationIcon>icon.ico</ApplicationIcon> <ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualBasic" /> <Reference Include="Microsoft.VisualBasic" />
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
@ -57,9 +60,6 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="zlib.net, Version=1.0.3.0, Culture=neutral, PublicKeyToken=47d7877cb3620160">
<HintPath>..\packages\zlib.net.1.0.4.0\lib\zlib.net.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ApplicationDefinition Include="App.xaml"> <ApplicationDefinition Include="App.xaml">

View File

@ -1,4 +1,4 @@
using BallanceTASEditor.Core.TASStruct; using BallanceTASEditor.Core.TASStruct;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -12,34 +12,63 @@ namespace BallanceTASEditor.Core {
public static void CompressTAS(LinkedList<FrameData> mem, FileStream file) { public static void CompressTAS(LinkedList<FrameData> mem, FileStream file) {
file.Write(BitConverter.GetBytes(mem.Count * ConstValue.FRAMEDATA_SIZE), 0, 4); file.Write(BitConverter.GetBytes(mem.Count * ConstValue.FRAMEDATA_SIZE), 0, 4);
var zo = new zlib.ZOutputStream(file, 9); using (var zo = new Ionic.Zlib.ZlibStream(file, Ionic.Zlib.CompressionMode.Compress, Ionic.Zlib.CompressionLevel.Level9, true)) {
var node = mem.First; var node = mem.First;
while (node != null) { while (node != null) {
zo.Write(BitConverter.GetBytes(node.Value.deltaTime), 0, 4); zo.Write(BitConverter.GetBytes(node.Value.deltaTime), 0, 4);
zo.Write(BitConverter.GetBytes(node.Value.keystates), 0, 4); zo.Write(BitConverter.GetBytes(node.Value.keystates), 0, 4);
node = node.Next; node = node.Next;
} }
zo.finish();
zo.Close(); zo.Close();
} }
//var zo = new zlib.ZOutputStream(file, 9);
//var node = mem.First;
//while (node != null) {
// zo.Write(BitConverter.GetBytes(node.Value.deltaTime), 0, 4);
// zo.Write(BitConverter.GetBytes(node.Value.keystates), 0, 4);
// node = node.Next;
//}
//zo.finish();
//zo.Close();
}
public static void DecompressTAS(LinkedList<FrameData> ls, FileStream file) { public static void DecompressTAS(LinkedList<FrameData> ls, FileStream file) {
var lengthTemp = new byte[4]; var lengthTemp = new byte[4];
var mem = new MemoryStream();
file.Read(lengthTemp, 0, 4); file.Read(lengthTemp, 0, 4);
Int32 expectedLength = BitConverter.ToInt32(lengthTemp, 0); Int32 expectedLength = BitConverter.ToInt32(lengthTemp, 0);
long expectedCount = expectedLength / ConstValue.FRAMEDATA_SIZE; long expectedCount = expectedLength / ConstValue.FRAMEDATA_SIZE;
var zo = new zlib.ZOutputStream(mem); using (var mem = new MemoryStream()) {
using (var zo = new Ionic.Zlib.ZlibStream(mem, Ionic.Zlib.CompressionMode.Decompress, true)) {
CopyStream(file, zo); CopyStream(file, zo);
zo.finish(); zo.Close();
}
mem.Seek(0, SeekOrigin.Begin); mem.Seek(0, SeekOrigin.Begin);
for (long i = 0; i < expectedCount; i++) { for (long i = 0; i < expectedCount; i++) {
ls.AddLast(new FrameData(mem)); ls.AddLast(new FrameData(mem));
} }
mem.Close(); mem.Close();
zo.Close(); }
//mem.Seek(0, SeekOrigin.Begin);
//for (long i = 0; i < expectedCount; i++) {
// ls.AddLast(new FrameData(mem));
//}
//mem.Close();
//zo.Close();
//var zo = new zlib.ZOutputStream(mem);
//CopyStream(file, zo);
//zo.finish();
//mem.Seek(0, SeekOrigin.Begin);
//for (long i = 0; i < expectedCount; i++) {
// ls.AddLast(new FrameData(mem));
//}
//mem.Close();
//zo.Close();
} }
public static void CopyStream(Stream origin, Stream target) { public static void CopyStream(Stream origin, Stream target) {

View File

@ -1,4 +1,4 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BallanceTASEditor.Language" xmlns:local="clr-namespace:BallanceTASEditor.Language"
xmlns:sys="clr-namespace:System;assembly=mscorlib"> xmlns:sys="clr-namespace:System;assembly=mscorlib">
@ -62,7 +62,7 @@
<sys:String x:Key="code_Shared_ProgramName">Ballance TAS 编辑器</sys:String> <sys:String x:Key="code_Shared_ProgramName">Ballance TAS 编辑器</sys:String>
<sys:String x:Key="code_MainWindow_Menu_Help_About" xml:space="preserve">基于 MIT 开源许可证发布 <sys:String x:Key="code_MainWindow_Menu_Help_About" xml:space="preserve">基于 MIT 开源许可证发布
版本1.1 stable 版本1.2 stable
程序yyc12345. 程序yyc12345.
图标设计plAer_2</sys:String> 图标设计plAer_2</sys:String>
<sys:String x:Key="code_MainWindow_Closing">文件未关闭。您想直接退出吗?所有修改不会被保存。</sys:String> <sys:String x:Key="code_MainWindow_Closing">文件未关闭。您想直接退出吗?所有修改不会被保存。</sys:String>

View File

@ -1,4 +1,4 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BallanceTASEditor.Language" xmlns:local="clr-namespace:BallanceTASEditor.Language"
xmlns:sys="clr-namespace:System;assembly=mscorlib"> xmlns:sys="clr-namespace:System;assembly=mscorlib">
@ -62,7 +62,7 @@
<sys:String x:Key="code_Shared_ProgramName">Ballance TAS Editor</sys:String> <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 <sys:String x:Key="code_MainWindow_Menu_Help_About" xml:space="preserve">Under MIT License
Version: 1.1 stable Version: 1.2 stable
Program: yyc12345. Program: yyc12345.
Icon design: plAer_2</sys:String> 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_Closing">File is not closed. Do you want to just quit? All changes will not be saved.</sys:String>

View File

@ -1,4 +1,4 @@
<Window x:Class="BallanceTASEditor.MainWindow" <Window x:Class="BallanceTASEditor.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@ -262,7 +262,7 @@
</StatusBarItem> </StatusBarItem>
<StatusBarItem DockPanel.Dock="Right" HorizontalAlignment="Right"> <StatusBarItem DockPanel.Dock="Right" HorizontalAlignment="Right">
<TextBlock Text="v1.1 stable" Foreground="Gray" FontStyle="Italic"/> <TextBlock Text="v1.2 stable" Foreground="Gray" FontStyle="Italic"/>
</StatusBarItem> </StatusBarItem>
</StatusBar> </StatusBar>

View File

@ -1,4 +1,4 @@
using BallanceTASEditor.Core; using BallanceTASEditor.Core;
using BallanceTASEditor.Core.TASStruct; using BallanceTASEditor.Core.TASStruct;
using BallanceTASEditor.UI; using BallanceTASEditor.UI;
using System; using System;
@ -309,8 +309,7 @@ namespace BallanceTASEditor {
var arr = (System.Array)e.Data.GetData(DataFormats.FileDrop); var arr = (System.Array)e.Data.GetData(DataFormats.FileDrop);
if (arr.Length != 1) e.Effects = DragDropEffects.None; if (arr.Length != 1) e.Effects = DragDropEffects.None;
else e.Effects = DragDropEffects.Link; else e.Effects = DragDropEffects.Link;
} } else e.Effects = DragDropEffects.None;
else e.Effects = DragDropEffects.None;
} }
#endregion #endregion
@ -331,8 +330,14 @@ namespace BallanceTASEditor {
} }
private void OpenFile(string file) { private void OpenFile(string file) {
#if DEBUG
#else
try { try {
#endif
mFile = new TASFile(file); mFile = new TASFile(file);
#if DEBUG
#else
} catch { } catch {
MessageBox.Show(I18NProcessor.GetI18N("code_MainWindow_Menu_File_Open_Fail"), MessageBox.Show(I18NProcessor.GetI18N("code_MainWindow_Menu_File_Open_Fail"),
I18NProcessor.GetI18N("code_Shared_ProgramName"), I18NProcessor.GetI18N("code_Shared_ProgramName"),
@ -340,6 +345,7 @@ namespace BallanceTASEditor {
mFile = null; mFile = null;
return; return;
} }
#endif
mViewer = new TASViewer(mFile, mSlider, mFlow); mViewer = new TASViewer(mFile, mSlider, mFlow);

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="DotNetZip" version="1.9.1.8" targetFramework="net45" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net45" /> <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net45" />
<package id="zlib.net" version="1.0.4.0" targetFramework="net40" />
</packages> </packages>

View File

@ -2,6 +2,12 @@
A editor written for TAS file editing. A editor written for TAS file editing.
## Deprecation Note
I have lost all my interests on this game, Ballance, since 1 year ago. However, recently, I noticed that there were some improvements and modifications in Ballance TAS. What I want to clarified is that I have no intention on updating this project to adapt the new format or feature of Ballance TAS. So I archive this repository to explicitly indicate this standpoint.
However, this status is not prepetual. I will reopen this repository until I have learned enough text editor skills, such as Gap Buffer, to improve this application, or, restored the interests on this game (barely but still possible). You can freely fork this repository, or create new Ballance TAS editor on your own. That's your right granted by open source license.
## Basic Interface ## Basic Interface
### Program Menu ### Program Menu

View File

@ -2,6 +2,12 @@
一款专门用于编辑Ballance TAS文件的编辑器 一款专门用于编辑Ballance TAS文件的编辑器
## 弃用说明
一年前,我对 Ballance 这款游戏失去了兴趣。然而,最近,我注意到 Ballance TAS 有一些改进和修改。我想澄清的是,我无意更新这个项目以适应 Ballance TAS 的新格式或功能。所以我存档了这个存储库以明确表明这一立场。
但是,这种状态不是永久的。我将重新打开这个存储库,直到我学会了足够的文本编辑器技能(例如 Gap Buffer来改进这个应用程序或者恢复对这个游戏的兴趣勉强但仍然可能。您可以自由地分叉这个存储库或者自己创建新的 Ballance TAS 编辑器。这是开源许可证授予您的权利。
## 基本界面 ## 基本界面
### 程序菜单 ### 程序菜单