Commit 42aea75b authored by keyongyu's avatar keyongyu

2.2.9.9

parent 94da8931

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 4.4
# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataEditorX", "DataEditorX\DataEditorX.csproj", "{3FA42393-3D90-4DE1-93FC-33FCB3045845}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3FA42393-3D90-4DE1-93FC-33FCB3045845}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FA42393-3D90-4DE1-93FC-33FCB3045845}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FA42393-3D90-4DE1-93FC-33FCB3045845}.Release|Any CPU.Build.0 = Release|Any CPU
{3FA42393-3D90-4DE1-93FC-33FCB3045845}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FA42393-3D90-4DE1-93FC-33FCB3045845}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3FA42393-3D90-4DE1-93FC-33FCB3045845}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{3FA42393-3D90-4DE1-93FC-33FCB3045845}.Debug|x86.ActiveCfg = Debug|Any CPU
{3FA42393-3D90-4DE1-93FC-33FCB3045845}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3FA42393-3D90-4DE1-93FC-33FCB3045845}.Release|Any CPU.Build.0 = Release|Any CPU
{3FA42393-3D90-4DE1-93FC-33FCB3045845}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{3FA42393-3D90-4DE1-93FC-33FCB3045845}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{3FA42393-3D90-4DE1-93FC-33FCB3045845}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
......@@ -35,6 +35,8 @@ protected override void Dispose(bool disposing)
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CodeEditForm));
this.mainMenu = new System.Windows.Forms.MenuStrip();
this.menuitem_file = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_open = new System.Windows.Forms.ToolStripMenuItem();
......@@ -51,9 +53,10 @@ private void InitializeComponent()
this.menuitem_help = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_about = new System.Windows.Forms.ToolStripMenuItem();
this.tb_input = new System.Windows.Forms.TextBox();
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.fctb = new FastColoredTextBoxNS.FastColoredTextBoxEx();
this.documentMap1 = new FastColoredTextBoxNS.DocumentMap();
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.mainMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.fctb)).BeginInit();
this.SuspendLayout();
......@@ -66,7 +69,7 @@ private void InitializeComponent()
this.menuitem_help});
this.mainMenu.Location = new System.Drawing.Point(0, 0);
this.mainMenu.Name = "mainMenu";
this.mainMenu.Size = new System.Drawing.Size(695, 25);
this.mainMenu.Size = new System.Drawing.Size(705, 25);
this.mainMenu.TabIndex = 0;
this.mainMenu.Text = "mainMenu";
//
......@@ -132,8 +135,8 @@ private void InitializeComponent()
// menuitem_showmap
//
this.menuitem_showmap.Name = "menuitem_showmap";
this.menuitem_showmap.Size = new System.Drawing.Size(168, 22);
this.menuitem_showmap.Text = "Show Map";
this.menuitem_showmap.Size = new System.Drawing.Size(195, 22);
this.menuitem_showmap.Text = "Show/Hide Map";
this.menuitem_showmap.Click += new System.EventHandler(this.ShowMapToolStripMenuItemClick);
//
// menuitem_showinput
......@@ -141,15 +144,15 @@ private void InitializeComponent()
this.menuitem_showinput.Checked = true;
this.menuitem_showinput.CheckState = System.Windows.Forms.CheckState.Checked;
this.menuitem_showinput.Name = "menuitem_showinput";
this.menuitem_showinput.Size = new System.Drawing.Size(168, 22);
this.menuitem_showinput.Text = "Show InputBox";
this.menuitem_showinput.Size = new System.Drawing.Size(195, 22);
this.menuitem_showinput.Text = "Show/Hide InputBox";
this.menuitem_showinput.Click += new System.EventHandler(this.Menuitem_showinputClick);
//
// menuitem_find
//
this.menuitem_find.Name = "menuitem_find";
this.menuitem_find.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
this.menuitem_find.Size = new System.Drawing.Size(168, 22);
this.menuitem_find.Size = new System.Drawing.Size(195, 22);
this.menuitem_find.Text = "Find";
this.menuitem_find.Click += new System.EventHandler(this.Menuitem_findClick);
//
......@@ -157,14 +160,14 @@ private void InitializeComponent()
//
this.menuitem_replace.Name = "menuitem_replace";
this.menuitem_replace.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.H)));
this.menuitem_replace.Size = new System.Drawing.Size(168, 22);
this.menuitem_replace.Size = new System.Drawing.Size(195, 22);
this.menuitem_replace.Text = "Replace";
this.menuitem_replace.Click += new System.EventHandler(this.Menuitem_replaceClick);
//
// menuitem_setcard
//
this.menuitem_setcard.Name = "menuitem_setcard";
this.menuitem_setcard.Size = new System.Drawing.Size(168, 22);
this.menuitem_setcard.Size = new System.Drawing.Size(195, 22);
this.menuitem_setcard.Text = "Set Cards";
//
// menuitem_help
......@@ -189,12 +192,17 @@ private void InitializeComponent()
this.tb_input.Location = new System.Drawing.Point(0, 394);
this.tb_input.Margin = new System.Windows.Forms.Padding(0);
this.tb_input.Name = "tb_input";
this.tb_input.Size = new System.Drawing.Size(504, 21);
this.tb_input.Size = new System.Drawing.Size(514, 21);
this.tb_input.TabIndex = 1;
this.tb_input.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Tb_inputKeyDown);
//
// backgroundWorker1
//
this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
//
// fctb
//
this.fctb.AutoCompleteBrackets = true;
this.fctb.AutoCompleteBracketsList = new char[] {
'(',
')',
......@@ -222,6 +230,7 @@ private void InitializeComponent()
this.fctb.Dock = System.Windows.Forms.DockStyle.Fill;
this.fctb.Font = new System.Drawing.Font("Consolas", 14.25F);
this.fctb.ForeColor = System.Drawing.Color.GhostWhite;
this.fctb.Hotkeys = resources.GetString("fctb.Hotkeys");
this.fctb.IndentBackColor = System.Drawing.SystemColors.WindowFrame;
this.fctb.IsReplaceMode = false;
this.fctb.Language = FastColoredTextBoxNS.Language.Lua;
......@@ -235,13 +244,12 @@ private void InitializeComponent()
this.fctb.RightBracket = ')';
this.fctb.RightBracket2 = '}';
this.fctb.SelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255)))));
this.fctb.Size = new System.Drawing.Size(504, 369);
this.fctb.Size = new System.Drawing.Size(514, 369);
this.fctb.TabIndex = 0;
this.fctb.WordWrap = true;
this.fctb.Zoom = 100;
this.fctb.ToolTipNeeded += new System.EventHandler<FastColoredTextBoxNS.ToolTipNeededEventArgs>(this.FctbToolTipNeeded);
this.fctb.SelectionChangedDelayed += new System.EventHandler(this.FctbSelectionChangedDelayed);
this.fctb.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FctbKeyDown);
this.fctb.MouseClick += new System.Windows.Forms.MouseEventHandler(this.FctbMouseClick);
//
// documentMap1
......@@ -249,7 +257,7 @@ private void InitializeComponent()
this.documentMap1.BackColor = System.Drawing.Color.DimGray;
this.documentMap1.Dock = System.Windows.Forms.DockStyle.Right;
this.documentMap1.ForeColor = System.Drawing.Color.Maroon;
this.documentMap1.Location = new System.Drawing.Point(504, 25);
this.documentMap1.Location = new System.Drawing.Point(514, 25);
this.documentMap1.Name = "documentMap1";
this.documentMap1.Size = new System.Drawing.Size(191, 390);
this.documentMap1.TabIndex = 5;
......@@ -257,14 +265,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;
this.ClientSize = new System.Drawing.Size(695, 415);
this.ClientSize = new System.Drawing.Size(705, 415);
this.Controls.Add(this.fctb);
this.Controls.Add(this.tb_input);
this.Controls.Add(this.documentMap1);
......@@ -303,6 +307,7 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem menuitem_file;
private System.Windows.Forms.MenuStrip mainMenu;
private System.ComponentModel.BackgroundWorker backgroundWorker1;
private System.Windows.Forms.ToolTip toolTip1;
}
......
......@@ -34,16 +34,11 @@ public partial class CodeEditForm : DockContent, IEditForm
#region init 函数提示菜单
//自动完成
AutocompleteMenu popupMenu;
//函数
AutocompleteMenu popupMenu_fun;
//常量
AutocompleteMenu popupMenu_con;
//搜索
AutocompleteMenu popupMenu_find;
string nowFile;
string title;
string oldtext;
Dictionary<string, string> tooltipDic;
SortedList<string, string> tooltipDic;
AutocompleteItem[] items;
bool tabisspaces = false;
string nowcdb;
public CodeEditForm()
......@@ -53,37 +48,11 @@ public CodeEditForm()
void InitForm()
{
cardlist = new SortedDictionary<long, string>();
tooltipDic = new Dictionary<string, string>();
tooltipDic = new SortedList<string, string>();
InitializeComponent();
Font ft = new Font(fctb.Font.Name, fctb.Font.Size / 1.2f, FontStyle.Regular);
popupMenu = new FastColoredTextBoxNS.AutocompleteMenu(fctb);
popupMenu.MinFragmentLength = 2;
popupMenu.Items.Font = ft;
popupMenu.Items.MaximumSize = new System.Drawing.Size(200, 400);
popupMenu.Items.Width = 300;
popupMenu_fun = new FastColoredTextBoxNS.AutocompleteMenu(fctb);
popupMenu_fun.MinFragmentLength = 2;
popupMenu_fun.Items.Font = ft;
popupMenu_fun.Items.MaximumSize = new System.Drawing.Size(200, 400);
popupMenu_fun.Items.Width = 300;
popupMenu_con = new FastColoredTextBoxNS.AutocompleteMenu(fctb);
popupMenu_con.MinFragmentLength = 2;
popupMenu_con.Items.Font = ft;
popupMenu_con.Items.MaximumSize = new System.Drawing.Size(200, 400);
popupMenu_con.Items.Width = 300;
popupMenu_find = new FastColoredTextBoxNS.AutocompleteMenu(fctb);
popupMenu_find.MinFragmentLength = 2;
popupMenu_find.Items.Font = ft;
popupMenu_find.Items.MaximumSize = new System.Drawing.Size(200, 400);
popupMenu_find.Items.Width = 300;
title = this.Text;
//设置字体,大小
string fontname = MyConfig.readString(MyConfig.TAG_FONT_NAME);
float fontsize = MyConfig.readFloat(MyConfig.TAG_FONT_SIZE, 14);
float fontsize = MyConfig.readFloat(MyConfig.TAG_FONT_SIZE, fctb.Font.Size);
fctb.Font = new Font(fontname, fontsize);
if (MyConfig.readBoolean(MyConfig.TAG_IME))
fctb.ImeMode = ImeMode.On;
......@@ -95,13 +64,26 @@ void InitForm()
tabisspaces = true;
else
tabisspaces = false;
Font ft = new Font(fctb.Font.Name, fctb.Font.Size / 1.2f, FontStyle.Regular);
popupMenu = new FastColoredTextBoxNS.AutocompleteMenu(fctb);
popupMenu.MinFragmentLength = 2;
popupMenu.Items.Font = ft;
popupMenu.Items.MaximumSize = new System.Drawing.Size(200, 400);
popupMenu.Items.Width = 300;
popupMenu.BackColor = fctb.BackColor;
popupMenu.ForeColor = fctb.ForeColor;
popupMenu.Closed += new ToolStripDropDownClosedEventHandler(popupMenu_Closed);
popupMenu.SelectedColor = Color.LightGray;
title = this.Text;
}
public void LoadXml(string xmlfile)
void popupMenu_Closed(object sender, ToolStripDropDownClosedEventArgs e)
{
fctb.DescriptionFile = xmlfile;
popupMenu.Items.SetAutocompleteItems(items);
}
#endregion
#region IEditForm接口
......@@ -194,16 +176,19 @@ void CodeEditFormEnter(object sender, EventArgs e)
#endregion
#region 自动完成
public void LoadXml(string xmlfile)
{
fctb.DescriptionFile = xmlfile;
}
public void InitTooltip(CodeConfig codeconfig)
{
this.tooltipDic = codeconfig.TooltipDic;
List<AutocompleteItem> items = new List<AutocompleteItem>();
items.AddRange(codeconfig.FunList);
items.AddRange(codeconfig.ConList);
items = codeconfig.Items;
popupMenu.Items.SetAutocompleteItems(items);
popupMenu_con.Items.SetAutocompleteItems(codeconfig.ConList);
popupMenu_fun.Items.SetAutocompleteItems(codeconfig.FunList);
}
#endregion
#region 悬停的函数说明
//查找函数说明
string FindTooltip(string word)
{
......@@ -219,6 +204,7 @@ string FindTooltip(string word)
}
return desc;
}
//悬停的函数说明
void FctbToolTipNeeded(object sender, ToolTipNeededEventArgs e)
{
......@@ -250,26 +236,46 @@ void FctbToolTipNeeded(object sender, ToolTipNeededEventArgs e)
}
#endregion
#region 按键监听
void FctbKeyDown(object sender, KeyEventArgs e)
#region 保存文件
bool savefile(bool saveas)
{
if (e.KeyData == (Keys.K | Keys.Control))
{
//forced show (MinFragmentLength will be ignored)
popupMenu_fun.Show(true);//显示函数列表
e.Handled = true;
}
else if (e.KeyData == (Keys.T | Keys.Control))
string alltext = fctb.Text;
if (!tabisspaces)
alltext = alltext.Replace(" ", "\t");
if (saveas)
{
//forced show (MinFragmentLength will be ignored)
popupMenu_con.Show(true);//显示常量列表
e.Handled = true;
using (SaveFileDialog sfdlg = new SaveFileDialog())
{
sfdlg.Filter = LANG.GetMsg(LMSG.ScriptFilter);
if (sfdlg.ShowDialog() == DialogResult.OK)
{
nowFile = sfdlg.FileName;
SetTitle();
}
else
return false;
}
}
//else if(e.KeyData == Keys(Keys.Control | Keys
File.WriteAllText(nowFile, alltext, new UTF8Encoding(false));
return true;
}
public bool SaveAs()
{
return savefile(true);
}
void SaveToolStripMenuItemClick(object sender, EventArgs e)
{
Save();
}
void SaveAsToolStripMenuItemClick(object sender, EventArgs e)
{
SaveAs();
}
#endregion
#region input
#region 菜单
//显示/隐藏输入框
void Menuitem_showinputClick(object sender, EventArgs e)
{
......@@ -284,9 +290,6 @@ void Menuitem_showinputClick(object sender, EventArgs e)
tb_input.Visible = true;
}
}
#endregion
#region menu
//如果是作为mdi,则隐藏菜单
void HideMenu()
{
......@@ -311,44 +314,7 @@ void Menuitem_replaceClick(object sender, EventArgs e)
{
fctb.ShowReplaceDialog();
}
#region 保存文件
bool savefile(bool saveas)
{
string alltext = fctb.Text;
if (!tabisspaces)
alltext = alltext.Replace(" ", "\t");
if (saveas)
{
using (SaveFileDialog sfdlg = new SaveFileDialog())
{
sfdlg.Filter = LANG.GetMsg(LMSG.ScriptFilter);
if (sfdlg.ShowDialog() == DialogResult.OK)
{
nowFile = sfdlg.FileName;
SetTitle();
}
else
return false;
}
}
File.WriteAllText(nowFile, alltext, new UTF8Encoding(false));
return true;
}
public bool SaveAs()
{
return savefile(true);
}
void SaveToolStripMenuItemClick(object sender, EventArgs e)
{
Save();
}
void SaveAsToolStripMenuItemClick(object sender, EventArgs e)
{
SaveAs();
}
#endregion
void QuitToolStripMenuItemClick(object sender, EventArgs e)
{
this.Close();
......@@ -384,26 +350,20 @@ void Tb_inputKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
//
string key = tb_input.Text;
List<AutocompleteItem> tlist = new List<AutocompleteItem>();
foreach (string k in tooltipDic.Keys)
List<AutocompleteItem> list =new List<AutocompleteItem>();
foreach (AutocompleteItem item in items)
{
if (tooltipDic[k].IndexOf(key) >= 0)
{
AutocompleteItem ai = new AutocompleteItem(k);
ai.ToolTipTitle = k;
ai.ToolTipText = tooltipDic[k];
tlist.Add(ai);
}
if (item.ToolTipText.Contains(key))
list.Add(item);
}
popupMenu_find.Items.SetAutocompleteItems(tlist.ToArray());
popupMenu_find.Show(true);
popupMenu.Items.SetAutocompleteItems(list.ToArray());
popupMenu.Show(true);
}
}
#endregion
#region 关闭提示保存
#region 提示保存
void CodeEditFormFormClosing(object sender, FormClosingEventArgs e)
{
if (!string.IsNullOrEmpty(oldtext))
......@@ -506,6 +466,5 @@ void FctbMouseClick(object sender, MouseEventArgs e)
}
#endregion
}
}
......@@ -123,4 +123,10 @@
<metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>306, 17</value>
</metadata>
<data name="fctb.Hotkeys" xml:space="preserve">
<value>Tab=IndentIncrease, Escape=ClearHints, PgUp=GoPageUp, PgDn=GoPageDown, End=GoEnd, Home=GoHome, Left=GoLeft, Up=GoUp, Right=GoRight, Down=GoDown, Ins=ReplaceMode, Del=DeleteCharRight, F3=FindNext, Shift+Tab=IndentDecrease, Shift+PgUp=GoPageUpWithSelection, Shift+PgDn=GoPageDownWithSelection, Shift+End=GoEndWithSelection, Shift+Home=GoHomeWithSelection, Shift+Left=GoLeftWithSelection, Shift+Up=GoUpWithSelection, Shift+Right=GoRightWithSelection, Shift+Down=GoDownWithSelection, Shift+Ins=Paste, Shift+Del=Cut, Ctrl+Back=ClearWordLeft, Ctrl+Space=AutocompleteMenu, Ctrl+End=GoLastLine, Ctrl+Home=GoFirstLine, Ctrl+Left=GoWordLeft, Ctrl+Up=ScrollUp, Ctrl+Right=GoWordRight, Ctrl+Down=ScrollDown, Ctrl+Ins=Copy, Ctrl+Del=ClearWordRight, Ctrl+0=ZoomNormal, Ctrl+A=SelectAll, Ctrl+B=BookmarkLine, Ctrl+C=Copy, Ctrl+E=MacroExecute, Ctrl+F=FindDialog, Ctrl+G=GoToDialog, Ctrl+H=ReplaceDialog, Ctrl+I=AutoIndentChars, Ctrl+M=MacroRecord, Ctrl+R=Redo, Ctrl+U=UpperCase, Ctrl+V=Paste, Ctrl+X=Cut, Ctrl+Z=Undo, Ctrl+Add=ZoomIn, Ctrl+Subtract=ZoomOut, Ctrl+F3=GoNextBookmark, Ctrl+OemMinus=NavigateBackward, Ctrl+Shift+End=GoLastLineWithSelection, Ctrl+Shift+Home=GoFirstLineWithSelection, Ctrl+Shift+Left=GoWordLeftWithSelection, Ctrl+Shift+Right=GoWordRightWithSelection, Ctrl+Shift+B=UnbookmarkLine, Ctrl+Shift+C=CommentSelected, Ctrl+Shift+N=GoPrevBookmark, Ctrl+Shift+U=LowerCase, Ctrl+Shift+OemMinus=NavigateForward, Alt+Back=Undo, Alt+Up=MoveSelectedLinesUp, Alt+Down=MoveSelectedLinesDown, Alt+F=FindChar, Alt+Shift+Left=GoLeft_ColumnSelectionMode, Alt+Shift+Up=GoUp_ColumnSelectionMode, Alt+Shift+Right=GoRight_ColumnSelectionMode, Alt+Shift+Down=GoDown_ColumnSelectionMode</value>
</data>
</root>
\ No newline at end of file
......@@ -125,5 +125,17 @@ public static string getFullFileName(string tag, string file)
else
return name.Replace(tag + "_", "");
}
public static void CreateDir(string dir)
{
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
}
public static void CreateDirByFile(string file)
{
string dir = Path.GetDirectoryName(file);
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
}
}
}
......@@ -15,43 +15,29 @@ public class CodeConfig
#region 成员
public CodeConfig()
{
Init();
}
public void Init()
{
tooltipDic = new Dictionary<string, string>();
funList = new List<AutocompleteItem>();
conList = new List<AutocompleteItem>();
tooltipDic = new SortedList<string, string>();
longTooltipDic = new SortedList<string, string>();
items = new List<AutocompleteItem>();
}
//函数提示
Dictionary<string, string> tooltipDic;
//函数列表
List<AutocompleteItem> funList;
//常量列表
List<AutocompleteItem> conList;
SortedList<string, string> tooltipDic;
SortedList<string, string> longTooltipDic;
List<AutocompleteItem> items;
/// <summary>
/// 输入提示
/// </summary>
public Dictionary<string, string> TooltipDic
public SortedList<string, string> TooltipDic
{
get { return tooltipDic; }
}
/// <summary>
/// 函数列表
/// </summary>
public AutocompleteItem[] FunList
public SortedList<string, string> LongTooltipDic
{
get { return funList.ToArray(); }
get { return longTooltipDic; }
}
/// <summary>
/// 常量列表
/// </summary>
public AutocompleteItem[] ConList
public AutocompleteItem[] Items
{
get { return conList.ToArray(); }
get { return items.ToArray(); }
}
#endregion
......@@ -67,7 +53,7 @@ public void SetNames(Dictionary<long, string> dic)
string key = "0x" + k.ToString("x");
if (!tooltipDic.ContainsKey(key))
{
AddConToolTip(key, dic[k]);
AddToolIipDic(key, dic[k]);
}
}
}
......@@ -89,7 +75,7 @@ public void AddStrings(string file)
string[] ws = line.Split(' ');
if (ws.Length > 2)
{
AddConToolTip(ws[1], ws[2]);
AddToolIipDic(ws[1], ws[2]);
}
}
}
......@@ -99,15 +85,10 @@ public void AddStrings(string file)
#endregion
#region function
/// <summary>
/// 添加函数
/// </summary>
/// <param name="funtxt"></param>
public void AddFunction(string funtxt)
{
if (!File.Exists(funtxt))
return;
string[] lines = File.ReadAllLines(funtxt);
bool isFind = false;
string name = "";
......@@ -121,7 +102,7 @@ public void AddFunction(string funtxt)
if (line.StartsWith("●"))
{
//add
AddFuncTooltip(name, desc);
AddToolIipDic(name, desc);
int w = line.IndexOf("(");
int t = line.IndexOf(" ");
......@@ -138,98 +119,91 @@ public void AddFunction(string funtxt)
desc += Environment.NewLine + line;
}
}
AddFuncTooltip(name, desc);
AddToolIipDic(name, desc);
}
//获取不带类名的函数名
string GetFunName(string str)
{
int t = str.IndexOf(".");
if (t > 0)
return str.Substring(t + 1);
return str;
}
//添加提示
void AddFuncTooltip(string name, string desc)
#endregion
#region 常量
public void AddConstant(string conlua)
{
if (!string.IsNullOrEmpty(name))
//conList.Add("con");
if (!File.Exists(conlua))
return;
string[] lines = File.ReadAllLines(conlua);
foreach (string line in lines)
{
string fname = GetFunName(name);
AddAutoMenuItem(funList, fname, desc);
if (!tooltipDic.ContainsKey(fname))
{
tooltipDic.Add(fname, desc);
}
else
tooltipDic[fname] += Environment.NewLine
+ Environment.NewLine + desc;
if (line.StartsWith("--"))
continue;
string k = line, desc = line;
int t = line.IndexOf("=");
int t2 = line.IndexOf("--");
//常量 = 0x1 ---注释
k = (t > 0) ? line.Substring(0, t).TrimEnd(new char[] { ' ', '\t' })
: line;
desc = (t > 0) ? line.Substring(t + 1).Replace("--", "\n")
: line;
AddToolIipDic(k, desc);
}
}
#endregion
#region constant
//常量提示
void AddConToolTip(string key, string desc)
#region 处理
public void InitAutoMenus()
{
AddAutoMenuItem(conList, key, desc);
if (tooltipDic.ContainsKey(key))
tooltipDic[key] += Environment.NewLine
+ Environment.NewLine + desc;
else
items.Clear();
foreach (string k in tooltipDic.Keys)
{
tooltipDic.Add(key, desc);
AutocompleteItem item = new AutocompleteItem(k);
item.ToolTipTitle = k;
item.ToolTipText = tooltipDic[k];
items.Add(item);
}
}
//常量
public void AddConstant(string conlua)
{
//conList.Add("con");
if (File.Exists(conlua))
foreach (string k in longTooltipDic.Keys)
{
string[] lines = File.ReadAllLines(conlua);
foreach (string line in lines)
{
if (line.StartsWith("--"))
continue;
string k = line, desc = line;
int t = line.IndexOf("=");
int t2 = line.IndexOf("--");
//常量 = 0x1 ---注释
k = (t > 0) ? line.Substring(0, t).TrimEnd(new char[] { ' ', '\t' })
: line;
desc = (t > 0) ? line.Substring(t + 1).Replace("--", "\n")
: line;
if (!tooltipDic.ContainsKey(k))
{
AddConToolTip(k, desc);
}
else
tooltipDic[k] += Environment.NewLine
+ Environment.NewLine + desc;
}
if (tooltipDic.ContainsKey(k))
continue;
AutocompleteItem item = new AutocompleteItem(k);
item.ToolTipTitle = k;
item.ToolTipText = longTooltipDic[k];
items.Add(item);
}
}
#endregion
#region 提示
void AddAutoMenuItem(List<AutocompleteItem> list, string key, string desc)
string GetShortName(string name)
{
int t = name.IndexOf(".");
if (t > 0)
return name.Substring(t + 1);
else
return name;
}
void AddToolIipDic(string key, string val)
{
bool isExists = false;
foreach (AutocompleteItem ai in list)
string skey = GetShortName(key);
if (tooltipDic.ContainsKey(skey))//存在
{
if (ai.Text == key)
{
isExists = true;
ai.ToolTipText += Environment.NewLine
+ Environment.NewLine + desc;
}
string nval = tooltipDic[skey];
if (!nval.EndsWith(Environment.NewLine))
nval += Environment.NewLine;
nval += Environment.NewLine +val;
tooltipDic[skey] = nval;
}
if (!isExists)
else
tooltipDic.Add(skey, val);
//
AddLongToolIipDic(key, val);
}
void AddLongToolIipDic(string key, string val)
{
if (longTooltipDic.ContainsKey(key))//存在
{
AutocompleteItem aitem = new AutocompleteItem(key);
aitem.ToolTipTitle = key;
aitem.ToolTipText = desc;
list.Add(aitem);
string nval = longTooltipDic[key];
if (!nval.EndsWith(Environment.NewLine))
nval += Environment.NewLine;
nval += Environment.NewLine + val;
longTooltipDic[key] = nval;
}
else
longTooltipDic.Add(key, val);
}
#endregion
}
......
......@@ -3,6 +3,8 @@
using System.IO;
using DataEditorX.Common;
using System.Windows.Forms;
using System.Diagnostics;
using System.Reflection;
namespace DataEditorX.Config
{
......@@ -69,6 +71,18 @@ public class MyConfig
/// </summary>
public const string TAG_UPDATE_URL = "updateURL";
/// <summary>
/// 删除卡片的时候,删除图片脚本
/// </summary>
public const string TAG_DELETE_WITH = "opera_with_cards_file";
/// <summary>
/// 异步加载数据
/// </summary>
public const string TAG_ASYNC = "async";
/// <summary>
/// 用本程序打开文件
/// </summary>
public const string TAG_OPEN_IN_THIS = "open_file_in_this";
/// <summary>
/// 一般的裁剪
/// </summary>
public const string TAG_IMAGE_OTHER = "image_other";
......@@ -297,14 +311,52 @@ public static string GetCardInfoFile(string path)
/// 发送消息打开文件
/// </summary>
/// <param name="file"></param>
public static void Open(IntPtr win, string file)
public static bool OpenOnExistForm(string file)
{
Process instance = RunningInstance();
if (instance == null)
{
return false;
}
else
{
//把需要打开的文件写入临时文件
string tmpfile = Path.Combine(Application.StartupPath, MyConfig.FILE_TEMP);
File.WriteAllText(tmpfile, file);
//发送消息
User32.SendMessage(instance.MainWindowHandle, MyConfig.WM_OPEN, 0, 0);
return true;
}
}
public static void OpenFileInThis(string file)
{
//把需要打开的文件写入临时文件
string tmpfile = Path.Combine(Application.StartupPath, MyConfig.FILE_TEMP);
File.WriteAllText(tmpfile, file);
//发送消息
User32.SendMessage(win, MyConfig.WM_OPEN, 0, 0);
Environment.Exit(1);
User32.SendMessage(Process.GetCurrentProcess().MainWindowHandle, MyConfig.WM_OPEN, 0, 0);
}
static Process RunningInstance()
{
Process current = Process.GetCurrentProcess();
Process[] processes = Process.GetProcessesByName(current.ProcessName);
//遍历与当前进程名称相同的进程列表
foreach (Process process in processes)
{
//如果实例已经存在则忽略当前进程
if (process.Id != current.Id)
{
//保证要打开的进程同已经存在的进程来自同一文件路径
if (Assembly.GetExecutingAssembly().Location.
Replace('/', Path.DirectorySeparatorChar)
== current.MainModule.FileName)
{
//返回已经存在的进程
return process;
}
}
}
return null;
}
}
......
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace DataEditorX.Config
{
public class YgoPath
{
public YgoPath(string gamepath)
{
SetPath(gamepath);
}
public void SetPath(string gamepath)
{
this.gamepath = gamepath;
picpath = MyPath.Combine(gamepath, "pics");
fieldpath = MyPath.Combine(picpath, "field");
picpath2 = MyPath.Combine(picpath, "thumbnail");
luapath = MyPath.Combine(gamepath, "script");
ydkpath = MyPath.Combine(gamepath, "deck");
replaypath = MyPath.Combine(gamepath, "replay");
}
/// <summary>游戏目录</summary>
public string gamepath;
/// <summary>大图目录</summary>
public string picpath;
/// <summary>小图目录</summary>
public string picpath2;
/// <summary>场地图目录</summary>
public string fieldpath;
/// <summary>脚本目录</summary>
public string luapath;
/// <summary>卡组目录</summary>
public string ydkpath;
/// <summary>录像目录</summary>
public string replaypath;
public string GetImage(long id)
{
return GetImage(id.ToString());
}
public string GetImageThum(long id)
{
return GetImageThum(id.ToString());
}
public string GetImageField(long id)
{
return GetImageField(id.ToString());//场地图
}
public string GetScript(long id)
{
return GetScript(id.ToString());
}
public string GetYdk(string name)
{
return MyPath.Combine(ydkpath, name + ".ydk");
}
//字符串id
public string GetImage(string id)
{
return MyPath.Combine(picpath, id + ".jpg");
}
public string GetImageThum(string id)
{
return MyPath.Combine(picpath2, id + ".jpg");
}
public string GetImageField(string id)
{
return MyPath.Combine(fieldpath, id+ ".png");//场地图
}
public string GetScript(string id)
{
return MyPath.Combine(luapath, "c" + id + ".lua");
}
public string[] GetCardfiles(long id)
{
string[] files = new string[]{
GetImage(id),//大图
GetImageThum(id),//小图
GetImageField(id),//场地图
GetScript(id)
};
return files;
}
public string[] GetCardfiles(string id)
{
string[] files = new string[]{
GetImage(id),//大图
GetImageThum(id),//小图
GetImageField(id),//场地图
GetScript(id)
};
return files;
}
}
}
......@@ -29,7 +29,7 @@ protected override void OnMouseMove(MouseEventArgs e)
base.OnMouseMove(e);
lastMouseCoord = e.Location;
}
//函数提示
//函数悬停提示
protected override void OnToolTip()
{
if (ToolTip == null)
......
......@@ -4,7 +4,7 @@
namespace DataEditorX.Controls
{
interface IEditForm
public interface IEditForm
{
//获取打开的文件路径
string GetOpenFile();
......
......@@ -5,6 +5,7 @@
*/
using System;
using System.Text.RegularExpressions;
using DataEditorX.Core.Info;
namespace DataEditorX.Core
{
......
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using DataEditorX.Config;
using DataEditorX.Language;
namespace DataEditorX.Core
{
public class CardEdit
{
IDataForm dataform;
string undoSQL;
public CardEdit(IDataForm dataform)
{
this.dataform = dataform;
}
#region 添加
//添加
public bool AddCard()
{
if (!dataform.CheckOpen())
return false;
Card c = dataform.GetCard();
if (c.id <= 0)//卡片密码不能小于等于0
{
MyMsg.Error(LMSG.CodeCanNotIsZero);
return false;
}
Card[] cards = dataform.GetCardList(false);
foreach (Card ckey in cards)//卡片id存在
{
if (c.id == ckey.id)
{
MyMsg.Warning(LMSG.ItIsExists);
return false;
}
}
if (DataBase.Command(dataform.GetOpenFile(),
DataBase.GetInsertSQL(c, true)) >= 2)
{
MyMsg.Show(LMSG.AddSucceed);
undoSQL = DataBase.GetDeleteSQL(c);
dataform.Search(true);
return true;
}
MyMsg.Error(LMSG.AddFail);
return false;
}
#endregion
#region 修改
//修改
public bool ModCard(bool modfiles)
{
if (!dataform.CheckOpen())
return false;
Card c = dataform.GetCard();
Card oldCard = dataform.GetOldCard();
if (c.Equals(oldCard))//没有修改
{
MyMsg.Show(LMSG.ItIsNotChanged);
return false;
}
if (c.id <= 0)
{
MyMsg.Error(LMSG.CodeCanNotIsZero);
return false;
}
string sql;
if (c.id != oldCard.id)//修改了id
{
sql = DataBase.GetInsertSQL(c, false);//插入
undoSQL = DataBase.GetDeleteSQL(c);//还原就是删除
bool delold = MyMsg.Question(LMSG.IfDeleteCard);
if (delold)//是否删除旧卡片
{
if (DataBase.Command(dataform.GetOpenFile(),
DataBase.GetDeleteSQL(oldCard)) < 2)
{
//删除失败
MyMsg.Error(LMSG.DeleteFail);
}
else
{//删除成功,添加还原sql
undoSQL += DataBase.GetInsertSQL(oldCard, false);
}
}
dataform.SetImage(0);//释放当前使用的卡图
//如果删除旧卡片,则把资源修改名字,否则复制资源
if (modfiles)
YGOUtil.CardRename(c.id, oldCard.id, dataform.GetPath(), delold);
}
else
{//更新数据
sql = DataBase.GetUpdateSQL(c);
undoSQL = DataBase.GetUpdateSQL(oldCard);
}
if (DataBase.Command(dataform.GetOpenFile(), sql) > 0)
{
MyMsg.Show(LMSG.ModifySucceed);
dataform.Search(true);
dataform.SetCard(c);
return true;
}
else
MyMsg.Error(LMSG.ModifyFail);
return false;
}
#endregion
#region 删除
//删除
public bool DelCards(bool deletefiles)
{
if (!dataform.CheckOpen())
return false;
Card[] cards = dataform.GetCardList(true);
if (cards == null || cards.Length == 0)
return false;
if (!MyMsg.Question(LMSG.IfDeleteCard))
return false;
undoSQL = "";//还原
List<string> sql = new List<string>();
foreach (Card c in cards)
{
sql.Add(DataBase.GetDeleteSQL(c));//删除
undoSQL += DataBase.GetInsertSQL(c, true);
//删除资源
if (deletefiles)
{
YGOUtil.CardDelete(c.id, dataform.GetPath(), false);
}
}
if (DataBase.Command(dataform.GetOpenFile(), sql.ToArray()) >= (sql.Count * 2))
{
MyMsg.Show(LMSG.DeleteSucceed);
dataform.Search(true);
return true;
}
else
{
MyMsg.Error(LMSG.DeleteFail);
dataform.Search(true);
}
return false;
}
#endregion
#region 打开脚本
//打开脚本
public bool OpenScript(bool openinthis)
{
if (!dataform.CheckOpen())
return false;
Card c = dataform.GetCard();
if (c.id <= 0)//卡片密码不能小于等于0
return false;
string lua = dataform.GetPath().GetScript(c.id);
if (!File.Exists(lua))
{
MyPath.CreateDirByFile(lua);
if (MyMsg.Question(LMSG.IfCreateScript))//是否创建脚本
{
using (FileStream fs = new FileStream(lua,
FileMode.OpenOrCreate,FileAccess.Write))
{
StreamWriter sw = new StreamWriter(fs, new UTF8Encoding(false));
sw.WriteLine("--" + c.name);
sw.WriteLine("function c"+c.id.ToString()+".initial_effect(c)");
sw.WriteLine("\t");
sw.WriteLine("end");
sw.Close();
fs.Close();
}
}
}
if (File.Exists(lua))//如果存在,则打开文件
{
if (openinthis)//是否用本程序打开
MyConfig.OpenFileInThis(lua);
else
System.Diagnostics.Process.Start(lua);
return true;
}
return false;
}
#endregion
#region 撤销
//撤销
public void Undo()
{
if (string.IsNullOrEmpty(undoSQL))
{
return;
}
DataBase.Command(dataform.GetOpenFile(), undoSQL);
dataform.Search(true);
}
#endregion
}
}
using DataEditorX.Config;
using DataEditorX.Controls;
namespace DataEditorX.Core
{
public interface IDataForm : IEditForm
{
YgoPath GetPath();
Card[] GetCardList(bool onlyselect);
bool CheckOpen();
void Reset();
void SetImage(long id);
void SetImage(string id);
void Search(bool isfresh);
Card GetOldCard();
Card GetCard();
void SetCard(Card c);
void SaveCards(Card[] cards);
void CompareCards(string cdbfile, bool checktext);
}
}
......@@ -7,7 +7,7 @@
*/
using System;
namespace DataEditorX.Core
namespace DataEditorX.Core.Info
{
/// <summary>
/// 卡片属性
......
......@@ -7,7 +7,7 @@
*/
using System;
namespace DataEditorX.Core
namespace DataEditorX.Core.Info
{
/// <summary>
/// 卡片种族
......
using System;
using System.Collections.Generic;
using System.Text;
namespace DataEditorX.Core

namespace DataEditorX.Core.Info
{
public enum CardRule :int
{
......
......@@ -7,7 +7,7 @@
*/
using System;
namespace DataEditorX.Core
namespace DataEditorX.Core.Info
{
/// <summary>
/// 卡片类型
......
......@@ -8,14 +8,13 @@
using System;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace DataEditorX
{
/// <summary>
/// Description of LuaFunction.
/// Lua 函数查找
/// </summary>
public class LuaFunction
{
......
......@@ -11,6 +11,7 @@
using System.Text.RegularExpressions;
using Microsoft.VisualBasic;
using DataEditorX.Core.Info;
using DataEditorX.Config;
using DataEditorX.Language;
......

namespace DataEditorX.Core
{
/// <summary>
/// 任务
/// </summary>
public enum MyTask
{
///<summary>空</summary>
NONE,
///<summary>检查更新</summary>
CheckUpdate,
///<summary>导出数据</summary>
ExportData,
///<summary>保存为MSE存档</summary>
SaveAsMSE,
///<summary>裁剪图片</summary>
CutImages,
///<summary>转换图片</summary>
ConvertImages,
///<summary>读取MSE存档</summary>
ReadMSE,
}
}
......@@ -19,26 +19,10 @@
using DataEditorX.Common;
using DataEditorX.Config;
using DataEditorX.Core.Mse;
using DataEditorX.Core.Info;
namespace DataEditorX.Core
{
public enum MyTask
{
///<summary>空</summary>
NONE,
///<summary>检查更新</summary>
CheckUpdate,
///<summary>导出数据</summary>
ExportData,
///<summary>保存为MSE存档</summary>
SaveAsMSE,
///<summary>裁剪图片</summary>
CutImages,
///<summary>转换图片</summary>
ConvertImages,
///<summary>读取MSE存档</summary>
ReadMSE,
}
/// <summary>
/// 任务
/// </summary>
......@@ -336,24 +320,21 @@ public Card[] ReadMSE(string mseset, bool repalceOld)
#endregion
#region 导出数据
public void ExportData(string zipname)
public void ExportData(string path, string zipname)
{
int i = 0;
Card[] cards = cardlist;
if (cards == null || cards.Length == 0)
return;
int count = cards.Length;
string path = Path.GetDirectoryName(zipname);
YgoPath ygopath = new YgoPath(path);
string name = Path.GetFileNameWithoutExtension(zipname);
//数据库
string cdbfile = zipname + ".cdb";
//说明
string readme = MyPath.Combine(path, name + ".txt");
//新卡ydk
string deckydk = MyPath.Combine(path, "deck/" + name + ".ydk");
string pics = MyPath.Combine(path, "pics");
string thumb = MyPath.Combine(pics, "thumbnail");
string script = MyPath.Combine(path, "script");
string deckydk = ygopath.GetYdk(name);
File.Delete(cdbfile);
DataBase.Create(cdbfile);
......@@ -372,17 +353,14 @@ public void ExportData(string zipname)
{
i++;
worker.ReportProgress(i / count, string.Format("{0}/{1}", i, count));
//zips.AddFile(
string jpg1 = MyPath.Combine(pics, c.id.ToString() + ".jpg");
string jpg2 = MyPath.Combine(thumb, c.id.ToString() + ".jpg");
string lua = MyPath.Combine(script, "c" + c.id.ToString() + ".lua");
if (File.Exists(jpg1))
zips.AddFile(jpg1, "pics/" + c.id.ToString() + ".jpg", "");
if (File.Exists(jpg2))
zips.AddFile(jpg2, "pics/thumbnail/" + c.id.ToString() + ".jpg", "");
if (File.Exists(lua))
zips.AddFile(lua, "script/c" + c.id.ToString() + ".lua", "");
string[] files = ygopath.GetCardfiles(c.id);
foreach (string file in files)
{
if (File.Exists(file))
{
zips.AddFile(file, file.Replace(path,""),"");
}
}
}
}
File.Delete(cdbfile);
......@@ -399,9 +377,9 @@ public void Run()
switch (nowTask)
{
case MyTask.ExportData:
if (mArgs != null && mArgs.Length >= 1)
if (mArgs != null && mArgs.Length >= 2)
{
ExportData(mArgs[0]);
ExportData(mArgs[0], mArgs[1]);
}
break;
case MyTask.CheckUpdate:
......
......@@ -8,6 +8,8 @@
using DataEditorX.Config;
using System.Windows.Forms;
using DataEditorX.Core.Info;
namespace DataEditorX.Core
{
static class YGOUtil
......@@ -120,11 +122,11 @@ static string GetType(CardType type)
public static string GetTypeString(long type)
{
string str="";
string str = "";
foreach (long k in datacfg.dicCardTypes.Keys)
{
if ((type & k) == k)
str += GetType((CardType)k)+"|";
str += GetType((CardType)k) + "|";
}
if (str.Length > 0)
str = str.Substring(0, str.Length - 1);
......@@ -190,14 +192,53 @@ public static string[] ReadImage(string path)
{
List<string> list = new List<string>();
string[] files = Directory.GetFiles(path, "*.*");
int n = files.Length;
for (int i = 0; i < n; i++)
int n = files.Length;
for (int i = 0; i < n; i++)
{
string ex = Path.GetExtension(files[i]).ToLower();
if (ex == ".jpg" || ex == ".png" || ex == ".bmp")
list.Add(Path.GetFileNameWithoutExtension(files[i]));
}
return list.ToArray();
}
#endregion
#region 删除资源
//删除资源
public static void CardDelete(long id, YgoPath ygopath, bool bak)
{
string[] files = ygopath.GetCardfiles(id);
for (int i = 0; i < files.Length; i++)
{
if (File.Exists(files[i]))
{
string ex = Path.GetExtension(files[i]).ToLower();
if (ex == ".jpg" || ex == ".png" || ex == ".bmp")
list.Add(Path.GetFileNameWithoutExtension(files[i]));
if (bak)
File.Move(files[i], files[i] + ".bak");
else
File.Delete(files[i]);//删除文件
}
return list.ToArray();
}
}
#endregion
#region 资源改名
//资源改名
public static void CardRename(long newid, long oldid, YgoPath ygopath, bool delold)
{
string[] newfiles = ygopath.GetCardfiles(newid);
string[] oldfiles = ygopath.GetCardfiles(oldid);
for (int i = 0; i < 3; i++)
{
if (File.Exists(oldfiles[i]))
{
if (delold)
File.Move(oldfiles[i], newfiles[i]);
else
File.Copy(oldfiles[i], newfiles[i], false);
}
}
}
#endregion
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -69,6 +69,7 @@
</Compile>
<Compile Include="Common\CheckUpdate.cs" />
<Compile Include="Common\ConfHelper.cs" />
<Compile Include="Config\YgoPath.cs" />
<Compile Include="Controls\DoubleContorl.cs">
<SubType>Component</SubType>
</Compile>
......@@ -77,6 +78,7 @@
</Compile>
<Compile Include="Common\MyPath.cs" />
<Compile Include="Controls\History.cs" />
<Compile Include="Core\IDataForm.cs" />
<Compile Include="Controls\IEditForm.cs" />
<Compile Include="Controls\IMainForm.cs" />
<Compile Include="Controls\MySyntaxHighlighter.cs" />
......@@ -86,10 +88,11 @@
<Compile Include="Common\Area.cs" />
<Compile Include="Config\MyConfig.cs" />
<Compile Include="Core\Card.cs" />
<Compile Include="Core\CardAttribute.cs" />
<Compile Include="Core\CardRace.cs" />
<Compile Include="Core\CardRule.cs" />
<Compile Include="Core\CardType.cs" />
<Compile Include="Core\Info\CardAttribute.cs" />
<Compile Include="Core\CardEdit.cs" />
<Compile Include="Core\Info\CardRace.cs" />
<Compile Include="Core\Info\CardRule.cs" />
<Compile Include="Core\Info\CardType.cs" />
<Compile Include="Config\CodeConfig.cs" />
<Compile Include="Core\DataBase.cs" />
<Compile Include="Config\DataConfig.cs" />
......@@ -99,6 +102,7 @@
<Compile Include="Core\Mse\MSECons.cs" />
<Compile Include="Core\Mse\MseMaker.cs" />
<Compile Include="Core\Mse\MSEConfig.cs" />
<Compile Include="Core\MyTask.cs" />
<Compile Include="Core\TaskHelper.cs" />
<Compile Include="Core\YGOUtil.cs" />
<Compile Include="DataEditForm.cs">
......@@ -120,6 +124,9 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="changed.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="data\mse_Chinese-Traditional.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......@@ -165,9 +172,6 @@
<None Include="readme.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="readme_en.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="CodeEditForm.resx">
......
......@@ -81,6 +81,7 @@ private void InitializeComponent()
//
// dockPanel1
//
this.dockPanel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.dockPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dockPanel1.Location = new System.Drawing.Point(0, 25);
this.dockPanel1.Margin = new System.Windows.Forms.Padding(0);
......@@ -328,6 +329,7 @@ private void InitializeComponent()
// bgWorker1
//
this.bgWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgWorker1_DoWork);
this.bgWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bgWorker1_RunWorkerCompleted);
//
// MainForm
//
......
......@@ -7,6 +7,7 @@
*/
using System;
using System.IO;
using System.Drawing;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
......@@ -14,6 +15,7 @@
using DataEditorX.Core;
using DataEditorX.Config;
using DataEditorX.Controls;
using System.Threading;
namespace DataEditorX
{
......@@ -33,9 +35,20 @@ public partial class MainForm : Form, IMainForm
//编辑器配置
DataConfig datacfg = null;
CodeConfig codecfg = null;
//将要打开的文件
string openfile;
#endregion
#region 设置界面,消息语言
public MainForm()
{
//检查更新
Thread th = new Thread(CheckUpdate);
th.IsBackground = true;//如果exe结束,则线程终止
th.Start();
//初始化控件
InitializeComponent();
}
public void SetDataPath(string datapath)
{
//判断是否合法
......@@ -44,7 +57,27 @@ public void SetDataPath(string datapath)
tCards = null;
//数据目录
this.datapath = datapath;
if (MyConfig.readBoolean(MyConfig.TAG_ASYNC))
{
//后台加载数据
bgWorker1.RunWorkerAsync();
}
else
{
Init();
InitForm();
}
}
void CheckUpdate()
{
TaskHelper.CheckVersion(false);
}
public void setOpenFile(string file)
{
this.openfile = file;
}
void Init()
{
//文件路径
conflang = MyConfig.GetLanguageFile(datapath);
//游戏数据,MSE数据
......@@ -57,8 +90,6 @@ public void SetDataPath(string datapath)
string conlua = MyPath.Combine(datapath, MyConfig.FILE_CONSTANT);
string confstring = MyPath.Combine(datapath, MyConfig.FILE_STRINGS);
codecfg = new CodeConfig();
//初始化
codecfg.Init();
//添加函数
codecfg.AddFunction(funtxt);
//添加指示物
......@@ -66,26 +97,35 @@ public void SetDataPath(string datapath)
//添加常量
codecfg.AddConstant(conlua);
codecfg.SetNames(datacfg.dicSetnames);
//初始化
InitializeComponent();
//加载多语言
LANG.LoadFormLabels(conflang);
LANG.SetFormLabel(this);
//设置所有窗口的语言
DockContentCollection contents = dockPanel1.Contents;
foreach (DockContent dc in contents)
{
if (dc is Form)
{
LANG.SetFormLabel((Form)dc);
}
}
//生成菜单
codecfg.InitAutoMenus();
history = new History(this);
//读取历史记录
history.ReadHistory(MyPath.Combine(datapath, MyConfig.FILE_HISTORY));
//加载多语言
LANG.LoadFormLabels(conflang);
}
void InitForm()
{
LANG.SetFormLabel(this);
//设置所有窗口的语言
DockContentCollection contents = dockPanel1.Contents;
foreach (DockContent dc in contents)
{
if (dc is Form)
{
LANG.SetFormLabel((Form)dc);
}
}
//添加历史菜单
history.MenuHistory();
//如果没有将要打开的文件,则打开一个空数据库标签
if (string.IsNullOrEmpty(openfile))
OpenDataBase(null);
else
Open(openfile);
}
#endregion
......@@ -221,10 +261,7 @@ bool FindEditForm(string file, bool isOpen)
void MainFormLoad(object sender, System.EventArgs e)
{
//检查更新
bgWorker1.RunWorkerAsync();
//如果没有标签,则打开一个空数据库标签
if (dockPanel1.Contents.Count == 0)
OpenDataBase(null);
//bgWorker1.RunWorkerAsync();
}
void MainFormFormClosing(object sender, FormClosingEventArgs e)
......@@ -243,10 +280,11 @@ void MainFormFormClosing(object sender, FormClosingEventArgs e)
#endregion
#region 窗口管理
//关闭当前
void CloseToolStripMenuItemClick(object sender, EventArgs e)
{
//关闭当前
dockPanel1.ActiveContent.DockHandler.Close();
if (dockPanel1.ActiveContent.DockHandler != null)
dockPanel1.ActiveContent.DockHandler.Close();
}
//打开脚本编辑
void Menuitem_codeeditorClick(object sender, EventArgs e)
......@@ -372,7 +410,7 @@ void Menuitem_copyselecttoClick(object sender, EventArgs e)
DataEditForm df = GetActive();//获取当前的数据库编辑
if (df != null)
{
tCards = df.getCardList(true); //获取选中的卡片
tCards = df.GetCardList(true); //获取选中的卡片
if (tCards != null)
{
SetCopyNumber(tCards.Length);//显示复制卡片的数量
......@@ -386,7 +424,7 @@ void Menuitem_copyallClick(object sender, EventArgs e)
DataEditForm df = GetActive();//获取当前的数据库编辑
if (df != null)
{
tCards = df.getCardList(false);//获取结果的所有卡片
tCards = df.GetCardList(false);//获取结果的所有卡片
if (tCards != null)
{
SetCopyNumber(tCards.Length);//显示复制卡片的数量
......@@ -462,12 +500,17 @@ void CompareDB()
#endregion
#region 自动更新
#region 后台加载数据
private void bgWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
{
//检查更新
TaskHelper.CheckVersion(false);
Init();
}
#endregion
private void bgWorker1_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
{
//更新UI
InitForm();
}
}
}
......@@ -21,51 +21,21 @@ internal sealed class Program
private static void Main(string[] args)
{
string file = (args.Length > 0) ? args[0] : "";
Process instance = RunningInstance();
//判断是否已经运行
if (instance == null)
{
if (MyConfig.OpenOnExistForm(file))//在已经存在的窗口打开文件
Environment.Exit(1);
else//新建窗口
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
MainForm mainForm = new MainForm();
//设置将要打开的文件
mainForm.setOpenFile(file);
//数据目录
mainForm.SetDataPath(MyPath.Combine(Application.StartupPath, MyConfig.TAG_DATA));
mainForm.Open(file);
Application.Run(mainForm);
}
else
{
//把需要打开的文件写入临时文件
//string tmpfile = Path.Combine(Application.StartupPath, MyConfig.FILE_TEMP);
//File.WriteAllText(tmpfile, file);
//发送消息
//User32.SendMessage(instance.MainWindowHandle, MyConfig.WM_OPEN, 0, 0);
MyConfig.Open(instance.MainWindowHandle, file);
Environment.Exit(1);
}
}
static Process RunningInstance()
{
Process current = Process.GetCurrentProcess();
Process[] processes = Process.GetProcessesByName(current.ProcessName);
//遍历与当前进程名称相同的进程列表
foreach (Process process in processes)
{
//如果实例已经存在则忽略当前进程
if (process.Id != current.Id)
{
//保证要打开的进程同已经存在的进程来自同一文件路径
if (Assembly.GetExecutingAssembly().Location.
Replace('/', Path.DirectorySeparatorChar)
== current.MainModule.FileName)
{
//返回已经存在的进程
return process;
}
}
}
return null;
}
}
}
......@@ -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.9.7")]
[assembly: AssemblyVersion("2.2.9.9")]
......@@ -14,11 +14,17 @@
<add key="mse" value="Chinese-Simplified" />
<!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt -->
<add key="language" value="chinese" />
<!-- async load data -->
<add key="async" value="false" />
<!-- DataEditorX source code -->
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<!-- DataEditorX update url-->
<add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" />
<!-- Cut Images Setting -->
<!-- delete,modify with card's files image script -->
<add key="opera_with_cards_file" value="false" />
<!-- open file in this.such as lua -->
<add key="open_file_in_this" value="true" />
<!-- Cut Images Setting -->
<add key="image_quilty" value="100" />
<add key="image" value="44,64,177,254" />
<add key="image_other" value="25,54,128,128" />
......
★更新历史
2.2.9.9
添加开始的时候,异步加载数据
改进CodeEditor的代码提示和函数搜索
修改了图片,脚本路径获取方式,可能出现的bug
更新readme
改进密码修改,如果删除就卡片,则资源改名,否则复制。(资源:大图,小图,脚本)
2.2.9.8
调整菜单
2.2.9.7
紧急修复-setname额外的显示出错
2.2.9.6
读取MSE存档
可能出现的bug:通常魔法类型识别出错,P怪兽文本提取出错,或者无法识别该卡
存档结构:(要求:每张卡的内容,开头是card,最后一行是gamecode,在MSE的card_fields修改gamecode为最后的元素)
card:
...
gamecode: 123456
card:
....
gamecode: 123456
2.2.9.5
优化选择框
2.2.9.4
DataEditor
修改游戏数据的查找方式()Dic = >sortlist,加快卡片显示速度
2.2.9.3
修复CodeEditor
2.2.9.2
读取MSE存档暂未实现
修改DataEditor界面
如果这次显示有问题,请务必反馈
2.2.9.1
添加MSE设置说明
2.2.9.0
可以切换MSE的配置
配置整合
2.2.8.6
修复无种族的token,
2.2.8.4
japan
历史记录修正
2.2.8.3
japan
2.2.8.2
MSE的图片库相对路径
2.2.8.1
卡片描述完善,加快打开lua的速度。
2.2.8.0
修正setcode搜索
在打开的时候,自动检查更新
2.2.7.5
lua编辑器,编辑完,返回当前页数
2.2.7.4
lua编辑器,修复按ydk,图像读取,编辑卡片后列表结果bug
2.2.7.3
lua编辑器,4个空格转换为tab键
2.2.7.2
打开脚本,重复的时候,显示标签
2.2.7.1
历史记录分离,脚本编辑器的卡片信息描述
2.2.7.0
修复导入图片
整理代码
图片搜索支持png,bmp
2.2.6.4
修复lua编辑器的自动完成
2.2.6.3
导出数据:改为导出当前列表
2.2.6.2
导出MSE存档,支持png,jpg格式,支持密码,带0密码,卡名命名方式
2.2.6.1
修复english的race的兽战士
导出MSE存档,添加反转/filp
2.2.6.0
文件历史记录的顺序,从上到下。
导出MSE存档,支持设置每个存档的最大卡片数量
2.2.5.0
lua编辑器支持,读取和提示指示物代码。
添加残局示例single.lua
2.2.4.1
修复部分条件搜索
2.2.4.0
lua编辑器,Ctrl+鼠标左键 跳转到函数定义
2.2.3.4
english pengulum text
2.2.3.3
修复lua编辑器的控件遮挡问题
2.2.3.2
lua编辑器,
设置卡片库,鼠标悬停在密码时,提示卡片信息
在config可以设置lua编辑器的字体和大小
2.2.3.1
lua编辑器的函数提示带所属名
2.2.3.0
支持卡片名做为MSE存档的图片名,但是必须哈数据库的一致
2.2.2.2
增加从源码获取Lua的函数,并且自动排序函数
更新cpp的函数库,未包括utility.lua
fix english mse-config
2.2.2.1
添加关闭标签快捷键 Ctrl+W
修复lua编辑器打开大文件,无响应
lua内容变动,在关闭提示保存
2.2.2.0
lua编辑器增加根据功能说明搜索函数名
在下面的文本框输入关键字,按Enter
2.2.1.2
lua编辑器的风格
2.2.1.1
修复文件关联打开文件,无法记录打开历史
修复新建lua,没有覆盖旧文件
2.2.1.0
lua编辑器的文件菜单整合
2.2.0.0
增加lua编辑器,支持关联lua文件
等待:
lua编辑器的文件菜单整合
常用函数模板
根据函数提示搜索
2.1.4.0
改善:
浏览和导入MSE图片库的图片
按图像读取,可以支持读取卡片名的图片
2.1.3.1
修复:
支持浏览和导入MSE图片库的图片
2.1.3.0
导出MSE存档,支持8位密码前面带0(00012345)
支持浏览和导入MSE图片库的图片
对比,仅密码或者卡片信息
复制当前列表卡片
导出zip:
【名字】.cdb
【名字】.txt
desck/【名字】.ydk
pics/*.jpg
pics/thumbnail/*.jpg
2.1.2.0
修改网络连接数
2.1.1.1
修改MSE下载器
2.1.1.0
增加数据库对比
待测试 数据库对比后的操作:按ydk读取,按图像读取,搜索按钮,卡名搜索。
2.1.0.1
添加导出zip
2.1.0.0
添加历史记录,最多32条
2.0.0.3
更新mse-config.txt
2.0.0.2
复制卡片,粘贴卡片
2.0.0.1
分离文件菜单,下个版本,改进复制卡片功能
2.0.0.0
多标签界面
1.6.8.0
不再支持自动更新,请大家每天手动更新,下个版本添加多cdb编辑
把文件菜单的项分开
改进卡名搜索
添加atk,def搜索
1.6.7.0
任务进度提示
取消任务
1.6.6.0
mse-config.txt添加注释
1.6.5.0
改进自定义魔法陷阱
1.6.4.0
修复setcode输入错误
搜索为空的错误
1.6.3.0
为无种族的token添加token card类型
1.6.2.2
修复没有种族的token
1.6.2.1
修复导出MSE存档
1.6.2.0
MSE存档导出,修正english的魔法陷阱标志
增加单系列搜索
1.6.1.0
把config的MSE设置改为chinese(english)/mse-config.txt
1.6.0.0
增加简体转繁体功能
mse-italic.txt支持正则替换
1.5.5.2
增加MSE的mse-italic.txt
1.5.5.1
修复第2次导入图片,出bug
1.5.5.0
完成导出MSE存档,简体测试OK
注:config设置P描述和正常描述的分离的正则表达式
mse-head.txt的language设置语言:CN,TW,JP,EN,KO
1.5.4.0
setcode编辑框
1.5.3.0
增加压缩数据库
1.5.2.1
导入卡图的路径改为cdb的目录的pics
1.5.2.0
修复复制卡片的替换
增加批量导入卡图
1.5.1.1
改MSE更新器的默认路径
1.5.1.0
完善系列框,等待导出MSE存档
1.5.0.0
修复卡名搜索,读取ydk,读取图片
添加导出MSE存档,裁剪图片
可以记住最后打开数据库
1.4.1.0
添加撤销上一次操作。
1.4.0.0
增加多语言文件的可修改性。
1.3.4.2
新建数据库,改为提示是否打开。
打开空白数据库,将会清空当前列表和内容。
1.3.4.1
ATK/DEF输入?,自动转-2
1.3.4.0
支持 新建文本文档.txt 直接改名 新建文本文档.cdb
1.3.3.0
修复打开方式
1.3.2.2
整理代码
1.3.2.1
完善language.txt
1.3.2.0
修复
1.3.1.0
添加下载文件
1.3.0.1
分文件夹
1.3.0.0
txt文件,顺序可以打乱,关键是数值不能重复
支持多语言化
1.2.1.2
按密码搜索一样会显示同名卡
更改密码搜索
按密码搜索:密码框>0 同名框=0
按同名搜索:密码框=0 同名框>0
按密码范围搜索:密码框>0 同名框>0
1.2.1.1
自动把游戏目录设为cdb的目录
1.2.1.0
更改检查更新网址为我的百度空间
1.2.0.0
添加检查新版本
修复setname
\ No newline at end of file
......@@ -39,10 +39,12 @@ DataEditForm.mainMenu.menuitem_copyselectto 把选中复制到...
DataEditForm.mainMenu.menuitem_copyto 把结果复制到...
DataEditForm.mainMenu.menuitem_openLastDataBase 打开最后的数据库
DataEditForm.mainMenu.menuitem_quit 退出
DataEditForm.mainMenu.menu_setting 设置(&S)
DataEditForm.mainMenu.menu_image MSE(&M)
DataEditForm.mainMenu.menuitem_importmseimg 设置为MSE图片库
DataEditForm.mainMenu.menuitem_mseconfig 设置MSE的配置文件
DataEditForm.mainMenu.menu_tools 工具(&T)
DataEditForm.mainMenu.menu_data 数据(&D)
DataEditForm.mainMenu.menuitem_operacardsfile 同步操作卡片图片和脚本
DataEditForm.mainMenu.menuitem_openfileinthis 用CodeEditor打开脚本
DataEditForm.mainMenu.menuitem_findluafunc 从C++源码查找Lua函数
DataEditForm.mainMenu.menuitem_readydk 从卡组文件读取卡片(&Y)
DataEditForm.mainMenu.menuitem_readimages 从卡图文件夹读取卡片(&I)
......
......@@ -39,8 +39,10 @@ DataEditForm.mainMenu.menuitem_copyselectto Copy Selected...
DataEditForm.mainMenu.menuitem_copyto Copy All Search...
DataEditForm.mainMenu.menuitem_openLastDataBase Open Last DataBase
DataEditForm.mainMenu.menuitem_quit Quit
DataEditForm.mainMenu.menu_setting Setting(&S)
DataEditForm.mainMenu.menu_tools Tool(&T)
DataEditForm.mainMenu.menu_image MSE(&M)
DataEditForm.mainMenu.menu_data Data(&D)
DataEditForm.mainMenu.menuitem_operacardsfile Opera with Card's files
DataEditForm.mainMenu.menuitem_openfileinthis Open Script With CodeEditor
DataEditForm.mainMenu.menuitem_readydk Read From ydk File(&Y)
DataEditForm.mainMenu.menuitem_readimages Read From Images Path(&I)
DataEditForm.mainMenu.menuitem_compdb Compress DataBase
......
......@@ -14,7 +14,7 @@ imagepath = ./Images
spell = [魔法卡%%]
trap = [陷阱卡%%]
############################ language,style,other setting
head = mse version: 0.3.8\r\ngame: yugioh\r\nstylesheet: standard\r\nset info:\r\n\tlanguage: CN\r\n\tedition: \r\n\tST mark is text: no\r\n\tpendulum image is small: yes
head = mse version: 0.3.8\r\ngame: yugioh\r\nstylesheet: standard\r\nset info:\r\n\tlanguage: CN\r\n\tedition: \r\n\tST mark is text: no\r\n\tpendulum image is small: yes\r\n\thide gamecode: yes
end = version control:\n\ttype: none\napprentice code:
############################ Text
text =【摇摆文本】\n%ptext%\n【怪兽效果】\n%text%\n
......
This diff is collapsed.

★File association
.lua notepad++/sublime text/DataEditorX
.cdb DataEditorX
★Feedback
Email:247321453@qq.com or keyoyu@foxmail.com
Title:(DataEditorX+Version)
Content:Error Message
★Language setting
DataEditorX.exe.config
<add key="language" value="english" />
★DataEditor:
1.Atk/Eef=? , input ? or -2 or ?
2.pics,script and cdb's folder is a same
3.Cards Copy:
Replace:Yes:If exists then replace old /NO:If exists then ignore
4.Search Cards:
1.Search By setcode: only one
2.Search By Desc,Rule,attribute,level,race,card type,category
3.search By ATK/DEF:
atk/def = 0 input: -1
atk/def = ? input: -2 or ?
4.Search By Name :
A.O.J%%
流%%天
%%战士
5.Searcg By Code:
--code = 10000000 card code: 10000000 card alias: 0
--alias = 10000000 card code: 10000000 card alias:10000000
--10000000<=code<=20000000 card code: 10000000 card alias:20000000
★Magic Set Editor 2
Download/Update:"Magic Set Editor 2/download.bat"
★MSE-set setting
mse-head MSE set info setting
mse-monster other monster setting
mse-pendulum pendulum monster setting
mse-spelltrap spell/trap setting
mse-config spell/trap text,pendulum rule,maxcount,imagepath
1.Pendulum for english
Pendulum Scale = 10
Pendulum Text :
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxx
Monster Text :
xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxx
2.english/mse-config.txt
pendulum-text = Pendulum Text :\n([\S\s]*?)\n\n
monster-text = Monster Text :\n([\S\s]*)
★CodeEditor
input keyword in bottom textbox , "Enter"
Ctrl+Mouse.Left Goto Function define
Ctrl+Mouse.capture Setting Scale
No preview for this file type
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<!-- Example connection to a SQL Server Database on localhost. -->
<!-- <add name="ExampleConnectionString"
<connectionStrings>
<!-- Example connection to a SQL Server Database on localhost. -->
<!-- <add name="ExampleConnectionString"
connectionString="Data Source=.;Initial Catalog=DBName;Integrated Security=True"
providerName="System.Data.SqlClient" /> -->
</connectionStrings>
<appSettings>
<!-- access these values via the property:
</connectionStrings>
<appSettings>
<!-- access these values via the property:
System.Configuration.ConfigurationManager.AppSettings[key]
-->
<!-- MSE language data/mse_xxx.txt -->
<add key="mse" value="Chinese-Traditional" />
<!-- MSE language data/mse_xxx.txt -->
<add key="mse" value="Chinese-Simplified" />
<!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt -->
<add key="language" value="chinese" />
<!-- DataEditorX source code -->
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<!-- DataEditorX update url-->
<add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" />
<!-- async load data -->
<add key="async" value="false" />
<!-- DataEditorX source code -->
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<!-- DataEditorX update url-->
<add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" />
<!-- delete,modify with card's files image script -->
<add key="opera_with_cards_file" value="false" />
<!-- open file in this.such as lua -->
<add key="open_file_in_this" value="true" />
<!-- Cut Images Setting -->
<add key="image_quilty" value="100" />
<add key="image" value="44,64,177,254" />
<add key="image_other" value="25,54,128,128" />
<add key="image_xyz" value="24,51,128,128" />
<add key="image_pendulum" value="14,46,149,120" />
<!-- CodeEdiotr Setting
<add key="image_quilty" value="100" />
<add key="image" value="44,64,177,254" />
<add key="image_other" value="25,54,128,128" />
<add key="image_xyz" value="24,51,128,128" />
<add key="image_pendulum" value="14,46,149,120" />
<!-- CodeEdiotr Setting
IME = true 使用輸入法,正常顯示文字,反應變慢
IME = false English
-->
<add key="IME" value="false" />
<add key="IME" value="false" />
<add key="wordwrap" value="true" />
<add key="tabisspace" value="false" />
<add key="fontname" value="Consolas" />
<add key="fontsize" value="14.5" />
</appSettings>
<add key="fontname" value="Consolas" />
<add key="fontsize" value="14.5" />
</appSettings>
</configuration>
\ No newline at end of file
......@@ -11,13 +11,17 @@
System.Configuration.ConfigurationManager.AppSettings[key]
-->
<!-- MSE language data/mse_xxx.txt -->
<add key="mse" value="Chinese-Traditional" />
<add key="mse" value="Chinese-Simplified" />
<!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt -->
<add key="language" value="chinese" />
<!-- DataEditorX source code -->
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<!-- DataEditorX update url-->
<add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" />
<!-- delete,modify with card's files image script -->
<add key="opera_with_cards_file" value="true" />
<!-- open file in this.such as lua -->
<add key="open_file_in_this" value="true" />
<!-- Cut Images Setting -->
<add key="image_quilty" value="100" />
<add key="image" value="44,64,177,254" />
......
★更新历史
2.2.9.9
添加开始的时候,异步加载数据
改进CodeEditor的代码提示和函数搜索
修改了图片,脚本路径获取方式,可能出现的bug
更新readme
改进密码修改,如果删除就卡片,则资源改名,否则复制。(资源:大图,小图,脚本)
2.2.9.8
调整菜单
2.2.9.7
紧急修复-setname额外的显示出错
2.2.9.6
读取MSE存档
可能出现的bug:通常魔法类型识别出错,P怪兽文本提取出错,或者无法识别该卡
存档结构:(要求:每张卡的内容,开头是card,最后一行是gamecode,在MSE的card_fields修改gamecode为最后的元素)
card:
...
gamecode: 123456
card:
....
gamecode: 123456
2.2.9.5
优化选择框
2.2.9.4
DataEditor
修改游戏数据的查找方式()Dic = >sortlist,加快卡片显示速度
2.2.9.3
修复CodeEditor
2.2.9.2
读取MSE存档暂未实现
修改DataEditor界面
如果这次显示有问题,请务必反馈
2.2.9.1
添加MSE设置说明
2.2.9.0
可以切换MSE的配置
配置整合
2.2.8.6
修复无种族的token,
2.2.8.4
japan
历史记录修正
2.2.8.3
japan
2.2.8.2
MSE的图片库相对路径
2.2.8.1
卡片描述完善,加快打开lua的速度。
2.2.8.0
修正setcode搜索
在打开的时候,自动检查更新
2.2.7.5
lua编辑器,编辑完,返回当前页数
2.2.7.4
lua编辑器,修复按ydk,图像读取,编辑卡片后列表结果bug
2.2.7.3
lua编辑器,4个空格转换为tab键
2.2.7.2
打开脚本,重复的时候,显示标签
2.2.7.1
历史记录分离,脚本编辑器的卡片信息描述
2.2.7.0
修复导入图片
整理代码
图片搜索支持png,bmp
2.2.6.4
修复lua编辑器的自动完成
2.2.6.3
导出数据:改为导出当前列表
2.2.6.2
导出MSE存档,支持png,jpg格式,支持密码,带0密码,卡名命名方式
2.2.6.1
修复english的race的兽战士
导出MSE存档,添加反转/filp
2.2.6.0
文件历史记录的顺序,从上到下。
导出MSE存档,支持设置每个存档的最大卡片数量
2.2.5.0
lua编辑器支持,读取和提示指示物代码。
添加残局示例single.lua
2.2.4.1
修复部分条件搜索
2.2.4.0
lua编辑器,Ctrl+鼠标左键 跳转到函数定义
2.2.3.4
english pengulum text
2.2.3.3
修复lua编辑器的控件遮挡问题
2.2.3.2
lua编辑器,
设置卡片库,鼠标悬停在密码时,提示卡片信息
在config可以设置lua编辑器的字体和大小
2.2.3.1
lua编辑器的函数提示带所属名
2.2.3.0
支持卡片名做为MSE存档的图片名,但是必须哈数据库的一致
2.2.2.2
增加从源码获取Lua的函数,并且自动排序函数
更新cpp的函数库,未包括utility.lua
fix english mse-config
2.2.2.1
添加关闭标签快捷键 Ctrl+W
修复lua编辑器打开大文件,无响应
lua内容变动,在关闭提示保存
2.2.2.0
lua编辑器增加根据功能说明搜索函数名
在下面的文本框输入关键字,按Enter
2.2.1.2
lua编辑器的风格
2.2.1.1
修复文件关联打开文件,无法记录打开历史
修复新建lua,没有覆盖旧文件
2.2.1.0
lua编辑器的文件菜单整合
2.2.0.0
增加lua编辑器,支持关联lua文件
等待:
lua编辑器的文件菜单整合
常用函数模板
根据函数提示搜索
2.1.4.0
改善:
浏览和导入MSE图片库的图片
按图像读取,可以支持读取卡片名的图片
2.1.3.1
修复:
支持浏览和导入MSE图片库的图片
2.1.3.0
导出MSE存档,支持8位密码前面带0(00012345)
支持浏览和导入MSE图片库的图片
对比,仅密码或者卡片信息
复制当前列表卡片
导出zip:
【名字】.cdb
【名字】.txt
desck/【名字】.ydk
pics/*.jpg
pics/thumbnail/*.jpg
2.1.2.0
修改网络连接数
2.1.1.1
修改MSE下载器
2.1.1.0
增加数据库对比
待测试 数据库对比后的操作:按ydk读取,按图像读取,搜索按钮,卡名搜索。
2.1.0.1
添加导出zip
2.1.0.0
添加历史记录,最多32条
2.0.0.3
更新mse-config.txt
2.0.0.2
复制卡片,粘贴卡片
2.0.0.1
分离文件菜单,下个版本,改进复制卡片功能
2.0.0.0
多标签界面
1.6.8.0
不再支持自动更新,请大家每天手动更新,下个版本添加多cdb编辑
把文件菜单的项分开
改进卡名搜索
添加atk,def搜索
1.6.7.0
任务进度提示
取消任务
1.6.6.0
mse-config.txt添加注释
1.6.5.0
改进自定义魔法陷阱
1.6.4.0
修复setcode输入错误
搜索为空的错误
1.6.3.0
为无种族的token添加token card类型
1.6.2.2
修复没有种族的token
1.6.2.1
修复导出MSE存档
1.6.2.0
MSE存档导出,修正english的魔法陷阱标志
增加单系列搜索
1.6.1.0
把config的MSE设置改为chinese(english)/mse-config.txt
1.6.0.0
增加简体转繁体功能
mse-italic.txt支持正则替换
1.5.5.2
增加MSE的mse-italic.txt
1.5.5.1
修复第2次导入图片,出bug
1.5.5.0
完成导出MSE存档,简体测试OK
注:config设置P描述和正常描述的分离的正则表达式
mse-head.txt的language设置语言:CN,TW,JP,EN,KO
1.5.4.0
setcode编辑框
1.5.3.0
增加压缩数据库
1.5.2.1
导入卡图的路径改为cdb的目录的pics
1.5.2.0
修复复制卡片的替换
增加批量导入卡图
1.5.1.1
改MSE更新器的默认路径
1.5.1.0
完善系列框,等待导出MSE存档
1.5.0.0
修复卡名搜索,读取ydk,读取图片
添加导出MSE存档,裁剪图片
可以记住最后打开数据库
1.4.1.0
添加撤销上一次操作。
1.4.0.0
增加多语言文件的可修改性。
1.3.4.2
新建数据库,改为提示是否打开。
打开空白数据库,将会清空当前列表和内容。
1.3.4.1
ATK/DEF输入?,自动转-2
1.3.4.0
支持 新建文本文档.txt 直接改名 新建文本文档.cdb
1.3.3.0
修复打开方式
1.3.2.2
整理代码
1.3.2.1
完善language.txt
1.3.2.0
修复
1.3.1.0
添加下载文件
1.3.0.1
分文件夹
1.3.0.0
txt文件,顺序可以打乱,关键是数值不能重复
支持多语言化
1.2.1.2
按密码搜索一样会显示同名卡
更改密码搜索
按密码搜索:密码框>0 同名框=0
按同名搜索:密码框=0 同名框>0
按密码范围搜索:密码框>0 同名框>0
1.2.1.1
自动把游戏目录设为cdb的目录
1.2.1.0
更改检查更新网址为我的百度空间
1.2.0.0
添加检查新版本
修复setname
\ No newline at end of file
# database history
F:\games\ygopro\p.cdb
F:\games\ygopro\cards.cdb
# script history
F:\games\ygopro\script\c168917.lua
F:\games\ygopro\script\c218704.lua
F:\games\ygopro\script\c126218.lua
F:\games\ygopro\script\c259314.lua
F:\games\ygopro\script\c62121.lua
F:\games\ygopro\script\c359563.lua
F:\games\ygopro\script\c42338879.lua
F:\games\ygopro\script\c42391240.lua
F:\games\ygopro\script\c191749.lua
F:\games\ygopro\script\c50755.lua
F:\games\ygopro\script\c41777.lua
\ No newline at end of file
......@@ -39,10 +39,12 @@ DataEditForm.mainMenu.menuitem_copyselectto 把选中复制到...
DataEditForm.mainMenu.menuitem_copyto 把结果复制到...
DataEditForm.mainMenu.menuitem_openLastDataBase 打开最后的数据库
DataEditForm.mainMenu.menuitem_quit 退出
DataEditForm.mainMenu.menu_setting 设置(&S)
DataEditForm.mainMenu.menu_image MSE(&M)
DataEditForm.mainMenu.menuitem_importmseimg 设置为MSE图片库
DataEditForm.mainMenu.menuitem_mseconfig 设置MSE的配置文件
DataEditForm.mainMenu.menu_tools 工具(&T)
DataEditForm.mainMenu.menu_data 数据(&D)
DataEditForm.mainMenu.menuitem_operacardsfile 同步操作卡片图片和脚本
DataEditForm.mainMenu.menuitem_openfileinthis 用CodeEditor打开脚本
DataEditForm.mainMenu.menuitem_findluafunc 从C++源码查找Lua函数
DataEditForm.mainMenu.menuitem_readydk 从卡组文件读取卡片(&Y)
DataEditForm.mainMenu.menuitem_readimages 从卡图文件夹读取卡片(&I)
......
......@@ -39,8 +39,10 @@ DataEditForm.mainMenu.menuitem_copyselectto Copy Selected...
DataEditForm.mainMenu.menuitem_copyto Copy All Search...
DataEditForm.mainMenu.menuitem_openLastDataBase Open Last DataBase
DataEditForm.mainMenu.menuitem_quit Quit
DataEditForm.mainMenu.menu_setting Setting(&S)
DataEditForm.mainMenu.menu_tools Tool(&T)
DataEditForm.mainMenu.menu_image MSE(&M)
DataEditForm.mainMenu.menu_data Data(&D)
DataEditForm.mainMenu.menuitem_operacardsfile Opera with Card's files
DataEditForm.mainMenu.menuitem_openfileinthis Open Script With CodeEditor
DataEditForm.mainMenu.menuitem_readydk Read From ydk File(&Y)
DataEditForm.mainMenu.menuitem_readimages Read From Images Path(&I)
DataEditForm.mainMenu.menuitem_compdb Compress DataBase
......
......@@ -14,7 +14,7 @@ imagepath = ./Images
spell = [魔法卡%%]
trap = [陷阱卡%%]
############################ language,style,other setting
head = mse version: 0.3.8\r\ngame: yugioh\r\nstylesheet: standard\r\nset info:\r\n\tlanguage: CN\r\n\tedition: \r\n\tST mark is text: no\r\n\tpendulum image is small: yes
head = mse version: 0.3.8\r\ngame: yugioh\r\nstylesheet: standard\r\nset info:\r\n\tlanguage: CN\r\n\tedition: \r\n\tST mark is text: no\r\n\tpendulum image is small: yes\r\n\thide gamecode: yes
end = version control:\n\ttype: none\napprentice code:
############################ Text
text =【摇摆文本】\n%ptext%\n【怪兽效果】\n%text%\n
......
This diff is collapsed.

★File association
.lua notepad++/sublime text/DataEditorX
.cdb DataEditorX
★Feedback
Email:247321453@qq.com or keyoyu@foxmail.com
Title:(DataEditorX+Version)
Content:Error Message
★Language setting
DataEditorX.exe.config
<add key="language" value="english" />
★DataEditor:
1.Atk/Eef=? , input ? or -2 or ?
2.pics,script and cdb's folder is a same
3.Cards Copy:
Replace:Yes:If exists then replace old /NO:If exists then ignore
4.Search Cards:
1.Search By setcode: only one
2.Search By Desc,Rule,attribute,level,race,card type,category
3.search By ATK/DEF:
atk/def = 0 input: -1
atk/def = ? input: -2 or ?
4.Search By Name :
A.O.J%%
流%%天
%%战士
5.Searcg By Code:
--code = 10000000 card code: 10000000 card alias: 0
--alias = 10000000 card code: 10000000 card alias:10000000
--10000000<=code<=20000000 card code: 10000000 card alias:20000000
★Magic Set Editor 2
Download/Update:"Magic Set Editor 2/download.bat"
★MSE-set setting
mse-head MSE set info setting
mse-monster other monster setting
mse-pendulum pendulum monster setting
mse-spelltrap spell/trap setting
mse-config spell/trap text,pendulum rule,maxcount,imagepath
1.Pendulum for english
Pendulum Scale = 10
Pendulum Text :
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxx
Monster Text :
xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxx
2.english/mse-config.txt
pendulum-text = Pendulum Text :\n([\S\s]*?)\n\n
monster-text = Monster Text :\n([\S\s]*)
★CodeEditor
input keyword in bottom textbox , "Enter"
Ctrl+Mouse.Left Goto Function define
Ctrl+Mouse.capture Setting Scale
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