Commit eab7049c authored by keyongyu's avatar keyongyu

2.1.4.0

parent b547ffee
...@@ -128,26 +128,26 @@ public static int Command(string DB, params string[] SQLs) ...@@ -128,26 +128,26 @@ public static int Command(string DB, params string[] SQLs)
static Card ReadCard(SQLiteDataReader reader,bool reNewLine) static Card ReadCard(SQLiteDataReader reader,bool reNewLine)
{ {
Card c = new Card(0); Card c = new Card(0);
c.id = reader.GetInt64(0); c.id = reader.GetInt64(reader.GetOrdinal("id"));
c.ot = reader.GetInt32(1); c.ot = reader.GetInt32(reader.GetOrdinal("ot"));
c.alias = reader.GetInt64(2); c.alias = reader.GetInt64(reader.GetOrdinal("alias"));
c.setcode = reader.GetInt64(3); c.setcode = reader.GetInt64(reader.GetOrdinal("setcode"));
c.type = reader.GetInt64(4); c.type = reader.GetInt64(reader.GetOrdinal("type"));
c.atk = reader.GetInt32(5); c.atk = reader.GetInt32(reader.GetOrdinal("atk"));
c.def = reader.GetInt32(6); c.def = reader.GetInt32(reader.GetOrdinal("def"));
c.level = reader.GetInt64(7); c.level = reader.GetInt64(reader.GetOrdinal("level"));
c.race = reader.GetInt64(8); c.race = reader.GetInt64(reader.GetOrdinal("race"));
c.attribute = reader.GetInt32(9); c.attribute = reader.GetInt32(reader.GetOrdinal("attribute"));
c.category = reader.GetInt64(10); c.category = reader.GetInt64(reader.GetOrdinal("category"));
c.name = reader.GetString(12); c.name = reader.GetString(reader.GetOrdinal("name"));
c.desc = reader.GetString(13); c.desc = reader.GetString(reader.GetOrdinal("desc"));
if(reNewLine) if(reNewLine)
c.desc=Retext(c.desc); c.desc=Retext(c.desc);
string temp = null; string temp = null;
for ( int i = 0; i < 0x10; i++ ) for ( int i = 0; i < 0x10; i++ )
{ {
temp = reader.GetString(14 + i); temp = reader.GetString(reader.GetOrdinal("str"+(i+1).ToString()));
c.str[i]= ( temp == null ) ? "":temp; c.str[i]= ( temp == null ) ? "":temp;
} }
return c; return c;
...@@ -170,6 +170,7 @@ static string Retext(string text) ...@@ -170,6 +170,7 @@ static string Retext(string text)
public static Card[] Read(string DB,bool reNewLine, params string[] SQLs) public static Card[] Read(string DB,bool reNewLine, params string[] SQLs)
{ {
List<Card> list=new List<Card>(); List<Card> list=new List<Card>();
List<long> idlist=new List<long>();
string SQLstr = ""; string SQLstr = "";
if ( File.Exists(DB) && SQLs != null ) if ( File.Exists(DB) && SQLs != null )
{ {
...@@ -182,18 +183,29 @@ public static Card[] Read(string DB,bool reNewLine, params string[] SQLs) ...@@ -182,18 +183,29 @@ public static Card[] Read(string DB,bool reNewLine, params string[] SQLs)
{ {
foreach ( string str in SQLs ) foreach ( string str in SQLs )
{ {
int tmp;
int.TryParse(str, out tmp);
if ( string.IsNullOrEmpty(str) ) if ( string.IsNullOrEmpty(str) )
SQLstr = defaultSQL; SQLstr = defaultSQL;
else if ( str.Length < 20 ) else if ( tmp >0)
SQLstr = defaultSQL + " and datas.id=" + str; SQLstr = defaultSQL + " and datas.id=" + tmp.ToString();
else else if ( str.StartsWith("select",StringComparison.OrdinalIgnoreCase))
SQLstr = str; SQLstr = str;
else if(str.IndexOf("and ")>=0)
SQLstr = defaultSQL + str;
else
SQLstr = defaultSQL + " and texts.name like '%" + str+"%'";
sqlitecommand.CommandText = SQLstr; sqlitecommand.CommandText = SQLstr;
using ( SQLiteDataReader reader = sqlitecommand.ExecuteReader() ) using ( SQLiteDataReader reader = sqlitecommand.ExecuteReader() )
{ {
while ( reader.Read() ) while ( reader.Read() )
{ {
list.Add(ReadCard(reader,reNewLine)); Card c=ReadCard(reader,reNewLine);
if(idlist.IndexOf(c.id)<0){//不存在,则添加
idlist.Add(c.id);
list.Add(c);
}
} }
reader.Close(); reader.Close();
} }
......
...@@ -69,6 +69,7 @@ DataEditorX.exe.config ...@@ -69,6 +69,7 @@ DataEditorX.exe.config
2.1.4.0 2.1.4.0
改善: 改善:
浏览和导入MSE图片库的图片 浏览和导入MSE图片库的图片
按图像读取,可以支持读取卡片名的图片
2.1.3.1 2.1.3.1
修复: 修复:
支持浏览和导入MSE图片库的图片 支持浏览和导入MSE图片库的图片
......
No preview for this file type
...@@ -69,6 +69,7 @@ DataEditorX.exe.config ...@@ -69,6 +69,7 @@ DataEditorX.exe.config
2.1.4.0 2.1.4.0
改善: 改善:
浏览和导入MSE图片库的图片 浏览和导入MSE图片库的图片
按图像读取,可以支持读取卡片名的图片
2.1.3.1 2.1.3.1
修复: 修复:
支持浏览和导入MSE图片库的图片 支持浏览和导入MSE图片库的图片
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment