Commit dbde4503 authored by keyongyu's avatar keyongyu

2.1.0.1

parent a08a5cd2
...@@ -21,6 +21,7 @@ namespace DataEditorX.Core ...@@ -21,6 +21,7 @@ namespace DataEditorX.Core
public enum MyTask{ public enum MyTask{
NONE, NONE,
CheckUpdate, CheckUpdate,
ExportData,
SaveAsMSE, SaveAsMSE,
CutImages, CutImages,
ConvertImages, ConvertImages,
...@@ -198,12 +199,58 @@ public void ConvertImages(string imgpath,string gamepath,bool isreplace) ...@@ -198,12 +199,58 @@ public void ConvertImages(string imgpath,string gamepath,bool isreplace)
} }
File.Delete(setFile); File.Delete(setFile);
} }
public void ExportData(string cdbfile)
{
if(!File.Exists(cdbfile))
return;
int i=0;
Card[] cards=DataBase.Read(cdbfile, false, "");
if(cards == null || cards.Length == 0)
return;
int count=cards.Length;
string path=Path.GetDirectoryName(cdbfile);
string name=Path.GetFileNameWithoutExtension(cdbfile);
string zipname=Path.Combine(path, name+".zip");
string pics=Path.Combine(path,"pics");
string thumb=Path.Combine(pics,"thumbnail");
string script=Path.Combine(path,"script");
if(File.Exists(zipname))
File.Delete(zipname);
using(ZipStorer zips=ZipStorer.Create(zipname, ""))
{
zips.AddFile(cdbfile, name+".cdb","");
foreach(Card c in cards)
{
i++;
worker.ReportProgress(i/count, string.Format("{0}/{1}",i,count));
//zips.AddFile(
string jpg1=Path.Combine(pics, c.id.ToString()+".jpg");
string jpg2=Path.Combine(thumb, c.id.ToString()+".jpg");
string lua=Path.Combine(script, "c"+c.id.ToString()+".lua");
if(File.Exists(jpg1))
zips.AddFile(jpg1,"pics/"+c.id.ToString()+".jpg","");
if(File.Exists(jpg2))
zips.AddFile(jpg2,"pics/thumbnail/"+c.id.ToString()+".jpg","");
if(File.Exists(lua))
zips.AddFile(lua,"script/c"+c.id.ToString()+".lua","");
}
}
}
public void Run(){ public void Run(){
isCancel=false; isCancel=false;
isRun=true; isRun=true;
bool replace; bool replace;
bool showNew; bool showNew;
switch(nowTask){ switch(nowTask){
case MyTask.ExportData:
if(mArgs!=null && mArgs.Length>=1){
ExportData(mArgs[0]);
}
break;
case MyTask.CheckUpdate: case MyTask.CheckUpdate:
showNew=false; showNew=false;
if(mArgs!=null && mArgs.Length>=1){ if(mArgs!=null && mArgs.Length>=1){
......
...@@ -113,6 +113,7 @@ private void InitializeComponent() ...@@ -113,6 +113,7 @@ private void InitializeComponent()
this.tb_setcode3 = new System.Windows.Forms.TextBox(); this.tb_setcode3 = new System.Windows.Forms.TextBox();
this.tb_setcode4 = new System.Windows.Forms.TextBox(); this.tb_setcode4 = new System.Windows.Forms.TextBox();
this.lb_cardcode = new System.Windows.Forms.Label(); this.lb_cardcode = new System.Windows.Forms.Label();
this.menuitem_exportdata = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -200,9 +201,10 @@ private void InitializeComponent() ...@@ -200,9 +201,10 @@ private void InitializeComponent()
// menu_tools // menu_tools
// //
this.menu_tools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menu_tools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuitem_compdb,
this.menuitem_readydk, this.menuitem_readydk,
this.menuitem_readimages, this.menuitem_readimages,
this.menuitem_compdb,
this.menuitem_exportdata,
this.tsep5, this.tsep5,
this.menuitem_saveasmse_select, this.menuitem_saveasmse_select,
this.menuitem_saveasmse, this.menuitem_saveasmse,
...@@ -882,6 +884,13 @@ private void InitializeComponent() ...@@ -882,6 +884,13 @@ private void InitializeComponent()
this.lb_cardcode.TabIndex = 7; this.lb_cardcode.TabIndex = 7;
this.lb_cardcode.Text = "Card Code"; this.lb_cardcode.Text = "Card Code";
// //
// menuitem_exportdata
//
this.menuitem_exportdata.Name = "menuitem_exportdata";
this.menuitem_exportdata.Size = new System.Drawing.Size(212, 22);
this.menuitem_exportdata.Text = "Export Data";
this.menuitem_exportdata.Click += new System.EventHandler(this.Menuitem_exportdataClick);
//
// DataEditForm // DataEditForm
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -950,6 +959,7 @@ private void InitializeComponent() ...@@ -950,6 +959,7 @@ private void InitializeComponent()
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
private System.Windows.Forms.ToolStripMenuItem menuitem_exportdata;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem menuitem_quit; private System.Windows.Forms.ToolStripMenuItem menuitem_quit;
......
...@@ -154,10 +154,19 @@ void HideMenu() ...@@ -154,10 +154,19 @@ void HideMenu()
//this.PerformLayout(); //this.PerformLayout();
} }
string RemoveTag(string text)
{
int t=text.LastIndexOf(" (");
if(t>0)
{
return text.Substring(0,t);
}
return text;
}
void SetTitle() void SetTitle()
{ {
string str=title; string str=title;
string str2=title; string str2=RemoveTag(title);
if(!string.IsNullOrEmpty(nowCdbFile)){ if(!string.IsNullOrEmpty(nowCdbFile)){
str=nowCdbFile+"-"+str; str=nowCdbFile+"-"+str;
str2=Path.GetFileName(nowCdbFile); str2=Path.GetFileName(nowCdbFile);
...@@ -1074,31 +1083,7 @@ void Menuitem_newClick(object sender, EventArgs e) ...@@ -1074,31 +1083,7 @@ void Menuitem_newClick(object sender, EventArgs e)
} }
} }
} }
void Menuitem_compdbClick(object sender, EventArgs e)
{
if(!Check())
return;
DataBase.Compression(nowCdbFile);
MyMsg.Show(LMSG.CompDBOK);
}
void Menuitem_convertimageClick(object sender, EventArgs e)
{
if(!Check())
return;
if(isRun())
return;
using(FolderBrowserDialog fdlg=new FolderBrowserDialog())
{
fdlg.Description= LANG.GetMsg(LMSG.SelectImagePath);
if(fdlg.ShowDialog()==DialogResult.OK)
{
bool isreplace=MyMsg.Question(LMSG.IfReplaceExistingImage);
tasker.SetTask(MyTask.ConvertImages, null,
fdlg.SelectedPath, GAMEPATH, isreplace.ToString());
Run(LANG.GetMsg(LMSG.ConvertImage));
}
}
}
void Menuitem_readydkClick(object sender, EventArgs e) void Menuitem_readydkClick(object sender, EventArgs e)
{ {
if(!Check()) if(!Check())
...@@ -1160,16 +1145,12 @@ void BgWorker1DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) ...@@ -1160,16 +1145,12 @@ void BgWorker1DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
} }
void BgWorker1ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) void BgWorker1ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
{ {
int t=title.LastIndexOf(" ("); title=string.Format("{0} ({1}-{2})",
if(t>0) RemoveTag(title),
{ taskname,
title=string.Format("{0} ({1}-{2})", // e.ProgressPercentage,
title.Substring(0,t), e.UserState);
taskname, SetTitle();
// e.ProgressPercentage,
e.UserState);
SetTitle();
}
} }
//任务完成 //任务完成
void BgWorker1RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) void BgWorker1RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
...@@ -1192,7 +1173,11 @@ void BgWorker1RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerC ...@@ -1192,7 +1173,11 @@ void BgWorker1RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerC
{ {
MyTask mt=tasker.getLastTask(); MyTask mt=tasker.getLastTask();
switch(mt){ switch(mt){
case MyTask.CheckUpdate:break; case MyTask.CheckUpdate:
break;
case MyTask.ExportData:
MyMsg.Show(LMSG.ExportDataOK);
break;
case MyTask.CutImages: case MyTask.CutImages:
MyMsg.Show(LMSG.CutImageOK); MyMsg.Show(LMSG.CutImageOK);
break; break;
...@@ -1443,7 +1428,43 @@ void InportImage(string file,string tid) ...@@ -1443,7 +1428,43 @@ void InportImage(string file,string tid)
else else
pl_image.BackgroundImage=m_cover; pl_image.BackgroundImage=m_cover;
} }
void Menuitem_compdbClick(object sender, EventArgs e)
{
if(!Check())
return;
DataBase.Compression(nowCdbFile);
MyMsg.Show(LMSG.CompDBOK);
}
void Menuitem_convertimageClick(object sender, EventArgs e)
{
if(!Check())
return;
if(isRun())
return;
using(FolderBrowserDialog fdlg=new FolderBrowserDialog())
{
fdlg.Description= LANG.GetMsg(LMSG.SelectImagePath);
if(fdlg.ShowDialog()==DialogResult.OK)
{
bool isreplace=MyMsg.Question(LMSG.IfReplaceExistingImage);
tasker.SetTask(MyTask.ConvertImages, null,
fdlg.SelectedPath, GAMEPATH, isreplace.ToString());
Run(LANG.GetMsg(LMSG.ConvertImage));
}
}
}
#endregion
#region 导出数据包
void Menuitem_exportdataClick(object sender, EventArgs e)
{
if(!Check())
return;
if(isRun())
return;
tasker.SetTask(MyTask.ExportData, null, nowCdbFile);
Run(LANG.GetMsg(LMSG.ExportData));
}
#endregion #endregion
} }
} }
...@@ -76,6 +76,8 @@ public enum LMSG : uint ...@@ -76,6 +76,8 @@ public enum LMSG : uint
CopyCards, CopyCards,
PasteCards, PasteCards,
ClearHistory, ClearHistory,
ExportData,
ExportDataOK,
COUNT, COUNT,
} }
} }
...@@ -28,4 +28,4 @@ ...@@ -28,4 +28,4 @@
// //
// You can specify all the values or you can use the default the Revision and // You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below: // Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("2.1.0.0")] [assembly: AssemblyVersion("2.1.0.1")]
...@@ -23,6 +23,7 @@ DataEditForm->lb5 / ...@@ -23,6 +23,7 @@ DataEditForm->lb5 /
DataEditForm->lv_cardlist0 密码 DataEditForm->lv_cardlist0 密码
DataEditForm->lv_cardlist1 卡片名称 DataEditForm->lv_cardlist1 卡片名称
DataEditForm->menu_tools 功能(&T) DataEditForm->menu_tools 功能(&T)
DataEditForm->menuitem_exportdata 导出所有卡片数据为zip
DataEditForm->menuitem_cancelTask 取消当前任务 DataEditForm->menuitem_cancelTask 取消当前任务
DataEditForm->menuitem_compdb 压缩当前数据库 DataEditForm->menuitem_compdb 压缩当前数据库
DataEditForm->menuitem_convertimage 批量导入卡图 DataEditForm->menuitem_convertimage 批量导入卡图
......
...@@ -59,4 +59,6 @@ ...@@ -59,4 +59,6 @@
0x3a 是否取消当前任务? 0x3a 是否取消当前任务?
0x3b 复制完成 0x3b 复制完成
0x3c 粘贴完成 0x3c 粘贴完成
0x3d 清空历史记录 0x3d 清空历史记录
\ No newline at end of file 0x3e 正在导出数据
0x3f 导出数据完成
\ No newline at end of file
...@@ -23,6 +23,7 @@ DataEditForm->lb5 / ...@@ -23,6 +23,7 @@ DataEditForm->lb5 /
DataEditForm->lv_cardlist0 Card Code DataEditForm->lv_cardlist0 Card Code
DataEditForm->lv_cardlist1 Card Name DataEditForm->lv_cardlist1 Card Name
DataEditForm->menu_tools Tools DataEditForm->menu_tools Tools
DataEditForm->menuitem_exportdata Export Data
DataEditForm->menuitem_cancelTask Cancel Task DataEditForm->menuitem_cancelTask Cancel Task
DataEditForm->menuitem_compdb Compression DataBase DataEditForm->menuitem_compdb Compression DataBase
DataEditForm->menuitem_convertimage Inport Images DataEditForm->menuitem_convertimage Inport Images
......
...@@ -59,4 +59,6 @@ ...@@ -59,4 +59,6 @@
0x3a Cancel Task? 0x3a Cancel Task?
0x3b Copy 0x3b Copy
0x3c Paste 0x3c Paste
0x3d Clear History 0x3d Clear History
\ No newline at end of file 0x3e Exporting Data
0x3f Export Data OK
\ No newline at end of file
[DataEditorX]2.1.0.0[DataEditorX] [DataEditorX]2.1.0.1[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。 ★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
...@@ -66,6 +66,8 @@ DataEditorX.exe.config ...@@ -66,6 +66,8 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么) 描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史 ★更新历史
2.1.0.1
添加导出zip
2.1.0.0 2.1.0.0
添加历史记录,最多32条 添加历史记录,最多32条
2.0.0.3 2.0.0.3
......
No preview for this file type
# history
F:\games\ygopro\cards.cdb
F:\games\ygocore\my.cdb
\ No newline at end of file
...@@ -23,6 +23,7 @@ DataEditForm->lb5 / ...@@ -23,6 +23,7 @@ DataEditForm->lb5 /
DataEditForm->lv_cardlist0 密码 DataEditForm->lv_cardlist0 密码
DataEditForm->lv_cardlist1 卡片名称 DataEditForm->lv_cardlist1 卡片名称
DataEditForm->menu_tools 功能(&T) DataEditForm->menu_tools 功能(&T)
DataEditForm->menuitem_exportdata 导出所有卡片数据为zip
DataEditForm->menuitem_cancelTask 取消当前任务 DataEditForm->menuitem_cancelTask 取消当前任务
DataEditForm->menuitem_compdb 压缩当前数据库 DataEditForm->menuitem_compdb 压缩当前数据库
DataEditForm->menuitem_convertimage 批量导入卡图 DataEditForm->menuitem_convertimage 批量导入卡图
......
...@@ -59,4 +59,6 @@ ...@@ -59,4 +59,6 @@
0x3a 是否取消当前任务? 0x3a 是否取消当前任务?
0x3b 复制完成 0x3b 复制完成
0x3c 粘贴完成 0x3c 粘贴完成
0x3d 清空历史记录 0x3d 清空历史记录
\ No newline at end of file 0x3e 正在导出数据
0x3f 导出数据完成
\ No newline at end of file
...@@ -23,6 +23,7 @@ DataEditForm->lb5 / ...@@ -23,6 +23,7 @@ DataEditForm->lb5 /
DataEditForm->lv_cardlist0 Card Code DataEditForm->lv_cardlist0 Card Code
DataEditForm->lv_cardlist1 Card Name DataEditForm->lv_cardlist1 Card Name
DataEditForm->menu_tools Tools DataEditForm->menu_tools Tools
DataEditForm->menuitem_exportdata Export Data
DataEditForm->menuitem_cancelTask Cancel Task DataEditForm->menuitem_cancelTask Cancel Task
DataEditForm->menuitem_compdb Compression DataBase DataEditForm->menuitem_compdb Compression DataBase
DataEditForm->menuitem_convertimage Inport Images DataEditForm->menuitem_convertimage Inport Images
......
...@@ -59,4 +59,6 @@ ...@@ -59,4 +59,6 @@
0x3a Cancel Task? 0x3a Cancel Task?
0x3b Copy 0x3b Copy
0x3c Paste 0x3c Paste
0x3d Clear History 0x3d Clear History
\ No newline at end of file 0x3e Exporting Data
0x3f Export Data OK
\ No newline at end of file
[DataEditorX]2.1.0.0[DataEditorX] [DataEditorX]2.1.0.1[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。 ★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
...@@ -66,6 +66,8 @@ DataEditorX.exe.config ...@@ -66,6 +66,8 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么) 描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史 ★更新历史
2.1.0.1
添加导出zip
2.1.0.0 2.1.0.0
添加历史记录,最多32条 添加历史记录,最多32条
2.0.0.3 2.0.0.3
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment