Commit 79c92359 authored by keyongyu's avatar keyongyu

2.2.7.2

parent 1491cfc3
This diff is collapsed.
...@@ -36,6 +36,7 @@ public partial class CodeEditForm : DockContent ...@@ -36,6 +36,7 @@ public partial class CodeEditForm : DockContent
AutocompleteMenu popupMenu_con; AutocompleteMenu popupMenu_con;
AutocompleteMenu popupMenu_find; AutocompleteMenu popupMenu_find;
string nowFile; string nowFile;
public string NowFile { get { return nowFile; } }
string title; string title;
string oldtext; string oldtext;
Dictionary<string,string> tooltipDic; Dictionary<string,string> tooltipDic;
...@@ -84,7 +85,6 @@ void InitForm() ...@@ -84,7 +85,6 @@ void InitForm()
fctb.ImeMode=ImeMode.On; fctb.ImeMode=ImeMode.On;
} }
public void LoadXml(string xmlfile) public void LoadXml(string xmlfile)
{ {
fctb.DescriptionFile=xmlfile; fctb.DescriptionFile=xmlfile;
......
...@@ -33,7 +33,6 @@ public partial class MainForm : Form ...@@ -33,7 +33,6 @@ public partial class MainForm : Form
string conflang,conflang_de,conflang_ce,confmsg,conflang_pe; string conflang,conflang_de,conflang_ce,confmsg,conflang_pe;
DataEditForm compare1,compare2; DataEditForm compare1,compare2;
Card[] tCards; Card[] tCards;
Dictionary<DataEditForm,string> list;
// //
DataConfig datacfg = null; DataConfig datacfg = null;
CodeConfig codecfg = null; CodeConfig codecfg = null;
...@@ -57,7 +56,6 @@ void Init(string datapath) ...@@ -57,7 +56,6 @@ void Init(string datapath)
tCards = null; tCards = null;
hittorylist = new List<string>(); hittorylist = new List<string>();
list = new Dictionary<DataEditForm,string>();
this.datapath = datapath; this.datapath = datapath;
InitDataEditor(); InitDataEditor();
InitCodeEditor(); InitCodeEditor();
...@@ -180,11 +178,13 @@ void MenuHistoryItem_Click(object sender, EventArgs e) ...@@ -180,11 +178,13 @@ void MenuHistoryItem_Click(object sender, EventArgs e)
{ {
ToolStripMenuItem tsmi=sender as ToolStripMenuItem; ToolStripMenuItem tsmi=sender as ToolStripMenuItem;
if(tsmi!=null){ if(tsmi!=null){
string file=tsmi.Text; string file = tsmi.Text;
if(MainForm.isScript(file)) if (MainForm.isScript(file))
OpenScript(file); {
else OpenScript(file);
Open(tsmi.Text); }
else
Open(file);
} }
} }
#endregion #endregion
...@@ -224,6 +224,10 @@ public void OpenScript(string file) ...@@ -224,6 +224,10 @@ public void OpenScript(string file)
if(!string.IsNullOrEmpty(file) && File.Exists(file)){ if(!string.IsNullOrEmpty(file) && File.Exists(file)){
AddHistory(file); AddHistory(file);
} }
if (checkOpen(file))
return;
if (OpenInNull(file))
return;
CodeEditForm cf=new CodeEditForm(); CodeEditForm cf=new CodeEditForm();
LANG.InitForm(cf, conflang_ce); LANG.InitForm(cf, conflang_ce);
LANG.SetLanguage(cf); LANG.SetLanguage(cf);
...@@ -258,6 +262,11 @@ void InitDataEditor() ...@@ -258,6 +262,11 @@ void InitDataEditor()
} }
public void Open(string file) public void Open(string file)
{ {
if (MainForm.isScript(file))
{
OpenScript(file);
return;
}
if(!string.IsNullOrEmpty(file) && File.Exists(file)){ if(!string.IsNullOrEmpty(file) && File.Exists(file)){
AddHistory(file); AddHistory(file);
} }
...@@ -275,20 +284,38 @@ public void Open(string file) ...@@ -275,20 +284,38 @@ public void Open(string file)
InitDataEditor(); InitDataEditor();
def.InitGameData(datacfg); def.InitGameData(datacfg);
def.DockAreas = DockAreas.Document; def.DockAreas = DockAreas.Document;
def.FormClosed+=new FormClosedEventHandler(def_FormClosed);
def.Show(dockPanel1, DockState.Document); def.Show(dockPanel1, DockState.Document);
list.Add(def, "");
} }
bool checkOpen(string file) bool checkOpen(string file)
{ {
foreach(DataEditForm df in list.Keys) DockContentCollection contents = dockPanel1.Contents;
foreach (DockContent dc in contents)
{ {
if(df!=null && !df.IsDisposed) if (!MainForm.isScript(file))
{ {
if(df.getNowCDB()==file) DataEditForm df = dc as DataEditForm;
return true; if (df != null && !df.IsDisposed)
} {
if (df.getNowCDB() == file)
{
df.Show();
return true;
}
}
}
else
{
CodeEditForm cf = dc as CodeEditForm;
if (cf != null && !cf.IsDisposed)
{
if (cf.NowFile == file)
{
cf.Show();
return true;
}
}
}
} }
return false; return false;
} }
...@@ -296,26 +323,38 @@ bool OpenInNull(string file) ...@@ -296,26 +323,38 @@ bool OpenInNull(string file)
{ {
if(string.IsNullOrEmpty(file) || !File.Exists(file)) if(string.IsNullOrEmpty(file) || !File.Exists(file))
return false; return false;
foreach(DataEditForm df in list.Keys) DockContentCollection contents = dockPanel1.Contents;
{ foreach (DockContent dc in contents)
if(df!=null && !df.IsDisposed) {
{ if (!MainForm.isScript(file))
if(string.IsNullOrEmpty(df.getNowCDB())){ {
df.Open(file); DataEditForm df = dc as DataEditForm;
return true; if (df != null && !df.IsDisposed)
} {
} if (string.IsNullOrEmpty(df.getNowCDB()))
} {
return false; df.Open(file);
} df.Show();
return true;
}
}
}
else
{
CodeEditForm cf = dc as CodeEditForm;
if (cf != null && !cf.IsDisposed)
{
if (string.IsNullOrEmpty(cf.NowFile))
{
cf.Open(file);
cf.Show();
return true;
}
void def_FormClosed(object sender, FormClosedEventArgs e) }
{ }
DataEditForm df=sender as DataEditForm; }
if(df!=null) return false;
{
list.Remove(df);
}
} }
void DataEditorToolStripMenuItemClick(object sender, EventArgs e) void DataEditorToolStripMenuItemClick(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("2.2.7.1")] [assembly: AssemblyVersion("2.2.7.2")]
[DataEditorX]2.2.7.1[DataEditorX] [DataEditorX]2.2.7.2[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★文件关联 ★文件关联
...@@ -58,6 +58,8 @@ Ctrl+鼠标左键 跳转到函数定义 ...@@ -58,6 +58,8 @@ Ctrl+鼠标左键 跳转到函数定义
Ctrl+鼠标滑轮 缩放文字 Ctrl+鼠标滑轮 缩放文字
★更新历史 ★更新历史
2.2.7.2
打开脚本,重复的时候,显示标签
2.2.7.1 2.2.7.1
历史记录分离,脚本编辑器的卡片信息描述 历史记录分离,脚本编辑器的卡片信息描述
2.2.7.0 2.2.7.0
......
No preview for this file type
# history # history
F:\games\ygopro\script\c78835747.lua F:\games\ygopro\script\c50485594.lua
F:\games\ygopro\p.zip.cdb F:\games\ygopro\script\c17857780.lua
\ No newline at end of file F:\games\ygopro\script\c47198668.lua
F:\games\ygopro\script\c168917.lua
F:\games\ygopro\script\c65518099.lua
F:\games\ygopro\p.zip.cdb
F:\games\ygopro\script\c64496451.lua
F:\games\ygopro\script\c78835747.lua
\ No newline at end of file
[DataEditorX]2.2.7.1[DataEditorX] [DataEditorX]2.2.7.2[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★文件关联 ★文件关联
...@@ -58,6 +58,8 @@ Ctrl+鼠标左键 跳转到函数定义 ...@@ -58,6 +58,8 @@ Ctrl+鼠标左键 跳转到函数定义
Ctrl+鼠标滑轮 缩放文字 Ctrl+鼠标滑轮 缩放文字
★更新历史 ★更新历史
2.2.7.2
打开脚本,重复的时候,显示标签
2.2.7.1 2.2.7.1
历史记录分离,脚本编辑器的卡片信息描述 历史记录分离,脚本编辑器的卡片信息描述
2.2.7.0 2.2.7.0
......
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