Commit 0f7fed32 authored by 247321453's avatar 247321453

fix

parent f102d643
...@@ -222,21 +222,21 @@ private void InitializeComponent() ...@@ -222,21 +222,21 @@ private void InitializeComponent()
// //
this.menuitem_about.Name = "menuitem_about"; this.menuitem_about.Name = "menuitem_about";
this.menuitem_about.ShortcutKeys = System.Windows.Forms.Keys.F1; this.menuitem_about.ShortcutKeys = System.Windows.Forms.Keys.F1;
this.menuitem_about.Size = new System.Drawing.Size(152, 22); this.menuitem_about.Size = new System.Drawing.Size(136, 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(152, 22); this.menuitem_checkupdate.Size = new System.Drawing.Size(136, 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 // menuitem_github
// //
this.menuitem_github.Name = "menuitem_github"; this.menuitem_github.Name = "menuitem_github";
this.menuitem_github.Size = new System.Drawing.Size(152, 22); this.menuitem_github.Size = new System.Drawing.Size(136, 22);
this.menuitem_github.Text = "程序源码"; this.menuitem_github.Text = "程序源码";
this.menuitem_github.Click += new System.EventHandler(this.Menuitem_githubClick); this.menuitem_github.Click += new System.EventHandler(this.Menuitem_githubClick);
// //
...@@ -781,7 +781,7 @@ private void InitializeComponent() ...@@ -781,7 +781,7 @@ private void InitializeComponent()
this.MaximizeBox = false; 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 = "DataEditorX";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DataEditFormFormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DataEditFormFormClosing);
this.Load += new System.EventHandler(this.DataEditFormLoad); this.Load += new System.EventHandler(this.DataEditFormLoad);
this.menuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false);
......
...@@ -6,18 +6,17 @@ ...@@ -6,18 +6,17 @@
* *
*/ */
using System; using System;
using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Globalization;
using System.IO; using System.IO;
using System.Collections.Generic;
using DataEditorX.Core;
using System.Text; using System.Text;
using System.Windows.Forms;
using DataEditorX.Core;
namespace DataEditorX namespace DataEditorX
{ {
/// <summary>
/// Description of DataEditForm.
/// </summary>
public partial class DataEditForm : Form public partial class DataEditForm : Form
{ {
#region 成员变量 #region 成员变量
...@@ -65,10 +64,12 @@ public DataEditForm() ...@@ -65,10 +64,12 @@ public DataEditForm()
void DataEditFormLoad(object sender, EventArgs e) void DataEditFormLoad(object sender, EventArgs e)
{ {
InitListRows(); InitListRows();
title=this.Text; Version ver =new Version(Application.ProductVersion);
string strVer = ver.ToString();
#if DEBUG #if DEBUG
title=title+"(DEBUG)"; this.Text=this.Text+"(DEBUG)"+" 版本:"+strVer;
#endif #endif
title=this.Text;
imgform.VisibleChanged+=OnimgFormClosed; imgform.VisibleChanged+=OnimgFormClosed;
InitPath(); InitPath();
...@@ -281,10 +282,21 @@ void SetSelect(Dictionary<long, string> dic,ComboBox cb, long k) ...@@ -281,10 +282,21 @@ void SetSelect(Dictionary<long, string> dic,ComboBox cb, long k)
} }
if(index==cb.Items.Count) if(index==cb.Items.Count)
{ {
string word="0x"+k.ToString("x"); string word=k.ToString("x");
if(!dic.ContainsKey(k)) if(!dic.ContainsKey(k))
dic.Add(k, word); dic.Add(k, word);
cb.Items.Add(word); if(cb.Name==cb_setname1.Name
||cb.Name==cb_setname2.Name
||cb.Name==cb_setname3.Name
||cb.Name==cb_setname4.Name)
{
cb_setname1.Items.Add(word);
cb_setname2.Items.Add(word);
cb_setname3.Items.Add(word);
cb_setname4.Items.Add(word);
}
else
cb.Items.Add(word);
} }
cb.SelectedIndex=index; cb.SelectedIndex=index;
} }
...@@ -301,18 +313,18 @@ Card GetCard() ...@@ -301,18 +313,18 @@ Card GetCard()
c.desc=tb_cardtext.Text; c.desc=tb_cardtext.Text;
Array.Copy(strs,c.str, c.str.Length); Array.Copy(strs,c.str, c.str.Length);
int.TryParse(GetSelect(dicCardRules,cb_cardrule,0),out c.ot); int.TryParse(GetSelect(dicCardRules,cb_cardrule),out c.ot);
int.TryParse(GetSelect(dicCardAttributes,cb_cardattribute,0),out c.attribute); int.TryParse(GetSelect(dicCardAttributes,cb_cardattribute),out c.attribute);
long.TryParse(GetSelect(dicCardLevels,cb_cardlevel,0),out c.level); long.TryParse(GetSelect(dicCardLevels,cb_cardlevel),out c.level);
long.TryParse(GetSelect(dicCardRaces,cb_cardrace,0),out c.race); long.TryParse(GetSelect(dicCardRaces,cb_cardrace),out c.race);
long.TryParse(GetSelect(dicSetnames, cb_setname1,1), out ltemp); long.TryParse(GetSelect(dicSetnames, cb_setname1), out ltemp);
c.setcode+=ltemp; c.setcode+=ltemp;
long.TryParse(GetSelect(dicSetnames, cb_setname2,1), out ltemp); long.TryParse(GetSelect(dicSetnames, cb_setname2), out ltemp);
c.setcode+=(ltemp<<0x10); c.setcode+=(ltemp<<0x10);
long.TryParse(GetSelect(dicSetnames, cb_setname3,1), out ltemp); long.TryParse(GetSelect(dicSetnames, cb_setname3), out ltemp);
c.setcode+=(ltemp<<0x20); c.setcode+=(ltemp<<0x20);
long.TryParse(GetSelect(dicSetnames, cb_setname4,1), out ltemp); long.TryParse(GetSelect(dicSetnames, cb_setname4), out ltemp);
c.setcode+=(ltemp<<0x30); c.setcode+=(ltemp<<0x30);
c.type=GetCheck(pl_cardtype); c.type=GetCheck(pl_cardtype);
...@@ -330,17 +342,23 @@ Card GetCard() ...@@ -330,17 +342,23 @@ Card GetCard()
return c; return c;
} }
string GetSelect(Dictionary<long, string> dic,ComboBox cb, int start) string GetSelect(Dictionary<long, string> dic,ComboBox cb)
{ {
long fkey=0; long fkey=0;
bool isfind=false;
foreach(long key in dic.Keys) foreach(long key in dic.Keys)
{ {
if(cb.Text==dic[key]) if(cb.Text==dic[key])
{ {
fkey=key; fkey=key;
isfind=true;
break; break;
} }
} }
if(!isfind)
{
long.TryParse(cb.Text, NumberStyles.HexNumber, null, out fkey);
}
return fkey.ToString(); return fkey.ToString();
} }
long GetCheck(FlowLayoutPanel fpl) long GetCheck(FlowLayoutPanel fpl)
...@@ -767,7 +785,10 @@ void Tb_edittextKeyPress(object sender, KeyPressEventArgs e) ...@@ -767,7 +785,10 @@ void Tb_edittextKeyPress(object sender, KeyPressEventArgs e)
#region 帮助菜单 #region 帮助菜单
void Menuitem_aboutClick(object sender, EventArgs e) void Menuitem_aboutClick(object sender, EventArgs e)
{ {
MyMsg.Show("程序:DataEditorX\n作者:247321453\nE-mail:247321453@qq.com\n"); MyMsg.Show("程序:"+Application.ProductName
+"\n版本:"+Application.ProductVersion
+"\n作者:247321453"
+"\nE-mail:247321453@qq.com\n");
} }
void Menuitem_checkupdateClick(object sender, EventArgs e) void Menuitem_checkupdateClick(object sender, EventArgs e)
......
...@@ -28,4 +28,4 @@ ...@@ -28,4 +28,4 @@
// //
// You can specify all the values or you can use the default the Revision and // You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below: // Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.1.0.2")] [assembly: AssemblyVersion("1.1.0.3")]
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