Commit 63c5c74f authored by keyongyu's avatar keyongyu

2.2.8.1

parent c99eb604
......@@ -53,6 +53,7 @@ private void InitializeComponent()
this.tb_input = new System.Windows.Forms.TextBox();
this.fctb = new FastColoredTextBoxNS.FastColoredTextBoxEx();
this.documentMap1 = new FastColoredTextBoxNS.DocumentMap();
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.fctb)).BeginInit();
this.SuspendLayout();
......@@ -257,6 +258,10 @@ private void InitializeComponent()
this.documentMap1.Text = "documentMap1";
this.documentMap1.Visible = false;
//
// backgroundWorker1
//
this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
//
// CodeEditForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -298,6 +303,7 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem menuitem_open;
private System.Windows.Forms.ToolStripMenuItem menuitem_file;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.ComponentModel.BackgroundWorker backgroundWorker1;
}
......
......@@ -41,6 +41,7 @@ public partial class CodeEditForm : DockContent
string oldtext;
Dictionary<string,string> tooltipDic;
bool tabisspaces = false;
string nowcdb;
public CodeEditForm()
{
InitForm();
......@@ -121,13 +122,13 @@ public void Open(string file)
nowFile=file;
string cdb=MyPath.Combine(
Path.GetDirectoryName(file),"../cards.cdb");
if(File.Exists(cdb))
SetCards(cdb);
SetCards(cdb);
fctb.OpenFile(nowFile, new UTF8Encoding(false));
oldtext=fctb.Text;
SetTitle();
}
}
void HideMenu()
{
if(this.MdiParent ==null)
......@@ -447,7 +448,9 @@ void MenuItem_Click(object sender, EventArgs e)
}
public void SetCards(string name)
{
SetCards(DataBase.Read(name, true,""));
nowcdb = name;
if (!backgroundWorker1.IsBusy)
backgroundWorker1.RunWorkerAsync();
}
public void SetCards(Card[] cards)
{
......@@ -499,5 +502,11 @@ void FctbMouseClick(object sender, MouseEventArgs e)
}
}
#endregion
private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
{
if (nowcdb !=null && File.Exists(nowcdb))
SetCards(DataBase.Read(nowcdb, true,""));
}
}
}
......@@ -120,6 +120,9 @@
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>137, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>44</value>
</metadata>
......
......@@ -4,6 +4,7 @@
* ModiftyDate :2014-02-12
*/
using System;
using System.Text.RegularExpressions;
namespace DataEditorX.Core
{
......@@ -86,31 +87,36 @@ public override bool Equals(object obj)
/// </summary>
public override string ToString()
{
string str = "";
if(IsType(CardType.TYPE_MONSTER))
return string.Format("{0}[{1}]\nType: 0x{2}\n{3}{4}/{5}\n {6}",
name, idString,type.ToString("x"),
str = string.Format("{0}[{1}]\n[{2}] {3}/{4}\n{5} {6}/{7}\n {8}",
name, idString,YGOUtil.GetTypeString(type),
YGOUtil.GetRace(race),
YGOUtil.GetAttributeString(attribute),
levelString(),atk,def,redesc());
return string.Format("{0}[{1}]\nType: 0x{2}\n{3}",
name, idString,type.ToString("x"),redesc());
}
else
str = string.Format("{0}[{1}]\n[{2}]\n{3}",
name, idString, YGOUtil.GetTypeString(type), redesc());
return str;
}
string levelString()
{
string star="[";
long i=0,j=level&0xff;
for(i=0;i<j;i++)
star +="★";
return star+"] "+j.ToString()+" ";
for (i = 0; i < j; i++)
{
if ( i>=0 && (i % 4) == 0)
star += " ";
star += "★";
}
return star+"]";
}
string redesc()
{
return desc
.Replace(Environment.NewLine, "")
//.Replace(",",",\n")
.Replace("。","。\n")
.Replace("?","?\n")
//.Replace(",",",\n")
//.Replace(".",".\n")
.Replace("?","?\n");
string str = desc.Replace(Environment.NewLine, "\n");
str = Regex.Replace(str, "([。|?|?])", "$1\n");
str = str.Replace("\n\n", "\n");
return str;
}
public bool EqualsData(Card other)
{
......
......@@ -283,7 +283,26 @@ static string GetType(CardType type)
{
return DataManager.GetValue(datacfg.dicCardTypes, (long)type);
}
public static string GetTypeString(long type)
{
string str="";
foreach (long k in datacfg.dicCardTypes.Keys)
{
if ((type & k) == k)
str += GetType((CardType)k)+"|";
}
if (str.Length > 0)
str = str.Substring(0, str.Length - 1);
else
str = "???";
return str;
}
public static string GetSetNameString(long type)
{
return "";
}
public static string GetDesc(string desc, string regx)
{
desc = desc.Replace(Environment.NewLine, "\n");
......
......@@ -234,9 +234,7 @@ public void OpenScript(string file)
LANG.SetLanguage(cf);
InitCodeEditor();
cf.SetCDBList(hittorylist.ToArray());
cf.DockAreas = DockAreas.Document;
cf.InitTooltip(codecfg.TooltipDic,
codecfg.FunList, codecfg.ConList);
cf.InitTooltip(codecfg.TooltipDic, codecfg.FunList, codecfg.ConList);
//cf.SetIMEMode(ImeMode.Inherit);
cf.Open(file);
cf.Show(dockPanel1, DockState.Document);
......
......@@ -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("2.2.8.0")]
[assembly: AssemblyVersion("2.2.8.1")]
[DataEditorX]2.2.8.0[DataEditorX]
[DataEditorX]2.2.8.1[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★捐助
......@@ -63,6 +63,8 @@ Ctrl+鼠标左键 跳转到函数定义
Ctrl+鼠标滑轮 缩放文字
★更新历史
2.2.8.1
卡片描述完善,加快打开lua的速度。
2.2.8.0
修正setcode搜索
在打开的时候,自动检查更新
......
No preview for this file type
# history
F:\games\ygopro\script\c47198668.lua
F:\games\ygopro\script\c4239451.lua
F:\games\ygopro\script\c93368494.lua
F:\games\ygopro\cards.cdb
F:\games\ygopro\script\c168917.lua
F:\games\ygopro\script\c50485594.lua
F:\games\ygopro\script\c17857780.lua
F:\games\ygopro\script\c27551.lua
F:\games\ygopro\p.zip.cdb
F:\games\ygopro\script\c168917.lua
F:\games\ygopro\script\c47198668.lua
F:\games\ygopro\script\c50485594.lua
F:\games\ygopro\script\c65518099.lua
F:\games\ygopro\script\c64496451.lua
F:\games\ygopro\script\c78835747.lua
\ No newline at end of file
[DataEditorX]2.2.8.0[DataEditorX]
[DataEditorX]2.2.8.1[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★捐助
......@@ -63,6 +63,8 @@ Ctrl+鼠标左键 跳转到函数定义
Ctrl+鼠标滑轮 缩放文字
★更新历史
2.2.8.1
卡片描述完善,加快打开lua的速度。
2.2.8.0
修正setcode搜索
在打开的时候,自动检查更新
......
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