Commit 16980159 authored by nanahira's avatar nanahira

Merge packmodule

parent 1a7034b8
...@@ -232,3 +232,5 @@ pip-log.txt ...@@ -232,3 +232,5 @@ pip-log.txt
/win32/data/history.txt /win32/data/history.txt
/win32/*.mse-set /win32/*.mse-set
/win32/set /win32/set
/temp
\ No newline at end of file
...@@ -334,7 +334,7 @@ public Card[] ReadMSE(string mseset, bool repalceOld) ...@@ -334,7 +334,7 @@ public Card[] ReadMSE(string mseset, bool repalceOld)
#endregion #endregion
#region 导出数据 #region 导出数据
public void ExportData(string path, string zipname, string _cdbfile) public void ExportData(string path, string zipname, string _cdbfile, string modulescript)
{ {
int i = 0; int i = 0;
Card[] cards = cardlist; Card[] cards = cardlist;
...@@ -349,11 +349,15 @@ public void ExportData(string path, string zipname, string _cdbfile) ...@@ -349,11 +349,15 @@ public void ExportData(string path, string zipname, string _cdbfile)
string readme = MyPath.Combine(path, name + ".txt"); string readme = MyPath.Combine(path, name + ".txt");
//新卡ydk //新卡ydk
string deckydk = ygopath.GetYdk(name); string deckydk = ygopath.GetYdk(name);
//module scripts
string script_path = MyPath.Combine(path, "script");
string extra_script = "";
if (modulescript.Length > 0)
extra_script = MyPath.Combine(script_path, modulescript + ".lua");
File.Delete(cdbfile); File.Delete(cdbfile);
DataBase.Create(cdbfile); DataBase.Create(cdbfile);
DataBase.CopyDB(cdbfile, false, cardlist); DataBase.CopyDB(cdbfile, false, cardlist);
if (File.Exists(zipname)) if (File.Exists(zipname))
File.Delete(zipname); File.Delete(zipname);
using (ZipStorer zips = ZipStorer.Create(zipname, "")) using (ZipStorer zips = ZipStorer.Create(zipname, ""))
...@@ -363,6 +367,8 @@ public void ExportData(string path, string zipname, string _cdbfile) ...@@ -363,6 +367,8 @@ public void ExportData(string path, string zipname, string _cdbfile)
zips.AddFile(readme, "readme_" + name + ".txt", ""); zips.AddFile(readme, "readme_" + name + ".txt", "");
if (File.Exists(deckydk)) if (File.Exists(deckydk))
zips.AddFile(deckydk, "deck/" + name + ".ydk", ""); zips.AddFile(deckydk, "deck/" + name + ".ydk", "");
if (modulescript.Length > 0 && File.Exists(extra_script))
zips.AddFile(extra_script, extra_script.Replace(path, ""), "");
foreach (Card c in cards) foreach (Card c in cards)
{ {
i++; i++;
...@@ -370,9 +376,9 @@ public void ExportData(string path, string zipname, string _cdbfile) ...@@ -370,9 +376,9 @@ public void ExportData(string path, string zipname, string _cdbfile)
string[] files = ygopath.GetCardfiles(c.id); string[] files = ygopath.GetCardfiles(c.id);
foreach (string file in files) foreach (string file in files)
{ {
if (File.Exists(file)) if (!String.Equals(file, extra_script) && File.Exists(file))
{ {
zips.AddFile(file, file.Replace(path,""),""); zips.AddFile(file, file.Replace(path,""), "");
} }
} }
} }
...@@ -391,9 +397,9 @@ public void Run() ...@@ -391,9 +397,9 @@ public void Run()
switch (nowTask) switch (nowTask)
{ {
case MyTask.ExportData: case MyTask.ExportData:
if (mArgs != null && mArgs.Length >= 2) if (mArgs != null && mArgs.Length >= 3)
{ {
ExportData(mArgs[0], mArgs[1], mArgs[2]); ExportData(mArgs[0], mArgs[1], mArgs[2], mArgs[3]);
} }
break; break;
case MyTask.CheckUpdate: case MyTask.CheckUpdate:
......
...@@ -1382,7 +1382,8 @@ void Menuitem_exportdataClick(object sender, EventArgs e) ...@@ -1382,7 +1382,8 @@ void Menuitem_exportdataClick(object sender, EventArgs e)
GetCardList(false), GetCardList(false),
ygopath.gamepath, ygopath.gamepath,
dlg.FileName, dlg.FileName,
GetOpenFile()); GetOpenFile(),
addrequire);
Run(LanguageHelper.GetMsg(LMSG.ExportData)); Run(LanguageHelper.GetMsg(LMSG.ExportData));
} }
} }
...@@ -1628,7 +1629,7 @@ private void menuitem_autocheckupdate_Click(object sender, EventArgs e) ...@@ -1628,7 +1629,7 @@ private void menuitem_autocheckupdate_Click(object sender, EventArgs e)
private void menuitem_addrequire_Click(object sender, EventArgs e) private void menuitem_addrequire_Click(object sender, EventArgs e)
{ {
addrequire = Microsoft.VisualBasic.Interaction.InputBox("Module script?\n\nPress \"Cancel\" to remove module script.", "", addrequire); addrequire = Microsoft.VisualBasic.Interaction.InputBox("Module script?\n\nPress \"Cancel\" to remove module script.", "", addrequire);
menuitem_addrequire.Checked = (addrequire.Length>0); menuitem_addrequire.Checked = (addrequire.Length > 0);
MyConfig.Save(MyConfig.TAG_ADD_REQUIRE, addrequire); MyConfig.Save(MyConfig.TAG_ADD_REQUIRE, addrequire);
} }
#endregion #endregion
......
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
<!-- async load data --> <!-- async load data -->
<add key="async" value="false" /> <add key="async" value="false" />
<!-- DataEditorX source code --> <!-- DataEditorX source code -->
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" /> <add key="sourceURL" value="https://github.com/purerosefallen/DataEditorX" />
<!-- DataEditorX update url--> <!-- DataEditorX update url-->
<add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" /> <add key="updateURL" value="https://github.com/purerosefallen/DataEditorX/tree/master/win32/readme.txt" />
<!-- delete,modify with card's files image script --> <!-- delete,modify with card's files image script -->
<add key="opera_with_cards_file" value="true" /> <add key="opera_with_cards_file" value="true" />
<!-- open file in this.such as lua --> <!-- open file in this.such as lua -->
......
[DataEditorX]2.4.3.1[DataEditorX] [DataEditorX]2.4.3.1[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/purerosefallen/DataEditorX/raw/master/win32/win32.zip[URL]
★运行环境(Environment) ★运行环境(Environment)
本程序基于.Net framework 2.0(3.5)开发 本程序基于.Net framework 2.0(3.5)开发
......
...@@ -9,7 +9,7 @@ This program based on .Net2.0/winXP(need .Net2.0)/win7(with.Net2.0)/win8(need.Ne ...@@ -9,7 +9,7 @@ This program based on .Net2.0/winXP(need .Net2.0)/win7(with.Net2.0)/win8(need.Ne
Click file with right mouse button, Open with, Browse Files, Choose confirm(Yes) Click file with right mouse button, Open with, Browse Files, Choose confirm(Yes)
★Feedback ★Feedback
If you has problems, please report on https://github.com/247321453/DataEditorX/issues If you has problems, please report on https://github.com/purerosefallen/DataEditorX/issues
Title:DataEditorX X.X.X.X Title:DataEditorX X.X.X.X
Text: Text:
The error message text: If there is a error message box, please press Ctrl+C, then paste in someplace. The error message text: If there is a error message box, please press Ctrl+C, then paste in someplace.
......
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