Commit bff8c83d authored by keyongyu's avatar keyongyu

2.1.1.0

parent dbde4503
......@@ -88,12 +88,7 @@ public override string ToString()
{
return string.Format("{0} [{1}]", id.ToString("00000000"), name);
}
/// <summary>
/// 比较卡片是否一致?
/// </summary>
/// <param name="other">比较的卡片</param>
/// <returns>结果</returns>
public bool Equals(Card other)
public bool EqualsData(Card other)
{
bool equalBool = true;
if (this.id != other.id)
......@@ -118,6 +113,18 @@ public bool Equals(Card other)
equalBool = false;
else if (this.category != other.category)
equalBool = false;
return equalBool;
}
/// <summary>
/// 比较卡片是否一致?
/// </summary>
/// <param name="other">比较的卡片</param>
/// <returns>结果</returns>
public bool Equals(Card other)
{
bool equalBool=EqualsData(other);
if(!equalBool)
return false;
else if (!this.name.Equals(other.name))
equalBool = false;
else if (!this.desc.Equals(other.desc))
......@@ -155,15 +162,6 @@ public override int GetHashCode()
{
return left.Equals(right);
}
/// <summary>
/// 卡片是否不相等
/// </summary>
public static bool operator !=(Card left, Card right)
{
return !left.Equals(right);
}
#endregion
public bool IsType(CardType type){
if((this.type & (long)type) == (long)type)
return true;
......@@ -180,9 +178,19 @@ public bool IsSetCode(long sc)
return true;
else if(((this.setcode>>0x30)&0xffff)==sc)
return true;
else
else
return false;
}
/// <summary>
/// 卡片是否不相等
/// </summary>
public static bool operator !=(Card left, Card right)
{
return !left.Equals(right);
}
#endregion
}
}
......@@ -33,6 +33,7 @@ public partial class DataEditForm : DockContent
/// <summary>搜索条件</summary>
Card srcCard=new Card(0);
string[] strs=null;
Dictionary<long,Card> complist;
string title;
string nowCdbFile="";
int MaxRow=20;
......@@ -85,6 +86,7 @@ public DataEditForm()
}
void Initialize()
{
complist=new Dictionary<long, Card>();
InitializeComponent();
title=this.Text;
nowCdbFile="";
......@@ -642,6 +644,7 @@ public bool Open(string cdbFile)
}
ydkfile=null;
imagepath=null;
complist=null;
SetCDB(cdbFile);
cardlist.Clear();
DataBase.CheckTable(cdbFile);
......@@ -696,6 +699,10 @@ public void Search(Card c, bool isfresh)
SetCards(DataBase.ReadYdk(nowCdbFile, ydkfile), false);
else if(!string.IsNullOrEmpty(imagepath))
SetCards(DataBase.ReadImage(nowCdbFile, imagepath), false);
else if(complist !=null){
UpdateCompCards();
SetCards(getCompCards(), false);
}
else{
srcCard=c;
string sql=DataBase.GetSelectSQL(c);
......@@ -706,6 +713,21 @@ public void Search(Card c, bool isfresh)
}
}
void UpdateCompCards()
{
Card[] mcards=DataBase.Read(nowCdbFile,true,"");
if(mcards==null){
complist.Clear();
return;
}
foreach(Card c in mcards)
{
if(complist.ContainsKey(c.id))
complist[c.id]=c;
}
}
public void Reset()
{
oldCard=new Card(0);
......@@ -874,6 +896,7 @@ void Btn_serachClick(object sender, EventArgs e)
{
ydkfile=null;
imagepath=null;
complist=null;
Search(GetCard(), false);
}
//重置卡片
......@@ -935,6 +958,7 @@ void Tb_cardcodeKeyPress(object sender, KeyPressEventArgs e)
{
ydkfile=null;
imagepath=null;
complist=null;
Search(c, false);
}
}
......@@ -949,6 +973,7 @@ void Tb_cardnameKeyDown(object sender, KeyEventArgs e)
if(c.name.Length>0){
ydkfile=null;
imagepath=null;
complist=null;
Search(c, false);
}
}
......@@ -1466,5 +1491,60 @@ void Menuitem_exportdataClick(object sender, EventArgs e)
Run(LANG.GetMsg(LMSG.ExportData));
}
#endregion
#region 对比数据
/// <summary>
/// 数据一致,返回true,不存在和数据不同,则返回false
/// </summary>
/// <param name="cards"></param>
/// <param name="card"></param>
/// <returns></returns>
bool CheckCard(Card[] cards,Card card,bool checktext)
{
foreach(Card c in cards)
{
if(c.id!=card.id)
continue;
//data数据不一样
bool isSame=false;
if(checktext)
isSame=card.Equals(c);
else
isSame=card.EqualsData(c);
if(isSame)
return true;
}
return false;
}
Card[] getCompCards()
{
if(complist.Count==0)
return null;
Card[] tmps=new Card[complist.Count];
complist.Values.CopyTo(tmps,0);
return tmps;
}
public void CompareCards(string cdbfile,bool checktext)
{
if(!Check())
return;
ydkfile=null;
imagepath=null;
srcCard=new Card();
Card[] mcards=DataBase.Read(nowCdbFile,true,"");
Card[] cards=DataBase.Read(cdbfile,true,"");
complist =new Dictionary<long, Card>();
foreach(Card card in mcards)
{
if(!CheckCard(cards, card, checktext))
complist.Add(card.id, card);
}
if(complist.Count==0){
SetCards(null, false);
return;
}
SetCards(getCompCards(), false);
}
#endregion
}
}
......@@ -78,6 +78,8 @@ public enum LMSG : uint
ClearHistory,
ExportData,
ExportDataOK,
CheckText,
CompareOK,
COUNT,
}
}
......@@ -59,14 +59,17 @@ private void InitializeComponent()
this.menuitem_copyselect = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_pastecards = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_comp1 = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_comp2 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_quit = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_history = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_windows = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_dataeditor = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_close = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_closeother = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_closeall = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_history = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
......@@ -147,6 +150,9 @@ private void InitializeComponent()
this.menuitem_copyselect,
this.menuitem_pastecards,
this.toolStripSeparator4,
this.menuitem_comp1,
this.menuitem_comp2,
this.toolStripSeparator1,
this.menuitem_quit});
this.menuitem_file.Name = "menuitem_file";
this.menuitem_file.Size = new System.Drawing.Size(53, 21);
......@@ -196,6 +202,26 @@ private void InitializeComponent()
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(258, 6);
//
// menuitem_comp1
//
this.menuitem_comp1.Name = "menuitem_comp1";
this.menuitem_comp1.Size = new System.Drawing.Size(261, 22);
this.menuitem_comp1.Text = "Compare DB 1";
this.menuitem_comp1.Click += new System.EventHandler(this.Menuitem_comp1Click);
//
// menuitem_comp2
//
this.menuitem_comp2.Enabled = false;
this.menuitem_comp2.Name = "menuitem_comp2";
this.menuitem_comp2.Size = new System.Drawing.Size(261, 22);
this.menuitem_comp2.Text = "Compare DB 2";
this.menuitem_comp2.Click += new System.EventHandler(this.Menuitem_comp2Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(258, 6);
//
// menuitem_quit
//
this.menuitem_quit.Name = "menuitem_quit";
......@@ -203,6 +229,12 @@ private void InitializeComponent()
this.menuitem_quit.Text = "Quit";
this.menuitem_quit.Click += new System.EventHandler(this.QuitToolStripMenuItemClick);
//
// menuitem_history
//
this.menuitem_history.Name = "menuitem_history";
this.menuitem_history.Size = new System.Drawing.Size(78, 21);
this.menuitem_history.Text = "History(&H)";
//
// menuitem_windows
//
this.menuitem_windows.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
......@@ -218,42 +250,36 @@ private void InitializeComponent()
// menuitem_dataeditor
//
this.menuitem_dataeditor.Name = "menuitem_dataeditor";
this.menuitem_dataeditor.Size = new System.Drawing.Size(152, 22);
this.menuitem_dataeditor.Size = new System.Drawing.Size(145, 22);
this.menuitem_dataeditor.Text = "DataEditor";
this.menuitem_dataeditor.Click += new System.EventHandler(this.DataEditorToolStripMenuItemClick);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(142, 6);
//
// menuitem_close
//
this.menuitem_close.Name = "menuitem_close";
this.menuitem_close.Size = new System.Drawing.Size(152, 22);
this.menuitem_close.Size = new System.Drawing.Size(145, 22);
this.menuitem_close.Text = "Close";
this.menuitem_close.Click += new System.EventHandler(this.CloseToolStripMenuItemClick);
//
// menuitem_closeother
//
this.menuitem_closeother.Name = "menuitem_closeother";
this.menuitem_closeother.Size = new System.Drawing.Size(152, 22);
this.menuitem_closeother.Size = new System.Drawing.Size(145, 22);
this.menuitem_closeother.Text = "Close Other";
this.menuitem_closeother.Click += new System.EventHandler(this.CloseOtherToolStripMenuItemClick);
//
// menuitem_closeall
//
this.menuitem_closeall.Name = "menuitem_closeall";
this.menuitem_closeall.Size = new System.Drawing.Size(152, 22);
this.menuitem_closeall.Size = new System.Drawing.Size(145, 22);
this.menuitem_closeall.Text = "Close All";
this.menuitem_closeall.Click += new System.EventHandler(this.CloseAllToolStripMenuItemClick);
//
// menuitem_history
//
this.menuitem_history.Name = "menuitem_history";
this.menuitem_history.Size = new System.Drawing.Size(78, 21);
this.menuitem_history.Text = "History(&H)";
//
// MainForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -273,6 +299,9 @@ private void InitializeComponent()
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem menuitem_comp2;
private System.Windows.Forms.ToolStripMenuItem menuitem_comp1;
private System.Windows.Forms.ToolStripMenuItem menuitem_pastecards;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
......
......@@ -23,6 +23,7 @@ namespace DataEditorX
/// </summary>
public partial class MainForm : Form
{
#region member
public const int CLOSE_ONE=1;
public const int CLOSE_OTHER=2;
public const int CLOSE_ALL=3;
......@@ -33,8 +34,10 @@ public partial class MainForm : Form
List<string> cdblist;
string datapath;
string conflang,conflang_de,confmsg;
DataEditForm compare1,compare2;
Card[] tCards;
Dictionary<DataEditForm,string> list;
#endregion
#region init
public MainForm(string datapath, string file)
......@@ -63,6 +66,7 @@ void Init(string datapath)
LANG.SetLanguage(this);
}
#endregion
#region History
void ReadHistory()
{
......@@ -357,5 +361,42 @@ void Menuitem_pastecardsClick(object sender, EventArgs e)
}
#endregion
void Menuitem_comp1Click(object sender, EventArgs e)
{
compare1 = GetActive();
if(compare1 != null && !string.IsNullOrEmpty(compare1.getNowCDB()))
{
menuitem_comp2.Enabled=true;
CompareDB();
}
}
void CompareDB()
{
if(compare1 == null || compare2 == null)
return;
string cdb1=compare1.getNowCDB();
string cdb2=compare2.getNowCDB();
if(string.IsNullOrEmpty(cdb1)
|| string.IsNullOrEmpty(cdb2)
||cdb1==cdb2)
return;
bool checktext=MyMsg.Question(LMSG.CheckText);
compare1.CompareCards(cdb2, checktext);
compare2.CompareCards(cdb1, checktext);
MyMsg.Show(LMSG.CompareOK);
menuitem_comp2.Enabled=false;
compare1=null;
compare2=null;
}
void Menuitem_comp2Click(object sender, EventArgs e)
{
compare2 = GetActive();
if(compare2 != null && !string.IsNullOrEmpty(compare2.getNowCDB()))
{
CompareDB();
}
}
}
}
......@@ -28,4 +28,4 @@
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("2.1.0.1")]
[assembly: AssemblyVersion("2.1.1.0")]
......@@ -3,6 +3,8 @@ MainForm->menuitem_new 新建(&N)
MainForm->menuitem_open 打开(&O)
MainForm->menuitem_copyselect 复制所选卡片
MainForm->menuitem_pastecards 粘贴卡片
MainForm->menuitem_comp1 对比-卡片数据 1
MainForm->menuitem_comp2 对比-卡片数据 2
MainForm->menuitem_history 历史(&H)
MainForm->menuitem_quit 退出(&Q)
MainForm->menuitem_windows 窗口(&W)
......
......@@ -61,4 +61,6 @@
0x3c 粘贴完成
0x3d 清空历史记录
0x3e 正在导出数据
0x3f 导出数据完成
\ No newline at end of file
0x3f 导出数据完成
0x40 是否对比卡片文字信息?
0x41 对比完成
\ No newline at end of file
......@@ -3,6 +3,8 @@ MainForm->menuitem_new New DataBase
MainForm->menuitem_open Open DataBase
MainForm->menuitem_copyselect Copy Select
MainForm->menuitem_pastecards Paste Cards
MainForm->menuitem_comp1 Compare-Cards 1
MainForm->menuitem_comp2 Compare-Cards 2
MainForm->menuitem_history History(&H)
MainForm->menuitem_quit Quit(&Q)
MainForm->menuitem_windows Windwos(&W)
......
......@@ -61,4 +61,6 @@
0x3c Paste
0x3d Clear History
0x3e Exporting Data
0x3f Export Data OK
\ No newline at end of file
0x3f Export Data OK
0x40 Compare Cards With Text?
0x41 Cards is Compared.
\ No newline at end of file
[DataEditorX]2.1.0.1[DataEditorX]
[DataEditorX]2.1.1.0[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
......@@ -66,6 +66,9 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史
2.1.1.0
增加数据库对比
待测试 数据库对比后的操作:按ydk读取,按图像读取,搜索按钮,卡名搜索。
2.1.0.1
添加导出zip
2.1.0.0
......
No preview for this file type
# history
F:\games\ygopro\cards.cdb
F:\games\ygocore\my.cdb
\ No newline at end of file
F:\games\ygocore\my.cdb
F:\games\ygocore\cards.cdb
F:\games\ygopro\cards.cdb
\ No newline at end of file
......@@ -3,6 +3,8 @@ MainForm->menuitem_new 新建(&N)
MainForm->menuitem_open 打开(&O)
MainForm->menuitem_copyselect 复制所选卡片
MainForm->menuitem_pastecards 粘贴卡片
MainForm->menuitem_comp1 对比-卡片数据 1
MainForm->menuitem_comp2 对比-卡片数据 2
MainForm->menuitem_history 历史(&H)
MainForm->menuitem_quit 退出(&Q)
MainForm->menuitem_windows 窗口(&W)
......
......@@ -61,4 +61,6 @@
0x3c 粘贴完成
0x3d 清空历史记录
0x3e 正在导出数据
0x3f 导出数据完成
\ No newline at end of file
0x3f 导出数据完成
0x40 是否对比卡片文字信息?
0x41 对比完成
\ No newline at end of file
......@@ -3,6 +3,8 @@ MainForm->menuitem_new New DataBase
MainForm->menuitem_open Open DataBase
MainForm->menuitem_copyselect Copy Select
MainForm->menuitem_pastecards Paste Cards
MainForm->menuitem_comp1 Compare-Cards 1
MainForm->menuitem_comp2 Compare-Cards 2
MainForm->menuitem_history History(&H)
MainForm->menuitem_quit Quit(&Q)
MainForm->menuitem_windows Windwos(&W)
......
......@@ -61,4 +61,6 @@
0x3c Paste
0x3d Clear History
0x3e Exporting Data
0x3f Export Data OK
\ No newline at end of file
0x3f Export Data OK
0x40 Compare Cards With Text?
0x41 Cards is Compared.
\ No newline at end of file
[DataEditorX]2.1.0.1[DataEditorX]
[DataEditorX]2.1.1.0[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
......@@ -66,6 +66,10 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史
2.1.1.0
MSE自动更新下载速度,特别是最后几个。
增加数据库对比
待测试 数据库对比后的操作:按ydk读取,按图像读取,搜索按钮,卡名搜索。
2.1.0.1
添加导出zip
2.1.0.0
......
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