Commit e334cd54 authored by 247321453's avatar 247321453

add

parent a0d4736a
......@@ -99,6 +99,7 @@ private void InitializeComponent()
this.label9 = new System.Windows.Forms.Label();
this.pl_cardtype = new System.Windows.Forms.DFlowLayoutPanel();
this.pl_category = new System.Windows.Forms.DFlowLayoutPanel();
this.menuitem_copyselectto = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
......@@ -119,6 +120,7 @@ private void InitializeComponent()
this.menuitem_file.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuitem_open,
this.menuitem_new,
this.menuitem_copyselectto,
this.menuitem_copyto,
this.tsep1,
this.menuitem_readydk,
......@@ -133,7 +135,7 @@ private void InitializeComponent()
//
this.menuitem_open.Name = "menuitem_open";
this.menuitem_open.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.menuitem_open.Size = new System.Drawing.Size(165, 22);
this.menuitem_open.Size = new System.Drawing.Size(169, 22);
this.menuitem_open.Text = "打开(&O)";
this.menuitem_open.Click += new System.EventHandler(this.Menuitem_openClick);
//
......@@ -141,45 +143,45 @@ private void InitializeComponent()
//
this.menuitem_new.Name = "menuitem_new";
this.menuitem_new.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.menuitem_new.Size = new System.Drawing.Size(165, 22);
this.menuitem_new.Size = new System.Drawing.Size(169, 22);
this.menuitem_new.Text = "新建(&N)";
this.menuitem_new.Click += new System.EventHandler(this.Menuitem_newClick);
//
// menuitem_copyto
//
this.menuitem_copyto.Name = "menuitem_copyto";
this.menuitem_copyto.Size = new System.Drawing.Size(165, 22);
this.menuitem_copyto.Text = "复制到(&C)";
this.menuitem_copyto.Size = new System.Drawing.Size(169, 22);
this.menuitem_copyto.Text = "复制全部卡片到...";
this.menuitem_copyto.Click += new System.EventHandler(this.Menuitem_copytoClick);
//
// tsep1
//
this.tsep1.Name = "tsep1";
this.tsep1.Size = new System.Drawing.Size(162, 6);
this.tsep1.Size = new System.Drawing.Size(166, 6);
//
// menuitem_readydk
//
this.menuitem_readydk.Name = "menuitem_readydk";
this.menuitem_readydk.Size = new System.Drawing.Size(165, 22);
this.menuitem_readydk.Size = new System.Drawing.Size(169, 22);
this.menuitem_readydk.Text = "读取ydk(&Y)";
this.menuitem_readydk.Click += new System.EventHandler(this.Menuitem_readydkClick);
//
// menuitem_readimages
//
this.menuitem_readimages.Name = "menuitem_readimages";
this.menuitem_readimages.Size = new System.Drawing.Size(165, 22);
this.menuitem_readimages.Size = new System.Drawing.Size(169, 22);
this.menuitem_readimages.Text = "读取图片(&I)";
this.menuitem_readimages.Click += new System.EventHandler(this.Menuitem_readimagesClick);
//
// tsep3
//
this.tsep3.Name = "tsep3";
this.tsep3.Size = new System.Drawing.Size(162, 6);
this.tsep3.Size = new System.Drawing.Size(166, 6);
//
// menuitem_quit
//
this.menuitem_quit.Name = "menuitem_quit";
this.menuitem_quit.Size = new System.Drawing.Size(165, 22);
this.menuitem_quit.Size = new System.Drawing.Size(169, 22);
this.menuitem_quit.Text = "退出(&Q)";
this.menuitem_quit.Click += new System.EventHandler(this.Menuitem_quitClick);
//
......@@ -715,6 +717,13 @@ private void InitializeComponent()
this.pl_category.Size = new System.Drawing.Size(303, 166);
this.pl_category.TabIndex = 13;
//
// menuitem_copyselectto
//
this.menuitem_copyselectto.Name = "menuitem_copyselectto";
this.menuitem_copyselectto.Size = new System.Drawing.Size(169, 22);
this.menuitem_copyselectto.Text = "复制选中卡片到...";
this.menuitem_copyselectto.Click += new System.EventHandler(this.Menuitem_copyselecttoClick);
//
// DataEditForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -780,6 +789,7 @@ private void InitializeComponent()
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.ToolStripMenuItem menuitem_copyselectto;
private System.Windows.Forms.ToolStripMenuItem menuitem_github;
private System.Windows.Forms.ToolStripMenuItem menuitem_new;
private System.Windows.Forms.ToolStripMenuItem menuitem_showimage;
......
......@@ -460,7 +460,7 @@ public bool Check()
return true;
else
{
MyMsg.Warning(MyMsg.WARN_NoSelectCDB);
MyMsg.Warning(MyMsg.ERROR_NoSelectCDB);
return false;
}
}
......@@ -469,7 +469,7 @@ public bool Open(string cdbFile)
{
if(!File.Exists(cdbFile))
{
MyMsg.Error(string.Format(MyMsg.ERROR_FileNotExisit,cdbFile));
MyMsg.Error(string.Format(MyMsg.ERROR_File_NotExisit,cdbFile));
return false;
}
nowCdbFile=cdbFile;
......@@ -541,9 +541,17 @@ public bool AddCard()
MyMsg.Error(MyMsg.ERROR_CardCodeIsZero);
return false;
}
foreach(Card ckey in cardlist)
{
if(c.id==ckey.id)
{
MyMsg.Warning(string.Format(MyMsg.ERROR_Card_IsExisit,ckey.ToString()));
return false;
}
}
if(DataBase.Command(nowCdbFile, DataBase.GetInsertSQL(c,true))>=2)
{
MyMsg.Show(string.Format(MyMsg.INFO_Addition,c.ToString()));
MyMsg.Show(string.Format(MyMsg.INFO_Addition_Card,c.ToString()));
Search(srcCard, true);
return true;
}
......@@ -567,10 +575,24 @@ public bool ModCard()
MyMsg.Error(MyMsg.ERROR_CardCodeIsZero);
return false;
}
if(DataBase.Command(nowCdbFile, DataBase.GetUpdateSQL(c))>0)
string sql;
if(c.id!=oldCard.id)
{
MyMsg.Show(string.Format(MyMsg.INFO_Modifty,c.ToString()));
if(MyMsg.Question(string.Format(MyMsg.QUES_Delete_Card,oldCard.ToString())))
{
if(DataBase.Command(nowCdbFile, DataBase.GetDeleteSQL(oldCard))<2)
{
MyMsg.Error(MyMsg.ERROR_DeleteFail);
return false;
}
}
sql=DataBase.GetInsertSQL(c,false);
}
else
sql=DataBase.GetUpdateSQL(c);
if(DataBase.Command(nowCdbFile, sql)>0)
{
MyMsg.Show(string.Format(MyMsg.INFO_Modifty_Card,c.ToString()));
Search(srcCard, true);
}
else
......@@ -585,7 +607,7 @@ public bool DelCards()
int ic=lv_cardlist.SelectedItems.Count;
if(ic>=0)
return false;
if(!MyMsg.Question(string.Format(MyMsg.QUES_DeleteCard,ic)))
if(!MyMsg.Question(string.Format(MyMsg.QUES_Delete_Cards,ic)))
return false;
List<string> sql=new List<string>();
foreach(ListViewItem lvitem in lv_cardlist.SelectedItems)
......@@ -619,7 +641,7 @@ public bool OpenScript()
string lua=Path.Combine(LUAPTH,"c"+tb_cardcode.Text+".lua");
if(!File.Exists(lua))
{
if(MyMsg.Question(string.Format(MyMsg.QUES_CreateLua,lua)))
if(MyMsg.Question(string.Format(MyMsg.QUES_Create_Lua_,lua)))
{
File.Create(lua);
}
......@@ -763,8 +785,8 @@ void Menuitem_openClick(object sender, EventArgs e)
{
using(OpenFileDialog dlg=new OpenFileDialog())
{
dlg.Title="选择卡片数据库(cdb文件)";
dlg.Filter="cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*";
dlg.Title=MyMsg.STR_OpenCDB;
dlg.Filter=MyMsg.STR_CDBFilter;
if(dlg.ShowDialog()==DialogResult.OK)
{
Open(dlg.FileName);
......@@ -775,8 +797,8 @@ void Menuitem_newClick(object sender, EventArgs e)
{
using(SaveFileDialog dlg=new SaveFileDialog())
{
dlg.Title="选择卡片数据库(cdb文件)保存位置";
dlg.Filter="cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*";
dlg.Title=MyMsg.STR_SaveCDB;
dlg.Filter=MyMsg.STR_CDBFilter;
if(dlg.ShowDialog()==DialogResult.OK)
{
if(DataBase.Create(dlg.FileName))
......@@ -787,31 +809,52 @@ void Menuitem_newClick(object sender, EventArgs e)
}
}
void Menuitem_copytoClick(object sender, EventArgs e)
{
CopyTo(false);
}
void Menuitem_copyselecttoClick(object sender, EventArgs e)
{
CopyTo(true);
}
void CopyTo(bool onlyselect)
{
if(!Check())
return;
List<Card> cards=new List<Card>();
if(onlyselect)
{
foreach(ListViewItem lvitem in lv_cardlist.SelectedItems)
{
int index=lvitem.Index+(page-1)*MaxRow;
if(index<cardlist.Count)
cards.Add(cardlist[index]);
}
}
else
cards.AddRange(cardlist.ToArray());
using(OpenFileDialog dlg=new OpenFileDialog())
{
dlg.Title="选择卡片数据库(cdb文件)";
dlg.Filter="cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*";
dlg.Title=MyMsg.STR_OpenCDB;
dlg.Filter=MyMsg.STR_CDBFilter;
if(dlg.ShowDialog()==DialogResult.OK)
{
if(MyMsg.Question("是否覆盖已经存在的卡片?"))
DataBase.CopyDB(dlg.FileName,false,cardlist.ToArray());
if(MyMsg.Question(MyMsg.QUES_ReplaceCard))
DataBase.CopyDB(dlg.FileName,false,cards.ToArray());
else
DataBase.CopyDB(dlg.FileName,true,cardlist.ToArray());
DataBase.CopyDB(dlg.FileName,true,cards.ToArray());
}
}
}
}
void Menuitem_readydkClick(object sender, EventArgs e)
{
if(!Check())
return;
using(OpenFileDialog dlg=new OpenFileDialog())
{
dlg.Title="选择卡组文件(ydk文件)";
dlg.Filter="ydk文件(*.ydk)|*.ydk|所有文件(*.*)|*.*";
dlg.Title=MyMsg.STR_Openydk;
dlg.Filter=MyMsg.STR_ydkFilter;
if(dlg.ShowDialog()==DialogResult.OK)
{
SetCards(DataBase.ReadYdk(nowCdbFile, dlg.FileName), false);
......@@ -825,7 +868,7 @@ void Menuitem_readimagesClick(object sender, EventArgs e)
return;
using(FolderBrowserDialog fdlg=new FolderBrowserDialog())
{
fdlg.Description="请选择卡片图像目录";
fdlg.Description=MyMsg.STR_SelectImages;
if(fdlg.ShowDialog()==DialogResult.OK)
{
SetCards(DataBase.ReadImage(nowCdbFile, fdlg.SelectedPath), false);
......@@ -859,6 +902,5 @@ void OnimgFormClosed(object sender, EventArgs e)
}
#endregion
}
}
......@@ -102,6 +102,7 @@
<None Include="readme.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="update.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
......@@ -18,18 +18,27 @@ public static class MyMsg
public static readonly string ABOUT="程序:DataEditorX\n作者:247321453\nE-mail:247321453@qq.com\n";
public static readonly string ERROR_NoSeclectScriptText="请选中脚本文本";
public static readonly string INFO_Delete="删除成功!";
public static readonly string INFO_Modifty="修改 {0} 成功!";
public static readonly string INFO_Addition="添加 {0} 成功!";
public static readonly string INFO_Modifty_Card="修改 {0} 成功!";
public static readonly string INFO_Addition_Card="添加 {0} 成功!";
public static readonly string INFO_NoChanged="卡片没有被修改!";
public static readonly string ERROR_NoCard="没有卡片!";
public static readonly string WARN_NoSelectCDB="请打开一个数据库!";
public static readonly string ERROR_FileNotExisit="文件不存在!\n{0}";
public static readonly string ERROR_NoSelectCDB="请打开一个数据库!";
public static readonly string ERROR_Card_IsExisit="卡片已经存在!\n{0}";
public static readonly string ERROR_File_NotExisit="文件不存在!\n{0}";
public static readonly string ERROR_ModiftyFail="修改失败!";
public static readonly string ERROR_AdditionFail="修添加失败!";
public static readonly string ERROR_CardCodeIsZero="卡片密码必须大于0!";
public static readonly string ERROR_DeleteFail="删除失败!";
public static readonly string QUES_CreateLua="是否创建脚本?\n{0}";
public static readonly string QUES_DeleteCard="是否删除选择的{0}张卡?";
public static readonly string QUES_Create_Lua_="是否创建脚本?\n{0}";
public static readonly string QUES_Delete_Card="是否删除卡片?\n{0}";
public static readonly string QUES_Delete_Cards="是否删除选择的{0}张卡?";
public static readonly string QUES_ReplaceCard="是否覆盖已经存在的卡片?";
public static readonly string STR_OpenCDB="选择卡片数据库(cdb文件)";
public static readonly string STR_SaveCDB="选择卡片数据库(cdb文件)保存位置";
public static readonly string STR_Openydk="选择卡组文件(ydk文件)";
public static readonly string STR_SelectImages="请选择卡片图像目录";
public static readonly string STR_CDBFilter="cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*";
public static readonly string STR_ydkFilter="ydk文件(*.ydk)|*.ydk|所有文件(*.*)|*.*";
public static void Show(string strMsg)
{
MessageBox.Show(strMsg, "提示",
......
配置文件
DataEditorX.txt
★卡片复制:
替换复制:如果存在卡片,就用最新的替换
不替换复制:如果存在卡片,就跳过
★卡片搜索
1.不支持系列名,ATK,DEF搜索
2.支持卡片名称,描述,规则,属性,等级,种族,卡片类型,效果类型,密码
3.密码范围搜索示例:
--大于密码10000000的卡片 卡片密码: 10000000 同名卡: -1
--小于密码10000000的卡片 卡片密码: -1 同名卡: 10000000
--大于密码10000000,小于20000000的卡片 卡片密码: 10000000 同名卡: 20000000
★配置文件
1.游戏目录
2.更新网址
3.源码网址
DataEditorX.txt
F:\game\YGOPRO
http://247321453.ys168.com
https://github.com/247321453/DataEditorX
\ No newline at end of file
https://github.com/247321453/DataEditorX
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