Commit 6c5a754b authored by JoyJ's avatar JoyJ

version 4.0.0.6:merge database; setcode search

parent 93d62eb4
Pipeline #23368 passed with stages
in 42 seconds
......@@ -68,6 +68,7 @@ private void InitializeComponent()
this.menuitem_export_select_sql = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_export_all_sql = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_findluafunc = new System.Windows.Forms.ToolStripMenuItem();
this.menuMergeDatabase = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_exportdata = new System.Windows.Forms.ToolStripMenuItem();
this.tsep5 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_cutimages = new System.Windows.Forms.ToolStripMenuItem();
......@@ -113,7 +114,7 @@ private void InitializeComponent()
this.btn_del = new System.Windows.Forms.Button();
this.btn_lua = new System.Windows.Forms.Button();
this.btn_reset = new System.Windows.Forms.Button();
this.btn_serach = new System.Windows.Forms.Button();
this.btn_search = new System.Windows.Forms.Button();
this.lb_categorys = new System.Windows.Forms.Label();
this.lb2 = new System.Windows.Forms.Label();
this.pl_image = new System.Windows.Forms.Panel();
......@@ -318,6 +319,7 @@ private void InitializeComponent()
this.menuitem_export_select_sql,
this.menuitem_export_all_sql,
this.menuitem_findluafunc,
this.menuMergeDatabase,
this.menuitem_exportdata,
this.tsep5,
this.menuitem_cutimages,
......@@ -403,6 +405,13 @@ private void InitializeComponent()
this.menuitem_findluafunc.Text = "Find Lua Function";
this.menuitem_findluafunc.Click += new System.EventHandler(this.menuitem_findluafunc_Click);
//
// menuMergeDatabase
//
this.menuMergeDatabase.Name = "menuMergeDatabase";
this.menuMergeDatabase.Size = new System.Drawing.Size(238, 22);
this.menuMergeDatabase.Text = "Merge Database...";
this.menuMergeDatabase.Click += new System.EventHandler(this.menuMergeDatabase_Click);
//
// menuitem_exportdata
//
this.menuitem_exportdata.Name = "menuitem_exportdata";
......@@ -876,16 +885,16 @@ private void InitializeComponent()
this.btn_reset.UseVisualStyleBackColor = true;
this.btn_reset.Click += new System.EventHandler(this.Btn_resetClick);
//
// btn_serach
// btn_search
//
this.btn_serach.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btn_serach.Location = new System.Drawing.Point(340, 3);
this.btn_serach.Name = "btn_serach";
this.btn_serach.Size = new System.Drawing.Size(80, 28);
this.btn_serach.TabIndex = 0;
this.btn_serach.Text = "&Search";
this.btn_serach.UseVisualStyleBackColor = true;
this.btn_serach.Click += new System.EventHandler(this.Btn_serachClick);
this.btn_search.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btn_search.Location = new System.Drawing.Point(340, 3);
this.btn_search.Name = "btn_search";
this.btn_search.Size = new System.Drawing.Size(80, 28);
this.btn_search.TabIndex = 0;
this.btn_search.Text = "&Search";
this.btn_search.UseVisualStyleBackColor = true;
this.btn_search.Click += new System.EventHandler(this.Btn_searchClick);
//
// lb_categorys
//
......@@ -991,6 +1000,8 @@ private void InitializeComponent()
this.tb_setcode1.Text = "0";
this.tb_setcode1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.tb_setcode1.TextChanged += new System.EventHandler(this.tb_setcode1_TextChanged);
this.tb_setcode1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_setcode1_KeyDown);
this.tb_setcode1.Leave += new System.EventHandler(this.tb_setcode1_Leave);
//
// tb_setcode2
//
......@@ -1003,6 +1014,8 @@ private void InitializeComponent()
this.tb_setcode2.Text = "0";
this.tb_setcode2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.tb_setcode2.TextChanged += new System.EventHandler(this.tb_setcode2_TextChanged);
this.tb_setcode2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_setcode2_KeyDown);
this.tb_setcode2.Leave += new System.EventHandler(this.tb_setcode2_Leave);
//
// tb_setcode3
//
......@@ -1015,6 +1028,8 @@ private void InitializeComponent()
this.tb_setcode3.Text = "0";
this.tb_setcode3.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.tb_setcode3.TextChanged += new System.EventHandler(this.tb_setcode3_TextChanged);
this.tb_setcode3.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_setcode3_KeyDown);
this.tb_setcode3.Leave += new System.EventHandler(this.tb_setcode3_Leave);
//
// tb_setcode4
//
......@@ -1027,6 +1042,8 @@ private void InitializeComponent()
this.tb_setcode4.Text = "0";
this.tb_setcode4.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.tb_setcode4.TextChanged += new System.EventHandler(this.tb_setcode4_TextChanged);
this.tb_setcode4.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_setcode4_KeyDown);
this.tb_setcode4.Leave += new System.EventHandler(this.tb_setcode4_Leave);
//
// lb_cardcode
//
......@@ -1072,7 +1089,7 @@ private void InitializeComponent()
this.pl_bottom.Controls.Add(this.tb_page);
this.pl_bottom.Controls.Add(this.tb_pagenum);
this.pl_bottom.Controls.Add(this.btn_lua);
this.pl_bottom.Controls.Add(this.btn_serach);
this.pl_bottom.Controls.Add(this.btn_search);
this.pl_bottom.Controls.Add(this.btn_img);
this.pl_bottom.Controls.Add(this.btn_reset);
this.pl_bottom.Controls.Add(this.btn_del);
......@@ -1303,7 +1320,7 @@ private void InitializeComponent()
private System.Windows.Forms.Label lb_types;
private DFlowLayoutPanel pl_category;
private DFlowLayoutPanel pl_cardtype;
private System.Windows.Forms.Button btn_serach;
private System.Windows.Forms.Button btn_search;
private System.Windows.Forms.Button btn_reset;
private System.Windows.Forms.Button btn_lua;
private System.Windows.Forms.Button btn_del;
......@@ -1376,5 +1393,6 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem menuitem_addrequire;
private System.Windows.Forms.SplitContainer splitContainer;
private DFlowLayoutPanel pl_markers;
private System.Windows.Forms.ToolStripMenuItem menuMergeDatabase;
}
}
......@@ -10,13 +10,16 @@
using DataEditorX.Core;
using DataEditorX.Core.Mse;
using DataEditorX.Language;
using Neo.IronLua;
using System;
using System.Collections.Generic;
using System.Data.SQLite;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using static DataEditorX.ResetForm;
namespace DataEditorX
{
......@@ -919,7 +922,7 @@ public void Reset()
#region 按钮
//搜索卡片
void Btn_serachClick(object sender, EventArgs e)
void Btn_searchClick(object sender, EventArgs e)
{
this.tmpCodes.Clear();//清空临时的结果
this.Search(this.GetCard(), false);
......@@ -2267,6 +2270,162 @@ private void OnDragEnter(object sender, DragEventArgs e)
e.Effect = DragDropEffects.All;
}
private void tb_setcode1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SearchSetCode(tb_setcode1, cb_setname1);
}
}
private void tb_setcode2_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SearchSetCode(tb_setcode2, cb_setname2);
}
}
private void tb_setcode3_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SearchSetCode(tb_setcode3, cb_setname3);
}
}
private void tb_setcode4_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SearchSetCode(tb_setcode4, cb_setname4);
}
}
private void tb_setcode1_Leave(object sender, EventArgs e)
{
CheckSetCode(tb_setcode1,cb_setname1);
}
private void tb_setcode2_Leave(object sender, EventArgs e)
{
CheckSetCode(tb_setcode2, cb_setname2);
}
private void CheckSetCode(TextBox tb, ComboBox cb)
{
if (tb.Text.ToLower().StartsWith("0x") || tb.Text.Length > 5)
{
SearchSetCode(tb, cb);
return;
}
string numbers = "1234567890abcdef";
for(int i = 0; i < tb.Text.Length; i++)
{
if (!numbers.Contains(tb.Text[i].ToString()))
{
SearchSetCode(tb, cb);
return;
}
}
}
private void SearchSetCode(TextBox tb, ComboBox cb)
{
for (int i = 0; i < cb.Items.Count; i++)
{
if (cb.Items[i].ToString().ToLower() == tb.Text.ToLower())
{
cb.SelectedIndex = i;
return;
}
}
for (int i = 0; i < cb.Items.Count; i++)
{
if (cb.Items[i].ToString().ToLower().Contains(tb.Text.ToLower()))
{
cb.SelectedIndex = i;
return;
}
}
tb.Text = "0";
}
private void tb_setcode3_Leave(object sender, EventArgs e)
{
CheckSetCode(tb_setcode3, cb_setname3);
}
private void tb_setcode4_Leave(object sender, EventArgs e)
{
CheckSetCode(tb_setcode4, cb_setname4);
}
private void menuMergeDatabase_Click(object sender, EventArgs e)
{
if (!this.CheckOpen())
{
return;
}
List<Card> cards = new List<Card>();
using (OpenFileDialog dlg = new OpenFileDialog())
{
dlg.Title = LanguageHelper.GetMsg(LMSG.SelectDataBasePath);
try
{
dlg.Filter = LanguageHelper.GetMsg(LMSG.CdbType);
dlg.Multiselect = true;
}
catch { }
if (dlg.ShowDialog() == DialogResult.OK)
{
bool replace = MessageBox.Show(LanguageHelper.GetMsg(LMSG.MergeHint), LanguageHelper.GetMsg(LMSG.titleInfo),MessageBoxButtons.YesNo) == DialogResult.Yes;
if (File.Exists(this.nowCdbFile))
{
using (SQLiteConnection mainConnection = new SQLiteConnection(@"Data Source=" + nowCdbFile))
{
mainConnection.Open();
using (SQLiteTransaction trans = mainConnection.BeginTransaction())
{
using (SQLiteCommand cmd = new SQLiteCommand(mainConnection))
{
foreach (string file in dlg.FileNames)
{
//读取失败就跳过
try
{
var dbCards = DataBase.Read(file, true, "");
//单张读取,失败就跳过
foreach (var dbCard in dbCards)
{
try
{
cards.Add(dbCard);
}
catch { }
}
}
catch { }
}
foreach(Card card in cards)
{
cmd.CommandText = DataBase.GetInsertSQL(card, !replace);
cmd.ExecuteNonQuery();
}
}
trans.Commit();
}
mainConnection.Close();
}
}
MessageBox.Show(string.Format(LanguageHelper.GetMsg(LMSG.MergeComplete), cards.Count), LanguageHelper.GetMsg(LMSG.About));
Btn_resetClick(null, null);
Btn_searchClick(null, null);
}
}
}
void Tb_linkKeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar != '0' && e.KeyChar != '1' && e.KeyChar != 1 && e.KeyChar != 22 && e.KeyChar != 3 && e.KeyChar != 8)
......
......@@ -124,6 +124,6 @@
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
<value>38</value>
</metadata>
</root>
\ No newline at end of file
......@@ -97,6 +97,9 @@ public enum LMSG : uint
IfOpenLotsOfFile = 0x4d,
UndoConfirm = 0x4e,
InvalidFileName = 0x4f,
CdbTypeOnly = 0x50,
MergeHint = 0x51,
MergeComplete = 0x52,
COUNT,
}
}
......@@ -27,4 +27,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("4.0.0.4")]
\ No newline at end of file
[assembly: AssemblyVersion("4.0.0.6")]
\ No newline at end of file
★更新历史
4.0.0.6
修正了一些函数提示的问题(by 尸体233)。
如果在字段框里输入汉字,DEX现在会在你点击别处或点击回车键时搜索一次对应的字段。没找到的话会把那个字段重置成0。
【数据】菜单里新增功能:批量导入其他卡片数据库。
更新了字段数据。
4.0.0.5
修正了部分字段不显示的问题。
4.0.0.4
......
......@@ -58,7 +58,7 @@ DataEditForm.pl_main.splitContainer..lv_cardlist.0 卡片编码
DataEditForm.pl_main.splitContainer..lv_cardlist.1 卡片名称
DataEditForm.pl_bottom.btn_reset 重置
DataEditForm.pl_bottom.btn_lua 脚本
DataEditForm.pl_bottom.btn_serach 搜索
DataEditForm.pl_bottom.btn_search 搜索
DataEditForm.pl_bottom.btn_del 删除
DataEditForm.pl_bottom.btn_undo 撤销
DataEditForm.pl_bottom.btn_mod 修改
......@@ -104,6 +104,7 @@ DataEditForm.mainMenu.menuitem_autocheckupdate 自动检查更新
DataEditForm.mainMenu.menuitem_github 源码
DataEditForm.mainMenu.menuitem_autoreturn (特殊功能)中文自动换行
DataEditForm.mainMenu.menuitem_replace (特殊功能)批量替换文本
DataEditForm.mainMenu.menuMergeDatabase 批量导入其他卡片数据库
#
MainForm.mainMenu.menuitem_file 文件(&F)
MainForm.mainMenu.menuitem_open 打开
......@@ -203,4 +204,7 @@ MainForm.mainMenu.menuitem_closeall 关闭所有
0x4c 测试完成,没有发现语法错误。
0x4d 一次性打开大量文件将导致卡顿,是否继续?
0x4e 确定要进行撤销吗?所有未保存的内容都将丢失。
0x4f 无效的文件名。只支持类似[cXXXXXXXX.lua]的文件。
\ No newline at end of file
0x4f 无效的文件名。只支持类似[cXXXXXXXX.lua]的文件。
0x50 数据库文件(*.cdb)|*.cdb|所有文件(*.*)|*.*
0x51 如果遇到重复的卡,是否要进行覆盖?
0x52 合并完成!共读取了{0}张卡。
\ No newline at end of file
......@@ -58,7 +58,7 @@ DataEditForm.pl_main.splitContainer..lv_cardlist.0 Code
DataEditForm.pl_main.splitContainer..lv_cardlist.1 Name
DataEditForm.pl_bottom.btn_reset Clear All
DataEditForm.pl_bottom.btn_lua Open Lua File
DataEditForm.pl_bottom.btn_serach Search
DataEditForm.pl_bottom.btn_search Search
DataEditForm.pl_bottom.btn_del Delete
DataEditForm.pl_bottom.btn_undo Undo
DataEditForm.pl_bottom.btn_mod Modify
......@@ -203,4 +203,7 @@ MainForm.mainMenu.menuitem_closeall Close All
0x4c No syntax error found.
0x4d It is not recommended to open lots of file at a time. Continue?
0x4e Are you sure to undo? All unsaved contents will be lost.
0x4f Invalid file name. Only support file names as [cXXXXXXXX.lua].
\ No newline at end of file
0x4f Invalid file name. Only support file names as [cXXXXXXXX.lua].
0x50 Database Files(*.cdb)|*.cdb|All Files(*.*)|*.*
0x51 Replace duplicated cards?
0x52 Successfully merged {0} card(s).
\ No newline at end of file
......@@ -1132,3 +1132,36 @@
!setname 0x179 兽带斗神 セリオンズ
!setname 0x17a 肆世坏 スケアクロー
!setname 0x17b 野蛮人 バーバリアン
!setname 0x17c 书灵师 リブロマンサー
!setname 0x17d 群豪 ヴァリアンツ
!setname 0x17e 拉比林斯迷宫 ラビュリンス
!setname 0x117e 拉比林斯迷宫欢迎 ウェルカム・ラビュリンス
!setname 0x17f 神碑
!setname 0x180 卫星闪灵 スプライト
!setname 0x181 珠泪哀歌族 ティアラメンツ
!setname 0x182 春化精
!setname 0x183 悠悠 もけもけ
!setname 0x184 翼侠 ウィングマン
#setname 0x185 涂鸦 らくがき
!setname 0x1185 涂鸦兽 らくがきじゅう
!setname 0x2185 涂鸦本 らくがきちょう
!setname 0x186 G石人 Gゴーレム
!setname 0x187 桥梁 架け橋
!setname 0x188 深渊之兽 ビーステッド
!setname 0x189 俱舍怒威族 クシャトリラ
!setname 0x18a 魊影 Ghoti
!setname 0x18b 救援ACERACE
!setname 0x18c 纯爱妖精 ピュアリィ
!setname 0x18d 御巫
!setname 0x18e 仪水镜 儀水鏡
!setname 0x18f 防火 ファイアウォール
!setname 0x190 末那愚子族 マナドゥム
!setname 0x191 妮穆蕾莉娅 ネムレリア
!setname 0x192 黄金荣耀 Gold Pride
!setname 0x193 迷宫壁 Labyrinth Wall
!setname 0x194 至爱 フェイバリット
!setname 0x195 征服斗魂 VS(ヴァンキッシュ・ソウル)
!setname 0x196 新式魔厨 ヌーベルズ
!setname 0x197 食谱 レシピ
!setname 0x198 维萨斯 ヴィサス
!setname 0x199 反击 カウンター
[DataEditorX]4.0.0.5[DataEditorX]
[URL]https://cdn01.moecube.com/DataEditorX/releases/DataEditorX-4.0.0.5.zip[URL]
[DataEditorX]4.0.0.6[DataEditorX]
[URL]https://cdn01.moecube.com/DataEditorX/releases/DataEditorX-4.0.0.6.zip[URL]
★运行环境(Environment)
本程序基于.Net framework 4.6开发
......
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