Commit 16980159 authored by nanahira's avatar nanahira

Merge packmodule

parent 1a7034b8
......@@ -232,3 +232,5 @@ pip-log.txt
/win32/data/history.txt
/win32/*.mse-set
/win32/set
/temp
\ No newline at end of file
......@@ -334,7 +334,7 @@ public Card[] ReadMSE(string mseset, bool repalceOld)
#endregion
#region 导出数据
public void ExportData(string path, string zipname, string _cdbfile)
public void ExportData(string path, string zipname, string _cdbfile, string modulescript)
{
int i = 0;
Card[] cards = cardlist;
......@@ -349,11 +349,15 @@ public void ExportData(string path, string zipname, string _cdbfile)
string readme = MyPath.Combine(path, name + ".txt");
//新卡ydk
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);
DataBase.Create(cdbfile);
DataBase.CopyDB(cdbfile, false, cardlist);
if (File.Exists(zipname))
File.Delete(zipname);
using (ZipStorer zips = ZipStorer.Create(zipname, ""))
......@@ -363,6 +367,8 @@ public void ExportData(string path, string zipname, string _cdbfile)
zips.AddFile(readme, "readme_" + name + ".txt", "");
if (File.Exists(deckydk))
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)
{
i++;
......@@ -370,9 +376,9 @@ public void ExportData(string path, string zipname, string _cdbfile)
string[] files = ygopath.GetCardfiles(c.id);
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()
switch (nowTask)
{
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;
case MyTask.CheckUpdate:
......
......@@ -1382,7 +1382,8 @@ void Menuitem_exportdataClick(object sender, EventArgs e)
GetCardList(false),
ygopath.gamepath,
dlg.FileName,
GetOpenFile());
GetOpenFile(),
addrequire);
Run(LanguageHelper.GetMsg(LMSG.ExportData));
}
}
......@@ -1628,7 +1629,7 @@ private void menuitem_autocheckupdate_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);
menuitem_addrequire.Checked = (addrequire.Length>0);
menuitem_addrequire.Checked = (addrequire.Length > 0);
MyConfig.Save(MyConfig.TAG_ADD_REQUIRE, addrequire);
}
#endregion
......
......@@ -19,9 +19,9 @@
<!-- async load data -->
<add key="async" value="false" />
<!-- DataEditorX source code -->
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<add key="sourceURL" value="https://github.com/purerosefallen/DataEditorX" />
<!-- 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 -->
<add key="opera_with_cards_file" value="true" />
<!-- open file in this.such as lua -->
......
[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)
本程序基于.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
Click file with right mouse button, Open with, Browse Files, Choose confirm(Yes)
★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
Text:
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