Commit aed623a0 authored by 247321453's avatar 247321453

ok

parent ccf4f16b
...@@ -50,7 +50,7 @@ static DataBase() ...@@ -50,7 +50,7 @@ static DataBase()
/// 创建数据库 /// 创建数据库
/// </summary> /// </summary>
/// <param name="Db">新数据库路径</param> /// <param name="Db">新数据库路径</param>
public static void Create(string Db) public static bool Create(string Db)
{ {
if ( File.Exists(Db) ) if ( File.Exists(Db) )
File.Delete(Db); File.Delete(Db);
...@@ -62,7 +62,9 @@ public static void Create(string Db) ...@@ -62,7 +62,9 @@ public static void Create(string Db)
{ {
File.AppendAllText("System.Data.SQLite.log", exc.Source+"\n"+ File.AppendAllText("System.Data.SQLite.log", exc.Source+"\n"+
exc.TargetSite+"\n"+exc.Message+"\n"+exc.ToString()); exc.TargetSite+"\n"+exc.Message+"\n"+exc.ToString());
return false;
} }
return true;
} }
#endregion #endregion
...@@ -326,7 +328,9 @@ public static string GetSelectSQL(Card c) ...@@ -326,7 +328,9 @@ public static string GetSelectSQL(Card c)
if(c.id>0 && c.alias<0) if(c.id>0 && c.alias<0)
sb.Append(" and datas.id >= "+c.id.ToString()); sb.Append(" and datas.id >= "+c.id.ToString());
else if(c.id>0 && c.alias>0) else if(c.id>0 && c.alias>0)
sb.Append(" and datas.id >= "+c.id.ToString()+" and datas.alias >="+c.alias.ToString()); sb.Append(" and datas.id >= "+c.id.ToString()+" and datas.id <="+c.alias.ToString());
else if(c.id<0 && c.alias>0)
sb.Append(" and datas.id <= "+c.alias.ToString());
else if(c.id>0) else if(c.id>0)
sb.Append(" and datas.id="+c.id.ToString()); sb.Append(" and datas.id="+c.id.ToString());
else if(c.alias>0) else if(c.alias>0)
...@@ -348,7 +352,7 @@ public static string GetInsertSQL(Card c, bool ignore) ...@@ -348,7 +352,7 @@ public static string GetInsertSQL(Card c, bool ignore)
if(ignore) if(ignore)
st.Append("INSERT or ignore into datas values("); st.Append("INSERT or ignore into datas values(");
else else
st.Append("INSERT into datas values("); st.Append("INSERT or replace into datas values(");
st.Append(c.id.ToString()); st.Append(","); st.Append(c.id.ToString()); st.Append(",");
st.Append(c.ot.ToString()); st.Append(","); st.Append(c.ot.ToString()); st.Append(",");
st.Append(c.alias.ToString()); st.Append(","); st.Append(c.alias.ToString()); st.Append(",");
...@@ -360,7 +364,10 @@ public static string GetInsertSQL(Card c, bool ignore) ...@@ -360,7 +364,10 @@ public static string GetInsertSQL(Card c, bool ignore)
st.Append(c.race.ToString()); st.Append(","); st.Append(c.race.ToString()); st.Append(",");
st.Append(c.attribute.ToString()); st.Append(","); st.Append(c.attribute.ToString()); st.Append(",");
st.Append(c.category.ToString()); st.Append(")"); st.Append(c.category.ToString()); st.Append(")");
st.Append(";INSERT or ignore into texts values("); if(ignore)
st.Append(";INSERT or ignore into texts values(");
else
st.Append(";INSERT or replace into texts values(");
st.Append(c.id.ToString()); st.Append(",'"); st.Append(c.id.ToString()); st.Append(",'");
st.Append(c.name.Replace("'", "''")); st.Append("','"); st.Append(c.name.Replace("'", "''")); st.Append("','");
st.Append(c.desc.Replace("'", "''")); st.Append(c.desc.Replace("'", "''"));
......
...@@ -35,47 +35,25 @@ protected override void Dispose(bool disposing) ...@@ -35,47 +35,25 @@ protected override void Dispose(bool disposing)
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.menuitem_file = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_file = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_open = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_open = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_new = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_new = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_save = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_saveas = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_copyto = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_copyto = new System.Windows.Forms.ToolStripMenuItem();
this.tsep1 = new System.Windows.Forms.ToolStripSeparator(); this.tsep1 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_inport = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_export = new System.Windows.Forms.ToolStripMenuItem();
this.tsep2 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_readydk = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_readydk = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_readimages = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_readimages = new System.Windows.Forms.ToolStripMenuItem();
this.tsep3 = new System.Windows.Forms.ToolStripSeparator(); this.tsep3 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_quit = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_quit = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_edit = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_edit = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_undo = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_redo = new System.Windows.Forms.ToolStripMenuItem();
this.tsep4 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_add = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_mod = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_del = new System.Windows.Forms.ToolStripMenuItem();
this.tsep5 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_search = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_reset = new System.Windows.Forms.ToolStripMenuItem();
this.tsep6 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_showimage = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_showimage = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_openscript = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_opengame = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_help = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_help = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_about = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_about = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_checkupdate = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_checkupdate = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_github = new System.Windows.Forms.ToolStripMenuItem();
this.lv_cardlist = new System.Windows.Forms.DListView(); this.lv_cardlist = new System.Windows.Forms.DListView();
this.ch_cardcode = new System.Windows.Forms.ColumnHeader(); this.ch_cardcode = new System.Windows.Forms.ColumnHeader();
this.ch_cardname = new System.Windows.Forms.ColumnHeader(); this.ch_cardname = new System.Windows.Forms.ColumnHeader();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyToToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.cb_cardattribute = new System.Windows.Forms.ComboBox(); this.cb_cardattribute = new System.Windows.Forms.ComboBox();
this.tb_cardname = new System.Windows.Forms.TextBox(); this.tb_cardname = new System.Windows.Forms.TextBox();
this.cb_cardrule = new System.Windows.Forms.ComboBox(); this.cb_cardrule = new System.Windows.Forms.ComboBox();
...@@ -115,8 +93,6 @@ private void InitializeComponent() ...@@ -115,8 +93,6 @@ private void InitializeComponent()
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label();
this.btn_redo = new System.Windows.Forms.Button();
this.btn_undo = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox();
...@@ -124,7 +100,6 @@ private void InitializeComponent() ...@@ -124,7 +100,6 @@ private void InitializeComponent()
this.pl_cardtype = new System.Windows.Forms.DFlowLayoutPanel(); this.pl_cardtype = new System.Windows.Forms.DFlowLayoutPanel();
this.pl_category = new System.Windows.Forms.DFlowLayoutPanel(); this.pl_category = new System.Windows.Forms.DFlowLayoutPanel();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// menuStrip1 // menuStrip1
...@@ -144,13 +119,8 @@ private void InitializeComponent() ...@@ -144,13 +119,8 @@ private void InitializeComponent()
this.menuitem_file.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuitem_file.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuitem_open, this.menuitem_open,
this.menuitem_new, this.menuitem_new,
this.menuitem_save,
this.menuitem_saveas,
this.menuitem_copyto, this.menuitem_copyto,
this.tsep1, this.tsep1,
this.menuitem_inport,
this.menuitem_export,
this.tsep2,
this.menuitem_readydk, this.menuitem_readydk,
this.menuitem_readimages, this.menuitem_readimages,
this.tsep3, this.tsep3,
...@@ -162,199 +132,79 @@ private void InitializeComponent() ...@@ -162,199 +132,79 @@ private void InitializeComponent()
// menuitem_open // menuitem_open
// //
this.menuitem_open.Name = "menuitem_open"; this.menuitem_open.Name = "menuitem_open";
this.menuitem_open.Size = new System.Drawing.Size(124, 22); 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.Text = "打开(&O)"; this.menuitem_open.Text = "打开(&O)";
this.menuitem_open.Click += new System.EventHandler(this.Menuitem_openClick); this.menuitem_open.Click += new System.EventHandler(this.Menuitem_openClick);
// //
// menuitem_new // menuitem_new
// //
this.menuitem_new.Name = "menuitem_new"; this.menuitem_new.Name = "menuitem_new";
this.menuitem_new.Size = new System.Drawing.Size(124, 22); 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.Text = "新建(&N)"; this.menuitem_new.Text = "新建(&N)";
this.menuitem_new.Click += new System.EventHandler(this.Menuitem_newClick); this.menuitem_new.Click += new System.EventHandler(this.Menuitem_newClick);
// //
// menuitem_save
//
this.menuitem_save.Name = "menuitem_save";
this.menuitem_save.Size = new System.Drawing.Size(124, 22);
this.menuitem_save.Text = "保存(&S)";
this.menuitem_save.Click += new System.EventHandler(this.Menuitem_saveClick);
//
// menuitem_saveas
//
this.menuitem_saveas.Name = "menuitem_saveas";
this.menuitem_saveas.Size = new System.Drawing.Size(124, 22);
this.menuitem_saveas.Text = "另存为";
this.menuitem_saveas.Click += new System.EventHandler(this.Menuitem_saveasClick);
//
// menuitem_copyto // menuitem_copyto
// //
this.menuitem_copyto.Name = "menuitem_copyto"; this.menuitem_copyto.Name = "menuitem_copyto";
this.menuitem_copyto.Size = new System.Drawing.Size(124, 22); this.menuitem_copyto.Size = new System.Drawing.Size(165, 22);
this.menuitem_copyto.Text = "复制到"; this.menuitem_copyto.Text = "复制到(&C)";
this.menuitem_copyto.Click += new System.EventHandler(this.Menuitem_copytoClick); this.menuitem_copyto.Click += new System.EventHandler(this.Menuitem_copytoClick);
// //
// tsep1 // tsep1
// //
this.tsep1.Name = "tsep1"; this.tsep1.Name = "tsep1";
this.tsep1.Size = new System.Drawing.Size(121, 6); this.tsep1.Size = new System.Drawing.Size(162, 6);
//
// menuitem_inport
//
this.menuitem_inport.Name = "menuitem_inport";
this.menuitem_inport.Size = new System.Drawing.Size(124, 22);
this.menuitem_inport.Text = "导出";
this.menuitem_inport.Click += new System.EventHandler(this.Menuitem_inportClick);
//
// menuitem_export
//
this.menuitem_export.Name = "menuitem_export";
this.menuitem_export.Size = new System.Drawing.Size(124, 22);
this.menuitem_export.Text = "导入";
this.menuitem_export.Click += new System.EventHandler(this.Menuitem_exportClick);
//
// tsep2
//
this.tsep2.Name = "tsep2";
this.tsep2.Size = new System.Drawing.Size(121, 6);
// //
// menuitem_readydk // menuitem_readydk
// //
this.menuitem_readydk.Name = "menuitem_readydk"; this.menuitem_readydk.Name = "menuitem_readydk";
this.menuitem_readydk.Size = new System.Drawing.Size(124, 22); this.menuitem_readydk.Size = new System.Drawing.Size(165, 22);
this.menuitem_readydk.Text = "读取ydk"; this.menuitem_readydk.Text = "读取ydk(&Y)";
this.menuitem_readydk.Click += new System.EventHandler(this.Menuitem_readydkClick); this.menuitem_readydk.Click += new System.EventHandler(this.Menuitem_readydkClick);
// //
// menuitem_readimages // menuitem_readimages
// //
this.menuitem_readimages.Name = "menuitem_readimages"; this.menuitem_readimages.Name = "menuitem_readimages";
this.menuitem_readimages.Size = new System.Drawing.Size(124, 22); this.menuitem_readimages.Size = new System.Drawing.Size(165, 22);
this.menuitem_readimages.Text = "读取图片"; this.menuitem_readimages.Text = "读取图片(&I)";
this.menuitem_readimages.Click += new System.EventHandler(this.Menuitem_readimagesClick); this.menuitem_readimages.Click += new System.EventHandler(this.Menuitem_readimagesClick);
// //
// tsep3 // tsep3
// //
this.tsep3.Name = "tsep3"; this.tsep3.Name = "tsep3";
this.tsep3.Size = new System.Drawing.Size(121, 6); this.tsep3.Size = new System.Drawing.Size(162, 6);
// //
// menuitem_quit // menuitem_quit
// //
this.menuitem_quit.Name = "menuitem_quit"; this.menuitem_quit.Name = "menuitem_quit";
this.menuitem_quit.Size = new System.Drawing.Size(124, 22); this.menuitem_quit.Size = new System.Drawing.Size(165, 22);
this.menuitem_quit.Text = "退出"; this.menuitem_quit.Text = "退出(&Q)";
this.menuitem_quit.Click += new System.EventHandler(this.Menuitem_quitClick); this.menuitem_quit.Click += new System.EventHandler(this.Menuitem_quitClick);
// //
// menuitem_edit // menuitem_edit
// //
this.menuitem_edit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuitem_edit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuitem_undo, this.menuitem_showimage});
this.menuitem_redo,
this.tsep4,
this.menuitem_add,
this.menuitem_mod,
this.menuitem_del,
this.tsep5,
this.menuitem_search,
this.menuitem_reset,
this.tsep6,
this.menuitem_showimage,
this.menuitem_openscript,
this.menuitem_opengame});
this.menuitem_edit.Name = "menuitem_edit"; this.menuitem_edit.Name = "menuitem_edit";
this.menuitem_edit.Size = new System.Drawing.Size(59, 21); this.menuitem_edit.Size = new System.Drawing.Size(59, 21);
this.menuitem_edit.Text = "编辑(&E)"; this.menuitem_edit.Text = "设置(&T)";
//
// menuitem_undo
//
this.menuitem_undo.Name = "menuitem_undo";
this.menuitem_undo.Size = new System.Drawing.Size(152, 22);
this.menuitem_undo.Text = "撤销";
this.menuitem_undo.Click += new System.EventHandler(this.Menuitem_undoClick);
//
// menuitem_redo
//
this.menuitem_redo.Name = "menuitem_redo";
this.menuitem_redo.Size = new System.Drawing.Size(152, 22);
this.menuitem_redo.Text = "还原";
this.menuitem_redo.Click += new System.EventHandler(this.Menuitem_redoClick);
//
// tsep4
//
this.tsep4.Name = "tsep4";
this.tsep4.Size = new System.Drawing.Size(149, 6);
//
// menuitem_add
//
this.menuitem_add.Name = "menuitem_add";
this.menuitem_add.Size = new System.Drawing.Size(152, 22);
this.menuitem_add.Text = "添加";
this.menuitem_add.Click += new System.EventHandler(this.Menuitem_addClick);
//
// menuitem_mod
//
this.menuitem_mod.Name = "menuitem_mod";
this.menuitem_mod.Size = new System.Drawing.Size(152, 22);
this.menuitem_mod.Text = "修改";
this.menuitem_mod.Click += new System.EventHandler(this.Menuitem_modClick);
//
// menuitem_del
//
this.menuitem_del.Name = "menuitem_del";
this.menuitem_del.Size = new System.Drawing.Size(152, 22);
this.menuitem_del.Text = "删除";
this.menuitem_del.Click += new System.EventHandler(this.Menuitem_delClick);
//
// tsep5
//
this.tsep5.Name = "tsep5";
this.tsep5.Size = new System.Drawing.Size(149, 6);
//
// menuitem_search
//
this.menuitem_search.Name = "menuitem_search";
this.menuitem_search.Size = new System.Drawing.Size(152, 22);
this.menuitem_search.Text = "搜索";
this.menuitem_search.Click += new System.EventHandler(this.Menuitem_searchClick);
//
// menuitem_reset
//
this.menuitem_reset.Name = "menuitem_reset";
this.menuitem_reset.Size = new System.Drawing.Size(152, 22);
this.menuitem_reset.Text = "重置";
this.menuitem_reset.Click += new System.EventHandler(this.Menuitem_resetClick);
//
// tsep6
//
this.tsep6.Name = "tsep6";
this.tsep6.Size = new System.Drawing.Size(149, 6);
// //
// menuitem_showimage // menuitem_showimage
// //
this.menuitem_showimage.CheckOnClick = true; this.menuitem_showimage.CheckOnClick = true;
this.menuitem_showimage.Name = "menuitem_showimage"; this.menuitem_showimage.Name = "menuitem_showimage";
this.menuitem_showimage.Size = new System.Drawing.Size(152, 22); this.menuitem_showimage.Size = new System.Drawing.Size(163, 22);
this.menuitem_showimage.Text = "显示卡片图像"; this.menuitem_showimage.Text = "显示卡片图像(&S)";
this.menuitem_showimage.Click += new System.EventHandler(this.Menuitem_showimageClick); this.menuitem_showimage.Click += new System.EventHandler(this.Menuitem_showimageClick);
// //
// menuitem_openscript
//
this.menuitem_openscript.Name = "menuitem_openscript";
this.menuitem_openscript.Size = new System.Drawing.Size(152, 22);
this.menuitem_openscript.Text = "打开脚本";
this.menuitem_openscript.Click += new System.EventHandler(this.Menuitem_openscriptClick);
//
// menuitem_opengame
//
this.menuitem_opengame.Name = "menuitem_opengame";
this.menuitem_opengame.Size = new System.Drawing.Size(152, 22);
this.menuitem_opengame.Text = "启动游戏";
this.menuitem_opengame.Click += new System.EventHandler(this.Menuitem_opengameClick);
//
// menuitem_help // menuitem_help
// //
this.menuitem_help.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuitem_help.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuitem_about, this.menuitem_about,
this.menuitem_checkupdate}); this.menuitem_checkupdate,
this.menuitem_github});
this.menuitem_help.Name = "menuitem_help"; this.menuitem_help.Name = "menuitem_help";
this.menuitem_help.Size = new System.Drawing.Size(61, 21); this.menuitem_help.Size = new System.Drawing.Size(61, 21);
this.menuitem_help.Text = "帮助(&H)"; this.menuitem_help.Text = "帮助(&H)";
...@@ -362,17 +212,25 @@ private void InitializeComponent() ...@@ -362,17 +212,25 @@ private void InitializeComponent()
// menuitem_about // menuitem_about
// //
this.menuitem_about.Name = "menuitem_about"; this.menuitem_about.Name = "menuitem_about";
this.menuitem_about.Size = new System.Drawing.Size(124, 22); this.menuitem_about.ShortcutKeys = System.Windows.Forms.Keys.F1;
this.menuitem_about.Size = new System.Drawing.Size(152, 22);
this.menuitem_about.Text = "关于"; this.menuitem_about.Text = "关于";
this.menuitem_about.Click += new System.EventHandler(this.Menuitem_aboutClick); this.menuitem_about.Click += new System.EventHandler(this.Menuitem_aboutClick);
// //
// menuitem_checkupdate // menuitem_checkupdate
// //
this.menuitem_checkupdate.Name = "menuitem_checkupdate"; this.menuitem_checkupdate.Name = "menuitem_checkupdate";
this.menuitem_checkupdate.Size = new System.Drawing.Size(124, 22); this.menuitem_checkupdate.Size = new System.Drawing.Size(152, 22);
this.menuitem_checkupdate.Text = "检查更新"; this.menuitem_checkupdate.Text = "检查更新";
this.menuitem_checkupdate.Click += new System.EventHandler(this.Menuitem_checkupdateClick); this.menuitem_checkupdate.Click += new System.EventHandler(this.Menuitem_checkupdateClick);
// //
// menuitem_github
//
this.menuitem_github.Name = "menuitem_github";
this.menuitem_github.Size = new System.Drawing.Size(152, 22);
this.menuitem_github.Text = "程序源码";
this.menuitem_github.Click += new System.EventHandler(this.Menuitem_githubClick);
//
// lv_cardlist // lv_cardlist
// //
this.lv_cardlist.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.lv_cardlist.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
...@@ -380,7 +238,6 @@ private void InitializeComponent() ...@@ -380,7 +238,6 @@ private void InitializeComponent()
this.lv_cardlist.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.lv_cardlist.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.ch_cardcode, this.ch_cardcode,
this.ch_cardname}); this.ch_cardname});
this.lv_cardlist.ContextMenuStrip = this.contextMenuStrip1;
this.lv_cardlist.FullRowSelect = true; this.lv_cardlist.FullRowSelect = true;
this.lv_cardlist.GridLines = true; this.lv_cardlist.GridLines = true;
this.lv_cardlist.HideSelection = false; this.lv_cardlist.HideSelection = false;
...@@ -393,6 +250,7 @@ private void InitializeComponent() ...@@ -393,6 +250,7 @@ private void InitializeComponent()
this.lv_cardlist.UseCompatibleStateImageBehavior = false; this.lv_cardlist.UseCompatibleStateImageBehavior = false;
this.lv_cardlist.View = System.Windows.Forms.View.Details; this.lv_cardlist.View = System.Windows.Forms.View.Details;
this.lv_cardlist.SelectedIndexChanged += new System.EventHandler(this.Lv_cardlistSelectedIndexChanged); this.lv_cardlist.SelectedIndexChanged += new System.EventHandler(this.Lv_cardlistSelectedIndexChanged);
this.lv_cardlist.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Lv_cardlistKeyDown);
// //
// ch_cardcode // ch_cardcode
// //
...@@ -404,40 +262,6 @@ private void InitializeComponent() ...@@ -404,40 +262,6 @@ private void InitializeComponent()
this.ch_cardname.Text = "卡片名称"; this.ch_cardname.Text = "卡片名称";
this.ch_cardname.Width = 140; this.ch_cardname.Width = 140;
// //
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.importToolStripMenuItem,
this.exportToolStripMenuItem,
this.copyToToolStripMenuItem,
this.deleteToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(122, 92);
//
// importToolStripMenuItem
//
this.importToolStripMenuItem.Name = "importToolStripMenuItem";
this.importToolStripMenuItem.Size = new System.Drawing.Size(121, 22);
this.importToolStripMenuItem.Text = "Import";
//
// exportToolStripMenuItem
//
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
this.exportToolStripMenuItem.Size = new System.Drawing.Size(121, 22);
this.exportToolStripMenuItem.Text = "Export";
//
// copyToToolStripMenuItem
//
this.copyToToolStripMenuItem.Name = "copyToToolStripMenuItem";
this.copyToToolStripMenuItem.Size = new System.Drawing.Size(121, 22);
this.copyToToolStripMenuItem.Text = "CopyTo";
//
// deleteToolStripMenuItem
//
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
this.deleteToolStripMenuItem.Size = new System.Drawing.Size(121, 22);
this.deleteToolStripMenuItem.Text = "Delete";
//
// cb_cardattribute // cb_cardattribute
// //
this.cb_cardattribute.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cb_cardattribute.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
...@@ -533,25 +357,25 @@ private void InitializeComponent() ...@@ -533,25 +357,25 @@ private void InitializeComponent()
// //
// lb_scripttext // lb_scripttext
// //
this.lb_scripttext.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.lb_scripttext.FormattingEnabled = true; this.lb_scripttext.FormattingEnabled = true;
this.lb_scripttext.IntegralHeight = false; this.lb_scripttext.IntegralHeight = false;
this.lb_scripttext.ItemHeight = 12; this.lb_scripttext.ItemHeight = 12;
this.lb_scripttext.Location = new System.Drawing.Point(532, 357); this.lb_scripttext.Location = new System.Drawing.Point(532, 357);
this.lb_scripttext.Name = "lb_scripttext"; this.lb_scripttext.Name = "lb_scripttext";
this.lb_scripttext.ScrollAlwaysVisible = true; this.lb_scripttext.ScrollAlwaysVisible = true;
this.lb_scripttext.Size = new System.Drawing.Size(281, 120); this.lb_scripttext.Size = new System.Drawing.Size(281, 138);
this.lb_scripttext.TabIndex = 6; this.lb_scripttext.TabIndex = 6;
this.lb_scripttext.SelectedIndexChanged += new System.EventHandler(this.Lb_scripttextSelectedIndexChanged); this.lb_scripttext.SelectedIndexChanged += new System.EventHandler(this.Lb_scripttextSelectedIndexChanged);
// //
// tb_edittext // tb_edittext
// //
this.tb_edittext.HideSelection = false; this.tb_edittext.HideSelection = false;
this.tb_edittext.Location = new System.Drawing.Point(533, 478); this.tb_edittext.Location = new System.Drawing.Point(533, 499);
this.tb_edittext.MaxLength = 2000; this.tb_edittext.MaxLength = 2000;
this.tb_edittext.Multiline = true;
this.tb_edittext.Name = "tb_edittext"; this.tb_edittext.Name = "tb_edittext";
this.tb_edittext.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.tb_edittext.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tb_edittext.Size = new System.Drawing.Size(279, 41); this.tb_edittext.Size = new System.Drawing.Size(279, 21);
this.tb_edittext.TabIndex = 4; this.tb_edittext.TabIndex = 4;
this.tb_edittext.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Tb_edittextKeyPress); this.tb_edittext.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Tb_edittextKeyPress);
// //
...@@ -611,7 +435,7 @@ private void InitializeComponent() ...@@ -611,7 +435,7 @@ private void InitializeComponent()
this.tb_page.Name = "tb_page"; this.tb_page.Name = "tb_page";
this.tb_page.Size = new System.Drawing.Size(34, 21); this.tb_page.Size = new System.Drawing.Size(34, 21);
this.tb_page.TabIndex = 8; this.tb_page.TabIndex = 8;
this.tb_page.Text = "0"; this.tb_page.Text = "1";
this.tb_page.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.tb_page.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.tb_page.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Tb_pageKeyPress); this.tb_page.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Tb_pageKeyPress);
// //
...@@ -624,7 +448,7 @@ private void InitializeComponent() ...@@ -624,7 +448,7 @@ private void InitializeComponent()
this.tb_pagenum.ReadOnly = true; this.tb_pagenum.ReadOnly = true;
this.tb_pagenum.Size = new System.Drawing.Size(34, 21); this.tb_pagenum.Size = new System.Drawing.Size(34, 21);
this.tb_pagenum.TabIndex = 8; this.tb_pagenum.TabIndex = 8;
this.tb_pagenum.Text = "0"; this.tb_pagenum.Text = "1";
this.tb_pagenum.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.tb_pagenum.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
// //
// btn_PageUp // btn_PageUp
...@@ -653,9 +477,9 @@ private void InitializeComponent() ...@@ -653,9 +477,9 @@ private void InitializeComponent()
// //
this.btn_add.Location = new System.Drawing.Point(532, 524); this.btn_add.Location = new System.Drawing.Point(532, 524);
this.btn_add.Name = "btn_add"; this.btn_add.Name = "btn_add";
this.btn_add.Size = new System.Drawing.Size(68, 26); this.btn_add.Size = new System.Drawing.Size(78, 27);
this.btn_add.TabIndex = 5; this.btn_add.TabIndex = 5;
this.btn_add.Text = "添加"; this.btn_add.Text = "添加卡片";
this.btn_add.UseVisualStyleBackColor = true; this.btn_add.UseVisualStyleBackColor = true;
this.btn_add.Click += new System.EventHandler(this.Btn_addClick); this.btn_add.Click += new System.EventHandler(this.Btn_addClick);
// //
...@@ -729,39 +553,39 @@ private void InitializeComponent() ...@@ -729,39 +553,39 @@ private void InitializeComponent()
// //
// btn_mod // btn_mod
// //
this.btn_mod.Location = new System.Drawing.Point(603, 524); this.btn_mod.Location = new System.Drawing.Point(616, 524);
this.btn_mod.Name = "btn_mod"; this.btn_mod.Name = "btn_mod";
this.btn_mod.Size = new System.Drawing.Size(68, 26); this.btn_mod.Size = new System.Drawing.Size(78, 27);
this.btn_mod.TabIndex = 5; this.btn_mod.TabIndex = 5;
this.btn_mod.Text = "修改"; this.btn_mod.Text = "修改卡片";
this.btn_mod.UseVisualStyleBackColor = true; this.btn_mod.UseVisualStyleBackColor = true;
this.btn_mod.Click += new System.EventHandler(this.Btn_modClick); this.btn_mod.Click += new System.EventHandler(this.Btn_modClick);
// //
// btn_del // btn_del
// //
this.btn_del.ForeColor = System.Drawing.Color.DarkRed; this.btn_del.ForeColor = System.Drawing.Color.DarkRed;
this.btn_del.Location = new System.Drawing.Point(743, 524); this.btn_del.Location = new System.Drawing.Point(445, 523);
this.btn_del.Name = "btn_del"; this.btn_del.Name = "btn_del";
this.btn_del.Size = new System.Drawing.Size(68, 26); this.btn_del.Size = new System.Drawing.Size(78, 27);
this.btn_del.TabIndex = 5; this.btn_del.TabIndex = 5;
this.btn_del.Text = "删除"; this.btn_del.Text = "删除卡片";
this.btn_del.UseVisualStyleBackColor = true; this.btn_del.UseVisualStyleBackColor = true;
this.btn_del.Click += new System.EventHandler(this.Btn_delClick); this.btn_del.Click += new System.EventHandler(this.Btn_delClick);
// //
// btn_lua // btn_lua
// //
this.btn_lua.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(0))))); this.btn_lua.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(0)))));
this.btn_lua.Location = new System.Drawing.Point(673, 524); this.btn_lua.Location = new System.Drawing.Point(715, 523);
this.btn_lua.Name = "btn_lua"; this.btn_lua.Name = "btn_lua";
this.btn_lua.Size = new System.Drawing.Size(68, 26); this.btn_lua.Size = new System.Drawing.Size(94, 27);
this.btn_lua.TabIndex = 5; this.btn_lua.TabIndex = 5;
this.btn_lua.Text = "脚本"; this.btn_lua.Text = "打开Lua脚本";
this.btn_lua.UseVisualStyleBackColor = true; this.btn_lua.UseVisualStyleBackColor = true;
this.btn_lua.Click += new System.EventHandler(this.Btn_luaClick); this.btn_lua.Click += new System.EventHandler(this.Btn_luaClick);
// //
// btn_reset // btn_reset
// //
this.btn_reset.Location = new System.Drawing.Point(307, 523); this.btn_reset.Location = new System.Drawing.Point(312, 523);
this.btn_reset.Name = "btn_reset"; this.btn_reset.Name = "btn_reset";
this.btn_reset.Size = new System.Drawing.Size(78, 27); this.btn_reset.Size = new System.Drawing.Size(78, 27);
this.btn_reset.TabIndex = 5; this.btn_reset.TabIndex = 5;
...@@ -832,26 +656,6 @@ private void InitializeComponent() ...@@ -832,26 +656,6 @@ private void InitializeComponent()
this.label7.Text = "卡片信息"; this.label7.Text = "卡片信息";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
// //
// btn_redo
//
this.btn_redo.Location = new System.Drawing.Point(390, 522);
this.btn_redo.Name = "btn_redo";
this.btn_redo.Size = new System.Drawing.Size(68, 26);
this.btn_redo.TabIndex = 5;
this.btn_redo.Text = "还原";
this.btn_redo.UseVisualStyleBackColor = true;
this.btn_redo.Click += new System.EventHandler(this.Btn_redoClick);
//
// btn_undo
//
this.btn_undo.Location = new System.Drawing.Point(460, 522);
this.btn_undo.Name = "btn_undo";
this.btn_undo.Size = new System.Drawing.Size(68, 26);
this.btn_undo.TabIndex = 5;
this.btn_undo.Text = "撤销";
this.btn_undo.UseVisualStyleBackColor = true;
this.btn_undo.Click += new System.EventHandler(this.Btn_undoClick);
//
// textBox1 // textBox1
// //
this.textBox1.Location = new System.Drawing.Point(530, -168); this.textBox1.Location = new System.Drawing.Point(530, -168);
...@@ -890,6 +694,7 @@ private void InitializeComponent() ...@@ -890,6 +694,7 @@ private void InitializeComponent()
// //
// pl_cardtype // pl_cardtype
// //
this.pl_cardtype.AutoScroll = true;
this.pl_cardtype.Location = new System.Drawing.Point(220, 219); this.pl_cardtype.Location = new System.Drawing.Point(220, 219);
this.pl_cardtype.Margin = new System.Windows.Forms.Padding(1, 2, 1, 2); this.pl_cardtype.Margin = new System.Windows.Forms.Padding(1, 2, 1, 2);
this.pl_cardtype.Name = "pl_cardtype"; this.pl_cardtype.Name = "pl_cardtype";
...@@ -899,11 +704,12 @@ private void InitializeComponent() ...@@ -899,11 +704,12 @@ private void InitializeComponent()
// //
// pl_category // pl_category
// //
this.pl_category.AutoScroll = true;
this.pl_category.Location = new System.Drawing.Point(220, 353); this.pl_category.Location = new System.Drawing.Point(220, 353);
this.pl_category.Margin = new System.Windows.Forms.Padding(1, 2, 1, 2); this.pl_category.Margin = new System.Windows.Forms.Padding(1, 2, 1, 2);
this.pl_category.Name = "pl_category"; this.pl_category.Name = "pl_category";
this.pl_category.Padding = new System.Windows.Forms.Padding(2); this.pl_category.Padding = new System.Windows.Forms.Padding(2);
this.pl_category.Size = new System.Drawing.Size(310, 169); this.pl_category.Size = new System.Drawing.Size(310, 166);
this.pl_category.TabIndex = 13; this.pl_category.TabIndex = 13;
// //
// DataEditForm // DataEditForm
...@@ -940,9 +746,7 @@ private void InitializeComponent() ...@@ -940,9 +746,7 @@ private void InitializeComponent()
this.Controls.Add(this.btn_lua); this.Controls.Add(this.btn_lua);
this.Controls.Add(this.btn_serach); this.Controls.Add(this.btn_serach);
this.Controls.Add(this.btn_del); this.Controls.Add(this.btn_del);
this.Controls.Add(this.btn_undo);
this.Controls.Add(this.btn_mod); this.Controls.Add(this.btn_mod);
this.Controls.Add(this.btn_redo);
this.Controls.Add(this.btn_add); this.Controls.Add(this.btn_add);
this.Controls.Add(this.btn_PageDown); this.Controls.Add(this.btn_PageDown);
this.Controls.Add(this.textBox2); this.Controls.Add(this.textBox2);
...@@ -960,30 +764,25 @@ private void InitializeComponent() ...@@ -960,30 +764,25 @@ private void InitializeComponent()
this.Controls.Add(this.cb_cardattribute); this.Controls.Add(this.cb_cardattribute);
this.Controls.Add(this.lv_cardlist); this.Controls.Add(this.lv_cardlist);
this.Controls.Add(this.menuStrip1); this.Controls.Add(this.menuStrip1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.MaximizeBox = false;
this.Name = "DataEditForm"; this.Name = "DataEditForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "DataEditor"; this.Text = "DataEditor";
this.Load += new System.EventHandler(this.DataEditFormLoad); this.Load += new System.EventHandler(this.DataEditFormLoad);
this.menuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
private System.Windows.Forms.ToolStripMenuItem menuitem_github;
private System.Windows.Forms.ToolStripMenuItem menuitem_new; private System.Windows.Forms.ToolStripMenuItem menuitem_new;
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem copyToToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem importToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem menuitem_showimage; private System.Windows.Forms.ToolStripMenuItem menuitem_showimage;
private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button btn_undo;
private System.Windows.Forms.Button btn_redo;
private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
...@@ -1031,30 +830,13 @@ private void InitializeComponent() ...@@ -1031,30 +830,13 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem menuitem_checkupdate; private System.Windows.Forms.ToolStripMenuItem menuitem_checkupdate;
private System.Windows.Forms.ToolStripMenuItem menuitem_about; private System.Windows.Forms.ToolStripMenuItem menuitem_about;
private System.Windows.Forms.ToolStripMenuItem menuitem_help; private System.Windows.Forms.ToolStripMenuItem menuitem_help;
private System.Windows.Forms.ToolStripMenuItem menuitem_opengame;
private System.Windows.Forms.ToolStripMenuItem menuitem_openscript;
private System.Windows.Forms.ToolStripSeparator tsep6;
private System.Windows.Forms.ToolStripMenuItem menuitem_reset;
private System.Windows.Forms.ToolStripMenuItem menuitem_search;
private System.Windows.Forms.ToolStripSeparator tsep5;
private System.Windows.Forms.ToolStripMenuItem menuitem_del;
private System.Windows.Forms.ToolStripMenuItem menuitem_mod;
private System.Windows.Forms.ToolStripMenuItem menuitem_add;
private System.Windows.Forms.ToolStripSeparator tsep4;
private System.Windows.Forms.ToolStripMenuItem menuitem_redo;
private System.Windows.Forms.ToolStripMenuItem menuitem_undo;
private System.Windows.Forms.ToolStripMenuItem menuitem_edit; private System.Windows.Forms.ToolStripMenuItem menuitem_edit;
private System.Windows.Forms.ToolStripMenuItem menuitem_quit; private System.Windows.Forms.ToolStripMenuItem menuitem_quit;
private System.Windows.Forms.ToolStripSeparator tsep3; private System.Windows.Forms.ToolStripSeparator tsep3;
private System.Windows.Forms.ToolStripMenuItem menuitem_readimages; private System.Windows.Forms.ToolStripMenuItem menuitem_readimages;
private System.Windows.Forms.ToolStripMenuItem menuitem_readydk; private System.Windows.Forms.ToolStripMenuItem menuitem_readydk;
private System.Windows.Forms.ToolStripSeparator tsep2;
private System.Windows.Forms.ToolStripMenuItem menuitem_export;
private System.Windows.Forms.ToolStripMenuItem menuitem_inport;
private System.Windows.Forms.ToolStripSeparator tsep1; private System.Windows.Forms.ToolStripSeparator tsep1;
private System.Windows.Forms.ToolStripMenuItem menuitem_copyto; private System.Windows.Forms.ToolStripMenuItem menuitem_copyto;
private System.Windows.Forms.ToolStripMenuItem menuitem_saveas;
private System.Windows.Forms.ToolStripMenuItem menuitem_save;
private System.Windows.Forms.ToolStripMenuItem menuitem_open; private System.Windows.Forms.ToolStripMenuItem menuitem_open;
private System.Windows.Forms.ToolStripMenuItem menuitem_file; private System.Windows.Forms.ToolStripMenuItem menuitem_file;
private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.MenuStrip menuStrip1;
......
...@@ -20,8 +20,10 @@ namespace DataEditorX ...@@ -20,8 +20,10 @@ namespace DataEditorX
/// </summary> /// </summary>
public partial class DataEditForm : Form public partial class DataEditForm : Form
{ {
string GAMEPATH,PICPATH,UPDATEURL; #region 成员变量
string GAMEPATH,PICPATH,UPDATEURL,GITURL,LUAPTH;
Card oldCard=new Card(0); Card oldCard=new Card(0);
Card srcCard=new Card(0);
ImageForm imgform=new ImageForm(); ImageForm imgform=new ImageForm();
string[] strs=null; string[] strs=null;
string title; string title;
...@@ -30,6 +32,7 @@ public partial class DataEditForm : Form ...@@ -30,6 +32,7 @@ public partial class DataEditForm : Form
int page=1,pageNum=1; int page=1,pageNum=1;
int cardcount; int cardcount;
string strSetname="卡片系列"; string strSetname="卡片系列";
List<Card> cardlist=new List<Card>(); List<Card> cardlist=new List<Card>();
Dictionary<long, string> dicCardRules=null; Dictionary<long, string> dicCardRules=null;
Dictionary<long, string> dicCardAttributes=null; Dictionary<long, string> dicCardAttributes=null;
...@@ -38,18 +41,20 @@ public partial class DataEditForm : Form ...@@ -38,18 +41,20 @@ public partial class DataEditForm : Form
Dictionary<long, string> dicSetnames=null; Dictionary<long, string> dicSetnames=null;
Dictionary<long, string> dicCardTypes=null; Dictionary<long, string> dicCardTypes=null;
Dictionary<long, string> dicCardcategorys=null; Dictionary<long, string> dicCardcategorys=null;
#endregion
#region 界面初始化
public DataEditForm(string cdbfile) public DataEditForm(string cdbfile)
{ {
InitializeComponent(); InitializeComponent();
nowCdbFile=cdbfile; nowCdbFile=cdbfile;
} }
public DataEditForm() public DataEditForm()
{ {
InitializeComponent(); InitializeComponent();
} }
#region 界面初始化
void DataEditFormLoad(object sender, EventArgs e) void DataEditFormLoad(object sender, EventArgs e)
{ {
InitListRows(); InitListRows();
...@@ -57,7 +62,7 @@ void DataEditFormLoad(object sender, EventArgs e) ...@@ -57,7 +62,7 @@ void DataEditFormLoad(object sender, EventArgs e)
#if DEBUG #if DEBUG
title=title+"(DEBUG)"; title=title+"(DEBUG)";
#endif #endif
//set null card //set null card
oldCard=new Card(0); oldCard=new Card(0);
SetCard(oldCard); SetCard(oldCard);
if(!string.IsNullOrEmpty(nowCdbFile)) if(!string.IsNullOrEmpty(nowCdbFile))
...@@ -68,10 +73,17 @@ void DataEditFormLoad(object sender, EventArgs e) ...@@ -68,10 +73,17 @@ void DataEditFormLoad(object sender, EventArgs e)
{ {
string[] lines=File.ReadAllLines(Path.Combine(GAMEPATH,"DataEditorX.txt"),Encoding.Default); string[] lines=File.ReadAllLines(Path.Combine(GAMEPATH,"DataEditorX.txt"),Encoding.Default);
GAMEPATH=(lines.Length>0)?lines[0]:Application.StartupPath; GAMEPATH=(lines.Length>0)?lines[0]:Application.StartupPath;
UPDATEURL=(lines.Length>1)?lines[1]:"http://about:blank"; UPDATEURL=(lines.Length>1)?lines[1]:"http://247321453@ys168.com";
GITURL=(lines.Length>2)?lines[2]:"https://github.com/247321453/DataEditorX";
}
else
{
GAMEPATH=Application.StartupPath;
UPDATEURL="http://247321453@ys168.com";
GITURL="https://github.com/247321453/DataEcitorX";
} }
PICPATH=Path.Combine(GAMEPATH,"pics"); PICPATH=Path.Combine(GAMEPATH,"pics");
LUAPTH=Path.Combine(GAMEPATH,"script");
} }
public void InitForm(string directory) public void InitForm(string directory)
{ {
...@@ -104,7 +116,7 @@ public void InitForm(string directory) ...@@ -104,7 +116,7 @@ public void InitForm(string directory)
dicCardcategorys=DataManager.Read( dicCardcategorys=DataManager.Read(
Path.Combine(directory, "card-category.txt")); Path.Combine(directory, "card-category.txt"));
InitCheckPanel(pl_category, dicCardcategorys); InitCheckPanel(pl_category, dicCardcategorys);
// //
if(File.Exists(Path.Combine(directory, "cover.jpg"))) if(File.Exists(Path.Combine(directory, "cover.jpg")))
imgform.SetDefault(Image.FromFile(Path.Combine(directory, "cover.jpg"))); imgform.SetDefault(Image.FromFile(Path.Combine(directory, "cover.jpg")));
} }
...@@ -174,7 +186,8 @@ void SetCard(Card c) ...@@ -174,7 +186,8 @@ void SetCard(Card c)
tb_cardname.Text=c.name; tb_cardname.Text=c.name;
tb_cardtext.Text=c.desc; tb_cardtext.Text=c.desc;
strs=c.str; strs=new string[c.str.Length];
Array.Copy(c.str,strs,c.str.Length);
lb_scripttext.Items.Clear(); lb_scripttext.Items.Clear();
lb_scripttext.Items.AddRange(c.str); lb_scripttext.Items.AddRange(c.str);
tb_edittext.Text=""; tb_edittext.Text="";
...@@ -190,7 +203,7 @@ void SetCard(Card c) ...@@ -190,7 +203,7 @@ void SetCard(Card c)
SetSelect(dicSetnames, cb_setname4, (c.setcode>>0x30)&0xffff,1); SetSelect(dicSetnames, cb_setname4, (c.setcode>>0x30)&0xffff,1);
SetCheck(pl_cardtype,c.type); SetCheck(pl_cardtype,c.type);
SetCheck(pl_category,c.category); SetCheck(pl_category,c.category);
tb_pleft.Text=((c.level >> 0x18) & 0xff).ToString(); tb_pleft.Text=((c.level >> 0x18) & 0xff).ToString();
tb_pright.Text=((c.level >> 0x10) & 0xff).ToString(); tb_pright.Text=((c.level >> 0x10) & 0xff).ToString();
tb_atk.Text=(c.atk<0)?"?":c.atk.ToString(); tb_atk.Text=(c.atk<0)?"?":c.atk.ToString();
...@@ -212,28 +225,33 @@ void SetCheck(FlowLayoutPanel fpl,long number) ...@@ -212,28 +225,33 @@ void SetCheck(FlowLayoutPanel fpl,long number)
if((temp & number)==temp && temp!=0) if((temp & number)==temp && temp!=0)
cbox.Checked=true; cbox.Checked=true;
else else
cbox.Checked=false; cbox.Checked=false;
} }
} }
} }
void SetSelect(Dictionary<long, string> dic,ComboBox cb, long k,int start) void SetSelect(Dictionary<long, string> dic,ComboBox cb, long k,int start)
{ {
int index=0; int index=start;
bool isfind=false; if(k==0)
{
cb.SelectedIndex=0;
return;
}
foreach(long key in dic.Keys) foreach(long key in dic.Keys)
{ {
if(k==key) if(k==key)
{
isfind=true;
break; break;
}
index++; index++;
} }
if(isfind) if(index==cb.Items.Count)
cb.SelectedIndex=index+start; {
else string word="0x"+k.ToString("x");
cb.SelectedIndex=0; if(!dic.ContainsKey(k))
dic.Add(k, word);
cb.Items.Add(word);
}
cb.SelectedIndex=index;
} }
#endregion #endregion
...@@ -242,27 +260,29 @@ void SetSelect(Dictionary<long, string> dic,ComboBox cb, long k,int start) ...@@ -242,27 +260,29 @@ void SetSelect(Dictionary<long, string> dic,ComboBox cb, long k,int start)
Card GetCard() Card GetCard()
{ {
int temp; int temp;
long ltemp;
Card c=new Card(0); Card c=new Card(0);
c.name=tb_cardname.Text; c.name=tb_cardname.Text;
c.desc=tb_cardtext.Text; c.desc=tb_cardtext.Text;
c.str=strs; Array.Copy(strs,c.str, c.str.Length);
int.TryParse(GetSelect(dicCardRules,cb_cardrule,0),out c.ot); int.TryParse(GetSelect(dicCardRules,cb_cardrule,0),out c.ot);
int.TryParse(GetSelect(dicCardAttributes,cb_cardattribute,0),out c.attribute); int.TryParse(GetSelect(dicCardAttributes,cb_cardattribute,0),out c.attribute);
long.TryParse(GetSelect(dicCardLevels,cb_cardlevel,0),out c.level); long.TryParse(GetSelect(dicCardLevels,cb_cardlevel,0),out c.level);
long.TryParse(GetSelect(dicCardRaces,cb_cardrace,0),out c.race); long.TryParse(GetSelect(dicCardRaces,cb_cardrace,0),out c.race);
int.TryParse(GetSelect(dicSetnames, cb_setname1,1), out temp); long.TryParse(GetSelect(dicSetnames, cb_setname1,1), out ltemp);
c.setcode+=temp; c.setcode+=ltemp;
int.TryParse(GetSelect(dicSetnames, cb_setname2,1), out temp); long.TryParse(GetSelect(dicSetnames, cb_setname2,1), out ltemp);
c.setcode+=(temp<<0x10); c.setcode+=(ltemp<<0x10);
int.TryParse(GetSelect(dicSetnames, cb_setname3,1), out temp); long.TryParse(GetSelect(dicSetnames, cb_setname3,1), out ltemp);
c.setcode+=(temp<<0x20); c.setcode+=(ltemp<<0x20);
int.TryParse(GetSelect(dicSetnames, cb_setname4,1), out temp); long.TryParse(GetSelect(dicSetnames, cb_setname4,1), out ltemp);
c.setcode+=(temp<<0x30); c.setcode+=(ltemp<<0x30);
c.type=GetCheck(pl_cardtype); c.type=GetCheck(pl_cardtype);
c.category=GetCheck(pl_category); c.category=GetCheck(pl_category);
int.TryParse(tb_pleft.Text,out temp); int.TryParse(tb_pleft.Text,out temp);
c.level+=(temp << 0x18); c.level+=(temp << 0x18);
int.TryParse(tb_pright.Text,out temp); int.TryParse(tb_pright.Text,out temp);
...@@ -310,17 +330,17 @@ long GetCheck(FlowLayoutPanel fpl) ...@@ -310,17 +330,17 @@ long GetCheck(FlowLayoutPanel fpl)
void ShowMsg(string strMsg) void ShowMsg(string strMsg)
{ {
MessageBox.Show(strMsg, "提示", MessageBox.Show(strMsg, "提示",
MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
void ShowWarning(string strWarn) void ShowWarning(string strWarn)
{ {
MessageBox.Show(strWarn, "警告", MessageBox.Show(strWarn, "警告",
MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBoxButtons.OK, MessageBoxIcon.Warning);
} }
void ShowError(string strError) void ShowError(string strError)
{ {
MessageBox.Show(strError, "错误", MessageBox.Show(strError, "错误",
MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
bool ShowQuestion(string strQues) bool ShowQuestion(string strQues)
{ {
...@@ -345,38 +365,31 @@ void Lv_cardlistSelectedIndexChanged(object sender, EventArgs e) ...@@ -345,38 +365,31 @@ void Lv_cardlistSelectedIndexChanged(object sender, EventArgs e)
Card c=cardlist[index]; Card c=cardlist[index];
SetCard(c); SetCard(c);
//设置卡片图像 //设置卡片图像
imgform.SetImageFile(Path.Combine(PICPATH,c.id.ToString()+".jpg"),c.name); if(imgform.Visible)
imgform.SetImageFile(Path.Combine(PICPATH,c.id.ToString()+".jpg"),c.name);
} }
} }
} }
void AddListView(int p) void AddListView(int p)
{ {
int i,j,istart,iend; int i,j,istart,iend;
if(p<=0) if(p<=0)
{
p=1; p=1;
istart=(p-1)*MaxRow;
iend=p*MaxRow;
}
else if(p>=pageNum) else if(p>=pageNum)
{
p=pageNum; p=pageNum;
istart=(p-1)*MaxRow; istart=(p-1)*MaxRow;
iend=p*MaxRow;
if(iend>cardcount)
iend=cardcount; iend=cardcount;
}
else
{
istart=(p-1)*MaxRow;
iend=p*MaxRow;
}
page=p; page=p;
lv_cardlist.BeginUpdate(); lv_cardlist.BeginUpdate();
lv_cardlist.Items.Clear(); lv_cardlist.Items.Clear();
if((iend-istart)>0) if((iend-istart)>0)
{ {
ListViewItem[] items=new ListViewItem[iend-istart]; ListViewItem[] items=new ListViewItem[iend-istart];
for(i=istart,j=0;i < iend;i++,j++) for(i=istart,j=0;i < iend;i++,j++)
{ {
items[j]=new ListViewItem(); items[j]=new ListViewItem();
...@@ -393,15 +406,29 @@ void AddListView(int p) ...@@ -393,15 +406,29 @@ void AddListView(int p)
tb_page.Text=page.ToString(); tb_page.Text=page.ToString();
} }
void Lv_cardlistKeyDown(object sender, KeyEventArgs e)
{
switch(e.KeyCode)
{
case Keys.Delete:ShowMsg("del");break;
case Keys.Right:Btn_PageDownClick(null,null);break;
case Keys.Left:Btn_PageUpClick(null,null);break;
}
}
void Btn_PageUpClick(object sender, EventArgs e) void Btn_PageUpClick(object sender, EventArgs e)
{ {
if(!Check())
return;
page--; page--;
AddListView(page); AddListView(page);
} }
void Btn_PageDownClick(object sender, EventArgs e) void Btn_PageDownClick(object sender, EventArgs e)
{ {
if(!Check())
return;
page++; page++;
AddListView(page); AddListView(page);
} }
...@@ -418,7 +445,18 @@ void Tb_pageKeyPress(object sender, KeyPressEventArgs e) ...@@ -418,7 +445,18 @@ void Tb_pageKeyPress(object sender, KeyPressEventArgs e)
} }
#endregion #endregion
#region 卡片编辑 #region 卡片搜索,打开
public bool Check()
{
if(File.Exists(nowCdbFile))
return true;
else
{
ShowWarning("请打开一个数据库!");
return false;
}
}
public bool Open(string cdbFile) public bool Open(string cdbFile)
{ {
if(!File.Exists(cdbFile)) if(!File.Exists(cdbFile))
...@@ -426,14 +464,15 @@ public bool Open(string cdbFile) ...@@ -426,14 +464,15 @@ public bool Open(string cdbFile)
ShowMsg("文件不存在!\n"+cdbFile); ShowMsg("文件不存在!\n"+cdbFile);
return false; return false;
} }
nowCdbFile=cdbFile;
this.Text=cdbFile+"-"+title; this.Text=cdbFile+"-"+title;
cardlist.Clear(); cardlist.Clear();
SetCards(DataBase.Read(cdbFile,true,"")); SetCards(DataBase.Read(cdbFile,true,""),false);
return true; return true;
} }
public void SetCards(Card[] cards) public void SetCards(Card[] cards, bool isfresh)
{ {
if(cards!=null) if(cards!=null)
{ {
...@@ -444,88 +483,165 @@ public void SetCards(Card[] cards) ...@@ -444,88 +483,165 @@ public void SetCards(Card[] cards)
pageNum++; pageNum++;
tb_pagenum.Text=pageNum.ToString(); tb_pagenum.Text=pageNum.ToString();
cardlist.AddRange(cards); cardlist.AddRange(cards);
AddListView(1); if(isfresh)
AddListView(page);
else
AddListView(1);
} }
else else
{ {
#if DEBUG
ShowWarning("没有卡片!"); ShowWarning("没有卡片!");
#endif
cardcount=0;
page=1;
pageNum=1;
tb_page.Text=page.ToString();
tb_pagenum.Text=pageNum.ToString();
} }
} }
public void Search(Card c)
public void Search(Card c, bool isfresh)
{ {
if(!Check())
return;
srcCard=c;
string sql=DataBase.GetSelectSQL(c); string sql=DataBase.GetSelectSQL(c);
#if DEBUG #if DEBUG
ShowMsg(sql); ShowMsg(sql);
#endif #endif
SetCards(DataBase.Read(nowCdbFile, true, sql)); SetCards(DataBase.Read(nowCdbFile, true, sql),isfresh);
} }
public void Reset() public void Reset()
{ {
oldCard=new Card(0); oldCard=new Card(0);
SetCard(oldCard); SetCard(oldCard);
} }
public void Undo()
{
}
public void Redo() #endregion
{
#region 卡片编辑
} //添加
public bool Add() public bool AddCard()
{ {
if(!Check())
return false;
Card c=GetCard();
if(c.id<=0)
{
ShowError("卡片密码必须大于0!");
return false;
}
if(DataBase.Command(nowCdbFile, DataBase.GetInsertSQL(c,true))>=2)
{
ShowMsg("添加 "+c.ToString()+" 成功!");
Search(srcCard, true);
return true;
}
ShowError("添加 "+c.ToString()+" 失败!\n原因:可能已经存在该卡片.\n");
return false; return false;
} }
public bool Mod() //修改
public bool ModCard()
{ {
if(!Check())
return false;
Card c=GetCard();
if(c.Equals(oldCard))
{
ShowMsg("卡片没有改变!");
return false;
}
if(c.id<=0)
{
ShowError("卡片密码必须大于0!");
return false;
}
if(DataBase.Command(nowCdbFile, DataBase.GetUpdateSQL(c))>0)
{
ShowMsg("修改 "+c.ToString()+" 成功!");
Search(srcCard, true);
}
else
ShowError("修改失败!");
return false; return false;
} }
public bool Del() //删除
public bool DelCards()
{ {
if(!Check())
return false;
int ic=lv_cardlist.SelectedItems.Count;
if(ic>=0)
return false;
if(!ShowQuestion("是否删除选中的"+ic.ToString()+"张卡片?"))
return false;
List<string> sql=new List<string>();
foreach(ListViewItem lvitem in lv_cardlist.SelectedItems)
{
int index=lvitem.Index+(page-1)*MaxRow;
if(index<cardlist.Count)
{
Card c=cardlist[index];
sql.Add(DataBase.GetDeleteSQL(c));
}
}
if(DataBase.Command(nowCdbFile, sql.ToArray())>=(sql.Count*2))
{
ShowMsg("删除成功!");
Search(srcCard, true);
return true;
}
else
{
ShowError("删除失败!\n原因:可能是卡片的数据不完整。");
Search(srcCard, true);
}
return false; return false;
} }
//打开脚本
public bool OpenScript() public bool OpenScript()
{ {
if(!Check())
return false;
string lua=Path.Combine(LUAPTH,"c"+tb_cardcode.Text+".lua");
if(!File.Exists(lua))
{
if(ShowQuestion("是否创建脚本?\n"+lua))
{
File.Create(lua);
}
}
if(File.Exists(lua))
System.Diagnostics.Process.Start(lua);
return false; return false;
} }
public void OpanGame()
{
}
#endregion #endregion
#region 按钮 #region 按钮
//搜索卡片 //搜索卡片
void Btn_serachClick(object sender, EventArgs e) void Btn_serachClick(object sender, EventArgs e)
{ {
Search(GetCard()); Search(GetCard(), false);
} }
//重置卡片 //重置卡片
void Btn_resetClick(object sender, EventArgs e) void Btn_resetClick(object sender, EventArgs e)
{ {
Reset(); Reset();
} }
//还原
void Btn_redoClick(object sender, EventArgs e)
{
Redo();
}
//撤销
void Btn_undoClick(object sender, EventArgs e)
{
Undo();
}
//添加 //添加
void Btn_addClick(object sender, EventArgs e) void Btn_addClick(object sender, EventArgs e)
{ {
Add(); AddCard();
} }
//修改 //修改
void Btn_modClick(object sender, EventArgs e) void Btn_modClick(object sender, EventArgs e)
{ {
Mod(); ModCard();
} }
//打开脚本 //打开脚本
void Btn_luaClick(object sender, EventArgs e) void Btn_luaClick(object sender, EventArgs e)
...@@ -535,7 +651,7 @@ void Btn_luaClick(object sender, EventArgs e) ...@@ -535,7 +651,7 @@ void Btn_luaClick(object sender, EventArgs e)
//删除 //删除
void Btn_delClick(object sender, EventArgs e) void Btn_delClick(object sender, EventArgs e)
{ {
Del(); DelCards();
} }
#endregion #endregion
...@@ -543,12 +659,15 @@ void Btn_delClick(object sender, EventArgs e) ...@@ -543,12 +659,15 @@ void Btn_delClick(object sender, EventArgs e)
//卡片密码搜索 //卡片密码搜索
void Tb_cardcodeKeyPress(object sender, KeyPressEventArgs e) void Tb_cardcodeKeyPress(object sender, KeyPressEventArgs e)
{ {
Card c=new Card(0); if(e.KeyChar==(char)Keys.Enter)
long.TryParse(tb_cardcode.Text, out c.id);
if(c.id>0)
{ {
string sql=DataBase.GetSelectSQL(c); Card c=new Card(0);
SetCards(DataBase.Read(nowCdbFile, true, sql)); long.TryParse(tb_cardcode.Text, out c.id);
if(c.id>0)
{
string sql=DataBase.GetSelectSQL(c);
SetCards(DataBase.Read(nowCdbFile, true, sql), false);
}
} }
} }
//卡片名称搜索、编辑 //卡片名称搜索、编辑
...@@ -559,7 +678,7 @@ void Tb_cardnameKeyDown(object sender, KeyEventArgs e) ...@@ -559,7 +678,7 @@ void Tb_cardnameKeyDown(object sender, KeyEventArgs e)
Card c=new Card(0); Card c=new Card(0);
c.name=tb_cardname.Text; c.name=tb_cardname.Text;
string sql=DataBase.GetSelectSQL(c); string sql=DataBase.GetSelectSQL(c);
SetCards(DataBase.Read(nowCdbFile, true, sql)); SetCards(DataBase.Read(nowCdbFile, true, sql), false);
} }
} }
//卡片描述编辑 //卡片描述编辑
...@@ -580,11 +699,11 @@ void Setscripttext(string str) ...@@ -580,11 +699,11 @@ void Setscripttext(string str)
if(index>=0) if(index>=0)
{ {
strs[index]=str; strs[index]=str;
lb_scripttext.Items.Clear(); lb_scripttext.Items.Clear();
lb_scripttext.Items.AddRange(strs); lb_scripttext.Items.AddRange(strs);
lb_scripttext.SelectedIndex=index; lb_scripttext.SelectedIndex=index;
} }
} }
string Getscripttext() string Getscripttext()
{ {
...@@ -606,7 +725,7 @@ void Lb_scripttextSelectedIndexChanged(object sender, EventArgs e) ...@@ -606,7 +725,7 @@ void Lb_scripttextSelectedIndexChanged(object sender, EventArgs e)
{ {
tb_edittext.Text=Getscripttext(); tb_edittext.Text=Getscripttext();
} }
//脚本文本 //脚本文本
void Tb_edittextKeyPress(object sender, KeyPressEventArgs e) void Tb_edittextKeyPress(object sender, KeyPressEventArgs e)
{ {
...@@ -614,63 +733,96 @@ void Tb_edittextKeyPress(object sender, KeyPressEventArgs e) ...@@ -614,63 +733,96 @@ void Tb_edittextKeyPress(object sender, KeyPressEventArgs e)
Setscripttext(tb_edittext.Text); Setscripttext(tb_edittext.Text);
} }
#endregion #endregion
#region 帮助菜单 #region 帮助菜单
void Menuitem_aboutClick(object sender, EventArgs e) void Menuitem_aboutClick(object sender, EventArgs e)
{ {
ShowMsg("程序:DataEditorX\n作者:247321453\nE-mail:247321453@qq.com\n");
} }
void Menuitem_checkupdateClick(object sender, EventArgs e) void Menuitem_checkupdateClick(object sender, EventArgs e)
{ {
System.Diagnostics.Process.Start(UPDATEURL);
}
void Menuitem_githubClick(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(GITURL);
} }
#endregion #endregion
#region 文件菜单 #region 文件菜单
void Menuitem_openClick(object sender, EventArgs e) void Menuitem_openClick(object sender, EventArgs e)
{ {
using(OpenFileDialog dlg=new OpenFileDialog())
} {
dlg.Title="选择卡片数据库(cdb文件)";
void Menuitem_saveClick(object sender, EventArgs e) dlg.Filter="cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*";
{ if(dlg.ShowDialog()==DialogResult.OK)
{
} Open(dlg.FileName);
}
void Menuitem_saveasClick(object sender, EventArgs e) }
{
} }
void Menuitem_newClick(object sender, EventArgs e) void Menuitem_newClick(object sender, EventArgs e)
{ {
using(SaveFileDialog dlg=new SaveFileDialog())
{
dlg.Title="选择卡片数据库(cdb文件)保存位置";
dlg.Filter="cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*";
if(dlg.ShowDialog()==DialogResult.OK)
{
if(DataBase.Create(dlg.FileName))
{
Open(dlg.FileName);
}
}
}
} }
void Menuitem_copytoClick(object sender, EventArgs e) void Menuitem_copytoClick(object sender, EventArgs e)
{ {
if(!Check())
} return;
using(OpenFileDialog dlg=new OpenFileDialog())
void Menuitem_inportClick(object sender, EventArgs e) {
{ dlg.Title="选择卡片数据库(cdb文件)";
dlg.Filter="cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*";
} if(dlg.ShowDialog()==DialogResult.OK)
{
void Menuitem_exportClick(object sender, EventArgs e) if(ShowQuestion("是否覆盖已经存在的卡片?"))
{ DataBase.CopyDB(dlg.FileName,false,cardlist.ToArray());
else
DataBase.CopyDB(dlg.FileName,true,cardlist.ToArray());
}
}
} }
void Menuitem_readydkClick(object sender, EventArgs e) void Menuitem_readydkClick(object sender, EventArgs e)
{ {
if(!Check())
return;
using(OpenFileDialog dlg=new OpenFileDialog())
{
dlg.Title="选择卡组文件(ydk文件)";
dlg.Filter="ydk文件(*.ydk)|*.ydk|所有文件(*.*)|*.*";
if(dlg.ShowDialog()==DialogResult.OK)
{
SetCards(DataBase.ReadYdk(nowCdbFile, dlg.FileName), false);
}
}
} }
void Menuitem_readimagesClick(object sender, EventArgs e) void Menuitem_readimagesClick(object sender, EventArgs e)
{ {
if(!Check())
return;
using(FolderBrowserDialog fdlg=new FolderBrowserDialog())
{
fdlg.Description="请选择卡片图像目录";
if(fdlg.ShowDialog()==DialogResult.OK)
{
SetCards(DataBase.ReadImage(nowCdbFile, fdlg.SelectedPath), false);
}
}
} }
//关闭 //关闭
void Menuitem_quitClick(object sender, EventArgs e) void Menuitem_quitClick(object sender, EventArgs e)
...@@ -679,63 +831,25 @@ void Menuitem_quitClick(object sender, EventArgs e) ...@@ -679,63 +831,25 @@ void Menuitem_quitClick(object sender, EventArgs e)
} }
#endregion #endregion
#region 编辑菜单 #region 设置菜单
void Menuitem_undoClick(object sender, EventArgs e)
{
Undo();
}
void Menuitem_redoClick(object sender, EventArgs e)
{
Redo();
}
void Menuitem_addClick(object sender, EventArgs e)
{
Add();
}
void Menuitem_modClick(object sender, EventArgs e)
{
Mod();
}
void Menuitem_delClick(object sender, EventArgs e)
{
Del();
}
void Menuitem_searchClick(object sender, EventArgs e)
{
Search(GetCard());
}
void Menuitem_resetClick(object sender, EventArgs e)
{
Reset();
}
void Menuitem_showimageClick(object sender, EventArgs e) void Menuitem_showimageClick(object sender, EventArgs e)
{ {
if(menuitem_showimage.Checked) if(menuitem_showimage.Checked)
{
imgform.SetImageFile(
Path.Combine(PICPATH, tb_cardcode.Text+".jpg"),
tb_cardname.Text);
imgform.Show(); imgform.Show();
else }
imgform.Hide(); else
imgform.Hide();
} }
void OnimgFormClosed(object sender, EventArgs e) void OnimgFormClosed(object sender, EventArgs e)
{ {
menuitem_showimage.Checked=imgform.Visible; menuitem_showimage.Checked=imgform.Visible;
}
void Menuitem_openscriptClick(object sender, EventArgs e)
{
OpenScript();
}
void Menuitem_opengameClick(object sender, EventArgs e)
{
OpanGame();
} }
#endregion #endregion
} }
} }
...@@ -120,9 +120,6 @@ ...@@ -120,9 +120,6 @@
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>130, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value> <value>25</value>
</metadata> </metadata>
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
<AssemblyName>DataEditorX</AssemblyName> <AssemblyName>DataEditorX</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<StartupObject>DataEditorX.Program</StartupObject>
<ApplicationIcon>icon.ico</ApplicationIcon>
<NoWin32Manifest>False</NoWin32Manifest>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("DataEditorX")] [assembly: AssemblyTitle("DataEditorX")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("E-mail:247321452@qq.com")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DataEditorX")] [assembly: AssemblyProduct("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