Commit 483dc120 authored by 247321453's avatar 247321453

1.2.1.2

parent 715a9175
......@@ -317,23 +317,6 @@ public static string GetSelectSQL(Card c)
sb.Append(" and texts.name like '%"+c.name+"%' ");
if(!string.IsNullOrEmpty(c.desc))
sb.Append(" and texts.desc like '%"+c.desc+"%' ");
/*
if(c.setcode>0)
{
string temp;
temp=toInt(c.setcode);
sb.Append(" and ( datas.setcode & "+temp+"="+temp);
temp=toInt(c.setcode<<0x10);
if(temp!="0")
sb.Append(" or datas.setcode & "+temp+"="+temp);
temp=toInt(c.setcode<<0x20);
if(temp!="0")
sb.Append(" or datas.setcode & "+temp+"="+temp);
temp=toInt(c.setcode<<0x30);
if(temp!="0")
sb.Append(" or datas.setcode & "+temp+"="+temp);
sb.Append(" ) ");
}*/
if(c.ot>0)
sb.Append(" and datas.ot & "+c.ot.ToString()+" = "+c.ot.ToString());
if(c.attribute>0)
......@@ -346,14 +329,13 @@ public static string GetSelectSQL(Card c)
sb.Append(" and datas.type & "+toInt(c.type)+" = "+toInt(c.type));
if(c.category>0)
sb.Append(" and datas.category & "+toInt(c.category)+" = "+toInt(c.category));
if(c.id>0 && c.alias<0)
sb.Append(" and datas.id >= "+c.id.ToString());
else if(c.id>0 && c.alias>0)
if(c.id>0 && c.alias>0)
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)
sb.Append(" and datas.id="+c.id.ToString());
{
sb.Append(" and ( datas.id="+c.id.ToString()+" or datas.alias="+c.id.ToString()+") ");
}
else if(c.alias>0)
sb.Append(" and datas.alias= "+c.alias.ToString());
return sb.ToString();
......
......@@ -222,21 +222,21 @@ private void InitializeComponent()
//
this.menuitem_about.Name = "menuitem_about";
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(124, 22);
this.menuitem_about.Text = "关于";
this.menuitem_about.Click += new System.EventHandler(this.Menuitem_aboutClick);
//
// 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(124, 22);
this.menuitem_checkupdate.Text = "检查更新";
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.Size = new System.Drawing.Size(124, 22);
this.menuitem_github.Text = "程序源码";
this.menuitem_github.Click += new System.EventHandler(this.Menuitem_githubClick);
//
......@@ -252,11 +252,11 @@ private void InitializeComponent()
this.lv_cardlist.GridLines = true;
this.lv_cardlist.HideSelection = false;
this.lv_cardlist.LabelWrap = false;
this.lv_cardlist.Location = new System.Drawing.Point(0, 26);
this.lv_cardlist.Location = new System.Drawing.Point(1, 26);
this.lv_cardlist.Name = "lv_cardlist";
this.lv_cardlist.Scrollable = false;
this.lv_cardlist.ShowItemToolTips = true;
this.lv_cardlist.Size = new System.Drawing.Size(218, 492);
this.lv_cardlist.Size = new System.Drawing.Size(216, 492);
this.lv_cardlist.TabIndex = 1;
this.lv_cardlist.UseCompatibleStateImageBehavior = false;
this.lv_cardlist.View = System.Windows.Forms.View.Details;
......
......@@ -36,6 +36,8 @@ public partial class DataEditForm : Form
int cardcount;
List<Card> cardlist=new List<Card>();
Image m_cover;
Dictionary<long, string> dicCardRules=null;
Dictionary<long, string> dicCardAttributes=null;
Dictionary<long, string> dicCardRaces=null;
......@@ -55,11 +57,13 @@ public partial class DataEditForm : Form
void SetCDB(string cdb)
{
this.nowCdbFile=cdb;
this.Text=nowCdbFile+"-"+title;
char SEP=Path.DirectorySeparatorChar;
int l=nowCdbFile.LastIndexOf(SEP);
GAMEPATH=(l>0)?nowCdbFile.Substring(0,l+1):cdb;
if(cdb.Length>0)
{
this.Text=nowCdbFile+"-"+title;
char SEP=Path.DirectorySeparatorChar;
int l=nowCdbFile.LastIndexOf(SEP);
GAMEPATH=(l>0)?nowCdbFile.Substring(0,l+1):cdb;
}
PICPATH=Path.Combine(GAMEPATH,"pics");
if(!Directory.Exists(PICPATH))
Directory.CreateDirectory(PICPATH);
......@@ -69,8 +73,6 @@ void SetCDB(string cdb)
}
#endregion
#region 界面初始化
public DataEditForm(string cdbfile)
{
......@@ -108,6 +110,13 @@ void DataEditFormLoad(object sender, EventArgs e)
void InitPath()
{
GAMEPATH=Application.StartupPath;
PICPATH=Path.Combine(GAMEPATH,"pics");
if(!Directory.Exists(PICPATH))
Directory.CreateDirectory(PICPATH);
LUAPTH=Path.Combine(GAMEPATH,"script");
if(!Directory.Exists(LUAPTH))
Directory.CreateDirectory(LUAPTH);
string datapath=Path.Combine(Application.StartupPath,"data");
string urltxt=Path.Combine(datapath,"update.txt");
......@@ -167,7 +176,12 @@ public void InitForm()
InitCheckPanel(pl_category, dicCardcategorys);
//
if(File.Exists(confcover))
imgform.SetDefault(Image.FromFile(confcover));
{
m_cover=Image.FromFile(confcover);
imgform.SetImage(m_cover,"卡片图像");
}
else
m_cover=null;
}
//初始化FlowLayoutPanel
void InitCheckPanel(FlowLayoutPanel fpanel, Dictionary<long, string> dic)
......@@ -393,6 +407,17 @@ long GetCheck(FlowLayoutPanel fpl)
#endregion
#region 卡片列表
void SetCardImage(string id,string name)
{
if(imgform.Visible)
{
string f=Path.Combine(PICPATH, id.ToString()+".jpg");
if(File.Exists(f))
imgform.SetImage(Image.FromFile(f), name+" ["+id+"]");
else
imgform.SetImage(m_cover, name+" ["+id+"]");
}
}
void Lv_cardlistSelectedIndexChanged(object sender, EventArgs e)
{
if(lv_cardlist.SelectedItems.Count>0)
......@@ -404,8 +429,7 @@ void Lv_cardlistSelectedIndexChanged(object sender, EventArgs e)
Card c=cardlist[index];
SetCard(c);
//设置卡片图像
if(imgform.Visible)
imgform.SetImageFile(Path.Combine(PICPATH,c.id.ToString()+".jpg"),c.name);
SetCardImage(c.id.ToString(), c.name);
}
}
}
......@@ -428,16 +452,17 @@ void AddListView(int p)
if((iend-istart)>0)
{
ListViewItem[] items=new ListViewItem[iend-istart];
Card mcard;
for(i=istart,j=0;i < iend;i++,j++)
{
mcard=cardlist[i];
items[j]=new ListViewItem();
items[j].Text=cardlist[i].id.ToString();
items[j].Text=mcard.id.ToString();
if ( i % 2 == 0 )
items[j].BackColor = Color.GhostWhite;
else
items[j].BackColor = Color.White;
items[j].SubItems.Add(cardlist[i].name);
items[j].SubItems.Add(mcard.name);
}
lv_cardlist.Items.AddRange(items);
}
......@@ -828,10 +853,10 @@ void Menuitem_checkupdateClick(object sender, EventArgs e)
System.Diagnostics.Process.Start(VERURL);
}
}
else if(iver2>0)
MyMsg.Show("已经是最新版本!\n版本号:"+newver);
else
{
MyMsg.Show("已经是最新版本!");
}
MyMsg.Error("查询失败!\n请检查计算机的网络连接。");
}
string CheckUpdate(string url)
{
......@@ -995,9 +1020,7 @@ void Menuitem_showimageClick(object sender, EventArgs e)
{
if(menuitem_showimage.Checked)
{
imgform.SetImageFile(
Path.Combine(PICPATH, tb_cardcode.Text+".jpg"),
tb_cardname.Text);
SetCardImage(tb_cardcode.Text, tb_cardname.Text);
imgform.Show();
}
else
......@@ -1006,7 +1029,6 @@ void Menuitem_showimageClick(object sender, EventArgs e)
void OnimgFormClosed(object sender, EventArgs e)
{
menuitem_showimage.Checked=imgform.Visible;
}
#endregion
......
......@@ -20,29 +20,15 @@ public ImageForm()
{
InitializeComponent();
}
Image deimg=null;
void ImageFormFormClosing(object sender, FormClosingEventArgs e)
{
this.Hide();
e.Cancel=true;
}
public void SetDefault(Image img)
{
deimg=img;
SetImage(img,"默认");
}
public void SetImage(Image img,string title)
{
this.Text=title;
this.BackgroundImage=img;
}
public void SetImageFile(string file,string title)
{
this.Text=title;
if(System.IO.File.Exists(file))
this.BackgroundImage=Image.FromFile(file);
else
this.BackgroundImage=deimg;
}
}
}
......@@ -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("1.2.1.1")]
[assembly: AssemblyVersion("1.2.1.2")]
......@@ -21,6 +21,12 @@ data\ygopro.txt
★更新历史
1.2.1.2
按密码搜索一样会显示同名卡
更改密码搜索
按密码搜索:密码框>0 同名框=0
按同名搜索:密码框=0 同名框>0
按密码范围搜索:密码框>0 同名框>0
1.2.1.1
自动把游戏目录设为cdb的目录
1.2.1.0
......
No preview for this file type
......@@ -21,6 +21,12 @@ data\ygopro.txt
★更新历史
1.2.1.2
按密码搜索一样会显示同名卡
更改密码搜索
按密码搜索:密码框>0 同名框=0
按同名搜索:密码框=0 同名框>0
按密码范围搜索:密码框>0 同名框>0
1.2.1.1
自动把游戏目录设为cdb的目录
1.2.1.0
......
File added
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