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
}
......
......@@ -46,23 +46,28 @@ private void InitializeComponent()
this.menuitem_openLastDataBase = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_quit = new System.Windows.Forms.ToolStripMenuItem();
this.menu_setting = new System.Windows.Forms.ToolStripMenuItem();
this.menu_image = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_mseconfig = new System.Windows.Forms.ToolStripMenuItem();
this.tsep3 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_readmse = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_saveasmse_select = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_saveasmse = new System.Windows.Forms.ToolStripMenuItem();
this.tsep7 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_importmseimg = new System.Windows.Forms.ToolStripMenuItem();
this.menu_tools = new System.Windows.Forms.ToolStripMenuItem();
this.menu_data = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_operacardsfile = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_openfileinthis = new System.Windows.Forms.ToolStripMenuItem();
this.tsep2 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_readydk = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_readimages = new System.Windows.Forms.ToolStripMenuItem();
this.tsep6 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_exportdata = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_compdb = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_findluafunc = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_exportdata = new System.Windows.Forms.ToolStripMenuItem();
this.tsep5 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_readmse = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_saveasmse_select = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_saveasmse = new System.Windows.Forms.ToolStripMenuItem();
this.tsep3 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_cutimages = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_convertimage = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.tsep1 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_cancelTask = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_help = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_about = new System.Windows.Forms.ToolStripMenuItem();
......@@ -119,7 +124,6 @@ private void InitializeComponent()
this.lv_cardlist = new System.Windows.Forms.DListView();
this.ch_cardcode = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ch_cardname = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.menuitem_compdb = new System.Windows.Forms.ToolStripMenuItem();
this.mainMenu.SuspendLayout();
this.SuspendLayout();
//
......@@ -127,8 +131,8 @@ private void InitializeComponent()
//
this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuitem_file,
this.menu_setting,
this.menu_tools,
this.menu_image,
this.menu_data,
this.menuitem_help});
this.mainMenu.Location = new System.Drawing.Point(0, 0);
this.mainMenu.Name = "mainMenu";
......@@ -141,7 +145,6 @@ private void InitializeComponent()
this.menuitem_file.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuitem_open,
this.menuitem_new,
this.menuitem_compdb,
this.toolStripSeparator3,
this.menuitem_copyselectto,
this.menuitem_copyto,
......@@ -206,136 +209,172 @@ private void InitializeComponent()
this.menuitem_quit.Size = new System.Drawing.Size(232, 22);
this.menuitem_quit.Text = "Quit";
//
// menu_setting
// menu_image
//
this.menu_setting.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menu_image.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuitem_mseconfig,
this.tsep3,
this.menuitem_readmse,
this.menuitem_saveasmse_select,
this.menuitem_saveasmse,
this.tsep7,
this.menuitem_importmseimg});
this.menu_setting.Name = "menu_setting";
this.menu_setting.Size = new System.Drawing.Size(75, 21);
this.menu_setting.Text = "Setting(&S)";
this.menu_image.Name = "menu_image";
this.menu_image.Size = new System.Drawing.Size(69, 21);
this.menu_image.Text = "Image(&I)";
//
// menuitem_mseconfig
//
this.menuitem_mseconfig.Name = "menuitem_mseconfig";
this.menuitem_mseconfig.Size = new System.Drawing.Size(193, 22);
this.menuitem_mseconfig.Size = new System.Drawing.Size(200, 22);
this.menuitem_mseconfig.Text = "MSE config";
//
// tsep3
//
this.tsep3.Name = "tsep3";
this.tsep3.Size = new System.Drawing.Size(197, 6);
//
// menuitem_readmse
//
this.menuitem_readmse.Name = "menuitem_readmse";
this.menuitem_readmse.Size = new System.Drawing.Size(200, 22);
this.menuitem_readmse.Text = "Read from MSE";
this.menuitem_readmse.Click += new System.EventHandler(this.menuitem_readmse_Click);
//
// menuitem_saveasmse_select
//
this.menuitem_saveasmse_select.Name = "menuitem_saveasmse_select";
this.menuitem_saveasmse_select.Size = new System.Drawing.Size(200, 22);
this.menuitem_saveasmse_select.Text = "Select Save As MSE";
this.menuitem_saveasmse_select.Click += new System.EventHandler(this.Menuitem_saveasmse_selectClick);
//
// menuitem_saveasmse
//
this.menuitem_saveasmse.Name = "menuitem_saveasmse";
this.menuitem_saveasmse.Size = new System.Drawing.Size(200, 22);
this.menuitem_saveasmse.Text = "All Now Save As MSE";
this.menuitem_saveasmse.Click += new System.EventHandler(this.Menuitem_saveasmseClick);
//
// tsep7
//
this.tsep7.Name = "tsep7";
this.tsep7.Size = new System.Drawing.Size(197, 6);
//
// menuitem_importmseimg
//
this.menuitem_importmseimg.Name = "menuitem_importmseimg";
this.menuitem_importmseimg.Size = new System.Drawing.Size(193, 22);
this.menuitem_importmseimg.Size = new System.Drawing.Size(200, 22);
this.menuitem_importmseimg.Text = "Drop Image to MSE";
this.menuitem_importmseimg.Click += new System.EventHandler(this.menuitem_importmseimg_Click);
//
// menu_tools
// menu_data
//
this.menu_tools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menu_data.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuitem_operacardsfile,
this.menuitem_openfileinthis,
this.tsep2,
this.menuitem_readydk,
this.menuitem_readimages,
this.tsep6,
this.menuitem_exportdata,
this.menuitem_compdb,
this.menuitem_findluafunc,
this.menuitem_exportdata,
this.tsep5,
this.menuitem_readmse,
this.menuitem_saveasmse_select,
this.menuitem_saveasmse,
this.tsep3,
this.menuitem_cutimages,
this.menuitem_convertimage,
this.toolStripSeparator1,
this.tsep1,
this.menuitem_cancelTask});
this.menu_tools.Name = "menu_tools";
this.menu_tools.Size = new System.Drawing.Size(67, 21);
this.menu_tools.Text = "Tools(&T)";
this.menu_data.Name = "menu_data";
this.menu_data.Size = new System.Drawing.Size(62, 21);
this.menu_data.Text = "Data(&T)";
//
// menuitem_operacardsfile
//
this.menuitem_operacardsfile.Name = "menuitem_operacardsfile";
this.menuitem_operacardsfile.Size = new System.Drawing.Size(212, 22);
this.menuitem_operacardsfile.Text = "Opera Card\'s Files";
this.menuitem_operacardsfile.Click += new System.EventHandler(this.menuitem_deletecardsfile_Click);
//
// menuitem_openfileinthis
//
this.menuitem_openfileinthis.Name = "menuitem_openfileinthis";
this.menuitem_openfileinthis.Size = new System.Drawing.Size(212, 22);
this.menuitem_openfileinthis.Text = "Open File in This";
this.menuitem_openfileinthis.Click += new System.EventHandler(this.menuitem_openfileinthis_Click);
//
// tsep2
//
this.tsep2.Name = "tsep2";
this.tsep2.Size = new System.Drawing.Size(209, 6);
//
// menuitem_readydk
//
this.menuitem_readydk.Name = "menuitem_readydk";
this.menuitem_readydk.Size = new System.Drawing.Size(205, 22);
this.menuitem_readydk.Size = new System.Drawing.Size(212, 22);
this.menuitem_readydk.Text = "Cards Form ydk file(&Y)";
this.menuitem_readydk.Click += new System.EventHandler(this.Menuitem_readydkClick);
//
// menuitem_readimages
//
this.menuitem_readimages.Name = "menuitem_readimages";
this.menuitem_readimages.Size = new System.Drawing.Size(205, 22);
this.menuitem_readimages.Size = new System.Drawing.Size(212, 22);
this.menuitem_readimages.Text = "Cards From Images(&I)";
this.menuitem_readimages.Click += new System.EventHandler(this.Menuitem_readimagesClick);
//
// tsep6
//
this.tsep6.Name = "tsep6";
this.tsep6.Size = new System.Drawing.Size(202, 6);
this.tsep6.Size = new System.Drawing.Size(209, 6);
//
// menuitem_exportdata
// menuitem_compdb
//
this.menuitem_exportdata.Name = "menuitem_exportdata";
this.menuitem_exportdata.Size = new System.Drawing.Size(205, 22);
this.menuitem_exportdata.Text = "Export Data";
this.menuitem_exportdata.Click += new System.EventHandler(this.Menuitem_exportdataClick);
this.menuitem_compdb.Name = "menuitem_compdb";
this.menuitem_compdb.Size = new System.Drawing.Size(212, 22);
this.menuitem_compdb.Text = "Compression DataBase";
this.menuitem_compdb.Click += new System.EventHandler(this.menuitem_compdb_Click);
//
// menuitem_findluafunc
//
this.menuitem_findluafunc.Name = "menuitem_findluafunc";
this.menuitem_findluafunc.Size = new System.Drawing.Size(205, 22);
this.menuitem_findluafunc.Size = new System.Drawing.Size(212, 22);
this.menuitem_findluafunc.Text = "Find Lua Function";
this.menuitem_findluafunc.Click += new System.EventHandler(this.menuitem_findluafunc_Click);
//
// tsep5
//
this.tsep5.Name = "tsep5";
this.tsep5.Size = new System.Drawing.Size(202, 6);
//
// menuitem_readmse
//
this.menuitem_readmse.Name = "menuitem_readmse";
this.menuitem_readmse.Size = new System.Drawing.Size(205, 22);
this.menuitem_readmse.Text = "Read from MSE";
this.menuitem_readmse.Click += new System.EventHandler(this.menuitem_readmse_Click);
//
// menuitem_saveasmse_select
//
this.menuitem_saveasmse_select.Name = "menuitem_saveasmse_select";
this.menuitem_saveasmse_select.Size = new System.Drawing.Size(205, 22);
this.menuitem_saveasmse_select.Text = "Select Save As MSE";
this.menuitem_saveasmse_select.Click += new System.EventHandler(this.Menuitem_saveasmse_selectClick);
//
// menuitem_saveasmse
// menuitem_exportdata
//
this.menuitem_saveasmse.Name = "menuitem_saveasmse";
this.menuitem_saveasmse.Size = new System.Drawing.Size(205, 22);
this.menuitem_saveasmse.Text = "All Now Save As MSE";
this.menuitem_saveasmse.Click += new System.EventHandler(this.Menuitem_saveasmseClick);
this.menuitem_exportdata.Name = "menuitem_exportdata";
this.menuitem_exportdata.Size = new System.Drawing.Size(212, 22);
this.menuitem_exportdata.Text = "Export Data";
this.menuitem_exportdata.Click += new System.EventHandler(this.Menuitem_exportdataClick);
//
// tsep3
// tsep5
//
this.tsep3.Name = "tsep3";
this.tsep3.Size = new System.Drawing.Size(202, 6);
this.tsep5.Name = "tsep5";
this.tsep5.Size = new System.Drawing.Size(209, 6);
//
// menuitem_cutimages
//
this.menuitem_cutimages.Name = "menuitem_cutimages";
this.menuitem_cutimages.Size = new System.Drawing.Size(205, 22);
this.menuitem_cutimages.Size = new System.Drawing.Size(212, 22);
this.menuitem_cutimages.Text = "Cut Images";
this.menuitem_cutimages.Click += new System.EventHandler(this.Menuitem_cutimagesClick);
//
// menuitem_convertimage
//
this.menuitem_convertimage.Name = "menuitem_convertimage";
this.menuitem_convertimage.Size = new System.Drawing.Size(205, 22);
this.menuitem_convertimage.Size = new System.Drawing.Size(212, 22);
this.menuitem_convertimage.Text = "Import Images";
this.menuitem_convertimage.Click += new System.EventHandler(this.Menuitem_convertimageClick);
//
// toolStripSeparator1
// tsep1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(202, 6);
this.tsep1.Name = "tsep1";
this.tsep1.Size = new System.Drawing.Size(209, 6);
//
// menuitem_cancelTask
//
this.menuitem_cancelTask.Name = "menuitem_cancelTask";
this.menuitem_cancelTask.Size = new System.Drawing.Size(205, 22);
this.menuitem_cancelTask.Size = new System.Drawing.Size(212, 22);
this.menuitem_cancelTask.Text = "Cancel Task";
this.menuitem_cancelTask.Click += new System.EventHandler(this.Menuitem_cancelTaskClick);
//
......@@ -782,6 +821,7 @@ private void InitializeComponent()
this.pl_image.TabIndex = 14;
this.pl_image.DragDrop += new System.Windows.Forms.DragEventHandler(this.Pl_imageDragDrop);
this.pl_image.DragEnter += new System.Windows.Forms.DragEventHandler(this.Pl_imageDragEnter);
this.pl_image.DoubleClick += new System.EventHandler(this.pl_image_DoubleClick);
//
// lb_types
//
......@@ -966,13 +1006,6 @@ private void InitializeComponent()
this.ch_cardname.Text = "Card Name";
this.ch_cardname.Width = 140;
//
// menuitem_compdb
//
this.menuitem_compdb.Name = "menuitem_compdb";
this.menuitem_compdb.Size = new System.Drawing.Size(232, 22);
this.menuitem_compdb.Text = "Compression DataBase";
this.menuitem_compdb.Click += new System.EventHandler(this.menuitem_compdb_Click);
//
// DataEditForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -1050,18 +1083,15 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem menuitem_open;
private System.Windows.Forms.ToolStripMenuItem menuitem_new;
private System.Windows.Forms.ToolStripMenuItem menuitem_file;
private System.Windows.Forms.ToolStripMenuItem menu_tools;
private System.Windows.Forms.ToolStripMenuItem menu_data;
private System.Windows.Forms.ToolStripMenuItem menuitem_cancelTask;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripSeparator tsep1;
private System.Windows.Forms.TextBox tb_setcode4;
private System.Windows.Forms.TextBox tb_setcode3;
private System.Windows.Forms.TextBox tb_setcode2;
private System.Windows.Forms.TextBox tb_setcode1;
private System.Windows.Forms.ToolStripSeparator tsep5;
private System.Windows.Forms.ToolStripMenuItem menuitem_convertimage;
private System.Windows.Forms.ToolStripMenuItem menuitem_cutimages;
private System.Windows.Forms.ToolStripMenuItem menuitem_saveasmse;
private System.Windows.Forms.ToolStripMenuItem menuitem_saveasmse_select;
private System.Windows.Forms.ToolStripSeparator tsep4;
private System.Windows.Forms.Button btn_img;
private System.Windows.Forms.Button btn_undo;
......@@ -1115,17 +1145,24 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem menuitem_checkupdate;
private System.Windows.Forms.ToolStripMenuItem menuitem_about;
private System.Windows.Forms.ToolStripMenuItem menuitem_help;
private System.Windows.Forms.ToolStripSeparator tsep3;
private System.Windows.Forms.ToolStripMenuItem menuitem_readimages;
private System.Windows.Forms.ToolStripMenuItem menuitem_readydk;
private System.Windows.Forms.ToolStripMenuItem menuitem_copyto;
private System.Windows.Forms.MenuStrip mainMenu;
private System.Windows.Forms.ToolStripMenuItem menuitem_readmse;
private System.Windows.Forms.ToolStripMenuItem menu_setting;
private System.Windows.Forms.ToolStripMenuItem menu_image;
private System.Windows.Forms.ToolStripMenuItem menuitem_mseconfig;
private System.Windows.Forms.ToolStripMenuItem menuitem_importmseimg;
private System.Windows.Forms.ToolStripMenuItem menuitem_findluafunc;
private System.Windows.Forms.ToolStripSeparator tsep6;
private System.Windows.Forms.ToolStripMenuItem menuitem_compdb;
private System.Windows.Forms.ToolStripMenuItem menuitem_readmse;
private System.Windows.Forms.ToolStripMenuItem menuitem_saveasmse_select;
private System.Windows.Forms.ToolStripMenuItem menuitem_saveasmse;
private System.Windows.Forms.ToolStripSeparator tsep3;
private System.Windows.Forms.ToolStripSeparator tsep7;
private System.Windows.Forms.ToolStripMenuItem menuitem_cutimages;
private System.Windows.Forms.ToolStripMenuItem menuitem_operacardsfile;
private System.Windows.Forms.ToolStripSeparator tsep2;
private System.Windows.Forms.ToolStripMenuItem menuitem_openfileinthis;
}
}
......@@ -7,33 +7,33 @@
*/
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Text;
using System.Windows.Forms;
using DataEditorX.Core;
using DataEditorX.Language;
using WeifenLuo.WinFormsUI.Docking;
using DataEditorX.Controls;
using DataEditorX.Config;
using DataEditorX.Core.Mse;
namespace DataEditorX
{
public partial class DataEditForm : DockContent, IEditForm
public partial class DataEditForm : DockContent, IDataForm
{
#region 成员变量/构造
TaskHelper tasker = null;
string taskname;
string GAMEPATH = "", PICPATH = "", PICPATH2 = "", LUAPTH = "";
//目录
YgoPath ygopath;
/// <summary>当前卡片</summary>
Card oldCard = new Card(0);
/// <summary>搜索条件</summary>
Card srcCard = new Card(0);
//卡片编辑
CardEdit cardedit;
string[] strs = null;
/// <summary>
/// 对比的id集合
......@@ -49,9 +49,8 @@ public partial class DataEditForm : DockContent, IEditForm
/// </summary>
int cardcount;
/// <summary>
/// 撤销的sql
/// 搜索结果
/// </summary>
string undoString;
List<Card> cardlist = new List<Card>();
//setcode正在输入
bool[] setcodeIsedit = new bool[5];
......@@ -63,15 +62,13 @@ public partial class DataEditForm : DockContent, IEditForm
public DataEditForm(string datapath, string cdbfile)
{
InitPath(datapath);
Initialize();
Initialize(datapath);
nowCdbFile = cdbfile;
}
public DataEditForm(string datapath)
{
InitPath(datapath);
Initialize();
Initialize(datapath);
}
public DataEditForm()
{//默认启动
......@@ -81,12 +78,15 @@ public DataEditForm()
Application.Exit();
}
datapath = MyPath.Combine(Application.StartupPath, dir);
InitPath(datapath);
Initialize();
Initialize(datapath);
}
void Initialize()
void Initialize(string datapath)
{
cardedit = new CardEdit(this);
tmpCodes = new List<string>();
ygopath = new YgoPath(Application.StartupPath);
InitPath(datapath);
InitializeComponent();
title = this.Text;
nowCdbFile = "";
......@@ -130,7 +130,10 @@ void DataEditFormLoad(object sender, EventArgs e)
//设置空白卡片
oldCard = new Card(0);
SetCard(oldCard);
//删除资源
menuitem_operacardsfile.Checked = MyConfig.readBoolean(MyConfig.TAG_DELETE_WITH);
//用CodeEditor打开脚本
menuitem_openfileinthis.Checked = MyConfig.readBoolean(MyConfig.TAG_OPEN_IN_THIS);
if (nowCdbFile != null && File.Exists(nowCdbFile))
Open(nowCdbFile);
//获取MSE配菜单
......@@ -219,17 +222,12 @@ void SetCDB(string cdb)
{
this.nowCdbFile = cdb;
SetTitle();
string path = Application.StartupPath;
if (cdb.Length > 0)
{
char SEP = Path.DirectorySeparatorChar;
int l = nowCdbFile.LastIndexOf(SEP);
GAMEPATH = (l > 0) ? nowCdbFile.Substring(0, l + 1) : cdb;
path = Path.GetDirectoryName(cdb);
}
else
GAMEPATH = Application.StartupPath;
PICPATH = MyPath.Combine(GAMEPATH, "pics");
PICPATH2 = MyPath.Combine(PICPATH, "thumbnail");
LUAPTH = MyPath.Combine(GAMEPATH, "script");
ygopath.SetPath(path);
}
//初始化文件路径
void InitPath(string datapath)
......@@ -275,7 +273,7 @@ void InitCheckPanel(FlowLayoutPanel fpanel, Dictionary<long, string> dic)
foreach (long key in dic.Keys)
{
CheckBox _cbox = new CheckBox();
_cbox.Name = fpanel.Name + key.ToString("x");
//_cbox.Name = fpanel.Name + key.ToString("x");
_cbox.Tag = key;//绑定值
_cbox.Text = dic[key];
_cbox.AutoSize = true;
......@@ -425,6 +423,7 @@ void AddListView(int p)
{
mcard = cardlist[i];
items[j] = new ListViewItem();
items[j].Tag = i;
items[j].Text = mcard.id.ToString();
if (mcard.id == oldCard.id)
items[j].Checked = true;
......@@ -443,7 +442,15 @@ void AddListView(int p)
#endregion
#region 设置卡片
void SetCard(Card c)
public YgoPath GetPath()
{
return ygopath;
}
public Card GetOldCard()
{
return oldCard;
}
public void SetCard(Card c)
{
oldCard = c;
if (c.str == null)
......@@ -485,12 +492,12 @@ void SetCard(Card c)
tb_def.Text = (c.def < 0) ? "?" : c.def.ToString();
tb_cardcode.Text = c.id.ToString();
tb_cardalias.Text = c.alias.ToString();
setImage(c.id.ToString());
SetImage(c.id.ToString());
}
#endregion
#region 获取卡片
Card GetCard()
public Card GetCard()
{
int temp;
Card c = new Card(0);
......@@ -561,15 +568,21 @@ void Lv_cardlistKeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Delete: DelCards(); break;
case Keys.Right: Btn_PageDownClick(null, null); break;
case Keys.Left: Btn_PageUpClick(null, null); break;
case Keys.Delete:
cardedit.DelCards(menuitem_operacardsfile.Checked);
break;
case Keys.Right:
Btn_PageDownClick(null, null);
break;
case Keys.Left:
Btn_PageUpClick(null, null);
break;
}
}
//上一页
void Btn_PageUpClick(object sender, EventArgs e)
{
if (!Check())
if (!CheckOpen())
return;
page--;
AddListView(page);
......@@ -577,7 +590,7 @@ void Btn_PageUpClick(object sender, EventArgs e)
//下一页
void Btn_PageDownClick(object sender, EventArgs e)
{
if (!Check())
if (!CheckOpen())
return;
page++;
AddListView(page);
......@@ -597,7 +610,7 @@ void Tb_pageKeyPress(object sender, KeyPressEventArgs e)
#region 卡片搜索,打开
//检查是否打开数据库
public bool Check()
public bool CheckOpen()
{
if (File.Exists(nowCdbFile))
return true;
......@@ -653,7 +666,7 @@ public void SetCards(Card[] cards, bool isfresh)
AddListView(1);
}
else
{
{//结果为空
cardcount = 0;
page = 1;
pageNum = 1;
......@@ -665,9 +678,13 @@ public void SetCards(Card[] cards, bool isfresh)
}
}
//搜索卡片
public void Search(Card c, bool isfresh)
public void Search(bool isfresh)
{
Search(srcCard, isfresh);
}
void Search(Card c, bool isfresh)
{
if (!Check())
if (!CheckOpen())
return;
//如果临时卡片不为空,则更新,这个在搜索的时候清空
if (tmpCodes.Count > 0)
......@@ -691,158 +708,6 @@ public void Reset()
}
#endregion
#region 卡片编辑
//添加
public bool AddCard()
{
if (!Check())
return false;
Card c = GetCard();
if (c.id <= 0)//卡片密码不能小于等于0
{
MyMsg.Error(LMSG.CodeCanNotIsZero);
return false;
}
foreach (Card ckey in cardlist)//卡片id存在
{
if (c.id == ckey.id)
{
MyMsg.Warning(LMSG.ItIsExists);
return false;
}
}
if (DataBase.Command(nowCdbFile, DataBase.GetInsertSQL(c, true)) >= 2)
{
MyMsg.Show(LMSG.AddSucceed);
undoString = DataBase.GetDeleteSQL(c);
Search(srcCard, true);
return true;
}
MyMsg.Error(LMSG.AddFail);
return false;
}
//修改
public bool ModCard()
{
if (!Check())
return false;
Card c = GetCard();
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
{
if (MyMsg.Question(LMSG.IfDeleteCard))//是否删除旧卡片
{
if (DataBase.Command(nowCdbFile, DataBase.GetDeleteSQL(oldCard)) < 2)
{
MyMsg.Error(LMSG.DeleteFail);
return false;
}
}
sql = DataBase.GetInsertSQL(c, false);
}
else
sql = DataBase.GetUpdateSQL(c);
if (DataBase.Command(nowCdbFile, sql) > 0)
{
MyMsg.Show(LMSG.ModifySucceed);
undoString = DataBase.GetDeleteSQL(c);
undoString += DataBase.GetInsertSQL(oldCard, false);
Search(srcCard, true);
SetCard(c);
}
else
MyMsg.Error(LMSG.ModifyFail);
return false;
}
//删除
public bool DelCards()
{
if (!Check())
return false;
int ic = lv_cardlist.SelectedItems.Count;
if (ic == 0)
return false;
if (!MyMsg.Question(LMSG.IfDeleteCard))
return false;
List<string> sql = new List<string>();
foreach (ListViewItem lvitem in lv_cardlist.SelectedItems)
{
int index = lvitem.Index + (page - 1) * MaxRow;
if (index < cardlist.Count)
{
Card c = cardlist[index];
undoString += DataBase.GetInsertSQL(c, true);
sql.Add(DataBase.GetDeleteSQL(c));
}
}
if (DataBase.Command(nowCdbFile, sql.ToArray()) >= (sql.Count * 2))
{
MyMsg.Show(LMSG.DeleteSucceed);
Search(srcCard, true);
return true;
}
else
{
MyMsg.Error(LMSG.DeleteFail);
Search(srcCard, true);
}
return false;
}
//打开脚本
public bool OpenScript()
{
if (!Check())
return false;
string lua = MyPath.Combine(LUAPTH, "c" + tb_cardcode.Text + ".lua");
if (!File.Exists(lua))
{
if (!Directory.Exists(LUAPTH))//创建脚本目录
Directory.CreateDirectory(LUAPTH);
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("--" + tb_cardname.Text);
sw.Close();
fs.Close();
}
}
}
if (File.Exists(lua))//如果存在,则打开文件
{
System.Diagnostics.Process.Start(lua);
}
return false;
}
//撤销
public void Undo()
{
if (string.IsNullOrEmpty(undoString))
{
return;
}
DataBase.Command(nowCdbFile, undoString);
Search(srcCard, true);
}
#endregion
#region 按钮
//搜索卡片
void Btn_serachClick(object sender, EventArgs e)
......@@ -858,42 +723,36 @@ void Btn_resetClick(object sender, EventArgs e)
//添加
void Btn_addClick(object sender, EventArgs e)
{
AddCard();
if(cardedit != null)
cardedit.AddCard();
}
//修改
void Btn_modClick(object sender, EventArgs e)
{
ModCard();
if (cardedit != null)
cardedit.ModCard(menuitem_operacardsfile.Checked);
}
//打开脚本
void Btn_luaClick(object sender, EventArgs e)
{
OpenScript();
if (cardedit != null)
cardedit.OpenScript(menuitem_openfileinthis.Checked);
}
//删除
void Btn_delClick(object sender, EventArgs e)
{
DelCards();
if (cardedit != null)
cardedit.DelCards(menuitem_operacardsfile.Checked);
}
void Btn_undoClick(object sender, EventArgs e)
{
Undo();
if (cardedit != null)
cardedit.Undo();
}
//导入卡图
void Btn_imgClick(object sender, EventArgs e)
{
string tid = tb_cardcode.Text;
if (tid == "0" || tid.Length == 0)
return;
using (OpenFileDialog dlg = new OpenFileDialog())
{
dlg.Title = LANG.GetMsg(LMSG.SelectImage) + "-" + tb_cardname.Text;
dlg.Filter = LANG.GetMsg(LMSG.ImageType);
if (dlg.ShowDialog() == DialogResult.OK)
{
//dlg.FileName;
ImportImage(dlg.FileName, tid);
}
}
ImportImageFromSelect();
}
#endregion
......@@ -1061,7 +920,7 @@ void Menuitem_newClick(object sender, EventArgs e)
//读取ydk
void Menuitem_readydkClick(object sender, EventArgs e)
{
if (!Check())
if (!CheckOpen())
return;
using (OpenFileDialog dlg = new OpenFileDialog())
{
......@@ -1080,7 +939,7 @@ void Menuitem_readydkClick(object sender, EventArgs e)
//从图片文件夹读取
void Menuitem_readimagesClick(object sender, EventArgs e)
{
if (!Check())
if (!CheckOpen())
return;
using (FolderBrowserDialog fdlg = new FolderBrowserDialog())
{
......@@ -1190,17 +1049,21 @@ void BgWorker1RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerC
#region 复制卡片
//得到卡片列表,是否是选中的
public Card[] getCardList(bool onlyselect)
public Card[] GetCardList(bool onlyselect)
{
if (!Check())
if (!CheckOpen())
return null;
List<Card> cards = new List<Card>();
if (onlyselect)
{
foreach (ListViewItem lvitem in lv_cardlist.SelectedItems)
{
int index = lvitem.Index + (page - 1) * MaxRow;
if (index < cardlist.Count)
int index;
if (lvitem.Tag != null)
index = (int)lvitem.Tag;
else
index = lvitem.Index + (page - 1) * MaxRow;
if (index>=0 && index < cardlist.Count)
cards.Add(cardlist[index]);
}
}
......@@ -1208,28 +1071,27 @@ public Card[] getCardList(bool onlyselect)
cards.AddRange(cardlist.ToArray());
if (cards.Count == 0)
{
MyMsg.Show(LMSG.NoSelectCard);
return null;
//MyMsg.Show(LMSG.NoSelectCard);
}
return cards.ToArray();
}
void Menuitem_copytoClick(object sender, EventArgs e)
{
if (!Check())
if (!CheckOpen())
return;
CopyTo(getCardList(false));
CopyTo(GetCardList(false));
}
void Menuitem_copyselecttoClick(object sender, EventArgs e)
{
if (!Check())
if (!CheckOpen())
return;
CopyTo(getCardList(true));
CopyTo(GetCardList(true));
}
//保存卡片到当前数据库
public void SaveCards(Card[] cards)
{
if (!Check())
if (!CheckOpen())
return;
if (cards == null || cards.Length == 0)
return;
......@@ -1264,35 +1126,37 @@ void CopyTo(Card[] cards)
}
#endregion
#region MSE存档
#region MSE存档/裁剪图片
//裁剪图片
void Menuitem_cutimagesClick(object sender, EventArgs e)
{
if (!Check())
if (!CheckOpen())
return;
if (isRun())
return;
bool isreplace = MyMsg.Question(LMSG.IfReplaceExistingImage);
tasker.SetTask(MyTask.CutImages, cardlist.ToArray(),
PICPATH, isreplace.ToString());
ygopath.picpath, isreplace.ToString());
Run(LANG.GetMsg(LMSG.CutImage));
}
void Menuitem_saveasmse_selectClick(object sender, EventArgs e)
{
//选择
SaveAsMSE(true);
}
void Menuitem_saveasmseClick(object sender, EventArgs e)
{
//全部
SaveAsMSE(false);
}
void SaveAsMSE(bool onlyselect)
{
if (!Check())
if (!CheckOpen())
return;
if (isRun())
return;
Card[] cards = getCardList(onlyselect);
Card[] cards = GetCardList(onlyselect);
if (cards == null)
return;
//select save mse-set
......@@ -1315,6 +1179,26 @@ void SaveAsMSE(bool onlyselect)
#endregion
#region 导入卡图
void ImportImageFromSelect()
{
string tid = tb_cardcode.Text;
if (tid == "0" || tid.Length == 0)
return;
using (OpenFileDialog dlg = new OpenFileDialog())
{
dlg.Title = LANG.GetMsg(LMSG.SelectImage) + "-" + tb_cardname.Text;
dlg.Filter = LANG.GetMsg(LMSG.ImageType);
if (dlg.ShowDialog() == DialogResult.OK)
{
//dlg.FileName;
ImportImage(dlg.FileName, tid);
}
}
}
private void pl_image_DoubleClick(object sender, EventArgs e)
{
ImportImageFromSelect();
}
void Pl_imageDragDrop(object sender, DragEventArgs e)
{
string[] files = e.Data.GetData(DataFormats.FileDrop) as string[];
......@@ -1333,14 +1217,14 @@ private void menuitem_importmseimg_Click(object sender, EventArgs e)
{
string tid = tb_cardcode.Text;
menuitem_importmseimg.Checked = !menuitem_importmseimg.Checked;
setImage(tid);
SetImage(tid);
}
void ImportImage(string file, string tid)
{
string f;
if (pl_image.BackgroundImage != null
&& pl_image.BackgroundImage != m_cover)
{
{//释放图片资源
pl_image.BackgroundImage.Dispose();
pl_image.BackgroundImage = m_cover;
}
......@@ -1353,36 +1237,34 @@ void ImportImage(string file, string tid)
}
else
{
f = MyPath.Combine(PICPATH, tid + ".jpg");
tasker.ToImg(file, f,
MyPath.Combine(PICPATH2, tid + ".jpg"));
tasker.ToImg(file, ygopath.GetImage(tid),
ygopath.GetImageThum(tid));
}
setImage(tid);
SetImage(tid);
}
void setImage(string id)
public void SetImage(string id)
{
long t;
long.TryParse(id, out t);
setImage(t);
SetImage(t);
}
void setImage(long id)
public void SetImage(long id)
{
if (pl_image.BackgroundImage != null
&& pl_image.BackgroundImage != m_cover)
{//释放资源占用
pl_image.BackgroundImage.Dispose();
Bitmap temp;
string pic = MyPath.Combine(PICPATH, id + ".jpg");
string pic2 = MyPath.Combine(tasker.MSEImagePath, id + ".jpg");
string pic3 = MyPath.Combine(tasker.MSEImagePath, new Card(id).idString + ".jpg");
if (menuitem_importmseimg.Checked && File.Exists(pic2))
{
temp = new Bitmap(pic2);
pl_image.BackgroundImage = temp;
}
else if (menuitem_importmseimg.Checked && File.Exists(pic3))
Bitmap temp;
string pic = ygopath.GetImage(id);
if (menuitem_importmseimg.Checked)//显示MSE图片
{
temp = new Bitmap(pic3);
pl_image.BackgroundImage = temp;
string msepic = MseMaker.GetCardImagePath(tasker.MSEImagePath, oldCard);
if(File.Exists(msepic))
{
temp = new Bitmap(msepic);
pl_image.BackgroundImage = temp;
}
}
else if (File.Exists(pic))
{
......@@ -1394,7 +1276,7 @@ void setImage(long id)
}
void Menuitem_convertimageClick(object sender, EventArgs e)
{
if (!Check())
if (!CheckOpen())
return;
if (isRun())
return;
......@@ -1405,7 +1287,7 @@ void Menuitem_convertimageClick(object sender, EventArgs e)
{
bool isreplace = MyMsg.Question(LMSG.IfReplaceExistingImage);
tasker.SetTask(MyTask.ConvertImages, null,
fdlg.SelectedPath, GAMEPATH, isreplace.ToString());
fdlg.SelectedPath, ygopath.gamepath, isreplace.ToString());
Run(LANG.GetMsg(LMSG.ConvertImage));
}
}
......@@ -1415,16 +1297,19 @@ void Menuitem_convertimageClick(object sender, EventArgs e)
#region 导出数据包
void Menuitem_exportdataClick(object sender, EventArgs e)
{
if (!Check())
if (!CheckOpen())
return;
if (isRun())
return;
using (SaveFileDialog dlg = new SaveFileDialog())
{
dlg.InitialDirectory = ygopath.gamepath;
dlg.Filter = "Zip|(*.zip|All Files(*.*)|*.*";
if (dlg.ShowDialog() == DialogResult.OK)
{
tasker.SetTask(MyTask.ExportData, getCardList(false), dlg.FileName);
tasker.SetTask(MyTask.ExportData,
GetCardList(false),
ygopath.gamepath, dlg.FileName);
Run(LANG.GetMsg(LMSG.ExportData));
}
}
......@@ -1436,9 +1321,6 @@ void Menuitem_exportdataClick(object sender, EventArgs e)
/// <summary>
/// 数据一致,返回true,不存在和数据不同,则返回false
/// </summary>
/// <param name="cards"></param>
/// <param name="card"></param>
/// <returns></returns>
bool CheckCard(Card[] cards, Card card, bool checkinfo)
{
foreach (Card c in cards)
......@@ -1458,13 +1340,13 @@ Card[] getCompCards()
{
if (tmpCodes.Count == 0)
return null;
if (!Check())
if (!CheckOpen())
return null;
return DataBase.Read(nowCdbFile, true, tmpCodes.ToArray());
}
public void CompareCards(string cdbfile, bool checktext)
{
if (!Check())
if (!CheckOpen())
return;
tmpCodes.Clear();
srcCard = new Card();
......@@ -1619,7 +1501,7 @@ private void cb_setname4_SelectedIndexChanged(object sender, EventArgs e)
#region 读取MSE存档
private void menuitem_readmse_Click(object sender, EventArgs e)
{
if (!Check())
if (!CheckOpen())
return;
if (isRun())
return;
......@@ -1639,13 +1521,30 @@ private void menuitem_readmse_Click(object sender, EventArgs e)
}
}
#endregion
#region 压缩数据库
private void menuitem_compdb_Click(object sender, EventArgs e)
{
if (!Check())
if (!CheckOpen())
return;
DataBase.Compression(nowCdbFile);
MyMsg.Show(LMSG.CompDBOK);
}
#endregion
#region 设置
//删除卡片的时候,是否要删除图片和脚本
private void menuitem_deletecardsfile_Click(object sender, EventArgs e)
{
menuitem_operacardsfile.Checked = !menuitem_operacardsfile.Checked;
MyConfig.Save(MyConfig.TAG_DELETE_WITH, menuitem_operacardsfile.Checked.ToString().ToLower());
}
//用CodeEditor打开lua
private void menuitem_openfileinthis_Click(object sender, EventArgs e)
{
menuitem_openfileinthis.Checked = !menuitem_openfileinthis.Checked;
MyConfig.Save(MyConfig.TAG_OPEN_IN_THIS, menuitem_openfileinthis.Checked.ToString().ToLower());
}
#endregion
}
}
......@@ -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
......
[DataEditorX]2.2.9.7[DataEditorX]
[DataEditorX]2.2.9.9[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★运行环境(Environment)
本程序基于.Net framework 2.0(3.5)开发
必备DLL:
System.Data.SQLite.dll 数据库操作
FastColoredTextBox.dll 脚本编辑
WeifenLuo.WinFormsUI.Docking.dll 多标签
winXP(需安装.Net2.0)
win7(自带.Net2.0)
win8(需要安装.Net3.5包含2.0)
★文件关联(File association)
.lua notepad++/sublime text/DataEditorX
.cdb DataEditorX
.cdb (必选)DataEditorX
.lua (可选)Notepad++/Sublime text/DataEditorX
方法:
右键文件,打开方式,浏览文件,选择,点击确定。
注意:
默认,lua是用本程序打开,如果需要修改,在★设置 open_file_in_this设为false
★bug反馈(Feedback)
Email:247321453@qq.com
提交版本前,请检查更新。
标题:(DataEditorX+版本号)
标题:DataEditorX X.X.X.X
内容:
错误提示文字:(弹出出错框,请按Ctrl+C,然后找地方粘贴)
详细描述:(卡片信息,杀毒软件,本程序目录等等)
详细描述:(卡片信息,杀毒软件,本程序目录,当时的详细操作等等)
★设置
DataEditorX.exe.config ★语言设置,★图片设置,★CodeEditor设置
data/language_xxx.txt 界面和消息提示文字
data/cardinfo_xxx.txt 种族,类型,系列名
★支持多语言化(Language setting)
★其他设置
async 后台加载数据(显示快)为true,直接加载数据为false
opera_with_cards_file 修改,删除卡片的同时,也会删除,修改,复制卡图和脚本。
open_file_in_this 用自带的脚本编辑器打开lua
★语言设置
DataEditorX.exe.config
<add key="language" value="chinese" />简体
<add key="language" value="english" />英文
其他语言请自己添加
其他语言请自己添加,需要2个文件,xxx为语言
data/language_xxx.txt
data/cardinfo_xxx.txt
★图片设置
在裁剪和导入图片时候使用。
image_quilty 保存的图片质量 1-100
image 游戏图片大小,小图宽,高,大图宽,高,共4个值
image_other 一般卡图裁剪
image_xyz xyz卡图裁剪
image_pendulum Pendulum卡图裁剪
★CodeEditor设置
IME 使用输入法
wordwrap 自动换行
tabisspace tab转换为space
fontname 字体名
fontsize 字体大小
★DataEditor:
攻击力为?,可以输入?,?,-2任意一个都可以。
文件夹pics和script和cdb所在文件夹一致。
卡片复制:
★修改卡片密码
删除,则是直接修改密码
不删除,就是复制一张新卡片
★从ydk和图片文件夹读取卡片列表
支持:密码,带0密码,卡名的png,jpg图片
★MSE存档
读取
存档结构:(要求:每张卡的内容,开头是card,最后一行是gamecode,在MSE的card_fields修改gamecode为最后的元素)
card:
...
gamecode: 123456
card:
....
gamecode: 123456
★MSE图片
支持:密码,带0密码,卡名的png,jpg图片
在“设置为MSE图片库”(“Set MSE'Image ”)的打勾时候,导入卡图都是放到MSE的图片文件夹
★导出数据
例如:mydiy.cdb
新卡:deck/mydiy.ydk
说明:mydiy.txt
脚本script
图片pics
生成mydiy.zip,可以放在音效版的expansions,直接使用,也可以用来发布。
★数据库对比
★Lua函数查找
从C++源码获取Lua函数
返回类型,参数类型,C++实现代码。
★卡片复制:
替换复制:如果存在卡片,就用最新的替换
不替换复制:如果存在卡片,就跳过
卡片搜索
卡片搜索
1.仅支持第一个系列名搜索,暂不支持P的刻度搜索
2.支持卡片名称,描述,规则,属性,等级,种族,卡片类型,效果类型,密码
2.支持卡片名称,效果描述,规则,属性,等级,种族,卡片类型,效果类型,密码
3.ATK,DEF搜索:
如果是0,则输入-1或者.搜索
如果是?,则输入-2或者?或者?搜索
......@@ -38,11 +113,21 @@ DataEditorX.exe.config
AOJ%% 以“AOJ”开头
流%%天 以“流”开头,“天”结尾
%%战士 以“战士”结尾
5.密码范围搜索示例:
--密码或同名卡为10000000,的卡片 卡片密码: 10000000 同名卡: 0
--同名卡为10000000的卡片 卡片密码: 0 同名卡: 10000000
--大于密码10000000,小于20000000的卡片 同名卡: 10000000 卡片密码: 20000000
★CodeEditor:
在下面的文本框输入关键字,按Enter
Ctrl+F 查找
Ctrl+H 替换
Ctrl+鼠标左键 跳转到函数定义
Ctrl+K 函数列表
Ctrl+T 常量列表
Ctrl+鼠标滑轮 缩放文字
★Magic Set Editor 2
下载/更新:"Magic Set Editor 2/download.bat"
或者
......@@ -72,252 +157,4 @@ replace = ([鮟|鱇|・|·]) <i>$1</i>
把空格替换为^,(占1/3字宽)
#replace = \s <sym-auto>^</sym-auto>
把A-Z替换为另外一种字体
#replace = ([A-Z]) <i>$1</i>
★lua编辑器
在下面的文本框输入关键字,按Enter
Ctrl+鼠标左键 跳转到函数定义
Ctrl+鼠标滑轮 缩放文字
★更新历史
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
#replace = ([A-Z]) <i>$1</i>
\ No newline at end of file

★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
......
[DataEditorX]2.2.9.7[DataEditorX]
[DataEditorX]2.2.9.9[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★运行环境(Environment)
本程序基于.Net framework 2.0(3.5)开发
必备DLL:
System.Data.SQLite.dll 数据库操作
FastColoredTextBox.dll 脚本编辑
WeifenLuo.WinFormsUI.Docking.dll 多标签
winXP(需安装.Net2.0)
win7(自带.Net2.0)
win8(需要安装.Net3.5包含2.0)
★文件关联(File association)
.lua notepad++/sublime text/DataEditorX
.cdb DataEditorX
.cdb (必选)DataEditorX
.lua (可选)Notepad++/Sublime text/DataEditorX
方法:
右键文件,打开方式,浏览文件,选择,点击确定。
注意:
默认,lua是用本程序打开,如果需要修改,在★设置 open_file_in_this设为false
★bug反馈(Feedback)
Email:247321453@qq.com
提交版本前,请检查更新。
标题:(DataEditorX+版本号)
标题:DataEditorX X.X.X.X
内容:
错误提示文字:(弹出出错框,请按Ctrl+C,然后找地方粘贴)
详细描述:(卡片信息,杀毒软件,本程序目录等等)
详细描述:(卡片信息,杀毒软件,本程序目录,当时的详细操作等等)
★设置
DataEditorX.exe.config ★语言设置,★图片设置,★CodeEditor设置
data/language_xxx.txt 界面和消息提示文字
data/cardinfo_xxx.txt 种族,类型,系列名
★支持多语言化(Language setting)
★其他设置
async 后台加载数据(显示快)为true,直接加载数据为false
opera_with_cards_file 修改,删除卡片的同时,也会删除,修改,复制卡图和脚本。
open_file_in_this 用自带的脚本编辑器打开lua
★语言设置
DataEditorX.exe.config
<add key="language" value="chinese" />简体
<add key="language" value="english" />英文
其他语言请自己添加
其他语言请自己添加,需要2个文件,xxx为语言
data/language_xxx.txt
data/cardinfo_xxx.txt
★图片设置
在裁剪和导入图片时候使用。
image_quilty 保存的图片质量 1-100
image 游戏图片大小,小图宽,高,大图宽,高,共4个值
image_other 一般卡图裁剪
image_xyz xyz卡图裁剪
image_pendulum Pendulum卡图裁剪
★CodeEditor设置
IME 使用输入法
wordwrap 自动换行
tabisspace tab转换为space
fontname 字体名
fontsize 字体大小
★DataEditor:
攻击力为?,可以输入?,?,-2任意一个都可以。
文件夹pics和script和cdb所在文件夹一致。
卡片复制:
★修改卡片密码
删除,则是直接修改密码
不删除,就是复制一张新卡片
★从ydk和图片文件夹读取卡片列表
支持:密码,带0密码,卡名的png,jpg图片
★MSE存档
读取
存档结构:(要求:每张卡的内容,开头是card,最后一行是gamecode,在MSE的card_fields修改gamecode为最后的元素)
card:
...
gamecode: 123456
card:
....
gamecode: 123456
★MSE图片
支持:密码,带0密码,卡名的png,jpg图片
在“设置为MSE图片库”(“Set MSE'Image ”)的打勾时候,导入卡图都是放到MSE的图片文件夹
★导出数据
例如:mydiy.cdb
新卡:deck/mydiy.ydk
说明:mydiy.txt
脚本script
图片pics
生成mydiy.zip,可以放在音效版的expansions,直接使用,也可以用来发布。
★数据库对比
★Lua函数查找
从C++源码获取Lua函数
返回类型,参数类型,C++实现代码。
★卡片复制:
替换复制:如果存在卡片,就用最新的替换
不替换复制:如果存在卡片,就跳过
卡片搜索
卡片搜索
1.仅支持第一个系列名搜索,暂不支持P的刻度搜索
2.支持卡片名称,描述,规则,属性,等级,种族,卡片类型,效果类型,密码
2.支持卡片名称,效果描述,规则,属性,等级,种族,卡片类型,效果类型,密码
3.ATK,DEF搜索:
如果是0,则输入-1或者.搜索
如果是?,则输入-2或者?或者?搜索
......@@ -38,11 +113,21 @@ DataEditorX.exe.config
AOJ%% 以“AOJ”开头
流%%天 以“流”开头,“天”结尾
%%战士 以“战士”结尾
5.密码范围搜索示例:
--密码或同名卡为10000000,的卡片 卡片密码: 10000000 同名卡: 0
--同名卡为10000000的卡片 卡片密码: 0 同名卡: 10000000
--大于密码10000000,小于20000000的卡片 同名卡: 10000000 卡片密码: 20000000
★CodeEditor:
在下面的文本框输入关键字,按Enter
Ctrl+F 查找
Ctrl+H 替换
Ctrl+鼠标左键 跳转到函数定义
Ctrl+K 函数列表
Ctrl+T 常量列表
Ctrl+鼠标滑轮 缩放文字
★Magic Set Editor 2
下载/更新:"Magic Set Editor 2/download.bat"
或者
......@@ -72,252 +157,4 @@ replace = ([鮟|鱇|・|·]) <i>$1</i>
把空格替换为^,(占1/3字宽)
#replace = \s <sym-auto>^</sym-auto>
把A-Z替换为另外一种字体
#replace = ([A-Z]) <i>$1</i>
★lua编辑器
在下面的文本框输入关键字,按Enter
Ctrl+鼠标左键 跳转到函数定义
Ctrl+鼠标滑轮 缩放文字
★更新历史
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
#replace = ([A-Z]) <i>$1</i>
\ No newline at end of file

★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